You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2007/12/13 12:40:10 UTC

svn commit: r603893 - in /ofbiz/trunk/framework: common/webcommon/includes/lookup.ftl images/webapp/images/calendar.html

Author: jleroux
Date: Thu Dec 13 03:40:07 2007
New Revision: 603893

URL: http://svn.apache.org/viewvc?rev=603893&view=rev
Log:
A patch from Daniel Martínez "Make user input change background colours of formulars" (https://issues.apache.org/jira/browse/OFBIZ-660) - OFBIZ-660
Note : only when the change comes from calendar or lookup. I will revert if it annoys somebody...


Modified:
    ofbiz/trunk/framework/common/webcommon/includes/lookup.ftl
    ofbiz/trunk/framework/images/webapp/images/calendar.html

Modified: ofbiz/trunk/framework/common/webcommon/includes/lookup.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/webcommon/includes/lookup.ftl?rev=603893&r1=603892&r2=603893&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/webcommon/includes/lookup.ftl (original)
+++ ofbiz/trunk/framework/common/webcommon/includes/lookup.ftl Thu Dec 13 03:40:07 2007
@@ -35,10 +35,15 @@
         if (obj_caller == null) 
             obj_caller = window.opener;
         
-        
+        var bkColor = "yellow";
+        function setSourceColor(src){
+        if(src != null)
+             src.style.backgroundColor = bkColor;
+        }
         // function passing selected value to calling window
         function set_value(value) {
                 if (!obj_caller) return;
+                setSourceColor(obj_caller.target);
                 obj_caller.target.value = value;
                 window.close();
         }
@@ -47,6 +52,7 @@
                 set_value(value);
                 if (!obj_caller.target2) return;
                 if (obj_caller.target2 == null) return;
+                setSourceColor(obj_caller.target2);
                 obj_caller.target2.value = value2;
         }
         function set_multivalues(value) {
@@ -56,6 +62,8 @@
              
     		if (arguments.length > 2 ) {
         		for(var i=1; i < arguments.length; i=i+2) {
+                    evalString = "setSourceColor(thisForm." + arguments[i] + ")";
+                    eval(evalString); 
         			evalString = "thisForm." + arguments[i] + ".value='" + arguments[i+1] + "'";
         			eval(evalString);
         		}

Modified: ofbiz/trunk/framework/images/webapp/images/calendar.html
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendar.html?rev=603893&r1=603892&r2=603893&view=diff
==============================================================================
--- ofbiz/trunk/framework/images/webapp/images/calendar.html (original)
+++ ofbiz/trunk/framework/images/webapp/images/calendar.html Thu Dec 13 03:40:07 2007
@@ -40,7 +40,12 @@
 var num_id = (re_id.exec(String(window.location))
 	? new Number(RegExp.$1) : 0);
 var obj_caller = (window.opener ? window.opener.calendars[num_id] : null);
-
+// Change background color
+var bkColor = "yellow";
+function setSourceColor(src){
+if(src != null)
+ src.style.backgroundColor = bkColor;
+}
 if (obj_caller && obj_caller.year_scroll) {
 	// get same date in the previous year
 	var dt_prev_year = new Date(dt_current);
@@ -87,6 +92,7 @@
 			? obj_caller.gen_tsmp(dt_datetime)
 			: obj_caller.gen_date(dt_datetime)
 		);
+        setSourceColor(obj_caller.target);
 		window.close();
 	}
 	else obj_caller.popup(dt_datetime.valueOf());