Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2018-10-15 22:23:19 +0300
committerGitHub <noreply@github.com>2018-10-15 22:23:19 +0300
commit3797b8e7e3b0417accd1b1bd11158ae81381643a (patch)
tree7d0be98ada50c47b2b4800a5a32e2122d39ef1d4
parent353fddfbb9f226666e351f78ea9ec33df15c318d (diff)
parentd65438f93151fe457d5bcabf6d2bc7df52f6793a (diff)
Merge pull request #11834 from nextcloud/csp/federationmenu
Compile federationscope menu handlebars template
-rwxr-xr-xbuild/compile-handlebars-templates.sh2
-rw-r--r--settings/js/federationscopemenu.js20
-rw-r--r--settings/js/templates.js33
-rw-r--r--settings/js/templates/authtoken.handlebars (renamed from settings/js/authtoken.handlebars)0
-rw-r--r--settings/js/templates/federationscopemenu.handlebars17
-rw-r--r--settings/templates/settings/personal/personal.info.php1
6 files changed, 53 insertions, 20 deletions
diff --git a/build/compile-handlebars-templates.sh b/build/compile-handlebars-templates.sh
index 1cbdbe4c832..52954333f6f 100755
--- a/build/compile-handlebars-templates.sh
+++ b/build/compile-handlebars-templates.sh
@@ -5,7 +5,7 @@ REPODIR=`git rev-parse --show-toplevel`
cd $REPODIR
# Settings
-handlebars -n OC.Settings.Templates settings/js/authtoken.handlebars -f settings/js/templates.js
+handlebars -n OC.Settings.Templates settings/js/templates -f settings/js/templates.js
# Contactsmenu
handlebars -n OC.ContactsMenu.Templates core/js/contactsmenu -f core/js/contactsmenu_templates.js
diff --git a/settings/js/federationscopemenu.js b/settings/js/federationscopemenu.js
index 92db261b8fd..e55b26198eb 100644
--- a/settings/js/federationscopemenu.js
+++ b/settings/js/federationscopemenu.js
@@ -11,22 +11,6 @@
/* global OC, Handlebars */
(function() {
- var TEMPLATE_MENU =
- '<ul>' +
- '{{#each items}}' +
- '<li>' +
- '<a href="#" class="menuitem action action-{{name}} permanent {{#if active}}active{{/if}}" data-action="{{name}}">' +
- '{{#if iconClass}}' +
- '<span class="icon {{iconClass}}"></span>' +
- '{{else}}' +
- '<span class="no-icon"></span>' +
- '{{/if}}' +
- '<p><strong class="menuitem-text">{{displayName}}</strong><br>' +
- '<span class="menuitem-text-detail">{{tooltip}}</span></p></a>' +
- '</li>' +
- '{{/each}}' +
- '</ul>';
-
/**
* Construct a new FederationScopeMenu instance
* @constructs FederationScopeMenu
@@ -76,8 +60,6 @@
'click a.action': '_onClickAction'
},
- template: Handlebars.compile(TEMPLATE_MENU),
-
/**
* Event handler whenever an action has been clicked within the menu
*
@@ -98,7 +80,7 @@
* Renders the menu with the currently set items
*/
render: function() {
- this.$el.html(this.template({
+ this.$el.html(OC.Settings.Templates['federationscopemenu']({
items: this._scopes
}));
},
diff --git a/settings/js/templates.js b/settings/js/templates.js
index 9d7457cd652..ea703c40c8d 100644
--- a/settings/js/templates.js
+++ b/settings/js/templates.js
@@ -46,4 +46,37 @@ templates['authtoken'] = template({"1":function(container,depth0,helpers,partial
+ ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.canDelete : depth0),{"name":"if","hash":{},"fn":container.program(6, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ " </div>\n </td>\n<tr>\n";
},"useData":true});
+templates['federationscopemenu'] = 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 " <li>\n <a href=\"#\" class=\"menuitem action action-"
+ + alias4(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"name","hash":{},"data":data}) : helper)))
+ + " permanent "
+ + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.active : depth0),{"name":"if","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ + "\" data-action=\""
+ + alias4(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"name","hash":{},"data":data}) : helper)))
+ + "\">\n"
+ + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.iconClass : depth0),{"name":"if","hash":{},"fn":container.program(4, data, 0),"inverse":container.program(6, data, 0),"data":data})) != null ? stack1 : "")
+ + " <p>\n <strong class=\"menuitem-text\">"
+ + alias4(((helper = (helper = helpers.displayName || (depth0 != null ? depth0.displayName : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"displayName","hash":{},"data":data}) : helper)))
+ + "</strong><br>\n <span class=\"menuitem-text-detail\">"
+ + alias4(((helper = (helper = helpers.tooltip || (depth0 != null ? depth0.tooltip : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"tooltip","hash":{},"data":data}) : helper)))
+ + "</span>\n </p>\n </a>\n </li>\n";
+},"2":function(container,depth0,helpers,partials,data) {
+ return "active";
+},"4":function(container,depth0,helpers,partials,data) {
+ var helper;
+
+ return " <span class=\"icon "
+ + container.escapeExpression(((helper = (helper = helpers.iconClass || (depth0 != null ? depth0.iconClass : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"iconClass","hash":{},"data":data}) : helper)))
+ + "\"></span>\n";
+},"6":function(container,depth0,helpers,partials,data) {
+ return " <span class=\"no-icon\"></span>\n";
+},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
+ var stack1;
+
+ return "<ul>\n"
+ + ((stack1 = helpers.each.call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.items : depth0),{"name":"each","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ + "</ul>\n";
+},"useData":true});
})(); \ No newline at end of file
diff --git a/settings/js/authtoken.handlebars b/settings/js/templates/authtoken.handlebars
index 7c222d863fe..7c222d863fe 100644
--- a/settings/js/authtoken.handlebars
+++ b/settings/js/templates/authtoken.handlebars
diff --git a/settings/js/templates/federationscopemenu.handlebars b/settings/js/templates/federationscopemenu.handlebars
new file mode 100644
index 00000000000..e5cfd942f46
--- /dev/null
+++ b/settings/js/templates/federationscopemenu.handlebars
@@ -0,0 +1,17 @@
+<ul>
+ {{#each items}}
+ <li>
+ <a href="#" class="menuitem action action-{{name}} permanent {{#if active}}active{{/if}}" data-action="{{name}}">
+ {{#if iconClass}}
+ <span class="icon {{iconClass}}"></span>
+ {{else}}
+ <span class="no-icon"></span>
+ {{/if}}
+ <p>
+ <strong class="menuitem-text">{{displayName}}</strong><br>
+ <span class="menuitem-text-detail">{{tooltip}}</span>
+ </p>
+ </a>
+ </li>
+ {{/each}}
+</ul>
diff --git a/settings/templates/settings/personal/personal.info.php b/settings/templates/settings/personal/personal.info.php
index 6fc85253499..04dcbe3a292 100644
--- a/settings/templates/settings/personal/personal.info.php
+++ b/settings/templates/settings/personal/personal.info.php
@@ -27,6 +27,7 @@
script('settings', [
'usersettings',
+ 'templates',
'federationsettingsview',
'federationscopemenu',
'settings/personalInfo',