From dd63ab59d34b60b1973c11d643ac7ddd711ac716 Mon Sep 17 00:00:00 2001 From: Chris Hallberg <crhallberg@gmail.com> Date: Tue, 31 May 2016 15:12:17 -0400 Subject: [PATCH] no-shadow --- themes/bootstrap3/js/check_save_statuses.js | 6 ++--- themes/bootstrap3/js/common.js | 4 +-- themes/bootstrap3/js/hierarchyTree.js | 18 ++++++------- themes/bootstrap3/js/lightbox.js | 29 +++++++++++---------- 4 files changed, 29 insertions(+), 28 deletions(-) diff --git a/themes/bootstrap3/js/check_save_statuses.js b/themes/bootstrap3/js/check_save_statuses.js index b033f1c3dd3..84247f4db1f 100644 --- a/themes/bootstrap3/js/check_save_statuses.js +++ b/themes/bootstrap3/js/check_save_statuses.js @@ -24,9 +24,9 @@ function checkSaveStatuses(container) { if (data.length) { var ids = []; var srcs = []; - for (var i = 0; i < data.length; i++) { - ids.push(data[i].id); - srcs.push(data[i].source); + for (var d = 0; d < data.length; d++) { + ids.push(data[d].id); + srcs.push(data[d].source); } $.ajax({ dataType: 'json', diff --git a/themes/bootstrap3/js/common.js b/themes/bootstrap3/js/common.js index 6c7ab8287e9..78e69bba976 100644 --- a/themes/bootstrap3/js/common.js +++ b/themes/bootstrap3/js/common.js @@ -190,8 +190,8 @@ function setupAutocomplete() { success: function autocompleteJSON(json) { if (json.data.length > 0) { var datums = []; - for (var i = 0; i < json.data.length; i++) { - datums.push(json.data[i]); + for (var j = 0; j < json.data.length; j++) { + datums.push(json.data[j]); } cb(datums); } else { diff --git a/themes/bootstrap3/js/hierarchyTree.js b/themes/bootstrap3/js/hierarchyTree.js index 6210a5f6f6a..9ec0d3232ab 100644 --- a/themes/bootstrap3/js/hierarchyTree.js +++ b/themes/bootstrap3/js/hierarchyTree.js @@ -24,9 +24,9 @@ function html_entity_decode(string, quote_style) { return tmp_str; } -function getRecord(recordID) { +function getRecord(id) { $.ajax({ - url: VuFind.path + '/Hierarchy/GetRecord?' + $.param({id: recordID}), + url: VuFind.path + '/Hierarchy/GetRecord?' + $.param({id: id}), dataType: 'html' }) .done(function getRecordDone(response) { @@ -34,7 +34,7 @@ function getRecord(recordID) { // Remove the old path highlighting $('#hierarchyTree a').removeClass("jstree-highlight"); // Add Current path highlighting - var jsTreeNode = $(":input[value='" + recordID + "']").parent(); + var jsTreeNode = $(":input[value='" + id + "']").parent(); jsTreeNode.children("a").addClass("jstree-highlight"); jsTreeNode.parents("li").children("a").addClass("jstree-highlight"); }); @@ -81,11 +81,11 @@ function doTreeSearch() { .done(function searchTreeAjaxDone(data) { if (data.results.length > 0) { $('#hierarchyTree').find('.jstree-search').removeClass('jstree-search'); - var tree = $('#hierarchyTree').jstree(true); - tree.close_all(); + var jstree = $('#hierarchyTree').jstree(true); + jstree.close_all(); for (var i = data.results.length; i--;) { var id = htmlEncodeId(data.results[i]); - tree._open_to(id); + jstree._open_to(id); } for (var j = data.results.length; j--;) { var tid = htmlEncodeId(data.results[j]); @@ -160,11 +160,11 @@ $(document).ready(function hierarchyTreeReady() { getRecord(recordID); } - $("#hierarchyTree").bind('select_node.jstree', function jsTreeSelect(e, data) { + $("#hierarchyTree").bind('select_node.jstree', function jsTreeSelect(e, resp) { if (hierarchyContext == "Record") { - window.location.href = data.node.a_attr.href; + window.location.href = resp.node.a_attr.href; } else { - getRecord(data.node.li_attr.recordid); + getRecord(resp.node.li_attr.recordid); } }); diff --git a/themes/bootstrap3/js/lightbox.js b/themes/bootstrap3/js/lightbox.js index 88f90ff9f4b..0a1f36f0320 100644 --- a/themes/bootstrap3/js/lightbox.js +++ b/themes/bootstrap3/js/lightbox.js @@ -11,8 +11,8 @@ VuFind.register('lightbox', function Lightbox() { function storeClickedStatus() { _clickedButton = this; } - function html(html) { - _modalBody.html(html); + function html(content) { + _modalBody.html(content); // Set or update title if we have one if (_lightboxTitle != '') { var h2 = _modalBody.find('h2:first-child'); @@ -80,23 +80,24 @@ VuFind.register('lightbox', function Lightbox() { * * data-lightbox-ignore = do not submit this form in lightbox */ - function update(html) { - if (!html.match) { + function update(content) { + if (!content.match) { return; } // Isolate successes - var htmlDiv = $('<div/>').html(html); + var htmlDiv = $('<div/>').html(content); var alerts = htmlDiv.find('.flash-message.alert-success'); if (alerts.length > 0) { showAlert(alerts[0].innerHTML, 'success'); return; } // Deframe HTML - if (html.match('<!DOCTYPE html>')) { - html = htmlDiv.find('.main > .container').html(); + var finalHTML = content; + if (content.match('<!DOCTYPE html>')) { + finalHTML = htmlDiv.find('.main > .container').html(); } // Fill HTML - _html(html); + _html(finalHTML); _modal.modal('show'); // Attach capturing events _modalBody.find('a').click(_constrainLink); @@ -138,14 +139,14 @@ VuFind.register('lightbox', function Lightbox() { } _xhr = $.ajax(obj); _xhr.always(function lbAjaxAlways() { _xhr = false; }) - .done(function lbAjaxDone(html, status, jq_xhr) { + .done(function lbAjaxDone(content, status, jq_xhr) { if (jq_xhr.status == 205) { _refreshPage(); return; } // Place Hold error isolation if (obj.url.match(/\/Record/) && (obj.url.match(/Hold\?/) || obj.url.match(/Request\?/))) { - var testDiv = $('<div/>').html(html); + var testDiv = $('<div/>').html(content); var error = testDiv.find('.flash-message.alert-danger'); if (error.length && testDiv.find('.record').length) { showAlert(error[0].innerHTML, 'danger'); @@ -156,7 +157,7 @@ VuFind.register('lightbox', function Lightbox() { obj.method // is a form && ((obj.url.match(/MyResearch/) && !obj.url.match(/Bulk/)) // that matches login/create account || obj.url.match(/catalogLogin/)) // or catalog login for holds - && $('<div/>').html(html).find('.flash-message.alert-danger').length == 0 // skip failed logins + && $('<div/>').html(content).find('.flash-message.alert-danger').length == 0 // skip failed logins ) { var eventResult = _emit('VuFind.lightbox.login', { originalUrl: _originalUrl, @@ -172,7 +173,7 @@ VuFind.register('lightbox', function Lightbox() { } _currentUrl = _originalUrl; // Now that we're logged in, where were we? } - _update(html); + _update(content); }) .fail(function lbAjaxFail() { showAlert(VuFind.translate('error_occurred'), 'danger'); @@ -263,8 +264,8 @@ VuFind.register('lightbox', function Lightbox() { } // onclose behavior if ('string' === typeof $(form).data('lightboxOnclose')) { - document.addEventListener('VuFind.lightbox.closed', function lightboxClosed(event) { - _evalCallback($(form).data('lightboxOnclose'), event); + document.addEventListener('VuFind.lightbox.closed', function lightboxClosed(ev) { + _evalCallback($(form).data('lightboxOnclose'), ev); }, false); } // Loading -- GitLab