diff --git a/config.jsonc b/config.jsonc index 4c1e6e8..ce14a54 100644 --- a/config.jsonc +++ b/config.jsonc @@ -53,7 +53,7 @@ "canPlayClips": {"guest": 1, "member": 1, "staff": 4, "admin": 4}, "canPlayVideo": {"guest": 1, "member": 1, "staff": 4, "admin": 4}, "canReadText": {"guest": 0, "member": 0, "staff": 1, "admin": 1}, - "canRemoveItems": {"admin": true, "staff": true}, + "canRemoveItems": {"admin": true}, "canRemoveDocuments": {"staff": true, "admin": true}, "canSeeAccessed": {"staff": true, "admin": true}, "canSeeAllTasks": {"staff": true, "admin": true}, diff --git a/static/js/localInit.bakma.js b/static/js/localInit.bakma.js deleted file mode 100644 index 16c7f56..0000000 --- a/static/js/localInit.bakma.js +++ /dev/null @@ -1,53 +0,0 @@ -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; - } -} diff --git a/static/js/renameAnnotationDialog.bakma.js b/static/js/renameAnnotationDialog.bakma.js deleted file mode 100644 index 7b97728..0000000 --- a/static/js/renameAnnotationDialog.bakma.js +++ /dev/null @@ -1,136 +0,0 @@ -pandora.ui.renameAnnotationDialog = function() { - - var dialogHeight = 100, - dialogWidth = 512 + 16, - formWidth = getFormWidth(), - - $button, - $content = Ox.Element(), - old, - value, - layer = pandora.site.layers[0].id, - $input = [ - Ox.Select({ - label: Ox._('Layer'), - labelWidth: 96, - width: 512, - items: pandora.site.layers, - }).css({ - margin: '8px' - }).bindEvent({ - change: function(data) { - layer = data.value; - } - }).appendTo($content), - Ox.Input({ - label: Ox._('From'), - labelWidth: 96, - width: 512 - }).css({ - margin: '8px' - }).bindEvent({ - change: function(data) { - $button.options({disabled: !data.value && !value}); - old = data.value; - } - }).appendTo($content), - Ox.Input({ - label: Ox._('To'), - labelWidth: 96, - width: 512 - }).css({ - margin: '8px' - }).bindEvent({ - change: function(data) { - $button.options({disabled: !data.value && !old}); - value = data.value; - } - }).appendTo($content) - ], - - that = Ox.Dialog({ - buttons: [ - Ox.Button({ - id: 'cancel', - title: Ox._('Cancel') - }) - .bindEvent({ - click: function() { - that.close(); - } - }), - $button = Ox.Button({ - disabled: true, - id: 'update', - title: Ox._('Rename Annotation') - }) - .bindEvent({ - click: function() { - that.options({content: Ox.LoadingScreen().start()}); - renameAnnotation(layer, old, value, function() { - Ox.Request.clearCache(); - that.close(); - }) - } - }) - ], - closeButton: true, - content: $content, - height: dialogHeight, - removeOnClose: true, - title: Ox._('Change Annotation'), - width: dialogWidth - }) - .bindEvent({ - resize: setSize - }); - - function getFormWidth() { - return dialogWidth - 32 - Ox.UI.SCROLLBAR_SIZE; - } - - function setSize(data) { - dialogHeight = data.height; - dialogWidth = data.width; - formWidth = getFormWidth(); - $input.forEach(function($element) { - $element.options({width: formWidth}); - }); - } - - function renameAnnotation(layer, old, value, callback) { - pandora.api.findAnnotations({ - 'query': { - 'conditions': [{ - 'key': 'value', - 'value': old, - 'operator': '==' - }, - { - 'key': 'layer', - 'value': layer, - 'operator': '==' - }], - 'operator': '&' - }, - 'keys': ['id', 'in', 'out', 'value', 'user', 'created'], - 'range': [0, 500000] - }, function(result) { - console.log('got annots', result.data.items); - Ox.serialForEach(result.data.items, function(annotation, index, array, next) { - pandora.api.editAnnotation({ - id: annotation.id, - value: value - }, function(result) { - next() - }) - }, function() { - callback() - }) - }) - } - - return that; -}; - -