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/10 18:02:06 UTC
svn commit: r430463 - in /incubator/xap/trunk/WebContent/examples/dojo:
colorPicker.html colorPicker.js colorPicker.xal colorPickerHandler.js
datePicker.html datePicker.js datePicker.xal dojoExample_0.html
dojoExample_0.js dojoExample_0.xal
Author: mturyn
Date: Thu Aug 10 11:02:05 2006
New Revision: 430463
URL: http://svn.apache.org/viewvc?rev=430463&view=rev
Log:
Standardised name of HTML DOM nodes and our client sessions.
Modified:
incubator/xap/trunk/WebContent/examples/dojo/colorPicker.html
incubator/xap/trunk/WebContent/examples/dojo/colorPicker.js
incubator/xap/trunk/WebContent/examples/dojo/colorPicker.xal
incubator/xap/trunk/WebContent/examples/dojo/colorPickerHandler.js
incubator/xap/trunk/WebContent/examples/dojo/datePicker.html
incubator/xap/trunk/WebContent/examples/dojo/datePicker.js
incubator/xap/trunk/WebContent/examples/dojo/datePicker.xal
incubator/xap/trunk/WebContent/examples/dojo/dojoExample_0.html
incubator/xap/trunk/WebContent/examples/dojo/dojoExample_0.js
incubator/xap/trunk/WebContent/examples/dojo/dojoExample_0.xal
Modified: incubator/xap/trunk/WebContent/examples/dojo/colorPicker.html
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/dojo/colorPicker.html?rev=430463&r1=430462&r2=430463&view=diff
==============================================================================
--- incubator/xap/trunk/WebContent/examples/dojo/colorPicker.html (original)
+++ incubator/xap/trunk/WebContent/examples/dojo/colorPicker.html Thu Aug 10 11:02:05 2006
@@ -70,11 +70,11 @@
<tr><th width="30%">0.</th><th>1.</th></tr>
<tr><td>This is put here by plain old Dojo.<div id="dp"/><td/><td></td></tr>
<tr><td id="xapStat"></td>
- <td><div context="../../" id="applicationHome"
- appName="MyApp" src="colorPicker.xal" toolkit="dojo">This cell is the xap ClientSession "MyApp"'s home-base.</div>
+ <td><div context="../../" id="applicationHome1"
+ appName="ColorPicker" src="colorPicker.xal" toolkit="dojo">This cell is the xap ClientSession "MyApp"'s home-base.</div>
</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>This ColorPicker was put here via a xap application:<div height="5em" id="colorPickerHome" valign="top" align="left"/></div></td><td></td></tr>
<tr><td height="30px" >
<div id="displayColour">
<font size="+2" face="Garamond">Pick a color...
Modified: incubator/xap/trunk/WebContent/examples/dojo/colorPicker.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/dojo/colorPicker.js?rev=430463&r1=430462&r2=430463&view=diff
==============================================================================
--- incubator/xap/trunk/WebContent/examples/dojo/colorPicker.js (original)
+++ incubator/xap/trunk/WebContent/examples/dojo/colorPicker.js Thu Aug 10 11:02:05 2006
@@ -1,5 +1,5 @@
document.showStatus = function(){
- var session = window["MyApp"] ;
+ var session = window["ColorPicker"] ;
var node = session.domContainer ;
var front = "" ;
Modified: incubator/xap/trunk/WebContent/examples/dojo/colorPicker.xal
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/dojo/colorPicker.xal?rev=430463&r1=430462&r2=430463&view=diff
==============================================================================
--- incubator/xap/trunk/WebContent/examples/dojo/colorPicker.xal (original)
+++ incubator/xap/trunk/WebContent/examples/dojo/colorPicker.xal Thu Aug 10 11:02:05 2006
@@ -13,7 +13,7 @@
<xm:append select="/xal">
<colorPalette xmlns="http://www.dojotoolkit.org/"
- elementId="targetNode"
+ elementId="colorPickerHome"
id="theColorPicker"
height="60px"
width="90px"
Modified: incubator/xap/trunk/WebContent/examples/dojo/colorPickerHandler.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/dojo/colorPickerHandler.js?rev=430463&r1=430462&r2=430463&view=diff
==============================================================================
--- incubator/xap/trunk/WebContent/examples/dojo/colorPickerHandler.js (original)
+++ incubator/xap/trunk/WebContent/examples/dojo/colorPickerHandler.js Thu Aug 10 11:02:05 2006
@@ -30,20 +30,20 @@
- 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 ;
+ 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=430463&r1=430462&r2=430463&view=diff
==============================================================================
--- incubator/xap/trunk/WebContent/examples/dojo/datePicker.html (original)
+++ incubator/xap/trunk/WebContent/examples/dojo/datePicker.html Thu Aug 10 11:02:05 2006
@@ -54,7 +54,10 @@
<script language="JavaScript" src="datePickerHandler.js"> </script>
+ <script language="JavaScript" src="../../src/dojo/src/widget/Parse.js"> </script>
+ <script language="JavaScript" src="../../src/xap/session/ClientSession.js"> </script>
+
</head>
@@ -71,18 +74,18 @@
<tr><th width="60%">0.</th><th>1.</th></tr>
<tr><td>This is put here by plain old Dojo.<div id="dp"/><td/><td></td></tr>
<tr><td id="xapStat"></td>
- <td><div context="../../" id="applicationHome"
- appName="MyApp" src="datePicker.xal" toolkit="dojo">This cell is the xap ClientSession "MyApp"'s home-base.</div>
+ <td><div context="../../" id="datePickerHome"
+ appName="DatePicker" src="datePicker.xal" toolkit="dojo"><div>This DatePicker was put here via a xap application:</div>This cell is the xap ClientSession "DatePicker"'s home-base.</div>
</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></td><td></td></tr>
<tr><td height="30px" bgColor="#FFFFee"><div id="displ"><b>Pick a day....</b></div></td><td id="mouseOverDisplayer"/><td/></tr>
</table>
- <!-- MyApp as the app name is a top-level alias for session
+ <!-- DatePicker as the app name is a top-level alias for session
as this event handler illustrates -->
- <button onclick="alert(MyApp.getDocumentContainer().getUiDocument().toXml());Xap.getAllDependencies('xap')">hello</button>
+ <button onclick="alert(DatePicker.getDocumentContainer().getUiDocument().toXml());Xap.getAllDependencies('xap')">hello</button>
<div id="foot">FOOTER TEXT</dev>
Modified: incubator/xap/trunk/WebContent/examples/dojo/datePicker.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/dojo/datePicker.js?rev=430463&r1=430462&r2=430463&view=diff
==============================================================================
--- incubator/xap/trunk/WebContent/examples/dojo/datePicker.js (original)
+++ incubator/xap/trunk/WebContent/examples/dojo/datePicker.js Thu Aug 10 11:02:05 2006
@@ -1,5 +1,5 @@
xap.showStatus = function(){
- var session = window["MyApp"] ;
+ var session = window["DatePicker"] ;
var node = session.domContainer ;
var front = "" ;
Modified: incubator/xap/trunk/WebContent/examples/dojo/datePicker.xal
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/dojo/datePicker.xal?rev=430463&r1=430462&r2=430463&view=diff
==============================================================================
--- incubator/xap/trunk/WebContent/examples/dojo/datePicker.xal (original)
+++ incubator/xap/trunk/WebContent/examples/dojo/datePicker.xal Thu Aug 10 11:02:05 2006
@@ -13,7 +13,7 @@
<xm:append select="/xal">
<datePicker xmlns="http://www.dojotoolkit.org/"
id="theDatePicker"
- elementId="targetNode"
+ elementId="datePickerHome"
height="60px"
width="90px"
x="10px"
Modified: incubator/xap/trunk/WebContent/examples/dojo/dojoExample_0.html
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/dojo/dojoExample_0.html?rev=430463&r1=430462&r2=430463&view=diff
==============================================================================
--- incubator/xap/trunk/WebContent/examples/dojo/dojoExample_0.html (original)
+++ incubator/xap/trunk/WebContent/examples/dojo/dojoExample_0.html Thu Aug 10 11:02:05 2006
@@ -19,6 +19,22 @@
<script language="JavaScript" type="text/javascript" src="../../src/dojo/dojo.js"></script>
<script language="JavaScript" type="text/javascript" src="../../src/xap/util/Utils.js"></script>
<script language="JavaScript" type="text/javascript" src="../../src/xap/Xap.js"></script>
+
+
+ <script language="JavaScript" type="text/javascript">
+ // These should be in this order, as this is what their dependencies
+ // look like
+ Xap.addDebuggables(
+ "xap.session.ClientSession",
+ "xap.taghandling.AbstractTagImpl",
+ "xap.bridges.basic.AbstractBlackBoxWidgetBridge",
+ "xap.bridges.dojo.DojoWidgetBridge",
+ "xap.bridges.dojo.DojoFloatingPaneBridge",
+ "xap.session.EventHandler"
+ ) ;
+ </script>
+
+
<script language="JavaScript" type="text/javascript">
Xap.bootstrap( "../../", true);
</script>
@@ -38,7 +54,7 @@
type="text/javascript"
src="dojoExample_0.js"></script>
</head>
-
+
<body onLoad="Xap.scanPage()">
<script type="text/javascript">
Modified: incubator/xap/trunk/WebContent/examples/dojo/dojoExample_0.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/dojo/dojoExample_0.js?rev=430463&r1=430462&r2=430463&view=diff
==============================================================================
--- incubator/xap/trunk/WebContent/examples/dojo/dojoExample_0.js (original)
+++ incubator/xap/trunk/WebContent/examples/dojo/dojoExample_0.js Thu Aug 10 11:02:05 2006
@@ -1,9 +1,6 @@
-function huh_0(){
- alert("Clicked button 0.") ;
+
+for (var k=0; k <3; ++k){
+ window["huh_"+k] = function(){
+ alert("Clicked button "+k+".") ;
+ }
}
-function huh_1(){
- alert("Clicked button 1.") ;
-}
-function huh_2(){
- alert("Clicked button 2.") ;
-}
\ No newline at end of file
Modified: incubator/xap/trunk/WebContent/examples/dojo/dojoExample_0.xal
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/dojo/dojoExample_0.xal?rev=430463&r1=430462&r2=430463&view=diff
==============================================================================
--- incubator/xap/trunk/WebContent/examples/dojo/dojoExample_0.xal (original)
+++ incubator/xap/trunk/WebContent/examples/dojo/dojoExample_0.xal Thu Aug 10 11:02:05 2006
@@ -2,7 +2,7 @@
<xm:modifications xmlns:xm="http://www.openxal.org/xmodify">
<xm:append select="/xal">
<button xmlns="http://www.dojotoolkit.org/" text="First"
- onClick="huh_0"
+ onClick="javascript:huh_0"
height="24px"
width="40px"
color="#aa0000"
@@ -24,7 +24,7 @@
<button xmlns="http://www.dojotoolkit.org/"
src="replaceButton.xm"
text="Do-"
- onClick="huh_1"
+ onClick="javascript:huh_1"
width="60px"
height="32px"
color="#00aa00"
@@ -45,7 +45,7 @@
<button xmlns="http://www.dojotoolkit.org/"
src="replaceButton.xm"
text="jo"
- onClick="huh_1"
+ onClick="javascript:huh_1"
width="60px"
height="32px"
color="#00ff00"
@@ -66,7 +66,7 @@
</floatingPane>
<button text="widgets" xmlns="http://www.dojotoolkit.org/"
- onClick="huh_2"
+ onClick="javascript:huh_2"
x="460px"
y="0px"
position="absolute"
@@ -78,7 +78,7 @@
<generic xmlns="http://www.dojotoolkit.org/"
dojoType="FloatingPane"
title="Created as generic widget."
- onClick="huh_1"
+ onClick="javascript:huh_1"
width="60px"
height="32px"
color="#00aa00"