Bugzilla – Attachment 48197 Details for
Bug 15847
Correct JSHint errors in basket.js in the staff client
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF]Bug 15847: Correct JSHint errors in basket.js in the staff client
SIGNED-OFFBug-15847-Correct-JSHint-errors-in-baske.patch (text/plain), 4.85 KB, created by
Héctor Eduardo Castro Avalos
on 2016-02-17 19:26:10 UTC
(
hide
)
Description:
[SIGNED-OFF]Bug 15847: Correct JSHint errors in basket.js in the staff client
Filename:
MIME Type:
Creator:
Héctor Eduardo Castro Avalos
Created:
2016-02-17 19:26:10 UTC
Size:
4.85 KB
patch
obsolete
>From d36be8d7b311eaef672128ba7cedee5f5da06de6 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Wed, 17 Feb 2016 12:17:17 -0500 >Subject: [PATCH] [SIGNED-OFF]Bug 15847: Correct JSHint errors in basket.js in > the staff client > >This patch corrects minor errors in the staff client's basket.js >according to warnings raised by JSHint. > >To test, apply the patch and run JSHint on basket.js. No warnings >should be raised. > >To confirm that the behavior of the JS is not changed, clear your >browser cache if necessary and: > >- Test adding multiple titles to the Cart from staff client search > results. >- Confirm that adding titles to the Cart triggers a message by the Cart > link. >- Test clicking the "Cart" link in the header menu when the Cart popup > is open but behind the main window. >- Testing emptying the Cart. > >Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com> >Works as described. No warnigns raised with jshint tool >--- > koha-tmpl/intranet-tmpl/prog/en/js/basket.js | 22 +++++++++++----------- > 1 file changed, 11 insertions(+), 11 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/basket.js b/koha-tmpl/intranet-tmpl/prog/en/js/basket.js >index 3e5676c..d5b1e33 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/js/basket.js >+++ b/koha-tmpl/intranet-tmpl/prog/en/js/basket.js >@@ -50,7 +50,7 @@ function readCookie(name, wd) { > for(var i=0;i < cookie_parts.length;i++) { > var c = cookie_parts[i]; > while (c.charAt(0)==' ') c = c.substring(1,c.length); >- if(c.indexOf(str_name) == 0) return c.substring(str_name.length,c.length); >+ if(c.indexOf(str_name) === 0) return c.substring(str_name.length,c.length); > } > return null; > } >@@ -82,7 +82,7 @@ function openBasket() { > var optWin = "status=yes,scrollbars=yes,resizable=yes,toolbar=no,location=yes,height="+iH+",width="+iW; > var loc = CGIBIN + "basket/basket.pl?" + strCookie; > var basket = open(loc, "basket", optWin); >- if (window.focus) {basket.focus()} >+ if (window.focus) { basket.focus(); } > } > else { > showCartUpdate(MSG_BASKET_EMPTY); >@@ -207,7 +207,7 @@ function showCartUpdate(msg){ > // set body of popup window > $("#cartDetails").html(msg); > showCart(); >- setTimeout("hideCart()",2000); >+ setTimeout(hideCart,2000); > } > > function showListsUpdate(msg){ >@@ -216,7 +216,7 @@ function showListsUpdate(msg){ > } > > function selRecord(num, status) { >- var str = document.myform.records.value >+ var str = document.myform.records.value; > if (status){ > str += num+"/"; > } >@@ -240,7 +240,7 @@ function delSelRecords() { > while (!end){ > s = str.indexOf("/"); > if (s>0){ >- num = str.substring(0, s) >+ num = str.substring(0, s); > str = delRecord(num,str); > str2 = delRecord(num,str2); > } else { >@@ -248,7 +248,7 @@ function delSelRecords() { > } > } > >- if (str2.length == 0) { // equivalent to emptying the basket >+ if (str2.length === 0) { // equivalent to emptying the basket > var rep = false; > rep = confirm(MSG_CONFIRM_DEL_BASKET); > if (rep) { >@@ -267,7 +267,7 @@ function delSelRecords() { > > if (recordsSel) { > var strCookie = ""; >- var valCookie = readCookie(nameCookie, 1); >+ valCookie = readCookie(nameCookie, 1); > strCookie = nameParam + "=" + valCookie; > var arrayRecords = valCookie.split("/"); > updateBasket(arrayRecords.length-1,top.opener); >@@ -302,7 +302,7 @@ function delRecord (n, s) { > > > function delBasket(context,rep) { >- if (rep == undefined){ >+ if (rep === undefined){ > rep = confirm(MSG_CONFIRM_DEL_BASKET); > } > if (rep) { >@@ -406,14 +406,14 @@ function addSelToShelf() { > /// vShelfAdd() builds url string for multiple-biblio adds. > > function vShelfAdd(biblist) { >- bibs = new Array(); >+ bibs = []; > if(biblist.length > 0) { > for (var i=0; i < biblist.length; i++) { > if (biblist[i].checked) { > bibs.push("biblionumber=" + biblist[i].value); > } > } >- if (bibs.length == 0) { showListsUpdate(MSG_NO_RECORD_SELECTED); } >+ if (bibs.length === 0) { showListsUpdate(MSG_NO_RECORD_SELECTED); } > return bibs.join("&"); > } else { > if (biblist.checked) { >@@ -429,7 +429,7 @@ function showCart(){ > if( scrolld > top ){ > top = scrolld + 15; > } >- var left = position.left >+ var left = position.left; > $("#cartDetails").css("position","absolute").css("top",top); > $("#cartDetails").css("position","absolute").css("left",left); > $("#cartDetails").fadeIn("fast"); >-- >1.7.10.4
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 15847
:
48195
|
48197
|
48206