mirror of
https://github.com/documize/community.git
synced 2025-08-10 07:55:25 +02:00
Merge pull request #4 from documize/smart-section-trello
Smart section trello
This commit is contained in:
commit
2c526ed304
153 changed files with 3320 additions and 902 deletions
|
@ -1,3 +1,14 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
import Resolver from './resolver';
|
import Resolver from './resolver';
|
||||||
import loadInitializers from 'ember-load-initializers';
|
import loadInitializers from 'ember-load-initializers';
|
||||||
|
@ -13,11 +24,11 @@ Ember.RSVP.on('error', function(error) {
|
||||||
});
|
});
|
||||||
|
|
||||||
App = Ember.Application.extend({
|
App = Ember.Application.extend({
|
||||||
modulePrefix: config.modulePrefix,
|
modulePrefix: config.modulePrefix,
|
||||||
podModulePrefix: config.podModulePrefix,
|
podModulePrefix: config.podModulePrefix,
|
||||||
Resolver
|
Resolver
|
||||||
});
|
});
|
||||||
|
|
||||||
loadInitializers(App, config.modulePrefix);
|
loadInitializers(App, config.modulePrefix);
|
||||||
|
|
||||||
export default App;
|
export default App;
|
|
@ -1,3 +1,14 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
export default Ember.Component.extend({
|
export default Ember.Component.extend({
|
||||||
|
|
|
@ -1,3 +1,14 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
export default Ember.Component.extend({
|
export default Ember.Component.extend({
|
||||||
|
|
|
@ -1,3 +1,14 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
import NotifierMixin from '../../mixins/notifier';
|
import NotifierMixin from '../../mixins/notifier';
|
||||||
import TooltipMixin from '../../mixins/tooltip';
|
import TooltipMixin from '../../mixins/tooltip';
|
||||||
|
@ -8,7 +19,12 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
||||||
pages: [],
|
pages: [],
|
||||||
page: "",
|
page: "",
|
||||||
showToc: false,
|
showToc: false,
|
||||||
tocTools: { UpTarget: "", DownTarget: "", AllowIndent: false, AllowOutdent: false },
|
tocTools: {
|
||||||
|
UpTarget: "",
|
||||||
|
DownTarget: "",
|
||||||
|
AllowIndent: false,
|
||||||
|
AllowOutdent: false
|
||||||
|
},
|
||||||
actionablePage: false,
|
actionablePage: false,
|
||||||
upDisabled: true,
|
upDisabled: true,
|
||||||
downDisabled: true,
|
downDisabled: true,
|
||||||
|
@ -17,36 +33,36 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
||||||
|
|
||||||
didReceiveAttrs: function() {
|
didReceiveAttrs: function() {
|
||||||
this.set('showToc', is.not.undefined(this.get('pages')) && this.get('pages').get('length') > 2);
|
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'));
|
this.send('clickGotoPage', this.get('page'));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
didRender: function() {
|
didRender: function() {
|
||||||
if (this.session.authenticated) {
|
if (this.session.authenticated) {
|
||||||
this.addTooltip(document.getElementById("toc-up-button"));
|
this.addTooltip(document.getElementById("toc-up-button"));
|
||||||
this.addTooltip(document.getElementById("toc-down-button"));
|
this.addTooltip(document.getElementById("toc-down-button"));
|
||||||
this.addTooltip(document.getElementById("toc-outdent-button"));
|
this.addTooltip(document.getElementById("toc-outdent-button"));
|
||||||
this.addTooltip(document.getElementById("toc-indent-button"));
|
this.addTooltip(document.getElementById("toc-indent-button"));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
didInsertElement() {
|
didInsertElement() {
|
||||||
this.eventBus.subscribe('documentPageAdded', this, 'onDocumentPageAdded');
|
this.eventBus.subscribe('documentPageAdded', this, 'onDocumentPageAdded');
|
||||||
|
|
||||||
var s = $(".document-structure");
|
var s = $(".document-structure");
|
||||||
var pos = s.position();
|
var pos = s.position();
|
||||||
$(window).scroll(function() {
|
$(window).scroll(function() {
|
||||||
var windowpos = $(window).scrollTop();
|
var windowpos = $(window).scrollTop();
|
||||||
if (windowpos - 200 >= pos.top) {
|
if (windowpos - 200 >= pos.top) {
|
||||||
s.addClass("stick");
|
s.addClass("stick");
|
||||||
s.css('width', s.parent().width());
|
s.css('width', s.parent().width());
|
||||||
} else {
|
} else {
|
||||||
s.removeClass("stick");
|
s.removeClass("stick");
|
||||||
s.css('width', 'auto');
|
s.css('width', 'auto');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
willDestroyElement() {
|
willDestroyElement() {
|
||||||
this.eventBus.unsubscribe('documentPageAdded');
|
this.eventBus.unsubscribe('documentPageAdded');
|
||||||
|
@ -77,9 +93,11 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
||||||
this.set('page', pageId);
|
this.set('page', pageId);
|
||||||
|
|
||||||
var toc = this.get('pages');
|
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) {
|
if (is.undefined(page) || page.level === 1) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -90,8 +108,8 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var upPage = toc[index-1];
|
var upPage = toc[index - 1];
|
||||||
var downPage = toc[index+1];
|
var downPage = toc[index + 1];
|
||||||
|
|
||||||
if (_.isUndefined(upPage)) {
|
if (_.isUndefined(upPage)) {
|
||||||
this.set('tocTools.UpTarget', "");
|
this.set('tocTools.UpTarget', "");
|
||||||
|
@ -103,39 +121,31 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
||||||
|
|
||||||
// can we go up?
|
// can we go up?
|
||||||
// can we indent?
|
// can we indent?
|
||||||
if (!_.isUndefined(upPage))
|
if (!_.isUndefined(upPage)) {
|
||||||
{
|
|
||||||
// can only go up if someone is same or higher level?
|
// can only go up if someone is same or higher level?
|
||||||
var index2 = _.indexOf(toc, upPage, false);
|
var index2 = _.indexOf(toc, upPage, false);
|
||||||
|
|
||||||
if (index2 !== -1)
|
if (index2 !== -1) {
|
||||||
{
|
|
||||||
// up
|
// up
|
||||||
for (var i = index2; i > 0; i--)
|
for (var i = index2; i > 0; i--) {
|
||||||
{
|
if (page.level > toc[i].level) {
|
||||||
if (page.level > toc[i].level)
|
|
||||||
{
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (page.level === toc[i].level)
|
if (page.level === toc[i].level) {
|
||||||
{
|
|
||||||
this.set('tocTools.UpTarget', toc[i].id);
|
this.set('tocTools.UpTarget', toc[i].id);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// indent?
|
// indent?
|
||||||
for (var i2 = index2; i2 > 0; i2--)
|
for (var i2 = index2; i2 > 0; i2--) {
|
||||||
{
|
if (toc[i2].level < page.level) {
|
||||||
if (toc[i2].level < page.level)
|
|
||||||
{
|
|
||||||
this.set('tocTools.AllowIndent', false);
|
this.set('tocTools.AllowIndent', false);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (page.level === toc[i2].level)
|
if (page.level === toc[i2].level) {
|
||||||
{
|
|
||||||
this.set('tocTools.AllowIndent', true);
|
this.set('tocTools.AllowIndent', true);
|
||||||
break;
|
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 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.AllowIndent', false);
|
||||||
this.set('tocTools.UpTarget', "");
|
this.set('tocTools.UpTarget', "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// can we go down?
|
// can we go down?
|
||||||
if (!_.isUndefined(downPage))
|
if (!_.isUndefined(downPage)) {
|
||||||
{
|
|
||||||
// can only go down if someone below is at our level or higher
|
// can only go down if someone below is at our level or higher
|
||||||
var index3 = _.indexOf(toc, downPage, false);
|
var index3 = _.indexOf(toc, downPage, false);
|
||||||
|
|
||||||
if (index3 !== -1)
|
if (index3 !== -1) {
|
||||||
{
|
for (var i3 = index3; i3 < toc.length; i3++) {
|
||||||
for (var i3 = index3; i3 < toc.length; i3++)
|
if (toc[i3].level < page.level) {
|
||||||
{
|
|
||||||
if (toc[i3].level < page.level)
|
|
||||||
{
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (page.level === toc[i3].level)
|
if (page.level === toc[i3].level) {
|
||||||
{
|
|
||||||
this.set('tocTools.DownTarget', toc[i3].id);
|
this.set('tocTools.DownTarget', toc[i3].id);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -201,8 +205,12 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
||||||
}
|
}
|
||||||
|
|
||||||
var pages = this.get('pages');
|
var pages = this.get('pages');
|
||||||
var current = _.findWhere(pages, {id: this.get('page')});
|
var current = _.findWhere(pages, {
|
||||||
var page1 = _.findWhere(pages, {id: this.tocTools.UpTarget});
|
id: this.get('page')
|
||||||
|
});
|
||||||
|
var page1 = _.findWhere(pages, {
|
||||||
|
id: this.tocTools.UpTarget
|
||||||
|
});
|
||||||
var page2 = null;
|
var page2 = null;
|
||||||
var pendingChanges = [];
|
var pendingChanges = [];
|
||||||
|
|
||||||
|
@ -221,30 +229,33 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
||||||
|
|
||||||
var index = _.indexOf(pages, current, false);
|
var index = _.indexOf(pages, current, false);
|
||||||
|
|
||||||
if (index !== -1)
|
if (index !== -1) {
|
||||||
{
|
|
||||||
var sequence = (sequence1 + sequence2) / 2;
|
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++)
|
for (var i = index + 1; i < pages.length; i++) {
|
||||||
{
|
if (pages[i].level <= current.level) {
|
||||||
if (pages[i].level <= current.level)
|
|
||||||
{
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
sequence = (sequence + page1.sequence) / 2;
|
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.attrs.changePageSequence(pendingChanges);
|
||||||
|
|
||||||
this.send('clickGotoPage', this.get('page'));
|
this.send('clickGotoPage', this.get('page'));
|
||||||
this.audit.record("moved-page-up");
|
this.audit.record("moved-page-up");
|
||||||
this.showNotification("Moved up");
|
this.showNotification("Moved up");
|
||||||
},
|
},
|
||||||
|
|
||||||
// Move down -- pages below shift up.
|
// Move down -- pages below shift up.
|
||||||
|
@ -254,9 +265,13 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
||||||
}
|
}
|
||||||
|
|
||||||
var pages = this.get('pages');
|
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 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 downTargetIndex = _.indexOf(pages, downTarget, false);
|
||||||
var pendingChanges = [];
|
var pendingChanges = [];
|
||||||
|
|
||||||
|
@ -267,53 +282,53 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
||||||
var startingSequence = 0;
|
var startingSequence = 0;
|
||||||
var upperSequence = 0;
|
var upperSequence = 0;
|
||||||
var cutOff = _.rest(pages, downTargetIndex);
|
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 aboveThisGuy = siblings[0];
|
||||||
var belowThisGuy = pages[_.indexOf(pages, aboveThisGuy, false) - 1];
|
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;
|
startingSequence = (aboveThisGuy.sequence + belowThisGuy.sequence) / 2;
|
||||||
upperSequence = aboveThisGuy.sequence;
|
upperSequence = aboveThisGuy.sequence;
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
var otherGuy = pages[downTargetIndex + 1];
|
var otherGuy = pages[downTargetIndex + 1];
|
||||||
|
|
||||||
startingSequence = (otherGuy.sequence + downTarget.sequence) / 2;
|
startingSequence = (otherGuy.sequence + downTarget.sequence) / 2;
|
||||||
upperSequence = otherGuy.sequence;
|
upperSequence = otherGuy.sequence;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
startingSequence = downTarget.sequence * 2;
|
startingSequence = downTarget.sequence * 2;
|
||||||
upperSequence = startingSequence * 2;
|
upperSequence = startingSequence * 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
pendingChanges.push({ pageId: current.id, sequence: startingSequence });
|
pendingChanges.push({
|
||||||
|
pageId: current.id,
|
||||||
|
sequence: startingSequence
|
||||||
|
});
|
||||||
|
|
||||||
var sequence = (startingSequence + upperSequence) / 2;
|
var sequence = (startingSequence + upperSequence) / 2;
|
||||||
|
|
||||||
for (var i = pageIndex + 1; i < pages.length; i++)
|
for (var i = pageIndex + 1; i < pages.length; i++) {
|
||||||
{
|
if (pages[i].level <= current.level) {
|
||||||
if (pages[i].level <= current.level)
|
|
||||||
{
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
var sequence2 = (sequence + upperSequence) / 2;
|
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.attrs.changePageSequence(pendingChanges);
|
||||||
|
|
||||||
this.send('clickGotoPage', this.get('page'));
|
this.send('clickGotoPage', this.get('page'));
|
||||||
this.audit.record("moved-page-down");
|
this.audit.record("moved-page-down");
|
||||||
this.showNotification("Moved down");
|
this.showNotification("Moved down");
|
||||||
},
|
},
|
||||||
|
|
||||||
// Indent - changes a page from H2 to H3, etc.
|
// 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 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 pageIndex = _.indexOf(pages, current, false);
|
||||||
var pendingChanges = [];
|
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++)
|
for (var i = pageIndex + 1; i < pages.length; i++) {
|
||||||
{
|
if (pages[i].level <= current.level) {
|
||||||
if (pages[i].level <= current.level)
|
|
||||||
{
|
|
||||||
break;
|
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.attrs.changePageLevel(pendingChanges);
|
||||||
|
|
||||||
this.send('clickGotoPage', this.get('page'));
|
this.send('clickGotoPage', this.get('page'));
|
||||||
this.audit.record("changed-page-sequence");
|
this.audit.record("changed-page-sequence");
|
||||||
this.showNotification("Indent");
|
this.showNotification("Indent");
|
||||||
},
|
},
|
||||||
|
|
||||||
// Outdent - changes a page from H3 to H2, etc.
|
// 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 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 pageIndex = _.indexOf(pages, current, false);
|
||||||
var pendingChanges = [];
|
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++)
|
for (var i = pageIndex + 1; i < pages.length; i++) {
|
||||||
{
|
if (pages[i].level <= current.level) {
|
||||||
if (pages[i].level <= current.level)
|
|
||||||
{
|
|
||||||
break;
|
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.attrs.changePageLevel(pendingChanges);
|
||||||
this.audit.record("changed-page-sequence");
|
this.audit.record("changed-page-sequence");
|
||||||
this.showNotification("Outdent");
|
this.showNotification("Outdent");
|
||||||
this.send('clickGotoPage', this.get('page'));
|
this.send('clickGotoPage', this.get('page'));
|
||||||
},
|
},
|
||||||
|
|
||||||
clickGotoPage(id) {
|
clickGotoPage(id) {
|
||||||
|
@ -380,4 +407,4 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
||||||
this.attrs.gotoPage(id);
|
this.attrs.gotoPage(id);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
|
@ -1,3 +1,14 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
export default Ember.Component.extend({
|
export default Ember.Component.extend({
|
||||||
|
|
|
@ -1,3 +1,14 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
export default Ember.Component.extend({
|
export default Ember.Component.extend({
|
||||||
|
|
|
@ -1,3 +1,14 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
import NotifierMixin from '../../mixins/notifier';
|
import NotifierMixin from '../../mixins/notifier';
|
||||||
import TooltipMixin from '../../mixins/tooltip';
|
import TooltipMixin from '../../mixins/tooltip';
|
||||||
|
|
|
@ -1,3 +1,14 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
import NotifierMixin from '../../mixins/notifier';
|
import NotifierMixin from '../../mixins/notifier';
|
||||||
import TooltipMixin from '../../mixins/tooltip';
|
import TooltipMixin from '../../mixins/tooltip';
|
||||||
|
|
|
@ -1,3 +1,14 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
export default Ember.Component.extend({
|
export default Ember.Component.extend({
|
||||||
|
@ -27,8 +38,11 @@ export default Ember.Component.extend({
|
||||||
|
|
||||||
didRender() {
|
didRender() {
|
||||||
let self = this;
|
let self = this;
|
||||||
Ember.run.schedule('afterRender', function(){
|
Ember.run.schedule('afterRender', function() {
|
||||||
Mousetrap.bind('esc', function() { self.send('cancelAction'); return false;});
|
Mousetrap.bind('esc', function() {
|
||||||
|
self.send('cancelAction');
|
||||||
|
return false;
|
||||||
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -45,15 +59,17 @@ export default Ember.Component.extend({
|
||||||
Ember.set(revision, 'selected', false);
|
Ember.set(revision, 'selected', false);
|
||||||
});
|
});
|
||||||
|
|
||||||
let revision = _.findWhere(revisions, { id: revisionId});
|
let revision = _.findWhere(revisions, {
|
||||||
|
id: revisionId
|
||||||
|
});
|
||||||
Ember.set(revision, 'selected', true);
|
Ember.set(revision, 'selected', true);
|
||||||
|
|
||||||
let self = this;
|
let self = this;
|
||||||
|
|
||||||
this.get('documentService').getPageRevisionDiff(this.get('model.documentId'),
|
this.get('documentService').getPageRevisionDiff(this.get('model.documentId'),
|
||||||
this.get('model.pageId'), revisionId).then(function(response) {
|
this.get('model.pageId'), revisionId).then(function(response) {
|
||||||
self.set('busy', false);
|
self.set('busy', false);
|
||||||
self.set('diffReport', Ember.String.htmlSafe(response));
|
self.set('diffReport', Ember.String.htmlSafe(response));
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -67,4 +83,4 @@ export default Ember.Component.extend({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
|
@ -1,3 +1,14 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
import TooltipMixin from '../../mixins/tooltip';
|
import TooltipMixin from '../../mixins/tooltip';
|
||||||
|
|
||||||
|
|
|
@ -1,43 +1,67 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
import NotifierMixin from '../../mixins/notifier';
|
||||||
|
|
||||||
export default Ember.Component.extend({
|
export default Ember.Component.extend(NotifierMixin, {
|
||||||
title: "",
|
title: "New Section",
|
||||||
contentType: "",
|
contentType: "",
|
||||||
|
|
||||||
didReceiveAttrs() {
|
didReceiveAttrs() {
|
||||||
let section = this.get("sections").get('firstObject');
|
let section = this.get("sections").get('firstObject');
|
||||||
section.set("selected", true);
|
section.set("selected", true);
|
||||||
},
|
},
|
||||||
|
|
||||||
didInsertElement() {
|
didInsertElement() {
|
||||||
$("#page-title").removeClass("error").focus();
|
$("#page-title").removeClass("error").focus();
|
||||||
},
|
},
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
setOption(id) {
|
setOption(id) {
|
||||||
let sections = this.get("sections");
|
let sections = this.get("sections");
|
||||||
|
|
||||||
sections.forEach(function(option) {
|
sections.forEach(function(option) {
|
||||||
Ember.set(option, 'selected', option.id === id);
|
Ember.set(option, 'selected', option.id === id);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.set("sections", sections);
|
this.set("sections", sections);
|
||||||
},
|
|
||||||
|
|
||||||
onCancel() {
|
if (this.session.get('popupBlocked')) {
|
||||||
this.attrs.onCancel();
|
this.showNotification("Hmm, looks like your browser is blocking popups...");
|
||||||
},
|
}
|
||||||
|
},
|
||||||
|
|
||||||
onAction() {
|
onCancel() {
|
||||||
let title = this.get("title");
|
this.attrs.onCancel();
|
||||||
let contentType = this.get("sections").findBy("selected", true).contentType;
|
},
|
||||||
|
|
||||||
if (is.empty(title)) {
|
onAction() {
|
||||||
$("#page-title").addClass("error").focus();
|
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;
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,3 +1,14 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
export default Ember.Component.extend({
|
export default Ember.Component.extend({
|
||||||
|
@ -6,7 +17,7 @@ export default Ember.Component.extend({
|
||||||
isEditor: false,
|
isEditor: false,
|
||||||
newTag: "",
|
newTag: "",
|
||||||
maxTags: 3,
|
maxTags: 3,
|
||||||
canAdd: false,
|
canAdd: false,
|
||||||
|
|
||||||
didInitAttrs() {
|
didInitAttrs() {
|
||||||
let tagz = [];
|
let tagz = [];
|
||||||
|
@ -21,61 +32,61 @@ export default Ember.Component.extend({
|
||||||
}
|
}
|
||||||
|
|
||||||
this.set('tagz', tagz);
|
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() {
|
didUpdateAttrs() {
|
||||||
this.set('canAdd', this.get('isEditor') && this.get('tagz').get('length') < 3);
|
this.set('canAdd', this.get('isEditor') && this.get('tagz').get('length') < 3);
|
||||||
},
|
},
|
||||||
|
|
||||||
didInsertElement() {
|
didInsertElement() {
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
willDestroyElement() {
|
willDestroyElement() {
|
||||||
$("#add-tag-field").off("keydown");
|
$("#add-tag-field").off("keydown");
|
||||||
},
|
},
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
onTagEditor() {
|
onTagEditor() {
|
||||||
$("#add-tag-field").off("keydown").on("keydown", function(e) {
|
$("#add-tag-field").off("keydown").on("keydown", function(e) {
|
||||||
if (e.shiftKey) {
|
if (e.shiftKey) {
|
||||||
return false;
|
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)) {
|
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 true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
addTag() {
|
addTag() {
|
||||||
let tags = this.get("tagz");
|
let tags = this.get("tagz");
|
||||||
let tag = this.get('newTag');
|
let tag = this.get('newTag');
|
||||||
tag = tag.toLowerCase().trim();
|
tag = tag.toLowerCase().trim();
|
||||||
|
|
||||||
// empty or dupe?
|
// empty or dupe?
|
||||||
if (tag.length === 0 || _.contains(tags, tag) || tags.length >= this.get('maxTags') || tag.startsWith('-')) {
|
if (tag.length === 0 || _.contains(tags, tag) || tags.length >= this.get('maxTags') || tag.startsWith('-')) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
tags.pushObject(tag);
|
tags.pushObject(tag);
|
||||||
this.set('tagz', tags);
|
this.set('tagz', tags);
|
||||||
this.set('newTag', '');
|
this.set('newTag', '');
|
||||||
|
|
||||||
let save = "#";
|
let save = "#";
|
||||||
_.each(tags, function(tag) {
|
_.each(tags, function(tag) {
|
||||||
save = save + 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 removes specified tag from the list of tags associated with this document.
|
||||||
removeTag(tagToRemove) {
|
removeTag(tagToRemove) {
|
||||||
|
@ -97,4 +108,4 @@ export default Ember.Component.extend({
|
||||||
this.audit.record('removed tag');
|
this.audit.record('removed tag');
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
});
|
});
|
|
@ -1,29 +1,39 @@
|
||||||
// Copyright (c) 2015 Documize Inc.
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
import stringUtil from '../utils/string';
|
import stringUtil from '../utils/string';
|
||||||
|
|
||||||
export default Ember.Component.extend({
|
export default Ember.Component.extend({
|
||||||
drop: null,
|
drop: null,
|
||||||
target: null,
|
target: null,
|
||||||
button: "Delete",
|
button: "Delete",
|
||||||
color: "flat-red",
|
color: "flat-red",
|
||||||
button2: "",
|
button2: "",
|
||||||
color2: "2",
|
color2: "2",
|
||||||
open: "click",
|
open: "click",
|
||||||
position: 'bottom right',
|
position: 'bottom right',
|
||||||
showCancel: true,
|
showCancel: true,
|
||||||
contentId: "",
|
contentId: "",
|
||||||
focusOn: null, // is there an input field we need to focus?
|
focusOn: null, // is there an input field we need to focus?
|
||||||
selectOn: null, // is there an input field we need to select?
|
selectOn: null, // is there an input field we need to select?
|
||||||
onOpenCallback: null, // callback when opened
|
onOpenCallback: null, // callback when opened
|
||||||
onAction: null,
|
onAction: null,
|
||||||
onAction2: null,
|
onAction2: null,
|
||||||
offset: "5px 0",
|
offset: "5px 0",
|
||||||
targetOffset: "10px 0",
|
targetOffset: "10px 0",
|
||||||
|
|
||||||
hasSecondButton: Ember.computed('button2', 'color2', function() {
|
hasSecondButton: Ember.computed('button2', 'color2', function() {
|
||||||
return is.not.empty(this.get('button2')) && is.not.empty(this.get('color2'));
|
return is.not.empty(this.get('button2')) && is.not.empty(this.get('color2'));
|
||||||
}),
|
}),
|
||||||
|
|
||||||
didReceiveAttrs() {
|
didReceiveAttrs() {
|
||||||
this.set("contentId", 'dropdown-dialog-' + stringUtil.makeId(10));
|
this.set("contentId", 'dropdown-dialog-' + stringUtil.makeId(10));
|
||||||
|
@ -37,35 +47,35 @@ export default Ember.Component.extend({
|
||||||
target: document.getElementById(self.get('target')),
|
target: document.getElementById(self.get('target')),
|
||||||
content: self.$(".dropdown-dialog")[0],
|
content: self.$(".dropdown-dialog")[0],
|
||||||
classes: 'drop-theme-basic',
|
classes: 'drop-theme-basic',
|
||||||
position: self.get('position'),
|
position: self.get('position'),
|
||||||
openOn: self.get('open'),
|
openOn: self.get('open'),
|
||||||
tetherOptions: {
|
tetherOptions: {
|
||||||
offset: self.offset,
|
offset: self.offset,
|
||||||
targetOffset: self.targetOffset
|
targetOffset: self.targetOffset
|
||||||
},
|
},
|
||||||
remove: true
|
remove: true
|
||||||
});
|
});
|
||||||
|
|
||||||
self.set('drop', drop);
|
self.set('drop', drop);
|
||||||
|
|
||||||
drop.on('open', function() {
|
drop.on('open', function() {
|
||||||
if (is.not.null(self.get("focusOn"))) {
|
if (is.not.null(self.get("focusOn"))) {
|
||||||
document.getElementById(self.get("focusOn")).focus();
|
document.getElementById(self.get("focusOn")).focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is.not.null(self.get("selectOn"))) {
|
if (is.not.null(self.get("selectOn"))) {
|
||||||
document.getElementById(self.get("selectOn")).select();
|
document.getElementById(self.get("selectOn")).select();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is.not.null(self.get("onOpenCallback"))) {
|
if (is.not.null(self.get("onOpenCallback"))) {
|
||||||
self.attrs.onOpenCallback(drop);
|
self.attrs.onOpenCallback(drop);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
willDestroyElement() {
|
willDestroyElement() {
|
||||||
this.get('drop').destroy();
|
this.get('drop').destroy();
|
||||||
},
|
},
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
onCancel() {
|
onCancel() {
|
||||||
|
@ -73,9 +83,9 @@ export default Ember.Component.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
onAction() {
|
onAction() {
|
||||||
if (this.get('onAction') === null) {
|
if (this.get('onAction') === null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let close = this.attrs.onAction();
|
let close = this.attrs.onAction();
|
||||||
|
|
||||||
|
@ -84,10 +94,10 @@ export default Ember.Component.extend({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onAction2() {
|
onAction2() {
|
||||||
if (this.get('onAction2') === null) {
|
if (this.get('onAction2') === null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let close = this.attrs.onAction2();
|
let close = this.attrs.onAction2();
|
||||||
|
|
||||||
|
@ -96,4 +106,4 @@ export default Ember.Component.extend({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
|
@ -1,4 +1,14 @@
|
||||||
// Copyright (c) 2015 Documize Inc.
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
import stringUtil from '../utils/string';
|
import stringUtil from '../utils/string';
|
||||||
|
|
||||||
|
@ -12,9 +22,9 @@ export default Ember.Component.extend({
|
||||||
didReceiveAttrs() {
|
didReceiveAttrs() {
|
||||||
this.set("contentId", 'dropdown-menu-' + stringUtil.makeId(10));
|
this.set("contentId", 'dropdown-menu-' + stringUtil.makeId(10));
|
||||||
|
|
||||||
// if (this.session.get('isMobile')) {
|
// if (this.session.get('isMobile')) {
|
||||||
// this.set('open', "click");
|
// this.set('open', "click");
|
||||||
// }
|
// }
|
||||||
},
|
},
|
||||||
|
|
||||||
didInsertElement() {
|
didInsertElement() {
|
||||||
|
@ -25,7 +35,7 @@ export default Ember.Component.extend({
|
||||||
target: document.getElementById(self.get('target')),
|
target: document.getElementById(self.get('target')),
|
||||||
content: self.$(".dropdown-menu")[0],
|
content: self.$(".dropdown-menu")[0],
|
||||||
classes: 'drop-theme-menu',
|
classes: 'drop-theme-menu',
|
||||||
position: self.get('position'),
|
position: self.get('position'),
|
||||||
openOn: self.get('open'),
|
openOn: self.get('open'),
|
||||||
tetherOptions: {
|
tetherOptions: {
|
||||||
offset: "5px 0",
|
offset: "5px 0",
|
||||||
|
@ -36,7 +46,7 @@ export default Ember.Component.extend({
|
||||||
self.set('drop', drop);
|
self.set('drop', drop);
|
||||||
},
|
},
|
||||||
|
|
||||||
willDestroyElement() {
|
willDestroyElement() {
|
||||||
this.get('drop').destroy();
|
this.get('drop').destroy();
|
||||||
}
|
}
|
||||||
});
|
});
|
|
@ -1,7 +1,18 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
export default Ember.TextField.extend({
|
export default Ember.TextField.extend({
|
||||||
becomeFocused: function() {
|
becomeFocused: function() {
|
||||||
this.$().focus();
|
this.$().focus();
|
||||||
}.on('didInsertElement')
|
}.on('didInsertElement')
|
||||||
});
|
});
|
|
@ -1,7 +1,18 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
export default Ember.TextArea.extend({
|
export default Ember.TextArea.extend({
|
||||||
becomeFocused: function() {
|
becomeFocused: function() {
|
||||||
this.$().focus();
|
this.$().focus();
|
||||||
}.on('didInsertElement')
|
}.on('didInsertElement')
|
||||||
});
|
});
|
|
@ -1,3 +1,14 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
export default Ember.Component.extend({
|
export default Ember.Component.extend({
|
||||||
|
@ -24,4 +35,4 @@ export default Ember.Component.extend({
|
||||||
this.get('filterByTag')(tag);
|
this.get('filterByTag')(tag);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
|
@ -1,3 +1,14 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
export default Ember.Component.extend({
|
export default Ember.Component.extend({
|
||||||
|
@ -9,22 +20,22 @@ export default Ember.Component.extend({
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
selectDocument(documentId) {
|
selectDocument(documentId) {
|
||||||
let doc = this.get('documents').findBy('id', documentId);
|
let doc = this.get('documents').findBy('id', documentId);
|
||||||
let list = this.get('selectedDocuments');
|
let list = this.get('selectedDocuments');
|
||||||
|
|
||||||
doc.set('selected', !doc.get('selected'));
|
doc.set('selected', !doc.get('selected'));
|
||||||
|
|
||||||
if (doc.get('selected')) {
|
if (doc.get('selected')) {
|
||||||
list.push(documentId);
|
list.push(documentId);
|
||||||
} else {
|
} else {
|
||||||
var index = list.indexOf(documentId);
|
var index = list.indexOf(documentId);
|
||||||
if (index > -1) {
|
if (index > -1) {
|
||||||
list.splice(index, 1);
|
list.splice(index, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.set('selectedDocuments', list);
|
this.set('selectedDocuments', list);
|
||||||
this.get('onDocumentsChecked')(list);
|
this.get('onDocumentsChecked')(list);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
|
@ -1,3 +1,14 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
import NotifierMixin from '../../mixins/notifier';
|
import NotifierMixin from '../../mixins/notifier';
|
||||||
import TooltipMixin from '../../mixins/tooltip';
|
import TooltipMixin from '../../mixins/tooltip';
|
||||||
|
@ -12,9 +23,9 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
||||||
hasSelectedDocuments: false,
|
hasSelectedDocuments: false,
|
||||||
selectedDocuments: [],
|
selectedDocuments: [],
|
||||||
importedDocuments: [],
|
importedDocuments: [],
|
||||||
savedTemplates: [],
|
savedTemplates: [],
|
||||||
isFolderOwner: false,
|
isFolderOwner: false,
|
||||||
moveFolderId: "",
|
moveFolderId: "",
|
||||||
|
|
||||||
hasDocuments: function() {
|
hasDocuments: function() {
|
||||||
return this.documents.get('length') > 0;
|
return this.documents.get('length') > 0;
|
||||||
|
@ -26,38 +37,44 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
||||||
this.set('importedDocuments', []);
|
this.set('importedDocuments', []);
|
||||||
this.set('isFolderOwner', this.get('folder.userId') === this.session.user.id);
|
this.set('isFolderOwner', this.get('folder.userId') === this.session.user.id);
|
||||||
|
|
||||||
let self = this;
|
let self = this;
|
||||||
|
|
||||||
this.get('templateService').getSavedTemplates().then(function(saved) {
|
this.get('templateService').getSavedTemplates().then(function(saved) {
|
||||||
let emptyTemplate = { id: "0", title: "Empty document", selected: true };
|
let emptyTemplate = {
|
||||||
saved.unshiftObject(emptyTemplate);
|
id: "0",
|
||||||
self.set('savedTemplates', saved);
|
title: "Empty document",
|
||||||
});
|
selected: true
|
||||||
|
};
|
||||||
|
saved.unshiftObject(emptyTemplate);
|
||||||
|
self.set('savedTemplates', saved);
|
||||||
|
});
|
||||||
|
|
||||||
let targets = _.reject(this.get('folders'), { id: this.get('folder').get('id') });
|
let targets = _.reject(this.get('folders'), {
|
||||||
this.set('movedFolderOptions', targets);
|
id: this.get('folder').get('id')
|
||||||
|
});
|
||||||
|
this.set('movedFolderOptions', targets);
|
||||||
},
|
},
|
||||||
|
|
||||||
didRender() {
|
didRender() {
|
||||||
if (this.get('hasSelectedDocuments')) {
|
if (this.get('hasSelectedDocuments')) {
|
||||||
this.addTooltip(document.getElementById("move-documents-button"));
|
this.addTooltip(document.getElementById("move-documents-button"));
|
||||||
this.addTooltip(document.getElementById("delete-documents-button"));
|
this.addTooltip(document.getElementById("delete-documents-button"));
|
||||||
} else {
|
} else {
|
||||||
if (this.get('isFolderOwner')) {
|
if (this.get('isFolderOwner')) {
|
||||||
this.addTooltip(document.getElementById("folder-share-button"));
|
this.addTooltip(document.getElementById("folder-share-button"));
|
||||||
this.addTooltip(document.getElementById("folder-settings-button"));
|
this.addTooltip(document.getElementById("folder-settings-button"));
|
||||||
}
|
}
|
||||||
if (this.get('folderService').get('canEditCurrentFolder')) {
|
if (this.get('folderService').get('canEditCurrentFolder')) {
|
||||||
this.addTooltip(document.getElementById("start-document-button"));
|
this.addTooltip(document.getElementById("start-document-button"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
willDestroyElement() {
|
willDestroyElement() {
|
||||||
this.destroyTooltips();
|
this.destroyTooltips();
|
||||||
},
|
},
|
||||||
|
|
||||||
navigateToDocument(document){
|
navigateToDocument(document) {
|
||||||
this.attrs.showDocument(this.get('folder'), 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);
|
this.set('hasSelectedDocuments', documents.length > 0);
|
||||||
},
|
},
|
||||||
|
|
||||||
onEditTemplate(template) {
|
onEditTemplate(template) {
|
||||||
this.navigateToDocument(template);
|
this.navigateToDocument(template);
|
||||||
},
|
},
|
||||||
|
|
||||||
onDocumentTemplate(id /*, title, type*/) {
|
onDocumentTemplate(id /*, title, type*/ ) {
|
||||||
let self = this;
|
let self = this;
|
||||||
|
|
||||||
this.send("showNotification", "Creating");
|
this.send("showNotification", "Creating");
|
||||||
|
|
||||||
this.get('templateService').importSavedTemplate(this.folder.get('id'), id).then(function(document) {
|
this.get('templateService').importSavedTemplate(this.folder.get('id'), id).then(function(document) {
|
||||||
self.navigateToDocument(document);
|
self.navigateToDocument(document);
|
||||||
|
@ -82,21 +99,21 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
||||||
},
|
},
|
||||||
|
|
||||||
onDocumentImporting(filename) {
|
onDocumentImporting(filename) {
|
||||||
this.send("showNotification", `Importing ${filename}`);
|
this.send("showNotification", `Importing ${filename}`);
|
||||||
|
|
||||||
let documents = this.get('importedDocuments');
|
let documents = this.get('importedDocuments');
|
||||||
documents.push(filename);
|
documents.push(filename);
|
||||||
this.set('importedDocuments', documents);
|
this.set('importedDocuments', documents);
|
||||||
},
|
},
|
||||||
|
|
||||||
onDocumentImported(filename/*, document*/) {
|
onDocumentImported(filename /*, document*/ ) {
|
||||||
this.send("showNotification", `${filename} ready`);
|
this.send("showNotification", `${filename} ready`);
|
||||||
|
|
||||||
let documents = this.get('importedDocuments');
|
let documents = this.get('importedDocuments');
|
||||||
documents.pop(filename);
|
documents.pop(filename);
|
||||||
this.set('importedDocuments', documents);
|
this.set('importedDocuments', documents);
|
||||||
|
|
||||||
this.attrs.refresh();
|
this.attrs.refresh();
|
||||||
|
|
||||||
if (documents.length === 0) {
|
if (documents.length === 0) {
|
||||||
// this.get('showDocument')(this.get('folder'), document);
|
// this.get('showDocument')(this.get('folder'), document);
|
||||||
|
@ -115,31 +132,31 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
||||||
|
|
||||||
this.set('selectedDocuments', []);
|
this.set('selectedDocuments', []);
|
||||||
this.set('hasSelectedDocuments', false);
|
this.set('hasSelectedDocuments', false);
|
||||||
this.send("showNotification", "Deleted");
|
this.send("showNotification", "Deleted");
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
|
|
||||||
setMoveFolder(folderId) {
|
setMoveFolder(folderId) {
|
||||||
this.set('moveFolderId', folderId);
|
this.set('moveFolderId', folderId);
|
||||||
|
|
||||||
let folders = this.get('folders');
|
let folders = this.get('folders');
|
||||||
|
|
||||||
folders.forEach(folder => {
|
folders.forEach(folder => {
|
||||||
folder.set('selected', folder.id === folderId);
|
folder.set('selected', folder.id === folderId);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
moveDocuments() {
|
moveDocuments() {
|
||||||
if (this.get("moveFolderId") === "") {
|
if (this.get("moveFolderId") === "") {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.get('onMoveDocument')(this.get('selectedDocuments'), this.get('moveFolderId'));
|
this.get('onMoveDocument')(this.get('selectedDocuments'), this.get('moveFolderId'));
|
||||||
this.set("moveFolderId", "");
|
this.set("moveFolderId", "");
|
||||||
this.send("showNotification", "Moved");
|
this.send("showNotification", "Moved");
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
|
@ -1,3 +1,14 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
export default Ember.Component.extend({
|
export default Ember.Component.extend({
|
||||||
|
@ -28,16 +39,16 @@ export default Ember.Component.extend({
|
||||||
actions: {
|
actions: {
|
||||||
rename() {
|
rename() {
|
||||||
if (is.empty(this.folder.get('name'))) {
|
if (is.empty(this.folder.get('name'))) {
|
||||||
$("#folderName").addClass("error").focus();
|
$("#folderName").addClass("error").focus();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.sendAction("onRename", this.folder);
|
this.sendAction("onRename", this.folder);
|
||||||
},
|
},
|
||||||
|
|
||||||
remove() {
|
remove() {
|
||||||
if (is.null(this.get('moveTarget'))) {
|
if (is.null(this.get('moveTarget'))) {
|
||||||
$("#delete-target > select").addClass("error").focus();
|
$("#delete-target > select").addClass("error").focus();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,10 +63,10 @@ export default Ember.Component.extend({
|
||||||
message = this.getDefaultInvitationMessage();
|
message = this.getDefaultInvitationMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (email.length === 0) {
|
if (email.length === 0) {
|
||||||
$("#inviteEmail").addClass("error").focus();
|
$("#inviteEmail").addClass("error").focus();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var result = {
|
var result = {
|
||||||
Message: message,
|
Message: message,
|
||||||
|
@ -75,7 +86,7 @@ export default Ember.Component.extend({
|
||||||
result.Recipients.push(email);
|
result.Recipients.push(email);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.set('inviteEmail', "");
|
this.set('inviteEmail', "");
|
||||||
|
|
||||||
this.sendAction("onShare", result);
|
this.sendAction("onShare", result);
|
||||||
},
|
},
|
||||||
|
@ -95,4 +106,4 @@ export default Ember.Component.extend({
|
||||||
this.sendAction("onPermission", this.get('folder'), message, this.get('permissions'));
|
this.sendAction("onPermission", this.get('folder'), message, this.get('permissions'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
|
@ -1,62 +1,72 @@
|
||||||
// Copyright (c) 2015 Documize Inc.
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
import constants from '../../utils/constants';
|
import constants from '../../utils/constants';
|
||||||
import TooltipMixin from '../../mixins/tooltip';
|
import TooltipMixin from '../../mixins/tooltip';
|
||||||
|
|
||||||
export default Ember.Component.extend(TooltipMixin, {
|
export default Ember.Component.extend(TooltipMixin, {
|
||||||
folderService: Ember.inject.service('folder'),
|
folderService: Ember.inject.service('folder'),
|
||||||
publicFolders: [],
|
publicFolders: [],
|
||||||
protectedFolders: [],
|
protectedFolders: [],
|
||||||
privateFolders: [],
|
privateFolders: [],
|
||||||
hasPublicFolders: false,
|
hasPublicFolders: false,
|
||||||
hasProtectedFolders: false,
|
hasProtectedFolders: false,
|
||||||
hasPrivateFolders: false,
|
hasPrivateFolders: false,
|
||||||
newFolder: "",
|
newFolder: "",
|
||||||
|
|
||||||
didInsertElement() {
|
didInsertElement() {
|
||||||
this._super(...arguments);
|
this._super(...arguments);
|
||||||
if (this.session.authenticated) {
|
if (this.session.authenticated) {
|
||||||
this.addTooltip(document.getElementById("add-folder-button"));
|
this.addTooltip(document.getElementById("add-folder-button"));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
didReceiveAttrs() {
|
didReceiveAttrs() {
|
||||||
let folders = this.get('folders');
|
let folders = this.get('folders');
|
||||||
let self = this;
|
let self = this;
|
||||||
|
|
||||||
// clear out state
|
// clear out state
|
||||||
this.set('publicFolders', []);
|
this.set('publicFolders', []);
|
||||||
this.set('protectedFolders', []);
|
this.set('protectedFolders', []);
|
||||||
this.set('privateFolders', []);
|
this.set('privateFolders', []);
|
||||||
|
|
||||||
_.each(folders, folder => {
|
_.each(folders, folder => {
|
||||||
if (folder.folderType === constants.FolderType.Public) {
|
if (folder.folderType === constants.FolderType.Public) {
|
||||||
let folders = self.get('publicFolders');
|
let folders = self.get('publicFolders');
|
||||||
folders.pushObject(folder);
|
folders.pushObject(folder);
|
||||||
self.set('publicFolders', folders);
|
self.set('publicFolders', folders);
|
||||||
}
|
}
|
||||||
if (folder.folderType === constants.FolderType.Private) {
|
if (folder.folderType === constants.FolderType.Private) {
|
||||||
let folders = self.get('privateFolders');
|
let folders = self.get('privateFolders');
|
||||||
folders.pushObject(folder);
|
folders.pushObject(folder);
|
||||||
self.set('privateFolders', folders);
|
self.set('privateFolders', folders);
|
||||||
}
|
}
|
||||||
if (folder.folderType === constants.FolderType.Protected) {
|
if (folder.folderType === constants.FolderType.Protected) {
|
||||||
let folders = self.get('protectedFolders');
|
let folders = self.get('protectedFolders');
|
||||||
folders.pushObject(folder);
|
folders.pushObject(folder);
|
||||||
self.set('protectedFolders', folders);
|
self.set('protectedFolders', folders);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
this.set('hasPublicFolders', this.get('publicFolders.length') > 0);
|
this.set('hasPublicFolders', this.get('publicFolders.length') > 0);
|
||||||
this.set('hasPrivateFolders', this.get('privateFolders.length') > 0);
|
this.set('hasPrivateFolders', this.get('privateFolders.length') > 0);
|
||||||
this.set('hasProtectedFolders', this.get('protectedFolders.length') > 0);
|
this.set('hasProtectedFolders', this.get('protectedFolders.length') > 0);
|
||||||
},
|
},
|
||||||
|
|
||||||
willDestroyElement() {
|
willDestroyElement() {
|
||||||
this.destroyTooltips();
|
this.destroyTooltips();
|
||||||
},
|
},
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
addFolder() {
|
addFolder() {
|
||||||
var folderName = this.get('newFolder');
|
var folderName = this.get('newFolder');
|
||||||
|
|
||||||
|
@ -65,10 +75,10 @@ export default Ember.Component.extend(TooltipMixin, {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.attrs.onFolderAdd(folderName);
|
this.attrs.onFolderAdd(folderName);
|
||||||
|
|
||||||
this.set('newFolder', "");
|
this.set('newFolder', "");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
|
@ -1,89 +1,103 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
import NotifierMixin from '../../mixins/notifier';
|
import NotifierMixin from '../../mixins/notifier';
|
||||||
|
|
||||||
export default Ember.Component.extend(NotifierMixin, {
|
export default Ember.Component.extend(NotifierMixin, {
|
||||||
|
|
||||||
tagName: 'span',
|
tagName: 'span',
|
||||||
selectedTemplate: { id: "0" },
|
selectedTemplate: {
|
||||||
canEditTemplate: "",
|
id: "0"
|
||||||
|
},
|
||||||
|
canEditTemplate: "",
|
||||||
|
|
||||||
didReceiveAttrs() {
|
didReceiveAttrs() {
|
||||||
this.send('setTemplate', this.get('savedTemplates')[0]);
|
this.send('setTemplate', this.get('savedTemplates')[0]);
|
||||||
},
|
},
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
setTemplate(chosen) {
|
setTemplate(chosen) {
|
||||||
if (is.undefined(chosen)) {
|
if (is.undefined(chosen)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.set('selectedTemplate', chosen);
|
this.set('selectedTemplate', chosen);
|
||||||
this.set('canEditTemplate', chosen.id !== "0" ? "Edit" : "");
|
this.set('canEditTemplate', chosen.id !== "0" ? "Edit" : "");
|
||||||
|
|
||||||
let templates = this.get('savedTemplates');
|
let templates = this.get('savedTemplates');
|
||||||
|
|
||||||
templates.forEach(template => {
|
templates.forEach(template => {
|
||||||
Ember.set(template, 'selected', template.id === chosen.id);
|
Ember.set(template, 'selected', template.id === chosen.id);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
editTemplate() {
|
editTemplate() {
|
||||||
let template = this.get('selectedTemplate');
|
let template = this.get('selectedTemplate');
|
||||||
|
|
||||||
this.audit.record('edited-saved-template');
|
this.audit.record('edited-saved-template');
|
||||||
this.attrs.onEditTemplate(template);
|
this.attrs.onEditTemplate(template);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
|
|
||||||
startDocument() {
|
startDocument() {
|
||||||
let template = this.get('selectedTemplate');
|
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");
|
this.attrs.onDocumentTemplate(template.id, template.title, "private");
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
|
|
||||||
onOpenCallback() {
|
onOpenCallback() {
|
||||||
let self = this;
|
let self = this;
|
||||||
let folderId = this.get('folder.id');
|
let folderId = this.get('folder.id');
|
||||||
let importUrl = this.session.appMeta.getUrl('import/folder/' + folderId);
|
let importUrl = this.session.appMeta.getUrl('import/folder/' + folderId);
|
||||||
|
|
||||||
let dzone = new Dropzone("#upload-documents", {
|
let dzone = new Dropzone("#upload-documents", {
|
||||||
headers: {'Authorization': 'Bearer ' + self.session.getSessionItem('token') },
|
headers: {
|
||||||
url: importUrl,
|
'Authorization': 'Bearer ' + self.session.getSessionItem('token')
|
||||||
method: "post",
|
},
|
||||||
paramName: 'attachment',
|
url: importUrl,
|
||||||
acceptedFiles: ".doc,.docx,.txt,.md,.markdown",
|
method: "post",
|
||||||
clickable: true,
|
paramName: 'attachment',
|
||||||
maxFilesize: 10,
|
acceptedFiles: ".doc,.docx,.txt,.md,.markdown",
|
||||||
parallelUploads: 3,
|
clickable: true,
|
||||||
uploadMultiple: false,
|
maxFilesize: 10,
|
||||||
addRemoveLinks: false,
|
parallelUploads: 3,
|
||||||
autoProcessQueue: true,
|
uploadMultiple: false,
|
||||||
|
addRemoveLinks: false,
|
||||||
|
autoProcessQueue: true,
|
||||||
|
|
||||||
init: function() {
|
init: function() {
|
||||||
this.on("success", function(document) {
|
this.on("success", function(document) {
|
||||||
self.attrs.onDocumentImported(document.name, document);
|
self.attrs.onDocumentImported(document.name, document);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.on("error", function(x) {
|
this.on("error", function(x) {
|
||||||
console.log("Conversion failed for ", x.name, " obj ",x); // TODO proper error handling
|
console.log("Conversion failed for ", x.name, " obj ", x); // TODO proper error handling
|
||||||
});
|
});
|
||||||
|
|
||||||
this.on("queuecomplete", function() {
|
|
||||||
});
|
|
||||||
|
|
||||||
this.on("addedfile", function(file) {
|
this.on("queuecomplete", function() {});
|
||||||
self.attrs.onDocumentImporting(file.name);
|
|
||||||
self.audit.record('converted-document');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
dzone.on("complete", function(file) {
|
this.on("addedfile", function(file) {
|
||||||
dzone.removeFile(file);
|
self.attrs.onDocumentImporting(file.name);
|
||||||
});
|
self.audit.record('converted-document');
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
dzone.on("complete", function(file) {
|
||||||
|
dzone.removeFile(file);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
|
@ -1,4 +1,14 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
export default Ember.Component.extend({
|
export default Ember.Component.extend({});
|
||||||
});
|
|
|
@ -1,13 +1,23 @@
|
||||||
// Copyright (c) 2015 Documize Inc.
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
import netUtil from '../../utils/net';
|
import netUtil from '../../utils/net';
|
||||||
|
|
||||||
export default Ember.Component.extend({
|
export default Ember.Component.extend({
|
||||||
dashboardMode: false,
|
dashboardMode: false,
|
||||||
searchMode: false,
|
searchMode: false,
|
||||||
profileMode: false,
|
profileMode: false,
|
||||||
settingsMode: false,
|
settingsMode: false,
|
||||||
folderMode: false,
|
folderMode: false,
|
||||||
documentMode: false,
|
documentMode: false,
|
||||||
|
|
||||||
didInitAttrs() {
|
didInitAttrs() {
|
||||||
|
@ -22,7 +32,7 @@ export default Ember.Component.extend({
|
||||||
actions: {
|
actions: {
|
||||||
switchAccount(domain) {
|
switchAccount(domain) {
|
||||||
this.audit.record('switched-account');
|
this.audit.record('switched-account');
|
||||||
window.location.href = netUtil.getAppUrl(domain);
|
window.location.href = netUtil.getAppUrl(domain);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
|
@ -1,3 +1,14 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
export default Ember.Component.extend({
|
export default Ember.Component.extend({
|
||||||
|
@ -14,4 +25,4 @@ export default Ember.Component.extend({
|
||||||
fetch() {
|
fetch() {
|
||||||
this.get('onFilter')(this.get('filter'));
|
this.get('onFilter')(this.get('filter'));
|
||||||
},
|
},
|
||||||
});
|
});
|
|
@ -1,4 +1,14 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
export default Ember.Component.extend({
|
export default Ember.Component.extend({});
|
||||||
});
|
|
|
@ -1,4 +1,14 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
export default Ember.Component.extend({
|
export default Ember.Component.extend({});
|
||||||
});
|
|
|
@ -1,4 +1,14 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
export default Ember.Component.extend({
|
export default Ember.Component.extend({});
|
||||||
});
|
|
|
@ -1,3 +1,14 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
import encodingUtil from '../../utils/encoding';
|
import encodingUtil from '../../utils/encoding';
|
||||||
import netUtil from '../../utils/net';
|
import netUtil from '../../utils/net';
|
||||||
|
@ -16,31 +27,24 @@ export default Ember.Component.extend({
|
||||||
$("#stage-1-firstname").focus();
|
$("#stage-1-firstname").focus();
|
||||||
|
|
||||||
// Stage 1 - person name keypress handler
|
// Stage 1 - person name keypress handler
|
||||||
$("#stage-1-firstname, #stage-1-lastname").keyup(function()
|
$("#stage-1-firstname, #stage-1-lastname").keyup(function() {
|
||||||
{
|
if (!$("#stage-1-firstname").val() || !$("#stage-1-lastname").val()) {
|
||||||
if (!$("#stage-1-firstname").val() || !$("#stage-1-lastname").val())
|
|
||||||
{
|
|
||||||
$(".name-status").attr("src", "assets/img/onboard/person-red.png");
|
$(".name-status").attr("src", "assets/img/onboard/person-red.png");
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
$(".name-status").attr("src", "assets/img/onboard/person-green.png");
|
$(".name-status").attr("src", "assets/img/onboard/person-green.png");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Stage 1 - finish
|
// Stage 1 - finish
|
||||||
$("#stage-1-next").off('click').on('click', function()
|
$("#stage-1-next").off('click').on('click', function() {
|
||||||
{
|
if (!$("#stage-1-firstname").val()) {
|
||||||
if (!$("#stage-1-firstname").val())
|
|
||||||
{
|
|
||||||
$("#stage-1-firstname").focus();
|
$("#stage-1-firstname").focus();
|
||||||
$("#stage-1-firstname").addClass("error");
|
$("#stage-1-firstname").addClass("error");
|
||||||
$(".name-status").attr("src", "assets/img/onboard/person-red.png");
|
$(".name-status").attr("src", "assets/img/onboard/person-red.png");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$("#stage-1-lastname").val())
|
if (!$("#stage-1-lastname").val()) {
|
||||||
{
|
|
||||||
$("#stage-1-lastname").focus();
|
$("#stage-1-lastname").focus();
|
||||||
$("#stage-1-lastname").addClass("error");
|
$("#stage-1-lastname").addClass("error");
|
||||||
$(".name-status").attr("src", "assets/img/onboard/person-red.png");
|
$(".name-status").attr("src", "assets/img/onboard/person-red.png");
|
||||||
|
@ -49,8 +53,7 @@ export default Ember.Component.extend({
|
||||||
|
|
||||||
self.set('processing', false);
|
self.set('processing', false);
|
||||||
|
|
||||||
$(".stage-1").fadeOut("slow", function()
|
$(".stage-1").fadeOut("slow", function() {
|
||||||
{
|
|
||||||
if (self.get('processing')) {
|
if (self.get('processing')) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -61,15 +64,11 @@ export default Ember.Component.extend({
|
||||||
$("#stage-2-password").focus();
|
$("#stage-2-password").focus();
|
||||||
|
|
||||||
// Stage 2 - password keypress handler
|
// 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 ||
|
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");
|
$(".password-status").attr("src", "assets/img/onboard/lock-red.png");
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
$(".password-status").attr("src", "assets/img/onboard/lock-green.png");
|
$(".password-status").attr("src", "assets/img/onboard/lock-green.png");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -77,24 +76,20 @@ export default Ember.Component.extend({
|
||||||
});
|
});
|
||||||
|
|
||||||
// Stage 2 - finish
|
// Stage 2 - finish
|
||||||
$("#stage-2-next").off('click').on('click', function()
|
$("#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) {
|
||||||
if (!$("#stage-2-password").val() || $("#stage-2-password").val().length < 6 || $("#stage-2-password").val().length > 50)
|
|
||||||
{
|
|
||||||
$("#stage-2-password").focus();
|
$("#stage-2-password").focus();
|
||||||
$("#stage-2-password").addClass("error");
|
$("#stage-2-password").addClass("error");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$("#stage-2-password-confirm").val())
|
if (!$("#stage-2-password-confirm").val()) {
|
||||||
{
|
|
||||||
$("#stage-2-password-confirm").focus();
|
$("#stage-2-password-confirm").focus();
|
||||||
$("#stage-2-password-confirm").addClass("error");
|
$("#stage-2-password-confirm").addClass("error");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($("#stage-2-password-confirm").val() !== $("#stage-2-password").val())
|
if ($("#stage-2-password-confirm").val() !== $("#stage-2-password").val()) {
|
||||||
{
|
|
||||||
$(".mismatch").show();
|
$(".mismatch").show();
|
||||||
$(".password-status").attr("src", "assets/img/onboard/lock-red.png");
|
$(".password-status").attr("src", "assets/img/onboard/lock-red.png");
|
||||||
return;
|
return;
|
||||||
|
@ -102,8 +97,7 @@ export default Ember.Component.extend({
|
||||||
|
|
||||||
self.set('processing', false);
|
self.set('processing', false);
|
||||||
|
|
||||||
$(".stage-2").fadeOut("slow", function()
|
$(".stage-2").fadeOut("slow", function() {
|
||||||
{
|
|
||||||
if (self.get('processing')) {
|
if (self.get('processing')) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -113,7 +107,7 @@ export default Ember.Component.extend({
|
||||||
$(".stage-3").fadeIn();
|
$(".stage-3").fadeIn();
|
||||||
$("#spinner-1").show();
|
$("#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();
|
var password = $("#stage-2-password").val();
|
||||||
|
|
||||||
self.get('folderService').onboard(self.folderId, payload).then(function(user) {
|
self.get('folderService').onboard(self.folderId, payload).then(function(user) {
|
||||||
|
@ -127,4 +121,4 @@ export default Ember.Component.extend({
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
});
|
});
|
|
@ -1,4 +1,14 @@
|
||||||
// Copyright (c) 2015 Documize Inc.
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
export default Ember.Component.extend({
|
export default Ember.Component.extend({
|
||||||
|
@ -7,7 +17,7 @@ export default Ember.Component.extend({
|
||||||
|
|
||||||
didReceiveAttrs() {
|
didReceiveAttrs() {
|
||||||
let count = this.get('results').length;
|
let count = this.get('results').length;
|
||||||
let self = this;
|
let self = this;
|
||||||
|
|
||||||
switch (count) {
|
switch (count) {
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -20,4 +30,4 @@ export default Ember.Component.extend({
|
||||||
self.set("resultPhrase", `${count} references found`);
|
self.set("resultPhrase", `${count} references found`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
|
@ -1,3 +1,14 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
export default Ember.Component.extend({
|
export default Ember.Component.extend({
|
||||||
|
@ -18,4 +29,4 @@ export default Ember.Component.extend({
|
||||||
|
|
||||||
this.set('tagz', tagz);
|
this.set('tagz', tagz);
|
||||||
}
|
}
|
||||||
});
|
});
|
|
@ -1,3 +1,14 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
export default Ember.Component.extend({
|
export default Ember.Component.extend({
|
||||||
|
|
|
@ -1,7 +1,18 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
export default Ember.Component.extend({
|
export default Ember.Component.extend({
|
||||||
didReceiveAttrs() {
|
didReceiveAttrs() {
|
||||||
this.set('rendererType', 'section/' + this.get('page.contentType') + '/type-renderer');
|
this.set('rendererType', 'section/' + this.get('page.contentType') + '/type-renderer');
|
||||||
},
|
},
|
||||||
});
|
});
|
|
@ -1,3 +1,14 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
import TooltipMixin from '../../../mixins/tooltip';
|
import TooltipMixin from '../../../mixins/tooltip';
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,14 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
export default Ember.Component.extend({
|
export default Ember.Component.extend({
|
||||||
|
|
|
@ -1,8 +1,20 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
import NotifierMixin from '../../../mixins/notifier';
|
import NotifierMixin from '../../../mixins/notifier';
|
||||||
import TooltipMixin from '../../../mixins/tooltip';
|
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'),
|
sectionService: Ember.inject.service('section'),
|
||||||
isDirty: false,
|
isDirty: false,
|
||||||
waiting: false,
|
waiting: false,
|
||||||
|
@ -11,14 +23,6 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
||||||
workspaces: [],
|
workspaces: [],
|
||||||
config: {},
|
config: {},
|
||||||
|
|
||||||
fieldEditable: function() {
|
|
||||||
if (this.get('page.userId') !== this.session.user.id) {
|
|
||||||
return "readonly";
|
|
||||||
} else {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
}.property('config'),
|
|
||||||
|
|
||||||
didReceiveAttrs() {
|
didReceiveAttrs() {
|
||||||
let config = {};
|
let config = {};
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,14 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
export default Ember.Component.extend({
|
export default Ember.Component.extend({});
|
||||||
});
|
|
226
app/app/components/section/trello/type-editor.js
Normal file
226
app/app/components/section/trello/type-editor.js
Normal file
|
@ -0,0 +1,226 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// 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);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
14
app/app/components/section/trello/type-renderer.js
Normal file
14
app/app/components/section/trello/type-renderer.js
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
|
import Ember from 'ember';
|
||||||
|
|
||||||
|
export default Ember.Component.extend({});
|
|
@ -1,3 +1,14 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
export default Ember.Component.extend({
|
export default Ember.Component.extend({
|
||||||
|
|
|
@ -1,4 +1,14 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
export default Ember.Component.extend({
|
export default Ember.Component.extend({});
|
||||||
});
|
|
|
@ -1,133 +1,147 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
export default Ember.Component.extend({
|
export default Ember.Component.extend({
|
||||||
editUser: null,
|
editUser: null,
|
||||||
deleteUser: null,
|
deleteUser: null,
|
||||||
drop: null,
|
drop: null,
|
||||||
password: {},
|
password: {},
|
||||||
|
|
||||||
didReceiveAttrs() {
|
didReceiveAttrs() {
|
||||||
this.users.forEach(user => {
|
this.users.forEach(user => {
|
||||||
user.set('me', user.get('id') === this.session.user.id);
|
user.set('me', user.get('id') === this.session.user.id);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
willDestroyElement() {
|
willDestroyElement() {
|
||||||
let drop = this.get('drop');
|
let drop = this.get('drop');
|
||||||
|
|
||||||
if (is.not.null(drop)) {
|
if (is.not.null(drop)) {
|
||||||
drop.destroy();
|
drop.destroy();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
toggleActive(id) {
|
toggleActive(id) {
|
||||||
let user = this.users.findBy("id", id);
|
let user = this.users.findBy("id", id);
|
||||||
user.set('active', !user.get('active'));
|
user.set('active', !user.get('active'));
|
||||||
this.attrs.onSave(user);
|
this.attrs.onSave(user);
|
||||||
},
|
},
|
||||||
|
|
||||||
toggleEditor(id) {
|
toggleEditor(id) {
|
||||||
let user = this.users.findBy("id", id);
|
let user = this.users.findBy("id", id);
|
||||||
user.set('editor', !user.get('editor'));
|
user.set('editor', !user.get('editor'));
|
||||||
this.attrs.onSave(user);
|
this.attrs.onSave(user);
|
||||||
},
|
},
|
||||||
|
|
||||||
toggleAdmin(id) {
|
toggleAdmin(id) {
|
||||||
let user = this.users.findBy("id", id);
|
let user = this.users.findBy("id", id);
|
||||||
user.set('admin', !user.get('admin'));
|
user.set('admin', !user.get('admin'));
|
||||||
this.attrs.onSave(user);
|
this.attrs.onSave(user);
|
||||||
},
|
},
|
||||||
|
|
||||||
edit(id) {
|
edit(id) {
|
||||||
let self = this;
|
let self = this;
|
||||||
|
|
||||||
let user = this.users.findBy("id", id);
|
let user = this.users.findBy("id", id);
|
||||||
this.set('editUser', user.copy());
|
this.set('editUser', user.copy());
|
||||||
this.set('password', { password: "", confirmation: ""});
|
this.set('password', {
|
||||||
$(".edit-user-dialog").css("display", "block");
|
password: "",
|
||||||
$("input").removeClass("error");
|
confirmation: ""
|
||||||
|
});
|
||||||
|
$(".edit-user-dialog").css("display", "block");
|
||||||
|
$("input").removeClass("error");
|
||||||
|
|
||||||
let drop = new Drop({
|
let drop = new Drop({
|
||||||
target: $(".edit-button-" + id)[0],
|
target: $(".edit-button-" + id)[0],
|
||||||
content: $(".edit-user-dialog")[0],
|
content: $(".edit-user-dialog")[0],
|
||||||
classes: 'drop-theme-basic',
|
classes: 'drop-theme-basic',
|
||||||
position: "bottom right",
|
position: "bottom right",
|
||||||
openOn: "always",
|
openOn: "always",
|
||||||
tetherOptions: {
|
tetherOptions: {
|
||||||
offset: "5px 0",
|
offset: "5px 0",
|
||||||
targetOffset: "10px 0"
|
targetOffset: "10px 0"
|
||||||
},
|
},
|
||||||
remove: false
|
remove: false
|
||||||
});
|
});
|
||||||
|
|
||||||
self.set('drop', drop);
|
self.set('drop', drop);
|
||||||
|
|
||||||
drop.on('open', function() {
|
drop.on('open', function() {
|
||||||
self.$("#edit-firstname").focus();
|
self.$("#edit-firstname").focus();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
confirmDelete(id) {
|
confirmDelete(id) {
|
||||||
let user = this.users.findBy("id", id);
|
let user = this.users.findBy("id", id);
|
||||||
this.set('deleteUser', user);
|
this.set('deleteUser', user);
|
||||||
$(".delete-user-dialog").css("display", "block");
|
$(".delete-user-dialog").css("display", "block");
|
||||||
|
|
||||||
let drop = new Drop({
|
let drop = new Drop({
|
||||||
target: $(".delete-button-" + id)[0],
|
target: $(".delete-button-" + id)[0],
|
||||||
content: $(".delete-user-dialog")[0],
|
content: $(".delete-user-dialog")[0],
|
||||||
classes: 'drop-theme-basic',
|
classes: 'drop-theme-basic',
|
||||||
position: "bottom right",
|
position: "bottom right",
|
||||||
openOn: "always",
|
openOn: "always",
|
||||||
tetherOptions: {
|
tetherOptions: {
|
||||||
offset: "5px 0",
|
offset: "5px 0",
|
||||||
targetOffset: "10px 0"
|
targetOffset: "10px 0"
|
||||||
},
|
},
|
||||||
remove: false
|
remove: false
|
||||||
});
|
});
|
||||||
|
|
||||||
this.set('drop', drop);
|
this.set('drop', drop);
|
||||||
},
|
},
|
||||||
|
|
||||||
cancel() {
|
cancel() {
|
||||||
let drop = this.get('drop');
|
let drop = this.get('drop');
|
||||||
drop.close();
|
drop.close();
|
||||||
},
|
},
|
||||||
|
|
||||||
save() {
|
save() {
|
||||||
let user = this.get('editUser');
|
let user = this.get('editUser');
|
||||||
let password = this.get('password');
|
let password = this.get('password');
|
||||||
|
|
||||||
if (is.empty(user.get('firstname'))) {
|
if (is.empty(user.get('firstname'))) {
|
||||||
$("#edit-firstname").addClass("error").focus();
|
$("#edit-firstname").addClass("error").focus();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (is.empty(user.get('lastname'))) {
|
if (is.empty(user.get('lastname'))) {
|
||||||
$("#edit-lastname").addClass("error").focus();
|
$("#edit-lastname").addClass("error").focus();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (is.empty(user.get('email'))) {
|
if (is.empty(user.get('email'))) {
|
||||||
$("#edit-email").addClass("error").focus();
|
$("#edit-email").addClass("error").focus();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let drop = this.get('drop');
|
let drop = this.get('drop');
|
||||||
drop.close();
|
drop.close();
|
||||||
|
|
||||||
this.attrs.onSave(user);
|
this.attrs.onSave(user);
|
||||||
|
|
||||||
if (is.not.empty(password.password) && is.not.empty(password.confirmation) &&
|
if (is.not.empty(password.password) && is.not.empty(password.confirmation) &&
|
||||||
password.password === password.confirmation) {
|
password.password === password.confirmation) {
|
||||||
this.attrs.onPassword(user, password.password);
|
this.attrs.onPassword(user, password.password);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
delete() {
|
delete() {
|
||||||
let drop = this.get('drop');
|
let drop = this.get('drop');
|
||||||
drop.close();
|
drop.close();
|
||||||
|
|
||||||
let user = this.get('deleteUser');
|
let user = this.get('deleteUser');
|
||||||
this.attrs.onDelete(user);
|
this.attrs.onDelete(user);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
|
@ -1,7 +1,18 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
export default Ember.Component.extend({
|
export default Ember.Component.extend({
|
||||||
cssClass: "",
|
cssClass: "",
|
||||||
content: [],
|
content: [],
|
||||||
prompt: null,
|
prompt: null,
|
||||||
optionValuePath: 'id',
|
optionValuePath: 'id',
|
||||||
|
@ -32,4 +43,4 @@ export default Ember.Component.extend({
|
||||||
changeCallback(selection);
|
changeCallback(selection);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
|
@ -1,3 +1,14 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
import miscUtil from '../utils/misc';
|
import miscUtil from '../utils/misc';
|
||||||
|
|
||||||
|
@ -24,7 +35,7 @@ export default Ember.Component.extend({
|
||||||
self.$(elem).show();
|
self.$(elem).show();
|
||||||
|
|
||||||
// FIXME: need a more robust solution
|
// FIXME: need a more robust solution
|
||||||
miscUtil.interval(function(){
|
miscUtil.interval(function() {
|
||||||
let notifications = self.get('notifications');
|
let notifications = self.get('notifications');
|
||||||
|
|
||||||
if (notifications.length > 0) {
|
if (notifications.length > 0) {
|
||||||
|
@ -38,4 +49,4 @@ export default Ember.Component.extend({
|
||||||
}, 2500, self.get('notifications').length);
|
}, 2500, self.get('notifications').length);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
});
|
});
|
|
@ -1,3 +1,14 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
// Copyright (c) 2015 Documize Inc.
|
// Copyright (c) 2015 Documize Inc.
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
import NotifierMixin from '../mixins/notifier';
|
import NotifierMixin from '../mixins/notifier';
|
||||||
|
@ -7,10 +18,18 @@ export default Ember.Component.extend(NotifierMixin, {
|
||||||
|
|
||||||
didInsertElement() {
|
didInsertElement() {
|
||||||
this._super(...arguments);
|
this._super(...arguments);
|
||||||
new Tooltip({target: document.getElementById("sample-1")});
|
new Tooltip({
|
||||||
new Tooltip({target: document.getElementById("sample-2")});
|
target: document.getElementById("sample-1")
|
||||||
new Tooltip({target: document.getElementById("sample-3")});
|
});
|
||||||
new Tooltip({target: document.getElementById("sample-4")});
|
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({
|
let drop1 = new Drop({
|
||||||
target: document.getElementById('sample-dropdown-1'),
|
target: document.getElementById('sample-dropdown-1'),
|
||||||
|
@ -33,4 +52,4 @@ export default Ember.Component.extend(NotifierMixin, {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
|
@ -1,11 +1,21 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
export function documentFileIcon(params) {
|
export function documentFileIcon(params) {
|
||||||
let fileExtension = params[0].toLowerCase();
|
let fileExtension = params[0].toLowerCase();
|
||||||
let html = "unknown.png";
|
let html = "unknown.png";
|
||||||
|
|
||||||
switch (fileExtension)
|
switch (fileExtension) {
|
||||||
{
|
|
||||||
case "7z":
|
case "7z":
|
||||||
case "7zip":
|
case "7zip":
|
||||||
case "zipx":
|
case "zipx":
|
||||||
|
@ -95,4 +105,4 @@ export function documentFileIcon(params) {
|
||||||
return new Ember.Handlebars.SafeString(html);
|
return new Ember.Handlebars.SafeString(html);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Ember.Helper.helper(documentFileIcon);
|
export default Ember.Helper.helper(documentFileIcon);
|
|
@ -1,23 +1,34 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
export function documentTocEntry(params) {
|
export function documentTocEntry(params) {
|
||||||
let currentPage = params[0];
|
let currentPage = params[0];
|
||||||
let nodeId = params[1];
|
let nodeId = params[1];
|
||||||
let nodeLevel = params[2];
|
let nodeLevel = params[2];
|
||||||
let html = "";
|
let html = "";
|
||||||
let indent = (nodeLevel - 1) * 20;
|
let indent = (nodeLevel - 1) * 20;
|
||||||
|
|
||||||
html += "<span style='margin-left: " + indent + "px;'></span>";
|
html += "<span style='margin-left: " + indent + "px;'></span>";
|
||||||
|
|
||||||
if (currentPage === nodeId) {
|
if (currentPage === nodeId) {
|
||||||
html += "<span class='selected'><i class='material-icons toc-bullet'>remove</i></span>";
|
html += "<span class='selected'></span>";
|
||||||
html += "";
|
html += "";
|
||||||
} else {
|
} else {
|
||||||
html += "<span class=''><i class='material-icons toc-bullet'>remove</i></span>";
|
html += "<span class=''></span>";
|
||||||
html += "";
|
html += "";
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Ember.Handlebars.SafeString(html);
|
return new Ember.Handlebars.SafeString(html);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Ember.Helper.helper(documentTocEntry);
|
export default Ember.Helper.helper(documentTocEntry);
|
|
@ -1,3 +1,14 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
import dateUtil from '../utils/date';
|
import dateUtil from '../utils/date';
|
||||||
|
|
||||||
|
@ -5,4 +16,4 @@ export function formattedDate(params) {
|
||||||
return dateUtil.toIsoDate(params[0], params[1]);
|
return dateUtil.toIsoDate(params[0], params[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Ember.Helper.helper(formattedDate);
|
export default Ember.Helper.helper(formattedDate);
|
|
@ -1,3 +1,14 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
// Usage: {{generate-id 'admin-' 123}}
|
// Usage: {{generate-id 'admin-' 123}}
|
||||||
|
@ -5,4 +16,4 @@ export default Ember.Helper.helper(function(params) {
|
||||||
let prefix = params[0];
|
let prefix = params[0];
|
||||||
let id = params[1];
|
let id = params[1];
|
||||||
return prefix + "-" + id;
|
return prefix + "-" + id;
|
||||||
});
|
});
|
|
@ -1,6 +1,17 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
// Usage: {{is-equal item selection}}
|
// Usage: {{is-equal item selection}}
|
||||||
export default Ember.Helper.helper(function([leftSide, rightSide]) {
|
export default Ember.Helper.helper(function([leftSide, rightSide]) {
|
||||||
return leftSide === rightSide;
|
return leftSide === rightSide;
|
||||||
});
|
});
|
|
@ -1,6 +1,17 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
// Usage: {{is-not selection}}
|
// Usage: {{is-not selection}}
|
||||||
export default Ember.Helper.helper(function([value]) {
|
export default Ember.Helper.helper(function([value]) {
|
||||||
return !value;
|
return !value;
|
||||||
});
|
});
|
|
@ -1,5 +1,16 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
export default Ember.Helper.helper(function([object, path]) {
|
export default Ember.Helper.helper(function([object, path]) {
|
||||||
return Ember.get(object, path);
|
return Ember.get(object, path);
|
||||||
});
|
});
|
|
@ -1,3 +1,14 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
import dateUtil from '../utils/date';
|
import dateUtil from '../utils/date';
|
||||||
|
|
||||||
|
@ -6,4 +17,4 @@ export function timeAgo(params) {
|
||||||
return dateUtil.timeAgo(params[0]);
|
return dateUtil.timeAgo(params[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Ember.Helper.helper(timeAgo);
|
export default Ember.Helper.helper(timeAgo);
|
|
@ -1,3 +1,14 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
// {{user-initials firstname lastname}}
|
// {{user-initials firstname lastname}}
|
||||||
|
@ -5,7 +16,7 @@ export function userInitials(params) {
|
||||||
let firstname = params[0];
|
let firstname = params[0];
|
||||||
let lastname = params[1];
|
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);
|
|
@ -1,20 +1,25 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
export function initialize( /*application*/ ) {
|
export function initialize( /*application*/ ) {
|
||||||
// address insecure jquery defaults (kudos: @nathanhammond)
|
// address insecure jquery defaults (kudos: @nathanhammond)
|
||||||
$.globalEval = function() {};
|
$.globalEval = function() {};
|
||||||
$.ajaxSetup({
|
$.ajaxSetup({
|
||||||
|
crossDomain: true,
|
||||||
converters: {
|
converters: {
|
||||||
'text script': text => text
|
'text script': text => text
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Dropzone.autoDiscover = false;
|
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 {
|
export default {
|
||||||
|
|
|
@ -1,3 +1,13 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
export function initialize(application) {
|
export function initialize(application) {
|
||||||
application.inject('route', 'audit', 'service:audit');
|
application.inject('route', 'audit', 'service:audit');
|
||||||
|
@ -9,4 +19,4 @@ export default {
|
||||||
name: 'audit',
|
name: 'audit',
|
||||||
after: 'session',
|
after: 'session',
|
||||||
initialize: initialize
|
initialize: initialize
|
||||||
};
|
};
|
|
@ -1,3 +1,14 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
export function initialize(application) {
|
export function initialize(application) {
|
||||||
application.inject('route', 'browser', 'service:browser');
|
application.inject('route', 'browser', 'service:browser');
|
||||||
application.inject('controller', 'browser', 'service:browser');
|
application.inject('controller', 'browser', 'service:browser');
|
||||||
|
@ -8,4 +19,4 @@ export default {
|
||||||
name: 'browser',
|
name: 'browser',
|
||||||
after: "session",
|
after: "session",
|
||||||
initialize: initialize
|
initialize: initialize
|
||||||
};
|
};
|
|
@ -1,3 +1,14 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
export function initialize(application) {
|
export function initialize(application) {
|
||||||
application.inject('route', 'eventBus', 'service:eventBus');
|
application.inject('route', 'eventBus', 'service:eventBus');
|
||||||
application.inject('component', 'eventBus', 'service:eventBus');
|
application.inject('component', 'eventBus', 'service:eventBus');
|
||||||
|
@ -9,4 +20,4 @@ export default {
|
||||||
name: 'eventBus',
|
name: 'eventBus',
|
||||||
after: 'session',
|
after: 'session',
|
||||||
initialize: initialize
|
initialize: initialize
|
||||||
};
|
};
|
|
@ -1,3 +1,14 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
export function initialize(application) {
|
export function initialize(application) {
|
||||||
application.inject('route', 'logger', 'service:logger');
|
application.inject('route', 'logger', 'service:logger');
|
||||||
application.inject('component', 'logger', 'service:logger');
|
application.inject('component', 'logger', 'service:logger');
|
||||||
|
@ -8,4 +19,4 @@ export default {
|
||||||
name: 'logger',
|
name: 'logger',
|
||||||
after: 'session',
|
after: 'session',
|
||||||
initialize: initialize
|
initialize: initialize
|
||||||
};
|
};
|
|
@ -1,7 +1,19 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
export function initialize(application) {
|
export function initialize(application) {
|
||||||
application.inject('route', 'session', 'service:session');
|
application.inject('route', 'session', 'service:session');
|
||||||
application.inject('controller', 'session', 'service:session');
|
application.inject('controller', 'session', 'service:session');
|
||||||
application.inject('component', 'session', 'service:session');
|
application.inject('component', 'session', 'service:session');
|
||||||
|
application.inject('mixin', 'session', 'service:session');
|
||||||
}
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -9,4 +21,4 @@ export default {
|
||||||
after: 'application',
|
after: 'application',
|
||||||
before: 'audit',
|
before: 'audit',
|
||||||
initialize: initialize
|
initialize: initialize
|
||||||
};
|
};
|
|
@ -1,13 +1,24 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
export default Ember.Mixin.create({
|
export default Ember.Mixin.create({
|
||||||
showNotification(msg) {
|
showNotification(msg) {
|
||||||
this.eventBus.publish('notifyUser', msg);
|
this.eventBus.publish('notifyUser', msg);
|
||||||
},
|
},
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
showNotification(msg) {
|
showNotification(msg) {
|
||||||
this.eventBus.publish('notifyUser', msg);
|
this.eventBus.publish('notifyUser', msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
27
app/app/mixins/section.js
Normal file
27
app/app/mixins/section.js
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// 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')
|
||||||
|
});
|
|
@ -1,23 +1,36 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
export default Ember.Mixin.create({
|
export default Ember.Mixin.create({
|
||||||
tooltips: [],
|
tooltips: [],
|
||||||
|
|
||||||
addTooltip(elem) {
|
addTooltip(elem) {
|
||||||
let t = new Tooltip({target: elem});
|
let t = new Tooltip({
|
||||||
let tt = this.get('tooltips');
|
target: elem
|
||||||
tt.push(t);
|
});
|
||||||
},
|
let tt = this.get('tooltips');
|
||||||
|
tt.push(t);
|
||||||
|
},
|
||||||
|
|
||||||
destroyTooltips() {
|
destroyTooltips() {
|
||||||
let tt = this.get('tooltips');
|
let tt = this.get('tooltips');
|
||||||
|
|
||||||
tt.forEach(t => {
|
tt.forEach(t => {
|
||||||
t.destroy();
|
t.destroy();
|
||||||
});
|
});
|
||||||
|
|
||||||
tt.length = 0;
|
tt.length = 0;
|
||||||
|
|
||||||
this.set('tooltips', tt);
|
this.set('tooltips', tt);
|
||||||
}
|
}
|
||||||
});
|
});
|
|
@ -1,3 +1,14 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Resolver from 'ember-resolver';
|
import Resolver from 'ember-resolver';
|
||||||
|
|
||||||
export default Resolver;
|
export default Resolver;
|
|
@ -1,3 +1,14 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
import config from './config/environment';
|
import config from './config/environment';
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,14 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
export default Ember.Route.extend({
|
export default Ember.Route.extend({
|
||||||
|
|
|
@ -1,3 +1,14 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
import netUtil from '../utils/net';
|
import netUtil from '../utils/net';
|
||||||
import config from '../config/environment';
|
import config from '../config/environment';
|
||||||
|
@ -45,8 +56,7 @@ export default Ember.Service.extend({
|
||||||
email: session.user.email,
|
email: session.user.email,
|
||||||
user_id: session.user.id,
|
user_id: session.user.id,
|
||||||
"administrator": session.user.admin,
|
"administrator": session.user.admin,
|
||||||
company:
|
company: {
|
||||||
{
|
|
||||||
id: session.get('appMeta.orgId'),
|
id: session.get('appMeta.orgId'),
|
||||||
name: session.get('appMeta.title').string,
|
name: session.get('appMeta.title').string,
|
||||||
"domain": netUtil.getSubdomain(),
|
"domain": netUtil.getSubdomain(),
|
||||||
|
@ -62,4 +72,4 @@ export default Ember.Service.extend({
|
||||||
|
|
||||||
window.Intercom('boot', window.intercomSettings);
|
window.Intercom('boot', window.intercomSettings);
|
||||||
},
|
},
|
||||||
});
|
});
|
|
@ -1,15 +1,25 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
export default Ember.Service.extend({
|
export default Ember.Service.extend({
|
||||||
interval(func, wait, times) {
|
interval(func, wait, times) {
|
||||||
var interv = function(w, t){
|
var interv = function(w, t) {
|
||||||
return function(){
|
return function() {
|
||||||
if(typeof t === "undefined" || t-- > 0) {
|
if (typeof t === "undefined" || t-- > 0) {
|
||||||
setTimeout(interv, w);
|
setTimeout(interv, w);
|
||||||
try {
|
try {
|
||||||
func.call(null);
|
func.call(null);
|
||||||
}
|
} catch (e) {
|
||||||
catch(e) {
|
|
||||||
t = 0;
|
t = 0;
|
||||||
throw e.toString();
|
throw e.toString();
|
||||||
}
|
}
|
||||||
|
@ -19,4 +29,4 @@ export default Ember.Service.extend({
|
||||||
|
|
||||||
setTimeout(interv, wait);
|
setTimeout(interv, wait);
|
||||||
}
|
}
|
||||||
});
|
});
|
|
@ -1,3 +1,14 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
export default Ember.Service.extend({
|
export default Ember.Service.extend({
|
||||||
|
@ -30,6 +41,6 @@ export default Ember.Service.extend({
|
||||||
description = this.get('sessionService').appMeta.message;
|
description = this.get('sessionService').appMeta.message;
|
||||||
}
|
}
|
||||||
|
|
||||||
$('head').append( '<meta name="description" content="' + description + '">' );
|
$('head').append('<meta name="description" content="' + description + '">');
|
||||||
}
|
}
|
||||||
});
|
});
|
|
@ -1,3 +1,14 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
import models from '../utils/model';
|
import models from '../utils/model';
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,14 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
export default Ember.Service.extend(Ember.Evented, {
|
export default Ember.Service.extend(Ember.Evented, {
|
||||||
|
@ -12,4 +23,4 @@ export default Ember.Service.extend(Ember.Evented, {
|
||||||
unsubscribe: function() {
|
unsubscribe: function() {
|
||||||
return this.off.apply(this, arguments);
|
return this.off.apply(this, arguments);
|
||||||
}
|
}
|
||||||
});
|
});
|
|
@ -1,3 +1,14 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
import models from '../utils/model';
|
import models from '../utils/model';
|
||||||
import BaseService from '../services/base';
|
import BaseService from '../services/base';
|
||||||
|
@ -34,15 +45,15 @@ export default BaseService.extend({
|
||||||
getFolder(id) {
|
getFolder(id) {
|
||||||
let url = this.get('sessionService').appMeta.getUrl(`folders/${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({
|
$.ajax({
|
||||||
url: url,
|
url: url,
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
success: function(response){
|
success: function(response) {
|
||||||
let folder = models.FolderModel.create(response);
|
let folder = models.FolderModel.create(response);
|
||||||
resolve(folder);
|
resolve(folder);
|
||||||
},
|
},
|
||||||
error: function(reason){
|
error: function(reason) {
|
||||||
reject(reason);
|
reject(reason);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -54,7 +65,9 @@ export default BaseService.extend({
|
||||||
let self = this;
|
let self = this;
|
||||||
|
|
||||||
if (this.get('folders') != null) {
|
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 {
|
} else {
|
||||||
return this.reload();
|
return this.reload();
|
||||||
}
|
}
|
||||||
|
@ -123,11 +136,11 @@ export default BaseService.extend({
|
||||||
getProtectedFolderInfo: function() {
|
getProtectedFolderInfo: function() {
|
||||||
var url = this.get('sessionService').appMeta.getUrl('folders?filter=viewers');
|
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({
|
$.ajax({
|
||||||
url: url,
|
url: url,
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
success: function(response){
|
success: function(response) {
|
||||||
let data = [];
|
let data = [];
|
||||||
_.each(response, function(obj) {
|
_.each(response, function(obj) {
|
||||||
data.pushObject(models.ProtectedFolderParticipant.create(obj));
|
data.pushObject(models.ProtectedFolderParticipant.create(obj));
|
||||||
|
@ -135,7 +148,7 @@ export default BaseService.extend({
|
||||||
|
|
||||||
resolve(data);
|
resolve(data);
|
||||||
},
|
},
|
||||||
error: function(reason){
|
error: function(reason) {
|
||||||
reject(reason);
|
reject(reason);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -146,7 +159,7 @@ export default BaseService.extend({
|
||||||
reload() {
|
reload() {
|
||||||
let url = this.get('sessionService').appMeta.getUrl(`folders`);
|
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({
|
$.ajax({
|
||||||
url: url,
|
url: url,
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
|
@ -157,7 +170,7 @@ export default BaseService.extend({
|
||||||
});
|
});
|
||||||
resolve(data);
|
resolve(data);
|
||||||
},
|
},
|
||||||
error: function(reason){
|
error: function(reason) {
|
||||||
reject(reason);
|
reject(reason);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -172,14 +185,14 @@ export default BaseService.extend({
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: self.get('sessionService').appMeta.getUrl(`folders/${folderId}/permissions`),
|
url: self.get('sessionService').appMeta.getUrl(`folders/${folderId}/permissions`),
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
success: function(response){
|
success: function(response) {
|
||||||
let data = [];
|
let data = [];
|
||||||
_.each(response, function(obj) {
|
_.each(response, function(obj) {
|
||||||
data.pushObject(models.FolderPermissionModel.create(obj));
|
data.pushObject(models.FolderPermissionModel.create(obj));
|
||||||
});
|
});
|
||||||
resolve(data);
|
resolve(data);
|
||||||
},
|
},
|
||||||
error: function(reason){
|
error: function(reason) {
|
||||||
reject(reason);
|
reject(reason);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -196,10 +209,10 @@ export default BaseService.extend({
|
||||||
type: 'PUT',
|
type: 'PUT',
|
||||||
contentType: 'json',
|
contentType: 'json',
|
||||||
data: JSON.stringify(payload),
|
data: JSON.stringify(payload),
|
||||||
success: function(response){
|
success: function(response) {
|
||||||
resolve(response);
|
resolve(response);
|
||||||
},
|
},
|
||||||
error: function(reason){
|
error: function(reason) {
|
||||||
reject(reason);
|
reject(reason);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -216,10 +229,10 @@ export default BaseService.extend({
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
contentType: 'json',
|
contentType: 'json',
|
||||||
data: JSON.stringify(invitation),
|
data: JSON.stringify(invitation),
|
||||||
success: function(response){
|
success: function(response) {
|
||||||
resolve(response);
|
resolve(response);
|
||||||
},
|
},
|
||||||
error: function(reason){
|
error: function(reason) {
|
||||||
reject(reason);
|
reject(reason);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -280,4 +293,4 @@ export default BaseService.extend({
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
});
|
});
|
|
@ -1,3 +1,14 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
export default Ember.Service.extend({
|
export default Ember.Service.extend({
|
||||||
|
@ -12,4 +23,4 @@ export default Ember.Service.extend({
|
||||||
info: function(entry) {
|
info: function(entry) {
|
||||||
console.log(entry);
|
console.log(entry);
|
||||||
}
|
}
|
||||||
});
|
});
|
|
@ -1,3 +1,14 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
import models from '../utils/model';
|
import models from '../utils/model';
|
||||||
|
|
||||||
|
@ -8,15 +19,15 @@ export default Ember.Service.extend({
|
||||||
getOrg(id) {
|
getOrg(id) {
|
||||||
let url = this.get('sessionService').appMeta.getUrl(`organizations/${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({
|
$.ajax({
|
||||||
url: url,
|
url: url,
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
success: function(response){
|
success: function(response) {
|
||||||
let org = models.OrganizationModel.create(response);
|
let org = models.OrganizationModel.create(response);
|
||||||
resolve(org);
|
resolve(org);
|
||||||
},
|
},
|
||||||
error: function(reason){
|
error: function(reason) {
|
||||||
reject(reason);
|
reject(reason);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -47,4 +58,4 @@ export default Ember.Service.extend({
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
|
@ -1,3 +1,14 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
export default Ember.Service.extend({
|
export default Ember.Service.extend({
|
||||||
|
@ -7,17 +18,17 @@ export default Ember.Service.extend({
|
||||||
find(keywords) {
|
find(keywords) {
|
||||||
let url = this.get('sessionService').appMeta.getUrl("search?keywords=" + encodeURIComponent(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({
|
$.ajax({
|
||||||
url: url,
|
url: url,
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
success: function(response) {
|
success: function(response) {
|
||||||
resolve(response);
|
resolve(response);
|
||||||
},
|
},
|
||||||
error: function(reason){
|
error: function(reason) {
|
||||||
reject(reason);
|
reject(reason);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
});
|
});
|
|
@ -1,3 +1,14 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
import models from '../utils/model';
|
import models from '../utils/model';
|
||||||
import BaseService from '../services/base';
|
import BaseService from '../services/base';
|
||||||
|
|
|
@ -1,3 +1,14 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
import encodingUtil from '../utils/encoding';
|
import encodingUtil from '../utils/encoding';
|
||||||
import netUtil from '../utils/net';
|
import netUtil from '../utils/net';
|
||||||
|
@ -117,8 +128,13 @@ export default Ember.Service.extend({
|
||||||
this.storeSessionItem('token', token);
|
this.storeSessionItem('token', token);
|
||||||
this.storeSessionItem('user', JSON.stringify(user));
|
this.storeSessionItem('user', JSON.stringify(user));
|
||||||
|
|
||||||
|
let self = this;
|
||||||
|
|
||||||
$.ajaxPrefilter(function(options, originalOptions, jqXHR) {
|
$.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) {
|
return new Ember.RSVP.Promise(function(resolve) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: self.get('appMeta').getUrl("public/meta"),
|
url: self.get('appMeta').getUrl("public/meta"),
|
||||||
|
@ -214,4 +239,4 @@ export default Ember.Service.extend({
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,3 +1,14 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
import models from '../utils/model';
|
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"),
|
url: self.get('sessionService').appMeta.getUrl("templates/" + templateId + "/folder/" + folderId + "?type=saved"),
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
success: function(doc) {
|
success: function(doc) {
|
||||||
let docModel = models.DocumentModel.create(doc);
|
let docModel = models.DocumentModel.create(doc);
|
||||||
resolve(docModel);
|
resolve(docModel);
|
||||||
},
|
},
|
||||||
error: function(reason) {
|
error: function(reason) {
|
||||||
|
@ -42,15 +53,17 @@ export default Ember.Service.extend({
|
||||||
getSavedTemplates() {
|
getSavedTemplates() {
|
||||||
let self = this;
|
let self = this;
|
||||||
|
|
||||||
return new Ember.RSVP.Promise(function(resolve, reject){
|
return new Ember.RSVP.Promise(function(resolve, reject) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: self.get('sessionService').appMeta.getUrl("templates"),
|
url: self.get('sessionService').appMeta.getUrl("templates"),
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
success: function(response) {
|
success: function(response) {
|
||||||
if (is.not.array(response)) {
|
if (is.not.array(response)) {
|
||||||
response = [];
|
response = [];
|
||||||
}
|
}
|
||||||
let templates = Ember.ArrayProxy.create({ content: Ember.A([]) });
|
let templates = Ember.ArrayProxy.create({
|
||||||
|
content: Ember.A([])
|
||||||
|
});
|
||||||
|
|
||||||
_.each(response, function(template) {
|
_.each(response, function(template) {
|
||||||
let templateModel = models.TemplateModel.create(template);
|
let templateModel = models.TemplateModel.create(template);
|
||||||
|
@ -69,7 +82,7 @@ export default Ember.Service.extend({
|
||||||
getStockTemplates() {
|
getStockTemplates() {
|
||||||
let self = this;
|
let self = this;
|
||||||
|
|
||||||
return new Ember.RSVP.Promise(function(resolve, reject){
|
return new Ember.RSVP.Promise(function(resolve, reject) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: self.get('sessionService').appMeta.getUrl("templates/stock"),
|
url: self.get('sessionService').appMeta.getUrl("templates/stock"),
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
|
@ -82,4 +95,4 @@ export default Ember.Service.extend({
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
|
@ -1,3 +1,14 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
import models from '../utils/model';
|
import models from '../utils/model';
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,14 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
@import "color.scss";
|
@import "color.scss";
|
||||||
@import "font.scss";
|
@import "font.scss";
|
||||||
@import "functions.scss";
|
@import "functions.scss";
|
||||||
|
|
|
@ -1,3 +1,14 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
.cursor-pointer { cursor: pointer; }
|
.cursor-pointer { cursor: pointer; }
|
||||||
.cursor-not-allowed { cursor: not-allowed !important; }
|
.cursor-not-allowed { cursor: not-allowed !important; }
|
||||||
.cursor-auto { cursor: auto; }
|
.cursor-auto { cursor: auto; }
|
||||||
|
@ -60,6 +71,12 @@ $i: 150;
|
||||||
$i: $i - 5;
|
$i: $i - 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$i: 100;
|
||||||
|
@while $i > 0 {
|
||||||
|
.width-#{$i} { width: #{$i}#{"%"}; }
|
||||||
|
$i: $i - 5;
|
||||||
|
}
|
||||||
|
|
||||||
.no-outline
|
.no-outline
|
||||||
{
|
{
|
||||||
outline:none !important;
|
outline:none !important;
|
||||||
|
|
|
@ -1,8 +1,17 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
$color-off-white: #f5f5f5;
|
$color-off-white: #f5f5f5;
|
||||||
$color-off-black: #4c4c4c;
|
$color-off-black: #4c4c4c;
|
||||||
$color-black: #000000;
|
$color-black: #000000;
|
||||||
$color-white: #ffffff;
|
$color-white: #ffffff;
|
||||||
|
|
||||||
$color-primary: #2180cc;
|
$color-primary: #2180cc;
|
||||||
$color-link: #5680de;
|
$color-link: #5680de;
|
||||||
$color-red: #d9493c;
|
$color-red: #d9493c;
|
||||||
|
@ -16,17 +25,10 @@ $color-chip: #98A2AB;
|
||||||
$color-input: #98A2AB;
|
$color-input: #98A2AB;
|
||||||
$color-stroke: #98A2AB;
|
$color-stroke: #98A2AB;
|
||||||
$color-card-active: #f7fcff;
|
$color-card-active: #f7fcff;
|
||||||
|
|
||||||
|
|
||||||
$color-border: #dbdbdb;
|
$color-border: #dbdbdb;
|
||||||
$color-border2: #e2e2e2;
|
$color-border2: #e2e2e2;
|
||||||
|
|
||||||
// FIXME remove/replace below?
|
|
||||||
// $color-primary: #1b75bb;
|
|
||||||
$color-primary-light: lighten($color-primary, 30%);
|
$color-primary-light: lighten($color-primary, 30%);
|
||||||
$color-primary-dark: darken($color-primary, 10%);
|
$color-primary-dark: darken($color-primary, 10%);
|
||||||
// $color-green: #79ad30;
|
|
||||||
// $color-gray: #a0a0a0;
|
|
||||||
$color-gray2: #f0eeee;
|
$color-gray2: #f0eeee;
|
||||||
$color-active-state: #e2e2e2;
|
$color-active-state: #e2e2e2;
|
||||||
$color-sidebar: #e7f1f6;
|
$color-sidebar: #e7f1f6;
|
||||||
|
@ -34,16 +36,42 @@ $color-shadow: #dbdbdb;
|
||||||
$color-error: #c23c56;
|
$color-error: #c23c56;
|
||||||
$color-highlight: #fff8dc;
|
$color-highlight: #fff8dc;
|
||||||
$color-warning: #990012;
|
$color-warning: #990012;
|
||||||
|
.background-color-white {
|
||||||
.background-color-white { background-color: $color-white; }
|
background-color: $color-white;
|
||||||
.color-white { color: $color-white; }
|
}
|
||||||
.color-off-white { color: $color-off-white; }
|
.color-white {
|
||||||
.color-black { color: $color-black; }
|
color: $color-white;
|
||||||
.color-off-black { color: $color-off-black; }
|
}
|
||||||
.background-color-primary { background-color: $color-primary; }
|
.color-off-white {
|
||||||
.color-primary { color: $color-primary; }
|
color: $color-off-white;
|
||||||
.color-link { color: $color-link; }
|
}
|
||||||
.color-blue { color: $color-blue; }
|
.color-black {
|
||||||
.color-red { color: $color-red; }
|
color: $color-black;
|
||||||
.color-green { color: $color-green; }
|
}
|
||||||
.color-gray { color: $color-gray; }
|
.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;
|
||||||
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
> .item {
|
> .item {
|
||||||
color: $color-off-black;
|
color: $color-off-black;
|
||||||
margin: 10px 5px;
|
margin: 0px 5px;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
list-style-type: none;
|
list-style-type: none;
|
||||||
|
|
||||||
|
|
|
@ -33,13 +33,12 @@
|
||||||
list-style: none;
|
list-style: none;
|
||||||
float: left;
|
float: left;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
width: 100px;
|
width: 400px;
|
||||||
height: 100px;
|
height: 80px;
|
||||||
background-color: $color-white;
|
background-color: $color-white;
|
||||||
border: 1px solid $color-border2;
|
border: 1px solid $color-border2;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
margin: 0 30px 30px 0;
|
margin: 0 30px 30px 0;
|
||||||
font-weight: bold;
|
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
@extend .z-depth-half;
|
@extend .z-depth-half;
|
||||||
|
@ -48,30 +47,48 @@
|
||||||
transition: 0.2s all ease;
|
transition: 0.2s all ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
> .material-icons {
|
|
||||||
text-align: center;
|
|
||||||
margin: 20px 0 0 31px;
|
|
||||||
font-size: 2.5rem;
|
|
||||||
color: $color-stroke;
|
|
||||||
}
|
|
||||||
|
|
||||||
> .img {
|
> .img {
|
||||||
height: 30px;
|
|
||||||
width: 30px;
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin: 23px 0 6px 33px;
|
margin: 17px 10px 0 20px;
|
||||||
|
display: inline-block;
|
||||||
|
height: 45px;
|
||||||
|
width: 45px;
|
||||||
}
|
}
|
||||||
|
|
||||||
> .title {
|
> .details {
|
||||||
font-size: 1rem;
|
vertical-align: top;
|
||||||
color: $color-stroke;
|
display: inline-block;
|
||||||
text-align: center;
|
|
||||||
margin-top: 5px;
|
> .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 {
|
> .selected {
|
||||||
border-color: $color-link;
|
background-color: $color-card-active;
|
||||||
|
border: 1px dotted $color-link;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
.wysiwyg {
|
.wysiwyg {
|
||||||
font-size: 1rem;
|
// font-size: 1rem;
|
||||||
|
font-size: 15px;
|
||||||
|
line-height: 30px;
|
||||||
|
|
||||||
table
|
table
|
||||||
{
|
{
|
||||||
|
@ -16,7 +18,7 @@
|
||||||
p
|
p
|
||||||
{
|
{
|
||||||
margin: 0 !important;
|
margin: 0 !important;
|
||||||
padding: 0 !important;
|
padding: 0 !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border: none;
|
border: none;
|
||||||
border-bottom: 1px solid $color-input;
|
border-bottom: 1px solid $color-input;
|
||||||
height: 2rem;
|
height: 2.3rem;
|
||||||
outline: none;
|
outline: none;
|
||||||
|
|
||||||
&:focus {
|
&:focus {
|
||||||
|
@ -53,7 +53,7 @@
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
border: 1px solid $color-input;
|
border: 1px solid $color-input;
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
height: 2rem;
|
height: 2.3rem;
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
|
||||||
|
@ -186,3 +186,13 @@
|
||||||
.form-divider {
|
.form-divider {
|
||||||
margin-top: 30px;
|
margin-top: 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.widget-checkbox {
|
||||||
|
color: $color-link;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.checkbox-gray {
|
||||||
|
color: $color-gray !important;
|
||||||
|
}
|
|
@ -17,15 +17,26 @@
|
||||||
<div class="canvas">
|
<div class="canvas">
|
||||||
<ul class="list">
|
<ul class="list">
|
||||||
{{#each sections as |section|}}
|
{{#each sections as |section|}}
|
||||||
<li title="{{section.description}}" class="item {{if section.selected "selected"}}" {{action 'setOption' section.id}}>
|
<li class="item {{if section.selected "selected"}}" {{action 'setOption' section.id}}>
|
||||||
{{#if section.hasImage}}
|
<img class="img" src="/sections/{{section.contentType}}.png" srcset="/sections/{{section.contentType}}@2x.png" />
|
||||||
<img class="img" src="{{section.iconFile}}" />
|
<div class="details">
|
||||||
{{else}}
|
<div class='title'>
|
||||||
<i class="material-icons">{{section.iconFont}}</i>
|
{{section.title}}
|
||||||
{{/if}}
|
{{#if section.preview}}
|
||||||
<div class='title'>{{section.title}}</div>
|
<div class="preview">coming soon</div>
|
||||||
|
{{/if}}
|
||||||
|
</div>
|
||||||
|
<div class='desc'>{{section.description}}</div>
|
||||||
|
</div>
|
||||||
</li>
|
</li>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
<li class="item">
|
||||||
|
<img class="img" src="/sections/suggest.png" />
|
||||||
|
<div class="details">
|
||||||
|
<div class='title'>Suggest</div>
|
||||||
|
<div class='desc'>We'll build the integrations you need - just let us know</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -47,17 +47,17 @@
|
||||||
<div class="input-control">
|
<div class="input-control">
|
||||||
<label>Gemini URL</label>
|
<label>Gemini URL</label>
|
||||||
<div class="tip">e.g. http://helpdesk.countersoft.com</div>
|
<div class="tip">e.g. http://helpdesk.countersoft.com</div>
|
||||||
{{focus-input id="gemini-url" type="text" value=config.url readonly=fieldEditable}}
|
{{focus-input id="gemini-url" type="text" value=config.url readonly=isReadonly}}
|
||||||
</div>
|
</div>
|
||||||
<div class="input-control">
|
<div class="input-control">
|
||||||
<label>Username</label>
|
<label>Username</label>
|
||||||
<div class="tip">Gemini username</div>
|
<div class="tip">Gemini username</div>
|
||||||
{{input id="gemini-username" type="text" value=config.username readonly=fieldEditable}}
|
{{input id="gemini-username" type="text" value=config.username readonly=isReadonly}}
|
||||||
</div>
|
</div>
|
||||||
<div class="input-control">
|
<div class="input-control">
|
||||||
<label>API Key</label>
|
<label>API Key</label>
|
||||||
<div class="tip">Gemini user API key (from user profile)</div>
|
<div class="tip">Gemini user API key (from user profile)</div>
|
||||||
{{input id="gemini-apikey" type="password" value=config.APIKey readonly=fieldEditable}}
|
{{input id="gemini-apikey" type="password" value=config.APIKey readonly=isReadonly}}
|
||||||
</div>
|
</div>
|
||||||
<div class="regular-button button-blue" {{ action 'auth' }}>Authenticate</div>
|
<div class="regular-button button-blue" {{ action 'auth' }}>Authenticate</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
95
app/app/templates/components/section/trello/type-editor.hbs
Normal file
95
app/app/templates/components/section/trello/type-editor.hbs
Normal file
|
@ -0,0 +1,95 @@
|
||||||
|
<style>
|
||||||
|
.trello-board {
|
||||||
|
width: 100%;
|
||||||
|
padding: 10px;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: auto
|
||||||
|
}
|
||||||
|
|
||||||
|
.trello-board-title {
|
||||||
|
font-weight: bold;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.trello-list {
|
||||||
|
background-color: #e2e4e6;
|
||||||
|
padding: 10px;
|
||||||
|
border-radius: 3px;
|
||||||
|
margin: 10px 10px 0 0;
|
||||||
|
max-width: 300px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.trello-list-title {
|
||||||
|
font-weight: bold;
|
||||||
|
color: #4c4c4c;
|
||||||
|
font-size: 14px;
|
||||||
|
margin: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.trello-list-checkbox {
|
||||||
|
vertical-align: text-bottom;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
{{#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}}
|
||||||
|
|
||||||
|
<div class="pull-left width-50">
|
||||||
|
<div class="input-form">
|
||||||
|
<div class="heading">
|
||||||
|
<div class="title">Select Board & Lists</div>
|
||||||
|
<div class="tip">Choose lists to include from board</div>
|
||||||
|
</div>
|
||||||
|
{{#if noBoards}}
|
||||||
|
<div class="input-control">
|
||||||
|
<div class="color-error">You have no team boards to share - personal boards are never shown.</div>
|
||||||
|
</div>
|
||||||
|
{{else}}
|
||||||
|
<div class="input-control">
|
||||||
|
<label>Board</label>
|
||||||
|
<div class="tip">Select board</div>
|
||||||
|
{{ui-select id="boards-dropdown" content=boards action=(action 'onBoardChange') optionValuePath="id" optionLabelPath="name" selection=config.board}}
|
||||||
|
</div>
|
||||||
|
<div class="input-control">
|
||||||
|
<label>Lists</label>
|
||||||
|
<div class="tip">Select lists to include</div>
|
||||||
|
<div class="trello-board" style= {{boardStyle}}>
|
||||||
|
<div class="trello-board-title">{{config.board.name}}</div>
|
||||||
|
{{#each config.lists as |list|}}
|
||||||
|
<div class="trello-list" {{action 'onListCheckbox' list.id}}>
|
||||||
|
{{#if list.included}}
|
||||||
|
<i class="material-icons widget-checkbox checkbox-gray trello-list-checkbox">check_box</i>
|
||||||
|
{{else}}
|
||||||
|
<i class="material-icons widget-checkbox checkbox-gray trello-list-checkbox">check_box_outline_blank</i>
|
||||||
|
{{/if}}
|
||||||
|
<span class="trello-list-title">{{list.name}}</span>
|
||||||
|
</div>
|
||||||
|
{{/each}}
|
||||||
|
<div class="clearfix" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{else}}
|
||||||
|
|
||||||
|
<div class="pull-left width-50">
|
||||||
|
<div class="input-form">
|
||||||
|
<form>
|
||||||
|
<div class="heading">
|
||||||
|
<div class="title">Authentication</div>
|
||||||
|
<div class="tip">Click to authenticate with Trello</div>
|
||||||
|
</div>
|
||||||
|
<div class="regular-button button-blue" {{ action 'auth' }}>Authenticate</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
{{/section/base-editor}}
|
|
@ -0,0 +1,54 @@
|
||||||
|
<style>
|
||||||
|
.trello-board {
|
||||||
|
width: 100%;
|
||||||
|
max-height: 600px;
|
||||||
|
padding: 10px;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: auto
|
||||||
|
}
|
||||||
|
|
||||||
|
.trello-board-title {
|
||||||
|
font-weight: bold;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.trello-list {
|
||||||
|
background-color: #e2e4e6;
|
||||||
|
padding: 10px;
|
||||||
|
border-radius: 3px;
|
||||||
|
margin: 10px 10px 0 0;
|
||||||
|
width: 300px;
|
||||||
|
max-height: 500px;
|
||||||
|
display: inline-block;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: auto;
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
|
|
||||||
|
.trello-list-title {
|
||||||
|
font-weight: bold;
|
||||||
|
color: #4c4c4c;
|
||||||
|
font-size: 14px;
|
||||||
|
margin: 0 10px 10px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.trello-card {
|
||||||
|
color: #4c4c4c;
|
||||||
|
border-bottom: 1px solid #CDD2D4;
|
||||||
|
background-color: #fff;
|
||||||
|
border-radius: 3px;
|
||||||
|
padding: 7px 7px;
|
||||||
|
margin: 5px 0;
|
||||||
|
font-size: 14px;
|
||||||
|
font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
|
||||||
|
line-height: 18px;
|
||||||
|
overflow: hidden;
|
||||||
|
word-wrap: break-word;
|
||||||
|
white-space: normal;
|
||||||
|
cursor: pointer;
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
{{{page.body}}}
|
|
@ -1,4 +1,4 @@
|
||||||
<select {{action 'change' on='change'}} class={{csslass}}>
|
<select {{action 'change' on='change'}} class={{csslass}} readonly={{readonly}}>
|
||||||
{{#if prompt}}
|
{{#if prompt}}
|
||||||
<option disabled selected={{is-not selection}}>
|
<option disabled selected={{is-not selection}}>
|
||||||
{{prompt}}
|
{{prompt}}
|
||||||
|
|
|
@ -1,7 +1,18 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
FolderType: {
|
FolderType: {
|
||||||
Public: 1,
|
Public: 1,
|
||||||
Private: 2,
|
Private: 2,
|
||||||
Protected: 3
|
Protected: 3
|
||||||
}
|
}
|
||||||
};
|
};
|
|
@ -1,3 +1,14 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
// "2014/02/05"
|
// "2014/02/05"
|
||||||
function toShortDate(date) {
|
function toShortDate(date) {
|
||||||
return moment(new Date(date)).format('YYYY/MM/DD');
|
return moment(new Date(date)).format('YYYY/MM/DD');
|
||||||
|
@ -26,4 +37,4 @@ export default {
|
||||||
formatDate,
|
formatDate,
|
||||||
timeAgo,
|
timeAgo,
|
||||||
timeAgoUTC
|
timeAgoUTC
|
||||||
};
|
};
|
|
@ -1,8 +1,108 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
//*************************************
|
//*************************************
|
||||||
// Base64 Object
|
// Base64 Object
|
||||||
//*************************************
|
//*************************************
|
||||||
var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(e){var t="";var n,r,i,s,o,u,a;var f=0;e=Base64._utf8_encode(e);while(f<e.length){n=e.charCodeAt(f++);r=e.charCodeAt(f++);i=e.charCodeAt(f++);s=n>>2;o=(n&3)<<4|r>>4;u=(r&15)<<2|i>>6;a=i&63;if(isNaN(r)){u=a=64}else if(isNaN(i)){a=64}t=t+this._keyStr.charAt(s)+this._keyStr.charAt(o)+this._keyStr.charAt(u)+this._keyStr.charAt(a)}return t},decode:function(e){var t="";var n,r,i;var s,o,u,a;var f=0;e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");while(f<e.length){s=this._keyStr.indexOf(e.charAt(f++));o=this._keyStr.indexOf(e.charAt(f++));u=this._keyStr.indexOf(e.charAt(f++));a=this._keyStr.indexOf(e.charAt(f++));n=s<<2|o>>4;r=(o&15)<<4|u>>2;i=(u&3)<<6|a;t=t+String.fromCharCode(n);if(u!=64){t=t+String.fromCharCode(r)}if(a!=64){t=t+String.fromCharCode(i)}}t=Base64._utf8_decode(t);return t},_utf8_encode:function(e){e=e.replace(/\r\n/g,"\n");var t="";for(var n=0;n<e.length;n++){var r=e.charCodeAt(n);if(r<128){t+=String.fromCharCode(r)}else if(r>127&&r<2048){t+=String.fromCharCode(r>>6|192);t+=String.fromCharCode(r&63|128)}else{t+=String.fromCharCode(r>>12|224);t+=String.fromCharCode(r>>6&63|128);t+=String.fromCharCode(r&63|128);}}return t;},_utf8_decode:function(e){var t="";var n=0;var r=c1=c2=0;while(n<e.length){r=e.charCodeAt(n);if(r<128){t+=String.fromCharCode(r);n++;}else if(r>191&&r<224){c2=e.charCodeAt(n+1);t+=String.fromCharCode((r&31)<<6|c2&63);n+=2;}else{c2=e.charCodeAt(n+1);c3=e.charCodeAt(n+2);t+=String.fromCharCode((r&15)<<12|(c2&63)<<6|c3&63);n+=3;}}return t;}}; //jshint ignore:line
|
var Base64 = {
|
||||||
|
_keyStr: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
|
||||||
|
encode: function(e) {
|
||||||
|
var t = "";
|
||||||
|
var n, r, i, s, o, u, a;
|
||||||
|
var f = 0;
|
||||||
|
e = Base64._utf8_encode(e);
|
||||||
|
while (f < e.length) {
|
||||||
|
n = e.charCodeAt(f++);
|
||||||
|
r = e.charCodeAt(f++);
|
||||||
|
i = e.charCodeAt(f++);
|
||||||
|
s = n >> 2;
|
||||||
|
o = (n & 3) << 4 | r >> 4;
|
||||||
|
u = (r & 15) << 2 | i >> 6;
|
||||||
|
a = i & 63;
|
||||||
|
if (isNaN(r)) {
|
||||||
|
u = a = 64
|
||||||
|
} else if (isNaN(i)) {
|
||||||
|
a = 64
|
||||||
|
}
|
||||||
|
t = t + this._keyStr.charAt(s) + this._keyStr.charAt(o) + this._keyStr.charAt(u) + this._keyStr.charAt(a)
|
||||||
|
}
|
||||||
|
return t
|
||||||
|
},
|
||||||
|
decode: function(e) {
|
||||||
|
var t = "";
|
||||||
|
var n, r, i;
|
||||||
|
var s, o, u, a;
|
||||||
|
var f = 0;
|
||||||
|
e = e.replace(/[^A-Za-z0-9\+\/\=]/g, "");
|
||||||
|
while (f < e.length) {
|
||||||
|
s = this._keyStr.indexOf(e.charAt(f++));
|
||||||
|
o = this._keyStr.indexOf(e.charAt(f++));
|
||||||
|
u = this._keyStr.indexOf(e.charAt(f++));
|
||||||
|
a = this._keyStr.indexOf(e.charAt(f++));
|
||||||
|
n = s << 2 | o >> 4;
|
||||||
|
r = (o & 15) << 4 | u >> 2;
|
||||||
|
i = (u & 3) << 6 | a;
|
||||||
|
t = t + String.fromCharCode(n);
|
||||||
|
if (u != 64) {
|
||||||
|
t = t + String.fromCharCode(r)
|
||||||
|
}
|
||||||
|
if (a != 64) {
|
||||||
|
t = t + String.fromCharCode(i)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
t = Base64._utf8_decode(t);
|
||||||
|
return t
|
||||||
|
},
|
||||||
|
_utf8_encode: function(e) {
|
||||||
|
e = e.replace(/\r\n/g, "\n");
|
||||||
|
var t = "";
|
||||||
|
for (var n = 0; n < e.length; n++) {
|
||||||
|
var r = e.charCodeAt(n);
|
||||||
|
if (r < 128) {
|
||||||
|
t += String.fromCharCode(r)
|
||||||
|
} else if (r > 127 && r < 2048) {
|
||||||
|
t += String.fromCharCode(r >> 6 | 192);
|
||||||
|
t += String.fromCharCode(r & 63 | 128)
|
||||||
|
} else {
|
||||||
|
t += String.fromCharCode(r >> 12 | 224);
|
||||||
|
t += String.fromCharCode(r >> 6 & 63 | 128);
|
||||||
|
t += String.fromCharCode(r & 63 | 128);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return t;
|
||||||
|
},
|
||||||
|
_utf8_decode: function(e) {
|
||||||
|
var t = "";
|
||||||
|
var n = 0;
|
||||||
|
var r = c1 = c2 = 0;
|
||||||
|
while (n < e.length) {
|
||||||
|
r = e.charCodeAt(n);
|
||||||
|
if (r < 128) {
|
||||||
|
t += String.fromCharCode(r);
|
||||||
|
n++;
|
||||||
|
} else if (r > 191 && r < 224) {
|
||||||
|
c2 = e.charCodeAt(n + 1);
|
||||||
|
t += String.fromCharCode((r & 31) << 6 | c2 & 63);
|
||||||
|
n += 2;
|
||||||
|
} else {
|
||||||
|
c2 = e.charCodeAt(n + 1);
|
||||||
|
c3 = e.charCodeAt(n + 2);
|
||||||
|
t += String.fromCharCode((r & 15) << 12 | (c2 & 63) << 6 | c3 & 63);
|
||||||
|
n += 3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
}; //jshint ignore:line
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
Base64
|
Base64
|
||||||
};
|
};
|
|
@ -1,13 +1,23 @@
|
||||||
// http://thecodeship.com/web-development/alternative-to-javascript-evil-setinterval/
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
|
// from http://thecodeship.com/web-development/alternative-to-javascript-evil-setinterval/
|
||||||
function interval(func, wait, times) {
|
function interval(func, wait, times) {
|
||||||
var interv = function(w, t) {
|
var interv = function(w, t) {
|
||||||
return function() {
|
return function() {
|
||||||
if(typeof t === "undefined" || t-- > 0) {
|
if (typeof t === "undefined" || t-- > 0) {
|
||||||
setTimeout(interv, w);
|
setTimeout(interv, w);
|
||||||
try {
|
try {
|
||||||
func.call(null);
|
func.call(null);
|
||||||
}
|
} catch (e) {
|
||||||
catch(e) {
|
|
||||||
t = 0;
|
t = 0;
|
||||||
throw e.toString();
|
throw e.toString();
|
||||||
}
|
}
|
||||||
|
@ -33,4 +43,4 @@ function wrapFunction(fn, context, params) {
|
||||||
export default {
|
export default {
|
||||||
interval,
|
interval,
|
||||||
wrapFunction
|
wrapFunction
|
||||||
};
|
};
|
|
@ -1,3 +1,14 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
import stringUtil from '../utils/string';
|
import stringUtil from '../utils/string';
|
||||||
import config from '../config/environment';
|
import config from '../config/environment';
|
||||||
|
@ -25,7 +36,7 @@ let AppMeta = BaseModel.extend({
|
||||||
init() {
|
init() {
|
||||||
this.set('host', config.apiHost);
|
this.set('host', config.apiHost);
|
||||||
this.set('namespace', config.apiNamespace);
|
this.set('namespace', config.apiNamespace);
|
||||||
this.set('url', [config.host, config.namespace, ""].join('/'));
|
this.set('url', [config.apiHost, config.apiNamespace, ""].join('/'));
|
||||||
},
|
},
|
||||||
|
|
||||||
getUrl(endpoint) {
|
getUrl(endpoint) {
|
||||||
|
|
|
@ -1,3 +1,14 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
function getSubdomain() {
|
function getSubdomain() {
|
||||||
if (is.ipv4(window.location.host)) {
|
if (is.ipv4(window.location.host)) {
|
||||||
return "";
|
return "";
|
||||||
|
@ -19,11 +30,11 @@ function getAppUrl(domain) {
|
||||||
|
|
||||||
let leftOvers = parts.join(".");
|
let leftOvers = parts.join(".");
|
||||||
|
|
||||||
if (is.empty(domain)) {
|
if (is.empty(domain)) {
|
||||||
domain = "";
|
domain = "";
|
||||||
} else {
|
} else {
|
||||||
domain = domain + ".";
|
domain = domain + ".";
|
||||||
}
|
}
|
||||||
|
|
||||||
return window.location.protocol + "//" + domain + leftOvers;
|
return window.location.protocol + "//" + domain + leftOvers;
|
||||||
}
|
}
|
||||||
|
@ -31,4 +42,4 @@ function getAppUrl(domain) {
|
||||||
export default {
|
export default {
|
||||||
getSubdomain,
|
getSubdomain,
|
||||||
getAppUrl
|
getAppUrl
|
||||||
};
|
};
|
|
@ -1,13 +1,24 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
// make url friendly slug from specified text.
|
// make url friendly slug from specified text.
|
||||||
function makeSlug(text) {
|
function makeSlug(text) {
|
||||||
return text.toLowerCase().replace(/[^\w ]+/g,'').replace(/ +/g,'-');
|
return text.toLowerCase().replace(/[^\w ]+/g, '').replace(/ +/g, '-');
|
||||||
}
|
}
|
||||||
|
|
||||||
function makeId(len) {
|
function makeId(len) {
|
||||||
var text = "";
|
var text = "";
|
||||||
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
||||||
|
|
||||||
for( var i=0; i < len; i++ ) {
|
for (var i = 0; i < len; i++) {
|
||||||
text += possible.charAt(Math.floor(Math.random() * possible.length));
|
text += possible.charAt(Math.floor(Math.random() * possible.length));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,4 +33,4 @@ export default {
|
||||||
makeSlug,
|
makeSlug,
|
||||||
makeId,
|
makeId,
|
||||||
endsWith
|
endsWith
|
||||||
};
|
};
|
|
@ -1,3 +1,14 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
/* jshint node: true */
|
/* jshint node: true */
|
||||||
|
|
||||||
module.exports = function(environment) {
|
module.exports = function(environment) {
|
||||||
|
@ -9,6 +20,7 @@ module.exports = function(environment) {
|
||||||
baseURL: '/',
|
baseURL: '/',
|
||||||
apiHost: '',
|
apiHost: '',
|
||||||
apiNamespace: '',
|
apiNamespace: '',
|
||||||
|
contentSecurityPolicyHeader: 'Content-Security-Policy-Report-Only',
|
||||||
|
|
||||||
EmberENV: {
|
EmberENV: {
|
||||||
FEATURES: {}
|
FEATURES: {}
|
||||||
|
@ -21,7 +33,7 @@ module.exports = function(environment) {
|
||||||
ENV.APP.LOG_TRANSITIONS_INTERNAL = true;
|
ENV.APP.LOG_TRANSITIONS_INTERNAL = true;
|
||||||
|
|
||||||
ENV.apiHost = "https://localhost:5001";
|
ENV.apiHost = "https://localhost:5001";
|
||||||
// ENV.apiHost = "https://demo1.dev:5001";
|
ENV.apiHost = "https://demo1.dev:5001";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (environment === 'test') {
|
if (environment === 'test') {
|
||||||
|
@ -37,7 +49,8 @@ module.exports = function(environment) {
|
||||||
// ENV.locationType = 'none';
|
// ENV.locationType = 'none';
|
||||||
// ENV.APP.rootElement = '#ember-testing';
|
// ENV.APP.rootElement = '#ember-testing';
|
||||||
|
|
||||||
ENV.apiHost = "https://demo1.dev:5001";
|
ENV.apiHost = "https://localhost:5001";
|
||||||
|
// ENV.apiHost = "https://demo1.dev:5001";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (environment === 'production') {
|
if (environment === 'production') {
|
||||||
|
@ -51,6 +64,7 @@ module.exports = function(environment) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ENV.apiNamespace = "api";
|
ENV.apiNamespace = "api";
|
||||||
|
ENV.contentSecurityPolicy = null;
|
||||||
|
|
||||||
// ENV.contentSecurityPolicy = {
|
// ENV.contentSecurityPolicy = {
|
||||||
// 'img-src': "'self' data: self https://js.intercomcdn.com",
|
// 'img-src': "'self' data: self https://js.intercomcdn.com",
|
||||||
|
@ -61,14 +75,14 @@ module.exports = function(environment) {
|
||||||
// 'default-src': "none"
|
// 'default-src': "none"
|
||||||
// };
|
// };
|
||||||
|
|
||||||
|
// ENV.contentSecurityPolicy = {
|
||||||
|
// 'img-src': "'self' data: self",
|
||||||
|
// 'font-src': "'self' *",
|
||||||
|
// 'style-src': "'self' *",
|
||||||
|
// 'script-src': "'self' *",
|
||||||
|
// 'connect-src': "'self' *",
|
||||||
|
// 'default-src': "*"
|
||||||
|
// };
|
||||||
|
|
||||||
return ENV;
|
return ENV;
|
||||||
};
|
};
|
||||||
|
|
||||||
// contentSecurityPolicy: {
|
|
||||||
// 'img-src': "'self' data: self",
|
|
||||||
// 'font-src': "'self' data: fonts.gstatic.com",
|
|
||||||
// 'style-src': "'self' 'unsafe-inline' fonts.googleapis.com",
|
|
||||||
// 'script-src': "'self' 'unsafe-inline' 'unsafe-eval' *",
|
|
||||||
// 'connect-src': "'self'",
|
|
||||||
// 'default-src': "none"
|
|
||||||
// },
|
|
|
@ -1,3 +1,14 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
/* global require, module */
|
/* global require, module */
|
||||||
var EmberApp = require('ember-cli/lib/broccoli/ember-app');
|
var EmberApp = require('ember-cli/lib/broccoli/ember-app');
|
||||||
var isDevelopment = EmberApp.env() === 'development';
|
var isDevelopment = EmberApp.env() === 'development';
|
||||||
|
@ -44,6 +55,7 @@ module.exports = function(defaults) {
|
||||||
app.import('vendor/tether.js');
|
app.import('vendor/tether.js');
|
||||||
app.import('vendor/drop.js');
|
app.import('vendor/drop.js');
|
||||||
app.import('vendor/tooltip.js');
|
app.import('vendor/tooltip.js');
|
||||||
|
app.import('vendor/markdown-it.min.js');
|
||||||
|
|
||||||
return app.toTree();
|
return app.toTree();
|
||||||
};
|
};
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue