diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js index 4fcb290ca8..5af558d77b 100644 --- a/apps/files/js/fileactions.js +++ b/apps/files/js/fileactions.js @@ -10,17 +10,6 @@ (function() { - var TEMPLATE_FILE_ACTION_TRIGGER = - '' + - '{{#if icon}}' + - '{{altText}}' + - '{{else}}' + - '{{#if iconClass}}{{/if}}' + - '{{#unless hasDisplayName}}{{altText}}{{/unless}}' + - '{{/if}}' + - '{{#if displayName}} {{displayName}}{{/if}}' + - ''; - /** * Construct a new FileActions instance * @constructs FileActions @@ -335,11 +324,7 @@ * @param {Object} params action params */ _makeActionLink: function(params) { - if (!this._fileActionTriggerTemplate) { - this._fileActionTriggerTemplate = Handlebars.compile(TEMPLATE_FILE_ACTION_TRIGGER); - } - - return $(this._fileActionTriggerTemplate(params)); + return $(OCA.Files.Templates['file_action_trigger'](params)); }, /** diff --git a/apps/files/js/templates.js b/apps/files/js/templates.js index 4cbd326bac..ac36f0098a 100644 --- a/apps/files/js/templates.js +++ b/apps/files/js/templates.js @@ -37,6 +37,50 @@ templates['favorite_mark'] = template({"1":function(container,depth0,helpers,par + alias4(((helper = (helper = helpers.altText || (depth0 != null ? depth0.altText : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"altText","hash":{},"data":data}) : helper))) + "\n\n"; },"useData":true}); +templates['file_action_trigger'] = 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"; +},"3":function(container,depth0,helpers,partials,data) { + var stack1, alias1=depth0 != null ? depth0 : (container.nullContext || {}); + + return ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.iconClass : depth0),{"name":"if","hash":{},"fn":container.program(4, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") + + ((stack1 = helpers.unless.call(alias1,(depth0 != null ? depth0.hasDisplayName : depth0),{"name":"unless","hash":{},"fn":container.program(6, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : ""); +},"4":function(container,depth0,helpers,partials,data) { + var helper; + + return " \n"; +},"6":function(container,depth0,helpers,partials,data) { + var helper; + + return " " + + container.escapeExpression(((helper = (helper = helpers.altText || (depth0 != null ? depth0.altText : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"altText","hash":{},"data":data}) : helper))) + + "\n"; +},"8":function(container,depth0,helpers,partials,data) { + var helper; + + return " " + + container.escapeExpression(((helper = (helper = helpers.displayName || (depth0 != null ? depth0.displayName : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"displayName","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" + + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.icon : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.program(3, data, 0),"data":data})) != null ? stack1 : "") + + " " + + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.displayName : depth0),{"name":"if","hash":{},"fn":container.program(8, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") + + "\n\n"; +},"useData":true}); templates['filemultiselectmenu'] = 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; 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 0000000000..d7112ee2b2 --- /dev/null +++ b/apps/files/js/templates/file_action_trigger.handlebars @@ -0,0 +1,13 @@ + + {{#if icon}} + {{altText}} + {{else}} + {{#if iconClass}} + + {{/if}} + {{#unless hasDisplayName}} + {{altText}} + {{/unless}} + {{/if}} + {{#if displayName}} {{displayName}}{{/if}} +