From de6334727031f6862690460db4c098ab76dfb9a3 Mon Sep 17 00:00:00 2001 From: dbs Date: Tue, 28 Dec 2010 17:26:57 +0000 Subject: [PATCH] Enhance usability of authority record deletion dialogue Don't show the number of linked bib records unless it is a non-zero sum. Make "Cancel" the button with focus in the dialog, so that an errant press of the "Enter" key doesn't do the wrong thing. Trim space from the authority text in the display. Move the authority text from the dialog title to the contents of the dialog. Do not display the MARC for the authority record by default; add a "View MARC" button and toggle it to show/hide MARC. git-svn-id: svn://svn.open-ils.org/ILS/trunk@19071 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/js/ui/default/cat/authority/list.js | 37 ++++++++++++++++++++---- 1 file changed, 32 insertions(+), 5 deletions(-) diff --git a/Open-ILS/web/js/ui/default/cat/authority/list.js b/Open-ILS/web/js/ui/default/cat/authority/list.js index 68b75f75ae..6c24621822 100644 --- a/Open-ILS/web/js/ui/default/cat/authority/list.js +++ b/Open-ILS/web/js/ui/default/cat/authority/list.js @@ -108,16 +108,31 @@ function displayAuthorities(data) { var delDlg = dijit.byId("delDialog_" + auth.id); dojo.query('#auth' + auth.id + ' span.text').forEach(function(node) { - auth.text += dojox.xml.parser.textContent(node); + auth.text += dojo.trim(dojox.xml.parser.textContent(node)); }); if (!delDlg) { + var content = '
Delete the authority record: "' + auth.text + '"?
'; + if (parseInt(linkedBibs) > 0) { + content = "
Number of linked bibliographic records: " + linkedBibs + "
"; + } + content += "
"; + content += ""; + content += ""; + content += ""; + content += ""; + content += "
"; delDlg = new dijit.Dialog({ "id":"delDialog_" + auth.id, - "title":"Confirm deletion of record # " + auth.id + " (" + auth.text + ") ", - "content":"
Number of linked bibliographic records: " + linkedBibs + "

" + - marcToHTML(auth_rec.marc()) + - "
" + "title":"Confirm deletion of record # " + auth.id, + "content": content }); } delDlg.show(); @@ -132,6 +147,18 @@ function displayAuthorities(data) { showBibCount(idArr); } +function viewMARC(recId) { + dojo.style(dojo.byId("authMARC" + recId), 'display', 'block'); + dojo.style(dijit.byId("viewMARC" + recId).domNode, 'display', 'none'); + dojo.style(dijit.byId("hideMARC" + recId).domNode, 'display', 'block'); +} + +function hideMARC(recId) { + dojo.style(dojo.byId("authMARC" + recId), 'display', 'none'); + dojo.style(dijit.byId("hideMARC" + recId).domNode, 'display', 'none'); + dojo.style(dijit.byId("viewMARC" + recId).domNode, 'display', 'block'); +} + function marcToHTML(marc) { var html = ''; marc = dojox.xml.parser.parse(marc); -- 2.11.0