From 003fbacd32f93341423631762c402fef7ea538d6 Mon Sep 17 00:00:00 2001 From: Harvey Kandola Date: Wed, 5 Oct 2016 15:44:44 -0700 Subject: [PATCH 01/20] new doc sidebar add section -- initial commit --- app/.jshintrc | 3 +- .../document/document-sidebar-toc.js | 26 +- .../components/document/document-sidebar.js | 47 +- .../components/document/document-toolbar.js | 3 +- app/app/components/document/document-view.js | 2 +- app/app/components/document/page-wizard.js | 15 +- app/app/pods/document/index/controller.js | 58 +- app/app/pods/document/index/template.hbs | 4 +- app/app/styles/color.scss | 32 +- app/app/styles/functions.scss | 29 + app/app/styles/view/document/sidebar.scss | 28 +- app/app/styles/view/document/wizard.scss | 44 +- .../components/document/document-sidebar.hbs | 9 + .../components/document/document-toolbar.hbs | 7 - .../components/document/page-wizard.hbs | 14 +- app/ember-cli-build.js | 4 +- app/vendor/hoverIntent.js | 158 +++ app/vendor/waypoints.js | 939 ++++++++++++++++++ core/product.go | 2 +- core/section/code/code.go | 2 +- core/section/gemini/gemini.go | 4 +- core/section/markdown/markdown.go | 2 +- core/section/table/table.go | 2 +- core/section/wysiwyg/wysiwyg.go | 2 +- 24 files changed, 1323 insertions(+), 113 deletions(-) create mode 100755 app/vendor/hoverIntent.js create mode 100644 app/vendor/waypoints.js diff --git a/app/.jshintrc b/app/.jshintrc index 767b6edf1..cee569be4 100644 --- a/app/.jshintrc +++ b/app/.jshintrc @@ -18,7 +18,8 @@ "Drop", "Dropzone", "dragula", - "datetimepicker" + "datetimepicker", + "Waypoint" ], "browser": true, "boss": true, diff --git a/app/app/components/document/document-sidebar-toc.js b/app/app/components/document/document-sidebar-toc.js index 3cc285b06..8151cd598 100644 --- a/app/app/components/document/document-sidebar-toc.js +++ b/app/app/components/document/document-sidebar-toc.js @@ -46,19 +46,19 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, { didInsertElement() { this.eventBus.subscribe('documentPageAdded', this, 'onDocumentPageAdded'); - var s = $(".document-structure"); - var pos = s.position(); - - $(window).scroll(function() { - var windowpos = $(window).scrollTop(); - if (windowpos - 200 >= pos.top) { - s.addClass("stick"); - s.css('width', s.parent().width()); - } else { - s.removeClass("stick"); - s.css('width', 'auto'); - } - }); + // let s = $(".document-structure"); + // let pos = s.position(); + // + // $(window).scroll(_.throttle(function() { + // let windowpos = $(window).scrollTop(); + // if (windowpos - 200 >= pos.top) { + // s.addClass("stuck-toc"); + // s.css('width', s.parent().width()); + // } else { + // s.removeClass("stuck-toc"); + // s.css('width', 'auto'); + // } + // }, 50)); }, willDestroyElement() { diff --git a/app/app/components/document/document-sidebar.js b/app/app/components/document/document-sidebar.js index 0c1107b19..3deaee270 100644 --- a/app/app/components/document/document-sidebar.js +++ b/app/app/components/document/document-sidebar.js @@ -11,23 +11,41 @@ import Ember from 'ember'; import TooltipMixin from '../../mixins/tooltip'; +import NotifierMixin from '../../mixins/notifier'; -export default Ember.Component.extend(TooltipMixin, { +export default Ember.Component.extend(TooltipMixin, NotifierMixin, { documentService: Ember.inject.service('document'), document: {}, folder: {}, showToc: true, showViews: false, showContributions: false, + showSections: false, didRender() { if (this.session.authenticated) { this.addTooltip(document.getElementById("owner-avatar")); + this.addTooltip(document.getElementById("section-tool")); } }, - willDestroyElements() { - this.destroyElements(); + didInsertElement() { + let s = $(".section-tool"); + let pos = s.position(); + + $(window).scroll(_.throttle(function() { + let windowpos = $(window).scrollTop(); + if (windowpos - 200 >= pos.top) { + s.addClass("stuck-tool"); + s.css('left', parseInt($(".zone-sidebar").css('width')) - 18 + 'px'); + } else { + s.removeClass("stuck-tool"); + } + }, 50)); + }, + + willDestroyElement() { + this.destroyTooltips(); }, actions: { @@ -45,27 +63,40 @@ export default Ember.Component.extend(TooltipMixin, { return this.attrs.gotoPage(id); }, - // close dialog - close() { - return true; - }, - showToc() { this.set('showToc', true); this.set('showViews', false); this.set('showContributions', false); + this.set('showSections', false); }, showViews() { this.set('showToc', false); this.set('showViews', true); this.set('showContributions', false); + this.set('showSections', false); }, showContributions() { this.set('showToc', false); this.set('showViews', false); this.set('showContributions', true); + this.set('showSections', false); + }, + + showSections() { + this.set('showToc', false); + this.set('showViews', false); + this.set('showContributions', false); + this.set('showSections', true); + }, + + onCancel() { + this.send('showToc'); + }, + + onAddSection(section) { + this.attrs.onAddSection(section); } } }); diff --git a/app/app/components/document/document-toolbar.js b/app/app/components/document/document-toolbar.js index 1fec9d383..4f19a868b 100644 --- a/app/app/components/document/document-toolbar.js +++ b/app/app/components/document/document-toolbar.js @@ -35,7 +35,6 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, { this.addTooltip(document.getElementById("save-template-button")); this.addTooltip(document.getElementById("set-meta-button")); this.addTooltip(document.getElementById("delete-document-button")); - this.addTooltip(document.getElementById("add-section-button")); } this.addTooltip(document.getElementById("print-document-button")); @@ -139,4 +138,4 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, { return true; }, } -}); \ No newline at end of file +}); diff --git a/app/app/components/document/document-view.js b/app/app/components/document/document-view.js index ed539429b..5efb80c9d 100644 --- a/app/app/components/document/document-view.js +++ b/app/app/components/document/document-view.js @@ -133,4 +133,4 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, { this.get('documentService').save(doc); } } -}); \ No newline at end of file +}); diff --git a/app/app/components/document/page-wizard.js b/app/app/components/document/page-wizard.js index 493a49e3b..36d6477f1 100644 --- a/app/app/components/document/page-wizard.js +++ b/app/app/components/document/page-wizard.js @@ -13,9 +13,18 @@ import Ember from 'ember'; import NotifierMixin from '../../mixins/notifier'; export default Ember.Component.extend(NotifierMixin, { + sectionService: Ember.inject.service('section'), + + didReceiveAttrs() { + let self = this; + this.get('sectionService').getAll().then(function(sections) { + self.set('sections', sections); + }); + }, didRender() { let self = this; + Mousetrap.bind('esc', function() { self.send('onCancel'); return false; @@ -28,12 +37,6 @@ export default Ember.Component.extend(NotifierMixin, { }, addSection(section) { - - if (section.preview) { - this.showNotification("Coming soon!"); - return; - } - this.attrs.onAction(section); } } diff --git a/app/app/pods/document/index/controller.js b/app/app/pods/document/index/controller.js index d73cbf8a6..239bcb9bb 100644 --- a/app/app/pods/document/index/controller.js +++ b/app/app/pods/document/index/controller.js @@ -193,18 +193,58 @@ export default Ember.Controller.extend(NotifierMixin, { }); }, - onAddPage(page) { - let self = this; - - this.get('documentService').addPage(this.get('model.id'), page).then(function (newPage) { - self.transitionToRoute('document.edit', - self.get('folder.id'), - self.get('folder.slug'), - self.get('model.id'), - self.get('model.slug'), + onAddSection(section) { + this.audit.record("added-section"); + this.audit.record("added-section-" + section.get('contentType')); + + let page = { + documentId: this.get('model.id'), + title: `${section.get('title')} Section`, + level: 1, + sequence: 2048, + body: "", + contentType: section.get('contentType') + }; + + let data = this.get('store').normalize('page', page); + let pageData = this.get('store').push(data); + + let meta = { + documentId: this.get('model.id'), + rawBody: "", + config: "" + }; + + let pageMeta = this.get('store').normalize('page-meta', meta); + let pageMetaData = this.get('store').push(pageMeta); + + let model = { + page: pageData, + meta: pageMetaData + }; + + this.get('documentService').addPage(this.get('model.id'), model).then((newPage) => { + this.transitionToRoute('document.edit', + this.get('folder.id'), + this.get('folder.slug'), + this.get('model.id'), + this.get('model.slug'), newPage.id); }); }, + // + // onAddPage(page) { + // let self = this; + // + // this.get('documentService').addPage(this.get('model.id'), page).then(function (newPage) { + // self.transitionToRoute('document.edit', + // self.get('folder.id'), + // self.get('folder.slug'), + // self.get('model.id'), + // self.get('model.slug'), + // newPage.id); + // }); + // }, onDocumentDelete() { let self = this; diff --git a/app/app/pods/document/index/template.hbs b/app/app/pods/document/index/template.hbs index a9fd74eed..dea165e91 100644 --- a/app/app/pods/document/index/template.hbs +++ b/app/app/pods/document/index/template.hbs @@ -3,7 +3,7 @@ {{layout/zone-navigation}} {{#layout/zone-header title=model.name message=model.excerpt}} - {{document/document-toolbar document=model pages=pages folder=folder owner=owner + {{document/document-toolbar document=model pages=pages folder=folder owner=owner isEditor=isEditor users=users onSaveTemplate=(action 'onSaveTemplate') onDocumentChange=(action 'onDocumentChange') @@ -13,7 +13,7 @@ {{#layout/zone-sidebar}} {{document/document-sidebar document=model meta=meta folder=folder pages=pages page=page owner=owner isEditor=isEditor - onAddPage=(action 'onAddPage') + onAddSection=(action 'onAddSection') changePageSequence=(action 'onPageSequenceChange') changePageLevel=(action 'onPageLevelChange') gotoPage=(action 'gotoPage')}} diff --git a/app/app/styles/color.scss b/app/app/styles/color.scss index a444b4c4e..d63354bbb 100644 --- a/app/app/styles/color.scss +++ b/app/app/styles/color.scss @@ -37,39 +37,39 @@ $color-chip: #dff0f9; $color-chip-border: #daeaf3; $color-chip-text: #1b88e3; -.background-color-white { - background-color: $color-white; -} .color-white { - color: $color-white; + color: $color-white !important; } .color-off-white { - color: $color-off-white; + color: $color-off-white !important; } .color-black { - color: $color-black; + color: $color-black !important; } .color-off-black { - color: $color-off-black; -} -.background-color-primary { - background-color: $color-primary; + color: $color-off-black !important; } .color-primary { - color: $color-primary; + color: $color-primary !important; } .color-link { - color: $color-link; + color: $color-link !important; } .color-blue { - color: $color-blue; + color: $color-blue !important; } .color-red { - color: $color-red; + color: $color-red !important; } .color-green { - color: $color-green; + color: $color-green !important; } .color-gray { - color: $color-gray; + color: $color-gray !important; +} +.background-color-white { + background-color: $color-white !important; +} +.background-color-primary { + background-color: $color-primary !important; } diff --git a/app/app/styles/functions.scss b/app/app/styles/functions.scss index 5282693a4..1f06bdc39 100644 --- a/app/app/styles/functions.scss +++ b/app/app/styles/functions.scss @@ -137,3 +137,32 @@ $opacity-ie: $opacity * 100; filter: alpha(opacity=$opacity-ie); //IE8 } + +@keyframes fadein { + from { opacity: 0; } + to { opacity: 1; } +} + +/* Firefox < 16 */ +@-moz-keyframes fadein { + from { opacity: 0; } + to { opacity: 1; } +} + +/* Safari, Chrome and Opera > 12.1 */ +@-webkit-keyframes fadein { + from { opacity: 0; } + to { opacity: 1; } +} + +/* Internet Explorer */ +@-ms-keyframes fadein { + from { opacity: 0; } + to { opacity: 1; } +} + +/* Opera < 12.1 */ +@-o-keyframes fadein { + from { opacity: 0; } + to { opacity: 1; } +} diff --git a/app/app/styles/view/document/sidebar.scss b/app/app/styles/view/document/sidebar.scss index 5b967c883..7c3bf30e9 100644 --- a/app/app/styles/view/document/sidebar.scss +++ b/app/app/styles/view/document/sidebar.scss @@ -46,9 +46,33 @@ } } - .stick { + .stuck-toc { position: fixed; - top: 10px; + top: 20px; + -webkit-animation: fadein 1s; /* Safari, Chrome and Opera > 12.1 */ + -moz-animation: fadein 1s; /* Firefox < 16 */ + -ms-animation: fadein 1s; /* Internet Explorer */ + -o-animation: fadein 1s; /* Opera < 12.1 */ + animation: fadein 1s; + } + + .section-tool { + position: absolute; + top: 150px; + right: -18px; + z-index: 999; + } + + .stuck-tool { + position: fixed !important; + top: 150px !important; + right: 0; + left: 0; + -webkit-animation: fadein 1s; /* Safari, Chrome and Opera > 12.1 */ + -moz-animation: fadein 1s; /* Firefox < 16 */ + -ms-animation: fadein 1s; /* Internet Explorer */ + -o-animation: fadein 1s; /* Opera < 12.1 */ + animation: fadein 1s; } .close-action { diff --git a/app/app/styles/view/document/wizard.scss b/app/app/styles/view/document/wizard.scss index cd7d777df..d6678429b 100644 --- a/app/app/styles/view/document/wizard.scss +++ b/app/app/styles/view/document/wizard.scss @@ -1,9 +1,8 @@ .section-wizard { - margin: 30px; + margin: 20px 0 30px 0; > .canvas { padding: 0; - margin: 30px 0; > .list { margin: 0; @@ -11,28 +10,33 @@ > .item { list-style: none; - float: left; cursor: pointer; - width: 400px; - height: 80px; - background-color: $color-white; - border: 1px solid $color-border; - border-radius: 3px; - margin: 0 30px 30px 0; + padding: 10px 5px; + margin: 5px 0; &:hover { - background-color: $color-card-active; - border: 1px solid $color-border; - transition: 0.2s all ease; + @include ease-in(); + + > .details { + > .title { + color: $color-primary; + } + + > .desc { + color: $color-primary; + } + } } .icon { text-align: center; display: inline-block; + padding-right: 20px; + width: 50px; > .img { + float: left; text-align: center; - margin: 17px 10px 0 20px; display: inline-block; height: 45px; width: 45px; @@ -42,30 +46,20 @@ > .details { vertical-align: top; display: inline-block; + float: left; + width: 80%; > .title { font-size: 1rem; font-weight: bold; color: $color-off-black; - margin-top: 18px; letter-spacing: 0.5px; - - .preview { - font-size: 0.7rem; - color: $color-goldy; - display: inline-block; - margin-left: 10px; - } } > .desc { color: $color-gray; font-size: 0.8rem; margin-top: 5px; - max-width: 300px; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; } } } diff --git a/app/app/templates/components/document/document-sidebar.hbs b/app/app/templates/components/document/document-sidebar.hbs index 24c0499d6..2c66c26bd 100644 --- a/app/app/templates/components/document/document-sidebar.hbs +++ b/app/app/templates/components/document/document-sidebar.hbs @@ -28,6 +28,12 @@
{{/if}} + {{#if isEditor}} +
+ add +
+ {{/if}} + {{#if showToc}} {{document/document-sidebar-toc document=model folder=folder pages=pages page=page isEditor=isEditor changePageSequence=(action 'onPageSequenceChange') changePageLevel=(action 'onPageLevelChange') @@ -39,4 +45,7 @@ {{#if showContributions}} {{document/document-sidebar-edits pages=pages meta=meta}} {{/if}} + {{#if showSections}} + {{document/page-wizard document=document folder=folder onCancel=(action 'onCancel') onAction=(action 'onAddSection')}} + {{/if}}
diff --git a/app/app/templates/components/document/document-toolbar.hbs b/app/app/templates/components/document/document-toolbar.hbs index 7e36a401f..00a0ef50e 100644 --- a/app/app/templates/components/document/document-toolbar.hbs +++ b/app/app/templates/components/document/document-toolbar.hbs @@ -31,13 +31,6 @@
delete
-
- {{#link-to 'document.wizard' folder.id folder.slug document.id document.slug}} -
- add -
section
-
- {{/link-to}} {{/if}} {{#if isEditor}} diff --git a/app/app/templates/components/document/page-wizard.hbs b/app/app/templates/components/document/page-wizard.hbs index ac0b6ec02..7174fb3b9 100644 --- a/app/app/templates/components/document/page-wizard.hbs +++ b/app/app/templates/components/document/page-wizard.hbs @@ -1,8 +1,4 @@
-
-
Cancel
-
-
    {{#each sections as |section|}} @@ -19,17 +15,9 @@
{{section.description}}
+
{{/each}} -
  • -
    - {{section.title}} -
    -
    -
    Suggest
    -
    We'll build the integrations you need - just let us know
    -
    -
  • diff --git a/app/ember-cli-build.js b/app/ember-cli-build.js index 9503e45a2..9ff276cca 100644 --- a/app/ember-cli-build.js +++ b/app/ember-cli-build.js @@ -55,6 +55,8 @@ module.exports = function(defaults) { app.import('vendor/markdown-it.min.js'); app.import('vendor/dragula.js'); app.import('vendor/datetimepicker.min.js'); + app.import('vendor/hoverIntent.js'); + app.import('vendor/waypoints.js'); return app.toTree(); -}; \ No newline at end of file +}; diff --git a/app/vendor/hoverIntent.js b/app/vendor/hoverIntent.js new file mode 100755 index 000000000..62a29ce4f --- /dev/null +++ b/app/vendor/hoverIntent.js @@ -0,0 +1,158 @@ +/*! + * hoverIntent v1.8.1 // 2014.08.11 // jQuery v1.9.1+ + * http://briancherne.github.io/jquery-hoverIntent/ + * + * You may use hoverIntent under the terms of the MIT license. Basically that + * means you are free to use hoverIntent as long as this header is left intact. + * Copyright 2007, 2014 Brian Cherne + */ + +/* hoverIntent is similar to jQuery's built-in "hover" method except that + * instead of firing the handlerIn function immediately, hoverIntent checks + * to see if the user's mouse has slowed down (beneath the sensitivity + * threshold) before firing the event. The handlerOut function is only + * called after a matching handlerIn. + * + * // basic usage ... just like .hover() + * .hoverIntent( handlerIn, handlerOut ) + * .hoverIntent( handlerInOut ) + * + * // basic usage ... with event delegation! + * .hoverIntent( handlerIn, handlerOut, selector ) + * .hoverIntent( handlerInOut, selector ) + * + * // using a basic configuration object + * .hoverIntent( config ) + * + * @param handlerIn function OR configuration object + * @param handlerOut function OR selector for delegation OR undefined + * @param selector selector OR undefined + * @author Brian Cherne + */ + +(function(factory) { + 'use strict'; + if (typeof define === 'function' && define.amd) { + define(['jquery'], factory); + } else if (jQuery && !jQuery.fn.hoverIntent) { + factory(jQuery); + } +})(function($) { + 'use strict'; + + // default configuration values + var _cfg = { + interval: 100, + sensitivity: 6, + timeout: 0 + }; + + // counter used to generate an ID for each instance + var INSTANCE_COUNT = 0; + + // current X and Y position of mouse, updated during mousemove tracking (shared across instances) + var cX, cY; + + // saves the current pointer position coordinates based on the given mousemove event + var track = function(ev) { + cX = ev.pageX; + cY = ev.pageY; + }; + + // compares current and previous mouse positions + var compare = function(ev,$el,s,cfg) { + // compare mouse positions to see if pointer has slowed enough to trigger `over` function + if ( Math.sqrt( (s.pX-cX)*(s.pX-cX) + (s.pY-cY)*(s.pY-cY) ) < cfg.sensitivity ) { + $el.off(s.event,track); + delete s.timeoutId; + // set hoverIntent state as active for this element (permits `out` handler to trigger) + s.isActive = true; + // overwrite old mouseenter event coordinates with most recent pointer position + ev.pageX = cX; ev.pageY = cY; + // clear coordinate data from state object + delete s.pX; delete s.pY; + return cfg.over.apply($el[0],[ev]); + } else { + // set previous coordinates for next comparison + s.pX = cX; s.pY = cY; + // use self-calling timeout, guarantees intervals are spaced out properly (avoids JavaScript timer bugs) + s.timeoutId = setTimeout( function(){compare(ev, $el, s, cfg);} , cfg.interval ); + } + }; + + // triggers given `out` function at configured `timeout` after a mouseleave and clears state + var delay = function(ev,$el,s,out) { + delete $el.data('hoverIntent')[s.id]; + return out.apply($el[0],[ev]); + }; + + $.fn.hoverIntent = function(handlerIn,handlerOut,selector) { + // instance ID, used as a key to store and retrieve state information on an element + var instanceId = INSTANCE_COUNT++; + + // extend the default configuration and parse parameters + var cfg = $.extend({}, _cfg); + if ( $.isPlainObject(handlerIn) ) { + cfg = $.extend(cfg, handlerIn); + if ( !$.isFunction(cfg.out) ) { + cfg.out = cfg.over; + } + } else if ( $.isFunction(handlerOut) ) { + cfg = $.extend(cfg, { over: handlerIn, out: handlerOut, selector: selector } ); + } else { + cfg = $.extend(cfg, { over: handlerIn, out: handlerIn, selector: handlerOut } ); + } + + // A private function for handling mouse 'hovering' + var handleHover = function(e) { + // cloned event to pass to handlers (copy required for event object to be passed in IE) + var ev = $.extend({},e); + + // the current target of the mouse event, wrapped in a jQuery object + var $el = $(this); + + // read hoverIntent data from element (or initialize if not present) + var hoverIntentData = $el.data('hoverIntent'); + if (!hoverIntentData) { $el.data('hoverIntent', (hoverIntentData = {})); } + + // read per-instance state from element (or initialize if not present) + var state = hoverIntentData[instanceId]; + if (!state) { hoverIntentData[instanceId] = state = { id: instanceId }; } + + // state properties: + // id = instance ID, used to clean up data + // timeoutId = timeout ID, reused for tracking mouse position and delaying "out" handler + // isActive = plugin state, true after `over` is called just until `out` is called + // pX, pY = previously-measured pointer coordinates, updated at each polling interval + // event = string representing the namespaced event used for mouse tracking + + // clear any existing timeout + if (state.timeoutId) { state.timeoutId = clearTimeout(state.timeoutId); } + + // namespaced event used to register and unregister mousemove tracking + var mousemove = state.event = 'mousemove.hoverIntent.hoverIntent'+instanceId; + + // handle the event, based on its type + if (e.type === 'mouseenter') { + // do nothing if already active + if (state.isActive) { return; } + // set "previous" X and Y position based on initial entry point + state.pX = ev.pageX; state.pY = ev.pageY; + // update "current" X and Y position based on mousemove + $el.off(mousemove,track).on(mousemove,track); + // start polling interval (self-calling timeout) to compare mouse coordinates over time + state.timeoutId = setTimeout( function(){compare(ev,$el,state,cfg);} , cfg.interval ); + } else { // "mouseleave" + // do nothing if not already active + if (!state.isActive) { return; } + // unbind expensive mousemove event + $el.off(mousemove,track); + // if hoverIntent state is true, then call the mouseOut function after the specified delay + state.timeoutId = setTimeout( function(){delay(ev,$el,state,cfg.out);} , cfg.timeout ); + } + }; + + // listen for mouseenter and mouseleave + return this.on({'mouseenter.hoverIntent':handleHover,'mouseleave.hoverIntent':handleHover}, cfg.selector); + }; +}); diff --git a/app/vendor/waypoints.js b/app/vendor/waypoints.js new file mode 100644 index 000000000..ae3d60f5f --- /dev/null +++ b/app/vendor/waypoints.js @@ -0,0 +1,939 @@ +/*! +Waypoints - 4.0.1 +Copyright © 2011-2016 Caleb Troughton +Licensed under the MIT license. +https://github.com/imakewebthings/waypoints/blob/master/licenses.txt +*/ +(function() { + 'use strict' + + var keyCounter = 0 + var allWaypoints = {} + + /* http://imakewebthings.com/waypoints/api/waypoint */ + function Waypoint(options) { + if (!options) { + throw new Error('No options passed to Waypoint constructor') + } + if (!options.element) { + throw new Error('No element option passed to Waypoint constructor') + } + if (!options.handler) { + throw new Error('No handler option passed to Waypoint constructor') + } + + this.key = 'waypoint-' + keyCounter + this.options = Waypoint.Adapter.extend({}, Waypoint.defaults, options) + this.element = this.options.element + this.adapter = new Waypoint.Adapter(this.element) + this.callback = options.handler + this.axis = this.options.horizontal ? 'horizontal' : 'vertical' + this.enabled = this.options.enabled + this.triggerPoint = null + this.group = Waypoint.Group.findOrCreate({ + name: this.options.group, + axis: this.axis + }) + this.context = Waypoint.Context.findOrCreateByElement(this.options.context) + + if (Waypoint.offsetAliases[this.options.offset]) { + this.options.offset = Waypoint.offsetAliases[this.options.offset] + } + this.group.add(this) + this.context.add(this) + allWaypoints[this.key] = this + keyCounter += 1 + } + + /* Private */ + Waypoint.prototype.queueTrigger = function(direction) { + this.group.queueTrigger(this, direction) + } + + /* Private */ + Waypoint.prototype.trigger = function(args) { + if (!this.enabled) { + return + } + if (this.callback) { + this.callback.apply(this, args) + } + } + + /* Public */ + /* http://imakewebthings.com/waypoints/api/destroy */ + Waypoint.prototype.destroy = function() { + this.context.remove(this) + this.group.remove(this) + delete allWaypoints[this.key] + } + + /* Public */ + /* http://imakewebthings.com/waypoints/api/disable */ + Waypoint.prototype.disable = function() { + this.enabled = false + return this + } + + /* Public */ + /* http://imakewebthings.com/waypoints/api/enable */ + Waypoint.prototype.enable = function() { + this.context.refresh() + this.enabled = true + return this + } + + /* Public */ + /* http://imakewebthings.com/waypoints/api/next */ + Waypoint.prototype.next = function() { + return this.group.next(this) + } + + /* Public */ + /* http://imakewebthings.com/waypoints/api/previous */ + Waypoint.prototype.previous = function() { + return this.group.previous(this) + } + + /* Private */ + Waypoint.invokeAll = function(method) { + var allWaypointsArray = [] + for (var waypointKey in allWaypoints) { + allWaypointsArray.push(allWaypoints[waypointKey]) + } + for (var i = 0, end = allWaypointsArray.length; i < end; i++) { + allWaypointsArray[i][method]() + } + } + + /* Public */ + /* http://imakewebthings.com/waypoints/api/destroy-all */ + Waypoint.destroyAll = function() { + Waypoint.invokeAll('destroy') + } + + /* Public */ + /* http://imakewebthings.com/waypoints/api/disable-all */ + Waypoint.disableAll = function() { + Waypoint.invokeAll('disable') + } + + /* Public */ + /* http://imakewebthings.com/waypoints/api/enable-all */ + Waypoint.enableAll = function() { + Waypoint.Context.refreshAll() + for (var waypointKey in allWaypoints) { + allWaypoints[waypointKey].enabled = true + } + return this + } + + /* Public */ + /* http://imakewebthings.com/waypoints/api/refresh-all */ + Waypoint.refreshAll = function() { + Waypoint.Context.refreshAll() + } + + /* Public */ + /* http://imakewebthings.com/waypoints/api/viewport-height */ + Waypoint.viewportHeight = function() { + return window.innerHeight || document.documentElement.clientHeight + } + + /* Public */ + /* http://imakewebthings.com/waypoints/api/viewport-width */ + Waypoint.viewportWidth = function() { + return document.documentElement.clientWidth + } + + Waypoint.adapters = [] + + Waypoint.defaults = { + context: window, + continuous: true, + enabled: true, + group: 'default', + horizontal: false, + offset: 0 + } + + Waypoint.offsetAliases = { + 'bottom-in-view': function() { + return this.context.innerHeight() - this.adapter.outerHeight() + }, + 'right-in-view': function() { + return this.context.innerWidth() - this.adapter.outerWidth() + } + } + + window.Waypoint = Waypoint +}()) +;(function() { + 'use strict' + + function requestAnimationFrameShim(callback) { + window.setTimeout(callback, 1000 / 60) + } + + var keyCounter = 0 + var contexts = {} + var Waypoint = window.Waypoint + var oldWindowLoad = window.onload + + /* http://imakewebthings.com/waypoints/api/context */ + function Context(element) { + this.element = element + this.Adapter = Waypoint.Adapter + this.adapter = new this.Adapter(element) + this.key = 'waypoint-context-' + keyCounter + this.didScroll = false + this.didResize = false + this.oldScroll = { + x: this.adapter.scrollLeft(), + y: this.adapter.scrollTop() + } + this.waypoints = { + vertical: {}, + horizontal: {} + } + + element.waypointContextKey = this.key + contexts[element.waypointContextKey] = this + keyCounter += 1 + if (!Waypoint.windowContext) { + Waypoint.windowContext = true + Waypoint.windowContext = new Context(window) + } + + this.createThrottledScrollHandler() + this.createThrottledResizeHandler() + } + + /* Private */ + Context.prototype.add = function(waypoint) { + var axis = waypoint.options.horizontal ? 'horizontal' : 'vertical' + this.waypoints[axis][waypoint.key] = waypoint + this.refresh() + } + + /* Private */ + Context.prototype.checkEmpty = function() { + var horizontalEmpty = this.Adapter.isEmptyObject(this.waypoints.horizontal) + var verticalEmpty = this.Adapter.isEmptyObject(this.waypoints.vertical) + var isWindow = this.element == this.element.window + if (horizontalEmpty && verticalEmpty && !isWindow) { + this.adapter.off('.waypoints') + delete contexts[this.key] + } + } + + /* Private */ + Context.prototype.createThrottledResizeHandler = function() { + var self = this + + function resizeHandler() { + self.handleResize() + self.didResize = false + } + + this.adapter.on('resize.waypoints', function() { + if (!self.didResize) { + self.didResize = true + Waypoint.requestAnimationFrame(resizeHandler) + } + }) + } + + /* Private */ + Context.prototype.createThrottledScrollHandler = function() { + var self = this + function scrollHandler() { + self.handleScroll() + self.didScroll = false + } + + this.adapter.on('scroll.waypoints', function() { + if (!self.didScroll || Waypoint.isTouch) { + self.didScroll = true + Waypoint.requestAnimationFrame(scrollHandler) + } + }) + } + + /* Private */ + Context.prototype.handleResize = function() { + Waypoint.Context.refreshAll() + } + + /* Private */ + Context.prototype.handleScroll = function() { + var triggeredGroups = {} + var axes = { + horizontal: { + newScroll: this.adapter.scrollLeft(), + oldScroll: this.oldScroll.x, + forward: 'right', + backward: 'left' + }, + vertical: { + newScroll: this.adapter.scrollTop(), + oldScroll: this.oldScroll.y, + forward: 'down', + backward: 'up' + } + } + + for (var axisKey in axes) { + var axis = axes[axisKey] + var isForward = axis.newScroll > axis.oldScroll + var direction = isForward ? axis.forward : axis.backward + + for (var waypointKey in this.waypoints[axisKey]) { + var waypoint = this.waypoints[axisKey][waypointKey] + if (waypoint.triggerPoint === null) { + continue + } + var wasBeforeTriggerPoint = axis.oldScroll < waypoint.triggerPoint + var nowAfterTriggerPoint = axis.newScroll >= waypoint.triggerPoint + var crossedForward = wasBeforeTriggerPoint && nowAfterTriggerPoint + var crossedBackward = !wasBeforeTriggerPoint && !nowAfterTriggerPoint + if (crossedForward || crossedBackward) { + waypoint.queueTrigger(direction) + triggeredGroups[waypoint.group.id] = waypoint.group + } + } + } + + for (var groupKey in triggeredGroups) { + triggeredGroups[groupKey].flushTriggers() + } + + this.oldScroll = { + x: axes.horizontal.newScroll, + y: axes.vertical.newScroll + } + } + + /* Private */ + Context.prototype.innerHeight = function() { + /*eslint-disable eqeqeq */ + if (this.element == this.element.window) { + return Waypoint.viewportHeight() + } + /*eslint-enable eqeqeq */ + return this.adapter.innerHeight() + } + + /* Private */ + Context.prototype.remove = function(waypoint) { + delete this.waypoints[waypoint.axis][waypoint.key] + this.checkEmpty() + } + + /* Private */ + Context.prototype.innerWidth = function() { + /*eslint-disable eqeqeq */ + if (this.element == this.element.window) { + return Waypoint.viewportWidth() + } + /*eslint-enable eqeqeq */ + return this.adapter.innerWidth() + } + + /* Public */ + /* http://imakewebthings.com/waypoints/api/context-destroy */ + Context.prototype.destroy = function() { + var allWaypoints = [] + for (var axis in this.waypoints) { + for (var waypointKey in this.waypoints[axis]) { + allWaypoints.push(this.waypoints[axis][waypointKey]) + } + } + for (var i = 0, end = allWaypoints.length; i < end; i++) { + allWaypoints[i].destroy() + } + } + + /* Public */ + /* http://imakewebthings.com/waypoints/api/context-refresh */ + Context.prototype.refresh = function() { + /*eslint-disable eqeqeq */ + var isWindow = this.element == this.element.window + /*eslint-enable eqeqeq */ + var contextOffset = isWindow ? undefined : this.adapter.offset() + var triggeredGroups = {} + var axes + + this.handleScroll() + axes = { + horizontal: { + contextOffset: isWindow ? 0 : contextOffset.left, + contextScroll: isWindow ? 0 : this.oldScroll.x, + contextDimension: this.innerWidth(), + oldScroll: this.oldScroll.x, + forward: 'right', + backward: 'left', + offsetProp: 'left' + }, + vertical: { + contextOffset: isWindow ? 0 : contextOffset.top, + contextScroll: isWindow ? 0 : this.oldScroll.y, + contextDimension: this.innerHeight(), + oldScroll: this.oldScroll.y, + forward: 'down', + backward: 'up', + offsetProp: 'top' + } + } + + for (var axisKey in axes) { + var axis = axes[axisKey] + for (var waypointKey in this.waypoints[axisKey]) { + var waypoint = this.waypoints[axisKey][waypointKey] + var adjustment = waypoint.options.offset + var oldTriggerPoint = waypoint.triggerPoint + var elementOffset = 0 + var freshWaypoint = oldTriggerPoint == null + var contextModifier, wasBeforeScroll, nowAfterScroll + var triggeredBackward, triggeredForward + + if (waypoint.element !== waypoint.element.window) { + elementOffset = waypoint.adapter.offset()[axis.offsetProp] + } + + if (typeof adjustment === 'function') { + adjustment = adjustment.apply(waypoint) + } + else if (typeof adjustment === 'string') { + adjustment = parseFloat(adjustment) + if (waypoint.options.offset.indexOf('%') > - 1) { + adjustment = Math.ceil(axis.contextDimension * adjustment / 100) + } + } + + contextModifier = axis.contextScroll - axis.contextOffset + waypoint.triggerPoint = Math.floor(elementOffset + contextModifier - adjustment) + wasBeforeScroll = oldTriggerPoint < axis.oldScroll + nowAfterScroll = waypoint.triggerPoint >= axis.oldScroll + triggeredBackward = wasBeforeScroll && nowAfterScroll + triggeredForward = !wasBeforeScroll && !nowAfterScroll + + if (!freshWaypoint && triggeredBackward) { + waypoint.queueTrigger(axis.backward) + triggeredGroups[waypoint.group.id] = waypoint.group + } + else if (!freshWaypoint && triggeredForward) { + waypoint.queueTrigger(axis.forward) + triggeredGroups[waypoint.group.id] = waypoint.group + } + else if (freshWaypoint && axis.oldScroll >= waypoint.triggerPoint) { + waypoint.queueTrigger(axis.forward) + triggeredGroups[waypoint.group.id] = waypoint.group + } + } + } + + Waypoint.requestAnimationFrame(function() { + for (var groupKey in triggeredGroups) { + triggeredGroups[groupKey].flushTriggers() + } + }) + + return this + } + + /* Private */ + Context.findOrCreateByElement = function(element) { + return Context.findByElement(element) || new Context(element) + } + + /* Private */ + Context.refreshAll = function() { + for (var contextId in contexts) { + contexts[contextId].refresh() + } + } + + /* Public */ + /* http://imakewebthings.com/waypoints/api/context-find-by-element */ + Context.findByElement = function(element) { + return contexts[element.waypointContextKey] + } + + window.onload = function() { + if (oldWindowLoad) { + oldWindowLoad() + } + Context.refreshAll() + } + + + Waypoint.requestAnimationFrame = function(callback) { + var requestFn = window.requestAnimationFrame || + window.mozRequestAnimationFrame || + window.webkitRequestAnimationFrame || + requestAnimationFrameShim + requestFn.call(window, callback) + } + Waypoint.Context = Context +}()) +;(function() { + 'use strict' + + function byTriggerPoint(a, b) { + return a.triggerPoint - b.triggerPoint + } + + function byReverseTriggerPoint(a, b) { + return b.triggerPoint - a.triggerPoint + } + + var groups = { + vertical: {}, + horizontal: {} + } + var Waypoint = window.Waypoint + + /* http://imakewebthings.com/waypoints/api/group */ + function Group(options) { + this.name = options.name + this.axis = options.axis + this.id = this.name + '-' + this.axis + this.waypoints = [] + this.clearTriggerQueues() + groups[this.axis][this.name] = this + } + + /* Private */ + Group.prototype.add = function(waypoint) { + this.waypoints.push(waypoint) + } + + /* Private */ + Group.prototype.clearTriggerQueues = function() { + this.triggerQueues = { + up: [], + down: [], + left: [], + right: [] + } + } + + /* Private */ + Group.prototype.flushTriggers = function() { + for (var direction in this.triggerQueues) { + var waypoints = this.triggerQueues[direction] + var reverse = direction === 'up' || direction === 'left' + waypoints.sort(reverse ? byReverseTriggerPoint : byTriggerPoint) + for (var i = 0, end = waypoints.length; i < end; i += 1) { + var waypoint = waypoints[i] + if (waypoint.options.continuous || i === waypoints.length - 1) { + waypoint.trigger([direction]) + } + } + } + this.clearTriggerQueues() + } + + /* Private */ + Group.prototype.next = function(waypoint) { + this.waypoints.sort(byTriggerPoint) + var index = Waypoint.Adapter.inArray(waypoint, this.waypoints) + var isLast = index === this.waypoints.length - 1 + return isLast ? null : this.waypoints[index + 1] + } + + /* Private */ + Group.prototype.previous = function(waypoint) { + this.waypoints.sort(byTriggerPoint) + var index = Waypoint.Adapter.inArray(waypoint, this.waypoints) + return index ? this.waypoints[index - 1] : null + } + + /* Private */ + Group.prototype.queueTrigger = function(waypoint, direction) { + this.triggerQueues[direction].push(waypoint) + } + + /* Private */ + Group.prototype.remove = function(waypoint) { + var index = Waypoint.Adapter.inArray(waypoint, this.waypoints) + if (index > -1) { + this.waypoints.splice(index, 1) + } + } + + /* Public */ + /* http://imakewebthings.com/waypoints/api/first */ + Group.prototype.first = function() { + return this.waypoints[0] + } + + /* Public */ + /* http://imakewebthings.com/waypoints/api/last */ + Group.prototype.last = function() { + return this.waypoints[this.waypoints.length - 1] + } + + /* Private */ + Group.findOrCreate = function(options) { + return groups[options.axis][options.name] || new Group(options) + } + + Waypoint.Group = Group +}()) +;(function() { + 'use strict' + + var $ = window.jQuery + var Waypoint = window.Waypoint + + function JQueryAdapter(element) { + this.$element = $(element) + } + + $.each([ + 'innerHeight', + 'innerWidth', + 'off', + 'offset', + 'on', + 'outerHeight', + 'outerWidth', + 'scrollLeft', + 'scrollTop' + ], function(i, method) { + JQueryAdapter.prototype[method] = function() { + var args = Array.prototype.slice.call(arguments) + return this.$element[method].apply(this.$element, args) + } + }) + + $.each([ + 'extend', + 'inArray', + 'isEmptyObject' + ], function(i, method) { + JQueryAdapter[method] = $[method] + }) + + Waypoint.adapters.push({ + name: 'jquery', + Adapter: JQueryAdapter + }) + Waypoint.Adapter = JQueryAdapter +}()) +;(function() { + 'use strict' + + var Waypoint = window.Waypoint + + function createExtension(framework) { + return function() { + var waypoints = [] + var overrides = arguments[0] + + if (framework.isFunction(arguments[0])) { + overrides = framework.extend({}, arguments[1]) + overrides.handler = arguments[0] + } + + this.each(function() { + var options = framework.extend({}, overrides, { + element: this + }) + if (typeof options.context === 'string') { + options.context = framework(this).closest(options.context)[0] + } + waypoints.push(new Waypoint(options)) + }) + + return waypoints + } + } + + if (window.jQuery) { + window.jQuery.fn.waypoint = createExtension(window.jQuery) + } + if (window.Zepto) { + window.Zepto.fn.waypoint = createExtension(window.Zepto) + } +}()) +; + +/*! +Waypoints Sticky Element Shortcut - 4.0.1 +Copyright © 2011-2016 Caleb Troughton +Licensed under the MIT license. +https://github.com/imakewebthings/waypoints/blob/master/licenses.txt +*/ +(function() { + 'use strict' + + var $ = window.jQuery + var Waypoint = window.Waypoint + + /* http://imakewebthings.com/waypoints/shortcuts/sticky-elements */ + function Sticky(options) { + this.options = $.extend({}, Waypoint.defaults, Sticky.defaults, options) + this.element = this.options.element + this.$element = $(this.element) + this.createWrapper() + this.createWaypoint() + } + + /* Private */ + Sticky.prototype.createWaypoint = function() { + var originalHandler = this.options.handler + + this.waypoint = new Waypoint($.extend({}, this.options, { + element: this.wrapper, + handler: $.proxy(function(direction) { + var shouldBeStuck = this.options.direction.indexOf(direction) > -1 + var wrapperHeight = shouldBeStuck ? this.$element.outerHeight(true) : '' + + this.$wrapper.height(wrapperHeight) + this.$element.toggleClass(this.options.stuckClass, shouldBeStuck) + + if (originalHandler) { + originalHandler.call(this, direction) + } + }, this) + })) + } + + /* Private */ + Sticky.prototype.createWrapper = function() { + if (this.options.wrapper) { + this.$element.wrap(this.options.wrapper) + } + this.$wrapper = this.$element.parent() + this.wrapper = this.$wrapper[0] + } + + /* Public */ + Sticky.prototype.destroy = function() { + if (this.$element.parent()[0] === this.wrapper) { + this.waypoint.destroy() + this.$element.removeClass(this.options.stuckClass) + if (this.options.wrapper) { + this.$element.unwrap() + } + } + } + + Sticky.defaults = { + wrapper: '
    ', + stuckClass: 'stuck', + direction: 'down right' + } + + Waypoint.Sticky = Sticky +}()) +; + +/*! +Waypoints Inview Shortcut - 4.0.1 +Copyright © 2011-2016 Caleb Troughton +Licensed under the MIT license. +https://github.com/imakewebthings/waypoints/blob/master/licenses.txt +*/ +(function() { + 'use strict' + + function noop() {} + + var Waypoint = window.Waypoint + + /* http://imakewebthings.com/waypoints/shortcuts/inview */ + function Inview(options) { + this.options = Waypoint.Adapter.extend({}, Inview.defaults, options) + this.axis = this.options.horizontal ? 'horizontal' : 'vertical' + this.waypoints = [] + this.element = this.options.element + this.createWaypoints() + } + + /* Private */ + Inview.prototype.createWaypoints = function() { + var configs = { + vertical: [{ + down: 'enter', + up: 'exited', + offset: '100%' + }, { + down: 'entered', + up: 'exit', + offset: 'bottom-in-view' + }, { + down: 'exit', + up: 'entered', + offset: 0 + }, { + down: 'exited', + up: 'enter', + offset: function() { + return -this.adapter.outerHeight() + } + }], + horizontal: [{ + right: 'enter', + left: 'exited', + offset: '100%' + }, { + right: 'entered', + left: 'exit', + offset: 'right-in-view' + }, { + right: 'exit', + left: 'entered', + offset: 0 + }, { + right: 'exited', + left: 'enter', + offset: function() { + return -this.adapter.outerWidth() + } + }] + } + + for (var i = 0, end = configs[this.axis].length; i < end; i++) { + var config = configs[this.axis][i] + this.createWaypoint(config) + } + } + + /* Private */ + Inview.prototype.createWaypoint = function(config) { + var self = this + this.waypoints.push(new Waypoint({ + context: this.options.context, + element: this.options.element, + enabled: this.options.enabled, + handler: (function(config) { + return function(direction) { + self.options[config[direction]].call(self, direction) + } + }(config)), + offset: config.offset, + horizontal: this.options.horizontal + })) + } + + /* Public */ + Inview.prototype.destroy = function() { + for (var i = 0, end = this.waypoints.length; i < end; i++) { + this.waypoints[i].destroy() + } + this.waypoints = [] + } + + Inview.prototype.disable = function() { + for (var i = 0, end = this.waypoints.length; i < end; i++) { + this.waypoints[i].disable() + } + } + + Inview.prototype.enable = function() { + for (var i = 0, end = this.waypoints.length; i < end; i++) { + this.waypoints[i].enable() + } + } + + Inview.defaults = { + context: window, + enabled: true, + enter: noop, + entered: noop, + exit: noop, + exited: noop + } + + Waypoint.Inview = Inview +}()) +; + +/*! +Waypoints Infinite Scroll Shortcut - 4.0.1 +Copyright © 2011-2016 Caleb Troughton +Licensed under the MIT license. +https://github.com/imakewebthings/waypoints/blob/master/licenses.txt +*/ +(function() { + 'use strict' + + var $ = window.jQuery + var Waypoint = window.Waypoint + + /* http://imakewebthings.com/waypoints/shortcuts/infinite-scroll */ + function Infinite(options) { + this.options = $.extend({}, Infinite.defaults, options) + this.container = this.options.element + if (this.options.container !== 'auto') { + this.container = this.options.container + } + this.$container = $(this.container) + this.$more = $(this.options.more) + + if (this.$more.length) { + this.setupHandler() + this.waypoint = new Waypoint(this.options) + } + } + + /* Private */ + Infinite.prototype.setupHandler = function() { + this.options.handler = $.proxy(function() { + this.options.onBeforePageLoad() + this.destroy() + this.$container.addClass(this.options.loadingClass) + + $.get($(this.options.more).attr('href'), $.proxy(function(data) { + var $data = $($.parseHTML(data)) + var $newMore = $data.find(this.options.more) + + var $items = $data.find(this.options.items) + if (!$items.length) { + $items = $data.filter(this.options.items) + } + + this.$container.append($items) + this.$container.removeClass(this.options.loadingClass) + + if (!$newMore.length) { + $newMore = $data.filter(this.options.more) + } + if ($newMore.length) { + this.$more.replaceWith($newMore) + this.$more = $newMore + this.waypoint = new Waypoint(this.options) + } + else { + this.$more.remove() + } + + this.options.onAfterPageLoad($items) + }, this)) + }, this) + } + + /* Public */ + Infinite.prototype.destroy = function() { + if (this.waypoint) { + this.waypoint.destroy() + } + } + + Infinite.defaults = { + container: 'auto', + items: '.infinite-item', + more: '.infinite-more-link', + offset: 'bottom-in-view', + loadingClass: 'infinite-loading', + onBeforePageLoad: $.noop, + onAfterPageLoad: $.noop + } + + Waypoint.Infinite = Infinite +}()) +; diff --git a/core/product.go b/core/product.go index 8192308cd..d02c15ea6 100644 --- a/core/product.go +++ b/core/product.go @@ -26,7 +26,7 @@ type ProdInfo struct { // Product returns product edition details func Product() (p ProdInfo) { p.Major = "0" - p.Minor = "23" + p.Minor = "24" p.Patch = "0" p.Version = fmt.Sprintf("%s.%s.%s", p.Major, p.Minor, p.Patch) p.Edition = "Community" diff --git a/core/section/code/code.go b/core/section/code/code.go index 8471ca64b..c446acf18 100644 --- a/core/section/code/code.go +++ b/core/section/code/code.go @@ -27,7 +27,7 @@ func (*Provider) Meta() provider.TypeMeta { section.ID = "4f6f2b02-8397-483d-9bb9-eea1fef13304" section.Title = "Code" - section.Description = "Formatted code samples supporting 50+ languages" + section.Description = "Formatted code snippets" section.ContentType = "code" section.Order = 9997 diff --git a/core/section/gemini/gemini.go b/core/section/gemini/gemini.go index 395b16fe2..bba1e27ff 100644 --- a/core/section/gemini/gemini.go +++ b/core/section/gemini/gemini.go @@ -20,8 +20,8 @@ import ( "io/ioutil" "net/http" - "github.com/documize/community/core/section/provider" "github.com/documize/community/core/log" + "github.com/documize/community/core/section/provider" ) // Provider represents Gemini @@ -33,7 +33,7 @@ func (*Provider) Meta() provider.TypeMeta { section := provider.TypeMeta{} section.ID = "23b133f9-4020-4616-9291-a98fb939735f" section.Title = "Gemini" - section.Description = "Display work items and tickets from workspaces" + section.Description = "Work items and tickets" section.ContentType = "gemini" return section diff --git a/core/section/markdown/markdown.go b/core/section/markdown/markdown.go index f6828de75..24ee7eb4a 100644 --- a/core/section/markdown/markdown.go +++ b/core/section/markdown/markdown.go @@ -28,7 +28,7 @@ func (*Provider) Meta() provider.TypeMeta { section.ID = "1470bb4a-36c6-4a98-a443-096f5658378b" section.Title = "Markdown" - section.Description = "CommonMark based markdown content with preview" + section.Description = "CommonMark based content" section.ContentType = "markdown" section.Order = 9998 diff --git a/core/section/table/table.go b/core/section/table/table.go index 2d44a0bf2..56c3195d2 100644 --- a/core/section/table/table.go +++ b/core/section/table/table.go @@ -27,7 +27,7 @@ func (*Provider) Meta() provider.TypeMeta { section.ID = "81a2ea93-2dfc-434d-841e-54b832492c92" section.Title = "Tabular" - section.Description = "Rows, columns and formatting for tabular data" + section.Description = "Rows, columns for tabular data" section.ContentType = "table" section.Order = 9996 diff --git a/core/section/wysiwyg/wysiwyg.go b/core/section/wysiwyg/wysiwyg.go index 0c10f429f..781bd89ab 100644 --- a/core/section/wysiwyg/wysiwyg.go +++ b/core/section/wysiwyg/wysiwyg.go @@ -27,7 +27,7 @@ func (*Provider) Meta() provider.TypeMeta { section.ID = "0f024fa0-d017-4bad-a094-2c13ce6edad7" section.Title = "Rich Text" - section.Description = "WYSIWYG editing with cut-paste image support" + section.Description = "Rich text WYSIWYG" section.ContentType = "wysiwyg" section.Order = 9999 From 3256292d4195491a57b94e5ec50dfa9cd51882fd Mon Sep 17 00:00:00 2001 From: Harvey Kandola Date: Wed, 5 Oct 2016 16:21:52 -0700 Subject: [PATCH 02/20] event-bus provides scroll and window resize events --- .../components/document/document-sidebar.js | 28 +++++++++++-------- app/app/services/event-bus.js | 18 ++++++++++-- 2 files changed, 31 insertions(+), 15 deletions(-) diff --git a/app/app/components/document/document-sidebar.js b/app/app/components/document/document-sidebar.js index 3deaee270..f1fdc1f0a 100644 --- a/app/app/components/document/document-sidebar.js +++ b/app/app/components/document/document-sidebar.js @@ -30,24 +30,28 @@ export default Ember.Component.extend(TooltipMixin, NotifierMixin, { }, didInsertElement() { - let s = $(".section-tool"); - let pos = s.position(); - - $(window).scroll(_.throttle(function() { - let windowpos = $(window).scrollTop(); - if (windowpos - 200 >= pos.top) { - s.addClass("stuck-tool"); - s.css('left', parseInt($(".zone-sidebar").css('width')) - 18 + 'px'); - } else { - s.removeClass("stuck-tool"); - } - }, 50)); + let _this = this; + this.eventBus.subscribe('resized', this, 'positionTool'); + this.eventBus.subscribe('scrolled', this, 'positionTool'); }, willDestroyElement() { this.destroyTooltips(); }, + positionTool() { + let s = $(".section-tool"); + let pos = s.position(); + let windowpos = $(window).scrollTop(); + + if (windowpos - 200 >= pos.top) { + s.addClass("stuck-tool"); + s.css('left', parseInt($(".zone-sidebar").css('width')) - 18 + 'px'); + } else { + s.removeClass("stuck-tool"); + } + }, + actions: { // Page up - above pages shunt down. onPageSequenceChange(pendingChanges) { diff --git a/app/app/services/event-bus.js b/app/app/services/event-bus.js index 58301200d..a62d82ae3 100644 --- a/app/app/services/event-bus.js +++ b/app/app/services/event-bus.js @@ -1,17 +1,29 @@ // Copyright 2016 Documize Inc. . All rights reserved. // -// This software (Documize Community Edition) is licensed under +// This software (Documize Community Edition) is licensed under // GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html // // You can operate outside the AGPL restrictions by purchasing // Documize Enterprise Edition and obtaining a commercial license -// by contacting . +// by contacting . // // https://documize.com import Ember from 'ember'; export default Ember.Service.extend(Ember.Evented, { + init() { + let _this = this; + + window.addEventListener("scroll", _.debounce(function() { + _this.publish('scrolled', null); + }, 100)); + + window.addEventListener("resize", _.debounce(function() { + _this.publish('resized', null); + }, 100)); + }, + publish: function() { return this.trigger.apply(this, arguments); }, @@ -23,4 +35,4 @@ export default Ember.Service.extend(Ember.Evented, { unsubscribe: function() { return this.off.apply(this, arguments); } -}); \ No newline at end of file +}); From 459469c1d46bb3fb38e312aadfaeeddc5bf2d137 Mon Sep 17 00:00:00 2001 From: Harvey Kandola Date: Wed, 5 Oct 2016 17:12:47 -0700 Subject: [PATCH 03/20] scroll top tool --- .../document/document-sidebar-toc.js | 32 ++++++++++--------- .../components/document/document-sidebar.js | 28 +++++++++++++--- app/app/services/event-bus.js | 2 +- app/app/styles/view/document/sidebar.scss | 12 +++++++ .../components/document/document-sidebar.hbs | 6 ++++ 5 files changed, 60 insertions(+), 20 deletions(-) diff --git a/app/app/components/document/document-sidebar-toc.js b/app/app/components/document/document-sidebar-toc.js index 8151cd598..435ea3413 100644 --- a/app/app/components/document/document-sidebar-toc.js +++ b/app/app/components/document/document-sidebar-toc.js @@ -45,27 +45,29 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, { didInsertElement() { this.eventBus.subscribe('documentPageAdded', this, 'onDocumentPageAdded'); - - // let s = $(".document-structure"); - // let pos = s.position(); - // - // $(window).scroll(_.throttle(function() { - // let windowpos = $(window).scrollTop(); - // if (windowpos - 200 >= pos.top) { - // s.addClass("stuck-toc"); - // s.css('width', s.parent().width()); - // } else { - // s.removeClass("stuck-toc"); - // s.css('width', 'auto'); - // } - // }, 50)); - }, + }, willDestroyElement() { this.eventBus.unsubscribe('documentPageAdded'); this.destroyTooltips(); }, + // positionToc() { + // let s = $(".document-structure"); + // let pos = s.position(); + // + // $(window).scroll(_.throttle(function() { + // let windowpos = $(window).scrollTop(); + // if (windowpos - 200 >= pos.top) { + // s.addClass("stuck-toc"); + // s.css('width', s.parent().width()); + // } else { + // s.removeClass("stuck-toc"); + // s.css('width', 'auto'); + // } + // }, 50)); + // }, + onDocumentPageAdded(pageId) { this.send('onEntryClick', pageId); }, diff --git a/app/app/components/document/document-sidebar.js b/app/app/components/document/document-sidebar.js index f1fdc1f0a..a07e00bce 100644 --- a/app/app/components/document/document-sidebar.js +++ b/app/app/components/document/document-sidebar.js @@ -21,6 +21,7 @@ export default Ember.Component.extend(TooltipMixin, NotifierMixin, { showViews: false, showContributions: false, showSections: false, + showScrollTool: false, didRender() { if (this.session.authenticated) { @@ -30,9 +31,20 @@ export default Ember.Component.extend(TooltipMixin, NotifierMixin, { }, didInsertElement() { - let _this = this; this.eventBus.subscribe('resized', this, 'positionTool'); this.eventBus.subscribe('scrolled', this, 'positionTool'); + + // new Waypoint({ + // element: document.getElementById('zone-header'), + // handler: function(direction) { + // console.log(direction); + // if (direction === 'up') { + // $(".scroll-tool").addClass('hide'); + // console.log("hiding"); + // } + // }, + // offset: 50 + // }); }, willDestroyElement() { @@ -40,14 +52,15 @@ export default Ember.Component.extend(TooltipMixin, NotifierMixin, { }, positionTool() { - let s = $(".section-tool"); - let pos = s.position(); + let s = $(".scroll-tool"); let windowpos = $(window).scrollTop(); - if (windowpos - 200 >= pos.top) { + if (windowpos >= 300) { + this.set('showScrollTool', true); s.addClass("stuck-tool"); s.css('left', parseInt($(".zone-sidebar").css('width')) - 18 + 'px'); } else { + this.set('showScrollTool', false); s.removeClass("stuck-tool"); } }, @@ -101,6 +114,13 @@ export default Ember.Component.extend(TooltipMixin, NotifierMixin, { onAddSection(section) { this.attrs.onAddSection(section); + }, + + scrollTop() { + this.set('showScrollTool', false); + $("html,body").animate({ + scrollTop: 0 + }, 500, "linear"); } } }); diff --git a/app/app/services/event-bus.js b/app/app/services/event-bus.js index a62d82ae3..2894c81c4 100644 --- a/app/app/services/event-bus.js +++ b/app/app/services/event-bus.js @@ -15,7 +15,7 @@ export default Ember.Service.extend(Ember.Evented, { init() { let _this = this; - window.addEventListener("scroll", _.debounce(function() { + window.addEventListener("scroll", _.throttle(function() { _this.publish('scrolled', null); }, 100)); diff --git a/app/app/styles/view/document/sidebar.scss b/app/app/styles/view/document/sidebar.scss index 7c3bf30e9..00867fd91 100644 --- a/app/app/styles/view/document/sidebar.scss +++ b/app/app/styles/view/document/sidebar.scss @@ -63,6 +63,18 @@ z-index: 999; } + .scroll-tool { + position: absolute; + top: 150px; + right: -18px; + z-index: 888; + -webkit-animation: fadein 1s; /* Safari, Chrome and Opera > 12.1 */ + -moz-animation: fadein 1s; /* Firefox < 16 */ + -ms-animation: fadein 1s; /* Internet Explorer */ + -o-animation: fadein 1s; /* Opera < 12.1 */ + animation: fadein 1s; + } + .stuck-tool { position: fixed !important; top: 150px !important; diff --git a/app/app/templates/components/document/document-sidebar.hbs b/app/app/templates/components/document/document-sidebar.hbs index 2c66c26bd..eec65770c 100644 --- a/app/app/templates/components/document/document-sidebar.hbs +++ b/app/app/templates/components/document/document-sidebar.hbs @@ -34,6 +34,12 @@
    {{/if}} + {{#if showScrollTool}} +
    + vertical_align_top +
    + {{/if}} + {{#if showToc}} {{document/document-sidebar-toc document=model folder=folder pages=pages page=page isEditor=isEditor changePageSequence=(action 'onPageSequenceChange') changePageLevel=(action 'onPageLevelChange') From bed6271d0d5ebdc875faf7e69f1d126addb18da0 Mon Sep 17 00:00:00 2001 From: Harvey Kandola Date: Wed, 5 Oct 2016 18:08:10 -0700 Subject: [PATCH 04/20] add section close button --- app/app/components/document/document-sidebar.js | 13 +++++++++++++ .../components/document/document-sidebar.hbs | 5 +++++ 2 files changed, 18 insertions(+) diff --git a/app/app/components/document/document-sidebar.js b/app/app/components/document/document-sidebar.js index a07e00bce..da57db26a 100644 --- a/app/app/components/document/document-sidebar.js +++ b/app/app/components/document/document-sidebar.js @@ -22,6 +22,7 @@ export default Ember.Component.extend(TooltipMixin, NotifierMixin, { showContributions: false, showSections: false, showScrollTool: false, + showingSections: false, didRender() { if (this.session.authenticated) { @@ -85,6 +86,8 @@ export default Ember.Component.extend(TooltipMixin, NotifierMixin, { this.set('showViews', false); this.set('showContributions', false); this.set('showSections', false); + + this.set('showingSections', false); }, showViews() { @@ -92,6 +95,8 @@ export default Ember.Component.extend(TooltipMixin, NotifierMixin, { this.set('showViews', true); this.set('showContributions', false); this.set('showSections', false); + + this.set('showingSections', false); }, showContributions() { @@ -99,6 +104,8 @@ export default Ember.Component.extend(TooltipMixin, NotifierMixin, { this.set('showViews', false); this.set('showContributions', true); this.set('showSections', false); + + this.set('showingSections', false); }, showSections() { @@ -106,18 +113,24 @@ export default Ember.Component.extend(TooltipMixin, NotifierMixin, { this.set('showViews', false); this.set('showContributions', false); this.set('showSections', true); + + this.set('showingSections', true); }, onCancel() { this.send('showToc'); + this.set('showingSections', false); }, onAddSection(section) { this.attrs.onAddSection(section); + + this.set('showingSections', false); }, scrollTop() { this.set('showScrollTool', false); + $("html,body").animate({ scrollTop: 0 }, 500, "linear"); diff --git a/app/app/templates/components/document/document-sidebar.hbs b/app/app/templates/components/document/document-sidebar.hbs index eec65770c..4565e490d 100644 --- a/app/app/templates/components/document/document-sidebar.hbs +++ b/app/app/templates/components/document/document-sidebar.hbs @@ -32,6 +32,11 @@
    add
    + {{#if showingSections}} +
    + close +
    + {{/if}} {{/if}} {{#if showScrollTool}} From 752d6aa9e3a68b17ff6613cfc03f767b91e8975a Mon Sep 17 00:00:00 2001 From: EnesAlili Date: Thu, 6 Oct 2016 19:14:46 +0100 Subject: [PATCH 05/20] Front-end and design tweaks --- app/app/styles/color.scss | 10 +++++----- app/app/styles/view/document/content.scss | 2 +- app/app/styles/view/document/wizard.scss | 11 +++++------ app/app/styles/view/document/wysiwyg.scss | 6 +++--- app/app/styles/view/page-documents.scss | 1 + app/app/templates/components/layout/zone-header.hbs | 2 +- app/package.json | 4 ++-- 7 files changed, 18 insertions(+), 18 deletions(-) diff --git a/app/app/styles/color.scss b/app/app/styles/color.scss index d63354bbb..37cf0a983 100644 --- a/app/app/styles/color.scss +++ b/app/app/styles/color.scss @@ -10,26 +10,26 @@ // https://documize.com $color-off-white: #f5f5f5; -$color-off-black: #333333; +$color-off-black: #393939; $color-black: #000000; $color-white: #ffffff; -$color-primary: #115a97; +$color-primary: #2667af; $color-red: #d04134; $color-green: #4caf50; -$color-blue: #115a97; +$color-blue: #2667af; $color-gray: #8b9096; $color-goldy: #cc9933; $color-header: #f3f5f8; $color-link: #0092d3; -$color-border: #e1e1e1; +$color-border: #f3f5f8; $color-input: #5a5a5a; $color-stroke: #e1e1e1; $color-tooltip: #a1a1a1; $color-toast: #4c4c4c; -$color-checkbox: #115a97; +$color-checkbox: #2667af; $color-card-active: #f7fcff; $color-chip: #98A2AB; diff --git a/app/app/styles/view/document/content.scss b/app/app/styles/view/document/content.scss index 609b88c10..e784254e8 100644 --- a/app/app/styles/view/document/content.scss +++ b/app/app/styles/view/document/content.scss @@ -43,7 +43,7 @@ } > .file { - font-size: 0.9rem; + font-size: 1rem; } } diff --git a/app/app/styles/view/document/wizard.scss b/app/app/styles/view/document/wizard.scss index d6678429b..59cdf4058 100644 --- a/app/app/styles/view/document/wizard.scss +++ b/app/app/styles/view/document/wizard.scss @@ -13,10 +13,11 @@ cursor: pointer; padding: 10px 5px; margin: 5px 0; + @include ease-in(); &:hover { @include ease-in(); - + > .details { > .title { color: $color-primary; @@ -31,22 +32,20 @@ .icon { text-align: center; display: inline-block; - padding-right: 20px; width: 50px; > .img { float: left; text-align: center; display: inline-block; - height: 45px; - width: 45px; + height: 40px; + width: 40px; } } > .details { vertical-align: top; display: inline-block; - float: left; width: 80%; > .title { @@ -58,7 +57,7 @@ > .desc { color: $color-gray; - font-size: 0.8rem; + font-size: 0.9rem; margin-top: 5px; } } diff --git a/app/app/styles/view/document/wysiwyg.scss b/app/app/styles/view/document/wysiwyg.scss index 56874af7a..2baebd3aa 100644 --- a/app/app/styles/view/document/wysiwyg.scss +++ b/app/app/styles/view/document/wysiwyg.scss @@ -45,8 +45,8 @@ h1 { - font-size: 2em; - font-weight: bold; + font-size: 1.6em; + font-family: open_sansregular; color:$color-off-black; margin: 30px 0 20px 0; } @@ -134,7 +134,7 @@ border-width: 2px; } th { - background: #e6e6e6; + background: #efefef; } } } diff --git a/app/app/styles/view/page-documents.scss b/app/app/styles/view/page-documents.scss index 6a541785a..d14871165 100644 --- a/app/app/styles/view/page-documents.scss +++ b/app/app/styles/view/page-documents.scss @@ -57,6 +57,7 @@ width: 100%; position: relative; transition: .3s; + border-bottom: 1px solid $color-border; &:hover { > .link { diff --git a/app/app/templates/components/layout/zone-header.hbs b/app/app/templates/components/layout/zone-header.hbs index 84d0567b3..612d89a07 100644 --- a/app/app/templates/components/layout/zone-header.hbs +++ b/app/app/templates/components/layout/zone-header.hbs @@ -1,5 +1,5 @@
    -
    +
     {{title}}
    diff --git a/app/package.json b/app/package.json index 4785ef5be..53c15c41b 100644 --- a/app/package.json +++ b/app/package.json @@ -21,7 +21,7 @@ "devDependencies": { "broccoli-asset-rev": "^2.4.2", "ember-ajax": "2.3.2", - "ember-cli": "2.8.0", + "ember-cli": "^2.8.0", "ember-cli-app-version": "^1.0.0", "ember-cli-babel": "^5.1.6", "ember-cli-dependency-checker": "^1.2.0", @@ -32,9 +32,9 @@ "ember-cli-mirage": "^0.2.0", "ember-cli-qunit": "^2.1.0", "ember-cli-release": "0.2.9", - "ember-cli-test-loader": "^1.1.0", "ember-cli-sass": "5.3.1", "ember-cli-sri": "^2.1.0", + "ember-cli-test-loader": "^1.1.0", "ember-cli-uglify": "^1.2.0", "ember-data": "^2.8.0", "ember-export-application-global": "^1.0.5", From 4ceddfc1f3ce6b28f709237047230b805fc508f4 Mon Sep 17 00:00:00 2001 From: Harvey Kandola Date: Thu, 6 Oct 2016 14:13:02 -0700 Subject: [PATCH 06/20] new layout designs! --- .../components/document/document-sidebar.js | 12 -- app/app/components/folder/folder-toolbar.js | 8 +- app/app/components/folder/folders-list.js | 29 ++++- app/app/helpers/document/file-icon.js | 2 +- app/app/pods/document/index/template.hbs | 16 +-- app/app/pods/folders/folder/template.hbs | 12 +- app/app/pods/folders/settings/template.hbs | 4 +- app/app/routes/application.js | 8 +- app/app/styles/app.scss | 1 - app/app/styles/base.scss | 1 + app/app/styles/view/document/sidebar.scss | 21 ++- app/app/styles/view/document/toolbar.scss | 8 -- app/app/styles/view/layout.scss | 54 ++++---- app/app/styles/view/page-documents.scss | 37 +++++- app/app/styles/widget/widget-button.scss | 4 +- .../components/document/document-sidebar.hbs | 13 +- .../components/document/document-toolbar.hbs | 30 ++--- .../components/document/document-view.hbs | 2 + .../components/folder/folder-toolbar.hbs | 123 +++++++++--------- .../components/folder/folders-list.hbs | 38 +++--- 20 files changed, 251 insertions(+), 172 deletions(-) delete mode 100644 app/app/styles/view/document/toolbar.scss diff --git a/app/app/components/document/document-sidebar.js b/app/app/components/document/document-sidebar.js index da57db26a..87d3daabc 100644 --- a/app/app/components/document/document-sidebar.js +++ b/app/app/components/document/document-sidebar.js @@ -34,18 +34,6 @@ export default Ember.Component.extend(TooltipMixin, NotifierMixin, { didInsertElement() { this.eventBus.subscribe('resized', this, 'positionTool'); this.eventBus.subscribe('scrolled', this, 'positionTool'); - - // new Waypoint({ - // element: document.getElementById('zone-header'), - // handler: function(direction) { - // console.log(direction); - // if (direction === 'up') { - // $(".scroll-tool").addClass('hide'); - // console.log("hiding"); - // } - // }, - // offset: 50 - // }); }, willDestroyElement() { diff --git a/app/app/components/folder/folder-toolbar.js b/app/app/components/folder/folder-toolbar.js index ea1140c1f..50fa03cc0 100644 --- a/app/app/components/folder/folder-toolbar.js +++ b/app/app/components/folder/folder-toolbar.js @@ -22,7 +22,7 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, { templateService: Ember.inject.service('template'), folderService: Ember.inject.service('folder'), session: Ember.inject.service(), - + showToolbar: false, folder: {}, busy: false, importedDocuments: [], @@ -31,9 +31,12 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, { moveFolderId: "", didReceiveAttrs() { + let self = this; + this.set('isFolderOwner', this.get('folder.userId') === this.get("session.user.id")); - let self = this; + let show = this.get('isFolderOwner') || this.get('hasSelectedDocuments') || this.get('folderService').get('canEditCurrentFolder'); + this.set('showToolbar', show); this.get('templateService').getSavedTemplates().then(function(saved) { let emptyTemplate = { @@ -62,6 +65,7 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, { this.addTooltip(document.getElementById("folder-settings-button")); } if (this.get('folderService').get('canEditCurrentFolder')) { + this.addTooltip(document.getElementById("import-document-button")); this.addTooltip(document.getElementById("start-document-button")); } } diff --git a/app/app/components/folder/folders-list.js b/app/app/components/folder/folders-list.js index 31a61e44f..6d75654c6 100644 --- a/app/app/components/folder/folders-list.js +++ b/app/app/components/folder/folders-list.js @@ -22,12 +22,17 @@ export default Ember.Component.extend(TooltipMixin, { hasProtectedFolders: false, hasPrivateFolders: false, newFolder: "", + showScrollTool: false, didInsertElement() { this._super(...arguments); + if (this.session.authenticated) { - this.addTooltip(document.getElementById("add-folder-button")); + this.addTooltip(document.getElementById("add-space-button")); } + + this.eventBus.subscribe('resized', this, 'positionTool'); + this.eventBus.subscribe('scrolled', this, 'positionTool'); }, didReceiveAttrs() { @@ -65,6 +70,20 @@ export default Ember.Component.extend(TooltipMixin, { this.destroyTooltips(); }, + positionTool() { + let s = $(".scroll-space-tool"); + let windowpos = $(window).scrollTop(); + + if (windowpos >= 300) { + this.set('showScrollTool', true); + s.addClass("stuck-space-tool"); + s.css('left', parseInt($(".zone-sidebar").css('width')) - 18 + 'px'); + } else { + this.set('showScrollTool', false); + s.removeClass("stuck-space-tool"); + } + }, + actions: { addFolder() { var folderName = this.get('newFolder'); @@ -78,6 +97,14 @@ export default Ember.Component.extend(TooltipMixin, { this.set('newFolder', ""); return true; + }, + + scrollTop() { + this.set('showScrollTool', false); + + $("html,body").animate({ + scrollTop: 0 + }, 500, "linear"); } } }); diff --git a/app/app/helpers/document/file-icon.js b/app/app/helpers/document/file-icon.js index 1d1d69049..5a0221914 100644 --- a/app/app/helpers/document/file-icon.js +++ b/app/app/helpers/document/file-icon.js @@ -107,7 +107,7 @@ export function documentFileIcon(params) { case "xslt": } - return new Ember.Handlebars.SafeString(html); + return new Ember.String.htmlSafe(html); } export default Ember.Helper.helper(documentFileIcon); diff --git a/app/app/pods/document/index/template.hbs b/app/app/pods/document/index/template.hbs index dea165e91..4554f0ba2 100644 --- a/app/app/pods/document/index/template.hbs +++ b/app/app/pods/document/index/template.hbs @@ -2,15 +2,6 @@ {{layout/zone-navigation}} - {{#layout/zone-header title=model.name message=model.excerpt}} - {{document/document-toolbar document=model pages=pages folder=folder owner=owner - isEditor=isEditor users=users - onSaveTemplate=(action 'onSaveTemplate') - onDocumentChange=(action 'onDocumentChange') - onAttachmentUpload=(action 'onAttachmentUpload') - onDocumentDelete=(action 'onDocumentDelete')}} - {{/layout/zone-header}} - {{#layout/zone-sidebar}} {{document/document-sidebar document=model meta=meta folder=folder pages=pages page=page owner=owner isEditor=isEditor onAddSection=(action 'onAddSection') @@ -20,6 +11,13 @@ {{/layout/zone-sidebar}} {{#layout/zone-content}} + {{document/document-toolbar document=model pages=pages folder=folder owner=owner + isEditor=isEditor users=users + onSaveTemplate=(action 'onSaveTemplate') + onDocumentChange=(action 'onDocumentChange') + onAttachmentUpload=(action 'onAttachmentUpload') + onDocumentDelete=(action 'onDocumentDelete')}} + {{document/document-view document=model pages=pages attachments=attachments folder=folder folders=folders isEditor=isEditor onAttachmentDeleted=(action 'onAttachmentDeleted') diff --git a/app/app/pods/folders/folder/template.hbs b/app/app/pods/folders/folder/template.hbs index 0e8d010dc..bdb645f61 100644 --- a/app/app/pods/folders/folder/template.hbs +++ b/app/app/pods/folders/folder/template.hbs @@ -2,7 +2,11 @@ {{layout/zone-navigation}} - {{#layout/zone-header title=model.folder.name message="A space provides a place for related content"}} + {{#layout/zone-sidebar}} + {{folder/folders-list folders=model.folders folder=model.folder onFolderAdd=(action 'onFolderAdd')}} + {{/layout/zone-sidebar}} + + {{#layout/zone-content}} {{folder/folder-toolbar folders=model.folders folder=model.folder @@ -11,13 +15,7 @@ onDeleteDocument=(action 'onDeleteDocument') onMoveDocument=(action 'onMoveDocument') showDocument=(action 'showDocument')}} - {{/layout/zone-header}} - {{#layout/zone-sidebar}} - {{folder/folders-list folders=model.folders onFolderAdd=(action 'onFolderAdd')}} - {{/layout/zone-sidebar}} - - {{#layout/zone-content}} {{folder/documents-list documents=model.documents folder=model.folder isFolderOwner=isFolderOwner onDocumentsChecked=(action 'onDocumentsChecked') }} {{/layout/zone-content}} diff --git a/app/app/pods/folders/settings/template.hbs b/app/app/pods/folders/settings/template.hbs index 121c5013e..ec6f9db1d 100644 --- a/app/app/pods/folders/settings/template.hbs +++ b/app/app/pods/folders/settings/template.hbs @@ -2,16 +2,14 @@ {{layout/zone-navigation}} - {{#layout/zone-header title=model.name message="Settings, sharing, permissions and deletion"}} + {{#layout/zone-sidebar}} {{#link-to 'folders.folder' model.id model.slug}}
    arrow_back
    space
    {{/link-to}} - {{/layout/zone-header}} - {{#layout/zone-sidebar}}