1
0
Fork 0
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:
Harvey Kandola 2016-05-22 13:28:51 -07:00
commit 2c526ed304
153 changed files with 3320 additions and 902 deletions

View file

@ -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 Resolver from './resolver';
import loadInitializers from 'ember-load-initializers';

View file

@ -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';
export default Ember.Component.extend({

View file

@ -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';
export default Ember.Component.extend({

View file

@ -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 NotifierMixin from '../../mixins/notifier';
import TooltipMixin from '../../mixins/tooltip';
@ -8,7 +19,12 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
pages: [],
page: "",
showToc: false,
tocTools: { UpTarget: "", DownTarget: "", AllowIndent: false, AllowOutdent: false },
tocTools: {
UpTarget: "",
DownTarget: "",
AllowIndent: false,
AllowOutdent: false
},
actionablePage: false,
upDisabled: true,
downDisabled: true,
@ -77,7 +93,9 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
this.set('page', pageId);
var toc = this.get('pages');
var page = _.findWhere(toc, {id: pageId});
var page = _.findWhere(toc, {
id: pageId
});
// handle root node
if (is.undefined(page) || page.level === 1) {
@ -90,8 +108,8 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
return;
}
var upPage = toc[index-1];
var downPage = toc[index+1];
var upPage = toc[index - 1];
var downPage = toc[index + 1];
if (_.isUndefined(upPage)) {
this.set('tocTools.UpTarget', "");
@ -103,39 +121,31 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
// can we go up?
// can we indent?
if (!_.isUndefined(upPage))
{
if (!_.isUndefined(upPage)) {
// can only go up if someone is same or higher level?
var index2 = _.indexOf(toc, upPage, false);
if (index2 !== -1)
{
if (index2 !== -1) {
// up
for (var i = index2; i > 0; i--)
{
if (page.level > toc[i].level)
{
for (var i = index2; i > 0; i--) {
if (page.level > toc[i].level) {
break;
}
if (page.level === toc[i].level)
{
if (page.level === toc[i].level) {
this.set('tocTools.UpTarget', toc[i].id);
break;
}
}
// indent?
for (var i2 = index2; i2 > 0; i2--)
{
if (toc[i2].level < page.level)
{
for (var i2 = index2; i2 > 0; i2--) {
if (toc[i2].level < page.level) {
this.set('tocTools.AllowIndent', false);
break;
}
if (page.level === toc[i2].level)
{
if (page.level === toc[i2].level) {
this.set('tocTools.AllowIndent', true);
break;
}
@ -143,30 +153,24 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
}
// if page above is root node then some things you can't do
if (upPage.level === 1)
{
if (upPage.level === 1) {
this.set('tocTools.AllowIndent', false);
this.set('tocTools.UpTarget', "");
}
}
// can we go down?
if (!_.isUndefined(downPage))
{
if (!_.isUndefined(downPage)) {
// can only go down if someone below is at our level or higher
var index3 = _.indexOf(toc, downPage, false);
if (index3 !== -1)
{
for (var i3 = index3; i3 < toc.length; i3++)
{
if (toc[i3].level < page.level)
{
if (index3 !== -1) {
for (var i3 = index3; i3 < toc.length; i3++) {
if (toc[i3].level < page.level) {
break;
}
if (page.level === toc[i3].level)
{
if (page.level === toc[i3].level) {
this.set('tocTools.DownTarget', toc[i3].id);
break;
}
@ -201,8 +205,12 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
}
var pages = this.get('pages');
var current = _.findWhere(pages, {id: this.get('page')});
var page1 = _.findWhere(pages, {id: this.tocTools.UpTarget});
var current = _.findWhere(pages, {
id: this.get('page')
});
var page1 = _.findWhere(pages, {
id: this.tocTools.UpTarget
});
var page2 = null;
var pendingChanges = [];
@ -221,22 +229,25 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
var index = _.indexOf(pages, current, false);
if (index !== -1)
{
if (index !== -1) {
var sequence = (sequence1 + sequence2) / 2;
pendingChanges.push({ pageId: current.id, sequence: sequence });
pendingChanges.push({
pageId: current.id,
sequence: sequence
});
for (var i = index + 1; i < pages.length; i++)
{
if (pages[i].level <= current.level)
{
for (var i = index + 1; i < pages.length; i++) {
if (pages[i].level <= current.level) {
break;
}
sequence = (sequence + page1.sequence) / 2;
pendingChanges.push({ pageId: pages[i].id, sequence: sequence });
pendingChanges.push({
pageId: pages[i].id,
sequence: sequence
});
}
}
@ -254,9 +265,13 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
}
var pages = this.get('pages');
var current = _.findWhere(pages, {id: this.get('page')});
var current = _.findWhere(pages, {
id: this.get('page')
});
var pageIndex = _.indexOf(pages, current, false);
var downTarget = _.findWhere(pages, {id: this.tocTools.DownTarget});
var downTarget = _.findWhere(pages, {
id: this.tocTools.DownTarget
});
var downTargetIndex = _.indexOf(pages, downTarget, false);
var pendingChanges = [];
@ -267,46 +282,46 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
var startingSequence = 0;
var upperSequence = 0;
var cutOff = _.rest(pages, downTargetIndex);
var siblings = _.reject(cutOff, function(p){ return p.level !== current.level || p.id === current.id || p.id === downTarget.id; });
var siblings = _.reject(cutOff, function(p) {
return p.level !== current.level || p.id === current.id || p.id === downTarget.id;
});
if (siblings.length > 0)
{
if (siblings.length > 0) {
var aboveThisGuy = siblings[0];
var belowThisGuy = pages[_.indexOf(pages, aboveThisGuy, false) - 1];
if (is.not.null(belowThisGuy) && belowThisGuy.level > current.level)
{
if (is.not.null(belowThisGuy) && belowThisGuy.level > current.level) {
startingSequence = (aboveThisGuy.sequence + belowThisGuy.sequence) / 2;
upperSequence = aboveThisGuy.sequence;
}
else
{
} else {
var otherGuy = pages[downTargetIndex + 1];
startingSequence = (otherGuy.sequence + downTarget.sequence) / 2;
upperSequence = otherGuy.sequence;
}
}
else
{
} else {
startingSequence = downTarget.sequence * 2;
upperSequence = startingSequence * 2;
}
pendingChanges.push({ pageId: current.id, sequence: startingSequence });
pendingChanges.push({
pageId: current.id,
sequence: startingSequence
});
var sequence = (startingSequence + upperSequence) / 2;
for (var i = pageIndex + 1; i < pages.length; i++)
{
if (pages[i].level <= current.level)
{
for (var i = pageIndex + 1; i < pages.length; i++) {
if (pages[i].level <= current.level) {
break;
}
var sequence2 = (sequence + upperSequence) / 2;
pendingChanges.push({ pageId: pages[i].id, sequence: sequence2 });
pendingChanges.push({
pageId: pages[i].id,
sequence: sequence2
});
}
this.attrs.changePageSequence(pendingChanges);
@ -323,20 +338,26 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
}
var pages = this.get('pages');
var current = _.findWhere(pages, {id: this.get('page')});
var current = _.findWhere(pages, {
id: this.get('page')
});
var pageIndex = _.indexOf(pages, current, false);
var pendingChanges = [];
pendingChanges.push({ pageId: current.id, level: current.level + 1 });
pendingChanges.push({
pageId: current.id,
level: current.level + 1
});
for (var i = pageIndex + 1; i < pages.length; i++)
{
if (pages[i].level <= current.level)
{
for (var i = pageIndex + 1; i < pages.length; i++) {
if (pages[i].level <= current.level) {
break;
}
pendingChanges.push({ pageId: pages[i].id, level: pages[i].level + 1 });
pendingChanges.push({
pageId: pages[i].id,
level: pages[i].level + 1
});
}
this.attrs.changePageLevel(pendingChanges);
@ -353,20 +374,26 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
}
var pages = this.get('pages');
var current = _.findWhere(pages, {id: this.get('page')});
var current = _.findWhere(pages, {
id: this.get('page')
});
var pageIndex = _.indexOf(pages, current, false);
var pendingChanges = [];
pendingChanges.push({ pageId: current.id, level: current.level - 1 });
pendingChanges.push({
pageId: current.id,
level: current.level - 1
});
for (var i = pageIndex + 1; i < pages.length; i++)
{
if (pages[i].level <= current.level)
{
for (var i = pageIndex + 1; i < pages.length; i++) {
if (pages[i].level <= current.level) {
break;
}
pendingChanges.push({ pageId: pages[i].id, level: pages[i].level - 1 });
pendingChanges.push({
pageId: pages[i].id,
level: pages[i].level - 1
});
}
this.attrs.changePageLevel(pendingChanges);

View file

@ -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';
export default Ember.Component.extend({

View file

@ -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';
export default Ember.Component.extend({

View file

@ -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 NotifierMixin from '../../mixins/notifier';
import TooltipMixin from '../../mixins/tooltip';

View file

@ -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 NotifierMixin from '../../mixins/notifier';
import TooltipMixin from '../../mixins/tooltip';

View file

@ -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';
export default Ember.Component.extend({
@ -27,8 +38,11 @@ export default Ember.Component.extend({
didRender() {
let self = this;
Ember.run.schedule('afterRender', function(){
Mousetrap.bind('esc', function() { self.send('cancelAction'); return false;});
Ember.run.schedule('afterRender', function() {
Mousetrap.bind('esc', function() {
self.send('cancelAction');
return false;
});
});
},
@ -45,7 +59,9 @@ export default Ember.Component.extend({
Ember.set(revision, 'selected', false);
});
let revision = _.findWhere(revisions, { id: revisionId});
let revision = _.findWhere(revisions, {
id: revisionId
});
Ember.set(revision, 'selected', true);
let self = this;

View file

@ -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 TooltipMixin from '../../mixins/tooltip';

View file

@ -1,7 +1,19 @@
import Ember from 'ember';
// 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 Ember.Component.extend({
title: "",
import Ember from 'ember';
import NotifierMixin from '../../mixins/notifier';
export default Ember.Component.extend(NotifierMixin, {
title: "New Section",
contentType: "",
didReceiveAttrs() {
@ -22,6 +34,10 @@ export default Ember.Component.extend({
});
this.set("sections", sections);
if (this.session.get('popupBlocked')) {
this.showNotification("Hmm, looks like your browser is blocking popups...");
}
},
onCancel() {
@ -30,13 +46,21 @@ export default Ember.Component.extend({
onAction() {
let title = this.get("title");
let contentType = this.get("sections").findBy("selected", true).contentType;
let section = this.get("sections").findBy("selected", true);
let contentType = section.contentType;
if (section.preview) {
this.showNotification("Coming soon!");
return;
}
if (is.empty(title)) {
$("#page-title").addClass("error").focus();
return;
}
this.audit.record('added section' + section.contentType);
this.attrs.onAction(title, contentType);
}
}

View file

@ -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';
export default Ember.Component.extend({

View file

@ -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 stringUtil from '../utils/string';

View file

@ -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 stringUtil from '../utils/string';

View file

@ -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';
export default Ember.TextField.extend({

View file

@ -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';
export default Ember.TextArea.extend({

View file

@ -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';
export default Ember.Component.extend({

View file

@ -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';
export default Ember.Component.extend({

View file

@ -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 NotifierMixin from '../../mixins/notifier';
import TooltipMixin from '../../mixins/tooltip';
@ -29,12 +40,18 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
let self = this;
this.get('templateService').getSavedTemplates().then(function(saved) {
let emptyTemplate = { id: "0", title: "Empty document", selected: true };
let emptyTemplate = {
id: "0",
title: "Empty document",
selected: true
};
saved.unshiftObject(emptyTemplate);
self.set('savedTemplates', saved);
});
let targets = _.reject(this.get('folders'), { id: this.get('folder').get('id') });
let targets = _.reject(this.get('folders'), {
id: this.get('folder').get('id')
});
this.set('movedFolderOptions', targets);
},
@ -57,7 +74,7 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
this.destroyTooltips();
},
navigateToDocument(document){
navigateToDocument(document) {
this.attrs.showDocument(this.get('folder'), document);
},
@ -71,7 +88,7 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
this.navigateToDocument(template);
},
onDocumentTemplate(id /*, title, type*/) {
onDocumentTemplate(id /*, title, type*/ ) {
let self = this;
this.send("showNotification", "Creating");
@ -89,7 +106,7 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
this.set('importedDocuments', documents);
},
onDocumentImported(filename/*, document*/) {
onDocumentImported(filename /*, document*/ ) {
this.send("showNotification", `${filename} ready`);
let documents = this.get('importedDocuments');

View file

@ -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';
export default Ember.Component.extend({

View file

@ -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 constants from '../../utils/constants';
import TooltipMixin from '../../mixins/tooltip';

View file

@ -1,10 +1,23 @@
// 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 NotifierMixin from '../../mixins/notifier';
export default Ember.Component.extend(NotifierMixin, {
tagName: 'span',
selectedTemplate: { id: "0" },
selectedTemplate: {
id: "0"
},
canEditTemplate: "",
didReceiveAttrs() {
@ -50,7 +63,9 @@ export default Ember.Component.extend(NotifierMixin, {
let importUrl = this.session.appMeta.getUrl('import/folder/' + folderId);
let dzone = new Dropzone("#upload-documents", {
headers: {'Authorization': 'Bearer ' + self.session.getSessionItem('token') },
headers: {
'Authorization': 'Bearer ' + self.session.getSessionItem('token')
},
url: importUrl,
method: "post",
paramName: 'attachment',
@ -68,11 +83,10 @@ export default Ember.Component.extend(NotifierMixin, {
});
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("queuecomplete", function() {});
this.on("addedfile", function(file) {
self.attrs.onDocumentImporting(file.name);

View 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';
export default Ember.Component.extend({
});
export default Ember.Component.extend({});

View file

@ -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 netUtil from '../../utils/net';

View file

@ -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';
export default Ember.Component.extend({

View 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';
export default Ember.Component.extend({
});
export default Ember.Component.extend({});

View 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';
export default Ember.Component.extend({
});
export default Ember.Component.extend({});

View 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';
export default Ember.Component.extend({
});
export default Ember.Component.extend({});

View file

@ -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 encodingUtil from '../../utils/encoding';
import netUtil from '../../utils/net';
@ -16,31 +27,24 @@ export default Ember.Component.extend({
$("#stage-1-firstname").focus();
// Stage 1 - person name keypress handler
$("#stage-1-firstname, #stage-1-lastname").keyup(function()
{
if (!$("#stage-1-firstname").val() || !$("#stage-1-lastname").val())
{
$("#stage-1-firstname, #stage-1-lastname").keyup(function() {
if (!$("#stage-1-firstname").val() || !$("#stage-1-lastname").val()) {
$(".name-status").attr("src", "assets/img/onboard/person-red.png");
}
else
{
} else {
$(".name-status").attr("src", "assets/img/onboard/person-green.png");
}
});
// Stage 1 - finish
$("#stage-1-next").off('click').on('click', function()
{
if (!$("#stage-1-firstname").val())
{
$("#stage-1-next").off('click').on('click', function() {
if (!$("#stage-1-firstname").val()) {
$("#stage-1-firstname").focus();
$("#stage-1-firstname").addClass("error");
$(".name-status").attr("src", "assets/img/onboard/person-red.png");
return;
}
if (!$("#stage-1-lastname").val())
{
if (!$("#stage-1-lastname").val()) {
$("#stage-1-lastname").focus();
$("#stage-1-lastname").addClass("error");
$(".name-status").attr("src", "assets/img/onboard/person-red.png");
@ -49,8 +53,7 @@ export default Ember.Component.extend({
self.set('processing', false);
$(".stage-1").fadeOut("slow", function()
{
$(".stage-1").fadeOut("slow", function() {
if (self.get('processing')) {
return;
}
@ -61,15 +64,11 @@ export default Ember.Component.extend({
$("#stage-2-password").focus();
// Stage 2 - password keypress handler
$("#stage-2-password-confirm").keyup(function()
{
$("#stage-2-password-confirm").keyup(function() {
if ($("#stage-2-password").val().length < 6 || $("#stage-2-password").val().length > 50 ||
($("#stage-2-password").val() !== $("#stage-2-password-confirm").val()))
{
($("#stage-2-password").val() !== $("#stage-2-password-confirm").val())) {
$(".password-status").attr("src", "assets/img/onboard/lock-red.png");
}
else
{
} else {
$(".password-status").attr("src", "assets/img/onboard/lock-green.png");
}
});
@ -77,24 +76,20 @@ export default Ember.Component.extend({
});
// Stage 2 - finish
$("#stage-2-next").off('click').on('click', function()
{
if (!$("#stage-2-password").val() || $("#stage-2-password").val().length < 6 || $("#stage-2-password").val().length > 50)
{
$("#stage-2-next").off('click').on('click', function() {
if (!$("#stage-2-password").val() || $("#stage-2-password").val().length < 6 || $("#stage-2-password").val().length > 50) {
$("#stage-2-password").focus();
$("#stage-2-password").addClass("error");
return;
}
if (!$("#stage-2-password-confirm").val())
{
if (!$("#stage-2-password-confirm").val()) {
$("#stage-2-password-confirm").focus();
$("#stage-2-password-confirm").addClass("error");
return;
}
if ($("#stage-2-password-confirm").val() !== $("#stage-2-password").val())
{
if ($("#stage-2-password-confirm").val() !== $("#stage-2-password").val()) {
$(".mismatch").show();
$(".password-status").attr("src", "assets/img/onboard/lock-red.png");
return;
@ -102,8 +97,7 @@ export default Ember.Component.extend({
self.set('processing', false);
$(".stage-2").fadeOut("slow", function()
{
$(".stage-2").fadeOut("slow", function() {
if (self.get('processing')) {
return;
}

View file

@ -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';
export default Ember.Component.extend({

View file

@ -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';
export default Ember.Component.extend({

View file

@ -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';
export default Ember.Component.extend({

View file

@ -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';
export default Ember.Component.extend({

View file

@ -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 TooltipMixin from '../../../mixins/tooltip';

View file

@ -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';
export default Ember.Component.extend({

View file

@ -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 NotifierMixin from '../../../mixins/notifier';
import TooltipMixin from '../../../mixins/tooltip';
import SectionMixin from '../../../mixins/section';
export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
export default Ember.Component.extend(SectionMixin, NotifierMixin, TooltipMixin, {
sectionService: Ember.inject.service('section'),
isDirty: false,
waiting: false,
@ -11,14 +23,6 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
workspaces: [],
config: {},
fieldEditable: function() {
if (this.get('page.userId') !== this.session.user.id) {
return "readonly";
} else {
return undefined;
}
}.property('config'),
didReceiveAttrs() {
let config = {};

View 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';
export default Ember.Component.extend({
});
export default Ember.Component.extend({});

View 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);
});
}
}
});

View 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({});

View file

@ -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';
export default Ember.Component.extend({

View 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';
export default Ember.Component.extend({
});
export default Ember.Component.extend({});

View file

@ -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';
export default Ember.Component.extend({
@ -44,7 +55,10 @@ export default Ember.Component.extend({
let user = this.users.findBy("id", id);
this.set('editUser', user.copy());
this.set('password', { password: "", confirmation: ""});
this.set('password', {
password: "",
confirmation: ""
});
$(".edit-user-dialog").css("display", "block");
$("input").removeClass("error");

View file

@ -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';
export default Ember.Component.extend({

View file

@ -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 miscUtil from '../utils/misc';
@ -24,7 +35,7 @@ export default Ember.Component.extend({
self.$(elem).show();
// FIXME: need a more robust solution
miscUtil.interval(function(){
miscUtil.interval(function() {
let notifications = self.get('notifications');
if (notifications.length > 0) {

View file

@ -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.
import Ember from 'ember';
import NotifierMixin from '../mixins/notifier';
@ -7,10 +18,18 @@ export default Ember.Component.extend(NotifierMixin, {
didInsertElement() {
this._super(...arguments);
new Tooltip({target: document.getElementById("sample-1")});
new Tooltip({target: document.getElementById("sample-2")});
new Tooltip({target: document.getElementById("sample-3")});
new Tooltip({target: document.getElementById("sample-4")});
new Tooltip({
target: document.getElementById("sample-1")
});
new Tooltip({
target: document.getElementById("sample-2")
});
new Tooltip({
target: document.getElementById("sample-3")
});
new Tooltip({
target: document.getElementById("sample-4")
});
let drop1 = new Drop({
target: document.getElementById('sample-dropdown-1'),

View file

@ -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';
export function documentFileIcon(params) {
let fileExtension = params[0].toLowerCase();
let html = "unknown.png";
switch (fileExtension)
{
switch (fileExtension) {
case "7z":
case "7zip":
case "zipx":

View file

@ -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';
export function documentTocEntry(params) {
@ -10,10 +21,10 @@ export function documentTocEntry(params) {
html += "<span style='margin-left: " + indent + "px;'></span>";
if (currentPage === nodeId) {
html += "<span class='selected'><i class='material-icons toc-bullet'>remove</i></span>";
html += "<span class='selected'></span>";
html += "";
} else {
html += "<span class=''><i class='material-icons toc-bullet'>remove</i></span>";
html += "<span class=''></span>";
html += "";
}

View file

@ -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 dateUtil from '../utils/date';

View file

@ -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';
// Usage: {{generate-id 'admin-' 123}}

View file

@ -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';
// Usage: {{is-equal item selection}}

View file

@ -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';
// Usage: {{is-not selection}}

View file

@ -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';
export default Ember.Helper.helper(function([object, path]) {

View file

@ -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 dateUtil from '../utils/date';

View file

@ -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';
// {{user-initials firstname lastname}}

View file

@ -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*/ ) {
// address insecure jquery defaults (kudos: @nathanhammond)
$.globalEval = function() {};
$.ajaxSetup({
crossDomain: true,
converters: {
'text script': text => text
}
});
Dropzone.autoDiscover = false;
// global trap for XHR 401
$(document).ajaxError(function(e, xhr /*, settings, exception*/ ) {
if (xhr.status === 401 && is.not.startWith(window.location.pathname, "/auth/")) {
window.location.href = "/auth/login";
}
});
}
export default {

View file

@ -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) {
application.inject('route', 'audit', 'service:audit');

View file

@ -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) {
application.inject('route', 'browser', 'service:browser');
application.inject('controller', 'browser', 'service:browser');

View file

@ -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) {
application.inject('route', 'eventBus', 'service:eventBus');
application.inject('component', 'eventBus', 'service:eventBus');

View file

@ -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) {
application.inject('route', 'logger', 'service:logger');
application.inject('component', 'logger', 'service:logger');

View file

@ -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) {
application.inject('route', 'session', 'service:session');
application.inject('controller', 'session', 'service:session');
application.inject('component', 'session', 'service:session');
application.inject('mixin', 'session', 'service:session');
}
export default {

View file

@ -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';
export default Ember.Mixin.create({

27
app/app/mixins/section.js Normal file
View 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')
});

View file

@ -1,10 +1,23 @@
// 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({
tooltips: [],
addTooltip(elem) {
let t = new Tooltip({target: elem});
let t = new Tooltip({
target: elem
});
let tt = this.get('tooltips');
tt.push(t);
},

View file

@ -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';
export default Resolver;

View file

@ -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 config from './config/environment';

View file

@ -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';
export default Ember.Route.extend({

View file

@ -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 netUtil from '../utils/net';
import config from '../config/environment';
@ -45,8 +56,7 @@ export default Ember.Service.extend({
email: session.user.email,
user_id: session.user.id,
"administrator": session.user.admin,
company:
{
company: {
id: session.get('appMeta.orgId'),
name: session.get('appMeta.title').string,
"domain": netUtil.getSubdomain(),

View file

@ -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';
export default Ember.Service.extend({
interval(func, wait, times) {
var interv = function(w, t){
return function(){
if(typeof t === "undefined" || t-- > 0) {
var interv = function(w, t) {
return function() {
if (typeof t === "undefined" || t-- > 0) {
setTimeout(interv, w);
try {
func.call(null);
}
catch(e) {
} catch (e) {
t = 0;
throw e.toString();
}

View file

@ -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';
export default Ember.Service.extend({
@ -30,6 +41,6 @@ export default Ember.Service.extend({
description = this.get('sessionService').appMeta.message;
}
$('head').append( '<meta name="description" content="' + description + '">' );
$('head').append('<meta name="description" content="' + description + '">');
}
});

View file

@ -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 models from '../utils/model';

View file

@ -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';
export default Ember.Service.extend(Ember.Evented, {

View file

@ -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 models from '../utils/model';
import BaseService from '../services/base';
@ -34,15 +45,15 @@ export default BaseService.extend({
getFolder(id) {
let url = this.get('sessionService').appMeta.getUrl(`folders/${id}`);
return new Ember.RSVP.Promise(function(resolve, reject){
return new Ember.RSVP.Promise(function(resolve, reject) {
$.ajax({
url: url,
type: 'GET',
success: function(response){
success: function(response) {
let folder = models.FolderModel.create(response);
resolve(folder);
},
error: function(reason){
error: function(reason) {
reject(reason);
}
});
@ -54,7 +65,9 @@ export default BaseService.extend({
let self = this;
if (this.get('folders') != null) {
return new Ember.RSVP.Promise(function(resolve) { resolve(self.get('folders')); });
return new Ember.RSVP.Promise(function(resolve) {
resolve(self.get('folders'));
});
} else {
return this.reload();
}
@ -123,11 +136,11 @@ export default BaseService.extend({
getProtectedFolderInfo: function() {
var url = this.get('sessionService').appMeta.getUrl('folders?filter=viewers');
return new Ember.RSVP.Promise(function(resolve, reject){
return new Ember.RSVP.Promise(function(resolve, reject) {
$.ajax({
url: url,
type: 'GET',
success: function(response){
success: function(response) {
let data = [];
_.each(response, function(obj) {
data.pushObject(models.ProtectedFolderParticipant.create(obj));
@ -135,7 +148,7 @@ export default BaseService.extend({
resolve(data);
},
error: function(reason){
error: function(reason) {
reject(reason);
}
});
@ -146,7 +159,7 @@ export default BaseService.extend({
reload() {
let url = this.get('sessionService').appMeta.getUrl(`folders`);
return new Ember.RSVP.Promise(function(resolve, reject){
return new Ember.RSVP.Promise(function(resolve, reject) {
$.ajax({
url: url,
type: 'GET',
@ -157,7 +170,7 @@ export default BaseService.extend({
});
resolve(data);
},
error: function(reason){
error: function(reason) {
reject(reason);
}
});
@ -172,14 +185,14 @@ export default BaseService.extend({
$.ajax({
url: self.get('sessionService').appMeta.getUrl(`folders/${folderId}/permissions`),
type: 'GET',
success: function(response){
success: function(response) {
let data = [];
_.each(response, function(obj) {
data.pushObject(models.FolderPermissionModel.create(obj));
});
resolve(data);
},
error: function(reason){
error: function(reason) {
reject(reason);
}
});
@ -196,10 +209,10 @@ export default BaseService.extend({
type: 'PUT',
contentType: 'json',
data: JSON.stringify(payload),
success: function(response){
success: function(response) {
resolve(response);
},
error: function(reason){
error: function(reason) {
reject(reason);
}
});
@ -216,10 +229,10 @@ export default BaseService.extend({
type: 'POST',
contentType: 'json',
data: JSON.stringify(invitation),
success: function(response){
success: function(response) {
resolve(response);
},
error: function(reason){
error: function(reason) {
reject(reason);
}
});

View file

@ -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';
export default Ember.Service.extend({

View file

@ -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 models from '../utils/model';
@ -8,15 +19,15 @@ export default Ember.Service.extend({
getOrg(id) {
let url = this.get('sessionService').appMeta.getUrl(`organizations/${id}`);
return new Ember.RSVP.Promise(function(resolve, reject){
return new Ember.RSVP.Promise(function(resolve, reject) {
$.ajax({
url: url,
type: 'GET',
success: function(response){
success: function(response) {
let org = models.OrganizationModel.create(response);
resolve(org);
},
error: function(reason){
error: function(reason) {
reject(reason);
}
});

View file

@ -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';
export default Ember.Service.extend({
@ -7,14 +18,14 @@ export default Ember.Service.extend({
find(keywords) {
let url = this.get('sessionService').appMeta.getUrl("search?keywords=" + encodeURIComponent(keywords));
return new Ember.RSVP.Promise(function(resolve, reject){
return new Ember.RSVP.Promise(function(resolve, reject) {
$.ajax({
url: url,
type: 'GET',
success: function(response) {
resolve(response);
},
error: function(reason){
error: function(reason) {
reject(reason);
}
});

View file

@ -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 models from '../utils/model';
import BaseService from '../services/base';

View file

@ -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 encodingUtil from '../utils/encoding';
import netUtil from '../utils/net';
@ -117,8 +128,13 @@ export default Ember.Service.extend({
this.storeSessionItem('token', token);
this.storeSessionItem('user', JSON.stringify(user));
let self = this;
$.ajaxPrefilter(function(options, originalOptions, jqXHR) {
// We only tack on auth header for Documize API calls
if (is.startWith(options.url, self.get('appMeta.url'))) {
jqXHR.setRequestHeader('Authorization', 'Bearer ' + token);
}
});
},
@ -167,6 +183,15 @@ export default Ember.Service.extend({
});
}
var blockedPopupTest = window.open("http://d27wjpa4h6c9yx.cloudfront.net/", "directories=no,height=1,width=1,menubar=no,resizable=no,scrollbars=no,status=no,titlebar=no,top=0,location=no");
if (!blockedPopupTest) {
this.set('popupBlocked', true);
} else {
blockedPopupTest.close();
this.set('popupBlocked', false);
}
return new Ember.RSVP.Promise(function(resolve) {
$.ajax({
url: self.get('appMeta').getUrl("public/meta"),

View file

@ -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 models from '../utils/model';
@ -42,7 +53,7 @@ export default Ember.Service.extend({
getSavedTemplates() {
let self = this;
return new Ember.RSVP.Promise(function(resolve, reject){
return new Ember.RSVP.Promise(function(resolve, reject) {
$.ajax({
url: self.get('sessionService').appMeta.getUrl("templates"),
type: 'GET',
@ -50,7 +61,9 @@ export default Ember.Service.extend({
if (is.not.array(response)) {
response = [];
}
let templates = Ember.ArrayProxy.create({ content: Ember.A([]) });
let templates = Ember.ArrayProxy.create({
content: Ember.A([])
});
_.each(response, function(template) {
let templateModel = models.TemplateModel.create(template);
@ -69,7 +82,7 @@ export default Ember.Service.extend({
getStockTemplates() {
let self = this;
return new Ember.RSVP.Promise(function(resolve, reject){
return new Ember.RSVP.Promise(function(resolve, reject) {
$.ajax({
url: self.get('sessionService').appMeta.getUrl("templates/stock"),
type: 'GET',

View file

@ -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 models from '../utils/model';

View file

@ -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 "font.scss";
@import "functions.scss";

View file

@ -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-not-allowed { cursor: not-allowed !important; }
.cursor-auto { cursor: auto; }
@ -60,6 +71,12 @@ $i: 150;
$i: $i - 5;
}
$i: 100;
@while $i > 0 {
.width-#{$i} { width: #{$i}#{"%"}; }
$i: $i - 5;
}
.no-outline
{
outline:none !important;

View file

@ -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-black: #4c4c4c;
$color-black: #000000;
$color-white: #ffffff;
$color-primary: #2180cc;
$color-link: #5680de;
$color-red: #d9493c;
@ -16,17 +25,10 @@ $color-chip: #98A2AB;
$color-input: #98A2AB;
$color-stroke: #98A2AB;
$color-card-active: #f7fcff;
$color-border: #dbdbdb;
$color-border2: #e2e2e2;
// FIXME remove/replace below?
// $color-primary: #1b75bb;
$color-primary-light: lighten($color-primary, 30%);
$color-primary-dark: darken($color-primary, 10%);
// $color-green: #79ad30;
// $color-gray: #a0a0a0;
$color-gray2: #f0eeee;
$color-active-state: #e2e2e2;
$color-sidebar: #e7f1f6;
@ -34,16 +36,42 @@ $color-shadow: #dbdbdb;
$color-error: #c23c56;
$color-highlight: #fff8dc;
$color-warning: #990012;
.background-color-white { background-color: $color-white; }
.color-white { color: $color-white; }
.color-off-white { color: $color-off-white; }
.color-black { color: $color-black; }
.color-off-black { color: $color-off-black; }
.background-color-primary { background-color: $color-primary; }
.color-primary { color: $color-primary; }
.color-link { color: $color-link; }
.color-blue { color: $color-blue; }
.color-red { color: $color-red; }
.color-green { color: $color-green; }
.color-gray { color: $color-gray; }
.background-color-white {
background-color: $color-white;
}
.color-white {
color: $color-white;
}
.color-off-white {
color: $color-off-white;
}
.color-black {
color: $color-black;
}
.color-off-black {
color: $color-off-black;
}
.background-color-primary {
background-color: $color-primary;
}
.color-primary {
color: $color-primary;
}
.color-link {
color: $color-link;
}
.color-blue {
color: $color-blue;
}
.color-red {
color: $color-red;
}
.color-green {
color: $color-green;
}
.color-gray {
color: $color-gray;
}
.color-error {
color: $color-error;
}

View file

@ -15,7 +15,7 @@
> .item {
color: $color-off-black;
margin: 10px 5px;
margin: 0px 5px;
padding: 0;
list-style-type: none;

View file

@ -33,13 +33,12 @@
list-style: none;
float: left;
cursor: pointer;
width: 100px;
height: 100px;
width: 400px;
height: 80px;
background-color: $color-white;
border: 1px solid $color-border2;
border-radius: 3px;
margin: 0 30px 30px 0;
font-weight: bold;
&:hover {
@extend .z-depth-half;
@ -48,30 +47,48 @@
transition: 0.2s all ease;
}
> .material-icons {
> .img {
text-align: center;
margin: 20px 0 0 31px;
font-size: 2.5rem;
color: $color-stroke;
margin: 17px 10px 0 20px;
display: inline-block;
height: 45px;
width: 45px;
}
> .img {
height: 30px;
width: 30px;
text-align: center;
margin: 23px 0 6px 33px;
}
> .details {
vertical-align: top;
display: inline-block;
> .title {
font-size: 1rem;
font-weight: bold;
color: $color-off-black;
margin-top: 18px;
letter-spacing: 0.5px;
.preview {
font-size: 0.7rem;
color: #cc9933;
display: inline-block;
margin-left: 10px;
}
}
> .desc {
color: $color-stroke;
text-align: center;
font-size: 0.8rem;
margin-top: 5px;
max-width: 300px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
}
}
> .selected {
border-color: $color-link;
background-color: $color-card-active;
border: 1px dotted $color-link;
}
}
}

View file

@ -1,5 +1,7 @@
.wysiwyg {
font-size: 1rem;
// font-size: 1rem;
font-size: 15px;
line-height: 30px;
table
{

View file

@ -28,7 +28,7 @@
width: 100%;
border: none;
border-bottom: 1px solid $color-input;
height: 2rem;
height: 2.3rem;
outline: none;
&:focus {
@ -53,7 +53,7 @@
padding: 5px;
border: 1px solid $color-input;
border-radius: 2px;
height: 2rem;
height: 2.3rem;
font-size: 1rem;
display: inline-block;
@ -186,3 +186,13 @@
.form-divider {
margin-top: 30px;
}
.widget-checkbox {
color: $color-link;
cursor: pointer;
}
.checkbox-gray {
color: $color-gray !important;
}

View file

@ -17,15 +17,26 @@
<div class="canvas">
<ul class="list">
{{#each sections as |section|}}
<li title="{{section.description}}" class="item {{if section.selected "selected"}}" {{action 'setOption' section.id}}>
{{#if section.hasImage}}
<img class="img" src="{{section.iconFile}}" />
{{else}}
<i class="material-icons">{{section.iconFont}}</i>
<li class="item {{if section.selected "selected"}}" {{action 'setOption' section.id}}>
<img class="img" src="/sections/{{section.contentType}}.png" srcset="/sections/{{section.contentType}}@2x.png" />
<div class="details">
<div class='title'>
{{section.title}}
{{#if section.preview}}
<div class="preview">coming soon</div>
{{/if}}
<div class='title'>{{section.title}}</div>
</div>
<div class='desc'>{{section.description}}</div>
</div>
</li>
{{/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>
</div>
</div>

View file

@ -47,17 +47,17 @@
<div class="input-control">
<label>Gemini URL</label>
<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 class="input-control">
<label>Username</label>
<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 class="input-control">
<label>API Key</label>
<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 class="regular-button button-blue" {{ action 'auth' }}>Authenticate</div>
</form>

View 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}}

View file

@ -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}}}

View file

@ -1,4 +1,4 @@
<select {{action 'change' on='change'}} class={{csslass}}>
<select {{action 'change' on='change'}} class={{csslass}} readonly={{readonly}}>
{{#if prompt}}
<option disabled selected={{is-not selection}}>
{{prompt}}

View file

@ -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 default {
FolderType: {
Public: 1,

View file

@ -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"
function toShortDate(date) {
return moment(new Date(date)).format('YYYY/MM/DD');

View file

@ -1,7 +1,107 @@
// 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
//*************************************
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 {
Base64

View file

@ -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) {
var interv = function(w, t) {
return function() {
if(typeof t === "undefined" || t-- > 0) {
if (typeof t === "undefined" || t-- > 0) {
setTimeout(interv, w);
try {
func.call(null);
}
catch(e) {
} catch (e) {
t = 0;
throw e.toString();
}

View file

@ -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 stringUtil from '../utils/string';
import config from '../config/environment';
@ -25,7 +36,7 @@ let AppMeta = BaseModel.extend({
init() {
this.set('host', config.apiHost);
this.set('namespace', config.apiNamespace);
this.set('url', [config.host, config.namespace, ""].join('/'));
this.set('url', [config.apiHost, config.apiNamespace, ""].join('/'));
},
getUrl(endpoint) {

View file

@ -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() {
if (is.ipv4(window.location.host)) {
return "";

View file

@ -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.
function makeSlug(text) {
return text.toLowerCase().replace(/[^\w ]+/g,'').replace(/ +/g,'-');
return text.toLowerCase().replace(/[^\w ]+/g, '').replace(/ +/g, '-');
}
function makeId(len) {
var text = "";
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));
}

View file

@ -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 */
module.exports = function(environment) {
@ -9,6 +20,7 @@ module.exports = function(environment) {
baseURL: '/',
apiHost: '',
apiNamespace: '',
contentSecurityPolicyHeader: 'Content-Security-Policy-Report-Only',
EmberENV: {
FEATURES: {}
@ -21,7 +33,7 @@ module.exports = function(environment) {
ENV.APP.LOG_TRANSITIONS_INTERNAL = true;
ENV.apiHost = "https://localhost:5001";
// ENV.apiHost = "https://demo1.dev:5001";
ENV.apiHost = "https://demo1.dev:5001";
}
if (environment === 'test') {
@ -37,7 +49,8 @@ module.exports = function(environment) {
// ENV.locationType = 'none';
// 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') {
@ -51,6 +64,7 @@ module.exports = function(environment) {
}
ENV.apiNamespace = "api";
ENV.contentSecurityPolicy = null;
// ENV.contentSecurityPolicy = {
// 'img-src': "'self' data: self https://js.intercomcdn.com",
@ -61,14 +75,14 @@ module.exports = function(environment) {
// '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;
};
// 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"
// },

View file

@ -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 */
var EmberApp = require('ember-cli/lib/broccoli/ember-app');
var isDevelopment = EmberApp.env() === 'development';
@ -44,6 +55,7 @@ module.exports = function(defaults) {
app.import('vendor/tether.js');
app.import('vendor/drop.js');
app.import('vendor/tooltip.js');
app.import('vendor/markdown-it.min.js');
return app.toTree();
};

Some files were not shown because too many files have changed in this diff Show more