Move to CSS-based styling of validated vs. unvalidated fields
authordbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 17 Aug 2010 22:06:12 +0000 (22:06 +0000)
committerdbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 17 Aug 2010 22:06:12 +0000 (22:06 +0000)
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
Open-ILS/xul/staff_client/server/cat/marcedit.js

index 46627bf..8f1fcf5 100644 (file)
@@ -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; }
index 61b2ae0..90435c9 100644 (file)
@@ -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');
             }
         }
     }