Bug 15847 - Correct JSHint errors in basket.js in the staff client
Summary: Correct JSHint errors in basket.js in the staff client
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-17 17:15 UTC by Owen Leonard
Modified: 2017-06-14 22:10 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 15847 - Correct JSHint errors in basket.js in the staff client (4.77 KB, patch)
2016-02-17 17:34 UTC, Owen Leonard
Details | Diff | Splinter Review
[SIGNED-OFF]Bug 15847: Correct JSHint errors in basket.js in the staff client (4.85 KB, patch)
2016-02-17 19:26 UTC, Héctor Eduardo Castro Avalos
Details | Diff | Splinter Review
Bug 15847: Correct JSHint errors in basket.js in the staff client (4.91 KB, patch)
2016-02-18 11:14 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2016-02-17 17:15:12 UTC
Following coding guideline JS8: "Follow guidelines set by JSHint," some errors should be corrected in basket.js

basket.js: line 53, col 36, Use '===' to compare with '0'.
basket.js: line 85, col 42, Missing semicolon.
basket.js: line 210, col 5, Implied eval. Consider passing a function instead of a string.
basket.js: line 219, col 44, Missing semicolon.
basket.js: line 243, col 46, Missing semicolon.
basket.js: line 251, col 29, Use '===' to compare with '0'.
basket.js: line 270, col 13, 'valCookie' is already defined.
basket.js: line 305, col 13, Use '===' to compare with 'undefined'.
basket.js: line 409, col 25, The array literal notation [] is preferable.
basket.js: line 416, col 25, Use '===' to compare with '0'.
basket.js: line 432, col 33, Missing semicolon.
basket.js: line 1, col 11, Missing semicolon.
Comment 1 Owen Leonard 2016-02-17 17:34:27 UTC Comment hidden (obsolete)
Comment 2 Héctor Eduardo Castro Avalos 2016-02-17 19:26:10 UTC Comment hidden (obsolete)
Comment 3 Jonathan Druart 2016-02-18 11:14:16 UTC
Created attachment 48206 [details] [review]
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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 4 Brendan Gallagher 2016-02-24 01:33:36 UTC
pushed to master - should be in the May 2016 release.  Thanks!
Comment 5 Julian Maurice 2016-02-26 15:37:26 UTC
Patch pushed to 3.22.x, will be in 3.22.4