load all templates from configured files
parent
5af98e1106
commit
503d6f5725
|
@ -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 @@
|
|||
</c:forEach>
|
||||
<script type="text/javascript" src="resources/js/admin.js"></script>
|
||||
</c:if>
|
||||
<div id="templates" class="hide"></div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -208,3 +208,5 @@ ui.routes.push({path: "admin/blacklist", name: "blackList", callback:
|
|||
}
|
||||
|
||||
});
|
||||
|
||||
ui.templates.push('resources/template/blacklist.html');
|
|
@ -1322,3 +1322,5 @@ ui.routes.push({path: "admin/client/:id", name: "editClient", callback:
|
|||
|
||||
}
|
||||
});
|
||||
|
||||
ui.templates.push('resources/template/client.html');
|
|
@ -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...
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
ui.templates.push('resources/template/dynreg.html');
|
|
@ -278,3 +278,5 @@ ui.routes.push({path: "user/approved", name: "approvedSites", callback:
|
|||
);
|
||||
}
|
||||
});
|
||||
|
||||
ui.templates.push('resources/template/grant.html');
|
|
@ -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');
|
|
@ -432,4 +432,6 @@ ui.routes.push({path: "admin/scope/:id", name: "editScope", callback:
|
|||
});
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
ui.templates.push('resources/template/scope.html');
|
|
@ -499,4 +499,6 @@ ui.routes.push({path: "user/tokens", name: "tokens", callback:
|
|||
);
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
ui.templates.push('resources/template/token.html');
|
|
@ -497,4 +497,6 @@ ui.routes.push({path: "admin/whitelist/:id", name: "editWhitelist", callback:
|
|||
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
ui.templates.push('resources/template/whitelist.html');
|
Loading…
Reference in New Issue