diff --git a/themes/bootstrap3/js/advanced_search.js b/themes/bootstrap3/js/advanced_search.js index deab40e80f3b4fc6b4c74e4699c862e1e059f2a1..e174fafb944600a589a9f0cbc10774ceef1ee6bf 100644 --- a/themes/bootstrap3/js/advanced_search.js +++ b/themes/bootstrap3/js/advanced_search.js @@ -96,7 +96,7 @@ function addGroup(_firstTerm, _firstField, _join) { $('#groupPlaceHolder').before($newGroup); // Populate groupLength[nextGroup] = 0; - addSearch(nextGroup, {term:firstTerm, field:firstField}); + addSearch(nextGroup, {term: firstTerm, field: firstField}); // Show join menu if (nextGroup > 0) { $('#groupJoin').removeClass('hidden'); diff --git a/themes/bootstrap3/js/cart.js b/themes/bootstrap3/js/cart.js index d55527f58f19b38ef9b1a708f88d258ad66c5233..d764a2850f8151d87f493dac0e5b34effa3ca2bc 100644 --- a/themes/bootstrap3/js/cart.js +++ b/themes/bootstrap3/js/cart.js @@ -187,8 +187,8 @@ VuFind.register('cart', function Cart() { var $form = $('form[name="bulkActionForm"]'); _registerUpdate($form); } - $("#updateCart, #bottom_updateCart").popover({content:'', html:true, trigger:'manual'}); - } + $("#updateCart, #bottom_updateCart").popover({content: '', html: true, trigger: 'manual'}); + }; // Reveal return { diff --git a/themes/bootstrap3/js/check_item_statuses.js b/themes/bootstrap3/js/check_item_statuses.js index 1ed0390522a1fec8f57916c633a828b53ba67e81..985427d4e5a39c9b40a14bb7cbe8b5a935ae4156 100644 --- a/themes/bootstrap3/js/check_item_statuses.js +++ b/themes/bootstrap3/js/check_item_statuses.js @@ -24,7 +24,7 @@ function checkItemStatuses(_container) { dataType: 'json', method: 'POST', url: VuFind.path + '/AJAX/JSON?method=getItemStatuses', - data: {'id':data} + data: {'id': data} }) .done(function checkItemStatusDone(response) { $.each(response.data, function checkItemDoneEach(i, result) { diff --git a/themes/bootstrap3/js/check_save_statuses.js b/themes/bootstrap3/js/check_save_statuses.js index 123533f46c04c384790eb65b2c35c625be34b8ca..a18e4c6787f025748b1d43de8921baa9bcd4eb22 100644 --- a/themes/bootstrap3/js/check_save_statuses.js +++ b/themes/bootstrap3/js/check_save_statuses.js @@ -11,7 +11,10 @@ function checkSaveStatuses(container) { if ($(record).find('.hiddenId').length === 0 || $(record).find('.hiddenSource').length === 0) { return null; } - var datum = {'id':$(record).find('.hiddenId').val(), 'source':$(record).find('.hiddenSource')[0].value}; + var datum = { + id: $(record).find('.hiddenId').val(), + source: $(record).find('.hiddenSource')[0].value + }; var key = datum.source + '|' + datum.id; if (typeof elements[key] === 'undefined') { elements[key] = $(); @@ -30,7 +33,7 @@ function checkSaveStatuses(container) { dataType: 'json', method: 'POST', url: VuFind.path + '/AJAX/JSON?method=getSaveStatuses', - data: {'id':ids, 'source':srcs} + data: {id: ids, source: srcs} }) .done(function checkSaveStatusDone(response) { for (var sel in response.data) { diff --git a/themes/bootstrap3/js/common.js b/themes/bootstrap3/js/common.js index d92f31228e463c0f67fd2aca39c5d6c7843b8cbd..fc9ec1d92a21e6dc589f8331f7413a3fb301109f 100644 --- a/themes/bootstrap3/js/common.js +++ b/themes/bootstrap3/js/common.js @@ -180,13 +180,13 @@ function setupAutocomplete() { $.fn.autocomplete.ajax({ url: VuFind.path + '/AJAX/JSON', data: { - q:query, - method:'getACSuggestions', - searcher:searcher.searcher, - type:searcher.type ? searcher.type : $(input).closest('.searchForm').find('.searchForm_type').val(), - hiddenFilters:hiddenFilters + q: query, + method: 'getACSuggestions', + searcher: searcher.searcher, + type: searcher.type ? searcher.type : $(input).closest('.searchForm').find('.searchForm_type').val(), + hiddenFilters: hiddenFilters }, - dataType:'json', + dataType: 'json', success: function autocompleteJSON(json) { if (json.data.length > 0) { var datums = []; diff --git a/themes/bootstrap3/js/embedGBS.js b/themes/bootstrap3/js/embedGBS.js index ae81464ebeed323816e8dcb0e1ea3296bf22fbc7..515a6fca77b7be78268304c174d0c782592808f2 100644 --- a/themes/bootstrap3/js/embedGBS.js +++ b/themes/bootstrap3/js/embedGBS.js @@ -2,7 +2,7 @@ // we don't need to wait for dom ready since lang is in the dom root var lang = document.documentElement.getAttribute('lang'); -google.load("books", "0", {"language":lang}); +google.load("books", "0", { language: lang }); function initialize() { var bibkeys = getBibKeyString().split(/\s+/); diff --git a/themes/bootstrap3/js/hierarchyTree.js b/themes/bootstrap3/js/hierarchyTree.js index 62a8e482575cd4f07a82ec183a51826a0b01e1ac..a2caa4f84143f030219e3e2d7181ee42f850907a 100644 --- a/themes/bootstrap3/js/hierarchyTree.js +++ b/themes/bootstrap3/js/hierarchyTree.js @@ -70,10 +70,10 @@ function doTreeSearch() { searchAjax.abort(); } searchAjax = $.ajax({ - "url" : VuFind.path + '/Hierarchy/SearchTree?' + $.param({ - 'lookfor': keyword, - 'hierarchyID': hierarchyID, - 'type': $("#treeSearchType").val() + url: VuFind.path + '/Hierarchy/SearchTree?' + $.param({ + lookfor: keyword, + hierarchyID: hierarchyID, + type: $("#treeSearchType").val() }) + "&format=true" }) .done(function searchTreeAjaxDone(data) { @@ -106,16 +106,14 @@ function buildJSONNodes(xml) { var id = content.children("name[class='JSTreeID']"); var name = content.children('name[href]'); jsonNode.push({ - 'id': htmlEncodeId(id.text()), - 'text': name.text(), - 'li_attr': { - 'recordid': id.text() + id: htmlEncodeId(id.text()), + text: name.text(), + li_attr: { recordid: id.text() }, + a_attr: { + href: name.attr('href'), + title: name.text() }, - 'a_attr': { - 'href': name.attr('href'), - 'title': name.text() - }, - 'type': name.attr('href').match(/\/Collection\//) ? 'collection' : 'record', + type: name.attr('href').match(/\/Collection\//) ? 'collection' : 'record', children: buildJSONNodes(this) }); }); @@ -124,12 +122,12 @@ function buildJSONNodes(xml) { function buildTreeWithXml(cb) { $.ajax({ - 'url': VuFind.path + '/Hierarchy/GetTree', - 'data': { - 'hierarchyID': hierarchyID, - 'id': recordID, - 'context': hierarchyContext, - 'mode': 'Tree' + url: VuFind.path + '/Hierarchy/GetTree', + data: { + hierarchyID: hierarchyID, + id: recordID, + context: hierarchyContext, + mode: 'Tree' } }) .done(function getTreeDone(xml) { @@ -182,16 +180,16 @@ $(document).ready(function hierarchyTreeReady() { } }) .jstree({ - 'plugins': ['search','types'], - 'core' : { - 'data' : function jsTreeCoreData(obj, cb) { + plugins: ['search','types'], + core: { + data: function jsTreeCoreData(obj, cb) { $.ajax({ - 'url': VuFind.path + '/Hierarchy/GetTreeJSON', - 'data': { - 'hierarchyID': hierarchyID, - 'id': recordID + url: VuFind.path + '/Hierarchy/GetTreeJSON', + data: { + hierarchyID: hierarchyID, + id: recordID }, - 'statusCode': { + statusCode: { 200: function jsTree200Status(json /*, status, request*/) { cb.call(this, json); }, @@ -205,12 +203,12 @@ $(document).ready(function hierarchyTreeReady() { }); } }, - 'types' : { - 'record': { - 'icon':'fa fa-file-o' + types: { + record: { + icon: 'fa fa-file-o' }, - 'collection': { - 'icon':'fa fa-folder' + collection: { + icon: 'fa fa-folder' } } }); diff --git a/themes/bootstrap3/js/ill.js b/themes/bootstrap3/js/ill.js index 2c8af1381da7890f67cdfa614c0d790173b4fc44..72272194797181e1e94957c490b7a4494decc2ca 100644 --- a/themes/bootstrap3/js/ill.js +++ b/themes/bootstrap3/js/ill.js @@ -6,7 +6,7 @@ function setUpILLRequestForm(recordId) { $("#ILLRequestForm #pickupLibraryLocationLabel i").addClass("fa fa-spinner icon-spin"); var url = VuFind.path + '/AJAX/JSON?' + $.param({ id: recordId, - method:'getLibraryPickupLocations', + method: 'getLibraryPickupLocations', pickupLib: $("#ILLRequestForm #pickupLibrary").val() }); $.ajax({ diff --git a/themes/bootstrap3/js/lightbox.js b/themes/bootstrap3/js/lightbox.js index 579d3dcbecfb113df4272c501496076578f1d3a1..d76ea8a752b844e3a57b9801285579629a0779a2 100644 --- a/themes/bootstrap3/js/lightbox.js +++ b/themes/bootstrap3/js/lightbox.js @@ -176,10 +176,10 @@ VuFind.register('lightbox', function Lightbox() { showAlert(VuFind.translate('error_occurred'), 'danger'); }); return _xhr; - } + }; function reload() { - ajax({url:_currentUrl || _originalUrl}); - } + ajax({ url: _currentUrl || _originalUrl }); + }; /** * Evaluate a callback @@ -236,11 +236,11 @@ VuFind.register('lightbox', function Lightbox() { // Gather data var form = event.target; var data = $(form).serializeArray(); - data.push({'name':'layout', 'value':'lightbox'}); // Return in lightbox, please + data.push({ name: 'layout', value: 'lightbox' }); // Return in lightbox, please // Add submit button information var submit = $(_clickedButton); _clickedButton = null; - var buttonData = {'name':name, 'value':1}; + var buttonData = { name: name, 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 e5c674a56a8be431977f810396aa2bbc1b307608..fb9312fedafc2156c673be8c78b647d927d9baf2 100644 --- a/themes/bootstrap3/js/openurl.js +++ b/themes/bootstrap3/js/openurl.js @@ -2,7 +2,11 @@ VuFind.register('openurl', function OpenUrl() { function _loadResolverLinks($target, openUrl, searchClassId) { $target.addClass('ajax_availability'); - var url = VuFind.path + '/AJAX/JSON?' + $.param({method:'getResolverLinks',openurl:openUrl,searchClassId:searchClassId}); + var url = VuFind.path + '/AJAX/JSON?' + $.param({ + method: 'getResolverLinks', + openurl: openUrl, + searchClassId: searchClassId + }); $.ajax({ dataType: 'json', url: url diff --git a/themes/bootstrap3/js/record.js b/themes/bootstrap3/js/record.js index 751df8cd23f190dca80252944e1525a7539c3ae4..ffa1be627bc845deae9e1c097a2d97f5efd541b8 100644 --- a/themes/bootstrap3/js/record.js +++ b/themes/bootstrap3/js/record.js @@ -9,7 +9,12 @@ function checkRequestIsValid(element, requestType) { var vars = deparam(element.href); vars.id = recordId; - var url = VuFind.path + '/AJAX/JSON?' + $.param({method:'checkRequestIsValid', id: recordId, requestType: requestType, data: vars}); + var url = VuFind.path + '/AJAX/JSON?' + $.param({ + method: 'checkRequestIsValid', + id: recordId, + requestType: requestType, + data: vars + }); $.ajax({ dataType: 'json', cache: false, @@ -42,7 +47,7 @@ function setUpCheckRequest() { } function deleteRecordComment(element, recordId, recordSource, commentId) { - var url = VuFind.path + '/AJAX/JSON?' + $.param({method:'deleteRecordComment',id:commentId}); + var url = VuFind.path + '/AJAX/JSON?' + $.param({ method: 'deleteRecordComment', id: commentId }); $.ajax({ dataType: 'json', url: url @@ -53,7 +58,11 @@ function deleteRecordComment(element, recordId, recordSource, commentId) { } function refreshCommentList($target, recordId, recordSource) { - var url = VuFind.path + '/AJAX/JSON?' + $.param({method:'getRecordCommentsAsHTML',id:recordId,'source':recordSource}); + var url = VuFind.path + '/AJAX/JSON?' + $.param({ + method: 'getRecordCommentsAsHTML', + id: recordId, + source: recordSource + }); $.ajax({ dataType: 'json', url: url @@ -78,15 +87,15 @@ function registerAjaxCommentRecord() { var form = this; var id = form.id.value; var recordSource = form.source.value; - var url = VuFind.path + '/AJAX/JSON?' + $.param({method:'commentRecord'}); + var url = VuFind.path + '/AJAX/JSON?' + $.param({ method: 'commentRecord' }); var data = { - comment:form.comment.value, - id:id, - source:recordSource + comment: form.comment.value, + id: id, + source: recordSource }; $.ajax({ type: 'POST', - url: url, + url: url, data: data, dataType: 'json' }) @@ -169,7 +178,11 @@ function refreshTagList(_target, _loggedin) { var recordSource = $(target).find('.hiddenSource').val(); var $tagList = $(target).find('.tagList'); if ($tagList.length > 0) { - var url = VuFind.path + '/AJAX/JSON?' + $.param({method:'getRecordTags',id:recordId,'source':recordSource}); + var url = VuFind.path + '/AJAX/JSON?' + $.param({ + method: 'getRecordTags', + id: recordId, + source: recordSource + }); $.ajax({ dataType: 'html', url: url @@ -193,13 +206,13 @@ function ajaxTagUpdate(_link, tag, _remove) { var recordId = $target.find('.hiddenId').val(); var recordSource = $target.find('.hiddenSource').val(); $.ajax({ - url:VuFind.path + '/AJAX/JSON?method=tagRecord', - method:'POST', - data:{ - tag:'"' + tag.replace(/\+/g, ' ') + '"', - id:recordId, - source:recordSource, - remove:remove + url: VuFind.path + '/AJAX/JSON?method=tagRecord', + method: 'POST', + data: { + tag: '"' + tag.replace(/\+/g, ' ') + '"', + id: recordId, + source: recordSource, + remove: remove } }) .always(function tagRecordAlways() {