cleanup pandora.setLocale, beforeunloadWindow -> beforeUnloadWindow

This commit is contained in:
rolux 2013-05-09 19:33:20 +02:00
parent 94352559a3
commit bd9bdc366f
2 changed files with 14 additions and 13 deletions

View file

@ -228,7 +228,7 @@ appPanel
document: $(document),
window: $(window)
.on({
beforeunload: pandora.beforeunloadWindow,
beforeunload: pandora.beforeUnloadWindow,
resize: pandora.resizeWindow,
unload: pandora.unloadWindow
})

View file

@ -157,6 +157,7 @@ pandora.addList = function() {
}).reloadList();
}
};
pandora.addText = function(options) {
var $folderList = pandora.$ui.folderList.personal;
options = options || {};
@ -177,6 +178,13 @@ pandora.addText = function(options) {
}
}
pandora.beforeUnloadWindow = function() {
if (pandora.firefogg)
return Ox._("Encoding is currently running\nDo you want to leave this page?");
//prevent error dialogs on unload
pandora.isUnloading = true;
};
pandora.changeFolderItemStatus = function(id, status, callback) {
var ui = pandora.user.ui,
folderItems = ui.section == 'items' ? 'Lists' : Ox.toTitleCase(ui.section),
@ -1463,18 +1471,11 @@ pandora.selectList = function() {
};
pandora.setLocale = function(locale, callback) {
Ox.setLocale(locale, locale && locale != 'en'
? '/static/json/locale.' + locale + '.json'
: void 0, function(result) {
callback(result);
});
}
pandora.beforeunloadWindow = function() {
if (pandora.firefogg)
return Ox._("Encoding is currently running\nDo you want to leave this page?");
//prevent error dialogs on unload
pandora.isUnloading = true;
Ox.setLocale(
locale,
locale && locale != 'en' ? '/static/json/locale.' + locale + '.json' : null,
callback
);
};
pandora.unloadWindow = function() {