add rename annotation menu item
This commit is contained in:
parent
546c3e8151
commit
ed6226b824
2 changed files with 189 additions and 0 deletions
53
static/js/localInit.bakma.js
Normal file
53
static/js/localInit.bakma.js
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
pandora.localInit = function() {
|
||||
if (!["admin", "staff"].includes(pandora.user.level)) {
|
||||
return
|
||||
}
|
||||
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: [
|
||||
{id: 'rename', title: 'Rename Annotation...'},
|
||||
],
|
||||
style: 'rounded',
|
||||
title: 'set',
|
||||
tooltip: Ox._('Extras'),
|
||||
type: 'image'
|
||||
}).css(css).bindEvent({
|
||||
click: function(data) {
|
||||
if (data.id == 'rename') {
|
||||
pandora.ui.renameAnnotationDialog().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