diff --git a/openid-connect-server-webapp/src/main/webapp/resources/js/admin.js b/openid-connect-server-webapp/src/main/webapp/resources/js/admin.js index 14ba31ffd..78f8737c2 100644 --- a/openid-connect-server-webapp/src/main/webapp/resources/js/admin.js +++ b/openid-connect-server-webapp/src/main/webapp/resources/js/admin.js @@ -112,8 +112,8 @@ var ListWidgetChildView = Backbone.View.extend({ }, - initialize:function () { - + initialize:function (options) { + this.options = options; if (!this.template) { this.template = _.template($('#tmpl-list-widget-child').html()); } @@ -149,7 +149,8 @@ var ListWidgetView = Backbone.View.extend({ } }, - initialize:function () { + initialize:function (options) { + this.options = options; if (!this.template) { this.template = _.template($('#tmpl-list-widget').html()); @@ -232,7 +233,8 @@ var BreadCrumbView = Backbone.View.extend({ tagName: 'ul', - initialize:function () { + initialize:function (options) { + this.options = options; if (!this.template) { this.template = _.template($('#tmpl-breadcrumbs').html()); @@ -269,7 +271,8 @@ var BreadCrumbView = Backbone.View.extend({ var BlackListListView = Backbone.View.extend({ tagName: 'span', - initialize:function() { + initialize:function(options) { + this.options = options; if (!this.template) { this.template = _.template($('#tmpl-blacklist-form').html()); } @@ -324,7 +327,8 @@ var BlackListListView = Backbone.View.extend({ var BlackListWidgetView = ListWidgetView.extend({ childView: ListWidgetChildView.extend({ - render:function() { + render:function(options) { + this.options = options; var uri = this.model.get('uri'); this.$el.html(this.template({item: uri})); @@ -389,7 +393,8 @@ var StatsModel = Backbone.Model.extend({ var UserProfileView = Backbone.View.extend({ tagName: 'span', - initialize:function() { + initialize:function(options) { + this.options = options; if (!this.template) { this.template = _.template($('#tmpl-user-profile-element').html()); } @@ -1000,6 +1005,11 @@ $(function () { // grab all hashed URLs and send them through the app router instead $(document).on('click', 'a[href^="manage/#"]', function(event) { event.preventDefault(); + + $('.sidebar-nav li.active').removeClass('active'); + + $(this).parent().addClass('active'); + app.navigate(this.hash.slice(1), {trigger: true}); }); diff --git a/openid-connect-server-webapp/src/main/webapp/resources/js/client.js b/openid-connect-server-webapp/src/main/webapp/resources/js/client.js index aff4dcc2c..1c124a578 100644 --- a/openid-connect-server-webapp/src/main/webapp/resources/js/client.js +++ b/openid-connect-server-webapp/src/main/webapp/resources/js/client.js @@ -149,7 +149,8 @@ var ClientView = Backbone.View.extend({ tagName: 'tr', - initialize:function () { + initialize:function (options) { + this.options = options; if (!this.template) { this.template = _.template($('#tmpl-client').html()); @@ -297,7 +298,8 @@ var ClientListView = Backbone.View.extend({ tagName: 'span', - initialize:function () { + initialize:function (options) { + this.options = options; this.filteredModel = this.model; }, @@ -469,7 +471,8 @@ var ClientFormView = Backbone.View.extend({ tagName:"span", - initialize:function () { + initialize:function (options) { + this.options = options; if (!this.template) { this.template = _.template($('#tmpl-client-form').html()); diff --git a/openid-connect-server-webapp/src/main/webapp/resources/js/dynreg.js b/openid-connect-server-webapp/src/main/webapp/resources/js/dynreg.js index 59c7e0647..112359cf7 100644 --- a/openid-connect-server-webapp/src/main/webapp/resources/js/dynreg.js +++ b/openid-connect-server-webapp/src/main/webapp/resources/js/dynreg.js @@ -78,7 +78,8 @@ var DynRegRootView = Backbone.View.extend({ tagName: 'span', - initialize:function() { + initialize:function(options) { + this.options = options; }, @@ -155,7 +156,8 @@ var DynRegEditView = Backbone.View.extend({ tagName: 'span', - initialize:function() { + initialize:function(options) { + this.options = options; if (!this.template) { this.template = _.template($('#tmpl-dynreg-client-form').html()); } diff --git a/openid-connect-server-webapp/src/main/webapp/resources/js/grant.js b/openid-connect-server-webapp/src/main/webapp/resources/js/grant.js index 64e7250fe..06082b19b 100644 --- a/openid-connect-server-webapp/src/main/webapp/resources/js/grant.js +++ b/openid-connect-server-webapp/src/main/webapp/resources/js/grant.js @@ -34,7 +34,9 @@ var ApprovedSiteCollection = Backbone.Collection.extend({ var ApprovedSiteListView = Backbone.View.extend({ tagName: 'span', - initialize:function() { }, + initialize:function(options) { + this.options = options; + }, load:function(callback) { if (this.model.isFetched && @@ -154,7 +156,8 @@ var ApprovedSiteListView = Backbone.View.extend({ var ApprovedSiteView = Backbone.View.extend({ tagName: 'tr', - initialize: function() { + initialize: function(options) { + this.options = options; if (!this.template) { this.template = _.template($('#tmpl-grant').html()); } diff --git a/openid-connect-server-webapp/src/main/webapp/resources/js/rsreg.js b/openid-connect-server-webapp/src/main/webapp/resources/js/rsreg.js index b4a639c08..4c8c2d60a 100644 --- a/openid-connect-server-webapp/src/main/webapp/resources/js/rsreg.js +++ b/openid-connect-server-webapp/src/main/webapp/resources/js/rsreg.js @@ -78,7 +78,8 @@ var ResRegRootView = Backbone.View.extend({ tagName: 'span', - initialize:function() { + initialize:function(options) { + this.options = options; }, @@ -155,7 +156,8 @@ var ResRegEditView = Backbone.View.extend({ tagName: 'span', - initialize:function() { + initialize:function(options) { + this.options = options; if (!this.template) { this.template = _.template($('#tmpl-rsreg-resource-form').html()); } diff --git a/openid-connect-server-webapp/src/main/webapp/resources/js/scope.js b/openid-connect-server-webapp/src/main/webapp/resources/js/scope.js index 760ec80a4..df76fb3e9 100644 --- a/openid-connect-server-webapp/src/main/webapp/resources/js/scope.js +++ b/openid-connect-server-webapp/src/main/webapp/resources/js/scope.js @@ -75,7 +75,8 @@ var SystemScopeView = Backbone.View.extend({ tagName: 'tr', - initialize:function () { + initialize:function (options) { + this.options = options; if (!this.template) { this.template = _.template($('#tmpl-system-scope').html()); @@ -151,6 +152,10 @@ var SystemScopeView = Backbone.View.extend({ var SystemScopeListView = Backbone.View.extend({ tagName: 'span', + initialize:function(options) { + this.options = options; + }, + load:function(callback) { if (this.model.isFetched) { callback(); @@ -221,7 +226,8 @@ var SystemScopeListView = Backbone.View.extend({ var SystemScopeFormView = Backbone.View.extend({ tagName: 'span', - initialize:function() { + initialize:function(options) { + this.options = options; if (!this.template) { this.template = _.template($('#tmpl-system-scope-form').html()); } diff --git a/openid-connect-server-webapp/src/main/webapp/resources/js/token.js b/openid-connect-server-webapp/src/main/webapp/resources/js/token.js index 78f68cb17..3017ad4ba 100644 --- a/openid-connect-server-webapp/src/main/webapp/resources/js/token.js +++ b/openid-connect-server-webapp/src/main/webapp/resources/js/token.js @@ -45,7 +45,8 @@ var AccessTokenView = Backbone.View.extend({ tagName: 'tr', - initialize:function () { + initialize:function (options) { + this.options = options; if (!this.template) { this.template = _.template($('#tmpl-access-token').html()); @@ -193,7 +194,8 @@ var RefreshTokenView = Backbone.View.extend({ tagName: 'tr', - initialize:function () { + initialize:function (options) { + this.options = options; if (!this.template) { this.template = _.template($('#tmpl-refresh-token').html()); @@ -317,6 +319,10 @@ var RefreshTokenView = Backbone.View.extend({ var TokenListView = Backbone.View.extend({ tagName: 'span', + initialize:function(options) { + this.options = options; + }, + events:{ "click .refresh-table":"refreshTable", 'page .paginator-access':'changePageAccess', diff --git a/openid-connect-server-webapp/src/main/webapp/resources/js/whitelist.js b/openid-connect-server-webapp/src/main/webapp/resources/js/whitelist.js index 833b42da5..e5c9dea9a 100644 --- a/openid-connect-server-webapp/src/main/webapp/resources/js/whitelist.js +++ b/openid-connect-server-webapp/src/main/webapp/resources/js/whitelist.js @@ -46,8 +46,8 @@ var WhiteListCollection = Backbone.Collection.extend({ var WhiteListListView = Backbone.View.extend({ tagName: 'span', - initialize:function () { - //this.model.bind("reset", this.render, this); + initialize:function (options) { + this.options = options; }, load:function(callback) { @@ -133,7 +133,8 @@ var WhiteListListView = Backbone.View.extend({ var WhiteListView = Backbone.View.extend({ tagName: 'tr', - initialize:function() { + initialize:function(options) { + this.options = options; if (!this.template) { this.template = _.template($('#tmpl-whitelist').html()); } @@ -240,7 +241,8 @@ var WhiteListView = Backbone.View.extend({ var WhiteListFormView = Backbone.View.extend({ tagName: 'span', - initialize:function () { + initialize:function (options) { + this.options = options; if (!this.template) { this.template = _.template($('#tmpl-whitelist-form').html()); }