You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xap-commits@incubator.apache.org by mt...@apache.org on 2006/08/04 16:22:15 UTC
svn commit: r428768 - in /incubator/xap/trunk/WebContent/examples/dojo:
colorPicker.html colorPickerHandler.js datePicker.html datePickerHandler.js
Author: mturyn
Date: Fri Aug 4 09:22:14 2006
New Revision: 428768
URL: http://svn.apache.org/viewvc?rev=428768&view=rev
Log:
We'll first be known by our examples, so it's worth it to tweak them.
Modified:
incubator/xap/trunk/WebContent/examples/dojo/colorPicker.html
incubator/xap/trunk/WebContent/examples/dojo/colorPickerHandler.js
incubator/xap/trunk/WebContent/examples/dojo/datePicker.html
incubator/xap/trunk/WebContent/examples/dojo/datePickerHandler.js
Modified: incubator/xap/trunk/WebContent/examples/dojo/colorPicker.html
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/dojo/colorPicker.html?rev=428768&r1=428767&r2=428768&view=diff
==============================================================================
--- incubator/xap/trunk/WebContent/examples/dojo/colorPicker.html (original)
+++ incubator/xap/trunk/WebContent/examples/dojo/colorPicker.html Fri Aug 4 09:22:14 2006
@@ -75,7 +75,15 @@
</td>
</tr>
<tr><td>This ColorPicker was put here via a xap application:<div height="5em" id="targetNode" valign="top" align="left"/></div></td><td></td></tr>
- <tr><td height="30px" bgColor="#FFFFee"><div id="dump">.</div></td><td id="mouseOverDisplayer"/><td/></tr>
+ <tr><td height="30px" >
+ <div id="displayColour">
+ <font size="+2" face="Garamond">Pick a color...
+ <div style="align:center;width:4em"> </div>
+ <div style="align:center;width:4em"> </div>
+ </font>
+ </div>
+ </td>
+ <td id="mouseOverDisplayer"/><td/></tr>
</table>
Modified: incubator/xap/trunk/WebContent/examples/dojo/colorPickerHandler.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/dojo/colorPickerHandler.js?rev=428768&r1=428767&r2=428768&view=diff
==============================================================================
--- incubator/xap/trunk/WebContent/examples/dojo/colorPickerHandler.js (original)
+++ incubator/xap/trunk/WebContent/examples/dojo/colorPickerHandler.js Fri Aug 4 09:22:14 2006
@@ -17,7 +17,33 @@
var bridge = clientEvent.session.getUiDocumentHandler().getHandlerForElement( dpEl );
var palette = bridge.getPeer() ;
- alert("Picked RGB: "+palette._color) ;
+ var colour = palette._color.replace(/\s/g,"") ;
+ var rgbHex = {r:colour.substring(1,3),g:colour.substring(3,5),b:colour.substring(5,7)} ;
+ var rgb = {r:parseInt(rgbHex.r,16) , g:parseInt(rgbHex.g,16), b:parseInt(rgbHex.b,16) };
+ var rgbInv = {r:0xFF^rgb.r, g:0xFF^rgb.g, b:0xFF^rgb.b } ;
+ var displayer = document.getElementById("displayColour") ;
+
+
+
+
+
+
+ var str = "<font size=\"+2\" weight=\"bold\" face=\"Garamond\" "
+ +">Picked : "
+ + "<font "
+ + " color=\""+colour +"\""
+ +" >"
+ + "<div style=\"width:4em;text-align:center;background:rgb(" + rgbInv.r + "," + rgbInv.g + "," +rgbInv.b +")\">"
+ +colour
+ + "</div>"
+ +"</font>"
+ +" = rgb("
+ +"<font color=\" #"+rgbHex.r+"0000\">" +rgb.r +"</font>,"
+ +"<font color=\" #00"+rgbHex.g+"00\">" +rgb.g +"</font>,"
+ +"<font color=\" #0000"+rgbHex.b+"\">" +rgb.b +"</font>"
+ +")"
+ +"</font></font>" ;
+ displayer.innerHTML =str ;
}
Modified: incubator/xap/trunk/WebContent/examples/dojo/datePicker.html
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/dojo/datePicker.html?rev=428768&r1=428767&r2=428768&view=diff
==============================================================================
--- incubator/xap/trunk/WebContent/examples/dojo/datePicker.html (original)
+++ incubator/xap/trunk/WebContent/examples/dojo/datePicker.html Fri Aug 4 09:22:14 2006
@@ -76,7 +76,7 @@
</td>
</tr>
<tr><td>This DatePicker was put here via a xap application:<div height="5em" id="targetNode" valign="top" align="left"/></div></td><td></td></tr>
- <tr><td height="30px" bgColor="#FFFFee"><strong>Try changing the year.</strong></td><td id="mouseOverDisplayer"/><td/></tr>
+ <tr><td height="30px" bgColor="#FFFFee"><div id="displ">Pick a day.</div></td><td id="mouseOverDisplayer"/><td/></tr>
</table>
Modified: incubator/xap/trunk/WebContent/examples/dojo/datePickerHandler.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/dojo/datePickerHandler.js?rev=428768&r1=428767&r2=428768&view=diff
==============================================================================
--- incubator/xap/trunk/WebContent/examples/dojo/datePickerHandler.js (original)
+++ incubator/xap/trunk/WebContent/examples/dojo/datePickerHandler.js Fri Aug 4 09:22:14 2006
@@ -16,7 +16,7 @@
var dp_0 = clientEvent.session.getUiDocumentHandler().getHandlerForElement(dpEl );
- alert(dp_0.getPeer().date) ;
+ document.getElementById("displ").innerHTML=dp_0.getPeer().date ;
}