diff --git a/openid-connect-server-webapp/src/main/webapp/WEB-INF/tags/footer.tag b/openid-connect-server-webapp/src/main/webapp/WEB-INF/tags/footer.tag index 3834c2c3d..724954171 100644 --- a/openid-connect-server-webapp/src/main/webapp/WEB-INF/tags/footer.tag +++ b/openid-connect-server-webapp/src/main/webapp/WEB-INF/tags/footer.tag @@ -20,7 +20,7 @@ // set up a global variable for UI components to hang extensions off of var ui = { - templates: [], + templates: ["resources/template/admin.html"], routes: [] }; @@ -39,5 +39,6 @@ +
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 f57e884a2..493e6c880 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 @@ -474,22 +474,18 @@ var app = null; // main $(function () { - var _load = function (templates) { - $('body').append(templates); + var loader = function(source) { + return $.get(source, function (templates) { + console.log('Loading file: ' + source); + $('#templates').append(templates); + }); }; - + // load templates and append them to the body - $.when( - $.get('resources/template/admin.html', _load), - $.get('resources/template/client.html', _load), - $.get('resources/template/grant.html', _load), - $.get('resources/template/scope.html', _load), - $.get('resources/template/whitelist.html', _load), - $.get('resources/template/dynreg.html', _load), - $.get('resources/template/rsreg.html', _load), - $.get('resources/template/token.html', _load), - $.get('resources/template/blacklist.html', _load) + $.when.apply(null, + ui.templates.map(loader) ).done(function() { + console.log('done'); $.ajaxSetup({cache:false}); app = new AppRouter(); diff --git a/openid-connect-server-webapp/src/main/webapp/resources/js/blacklist.js b/openid-connect-server-webapp/src/main/webapp/resources/js/blacklist.js index df97d056b..c031379d9 100644 --- a/openid-connect-server-webapp/src/main/webapp/resources/js/blacklist.js +++ b/openid-connect-server-webapp/src/main/webapp/resources/js/blacklist.js @@ -208,3 +208,5 @@ ui.routes.push({path: "admin/blacklist", name: "blackList", callback: } }); + +ui.templates.push('resources/template/blacklist.html'); \ No newline at end of file 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 7c6839d2b..713e21f76 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 @@ -1322,3 +1322,5 @@ ui.routes.push({path: "admin/client/:id", name: "editClient", callback: } }); + +ui.templates.push('resources/template/client.html'); \ No newline at end of file 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 e0bb23b7e..b46983e46 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 @@ -705,4 +705,6 @@ ui.routes.push({path: "dev/dynreg/edit", name: "editDynReg", callback: setPageTitle($.t('dynreg.edit-existing')); // note that this doesn't actually load the client, that's supposed to happen elsewhere... } -}); \ No newline at end of file +}); + +ui.templates.push('resources/template/dynreg.html'); \ No newline at end of file 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 303963b4d..bcf10701c 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 @@ -278,3 +278,5 @@ ui.routes.push({path: "user/approved", name: "approvedSites", callback: ); } }); + +ui.templates.push('resources/template/grant.html'); \ No newline at end of file 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 4e17b7039..3b01bacbb 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 @@ -503,3 +503,5 @@ ui.routes.push({path: "dev/resource/edit", name: "editResReg", callback: // note that this doesn't actually load the client, that's supposed to happen elsewhere... } }); + +ui.templates.push('resources/template/rsreg.html'); \ No newline at end of file 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 8e8e96366..ea904c62e 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 @@ -432,4 +432,6 @@ ui.routes.push({path: "admin/scope/:id", name: "editScope", callback: }); } -}); \ No newline at end of file +}); + +ui.templates.push('resources/template/scope.html'); \ No newline at end of file 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 a25cc3770..4ea20b55a 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 @@ -499,4 +499,6 @@ ui.routes.push({path: "user/tokens", name: "tokens", callback: ); } -}); \ No newline at end of file +}); + +ui.templates.push('resources/template/token.html'); \ No newline at end of file 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 ad20c0b8a..d75d06e4f 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 @@ -497,4 +497,6 @@ ui.routes.push({path: "admin/whitelist/:id", name: "editWhitelist", callback: } -}); \ No newline at end of file +}); + +ui.templates.push('resources/template/whitelist.html'); \ No newline at end of file