diff --git a/themes/bootstrap3/js/advanced_search.js b/themes/bootstrap3/js/advanced_search.js index ea908c8de86c430275b96ef3ce0a4752842e203e..deab40e80f3b4fc6b4c74e4699c862e1e059f2a1 100644 --- a/themes/bootstrap3/js/advanced_search.js +++ b/themes/bootstrap3/js/advanced_search.js @@ -1,3 +1,4 @@ +/* exported addGroup, addSearch, deleteGroup, deleteSearch */ var nextGroup = 0; var groupLength = []; diff --git a/themes/bootstrap3/js/cart.js b/themes/bootstrap3/js/cart.js index 2d610aef92e72ff53d485b9e7bf916a841004620..d55527f58f19b38ef9b1a708f88d258ad66c5233 100644 --- a/themes/bootstrap3/js/cart.js +++ b/themes/bootstrap3/js/cart.js @@ -1,4 +1,5 @@ /*global Cookies, VuFind */ +/* exported cartFormHandler */ VuFind.register('cart', function Cart() { var _COOKIE = 'vufind_cart'; @@ -76,7 +77,6 @@ VuFind.register('cart', function Cart() { var cartIndex = cartItems.indexOf(String.fromCharCode(65 + cartSources.indexOf(source)) + id); if (cartIndex > -1) { var sourceIndex = cartItems[cartIndex].charCodeAt(0) - 65; - var cartItem = cartItems[cartIndex]; var saveSource = false; for (var i = cartItems.length; i--;) { if (i === cartIndex) { @@ -127,7 +127,7 @@ VuFind.register('cart', function Cart() { var inCart = 0; var msg = ""; var orig = getFullItems(); - $(selected).each(function cartCheckedItemsAdd(i) { + $(selected).each(function cartCheckedItemsAdd() { for (var x in orig) { if (this === orig[x]) { inCart++; diff --git a/themes/bootstrap3/js/common.js b/themes/bootstrap3/js/common.js index bd4bcd7eda9b827f34a492d3cab52313e9f32554..d92f31228e463c0f67fd2aca39c5d6c7843b8cbd 100644 --- a/themes/bootstrap3/js/common.js +++ b/themes/bootstrap3/js/common.js @@ -1,4 +1,5 @@ -/*global btoa, console, hexEncode, isPhoneNumberValid, Lightbox, rc4Encrypt, unescape */ +/*global isPhoneNumberValid, unescape */ +/* exported VuFind, htmlEncode, deparam, moreFacets, lessFacets, phoneNumberFormHandler, bulkFormHandler */ // IE 9< console polyfill window.console = window.console || {log: function polyfillLog() {}}; @@ -136,7 +137,6 @@ function bulkFormHandler(event, data) { VuFind.lightbox.alert(VuFind.translate('bulk_noitems_advice'), 'danger'); return false; } - var keys = []; for (var i in data) { if ('print' === data[i].name) { return true; diff --git a/themes/bootstrap3/js/embedded_record.js b/themes/bootstrap3/js/embedded_record.js index b11ed7642e52ac5b9256257ec13b44b8138c4e88..20633b0dbfd739b9dc9cb9f176e4c19f8461cbcd 100644 --- a/themes/bootstrap3/js/embedded_record.js +++ b/themes/bootstrap3/js/embedded_record.js @@ -1,4 +1,4 @@ -/* global checkSaveStatuses, sessionStorage, registerAjaxCommentRecord, registerTabEvents, setupRecordToolbar, syn_get_widget, VuFind */ +/* global checkSaveStatuses, sessionStorage, registerAjaxCommentRecord, registerTabEvents, syn_get_widget, VuFind */ VuFind.register('embedded', function embedded() { var _STORAGEKEY = 'vufind_search_open'; var _SEPERATOR = ':::'; diff --git a/themes/bootstrap3/js/facets.js b/themes/bootstrap3/js/facets.js index 9ca2759bbd35b69923c95170b59d7061f948e3ad..a19d6d4aceadb16ba611ac8b46c73d6b33fdfb95 100644 --- a/themes/bootstrap3/js/facets.js +++ b/themes/bootstrap3/js/facets.js @@ -1,4 +1,5 @@ /*global htmlEncode, VuFind */ +/* exported initFacetTree */ function buildFacetNodes(data, currentPath, allowExclude, excludeTitle, counts) { var json = []; @@ -79,12 +80,12 @@ function initFacetTree(treeNode, inSidebar) facetSort: sort, facetOperator: operator }, - function getFacetData(response, textStatus) { + function getFacetData(response/*, textStatus*/) { if (response.status === "OK") { var results = buildFacetNodes(response.data, currentPath, allowExclude, excludeTitle, inSidebar); treeNode.find('.fa-spinner').parent().remove(); if (inSidebar) { - treeNode.on('loaded.jstree open_node.jstree', function treeNodeOpen(e, data) { + treeNode.on('loaded.jstree open_node.jstree', function treeNodeOpen(/*e, data*/) { treeNode.find('ul.jstree-container-ul > li.jstree-node').addClass('list-group-item'); }); } @@ -104,7 +105,6 @@ VuFind.register('lightbox_facets', function LightboxFacets() { function lightboxFacetSorting() { var sortButtons = $('.js-facet-sort'); - var lastsort, lastlimit; function sortAjax(sort) { var list = $('#facet-list-' + sort); if (list.find('.js-facet-item').length === 0) { diff --git a/themes/bootstrap3/js/hierarchyTree.js b/themes/bootstrap3/js/hierarchyTree.js index 7a84efe5dbff5af19c39ea7ecadf07588332918e..62a8e482575cd4f07a82ec183a51826a0b01e1ac 100644 --- a/themes/bootstrap3/js/hierarchyTree.js +++ b/themes/bootstrap3/js/hierarchyTree.js @@ -1,13 +1,12 @@ -/*global hierarchySettings, VuFind */ +/*global VuFind */ var hierarchyID, recordID, htmlID, hierarchyContext; -var baseTreeSearchFullURL; /* Utility functions */ function htmlEncodeId(id) { return id.replace(/\W/g, "-"); // Also change Hierarchy/TreeRenderer/JSTree.php } -function html_entity_decode(string, quote_style) { +function html_entity_decode(string) { var hash_map = { '&': '&', '>': '>', @@ -60,7 +59,6 @@ var searchAjax = false; function doTreeSearch() { $('#treeSearchLoadingImg').removeClass('hidden'); var keyword = $("#treeSearchText").val(); - var type = $("#treeSearchType").val(); if (keyword.length === 0) { $('#hierarchyTree').find('.jstree-search').removeClass('jstree-search'); var tree = $('#hierarchyTree').jstree(true); @@ -150,7 +148,7 @@ $(document).ready(function hierarchyTreeReady() { $("#hierarchyLoading").removeClass('hide'); $("#hierarchyTree") - .bind("ready.jstree", function jsTreeReady(event, data) { + .bind("ready.jstree", function jsTreeReady(/*event, data*/) { $("#hierarchyLoading").addClass('hide'); var tree = $("#hierarchyTree").jstree(true); tree.select_node(htmlID); @@ -194,13 +192,13 @@ $(document).ready(function hierarchyTreeReady() { 'id': recordID }, 'statusCode': { - 200: function jsTree200Status(json, status, request) { + 200: function jsTree200Status(json /*, status, request*/) { cb.call(this, json); }, - 204: function jsTree204Status(json, status, request) { // No Content + 204: function jsTree204Status(/*json, status, request*/) { // No Content buildTreeWithXml(cb); }, - 503: function jsTree503Status(json, status, request) { // Service Unavailable + 503: function jsTree503Status(/*json, status, request*/) { // Service Unavailable buildTreeWithXml(cb); } } diff --git a/themes/bootstrap3/js/hold.js b/themes/bootstrap3/js/hold.js index ed16e9a35cd2dc3c8109d70a9546ac5d13f08e23..904ed12b8433e1289fbe4ff28eb5dfe8b8108857 100644 --- a/themes/bootstrap3/js/hold.js +++ b/themes/bootstrap3/js/hold.js @@ -1,4 +1,5 @@ /*global VuFind */ +/* exported setUpHoldRequestForm */ function setUpHoldRequestForm(recordId) { $('#requestGroupId').change(function requestGroupChange() { var $emptyOption = $("#pickUpLocation option[value='']"); @@ -32,7 +33,7 @@ function setUpHoldRequestForm(recordId) { $('#pickUpLocationLabel i').removeClass("fa fa-spinner icon-spin"); $('#pickUpLocation').removeAttr('disabled'); }) - .fail(function holdPickupLocationsFail(response) { + .fail(function holdPickupLocationsFail(/*response*/) { $('#pickUpLocationLabel i').removeClass("fa fa-spinner icon-spin"); $('#pickUpLocation').removeAttr('disabled'); }); diff --git a/themes/bootstrap3/js/ill.js b/themes/bootstrap3/js/ill.js index 76de720b4f738e74a62a05b236a40dc39f1dd9e5..2c8af1381da7890f67cdfa614c0d790173b4fc44 100644 --- a/themes/bootstrap3/js/ill.js +++ b/themes/bootstrap3/js/ill.js @@ -1,4 +1,5 @@ /*global VuFind */ +/* exported setUpILLRequestForm */ function setUpILLRequestForm(recordId) { $("#ILLRequestForm #pickupLibrary").change(function illPickupChange() { $("#ILLRequestForm #pickupLibraryLocation option").remove(); @@ -23,7 +24,7 @@ function setUpILLRequestForm(recordId) { }); $("#ILLRequestForm #pickupLibraryLocationLabel i").removeClass("fa fa-spinner icon-spin"); }) - .fail(function illPickupLocationsFail(response) { + .fail(function illPickupLocationsFail(/*response*/) { $("#ILLRequestForm #pickupLibraryLocationLabel i").removeClass("fa fa-spinner icon-spin"); }); }); diff --git a/themes/bootstrap3/js/lightbox.js b/themes/bootstrap3/js/lightbox.js index 5d00ec2075be6bc961f295f1fc64e05d44c3decf..579d3dcbecfb113df4272c501496076578f1d3a1 100644 --- a/themes/bootstrap3/js/lightbox.js +++ b/themes/bootstrap3/js/lightbox.js @@ -8,10 +8,10 @@ VuFind.register('lightbox', function Lightbox() { // Elements var _modal, _modalBody, _clickedButton = null; // Utilities - function storeClickedStatus() { + function _storeClickedStatus() { _clickedButton = this; } - function html(content) { + function _html(content) { _modalBody.html(content); // Set or update title if we have one if (_lightboxTitle !== '') { @@ -44,7 +44,7 @@ VuFind.register('lightbox', function Lightbox() { /** * Reload the page without causing trouble with POST parameters while keeping hash */ - function refreshPage() { + function _refreshPage() { var parts = window.location.href.split('#'); if (typeof parts[1] === 'undefined') { window.location.href = window.location.href; @@ -184,7 +184,7 @@ VuFind.register('lightbox', function Lightbox() { /** * Evaluate a callback */ - function evalCallback(callback, event, data) { + function _evalCallback(callback, event, data) { if ('function' === typeof window[callback]) { return window[callback](event, data); } else { @@ -200,7 +200,7 @@ VuFind.register('lightbox', function Lightbox() { * data-lightbox-post = post data * data-lightbox-title = Lightbox title (overrides any title the page provides) */ - function constrainLink(event) { + function _constrainLink(event) { if (typeof $(this).data('lightboxIgnore') != 'undefined' || this.attributes.href.value.charAt(0) === '#') { return true; } @@ -232,7 +232,7 @@ VuFind.register('lightbox', function Lightbox() { * * data-lightbox-ignore = do not handle clicking this button in lightbox */ - function formSubmit(event) { + function _formSubmit(event) { // Gather data var form = event.target; var data = $(form).serializeArray(); diff --git a/themes/bootstrap3/js/openurl.js b/themes/bootstrap3/js/openurl.js index b3a0e726b2e2cc5ecfe4ec5cefd54ac4d5fc3780..e5c674a56a8be431977f810396aa2bbc1b307608 100644 --- a/themes/bootstrap3/js/openurl.js +++ b/themes/bootstrap3/js/openurl.js @@ -1,6 +1,6 @@ /*global extractClassParams, VuFind */ VuFind.register('openurl', function OpenUrl() { - function loadResolverLinks($target, openUrl, searchClassId) { + function _loadResolverLinks($target, openUrl, searchClassId) { $target.addClass('ajax_availability'); var url = VuFind.path + '/AJAX/JSON?' + $.param({method:'getResolverLinks',openurl:openUrl,searchClassId:searchClassId}); $.ajax({ diff --git a/themes/bootstrap3/js/preview.js b/themes/bootstrap3/js/preview.js index 76e423ee25f4b6b9cb3e6ac8061626ccb2fb7890..37ef7f531b103a5b9cc2253ec25a93b83d5d67a9 100644 --- a/themes/bootstrap3/js/preview.js +++ b/themes/bootstrap3/js/preview.js @@ -1,3 +1,5 @@ +/* exported processGBSBookInfo, processOLBookInfo, processHTBookInfo */ + // functions to get rights codes for previews function getHathiOptions() { return $('[class*="hathiPreviewSpan"]').attr("class").split('__')[1].split(','); diff --git a/themes/bootstrap3/js/pubdate_vis.js b/themes/bootstrap3/js/pubdate_vis.js index 290c28a881bce7d00f821ec5fb6082452e665e57..1fac0bbb65c266350668665a85832fb403767c42 100644 --- a/themes/bootstrap3/js/pubdate_vis.js +++ b/themes/bootstrap3/js/pubdate_vis.js @@ -1,4 +1,5 @@ /*global htmlEncode*/ +/* exported loadVis */ function PadDigits(number, totalDigits) { var n = number <= 0 ? 1 : number; diff --git a/themes/bootstrap3/js/record.js b/themes/bootstrap3/js/record.js index bee2918234104861cb4555880f13c570dd0d3c0e..751df8cd23f190dca80252944e1525a7539c3ae4 100644 --- a/themes/bootstrap3/js/record.js +++ b/themes/bootstrap3/js/record.js @@ -1,4 +1,5 @@ /*global deparam, syn_get_widget, userIsLoggedIn, VuFind */ +/* exported ajaxTagUpdate, recordDocReady */ /** * Functions and event handlers specific to record pages. @@ -23,19 +24,19 @@ function checkRequestIsValid(element, requestType) { $(element).remove(); } }) - .fail(function checkValidFail(response) { + .fail(function checkValidFail(/*response*/) { $(element).remove(); }); } function setUpCheckRequest() { - $('.checkRequest').each(function checkRequest(i) { + $('.checkRequest').each(function checkRequest() { checkRequestIsValid(this, 'Hold'); }); - $('.checkStorageRetrievalRequest').each(function checkStorageRetrievalRequest(i) { + $('.checkStorageRetrievalRequest').each(function checkStorageRetrievalRequest() { checkRequestIsValid(this, 'StorageRetrievalRequest'); }); - $('.checkILLRequest').each(function checkILLRequest(i) { + $('.checkILLRequest').each(function checkILLRequest() { checkRequestIsValid(this, 'ILLRequest'); }); } @@ -46,7 +47,7 @@ function deleteRecordComment(element, recordId, recordSource, commentId) { dataType: 'json', url: url }) - .done(function deleteCommentDone(response) { + .done(function deleteCommentDone(/*response*/) { $($(element).closest('.comment')[0]).remove(); }); } @@ -89,7 +90,7 @@ function registerAjaxCommentRecord() { data: data, dataType: 'json' }) - .done(function addCommentDone(response) { + .done(function addCommentDone(/*response, textStatus*/) { var $tab = $(form).closest('.tab-pane'); refreshCommentList($tab, id, recordSource); $(form).find('textarea[name="comment"]').val(''); @@ -223,7 +224,7 @@ function applyRecordTabHash() { $(window).on('hashchange', applyRecordTabHash); function recordDocReady() { - $('.record-tabs .nav-tabs a').click(function recordTabsClick(e) { + $('.record-tabs .nav-tabs a').click(function recordTabsClick() { var $li = $(this).parent(); // If it's an active tab, click again to follow to a shareable link. if ($li.hasClass('active')) {