From: pines Date: Tue, 13 Feb 2007 05:30:44 +0000 (+0000) Subject: bug #322. in copy editor, make alert message truly empty if it doesn't have alphanum... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=ac979c31d4509bcadd6ec80044203c370ea8ce1e;p=Evergreen.git bug #322. in copy editor, make alert message truly empty if it doesn't have alphanumeric content git-svn-id: svn://svn.open-ils.org/ILS/trunk@6939 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/xul/staff_client/server/cat/copy_editor.js b/Open-ILS/xul/staff_client/server/cat/copy_editor.js index 7a83add9dd..f9fe04a70f 100644 --- a/Open-ILS/xul/staff_client/server/cat/copy_editor.js +++ b/Open-ILS/xul/staff_client/server/cat/copy_editor.js @@ -435,6 +435,7 @@ g.reset = function() { g.apply = function(field,value) { g.error.sdump('D_TRACE','applying field = <' + field + '> value = <' + value + '>\n'); if (value == '') value = null; + if (field == 'alert_message') { value = value.replace(/^\W+$/g,''); } for (var i = 0; i < g.copies.length; i++) { var copy = g.copies[i]; try { @@ -827,7 +828,7 @@ g.panes_and_field_names = { "Alert Message", { render: 'fm.alert_message() == null ? "" : fm.alert_message()', - input: 'c = function(v){ g.apply("alert_message",v); if (typeof post_c == "function") post_c(v); }; x = document.createElement("textbox"); x.setAttribute("multiline",true); g.populate_alert_message_input(x); x.addEventListener("apply",function(f){ return function(ev) { f( String(ev.target.value).replace(/^\s+$/,"") ); } }(c), false);', + input: 'c = function(v){ g.apply("alert_message",v); if (typeof post_c == "function") post_c(v); }; x = document.createElement("textbox"); x.setAttribute("multiline",true); g.populate_alert_message_input(x); x.addEventListener("apply",function(f){ return function(ev) { f( ev.target.value ); } }(c), false);', } ],