From aae0815748ebc087a3954e0f920a59e5c78cc024 Mon Sep 17 00:00:00 2001
From: Chris Hallberg <crhallberg@gmail.com>
Date: Thu, 2 Jun 2016 11:09:22 -0400
Subject: [PATCH] no-undef

---
 themes/bootstrap3/js/autocomplete.js        | 4 ++--
 themes/bootstrap3/js/cart.js                | 2 +-
 themes/bootstrap3/js/check_item_statuses.js | 2 +-
 themes/bootstrap3/js/check_save_statuses.js | 4 ++--
 themes/bootstrap3/js/combined-search.js     | 2 +-
 themes/bootstrap3/js/common.js              | 4 ++--
 themes/bootstrap3/js/embedGBS.js            | 2 +-
 themes/bootstrap3/js/facets.js              | 2 +-
 themes/bootstrap3/js/hierarchyTree.js       | 2 +-
 themes/bootstrap3/js/hold.js                | 2 +-
 themes/bootstrap3/js/ill.js                 | 2 +-
 themes/bootstrap3/js/keep_alive.js          | 2 +-
 themes/bootstrap3/js/lightbox.js            | 4 ++--
 themes/bootstrap3/js/openurl.js             | 2 +-
 themes/bootstrap3/js/pubdate_vis.js         | 4 ++--
 themes/bootstrap3/js/record.js              | 2 +-
 16 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/themes/bootstrap3/js/autocomplete.js b/themes/bootstrap3/js/autocomplete.js
index 9199eb74363..b148bb4cf3a 100644
--- a/themes/bootstrap3/js/autocomplete.js
+++ b/themes/bootstrap3/js/autocomplete.js
@@ -46,7 +46,7 @@
 
   function createList(fulldata, input) {
     // Limit results
-    data = fulldata.slice(0, Math.min(options.maxResults, data.length));
+    var data = fulldata.slice(0, Math.min(options.maxResults, data.length));
     input.data('length', data.length);
     // highlighting setup
     // escape term for regex - https://github.com/sindresorhus/escape-string-regexp/blob/master/index.js
@@ -241,7 +241,7 @@
 
     return this.each(function acJQueryEach() {
 
-      input = $(this);
+      var input = $(this);
 
       if (typeof settings === "string") {
         if (settings === "show") {
diff --git a/themes/bootstrap3/js/cart.js b/themes/bootstrap3/js/cart.js
index d764a2850f8..fbc1ef063dd 100644
--- a/themes/bootstrap3/js/cart.js
+++ b/themes/bootstrap3/js/cart.js
@@ -1,4 +1,4 @@
-/*global Cookies, VuFind */
+/* global Cookies, VuFind, setTimeout, clearTimeout */
 /* exported cartFormHandler */
 
 VuFind.register('cart', function Cart() {
diff --git a/themes/bootstrap3/js/check_item_statuses.js b/themes/bootstrap3/js/check_item_statuses.js
index 985427d4e5a..75e1c17a269 100644
--- a/themes/bootstrap3/js/check_item_statuses.js
+++ b/themes/bootstrap3/js/check_item_statuses.js
@@ -1,4 +1,4 @@
-/*global VuFind */
+/* global VuFind */
 
 function checkItemStatuses(_container) {
   var container = _container || $('body');
diff --git a/themes/bootstrap3/js/check_save_statuses.js b/themes/bootstrap3/js/check_save_statuses.js
index a18e4c6787f..a13c5fa31a6 100644
--- a/themes/bootstrap3/js/check_save_statuses.js
+++ b/themes/bootstrap3/js/check_save_statuses.js
@@ -1,6 +1,6 @@
-/*global htmlEncode, VuFind, userIsLoggedIn */
+/* global htmlEncode, VuFind, userIsLoggedIn */
 
-function checkSaveStatuses(container) {
+function checkSaveStatuses(_container) {
   if (!userIsLoggedIn) {
     return;
   }
diff --git a/themes/bootstrap3/js/combined-search.js b/themes/bootstrap3/js/combined-search.js
index dd4c75d9117..2a4f9b71da4 100644
--- a/themes/bootstrap3/js/combined-search.js
+++ b/themes/bootstrap3/js/combined-search.js
@@ -1,4 +1,4 @@
-/*global VuFind, checkItemStatuses, checkSaveStatuses */
+/* global VuFind, checkItemStatuses, checkSaveStatuses */
 VuFind.combinedSearch = (function CombinedSearch() {
   var init = function init(container, url) {
     container.load(url, '', function containerLoad(responseText) {
diff --git a/themes/bootstrap3/js/common.js b/themes/bootstrap3/js/common.js
index fc9ec1d92a2..72826c1f1bb 100644
--- a/themes/bootstrap3/js/common.js
+++ b/themes/bootstrap3/js/common.js
@@ -1,4 +1,4 @@
-/*global isPhoneNumberValid, unescape */
+/* global isPhoneNumberValid, unescape */
 /* exported VuFind, htmlEncode, deparam, moreFacets, lessFacets, phoneNumberFormHandler, bulkFormHandler */
 
 // IE 9< console polyfill
@@ -54,7 +54,7 @@ var VuFind = (function VuFind() {
 /* --- GLOBAL FUNCTIONS --- */
 function htmlEncode(value) {
   if (value) {
-    return jQuery('<div />').text(value).html();
+    return $('<div />').text(value).html();
   } else {
     return '';
   }
diff --git a/themes/bootstrap3/js/embedGBS.js b/themes/bootstrap3/js/embedGBS.js
index 515a6fca77b..1388dd1d57f 100644
--- a/themes/bootstrap3/js/embedGBS.js
+++ b/themes/bootstrap3/js/embedGBS.js
@@ -1,4 +1,4 @@
-/*global getBibKeyString, google */
+/* global getBibKeyString, google */
 
 // we don't need to wait for dom ready since lang is in the dom root
 var lang = document.documentElement.getAttribute('lang');
diff --git a/themes/bootstrap3/js/facets.js b/themes/bootstrap3/js/facets.js
index a19d6d4acea..4c0fb043e79 100644
--- a/themes/bootstrap3/js/facets.js
+++ b/themes/bootstrap3/js/facets.js
@@ -1,4 +1,4 @@
-/*global htmlEncode, VuFind */
+/* global htmlEncode, VuFind */
 /* exported initFacetTree */
 function buildFacetNodes(data, currentPath, allowExclude, excludeTitle, counts)
 {
diff --git a/themes/bootstrap3/js/hierarchyTree.js b/themes/bootstrap3/js/hierarchyTree.js
index a2caa4f8414..70ab809310b 100644
--- a/themes/bootstrap3/js/hierarchyTree.js
+++ b/themes/bootstrap3/js/hierarchyTree.js
@@ -1,4 +1,4 @@
-/*global VuFind */
+/* global VuFind */
 
 var hierarchyID, recordID, htmlID, hierarchyContext;
 
diff --git a/themes/bootstrap3/js/hold.js b/themes/bootstrap3/js/hold.js
index 904ed12b843..0f3cb34b34d 100644
--- a/themes/bootstrap3/js/hold.js
+++ b/themes/bootstrap3/js/hold.js
@@ -1,4 +1,4 @@
-/*global VuFind */
+/* global VuFind */
 /* exported setUpHoldRequestForm */
 function setUpHoldRequestForm(recordId) {
   $('#requestGroupId').change(function requestGroupChange() {
diff --git a/themes/bootstrap3/js/ill.js b/themes/bootstrap3/js/ill.js
index 72272194797..0817e027fcb 100644
--- a/themes/bootstrap3/js/ill.js
+++ b/themes/bootstrap3/js/ill.js
@@ -1,4 +1,4 @@
-/*global VuFind */
+/* global VuFind */
 /* exported setUpILLRequestForm */
 function setUpILLRequestForm(recordId) {
   $("#ILLRequestForm #pickupLibrary").change(function illPickupChange() {
diff --git a/themes/bootstrap3/js/keep_alive.js b/themes/bootstrap3/js/keep_alive.js
index 65a7e252f16..9bef1a9ef6c 100644
--- a/themes/bootstrap3/js/keep_alive.js
+++ b/themes/bootstrap3/js/keep_alive.js
@@ -1,4 +1,4 @@
-/*global keepAliveInterval, VuFind */
+/* global keepAliveInterval, VuFind */
 
 $(document).ready(function keepAliveReady() {
   window.setInterval(function keepAliveInterval() {
diff --git a/themes/bootstrap3/js/lightbox.js b/themes/bootstrap3/js/lightbox.js
index d76ea8a752b..089307b53d6 100644
--- a/themes/bootstrap3/js/lightbox.js
+++ b/themes/bootstrap3/js/lightbox.js
@@ -1,4 +1,4 @@
-/*global $, document, CustomEvent, VuFind, window */
+/* global $, document, CustomEvent, VuFind, window */
 VuFind.register('lightbox', function Lightbox() {
   // State
   var _originalUrl = false;
@@ -240,7 +240,7 @@ VuFind.register('lightbox', function Lightbox() {
     // Add submit button information
     var submit = $(_clickedButton);
     _clickedButton = null;
-    var buttonData = { name: name, value: 1 };
+    var buttonData = { name: 'submit', value: 1 };
     if (submit.length > 0) {
       if (typeof submit.data('lightbox-ignore') !== 'undefined') {
         return true;
diff --git a/themes/bootstrap3/js/openurl.js b/themes/bootstrap3/js/openurl.js
index fb9312fedaf..3d23e11d8d2 100644
--- a/themes/bootstrap3/js/openurl.js
+++ b/themes/bootstrap3/js/openurl.js
@@ -1,4 +1,4 @@
-/*global extractClassParams, VuFind */
+/* global extractClassParams, VuFind */
 VuFind.register('openurl', function OpenUrl() {
   function _loadResolverLinks($target, openUrl, searchClassId) {
     $target.addClass('ajax_availability');
diff --git a/themes/bootstrap3/js/pubdate_vis.js b/themes/bootstrap3/js/pubdate_vis.js
index 1fac0bbb65c..9863e90040a 100644
--- a/themes/bootstrap3/js/pubdate_vis.js
+++ b/themes/bootstrap3/js/pubdate_vis.js
@@ -1,4 +1,4 @@
-/*global htmlEncode*/
+/* global htmlEncode */
 /* exported loadVis */
 
 function PadDigits(number, totalDigits) {
@@ -115,7 +115,7 @@ function loadVis(facetFields, searchParams, baseURL, zooming) {
       placeholder.bind("plotselected", function plotselected(event, ranges) {
         var from = Math.floor(ranges.xaxis.from);
         var to = Math.ceil(ranges.xaxis.to);
-        location.href = val.removalURL + '&daterange[]=' + key + '&' + key + 'to=' + PadDigits(to,4) + '&' + key + 'from=' + PadDigits(from,4);
+        window.location.href = val.removalURL + '&daterange[]=' + key + '&' + key + 'to=' + PadDigits(to,4) + '&' + key + 'from=' + PadDigits(from,4);
       });
 
       if (hasFilter) {
diff --git a/themes/bootstrap3/js/record.js b/themes/bootstrap3/js/record.js
index ffa1be627bc..840b93e224e 100644
--- a/themes/bootstrap3/js/record.js
+++ b/themes/bootstrap3/js/record.js
@@ -1,4 +1,4 @@
-/*global deparam, syn_get_widget, userIsLoggedIn, VuFind */
+/* global deparam, syn_get_widget, userIsLoggedIn, VuFind */
 /* exported ajaxTagUpdate, recordDocReady */
 
 /**
-- 
GitLab