From dc3d850a09eae9252457fd1c7689ad0f0a529e35 Mon Sep 17 00:00:00 2001 From: j Date: Wed, 8 Aug 2018 11:58:48 +0100 Subject: [PATCH 1/2] remove unused descriptions --- static/js/infoView.cms.js | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/static/js/infoView.cms.js b/static/js/infoView.cms.js index d0acdcf..5237fad 100644 --- a/static/js/infoView.cms.js +++ b/static/js/infoView.cms.js @@ -539,15 +539,7 @@ pandora.ui.infoView = function(data) { $icon.attr({src: src}); $reflectionIcon.attr({src: src}); } - if (Ox.contains(nameKeys, key)) { - data['namedescription'] = result.data['namedescription']; - descriptions.names = getNames(); - renderDescriptions(); - } else if (key == 'productionCompany') { - data['productionCompanydescription'] = result.data['productionCompanydescription']; - descriptions.studios = getStudios(); - renderDescriptions(); - } else if (key == 'imdbId') { + if (key == 'imdbId') { updateIMDb(); } }); From 86253cd60e8627d6fc1001d31fa10a8d141a0222 Mon Sep 17 00:00:00 2001 From: j Date: Wed, 8 Aug 2018 11:59:08 +0100 Subject: [PATCH 2/2] add extra menu for admins --- static/js/localInit.cms.js | 60 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 static/js/localInit.cms.js diff --git a/static/js/localInit.cms.js b/static/js/localInit.cms.js new file mode 100644 index 0000000..bd26116 --- /dev/null +++ b/static/js/localInit.cms.js @@ -0,0 +1,60 @@ + +pandora.localInitInit = function() { + var plugins = []; + + if (pandora.user.level == 'admin') { + 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 Keyword'}, + {'id': 'ontology_graph', title: 'Ontology Graph'}, + {'id': 'ontology', title: 'Ontology Overview'}, + ], + style: 'rounded', + title: 'set', + tooltip: Ox._('Extras'), + type: 'image' + }).css(css).bindEvent({ + click: function(data) { + if (data.id == 'rename') { + pandora.ui.renameKeywordDialog().open() + } else if (data.id == 'ontology_graph') { + pandora.openLink('/static/ontology/'); + } else if (data.id == 'ontology') { + pandora.openLink('/static/ontology/ontology.html'); + } + }, + }), + plugins = []; + + that.load = function() { + pandora.$ui.mainMenu.find('.OxExtras').prepend($item); + pandora.$ui.extraItem = $item; + }; + return that; + } + +}