ui.onload -> user.script, fixes #2697

This commit is contained in:
j 2015-02-21 10:32:48 +00:00
commit 90a49b2a4d
9 changed files with 112 additions and 9 deletions

View file

@ -13,7 +13,7 @@ pandora.ui.onloadDialog = function() {
+ 'If you ever need to manually change or remove it, '
+ 'you can do so by pandora.UI.set({onload: ""}) in the console.\n*/'),
type: 'textarea',
value: pandora.user.ui.onload || '',
value: pandora.user.script || '',
width: dialogWidth - 32
})
.css({margin: '16px'}),
@ -62,14 +62,14 @@ pandora.ui.onloadDialog = function() {
}
function clear() {
pandora.UI.set({onload: ''});
pandora.api.editPreferences({script: ''});
$input.options({value: ''});
}
that.superClose = that.close;
that.close = function() {
var value = $input.value();
pandora.UI.set({onload: value || ''});
pandora.api.editPreferences({script: value || ''});
that.superClose();
};

View file

@ -1970,9 +1970,9 @@ pandora.isVideoView = function(view, item) {
};
pandora.loadUserScript = function() {
if (pandora.user.ui.onload) {
if (pandora.user.script) {
try {
eval(pandora.user.ui.onload);
eval(pandora.user.script);
} catch(e) {
Ox.print('user onload script error', e);
}