move run script on load to user->preferences->advanced

This commit is contained in:
j 2012-05-28 21:04:27 +00:00
parent 54fcacf94f
commit fb6422388d
3 changed files with 17 additions and 7 deletions

View file

@ -154,8 +154,7 @@ pandora.ui.mainMenu = function() {
{ id: 'reloadapplication', title: 'Reload Application'},
{ id: 'resetui', title: 'Reset UI Settings'},
{ id: 'debug', title: (pandora.localStorage('debug')?'Disable':'Enable')+' Debug Mode'},
{ id: 'triggererror', title: 'Trigger JavaScript Error'},
{ id: 'onload', title: 'Edit onload script...'}
{ id: 'triggererror', title: 'Trigger JavaScript Error'}
] }
]
: []
@ -320,8 +319,6 @@ pandora.ui.mainMenu = function() {
filters: pandora.site.user.ui.filters
});
pandora.$ui.contentPanel.replaceElement(0, pandora.$ui.browser = pandora.ui.browser());
} else if (data.id == 'onload') {
pandora.$ui.onloadDialog = pandora.ui.onloadDialog().open();
} else if (data.id == 'logs') {
pandora.$ui.logsDialog = pandora.ui.logsDialog().open();
} else if (data.id == 'clearcache') {

View file

@ -10,7 +10,8 @@ pandora.ui.onloadDialog = function() {
$text = Ox.Input({
height: dialogHeight - 8,
id: 'onload',
placeholder: 'Paste onload code here',
placeholder: '/*\nAny JavaScript you paste here will run on load.\n'
+'You can also manually change or remove it by setting localStorage["pandora.onload"] in the console.\n*/',
type: 'textarea',
value: localStorage['pandora.onload'] || '',
width: dialogWidth - 8
@ -45,7 +46,7 @@ pandora.ui.onloadDialog = function() {
minWidth: 512,
padding: 0,
removeOnClose: true,
title: 'Manage on load hook',
title: 'Run Script on Load',
width: dialogWidth
})
.bindEvent({

View file

@ -100,7 +100,7 @@ pandora.ui.preferencesDialog = function() {
$content.append(
Ox.Button({
title: 'Reset UI Settings',
width: 120
width: 128
})
.bindEvent({
click: function() {
@ -110,6 +110,18 @@ pandora.ui.preferencesDialog = function() {
})
.css({position: 'absolute', left: '96px', top: '16px'})
);
$content.append(
Ox.Button({
title: 'Run Script on Load',
width: 128
})
.bindEvent({
click: function() {
pandora.$ui.onloadDialog = pandora.ui.onloadDialog().open();
}
})
.css({position: 'absolute', left: '96px', top: '40px'})
);
}
return $content;
},