flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ha...@apache.org
Subject git commit: [flex-asjs] [refs/heads/develop] - Added BrowserUtils
Date Wed, 06 Jul 2016 10:42:25 GMT
Repository: flex-asjs
Updated Branches:
  refs/heads/develop 2f7d30fcb -> 8221a6685


Added BrowserUtils


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/8221a668
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/8221a668
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/8221a668

Branch: refs/heads/develop
Commit: 8221a6685be1f1cc741620454aa0defff03937c9
Parents: 2f7d30f
Author: Harbs <harbs@in-tools.com>
Authored: Wed Jul 6 13:42:21 2016 +0300
Committer: Harbs <harbs@in-tools.com>
Committed: Wed Jul 6 13:42:21 2016 +0300

----------------------------------------------------------------------
 .../projects/Core/src/main/flex/CoreClasses.as  |  1 +
 .../flex/org/apache/flex/utils/BrowserUtils.as  | 62 ++++++++++++++++++++
 .../main/flex/org/apache/flex/net/HTTPUtils.as  |  3 +-
 3 files changed, 65 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/8221a668/frameworks/projects/Core/src/main/flex/CoreClasses.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/CoreClasses.as b/frameworks/projects/Core/src/main/flex/CoreClasses.as
index aac3cd3..90badd8 100644
--- a/frameworks/projects/Core/src/main/flex/CoreClasses.as
+++ b/frameworks/projects/Core/src/main/flex/CoreClasses.as
@@ -126,6 +126,7 @@ internal class CoreClasses
 	    import org.apache.flex.utils.StringTrimmer; StringTrimmer;
 		import org.apache.flex.utils.HTMLLoader; HTMLLoader;
 }
+	import org.apache.flex.utils.BrowserUtils; BrowserUtils;
 	import org.apache.flex.utils.Endian; Endian;
 	import org.apache.flex.utils.Timer; Timer;
 	import org.apache.flex.utils.UIUtils; UIUtils;

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/8221a668/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/BrowserUtils.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/BrowserUtils.as
b/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/BrowserUtils.as
new file mode 100644
index 0000000..c3de4a3
--- /dev/null
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/BrowserUtils.as
@@ -0,0 +1,62 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.utils
+{
+	COMPILE::SWF
+	{
+		import flash.external.ExternalInterface;
+	}
+
+	/**
+	 *  The BrowserUtils class has convenience methods abstracting differences
+	 *  in executing browser code in Flash and HTML.
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10.2
+	 *  @playerversion AIR 2.6
+	 *  @productversion FlexJS 0.7.0
+	 */
+	public class BrowserUtils
+	{
+		/**
+		 *  evals arbitrary javascript code in the current browser context
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.7.0
+		 */
+		public static function executeJS(str:String):*
+		{
+			COMPILE::SWF
+			{
+				return ExternalInterface.call('eval', str);
+			}
+			
+			COMPILE::JS
+			{
+				return eval(str);
+			}
+	
+		}
+		public function BrowserUtils()
+		{
+		}
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/8221a668/frameworks/projects/Network/src/main/flex/org/apache/flex/net/HTTPUtils.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Network/src/main/flex/org/apache/flex/net/HTTPUtils.as b/frameworks/projects/Network/src/main/flex/org/apache/flex/net/HTTPUtils.as
index 106154c..fab6fdc 100644
--- a/frameworks/projects/Network/src/main/flex/org/apache/flex/net/HTTPUtils.as
+++ b/frameworks/projects/Network/src/main/flex/org/apache/flex/net/HTTPUtils.as
@@ -23,7 +23,7 @@ package org.apache.flex.net
         public function HTTPUtils()
         {
         }
-        static public function encodeUrlVariables(data:Object):String
+		public static function encodeUrlVariables(data:Object):String
         {
             if(!data)
                 return "";
@@ -40,6 +40,7 @@ package org.apache.flex.net
                 b.pop()
             return b.join("");
         }
+		
 
     }
 }
\ No newline at end of file


Mime
View raw message