diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2018-10-15 10:58:31 +0200 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2018-10-16 09:51:36 +0200 |
commit | 0a4a23f015f1b899739e4b1d852a13fea274e4ad (patch) | |
tree | 18863149b201384f13bea9441bd47ba9c0148704 /core | |
parent | ad66b0f9ab010ee00d249d6f8512d30332e8a0af (diff) | |
download | nextcloud-server-0a4a23f015f1b899739e4b1d852a13fea274e4ad.tar.gz nextcloud-server-0a4a23f015f1b899739e4b1d852a13fea274e4ad.zip |
Move jquery.contactsmenu.js to compiled handlebars
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'core')
-rw-r--r-- | core/js/contactsmenu/jquery_entry.handlebars | 6 | ||||
-rw-r--r-- | core/js/contactsmenu_templates.js | 17 | ||||
-rw-r--r-- | core/js/jquery.contactsmenu.js | 11 |
3 files changed, 25 insertions, 9 deletions
diff --git a/core/js/contactsmenu/jquery_entry.handlebars b/core/js/contactsmenu/jquery_entry.handlebars new file mode 100644 index 00000000000..cbd97056e5c --- /dev/null +++ b/core/js/contactsmenu/jquery_entry.handlebars @@ -0,0 +1,6 @@ +<li> + <a href="{{hyperlink}}"> + {{#if icon}}<img src="{{icon}}">{{/if}} + <span>{{title}}</span> + </a> +</li> diff --git a/core/js/contactsmenu_templates.js b/core/js/contactsmenu_templates.js index 973d93a74f0..af96a133ece 100644 --- a/core/js/contactsmenu_templates.js +++ b/core/js/contactsmenu_templates.js @@ -74,6 +74,23 @@ templates['error'] = template({"compiler":[7,">= 4.0.0"],"main":function(contain + container.escapeExpression(((helper = (helper = helpers.couldNotLoadText || (depth0 != null ? depth0.couldNotLoadText : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"couldNotLoadText","hash":{},"data":data}) : helper))) + "</h2>\n</div>\n"; },"useData":true}); +templates['jquery_entry'] = template({"1":function(container,depth0,helpers,partials,data) { + var helper; + + return "<img src=\"" + + container.escapeExpression(((helper = (helper = helpers.icon || (depth0 != null ? depth0.icon : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"icon","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 "<li>\n <a href=\"" + + alias4(((helper = (helper = helpers.hyperlink || (depth0 != null ? depth0.hyperlink : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"hyperlink","hash":{},"data":data}) : helper))) + + "\">\n " + + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.icon : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") + + "\n <span>" + + alias4(((helper = (helper = helpers.title || (depth0 != null ? depth0.title : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"title","hash":{},"data":data}) : helper))) + + "</span>\n </a>\n</li>\n"; +},"useData":true}); templates['list'] = template({"1":function(container,depth0,helpers,partials,data) { var helper; diff --git a/core/js/jquery.contactsmenu.js b/core/js/jquery.contactsmenu.js index e3f24dfff52..4b443d5e3b3 100644 --- a/core/js/jquery.contactsmenu.js +++ b/core/js/jquery.contactsmenu.js @@ -6,13 +6,6 @@ */ (function ($) { - var ENTRY = '' - + '<li>' - + ' <a href="{{hyperlink}}">' - + ' {{#if icon}}<img src="{{icon}}">{{/if}}' - + ' <span>{{title}}</span>' - + ' </a>' - + '</li>'; var LIST = '' + '<div class="menu popovermenu menu-left hidden contactsmenu-popover">' @@ -71,7 +64,7 @@ } actions.forEach(function(action) { - var template = Handlebars.compile(ENTRY); + var template = OC.ContactsMenu.Templates['jquery_entry']; $list.find('ul').append(template(action)); }); @@ -88,7 +81,7 @@ title = t('core', 'Error fetching contact actions'); } - var template = Handlebars.compile(ENTRY); + var template = OC.ContactsMenu.Templates['jquery_entry']; $list.find('ul').append(template({ hyperlink: '#', title: title |