Skip to content
Snippets Groups Projects
Commit 54df6ba7 authored by Chris Hallberg's avatar Chris Hallberg
Browse files

key-spacing

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