From 0afe051e5fe037c4714ff9a61cd33b2f928f807e Mon Sep 17 00:00:00 2001 From: Chris Hallberg <crhallberg@gmail.com> Date: Thu, 25 Feb 2016 12:48:59 -0500 Subject: [PATCH] Detect and display alert-success messages from holds. --- themes/bootstrap3/js/lightbox.js | 3 +++ themes/bootstrap3/js/record.js | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/themes/bootstrap3/js/lightbox.js b/themes/bootstrap3/js/lightbox.js index 2b25b1fbd3f..48186b18792 100644 --- a/themes/bootstrap3/js/lightbox.js +++ b/themes/bootstrap3/js/lightbox.js @@ -154,6 +154,9 @@ var Lightbox = { confirm: function(message) { this.changeContent('<div class="alert alert-info">'+message+'</div><button class="btn btn-default" onClick="Lightbox.close()">'+vufindString['close']+'</button>'); }, + success: function(message) { + this.changeContent('<div class="alert alert-success">'+message+'</div><button class="btn btn-default" onClick="Lightbox.close()">'+vufindString['close']+'</button>'); + }, /** * Regexes a piece of html to find an error alert * If one is found, display it diff --git a/themes/bootstrap3/js/record.js b/themes/bootstrap3/js/record.js index 73661094ea0..57d81b1547e 100644 --- a/themes/bootstrap3/js/record.js +++ b/themes/bootstrap3/js/record.js @@ -270,10 +270,10 @@ $(document).ready(function(){ }); Lightbox.addFormCallback('placeHold', function(html) { Lightbox.checkForError(html, function(html) { - var divPattern = '<div class="alert alert-info">'; + var divPattern = '<div class="alert alert-success">'; var fi = html.indexOf(divPattern); var li = html.indexOf('</div>', fi+divPattern.length); - Lightbox.confirm(html.substring(fi+divPattern.length, li).replace(/^[\s<>]+|[\s<>]+$/g, '')); + Lightbox.success(html.substring(fi+divPattern.length, li).replace(/^[\s<>]+|[\s<>]+$/g, '')); }); }); Lightbox.addFormCallback('placeILLRequest', function() { -- GitLab