diff --git a/themes/bootstrap3/js/cart.js b/themes/bootstrap3/js/cart.js index 4ae751100082ebf9ca4766aa4af799ea57900eb7..1bba92ed8c71c6abb8d0da295f9b0f0140efe8fc 100644 --- a/themes/bootstrap3/js/cart.js +++ b/themes/bootstrap3/js/cart.js @@ -36,7 +36,7 @@ function getFullCartItems() { function addItemToCart(id,source) { if(!source) { - source = VuFind.getDefaultSearchBackend(); + source = VuFind.defaultSearchBackend; } var cartItems = getCartItems(); var cartSources = getCartSources(); diff --git a/themes/bootstrap3/js/check_item_statuses.js b/themes/bootstrap3/js/check_item_statuses.js index 04dec21f4a7821ac3b15f5c275195a10892ca0ef..21089fd02f5049ee33d8b3e1c92152b21b280d1a 100644 --- a/themes/bootstrap3/js/check_item_statuses.js +++ b/themes/bootstrap3/js/check_item_statuses.js @@ -12,7 +12,7 @@ function checkItemStatuses() { $.ajax({ dataType: 'json', method: 'POST', - url: VuFind.getPath() + '/AJAX/JSON?method=getItemStatuses', + url: VuFind.path + '/AJAX/JSON?method=getItemStatuses', data: {id:id} }) .done(function(response) { diff --git a/themes/bootstrap3/js/check_save_statuses.js b/themes/bootstrap3/js/check_save_statuses.js index d1c9e6966c7c1f2707df6dceb5f9a94da78f73ef..1ff432fbb676eec2c4ddb4c9c2ebe8ea6314e1e0 100644 --- a/themes/bootstrap3/js/check_save_statuses.js +++ b/themes/bootstrap3/js/check_save_statuses.js @@ -20,7 +20,7 @@ function checkSaveStatuses() { $.ajax({ dataType: 'json', method: 'POST', - url: VuFind.getPath() + '/AJAX/JSON?method=getSaveStatuses', + url: VuFind.path + '/AJAX/JSON?method=getSaveStatuses', data: {id:ids, 'source':srcs} }) .done(function(response) { diff --git a/themes/bootstrap3/js/common.js b/themes/bootstrap3/js/common.js index de3aa0505695d1a05a593d76756c19b8f1a9f3f5..833e45a6c2a0d314f2d865d72ea9fd2afdcf319b 100644 --- a/themes/bootstrap3/js/common.js +++ b/themes/bootstrap3/js/common.js @@ -3,20 +3,17 @@ // IE 9< console polyfill window.console = window.console || {log: function () {}}; -function VuFindNamespace(p, s, dsb) { - var defaultSearchBackend = dsb; - var path = p; - var strings = s; +var VuFind = { + defaultSearchBackend: null, + path: null, + translations: {}, - var getDefaultSearchBackend = function() { return defaultSearchBackend; }; - var getPath = function() { return path; }; - var translate = function(op) { return strings[op] || op; }; - - return { - getDefaultSearchBackend: getDefaultSearchBackend, - getPath: getPath, - translate: translate - }; + addTranslations: function(s) { + for (var i in s) { + this.translations[i] = s[i]; + } + }, + translate: function(op) { return this.translations[op] || op; } } /* --- GLOBAL FUNCTIONS --- */ @@ -116,7 +113,7 @@ function bulkActionSubmit($form) { } if (submit == 'print') { //redirect page - var url = VuFind.getPath() + '/Records/Home?print=true'; + var url = VuFind.path + '/Records/Home?print=true'; for(var i=0;i<checks.length;i++) { url += '&id[]='+checks[i].value; } @@ -198,7 +195,7 @@ function newAccountHandler(html) { // This is a full handler for the login form function ajaxLogin(form) { Lightbox.ajax({ - url: VuFind.getPath() + '/AJAX/JSON?method=getSalt', + url: VuFind.path + '/AJAX/JSON?method=getSalt', dataType: 'json' }) .done(function(response) { @@ -224,7 +221,7 @@ function ajaxLogin(form) { // login via ajax Lightbox.ajax({ type: 'POST', - url: VuFind.getPath() + '/AJAX/JSON?method=login', + url: VuFind.path + '/AJAX/JSON?method=login', dataType: 'json', data: params }) @@ -310,7 +307,7 @@ function setupAutocomplete() { hiddenFilters.push($(this).val()); }); $.fn.autocomplete.ajax({ - url: VuFind.getPath() + '/AJAX/JSON', + url: VuFind.path + '/AJAX/JSON', data: { q:query, method:'getACSuggestions', @@ -431,7 +428,7 @@ $(document).ready(function() { window.print(); }); // Make an ajax call to ensure that ajaxStop is triggered - $.getJSON(VuFind.getPath() + '/AJAX/JSON', {method: 'keepAlive'}); + $.getJSON(VuFind.path + '/AJAX/JSON', {method: 'keepAlive'}); } // Advanced facets diff --git a/themes/bootstrap3/js/facets.js b/themes/bootstrap3/js/facets.js index 77461c61c55a3524471385a1053876f883562bc5..f906209f4c0748579e40c41d05f456ea01003b71 100644 --- a/themes/bootstrap3/js/facets.js +++ b/themes/bootstrap3/js/facets.js @@ -72,7 +72,7 @@ function initFacetTree(treeNode, inSidebar) } else { treeNode.prepend('<div><i class="fa fa-spinner fa-spin"></i><div>'); } - $.getJSON(VuFind.getPath() + '/AJAX/JSON?' + query, + $.getJSON(VuFind.path + '/AJAX/JSON?' + query, { method: "getFacetData", facetName: facet, diff --git a/themes/bootstrap3/js/hierarchyTree.js b/themes/bootstrap3/js/hierarchyTree.js index a4f24c9de44058c5eeb5aacac0a940cb1abf12cf..3c228b4f8961083b84cba2a8536453f23c03cf14 100644 --- a/themes/bootstrap3/js/hierarchyTree.js +++ b/themes/bootstrap3/js/hierarchyTree.js @@ -26,7 +26,7 @@ function html_entity_decode(string, quote_style) { function getRecord(recordID) { $.ajax({ - url: VuFind.getPath() + '/Hierarchy/GetRecord?' + $.param({id: recordID}), + url: VuFind.path + '/Hierarchy/GetRecord?' + $.param({id: recordID}), dataType: 'html' }) .done(function(response) { @@ -72,7 +72,7 @@ function doTreeSearch() { searchAjax.abort(); } searchAjax = $.ajax({ - "url" : VuFind.getPath() + '/Hierarchy/SearchTree?' + $.param({ + "url" : VuFind.path + '/Hierarchy/SearchTree?' + $.param({ 'lookfor': keyword, 'hierarchyID': hierarchyID, 'type': $("#treeSearchType").val() @@ -126,7 +126,7 @@ function buildJSONNodes(xml) { function buildTreeWithXml(cb) { $.ajax({ - 'url': VuFind.getPath() + '/Hierarchy/GetTree', + 'url': VuFind.path + '/Hierarchy/GetTree', 'data': { 'hierarchyID': hierarchyID, 'id': recordID, @@ -188,7 +188,7 @@ $(document).ready(function() { 'core' : { 'data' : function (obj, cb) { $.ajax({ - 'url': VuFind.getPath() + '/Hierarchy/GetTreeJSON', + 'url': VuFind.path + '/Hierarchy/GetTreeJSON', 'data': { 'hierarchyID': hierarchyID, 'id': recordID diff --git a/themes/bootstrap3/js/hold.js b/themes/bootstrap3/js/hold.js index a34780b1ba58309e7f4afe229bcca6c69294080c..8e9b85948134a90370bd8489bfed678f6c68fabf 100644 --- a/themes/bootstrap3/js/hold.js +++ b/themes/bootstrap3/js/hold.js @@ -17,7 +17,7 @@ function setUpHoldRequestForm(recordId) { data: params, dataType: 'json', cache: false, - url: VuFind.getPath() + '/AJAX/JSON' + url: VuFind.path + '/AJAX/JSON' }) .done(function(response) { var defaultValue = $('#pickUpLocation').data('default'); diff --git a/themes/bootstrap3/js/ill.js b/themes/bootstrap3/js/ill.js index cdef12d3c19d6a396b1d9843e11c2650bbd9f4de..7b67942cac583570c8d8a242b2e700b701edb0f1 100644 --- a/themes/bootstrap3/js/ill.js +++ b/themes/bootstrap3/js/ill.js @@ -3,7 +3,7 @@ function setUpILLRequestForm(recordId) { $("#ILLRequestForm #pickupLibrary").change(function() { $("#ILLRequestForm #pickupLibraryLocation option").remove(); $("#ILLRequestForm #pickupLibraryLocationLabel i").addClass("fa fa-spinner icon-spin"); - var url = VuFind.getPath() + '/AJAX/JSON?' + $.param({ + var url = VuFind.path + '/AJAX/JSON?' + $.param({ id: recordId, method:'getLibraryPickupLocations', pickupLib: $("#ILLRequestForm #pickupLibrary").val() diff --git a/themes/bootstrap3/js/keep_alive.js b/themes/bootstrap3/js/keep_alive.js index d0e45d79b4d8a6eb55a97ebba3b97c760de79639..7df79b51986210405d627d7bab6b0a70de0f2fe1 100644 --- a/themes/bootstrap3/js/keep_alive.js +++ b/themes/bootstrap3/js/keep_alive.js @@ -2,6 +2,6 @@ $(document).ready(function() { window.setInterval(function() { - $.getJSON(VuFind.getPath() + '/AJAX/JSON', {method: 'keepAlive'}); + $.getJSON(VuFind.path + '/AJAX/JSON', {method: 'keepAlive'}); }, keepAliveInterval * 1000); }); diff --git a/themes/bootstrap3/js/lightbox.js b/themes/bootstrap3/js/lightbox.js index 45dbcd28eb9fcb4ebcdc46a9d6321c591af78e39..a6c46d283f5a6493c0ec76319265016e1287d2da 100644 --- a/themes/bootstrap3/js/lightbox.js +++ b/themes/bootstrap3/js/lightbox.js @@ -271,7 +271,7 @@ var Lightbox = { */ get: function(controller, action, get, post, callback) { // Build URL - var url = VuFind.getPath()+'/AJAX/JSON?method=getLightbox&submodule='+controller+'&subaction='+action; + var url = VuFind.path+'/AJAX/JSON?method=getLightbox&submodule='+controller+'&subaction='+action; if(typeof get !== "undefined" && get !== {}) { url += '&'+$.param(get); } @@ -394,7 +394,7 @@ var Lightbox = { var POST = $form.attr('method') && $form.attr('method').toUpperCase() == 'POST'; if($form.attr('action')) { // Parse action location - var path = VuFind.getPath(); + var path = VuFind.path; var action = $form.attr('action').substring($form.attr('action').indexOf(path)+path.length+1); var params = action.split('?'); action = action.split('/'); @@ -420,7 +420,7 @@ function getListUrlFromHTML(html) { if (typeof listUrl === 'undefined') { var listID = fakePage.find('[name="listID"]'); if(listID.length > 0) { - listUrl = VuFind.getPath() + '/MyResearch/MyList/'+listID.val(); + listUrl = VuFind.path + '/MyResearch/MyList/'+listID.val(); } } var message = VuFind.translate('bulk_save_success'); @@ -484,7 +484,7 @@ $(document).ready(function() { Lightbox.addFormHandler('exportForm', function(evt) { Lightbox.ajax({ - url: VuFind.getPath() + '/AJAX/JSON?' + $.param({method:'exportFavorites'}), + url: VuFind.path + '/AJAX/JSON?' + $.param({method:'exportFavorites'}), type:'POST', dataType:'json', data:Lightbox.getFormData($(evt.target)) diff --git a/themes/bootstrap3/js/openurl.js b/themes/bootstrap3/js/openurl.js index 88f50d1dbd4b5937f35c498d7f2925fcc76226d2..7540bf15aefed499c374b4b0cda5724ff24e335b 100644 --- a/themes/bootstrap3/js/openurl.js +++ b/themes/bootstrap3/js/openurl.js @@ -2,7 +2,7 @@ function loadResolverLinks($target, openUrl, searchClassId) { $target.addClass('ajax_availability'); - var url = VuFind.getPath() + '/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 6ed8710bde7576b2bd61dc14bb3983bd99f6b6e5..fc9b2bbb914af83753cd88f619e9cee8b057221b 100644 --- a/themes/bootstrap3/js/record.js +++ b/themes/bootstrap3/js/record.js @@ -8,7 +8,7 @@ function checkRequestIsValid(element, requestType) { var vars = deparam(element.href); vars['id'] = recordId; - var url = VuFind.getPath() + '/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, @@ -41,7 +41,7 @@ function setUpCheckRequest() { } function deleteRecordComment(element, recordId, recordSource, commentId) { - var url = VuFind.getPath() + '/AJAX/JSON?' + $.param({method:'deleteRecordComment',id:commentId}); + var url = VuFind.path + '/AJAX/JSON?' + $.param({method:'deleteRecordComment',id:commentId}); $.ajax({ dataType: 'json', url: url @@ -52,7 +52,7 @@ function deleteRecordComment(element, recordId, recordSource, commentId) { } function refreshCommentList($target, recordId, recordSource) { - var url = VuFind.getPath() + '/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 @@ -77,7 +77,7 @@ function registerAjaxCommentRecord() { var form = this; var id = form.id.value; var recordSource = form.source.value; - var url = VuFind.getPath() + '/AJAX/JSON?' + $.param({method:'commentRecord'}); + var url = VuFind.path + '/AJAX/JSON?' + $.param({method:'commentRecord'}); var data = { comment:form.comment.value, id:id, @@ -134,7 +134,7 @@ function ajaxLoadTab($newTab, tabid, setHash) { // Parse out the base URL for the current record: var urlParts = document.URL.split(/[?#]/); var urlWithoutFragment = urlParts[0]; - var path = VuFind.getPath(); + var path = VuFind.path; var urlroot = null; if (path === '') { // special case -- VuFind installed at site root: @@ -175,7 +175,7 @@ function refreshTagList(target, loggedin) { var recordSource = $(target).find('.hiddenSource').val(); var $tagList = $(target).find('.tagList'); if ($tagList.length > 0) { - var url = VuFind.getPath() + '/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 @@ -203,7 +203,7 @@ function ajaxTagUpdate(link, tag, remove) { var recordId = $target.find('.hiddenId').val(); var recordSource = $target.find('.hiddenSource').val(); $.ajax({ - url:VuFind.getPath() + '/AJAX/JSON?method=tagRecord', + url:VuFind.path + '/AJAX/JSON?method=tagRecord', method:'POST', data:{ tag:'"'+tag.replace(/\+/g, ' ')+'"', diff --git a/themes/bootstrap3/js/vudl/record.js b/themes/bootstrap3/js/vudl/record.js index 9e62e5ab5cbeaa6eddbc5d37e1ad6c54f7a6001f..7aa7f4ae8823ea403323226d047b47f27f7ddd6e 100644 --- a/themes/bootstrap3/js/vudl/record.js +++ b/themes/bootstrap3/js/vudl/record.js @@ -50,7 +50,7 @@ function updateTechInfo(record) { if(typeof d.data.type !== "undefined") { $('#download-button .details').html(d.data.type+' ~ '+d.data.size); } - $('#file-download').attr('action', VuFind.getPath()+'/files/'+record.id+'/'+downloadSrc+'?download=true'); + $('#file-download').attr('action', VuFind.path+'/files/'+record.id+'/'+downloadSrc+'?download=true'); }) .fail(function(response, textStatus) { console.log(response, textStatus); diff --git a/themes/bootstrap3/templates/Recommend/EuropeanaResultsDeferred.phtml b/themes/bootstrap3/templates/Recommend/EuropeanaResultsDeferred.phtml index 626186af6ee6d0793bbc805e258001faa2268859..70c5271da00b1ca7ff8d0e94b49eb0e48bf4e7ca 100644 --- a/themes/bootstrap3/templates/Recommend/EuropeanaResultsDeferred.phtml +++ b/themes/bootstrap3/templates/Recommend/EuropeanaResultsDeferred.phtml @@ -1,6 +1,6 @@ <? // Set up Javascript for use below: - $loadJs = 'var url = VuFind.getPath() + "/AJAX/Recommend?' . $this->recommend->getUrlParams() . '";' + $loadJs = 'var url = VuFind.path + "/AJAX/Recommend?' . $this->recommend->getUrlParams() . '";' . "\$('#EuropeanaDeferredRecommend').load(url);"; ?> <div id="EuropeanaDeferredRecommend"> diff --git a/themes/bootstrap3/templates/Recommend/OpenLibrarySubjectsDeferred.phtml b/themes/bootstrap3/templates/Recommend/OpenLibrarySubjectsDeferred.phtml index abbddb3b7b532c59788fe4b7a7698c00d5cd3458..aec3a025b25b974582586aa881cd3ad9b734525e 100644 --- a/themes/bootstrap3/templates/Recommend/OpenLibrarySubjectsDeferred.phtml +++ b/themes/bootstrap3/templates/Recommend/OpenLibrarySubjectsDeferred.phtml @@ -1,6 +1,6 @@ <? // Set up Javascript for use below: - $loadJs = 'var url = VuFind.getPath() + "/AJAX/Recommend?' . $this->recommend->getUrlParams() . '";' + $loadJs = 'var url = VuFind.path + "/AJAX/Recommend?' . $this->recommend->getUrlParams() . '";' . "\$('#openLibraryDeferredRecommend').load(url);"; ?> <div id="openLibraryDeferredRecommend"> diff --git a/themes/bootstrap3/templates/Recommend/PubDateVisAjax.phtml b/themes/bootstrap3/templates/Recommend/PubDateVisAjax.phtml index fb19996e019d8a0187b4d197259c27c0ab4a6459..67f43cad8fdf1624d0108113c3e7d373404dc521 100644 --- a/themes/bootstrap3/templates/Recommend/PubDateVisAjax.phtml +++ b/themes/bootstrap3/templates/Recommend/PubDateVisAjax.phtml @@ -21,7 +21,7 @@ <div id="dateVisColorSettings"><!-- do not delete! used for passing CSS to Javascript --></div> <? $js = "loadVis('" . $this->recommend->getFacetFields() . "', '" - . $this->recommend->getSearchParams() . "', VuFind.getPath(), " + . $this->recommend->getSearchParams() . "', VuFind.path, " . $this->recommend->getZooming() . ");"; echo $this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, $js, 'SET'); ?> diff --git a/themes/bootstrap3/templates/Recommend/ResultGoogleMapAjax.phtml b/themes/bootstrap3/templates/Recommend/ResultGoogleMapAjax.phtml index 341f452897c30552befa4d7459fcf8477589c02d..6daed32b9a5a1fbccf6a034d0724d7daed06939c 100644 --- a/themes/bootstrap3/templates/Recommend/ResultGoogleMapAjax.phtml +++ b/themes/bootstrap3/templates/Recommend/ResultGoogleMapAjax.phtml @@ -96,7 +96,7 @@ var myOptions; var map; var infowindow = new google.maps.InfoWindow({maxWidth: 480, minWidth: 480}); function initialize() { - var url = VuFind.getPath()+'/AJAX/json?method=getMapData&<?=$searchParams ?>'; + var url = VuFind.path+'/AJAX/json?method=getMapData&<?=$searchParams ?>'; //alert('go: ' + url); $.getJSON(url, function(data){ //alert(data); @@ -171,7 +171,7 @@ var infowindow = new google.maps.InfoWindow({maxWidth: 480, minWidth: 480}); else{// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } - var ajaxUrl = VuFind.getPath()+'/AJAX/ResultGoogleMapInfo?limit=5&filter[]=long_lat%3A"' + marker.loc_facet+'"&<?=$searchParams ?>'; + var ajaxUrl = VuFind.path+'/AJAX/ResultGoogleMapInfo?limit=5&filter[]=long_lat%3A"' + marker.loc_facet+'"&<?=$searchParams ?>'; xmlhttp.open("GET", ajaxUrl, false); xmlhttp.send(); diff --git a/themes/bootstrap3/templates/Recommend/SummonBestBetsDeferred.phtml b/themes/bootstrap3/templates/Recommend/SummonBestBetsDeferred.phtml index 5a31f9811cc5efa3dfa09db356c9490c71d33f23..ef315eb767c576ac22d981d59cca5af909863573 100644 --- a/themes/bootstrap3/templates/Recommend/SummonBestBetsDeferred.phtml +++ b/themes/bootstrap3/templates/Recommend/SummonBestBetsDeferred.phtml @@ -1,6 +1,6 @@ <? // Set up Javascript for use below: - $loadJs = 'var url = VuFind.getPath() + "/AJAX/Recommend?' . $this->recommend->getUrlParams() . '";' + $loadJs = 'var url = VuFind.path + "/AJAX/Recommend?' . $this->recommend->getUrlParams() . '";' . "\$('#SummonDeferredBestBets').load(url);"; ?> <div id="SummonDeferredBestBets"> diff --git a/themes/bootstrap3/templates/Recommend/SummonDatabasesDeferred.phtml b/themes/bootstrap3/templates/Recommend/SummonDatabasesDeferred.phtml index 454d5f42e805e2cfafcf89894ac558d125ffbff5..0b9f2caa70d20cfe1852ebfcf944a1b566964b51 100644 --- a/themes/bootstrap3/templates/Recommend/SummonDatabasesDeferred.phtml +++ b/themes/bootstrap3/templates/Recommend/SummonDatabasesDeferred.phtml @@ -1,6 +1,6 @@ <? // Set up Javascript for use below: - $loadJs = 'var url = VuFind.getPath() + "/AJAX/Recommend?' . $this->recommend->getUrlParams() . '";' + $loadJs = 'var url = VuFind.path + "/AJAX/Recommend?' . $this->recommend->getUrlParams() . '";' . "\$('#SummonDeferredDatabases').load(url);"; ?> <div id="SummonDeferredDatabases"> diff --git a/themes/bootstrap3/templates/Recommend/SummonResultsDeferred.phtml b/themes/bootstrap3/templates/Recommend/SummonResultsDeferred.phtml index ed9b5d540068d96fa1310a27832172e45475f1ad..e97c79492b2c3998a02bef5818aefcc35a94feca 100644 --- a/themes/bootstrap3/templates/Recommend/SummonResultsDeferred.phtml +++ b/themes/bootstrap3/templates/Recommend/SummonResultsDeferred.phtml @@ -1,6 +1,6 @@ <? // Set up Javascript for use below: - $loadJs = 'var url = VuFind.getPath() + "/AJAX/Recommend?' . $this->recommend->getUrlParams() . '";' + $loadJs = 'var url = VuFind.path + "/AJAX/Recommend?' . $this->recommend->getUrlParams() . '";' . "\$('#SummonDeferredRecommend').load(url);"; ?> <div id="SummonDeferredRecommend"> diff --git a/themes/bootstrap3/templates/cart/cart.phtml b/themes/bootstrap3/templates/cart/cart.phtml index 4efe7527d072d40e86d182250aef215c67b0f394..c372dc1e25c75f839ce6271ac04ad7126548a064 100644 --- a/themes/bootstrap3/templates/cart/cart.phtml +++ b/themes/bootstrap3/templates/cart/cart.phtml @@ -72,7 +72,7 @@ } } function submitCartForm(elem, data) { - var url = VuFind.getPath() + '/AJAX/JSON?method=getLightbox&submodule=Cart&subaction=Home'; + var url = VuFind.path + '/AJAX/JSON?method=getLightbox&submodule=Cart&subaction=Home'; $.post(url, data, determineCallback(elem)); } function submitFormWithIds(elem, data) { diff --git a/themes/bootstrap3/templates/combined/results-ajax.phtml b/themes/bootstrap3/templates/combined/results-ajax.phtml index fdbed6eb826946d1a3253c13f64c521f8c0ef452..6d150814a4803ab9eaec69de44f81a5feadd057e 100644 --- a/themes/bootstrap3/templates/combined/results-ajax.phtml +++ b/themes/bootstrap3/templates/combined/results-ajax.phtml @@ -13,7 +13,7 @@ $lookforEncoded = urlencode($lookfor); $loadJs = <<<JS $(document).ready(function(){ - var url = VuFind.getPath() + '/Combined/Result?id=$searchClassIdEncoded&lookfor=$lookforEncoded'; + var url = VuFind.path + '/Combined/Result?id=$searchClassIdEncoded&lookfor=$lookforEncoded'; $('$targetIdHtmlEscaped').load(url, '', function(responseText) { if (responseText.length == 0) { $('$targetIdHtmlEscaped').hide(); diff --git a/themes/bootstrap3/templates/layout/layout.phtml b/themes/bootstrap3/templates/layout/layout.phtml index 05f797740b384b9fa526a2de721395bbcb557c20..d252393c7278eb132233268deba3295840bbce1b 100644 --- a/themes/bootstrap3/templates/layout/layout.phtml +++ b/themes/bootstrap3/templates/layout/layout.phtml @@ -99,7 +99,11 @@ $root = rtrim($this->url('home'), '/'); $translations = $this->jsTranslations()->getJSON(); $dsb = DEFAULT_SEARCH_BACKEND; - $setupJS = "var VuFind = new VuFindNamespace('{$root}', {$translations}, '{$dsb}');"; + $setupJS = <<<JS +VuFind.path = '{$root}'; +VuFind.defaultSearchBackend = '{$dsb}'; +VuFind.addTranslations({$translations}); +JS; $this->headScript()->appendScript($setupJS); ?> <?=$this->headScript()?>