From 54df6ba7bd2f6244f94e5aca9f1851306be0b10e Mon Sep 17 00:00:00 2001
From: Chris Hallberg <crhallberg@gmail.com>
Date: Wed, 1 Jun 2016 15:57:31 -0400
Subject: [PATCH] key-spacing

Conflicts:
	themes/bootstrap3/js/cart.js
	themes/bootstrap3/js/lightbox.js
---
 themes/bootstrap3/js/advanced_search.js     |  2 +-
 themes/bootstrap3/js/cart.js                |  4 +-
 themes/bootstrap3/js/check_item_statuses.js |  2 +-
 themes/bootstrap3/js/check_save_statuses.js |  7 ++-
 themes/bootstrap3/js/common.js              | 12 ++--
 themes/bootstrap3/js/embedGBS.js            |  2 +-
 themes/bootstrap3/js/hierarchyTree.js       | 62 ++++++++++-----------
 themes/bootstrap3/js/ill.js                 |  2 +-
 themes/bootstrap3/js/lightbox.js            | 10 ++--
 themes/bootstrap3/js/openurl.js             |  6 +-
 themes/bootstrap3/js/record.js              | 45 +++++++++------
 11 files changed, 86 insertions(+), 68 deletions(-)

diff --git a/themes/bootstrap3/js/advanced_search.js b/themes/bootstrap3/js/advanced_search.js
index deab40e80f3..e174fafb944 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 d55527f58f1..d764a2850f8 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 1ed0390522a..985427d4e5a 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 123533f46c0..a18e4c6787f 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 d92f31228e4..fc9ec1d92a2 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 ae81464ebee..515a6fca77b 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 62a8e482575..a2caa4f8414 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 2c8af1381da..72272194797 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 579d3dcbecf..d76ea8a752b 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 e5c674a56a8..fb9312fedaf 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 751df8cd23f..ffa1be627bc 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() {
-- 
GitLab