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/06/30 05:29:08 UTC

svn commit: r418183 - in /incubator/xap/trunk/WebContent/examples/dojo: dojoExample_0.html dojoExample_0.js dojoExample_0.xal

Author: mturyn
Date: Thu Jun 29 22:29:08 2006
New Revision: 418183

URL: http://svn.apache.org/viewvc?rev=418183&view=rev
Log:
Simple example with three dojo buttons, one of whose caption is changed during the start-up with Xmodify.

Added:
    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

Added: 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=418183&view=auto
==============================================================================
--- incubator/xap/trunk/WebContent/examples/dojo/dojoExample_0.html (added)
+++ incubator/xap/trunk/WebContent/examples/dojo/dojoExample_0.html Thu Jun 29 22:29:08 2006
@@ -0,0 +1,44 @@
+<html>
+<head>
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+    <title>Dojo example 0</title>
+
+	<style type="text/css">
+      <!--
+          @import url(../../css/xapDefault.css);
+      -->
+    </style>
+    <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">
+    	Xap.bootstrap( "../../" );
+  	</script>
+ </head>
+ 
+   	
+     
+    <!-- SECTION 2 -->
+	<script type="text/javascript">
+            // Load Dojo's code concerned with a Button or Button2 widget,
+            // including the object dojo.widget needed to create one
+           dojo.require("dojo.widget.*");   
+	       dojo.require("dojo.event.*");            
+           dojo.require("dojo.widget.Button");  
+           
+                             
+ 	</script>
+
+	<script language="JavaScript" type="text/javascript" src="dojoExample_0.js">
+	</script>	
+	
+
+
+<body onLoad="launch()" >
+   <script language="JavaScript" 
+   			type="text/javascript" 
+   			src="dojoExample_0.js"></script>
+</body>
+
+
+</html>

Added: 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=418183&view=auto
==============================================================================
--- incubator/xap/trunk/WebContent/examples/dojo/dojoExample_0.js (added)
+++ incubator/xap/trunk/WebContent/examples/dojo/dojoExample_0.js Thu Jun 29 22:29:08 2006
@@ -0,0 +1,27 @@
+
+function launch(){
+
+    	Xap.bootstrap( "../../" );
+ 		// required for Zimbra, so this should be gone, soon:
+		DBG = new AjxDebug( AjxDebug.NONE, null, false );    	
+ 
+
+        // Dojo uses djConfig to let you specify config options for it.
+        // baseRelativePath is telling Dojo where to find itself
+        // isDebug will give us error messages if something goes wrong
+        var djConfig = new Object() ;
+        djConfig.baseRelativePath = "../../src/dojo" ; 
+        djConfig.isDebug = true ; 
+ 		Xap.createSession( "../../", "dojoExample_0.xal", "dojo" );
+}
+
+
+function huh_0(){
+	alert("Clicked button 0.") ;
+}
+function huh_1(){
+	alert("Clicked button 1.") ;
+}
+function huh_2(){
+	alert("Clicked button 2.") ;
+}
\ No newline at end of file

Added: 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=418183&view=auto
==============================================================================
--- incubator/xap/trunk/WebContent/examples/dojo/dojoExample_0.xal (added)
+++ incubator/xap/trunk/WebContent/examples/dojo/dojoExample_0.xal Thu Jun 29 22:29:08 2006
@@ -0,0 +1,42 @@
+<xal xmlns="http://www.openxal.org/xal"> 
+  <xm:modifications xmlns:xm="http://www.openxal.org/xmodify">
+    <xm:append select="/xal">
+		<button xmlns="http://www.dojotoolkit.org/" text="First" 
+			onClick="huh_0"			
+			height="24px"
+			width="40px"
+			color="#aa0000"
+			id="button_0"
+			position="absolute"
+			backgroundColor="#00aaaa"
+		/>
+		<button xmlns="http://www.dojotoolkit.org/"
+			src="replaceButton.xm"
+			text="Dojo"	
+			x="40px"
+			y="24px"
+			position="absolute"
+			onClick="huh_1"			
+			width="60px"
+			height="32px"	
+			color="#00aa00"												
+		/>		
+		<button text="widgets" xmlns="http://www.dojotoolkit.org/" 
+			onClick="huh_2"
+			x="100px"
+			y="6px"
+			position="absolute"
+			width="30px"
+			height="18px"
+			color="#0000aa"					
+		/>	
+		
+   	</xm:append>
+   	<!-- Try out caption-changing:  -->
+		<xm:set-attribute select="id('button_0')">			
+			<attribute name="text" value="Three..."/>
+		</xm:set-attribute>   	
+   	
+   	
+  </xm:modifications>
+</xal>
\ No newline at end of file