pandora_userscripts/goto_item.js

61 lines
1.4 KiB
JavaScript

(function() {
var css = {
margin: '2px',
},
reload = pandora.$ui.appPanel.reload,
timeout,
$item = Ox.Editable({
placeholder: 'No Item',
editable: true,
value: pandora.user.ui.section == 'items' ? pandora.user.ui.item : ''
}).css(css).bindEvent({
pandora_item: update,
pandora_section: update,
submit: function(data) {
pandora.UI.set({section: 'items', item: data.value});
}
});
load();
function update() {
$item.options({value: pandora.user.ui.section == 'items' ? pandora.user.ui.item : ''});
}
function load() {
pandora.$ui.mainMenu.find('.OxExtras').prepend($item);
pandora.$ui.extraItem = $item;
patchReload();
}
function patchReload() {
pandora.$ui.appPanel.reload = function() {
reload();
load();
}
}
window.missingLocale ={};
Ox._.log(function(k, v) {
if (Ox.isUndefined(v)) {
window.missingLocale[k] = '';
}
});
window.missingLocale.show = function() {
Ox.Dialog({
width: 320,
height: 320,
closeButton: true,
destroyOnClose: true,
content: Ox.Input({
width: 300,
height: 300,
type: 'textarea', value: JSON.stringify(window.missingLocale, null, 4)
})
}).open();
};
}());