From 48d1fe01169f9437bfe762852023e666641f029f Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Mon, 1 Oct 2018 18:50:09 +0200 Subject: Move filelist to compiled handlebars Signed-off-by: Roeland Jago Douma --- apps/files/js/filelist.js | 10 +--------- apps/files/js/templates.js | 9 +++++++++ apps/files/js/templates/template_addbutton.handlebars | 4 ++++ 3 files changed, 14 insertions(+), 9 deletions(-) create mode 100644 apps/files/js/templates/template_addbutton.handlebars (limited to 'apps') diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index c6e603e0c94..ab3607e3db9 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -10,11 +10,6 @@ (function() { - var TEMPLATE_ADDBUTTON = '' + - '' + - '{{addText}}' + - ''; - /** * @class OCA.Files.FileList * @classdesc @@ -3295,10 +3290,7 @@ if (!$actionsContainer.length || this.$el.find('.button.upload').length) { return; } - if (!this._addButtonTemplate) { - this._addButtonTemplate = Handlebars.compile(TEMPLATE_ADDBUTTON); - } - var $newButton = $(this._addButtonTemplate({ + var $newButton = $(OCA.Files.Templates['template_addbutton']({ addText: t('files', 'New'), iconClass: 'icon-add' })); diff --git a/apps/files/js/templates.js b/apps/files/js/templates.js index 8ada62b6d60..9e93d5b5ac3 100644 --- a/apps/files/js/templates.js +++ b/apps/files/js/templates.js @@ -36,4 +36,13 @@ templates['filesummary'] = template({"compiler":[7,">= 4.0.0"],"main":function(c + container.escapeExpression(((helper = (helper = helpers.connectorLabel || (depth0 != null ? depth0.connectorLabel : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"connectorLabel","hash":{},"data":data}) : helper))) + "\n \n \n \n\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/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}} + -- cgit v1.2.3