From: dbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Date: Tue, 17 Aug 2010 22:06:12 +0000 (+0000)
Subject: Move to CSS-based styling of validated vs. unvalidated fields
X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=7bb2d907c6a4b5d97009dea6f8aeea13bc76410a;p=evergreen%2Fpines.git

Move to CSS-based styling of validated vs. unvalidated fields

This sets the stage for differentiating between validated fields that
match authority records, and validated fields with a controlling $0
subfield that match an authority record. This also gives sites a bit
of an easier entry point to customize their MARC editor - say, for example,
to support accessibility requirements if red vs. black doesn't satisfy
the needs of those who are colour-blind.


git-svn-id: svn://svn.open-ils.org/ILS/trunk@17234 dcc99617-32d9-48b4-a31d-7c20da2025e4
---

diff --git a/Open-ILS/xul/staff_client/server/cat/marcedit.css b/Open-ILS/xul/staff_client/server/cat/marcedit.css
index 46627bf1bc..8f1fcf5e64 100644
--- a/Open-ILS/xul/staff_client/server/cat/marcedit.css
+++ b/Open-ILS/xul/staff_client/server/cat/marcedit.css
@@ -104,3 +104,6 @@ grid#leaderGrid[type="MFHD"] *[set~="MFHD"], grid#leaderGrid[type="MFHD"] *[set~
 }
 
 grid[name="-none-"] * label { color: black; }
+
+.marcValidated { color: black; }
+.marcUnvalidated { color: red; }
diff --git a/Open-ILS/xul/staff_client/server/cat/marcedit.js b/Open-ILS/xul/staff_client/server/cat/marcedit.js
index 61b2ae017b..90435c9e7d 100644
--- a/Open-ILS/xul/staff_client/server/cat/marcedit.js
+++ b/Open-ILS/xul/staff_client/server/cat/marcedit.js
@@ -2250,10 +2250,12 @@ function validateAuthority (button) {
         // XXX If adt, etc should be validated separately from vxz, etc then move this up into the above for loop
         for (var j = 0; j < subfields.length; j++) {
             var sf = subfields[j];
-               if (!found) {
-                sf.childNodes[2].inputField.style.color = 'red';
+            if (!found) {
+                dojo.removeClass(sf.childNodes[2], 'marcValidated');
+                dojo.addClass(sf.childNodes[2], 'marcUnvalidated');
             } else {
-                sf.childNodes[2].inputField.style.color = 'black';
+                dojo.removeClass(sf.childNodes[2], 'marcUnvalidated');
+                dojo.addClass(sf.childNodes[2], 'marcValidated');
             }
         }
     }