From 1540fbd90ac4311e0eda95f88efb73cea37a60a7 Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Tue, 2 Aug 2011 12:42:53 -0400 Subject: [PATCH] Markup-based dijit.Dialog implementation, inspired by and based on a patch from Joseph Lewis in https://bugs.launchpad.net/evergreen/+bug/787162 Signed-off-by: Mike Rylander Signed-off-by: Dan Scott --- Open-ILS/web/opac/skin/default/js/rdetail.js | 29 +++++++++++++++---- .../opac/skin/default/xml/page_rdetail.xml | 6 +++- 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/Open-ILS/web/opac/skin/default/js/rdetail.js b/Open-ILS/web/opac/skin/default/js/rdetail.js index eae2aa0bd2..0b04880bb4 100644 --- a/Open-ILS/web/opac/skin/default/js/rdetail.js +++ b/Open-ILS/web/opac/skin/default/js/rdetail.js @@ -51,6 +51,9 @@ if(location.href.match(/&place_hold=1/)) { 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"); @@ -675,13 +678,23 @@ function rdetailAddBookbags(r) { } 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 ); @@ -689,6 +702,12 @@ function rdetailNewBookbag() { } } +/** + * Creates a new Bookbag for the user. + */ +function rdetailNewBookbag() { + newBBDialog.show(); // Show the bookbag dialog. +} function rdetailAddToBookbag() { var selector = $('rdetail_more_actions_selector'); diff --git a/Open-ILS/web/opac/skin/default/xml/page_rdetail.xml b/Open-ILS/web/opac/skin/default/xml/page_rdetail.xml index c816b6d827..44e35ff9c6 100644 --- a/Open-ILS/web/opac/skin/default/xml/page_rdetail.xml +++ b/Open-ILS/web/opac/skin/default/xml/page_rdetail.xml @@ -83,7 +83,11 @@
&rdetail.none;
&rdetail.bookbag.add.success;
-
&rdetail.bookbag.name;
+
+
+ + +
&rdetail.bookbag.create.success;
-- 2.43.2