[LON-CAPA-cvs] cvs: loncom /interface loncommon.pm /interface/statistics lonstudentassessment.pm

albertel lon-capa-cvs@mail.lon-capa.org
Mon, 03 Jul 2006 03:54:33 -0000


albertel		Sun Jul  2 23:54:33 2006 EDT

  Modified files:              
    /loncom/interface	loncommon.pm 
    /loncom/interface/statistics	lonstudentassessment.pm 
  Log:
  - BUG#4906 chrt higlight colror switching
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.416 loncom/interface/loncommon.pm:1.417
--- loncom/interface/loncommon.pm:1.416	Sun Jul  2 21:32:50 2006
+++ loncom/interface/loncommon.pm	Sun Jul  2 23:54:29 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.416 2006/07/03 01:32:50 albertel Exp $
+# $Id: loncommon.pm,v 1.417 2006/07/03 03:54:29 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3461,6 +3461,19 @@
   color: $vlink;
 }
 
+.LC_chrt_popup_exists {
+  border: 1px solid #339933;
+  margin: -1px;
+}
+.LC_chrt_popup_up {
+  border: 1px solid yellow;
+  margin: -1px;
+}
+.LC_chrt_popup {
+  border: 1px solid #8888FF;
+  background: #CCCCFF;
+}
+
 END
 }
 
Index: loncom/interface/statistics/lonstudentassessment.pm
diff -u loncom/interface/statistics/lonstudentassessment.pm:1.141 loncom/interface/statistics/lonstudentassessment.pm:1.142
--- loncom/interface/statistics/lonstudentassessment.pm:1.141	Fri Jun 30 00:15:07 2006
+++ loncom/interface/statistics/lonstudentassessment.pm	Sun Jul  2 23:54:32 2006
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 #
-# $Id: lonstudentassessment.pm,v 1.141 2006/06/30 04:15:07 albertel Exp $
+# $Id: lonstudentassessment.pm,v 1.142 2006/07/03 03:54:32 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -750,7 +750,7 @@
     $r->rflush();
 
     $r->print(<<JS);
-<script>
+<script type="text/javascript">
 // get the left offset of a given widget as an absolute position
 function getLeftOffset (element) {
     return collect(element, "offsetLeft");
@@ -771,23 +771,20 @@
 }
 
 var currentDiv;
-var oldBorder;
 var currentElement;
 function popup_score(element, score) {
     popdown_score();
     var left = getLeftOffset(element);
     var top = getTopOffset(element);
     var div = document.createElement("div");
-    div.style.border = "1px solid #8888FF";
-    div.style.backgroundColor = "#CCCCFF";
+    div.className = "LC_chrt_popup";
     div.appendChild(document.createTextNode(score));
     div.style.position = "absolute";
     div.style.top = (top - 25) + "px";
     div.style.left = (left - 10) + "px";
     currentDiv = div;
     document.body.insertBefore(div, document.body.childNodes[0]);
-    oldBorder = element.style.border;
-    element.style.border = "1px solid yellow";
+    element.className = "LC_chrt_popup_up";
     currentElement = element;
 }
 
@@ -796,7 +793,7 @@
         document.body.removeChild(currentDiv);
     }
     if (currentElement) {
-        currentElement.style.border = oldBorder;
+        currentElement.className = 'LC_chrt_popup_exists';
     }
     currentDiv = undefined;
 }
@@ -1841,7 +1838,7 @@
     # Escape the popup for JS.
     $popup =~ s/([^-a-zA-Z0-9:;,._ ()|!\/?=&*])/'\\' . sprintf("%lo", ord($1))/ge;
     
-    return "<span onmouseover='popup_score(this, \"$popup\");return false;' onmouseout='popdown_score();return false;' style='border: 1px solid #339933; margin: -1px;'>$symbol</span>";
+    return "<span class=\"LC_chrt_popup_exists\" onmouseover='popup_score(this, \"$popup\");return false;' onmouseout='popdown_score();return false;'>$symbol</span>";
 }
 
 #######################################################