diff --git a/apps/comments/js/commentstabview.js b/apps/comments/js/commentstabview.js
index 28382c8b67e..35e73d3f4a6 100644
--- a/apps/comments/js/commentstabview.js
+++ b/apps/comments/js/commentstabview.js
@@ -11,49 +11,6 @@
/* global Handlebars, escapeHTML */
(function(OC, OCA) {
- var TEMPLATE =
- '
' +
- '
\n\n
\n
\n"
+ + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.hasFavoriteAction : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ + " "
+ + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.hasSize : depth0),{"name":"if","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ + ""
+ + alias4(((helper = (helper = helpers.date || (depth0 != null ? depth0.date : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"date","hash":{},"data":data}) : helper)))
+ + " \n
\n
\n\n \n
\n";
+},"useData":true});
+templates['newfilemenu'] = template({"1":function(container,depth0,helpers,partials,data) {
+ var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+ return " \n \n \n";
+},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
+ var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+ return "\n \n \n \n"
+ + ((stack1 = helpers.each.call(alias1,(depth0 != null ? depth0.items : depth0),{"name":"each","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ + " \n";
+},"useData":true});
+templates['newfilemenu_filename_form'] = template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
+ var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+ return "\n";
+},"useData":true});
+templates['template_addbutton'] = template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
+ var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+ return "\n \n "
+ + alias4(((helper = (helper = helpers.addText || (depth0 != null ? depth0.addText : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"addText","hash":{},"data":data}) : helper)))
+ + " \n \n";
+},"useData":true});
})();
\ No newline at end of file
diff --git a/apps/files/js/templates/detailsview.handlebars b/apps/files/js/templates/detailsview.handlebars
new file mode 100644
index 00000000000..841a8fe25fe
--- /dev/null
+++ b/apps/files/js/templates/detailsview.handlebars
@@ -0,0 +1,12 @@
+
+{{#if tabHeaders}}
+
+{{/if}}
+
+
{{closeLabel}}
diff --git a/apps/files/js/templates/favorite_mark.handlebars b/apps/files/js/templates/favorite_mark.handlebars
new file mode 100644
index 00000000000..7e0cb4385a8
--- /dev/null
+++ b/apps/files/js/templates/favorite_mark.handlebars
@@ -0,0 +1,4 @@
+
+
+ {{altText}}
+
diff --git a/apps/files/js/templates/file_action_trigger.handlebars b/apps/files/js/templates/file_action_trigger.handlebars
new file mode 100644
index 00000000000..d7112ee2b2f
--- /dev/null
+++ b/apps/files/js/templates/file_action_trigger.handlebars
@@ -0,0 +1,13 @@
+
+ {{#if icon}}
+
+ {{else}}
+ {{#if iconClass}}
+
+ {{/if}}
+ {{#unless hasDisplayName}}
+ {{altText}}
+ {{/unless}}
+ {{/if}}
+ {{#if displayName}} {{displayName}} {{/if}}
+
diff --git a/apps/files/js/templates/mainfileinfodetailsview.handlebars b/apps/files/js/templates/mainfileinfodetailsview.handlebars
new file mode 100644
index 00000000000..02a4cdb6416
--- /dev/null
+++ b/apps/files/js/templates/mainfileinfodetailsview.handlebars
@@ -0,0 +1,21 @@
+
+
+
+
+ {{#if hasFavoriteAction}}
+
+
+
+ {{/if}}
+ {{#if hasSize}}
{{size}} , {{/if}}
{{date}}
+
+
+
+
+
diff --git a/apps/files/js/templates/newfilemenu.handlebars b/apps/files/js/templates/newfilemenu.handlebars
new file mode 100644
index 00000000000..0d9ad9682ca
--- /dev/null
+++ b/apps/files/js/templates/newfilemenu.handlebars
@@ -0,0 +1,10 @@
+
+
+
+
+ {{#each items}}
+
+
+
+ {{/each}}
+
diff --git a/apps/files/js/templates/newfilemenu_filename_form.handlebars b/apps/files/js/templates/newfilemenu_filename_form.handlebars
new file mode 100644
index 00000000000..cf18b28cad2
--- /dev/null
+++ b/apps/files/js/templates/newfilemenu_filename_form.handlebars
@@ -0,0 +1,4 @@
+
diff --git a/apps/files/js/templates/template_addbutton.handlebars b/apps/files/js/templates/template_addbutton.handlebars
new file mode 100644
index 00000000000..62a022715a9
--- /dev/null
+++ b/apps/files/js/templates/template_addbutton.handlebars
@@ -0,0 +1,4 @@
+
+
+ {{addText}}
+
diff --git a/apps/files_sharing/js/sharetabview.js b/apps/files_sharing/js/sharetabview.js
index 7bb1f1229d0..fc7f2c5f045 100644
--- a/apps/files_sharing/js/sharetabview.js
+++ b/apps/files_sharing/js/sharetabview.js
@@ -25,10 +25,7 @@
className: 'tab shareTabView',
template: function(params) {
- if (!this._template) {
- this._template = Handlebars.compile(TEMPLATE);
- }
- return this._template(params);
+ return TEMPLATE;
},
getLabel: function() {
diff --git a/apps/files_versions/js/merged.json b/apps/files_versions/js/merged.json
index 1a7fbad298b..67ee60b3851 100644
--- a/apps/files_versions/js/merged.json
+++ b/apps/files_versions/js/merged.json
@@ -1,5 +1,6 @@
[
"versionmodel.js",
+ "templates.js",
"versioncollection.js",
"versionstabview.js",
"filesplugin.js"
diff --git a/apps/files_versions/js/templates.js b/apps/files_versions/js/templates.js
new file mode 100644
index 00000000000..17293d763df
--- /dev/null
+++ b/apps/files_versions/js/templates.js
@@ -0,0 +1,54 @@
+(function() {
+ var template = Handlebars.template, templates = OCA.Versions.Templates = OCA.Versions.Templates || {};
+templates['item'] = template({"1":function(container,depth0,helpers,partials,data) {
+ var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+ return "
\n "
+ + alias4(((helper = (helper = helpers.humanReadableSize || (depth0 != null ? depth0.humanReadableSize : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"humanReadableSize","hash":{},"data":data}) : helper)))
+ + " \n
\n";
+},"3":function(container,depth0,helpers,partials,data) {
+ var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+ return "
\n";
+},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
+ var stack1, helper, options, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression, alias5=helpers.blockHelperMissing, buffer =
+ "
\n \n
\n
\n
\n
\n
\n";
+ stack1 = ((helper = (helper = helpers.hasDetails || (depth0 != null ? depth0.hasDetails : depth0)) != null ? helper : alias2),(options={"name":"hasDetails","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data}),(typeof helper === alias3 ? helper.call(alias1,options) : helper));
+ if (!helpers.hasDetails) { stack1 = alias5.call(depth0,stack1,options)}
+ if (stack1 != null) { buffer += stack1; }
+ buffer += "
\n";
+ stack1 = ((helper = (helper = helpers.canRevert || (depth0 != null ? depth0.canRevert : depth0)) != null ? helper : alias2),(options={"name":"canRevert","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data}),(typeof helper === alias3 ? helper.call(alias1,options) : helper));
+ if (!helpers.canRevert) { stack1 = alias5.call(depth0,stack1,options)}
+ if (stack1 != null) { buffer += stack1; }
+ return buffer + "
\n \n";
+},"useData":true});
+templates['template'] = template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
+ var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+ return "
\n
\n
\n
\n
\n
"
+ + alias4(((helper = (helper = helpers.emptyResultLabel || (depth0 != null ? depth0.emptyResultLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"emptyResultLabel","hash":{},"data":data}) : helper)))
+ + "
\n
\n
\n
\n
\n";
+},"useData":true});
+})();
\ No newline at end of file
diff --git a/apps/files_versions/js/templates/item.handlebars b/apps/files_versions/js/templates/item.handlebars
new file mode 100644
index 00000000000..6d11b9c0888
--- /dev/null
+++ b/apps/files_versions/js/templates/item.handlebars
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+ {{#hasDetails}}
+
+ {{humanReadableSize}}
+
+ {{/hasDetails}}
+
+ {{#canRevert}}
+
+ {{/canRevert}}
+
+
diff --git a/apps/files_versions/js/templates/template.handlebars b/apps/files_versions/js/templates/template.handlebars
new file mode 100644
index 00000000000..f01a6f41626
--- /dev/null
+++ b/apps/files_versions/js/templates/template.handlebars
@@ -0,0 +1,10 @@
+
+
+
+
+
+
{{emptyResultLabel}}
+
+
+
+
diff --git a/apps/files_versions/js/versionstabview.js b/apps/files_versions/js/versionstabview.js
index 3a9026901ea..dacd567fdc9 100644
--- a/apps/files_versions/js/versionstabview.js
+++ b/apps/files_versions/js/versionstabview.js
@@ -11,42 +11,6 @@
/* @global Handlebars */
(function() {
- var TEMPLATE_ITEM =
- '
' +
- '' +
- '
' +
- '
' +
- '
' +
- '
' +
- '
' +
- '{{#hasDetails}}' +
- '
' +
- '{{humanReadableSize}} ' +
- '
' +
- '{{/hasDetails}}' +
- '
' +
- '{{#canRevert}}' +
- '
' +
- '{{/canRevert}}' +
- '
' +
- ' ';
-
- var TEMPLATE =
- '
' +
- '
' +
- '
' +
- '
' +
- '
' +
- '
{{emptyResultLabel}}
' +
- '
' +
- '
' +
- '
';
-
/**
* @memberof OCA.Versions
*/
@@ -182,19 +146,11 @@
},
template: function(data) {
- if (!this._template) {
- this._template = Handlebars.compile(TEMPLATE);
- }
-
- return this._template(data);
+ return OCA.Versions.Templates['template'](data);
},
itemTemplate: function(data) {
- if (!this._itemTemplate) {
- this._itemTemplate = Handlebars.compile(TEMPLATE_ITEM);
- }
-
- return this._itemTemplate(data);
+ return OCA.Versions.Templates['item'](data);
},
setFileInfo: function(fileInfo) {
diff --git a/apps/systemtags/js/systemtagsinfoviewtoggleview.js b/apps/systemtags/js/systemtagsinfoviewtoggleview.js
index 13a48e49cfb..a3261e7994d 100644
--- a/apps/systemtags/js/systemtagsinfoviewtoggleview.js
+++ b/apps/systemtags/js/systemtagsinfoviewtoggleview.js
@@ -21,9 +21,6 @@
(function(OCA) {
- var TEMPLATE =
- '
' + t('systemtags', 'Tags');
-
/**
* @class OCA.SystemTags.SystemTagsInfoViewToggleView
* @classdesc
@@ -49,10 +46,7 @@
_systemTagsInfoView: null,
template: function(data) {
- if (!this._template) {
- this._template = Handlebars.compile(TEMPLATE);
- }
- return this._template(data);
+ return '
' + t('systemtags', 'Tags');
},
/**
diff --git a/build/compile-handlebars-templates.sh b/build/compile-handlebars-templates.sh
index 585406c4e8f..2f83dd3956a 100755
--- a/build/compile-handlebars-templates.sh
+++ b/build/compile-handlebars-templates.sh
@@ -10,9 +10,22 @@ handlebars -n OC.Settings.Templates settings/js/authtoken.handlebars -f setting
# Contactsmenu
handlebars -n OC.ContactsMenu.Templates core/js/contactsmenu -f core/js/contactsmenu_templates.js
+# Systemtags
+handlebars -n OC.SystemTags.Templates core/js/systemtags/templates -f core/js/systemtags/templates.js
+
+# Share
+handlebars -n OC.Share.Templates core/js/share -f core/js/sharetemplates.js
+
# Files app
handlebars -n OCA.Files.Templates apps/files/js/templates -f apps/files/js/templates.js
+# Comments app
+handlebars -n OCA.Comments.Templates apps/comments/js/templates -f apps/comments/js/templates.js
+
+# Versions app
+handlebars -n OCA.Versions.Templates apps/files_versions/js/templates -f apps/files_versions/js/templates.js
+
+
if [[ $(git diff --name-only) ]]; then
echo "Please submit your compiled handlebars templates"
echo
diff --git a/core/js/core.json b/core/js/core.json
index 19f361d2dfe..12249d4dbaf 100644
--- a/core/js/core.json
+++ b/core/js/core.json
@@ -33,6 +33,7 @@
"l10n.js",
"apps.js",
"share.js",
+ "sharetemplates.js",
"sharesocialmanager.js",
"shareconfigmodel.js",
"shareitemmodel.js",
@@ -58,6 +59,7 @@
"files/fileinfo.js",
"files/client.js",
"systemtags/systemtags.js",
+ "systemtags/templates.js",
"systemtags/systemtagmodel.js",
"systemtags/systemtagscollection.js",
"systemtags/systemtagsmappingcollection.js",
diff --git a/core/js/merged-share-backend.json b/core/js/merged-share-backend.json
index 63c3575a666..8d67d9309cd 100644
--- a/core/js/merged-share-backend.json
+++ b/core/js/merged-share-backend.json
@@ -1,5 +1,6 @@
[
"shareconfigmodel.js",
+ "sharetemplates.js",
"shareitemmodel.js",
"sharesocialmanager.js",
"sharedialogresharerinfoview.js",
diff --git a/core/js/share/sharedialoglinkshareview.handlebars b/core/js/share/sharedialoglinkshareview.handlebars
new file mode 100644
index 00000000000..e0787cc7d3b
--- /dev/null
+++ b/core/js/share/sharedialoglinkshareview.handlebars
@@ -0,0 +1,25 @@
+{{#if shareAllowed}}
+
+{{else}}
+{{#if noSharingPlaceholder}}
{{/if}}
+{{/if}}'
diff --git a/core/js/share/sharedialoglinkshareview_popover_menu.handlebars b/core/js/share/sharedialoglinkshareview_popover_menu.handlebars
new file mode 100644
index 00000000000..412ed8efca0
--- /dev/null
+++ b/core/js/share/sharedialoglinkshareview_popover_menu.handlebars
@@ -0,0 +1,96 @@
+
diff --git a/core/js/share/sharedialoglinkshareview_popover_menu_pending.handlebars b/core/js/share/sharedialoglinkshareview_popover_menu_pending.handlebars
new file mode 100644
index 00000000000..e39c082315b
--- /dev/null
+++ b/core/js/share/sharedialoglinkshareview_popover_menu_pending.handlebars
@@ -0,0 +1,14 @@
+
diff --git a/core/js/share/sharedialogresharerinfoview.handlebars b/core/js/share/sharedialogresharerinfoview.handlebars
new file mode 100644
index 00000000000..e2cfa13da96
--- /dev/null
+++ b/core/js/share/sharedialogresharerinfoview.handlebars
@@ -0,0 +1,5 @@
+
+
+ {{sharedByText}}
+ ' +
+{{#if hasShareNote}}
{{shareNote}}
{{/if}}
diff --git a/core/js/share/sharedialogshareelistview.handlebars b/core/js/share/sharedialogshareelistview.handlebars
new file mode 100644
index 00000000000..ba9aa6e510a
--- /dev/null
+++ b/core/js/share/sharedialogshareelistview.handlebars
@@ -0,0 +1,28 @@
+
diff --git a/core/js/share/sharedialogshareelistview_popover_menu.handlebars b/core/js/share/sharedialogshareelistview_popover_menu.handlebars
new file mode 100644
index 00000000000..c135d31b081
--- /dev/null
+++ b/core/js/share/sharedialogshareelistview_popover_menu.handlebars
@@ -0,0 +1,106 @@
+
diff --git a/core/js/share/sharedialogview.handlebars b/core/js/share/sharedialogview.handlebars
new file mode 100644
index 00000000000..d364be901ab
--- /dev/null
+++ b/core/js/share/sharedialogview.handlebars
@@ -0,0 +1,12 @@
+
+{{#if isSharingAllowed}}
+
{{shareLabel}}
+
+
+ '+
+
+
+{{/if}}
+
+
+
';
diff --git a/core/js/sharedialoglinkshareview.js b/core/js/sharedialoglinkshareview.js
index 9cd48aaf9a7..995ff480aa6 100644
--- a/core/js/sharedialoglinkshareview.js
+++ b/core/js/sharedialoglinkshareview.js
@@ -19,138 +19,6 @@
var PASSWORD_PLACEHOLDER_MESSAGE = t('core', 'Choose a password for the public link');
var PASSWORD_PLACEHOLDER_MESSAGE_OPTIONAL = t('core', 'Choose a password for the public link or press the "Enter" key');
- var TEMPLATE =
- '{{#if shareAllowed}}' +
- '
' +
- '{{else}}' +
- // FIXME: this doesn't belong in this view
- '{{#if noSharingPlaceholder}}
{{/if}}' +
- '{{/if}}'
- ;
- var TEMPLATE_POPOVER_MENU =
- '';
-
- // popovermenu waiting for password or expiration date before saving the share
- var TEMPLATE_POPOVER_MENU_PENDING =
- '';
-
/**
* @class OCA.Share.ShareDialogLinkShareView
* @member {OC.Share.ShareItemModel} model
@@ -168,15 +36,6 @@
/** @type {OC.Share.ShareConfigModel} **/
configModel: undefined,
- /** @type {Function} **/
- _template: undefined,
-
- /** @type {Function} **/
- _popoverMenuTemplate: undefined,
-
- /** @type {Function} **/
- _pendingPopoverMenuTemplate: undefined,
-
/** @type {boolean} **/
showLink: true,
@@ -684,10 +543,7 @@
* @private
*/
template: function () {
- if (!this._template) {
- this._template = Handlebars.compile(TEMPLATE);
- }
- return this._template;
+ return OC.Share.Templates['sharedialoglinkshareview'];
},
/**
@@ -697,10 +553,7 @@
* @returns {string}
*/
popoverMenuTemplate: function(data) {
- if(!this._popoverMenuTemplate) {
- this._popoverMenuTemplate = Handlebars.compile(TEMPLATE_POPOVER_MENU);
- }
- return this._popoverMenuTemplate(data);
+ return OC.Share.Templates['sharedialoglinkshareview_popover_menu'](data);
},
/**
@@ -710,10 +563,7 @@
* @returns {string}
*/
pendingPopoverMenuTemplate: function(data) {
- if(!this._pendingPopoverMenuTemplate) {
- this._pendingPopoverMenuTemplate = Handlebars.compile(TEMPLATE_POPOVER_MENU_PENDING);
- }
- return this._pendingPopoverMenuTemplate(data);
+ return OC.Share.Templates['sharedialoglinkshareview_popover_menu_pending'](data);
},
onPopUpClick: function(event) {
diff --git a/core/js/sharedialogresharerinfoview.js b/core/js/sharedialogresharerinfoview.js
index b2d5a093990..f55f2bcc527 100644
--- a/core/js/sharedialogresharerinfoview.js
+++ b/core/js/sharedialogresharerinfoview.js
@@ -15,14 +15,6 @@
OC.Share = {};
}
- var TEMPLATE =
- '
' +
- '
' +
- ' {{sharedByText}}' +
- ' ' +
- '{{#if hasShareNote}}
{{shareNote}}
{{/if}}'
- ;
-
/**
* @class OCA.Share.ShareDialogView
* @member {OC.Share.ShareItemModel} model
@@ -159,10 +151,7 @@
* @private
*/
template: function () {
- if (!this._template) {
- this._template = Handlebars.compile(TEMPLATE);
- }
- return this._template;
+ return OC.Share.Templates['sharedialogresharerinfoview'];
}
});
diff --git a/core/js/sharedialogshareelistview.js b/core/js/sharedialogshareelistview.js
index 2627d5fa662..39e79f19eb1 100644
--- a/core/js/sharedialogshareelistview.js
+++ b/core/js/sharedialogshareelistview.js
@@ -21,146 +21,6 @@
OC.Share = {};
}
- var TEMPLATE =
- '
'
- ;
-
- var TEMPLATE_POPOVER_MENU =
- '';
-
/**
* @class OCA.Share.ShareDialogShareeListView
* @member {OC.Share.ShareItemModel} model
@@ -178,12 +38,6 @@
/** @type {OC.Share.ShareConfigModel} **/
configModel: undefined,
- /** @type {Function} **/
- _template: undefined,
-
- /** @type {Function} **/
- _popoverMenuTemplate: undefined,
-
_menuOpen: false,
/** @type {boolean|number} **/
@@ -503,16 +357,13 @@
* @private
*/
template: function (data) {
- if (!this._template) {
- this._template = Handlebars.compile(TEMPLATE);
- }
var sharees = data.sharees;
if(_.isArray(sharees)) {
for (var i = 0; i < sharees.length; i++) {
data.sharees[i].popoverMenu = this.popoverMenuTemplate(sharees[i]);
}
}
- return this._template(data);
+ return OC.Share.Templates['sharedialogshareelistview'](data);
},
/**
@@ -522,10 +373,7 @@
* @returns {string}
*/
popoverMenuTemplate: function(data) {
- if(!this._popoverMenuTemplate) {
- this._popoverMenuTemplate = Handlebars.compile(TEMPLATE_POPOVER_MENU);
- }
- return this._popoverMenuTemplate(data);
+ return OC.Share.Templates['sharedialogshareelistview_popover_menu'](data);
},
showNoteForm: function(event) {
diff --git a/core/js/sharedialogview.js b/core/js/sharedialogview.js
index f5b876c37be..9c648357e61 100644
--- a/core/js/sharedialogview.js
+++ b/core/js/sharedialogview.js
@@ -15,20 +15,6 @@
OC.Share = {};
}
- var TEMPLATE_BASE =
- '
' +
- '{{#if isSharingAllowed}}' +
- '
{{shareLabel}} ' +
- '
' +
- ' ' +
- ' '+
- ' ' +
- '
' +
- '{{/if}}' +
- '
' +
- '
' +
- '
';
-
/**
* @class OCA.Share.ShareDialogView
* @member {OC.Share.ShareItemModel} model
@@ -663,7 +649,7 @@
render: function() {
var self = this;
- var baseTemplate = this._getTemplate('base', TEMPLATE_BASE);
+ var baseTemplate = OC.Share.Templates['sharedialogview'];
this.$el.html(baseTemplate({
cid: this.cid,
@@ -739,20 +725,6 @@
return t('core', 'Name...');
},
- /**
- *
- * @param {string} key - an identifier for the template
- * @param {string} template - the HTML to be compiled by Handlebars
- * @returns {Function} from Handlebars
- * @private
- */
- _getTemplate: function (key, template) {
- if (!this._templates[key]) {
- this._templates[key] = Handlebars.compile(template);
- }
- return this._templates[key];
- },
-
});
OC.Share.ShareDialogView = ShareDialogView;
diff --git a/core/js/sharetemplates.js b/core/js/sharetemplates.js
new file mode 100644
index 00000000000..94700e1a06c
--- /dev/null
+++ b/core/js/sharetemplates.js
@@ -0,0 +1,629 @@
+(function() {
+ var template = Handlebars.template, templates = OC.Share.Templates = OC.Share.Templates || {};
+templates['sharedialoglinkshareview'] = template({"1":function(container,depth0,helpers,partials,data) {
+ var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+ return "
\n \n
"
+ + alias4(((helper = (helper = helpers.linkShareLabel || (depth0 != null ? depth0.linkShareLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"linkShareLabel","hash":{},"data":data}) : helper)))
+ + " \n \n \n \n \n "
+ + alias4(((helper = (helper = helpers.linkShareEnableLabel || (depth0 != null ? depth0.linkShareEnableLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"linkShareEnableLabel","hash":{},"data":data}) : helper)))
+ + " \n \n"
+ + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.showMenu : depth0),{"name":"if","hash":{},"fn":container.program(4, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ + " \n \n \n";
+},"2":function(container,depth0,helpers,partials,data) {
+ return "checked=\"checked\"";
+},"4":function(container,depth0,helpers,partials,data) {
+ var stack1;
+
+ return " \n";
+},"5":function(container,depth0,helpers,partials,data) {
+ var stack1, helper;
+
+ return " "
+ + ((stack1 = ((helper = (helper = helpers.pendingPopoverMenu || (depth0 != null ? depth0.pendingPopoverMenu : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"pendingPopoverMenu","hash":{},"data":data}) : helper))) != null ? stack1 : "")
+ + "\n";
+},"7":function(container,depth0,helpers,partials,data) {
+ var stack1, helper;
+
+ return " "
+ + ((stack1 = ((helper = (helper = helpers.popoverMenu || (depth0 != null ? depth0.popoverMenu : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"popoverMenu","hash":{},"data":data}) : helper))) != null ? stack1 : "")
+ + "\n";
+},"9":function(container,depth0,helpers,partials,data) {
+ var stack1;
+
+ return ((stack1 = helpers["if"].call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.noSharingPlaceholder : depth0),{"name":"if","hash":{},"fn":container.program(10, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ + "\n";
+},"10":function(container,depth0,helpers,partials,data) {
+ var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+ return "
";
+},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
+ var stack1;
+
+ return ((stack1 = helpers["if"].call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.shareAllowed : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.program(9, data, 0),"data":data})) != null ? stack1 : "")
+ + "'\n";
+},"useData":true});
+templates['sharedialoglinkshareview_popover_menu'] = template({"1":function(container,depth0,helpers,partials,data) {
+ var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+ return "
\n \n \n \n "
+ + alias4(((helper = (helper = helpers.publicUploadRLabel || (depth0 != null ? depth0.publicUploadRLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"publicUploadRLabel","hash":{},"data":data}) : helper)))
+ + " \n \n \n
\n \n \n \n "
+ + alias4(((helper = (helper = helpers.publicUploadRWLabel || (depth0 != null ? depth0.publicUploadRWLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"publicUploadRWLabel","hash":{},"data":data}) : helper)))
+ + " \n \n
\n \n \n \n "
+ + alias4(((helper = (helper = helpers.publicUploadWLabel || (depth0 != null ? depth0.publicUploadWLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"publicUploadWLabel","hash":{},"data":data}) : helper)))
+ + " \n \n \n";
+},"3":function(container,depth0,helpers,partials,data) {
+ var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+ return "
\n \n \n \n "
+ + alias4(((helper = (helper = helpers.publicEditingLabel || (depth0 != null ? depth0.publicEditingLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"publicEditingLabel","hash":{},"data":data}) : helper)))
+ + " \n \n \n";
+},"5":function(container,depth0,helpers,partials,data) {
+ var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+ return "
\n \n \n "
+ + alias4(((helper = (helper = helpers.enablePasswordLabel || (depth0 != null ? depth0.enablePasswordLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"enablePasswordLabel","hash":{},"data":data}) : helper)))
+ + " \n \n \n
\n \n \n \n \n \n";
+},"6":function(container,depth0,helpers,partials,data) {
+ return "checked=\"checked\"";
+},"8":function(container,depth0,helpers,partials,data) {
+ return "disabled=\"disabled\"";
+},"10":function(container,depth0,helpers,partials,data) {
+ return "hidden";
+},"12":function(container,depth0,helpers,partials,data) {
+ var helper;
+
+ return container.escapeExpression(((helper = (helper = helpers.expireDate || (depth0 != null ? depth0.expireDate : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"expireDate","hash":{},"data":data}) : helper)));
+},"14":function(container,depth0,helpers,partials,data) {
+ var helper;
+
+ return container.escapeExpression(((helper = (helper = helpers.defaultExpireDate || (depth0 != null ? depth0.defaultExpireDate : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"defaultExpireDate","hash":{},"data":data}) : helper)));
+},"16":function(container,depth0,helpers,partials,data) {
+ var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+ return "
\n \n \n "
+ + alias4(((helper = (helper = helpers.label || (depth0 != null ? depth0.label : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"label","hash":{},"data":data}) : helper)))
+ + " \n \n \n";
+},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
+ var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+ return "\n";
+},"useData":true});
+templates['sharedialoglinkshareview_popover_menu_pending'] = template({"1":function(container,depth0,helpers,partials,data) {
+ var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+ return "
\n \n "
+ + alias4(((helper = (helper = helpers.enablePasswordLabel || (depth0 != null ? depth0.enablePasswordLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"enablePasswordLabel","hash":{},"data":data}) : helper)))
+ + " \n \n \n";
+},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
+ var stack1;
+
+ return "\n";
+},"useData":true});
+templates['sharedialogresharerinfoview'] = template({"1":function(container,depth0,helpers,partials,data) {
+ var helper;
+
+ return "
"
+ + container.escapeExpression(((helper = (helper = helpers.shareNote || (depth0 != null ? depth0.shareNote : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"shareNote","hash":{},"data":data}) : helper)))
+ + "
";
+},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
+ var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+ return "
\n
\n "
+ + alias4(((helper = (helper = helpers.sharedByText || (depth0 != null ? depth0.sharedByText : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"sharedByText","hash":{},"data":data}) : helper)))
+ + "\n ' +\n"
+ + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.hasShareNote : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ + "\n";
+},"useData":true});
+templates['sharedialogshareelistview'] = template({"1":function(container,depth0,helpers,partials,data) {
+ var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+ return "
\n
\n "
+ + alias4(((helper = (helper = helpers.shareWithDisplayName || (depth0 != null ? depth0.shareWithDisplayName : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareWithDisplayName","hash":{},"data":data}) : helper)))
+ + " \n \n"
+ + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.editPermissionPossible : depth0),{"name":"if","hash":{},"fn":container.program(6, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ + " \n \n \n";
+},"2":function(container,depth0,helpers,partials,data) {
+ return "imageplaceholderseed";
+},"4":function(container,depth0,helpers,partials,data) {
+ var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+ return "data-seed=\""
+ + alias4(((helper = (helper = helpers.shareWith || (depth0 != null ? depth0.shareWith : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareWith","hash":{},"data":data}) : helper)))
+ + " "
+ + alias4(((helper = (helper = helpers.shareType || (depth0 != null ? depth0.shareType : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareType","hash":{},"data":data}) : helper)))
+ + "\"";
+},"6":function(container,depth0,helpers,partials,data) {
+ var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+ return "
\n \n "
+ + alias4(((helper = (helper = helpers.canEditLabel || (depth0 != null ? depth0.canEditLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"canEditLabel","hash":{},"data":data}) : helper)))
+ + " \n \n";
+},"8":function(container,depth0,helpers,partials,data) {
+ var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+ return "
\n
\n t('core', '"
+ + alias4(((helper = (helper = helpers.shareInitiatorDisplayName || (depth0 != null ? depth0.shareInitiatorDisplayName : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareInitiatorDisplayName","hash":{},"data":data}) : helper)))
+ + " shared via link') + ' \n \n "
+ + alias4(((helper = (helper = helpers.unshareLabel || (depth0 != null ? depth0.unshareLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"unshareLabel","hash":{},"data":data}) : helper)))
+ + " \n \n \n";
+},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
+ var stack1, alias1=depth0 != null ? depth0 : (container.nullContext || {});
+
+ return "
\n"
+ + ((stack1 = helpers.each.call(alias1,(depth0 != null ? depth0.sharees : depth0),{"name":"each","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ + ((stack1 = helpers.each.call(alias1,(depth0 != null ? depth0.linkReshares : depth0),{"name":"each","hash":{},"fn":container.program(8, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ + " \n";
+},"useData":true});
+templates['sharedialogshareelistview_popover_menu'] = template({"1":function(container,depth0,helpers,partials,data) {
+ var stack1;
+
+ return " "
+ + ((stack1 = helpers["if"].call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.sharePermissionPossible : depth0),{"name":"if","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ + " ";
+},"2":function(container,depth0,helpers,partials,data) {
+ var stack1;
+
+ return " "
+ + ((stack1 = helpers.unless.call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.isMailShare : depth0),{"name":"unless","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ + " ";
+},"3":function(container,depth0,helpers,partials,data) {
+ var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+ return "\n
\n \n \n "
+ + alias4(((helper = (helper = helpers.canShareLabel || (depth0 != null ? depth0.canShareLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"canShareLabel","hash":{},"data":data}) : helper)))
+ + " \n \n \n ";
+},"4":function(container,depth0,helpers,partials,data) {
+ return "checked=\"checked\"";
+},"6":function(container,depth0,helpers,partials,data) {
+ var stack1, alias1=depth0 != null ? depth0 : (container.nullContext || {});
+
+ return " "
+ + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.createPermissionPossible : depth0),{"name":"if","hash":{},"fn":container.program(7, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ + "\n "
+ + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.updatePermissionPossible : depth0),{"name":"if","hash":{},"fn":container.program(10, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ + "\n "
+ + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.deletePermissionPossible : depth0),{"name":"if","hash":{},"fn":container.program(13, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ + "\n";
+},"7":function(container,depth0,helpers,partials,data) {
+ var stack1;
+
+ return ((stack1 = helpers.unless.call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.isMailShare : depth0),{"name":"unless","hash":{},"fn":container.program(8, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "");
+},"8":function(container,depth0,helpers,partials,data) {
+ var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+ return "\n
\n \n \n "
+ + alias4(((helper = (helper = helpers.createPermissionLabel || (depth0 != null ? depth0.createPermissionLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"createPermissionLabel","hash":{},"data":data}) : helper)))
+ + " \n \n \n ";
+},"10":function(container,depth0,helpers,partials,data) {
+ var stack1;
+
+ return ((stack1 = helpers.unless.call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.isMailShare : depth0),{"name":"unless","hash":{},"fn":container.program(11, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "");
+},"11":function(container,depth0,helpers,partials,data) {
+ var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+ return "\n
\n \n \n "
+ + alias4(((helper = (helper = helpers.updatePermissionLabel || (depth0 != null ? depth0.updatePermissionLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"updatePermissionLabel","hash":{},"data":data}) : helper)))
+ + " \n \n \n ";
+},"13":function(container,depth0,helpers,partials,data) {
+ var stack1;
+
+ return ((stack1 = helpers.unless.call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.isMailShare : depth0),{"name":"unless","hash":{},"fn":container.program(14, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "");
+},"14":function(container,depth0,helpers,partials,data) {
+ var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+ return "\n
\n \n \n "
+ + alias4(((helper = (helper = helpers.deletePermissionLabel || (depth0 != null ? depth0.deletePermissionLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"deletePermissionLabel","hash":{},"data":data}) : helper)))
+ + " \n \n \n ";
+},"16":function(container,depth0,helpers,partials,data) {
+ var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+ return ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.hasCreatePermission : depth0),{"name":"if","hash":{},"fn":container.program(17, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ + "
\n \n \n "
+ + alias4(((helper = (helper = helpers.passwordLabel || (depth0 != null ? depth0.passwordLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"passwordLabel","hash":{},"data":data}) : helper)))
+ + " \n \n \n \n"
+ + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.isTalkEnabled : depth0),{"name":"if","hash":{},"fn":container.program(24, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "");
+},"17":function(container,depth0,helpers,partials,data) {
+ var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+ return "
\n \n \n "
+ + alias4(((helper = (helper = helpers.secureDropLabel || (depth0 != null ? depth0.secureDropLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"secureDropLabel","hash":{},"data":data}) : helper)))
+ + " \n \n \n";
+},"19":function(container,depth0,helpers,partials,data) {
+ var stack1;
+
+ return ((stack1 = helpers["if"].call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.isPasswordForMailSharesRequired : depth0),{"name":"if","hash":{},"fn":container.program(20, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "");
+},"20":function(container,depth0,helpers,partials,data) {
+ return "disabled=\"\"";
+},"22":function(container,depth0,helpers,partials,data) {
+ return "hidden";
+},"24":function(container,depth0,helpers,partials,data) {
+ var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+ return "
\n \n \n "
+ + alias4(((helper = (helper = helpers.passwordByTalkLabel || (depth0 != null ? depth0.passwordByTalkLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"passwordByTalkLabel","hash":{},"data":data}) : helper)))
+ + " \n \n \n \n";
+},"26":function(container,depth0,helpers,partials,data) {
+ var helper;
+
+ return container.escapeExpression(((helper = (helper = helpers.expireDate || (depth0 != null ? depth0.expireDate : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"expireDate","hash":{},"data":data}) : helper)));
+},"28":function(container,depth0,helpers,partials,data) {
+ var helper;
+
+ return container.escapeExpression(((helper = (helper = helpers.defaultExpireDate || (depth0 != null ? depth0.defaultExpireDate : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"defaultExpireDate","hash":{},"data":data}) : helper)));
+},"30":function(container,depth0,helpers,partials,data) {
+ var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+ return "
\n \n \n "
+ + alias4(((helper = (helper = helpers.addNoteLabel || (depth0 != null ? depth0.addNoteLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"addNoteLabel","hash":{},"data":data}) : helper)))
+ + " \n \n \n \n
\n \n \n";
+},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
+ var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+ return "\n";
+},"useData":true});
+templates['sharedialogview'] = template({"1":function(container,depth0,helpers,partials,data) {
+ var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+ return "
"
+ + alias4(((helper = (helper = helpers.shareLabel || (depth0 != null ? depth0.shareLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareLabel","hash":{},"data":data}) : helper)))
+ + " \n
\n \n '+\n \n
\n";
+},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
+ var stack1;
+
+ return "
\n"
+ + ((stack1 = helpers["if"].call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.isSharingAllowed : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ + "
\n
\n
';\n";
+},"useData":true});
+})();
\ No newline at end of file
diff --git a/core/js/systemtags/merged.json b/core/js/systemtags/merged.json
index 846ba967ed5..641858ee2ed 100644
--- a/core/js/systemtags/merged.json
+++ b/core/js/systemtags/merged.json
@@ -1,5 +1,6 @@
[
"systemtags.js",
+ "templates.js",
"systemtagmodel.js",
"systemtagsmappingcollection.js",
"systemtagscollection.js",
diff --git a/core/js/systemtags/systemtagsinputfield.js b/core/js/systemtags/systemtagsinputfield.js
index ba72d486204..82fd659c72e 100644
--- a/core/js/systemtags/systemtagsinputfield.js
+++ b/core/js/systemtags/systemtagsinputfield.js
@@ -11,39 +11,6 @@
/* global Handlebars */
(function(OC) {
- var TEMPLATE =
- '
';
-
- var RESULT_TEMPLATE =
- '
' +
- ' ' +
- '{{#if isAdmin}}' +
- ' {{{tagMarkup}}} ' +
- '{{else}}' +
- ' {{name}} ' +
- '{{/if}}' +
- '{{#allowActions}}' +
- ' ' +
- ' ' +
- ' ' +
- '{{/allowActions}}' +
- ' ';
-
- var SELECTION_TEMPLATE =
- '{{#if isAdmin}}' +
- '
{{{tagMarkup}}} ' +
- '{{else}}' +
- '
{{name}} ' +
- '{{/if}}';
-
- var RENAME_FORM_TEMPLATE =
- '
';
/**
* @class OC.SystemTags.SystemTagsInputField
@@ -64,10 +31,7 @@
className: 'systemTagsInputFieldContainer',
template: function(data) {
- if (!this._template) {
- this._template = Handlebars.compile(TEMPLATE);
- }
- return this._template(data);
+ return '
';
},
/**
@@ -141,12 +105,9 @@
var $item = $(ev.target).closest('.systemtags-item');
var tagId = $item.attr('data-id');
var tagModel = this.collection.get(tagId);
- if (!this._renameFormTemplate) {
- this._renameFormTemplate = Handlebars.compile(RENAME_FORM_TEMPLATE);
- }
var oldName = tagModel.get('name');
- var $renameForm = $(this._renameFormTemplate({
+ var $renameForm = $(OC.SystemTags.Templates['result_form']({
cid: this.cid,
name: oldName,
deleteTooltip: t('core', 'Delete'),
@@ -310,10 +271,7 @@
* @return {string} HTML markup
*/
_formatDropDownResult: function(data) {
- if (!this._resultTemplate) {
- this._resultTemplate = Handlebars.compile(RESULT_TEMPLATE);
- }
- return this._resultTemplate(_.extend({
+ return OC.SystemTags.Templates['result'](_.extend({
renameTooltip: t('core', 'Rename'),
allowActions: this._allowActions,
tagMarkup: this._isAdmin ? OC.SystemTags.getDescriptiveTag(data)[0].innerHTML : null,
@@ -328,10 +286,7 @@
* @return {string} HTML markup
*/
_formatSelection: function(data) {
- if (!this._selectionTemplate) {
- this._selectionTemplate = Handlebars.compile(SELECTION_TEMPLATE);
- }
- return this._selectionTemplate(_.extend({
+ return OC.SystemTags.Templates['selection'](_.extend({
tagMarkup: this._isAdmin ? OC.SystemTags.getDescriptiveTag(data)[0].innerHTML : null,
isAdmin: this._isAdmin
}, data));
diff --git a/core/js/systemtags/templates.js b/core/js/systemtags/templates.js
new file mode 100644
index 00000000000..0894d646829
--- /dev/null
+++ b/core/js/systemtags/templates.js
@@ -0,0 +1,74 @@
+(function() {
+ var template = Handlebars.template, templates = OC.SystemTags.Templates = OC.SystemTags.Templates || {};
+templates['result'] = template({"1":function(container,depth0,helpers,partials,data) {
+ return " new-item";
+},"3":function(container,depth0,helpers,partials,data) {
+ var stack1, helper;
+
+ return "
"
+ + ((stack1 = ((helper = (helper = helpers.tagMarkup || (depth0 != null ? depth0.tagMarkup : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"tagMarkup","hash":{},"data":data}) : helper))) != null ? stack1 : "")
+ + " \n";
+},"5":function(container,depth0,helpers,partials,data) {
+ var helper;
+
+ return "
"
+ + container.escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"name","hash":{},"data":data}) : helper)))
+ + " \n";
+},"7":function(container,depth0,helpers,partials,data) {
+ var helper;
+
+ return "
\n \n \n";
+},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
+ var stack1, helper, options, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", buffer =
+ "
\n \n"
+ + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.isAdmin : depth0),{"name":"if","hash":{},"fn":container.program(3, data, 0),"inverse":container.program(5, data, 0),"data":data})) != null ? stack1 : "");
+ stack1 = ((helper = (helper = helpers.allowActions || (depth0 != null ? depth0.allowActions : depth0)) != null ? helper : alias2),(options={"name":"allowActions","hash":{},"fn":container.program(7, data, 0),"inverse":container.noop,"data":data}),(typeof helper === alias3 ? helper.call(alias1,options) : helper));
+ if (!helpers.allowActions) { stack1 = helpers.blockHelperMissing.call(depth0,stack1,options)}
+ if (stack1 != null) { buffer += stack1; }
+ return buffer + " ';\n";
+},"useData":true});
+templates['result_form'] = template({"1":function(container,depth0,helpers,partials,data) {
+ var helper;
+
+ return "
\n";
+},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
+ var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+ return "
\n";
+},"useData":true});
+templates['selection'] = template({"1":function(container,depth0,helpers,partials,data) {
+ var stack1, helper;
+
+ return "
"
+ + ((stack1 = ((helper = (helper = helpers.tagMarkup || (depth0 != null ? depth0.tagMarkup : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"tagMarkup","hash":{},"data":data}) : helper))) != null ? stack1 : "")
+ + " \n";
+},"3":function(container,depth0,helpers,partials,data) {
+ var helper;
+
+ return "
"
+ + container.escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"name","hash":{},"data":data}) : helper)))
+ + " \n";
+},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
+ var stack1;
+
+ return ((stack1 = helpers["if"].call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.isAdmin : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.program(3, data, 0),"data":data})) != null ? stack1 : "");
+},"useData":true});
+})();
\ No newline at end of file
diff --git a/core/js/systemtags/templates/result.handlebars b/core/js/systemtags/templates/result.handlebars
new file mode 100644
index 00000000000..ce69c8a21ff
--- /dev/null
+++ b/core/js/systemtags/templates/result.handlebars
@@ -0,0 +1,13 @@
+
+
+ {{#if isAdmin}}
+ {{{tagMarkup}}}
+ {{else}}
+ {{name}}
+ {{/if}}
+ {{#allowActions}}
+
+
+
+ {{/allowActions}}
+ ';
diff --git a/core/js/systemtags/templates/result_form.handlebars b/core/js/systemtags/templates/result_form.handlebars
new file mode 100644
index 00000000000..28fe8c56fe2
--- /dev/null
+++ b/core/js/systemtags/templates/result_form.handlebars
@@ -0,0 +1,7 @@
+
diff --git a/core/js/systemtags/templates/selection.handlebars b/core/js/systemtags/templates/selection.handlebars
new file mode 100644
index 00000000000..b006b129748
--- /dev/null
+++ b/core/js/systemtags/templates/selection.handlebars
@@ -0,0 +1,5 @@
+{{#if isAdmin}}
+
{{{tagMarkup}}}
+{{else}}
+
{{name}}
+{{/if}}
diff --git a/tests/karma.config.js b/tests/karma.config.js
index 0fd9b7b8019..83392851163 100644
--- a/tests/karma.config.js
+++ b/tests/karma.config.js
@@ -77,6 +77,7 @@ module.exports = function(config) {
srcFiles: [
// need to enforce loading order...
'apps/files_versions/js/versionmodel.js',
+ 'apps/files_versions/js/templates.js',
'apps/files_versions/js/versioncollection.js',
'apps/files_versions/js/versionstabview.js'
],
@@ -87,6 +88,7 @@ module.exports = function(config) {
srcFiles: [
// need to enforce loading order...
'apps/comments/js/app.js',
+ 'apps/comments/js/templates.js',
'apps/comments/js/vendor/Caret.js/dist/jquery.caret.min.js',
'apps/comments/js/vendor/At.js/dist/js/jquery.atwho.min.js',
'apps/comments/js/commentmodel.js',