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

View file

@ -10,7 +10,8 @@ pandora.ui.onloadDialog = function() {
$text = Ox.Input({ $text = Ox.Input({
height: dialogHeight - 8, height: dialogHeight - 8,
id: 'onload', 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', type: 'textarea',
value: localStorage['pandora.onload'] || '', value: localStorage['pandora.onload'] || '',
width: dialogWidth - 8 width: dialogWidth - 8
@ -45,7 +46,7 @@ pandora.ui.onloadDialog = function() {
minWidth: 512, minWidth: 512,
padding: 0, padding: 0,
removeOnClose: true, removeOnClose: true,
title: 'Manage on load hook', title: 'Run Script on Load',
width: dialogWidth width: dialogWidth
}) })
.bindEvent({ .bindEvent({

View file

@ -100,7 +100,7 @@ pandora.ui.preferencesDialog = function() {
$content.append( $content.append(
Ox.Button({ Ox.Button({
title: 'Reset UI Settings', title: 'Reset UI Settings',
width: 120 width: 128
}) })
.bindEvent({ .bindEvent({
click: function() { click: function() {
@ -110,6 +110,18 @@ pandora.ui.preferencesDialog = function() {
}) })
.css({position: 'absolute', left: '96px', top: '16px'}) .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; return $content;
}, },