You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by jm...@apache.org on 2014/08/27 09:15:51 UTC
[4/6] git commit: [flex-utilities] [refs/heads/develop] - Added
buttons to copy code, copy link to code and goto github (FLEX-34502,
FLEX-34492 and FLEX-34482)
Added buttons to copy code, copy link to code and goto github (FLEX-34502, FLEX-34492 and FLEX-34482)
Project: http://git-wip-us.apache.org/repos/asf/flex-utilities/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-utilities/commit/ca30f444
Tree: http://git-wip-us.apache.org/repos/asf/flex-utilities/tree/ca30f444
Diff: http://git-wip-us.apache.org/repos/asf/flex-utilities/diff/ca30f444
Branch: refs/heads/develop
Commit: ca30f4442113e04498b20fd491d13293bc874c08
Parents: 02c5bdb
Author: Justin Mclean <jm...@apache.org>
Authored: Wed Aug 27 17:00:39 2014 +1000
Committer: Justin Mclean <jm...@apache.org>
Committed: Wed Aug 27 17:00:39 2014 +1000
----------------------------------------------------------------------
TourDeFlex/TourDeFlex3/src/SourceTab.mxml | 30 ++++++++++++++++++++++++--
1 file changed, 28 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/ca30f444/TourDeFlex/TourDeFlex3/src/SourceTab.mxml
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/SourceTab.mxml b/TourDeFlex/TourDeFlex3/src/SourceTab.mxml
index b9450cf..c9d8f7c 100755
--- a/TourDeFlex/TourDeFlex3/src/SourceTab.mxml
+++ b/TourDeFlex/TourDeFlex3/src/SourceTab.mxml
@@ -26,6 +26,8 @@
import mx.rpc.events.FaultEvent;
import mx.controls.Alert;
+ public var app:String;
+
public function set source(file:String):void
{
label = file.substring(file.lastIndexOf("/")+1);
@@ -46,6 +48,25 @@
{
Alert.show("Error loading source file");
}
+
+ private function copyCode():void
+ {
+ System.setClipboard(ta.text);
+ }
+
+ private function copyLink():void
+ {
+ var linkText:String = "http://flex.apache.org/tourdeflex/?app=" + app;
+
+ System.setClipboard(linkText);
+ }
+
+ private function viewInGitHub():void
+ {
+ var gitHubLink:String = "https://github.com/apache/flex-utilities/tree/master/TourDeFlex/TourDeFlex3/src/" + srv.url;
+ var urlRequest:URLRequest = new URLRequest(gitHubLink);
+ navigateToURL(urlRequest, "_blank");
+ }
]]>
</fx:Script>
@@ -54,6 +75,11 @@
<mx:HTTPService id="srv" useProxy="false" resultFormat="text" result="resultHandler(event)" fault="faultHandler(event)"/>
</fx:Declarations>
- <mx:TextArea id= "ta" color="#0000A0" fontFamily="Courier" editable="false" wordWrap="false" width="100%" height="100%"/>
-
+ <mx:TextArea id="ta" color="#0000A0" fontFamily="Courier" editable="false" wordWrap="false" width="100%" height="100%"/>
+ <mx:HBox width="100%">
+ <mx:Spacer width="100%" />
+ <mx:Button label="Copy" click="copyCode()" />
+ <mx:Button label="Copy Link" click="copyLink()" />
+ <mx:Button label="GitHub" click="viewInGitHub()" />
+ </mx:HBox>
</mx:VBox>
\ No newline at end of file