<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -58,6 +58,11 @@ package org.windmill {
       stage.removeEventListener(MouseEvent.MOUSE_OVER, WMExplorer.select);
       stage.removeEventListener(MouseEvent.MOUSE_DOWN, WMExplorer.stop);
       WMExplorer.running = false;
+      
+      var res:* = ExternalInterface.call('wm_explorerStopped');
+      if (!res) {
+        WMLogger.log('(Windmill Flash bridge not found.)');
+      }
     }
 
     public static function highlight(e:MouseEvent):void {</diff>
      <filename>flash/org/windmill/WMExplorer.as</filename>
    </modified>
    <modified>
      <diff>@@ -18,7 +18,7 @@ var _f = windmill.controller.flash;
 
 _f.click = function (paramObj) {
   var movie = lookupNode(paramObj);
-  var res = movie['wm_click']({chain:paramObj.optchain});
+  var res = movie['wm_click']({chain:paramObj['swf.chain']});
   
   if (res){
     throw (JSON.stringify(res));</diff>
      <filename>windmill/html/js/controller/flash.js</filename>
    </modified>
    <modified>
      <diff>@@ -43,7 +43,7 @@ windmill.controller.extensions.assertFormMethod = function (paramObject) {
 // This makes it show up in the IDE -- note: it needs to be
 // an object key *string* of &quot;extensions.yourAsserName&quot;
 // You have to pass it as a string, since it contains a dot
-flashunit.methods['extensions.assertFormMethod'] = {
+windmill.registry.methods['extensions.assertFormMethod'] = {
   locator: true,
   option: 'validator'
 };</diff>
      <filename>windmill/html/js/extensions/extensions.js</filename>
    </modified>
    <modified>
      <diff>@@ -176,7 +176,7 @@ windmill.ui.assertexplorer = new function() {
 
       try {
         //Reset the selected element
-        windmill.ui.remote.selectedElement = null;
+        windmill.ui.remote.selectedInputID = null;
         $('assertx').src = 'img/axon.png';
         $('domExp').style.visibility = 'hidden';
         $('domExp').innerHTML = '';</diff>
      <filename>windmill/html/js/wm/ide/ax.js</filename>
    </modified>
    <modified>
      <diff>@@ -28,8 +28,8 @@ windmill.ui.dx = new function() {
   
   //Display the id in the remote
   this.setIdInRemote = function(e) {
-    if ($(windmill.ui.remote.selectedElement) == null){
-      windmill.ui.remote.selectedElement = null;
+    if ($(windmill.ui.remote.selectedInputID) == null){
+      windmill.ui.remote.selectedInputID = null;
     }
     
     //if absolute xpath is not wanted try our best to get a better locater
@@ -113,18 +113,18 @@ windmill.ui.dx = new function() {
   this.updateAction = function(){
     var a = this.parseDOMExp();
     a[0] = a[0].toLowerCase();
-    
-    if (windmill.ui.remote.selectedElementOption) {
-      var id = windmill.ui.remote.selectedElementOption.replace('option', '');
-      $(id + 'optionType').value = 'opt'+a[0];
-      $(id + 'option').value = a[1];
-      $(id + 'option').focus();
-    }
-    if (windmill.ui.remote.selectedElement) {
-      var id = windmill.ui.remote.selectedElement.replace('locator', '');
-      $(id + 'locatorType').value = a[0];
-      $(id + 'locator').value = a[1];
-      $(id + 'locator').focus();
+
+    if (windmill.ui.remote.selectedInputID) {
+      var id = windmill.ui.remote.selectedInputID;
+      var input = $(id);
+      
+      if (id.indexOf(&quot;option&quot;) == -1){
+        var dd = $(id+&quot;Type&quot;);
+        dd.value = a[0];
+      }
+      
+      input.value = a[1];
+      input.focus();
     }
   };
   
@@ -151,7 +151,7 @@ windmill.ui.dx = new function() {
       e.preventDefault();
     }
     
-    var optId = windmill.ui.remote.selectedElementOption;
+    var optId = windmill.ui.remote.selectedInputID;
     //if an option section is selected and the altKey is down append the mouse coords
     if ((optId != null) &amp;&amp; (e.altKey)){
       if ($(optId).value == &quot;&quot;){
@@ -209,8 +209,7 @@ windmill.ui.dx = new function() {
 
     try {
       //Reset the selected element
-      windmill.ui.remote.selectedElement = null;
-      windmill.ui.remote.selectedElementOption = null;
+      windmill.ui.remote.selectedInputID = null;
       
       $('explorer').src = 'img/xon.png';
       this.dxRecursiveUnBind(windmill.testWin());</diff>
      <filename>windmill/html/js/wm/ide/dx.js</filename>
    </modified>
    <modified>
      <diff>@@ -17,8 +17,7 @@ Copyright 2006-2007, Open Source Applications Foundation
 //Functions for interacting with the remote
 /***************************************/
 windmill.ui.remote = new function() {
-    this.selectedElement = null;
-    this.selectedElementOption = null;
+    this.selectedInputID = null;
 
     this.scrollRecorderTextArea = function() {
         var obj = $(&quot;ideForm&quot;);
@@ -89,15 +88,10 @@ windmill.ui.remote = new function() {
         }
     };
 
-    this.setRemoteElem = function(id) {
-      this.selectedElementOption = null;
-      this.selectedElement = id;
+    this.setInputID = function(id) {
+      this.selectedInputID = null;
+      this.selectedInputID = id;
     };
-    this.setRemoteElemOption = function(id) {
-      this.selectedElement = null;
-      this.selectedElementOption = id;
-    };
-    
     //This is because the google chrome rendering engine sucks
     //and makes drop down boxes with background images black
     this.addCSSBG = function(){
@@ -134,7 +128,7 @@ windmill.ui.remote = new function() {
           //So that we don't leave the selected element
           //variable turned on when there are no actions in the IDE
           if (pElement.id == 'ideForm') {
-            windmill.ui.remote.selectedElement = null;
+            windmill.ui.remote.selectedInputID = null;
           }
         };
         setTimeout(&quot;d()&quot;, 800);
@@ -257,11 +251,11 @@ windmill.ui.remote = new function() {
                   var paramsObj = {};
                   paramsObj.uuid = suite.childNodes[j].id;
 
-                  if (flashunit.methods[actionObj.method].locator) {
+                  if (windmill.registry.methods[actionObj.method].locator) {
                     var si = $(suite.childNodes[j].id + 'locatorType').selectedIndex;
                     paramsObj[$(suite.childNodes[j].id + 'locatorType')[si].value] = $(suite.childNodes[j].id + 'locator').value;
                   }
-                  if (flashunit.methods[actionObj.method].option) {
+                  if (windmill.registry.methods[actionObj.method].option) {
                     var optNode = $(suite.childNodes[j].id + 'optionType');
                     //if we have a select vs a span (1 option)
                     if (optNode.tagName.toLowerCase() == &quot;select&quot;){
@@ -303,7 +297,7 @@ windmill.ui.remote = new function() {
     };
     
     this.getMethods = function(state){
-      var reg = flashunit;
+      var reg = windmill.registry;
       
       var select = document.createElement('select');
       select.className = 'smalloption';
@@ -334,7 +328,7 @@ windmill.ui.remote = new function() {
     };
     
     this.getOptions = function(state){
-      var reg = flashunit;
+      var reg = windmill.registry;
       
       var select = document.createElement('select');
       select.className = 'smalloption';
@@ -393,7 +387,7 @@ windmill.ui.remote = new function() {
     };
     
     this.getLocatorType = function(params){
-      var reg = flashunit;
+      var reg = windmill.registry;
       var locator = null;
       //Get the locator from all available
       for (var loc = 0; loc &lt; reg.locator.length; loc++){
@@ -406,7 +400,7 @@ windmill.ui.remote = new function() {
     
     this.getLocators = function(state){
       var _this = windmill.ui.remote;
-      var reg = flashunit;
+      var reg = windmill.registry;
       
       if (!reg.methods[state.method].locator){
         return false;
@@ -441,7 +435,7 @@ windmill.ui.remote = new function() {
     };
     
     this.getLocatorInput = function(state){
-      var reg = flashunit;
+      var reg = windmill.registry;
       var _this = windmill.ui.remote;
       var locator = _this.getLocatorType(state.params);
       
@@ -461,13 +455,13 @@ windmill.ui.remote = new function() {
       //in firefox there was a bug moving the focus to the element we clicked, not sure why
       //but this seems to fix it. 
       if (!windmill.browser.isIE6x) {
-        input.setAttribute('onFocus', 'windmill.ui.remote.setRemoteElem(\'' + input.id + '\')');
+        input.setAttribute('onFocus', 'windmill.ui.remote.setInputID(\'' + input.id + '\')');
       } 
       return input;
     };
     
     this.getOptionInput = function(state){
-      var reg = flashunit;
+      var reg = windmill.registry;
       
       var input = document.createElement('input');
       input.name = 'optValue';
@@ -500,7 +494,7 @@ windmill.ui.remote = new function() {
       //give the value input an id
       input.id = state.action.id + 'option';
       if (!windmill.browser.isIE6x) {
-        input.setAttribute('onFocus', 'windmill.ui.remote.setRemoteElemOption(\'' + input.id + '\')');
+        input.setAttribute('onFocus', 'windmill.ui.remote.setInputID(\'' + input.id + '\')');
       }
 
       return input;
@@ -535,11 +529,25 @@ windmill.ui.remote = new function() {
       return action;
     };
     
+    this.getSWF = function(state){
+      
+      var input = document.createElement('input');
+      input.id = state.action.id + 'swf';
+      input.className = 'texta';
+      
+      if (!windmill.browser.isIE6x) {
+        input.setAttribute('onFocus', 'windmill.ui.remote.setInputID(\'' + input.id + '\')');
+      }
+      
+      return input;
+    };
+    
     //This function takes a method and it's params and returns a DOM
     //Element representing that action for the UI
     this.buildAction = function(method, params) {
         var _this = windmill.ui.remote;
-        var reg = flashunit;
+        var reg = windmill.registry;
+        
         //if we just want a blank action
         //default to type for now so everything gets displayed
         if (method == null) {
@@ -581,6 +589,19 @@ windmill.ui.remote = new function() {
           jQuery(action).append(jQuery(locCont));
         }
         
+        //if we have a flash action swf is true
+        //build the swf UI
+        if (reg.methods[method].swf){
+         var swfCont = document.createElement('div');
+         var swfLoc = _this.getLocators(state);
+         swfLoc.id = state.action.id +&quot;swfType&quot;;
+         var swfInput = _this.getSWF(state);
+         swfCont.appendChild(swfLoc);
+         swfCont.appendChild(swfInput);
+         
+         jQuery(action).append(jQuery(swfCont));
+        }
+        
         //if this action has options, add them in a container
         if (options){
           var optCont = document.createElement('div');</diff>
      <filename>windmill/html/js/wm/ide/remote.js</filename>
    </modified>
    <modified>
      <diff>@@ -197,13 +197,15 @@ windmill.ui.playback = new function() {
 
                           var paramsObj = {};
                           paramsObj.uuid = suites[i].childNodes[j].id;
-
-                          if (flashunit.methods[actionObj.method].locator) {
+                          
+                          //if there is a locator
+                          if (windmill.registry.methods[actionObj.method].locator) {
                               var si = $(suites[i].childNodes[j].id + 'locatorType').selectedIndex;
                               paramsObj[$(suites[i].childNodes[j].id + 'locatorType')[si].value] = $(suites[i].childNodes[j].id + 'locator').value;
 
                           }
-                          if (flashunit.methods[actionObj.method].option) {
+                          //if there is an option
+                          if (windmill.registry.methods[actionObj.method].option) {
                               var optionNode = $(suites[i].childNodes[j].id + 'optionType');
                               //if we have a drop down, get the selected element
                               if (optionNode.tagName.toLowerCase() == &quot;select&quot;){
@@ -215,7 +217,20 @@ windmill.ui.playback = new function() {
                                 paramsObj[$(suites[i].childNodes[j].id + 'optionType').innerHTML] = $(suites[i].childNodes[j].id + 'option').value;
                               }
                           }
-
+                          //if there is a swf
+                           if (windmill.registry.methods[actionObj.method].swf) {
+                                var optionNode = $(suites[i].childNodes[j].id + 'swfType');
+                                //if we have a drop down, get the selected element
+                                if (optionNode.tagName.toLowerCase() == &quot;select&quot;){
+                                  var si = optionNode.selectedIndex;
+                                  paramsObj['swf.'+$(suites[i].childNodes[j].id + 'swfType')[si].value] = $(suites[i].childNodes[j].id + 'swf').value; 
+                                }
+                                //if there is only one option, it's a span, get the innerHTML
+                                else{
+                                  paramsObj['swf.'+$(suites[i].childNodes[j].id + 'swfType').innerHTML] = $(suites[i].childNodes[j].id + 'swf').value;
+                                }
+                            }
+                          
                           actionObj.params = paramsObj;
                       }
 </diff>
      <filename>windmill/html/js/wm/ide/ui.js</filename>
    </modified>
    <modified>
      <diff>@@ -14,24 +14,24 @@ Copyright 2006-2007, Open Source Applications Foundation
  limitations under the License.
 */
 
-flashunit = new function () {
+windmill.registry = new function () {
   this.methods  = {};
   this.locator = [];
   this.option  = [];
 };
 
 //Setup all the current methods supported
-flashunit.locator = ['id','link','xpath','jsid', 'name','value','classname', 'tagname','label','jquery', 'rteID','chain'];
-//flashunit.locator.push('id','link','xpath','jsid', 'name','classname', 'tagname');
+windmill.registry.locator = ['id','link','xpath','jsid', 'name','value','classname', 'tagname','label','jquery', 'rteID','chain'];
+//windmill.registry.locator.push('id','link','xpath','jsid', 'name','classname', 'tagname');
 
-for( var i=0; i&lt;flashunit.locator.length;i++ ){
-  flashunit.option.push('opt'+flashunit.locator[i]);
+for( var i=0; i&lt;windmill.registry.locator.length;i++ ){
+  windmill.registry.option.push('opt'+windmill.registry.locator[i]);
 }
 
-flashunit.option.push('text','url','option','validator','destination','stopOnFailure', 'milliseconds', 'timeout','js', 'status','domain', 'coords', 'pixels', 'val');
+windmill.registry.option.push('text','url','option','validator','destination','stopOnFailure', 'milliseconds', 'timeout','js', 'status','domain', 'coords', 'pixels', 'val');
 
 //Setup method registry
-flashunit.methods = {
+windmill.registry.methods = {
   '-- Mouse --': {'locator': false, 'option': false, 'section': true},
   'click': {'locator': true, 'option': false},
   'doubleClick': {'locator': true, 'option': false},
@@ -84,7 +84,8 @@ flashunit.methods = {
   'storeVarFromLocAttrib': {'locator': true, 'option': 'options' },
   'triggerEvent': {'locator': true, 'option': 'option' },
   '-- Flash --': {'locator': false, 'option': false, 'section': true},
-  'flash.click': {'locator': true, 'option': true, 'optionIsLocator': true},
+  'flash.click': {'swf':true, 'locator': true, 'option': false},
+  'flash.type': {'swf':true, 'locator': true, 'option': 'option'},
   '-- Asserts --': {'locator': false, 'option': false, 'section': true},
   'asserts.assertJS': {'locator': false, 'option': 'js' },
   'asserts.assertIDEJS': {'locator': false, 'option': 'js' },</diff>
      <filename>windmill/html/js/wm/registry.js</filename>
    </modified>
    <modified>
      <diff>@@ -23,9 +23,9 @@ windmill.service = new function() {
             if ((meth.charAt(0) != '_') &amp;&amp; (!windmill.controller.asserts[meth].jsUnitAssert) &amp;&amp; (typeof(windmill.controller.asserts[meth]) != 'object')) {
 
                 var newMethName = meth.replace('assert', '');
-                flashunit.methods['asserts.assertNot' + newMethName] = {
-                    'locator': flashunit.methods['asserts.' + meth].locator,
-                    'option': flashunit.methods['asserts.' + meth].option
+                windmill.registry.methods['asserts.assertNot' + newMethName] = {
+                    'locator': windmill.registry.methods['asserts.' + meth].locator,
+                    'option': windmill.registry.methods['asserts.' + meth].option
                 };
             }
         }</diff>
      <filename>windmill/html/js/wm/utils.js</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>a06d2661242d683b7d18610342dc32ec3daeff72</id>
    </parent>
  </parents>
  <author>
    <name>Adam Christian</name>
    <email>adam.christian@gmail.com</email>
  </author>
  <url>http://github.com/mde/windmill/commit/619175f0e74d5933ba71e0fc8ae1ca76588984eb</url>
  <id>619175f0e74d5933ba71e0fc8ae1ca76588984eb</id>
  <committed-date>2009-09-15T20:19:45-07:00</committed-date>
  <authored-date>2009-09-15T20:19:45-07:00</authored-date>
  <message>Flash goodness is live</message>
  <tree>3adba8b4b4548877f13e4e2f97bbc6418212f63d</tree>
  <committer>
    <name>Adam Christian</name>
    <email>adam.christian@gmail.com</email>
  </committer>
</commit>
