local app
This commit is contained in:
parent
d255ed6a03
commit
a775ed3055
7 changed files with 314 additions and 3 deletions
53
static/js/localInit.amp.js
Normal file
53
static/js/localInit.amp.js
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
pandora.localInit = function() {
|
||||
var plugins = [];
|
||||
|
||||
plugins.push(ExtrasMenu());
|
||||
|
||||
plugins.length && load();
|
||||
|
||||
function load() {
|
||||
patchReload();
|
||||
plugins.forEach(function(plugin) { plugin.load() });
|
||||
}
|
||||
|
||||
function patchReload() {
|
||||
var reload = pandora.$ui.appPanel.reload;
|
||||
pandora.$ui.appPanel.reload = function() {
|
||||
reload();
|
||||
load();
|
||||
}
|
||||
}
|
||||
|
||||
function ExtrasMenu() {
|
||||
var that = {};
|
||||
|
||||
var css = {
|
||||
//margin: '2px',
|
||||
},
|
||||
$item = Ox.MenuButton({
|
||||
items: [
|
||||
].concat(pandora.user.level == 'admin' ? [
|
||||
] : [], [
|
||||
{id: 'import_documents', title: 'Import Documents...'},
|
||||
]),
|
||||
style: 'rounded',
|
||||
title: 'set',
|
||||
tooltip: Ox._('Extras'),
|
||||
type: 'image'
|
||||
}).css(css).bindEvent({
|
||||
click: function(data) {
|
||||
if (data.id == 'import_documents') {
|
||||
pandora.ui.importDocumentsDialog().open()
|
||||
}
|
||||
},
|
||||
}),
|
||||
plugins = [];
|
||||
|
||||
that.load = function() {
|
||||
pandora.$ui.mainMenu.find('.OxExtras').prepend($item);
|
||||
pandora.$ui.extraItem = $item;
|
||||
};
|
||||
return that;
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue