From d37aee0604d135331a44809a60e7482f5db5ec70 Mon Sep 17 00:00:00 2001 From: Demian Katz <demian.katz@villanova.edu> Date: Wed, 26 Feb 2014 11:45:54 -0500 Subject: [PATCH] Style fixes. --- themes/bootstrap/js/cart.js | 23 +++++++++++------------ themes/bootstrap/js/common.js | 4 ++-- themes/bootstrap/js/lightbox.js | 10 +++++----- themes/bootstrap/js/record.js | 2 +- 4 files changed, 19 insertions(+), 20 deletions(-) diff --git a/themes/bootstrap/js/cart.js b/themes/bootstrap/js/cart.js index 3308a86adcb..f73c7924bb7 100644 --- a/themes/bootstrap/js/cart.js +++ b/themes/bootstrap/js/cart.js @@ -52,6 +52,15 @@ function addItemToCart(id,source) { $('#cartItems strong').html(parseInt($('#cartItems strong').html(), 10)+1); return true; } +function uniqueArray(op) { + var ret = []; + for(var i=0;i<op.length;i++) { + if(ret.indexOf(op[i]) < 0) { + ret.push(op[i]); + } + } + return ret; +} function removeItemFromCart(id,source) { var cartItems = getCartItems(); var cartSources = getCartSources(); @@ -95,16 +104,6 @@ function removeItemFromCart(id,source) { } return false; } -function uniqueArray(op) { - var ret = []; - for(var i=0;i<op.length;i++) { - if(ret.indexOf(op[i]) < 0) { - ret.push(op[i]); - } - } - return ret; -} - function registerUpdateCart($form) { if($form) { $("#updateCart, #bottom_updateCart").unbind('click').click(function(){ @@ -213,12 +212,12 @@ $(document).ready(function() { url: path + '/AJAX/JSON?' + $.param({method:'exportFavorites'}), type:'POST', dataType:'json', - data:getDataFromForm($(evt.target)), + data:Lightbox.getFormData($(evt.target)), success:function(data) { if(data.data.needs_redirect) { document.location.href = data.data.result_url; } else { - changeModalContent(data.data.result_additional); + Lightbox.changeContent(data.data.result_additional); } }, error:function(d,e) { diff --git a/themes/bootstrap/js/common.js b/themes/bootstrap/js/common.js index 10ff91ffdf8..8c4eebfdaaf 100644 --- a/themes/bootstrap/js/common.js +++ b/themes/bootstrap/js/common.js @@ -1,4 +1,4 @@ -/*global path, vufindString */ +/*global Lightbox, path, vufindString */ /* --- GLOBAL FUNCTIONS --- */ function htmlEncode(value){ @@ -182,7 +182,7 @@ $(document).ready(function() { var parts = this.href.split('/'); return Lightbox.get(parts[parts.length-3],'Save',{id:$(this).attr('id')}); }); - Lightbox.addFormCallback('emailSearch', function(html) { + Lightbox.addFormCallback('emailSearch', function(x) { Lightbox.confirm(vufindString['bulk_email_success']); }); }); \ No newline at end of file diff --git a/themes/bootstrap/js/lightbox.js b/themes/bootstrap/js/lightbox.js index 80fc65ee094..dc1f5fa87d0 100644 --- a/themes/bootstrap/js/lightbox.js +++ b/themes/bootstrap/js/lightbox.js @@ -52,7 +52,7 @@ var Lightbox = { if(typeof expectsError === "undefined" || expectsError) { this.formCallbacks[formName] = function(html) { Lightbox.checkForError(html, func); - } + }; } else { this.formCallbacks[formName] = func; } @@ -383,13 +383,13 @@ var Lightbox = { } else { $(form).unbind('submit').submit(function(evt){ Lightbox.submit($(evt.target), function(html){ - Lightbox.checkForError(html, Lightbox.close) + Lightbox.checkForError(html, Lightbox.close); }); return false; }); } - }, -} + } +}; /** * This is a full handler for the login form @@ -491,7 +491,7 @@ function ajaxLogin(form) { } } }); -}; +} /** * This is where you add click events to open the lightbox. diff --git a/themes/bootstrap/js/record.js b/themes/bootstrap/js/record.js index 3d3c66906b1..63cf817db72 100644 --- a/themes/bootstrap/js/record.js +++ b/themes/bootstrap/js/record.js @@ -1,4 +1,4 @@ -/*global extractClassParams, Lightbox, path, vufindString */ +/*global deparam, extractClassParams, htmlEncode, Lightbox, path, vufindString */ /** * Functions and event handlers specific to record pages. -- GitLab