From bf20c93e99ad3f5d8cb9d110e137a4e84cc0300d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Tue, 2 Jul 2019 02:42:46 +0200 Subject: [PATCH] Remove legacy annotations JavaScript file This code isn't used since commit 54e59a8a. --- app/assets/javascripts/annotatable.js.coffee | 38 -------------------- app/assets/javascripts/application.js | 2 -- 2 files changed, 40 deletions(-) delete mode 100644 app/assets/javascripts/annotatable.js.coffee diff --git a/app/assets/javascripts/annotatable.js.coffee b/app/assets/javascripts/annotatable.js.coffee deleted file mode 100644 index 90cabb9e4..000000000 --- a/app/assets/javascripts/annotatable.js.coffee +++ /dev/null @@ -1,38 +0,0 @@ -_t = (key) -> new Gettext().gettext(key) - -App.Annotatable = - initialize: -> - current_user_id = $("html").data("current-user-id") - if current_user_id == "" - annotator.ui.editor.Editor.template = [ - '
', - '
', - " #{_t("Unregistered")}", - '
', - " #{_t("Cancel")}", - "
", - "
", - "
" - ].join("\n") - - $("[data-annotatable-type]").each -> - $this = $(this) - ann_type = $this.data("annotatable-type") - ann_id = $this.data("annotatable-id") - - app = new annotator.App() - .include -> - beforeAnnotationCreated: (ann) -> - ann["#{ann_type}_id"] = ann_id - ann.permissions = ann.permissions || {} - ann.permissions.admin = [] - .include(annotator.ui.main, { element: this }) - .include(annotator.storage.http, { prefix: "", urls: { search: "/annotations/search" } }) - - - app.start().then -> - app.ident.identity = current_user_id - - options = {} - options["#{ann_type}_id"] = ann_id - app.annotations.load(options) diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index dda27c914..9a50e623d 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -42,7 +42,6 @@ //= require users //= require votes //= require allow_participation -//= require annotatable //= require advanced_search //= require registration_form //= require suggest @@ -102,7 +101,6 @@ var initialize_modules = function() { App.CheckAllNone.initialize(); App.PreventDoubleSubmission.initialize(); App.IeAlert.initialize(); - App.Annotatable.initialize(); App.AdvancedSearch.initialize(); App.RegistrationForm.initialize(); App.Suggest.initialize();