templates refactor part 2

updated so that tpls get loaded on demand as opposed to all at once on
load; added a function to pull the tpl list on load instead of having to
manually define new templates in code; some clean up; added utils.walk;
This commit is contained in:
psychobunny
2013-05-17 15:20:08 -04:00
parent ba8e0ea420
commit fb52dfc6c8
6 changed files with 123 additions and 73 deletions

View File

@@ -39,17 +39,16 @@ var ajaxify = {};
tpl_url = url;
}
if (templates[tpl_url] && !templates.force_refresh(tpl_url)) {
if (templates.is_available(tpl_url) && !templates.force_refresh(tpl_url)) {
if (quiet !== true) {
window.history.pushState({
"url": url
}, url, "/" + url);
}
jQuery('#footer').fadeOut(100);
jQuery('#content').fadeOut(100);
jQuery('#footer, #content').fadeOut(100);
load_template(function() {
templates.load_template(function() {
exec_body_scripts(content);
ajaxify.enable();