From de3b0cf9edbbf93f7bb2136a84f9e5146c5b9488 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Mon, 4 May 2020 12:36:57 +0000 Subject: [PATCH] Bug 25363: Merge common.js with staff-global.js This patch merges the contents of common.js with staff-global.js. Both are included globally in the staff interface, and there doesn't seem to be any reason to require that the user downloads two different JavaScript files. To test, apply the patch and perform a catalog search in the staff client. View the detail page for a title in the search results. On the detail page you should see navigation controls in the sidebar for browsing through search results. Confirm they work correctly. Signed-off-by: Lucas Gass Signed-off-by: Katrin Fischer --- .../intranet-tmpl/prog/en/includes/js_includes.inc | 1 - koha-tmpl/intranet-tmpl/prog/js/commons.js | 73 --------------------- koha-tmpl/intranet-tmpl/prog/js/staff-global.js | 75 ++++++++++++++++++++++ 3 files changed, 75 insertions(+), 74 deletions(-) delete mode 100644 koha-tmpl/intranet-tmpl/prog/js/commons.js diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc index bd833a4e76..7e7604b71c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc @@ -25,7 +25,6 @@ [% Asset.js("lib/jquery/plugins/jquery.validate.min.js") | $raw %] [% Asset.js("js/staff-global.js") | $raw %] -[% Asset.js("js/commons.js") | $raw %] [% INCLUDE 'validator-strings.inc' %] [% IF ( IntranetUserJS ) %] diff --git a/koha-tmpl/intranet-tmpl/prog/js/commons.js b/koha-tmpl/intranet-tmpl/prog/js/commons.js deleted file mode 100644 index 4981c07946..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/js/commons.js +++ /dev/null @@ -1,73 +0,0 @@ -// Extends jQuery API -jQuery.extend({uniqueArray:function(array){ - return $.grep(array, function(el, index) { - return index === $.inArray(el, array); - }); -}}); - -function removeByValue(arr, val) { - for(var i=0; i