hideMe(dojo.byId('canvas_main'));
}
+dojo.require("dijit.Dialog");
+dojo.require("dijit.form.TextBox");
+
/* serials are currently the only use of Dojo strings in the OPAC */
if (rdetailDisplaySerialHoldings) {
dojo.require("dijit.Menu");
}
var _actions = {};
-function rdetailNewBookbag() {
- var name = prompt($('rdetail_bb_new').innerHTML,"");
- if(!name) return;
-
+/**
+ * Adds a new bookbag and exits.
+ *
+ * exitstatus should be 0 if the status is to be read.
+ */
+function finishBookbag(exitstatus) {
+ var name = bbName.attr('value');
+
+ newBBDialog.hide();
+ bbName.attr("value", ""); // Do this after hide so the text doesn't disappear.
+
+ if(exitstatus != 0) return; // If the user canceled, just drop off here.
+
var id;
+
if( id = containerCreate( name ) ) {
- alert($('rdetail_bb_success').innerHTML);
+ new dijit.Dialog({content: $('rdetail_bb_success').innerHTML,}).show();
var selector = $('rdetail_more_actions_selector');
insertSelectorVal( selector, nextContainerIndex++, name,
"container_" + id, rdetailAddToBookbag, 1 );
}
}
+/**
+ * Creates a new Bookbag for the user.
+ */
+function rdetailNewBookbag() {
+ newBBDialog.show(); // Show the bookbag dialog.
+}
function rdetailAddToBookbag() {
var selector = $('rdetail_more_actions_selector');
<div class='hide_me' id='rdetail_bb_none'>&rdetail.none;</div>
<div class='hide_me' id='rdetail_bb_item_success'>&rdetail.bookbag.add.success;</div>
- <div class='hide_me' id='rdetail_bb_new'>&rdetail.bookbag.name;</div>
+ <div dojoType='dijit.Dialog' id='newBBDialog' jsId='newBBDialog' title='&rdetail.bookbag.name;'>
+ <input id='bbName' jsId='bbName' dojoType='dijit.form.TextBox'></input><br/>
+ <button id='bbok' dojoType='dijit.form.Button' onClick='finishBookbag(0);' type='button'>&advanced.go;</button>
+ <button id='bbca' dojoType='dijit.form.Button' onClick='finishBookbag(1);' type='button'>&common.cancel;</button>
+ </div>
<div class='hide_me' id='rdetail_bb_success'>&rdetail.bookbag.create.success;</div>
</div>