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

Detect and display alert-success messages from holds.

parent 5ff545df
No related merge requests found
...@@ -154,6 +154,9 @@ var Lightbox = { ...@@ -154,6 +154,9 @@ var Lightbox = {
confirm: function(message) { confirm: function(message) {
this.changeContent('<div class="alert alert-info">'+message+'</div><button class="btn btn-default" onClick="Lightbox.close()">'+vufindString['close']+'</button>'); 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 * Regexes a piece of html to find an error alert
* If one is found, display it * If one is found, display it
......
...@@ -270,10 +270,10 @@ $(document).ready(function(){ ...@@ -270,10 +270,10 @@ $(document).ready(function(){
}); });
Lightbox.addFormCallback('placeHold', function(html) { Lightbox.addFormCallback('placeHold', function(html) {
Lightbox.checkForError(html, 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 fi = html.indexOf(divPattern);
var li = html.indexOf('</div>', fi+divPattern.length); 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() { Lightbox.addFormCallback('placeILLRequest', function() {
......
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