Bugzilla – Attachment 121668 Details for
Bug 28522
Correct eslint errors in staff-global.js
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28522: Correct eslint errors in staff-global.js
Bug-28522-Correct-eslint-errors-in-staff-globaljs.patch (text/plain), 5.00 KB, created by
Owen Leonard
on 2021-06-07 12:53:20 UTC
(
hide
)
Description:
Bug 28522: Correct eslint errors in staff-global.js
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2021-06-07 12:53:20 UTC
Size:
5.00 KB
patch
obsolete
>From 7a30f7a43a29ba535757f3430b72a3308c3377f5 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Mon, 7 Jun 2021 12:26:02 +0000 >Subject: [PATCH] Bug 28522: Correct eslint errors in staff-global.js > >This patch makes minor corrections to staff-global.js in order to quiet >warnings from ESLint. This includes: > >- Remove unused variables >- Declare undeclared variables >- Update list of global and exported variables and functions >- Correct whitespace >- Remove an unused function (paramOfUrl) > >To test, apply the patch and clear your browser cache if necessary. > >- Confirm that the first search header form field has focus when > switching bewteen pages. >- Confirm that text entered in any search header form field persists > when you switch search header form tabs, e.g. a word typed into the > "Check out" tab is copied to the "Check in" form when you switch to > that tab. >- Perform a search from the "Search the catalog" tab in the header. On > the search results page and any following detail page your search term > should remain in the header search form. >- From a bibliographic detail page, confirm that selecting a list from > the "Add to list" button menu correctly triggers a popup window. >--- > .../intranet-tmpl/prog/js/staff-global.js | 31 ++++++------------- > 1 file changed, 10 insertions(+), 21 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >index 5a7f7fff74..c62a037e52 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >@@ -1,5 +1,5 @@ >-/* global shortcut delCookie delBasket Sticky */ >-/* exported paramOfUrl addBibToContext delBibToContext */ >+/* global shortcut delBasket Sticky AUDIO_ALERT_PATH */ >+/* exported addBibToContext delBibToContext escape_str escape_price openWindow _ removeFocus toUC confirmDelete confirmClone playSound */ > if ( KOHA === undefined ) var KOHA = {}; > > function _(s) { return s; } // dummy function for gettext >@@ -48,8 +48,8 @@ $.fn.selectTabByID = function (tabID) { > $(this).tabs("option", "active", $( tabID ).tabIndex()); > }; > >- $(document).ready(function() { >- $('#header_search').tabs().on( "tabsactivate", function(e, ui) { $(this).find("div:visible").find('input').eq(0).focus(); }); >+$(document).ready(function() { >+ $('#header_search').tabs().on( "tabsactivate", function() { $(this).find("div:visible").find('input').eq(0).focus(); }); > > $(".close").click(function(){ window.close(); }); > >@@ -213,7 +213,7 @@ function openHelp(){ > > jQuery.fn.preventDoubleFormSubmit = function() { > jQuery(this).submit(function() { >- $("body, form input[type='submit'], form button[type='submit'], form a").addClass('waiting'); >+ $("body, form input[type='submit'], form button[type='submit'], form a").addClass('waiting'); > if (this.beenSubmitted) > return false; > else >@@ -225,12 +225,11 @@ function openWindow(link,name,width,height) { > name = (typeof name == "undefined")?'popup':name; > width = (typeof width == "undefined")?'600':width; > height = (typeof height == "undefined")?'400':height; >- var newwin; > //IE <= 9 can't handle a "name" with whitespace > try { >- newin=window.open(link,name,'width='+width+',height='+height+',resizable=yes,toolbar=false,scrollbars=yes,top'); >+ window.open(link,name,'width='+width+',height='+height+',resizable=yes,toolbar=false,scrollbars=yes,top'); > } catch(e) { >- newin=window.open(link,null,'width='+width+',height='+height+',resizable=yes,toolbar=false,scrollbars=yes,top'); >+ window.open(link,null,'width='+width+',height='+height+',resizable=yes,toolbar=false,scrollbars=yes,top'); > } > } > >@@ -267,7 +266,7 @@ function keep_text(clicked_index) { > var searchboxes = document.getElementsByClassName("head-searchbox"); > var persist = searchboxes[0].value; > >- for (i = 0; i < searchboxes.length - 1; i++) { >+ for (var i = 0; i < searchboxes.length - 1; i++) { > if (searchboxes[i].value != searchboxes[i+1].value) { > if (i === searchboxes.length-2) { > if (searchboxes[i].value != searchboxes[0].value) { >@@ -306,18 +305,6 @@ function removeByValue(arr, val) { > } > } > >-function paramOfUrl( url, param ) { >- param = param.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); >- var regexS = "[\\?&]"+param+"=([^&#]*)"; >- var regex = new RegExp( regexS ); >- var results = regex.exec( url ); >- if( results == null ) { >- return ""; >- } else { >- return results[1]; >- } >-} >- > function addBibToContext( bibnum ) { > bibnum = parseInt(bibnum, 10); > var bibnums = getContextBiblioNumbers(); >@@ -351,6 +338,8 @@ function resetSearchContext() { > > function saveOrClearSimpleSearchParams() { > // Simple masthead search - pass value for display on details page >+ var pulldown_selection; >+ var searchbox_value; > if( $("#cat-search-block select.advsearch").length ){ > pulldown_selection = $("#cat-search-block select.advsearch").val(); > } else { >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 28522
:
121668
|
121697
|
121857