Permalink
Browse files

initial commit

  • Loading branch information...
0 parents commit 8ebc792656e23f05a5ccc0996cf7482b8637f3b6 @zagraves zagraves committed Jul 9, 2010
Showing with 19,003 additions and 0 deletions.
  1. +16 −0 .actionScriptProperties
  2. +2 −0 .flexProperties
  3. +18 −0 .project
  4. +3 −0 .settings/com.adobe.flexbuilder.project.prefs
  5. +3 −0 .settings/org.eclipse.core.resources.prefs
  6. +292 −0 html-template/AC_OETags.js
  7. +61 −0 html-template/index.template.html
  8. +42 −0 src/YAPFriendPicker.mxml
  9. BIN src/assets/add-icon.png
  10. +79 −0 src/assets/css/FriendPicker.css
  11. BIN src/assets/remove-icon.png
  12. +7 −0 src/com/adobe/CVS/Entries
  13. +1 −0 src/com/adobe/CVS/Repository
  14. +1 −0 src/com/adobe/CVS/Root
  15. +3 −0 src/com/adobe/as3Validators/CVS/Entries
  16. +1 −0 src/com/adobe/as3Validators/CVS/Repository
  17. +1 −0 src/com/adobe/as3Validators/CVS/Root
  18. +880 −0 src/com/adobe/as3Validators/as3DataValidation.as
  19. +50 −0 src/com/adobe/as3Validators/as3ValidationResult.as
  20. +5 −0 src/com/adobe/serialization/.svn/all-wcprops
  21. +31 −0 src/com/adobe/serialization/.svn/entries
  22. +1 −0 src/com/adobe/serialization/.svn/format
  23. +1 −0 src/com/adobe/serialization/CVS/Entries
  24. +1 −0 src/com/adobe/serialization/CVS/Repository
  25. +1 −0 src/com/adobe/serialization/CVS/Root
  26. +47 −0 src/com/adobe/serialization/json/.svn/all-wcprops
  27. +112 −0 src/com/adobe/serialization/json/.svn/entries
  28. +1 −0 src/com/adobe/serialization/json/.svn/format
  29. +86 −0 src/com/adobe/serialization/json/.svn/text-base/JSON.as.svn-base
  30. +327 −0 src/com/adobe/serialization/json/.svn/text-base/JSONDecoder.as.svn-base
  31. +299 −0 src/com/adobe/serialization/json/.svn/text-base/JSONEncoder.as.svn-base
  32. +87 −0 src/com/adobe/serialization/json/.svn/text-base/JSONParseError.as.svn-base
  33. +104 −0 src/com/adobe/serialization/json/.svn/text-base/JSONToken.as.svn-base
  34. +69 −0 src/com/adobe/serialization/json/.svn/text-base/JSONTokenType.as.svn-base
  35. +652 −0 src/com/adobe/serialization/json/.svn/text-base/JSONTokenizer.as.svn-base
  36. +7 −0 src/com/adobe/serialization/json/CVS/Entries
  37. +1 −0 src/com/adobe/serialization/json/CVS/Repository
  38. +1 −0 src/com/adobe/serialization/json/CVS/Root
  39. +86 −0 src/com/adobe/serialization/json/JSON.as
  40. +327 −0 src/com/adobe/serialization/json/JSONDecoder.as
  41. +299 −0 src/com/adobe/serialization/json/JSONEncoder.as
  42. +87 −0 src/com/adobe/serialization/json/JSONParseError.as
  43. +104 −0 src/com/adobe/serialization/json/JSONToken.as
  44. +69 −0 src/com/adobe/serialization/json/JSONTokenType.as
  45. +652 −0 src/com/adobe/serialization/json/JSONTokenizer.as
  46. +19 −0 src/com/yahoo/astra/CVS/Entries
  47. +1 −0 src/com/yahoo/astra/CVS/Repository
  48. +1 −0 src/com/yahoo/astra/CVS/Root
  49. +552 −0 src/com/yahoo/astra/animation/Animation.as
  50. +148 −0 src/com/yahoo/astra/animation/AnimationEvent.as
  51. +2 −0 src/com/yahoo/astra/animation/CVS/Entries
  52. +1 −0 src/com/yahoo/astra/animation/CVS/Repository
  53. +1 −0 src/com/yahoo/astra/animation/CVS/Root
  54. +4 −0 src/com/yahoo/astra/badgekit/CVS/Entries
  55. +1 −0 src/com/yahoo/astra/badgekit/CVS/Repository
  56. +1 −0 src/com/yahoo/astra/badgekit/CVS/Root
  57. +66 −0 src/com/yahoo/astra/badgekit/controls/Button.as
  58. +6 −0 src/com/yahoo/astra/badgekit/controls/CVS/Entries
  59. +1 −0 src/com/yahoo/astra/badgekit/controls/CVS/Repository
  60. +1 −0 src/com/yahoo/astra/badgekit/controls/CVS/Root
  61. +24 −0 src/com/yahoo/astra/badgekit/controls/Image.as
  62. +46 −0 src/com/yahoo/astra/badgekit/controls/ImageTileList.as
  63. +68 −0 src/com/yahoo/astra/badgekit/controls/Label.as
  64. +67 −0 src/com/yahoo/astra/badgekit/controls/TextInput.as
  65. +2 −0 src/com/yahoo/astra/badgekit/controls/listClasses/CVS/Entries
  66. +1 −0 src/com/yahoo/astra/badgekit/controls/listClasses/CVS/Repository
  67. +1 −0 src/com/yahoo/astra/badgekit/controls/listClasses/CVS/Root
  68. +90 −0 src/com/yahoo/astra/badgekit/controls/listClasses/ImageCellRenderer.as
  69. +193 −0 src/com/yahoo/astra/badgekit/controls/listClasses/MultilineImageCellRenderer.as
  70. +300 −0 src/com/yahoo/astra/badgekit/managers/BindingManager.as
  71. +6 −0 src/com/yahoo/astra/badgekit/managers/CVS/Entries
  72. +1 −0 src/com/yahoo/astra/badgekit/managers/CVS/Repository
  73. +1 −0 src/com/yahoo/astra/badgekit/managers/CVS/Root
  74. +186 −0 src/com/yahoo/astra/badgekit/managers/ConfigurationManager.as
  75. +355 −0 src/com/yahoo/astra/badgekit/managers/ElementManager.as
  76. +205 −0 src/com/yahoo/astra/badgekit/managers/ResourceManager.as
  77. +235 −0 src/com/yahoo/astra/badgekit/managers/ServiceManager.as
  78. +152 −0 src/com/yahoo/astra/badgekit/managers/TweenManager.as
  79. +1 −0 src/com/yahoo/astra/badgekit/styles/CVS/Entries
  80. +1 −0 src/com/yahoo/astra/badgekit/styles/CVS/Repository
  81. +1 −0 src/com/yahoo/astra/badgekit/styles/CVS/Root
  82. +1 −0 src/com/yahoo/astra/badgekit/styles/metadata/CVS/Entries
  83. +1 −0 src/com/yahoo/astra/badgekit/styles/metadata/CVS/Repository
  84. +1 −0 src/com/yahoo/astra/badgekit/styles/metadata/CVS/Root
  85. +38 −0 src/com/yahoo/astra/badgekit/styles/metadata/TextStyles.as
  86. +1 −0 src/com/yahoo/astra/badgekit/webapis/CVS/Entries
  87. +1 −0 src/com/yahoo/astra/badgekit/webapis/CVS/Repository
  88. +1 −0 src/com/yahoo/astra/badgekit/webapis/CVS/Root
  89. +103 −0 src/com/yahoo/astra/badgekit/webapis/URLService.as
  90. +1 −0 src/com/yahoo/astra/containers/CVS/Entries
  91. +1 −0 src/com/yahoo/astra/containers/CVS/Repository
  92. +1 −0 src/com/yahoo/astra/containers/CVS/Root
  93. +8 −0 src/com/yahoo/astra/containers/formClasses/CVS/Entries
  94. +1 −0 src/com/yahoo/astra/containers/formClasses/CVS/Repository
  95. +1 −0 src/com/yahoo/astra/containers/formClasses/CVS/Root
  96. +82 −0 src/com/yahoo/astra/containers/formClasses/FormEventObserver.as
  97. +765 −0 src/com/yahoo/astra/containers/formClasses/FormItem.as
  98. +437 −0 src/com/yahoo/astra/containers/formClasses/FormItemContainer.as
  99. +207 −0 src/com/yahoo/astra/containers/formClasses/FormItemLabel.as
  100. +231 −0 src/com/yahoo/astra/containers/formClasses/FormLayoutStyle.as
  101. +27 −0 src/com/yahoo/astra/containers/formClasses/IForm.as
  102. +40 −0 src/com/yahoo/astra/containers/formClasses/IFormEventObserver.as
  103. +161 −0 src/com/yahoo/astra/containers/formClasses/RequiredIndicator.as
  104. +102 −0 src/com/yahoo/astra/customizer/BackgroundSprite.as
  105. +9 −0 src/com/yahoo/astra/customizer/CVS/Entries
  106. +1 −0 src/com/yahoo/astra/customizer/CVS/Repository
  107. +1 −0 src/com/yahoo/astra/customizer/CVS/Root
  108. +44 −0 src/com/yahoo/astra/customizer/ControlType.as
  109. +416 −0 src/com/yahoo/astra/customizer/Customizer.as
  110. +50 −0 src/com/yahoo/astra/customizer/CustomizerTypes.as
  111. +175 −0 src/com/yahoo/astra/customizer/EmbedGenerator.as
  112. +300 −0 src/com/yahoo/astra/customizer/GradientBackground.as
  113. +228 −0 src/com/yahoo/astra/customizer/StageResizer.as
  114. +2 −0 src/com/yahoo/astra/customizer/events/CVS/Entries
  115. +1 −0 src/com/yahoo/astra/customizer/events/CVS/Repository
  116. +1 −0 src/com/yahoo/astra/customizer/events/CVS/Root
  117. +196 −0 src/com/yahoo/astra/customizer/events/CustomizerEvent.as
  118. +25 −0 src/com/yahoo/astra/customizer/events/PropertyEditorEvent.as
  119. +1 −0 src/com/yahoo/astra/customizer/net/CVS/Entries
  120. +1 −0 src/com/yahoo/astra/customizer/net/CVS/Repository
  121. +1 −0 src/com/yahoo/astra/customizer/net/CVS/Root
  122. +279 −0 src/com/yahoo/astra/customizer/net/LocalConnectionDispatcher.as
  123. +252 −0 src/com/yahoo/astra/display/BitmapText.as
  124. +1 −0 src/com/yahoo/astra/display/CVS/Entries
  125. +1 −0 src/com/yahoo/astra/display/CVS/Repository
  126. +1 −0 src/com/yahoo/astra/display/CVS/Root
  127. +5 −0 src/com/yahoo/astra/editor/CVS/Entries
  128. +1 −0 src/com/yahoo/astra/editor/CVS/Repository
  129. +1 −0 src/com/yahoo/astra/editor/CVS/Root
  130. +26 −0 src/com/yahoo/astra/editor/IElementDataEditor.as
  131. +53 −0 src/com/yahoo/astra/editor/IGraphicalEditor.as
  132. +4 −0 src/com/yahoo/astra/editor/data/CVS/Entries
  133. +1 −0 src/com/yahoo/astra/editor/data/CVS/Repository
  134. +1 −0 src/com/yahoo/astra/editor/data/CVS/Root
  135. +63 −0 src/com/yahoo/astra/editor/data/IEditableElementData.as
  136. +87 −0 src/com/yahoo/astra/editor/data/IElementData.as
  137. +59 −0 src/com/yahoo/astra/editor/data/IGraphicalEditorData.as
  138. +42 −0 src/com/yahoo/astra/editor/data/IStylableElementData.as
  139. +2 −0 src/com/yahoo/astra/editor/events/CVS/Entries
  140. +1 −0 src/com/yahoo/astra/editor/events/CVS/Repository
  141. +1 −0 src/com/yahoo/astra/editor/events/CVS/Root
  142. +21 −0 src/com/yahoo/astra/editor/events/ElementDataEvent.as
  143. +44 −0 src/com/yahoo/astra/editor/events/GraphicalEditorEvent.as
  144. +3 −0 src/com/yahoo/astra/editor/traits/CVS/Entries
  145. +1 −0 src/com/yahoo/astra/editor/traits/CVS/Repository
  146. +1 −0 src/com/yahoo/astra/editor/traits/CVS/Root
  147. +19 −0 src/com/yahoo/astra/editor/traits/ITrait.as
  148. +54 −0 src/com/yahoo/astra/editor/traits/PositionLimits.as
  149. +66 −0 src/com/yahoo/astra/editor/traits/SizeLimits.as
  150. +2 −0 src/com/yahoo/astra/events/CVS/Entries
  151. +1 −0 src/com/yahoo/astra/events/CVS/Repository
  152. +1 −0 src/com/yahoo/astra/events/CVS/Root
  153. +102 −0 src/com/yahoo/astra/events/FormDataManagerEvent.as
  154. +129 −0 src/com/yahoo/astra/events/FormLayoutEvent.as
  155. +11 −0 src/com/yahoo/astra/fl/.project
  156. +10 −0 src/com/yahoo/astra/fl/CVS/Entries
  157. +1 −0 src/com/yahoo/astra/fl/CVS/Repository
  158. +1 −0 src/com/yahoo/astra/fl/CVS/Root
  159. +8 −0 src/com/yahoo/astra/fl/accessibility/CVS/Entries
  160. +1 −0 src/com/yahoo/astra/fl/accessibility/CVS/Repository
  161. +1 −0 src/com/yahoo/astra/fl/accessibility/CVS/Root
  162. +272 −0 src/com/yahoo/astra/fl/accessibility/CarouselAccImpl.as
  163. +28 −0 src/com/yahoo/astra/fl/accessibility/EventTypes.as
  164. +15 −0 src/com/yahoo/astra/fl/accessibility/FocusAndSelectionFlags.as
  165. +506 −0 src/com/yahoo/astra/fl/accessibility/MenuAccImpl.as
  166. +70 −0 src/com/yahoo/astra/fl/accessibility/ObjectRoles.as
  167. +40 −0 src/com/yahoo/astra/fl/accessibility/ObjectStates.as
  168. +345 −0 src/com/yahoo/astra/fl/accessibility/TabBarAccImpl.as
  169. +589 −0 src/com/yahoo/astra/fl/accessibility/TreeAccImpl.as
  170. +84 −0 src/com/yahoo/astra/fl/charts/BarChart.as
  171. +18 −0 src/com/yahoo/astra/fl/charts/CVS/Entries
  172. +1 −0 src/com/yahoo/astra/fl/charts/CVS/Repository
  173. +1 −0 src/com/yahoo/astra/fl/charts/CVS/Root
  174. +1,916 −0 src/com/yahoo/astra/fl/charts/CartesianChart.as
  175. +832 −0 src/com/yahoo/astra/fl/charts/Chart.as
  176. +48 −0 src/com/yahoo/astra/fl/charts/ChartUtil.as
  177. +27 −0 src/com/yahoo/astra/fl/charts/ColumnChart.as
  178. +216 −0 src/com/yahoo/astra/fl/charts/DataTipRenderer.as
  179. +26 −0 src/com/yahoo/astra/fl/charts/ICategoryChart.as
  180. +76 −0 src/com/yahoo/astra/fl/charts/IChart.as
  181. +43 −0 src/com/yahoo/astra/fl/charts/IDataTipRenderer.as
  182. +104 −0 src/com/yahoo/astra/fl/charts/LineChart.as
  183. +368 −0 src/com/yahoo/astra/fl/charts/PieChart.as
  184. +28 −0 src/com/yahoo/astra/fl/charts/StackedBarChart.as
  185. +27 −0 src/com/yahoo/astra/fl/charts/StackedColumnChart.as
  186. +47 −0 src/com/yahoo/astra/fl/charts/axes/AxisData.as
  187. +27 −0 src/com/yahoo/astra/fl/charts/axes/AxisOrientation.as
  188. +241 −0 src/com/yahoo/astra/fl/charts/axes/BaseAxis.as
  189. +19 −0 src/com/yahoo/astra/fl/charts/axes/CVS/Entries
  190. +1 −0 src/com/yahoo/astra/fl/charts/axes/CVS/Repository
  191. +1 −0 src/com/yahoo/astra/fl/charts/axes/CVS/Root
  192. +307 −0 src/com/yahoo/astra/fl/charts/axes/CategoryAxis.as
Sorry, we could not display the entire diff because too many files (1,213) changed.
16 .actionScriptProperties
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<actionScriptProperties mainApplicationPath="YAPFriendPicker.mxml" version="6">
+ <compiler additionalCompilerArguments="-locale en_US -default-background-color=#FFFFFF" autoRSLOrdering="false" copyDependentFiles="true" fteInMXComponents="false" generateAccessible="false" htmlExpressInstall="false" htmlGenerate="true" htmlHistoryManagement="false" htmlPlayerVersionCheck="false" includeNetmonSwc="false" outputFolderPath="bin-debug" sourceFolderPath="src" strict="true" targetPlayerVersion="0.0.0" useApolloConfig="false" useDebugRSLSwfs="true" verifyDigests="true" warn="true">
+ <compilerSourcePath/>
+ <libraryPath defaultLinkType="1">
+ <libraryPathEntry kind="4" path=""/>
+ <libraryPathEntry kind="1" linkType="1" path="libs"/>
+ </libraryPath>
+ <sourceAttachmentPath/>
+ </compiler>
+ <applications>
+ <application path="YAPFriendPicker.mxml"/>
+ </applications>
+ <modules/>
+ <buildCSSFiles/>
+</actionScriptProperties>
2 .flexProperties
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<flexProperties enableServiceManager="false" flexServerFeatures="0" flexServerType="0" toolCompile="true" useServerFlexSDK="false" version="1"/>
18 .project
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>YAPFriendPicker</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>
3 .settings/com.adobe.flexbuilder.project.prefs
@@ -0,0 +1,3 @@
+#Thu Jun 10 14:44:40 PDT 2010
+eclipse.preferences.version=1
+upgradeSDK/fb4=Flex 3.5
3 .settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,3 @@
+#Fri May 28 01:47:27 PDT 2010
+eclipse.preferences.version=1
+encoding/<project>=utf-8
292 html-template/AC_OETags.js
@@ -0,0 +1,292 @@
+// Flash Player Version Detection - Rev 1.6
+// Detect Client Browser type
+// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
+var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
+var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
+var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
+
+function ControlVersion()
+{
+ var version;
+ var axo;
+ var e;
+
+ // NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
+
+ try {
+ // version will be set for 7.X or greater players
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 6.X players only
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
+
+ // installed player is some revision of 6.0
+ // GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
+ // so we have to be careful.
+
+ // default to the first public version
+ version = "WIN 6,0,21,0";
+
+ // throws if AllowScripAccess does not exist (introduced in 6.0r47)
+ axo.AllowScriptAccess = "always";
+
+ // safe to call for 6.0r47 or greater
+ version = axo.GetVariable("$version");
+
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 4.X or 5.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 3.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = "WIN 3,0,18,0";
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 2.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
+ version = "WIN 2,0,0,11";
+ } catch (e) {
+ version = -1;
+ }
+ }
+
+ return version;
+}
+
+// JavaScript helper required to detect Flash Player PlugIn version information
+function GetSwfVer(){
+ // NS/Opera version >= 3 check for Flash plugin in plugin array
+ var flashVer = -1;
+
+ if (navigator.plugins != null && navigator.plugins.length > 0) {
+ if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
+ var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
+ var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
+ var descArray = flashDescription.split(" ");
+ var tempArrayMajor = descArray[2].split(".");
+ var versionMajor = tempArrayMajor[0];
+ var versionMinor = tempArrayMajor[1];
+ var versionRevision = descArray[3];
+ if (versionRevision == "") {
+ versionRevision = descArray[4];
+ }
+ if (versionRevision[0] == "d") {
+ versionRevision = versionRevision.substring(1);
+ } else if (versionRevision[0] == "r") {
+ versionRevision = versionRevision.substring(1);
+ if (versionRevision.indexOf("d") > 0) {
+ versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
+ }
+ } else if (versionRevision[0] == "b") {
+ versionRevision = versionRevision.substring(1);
+ }
+ var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
+ }
+ }
+ // MSN/WebTV 2.6 supports Flash 4
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
+ // WebTV 2.5 supports Flash 3
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
+ // older WebTV supports Flash 2
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
+ else if ( isIE && isWin && !isOpera ) {
+ flashVer = ControlVersion();
+ }
+ return flashVer;
+}
+
+// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
+function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
+{
+ versionStr = GetSwfVer();
+ if (versionStr == -1 ) {
+ return false;
+ } else if (versionStr != 0) {
+ if(isIE && isWin && !isOpera) {
+ // Given "WIN 2,0,0,11"
+ tempArray = versionStr.split(" "); // ["WIN", "2,0,0,11"]
+ tempString = tempArray[1]; // "2,0,0,11"
+ versionArray = tempString.split(","); // ['2', '0', '0', '11']
+ } else {
+ versionArray = versionStr.split(".");
+ }
+ var versionMajor = versionArray[0];
+ var versionMinor = versionArray[1];
+ var versionRevision = versionArray[2];
+
+ // is the major.revision >= requested major.revision AND the minor version >= requested minor
+ if (versionMajor > parseFloat(reqMajorVer)) {
+ return true;
+ } else if (versionMajor == parseFloat(reqMajorVer)) {
+ if (versionMinor > parseFloat(reqMinorVer))
+ return true;
+ else if (versionMinor == parseFloat(reqMinorVer)) {
+ if (versionRevision >= parseFloat(reqRevision))
+ return true;
+ }
+ }
+ return false;
+ }
+}
+
+function AC_AddExtension(src, ext)
+{
+ var qIndex = src.indexOf('?');
+ if ( qIndex != -1)
+ {
+ // Add the extention (if needed) before the query params
+ var path = src.substring(0, qIndex);
+ if (path.length >= ext.length && path.lastIndexOf(ext) == (path.length - ext.length))
+ return src;
+ else
+ return src.replace(/\?/, ext+'?');
+ }
+ else
+ {
+ // Add the extension (if needed) to the end of the URL
+ if (src.length >= ext.length && src.lastIndexOf(ext) == (src.length - ext.length))
+ return src; // Already have extension
+ else
+ return src + ext;
+ }
+}
+
+function AC_Generateobj(objAttrs, params, embedAttrs)
+{
+ var str = '';
+ if (isIE && isWin && !isOpera)
+ {
+ str += '<object ';
+ for (var i in objAttrs)
+ str += i + '="' + objAttrs[i] + '" ';
+ str += '>';
+ for (var i in params)
+ str += '<param name="' + i + '" value="' + params[i] + '" /> ';
+ str += '</object>';
+ } else {
+ str += '<embed ';
+ for (var i in embedAttrs)
+ str += i + '="' + embedAttrs[i] + '" ';
+ str += '> </embed>';
+ }
+
+ document.write(str);
+}
+
+function AC_FL_RunContent(){
+ var ret =
+ AC_GetArgs
+ ( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
+ , "application/x-shockwave-flash"
+ );
+ AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
+}
+
+function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
+ var ret = new Object();
+ ret.embedAttrs = new Object();
+ ret.params = new Object();
+ ret.objAttrs = new Object();
+ for (var i=0; i < args.length; i=i+2){
+ var currArg = args[i].toLowerCase();
+
+ switch (currArg){
+ case "classid":
+ break;
+ case "pluginspage":
+ ret.embedAttrs[args[i]] = args[i+1];
+ break;
+ case "src":
+ case "movie":
+ args[i+1] = AC_AddExtension(args[i+1], ext);
+ ret.embedAttrs["src"] = args[i+1];
+ ret.params[srcParamName] = args[i+1];
+ break;
+ case "onafterupdate":
+ case "onbeforeupdate":
+ case "onblur":
+ case "oncellchange":
+ case "onclick":
+ case "ondblClick":
+ case "ondrag":
+ case "ondragend":
+ case "ondragenter":
+ case "ondragleave":
+ case "ondragover":
+ case "ondrop":
+ case "onfinish":
+ case "onfocus":
+ case "onhelp":
+ case "onmousedown":
+ case "onmouseup":
+ case "onmouseover":
+ case "onmousemove":
+ case "onmouseout":
+ case "onkeypress":
+ case "onkeydown":
+ case "onkeyup":
+ case "onload":
+ case "onlosecapture":
+ case "onpropertychange":
+ case "onreadystatechange":
+ case "onrowsdelete":
+ case "onrowenter":
+ case "onrowexit":
+ case "onrowsinserted":
+ case "onstart":
+ case "onscroll":
+ case "onbeforeeditfocus":
+ case "onactivate":
+ case "onbeforedeactivate":
+ case "ondeactivate":
+ case "type":
+ case "codebase":
+ ret.objAttrs[args[i]] = args[i+1];
+ break;
+ case "id":
+ case "width":
+ case "height":
+ case "align":
+ case "vspace":
+ case "hspace":
+ case "class":
+ case "title":
+ case "accesskey":
+ case "name":
+ case "tabindex":
+ ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
+ break;
+ default:
+ ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
+ }
+ }
+ ret.objAttrs["classid"] = classid;
+ if (mimeType) ret.embedAttrs["type"] = mimeType;
+ return ret;
+}
+
+
61 html-template/index.template.html
@@ -0,0 +1,61 @@
+<!-- saved from url=(0014)about:internet -->
+<html lang="en">
+
+<!--
+Smart developers always View Source.
+
+This application was built using Adobe Flex, an open source framework
+for building rich Internet applications that get delivered via the
+Flash Player or to desktops via Adobe AIR.
+
+Learn more about Flex at http://flex.org
+// -->
+
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>${title}</title>
+<script src="AC_OETags.js" language="javascript"></script>
+<style>
+body { margin: 0px; overflow:hidden }
+</style>
+</head>
+
+<body scroll='no'>
+<script language="JavaScript" type="text/javascript">
+<!--
+ AC_FL_RunContent(
+ "src", "${swf}",
+ "width", "${width}",
+ "height", "${height}",
+ "align", "middle",
+ "id", "${application}",
+ "quality", "high",
+ "bgcolor", "${bgcolor}",
+ "name", "${application}",
+ "allowScriptAccess","sameDomain",
+ "type", "application/x-shockwave-flash",
+ "pluginspage", "http://www.adobe.com/go/getflashplayer"
+ );
+// -->
+</script>
+<noscript>
+ <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
+ id="${application}" width="${width}" height="${height}"
+ codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
+ <param name="movie" value="${swf}.swf" />
+ <param name="quality" value="high" />
+ <param name="bgcolor" value="${bgcolor}" />
+ <param name="allowScriptAccess" value="sameDomain" />
+ <embed src="${swf}.swf" quality="high" bgcolor="${bgcolor}"
+ width="${width}" height="${height}" name="${application}" align="middle"
+ play="true"
+ loop="false"
+ quality="high"
+ allowScriptAccess="sameDomain"
+ type="application/x-shockwave-flash"
+ pluginspage="http://www.adobe.com/go/getflashplayer">
+ </embed>
+ </object>
+</noscript>
+</body>
+</html>
42 src/YAPFriendPicker.mxml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:friendpicker="com.yahoo.friendpicker.*" layout="absolute" initialize="handleInitialize(event)" styleName="fpApplication" backgroundGradientAlphas="[1.0, 1.0]" backgroundGradientColors="[#FFFFFF, #FFFFFF]">
+ <friendpicker:FriendPicker id="friendPicker" width="100%" height="100%" backgroundColor="#FFFFFF"/>
+
+ <mx:Script>
+ <![CDATA[
+ import com.yahoo.oauth.OAuthConsumer;
+ import com.yahoo.social.YahooAccessToken;
+ import com.yahoo.social.YahooApplication;
+
+ import mx.events.FlexEvent;
+
+ private static const CONSUMER_KEY:String = "dj0yJmk9VXdoeWphbGlzeXhxJmQ9WVdrOVJrMHlWVXhUTlRBbWNHbzlNVEU1TWpBME16TTBOQS0tJnM9Y29uc3VtZXJzZWNyZXQmeD0yZQ--";
+ private static const CONSUMER_SECRET:String = "80c2c1eca000c9b43b43647799ffea84c83b8ced";
+
+ private function handleInitialize(event:FlexEvent):void
+ {
+ var flashvars:Object = Application.application.parameters;
+ flashvars.cancelURL = 'http://www.yahoo.com/';
+ var consumer:OAuthConsumer = new OAuthConsumer();
+ consumer.key = CONSUMER_KEY;
+ consumer.secret = CONSUMER_SECRET;
+
+ var token:YahooAccessToken = new YahooAccessToken();
+ token.key = flashvars.yap_viewer_access_token || 'A=55w7qYb4jyNh5YMScma9FlIIsy78MUDlU8nXNfVEr1P.haSg5_PyzPjhKpM2s_9Q6r1DrED7EmZwAuseR4L1J07umqi3E1pwNjaGUVIRxxlNCDUHjNxB.rQ6Er56JmN2XNDTeQTU6wbSLhNeka8glR5VACFydHfUT2CRcOwU7xRSbypNWSbLwqJYFHAUkpMUx1DlJ6YoPvkydvQG4.ny0gmiL5Nnzx8v7yLb7zmoEkAiuegZIpWoe4SX5UVnrSy45GU5qTn2bmRdA6M1ZGnXzRI6U9VZYdGVj0laIqnjL.IfYt0UWNdC3s11sCBzdOGeh.TqlsU_3qWhZYKkpYeC.qCE0ADdNY7UWfEwXozhgY6IZlnsMaTijDT.hnAr0dHAeGrri5zW03qPUOz9_.Ug85Ru7WFXHypv6HPOJtWaRWOIxe1NBfxMEDda5IZlnO3V0WfkRNBtiJ0eZag0532I1aW7OCe5zJKGxJYreFMCiNScrK.C8.X7EXkJAZrB2VZbSAPA92Bbi0_FbQ3KBDuBDtrKuWbANdQ3QLO8Wey8gH3wju9Ad_1smKy.N.jjgvymhrVZ9gg3CM8pjGQisrdf6qG_tVPrSc14QcXl70GJ1BrDU1Eyay3Mecp.gGdQVS4fB1K441NZUnMCIKfbsHvBtibG4az54lkvMhUOfoqGvnaQ.mZZJacYta6JLubUvWBbULByrKRQNPrfkSvWZTOwP2Jk78nFAvaHLEj3YeeOa.fQju0N9w5eUro6C3yfNqQg8A--';
+ token.secret = flashvars.yap_viewer_access_token_secret || 'e5978886f4e9e07d313b796c22079efd090201e8';
+ token.yahoo_guid = flashvars.yap_viewer_guid || 'JTN7YJFGW3J4IF53MDOD5RF7YU';
+
+ try {
+ friendPicker.setup({
+ application: new YahooApplication(consumer.key, consumer.secret, flashvars.yap_appid, token),
+ type: flashvars.type,
+ subject: flashvars.subject,
+ body: flashvars.body,
+ cancelURL: flashvars.cancelURL
+ });
+ } catch(e:Error) {}
+
+ }
+ ]]>
+ </mx:Script>
+</mx:Application>
BIN src/assets/add-icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
79 src/assets/css/FriendPicker.css
@@ -0,0 +1,79 @@
+/* CSS file */
+
+.fpApplication {
+ backgroundColor:#FFFFFF;
+}
+
+.fpcontainer {
+ backgroundColor:#FFFFFF;
+ borderColor:#B0BBC6;
+ borderStyle:solid;
+ borderThickness:10px;
+ cornerRadius:10px;
+}
+
+.fpinput {
+ borderStyle:none;
+ borderThickness:1px;
+ borderColor:#EAEAEA;
+ backgroundColor:#FBFBFB;
+}
+
+.fpselector {
+ fontWeight:normal;
+ fontFamily:'Arial';
+ fontSize:16px;
+ themeColor:#FFB035;
+ color:#545454;
+ borderColor:#b4b5b5;
+ borderStyle:solid;
+ paddingBottom:2px;
+ paddingLeft:2px;
+ paddingRight:2px;
+ paddingTop:2px;
+ verticalCenter: 0px;
+ left: 15px;
+ right:15px;
+}
+
+.fpsearch {
+ backgroundColor:#DBE0E5;
+}
+
+.fpsearchLabel {
+ fontFamily:'Arial';
+ fontSize:14;
+ color:#777788;
+}
+
+.fpcategoryBox {
+ cornerRadius:0px;
+ borderColor:#B4B5B5;
+ right:30px;
+ verticalCenter:0px;
+}
+
+.fplist {
+ borderStyle:none;
+}
+
+.fptilelist {
+ borderStyle:none;
+ themeColor:#FFFFFF;
+}
+
+.fperror {
+ color:#1D1D1D;
+}
+
+.fpcontinue {
+ cornerRadius:0px;
+ color:#111111;
+ fontWeight:bold;
+ verticalCenter:0px;
+ right:10px;
+}
+
+.fplink {
+ color:#6D6D6D;
+}
BIN src/assets/remove-icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 src/com/adobe/CVS/Entries
@@ -0,0 +1,7 @@
+D/as3Validators////
+D/crypto////
+D/errors////
+D/images////
+D/net////
+D/serialization////
+D/utils////
1 src/com/adobe/CVS/Repository
@@ -0,0 +1 @@
+yahoo/presentation/flash/ActionScript 3/com/adobe
1 src/com/adobe/CVS/Root
@@ -0,0 +1 @@
+:extssh:zachg@vault.yahoo.com:/CVSROOT
3 src/com/adobe/as3Validators/CVS/Entries
@@ -0,0 +1,3 @@
+D/.svn////
+/as3DataValidation.as/1.1/Wed Feb 11 21:38:43 2009/-ko/
+/as3ValidationResult.as/1.1/Wed Feb 11 21:38:43 2009/-ko/
1 src/com/adobe/as3Validators/CVS/Repository
@@ -0,0 +1 @@
+yahoo/presentation/flash/ActionScript 3/com/adobe/as3Validators
1 src/com/adobe/as3Validators/CVS/Root
@@ -0,0 +1 @@
+:extssh:zachg@vault.yahoo.com:/CVSROOT
880 src/com/adobe/as3Validators/as3DataValidation.as
@@ -0,0 +1,880 @@
+/*
+Adobe Systems Incorporated(r) Source Code License Agreement
+Copyright(c) 2007 Adobe Systems Incorporated. All rights reserved.
+
+Please read this Source Code License Agreement carefully before using
+the source code.
+
+Adobe Systems Incorporated grants to you a perpetual, worldwide, non-exclusive,
+no-charge, royalty-free, irrevocable copyright license, to reproduce,
+prepare derivative works of, publicly display, publicly perform, and
+distribute this source code and such derivative works in source or
+object code form without any attribution requirements.
+
+The name "Adobe Systems Incorporated" must not be used to endorse or promote products
+derived from the source code without prior written permission.
+
+You agree to indemnify, hold harmless and defend Adobe Systems Incorporated from and
+against any loss, damage, claims or lawsuits, including attorney's
+fees that arise or result from your use or distribution of the source
+code.
+
+THIS SOURCE CODE IS PROVIDED "AS IS" AND "WITH ALL FAULTS", WITHOUT
+ANY TECHNICAL SUPPORT OR ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING,
+BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ALSO, THERE IS NO WARRANTY OF
+NON-INFRINGEMENT, TITLE OR QUIET ENJOYMENT. IN NO EVENT SHALL MACROMEDIA
+OR ITS SUPPLIERS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOURCE CODE, EVEN IF
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+package com.adobe.as3Validators{
+
+ public class as3DataValidation {
+
+ /**
+ * @private
+ */
+ private static var DECIMAL_DIGITS:String = "01234567890";
+
+ /**
+ * @private
+ */
+ private static var LC_ROMAN_LETTERS:String = "abcdefghijklmnopqrstuvwxyz";
+
+ /**
+ * Compare a string against a list of characters to determine if the string does not
+ * contain those characters. This comparison is not case-senstive and it does not
+ * validate that the characters are in a particular order.
+ *
+ * @param str The string that needs to be validated
+ * @param chars The list of valid characters for that string
+ * @return A Boolean true value if the data is valid
+ */
+ public function hasInValidChars(str:String, chars:String):Boolean {
+ for (var i:int = 0; i<str.length; i++) {
+ if (chars.indexOf(str.charAt(i))) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+
+ /**
+ * Compare a string against a list of characters to determine if the string contains
+ * only those characters. This comparison is not case-sensitive and does not validate
+ * the order of the characters.
+ *
+ * @param str The string that needs to be validated
+ * @param chars The list of valid characters for that string
+ * @return A Boolean true value if the data is valid
+ */
+ public function hasValidChars(str:String, chars:String):Boolean {
+ var str = str.toLowerCase();
+ if (str.length == 0) {
+ return false;
+ }
+
+ var chars = chars.toLowerCase();
+ var cArr = str.split("");
+ var len = cArr.length;
+
+ for (var i = 0; i<len; i++) {
+ var valid = (chars.indexOf(cArr[i]) != -1);
+ if (!valid) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+
+ /**
+ * Determine whether a string is a valid IP address
+ *
+ * @param ip The string containing the IP address
+ * @return An as3ValidationResult.result true value if the data is valid. If the data is invalid, then
+ * as3Validation.result is set to false and the errorStr provides a brief description.
+ */
+ public function isIP(ip:String):as3ValidationResult {
+ var vResult = new as3ValidationResult();
+
+ if (!this.hasValidChars(ip, DECIMAL_DIGITS+".")) {
+ vResult.errorStr = "The string contains invalid characters.";
+ return vResult;
+ }
+ //Does the IP contain four sections
+ var parts = ip.split(".");
+ if (parts.length != 4) {
+ vResult.errorStr = "Too many periods are in the string.";
+ return vResult;
+ }
+ //Make sure the first number is not zero
+ if (parseInt(parts[0]) == 0) {
+ vResult.errorStr = "The first value can not be zero.";
+ return vResult;
+ }
+ //Validate that each part exists and is in the correct range
+ for (var i = 0; i<parts.length; i++) {
+ if ((parts[i].length == 0) || (parseInt(parts[i])>255 || parseInt(parts[i])<0)) {
+ vResult.errorStr = "The value " + parts[i] + " is not a valid number.";
+ return vResult;
+ }
+ }
+ vResult.result = true;
+ return vResult;
+ }
+
+
+ /**
+ * Determine whether a string is a Windows file URL
+ *
+ * @param fileURL The string containing the IP address
+ * @return An as3ValidationResult.result true value if the data is valid. If the data is invalid, then
+ * as3Validation.result is set to false and the errorStr provides a brief description.
+ */
+ public function isFileURL(fileURL:String):as3ValidationResult {
+ var vResult = new as3ValidationResult();
+
+ //Does it start with file://
+ if (fileURL.indexOf("file://") != 0){
+ vResult.errorStr = "Does not begin with file://.";
+ return (vResult);
+ }
+
+ var lastSlash:int = fileURL.lastIndexOf("/");
+
+ //On windows systems paths can not be longer than 248 characters
+ if (lastSlash -7 >= 248) { return (vResult); }
+
+ //On Windows machines filenames can not be longer than 260 characters
+ if (fileURL.length - lastSlash >= 260) {
+ vResult.errorStr = "The filename is too long for Windows systems.";
+ return (vResult);
+ }
+
+ //Just in case the slash is encoded or something
+ if (fileURL.length >= 260 + 248 + 7) {
+ vResult.errorStr = "The string is too long for Windows systems.";
+ return (vResult);
+ }
+
+ vResult.result = true;
+ return (vResult);
+ }
+
+
+ /**
+ * This is an example of how to do the isHttpURL and isHttpsURL checks using a RegEx instead
+ * using string functions.
+ * It assumes the domain is sent in the call and that the URL contains at least one "/" after the domain.
+ *
+ * @param str The string containing the http(s) URL
+ * @param domain The string containing expected domain for the URL
+ * @return An as3ValidationResult.result true value if the url is an http or https protocol URL for the
+ * given domain.
+ */
+ /*
+ function checkHttpProtocol (str:String, domain:String):as3ValidationResult {
+ var vResult = new as3ValidationResult();
+
+ // Build the RegEx
+ // This RegEx assumes that there is at least one "/" after the
+ // domain. http://www.mysite.com will not match.
+ var pattern:RegExp = new RegExp("^http[s]?\:\\/\\/([^\\/]+)\\/");
+ var result:Object = pattern.exec(flashVarURL);
+
+ if (result == null || result[1] != domain || flashVarURL.length >= 4096) {
+ vResult.errorStr = "The URL is invalid";
+ return (vResult);
+ }
+
+ vResult.result = true;
+ return (vResult);
+ }
+ */
+
+
+ /**
+ * Performs basic checks to determine if a string is a valid HTTPS URL
+ *
+ * @param str The string containing the HTTPS URL
+ * @param domain The expected domain for the URL (optional)
+ * @return An as3ValidationResult.result true value if the data is valid. If the data is invalid, then
+ * as3Validation.result is set to false and the errorStr provides a brief description.
+ */
+ public function isHttpsURL(str:String, domain:String = ""):as3ValidationResult {
+ return this.isHttpURL(str,domain,true);
+ }
+
+
+ /**
+ * Performs basic checks to determine if a string is a valid HTTP or HTTPS URL
+ *
+ * @param str The string containing the URL
+ * @param domain The expected domain for the URL (optional)
+ * @param isSSL A boolean value that is set to true for HTTPS URLs (optional)
+ * @return An as3ValidationResult.result true value if the data is valid. If the data is invalid, then
+ * as3Validation.result is set to false and the errorStr provides a brief description.
+ */
+ public function isHttpURL(str:String, domain:String = "", isSSL:Boolean = false):as3ValidationResult {
+ var vResult = new as3ValidationResult();
+ var str = str.toLowerCase();
+
+ //Assuming domain contains at least 4 characters (a.eu)
+ if (str.length<9 || str.length>4096) {
+ vResult.errorStr = "The string is an invalid length.";
+ return vResult;
+ }
+
+ var startIndex:int;
+ var startLen:int;
+ if (isSSL) {
+ startIndex = str.indexOf("https://");
+ startLen = 8;
+ } else {
+ startIndex = str.indexOf("http://");
+ startLen = 7;
+ }
+
+ if (startIndex != 0) {
+ vResult.errorStr = "The URL contains an invalid protocol."
+ return vResult;
+ }
+
+ if (!this.hasValidChars(str, DECIMAL_DIGITS+LC_ROMAN_LETTERS+"-_.:/?&%#=+~")) {
+ vResult.errorStr = "The URL contains invalid characters.";
+ return vResult;
+ }
+ var tempDomain:String;
+ if (str.indexOf("/", startLen+1)>0) {
+ tempDomain = str.substr(startLen, str.indexOf("/", startLen+1)-startLen);
+ } else {
+ tempDomain = str.substring(startLen, str.length);
+ }
+ //Does the domain name appear to be valid
+ if (!this.hasValidChars(tempDomain, DECIMAL_DIGITS+LC_ROMAN_LETTERS+"-.")) {
+ vResult.errorStr = "The URL contans an invalid domain name.";
+ return vResult;
+ }
+ //Domain matches SWF domain
+ if (domain.length>0 && domain != tempDomain) {
+ vResult.errorStr = "URLs that are not part of " + domain + " are not permitted.";
+ return vResult;
+ }
+ //Confirm that it has only one ?
+ if ((str.indexOf("?")>startLen+1) && (str.indexOf("?") != str.lastIndexOf("?"))) {
+ vResult.errorStr = "The URL can contain only one \"?\" seperator.";
+ return vResult;
+ }
+ vResult.result = true;
+ return vResult;
+ }
+
+
+ /**
+ * Determines whether a string is an email address.
+ * Checks for common email address formats but it does not support the full RFC definition
+ *
+ * @param str The string containing the email address
+ * @return An as3ValidationResult.result true value if the data is valid. If the data is invalid, then
+ * as3Validation.result is set to false and the errorStr provides a brief description.
+ */
+ public function isEmail(str:String):as3ValidationResult {
+ var vResult = new as3ValidationResult();
+ str = str.toLowerCase();
+
+ //var invalidChars:String = "()<>,;:\\\"[] `~!#$%^&*+={}|/?'";
+
+ //Should this include underscore?
+ if (!this.hasValidChars(str, DECIMAL_DIGITS+LC_ROMAN_LETTERS+"-_.@")) {
+ vResult.errorStr = "The email address contains invalid characters.";
+ return vResult;
+ }
+ var parts:Array = str.split("@");
+
+ //Validate there is only one @ in the URL
+ if (parts.length != 2) {
+ vResult.errorStr = "The email address can contain only one \"@\" character.";
+ return vResult;
+
+ }
+ //Check to make sure the username looks approximately correct
+ var username:String = parts[0];
+ if (username.length == 0) {
+ vResult.errorStr = "The username can not be blank.";
+ return vResult;
+ }
+ //Check to make sure it ends in a valid extension
+ var domain:Array = parts[1].split(".");
+
+ //The domain must have at least one dot and a char
+ if (domain.length<2 || domain[0].length<1) {
+ vResult.errorStr = "Invalid domain name.";
+ return vResult;
+ }
+ //should cover country extensions, .info, .museum, etc.
+ var ext:Object = domain.pop();
+ if (ext.toString().length<2 || ext.toString().length == 5 || ext.toString().length>6) {
+ vResult.errorStr = "Invalid domain extension.";
+ return vResult;
+
+ }
+ vResult.result = true;
+ return vResult;
+ }
+
+
+ /**
+ * Is a String a valid Social Security Number
+ * Valid examples are 111-11-1111 or 111111111
+ *
+ * @param inStr The string that will be validated
+ * @param dashOpt This boolean is set to true if the dash character is optional? (optional)
+ * @return An as3ValidationResult.result true value if the data is valid. If the data is invalid, then
+ * as3Validation.result is set to false and the errorStr provides a brief description.
+ */
+ public function isSSN(inStr:String, dashOpt:Boolean = false):as3ValidationResult {
+ var vResult = new as3ValidationResult();
+ var str:String = inStr.toString();
+
+ if (!this.hasValidChars(str, DECIMAL_DIGITS+"-")) {
+ vResult.errorStr = "The SSN contains invalid characters. Only 0-9 and \"-\" are allowed.";
+ return vResult;
+ }
+ //if the dash must be there, validate it is in the correct spots
+ if (dashOpt == false) {
+ if (str.charAt(3) != "-" || str.charAt(6) != "-") {
+ vResult.errorStr = "The SSN does not adhere to a ###-##-#### format.";
+ return vResult;
+ }
+ }
+ if (str.indexOf("-")>-1) {
+ if (str.charAt(3) != "-" || str.charAt(6) != "-") {
+ vResult.errorStr = "The SSN does not adhere to a ###-##-#### format.";
+ return vResult;
+ }
+ var parts:Array = str.split("-");
+ if (parts.length != 3) {
+ vResult.errorStr = "Too many dashes are in the string.";
+ return vResult;
+ }
+ str = parts.join("");
+ }
+ if (str.length != 9) {
+ vResult.errorStr = "The SSN is too long.";
+ return vResult;
+ }
+ vResult.result = true;
+ return vResult;
+ }
+
+
+ /**
+ * Checks for a valid US Zip code
+ * Valid examples include 12345, 123456789 and 12345-6789 for US
+ * Valid examples for Canada include Z1Z-1Z1 and Z1Z 1Z1
+ *
+ * @param str The string to be validated
+ * @param allowCAN Set this Boolean to true to allow US and Canadian zip codes (optional)
+ * @return Am as3ValidationResult.result true value if the data is valid. If the data is invalid, then
+ * as3Validation.result is set to false and the errorStr provides a brief description.
+ */
+ public function isZip(str:String, allowCAN:Boolean = false):as3ValidationResult {
+ var vResult = new as3ValidationResult();
+
+ //If the Length is 10, Validate it is a US 5-4 format
+ if (str.length == 10) {
+ if (!this.hasValidChars(str, DECIMAL_DIGITS+"-")) {
+ vResult.errorStr = "The Zip contains invalid characters. Only 0-9 and \"-\" are allowed.";
+ return vResult;
+ }
+ var parts:Array = str.split("-");
+ if (parts.length != 2) {
+ vResult.errorStr = "Too many dashes.";
+ return vResult;
+ }
+
+ if (parts[0].length != 5) {
+ vResult.errorStr = "The primary ZIP is not 5 characters.";
+ return vResult;
+ }
+ if (parts[1].length != 4) {
+ vResult.errorStr = "The 4 digit extension is not 4 digits."
+ return vResult;
+ }
+ //If the zip is a US 5 digit or 9 digit (no space) zip code
+ } else if (str.length == 5 || str.length == 9) {
+ if (!this.hasValidChars(str, DECIMAL_DIGITS)) {
+ vResult.errorStr = "The zip code is not the correct length.";
+ return vResult;
+ }
+ //Check to see if the zip code is a LDL-DLD Canadian zip code
+ } else if (allowCAN && (str.length == 6 || str.length == 7)) {
+ var i:int = 0;
+ str = str.toLowerCase();
+ if (LC_ROMAN_LETTERS.indexOf(str.charAt(i++)) == -1 || DECIMAL_DIGITS.indexOf(str.charAt(i++)) == -1 || LC_ROMAN_LETTERS.indexOf(str.charAt(i++)) == -1) {
+ vResult.errorStr = "The first half of the Canadian Zip code is invalid.";
+ return vResult;
+ }
+ //Check the seperator (space or dash allowed)
+ if (str.length == 7) {
+ if (str.charAt(i) != "-" && str.charAt(i) != " ") {
+ vResult.errorStr = "The seperator is not in the correct location for a Canadian zip code.";
+ return vResult;
+ }
+ i++;
+ }
+ if (DECIMAL_DIGITS.indexOf(str.charAt(i++)) == -1 || LC_ROMAN_LETTERS.indexOf(str.charAt(i++)) == -1 || DECIMAL_DIGITS.indexOf(str.charAt(i++)) == -1) {
+ vResult.errorStr = "The second half of the Canadian zip is invalid.";
+ return vResult;
+ }
+ } else {
+ vResult.errorStr = "Unknown Zip type.";
+ return vResult;
+ }
+ vResult.result = true;
+ return vResult;
+ }
+
+
+ /**
+ * Determines whether the string is a valid US Phone Number with the area code
+ * Examples include (555) 555-5555, 555-555-5555, 555 555-5555, +1 (234) 555-5555
+ *
+ * @param str The string to be validated
+ * @return An as3ValidationResult.result true value if the data is valid. If the data is invalid, then
+ * as3Validation.result is set to false and the errorStr provides a brief description.
+ */
+ public function isUSPhoneNumber(inStr:String):as3ValidationResult {
+ var vResult = new as3ValidationResult();
+ var str:String = inStr.toString();
+ str = str.split(" ").join("");
+
+ //Ignore beginning + sign
+ if (str.charAt(0) == "+") {
+ //Not a US Number
+ if (str.charAt(1) != "1") {
+ vResult.errorStr = "Not a US Phone number.";
+ return vResult;
+ };
+ str = str.substr(1,str.length);
+ }
+
+ //Assume country code for now.
+ var hasCountryCode:Boolean = false;
+ if (str.charAt(0) == "1" && str.length > 10) {
+ hasCountryCode = true;
+ }
+
+ var paren = str.indexOf("(");
+ var tempArray:Array;
+ if (paren != -1) {
+ //Make sure parenthesis are in the right place :)
+ if ((paren != 0 && !hasCountryCode) || (hasCountryCode && paren != 1)) {
+ vResult.errorStr = "Left parenthesis is in an unexpected position.";
+ return vResult;
+ }
+
+ paren = str.indexOf(")");
+ if ((paren != 4 && !hasCountryCode) || (hasCountryCode && paren != 5)) {
+ vResult.errorStr = "Right Parenthesis is in an unexpected position.";
+ return vResult;
+ }
+
+ tempArray = str.split("(");
+ if (tempArray.length != 2) {
+ vResult.errorStr = "Too many right parenthesis.";
+ return vResult;
+ }
+
+ tempArray = tempArray.join("").split(")");
+ if (tempArray.length != 2) {
+ vResult.errorStr = "Too many left parenthesis.";
+ return vResult;
+ }
+
+ str = tempArray.join("");
+ }
+
+ if (str.indexOf("-") != -1) {
+ tempArray = str.split("-");
+ if (tempArray.length>4) {
+ vResult.errorStr = "Too many dashes.";
+ return vResult;
+ }
+ var len:int = tempArray.length;
+ //trace (tempArray[len - 2] + ":" + tempArray[len - 1]);
+
+ //Make sure dash is in the right place
+ if (tempArray[len - 1].length != 4) {
+ vResult.errorStr = "The dash is an unexpected position.";
+ return vResult;
+ }
+
+ str = tempArray.join("");
+ }
+
+ if (!this.hasValidChars(str, DECIMAL_DIGITS)) {
+ vResult.errorStr = "Invalid characters."
+ return vResult;
+ }
+
+ //Not the right length
+ if (str.length < 10 || str.length > 11) {
+ vResult.errorStr = "Incorrect length.";
+ return vResult;
+ }
+
+ //Area Codes do not begin with zero or one
+ var char:String;
+ if (str.length == 10) {
+ char = str.substr(0, 1);
+ } else if (str.length == 11) {
+ char = str.substr(1, 1);
+ } else {
+ vResult.errorStr = "Incorrect length.";
+ return vResult;
+ }
+
+ if ((parseInt(char) != 0) && (parseInt(char) != 1)) {
+ vResult.result = "true";
+ return (vResult);
+ } else {
+ vResult.errorStr = "Invalid area code.";
+ return (vResult);
+ }
+
+ }
+
+
+ /**
+ * Validate a credit card using the LUHN-10 Method
+ * This function ignores spaces and dashes
+ * Length is checked based on card type
+ *
+ * @param str The credit card number as a String
+ * @return An as3ValidationResult.result true value if the data is valid. If the data is invalid, then
+ * as3Validation.result is set to false and the errorStr provides a brief description.
+ */
+ public function isCreditCard(str:String):as3ValidationResult {
+ var vResult = new as3ValidationResult();
+ var str = str.toString();
+ str = str.split("-").join("");
+ str = str.split(" ").join("");
+
+ if (!this.hasValidChars(str, DECIMAL_DIGITS)) {
+ vResult.errorStr = "Contains invalid characters.";
+ return vResult;
+ }
+ var twoDigit:int = parseInt(str.substr(0, 2));
+ //If Visa
+ if (str.charAt(0) == "4") {
+ if (str.length != 16 && str.length != 13) {
+ vResult.errorStr = "Incorrect length for a Visa card.";
+ return vResult;
+ }
+ //If Discover
+ } else if (str.substr(0, 4) == "6011") {
+ if (str.length != 16) {
+ vResult.errorStr = "Incorrect length for a Discover card.";
+ return vResult;
+ }
+ //If American Express
+ } else if (twoDigit == 34 || twoDigit == 37) {
+ if (str.length != 15) {
+ vResult.errorStr = "Incorrect length for an American Express.";
+ return vResult;
+ }
+ //If Mastercard
+ } else if (twoDigit>=51 && twoDigit<=55) {
+ if (str.length != 16) {
+ vResult.errorStr = "Incorrect length for a Mastercard.";
+ return vResult;
+ }
+ //If Diner's Club
+ } else if ((parseInt(str.substr(0, 3))>=300 && parseInt(str.substr(0, 3))<=305) || twoDigit == 36 || twoDigit == 38) {
+ if (str.length != 14) {
+ vResult.errorStr = "Incorrect length for a Diner's Club card."
+ return vResult;
+ }
+ } else {
+ vResult.errorStr = "Unknown card type.";
+ return vResult;
+ }
+ var numbers:Array = str.split("");
+ var len:int = numbers.length;
+ var i:int;
+
+ //Perform LUHN-10 Check
+ for (i=0; i<len; i++, i++) {
+ var num = numbers[i]*2;
+ num = num.toString();
+ if (num.length == 2) {
+ num = parseInt(num.substr(0, 1))+parseInt(num.substr(1));
+ }
+ numbers[i] = num;
+ }
+ var mNum:int = 0;
+ for (i=0; i<len; i++) {
+ mNum += parseInt(numbers[i]);
+ }
+
+ if (mNum % 10 == 0) {
+ vResult.result = true;
+ return vResult;
+ } else {
+ vResult.errorStr = "Invalid card number.";
+ return vResult;
+ }
+ }
+
+
+ /**
+ * Casts a string as a number. If it fails, returns false.
+ *
+ * @param n The String of the number to validate
+ * @return A Boolean true value if the data is valid
+ */
+ public function isDigit(n:String):Boolean {
+ if (n == "" || n == null || n.length != 1) {
+ return false;
+ }
+ return ! isNaN(parseInt(n));
+ }
+
+
+ /**
+ * Determines if n is within A-Z or a-z
+ *
+ * @param n The character to validate
+ * @return A Boolean true value if the data is valid
+ */
+ public function isLetter(n:String):Boolean {
+ if (n == "" || n == null || n.length != 1) {
+ return false;
+ }
+ return LC_ROMAN_LETTERS.indexOf(n.toLowerCase()) != -1;
+ }
+
+
+ /**
+ * Determines whether the string contains only alphabetic and numeric characters
+ *
+ * @param str The string to validate
+ * @return A Boolean true value if the data is valid
+ */
+ public function isAlphaNumeric(str:String):Boolean {
+ return this.hasValidChars(str,DECIMAL_DIGITS + LC_ROMAN_LETTERS);
+ }
+
+
+ /**
+ * Does the character contain an alphabetic character or number
+ *
+ * @param n The character to validate
+ * @return A Boolean true value if the data is valid
+ */
+ public function isLetterOrDigit(n:String):Boolean {
+ if (n.length != 1) {return false;}
+ var ret:Boolean = (this.isLetter(n) || this.isDigit(n));
+ return ret;
+ }
+
+
+ /**
+ * Determines whether the string contains data
+ *
+ * @param str The character to validate
+ * @param white A boolean when set to false will ignore white space (space, newline, tab)
+ * @return A Boolean true value if the string is not empty
+ */
+ public function isNotEmpty(str:String, white:Boolean = false):Boolean {
+ if (white == false) {
+ str = str.split(" ").join("");
+ str = str.split("\n").join("");
+ str = str.split("\t").join("");
+ }
+ return str.length > 0;
+ }
+
+
+ /**
+ * Determines whether the integer with a specified range
+ *
+ * @param n The String representing the number to validate
+ * @param min The minimum value as a Number (>= comparison)
+ * @param max The maxium value as a Number (<= comparison)
+ * @return A Boolean true value if the data is within the range
+ */
+ public function isIntegerInRange(nString:String, min:int, max:int):Boolean {
+ var n:int = parseInt(nString);
+ if (isNaN(n) || isNaN(min) || isNaN(max)) {
+ return false;
+ }
+
+ //Make sure the arguments are in the correct order
+ if (min > max) {return false;}
+
+ //Make sure the number is an Integer
+ if (n != Math.round(n)) {
+ return false;
+ }
+
+ return (n >= min && n <= max);
+ }
+
+
+ /**
+ * Determines whether the string contains a valid day-first format date
+ *
+ * @param str The string containing a date in a day-first format
+ * @return A Boolean true value if the date is a valid day-first date
+ */
+ public function isWorldDate(str:String):as3ValidationResult {
+ return this.isDate(str,true);
+ }
+
+
+ /**
+ * Determines if the string contains a valid date.
+ * Valid Examples include 9/30/09, 9-30-09 or 9.30.09
+ *
+ * @param str The String containing the date
+ * @param dayFirst Whether the date is in a day first format
+ * @return An as3ValidationResult.result true value if the data is valid. If the data is invalid, then
+ * as3Validation.result is set to false and the errorStr provides a brief description.
+ */
+ public function isDate(str:String, dayFirst:Boolean = false):as3ValidationResult {
+ var vResult = new as3ValidationResult();
+ var str = str.split(" ").join("");
+
+ var dash = (str.indexOf("-") != -1);
+ var slash = (str.indexOf("/") != -1);
+ var period = (str.indexOf(".") != -1);
+
+ var parts;
+
+ //Validate that it used a consistent seperator
+ if (dash && !slash && !period) {
+ parts = str.split("-");
+ } else if (slash && !dash && !period) {
+ parts = str.split("/");
+ } else if (period && !dash && !slash) {
+ parts = str.split(".");
+ } else {
+ vResult.errorStr = "Incorrect format.";
+ return vResult;
+ }
+
+ if (parts.length != 3) {
+ vResult.errorStr = "Too many seperators.";
+ return vResult;
+ }
+
+ //Obtain the pieces of the date
+ var month:int, day:int;
+
+ if (dayFirst == true) {
+ day = parseInt(parts[0]);
+ month = parseInt(parts[1]);
+ } else {
+ month = parseInt(parts[0]);
+ day = parseInt(parts[1]);
+ }
+ var year:int = parseInt(parts[2]);
+ var yearLen:int = parts[2].length;
+
+ if (yearLen == 2) {
+ year = parseInt("20"+parts[2]);
+ } else if (yearLen != 4) {
+ vResult.errorStr = "Incorrect year.";
+ return vResult;
+ }
+
+ //Validate that the day and month look reasonable
+ if (!this.isIntegerInRange(month.toString(), 1, 12) || !this.isIntegerInRange(day.toString(), 1, 31)) {
+ vResult.errorStr = "The day or month is outside of range.";
+ return vResult;
+ }
+ //Cast as date to determine if the date exists on the calendar
+ var dt = new Date(year, month-1, day);
+
+ if (dt.getMonth() != month-1) {
+ vResult.errorStr = "Could not convert to a valid date.";
+ return vResult;
+ }
+
+ vResult.result = true;
+ return vResult;
+ }
+
+
+ /**
+ * HTML Encodes characters within a string for use in an HTML Text Field
+ * The characters escaped include: <>'&"
+ *
+ * @param str The String containing the HTML data
+ * @return An HTML encoded version of the original string.
+ */
+ public function escapeHTML(str:String):String {
+
+ var safeString:String = str;
+ if (safeString.indexOf("&")>=0) {
+ safeString = safeString.split("&").join("&amp;");
+ }
+ if (safeString.indexOf("<")>=0) {
+ safeString = safeString.split("<").join("&lt;");
+ }
+
+ if (safeString.indexOf(">")>=0) {
+ safeString = safeString.split(">").join("&gt;");
+ }
+
+ if (safeString.indexOf("\"")>=0) {
+ safeString = safeString.split("\"").join("&quot;");
+ }
+
+ if (safeString.indexOf("'")>=0) {
+ safeString = safeString.split("'").join("&apos;");
+ }
+
+ return safeString;
+ }
+
+
+
+ /**
+ * Checks to determine if a string contains a possible scripting tags.
+ * This function only checks for javascript:, event:, vbscript: and asfunction: links
+ * It will not check for data:, mailto: or other tags.
+ *
+ * @param str The string that will be checked.
+ * @return A Boolean true value if the string contains the forbidden text
+ */
+ public function containsScriptSchemes(htmlString:String):Boolean {
+ //Convert to lowercase since certain browsers ignore case
+ var str:String = htmlString.toLowerCase();
+
+ //remove spaces, tabs and newlines since different browser and OS combinations
+ //occasionally ignore these characters
+ str = str.split(" ").join("");
+ str = str.split("\t").join("");
+ str = str.split("\n").join("");
+ str = str.split("\r").join("");
+
+ if (str.indexOf("asfunction:")>=0 || str.indexOf("javascript:")>=0 || str.indexOf("event:")>=0 || str.indexOf("vbscript:")>=0) {
+ return true;
+ }
+ return false;
+ }
+
+ }//End Class
+
+}//End Package
50 src/com/adobe/as3Validators/as3ValidationResult.as
@@ -0,0 +1,50 @@
+/*
+Adobe Systems Incorporated(r) Source Code License Agreement
+Copyright(c) 2007 Adobe Systems Incorporated. All rights reserved.
+
+Please read this Source Code License Agreement carefully before using
+the source code.
+
+Adobe Systems Incorporated grants to you a perpetual, worldwide, non-exclusive,
+no-charge, royalty-free, irrevocable copyright license, to reproduce,
+prepare derivative works of, publicly display, publicly perform, and
+distribute this source code and such derivative works in source or
+object code form without any attribution requirements.
+
+The name "Adobe Systems Incorporated" must not be used to endorse or promote products
+derived from the source code without prior written permission.
+
+You agree to indemnify, hold harmless and defend Adobe Systems Incorporated from and
+against any loss, damage, claims or lawsuits, including attorney's
+fees that arise or result from your use or distribution of the source
+code.
+
+THIS SOURCE CODE IS PROVIDED "AS IS" AND "WITH ALL FAULTS", WITHOUT
+ANY TECHNICAL SUPPORT OR ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING,
+BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ALSO, THERE IS NO WARRANTY OF
+NON-INFRINGEMENT, TITLE OR QUIET ENJOYMENT. IN NO EVENT SHALL MACROMEDIA
+OR ITS SUPPLIERS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOURCE CODE, EVEN IF
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+package com.adobe.as3Validators{
+
+ public class as3ValidationResult {
+
+ /**
+ * Whether the validation was successful or not
+ */
+ public var result:Boolean = false;
+
+ /**
+ * The reason why the validation was unsuccessful
+ */
+ public var errorStr:String = "Unknown Error";
+ }
+}
5 src/com/adobe/serialization/.svn/all-wcprops
@@ -0,0 +1,5 @@
+K 25
+svn:wc:ra_dav:version-url
+V 50
+/svn/!svn/ver/83/trunk/src/com/adobe/serialization
+END
31 src/com/adobe/serialization/.svn/entries
@@ -0,0 +1,31 @@
+8
+
+dir
+83
+http://as3corelib.googlecode.com/svn/trunk/src/com/adobe/serialization
+http://as3corelib.googlecode.com/svn
+
+
+
+2008-12-23T15:13:33.074852Z
+83
+darron.schall
+
+
+svn:special svn:externals svn:needs-lock
+
+
+
+
+
+
+
+
+
+
+
+374f7c76-8224-0410-aa2b-53cc4844e527
+
+json
+dir
+
1 src/com/adobe/serialization/.svn/format
@@ -0,0 +1 @@
+8
1 src/com/adobe/serialization/CVS/Entries
@@ -0,0 +1 @@
+D/json////
1 src/com/adobe/serialization/CVS/Repository
@@ -0,0 +1 @@
+yahoo/presentation/flash/ActionScript 3/com/adobe/serialization
1 src/com/adobe/serialization/CVS/Root
@@ -0,0 +1 @@
+:extssh:zachg@vault.yahoo.com:/CVSROOT
47 src/com/adobe/serialization/json/.svn/all-wcprops
@@ -0,0 +1,47 @@
+K 25
+svn:wc:ra_dav:version-url
+V 55
+/svn/!svn/ver/83/trunk/src/com/adobe/serialization/json
+END
+JSONParseError.as
+K 25
+svn:wc:ra_dav:version-url
+V 73
+/svn/!svn/ver/55/trunk/src/com/adobe/serialization/json/JSONParseError.as
+END
+JSONDecoder.as
+K 25
+svn:wc:ra_dav:version-url
+V 70
+/svn/!svn/ver/83/trunk/src/com/adobe/serialization/json/JSONDecoder.as
+END
+JSONTokenizer.as
+K 25
+svn:wc:ra_dav:version-url
+V 72
+/svn/!svn/ver/83/trunk/src/com/adobe/serialization/json/JSONTokenizer.as
+END
+JSONEncoder.as
+K 25
+svn:wc:ra_dav:version-url
+V 70
+/svn/!svn/ver/55/trunk/src/com/adobe/serialization/json/JSONEncoder.as
+END
+JSON.as
+K 25
+svn:wc:ra_dav:version-url
+V 63
+/svn/!svn/ver/83/trunk/src/com/adobe/serialization/json/JSON.as
+END
+JSONToken.as
+K 25
+svn:wc:ra_dav:version-url
+V 68
+/svn/!svn/ver/55/trunk/src/com/adobe/serialization/json/JSONToken.as
+END
+JSONTokenType.as
+K 25
+svn:wc:ra_dav:version-url
+V 72
+/svn/!svn/ver/83/trunk/src/com/adobe/serialization/json/JSONTokenType.as
+END
112 src/com/adobe/serialization/json/.svn/entries
@@ -0,0 +1,112 @@
+8
+
+dir
+83
+http://as3corelib.googlecode.com/svn/trunk/src/com/adobe/serialization/json
+http://as3corelib.googlecode.com/svn
+
+
+
+2008-12-23T15:13:33.074852Z
+83
+darron.schall
+
+
+svn:special svn:externals svn:needs-lock
+
+
+
+
+
+
+
+
+
+
+
+374f7c76-8224-0410-aa2b-53cc4844e527
+
+JSONParseError.as
+file
+
+
+
+
+2008-12-04T08:42:31.000000Z
+349b4a6caceeb46730e01e909cc08413
+2008-08-08T06:16:29.605969Z
+55
+mikechambers
+
+JSONDecoder.as
+file
+
+
+
+
+2008-12-24T05:38:38.000000Z
+a0cfe010302ed884750a06926f72d6b6
+2008-12-23T15:13:33.074852Z
+83
+darron.schall
+
+JSONTokenizer.as
+file
+
+
+
+
+2008-12-24T05:38:38.000000Z
+520615f38ac73a6f662bff49f112a838
+2008-12-23T15:13:33.074852Z
+83
+darron.schall
+
+JSONEncoder.as
+file
+
+
+
+
+2008-12-04T08:42:31.000000Z
+f2802c0025547d37081a1eb92b604375
+2008-08-08T06:16:29.605969Z
+55
+mikechambers
+
+JSON.as
+file
+
+
+
+
+2008-12-24T05:38:38.000000Z
+72fd479d0901e989726554bb3655aeb1
+2008-12-23T15:13:33.074852Z
+83
+darron.schall
+
+JSONToken.as
+file
+
+
+
+
+2008-12-04T08:42:31.000000Z
+1306bd9a6d3ccb468510b068fd7bddbf
+2008-08-08T06:16:29.605969Z
+55
+mikechambers
+
+JSONTokenType.as
+file
+
+
+
+
+2008-12-24T05:38:38.000000Z
+16ac4a184d1218d59db4ac20a836169b
+2008-12-23T15:13:33.074852Z
+83
+darron.schall
+
1 src/com/adobe/serialization/json/.svn/format
@@ -0,0 +1 @@
+8
86 src/com/adobe/serialization/json/.svn/text-base/JSON.as.svn-base
@@ -0,0 +1,86 @@
+/*
+ Copyright (c) 2008, Adobe Systems Incorporated
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ * Neither the name of Adobe Systems Incorporated nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+package com.adobe.serialization.json
+{
+
+ /**
+ * This class provides encoding and decoding of the JSON format.
+ *
+ * Example usage:
+ * <code>
+ * // create a JSON string from an internal object
+ * JSON.encode( myObject );
+ *
+ * // read a JSON string into an internal object
+ * var myObject:Object = JSON.decode( jsonString );
+ * </code>
+ */
+ public class JSON
+ {
+ /**
+ * Encodes a object into a JSON string.
+ *
+ * @param o The object to create a JSON string for
+ * @return the JSON string representing o
+ * @langversion ActionScript 3.0
+ * @playerversion Flash 9.0
+ * @tiptext
+ */
+ public static function encode( o:Object ):String
+ {
+ return new JSONEncoder( o ).getString();
+ }
+
+ /**
+ * Decodes a JSON string into a native object.
+ *
+ * @param s The JSON string representing the object
+ * @param strict Flag indicating if the decoder should strictly adhere
+ * to the JSON standard or not. The default of <code>true</code>
+ * throws errors if the format does not match the JSON syntax exactly.
+ * Pass <code>false</code> to allow for non-properly-formatted JSON
+ * strings to be decoded with more leniancy.
+ * @return A native object as specified by s
+ * @throw JSONParseError
+ * @langversion ActionScript 3.0
+ * @playerversion Flash 9.0
+ * @tiptext
+ */
+ public static function decode( s:String, strict:Boolean = true ):*
+ {
+ return new JSONDecoder( s, strict ).getValue();
+ }
+
+ }
+
+}
327 src/com/adobe/serialization/json/.svn/text-base/JSONDecoder.as.svn-base
@@ -0,0 +1,327 @@
+/*
+ Copyright (c) 2008, Adobe Systems Incorporated
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ * Neither the name of Adobe Systems Incorporated nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+package com.adobe.serialization.json
+{
+
+ public class JSONDecoder
+ {
+
+ /**
+ * Flag indicating if the parser should be strict about the format
+ * of the JSON string it is attempting to decode.
+ */
+ private var strict:Boolean;
+
+ /** The value that will get parsed from the JSON string */
+ private var value:*;
+
+ /** The tokenizer designated to read the JSON string */
+ private var tokenizer:JSONTokenizer;
+
+ /** The current token from the tokenizer */
+ private var token:JSONToken;
+
+ /**
+ * Constructs a new JSONDecoder to parse a JSON string
+ * into a native object.
+ *
+ * @param s The JSON string to be converted
+ * into a native object
+ * @param strict Flag indicating if the JSON string needs to
+ * strictly match the JSON standard or not.
+ * @langversion ActionScript 3.0
+ * @playerversion Flash 9.0
+ * @tiptext
+ */
+ public function JSONDecoder( s:String, strict:Boolean )
+ {
+ this.strict = strict;
+ tokenizer = new JSONTokenizer( s, strict );
+
+ nextToken();
+ value = parseValue();
+
+ // Make sure the input stream is empty
+ if ( strict && nextToken() != null )
+ {
+ tokenizer.parseError( "Unexpected characters left in input stream" );
+ }
+ }
+
+ /**
+ * Gets the internal object that was created by parsing
+ * the JSON string passed to the constructor.
+ *
+ * @return The internal object representation of the JSON
+ * string that was passed to the constructor
+ * @langversion ActionScript 3.0
+ * @playerversion Flash 9.0
+ * @tiptext
+ */
+ public function getValue():*
+ {
+ return value;
+ }
+
+ /**
+ * Returns the next token from the tokenzier reading
+ * the JSON string
+ */
+ private function nextToken():JSONToken
+ {
+ return token = tokenizer.getNextToken();
+ }
+
+ /**
+ * Attempt to parse an array.
+ */
+ private function parseArray():Array
+ {
+ // create an array internally that we're going to attempt
+ // to parse from the tokenizer
+ var a:Array = new Array();
+
+ // grab the next token from the tokenizer to move
+ // past the opening [
+ nextToken();
+
+ // check to see if we have an empty array
+ if ( token.type == JSONTokenType.RIGHT_BRACKET )
+ {
+ // we're done reading the array, so return it
+ return a;
+ }
+ // in non-strict mode an empty array is also a comma
+ // followed by a right bracket
+ else if ( !strict && token.type == JSONTokenType.COMMA )
+ {
+ // move past the comma
+ nextToken();
+
+ // check to see if we're reached the end of the array
+ if ( token.type == JSONTokenType.RIGHT_BRACKET )
+ {
+ return a;
+ }
+ else
+ {
+ tokenizer.parseError( "Leading commas are not supported. Expecting ']' but found " + token.value );
+ }
+ }
+
+ // deal with elements of the array, and use an "infinite"
+ // loop because we could have any amount of elements
+ while ( true )
+ {
+ // read in the value and add it to the array
+ a.push( parseValue() );
+
+ // after the value there should be a ] or a ,
+ nextToken();
+
+ if ( token.type == JSONTokenType.RIGHT_BRACKET )
+ {
+ // we're done reading the array, so return it
+ return a;
+ }
+ else if ( token.type == JSONTokenType.COMMA )
+ {
+ // move past the comma and read another value
+ nextToken();