From 9526d6efea15c95d3d0d1195f3ba72b7f7f7c7d1 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 Signed-off-by: Jonathan Druart (cherry picked from commit 814a7ecf47b087a60b35bca6a4d23deeb596a0e8) Signed-off-by: Lucas Gass --- .../prog/en/includes/js_includes.inc | 1 - koha-tmpl/intranet-tmpl/prog/js/commons.js | 73 ------------------ .../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