From 7bb2d907c6a4b5d97009dea6f8aeea13bc76410a Mon Sep 17 00:00:00 2001
From: dbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Date: Tue, 17 Aug 2010 22:06:12 +0000
Subject: [PATCH] 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
---
 Open-ILS/xul/staff_client/server/cat/marcedit.css | 3 +++
 Open-ILS/xul/staff_client/server/cat/marcedit.js  | 8 +++++---
 2 files changed, 8 insertions(+), 3 deletions(-)

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');
             }
         }
     }
-- 
2.11.0