making oAuth open up in a smaller centred window
authorAntony Pegg <antthelimey@gmail.com>
Mon, 18 Apr 2011 15:29:49 +0000 (11:29 -0400)
committerAntony Pegg <antthelimey@gmail.com>
Mon, 18 Apr 2011 15:29:49 +0000 (11:29 -0400)
.gitignore
net/systemeD/potlatch2/save/OAuthPanel.mxml
resources/ok_go.html [new file with mode: 0644]

index f3b6c16..b07f606 100644 (file)
@@ -2,13 +2,18 @@ build.properties
 l10n/locale/bundles
 version.as
 halcyon.tmproj
 l10n/locale/bundles
 version.as
 halcyon.tmproj
+Potlatch2.as3proj
 
 resources/locales
 resources/*.swf
 resources/*.cache
 resources/docs
 
 resources/locales
 resources/*.swf
 resources/*.cache
 resources/docs
+resources/mapquest
 
 /tests/bin/
 /tests/report/
 
 /generated
 
 /tests/bin/
 /tests/report/
 
 /generated
+
+bin/
+obj/
index 096222e..090b084 100644 (file)
        </mx:ControlBar>
        
        <mx:Script><![CDATA[
        </mx:ControlBar>
        
        <mx:Script><![CDATA[
+               import flash.display.InteractiveObject;
         import flash.events.Event;
         import flash.net.*;
         import flash.events.Event;
         import flash.net.*;
+               import flash.system.Capabilities;
         import mx.managers.PopUpManager;
         import net.systemeD.halcyon.connection.*;
         import org.iotashan.oauth.*;
         import mx.managers.PopUpManager;
         import net.systemeD.halcyon.connection.*;
         import org.iotashan.oauth.*;
+               import flash.external.ExternalInterface;
 
         private var connection:Connection;
         private var requestToken:OAuthToken;
 
         private var connection:Connection;
         private var requestToken:OAuthToken;
         }
         
         private function openURL(url:String):void {
         }
         
         private function openURL(url:String):void {
-            var urlRequest:URLRequest = new URLRequest(url);
-            navigateToURL(urlRequest, "_blank");
-        }
+                       if (ExternalInterface.available) {
+                               var winH:int = 560;
+                               var winW:int = 600;
+                               var leftPos:int  = (Capabilities.screenResolutionX - winW) / 2;
+                               var topPos:int = (Capabilities.screenResolutionY - winH) / 2;
+                               ExternalInterface.call( "window.open", url,"oAuthWin","height=" + winH + ",width=" + winW +",top=" + topPos + ", left=" + leftPos +", toolbar=no,scrollbars=no,status=no,location=no,menubar=no,directories=no");
+                               }               
+                       else
+                       {
+                               var urlRequest:URLRequest = new URLRequest(url);
+                               navigateToURL(urlRequest,"_blank");
+                       }
+               }
         
         private function getRequestToken():void {
             connection = Connection.getConnectionInstance();
         
         private function getRequestToken():void {
             connection = Connection.getConnectionInstance();
             
             var url:String = Connection.getParam("oauth_auth_url", "http://127.0.0.1:3000/oauth/authorize");            
             link.label = url;
             
             var url:String = Connection.getParam("oauth_auth_url", "http://127.0.0.1:3000/oauth/authorize");            
             link.label = url;
-            authoriseURL = url + "?oauth_token="+requestToken.key;
-            progress.visible = false;
+                       authoriseURL = url + "?oauth_token="+requestToken.key;
+                       progress.visible = false;
             gotLinkBox.visible = true;
         }
 
             gotLinkBox.visible = true;
         }
 
diff --git a/resources/ok_go.html b/resources/ok_go.html
new file mode 100644 (file)
index 0000000..9599d33
--- /dev/null
@@ -0,0 +1,19 @@
+<html>
+<head>
+       <script language="javascript">
+        function sendBack() {
+               if (window.self.opener) {
+                        window.self.opener.focus();
+               }
+               window.self.close();
+        }
+       </script>
+</head>
+<body onload="sendBack()">
+SUCCESS!
+<br />
+<br />
+go <a href="http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager07.html" target="_new">here</A> to clear cache and see this window again
+
+</body>
+</html>
\ No newline at end of file