You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2015/06/15 08:31:05 UTC
[31/48] git commit: [flex-utilities] [refs/heads/develop] - move
installerBadge under flex-installer
move installerBadge under flex-installer
Project: http://git-wip-us.apache.org/repos/asf/flex-utilities/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-utilities/commit/e3026f59
Tree: http://git-wip-us.apache.org/repos/asf/flex-utilities/tree/e3026f59
Diff: http://git-wip-us.apache.org/repos/asf/flex-utilities/diff/e3026f59
Branch: refs/heads/develop
Commit: e3026f596176df8116e22137def0e1414bae4e8e
Parents: cda7850
Author: Alex Harui <ah...@apache.org>
Authored: Sun Jun 14 23:12:25 2015 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Sun Jun 14 23:12:25 2015 -0700
----------------------------------------------------------------------
.../installerBadge/.actionScriptProperties | 24 ++
flex-installer/installerBadge/.flexProperties | 2 +
flex-installer/installerBadge/.fxpProperties | 12 +
flex-installer/installerBadge/.project | 18 ++
.../.settings/org.eclipse.core.resources.prefs | 3 +
flex-installer/installerBadge/README | 7 +
flex-installer/installerBadge/compile.sh | 1 +
.../html-template/badgeConfigService.php | 8 +
.../html-template/disclaimer.html | 44 +++
.../html-template/index.template.html | 94 ++++++
.../src/InstallApacheFlexBadge.mxml | 286 +++++++++++++++++++
.../images/backgroundRegular.png | Bin 0 -> 37086 bytes
.../images/backgroundSmall.png | Bin 0 -> 17788 bytes
.../resources/EmbeddedMedia.as | 56 ++++
.../styles/ApacheFlexBadgeStyle.css | 49 ++++
installerBadge/.actionScriptProperties | 24 --
installerBadge/.flexProperties | 2 -
installerBadge/.fxpProperties | 12 -
installerBadge/.project | 18 --
.../.settings/org.eclipse.core.resources.prefs | 3 -
installerBadge/README | 7 -
installerBadge/compile.sh | 1 -
.../html-template/badgeConfigService.php | 8 -
installerBadge/html-template/disclaimer.html | 44 ---
.../html-template/index.template.html | 94 ------
installerBadge/src/InstallApacheFlexBadge.mxml | 286 -------------------
.../images/backgroundRegular.png | Bin 37086 -> 0 bytes
.../images/backgroundSmall.png | Bin 17788 -> 0 bytes
.../resources/EmbeddedMedia.as | 56 ----
.../styles/ApacheFlexBadgeStyle.css | 49 ----
30 files changed, 604 insertions(+), 604 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e3026f59/flex-installer/installerBadge/.actionScriptProperties
----------------------------------------------------------------------
diff --git a/flex-installer/installerBadge/.actionScriptProperties b/flex-installer/installerBadge/.actionScriptProperties
new file mode 100644
index 0000000..991a460
--- /dev/null
+++ b/flex-installer/installerBadge/.actionScriptProperties
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<actionScriptProperties analytics="false" mainApplicationPath="InstallApacheFlexBadge.mxml" projectUUID="86e06d97-9ac5-4d36-a8ab-9da6d44644d9" version="11">
+ <compiler additionalCompilerArguments="-locale en_US" autoRSLOrdering="true" copyDependentFiles="true" fteInMXComponents="false" generateAccessible="true" htmlExpressInstall="true" htmlGenerate="true" htmlHistoryManagement="false" htmlPlayerVersionCheck="true" includeNetmonSwc="false" outputFolderPath="bin-debug" removeUnusedRSL="true" sourceFolderPath="src" strict="true" targetPlayerVersion="0.0.0" useApolloConfig="false" useDebugRSLSwfs="true" useFlashSDK="false" verifyDigests="true" warn="true">
+ <compilerSourcePath>
+ <compilerSourcePathEntry kind="1" linkType="1" path="/common/src"/>
+ </compilerSourcePath>
+ <libraryPath defaultLinkType="0">
+ <libraryPathEntry kind="4" path="">
+ <excludedEntries>
+ <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/flex.swc" useDefaultLinkType="false"/>
+ <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/core.swc" useDefaultLinkType="false"/>
+ </excludedEntries>
+ </libraryPathEntry>
+ </libraryPath>
+ <sourceAttachmentPath/>
+ </compiler>
+ <applications>
+ <application path="InstallApacheFlexBadge.mxml"/>
+ </applications>
+ <modules/>
+ <workers/>
+ <buildCSSFiles/>
+ <flashCatalyst validateFlashCatalystCompatibility="false"/>
+</actionScriptProperties>
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e3026f59/flex-installer/installerBadge/.flexProperties
----------------------------------------------------------------------
diff --git a/flex-installer/installerBadge/.flexProperties b/flex-installer/installerBadge/.flexProperties
new file mode 100644
index 0000000..33054f7
--- /dev/null
+++ b/flex-installer/installerBadge/.flexProperties
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<flexProperties enableServiceManager="false" flexServerFeatures="0" flexServerType="0" fmlDataModelLocation=".model/apacheFlex_InstallApacheFlexBadge.fml" toolCompile="true" useServerFlexSDK="false" version="2"/>
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e3026f59/flex-installer/installerBadge/.fxpProperties
----------------------------------------------------------------------
diff --git a/flex-installer/installerBadge/.fxpProperties b/flex-installer/installerBadge/.fxpProperties
new file mode 100644
index 0000000..48ee015
--- /dev/null
+++ b/flex-installer/installerBadge/.fxpProperties
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<fxpProperties abbreviated="false" authoringTool="Flex Builder" compiles="true" parentProject="86e06d97-9ac5-4d36-a8ab-9da6d44644d9" projectUUID="86e06d97-9ac5-4d36-a8ab-9da6d44644d9" pureCatalystProject="false" sdkVersion="4.8.0" uuid="3b8c53e2-3823-42c4-b508-038d4cca1eac" version="15">
+ <projects/>
+ <src/>
+ <swc>
+ <linked location="sdkPlaceHolder" path="sdkPlaceHolder" position="0" uuid="3b8c53e2-3823-42c4-b508-038d4cca1eac"/>
+ <linked location="/libs" path="\libs" position="1" uuid="3b8c53e2-3823-42c4-b508-038d4cca1eac"/>
+ </swc>
+ <misc/>
+ <theme/>
+ <mxmlFormattingPrefs groupAttributesByState="true" maxLineWidth="100" mxmlAlignAttributes="true" mxmlAttributeOrder="id,userLabel,includeIn,excludeFrom,visible,x,y,z,left,right,top,bottom,width,height,minWidth,minHeight,maxWidth,maxHeight,label" mxmlKeepAttributeValuesOrganized="true"/>
+</fxpProperties>
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e3026f59/flex-installer/installerBadge/.project
----------------------------------------------------------------------
diff --git a/flex-installer/installerBadge/.project b/flex-installer/installerBadge/.project
new file mode 100644
index 0000000..8035174
--- /dev/null
+++ b/flex-installer/installerBadge/.project
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>installerBadge</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>com.adobe.flexbuilder.project.flexbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>com.adobe.flexbuilder.project.flexnature</nature>
+ <nature>com.adobe.flexbuilder.project.actionscriptnature</nature>
+ </natures>
+</projectDescription>
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e3026f59/flex-installer/installerBadge/.settings/org.eclipse.core.resources.prefs
----------------------------------------------------------------------
diff --git a/flex-installer/installerBadge/.settings/org.eclipse.core.resources.prefs b/flex-installer/installerBadge/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 0000000..fcd6423
--- /dev/null
+++ b/flex-installer/installerBadge/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,3 @@
+#Mon Aug 13 11:22:10 PDT 2012
+eclipse.preferences.version=1
+encoding/<project>=utf-8
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e3026f59/flex-installer/installerBadge/README
----------------------------------------------------------------------
diff --git a/flex-installer/installerBadge/README b/flex-installer/installerBadge/README
new file mode 100644
index 0000000..b4415de
--- /dev/null
+++ b/flex-installer/installerBadge/README
@@ -0,0 +1,7 @@
+The code implements functionality to be viewed through an iframe on another domain. Please use one of these to embed the badge on your site or communications:
+
+Regular size (302 x 302)
+<iframe name="afSDKInstallBadgeRegular" src="http://flex.apache.org/installerbadge/index.html" frameborder="0" height="302" marginheight="0" marginwidth="0" scrolling="no" width="302"></iframe>
+
+Small size (402 x 84)
+<iframe name="afSDKInstallBadgeSmall" src="http://flex.apache.org/installerbadge/index.html" frameborder="0" height="84" marginheight="0" marginwidth="0" scrolling="no" width="402"></iframe>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e3026f59/flex-installer/installerBadge/compile.sh
----------------------------------------------------------------------
diff --git a/flex-installer/installerBadge/compile.sh b/flex-installer/installerBadge/compile.sh
new file mode 100644
index 0000000..4d46b15
--- /dev/null
+++ b/flex-installer/installerBadge/compile.sh
@@ -0,0 +1 @@
+$FLEX_SDK_HOME/bin/mxmlc -compiler.source-path+=../common/src src/InstallApacheFlexBadge.mxml
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e3026f59/flex-installer/installerBadge/html-template/badgeConfigService.php
----------------------------------------------------------------------
diff --git a/flex-installer/installerBadge/html-template/badgeConfigService.php b/flex-installer/installerBadge/html-template/badgeConfigService.php
new file mode 100644
index 0000000..cb7d797
--- /dev/null
+++ b/flex-installer/installerBadge/html-template/badgeConfigService.php
@@ -0,0 +1,8 @@
+<?php
+
+$ch = curl_init($_GET["url"]);
+curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+echo curl_exec($ch);
+curl_close($ch);
+
+?>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e3026f59/flex-installer/installerBadge/html-template/disclaimer.html
----------------------------------------------------------------------
diff --git a/flex-installer/installerBadge/html-template/disclaimer.html b/flex-installer/installerBadge/html-template/disclaimer.html
new file mode 100644
index 0000000..5c015ba
--- /dev/null
+++ b/flex-installer/installerBadge/html-template/disclaimer.html
@@ -0,0 +1,44 @@
+<!--
+ 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.
+-->
+
+<!DOCTYPE html>
+
+<html>
+<head>
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+
+ <title>Disclaimer - Apache Flex SDK Installer Badge</title>
+</head>
+<body>
+ <p>
+ Apache Flex is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator.
+ </p>
+ <br />
+ <p>
+ Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects.
+ </p>
+ <br />
+ <p>
+ While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.
+ </p>
+ <br />
+ <p>
+ Notice: Apache and Apache Flex are trademarks of The Apache Software Foundation. Other names may be trademarks of their respective owners.
+ </p>
+</body>
+</html>
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e3026f59/flex-installer/installerBadge/html-template/index.template.html
----------------------------------------------------------------------
diff --git a/flex-installer/installerBadge/html-template/index.template.html b/flex-installer/installerBadge/html-template/index.template.html
new file mode 100644
index 0000000..ce1d629
--- /dev/null
+++ b/flex-installer/installerBadge/html-template/index.template.html
@@ -0,0 +1,94 @@
+<!--
+ 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.
+-->
+
+<!DOCTYPE html>
+
+<html>
+<head>
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+
+ <title>${title}</title>
+
+ <style type="text/css">
+ body { margin: 0; padding: 0; }
+ object:focus { outline: none; }
+ #flashContent { display: none; }
+ #${application} { border: 1px solid #172647; }
+ </style>
+
+ <!--
+ SWFObject v2.2 <http://code.google.com/p/swfobject/>
+ is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
+ -->
+ <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
+
+ <script type="text/javascript">
+ /* use strict */
+
+ var swfVersionStr, params, attributes;
+
+ function displayType() {
+ if ((window.top != window.self) && window.parent)
+ return window.name;
+
+ return "";
+ }
+
+ function init() {
+ var prefix, theElement, theHeight, theWidth, widget;
+
+ if (displayType() != "") {
+ if (typeof window.innerWidth === 'number') {
+ theHeight = window.innerHeight;
+ theWidth = window.innerWidth;
+ } else {
+ theElement = window.document.documentElement;
+
+ theHeight = theElement.clientHeight;
+ theWidth = theElement.clientWidth;
+ }
+
+ widget = document.getElementById("${application}");
+ widget.style.height = (theHeight - 2) + "px";
+ widget.style.width = (theWidth - 2) + "px";
+ }
+ }
+
+ swfVersionStr = "${version_major}.${version_minor}.${version_revision}";
+ flashVars = { serviceURL: "http://flex.apache.org/" };
+ params = { quality: "high", bgcolor: "${bgcolor}", allowscriptaccess: "sameDomain",
+ allowfullscreen: "true" };
+ attributes = { id: "${application}", name: "${application}" };
+
+ swfobject.embedSWF("${swf}.swf", "flashContent", "300", "300",
+ swfVersionStr, "", flashVars, params, attributes);
+
+ swfobject.createCSS("#flashContent", "display: block;");
+ </script>
+
+</head>
+<body onload="init();">
+ <div id="flashContent">
+ <script type="text/javascript">
+ var pageHost = ((document.location.protocol == "https:") ? "https://" : "http://");
+ document.write("<a href='http://www.adobe.com/go/getflashplayer'><img src='"
+ + pageHost + "www.adobe.com/images/shared/download_buttons/get_flash_player.gif' alt='Get Adobe Flash player' /></a>" );
+ </script>
+ </div>
+</body>
+</html>
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e3026f59/flex-installer/installerBadge/src/InstallApacheFlexBadge.mxml
----------------------------------------------------------------------
diff --git a/flex-installer/installerBadge/src/InstallApacheFlexBadge.mxml b/flex-installer/installerBadge/src/InstallApacheFlexBadge.mxml
new file mode 100644
index 0000000..c8d8e0c
--- /dev/null
+++ b/flex-installer/installerBadge/src/InstallApacheFlexBadge.mxml
@@ -0,0 +1,286 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+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.
+
+-->
+
+<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
+ xmlns:s="library://ns.adobe.com/flex/spark"
+ xmlns:mx="library://ns.adobe.com/flex/mx"
+ xmlns:components="org.apache.flex.installApacheFlexBadge.components.*"
+ creationComplete="creationCompleteHandler(event)">
+
+ <fx:Style source="/org/apache/flex/installApacheFlexBadge/styles/ApacheFlexBadgeStyle.css" />
+
+ <fx:Script><![CDATA[
+ import mx.controls.Alert;
+ import mx.core.FlexGlobals;
+ import mx.events.FlexEvent;
+
+ import org.apache.flex.installApacheFlexBadge.resources.EmbeddedMedia;
+ import org.apache.flex.utilities.common.Constants;
+ import org.apache.flex.utilities.common.InternetUtil;
+ import org.apache.flex.utilities.common.MirrorURLUtil;
+ import org.apache.flex.utilities.common.Tools;
+
+ //----------------------------------------------------------------------
+ //
+ // Constants
+ //
+ //----------------------------------------------------------------------
+
+ private const INFO_ERROR_OPERATING_SYSTEM:String = "The Apache Flex SDK Installer application\nis not supported on your operating system.\n\nPlease see https://cwiki.apache.org/confluence/display/FLEX/Installation+help for alternatives.";
+ private const INFO_ERROR_RETRIEVE_CONFIG:String = "The application was unable to retrieve\nthe configuration file.";
+
+ private const LABEL_DOWNLOAD:String = "DOWNLOAD";
+
+ private const TITLE_ERROR_INTERNET:String = "Internet Error";
+ private const TITLE_ERROR_PLATFORM:String = "Platform Error";
+
+ //----------------------------------------------------------------------
+ //
+ // Variables
+ //
+ //----------------------------------------------------------------------
+
+ private var _applicationExtension:String;
+
+ private var _sdkBinaryFileName:String;
+
+ private var _installerDownloadPath:String;
+
+ private var _installerFileName:String;
+
+ private var _internetUtil:InternetUtil = InternetUtil.instance;
+
+ private var _mirrorURLUtil:MirrorURLUtil = MirrorURLUtil.instance;
+
+ private var _serviceURL:String;
+
+ [Bindable]
+ private var _sdkVersionString:String = "";
+
+ //----------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //----------------------------------------------------------------------
+
+ //----------------------------------
+ // btnDownload_clickHandler
+ //----------------------------------
+
+ private function btnDownload_clickHandler(event:MouseEvent):void
+ {
+ try
+ {
+ _applicationExtension = Tools.getApplicationExtension();
+
+ var request:URLRequest = new URLRequest(
+ _installerDownloadPath + _installerFileName + _applicationExtension);
+
+ navigateToURL(request, "_blank");
+ }
+ catch (error:Error)
+ {
+ Alert.show(INFO_ERROR_OPERATING_SYSTEM, TITLE_ERROR_PLATFORM);
+ }
+ }
+
+ //----------------------------------
+ // creationCompleteHandler
+ //----------------------------------
+
+ private function creationCompleteHandler(event:FlexEvent):void
+
+ {
+ if( Capabilities.manufacturer.toLowerCase().indexOf('linux') > -1 ){
+ Alert.show(INFO_ERROR_OPERATING_SYSTEM, TITLE_ERROR_PLATFORM);
+ }
+
+ _serviceURL = FlexGlobals.topLevelApplication.parameters.serviceURL;
+
+ var displayType:String = ExternalInterface.call("displayType");
+
+ var newStateName:String;
+ switch (displayType)
+ {
+ case "afSDKInstallBadgeSmall" :
+ {
+ newStateName = "small";
+
+ break;
+ }
+
+ case "afSDKInstallBadgeRegular" :
+ default :
+ {
+ newStateName = "regular";
+
+ break;
+ }
+ }
+ currentState = newStateName;
+
+ var url:String = _serviceURL + Constants.CONFIG_XML_NAME;
+
+ if (useCURL())
+ _internetUtil.fetch("badgeConfigService.php", internetFetchResultHandler, "url=" + escape(url));
+ else
+ _internetUtil.fetch(url, internetFetchResultHandler);
+ }
+
+ //----------------------------------
+ // getMirrorURLResultHandler
+ //----------------------------------
+
+ private function getMirrorURLResultHandler():void
+ {
+ _installerDownloadPath = _mirrorURLUtil.mirrorURL + _installerDownloadPath;
+
+ parseSDKVersionNumber();
+ }
+
+ //----------------------------------
+ // internetFetchResultHandler
+ //----------------------------------
+
+ private function internetFetchResultHandler():void
+ {
+ if (!_internetUtil.errorOccurred)
+ {
+ var configXML:XML = XML(_internetUtil.result);
+ var flexSDKNode:XMLList = configXML.products.ApacheFlexSDK;
+ var defaultFlexVersion:String = configXML.products.ApacheFlexSDK.@latestVersion.toString();
+
+ _sdkBinaryFileName = flexSDKNode.versions.children().(@id == defaultFlexVersion).@file.toString();
+
+ _installerFileName = configXML.installer.(@name == 'SDKInstallerApp').@file.toString();
+ _installerDownloadPath = configXML.installer.(@name == 'SDKInstallerApp').@path.toString();
+
+ if (_installerDownloadPath.substr(0, Constants.URL_PREFIX.length) != Constants.URL_PREFIX)
+ {
+ var mirrorURLCGI:String = configXML.mirror.(@name == 'MirrorURLCGI').@file.toString();
+
+ _mirrorURLUtil.getMirrorURL(_serviceURL + mirrorURLCGI, getMirrorURLResultHandler);
+ }
+ else
+ {
+ parseSDKVersionNumber();
+ }
+ }
+ else
+ {
+ Alert.show(INFO_ERROR_RETRIEVE_CONFIG, TITLE_ERROR_INTERNET);
+ }
+ }
+
+ //----------------------------------
+ // parseSDKVersionNumber
+ //----------------------------------
+
+ private function parseSDKVersionNumber():void
+ {
+ _sdkVersionString = _sdkBinaryFileName.substr(Constants.SDK_BINARY_FILE_NAME_PREFIX.length).split("-")[0];
+
+ btnDownload.enabled = true;
+ }
+
+ //----------------------------------
+ // showDislaimer
+ //----------------------------------
+
+ private function showDisclaimer():void
+ {
+ var request:URLRequest = new URLRequest(
+ "disclaimer.html");
+
+ navigateToURL(request, "_blank");
+ }
+
+ //----------------------------------
+ // useCURL
+ //----------------------------------
+
+ private function useCURL():Boolean
+ {
+ /*
+ Using a simple webservice (PHP + cUrl) to bypass cross domain
+ and security sandbox restrictions while developing.
+ */
+
+ var localDomain:String = InternetUtil.getTLDFromURL(
+ ExternalInterface.call("function () { return window.location.hostname; }"));
+
+ var remoteDomain:String = InternetUtil.getTLDFromURL(_serviceURL);
+
+ return (localDomain) && (localDomain != remoteDomain);
+ }
+
+ ]]></fx:Script>
+
+ <fx:Declarations />
+
+ <s:states>
+ <s:State name="regular" />
+ <s:State name="small" />
+ </s:states>
+
+ <s:Image id="imgBackgroundRegular" source="{EmbeddedMedia.backgroundRegular}" includeIn="regular"/>
+
+ <s:Group height="15" width="60"
+ left="188" top="230"
+ buttonMode="true"
+ click="showDisclaimer()"
+ includeIn="regular" />
+
+ <s:Image id="imgBackgroundSmall" source="{EmbeddedMedia.backgroundSmall}" includeIn="small"/>
+
+ <s:Group height="15" width="60"
+ left="146" top="57"
+ buttonMode="true"
+ click="showDisclaimer()"
+ includeIn="small" />
+
+ <s:Group height="15" width="60"
+ left="188" top="230"
+ buttonMode="true"
+ click="showDisclaimer()"
+ includeIn="small" />
+
+ <s:Group height="37" width="250"
+ left="75" left.small="95"
+ top.regular="185" top.small="15">
+ <s:Label text="{_sdkVersionString}"
+ fontFamily="openSansBold"
+ color="0x162545" fontSize="32"
+ trackingLeft="-1" trackingRight="-1"
+ left="87" top="9" />
+ </s:Group>
+
+ <s:Button id="btnDownload" label="{LABEL_DOWNLOAD}"
+ height="30"
+ bottom="10" bottom.small="12"
+ right.small="27"
+ horizontalCenter.regular="0"
+ enabled="false"
+ buttonMode="true"
+ useHandCursor="true"
+ click="btnDownload_clickHandler(event)"
+ styleName="mainBtnStyle"/>
+
+</s:Application>
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e3026f59/flex-installer/installerBadge/src/org/apache/flex/installApacheFlexBadge/images/backgroundRegular.png
----------------------------------------------------------------------
diff --git a/flex-installer/installerBadge/src/org/apache/flex/installApacheFlexBadge/images/backgroundRegular.png b/flex-installer/installerBadge/src/org/apache/flex/installApacheFlexBadge/images/backgroundRegular.png
new file mode 100644
index 0000000..73f61ca
Binary files /dev/null and b/flex-installer/installerBadge/src/org/apache/flex/installApacheFlexBadge/images/backgroundRegular.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e3026f59/flex-installer/installerBadge/src/org/apache/flex/installApacheFlexBadge/images/backgroundSmall.png
----------------------------------------------------------------------
diff --git a/flex-installer/installerBadge/src/org/apache/flex/installApacheFlexBadge/images/backgroundSmall.png b/flex-installer/installerBadge/src/org/apache/flex/installApacheFlexBadge/images/backgroundSmall.png
new file mode 100644
index 0000000..09e2c20
Binary files /dev/null and b/flex-installer/installerBadge/src/org/apache/flex/installApacheFlexBadge/images/backgroundSmall.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e3026f59/flex-installer/installerBadge/src/org/apache/flex/installApacheFlexBadge/resources/EmbeddedMedia.as
----------------------------------------------------------------------
diff --git a/flex-installer/installerBadge/src/org/apache/flex/installApacheFlexBadge/resources/EmbeddedMedia.as b/flex-installer/installerBadge/src/org/apache/flex/installApacheFlexBadge/resources/EmbeddedMedia.as
new file mode 100644
index 0000000..d788ff4
--- /dev/null
+++ b/flex-installer/installerBadge/src/org/apache/flex/installApacheFlexBadge/resources/EmbeddedMedia.as
@@ -0,0 +1,56 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.installApacheFlexBadge.resources
+{
+
+public final class EmbeddedMedia
+{
+ //--------------------------------------------------------------------------
+ //
+ // Class properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // backgroundRegular
+ //----------------------------------
+
+ [Embed(source="/org/apache/flex/installApacheFlexBadge/images/backgroundRegular.png")]
+ [Bindable]
+ public static var backgroundRegular:Class;
+
+ //----------------------------------
+ // backgroundSmall
+ //----------------------------------
+
+ [Embed(source="/org/apache/flex/installApacheFlexBadge/images/backgroundSmall.png")]
+ [Bindable]
+ public static var backgroundSmall:Class;
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ public function EmbeddedMedia() {}
+
+}
+}
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e3026f59/flex-installer/installerBadge/src/org/apache/flex/installApacheFlexBadge/styles/ApacheFlexBadgeStyle.css
----------------------------------------------------------------------
diff --git a/flex-installer/installerBadge/src/org/apache/flex/installApacheFlexBadge/styles/ApacheFlexBadgeStyle.css b/flex-installer/installerBadge/src/org/apache/flex/installApacheFlexBadge/styles/ApacheFlexBadgeStyle.css
new file mode 100644
index 0000000..384d7be
--- /dev/null
+++ b/flex-installer/installerBadge/src/org/apache/flex/installApacheFlexBadge/styles/ApacheFlexBadgeStyle.css
@@ -0,0 +1,49 @@
+/*
+
+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.
+
+*/
+@namespace s "library://ns.adobe.com/flex/spark";
+
+@font-face {
+ src: url("/assets/fonts/open-sans/OpenSans-Bold.ttf");
+ fontFamily: openSansBold;
+ advancedAntiAliasing: true;
+ unicodeRange:
+ U+0044, /* D */
+ U+004F, /* O */
+ U+0057, /* W */
+ U+004E, /* N */
+ U+004C, /* L */
+ U+0041, /* A */
+ U+0030-U+0039, /* Numbers [0..9] */
+ U+002E-U+002E; /* Period [.] */
+}
+
+s|Button
+{
+ skinClass : ClassReference("ws.tink.spark.skins.controls.ButtonSkin");
+ fontFamily : openSansBold;
+ fontSize : 14;
+ color : #FFFFFF;
+ borderColor: #DBDBDB;
+}
+
+.mainBtnStyle
+{
+ chromeColor: #679d13;
+}
+
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e3026f59/installerBadge/.actionScriptProperties
----------------------------------------------------------------------
diff --git a/installerBadge/.actionScriptProperties b/installerBadge/.actionScriptProperties
deleted file mode 100644
index 991a460..0000000
--- a/installerBadge/.actionScriptProperties
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<actionScriptProperties analytics="false" mainApplicationPath="InstallApacheFlexBadge.mxml" projectUUID="86e06d97-9ac5-4d36-a8ab-9da6d44644d9" version="11">
- <compiler additionalCompilerArguments="-locale en_US" autoRSLOrdering="true" copyDependentFiles="true" fteInMXComponents="false" generateAccessible="true" htmlExpressInstall="true" htmlGenerate="true" htmlHistoryManagement="false" htmlPlayerVersionCheck="true" includeNetmonSwc="false" outputFolderPath="bin-debug" removeUnusedRSL="true" sourceFolderPath="src" strict="true" targetPlayerVersion="0.0.0" useApolloConfig="false" useDebugRSLSwfs="true" useFlashSDK="false" verifyDigests="true" warn="true">
- <compilerSourcePath>
- <compilerSourcePathEntry kind="1" linkType="1" path="/common/src"/>
- </compilerSourcePath>
- <libraryPath defaultLinkType="0">
- <libraryPathEntry kind="4" path="">
- <excludedEntries>
- <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/flex.swc" useDefaultLinkType="false"/>
- <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/core.swc" useDefaultLinkType="false"/>
- </excludedEntries>
- </libraryPathEntry>
- </libraryPath>
- <sourceAttachmentPath/>
- </compiler>
- <applications>
- <application path="InstallApacheFlexBadge.mxml"/>
- </applications>
- <modules/>
- <workers/>
- <buildCSSFiles/>
- <flashCatalyst validateFlashCatalystCompatibility="false"/>
-</actionScriptProperties>
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e3026f59/installerBadge/.flexProperties
----------------------------------------------------------------------
diff --git a/installerBadge/.flexProperties b/installerBadge/.flexProperties
deleted file mode 100644
index 33054f7..0000000
--- a/installerBadge/.flexProperties
+++ /dev/null
@@ -1,2 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<flexProperties enableServiceManager="false" flexServerFeatures="0" flexServerType="0" fmlDataModelLocation=".model/apacheFlex_InstallApacheFlexBadge.fml" toolCompile="true" useServerFlexSDK="false" version="2"/>
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e3026f59/installerBadge/.fxpProperties
----------------------------------------------------------------------
diff --git a/installerBadge/.fxpProperties b/installerBadge/.fxpProperties
deleted file mode 100644
index 48ee015..0000000
--- a/installerBadge/.fxpProperties
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<fxpProperties abbreviated="false" authoringTool="Flex Builder" compiles="true" parentProject="86e06d97-9ac5-4d36-a8ab-9da6d44644d9" projectUUID="86e06d97-9ac5-4d36-a8ab-9da6d44644d9" pureCatalystProject="false" sdkVersion="4.8.0" uuid="3b8c53e2-3823-42c4-b508-038d4cca1eac" version="15">
- <projects/>
- <src/>
- <swc>
- <linked location="sdkPlaceHolder" path="sdkPlaceHolder" position="0" uuid="3b8c53e2-3823-42c4-b508-038d4cca1eac"/>
- <linked location="/libs" path="\libs" position="1" uuid="3b8c53e2-3823-42c4-b508-038d4cca1eac"/>
- </swc>
- <misc/>
- <theme/>
- <mxmlFormattingPrefs groupAttributesByState="true" maxLineWidth="100" mxmlAlignAttributes="true" mxmlAttributeOrder="id,userLabel,includeIn,excludeFrom,visible,x,y,z,left,right,top,bottom,width,height,minWidth,minHeight,maxWidth,maxHeight,label" mxmlKeepAttributeValuesOrganized="true"/>
-</fxpProperties>
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e3026f59/installerBadge/.project
----------------------------------------------------------------------
diff --git a/installerBadge/.project b/installerBadge/.project
deleted file mode 100644
index 8035174..0000000
--- a/installerBadge/.project
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>installerBadge</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>com.adobe.flexbuilder.project.flexbuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>com.adobe.flexbuilder.project.flexnature</nature>
- <nature>com.adobe.flexbuilder.project.actionscriptnature</nature>
- </natures>
-</projectDescription>
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e3026f59/installerBadge/.settings/org.eclipse.core.resources.prefs
----------------------------------------------------------------------
diff --git a/installerBadge/.settings/org.eclipse.core.resources.prefs b/installerBadge/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index fcd6423..0000000
--- a/installerBadge/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Mon Aug 13 11:22:10 PDT 2012
-eclipse.preferences.version=1
-encoding/<project>=utf-8
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e3026f59/installerBadge/README
----------------------------------------------------------------------
diff --git a/installerBadge/README b/installerBadge/README
deleted file mode 100644
index b4415de..0000000
--- a/installerBadge/README
+++ /dev/null
@@ -1,7 +0,0 @@
-The code implements functionality to be viewed through an iframe on another domain. Please use one of these to embed the badge on your site or communications:
-
-Regular size (302 x 302)
-<iframe name="afSDKInstallBadgeRegular" src="http://flex.apache.org/installerbadge/index.html" frameborder="0" height="302" marginheight="0" marginwidth="0" scrolling="no" width="302"></iframe>
-
-Small size (402 x 84)
-<iframe name="afSDKInstallBadgeSmall" src="http://flex.apache.org/installerbadge/index.html" frameborder="0" height="84" marginheight="0" marginwidth="0" scrolling="no" width="402"></iframe>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e3026f59/installerBadge/compile.sh
----------------------------------------------------------------------
diff --git a/installerBadge/compile.sh b/installerBadge/compile.sh
deleted file mode 100644
index 4d46b15..0000000
--- a/installerBadge/compile.sh
+++ /dev/null
@@ -1 +0,0 @@
-$FLEX_SDK_HOME/bin/mxmlc -compiler.source-path+=../common/src src/InstallApacheFlexBadge.mxml
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e3026f59/installerBadge/html-template/badgeConfigService.php
----------------------------------------------------------------------
diff --git a/installerBadge/html-template/badgeConfigService.php b/installerBadge/html-template/badgeConfigService.php
deleted file mode 100644
index cb7d797..0000000
--- a/installerBadge/html-template/badgeConfigService.php
+++ /dev/null
@@ -1,8 +0,0 @@
-<?php
-
-$ch = curl_init($_GET["url"]);
-curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
-echo curl_exec($ch);
-curl_close($ch);
-
-?>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e3026f59/installerBadge/html-template/disclaimer.html
----------------------------------------------------------------------
diff --git a/installerBadge/html-template/disclaimer.html b/installerBadge/html-template/disclaimer.html
deleted file mode 100644
index 5c015ba..0000000
--- a/installerBadge/html-template/disclaimer.html
+++ /dev/null
@@ -1,44 +0,0 @@
-<!--
- 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.
--->
-
-<!DOCTYPE html>
-
-<html>
-<head>
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-
- <title>Disclaimer - Apache Flex SDK Installer Badge</title>
-</head>
-<body>
- <p>
- Apache Flex is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator.
- </p>
- <br />
- <p>
- Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects.
- </p>
- <br />
- <p>
- While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.
- </p>
- <br />
- <p>
- Notice: Apache and Apache Flex are trademarks of The Apache Software Foundation. Other names may be trademarks of their respective owners.
- </p>
-</body>
-</html>
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e3026f59/installerBadge/html-template/index.template.html
----------------------------------------------------------------------
diff --git a/installerBadge/html-template/index.template.html b/installerBadge/html-template/index.template.html
deleted file mode 100644
index ce1d629..0000000
--- a/installerBadge/html-template/index.template.html
+++ /dev/null
@@ -1,94 +0,0 @@
-<!--
- 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.
--->
-
-<!DOCTYPE html>
-
-<html>
-<head>
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-
- <title>${title}</title>
-
- <style type="text/css">
- body { margin: 0; padding: 0; }
- object:focus { outline: none; }
- #flashContent { display: none; }
- #${application} { border: 1px solid #172647; }
- </style>
-
- <!--
- SWFObject v2.2 <http://code.google.com/p/swfobject/>
- is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
- -->
- <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
-
- <script type="text/javascript">
- /* use strict */
-
- var swfVersionStr, params, attributes;
-
- function displayType() {
- if ((window.top != window.self) && window.parent)
- return window.name;
-
- return "";
- }
-
- function init() {
- var prefix, theElement, theHeight, theWidth, widget;
-
- if (displayType() != "") {
- if (typeof window.innerWidth === 'number') {
- theHeight = window.innerHeight;
- theWidth = window.innerWidth;
- } else {
- theElement = window.document.documentElement;
-
- theHeight = theElement.clientHeight;
- theWidth = theElement.clientWidth;
- }
-
- widget = document.getElementById("${application}");
- widget.style.height = (theHeight - 2) + "px";
- widget.style.width = (theWidth - 2) + "px";
- }
- }
-
- swfVersionStr = "${version_major}.${version_minor}.${version_revision}";
- flashVars = { serviceURL: "http://flex.apache.org/" };
- params = { quality: "high", bgcolor: "${bgcolor}", allowscriptaccess: "sameDomain",
- allowfullscreen: "true" };
- attributes = { id: "${application}", name: "${application}" };
-
- swfobject.embedSWF("${swf}.swf", "flashContent", "300", "300",
- swfVersionStr, "", flashVars, params, attributes);
-
- swfobject.createCSS("#flashContent", "display: block;");
- </script>
-
-</head>
-<body onload="init();">
- <div id="flashContent">
- <script type="text/javascript">
- var pageHost = ((document.location.protocol == "https:") ? "https://" : "http://");
- document.write("<a href='http://www.adobe.com/go/getflashplayer'><img src='"
- + pageHost + "www.adobe.com/images/shared/download_buttons/get_flash_player.gif' alt='Get Adobe Flash player' /></a>" );
- </script>
- </div>
-</body>
-</html>
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e3026f59/installerBadge/src/InstallApacheFlexBadge.mxml
----------------------------------------------------------------------
diff --git a/installerBadge/src/InstallApacheFlexBadge.mxml b/installerBadge/src/InstallApacheFlexBadge.mxml
deleted file mode 100644
index c8d8e0c..0000000
--- a/installerBadge/src/InstallApacheFlexBadge.mxml
+++ /dev/null
@@ -1,286 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-
-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.
-
--->
-
-<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
- xmlns:s="library://ns.adobe.com/flex/spark"
- xmlns:mx="library://ns.adobe.com/flex/mx"
- xmlns:components="org.apache.flex.installApacheFlexBadge.components.*"
- creationComplete="creationCompleteHandler(event)">
-
- <fx:Style source="/org/apache/flex/installApacheFlexBadge/styles/ApacheFlexBadgeStyle.css" />
-
- <fx:Script><![CDATA[
- import mx.controls.Alert;
- import mx.core.FlexGlobals;
- import mx.events.FlexEvent;
-
- import org.apache.flex.installApacheFlexBadge.resources.EmbeddedMedia;
- import org.apache.flex.utilities.common.Constants;
- import org.apache.flex.utilities.common.InternetUtil;
- import org.apache.flex.utilities.common.MirrorURLUtil;
- import org.apache.flex.utilities.common.Tools;
-
- //----------------------------------------------------------------------
- //
- // Constants
- //
- //----------------------------------------------------------------------
-
- private const INFO_ERROR_OPERATING_SYSTEM:String = "The Apache Flex SDK Installer application\nis not supported on your operating system.\n\nPlease see https://cwiki.apache.org/confluence/display/FLEX/Installation+help for alternatives.";
- private const INFO_ERROR_RETRIEVE_CONFIG:String = "The application was unable to retrieve\nthe configuration file.";
-
- private const LABEL_DOWNLOAD:String = "DOWNLOAD";
-
- private const TITLE_ERROR_INTERNET:String = "Internet Error";
- private const TITLE_ERROR_PLATFORM:String = "Platform Error";
-
- //----------------------------------------------------------------------
- //
- // Variables
- //
- //----------------------------------------------------------------------
-
- private var _applicationExtension:String;
-
- private var _sdkBinaryFileName:String;
-
- private var _installerDownloadPath:String;
-
- private var _installerFileName:String;
-
- private var _internetUtil:InternetUtil = InternetUtil.instance;
-
- private var _mirrorURLUtil:MirrorURLUtil = MirrorURLUtil.instance;
-
- private var _serviceURL:String;
-
- [Bindable]
- private var _sdkVersionString:String = "";
-
- //----------------------------------------------------------------------
- //
- // Methods
- //
- //----------------------------------------------------------------------
-
- //----------------------------------
- // btnDownload_clickHandler
- //----------------------------------
-
- private function btnDownload_clickHandler(event:MouseEvent):void
- {
- try
- {
- _applicationExtension = Tools.getApplicationExtension();
-
- var request:URLRequest = new URLRequest(
- _installerDownloadPath + _installerFileName + _applicationExtension);
-
- navigateToURL(request, "_blank");
- }
- catch (error:Error)
- {
- Alert.show(INFO_ERROR_OPERATING_SYSTEM, TITLE_ERROR_PLATFORM);
- }
- }
-
- //----------------------------------
- // creationCompleteHandler
- //----------------------------------
-
- private function creationCompleteHandler(event:FlexEvent):void
-
- {
- if( Capabilities.manufacturer.toLowerCase().indexOf('linux') > -1 ){
- Alert.show(INFO_ERROR_OPERATING_SYSTEM, TITLE_ERROR_PLATFORM);
- }
-
- _serviceURL = FlexGlobals.topLevelApplication.parameters.serviceURL;
-
- var displayType:String = ExternalInterface.call("displayType");
-
- var newStateName:String;
- switch (displayType)
- {
- case "afSDKInstallBadgeSmall" :
- {
- newStateName = "small";
-
- break;
- }
-
- case "afSDKInstallBadgeRegular" :
- default :
- {
- newStateName = "regular";
-
- break;
- }
- }
- currentState = newStateName;
-
- var url:String = _serviceURL + Constants.CONFIG_XML_NAME;
-
- if (useCURL())
- _internetUtil.fetch("badgeConfigService.php", internetFetchResultHandler, "url=" + escape(url));
- else
- _internetUtil.fetch(url, internetFetchResultHandler);
- }
-
- //----------------------------------
- // getMirrorURLResultHandler
- //----------------------------------
-
- private function getMirrorURLResultHandler():void
- {
- _installerDownloadPath = _mirrorURLUtil.mirrorURL + _installerDownloadPath;
-
- parseSDKVersionNumber();
- }
-
- //----------------------------------
- // internetFetchResultHandler
- //----------------------------------
-
- private function internetFetchResultHandler():void
- {
- if (!_internetUtil.errorOccurred)
- {
- var configXML:XML = XML(_internetUtil.result);
- var flexSDKNode:XMLList = configXML.products.ApacheFlexSDK;
- var defaultFlexVersion:String = configXML.products.ApacheFlexSDK.@latestVersion.toString();
-
- _sdkBinaryFileName = flexSDKNode.versions.children().(@id == defaultFlexVersion).@file.toString();
-
- _installerFileName = configXML.installer.(@name == 'SDKInstallerApp').@file.toString();
- _installerDownloadPath = configXML.installer.(@name == 'SDKInstallerApp').@path.toString();
-
- if (_installerDownloadPath.substr(0, Constants.URL_PREFIX.length) != Constants.URL_PREFIX)
- {
- var mirrorURLCGI:String = configXML.mirror.(@name == 'MirrorURLCGI').@file.toString();
-
- _mirrorURLUtil.getMirrorURL(_serviceURL + mirrorURLCGI, getMirrorURLResultHandler);
- }
- else
- {
- parseSDKVersionNumber();
- }
- }
- else
- {
- Alert.show(INFO_ERROR_RETRIEVE_CONFIG, TITLE_ERROR_INTERNET);
- }
- }
-
- //----------------------------------
- // parseSDKVersionNumber
- //----------------------------------
-
- private function parseSDKVersionNumber():void
- {
- _sdkVersionString = _sdkBinaryFileName.substr(Constants.SDK_BINARY_FILE_NAME_PREFIX.length).split("-")[0];
-
- btnDownload.enabled = true;
- }
-
- //----------------------------------
- // showDislaimer
- //----------------------------------
-
- private function showDisclaimer():void
- {
- var request:URLRequest = new URLRequest(
- "disclaimer.html");
-
- navigateToURL(request, "_blank");
- }
-
- //----------------------------------
- // useCURL
- //----------------------------------
-
- private function useCURL():Boolean
- {
- /*
- Using a simple webservice (PHP + cUrl) to bypass cross domain
- and security sandbox restrictions while developing.
- */
-
- var localDomain:String = InternetUtil.getTLDFromURL(
- ExternalInterface.call("function () { return window.location.hostname; }"));
-
- var remoteDomain:String = InternetUtil.getTLDFromURL(_serviceURL);
-
- return (localDomain) && (localDomain != remoteDomain);
- }
-
- ]]></fx:Script>
-
- <fx:Declarations />
-
- <s:states>
- <s:State name="regular" />
- <s:State name="small" />
- </s:states>
-
- <s:Image id="imgBackgroundRegular" source="{EmbeddedMedia.backgroundRegular}" includeIn="regular"/>
-
- <s:Group height="15" width="60"
- left="188" top="230"
- buttonMode="true"
- click="showDisclaimer()"
- includeIn="regular" />
-
- <s:Image id="imgBackgroundSmall" source="{EmbeddedMedia.backgroundSmall}" includeIn="small"/>
-
- <s:Group height="15" width="60"
- left="146" top="57"
- buttonMode="true"
- click="showDisclaimer()"
- includeIn="small" />
-
- <s:Group height="15" width="60"
- left="188" top="230"
- buttonMode="true"
- click="showDisclaimer()"
- includeIn="small" />
-
- <s:Group height="37" width="250"
- left="75" left.small="95"
- top.regular="185" top.small="15">
- <s:Label text="{_sdkVersionString}"
- fontFamily="openSansBold"
- color="0x162545" fontSize="32"
- trackingLeft="-1" trackingRight="-1"
- left="87" top="9" />
- </s:Group>
-
- <s:Button id="btnDownload" label="{LABEL_DOWNLOAD}"
- height="30"
- bottom="10" bottom.small="12"
- right.small="27"
- horizontalCenter.regular="0"
- enabled="false"
- buttonMode="true"
- useHandCursor="true"
- click="btnDownload_clickHandler(event)"
- styleName="mainBtnStyle"/>
-
-</s:Application>
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e3026f59/installerBadge/src/org/apache/flex/installApacheFlexBadge/images/backgroundRegular.png
----------------------------------------------------------------------
diff --git a/installerBadge/src/org/apache/flex/installApacheFlexBadge/images/backgroundRegular.png b/installerBadge/src/org/apache/flex/installApacheFlexBadge/images/backgroundRegular.png
deleted file mode 100644
index 73f61ca..0000000
Binary files a/installerBadge/src/org/apache/flex/installApacheFlexBadge/images/backgroundRegular.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e3026f59/installerBadge/src/org/apache/flex/installApacheFlexBadge/images/backgroundSmall.png
----------------------------------------------------------------------
diff --git a/installerBadge/src/org/apache/flex/installApacheFlexBadge/images/backgroundSmall.png b/installerBadge/src/org/apache/flex/installApacheFlexBadge/images/backgroundSmall.png
deleted file mode 100644
index 09e2c20..0000000
Binary files a/installerBadge/src/org/apache/flex/installApacheFlexBadge/images/backgroundSmall.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e3026f59/installerBadge/src/org/apache/flex/installApacheFlexBadge/resources/EmbeddedMedia.as
----------------------------------------------------------------------
diff --git a/installerBadge/src/org/apache/flex/installApacheFlexBadge/resources/EmbeddedMedia.as b/installerBadge/src/org/apache/flex/installApacheFlexBadge/resources/EmbeddedMedia.as
deleted file mode 100644
index d788ff4..0000000
--- a/installerBadge/src/org/apache/flex/installApacheFlexBadge/resources/EmbeddedMedia.as
+++ /dev/null
@@ -1,56 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// 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.installApacheFlexBadge.resources
-{
-
-public final class EmbeddedMedia
-{
- //--------------------------------------------------------------------------
- //
- // Class properties
- //
- //--------------------------------------------------------------------------
-
- //----------------------------------
- // backgroundRegular
- //----------------------------------
-
- [Embed(source="/org/apache/flex/installApacheFlexBadge/images/backgroundRegular.png")]
- [Bindable]
- public static var backgroundRegular:Class;
-
- //----------------------------------
- // backgroundSmall
- //----------------------------------
-
- [Embed(source="/org/apache/flex/installApacheFlexBadge/images/backgroundSmall.png")]
- [Bindable]
- public static var backgroundSmall:Class;
-
- //--------------------------------------------------------------------------
- //
- // Constructor
- //
- //--------------------------------------------------------------------------
-
- public function EmbeddedMedia() {}
-
-}
-}
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e3026f59/installerBadge/src/org/apache/flex/installApacheFlexBadge/styles/ApacheFlexBadgeStyle.css
----------------------------------------------------------------------
diff --git a/installerBadge/src/org/apache/flex/installApacheFlexBadge/styles/ApacheFlexBadgeStyle.css b/installerBadge/src/org/apache/flex/installApacheFlexBadge/styles/ApacheFlexBadgeStyle.css
deleted file mode 100644
index 384d7be..0000000
--- a/installerBadge/src/org/apache/flex/installApacheFlexBadge/styles/ApacheFlexBadgeStyle.css
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
-
-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.
-
-*/
-@namespace s "library://ns.adobe.com/flex/spark";
-
-@font-face {
- src: url("/assets/fonts/open-sans/OpenSans-Bold.ttf");
- fontFamily: openSansBold;
- advancedAntiAliasing: true;
- unicodeRange:
- U+0044, /* D */
- U+004F, /* O */
- U+0057, /* W */
- U+004E, /* N */
- U+004C, /* L */
- U+0041, /* A */
- U+0030-U+0039, /* Numbers [0..9] */
- U+002E-U+002E; /* Period [.] */
-}
-
-s|Button
-{
- skinClass : ClassReference("ws.tink.spark.skins.controls.ButtonSkin");
- fontFamily : openSansBold;
- fontSize : 14;
- color : #FFFFFF;
- borderColor: #DBDBDB;
-}
-
-.mainBtnStyle
-{
- chromeColor: #679d13;
-}
-