diff --git a/app/app/app.js b/app/app/app.js index 98abc2bc..39e6de86 100644 --- a/app/app/app.js +++ b/app/app/app.js @@ -1,3 +1,14 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; import Resolver from './resolver'; import loadInitializers from 'ember-load-initializers'; @@ -13,11 +24,11 @@ Ember.RSVP.on('error', function(error) { }); App = Ember.Application.extend({ - modulePrefix: config.modulePrefix, - podModulePrefix: config.podModulePrefix, - Resolver + modulePrefix: config.modulePrefix, + podModulePrefix: config.podModulePrefix, + Resolver }); loadInitializers(App, config.modulePrefix); -export default App; +export default App; \ No newline at end of file diff --git a/app/app/components/document/document-editor.js b/app/app/components/document/document-editor.js index a4bb4744..f958a111 100644 --- a/app/app/components/document/document-editor.js +++ b/app/app/components/document/document-editor.js @@ -1,3 +1,14 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; export default Ember.Component.extend({ diff --git a/app/app/components/document/document-sidebar-edits.js b/app/app/components/document/document-sidebar-edits.js index 86770cbc..da17e751 100644 --- a/app/app/components/document/document-sidebar-edits.js +++ b/app/app/components/document/document-sidebar-edits.js @@ -1,3 +1,14 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; export default Ember.Component.extend({ diff --git a/app/app/components/document/document-sidebar-toc.js b/app/app/components/document/document-sidebar-toc.js index 5f94754c..ef0f239c 100644 --- a/app/app/components/document/document-sidebar-toc.js +++ b/app/app/components/document/document-sidebar-toc.js @@ -1,3 +1,14 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; import NotifierMixin from '../../mixins/notifier'; import TooltipMixin from '../../mixins/tooltip'; @@ -8,7 +19,12 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, { pages: [], page: "", showToc: false, - tocTools: { UpTarget: "", DownTarget: "", AllowIndent: false, AllowOutdent: false }, + tocTools: { + UpTarget: "", + DownTarget: "", + AllowIndent: false, + AllowOutdent: false + }, actionablePage: false, upDisabled: true, downDisabled: true, @@ -17,36 +33,36 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, { didReceiveAttrs: function() { this.set('showToc', is.not.undefined(this.get('pages')) && this.get('pages').get('length') > 2); - if (is.not.null(this.get('page'))) { + if (is.not.null(this.get('page'))) { this.send('clickGotoPage', this.get('page')); } }, didRender: function() { - if (this.session.authenticated) { - this.addTooltip(document.getElementById("toc-up-button")); - this.addTooltip(document.getElementById("toc-down-button")); - this.addTooltip(document.getElementById("toc-outdent-button")); - this.addTooltip(document.getElementById("toc-indent-button")); - } + if (this.session.authenticated) { + this.addTooltip(document.getElementById("toc-up-button")); + this.addTooltip(document.getElementById("toc-down-button")); + this.addTooltip(document.getElementById("toc-outdent-button")); + this.addTooltip(document.getElementById("toc-indent-button")); + } }, - didInsertElement() { - this.eventBus.subscribe('documentPageAdded', this, 'onDocumentPageAdded'); + 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'); - } - }); - }, + 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'); + } + }); + }, willDestroyElement() { this.eventBus.unsubscribe('documentPageAdded'); @@ -77,9 +93,11 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, { this.set('page', pageId); var toc = this.get('pages'); - var page = _.findWhere(toc, {id: pageId}); + var page = _.findWhere(toc, { + id: pageId + }); - // handle root node + // handle root node if (is.undefined(page) || page.level === 1) { return; } @@ -90,8 +108,8 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, { return; } - var upPage = toc[index-1]; - var downPage = toc[index+1]; + var upPage = toc[index - 1]; + var downPage = toc[index + 1]; if (_.isUndefined(upPage)) { this.set('tocTools.UpTarget', ""); @@ -103,39 +121,31 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, { // can we go up? // can we indent? - if (!_.isUndefined(upPage)) - { + if (!_.isUndefined(upPage)) { // can only go up if someone is same or higher level? var index2 = _.indexOf(toc, upPage, false); - if (index2 !== -1) - { + if (index2 !== -1) { // up - for (var i = index2; i > 0; i--) - { - if (page.level > toc[i].level) - { + for (var i = index2; i > 0; i--) { + if (page.level > toc[i].level) { break; } - if (page.level === toc[i].level) - { + if (page.level === toc[i].level) { this.set('tocTools.UpTarget', toc[i].id); break; } } // indent? - for (var i2 = index2; i2 > 0; i2--) - { - if (toc[i2].level < page.level) - { + for (var i2 = index2; i2 > 0; i2--) { + if (toc[i2].level < page.level) { this.set('tocTools.AllowIndent', false); break; } - if (page.level === toc[i2].level) - { + if (page.level === toc[i2].level) { this.set('tocTools.AllowIndent', true); break; } @@ -143,30 +153,24 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, { } // if page above is root node then some things you can't do - if (upPage.level === 1) - { + if (upPage.level === 1) { this.set('tocTools.AllowIndent', false); this.set('tocTools.UpTarget', ""); } } // can we go down? - if (!_.isUndefined(downPage)) - { + if (!_.isUndefined(downPage)) { // can only go down if someone below is at our level or higher var index3 = _.indexOf(toc, downPage, false); - if (index3 !== -1) - { - for (var i3 = index3; i3 < toc.length; i3++) - { - if (toc[i3].level < page.level) - { + if (index3 !== -1) { + for (var i3 = index3; i3 < toc.length; i3++) { + if (toc[i3].level < page.level) { break; } - if (page.level === toc[i3].level) - { + if (page.level === toc[i3].level) { this.set('tocTools.DownTarget', toc[i3].id); break; } @@ -201,8 +205,12 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, { } var pages = this.get('pages'); - var current = _.findWhere(pages, {id: this.get('page')}); - var page1 = _.findWhere(pages, {id: this.tocTools.UpTarget}); + var current = _.findWhere(pages, { + id: this.get('page') + }); + var page1 = _.findWhere(pages, { + id: this.tocTools.UpTarget + }); var page2 = null; var pendingChanges = []; @@ -221,30 +229,33 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, { var index = _.indexOf(pages, current, false); - if (index !== -1) - { + if (index !== -1) { var sequence = (sequence1 + sequence2) / 2; - pendingChanges.push({ pageId: current.id, sequence: sequence }); + pendingChanges.push({ + pageId: current.id, + sequence: sequence + }); - for (var i = index + 1; i < pages.length; i++) - { - if (pages[i].level <= current.level) - { + for (var i = index + 1; i < pages.length; i++) { + if (pages[i].level <= current.level) { break; } sequence = (sequence + page1.sequence) / 2; - pendingChanges.push({ pageId: pages[i].id, sequence: sequence }); + pendingChanges.push({ + pageId: pages[i].id, + sequence: sequence + }); } } this.attrs.changePageSequence(pendingChanges); - this.send('clickGotoPage', this.get('page')); + this.send('clickGotoPage', this.get('page')); this.audit.record("moved-page-up"); - this.showNotification("Moved up"); + this.showNotification("Moved up"); }, // Move down -- pages below shift up. @@ -254,9 +265,13 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, { } var pages = this.get('pages'); - var current = _.findWhere(pages, {id: this.get('page')}); + var current = _.findWhere(pages, { + id: this.get('page') + }); var pageIndex = _.indexOf(pages, current, false); - var downTarget = _.findWhere(pages, {id: this.tocTools.DownTarget}); + var downTarget = _.findWhere(pages, { + id: this.tocTools.DownTarget + }); var downTargetIndex = _.indexOf(pages, downTarget, false); var pendingChanges = []; @@ -267,53 +282,53 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, { var startingSequence = 0; var upperSequence = 0; var cutOff = _.rest(pages, downTargetIndex); - var siblings = _.reject(cutOff, function(p){ return p.level !== current.level || p.id === current.id || p.id === downTarget.id; }); + var siblings = _.reject(cutOff, function(p) { + return p.level !== current.level || p.id === current.id || p.id === downTarget.id; + }); - if (siblings.length > 0) - { + if (siblings.length > 0) { var aboveThisGuy = siblings[0]; var belowThisGuy = pages[_.indexOf(pages, aboveThisGuy, false) - 1]; - if (is.not.null(belowThisGuy) && belowThisGuy.level > current.level) - { + if (is.not.null(belowThisGuy) && belowThisGuy.level > current.level) { startingSequence = (aboveThisGuy.sequence + belowThisGuy.sequence) / 2; upperSequence = aboveThisGuy.sequence; - } - else - { + } else { var otherGuy = pages[downTargetIndex + 1]; startingSequence = (otherGuy.sequence + downTarget.sequence) / 2; upperSequence = otherGuy.sequence; } - } - else - { + } else { startingSequence = downTarget.sequence * 2; upperSequence = startingSequence * 2; } - pendingChanges.push({ pageId: current.id, sequence: startingSequence }); + pendingChanges.push({ + pageId: current.id, + sequence: startingSequence + }); var sequence = (startingSequence + upperSequence) / 2; - for (var i = pageIndex + 1; i < pages.length; i++) - { - if (pages[i].level <= current.level) - { + for (var i = pageIndex + 1; i < pages.length; i++) { + if (pages[i].level <= current.level) { break; } var sequence2 = (sequence + upperSequence) / 2; - pendingChanges.push({ pageId: pages[i].id, sequence: sequence2 }); + pendingChanges.push({ + pageId: pages[i].id, + sequence: sequence2 + }); } this.attrs.changePageSequence(pendingChanges); - this.send('clickGotoPage', this.get('page')); + this.send('clickGotoPage', this.get('page')); this.audit.record("moved-page-down"); - this.showNotification("Moved down"); + this.showNotification("Moved down"); }, // Indent - changes a page from H2 to H3, etc. @@ -323,27 +338,33 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, { } var pages = this.get('pages'); - var current = _.findWhere(pages, {id: this.get('page')}); + var current = _.findWhere(pages, { + id: this.get('page') + }); var pageIndex = _.indexOf(pages, current, false); var pendingChanges = []; - pendingChanges.push({ pageId: current.id, level: current.level + 1 }); + pendingChanges.push({ + pageId: current.id, + level: current.level + 1 + }); - for (var i = pageIndex + 1; i < pages.length; i++) - { - if (pages[i].level <= current.level) - { + for (var i = pageIndex + 1; i < pages.length; i++) { + if (pages[i].level <= current.level) { break; } - pendingChanges.push({ pageId: pages[i].id, level: pages[i].level + 1 }); + pendingChanges.push({ + pageId: pages[i].id, + level: pages[i].level + 1 + }); } this.attrs.changePageLevel(pendingChanges); - this.send('clickGotoPage', this.get('page')); + this.send('clickGotoPage', this.get('page')); this.audit.record("changed-page-sequence"); - this.showNotification("Indent"); + this.showNotification("Indent"); }, // Outdent - changes a page from H3 to H2, etc. @@ -353,26 +374,32 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, { } var pages = this.get('pages'); - var current = _.findWhere(pages, {id: this.get('page')}); + var current = _.findWhere(pages, { + id: this.get('page') + }); var pageIndex = _.indexOf(pages, current, false); var pendingChanges = []; - pendingChanges.push({ pageId: current.id, level: current.level - 1 }); + pendingChanges.push({ + pageId: current.id, + level: current.level - 1 + }); - for (var i = pageIndex + 1; i < pages.length; i++) - { - if (pages[i].level <= current.level) - { + for (var i = pageIndex + 1; i < pages.length; i++) { + if (pages[i].level <= current.level) { break; } - pendingChanges.push({ pageId: pages[i].id, level: pages[i].level - 1 }); + pendingChanges.push({ + pageId: pages[i].id, + level: pages[i].level - 1 + }); } this.attrs.changePageLevel(pendingChanges); this.audit.record("changed-page-sequence"); - this.showNotification("Outdent"); - this.send('clickGotoPage', this.get('page')); + this.showNotification("Outdent"); + this.send('clickGotoPage', this.get('page')); }, clickGotoPage(id) { @@ -380,4 +407,4 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, { this.attrs.gotoPage(id); }, }, -}); +}); \ No newline at end of file diff --git a/app/app/components/document/document-sidebar-viewers.js b/app/app/components/document/document-sidebar-viewers.js index 969824b7..47a2a6c9 100644 --- a/app/app/components/document/document-sidebar-viewers.js +++ b/app/app/components/document/document-sidebar-viewers.js @@ -1,3 +1,14 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; export default Ember.Component.extend({ diff --git a/app/app/components/document/document-sidebar.js b/app/app/components/document/document-sidebar.js index 889bb047..3da1ee56 100644 --- a/app/app/components/document/document-sidebar.js +++ b/app/app/components/document/document-sidebar.js @@ -1,3 +1,14 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; export default Ember.Component.extend({ diff --git a/app/app/components/document/document-toolbar.js b/app/app/components/document/document-toolbar.js index 4f4a6049..077bde0f 100644 --- a/app/app/components/document/document-toolbar.js +++ b/app/app/components/document/document-toolbar.js @@ -1,3 +1,14 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; import NotifierMixin from '../../mixins/notifier'; import TooltipMixin from '../../mixins/tooltip'; diff --git a/app/app/components/document/document-view.js b/app/app/components/document/document-view.js index 708bbc44..5ecbbe32 100644 --- a/app/app/components/document/document-view.js +++ b/app/app/components/document/document-view.js @@ -1,3 +1,14 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; import NotifierMixin from '../../mixins/notifier'; import TooltipMixin from '../../mixins/tooltip'; diff --git a/app/app/components/document/editor-history.js b/app/app/components/document/editor-history.js index d42a1f33..815e656a 100644 --- a/app/app/components/document/editor-history.js +++ b/app/app/components/document/editor-history.js @@ -1,3 +1,14 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; export default Ember.Component.extend({ @@ -27,8 +38,11 @@ export default Ember.Component.extend({ didRender() { let self = this; - Ember.run.schedule('afterRender', function(){ - Mousetrap.bind('esc', function() { self.send('cancelAction'); return false;}); + Ember.run.schedule('afterRender', function() { + Mousetrap.bind('esc', function() { + self.send('cancelAction'); + return false; + }); }); }, @@ -45,15 +59,17 @@ export default Ember.Component.extend({ Ember.set(revision, 'selected', false); }); - let revision = _.findWhere(revisions, { id: revisionId}); + let revision = _.findWhere(revisions, { + id: revisionId + }); Ember.set(revision, 'selected', true); let self = this; this.get('documentService').getPageRevisionDiff(this.get('model.documentId'), this.get('model.pageId'), revisionId).then(function(response) { - self.set('busy', false); - self.set('diffReport', Ember.String.htmlSafe(response)); + self.set('busy', false); + self.set('diffReport', Ember.String.htmlSafe(response)); }); }, @@ -67,4 +83,4 @@ export default Ember.Component.extend({ } } } -}); +}); \ No newline at end of file diff --git a/app/app/components/document/page-heading.js b/app/app/components/document/page-heading.js index 165bcfb3..64b060b2 100644 --- a/app/app/components/document/page-heading.js +++ b/app/app/components/document/page-heading.js @@ -1,3 +1,14 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; import TooltipMixin from '../../mixins/tooltip'; diff --git a/app/app/components/document/page-wizard.js b/app/app/components/document/page-wizard.js index 5669b3df..74bda081 100644 --- a/app/app/components/document/page-wizard.js +++ b/app/app/components/document/page-wizard.js @@ -1,43 +1,67 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; +import NotifierMixin from '../../mixins/notifier'; -export default Ember.Component.extend({ - title: "", - contentType: "", +export default Ember.Component.extend(NotifierMixin, { + title: "New Section", + contentType: "", - didReceiveAttrs() { - let section = this.get("sections").get('firstObject'); - section.set("selected", true); - }, + didReceiveAttrs() { + let section = this.get("sections").get('firstObject'); + section.set("selected", true); + }, - didInsertElement() { - $("#page-title").removeClass("error").focus(); - }, + didInsertElement() { + $("#page-title").removeClass("error").focus(); + }, - actions: { - setOption(id) { - let sections = this.get("sections"); + actions: { + setOption(id) { + let sections = this.get("sections"); - sections.forEach(function(option) { - Ember.set(option, 'selected', option.id === id); - }); + sections.forEach(function(option) { + Ember.set(option, 'selected', option.id === id); + }); - this.set("sections", sections); - }, + this.set("sections", sections); - onCancel() { - this.attrs.onCancel(); - }, + if (this.session.get('popupBlocked')) { + this.showNotification("Hmm, looks like your browser is blocking popups..."); + } + }, - onAction() { - let title = this.get("title"); - let contentType = this.get("sections").findBy("selected", true).contentType; + onCancel() { + this.attrs.onCancel(); + }, - if (is.empty(title)) { - $("#page-title").addClass("error").focus(); + onAction() { + let title = this.get("title"); + let section = this.get("sections").findBy("selected", true); + let contentType = section.contentType; + + if (section.preview) { + this.showNotification("Coming soon!"); return; } - this.attrs.onAction(title, contentType); - } - } + if (is.empty(title)) { + $("#page-title").addClass("error").focus(); + return; + } + + this.audit.record('added section' + section.contentType); + + this.attrs.onAction(title, contentType); + } + } }); diff --git a/app/app/components/document/tag-editor.js b/app/app/components/document/tag-editor.js index 9a212f93..1d189887 100644 --- a/app/app/components/document/tag-editor.js +++ b/app/app/components/document/tag-editor.js @@ -1,3 +1,14 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; export default Ember.Component.extend({ @@ -6,7 +17,7 @@ export default Ember.Component.extend({ isEditor: false, newTag: "", maxTags: 3, - canAdd: false, + canAdd: false, didInitAttrs() { let tagz = []; @@ -21,61 +32,61 @@ export default Ember.Component.extend({ } this.set('tagz', tagz); - this.set('canAdd', this.get('isEditor') && this.get('tagz').get('length') < 3); + this.set('canAdd', this.get('isEditor') && this.get('tagz').get('length') < 3); }, - didUpdateAttrs() { - this.set('canAdd', this.get('isEditor') && this.get('tagz').get('length') < 3); - }, + didUpdateAttrs() { + this.set('canAdd', this.get('isEditor') && this.get('tagz').get('length') < 3); + }, - didInsertElement() { + didInsertElement() { - }, + }, - willDestroyElement() { - $("#add-tag-field").off("keydown"); - }, + willDestroyElement() { + $("#add-tag-field").off("keydown"); + }, actions: { - onTagEditor() { - $("#add-tag-field").off("keydown").on("keydown", function(e) { - if (e.shiftKey) { - return false; - } + onTagEditor() { + $("#add-tag-field").off("keydown").on("keydown", function(e) { + if (e.shiftKey) { + return false; + } - if (e.which === 13 || e.which === 45 || e.which === 189 || e.which === 8 || e.which === 127 || (e.which >= 65 && e.which <= 90) || (e.which >= 97 && e.which <= 122) || (e.which >= 48 && e.which <= 57)) { - return true; - } + if (e.which === 13 || e.which === 45 || e.which === 189 || e.which === 8 || e.which === 127 || (e.which >= 65 && e.which <= 90) || (e.which >= 97 && e.which <= 122) || (e.which >= 48 && e.which <= 57)) { + return true; + } - return false; - }); - }, + return false; + }); + }, - addTag() { - let tags = this.get("tagz"); - let tag = this.get('newTag'); - tag = tag.toLowerCase().trim(); + addTag() { + let tags = this.get("tagz"); + let tag = this.get('newTag'); + tag = tag.toLowerCase().trim(); - // empty or dupe? - if (tag.length === 0 || _.contains(tags, tag) || tags.length >= this.get('maxTags') || tag.startsWith('-')) { - return false; - } + // empty or dupe? + if (tag.length === 0 || _.contains(tags, tag) || tags.length >= this.get('maxTags') || tag.startsWith('-')) { + return false; + } - tags.pushObject(tag); - this.set('tagz', tags); - this.set('newTag', ''); + tags.pushObject(tag); + this.set('tagz', tags); + this.set('newTag', ''); - let save = "#"; - _.each(tags, function(tag) { - save = save + tag + "#"; - }); + let save = "#"; + _.each(tags, function(tag) { + save = save + tag + "#"; + }); - this.get('onChange')(save); + this.get('onChange')(save); - this.audit.record('added-tag'); + this.audit.record('added-tag'); - return true; - }, + return true; + }, // removeTag removes specified tag from the list of tags associated with this document. removeTag(tagToRemove) { @@ -97,4 +108,4 @@ export default Ember.Component.extend({ this.audit.record('removed tag'); }, } -}); +}); \ No newline at end of file diff --git a/app/app/components/dropdown-dialog.js b/app/app/components/dropdown-dialog.js index f08ecfbf..09c6e1f9 100644 --- a/app/app/components/dropdown-dialog.js +++ b/app/app/components/dropdown-dialog.js @@ -1,29 +1,39 @@ -// Copyright (c) 2015 Documize Inc. +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; import stringUtil from '../utils/string'; export default Ember.Component.extend({ - drop: null, + drop: null, target: null, button: "Delete", - color: "flat-red", - button2: "", - color2: "2", + color: "flat-red", + button2: "", + color2: "2", open: "click", position: 'bottom right', showCancel: true, contentId: "", - focusOn: null, // is there an input field we need to focus? - selectOn: null, // is there an input field we need to select? - onOpenCallback: null, // callback when opened - onAction: null, - onAction2: null, - offset: "5px 0", - targetOffset: "10px 0", + focusOn: null, // is there an input field we need to focus? + selectOn: null, // is there an input field we need to select? + onOpenCallback: null, // callback when opened + onAction: null, + onAction2: null, + offset: "5px 0", + targetOffset: "10px 0", - hasSecondButton: Ember.computed('button2', 'color2', function() { - return is.not.empty(this.get('button2')) && is.not.empty(this.get('color2')); - }), + hasSecondButton: Ember.computed('button2', 'color2', function() { + return is.not.empty(this.get('button2')) && is.not.empty(this.get('color2')); + }), didReceiveAttrs() { this.set("contentId", 'dropdown-dialog-' + stringUtil.makeId(10)); @@ -37,35 +47,35 @@ export default Ember.Component.extend({ target: document.getElementById(self.get('target')), content: self.$(".dropdown-dialog")[0], classes: 'drop-theme-basic', - position: self.get('position'), + position: self.get('position'), openOn: self.get('open'), - tetherOptions: { + tetherOptions: { offset: self.offset, targetOffset: self.targetOffset }, - remove: true + remove: true }); - self.set('drop', drop); + self.set('drop', drop); - drop.on('open', function() { - if (is.not.null(self.get("focusOn"))) { - document.getElementById(self.get("focusOn")).focus(); - } + drop.on('open', function() { + if (is.not.null(self.get("focusOn"))) { + document.getElementById(self.get("focusOn")).focus(); + } - if (is.not.null(self.get("selectOn"))) { - document.getElementById(self.get("selectOn")).select(); - } + if (is.not.null(self.get("selectOn"))) { + document.getElementById(self.get("selectOn")).select(); + } - if (is.not.null(self.get("onOpenCallback"))) { - self.attrs.onOpenCallback(drop); - } - }); + if (is.not.null(self.get("onOpenCallback"))) { + self.attrs.onOpenCallback(drop); + } + }); }, - willDestroyElement() { - this.get('drop').destroy(); - }, + willDestroyElement() { + this.get('drop').destroy(); + }, actions: { onCancel() { @@ -73,9 +83,9 @@ export default Ember.Component.extend({ }, onAction() { - if (this.get('onAction') === null) { - return; - } + if (this.get('onAction') === null) { + return; + } let close = this.attrs.onAction(); @@ -84,10 +94,10 @@ export default Ember.Component.extend({ } }, - onAction2() { - if (this.get('onAction2') === null) { - return; - } + onAction2() { + if (this.get('onAction2') === null) { + return; + } let close = this.attrs.onAction2(); @@ -96,4 +106,4 @@ export default Ember.Component.extend({ } } } -}); +}); \ No newline at end of file diff --git a/app/app/components/dropdown-menu.js b/app/app/components/dropdown-menu.js index e1dd2554..38fb9f9d 100644 --- a/app/app/components/dropdown-menu.js +++ b/app/app/components/dropdown-menu.js @@ -1,4 +1,14 @@ -// Copyright (c) 2015 Documize Inc. +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; import stringUtil from '../utils/string'; @@ -12,9 +22,9 @@ export default Ember.Component.extend({ didReceiveAttrs() { this.set("contentId", 'dropdown-menu-' + stringUtil.makeId(10)); - // if (this.session.get('isMobile')) { - // this.set('open', "click"); - // } + // if (this.session.get('isMobile')) { + // this.set('open', "click"); + // } }, didInsertElement() { @@ -25,7 +35,7 @@ export default Ember.Component.extend({ target: document.getElementById(self.get('target')), content: self.$(".dropdown-menu")[0], classes: 'drop-theme-menu', - position: self.get('position'), + position: self.get('position'), openOn: self.get('open'), tetherOptions: { offset: "5px 0", @@ -36,7 +46,7 @@ export default Ember.Component.extend({ self.set('drop', drop); }, - willDestroyElement() { - this.get('drop').destroy(); - } -}); + willDestroyElement() { + this.get('drop').destroy(); + } +}); \ No newline at end of file diff --git a/app/app/components/focus-input.js b/app/app/components/focus-input.js index 0043abf2..d42d7360 100644 --- a/app/app/components/focus-input.js +++ b/app/app/components/focus-input.js @@ -1,7 +1,18 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; export default Ember.TextField.extend({ becomeFocused: function() { this.$().focus(); }.on('didInsertElement') -}); +}); \ No newline at end of file diff --git a/app/app/components/focus-textarea.js b/app/app/components/focus-textarea.js index e0f05883..e64feca9 100644 --- a/app/app/components/focus-textarea.js +++ b/app/app/components/focus-textarea.js @@ -1,7 +1,18 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; export default Ember.TextArea.extend({ becomeFocused: function() { this.$().focus(); }.on('didInsertElement') -}); +}); \ No newline at end of file diff --git a/app/app/components/folder/document-tags.js b/app/app/components/folder/document-tags.js index 8f2d7a7f..1fda80d8 100644 --- a/app/app/components/folder/document-tags.js +++ b/app/app/components/folder/document-tags.js @@ -1,3 +1,14 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; export default Ember.Component.extend({ @@ -24,4 +35,4 @@ export default Ember.Component.extend({ this.get('filterByTag')(tag); } } -}); +}); \ No newline at end of file diff --git a/app/app/components/folder/documents-list.js b/app/app/components/folder/documents-list.js index 196cb8b2..ebc4cba3 100644 --- a/app/app/components/folder/documents-list.js +++ b/app/app/components/folder/documents-list.js @@ -1,3 +1,14 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; export default Ember.Component.extend({ @@ -9,22 +20,22 @@ export default Ember.Component.extend({ actions: { selectDocument(documentId) { - let doc = this.get('documents').findBy('id', documentId); - let list = this.get('selectedDocuments'); + let doc = this.get('documents').findBy('id', documentId); + let list = this.get('selectedDocuments'); - doc.set('selected', !doc.get('selected')); + doc.set('selected', !doc.get('selected')); - if (doc.get('selected')) { - list.push(documentId); - } else { - var index = list.indexOf(documentId); - if (index > -1) { - list.splice(index, 1); - } - } + if (doc.get('selected')) { + list.push(documentId); + } else { + var index = list.indexOf(documentId); + if (index > -1) { + list.splice(index, 1); + } + } - this.set('selectedDocuments', list); - this.get('onDocumentsChecked')(list); + this.set('selectedDocuments', list); + this.get('onDocumentsChecked')(list); } } -}); +}); \ No newline at end of file diff --git a/app/app/components/folder/folder-dashboard.js b/app/app/components/folder/folder-dashboard.js index a7be4454..0f31e243 100644 --- a/app/app/components/folder/folder-dashboard.js +++ b/app/app/components/folder/folder-dashboard.js @@ -1,3 +1,14 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; import NotifierMixin from '../../mixins/notifier'; import TooltipMixin from '../../mixins/tooltip'; @@ -12,9 +23,9 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, { hasSelectedDocuments: false, selectedDocuments: [], importedDocuments: [], - savedTemplates: [], + savedTemplates: [], isFolderOwner: false, - moveFolderId: "", + moveFolderId: "", hasDocuments: function() { return this.documents.get('length') > 0; @@ -26,38 +37,44 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, { this.set('importedDocuments', []); this.set('isFolderOwner', this.get('folder.userId') === this.session.user.id); - let self = this; + let self = this; - this.get('templateService').getSavedTemplates().then(function(saved) { - let emptyTemplate = { id: "0", title: "Empty document", selected: true }; - saved.unshiftObject(emptyTemplate); - self.set('savedTemplates', saved); - }); + this.get('templateService').getSavedTemplates().then(function(saved) { + let emptyTemplate = { + id: "0", + title: "Empty document", + selected: true + }; + saved.unshiftObject(emptyTemplate); + self.set('savedTemplates', saved); + }); - let targets = _.reject(this.get('folders'), { id: this.get('folder').get('id') }); - this.set('movedFolderOptions', targets); + let targets = _.reject(this.get('folders'), { + id: this.get('folder').get('id') + }); + this.set('movedFolderOptions', targets); }, - didRender() { - if (this.get('hasSelectedDocuments')) { - this.addTooltip(document.getElementById("move-documents-button")); - this.addTooltip(document.getElementById("delete-documents-button")); - } else { - if (this.get('isFolderOwner')) { - this.addTooltip(document.getElementById("folder-share-button")); - this.addTooltip(document.getElementById("folder-settings-button")); - } - if (this.get('folderService').get('canEditCurrentFolder')) { - this.addTooltip(document.getElementById("start-document-button")); - } - } - }, + didRender() { + if (this.get('hasSelectedDocuments')) { + this.addTooltip(document.getElementById("move-documents-button")); + this.addTooltip(document.getElementById("delete-documents-button")); + } else { + if (this.get('isFolderOwner')) { + this.addTooltip(document.getElementById("folder-share-button")); + this.addTooltip(document.getElementById("folder-settings-button")); + } + if (this.get('folderService').get('canEditCurrentFolder')) { + this.addTooltip(document.getElementById("start-document-button")); + } + } + }, - willDestroyElement() { - this.destroyTooltips(); - }, + willDestroyElement() { + this.destroyTooltips(); + }, - navigateToDocument(document){ + navigateToDocument(document) { this.attrs.showDocument(this.get('folder'), document); }, @@ -67,14 +84,14 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, { this.set('hasSelectedDocuments', documents.length > 0); }, - onEditTemplate(template) { - this.navigateToDocument(template); - }, + onEditTemplate(template) { + this.navigateToDocument(template); + }, - onDocumentTemplate(id /*, title, type*/) { + onDocumentTemplate(id /*, title, type*/ ) { let self = this; - this.send("showNotification", "Creating"); + this.send("showNotification", "Creating"); this.get('templateService').importSavedTemplate(this.folder.get('id'), id).then(function(document) { self.navigateToDocument(document); @@ -82,21 +99,21 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, { }, onDocumentImporting(filename) { - this.send("showNotification", `Importing ${filename}`); + this.send("showNotification", `Importing ${filename}`); let documents = this.get('importedDocuments'); documents.push(filename); this.set('importedDocuments', documents); }, - onDocumentImported(filename/*, document*/) { - this.send("showNotification", `${filename} ready`); + onDocumentImported(filename /*, document*/ ) { + this.send("showNotification", `${filename} ready`); let documents = this.get('importedDocuments'); documents.pop(filename); this.set('importedDocuments', documents); - this.attrs.refresh(); + this.attrs.refresh(); if (documents.length === 0) { // this.get('showDocument')(this.get('folder'), document); @@ -115,31 +132,31 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, { this.set('selectedDocuments', []); this.set('hasSelectedDocuments', false); - this.send("showNotification", "Deleted"); + this.send("showNotification", "Deleted"); - return true; + return true; }, - setMoveFolder(folderId) { - this.set('moveFolderId', folderId); + setMoveFolder(folderId) { + this.set('moveFolderId', folderId); - let folders = this.get('folders'); + let folders = this.get('folders'); - folders.forEach(folder => { - folder.set('selected', folder.id === folderId); - }); - }, + folders.forEach(folder => { + folder.set('selected', folder.id === folderId); + }); + }, moveDocuments() { - if (this.get("moveFolderId") === "") { - return false; - } + if (this.get("moveFolderId") === "") { + return false; + } this.get('onMoveDocument')(this.get('selectedDocuments'), this.get('moveFolderId')); - this.set("moveFolderId", ""); - this.send("showNotification", "Moved"); + this.set("moveFolderId", ""); + this.send("showNotification", "Moved"); - return true; + return true; } } -}); +}); \ No newline at end of file diff --git a/app/app/components/folder/folder-settings.js b/app/app/components/folder/folder-settings.js index 029351cf..7460bbd7 100644 --- a/app/app/components/folder/folder-settings.js +++ b/app/app/components/folder/folder-settings.js @@ -1,3 +1,14 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; export default Ember.Component.extend({ @@ -28,16 +39,16 @@ export default Ember.Component.extend({ actions: { rename() { if (is.empty(this.folder.get('name'))) { - $("#folderName").addClass("error").focus(); + $("#folderName").addClass("error").focus(); return; } - this.sendAction("onRename", this.folder); + this.sendAction("onRename", this.folder); }, remove() { if (is.null(this.get('moveTarget'))) { - $("#delete-target > select").addClass("error").focus(); + $("#delete-target > select").addClass("error").focus(); return; } @@ -52,10 +63,10 @@ export default Ember.Component.extend({ message = this.getDefaultInvitationMessage(); } - if (email.length === 0) { - $("#inviteEmail").addClass("error").focus(); - return; - } + if (email.length === 0) { + $("#inviteEmail").addClass("error").focus(); + return; + } var result = { Message: message, @@ -75,7 +86,7 @@ export default Ember.Component.extend({ result.Recipients.push(email); } - this.set('inviteEmail', ""); + this.set('inviteEmail', ""); this.sendAction("onShare", result); }, @@ -95,4 +106,4 @@ export default Ember.Component.extend({ this.sendAction("onPermission", this.get('folder'), message, this.get('permissions')); } } -}); +}); \ No newline at end of file diff --git a/app/app/components/folder/folders-list.js b/app/app/components/folder/folders-list.js index b366a074..7f730850 100644 --- a/app/app/components/folder/folders-list.js +++ b/app/app/components/folder/folders-list.js @@ -1,62 +1,72 @@ -// Copyright (c) 2015 Documize Inc. +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; import constants from '../../utils/constants'; import TooltipMixin from '../../mixins/tooltip'; export default Ember.Component.extend(TooltipMixin, { - folderService: Ember.inject.service('folder'), - publicFolders: [], - protectedFolders: [], - privateFolders: [], - hasPublicFolders: false, - hasProtectedFolders: false, - hasPrivateFolders: false, + folderService: Ember.inject.service('folder'), + publicFolders: [], + protectedFolders: [], + privateFolders: [], + hasPublicFolders: false, + hasProtectedFolders: false, + hasPrivateFolders: false, newFolder: "", - didInsertElement() { + didInsertElement() { this._super(...arguments); - if (this.session.authenticated) { - this.addTooltip(document.getElementById("add-folder-button")); - } - }, + if (this.session.authenticated) { + this.addTooltip(document.getElementById("add-folder-button")); + } + }, - didReceiveAttrs() { - let folders = this.get('folders'); - let self = this; + didReceiveAttrs() { + let folders = this.get('folders'); + let self = this; - // clear out state - this.set('publicFolders', []); - this.set('protectedFolders', []); - this.set('privateFolders', []); + // clear out state + this.set('publicFolders', []); + this.set('protectedFolders', []); + this.set('privateFolders', []); - _.each(folders, folder => { - if (folder.folderType === constants.FolderType.Public) { - let folders = self.get('publicFolders'); - folders.pushObject(folder); - self.set('publicFolders', folders); - } - if (folder.folderType === constants.FolderType.Private) { - let folders = self.get('privateFolders'); - folders.pushObject(folder); - self.set('privateFolders', folders); - } - if (folder.folderType === constants.FolderType.Protected) { - let folders = self.get('protectedFolders'); - folders.pushObject(folder); - self.set('protectedFolders', folders); - } - }); + _.each(folders, folder => { + if (folder.folderType === constants.FolderType.Public) { + let folders = self.get('publicFolders'); + folders.pushObject(folder); + self.set('publicFolders', folders); + } + if (folder.folderType === constants.FolderType.Private) { + let folders = self.get('privateFolders'); + folders.pushObject(folder); + self.set('privateFolders', folders); + } + if (folder.folderType === constants.FolderType.Protected) { + let folders = self.get('protectedFolders'); + folders.pushObject(folder); + self.set('protectedFolders', folders); + } + }); - this.set('hasPublicFolders', this.get('publicFolders.length') > 0); - this.set('hasPrivateFolders', this.get('privateFolders.length') > 0); - this.set('hasProtectedFolders', this.get('protectedFolders.length') > 0); - }, + this.set('hasPublicFolders', this.get('publicFolders.length') > 0); + this.set('hasPrivateFolders', this.get('privateFolders.length') > 0); + this.set('hasProtectedFolders', this.get('protectedFolders.length') > 0); + }, - willDestroyElement() { - this.destroyTooltips(); - }, + willDestroyElement() { + this.destroyTooltips(); + }, - actions: { + actions: { addFolder() { var folderName = this.get('newFolder'); @@ -65,10 +75,10 @@ export default Ember.Component.extend(TooltipMixin, { return false; } - this.attrs.onFolderAdd(folderName); + this.attrs.onFolderAdd(folderName); - this.set('newFolder', ""); - return true; + this.set('newFolder', ""); + return true; } } -}); +}); \ No newline at end of file diff --git a/app/app/components/folder/start-document.js b/app/app/components/folder/start-document.js index 6b264beb..f6b5b322 100644 --- a/app/app/components/folder/start-document.js +++ b/app/app/components/folder/start-document.js @@ -1,89 +1,103 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; import NotifierMixin from '../../mixins/notifier'; export default Ember.Component.extend(NotifierMixin, { - tagName: 'span', - selectedTemplate: { id: "0" }, - canEditTemplate: "", + tagName: 'span', + selectedTemplate: { + id: "0" + }, + canEditTemplate: "", - didReceiveAttrs() { - this.send('setTemplate', this.get('savedTemplates')[0]); - }, + didReceiveAttrs() { + this.send('setTemplate', this.get('savedTemplates')[0]); + }, actions: { - setTemplate(chosen) { - if (is.undefined(chosen)) { - return; - } + setTemplate(chosen) { + if (is.undefined(chosen)) { + return; + } - this.set('selectedTemplate', chosen); - this.set('canEditTemplate', chosen.id !== "0" ? "Edit" : ""); + this.set('selectedTemplate', chosen); + this.set('canEditTemplate', chosen.id !== "0" ? "Edit" : ""); - let templates = this.get('savedTemplates'); + let templates = this.get('savedTemplates'); - templates.forEach(template => { - Ember.set(template, 'selected', template.id === chosen.id); - }); - }, + templates.forEach(template => { + Ember.set(template, 'selected', template.id === chosen.id); + }); + }, - editTemplate() { - let template = this.get('selectedTemplate'); + editTemplate() { + let template = this.get('selectedTemplate'); - this.audit.record('edited-saved-template'); - this.attrs.onEditTemplate(template); + this.audit.record('edited-saved-template'); + this.attrs.onEditTemplate(template); - return true; - }, + return true; + }, - startDocument() { - let template = this.get('selectedTemplate'); + startDocument() { + let template = this.get('selectedTemplate'); - this.audit.record('used-saved-template'); + this.audit.record('used-saved-template'); this.attrs.onDocumentTemplate(template.id, template.title, "private"); - return true; - }, + return true; + }, - onOpenCallback() { - let self = this; - let folderId = this.get('folder.id'); - let importUrl = this.session.appMeta.getUrl('import/folder/' + folderId); + onOpenCallback() { + let self = this; + let folderId = this.get('folder.id'); + let importUrl = this.session.appMeta.getUrl('import/folder/' + folderId); - let dzone = new Dropzone("#upload-documents", { - headers: {'Authorization': 'Bearer ' + self.session.getSessionItem('token') }, - url: importUrl, - method: "post", - paramName: 'attachment', - acceptedFiles: ".doc,.docx,.txt,.md,.markdown", - clickable: true, - maxFilesize: 10, - parallelUploads: 3, - uploadMultiple: false, - addRemoveLinks: false, - autoProcessQueue: true, + let dzone = new Dropzone("#upload-documents", { + headers: { + 'Authorization': 'Bearer ' + self.session.getSessionItem('token') + }, + url: importUrl, + method: "post", + paramName: 'attachment', + acceptedFiles: ".doc,.docx,.txt,.md,.markdown", + clickable: true, + maxFilesize: 10, + parallelUploads: 3, + uploadMultiple: false, + addRemoveLinks: false, + autoProcessQueue: true, - init: function() { - this.on("success", function(document) { + init: function() { + this.on("success", function(document) { self.attrs.onDocumentImported(document.name, document); - }); + }); this.on("error", function(x) { - console.log("Conversion failed for ", x.name, " obj ",x); // TODO proper error handling - }); - - this.on("queuecomplete", function() { - }); + console.log("Conversion failed for ", x.name, " obj ", x); // TODO proper error handling + }); - this.on("addedfile", function(file) { - self.attrs.onDocumentImporting(file.name); - self.audit.record('converted-document'); - }); - } - }); + this.on("queuecomplete", function() {}); - dzone.on("complete", function(file) { - dzone.removeFile(file); - }); - } - } -}); + this.on("addedfile", function(file) { + self.attrs.onDocumentImporting(file.name); + self.audit.record('converted-document'); + }); + } + }); + + dzone.on("complete", function(file) { + dzone.removeFile(file); + }); + } + } +}); \ No newline at end of file diff --git a/app/app/components/header/message-box.js b/app/app/components/header/message-box.js index 926b6130..a5417462 100644 --- a/app/app/components/header/message-box.js +++ b/app/app/components/header/message-box.js @@ -1,4 +1,14 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; -export default Ember.Component.extend({ -}); +export default Ember.Component.extend({}); \ No newline at end of file diff --git a/app/app/components/header/page-navigation.js b/app/app/components/header/page-navigation.js index f7722dac..c161fed1 100644 --- a/app/app/components/header/page-navigation.js +++ b/app/app/components/header/page-navigation.js @@ -1,13 +1,23 @@ -// Copyright (c) 2015 Documize Inc. +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; import netUtil from '../../utils/net'; export default Ember.Component.extend({ - dashboardMode: false, - searchMode: false, - profileMode: false, - settingsMode: false, - folderMode: false, + dashboardMode: false, + searchMode: false, + profileMode: false, + settingsMode: false, + folderMode: false, documentMode: false, didInitAttrs() { @@ -22,7 +32,7 @@ export default Ember.Component.extend({ actions: { switchAccount(domain) { this.audit.record('switched-account'); - window.location.href = netUtil.getAppUrl(domain); + window.location.href = netUtil.getAppUrl(domain); } } -}); +}); \ No newline at end of file diff --git a/app/app/components/header/search-box.js b/app/app/components/header/search-box.js index a9a5dd22..67cc0f65 100644 --- a/app/app/components/header/search-box.js +++ b/app/app/components/header/search-box.js @@ -1,3 +1,14 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; export default Ember.Component.extend({ @@ -14,4 +25,4 @@ export default Ember.Component.extend({ fetch() { this.get('onFilter')(this.get('filter')); }, -}); +}); \ No newline at end of file diff --git a/app/app/components/layout/page-container.js b/app/app/components/layout/page-container.js index 926b6130..a5417462 100644 --- a/app/app/components/layout/page-container.js +++ b/app/app/components/layout/page-container.js @@ -1,4 +1,14 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; -export default Ember.Component.extend({ -}); +export default Ember.Component.extend({}); \ No newline at end of file diff --git a/app/app/components/layout/page-content.js b/app/app/components/layout/page-content.js index 926b6130..a5417462 100644 --- a/app/app/components/layout/page-content.js +++ b/app/app/components/layout/page-content.js @@ -1,4 +1,14 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; -export default Ember.Component.extend({ -}); +export default Ember.Component.extend({}); \ No newline at end of file diff --git a/app/app/components/layout/page-sidebar.js b/app/app/components/layout/page-sidebar.js index 926b6130..a5417462 100644 --- a/app/app/components/layout/page-sidebar.js +++ b/app/app/components/layout/page-sidebar.js @@ -1,4 +1,14 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; -export default Ember.Component.extend({ -}); +export default Ember.Component.extend({}); \ No newline at end of file diff --git a/app/app/components/onboard/share-folder.js b/app/app/components/onboard/share-folder.js index 62eda811..0429b897 100644 --- a/app/app/components/onboard/share-folder.js +++ b/app/app/components/onboard/share-folder.js @@ -1,3 +1,14 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; import encodingUtil from '../../utils/encoding'; import netUtil from '../../utils/net'; @@ -16,31 +27,24 @@ export default Ember.Component.extend({ $("#stage-1-firstname").focus(); // Stage 1 - person name keypress handler - $("#stage-1-firstname, #stage-1-lastname").keyup(function() - { - if (!$("#stage-1-firstname").val() || !$("#stage-1-lastname").val()) - { + $("#stage-1-firstname, #stage-1-lastname").keyup(function() { + if (!$("#stage-1-firstname").val() || !$("#stage-1-lastname").val()) { $(".name-status").attr("src", "assets/img/onboard/person-red.png"); - } - else - { + } else { $(".name-status").attr("src", "assets/img/onboard/person-green.png"); } }); // Stage 1 - finish - $("#stage-1-next").off('click').on('click', function() - { - if (!$("#stage-1-firstname").val()) - { + $("#stage-1-next").off('click').on('click', function() { + if (!$("#stage-1-firstname").val()) { $("#stage-1-firstname").focus(); $("#stage-1-firstname").addClass("error"); $(".name-status").attr("src", "assets/img/onboard/person-red.png"); return; } - if (!$("#stage-1-lastname").val()) - { + if (!$("#stage-1-lastname").val()) { $("#stage-1-lastname").focus(); $("#stage-1-lastname").addClass("error"); $(".name-status").attr("src", "assets/img/onboard/person-red.png"); @@ -49,8 +53,7 @@ export default Ember.Component.extend({ self.set('processing', false); - $(".stage-1").fadeOut("slow", function() - { + $(".stage-1").fadeOut("slow", function() { if (self.get('processing')) { return; } @@ -61,15 +64,11 @@ export default Ember.Component.extend({ $("#stage-2-password").focus(); // Stage 2 - password keypress handler - $("#stage-2-password-confirm").keyup(function() - { + $("#stage-2-password-confirm").keyup(function() { if ($("#stage-2-password").val().length < 6 || $("#stage-2-password").val().length > 50 || - ($("#stage-2-password").val() !== $("#stage-2-password-confirm").val())) - { + ($("#stage-2-password").val() !== $("#stage-2-password-confirm").val())) { $(".password-status").attr("src", "assets/img/onboard/lock-red.png"); - } - else - { + } else { $(".password-status").attr("src", "assets/img/onboard/lock-green.png"); } }); @@ -77,24 +76,20 @@ export default Ember.Component.extend({ }); // Stage 2 - finish - $("#stage-2-next").off('click').on('click', function() - { - if (!$("#stage-2-password").val() || $("#stage-2-password").val().length < 6 || $("#stage-2-password").val().length > 50) - { + $("#stage-2-next").off('click').on('click', function() { + if (!$("#stage-2-password").val() || $("#stage-2-password").val().length < 6 || $("#stage-2-password").val().length > 50) { $("#stage-2-password").focus(); $("#stage-2-password").addClass("error"); return; } - if (!$("#stage-2-password-confirm").val()) - { + if (!$("#stage-2-password-confirm").val()) { $("#stage-2-password-confirm").focus(); $("#stage-2-password-confirm").addClass("error"); return; } - if ($("#stage-2-password-confirm").val() !== $("#stage-2-password").val()) - { + if ($("#stage-2-password-confirm").val() !== $("#stage-2-password").val()) { $(".mismatch").show(); $(".password-status").attr("src", "assets/img/onboard/lock-red.png"); return; @@ -102,8 +97,7 @@ export default Ember.Component.extend({ self.set('processing', false); - $(".stage-2").fadeOut("slow", function() - { + $(".stage-2").fadeOut("slow", function() { if (self.get('processing')) { return; } @@ -113,7 +107,7 @@ export default Ember.Component.extend({ $(".stage-3").fadeIn(); $("#spinner-1").show(); - var payload = '{ "Password": "' + $("#stage-2-password").val() + '", "Serial": "' + self.serial + '", "Firstname": "' + $("#stage-1-firstname").val() + '", "Lastname": "' + $("#stage-1-lastname").val() + '" }'; + var payload = '{ "Password": "' + $("#stage-2-password").val() + '", "Serial": "' + self.serial + '", "Firstname": "' + $("#stage-1-firstname").val() + '", "Lastname": "' + $("#stage-1-lastname").val() + '" }'; var password = $("#stage-2-password").val(); self.get('folderService').onboard(self.folderId, payload).then(function(user) { @@ -127,4 +121,4 @@ export default Ember.Component.extend({ }); }); }, -}); +}); \ No newline at end of file diff --git a/app/app/components/search/search-results.js b/app/app/components/search/search-results.js index 0ff706e2..dca722aa 100644 --- a/app/app/components/search/search-results.js +++ b/app/app/components/search/search-results.js @@ -1,4 +1,14 @@ -// Copyright (c) 2015 Documize Inc. +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; export default Ember.Component.extend({ @@ -7,7 +17,7 @@ export default Ember.Component.extend({ didReceiveAttrs() { let count = this.get('results').length; - let self = this; + let self = this; switch (count) { case 0: @@ -20,4 +30,4 @@ export default Ember.Component.extend({ self.set("resultPhrase", `${count} references found`); } } -}); +}); \ No newline at end of file diff --git a/app/app/components/search/tag-list.js b/app/app/components/search/tag-list.js index 8e65d6ee..fb8a5d32 100644 --- a/app/app/components/search/tag-list.js +++ b/app/app/components/search/tag-list.js @@ -1,3 +1,14 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; export default Ember.Component.extend({ @@ -18,4 +29,4 @@ export default Ember.Component.extend({ this.set('tagz', tagz); } -}); +}); \ No newline at end of file diff --git a/app/app/components/section/base-editor.js b/app/app/components/section/base-editor.js index 79620938..35eb2c6f 100644 --- a/app/app/components/section/base-editor.js +++ b/app/app/components/section/base-editor.js @@ -1,3 +1,14 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; export default Ember.Component.extend({ diff --git a/app/app/components/section/base-renderer.js b/app/app/components/section/base-renderer.js index d4702603..041d0751 100644 --- a/app/app/components/section/base-renderer.js +++ b/app/app/components/section/base-renderer.js @@ -1,7 +1,18 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; export default Ember.Component.extend({ - didReceiveAttrs() { - this.set('rendererType', 'section/' + this.get('page.contentType') + '/type-renderer'); - }, -}); + didReceiveAttrs() { + this.set('rendererType', 'section/' + this.get('page.contentType') + '/type-renderer'); + }, +}); \ No newline at end of file diff --git a/app/app/components/section/code/type-editor.js b/app/app/components/section/code/type-editor.js index 49c4e559..599ed147 100644 --- a/app/app/components/section/code/type-editor.js +++ b/app/app/components/section/code/type-editor.js @@ -1,3 +1,14 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; import TooltipMixin from '../../../mixins/tooltip'; diff --git a/app/app/components/section/code/type-renderer.js b/app/app/components/section/code/type-renderer.js index ec1f47b1..af256e06 100644 --- a/app/app/components/section/code/type-renderer.js +++ b/app/app/components/section/code/type-renderer.js @@ -1,3 +1,14 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; export default Ember.Component.extend({ diff --git a/app/app/components/section/gemini/type-editor.js b/app/app/components/section/gemini/type-editor.js index 321f40b2..14a265b9 100644 --- a/app/app/components/section/gemini/type-editor.js +++ b/app/app/components/section/gemini/type-editor.js @@ -1,8 +1,20 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; import NotifierMixin from '../../../mixins/notifier'; import TooltipMixin from '../../../mixins/tooltip'; +import SectionMixin from '../../../mixins/section'; -export default Ember.Component.extend(NotifierMixin, TooltipMixin, { +export default Ember.Component.extend(SectionMixin, NotifierMixin, TooltipMixin, { sectionService: Ember.inject.service('section'), isDirty: false, waiting: false, @@ -11,14 +23,6 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, { workspaces: [], config: {}, - fieldEditable: function() { - if (this.get('page.userId') !== this.session.user.id) { - return "readonly"; - } else { - return undefined; - } - }.property('config'), - didReceiveAttrs() { let config = {}; diff --git a/app/app/components/section/gemini/type-renderer.js b/app/app/components/section/gemini/type-renderer.js index 926b6130..a5417462 100644 --- a/app/app/components/section/gemini/type-renderer.js +++ b/app/app/components/section/gemini/type-renderer.js @@ -1,4 +1,14 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; -export default Ember.Component.extend({ -}); +export default Ember.Component.extend({}); \ No newline at end of file diff --git a/app/app/components/section/trello/type-editor.js b/app/app/components/section/trello/type-editor.js new file mode 100644 index 00000000..9f8b0f37 --- /dev/null +++ b/app/app/components/section/trello/type-editor.js @@ -0,0 +1,226 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + +/*global Trello*/ +import Ember from 'ember'; +import NotifierMixin from '../../../mixins/notifier'; +import TooltipMixin from '../../../mixins/tooltip'; +import SectionMixin from '../../../mixins/section'; + +export default Ember.Component.extend(SectionMixin, NotifierMixin, TooltipMixin, { + sectionService: Ember.inject.service('section'), + isDirty: false, + busy: false, + authenticated: false, + config: {}, + boards: null, + noBoards: false, + + boardStyle: Ember.computed('config.board', function() { + let board = this.get('config.board'); + + if (is.null(board) || is.undefined(board)) { + return "#4c4c4c"; + } + + let color = board.prefs.backgroundColor; + return Ember.String.htmlSafe("background-color: " + color); + }), + + didReceiveAttrs() { + let config = {}; + + try { + config = JSON.parse(this.get('meta.config')); + } + catch (e) {} + + if (is.empty(config)) { + config = { + appKey: "8e00492ee9a8934cfb8604d3a51f8f70", + token: "", + user: null, + board: null, + lists: [] + }; + } + + this.set('config', config); + + if (this.get('config.appKey') !== "" && this.get('config.token') !== "") { + this.send('auth'); + } + else { + Ember.$.getScript("https://api.trello.com/1/client.js?key=" + this.get('config.appKey'), function() { + Trello.deauthorize(); + }); + } + }, + + willDestroyElement() { + this.destroyTooltips(); + }, + + getBoardLists() { + this.set('busy', true); + + let self = this; + let boards = this.get('boards'); + let board = this.get('config.board'); + let page = this.get('page'); + + if (is.null(boards) || is.undefined(boards) || boards.length === 0) { + this.set('noBoards', true); + return; + } + + this.set('noBoards', false); + + if (is.null(board) || is.undefined(board)) { + if (boards.length) { + board = boards[0]; + this.set('config.board', board); + } + } + else { + this.set('config.board', boards.findBy('id', board.id)); + } + + this.get('sectionService').fetch(page, "lists", self.get('config')) + .then(function(lists) { + let savedLists = self.get('config.lists'); + if (savedLists === null) { + savedLists = []; + } + + lists.forEach(function(list) { + let saved = savedLists.findBy("id", list.id); + let included = true; + if (is.not.undefined(saved)) { + included = saved.included; + } + list.included = included; + }); + + self.set('config.lists', lists); + self.set('busy', false); + }, function(error) { //jshint ignore: line + self.set('busy', false); + self.set('authenticated', false); + self.showNotification("Unable to fetch board lists"); + console.log(error); + }); + }, + + actions: { + isDirty() { + return this.get('isDirty'); + }, + + onListCheckbox(id) { + let lists = this.get('config.lists'); + let list = lists.findBy('id', id); + + if (list !== null) { + Ember.set(list, 'included', !list.included); + } + }, + + auth() { + if (this.get('config.appKey') === "") { + $("#trello-appkey").addClass('error').focus(); + this.set('authenticated', false); + return; + } + + let self = this; + let page = this.get('page'); + + self.set('busy', true); + + Ember.$.getScript("https://api.trello.com/1/client.js?key=" + this.get('config.appKey'), function() { + Trello.authorize({ + type: "popup", + // interactive: false, + name: "Documize", + scope: { + read: true, + write: false + }, + expiration: "never", + persist: true, + success: function() { + self.set('authenticated', true); + self.set('config.token', Trello.token()); + self.set('busy', true); + + Trello.members.get("me", function(user) { + self.set('config.user', user); + }, function(error) { + console.log(error); + }); + + self.get('sectionService').fetch(page, "boards", self.get('config')) + .then(function(boards) { + self.set('busy', false); + self.set('boards', boards); + self.getBoardLists(); + }, function(error) { //jshint ignore: line + self.set('busy', false); + self.set('authenticated', false); + self.showNotification("Unable to fetch boards"); + console.log(error); + }); + }, + error: function(error) { + self.set('busy', false); + self.set('authenticated', false); + self.showNotification("Unable to authenticate"); + console.log(error); + } + }); + }); + }, + + onBoardChange(board) { + this.set('isDirty', true); + this.set('config.board', board); + this.set('config.lists', []); + this.getBoardLists(); + }, + + onCancel() { + this.attrs.onCancel(); + }, + + onAction(title) { + this.set('busy', true); + + let self = this; + let page = this.get('page'); + let meta = this.get('meta'); + page.set('title', title); + meta.set('rawBody', ''); + meta.set('config', JSON.stringify(this.get('config'))); + meta.set('externalSource', true); + + this.get('sectionService').fetch(page, "cards", this.get('config')) + .then(function(response) { + meta.set('rawBody', JSON.stringify(response)); + self.set('busy', false); + self.attrs.onAction(page, meta); + }, function(reason) { //jshint ignore: line + self.set('busy', false); + self.attrs.onAction(page, meta); + }); + } + } +}); diff --git a/app/app/components/section/trello/type-renderer.js b/app/app/components/section/trello/type-renderer.js new file mode 100644 index 00000000..a5417462 --- /dev/null +++ b/app/app/components/section/trello/type-renderer.js @@ -0,0 +1,14 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + +import Ember from 'ember'; + +export default Ember.Component.extend({}); \ No newline at end of file diff --git a/app/app/components/section/wysiwyg/type-editor.js b/app/app/components/section/wysiwyg/type-editor.js index 4977cd89..5500aa77 100644 --- a/app/app/components/section/wysiwyg/type-editor.js +++ b/app/app/components/section/wysiwyg/type-editor.js @@ -1,3 +1,14 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; export default Ember.Component.extend({ diff --git a/app/app/components/section/wysiwyg/type-renderer.js b/app/app/components/section/wysiwyg/type-renderer.js index 926b6130..a5417462 100644 --- a/app/app/components/section/wysiwyg/type-renderer.js +++ b/app/app/components/section/wysiwyg/type-renderer.js @@ -1,4 +1,14 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; -export default Ember.Component.extend({ -}); +export default Ember.Component.extend({}); \ No newline at end of file diff --git a/app/app/components/settings/user-list.js b/app/app/components/settings/user-list.js index 992c4579..8d92bd99 100644 --- a/app/app/components/settings/user-list.js +++ b/app/app/components/settings/user-list.js @@ -1,133 +1,147 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; export default Ember.Component.extend({ - editUser: null, - deleteUser: null, - drop: null, - password: {}, + editUser: null, + deleteUser: null, + drop: null, + password: {}, - didReceiveAttrs() { - this.users.forEach(user => { - user.set('me', user.get('id') === this.session.user.id); - }); - }, + didReceiveAttrs() { + this.users.forEach(user => { + user.set('me', user.get('id') === this.session.user.id); + }); + }, - willDestroyElement() { - let drop = this.get('drop'); + willDestroyElement() { + let drop = this.get('drop'); - if (is.not.null(drop)) { - drop.destroy(); - } - }, + if (is.not.null(drop)) { + drop.destroy(); + } + }, - actions: { - toggleActive(id) { - let user = this.users.findBy("id", id); - user.set('active', !user.get('active')); - this.attrs.onSave(user); - }, + actions: { + toggleActive(id) { + let user = this.users.findBy("id", id); + user.set('active', !user.get('active')); + this.attrs.onSave(user); + }, - toggleEditor(id) { - let user = this.users.findBy("id", id); - user.set('editor', !user.get('editor')); - this.attrs.onSave(user); - }, + toggleEditor(id) { + let user = this.users.findBy("id", id); + user.set('editor', !user.get('editor')); + this.attrs.onSave(user); + }, - toggleAdmin(id) { - let user = this.users.findBy("id", id); - user.set('admin', !user.get('admin')); - this.attrs.onSave(user); - }, + toggleAdmin(id) { + let user = this.users.findBy("id", id); + user.set('admin', !user.get('admin')); + this.attrs.onSave(user); + }, - edit(id) { - let self = this; + edit(id) { + let self = this; - let user = this.users.findBy("id", id); - this.set('editUser', user.copy()); - this.set('password', { password: "", confirmation: ""}); - $(".edit-user-dialog").css("display", "block"); - $("input").removeClass("error"); + let user = this.users.findBy("id", id); + this.set('editUser', user.copy()); + this.set('password', { + password: "", + confirmation: "" + }); + $(".edit-user-dialog").css("display", "block"); + $("input").removeClass("error"); - let drop = new Drop({ - target: $(".edit-button-" + id)[0], - content: $(".edit-user-dialog")[0], - classes: 'drop-theme-basic', - position: "bottom right", - openOn: "always", - tetherOptions: { - offset: "5px 0", - targetOffset: "10px 0" - }, - remove: false - }); + let drop = new Drop({ + target: $(".edit-button-" + id)[0], + content: $(".edit-user-dialog")[0], + classes: 'drop-theme-basic', + position: "bottom right", + openOn: "always", + tetherOptions: { + offset: "5px 0", + targetOffset: "10px 0" + }, + remove: false + }); - self.set('drop', drop); + self.set('drop', drop); - drop.on('open', function() { - self.$("#edit-firstname").focus(); - }); - }, + drop.on('open', function() { + self.$("#edit-firstname").focus(); + }); + }, - confirmDelete(id) { - let user = this.users.findBy("id", id); - this.set('deleteUser', user); - $(".delete-user-dialog").css("display", "block"); + confirmDelete(id) { + let user = this.users.findBy("id", id); + this.set('deleteUser', user); + $(".delete-user-dialog").css("display", "block"); - let drop = new Drop({ - target: $(".delete-button-" + id)[0], - content: $(".delete-user-dialog")[0], - classes: 'drop-theme-basic', - position: "bottom right", - openOn: "always", - tetherOptions: { - offset: "5px 0", - targetOffset: "10px 0" - }, - remove: false - }); + let drop = new Drop({ + target: $(".delete-button-" + id)[0], + content: $(".delete-user-dialog")[0], + classes: 'drop-theme-basic', + position: "bottom right", + openOn: "always", + tetherOptions: { + offset: "5px 0", + targetOffset: "10px 0" + }, + remove: false + }); - this.set('drop', drop); - }, + this.set('drop', drop); + }, - cancel() { - let drop = this.get('drop'); - drop.close(); - }, + cancel() { + let drop = this.get('drop'); + drop.close(); + }, - save() { - let user = this.get('editUser'); - let password = this.get('password'); + save() { + let user = this.get('editUser'); + let password = this.get('password'); - if (is.empty(user.get('firstname'))) { - $("#edit-firstname").addClass("error").focus(); - return; - } - if (is.empty(user.get('lastname'))) { - $("#edit-lastname").addClass("error").focus(); - return; - } - if (is.empty(user.get('email'))) { - $("#edit-email").addClass("error").focus(); - return; - } + if (is.empty(user.get('firstname'))) { + $("#edit-firstname").addClass("error").focus(); + return; + } + if (is.empty(user.get('lastname'))) { + $("#edit-lastname").addClass("error").focus(); + return; + } + if (is.empty(user.get('email'))) { + $("#edit-email").addClass("error").focus(); + return; + } - let drop = this.get('drop'); - drop.close(); + let drop = this.get('drop'); + drop.close(); - this.attrs.onSave(user); + this.attrs.onSave(user); - if (is.not.empty(password.password) && is.not.empty(password.confirmation) && - password.password === password.confirmation) { - this.attrs.onPassword(user, password.password); - } - }, + if (is.not.empty(password.password) && is.not.empty(password.confirmation) && + password.password === password.confirmation) { + this.attrs.onPassword(user, password.password); + } + }, - delete() { - let drop = this.get('drop'); - drop.close(); + delete() { + let drop = this.get('drop'); + drop.close(); - let user = this.get('deleteUser'); - this.attrs.onDelete(user); - } - } -}); + let user = this.get('deleteUser'); + this.attrs.onDelete(user); + } + } +}); \ No newline at end of file diff --git a/app/app/components/ui-select.js b/app/app/components/ui-select.js index 06feebc7..6e61bf03 100644 --- a/app/app/components/ui-select.js +++ b/app/app/components/ui-select.js @@ -1,7 +1,18 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; export default Ember.Component.extend({ - cssClass: "", + cssClass: "", content: [], prompt: null, optionValuePath: 'id', @@ -32,4 +43,4 @@ export default Ember.Component.extend({ changeCallback(selection); } } -}); +}); \ No newline at end of file diff --git a/app/app/components/user-notification.js b/app/app/components/user-notification.js index e8effedb..198d8ce8 100644 --- a/app/app/components/user-notification.js +++ b/app/app/components/user-notification.js @@ -1,3 +1,14 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; import miscUtil from '../utils/misc'; @@ -24,7 +35,7 @@ export default Ember.Component.extend({ self.$(elem).show(); // FIXME: need a more robust solution - miscUtil.interval(function(){ + miscUtil.interval(function() { let notifications = self.get('notifications'); if (notifications.length > 0) { @@ -38,4 +49,4 @@ export default Ember.Component.extend({ }, 2500, self.get('notifications').length); }); }, -}); +}); \ No newline at end of file diff --git a/app/app/components/widget-sample.js b/app/app/components/widget-sample.js index f5b841dc..f1129cce 100644 --- a/app/app/components/widget-sample.js +++ b/app/app/components/widget-sample.js @@ -1,3 +1,14 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + // Copyright (c) 2015 Documize Inc. import Ember from 'ember'; import NotifierMixin from '../mixins/notifier'; @@ -7,10 +18,18 @@ export default Ember.Component.extend(NotifierMixin, { didInsertElement() { this._super(...arguments); - new Tooltip({target: document.getElementById("sample-1")}); - new Tooltip({target: document.getElementById("sample-2")}); - new Tooltip({target: document.getElementById("sample-3")}); - new Tooltip({target: document.getElementById("sample-4")}); + new Tooltip({ + target: document.getElementById("sample-1") + }); + new Tooltip({ + target: document.getElementById("sample-2") + }); + new Tooltip({ + target: document.getElementById("sample-3") + }); + new Tooltip({ + target: document.getElementById("sample-4") + }); let drop1 = new Drop({ target: document.getElementById('sample-dropdown-1'), @@ -33,4 +52,4 @@ export default Ember.Component.extend(NotifierMixin, { return true; } } -}); +}); \ No newline at end of file diff --git a/app/app/helpers/document/file-icon.js b/app/app/helpers/document/file-icon.js index be63d56d..04058c71 100644 --- a/app/app/helpers/document/file-icon.js +++ b/app/app/helpers/document/file-icon.js @@ -1,11 +1,21 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; export function documentFileIcon(params) { let fileExtension = params[0].toLowerCase(); let html = "unknown.png"; - switch (fileExtension) - { + switch (fileExtension) { case "7z": case "7zip": case "zipx": @@ -95,4 +105,4 @@ export function documentFileIcon(params) { return new Ember.Handlebars.SafeString(html); } -export default Ember.Helper.helper(documentFileIcon); +export default Ember.Helper.helper(documentFileIcon); \ No newline at end of file diff --git a/app/app/helpers/document/toc-entry.js b/app/app/helpers/document/toc-entry.js index e6ad0751..2f35f025 100644 --- a/app/app/helpers/document/toc-entry.js +++ b/app/app/helpers/document/toc-entry.js @@ -1,23 +1,34 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; export function documentTocEntry(params) { - let currentPage = params[0]; + let currentPage = params[0]; let nodeId = params[1]; - let nodeLevel = params[2]; + let nodeLevel = params[2]; let html = ""; let indent = (nodeLevel - 1) * 20; html += ""; if (currentPage === nodeId) { - html += "remove"; + html += ""; html += ""; } else { - html += "remove"; + html += ""; html += ""; } return new Ember.Handlebars.SafeString(html); } -export default Ember.Helper.helper(documentTocEntry); +export default Ember.Helper.helper(documentTocEntry); \ No newline at end of file diff --git a/app/app/helpers/formatted-date.js b/app/app/helpers/formatted-date.js index 09daa555..67162831 100644 --- a/app/app/helpers/formatted-date.js +++ b/app/app/helpers/formatted-date.js @@ -1,3 +1,14 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; import dateUtil from '../utils/date'; @@ -5,4 +16,4 @@ export function formattedDate(params) { return dateUtil.toIsoDate(params[0], params[1]); } -export default Ember.Helper.helper(formattedDate); +export default Ember.Helper.helper(formattedDate); \ No newline at end of file diff --git a/app/app/helpers/generate-id.js b/app/app/helpers/generate-id.js index de322a70..a950d0f2 100644 --- a/app/app/helpers/generate-id.js +++ b/app/app/helpers/generate-id.js @@ -1,3 +1,14 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; // Usage: {{generate-id 'admin-' 123}} @@ -5,4 +16,4 @@ export default Ember.Helper.helper(function(params) { let prefix = params[0]; let id = params[1]; return prefix + "-" + id; -}); +}); \ No newline at end of file diff --git a/app/app/helpers/is-equal.js b/app/app/helpers/is-equal.js index 7416a532..80ac40a3 100644 --- a/app/app/helpers/is-equal.js +++ b/app/app/helpers/is-equal.js @@ -1,6 +1,17 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; // Usage: {{is-equal item selection}} export default Ember.Helper.helper(function([leftSide, rightSide]) { return leftSide === rightSide; -}); +}); \ No newline at end of file diff --git a/app/app/helpers/is-not.js b/app/app/helpers/is-not.js index 24992fc0..3c2d58ab 100644 --- a/app/app/helpers/is-not.js +++ b/app/app/helpers/is-not.js @@ -1,6 +1,17 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; // Usage: {{is-not selection}} export default Ember.Helper.helper(function([value]) { return !value; -}); +}); \ No newline at end of file diff --git a/app/app/helpers/read-path.js b/app/app/helpers/read-path.js index db70dcf4..a9c1e037 100644 --- a/app/app/helpers/read-path.js +++ b/app/app/helpers/read-path.js @@ -1,5 +1,16 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; export default Ember.Helper.helper(function([object, path]) { return Ember.get(object, path); -}); +}); \ No newline at end of file diff --git a/app/app/helpers/time-ago.js b/app/app/helpers/time-ago.js index b2c00dc2..e44fee70 100644 --- a/app/app/helpers/time-ago.js +++ b/app/app/helpers/time-ago.js @@ -1,3 +1,14 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; import dateUtil from '../utils/date'; @@ -6,4 +17,4 @@ export function timeAgo(params) { return dateUtil.timeAgo(params[0]); } -export default Ember.Helper.helper(timeAgo); +export default Ember.Helper.helper(timeAgo); \ No newline at end of file diff --git a/app/app/helpers/user-initials.js b/app/app/helpers/user-initials.js index 4e2ede90..b4999582 100644 --- a/app/app/helpers/user-initials.js +++ b/app/app/helpers/user-initials.js @@ -1,3 +1,14 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; // {{user-initials firstname lastname}} @@ -5,7 +16,7 @@ export function userInitials(params) { let firstname = params[0]; let lastname = params[1]; - return (firstname.substring(0, 1) + lastname.substring(0, 1)).toUpperCase(); + return (firstname.substring(0, 1) + lastname.substring(0, 1)).toUpperCase(); } -export default Ember.Helper.helper(userInitials); +export default Ember.Helper.helper(userInitials); \ No newline at end of file diff --git a/app/app/initializers/application.js b/app/app/initializers/application.js index 9418df90..0cc3d498 100644 --- a/app/app/initializers/application.js +++ b/app/app/initializers/application.js @@ -1,20 +1,25 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + export function initialize( /*application*/ ) { // address insecure jquery defaults (kudos: @nathanhammond) $.globalEval = function() {}; $.ajaxSetup({ + crossDomain: true, converters: { 'text script': text => text } }); Dropzone.autoDiscover = false; - - // global trap for XHR 401 - $(document).ajaxError(function(e, xhr /*, settings, exception*/ ) { - if (xhr.status === 401 && is.not.startWith(window.location.pathname, "/auth/")) { - window.location.href = "/auth/login"; - } - }); } export default { diff --git a/app/app/initializers/audit.js b/app/app/initializers/audit.js index 50db1e58..17da4585 100644 --- a/app/app/initializers/audit.js +++ b/app/app/initializers/audit.js @@ -1,3 +1,13 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com export function initialize(application) { application.inject('route', 'audit', 'service:audit'); @@ -9,4 +19,4 @@ export default { name: 'audit', after: 'session', initialize: initialize -}; +}; \ No newline at end of file diff --git a/app/app/initializers/browser.js b/app/app/initializers/browser.js index 4156696a..2a1f9c26 100644 --- a/app/app/initializers/browser.js +++ b/app/app/initializers/browser.js @@ -1,3 +1,14 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + export function initialize(application) { application.inject('route', 'browser', 'service:browser'); application.inject('controller', 'browser', 'service:browser'); @@ -8,4 +19,4 @@ export default { name: 'browser', after: "session", initialize: initialize -}; +}; \ No newline at end of file diff --git a/app/app/initializers/event-bus.js b/app/app/initializers/event-bus.js index 136d804b..877524c9 100644 --- a/app/app/initializers/event-bus.js +++ b/app/app/initializers/event-bus.js @@ -1,3 +1,14 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + export function initialize(application) { application.inject('route', 'eventBus', 'service:eventBus'); application.inject('component', 'eventBus', 'service:eventBus'); @@ -9,4 +20,4 @@ export default { name: 'eventBus', after: 'session', initialize: initialize -}; +}; \ No newline at end of file diff --git a/app/app/initializers/logger.js b/app/app/initializers/logger.js index f333cf09..cad17240 100644 --- a/app/app/initializers/logger.js +++ b/app/app/initializers/logger.js @@ -1,3 +1,14 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + export function initialize(application) { application.inject('route', 'logger', 'service:logger'); application.inject('component', 'logger', 'service:logger'); @@ -8,4 +19,4 @@ export default { name: 'logger', after: 'session', initialize: initialize -}; +}; \ No newline at end of file diff --git a/app/app/initializers/session.js b/app/app/initializers/session.js index 3ffbaec1..55bb0999 100644 --- a/app/app/initializers/session.js +++ b/app/app/initializers/session.js @@ -1,7 +1,19 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + export function initialize(application) { application.inject('route', 'session', 'service:session'); application.inject('controller', 'session', 'service:session'); application.inject('component', 'session', 'service:session'); + application.inject('mixin', 'session', 'service:session'); } export default { @@ -9,4 +21,4 @@ export default { after: 'application', before: 'audit', initialize: initialize -}; +}; \ No newline at end of file diff --git a/app/app/mixins/notifier.js b/app/app/mixins/notifier.js index fc315e8a..7086a358 100644 --- a/app/app/mixins/notifier.js +++ b/app/app/mixins/notifier.js @@ -1,13 +1,24 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; export default Ember.Mixin.create({ - showNotification(msg) { - this.eventBus.publish('notifyUser', msg); - }, + showNotification(msg) { + this.eventBus.publish('notifyUser', msg); + }, actions: { showNotification(msg) { this.eventBus.publish('notifyUser', msg); } } -}); +}); \ No newline at end of file diff --git a/app/app/mixins/section.js b/app/app/mixins/section.js new file mode 100644 index 00000000..0b2b1725 --- /dev/null +++ b/app/app/mixins/section.js @@ -0,0 +1,27 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + +import Ember from 'ember'; + +export default Ember.Mixin.create({ + isReadonly: function() { + if (this.get('page.userId') === this.session.user.id) { + return undefined; + } + else { + return "readonly"; + } + }.property('page'), + + isMine: function() { + return this.get('page.userId') === this.session.user.id; + }.property('page') +}); diff --git a/app/app/mixins/tooltip.js b/app/app/mixins/tooltip.js index 99d8d3e3..45f3c9b6 100644 --- a/app/app/mixins/tooltip.js +++ b/app/app/mixins/tooltip.js @@ -1,23 +1,36 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; export default Ember.Mixin.create({ - tooltips: [], + tooltips: [], - addTooltip(elem) { - let t = new Tooltip({target: elem}); - let tt = this.get('tooltips'); - tt.push(t); - }, + addTooltip(elem) { + let t = new Tooltip({ + target: elem + }); + let tt = this.get('tooltips'); + tt.push(t); + }, - destroyTooltips() { - let tt = this.get('tooltips'); + destroyTooltips() { + let tt = this.get('tooltips'); - tt.forEach(t => { - t.destroy(); - }); + tt.forEach(t => { + t.destroy(); + }); - tt.length = 0; + tt.length = 0; - this.set('tooltips', tt); - } -}); + this.set('tooltips', tt); + } +}); \ No newline at end of file diff --git a/app/app/resolver.js b/app/app/resolver.js index 2fb563d6..49331f17 100644 --- a/app/app/resolver.js +++ b/app/app/resolver.js @@ -1,3 +1,14 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Resolver from 'ember-resolver'; -export default Resolver; +export default Resolver; \ No newline at end of file diff --git a/app/app/router.js b/app/app/router.js index 4a86c2a0..dd9b740a 100644 --- a/app/app/router.js +++ b/app/app/router.js @@ -1,3 +1,14 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; import config from './config/environment'; diff --git a/app/app/routes/application.js b/app/app/routes/application.js index 0cf77c68..ade10ade 100644 --- a/app/app/routes/application.js +++ b/app/app/routes/application.js @@ -1,3 +1,14 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; export default Ember.Route.extend({ diff --git a/app/app/services/audit.js b/app/app/services/audit.js index 076ad08a..1bf39d6a 100644 --- a/app/app/services/audit.js +++ b/app/app/services/audit.js @@ -1,3 +1,14 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; import netUtil from '../utils/net'; import config from '../config/environment'; @@ -45,8 +56,7 @@ export default Ember.Service.extend({ email: session.user.email, user_id: session.user.id, "administrator": session.user.admin, - company: - { + company: { id: session.get('appMeta.orgId'), name: session.get('appMeta.title').string, "domain": netUtil.getSubdomain(), @@ -62,4 +72,4 @@ export default Ember.Service.extend({ window.Intercom('boot', window.intercomSettings); }, -}); +}); \ No newline at end of file diff --git a/app/app/services/base.js b/app/app/services/base.js index d4e9172f..270aac4b 100644 --- a/app/app/services/base.js +++ b/app/app/services/base.js @@ -1,15 +1,25 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; export default Ember.Service.extend({ interval(func, wait, times) { - var interv = function(w, t){ - return function(){ - if(typeof t === "undefined" || t-- > 0) { + var interv = function(w, t) { + return function() { + if (typeof t === "undefined" || t-- > 0) { setTimeout(interv, w); try { func.call(null); - } - catch(e) { + } catch (e) { t = 0; throw e.toString(); } @@ -19,4 +29,4 @@ export default Ember.Service.extend({ setTimeout(interv, wait); } -}); +}); \ No newline at end of file diff --git a/app/app/services/browser.js b/app/app/services/browser.js index d4a45de8..c42bec2c 100644 --- a/app/app/services/browser.js +++ b/app/app/services/browser.js @@ -1,3 +1,14 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; export default Ember.Service.extend({ @@ -30,6 +41,6 @@ export default Ember.Service.extend({ description = this.get('sessionService').appMeta.message; } - $('head').append( '' ); + $('head').append(''); } -}); +}); \ No newline at end of file diff --git a/app/app/services/document.js b/app/app/services/document.js index f3000184..dc230af9 100644 --- a/app/app/services/document.js +++ b/app/app/services/document.js @@ -1,3 +1,14 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; import models from '../utils/model'; diff --git a/app/app/services/event-bus.js b/app/app/services/event-bus.js index d2b0dfa2..58301200 100644 --- a/app/app/services/event-bus.js +++ b/app/app/services/event-bus.js @@ -1,3 +1,14 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; export default Ember.Service.extend(Ember.Evented, { @@ -12,4 +23,4 @@ export default Ember.Service.extend(Ember.Evented, { unsubscribe: function() { return this.off.apply(this, arguments); } -}); +}); \ No newline at end of file diff --git a/app/app/services/folder.js b/app/app/services/folder.js index 049399a9..b0ed6b18 100644 --- a/app/app/services/folder.js +++ b/app/app/services/folder.js @@ -1,3 +1,14 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; import models from '../utils/model'; import BaseService from '../services/base'; @@ -34,15 +45,15 @@ export default BaseService.extend({ getFolder(id) { let url = this.get('sessionService').appMeta.getUrl(`folders/${id}`); - return new Ember.RSVP.Promise(function(resolve, reject){ + return new Ember.RSVP.Promise(function(resolve, reject) { $.ajax({ url: url, type: 'GET', - success: function(response){ + success: function(response) { let folder = models.FolderModel.create(response); resolve(folder); }, - error: function(reason){ + error: function(reason) { reject(reason); } }); @@ -54,7 +65,9 @@ export default BaseService.extend({ let self = this; if (this.get('folders') != null) { - return new Ember.RSVP.Promise(function(resolve) { resolve(self.get('folders')); }); + return new Ember.RSVP.Promise(function(resolve) { + resolve(self.get('folders')); + }); } else { return this.reload(); } @@ -123,11 +136,11 @@ export default BaseService.extend({ getProtectedFolderInfo: function() { var url = this.get('sessionService').appMeta.getUrl('folders?filter=viewers'); - return new Ember.RSVP.Promise(function(resolve, reject){ + return new Ember.RSVP.Promise(function(resolve, reject) { $.ajax({ url: url, type: 'GET', - success: function(response){ + success: function(response) { let data = []; _.each(response, function(obj) { data.pushObject(models.ProtectedFolderParticipant.create(obj)); @@ -135,7 +148,7 @@ export default BaseService.extend({ resolve(data); }, - error: function(reason){ + error: function(reason) { reject(reason); } }); @@ -146,7 +159,7 @@ export default BaseService.extend({ reload() { let url = this.get('sessionService').appMeta.getUrl(`folders`); - return new Ember.RSVP.Promise(function(resolve, reject){ + return new Ember.RSVP.Promise(function(resolve, reject) { $.ajax({ url: url, type: 'GET', @@ -157,7 +170,7 @@ export default BaseService.extend({ }); resolve(data); }, - error: function(reason){ + error: function(reason) { reject(reason); } }); @@ -172,14 +185,14 @@ export default BaseService.extend({ $.ajax({ url: self.get('sessionService').appMeta.getUrl(`folders/${folderId}/permissions`), type: 'GET', - success: function(response){ + success: function(response) { let data = []; _.each(response, function(obj) { data.pushObject(models.FolderPermissionModel.create(obj)); }); resolve(data); }, - error: function(reason){ + error: function(reason) { reject(reason); } }); @@ -196,10 +209,10 @@ export default BaseService.extend({ type: 'PUT', contentType: 'json', data: JSON.stringify(payload), - success: function(response){ + success: function(response) { resolve(response); }, - error: function(reason){ + error: function(reason) { reject(reason); } }); @@ -216,10 +229,10 @@ export default BaseService.extend({ type: 'POST', contentType: 'json', data: JSON.stringify(invitation), - success: function(response){ + success: function(response) { resolve(response); }, - error: function(reason){ + error: function(reason) { reject(reason); } }); @@ -280,4 +293,4 @@ export default BaseService.extend({ } }); }, -}); +}); \ No newline at end of file diff --git a/app/app/services/logger.js b/app/app/services/logger.js index e1bf8be0..ee7f68a7 100644 --- a/app/app/services/logger.js +++ b/app/app/services/logger.js @@ -1,3 +1,14 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; export default Ember.Service.extend({ @@ -12,4 +23,4 @@ export default Ember.Service.extend({ info: function(entry) { console.log(entry); } -}); +}); \ No newline at end of file diff --git a/app/app/services/organization.js b/app/app/services/organization.js index 46df91e1..24ee457e 100644 --- a/app/app/services/organization.js +++ b/app/app/services/organization.js @@ -1,3 +1,14 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; import models from '../utils/model'; @@ -8,15 +19,15 @@ export default Ember.Service.extend({ getOrg(id) { let url = this.get('sessionService').appMeta.getUrl(`organizations/${id}`); - return new Ember.RSVP.Promise(function(resolve, reject){ + return new Ember.RSVP.Promise(function(resolve, reject) { $.ajax({ url: url, type: 'GET', - success: function(response){ + success: function(response) { let org = models.OrganizationModel.create(response); resolve(org); }, - error: function(reason){ + error: function(reason) { reject(reason); } }); @@ -47,4 +58,4 @@ export default Ember.Service.extend({ }); }); } -}); +}); \ No newline at end of file diff --git a/app/app/services/search.js b/app/app/services/search.js index 3a3b5349..c4f88d92 100644 --- a/app/app/services/search.js +++ b/app/app/services/search.js @@ -1,3 +1,14 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; export default Ember.Service.extend({ @@ -7,17 +18,17 @@ export default Ember.Service.extend({ find(keywords) { let url = this.get('sessionService').appMeta.getUrl("search?keywords=" + encodeURIComponent(keywords)); - return new Ember.RSVP.Promise(function(resolve, reject){ + return new Ember.RSVP.Promise(function(resolve, reject) { $.ajax({ url: url, type: 'GET', success: function(response) { resolve(response); }, - error: function(reason){ + error: function(reason) { reject(reason); } }); }); }, -}); +}); \ No newline at end of file diff --git a/app/app/services/section.js b/app/app/services/section.js index b5c8b528..b7da9c7c 100644 --- a/app/app/services/section.js +++ b/app/app/services/section.js @@ -1,3 +1,14 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; import models from '../utils/model'; import BaseService from '../services/base'; diff --git a/app/app/services/session.js b/app/app/services/session.js index a31a5bcd..f1ab0d48 100644 --- a/app/app/services/session.js +++ b/app/app/services/session.js @@ -1,3 +1,14 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; import encodingUtil from '../utils/encoding'; import netUtil from '../utils/net'; @@ -117,8 +128,13 @@ export default Ember.Service.extend({ this.storeSessionItem('token', token); this.storeSessionItem('user', JSON.stringify(user)); + let self = this; + $.ajaxPrefilter(function(options, originalOptions, jqXHR) { - jqXHR.setRequestHeader('Authorization', 'Bearer ' + token); + // We only tack on auth header for Documize API calls + if (is.startWith(options.url, self.get('appMeta.url'))) { + jqXHR.setRequestHeader('Authorization', 'Bearer ' + token); + } }); }, @@ -167,6 +183,15 @@ export default Ember.Service.extend({ }); } + var blockedPopupTest = window.open("http://d27wjpa4h6c9yx.cloudfront.net/", "directories=no,height=1,width=1,menubar=no,resizable=no,scrollbars=no,status=no,titlebar=no,top=0,location=no"); + + if (!blockedPopupTest) { + this.set('popupBlocked', true); + } else { + blockedPopupTest.close(); + this.set('popupBlocked', false); + } + return new Ember.RSVP.Promise(function(resolve) { $.ajax({ url: self.get('appMeta').getUrl("public/meta"), @@ -214,4 +239,4 @@ export default Ember.Service.extend({ }); }); } -}); \ No newline at end of file +}); diff --git a/app/app/services/template.js b/app/app/services/template.js index f49b1862..471d6eee 100644 --- a/app/app/services/template.js +++ b/app/app/services/template.js @@ -1,3 +1,14 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; import models from '../utils/model'; @@ -29,7 +40,7 @@ export default Ember.Service.extend({ url: self.get('sessionService').appMeta.getUrl("templates/" + templateId + "/folder/" + folderId + "?type=saved"), type: 'POST', success: function(doc) { - let docModel = models.DocumentModel.create(doc); + let docModel = models.DocumentModel.create(doc); resolve(docModel); }, error: function(reason) { @@ -42,15 +53,17 @@ export default Ember.Service.extend({ getSavedTemplates() { let self = this; - return new Ember.RSVP.Promise(function(resolve, reject){ + return new Ember.RSVP.Promise(function(resolve, reject) { $.ajax({ url: self.get('sessionService').appMeta.getUrl("templates"), type: 'GET', success: function(response) { - if (is.not.array(response)) { - response = []; - } - let templates = Ember.ArrayProxy.create({ content: Ember.A([]) }); + if (is.not.array(response)) { + response = []; + } + let templates = Ember.ArrayProxy.create({ + content: Ember.A([]) + }); _.each(response, function(template) { let templateModel = models.TemplateModel.create(template); @@ -69,7 +82,7 @@ export default Ember.Service.extend({ getStockTemplates() { let self = this; - return new Ember.RSVP.Promise(function(resolve, reject){ + return new Ember.RSVP.Promise(function(resolve, reject) { $.ajax({ url: self.get('sessionService').appMeta.getUrl("templates/stock"), type: 'GET', @@ -82,4 +95,4 @@ export default Ember.Service.extend({ }); }); } -}); +}); \ No newline at end of file diff --git a/app/app/services/user.js b/app/app/services/user.js index 7e484e19..186d863a 100644 --- a/app/app/services/user.js +++ b/app/app/services/user.js @@ -1,3 +1,14 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + import Ember from 'ember'; import models from '../utils/model'; diff --git a/app/app/styles/app.scss b/app/app/styles/app.scss index 5c6d50fe..aadb56c4 100644 --- a/app/app/styles/app.scss +++ b/app/app/styles/app.scss @@ -1,3 +1,14 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + @import "color.scss"; @import "font.scss"; @import "functions.scss"; diff --git a/app/app/styles/base.scss b/app/app/styles/base.scss index 88c5a92a..44854a2e 100644 --- a/app/app/styles/base.scss +++ b/app/app/styles/base.scss @@ -1,3 +1,14 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + .cursor-pointer { cursor: pointer; } .cursor-not-allowed { cursor: not-allowed !important; } .cursor-auto { cursor: auto; } @@ -60,6 +71,12 @@ $i: 150; $i: $i - 5; } +$i: 100; +@while $i > 0 { + .width-#{$i} { width: #{$i}#{"%"}; } + $i: $i - 5; +} + .no-outline { outline:none !important; diff --git a/app/app/styles/color.scss b/app/app/styles/color.scss index dc469870..5e7204e1 100644 --- a/app/app/styles/color.scss +++ b/app/app/styles/color.scss @@ -1,8 +1,17 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com $color-off-white: #f5f5f5; $color-off-black: #4c4c4c; $color-black: #000000; $color-white: #ffffff; - $color-primary: #2180cc; $color-link: #5680de; $color-red: #d9493c; @@ -16,17 +25,10 @@ $color-chip: #98A2AB; $color-input: #98A2AB; $color-stroke: #98A2AB; $color-card-active: #f7fcff; - - $color-border: #dbdbdb; $color-border2: #e2e2e2; - -// FIXME remove/replace below? -// $color-primary: #1b75bb; $color-primary-light: lighten($color-primary, 30%); $color-primary-dark: darken($color-primary, 10%); -// $color-green: #79ad30; -// $color-gray: #a0a0a0; $color-gray2: #f0eeee; $color-active-state: #e2e2e2; $color-sidebar: #e7f1f6; @@ -34,16 +36,42 @@ $color-shadow: #dbdbdb; $color-error: #c23c56; $color-highlight: #fff8dc; $color-warning: #990012; - -.background-color-white { background-color: $color-white; } -.color-white { color: $color-white; } -.color-off-white { color: $color-off-white; } -.color-black { color: $color-black; } -.color-off-black { color: $color-off-black; } -.background-color-primary { background-color: $color-primary; } -.color-primary { color: $color-primary; } -.color-link { color: $color-link; } -.color-blue { color: $color-blue; } -.color-red { color: $color-red; } -.color-green { color: $color-green; } -.color-gray { color: $color-gray; } +.background-color-white { + background-color: $color-white; +} +.color-white { + color: $color-white; +} +.color-off-white { + color: $color-off-white; +} +.color-black { + color: $color-black; +} +.color-off-black { + color: $color-off-black; +} +.background-color-primary { + background-color: $color-primary; +} +.color-primary { + color: $color-primary; +} +.color-link { + color: $color-link; +} +.color-blue { + color: $color-blue; +} +.color-red { + color: $color-red; +} +.color-green { + color: $color-green; +} +.color-gray { + color: $color-gray; +} +.color-error { + color: $color-error; +} diff --git a/app/app/styles/view/document/content.scss b/app/app/styles/view/document/content.scss index 7c09e754..73f5e725 100644 --- a/app/app/styles/view/document/content.scss +++ b/app/app/styles/view/document/content.scss @@ -15,7 +15,7 @@ > .item { color: $color-off-black; - margin: 10px 5px; + margin: 0px 5px; padding: 0; list-style-type: none; diff --git a/app/app/styles/view/document/wizard.scss b/app/app/styles/view/document/wizard.scss index 8c89984f..015ea1af 100644 --- a/app/app/styles/view/document/wizard.scss +++ b/app/app/styles/view/document/wizard.scss @@ -33,13 +33,12 @@ list-style: none; float: left; cursor: pointer; - width: 100px; - height: 100px; + width: 400px; + height: 80px; background-color: $color-white; border: 1px solid $color-border2; border-radius: 3px; margin: 0 30px 30px 0; - font-weight: bold; &:hover { @extend .z-depth-half; @@ -48,30 +47,48 @@ transition: 0.2s all ease; } - > .material-icons { - text-align: center; - margin: 20px 0 0 31px; - font-size: 2.5rem; - color: $color-stroke; - } - > .img { - height: 30px; - width: 30px; text-align: center; - margin: 23px 0 6px 33px; + margin: 17px 10px 0 20px; + display: inline-block; + height: 45px; + width: 45px; } - > .title { - font-size: 1rem; - color: $color-stroke; - text-align: center; - margin-top: 5px; + > .details { + vertical-align: top; + display: inline-block; + + > .title { + font-size: 1rem; + font-weight: bold; + color: $color-off-black; + margin-top: 18px; + letter-spacing: 0.5px; + + .preview { + font-size: 0.7rem; + color: #cc9933; + display: inline-block; + margin-left: 10px; + } + } + + > .desc { + color: $color-stroke; + font-size: 0.8rem; + margin-top: 5px; + max-width: 300px; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + } } } > .selected { - border-color: $color-link; + background-color: $color-card-active; + border: 1px dotted $color-link; } } } diff --git a/app/app/styles/view/document/wysiwyg.scss b/app/app/styles/view/document/wysiwyg.scss index a9ca8712..a39bcf69 100644 --- a/app/app/styles/view/document/wysiwyg.scss +++ b/app/app/styles/view/document/wysiwyg.scss @@ -1,5 +1,7 @@ .wysiwyg { - font-size: 1rem; + // font-size: 1rem; + font-size: 15px; + line-height: 30px; table { @@ -16,7 +18,7 @@ p { margin: 0 !important; - padding: 0 !important; + padding: 0 !important; } } } diff --git a/app/app/styles/widget/widget-input.scss b/app/app/styles/widget/widget-input.scss index c3849ac0..54e4eed2 100644 --- a/app/app/styles/widget/widget-input.scss +++ b/app/app/styles/widget/widget-input.scss @@ -28,7 +28,7 @@ width: 100%; border: none; border-bottom: 1px solid $color-input; - height: 2rem; + height: 2.3rem; outline: none; &:focus { @@ -53,7 +53,7 @@ padding: 5px; border: 1px solid $color-input; border-radius: 2px; - height: 2rem; + height: 2.3rem; font-size: 1rem; display: inline-block; @@ -186,3 +186,13 @@ .form-divider { margin-top: 30px; } + + +.widget-checkbox { + color: $color-link; + cursor: pointer; +} + +.checkbox-gray { + color: $color-gray !important; +} \ No newline at end of file diff --git a/app/app/templates/components/document/page-wizard.hbs b/app/app/templates/components/document/page-wizard.hbs index b612483c..dab886b4 100644 --- a/app/app/templates/components/document/page-wizard.hbs +++ b/app/app/templates/components/document/page-wizard.hbs @@ -17,15 +17,26 @@
    {{#each sections as |section|}} -
  • - {{#if section.hasImage}} - - {{else}} - {{section.iconFont}} - {{/if}} -
    {{section.title}}
    +
  • + +
    +
    + {{section.title}} + {{#if section.preview}} +
    coming soon
    + {{/if}} +
    +
    {{section.description}}
    +
  • {{/each}} +
  • + +
    +
    Suggest
    +
    We'll build the integrations you need - just let us know
    +
    +
diff --git a/app/app/templates/components/section/gemini/type-editor.hbs b/app/app/templates/components/section/gemini/type-editor.hbs index 40553fe8..47c484d1 100644 --- a/app/app/templates/components/section/gemini/type-editor.hbs +++ b/app/app/templates/components/section/gemini/type-editor.hbs @@ -47,17 +47,17 @@
e.g. http://helpdesk.countersoft.com
- {{focus-input id="gemini-url" type="text" value=config.url readonly=fieldEditable}} + {{focus-input id="gemini-url" type="text" value=config.url readonly=isReadonly}}
Gemini username
- {{input id="gemini-username" type="text" value=config.username readonly=fieldEditable}} + {{input id="gemini-username" type="text" value=config.username readonly=isReadonly}}
Gemini user API key (from user profile)
- {{input id="gemini-apikey" type="password" value=config.APIKey readonly=fieldEditable}} + {{input id="gemini-apikey" type="password" value=config.APIKey readonly=isReadonly}}
Authenticate
diff --git a/app/app/templates/components/section/trello/type-editor.hbs b/app/app/templates/components/section/trello/type-editor.hbs new file mode 100644 index 00000000..001cdcc0 --- /dev/null +++ b/app/app/templates/components/section/trello/type-editor.hbs @@ -0,0 +1,95 @@ + + +{{#section/base-editor document=document folder=folder page=page busy=busy + tip="Trello is the visual way to manage your projects and organize anything (https://trello.com)" + isDirty=(action 'isDirty') onCancel=(action 'onCancel') onAction=(action 'onAction')}} + + {{#if authenticated}} + +
+
+
+
Select Board & Lists
+
Choose lists to include from board
+
+ {{#if noBoards}} +
+
You have no team boards to share - personal boards are never shown.
+
+ {{else}} +
+ +
Select board
+ {{ui-select id="boards-dropdown" content=boards action=(action 'onBoardChange') optionValuePath="id" optionLabelPath="name" selection=config.board}} +
+
+ +
Select lists to include
+
+
{{config.board.name}}
+ {{#each config.lists as |list|}} +
+ {{#if list.included}} + check_box + {{else}} + check_box_outline_blank + {{/if}} + {{list.name}} +
+ {{/each}} +
+
+
+ {{/if}} +
+
+ + {{else}} + +
+
+
+
+
Authentication
+
Click to authenticate with Trello
+
+
Authenticate
+
+
+
+ + {{/if}} + +{{/section/base-editor}} diff --git a/app/app/templates/components/section/trello/type-renderer.hbs b/app/app/templates/components/section/trello/type-renderer.hbs new file mode 100644 index 00000000..4f2743a9 --- /dev/null +++ b/app/app/templates/components/section/trello/type-renderer.hbs @@ -0,0 +1,54 @@ + + +{{{page.body}}} diff --git a/app/app/templates/components/ui-select.hbs b/app/app/templates/components/ui-select.hbs index 33ce913c..a5c2e767 100644 --- a/app/app/templates/components/ui-select.hbs +++ b/app/app/templates/components/ui-select.hbs @@ -1,4 +1,4 @@ - {{#if prompt}}