commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbe...@apache.org
Subject svn commit: r984025 - /commons/sandbox/gsoc/2010/scxml-js/trunk/demo/drawing-tool/drawing-tool.html
Date Tue, 10 Aug 2010 14:18:33 GMT
Author: jbeard
Date: Tue Aug 10 14:18:33 2010
New Revision: 984025

URL: http://svn.apache.org/viewvc?rev=984025&view=rev
Log:
drawing-tool.html was taking up too much space and getting difficult to read, so switched
from tabs to spaces.

Modified:
    commons/sandbox/gsoc/2010/scxml-js/trunk/demo/drawing-tool/drawing-tool.html

Modified: commons/sandbox/gsoc/2010/scxml-js/trunk/demo/drawing-tool/drawing-tool.html
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/trunk/demo/drawing-tool/drawing-tool.html?rev=984025&r1=984024&r2=984025&view=diff
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-js/trunk/demo/drawing-tool/drawing-tool.html (original)
+++ commons/sandbox/gsoc/2010/scxml-js/trunk/demo/drawing-tool/drawing-tool.html Tue Aug 10
14:18:33 2010
@@ -17,198 +17,198 @@
 -->
 
 <html xmlns="http://www.w3.org/1999/xhtml" xmlns:svg="http://www.w3.org/2000/svg">
-	<head>
-		<style type="text/css">
-			html, body {
-				height:100%;
-				margin: 0;
-				padding: 0;
-			}
-
-			div#toolbarDiv {
-				position:absolute;
-				bottom:0px;
-				right:0px;
-			}
-
-
-			div#toolbarDiv > svg > g > rect.background {
-				fill : none;
-				stroke : none;
-			}
-
-			div#toolbarDiv > svg > g.selected > rect.background {
-				fill : #AAAAAA;
-				stroke : none;
-			}
-
-			@import "lib/jquery.svg.css";
-
-		</style>
-		<script src="../../lib/js/requirejs/require.js" type="text/javascript"></script>
-		<script src="../../lib/js/requirejs/require/text.js" type="text/javascript"></script>
-		<script src="../../lib/js/requirejs/require/xml.js" type="text/javascript"></script>
-
-		<script src="lib/jquery-1.4.2.js" type="text/javascript"></script>
-		<script src="lib/jquery.svg.js" type="text/javascript"></script>
-		<script src="lib/jquery.svgdom.js" type="text/javascript"></script>
-
-		<script>
-			$(document).ready(function(){
-
-				//hook up minimal console api
-				if(typeof console == "undefined"){
-					console = {};
-					["log","info","error","dirxml"].forEach(function(m){console[m] = console[m] || function(){}
});
-				} 
-
-
-				var scxmlns = "http://www.w3.org/2005/07/scxml";
-				var svgns = "http://www.w3.org/2000/svg";
-
-				$("#toolbarDiv").svg({
-					onLoad:function(toolbar){
-						$(toolbar.root()).attr({
-							"width":"100px",
-							"height":"50px"
-						});
-
-						$(document.body).svg({
-							onLoad:function(svg){
-
-								$(svg.root()).attr({
-									"width":"100%",
-									"height":"100%"
-								});
-
-								var toolbarOutlineRect = toolbar.rect(0,0,100,50,{
-									fill:"white", 
-									stroke:"black"
-								}) ;
-								
-								var rectButton = toolbar.group();
-								var rectButtonBackground = toolbar.rect(rectButton,0,0,50,50,{ 
-									class:"background"
-								});
-								var rectButtonIcon = toolbar.rect(rectButton,10,10,30,30,{ 
-									fill:"red", 
-									stroke:"black"
-								});
-
-								var ellipseButton = toolbar.group({"transform":"translate(50,0)"});
-
-								var ellipseButtonBackground = toolbar.rect(ellipseButton,0,0,50,50,{
-									class:"background"
-								});
-
-								var ellipseButtonIcon = toolbar.circle(ellipseButton,25,25,15,{
-									fill:"blue",
-									stroke:"black"
-								});
-
-
-								function hookUpDOMEvents(node,compiledStatechartInstance){
-									//hook up DOM events
-									["mousedown","mouseup","mousemove"].forEach(function(eventName){
-										if(compiledStatechartInstance[eventName]){
-											node.addEventListener(eventName,function(e){
-												e.preventDefault();
-												compiledStatechartInstance[eventName](e)
-											},false);
-										}
-									});
-								}
-
-								require(
-									{
-										"baseUrl":"/"
-									},
-									["src/javascript/scxml/cgf/SCXMLCompiler",
-										"demo/drawing-tool/transform",
-										"xml!demo/drawing-tool/behaviour/canvas.xml",
-										"xml!demo/drawing-tool/behaviour/node.xml",
-										"xml!demo/drawing-tool/behaviour/toolbar.xml" ],
-
-									function(compiler,svgTransformer,canvasBehaviourSCXML,nodeBehaviourSCXML,toolbarBehaviourSCXML){
-
-										require( [window.DOMParser ?
-												"src/javascript/scxml/cgf/util/xsl/browser" :
-												"src/javascript/scxml/cgf/util/xsl/ie"],
-											function(xslTransformer){
-
-							
-											var d = new Date();
-
-											compiler.compile({
-												inFiles:[canvasBehaviourSCXML,nodeBehaviourSCXML,toolbarBehaviourSCXML],
-												//debug:true,
-												backend:"state",
-												beautify:true,
-												verbose:false,
-												log:false,
-												ie:false
-											}, function(scArr){
-						
-												console.log("Compiling statecharts took:",new Date() - d);
-												//eval
-												for(var i=0, l=scArr.length; i < l; i++){
-													console.log(scArr[i]);
-													eval(scArr[i]);
-												}
-
-
-												//hook up toolbar behaviour
-												var toolbarSC = new ToolbarStatechartExecutionContext();
-												toolbarSC.initialize();
-												toolbarSC.init({
-													ellipseButton:ellipseButton,
-													rectButton:rectButton,
-													ellipseIcon:ellipseButtonIcon,
-													rectIcon:rectButtonIcon	
-												});
-												
-												hookUpDOMEvents(toolbar.root(),toolbarSC);
-
-												//hook up canvas behaviour
-												var canvasSC = new CanvasStatechartExecutionContext(); 
-												canvasSC.initialize();
-												
-												//pass in reference to rect
-												canvasSC.init({	
-													svg:svg,
-													toolbarStatechart:toolbarSC,
-													api:{
-														addBehaviourToNode:function(node){
-															//add behaviour
-															var nodeSc = new NodeStatechartExecutionContext();
-															nodeSc.initialize();
-															nodeSc.init({
-																rawNode:node,
-																transformModule:svgTransformer
-															});
-															hookUpDOMEvents(node,nodeSc);
-														}
-													}
-												}); 	
-
-												hookUpDOMEvents(svg.root(),canvasSC);
-
-											},xslTransformer);
-										})
-									}
-								);
-							}	
-						})
-					}
-				});
-
-				//build up the DOM
-			});
-		</script>
-	</head>
-	<body>
-		<div id="toolbarDiv"></div>
-	</body>
+  <head>
+    <style type="text/css">
+      html, body {
+        height:100%;
+        margin: 0;
+        padding: 0;
+      }
+
+      div#toolbarDiv {
+        position:absolute;
+        bottom:0px;
+        right:0px;
+      }
+
+
+      div#toolbarDiv > svg > g > rect.background {
+        fill : none;
+        stroke : none;
+      }
+
+      div#toolbarDiv > svg > g.selected > rect.background {
+        fill : #AAAAAA;
+        stroke : none;
+      }
+
+      @import "lib/jquery.svg.css";
+
+    </style>
+    <script src="../../lib/js/requirejs/require.js" type="text/javascript"></script>
+    <script src="../../lib/js/requirejs/require/text.js" type="text/javascript"></script>
+    <script src="../../lib/js/requirejs/require/xml.js" type="text/javascript"></script>
+
+    <script src="lib/jquery-1.4.2.js" type="text/javascript"></script>
+    <script src="lib/jquery.svg.js" type="text/javascript"></script>
+    <script src="lib/jquery.svgdom.js" type="text/javascript"></script>
+
+    <script>
+      $(document).ready(function(){
+
+        //hook up minimal console api
+        if(typeof console == "undefined"){
+          console = {};
+          ["log","info","error","dirxml"].forEach(function(m){console[m] = console[m] ||
function(){} });
+        } 
+
+
+        var scxmlns = "http://www.w3.org/2005/07/scxml";
+        var svgns = "http://www.w3.org/2000/svg";
+
+        $("#toolbarDiv").svg({
+          onLoad:function(toolbar){
+            $(toolbar.root()).attr({
+              "width":"100px",
+              "height":"50px"
+            });
+
+            $(document.body).svg({
+              onLoad:function(svg){
+
+                $(svg.root()).attr({
+                  "width":"100%",
+                  "height":"100%"
+                });
+
+                var toolbarOutlineRect = toolbar.rect(0,0,100,50,{
+                  fill:"white", 
+                  stroke:"black"
+                }) ;
+                
+                var rectButton = toolbar.group();
+                var rectButtonBackground = toolbar.rect(rectButton,0,0,50,50,{ 
+                  class:"background"
+                });
+                var rectButtonIcon = toolbar.rect(rectButton,10,10,30,30,{ 
+                  fill:"red", 
+                  stroke:"black"
+                });
+
+                var ellipseButton = toolbar.group({"transform":"translate(50,0)"});
+
+                var ellipseButtonBackground = toolbar.rect(ellipseButton,0,0,50,50,{
+                  class:"background"
+                });
+
+                var ellipseButtonIcon = toolbar.circle(ellipseButton,25,25,15,{
+                  fill:"blue",
+                  stroke:"black"
+                });
+
+
+                function hookUpDOMEvents(node,compiledStatechartInstance){
+                  //hook up DOM events
+                  ["mousedown","mouseup","mousemove"].forEach(function(eventName){
+                    if(compiledStatechartInstance[eventName]){
+                      node.addEventListener(eventName,function(e){
+                        e.preventDefault();
+                        compiledStatechartInstance[eventName](e)
+                      },false);
+                    }
+                  });
+                }
+
+                require(
+                  {
+                    "baseUrl":"/"
+                  },
+                  ["src/javascript/scxml/cgf/SCXMLCompiler",
+                    "demo/drawing-tool/transform",
+                    "xml!demo/drawing-tool/behaviour/canvas.xml",
+                    "xml!demo/drawing-tool/behaviour/node.xml",
+                    "xml!demo/drawing-tool/behaviour/toolbar.xml" ],
+
+                  function(compiler,svgTransformer,canvasBehaviourSCXML,nodeBehaviourSCXML,toolbarBehaviourSCXML){
+
+                    require( [window.DOMParser ?
+                        "src/javascript/scxml/cgf/util/xsl/browser" :
+                        "src/javascript/scxml/cgf/util/xsl/ie"],
+                      function(xslTransformer){
+
+              
+                      var d = new Date();
+
+                      compiler.compile({
+                        inFiles:[canvasBehaviourSCXML,nodeBehaviourSCXML,toolbarBehaviourSCXML],
+                        //debug:true,
+                        backend:"state",
+                        beautify:true,
+                        verbose:false,
+                        log:false,
+                        ie:false
+                      }, function(scArr){
+            
+                        console.log("Compiling statecharts took:",new Date() - d);
+                        //eval
+                        for(var i=0, l=scArr.length; i < l; i++){
+                          console.log(scArr[i]);
+                          eval(scArr[i]);
+                        }
+
+
+                        //hook up toolbar behaviour
+                        var toolbarSC = new ToolbarStatechartExecutionContext();
+                        toolbarSC.initialize();
+                        toolbarSC.init({
+                          ellipseButton:ellipseButton,
+                          rectButton:rectButton,
+                          ellipseIcon:ellipseButtonIcon,
+                          rectIcon:rectButtonIcon  
+                        });
+                        
+                        hookUpDOMEvents(toolbar.root(),toolbarSC);
+
+                        //hook up canvas behaviour
+                        var canvasSC = new CanvasStatechartExecutionContext(); 
+                        canvasSC.initialize();
+                        
+                        //pass in reference to rect
+                        canvasSC.init({  
+                          svg:svg,
+                          toolbarStatechart:toolbarSC,
+                          api:{
+                            addBehaviourToNode:function(node){
+                              //add behaviour
+                              var nodeSc = new NodeStatechartExecutionContext();
+                              nodeSc.initialize();
+                              nodeSc.init({
+                                rawNode:node,
+                                transformModule:svgTransformer
+                              });
+                              hookUpDOMEvents(node,nodeSc);
+                            }
+                          }
+                        });   
+
+                        hookUpDOMEvents(svg.root(),canvasSC);
+
+                      },xslTransformer);
+                    })
+                  }
+                );
+              }  
+            })
+          }
+        });
+
+        //build up the DOM
+      });
+    </script>
+  </head>
+  <body>
+    <div id="toolbarDiv"></div>
+  </body>
 </html>
 
 



Mime
View raw message