This commit is contained in:
psychobunny
2014-03-11 14:41:32 -04:00
parent 21d28b0f58
commit 29ad8d2582
2 changed files with 38 additions and 34 deletions

View File

@@ -630,43 +630,45 @@ var socket,
} }
$('document').ready(function () { app.load = function() {
var url = window.location.pathname.slice(1), $('document').ready(function () {
tpl_url = ajaxify.getTemplateMapping(url); var url = window.location.pathname.slice(1),
tpl_url = ajaxify.getTemplateMapping(url);
$(window).trigger('action:ajaxify.start', { $(window).trigger('action:ajaxify.start', {
url: url
});
$('#search-form').on('submit', function () {
var input = $(this).find('input');
ajaxify.go("search/" + input.val());
input.val('');
return false;
});
$(window).blur(function(){
app.isFocused = false;
});
$(window).focus(function(){
app.isFocused = true;
app.alternatingTitle('');
});
createHeaderTooltips();
templates.parseTemplateVariables();
app.processPage();
ajaxify.renderWidgets(tpl_url, url);
ajaxify.loadScript(tpl_url, function() {
$(window).trigger('action:ajaxify.end', {
url: url url: url
}); });
$('#search-form').on('submit', function () {
var input = $(this).find('input');
ajaxify.go("search/" + input.val());
input.val('');
return false;
});
$(window).blur(function(){
app.isFocused = false;
});
$(window).focus(function(){
app.isFocused = true;
app.alternatingTitle('');
});
createHeaderTooltips();
templates.parseTemplateVariables();
app.processPage();
ajaxify.renderWidgets(tpl_url, url);
ajaxify.loadScript(tpl_url, function() {
$(window).trigger('action:ajaxify.end', {
url: url
});
});
}); });
}); };
showWelcomeMessage = location.href.indexOf('loggedin') !== -1; showWelcomeMessage = location.href.indexOf('loggedin') !== -1;

View File

@@ -357,6 +357,8 @@
$.when($.getJSON(RELATIVE_PATH + '/templates/config.json'), $.getJSON(RELATIVE_PATH + '/api/get_templates_listing')).done(function (config_data, templates_data) { $.when($.getJSON(RELATIVE_PATH + '/templates/config.json'), $.getJSON(RELATIVE_PATH + '/api/get_templates_listing')).done(function (config_data, templates_data) {
config = config_data[0]; config = config_data[0];
available_templates = templates_data[0]; available_templates = templates_data[0];
app.load();
}); });
} }
} }