1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-08-05 05:25:27 +02:00

moved emberjs to gui folder

This commit is contained in:
Harvey Kandola 2017-07-19 14:48:33 +01:00
parent 6a18d18f91
commit dc49dbbeff
999 changed files with 677 additions and 651 deletions

View file

@ -0,0 +1,112 @@
// 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) {
case "7z":
case "7zip":
case "zipx":
case "zip":
case "war":
case "rar":
case "tar":
case "gzip":
html = "zip.png";
break;
case "avi":
case "mov":
case "mp4":
html = "avi.png";
break;
case "html":
html = "html.png";
break;
case "css":
html = "css.png";
break;
case "bat":
case "sh":
case "ps":
case "ps1":
case "cs":
case "vb":
case "php":
case "java":
case "go":
case "js":
case "rb":
case "py":
case "json":
case "config":
case "xml":
html = "code.png";
break;
case "bin":
case "exe":
case "dll":
html = "bin.png";
break;
case "bmp":
case "jpg":
case "jpeg":
case "gif":
case "tiff":
case "svg":
case "png":
case "psd":
case "ai":
case "sketch":
html = "image.png";
break;
case "xls":
case "xlsx":
case "csv":
html = "xls.png";
break;
case "log":
case "txt":
case "md":
case "markdown":
html = "txt.png";
break;
case "mp3":
case "wav":
html = "mp3.png";
break;
case "pdf":
html = "pdf.png";
break;
case "ppt":
case "pptx":
html = "ppt.png";
break;
case "vsd":
case "vsdx":
html = "vsd.png";
break;
case "doc":
case "docx":
html = "doc.png";
break;
case "xslt":
}
return new Ember.String.htmlSafe(html);
}
export default Ember.Helper.helper(documentFileIcon);

View file

@ -0,0 +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
import Ember from 'ember';
import dateUtil from '../utils/date';
export function formattedDate(params) {
return dateUtil.toIsoDate(params[0], params[1]);
}
export default Ember.Helper.helper(formattedDate);

View file

@ -0,0 +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
import Ember from 'ember';
// Usage: {{generate-id 'admin-' 123}}
export default Ember.Helper.helper(function(params) {
let prefix = params[0];
let id = params[1];
return prefix + "-" + id;
});

View file

@ -0,0 +1,17 @@
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
//
// This software (Documize Community Edition) is licensed under
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
//
// You can operate outside the AGPL restrictions by purchasing
// Documize Enterprise Edition and obtaining a commercial license
// by contacting <sales@documize.com>.
//
// https://documize.com
import Ember from 'ember';
// Usage: {{is-equal item selection}}
export default Ember.Helper.helper(function([leftSide, rightSide]) {
return leftSide === rightSide;
});

17
gui/app/helpers/is-not.js Normal file
View file

@ -0,0 +1,17 @@
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
//
// This software (Documize Community Edition) is licensed under
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
//
// You can operate outside the AGPL restrictions by purchasing
// Documize Enterprise Edition and obtaining a commercial license
// by contacting <sales@documize.com>.
//
// https://documize.com
import Ember from 'ember';
// Usage: {{is-not selection}}
export default Ember.Helper.helper(function([value]) {
return !value;
});

View file

@ -0,0 +1,16 @@
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
//
// This software (Documize Community Edition) is licensed under
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
//
// You can operate outside the AGPL restrictions by purchasing
// Documize Enterprise Edition and obtaining a commercial license
// by contacting <sales@documize.com>.
//
// https://documize.com
import Ember from 'ember';
export default Ember.Helper.helper(function([object, path]) {
return Ember.get(object, path);
});

View file

@ -0,0 +1,26 @@
// 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';
// {{time-ago createdAt}}
export function timeAgo(params) {
let d = dateUtil.timeAgo(params[0]);
if (d === 'Invalid date'){
d = '';
}
return d;
}
export default Ember.Helper.helper(timeAgo);

View file

@ -0,0 +1,29 @@
// 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}}
export function userInitials(params) {
let firstname = params[0];
let lastname = params[1];
if (is.undefined(firstname)) {
firstname = " ";
}
if (is.undefined(lastname)) {
lastname = " ";
}
return (firstname.substring(0, 1) + lastname.substring(0, 1)).toUpperCase();
}
export default Ember.Helper.helper(userInitials);