|
From: <luk...@us...> - 2006-04-08 20:44:54
|
Revision: 52 Author: lukebayes Date: 2006-04-08 13:44:50 -0700 (Sat, 08 Apr 2006) ViewCVS: http://svn.sourceforge.net/asunit/?rev=52&view=rev Log Message: ----------- Put tibors code into repos Added Paths: ----------- trunk/flashui/createTestSuites/lib-tibor.jsfl Added: trunk/flashui/createTestSuites/lib-tibor.jsfl =================================================================== --- trunk/flashui/createTestSuites/lib-tibor.jsfl (rev 0) +++ trunk/flashui/createTestSuites/lib-tibor.jsfl 2006-04-08 20:44:50 UTC (rev 52) @@ -0,0 +1,44 @@ +/** + * This file contains functionality that is shared by other ASUnit related jsfl-Files. + * + * @author Tibor Claassen (ti...@im...) + * @version 1.0 + * +*/ + + function getActiveDocumentURI() { + + var uri = fl.getDocumentDOM().path; + if(uri == undefined) { + fl.trace(">> Cannot determine path to current document on disk. Try saving first."); + return false; + } + + var isWin = (getPlatform() == "WIN") ? true : false; + var isVersion7 = getVersion() < 8; + + if (isWin) uri = uri.split("\\"); + else if (isVersion7) uri = uri.split(":"); + else uri = uri.split("/"); + uri.pop(); + uri = uri.join("/") + "/"; + if (isWin) uri = "/" + uri.split(":").join("|"); + else if (isVersion7) uri = "/" + uri; + uri = "file://" + uri; + + return uri; + } + + function getPlatform() { + return fl.version.substr(0, 3); + } + + function getVersion() { + return fl.version.charAt(4) * 1; + } + + function getRevision() { + var revision = fl.version.charAt(6) * 1; + return getVersion() + revision / 10; + } + \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |