emergent-core 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (349) hide show
  1. data/.bnsignore +16 -0
  2. data/History.txt +4 -0
  3. data/Manifest.txt +348 -0
  4. data/README.rdoc +47 -0
  5. data/Rakefile +39 -0
  6. data/app_generators/emergent_core/USAGE +5 -0
  7. data/app_generators/emergent_core/emergent_core_generator.rb +73 -0
  8. data/app_generators/emergent_core/templates/core/actionscript.properties +16 -0
  9. data/app_generators/emergent_core/templates/core/actionscriptair.properties +16 -0
  10. data/app_generators/emergent_core/templates/core/app.yaml.erb +12 -0
  11. data/app_generators/emergent_core/templates/core/default_tasks.rake +51 -0
  12. data/app_generators/emergent_core/templates/core/empty.txt +0 -0
  13. data/app_generators/emergent_core/templates/core/expressInstall.swf +0 -0
  14. data/app_generators/emergent_core/templates/core/flex.properties +2 -0
  15. data/app_generators/emergent_core/templates/core/generate.rb +17 -0
  16. data/app_generators/emergent_core/templates/core/html-template/AC_OETags.js +276 -0
  17. data/app_generators/emergent_core/templates/core/html-template/history/history.css +6 -0
  18. data/app_generators/emergent_core/templates/core/html-template/history/history.js +645 -0
  19. data/app_generators/emergent_core/templates/core/html-template/history/historyFrame.html +29 -0
  20. data/app_generators/emergent_core/templates/core/html-template/index.template.html +121 -0
  21. data/app_generators/emergent_core/templates/core/html-template/playerProductInstall.swf +0 -0
  22. data/app_generators/emergent_core/templates/core/index.html.erb +18 -0
  23. data/app_generators/emergent_core/templates/core/index.yaml +11 -0
  24. data/app_generators/emergent_core/templates/core/mainair-app.xml +134 -0
  25. data/app_generators/emergent_core/templates/core/mainapp-config.xml +21 -0
  26. data/app_generators/emergent_core/templates/core/mainapp.mxml +106 -0
  27. data/app_generators/emergent_core/templates/core/project-textmate.erb +52 -0
  28. data/app_generators/emergent_core/templates/core/project.properties +18 -0
  29. data/app_generators/emergent_core/templates/core/projectair.properties +24 -0
  30. data/app_generators/emergent_core/templates/core/swfobject.js +5 -0
  31. data/bin/emergent +17 -0
  32. data/lib/emergent_core.rb +49 -0
  33. data/lib/restfulx/active_foo.rb +194 -0
  34. data/lib/restfulx/active_record_tasks.rb +81 -0
  35. data/lib/restfulx/configuration.rb +76 -0
  36. data/lib/restfulx/datamapper_foo.rb +31 -0
  37. data/lib/restfulx/rails/recipes.rb +60 -0
  38. data/lib/restfulx/rails/swf_helper.rb +60 -0
  39. data/lib/restfulx/tasks.rb +85 -0
  40. data/lib/restfulx.rb +117 -0
  41. data/rails_generators/emergent_cms/USAGE +5 -0
  42. data/rails_generators/emergent_cms/emergent_cms_generator.rb +21 -0
  43. data/rails_generators/emergent_cms/templates/PagesEditModel.as +114 -0
  44. data/rails_generators/emergent_cms/templates/PagesEditView.mxml +102 -0
  45. data/rails_generators/emergent_config/USAGE +5 -0
  46. data/rails_generators/emergent_config/emergent_config_generator.rb +330 -0
  47. data/rails_generators/emergent_config/templates/app/controllers/accounts_controller.rb +104 -0
  48. data/rails_generators/emergent_config/templates/app/controllers/addresses_controller.rb +97 -0
  49. data/rails_generators/emergent_config/templates/app/controllers/application.rb +26 -0
  50. data/rails_generators/emergent_config/templates/app/controllers/assets_controller.rb +1 -0
  51. data/rails_generators/emergent_config/templates/app/controllers/content_assignments_controller.rb +97 -0
  52. data/rails_generators/emergent_config/templates/app/controllers/contents_controller.rb +114 -0
  53. data/rails_generators/emergent_config/templates/app/controllers/sessions_controller.rb +72 -0
  54. data/rails_generators/emergent_config/templates/app/controllers/sites_controller.rb +1 -0
  55. data/rails_generators/emergent_config/templates/app/controllers/users_controller.rb +97 -0
  56. data/rails_generators/emergent_config/templates/app/flex/application/controllers/command/ICommand.as +16 -0
  57. data/rails_generators/emergent_config/templates/app/flex/application/controllers/command/Undoable.as +46 -0
  58. data/rails_generators/emergent_config/templates/app/flex/application/controllers/command/UpdateDocumentCommand.as +73 -0
  59. data/rails_generators/emergent_config/templates/app/flex/application/controllers/event/DocumentEvent.as +46 -0
  60. data/rails_generators/emergent_config/templates/app/flex/application/controllers/event/NavigationEvent.as +31 -0
  61. data/rails_generators/emergent_config/templates/app/flex/application/controllers/event/ResourceEvent.as +27 -0
  62. data/rails_generators/emergent_config/templates/app/flex/application/controllers/event/UndoEvent.as +36 -0
  63. data/rails_generators/emergent_config/templates/app/flex/application/controllers/manager/AboutUsManager.as +15 -0
  64. data/rails_generators/emergent_config/templates/app/flex/application/controllers/manager/AccountManager.as +31 -0
  65. data/rails_generators/emergent_config/templates/app/flex/application/controllers/manager/AuthenticationManager.as +76 -0
  66. data/rails_generators/emergent_config/templates/app/flex/application/controllers/manager/ContentManager.as +92 -0
  67. data/rails_generators/emergent_config/templates/app/flex/application/controllers/manager/DocumentManager.as +131 -0
  68. data/rails_generators/emergent_config/templates/app/flex/application/controllers/manager/DocumentsManager.as +156 -0
  69. data/rails_generators/emergent_config/templates/app/flex/application/controllers/manager/HomeManager.as +18 -0
  70. data/rails_generators/emergent_config/templates/app/flex/application/controllers/manager/MainManager.as +23 -0
  71. data/rails_generators/emergent_config/templates/app/flex/application/controllers/manager/PagesManager.as +71 -0
  72. data/rails_generators/emergent_config/templates/app/flex/application/controllers/manager/ResourceManager.as +195 -0
  73. data/rails_generators/emergent_config/templates/app/flex/application/controllers/manager/SiteManager.as +25 -0
  74. data/rails_generators/emergent_config/templates/app/flex/application/controllers/manager/UndoManager.as +143 -0
  75. data/rails_generators/emergent_config/templates/app/flex/application/controllers/map/DocumentMap.mxml +123 -0
  76. data/rails_generators/emergent_config/templates/app/flex/application/controllers/map/DocumentsMap.mxml +134 -0
  77. data/rails_generators/emergent_config/templates/app/flex/application/controllers/map/ManagerPresentationModelMap.mxml +59 -0
  78. data/rails_generators/emergent_config/templates/app/flex/application/controllers/map/ObjectMap.mxml +75 -0
  79. data/rails_generators/emergent_config/templates/app/flex/application/controllers/map/PresentationModelViewMap.mxml +81 -0
  80. data/rails_generators/emergent_config/templates/app/flex/application/controllers/map/PresenterViewMap.mxml +67 -0
  81. data/rails_generators/emergent_config/templates/app/flex/application/models/constant/DocumentType.as +52 -0
  82. data/rails_generators/emergent_config/templates/app/flex/application/models/constant/Resource.as +25 -0
  83. data/rails_generators/emergent_config/templates/app/flex/application/models/constant/ResourceAction.as +28 -0
  84. data/rails_generators/emergent_config/templates/app/flex/application/models/constant/ResourceResult.as +8 -0
  85. data/rails_generators/emergent_config/templates/app/flex/application/models/domain/Account.as +32 -0
  86. data/rails_generators/emergent_config/templates/app/flex/application/models/domain/Address.as +26 -0
  87. data/rails_generators/emergent_config/templates/app/flex/application/models/domain/Asset.as +25 -0
  88. data/rails_generators/emergent_config/templates/app/flex/application/models/domain/AssetAssignment.as +25 -0
  89. data/rails_generators/emergent_config/templates/app/flex/application/models/domain/Content.as +46 -0
  90. data/rails_generators/emergent_config/templates/app/flex/application/models/domain/ContentAssignment.as +33 -0
  91. data/rails_generators/emergent_config/templates/app/flex/application/models/domain/Document.as +131 -0
  92. data/rails_generators/emergent_config/templates/app/flex/application/models/domain/PlainDocument.as +19 -0
  93. data/rails_generators/emergent_config/templates/app/flex/application/models/domain/RichDocument.as +19 -0
  94. data/rails_generators/emergent_config/templates/app/flex/application/models/domain/Session.as +13 -0
  95. data/rails_generators/emergent_config/templates/app/flex/application/models/domain/Snapshot.as +21 -0
  96. data/rails_generators/emergent_config/templates/app/flex/application/models/domain/User.as +28 -0
  97. data/rails_generators/emergent_config/templates/app/flex/application/models/factory/DocumentFactory.as +61 -0
  98. data/rails_generators/emergent_config/templates/app/flex/application/models/factory/DocumentViewFactory.as +59 -0
  99. data/rails_generators/emergent_config/templates/app/flex/application/models/factory/ResourceFactory.as +28 -0
  100. data/rails_generators/emergent_config/templates/app/flex/application/models/presentation/AboutUsModel.as +22 -0
  101. data/rails_generators/emergent_config/templates/app/flex/application/models/presentation/AccountModel.as +68 -0
  102. data/rails_generators/emergent_config/templates/app/flex/application/models/presentation/AuthenticationModel.as +44 -0
  103. data/rails_generators/emergent_config/templates/app/flex/application/models/presentation/ContactUsModel.as +45 -0
  104. data/rails_generators/emergent_config/templates/app/flex/application/models/presentation/ContentModel.as +70 -0
  105. data/rails_generators/emergent_config/templates/app/flex/application/models/presentation/DocumentModel.as +235 -0
  106. data/rails_generators/emergent_config/templates/app/flex/application/models/presentation/DocumentsModel.as +169 -0
  107. data/rails_generators/emergent_config/templates/app/flex/application/models/presentation/HomeModel.as +23 -0
  108. data/rails_generators/emergent_config/templates/app/flex/application/models/presentation/MainModel.as +35 -0
  109. data/rails_generators/emergent_config/templates/app/flex/application/models/presentation/PagesModel.as +44 -0
  110. data/rails_generators/emergent_config/templates/app/flex/application/models/presentation/ProfileModel.as +99 -0
  111. data/rails_generators/emergent_config/templates/app/flex/application/models/presentation/ResourceModel.as +100 -0
  112. data/rails_generators/emergent_config/templates/app/flex/application/views/about_us/about_us.mxml +105 -0
  113. data/rails_generators/emergent_config/templates/app/flex/application/views/account/account.mxml +97 -0
  114. data/rails_generators/emergent_config/templates/app/flex/application/views/contact_us/contact_us.mxml +65 -0
  115. data/rails_generators/emergent_config/templates/app/flex/application/views/document/document.mxml +71 -0
  116. data/rails_generators/emergent_config/templates/app/flex/application/views/document/documents.mxml +201 -0
  117. data/rails_generators/emergent_config/templates/app/flex/application/views/document/plain_document.mxml +9 -0
  118. data/rails_generators/emergent_config/templates/app/flex/application/views/document/rich_document.mxml +12 -0
  119. data/rails_generators/emergent_config/templates/app/flex/application/views/gallery/gallery.mxml +37 -0
  120. data/rails_generators/emergent_config/templates/app/flex/application/views/home/home.mxml +58 -0
  121. data/rails_generators/emergent_config/templates/app/flex/application/views/home/home_presenter.as +81 -0
  122. data/rails_generators/emergent_config/templates/app/flex/application/views/home/home_troparchy.mxml +71 -0
  123. data/rails_generators/emergent_config/templates/app/flex/application/views/login/login.mxml +50 -0
  124. data/rails_generators/emergent_config/templates/app/flex/application/views/main/main.mxml +131 -0
  125. data/rails_generators/emergent_config/templates/app/flex/application/views/main/main_presenter.as +166 -0
  126. data/rails_generators/emergent_config/templates/app/flex/application/views/main/main_troparchy.mxml +74 -0
  127. data/rails_generators/emergent_config/templates/app/flex/application/views/navigation/navigation_bar_bottom_model.as +13 -0
  128. data/rails_generators/emergent_config/templates/app/flex/application/views/navigation/navigation_bar_bottom_presenter.as +10 -0
  129. data/rails_generators/emergent_config/templates/app/flex/application/views/navigation/navigation_bar_bottom_view.mxml +48 -0
  130. data/rails_generators/emergent_config/templates/app/flex/application/views/navigation/navigation_bar_left_model.as +13 -0
  131. data/rails_generators/emergent_config/templates/app/flex/application/views/navigation/navigation_bar_left_presenter.as +10 -0
  132. data/rails_generators/emergent_config/templates/app/flex/application/views/navigation/navigation_bar_left_view.mxml +43 -0
  133. data/rails_generators/emergent_config/templates/app/flex/application/views/navigation/navigation_bar_right_model.as +13 -0
  134. data/rails_generators/emergent_config/templates/app/flex/application/views/navigation/navigation_bar_right_presenter.as +10 -0
  135. data/rails_generators/emergent_config/templates/app/flex/application/views/navigation/navigation_bar_right_view.mxml +47 -0
  136. data/rails_generators/emergent_config/templates/app/flex/application/views/navigation/navigation_bar_top_model.as +13 -0
  137. data/rails_generators/emergent_config/templates/app/flex/application/views/navigation/navigation_bar_top_presenter.as +10 -0
  138. data/rails_generators/emergent_config/templates/app/flex/application/views/navigation/navigation_bar_top_view.mxml +49 -0
  139. data/rails_generators/emergent_config/templates/app/flex/application/views/navigation/navigation_bars_presenter.as +63 -0
  140. data/rails_generators/emergent_config/templates/app/flex/application/views/navigation/navigation_bars_troparchy.mxml +63 -0
  141. data/rails_generators/emergent_config/templates/app/flex/application/views/navigation/navigation_bars_view.mxml +59 -0
  142. data/rails_generators/emergent_config/templates/app/flex/application/views/pages/pages.mxml +44 -0
  143. data/rails_generators/emergent_config/templates/app/flex/application/views/pages/pages_presenter.as +83 -0
  144. data/rails_generators/emergent_config/templates/app/flex/application/views/pages/pages_troparchy.mxml +62 -0
  145. data/rails_generators/emergent_config/templates/app/flex/application/views/profile/profile.mxml +73 -0
  146. data/rails_generators/emergent_config/templates/app/flex/assets/fonts/MyriadPro-Bold.otf +0 -0
  147. data/rails_generators/emergent_config/templates/app/flex/assets/fonts/MyriadPro-Regular.otf +0 -0
  148. data/rails_generators/emergent_config/templates/app/flex/assets/html/lorem.html +3 -0
  149. data/rails_generators/emergent_config/templates/app/flex/assets/images/alexgrey/Picture10.png +0 -0
  150. data/rails_generators/emergent_config/templates/app/flex/assets/images/alexgrey/Picture11.png +0 -0
  151. data/rails_generators/emergent_config/templates/app/flex/assets/images/alexgrey/Picture12.png +0 -0
  152. data/rails_generators/emergent_config/templates/app/flex/assets/images/alexgrey/Picture13.png +0 -0
  153. data/rails_generators/emergent_config/templates/app/flex/assets/images/alexgrey/Picture14.png +0 -0
  154. data/rails_generators/emergent_config/templates/app/flex/assets/images/alexgrey/Picture3.png +0 -0
  155. data/rails_generators/emergent_config/templates/app/flex/assets/images/alexgrey/Picture4.png +0 -0
  156. data/rails_generators/emergent_config/templates/app/flex/assets/images/alexgrey/Picture5.png +0 -0
  157. data/rails_generators/emergent_config/templates/app/flex/assets/images/alexgrey/Picture6.png +0 -0
  158. data/rails_generators/emergent_config/templates/app/flex/assets/images/alexgrey/Picture7.png +0 -0
  159. data/rails_generators/emergent_config/templates/app/flex/assets/images/alexgrey/Picture8.png +0 -0
  160. data/rails_generators/emergent_config/templates/app/flex/assets/images/alexgrey/Picture9.png +0 -0
  161. data/rails_generators/emergent_config/templates/app/flex/assets/images/hot_nebula_0.jpg +0 -0
  162. data/rails_generators/emergent_config/templates/app/flex/assets/images/hot_nebula_180.jpg +0 -0
  163. data/rails_generators/emergent_config/templates/app/flex/assets/images/hot_nebula_270.jpg +0 -0
  164. data/rails_generators/emergent_config/templates/app/flex/assets/images/hot_nebula_90.jpg +0 -0
  165. data/rails_generators/emergent_config/templates/app/flex/assets/images/hot_nebula_bottom.jpg +0 -0
  166. data/rails_generators/emergent_config/templates/app/flex/assets/images/hot_nebula_top.jpg +0 -0
  167. data/rails_generators/emergent_config/templates/app/flex/assets/styles/itunes7Bg.jpg +0 -0
  168. data/rails_generators/emergent_config/templates/app/flex/assets/styles/jukebox.css +764 -0
  169. data/rails_generators/emergent_config/templates/app/flex/assets/styles/jukeboxGfx.swf +0 -0
  170. data/rails_generators/emergent_config/templates/app/flex/assets/styles/obsidian.css +734 -0
  171. data/rails_generators/emergent_config/templates/app/flex/assets/styles/obsidianBg.jpg +0 -0
  172. data/rails_generators/emergent_config/templates/app/flex/assets/styles/obsidianGfx.swf +0 -0
  173. data/rails_generators/emergent_config/templates/app/flex/com/fourD/actions/LayoutAction.as +377 -0
  174. data/rails_generators/emergent_config/templates/app/flex/com/fourD/actions/SimpleLayoutAction.as +210 -0
  175. data/rails_generators/emergent_config/templates/app/flex/com/fourD/animators/FourDTweenCollection.mxml +50 -0
  176. data/rails_generators/emergent_config/templates/app/flex/com/fourD/animators/IAnimator.as +39 -0
  177. data/rails_generators/emergent_config/templates/app/flex/com/fourD/animators/TweenMaxAnimator.as +269 -0
  178. data/rails_generators/emergent_config/templates/app/flex/com/fourD/cameras/AstroCamera.as +177 -0
  179. data/rails_generators/emergent_config/templates/app/flex/com/fourD/components/FourDDataGrid.mxml +105 -0
  180. data/rails_generators/emergent_config/templates/app/flex/com/fourD/components/FourDItemRenderer.mxml +54 -0
  181. data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/CenterPerspectiveProjection.as +72 -0
  182. data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/ComplexCondition.as +44 -0
  183. data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/ConditionsUtil.as +82 -0
  184. data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/FourDComponent.as +309 -0
  185. data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/InstanceMethodInvoker.as +50 -0
  186. data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/InstancePropertyInjector.as +43 -0
  187. data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/MethodCaller.as +51 -0
  188. data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/Pathway.as +10 -0
  189. data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/PathwayEvent.as +28 -0
  190. data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/Pheron.as +34 -0
  191. data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/Pheron2.as +41 -0
  192. data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/PheronReceptor.as +125 -0
  193. data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/Properties.as +57 -0
  194. data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/Router.as +50 -0
  195. data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/RouterUtil.as +70 -0
  196. data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/SimpleCondition.as +42 -0
  197. data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/SimpleZSortVO.as +1 -0
  198. data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/SimpleZSorter.as +1 -0
  199. data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/Tecton.as +70 -0
  200. data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/Tecton2.as +234 -0
  201. data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/TectonCache.as +111 -0
  202. data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/TectonEvent.as +39 -0
  203. data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/TectonMap.as +515 -0
  204. data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/TectonMap2.as +289 -0
  205. data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/TectonMapSample.mxml +73 -0
  206. data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/TectonReceptor.as +43 -0
  207. data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/TectonScope.as +38 -0
  208. data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/TectonScopeProperties.as +18 -0
  209. data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/TectonUtils.as +51 -0
  210. data/rails_generators/emergent_config/templates/app/flex/com/fourD/events/LayoutActionEvent.as +75 -0
  211. data/rails_generators/emergent_config/templates/app/flex/com/fourD/layouts/CarouselLayout.as +85 -0
  212. data/rails_generators/emergent_config/templates/app/flex/com/fourD/layouts/CircleLayout.as +102 -0
  213. data/rails_generators/emergent_config/templates/app/flex/com/fourD/layouts/CoverFlowLayout.as +136 -0
  214. data/rails_generators/emergent_config/templates/app/flex/com/fourD/layouts/FourDLayout.as +272 -0
  215. data/rails_generators/emergent_config/templates/app/flex/com/fourD/utils/TweenUtil.as +110 -0
  216. data/rails_generators/emergent_config/templates/app/helpers/accounts_helper.rb +93 -0
  217. data/rails_generators/emergent_config/templates/app/helpers/application_helper.rb +3 -0
  218. data/rails_generators/emergent_config/templates/app/models/account.rb +84 -0
  219. data/rails_generators/emergent_config/templates/app/models/account_mailer.rb +24 -0
  220. data/rails_generators/emergent_config/templates/app/models/account_observer.rb +17 -0
  221. data/rails_generators/emergent_config/templates/app/models/address.rb +2 -0
  222. data/rails_generators/emergent_config/templates/app/models/asset.rb +6 -0
  223. data/rails_generators/emergent_config/templates/app/models/asset_assignment.rb +4 -0
  224. data/rails_generators/emergent_config/templates/app/models/category.rb +35 -0
  225. data/rails_generators/emergent_config/templates/app/models/comment.rb +98 -0
  226. data/rails_generators/emergent_config/templates/app/models/content.rb +89 -0
  227. data/rails_generators/emergent_config/templates/app/models/content_assignment.rb +21 -0
  228. data/rails_generators/emergent_config/templates/app/models/image.rb +3 -0
  229. data/rails_generators/emergent_config/templates/app/models/post.rb +76 -0
  230. data/rails_generators/emergent_config/templates/app/models/section.rb +97 -0
  231. data/rails_generators/emergent_config/templates/app/models/site.rb +1 -0
  232. data/rails_generators/emergent_config/templates/app/models/tag.rb +1 -0
  233. data/rails_generators/emergent_config/templates/app/models/user.rb +4 -0
  234. data/rails_generators/emergent_config/templates/app/views/account_mailer/activation.erb +3 -0
  235. data/rails_generators/emergent_config/templates/app/views/account_mailer/signup_notification.erb +8 -0
  236. data/rails_generators/emergent_config/templates/config/Capfile +4 -0
  237. data/rails_generators/emergent_config/templates/config/README.txt +18 -0
  238. data/rails_generators/emergent_config/templates/config/deploy.rb +36 -0
  239. data/rails_generators/emergent_config/templates/config/routes.rb +72 -0
  240. data/rails_generators/emergent_config/templates/core/actionscript.properties +16 -0
  241. data/rails_generators/emergent_config/templates/core/actionscriptair.properties +16 -0
  242. data/rails_generators/emergent_config/templates/core/app.yaml.erb +12 -0
  243. data/rails_generators/emergent_config/templates/core/default_tasks.rake +51 -0
  244. data/rails_generators/emergent_config/templates/core/emergent_tasks.rake +42 -0
  245. data/rails_generators/emergent_config/templates/core/empty.txt +0 -0
  246. data/rails_generators/emergent_config/templates/core/expressInstall.swf +0 -0
  247. data/rails_generators/emergent_config/templates/core/flex.properties +2 -0
  248. data/rails_generators/emergent_config/templates/core/generate.rb +17 -0
  249. data/rails_generators/emergent_config/templates/core/html-template/AC_OETags.js +276 -0
  250. data/rails_generators/emergent_config/templates/core/html-template/history/history.css +6 -0
  251. data/rails_generators/emergent_config/templates/core/html-template/history/history.js +645 -0
  252. data/rails_generators/emergent_config/templates/core/html-template/history/historyFrame.html +29 -0
  253. data/rails_generators/emergent_config/templates/core/html-template/index.template.html +121 -0
  254. data/rails_generators/emergent_config/templates/core/html-template/playerProductInstall.swf +0 -0
  255. data/rails_generators/emergent_config/templates/core/index.html.erb +18 -0
  256. data/rails_generators/emergent_config/templates/core/index.yaml +11 -0
  257. data/rails_generators/emergent_config/templates/core/mainair-app.xml +134 -0
  258. data/rails_generators/emergent_config/templates/core/mainapp-config.xml +21 -0
  259. data/rails_generators/emergent_config/templates/core/mainapp.mxml +101 -0
  260. data/rails_generators/emergent_config/templates/core/project-textmate.erb +52 -0
  261. data/rails_generators/emergent_config/templates/core/project.properties +18 -0
  262. data/rails_generators/emergent_config/templates/core/projectair.properties +24 -0
  263. data/rails_generators/emergent_config/templates/core/restfulx.yml +14 -0
  264. data/rails_generators/emergent_config/templates/core/restfulx_tasks.rake +6 -0
  265. data/rails_generators/emergent_config/templates/core/swfobject.js +5 -0
  266. data/rails_generators/emergent_config/templates/db/migrate/create_accounts.rb +40 -0
  267. data/rails_generators/emergent_config/templates/db/migrate/create_addresses.rb +18 -0
  268. data/rails_generators/emergent_config/templates/db/migrate/create_asset_assignments.rb +19 -0
  269. data/rails_generators/emergent_config/templates/db/migrate/create_assets.rb +20 -0
  270. data/rails_generators/emergent_config/templates/db/migrate/create_content_assignments.rb +26 -0
  271. data/rails_generators/emergent_config/templates/db/migrate/create_contents.rb +21 -0
  272. data/rails_generators/emergent_config/templates/db/migrate/create_sessions.rb +16 -0
  273. data/rails_generators/emergent_config/templates/db/migrate/create_sites.rb +27 -0
  274. data/rails_generators/emergent_config/templates/db/migrate/create_users.rb +15 -0
  275. data/rails_generators/emergent_config/templates/lib/analytics.swc +0 -0
  276. data/rails_generators/emergent_config/templates/lib/app_controller.rb.erb +26 -0
  277. data/rails_generators/emergent_config/templates/lib/as3corelib-0.92.1.swc +0 -0
  278. data/rails_generators/emergent_config/templates/lib/as3crypto-1.3patched.swc +0 -0
  279. data/rails_generators/emergent_config/templates/lib/as3crypto.swc +0 -0
  280. data/rails_generators/emergent_config/templates/lib/as3ds-1.04.swc +0 -0
  281. data/rails_generators/emergent_config/templates/lib/as3httpclientlib-1.0.swc +0 -0
  282. data/rails_generators/emergent_config/templates/lib/authenticated_system.rb +189 -0
  283. data/rails_generators/emergent_config/templates/lib/authenticated_test_helper.rb +11 -0
  284. data/rails_generators/emergent_config/templates/lib/containerEx.swc +0 -0
  285. data/rails_generators/emergent_config/templates/lib/flare.swc +0 -0
  286. data/rails_generators/emergent_config/templates/lib/flash_session_hack.rb +27 -0
  287. data/rails_generators/emergent_config/templates/lib/flex2BrowserManager.swc +0 -0
  288. data/rails_generators/emergent_config/templates/lib/flexlib.swc +0 -0
  289. data/rails_generators/emergent_config/templates/lib/fluint.swc +0 -0
  290. data/rails_generators/emergent_config/templates/lib/mate_0_8_6_enhanced.swc +0 -0
  291. data/rails_generators/emergent_config/templates/lib/openflux.swc +0 -0
  292. data/rails_generators/emergent_config/templates/lib/pv3d.swc +0 -0
  293. data/rails_generators/emergent_config/templates/lib/restfulx.swc +0 -0
  294. data/rails_generators/emergent_config/templates/lib/site_keys.rb +38 -0
  295. data/rails_generators/emergent_config/templates/lib/tweenMax.swc +0 -0
  296. data/rails_generators/emergent_config/templates/lib/urlkitFlex3.swc +0 -0
  297. data/rails_generators/emergent_config/templates/shell_script +31 -0
  298. data/rails_generators/emergent_controller/USAGE +5 -0
  299. data/rails_generators/emergent_controller/emergent_controller_generator.rb +25 -0
  300. data/rails_generators/emergent_controller/templates/controller.as.erb +37 -0
  301. data/rails_generators/emergent_core/USAGE +5 -0
  302. data/rails_generators/emergent_core/emergent_core_generator.rb +157 -0
  303. data/rails_generators/emergent_iphone/USAGE +5 -0
  304. data/rails_generators/emergent_iphone/emergent_iphone_generator.rb +27 -0
  305. data/rails_generators/emergent_scaffold/USAGE +5 -0
  306. data/rails_generators/emergent_scaffold/emergent_scaffold_generator.rb +157 -0
  307. data/rails_generators/emergent_scaffold/templates/component.mxml.erb +101 -0
  308. data/rails_generators/emergent_scaffold/templates/controller.rb.erb +101 -0
  309. data/rails_generators/emergent_scaffold/templates/edit_index_view.mxml.erb +114 -0
  310. data/rails_generators/emergent_scaffold/templates/edit_show_view.mxml.erb +84 -0
  311. data/rails_generators/emergent_scaffold/templates/filter_view.mxml.erb +1 -0
  312. data/rails_generators/emergent_scaffold/templates/fixtures.yml.erb +128 -0
  313. data/rails_generators/emergent_scaffold/templates/index_view.mxml.erb +58 -0
  314. data/rails_generators/emergent_scaffold/templates/item_renderer.mxml.erb +53 -0
  315. data/rails_generators/emergent_scaffold/templates/manager.as.erb +31 -0
  316. data/rails_generators/emergent_scaffold/templates/migration.rb.erb +22 -0
  317. data/rails_generators/emergent_scaffold/templates/model.as.erb +42 -0
  318. data/rails_generators/emergent_scaffold/templates/model.rb.erb +11 -0
  319. data/rails_generators/emergent_scaffold/templates/presentation_model.as.erb +33 -0
  320. data/rails_generators/emergent_scaffold/templates/presenter.as.erb +98 -0
  321. data/rails_generators/emergent_scaffold/templates/show_view.mxml.erb +50 -0
  322. data/rails_generators/emergent_scaffold/templates/view_map.mxml.erb +40 -0
  323. data/rails_generators/emergent_scaffold/templates/views_panel.mxml.erb +64 -0
  324. data/rails_generators/emergent_styler/USAGE +5 -0
  325. data/rails_generators/emergent_styler/emergent_styler_generator.rb +21 -0
  326. data/rails_generators/rx_yaml_scaffold/USAGE +51 -0
  327. data/rails_generators/rx_yaml_scaffold/rx_yaml_scaffold_generator.rb +49 -0
  328. data/script/console +10 -0
  329. data/script/destroy +14 -0
  330. data/script/generate +14 -0
  331. data/spec/emergent_core_spec.rb +7 -0
  332. data/spec/spec_helper.rb +16 -0
  333. data/tasks/ann.rake +80 -0
  334. data/tasks/bones.rake +20 -0
  335. data/tasks/gem.rake +201 -0
  336. data/tasks/git.rake +40 -0
  337. data/tasks/manifest.rake +48 -0
  338. data/tasks/notes.rake +27 -0
  339. data/tasks/post_load.rake +39 -0
  340. data/tasks/rdoc.rake +50 -0
  341. data/tasks/rubyforge.rake +55 -0
  342. data/tasks/setup.rb +279 -0
  343. data/tasks/spec.rake +54 -0
  344. data/tasks/svn.rake +47 -0
  345. data/tasks/test.rake +40 -0
  346. data/test/test_emergent_core.rb +0 -0
  347. data/test/test_emergent_iphone_generator.rb +46 -0
  348. data/test/test_generator_helper.rb +29 -0
  349. metadata +437 -0
@@ -0,0 +1,645 @@
1
+ BrowserHistoryUtils = {
2
+ addEvent: function(elm, evType, fn, useCapture) {
3
+ useCapture = useCapture || false;
4
+ if (elm.addEventListener) {
5
+ elm.addEventListener(evType, fn, useCapture);
6
+ return true;
7
+ }
8
+ else if (elm.attachEvent) {
9
+ var r = elm.attachEvent('on' + evType, fn);
10
+ return r;
11
+ }
12
+ else {
13
+ elm['on' + evType] = fn;
14
+ }
15
+ }
16
+ }
17
+
18
+ BrowserHistory = (function() {
19
+ // type of browser
20
+ var browser = {
21
+ ie: false,
22
+ firefox: false,
23
+ safari: false,
24
+ opera: false,
25
+ version: -1
26
+ };
27
+
28
+ // if setDefaultURL has been called, our first clue
29
+ // that the SWF is ready and listening
30
+ //var swfReady = false;
31
+
32
+ // the URL we'll send to the SWF once it is ready
33
+ //var pendingURL = '';
34
+
35
+ // Default app state URL to use when no fragment ID present
36
+ var defaultHash = '';
37
+
38
+ // Last-known app state URL
39
+ var currentHref = document.location.href;
40
+
41
+ // Initial URL (used only by IE)
42
+ var initialHref = document.location.href;
43
+
44
+ // Initial URL (used only by IE)
45
+ var initialHash = document.location.hash;
46
+
47
+ // History frame source URL prefix (used only by IE)
48
+ var historyFrameSourcePrefix = 'history/historyFrame.html?';
49
+
50
+ // History maintenance (used only by Safari)
51
+ var currentHistoryLength = -1;
52
+
53
+ var historyHash = [];
54
+
55
+ var initialState = createState(initialHref, initialHref + '#' + initialHash, initialHash);
56
+
57
+ var backStack = [];
58
+ var forwardStack = [];
59
+
60
+ var currentObjectId = null;
61
+
62
+ //UserAgent detection
63
+ var useragent = navigator.userAgent.toLowerCase();
64
+
65
+ if (useragent.indexOf("opera") != -1) {
66
+ browser.opera = true;
67
+ } else if (useragent.indexOf("msie") != -1) {
68
+ browser.ie = true;
69
+ browser.version = parseFloat(useragent.substring(useragent.indexOf('msie') + 4));
70
+ } else if (useragent.indexOf("safari") != -1) {
71
+ browser.safari = true;
72
+ browser.version = parseFloat(useragent.substring(useragent.indexOf('safari') + 7));
73
+ } else if (useragent.indexOf("gecko") != -1) {
74
+ browser.firefox = true;
75
+ }
76
+
77
+ if (browser.ie == true && browser.version == 7) {
78
+ window["_ie_firstload"] = false;
79
+ }
80
+
81
+ // Accessor functions for obtaining specific elements of the page.
82
+ function getHistoryFrame()
83
+ {
84
+ return document.getElementById('ie_historyFrame');
85
+ }
86
+
87
+ function getAnchorElement()
88
+ {
89
+ return document.getElementById('firefox_anchorDiv');
90
+ }
91
+
92
+ function getFormElement()
93
+ {
94
+ return document.getElementById('safari_formDiv');
95
+ }
96
+
97
+ function getRememberElement()
98
+ {
99
+ return document.getElementById("safari_remember_field");
100
+ }
101
+
102
+ /* Get the Flash player object for performing ExternalInterface callbacks. */
103
+ function getPlayer(objectId) {
104
+ var objectId = objectId || null;
105
+ var player = null; /* AJH, needed? = document.getElementById(getPlayerId()); */
106
+ if (browser.ie && objectId != null) {
107
+ player = document.getElementById(objectId);
108
+ }
109
+ if (player == null) {
110
+ player = document.getElementsByTagName('object')[0];
111
+ }
112
+
113
+ if (player == null || player.object == null) {
114
+ player = document.getElementsByTagName('embed')[0];
115
+ }
116
+
117
+ return player;
118
+ }
119
+
120
+ function getPlayers() {
121
+ var players = [];
122
+ if (players.length == 0) {
123
+ var tmp = document.getElementsByTagName('object');
124
+ players = tmp;
125
+ }
126
+
127
+ if (players.length == 0 || players[0].object == null) {
128
+ var tmp = document.getElementsByTagName('embed');
129
+ players = tmp;
130
+ }
131
+ return players;
132
+ }
133
+
134
+ function getIframeHash() {
135
+ var doc = getHistoryFrame().contentWindow.document;
136
+ var hash = String(doc.location.search);
137
+ if (hash.length == 1 && hash.charAt(0) == "?") {
138
+ hash = "";
139
+ }
140
+ else if (hash.length >= 2 && hash.charAt(0) == "?") {
141
+ hash = hash.substring(1);
142
+ }
143
+ return hash;
144
+ }
145
+
146
+ /* Get the current location hash excluding the '#' symbol. */
147
+ function getHash() {
148
+ // It would be nice if we could use document.location.hash here,
149
+ // but it's faulty sometimes.
150
+ var idx = document.location.href.indexOf('#');
151
+ return (idx >= 0) ? document.location.href.substr(idx+1) : '';
152
+ }
153
+
154
+ /* Get the current location hash excluding the '#' symbol. */
155
+ function setHash(hash) {
156
+ // It would be nice if we could use document.location.hash here,
157
+ // but it's faulty sometimes.
158
+ if (hash == '') hash = '#'
159
+ document.location.hash = hash;
160
+ }
161
+
162
+ function createState(baseUrl, newUrl, flexAppUrl) {
163
+ return { 'baseUrl': baseUrl, 'newUrl': newUrl, 'flexAppUrl': flexAppUrl, 'title': null };
164
+ }
165
+
166
+ /* Add a history entry to the browser.
167
+ * baseUrl: the portion of the location prior to the '#'
168
+ * newUrl: the entire new URL, including '#' and following fragment
169
+ * flexAppUrl: the portion of the location following the '#' only
170
+ */
171
+ function addHistoryEntry(baseUrl, newUrl, flexAppUrl) {
172
+
173
+ //delete all the history entries
174
+ forwardStack = [];
175
+
176
+ if (browser.ie) {
177
+ //Check to see if we are being asked to do a navigate for the first
178
+ //history entry, and if so ignore, because it's coming from the creation
179
+ //of the history iframe
180
+ if (flexAppUrl == defaultHash && document.location.href == initialHref && window['_ie_firstload']) {
181
+ currentHref = initialHref;
182
+ return;
183
+ }
184
+ if ((!flexAppUrl || flexAppUrl == defaultHash) && window['_ie_firstload']) {
185
+ newUrl = baseUrl + '#' + defaultHash;
186
+ flexAppUrl = defaultHash;
187
+ } else {
188
+ // for IE, tell the history frame to go somewhere without a '#'
189
+ // in order to get this entry into the browser history.
190
+ getHistoryFrame().src = historyFrameSourcePrefix + flexAppUrl;
191
+ }
192
+ setHash(flexAppUrl);
193
+ } else {
194
+
195
+ //ADR
196
+ if (backStack.length == 0 && initialState.flexAppUrl == flexAppUrl) {
197
+ initialState = createState(baseUrl, newUrl, flexAppUrl);
198
+ } else if(backStack.length > 0 && backStack[backStack.length - 1].flexAppUrl == flexAppUrl) {
199
+ backStack[backStack.length - 1] = createState(baseUrl, newUrl, flexAppUrl);
200
+ }
201
+
202
+ if (browser.safari) {
203
+ // for Safari, submit a form whose action points to the desired URL
204
+ if (browser.version <= 419.3) {
205
+ var file = window.location.pathname.toString();
206
+ file = file.substring(file.lastIndexOf("/")+1);
207
+ getFormElement().innerHTML = '<form name="historyForm" action="'+file+'#' + flexAppUrl + '" method="GET"></form>';
208
+ //get the current elements and add them to the form
209
+ var qs = window.location.search.substring(1);
210
+ var qs_arr = qs.split("&");
211
+ for (var i = 0; i < qs_arr.length; i++) {
212
+ var tmp = qs_arr[i].split("=");
213
+ var elem = document.createElement("input");
214
+ elem.type = "hidden";
215
+ elem.name = tmp[0];
216
+ elem.value = tmp[1];
217
+ document.forms.historyForm.appendChild(elem);
218
+ }
219
+ document.forms.historyForm.submit();
220
+ } else {
221
+ top.location.hash = flexAppUrl;
222
+ }
223
+ // We also have to maintain the history by hand for Safari
224
+ historyHash[history.length] = flexAppUrl;
225
+ _storeStates();
226
+ } else {
227
+ // Otherwise, write an anchor into the page and tell the browser to go there
228
+ addAnchor(flexAppUrl);
229
+ setHash(flexAppUrl);
230
+ }
231
+ }
232
+ backStack.push(createState(baseUrl, newUrl, flexAppUrl));
233
+ }
234
+
235
+ function _storeStates() {
236
+ if (browser.safari) {
237
+ getRememberElement().value = historyHash.join(",");
238
+ }
239
+ }
240
+
241
+ function handleBackButton() {
242
+ //The "current" page is always at the top of the history stack.
243
+ var current = backStack.pop();
244
+ if (!current) { return; }
245
+ var last = backStack[backStack.length - 1];
246
+ if (!last && backStack.length == 0){
247
+ last = initialState;
248
+ }
249
+ forwardStack.push(current);
250
+ }
251
+
252
+ function handleForwardButton() {
253
+ //summary: private method. Do not call this directly.
254
+
255
+ var last = forwardStack.pop();
256
+ if (!last) { return; }
257
+ backStack.push(last);
258
+ }
259
+
260
+ function handleArbitraryUrl() {
261
+ //delete all the history entries
262
+ forwardStack = [];
263
+ }
264
+
265
+ /* Called periodically to poll to see if we need to detect navigation that has occurred */
266
+ function checkForUrlChange() {
267
+
268
+ if (browser.ie) {
269
+ if (currentHref != document.location.href && currentHref + '#' != document.location.href) {
270
+ //This occurs when the user has navigated to a specific URL
271
+ //within the app, and didn't use browser back/forward
272
+ //IE seems to have a bug where it stops updating the URL it
273
+ //shows the end-user at this point, but programatically it
274
+ //appears to be correct. Do a full app reload to get around
275
+ //this issue.
276
+ if (browser.version < 7) {
277
+ currentHref = document.location.href;
278
+ document.location.reload();
279
+ } else {
280
+ if (getHash() != getIframeHash()) {
281
+ // this.iframe.src = this.blankURL + hash;
282
+ var sourceToSet = historyFrameSourcePrefix + getHash();
283
+ getHistoryFrame().src = sourceToSet;
284
+ }
285
+ }
286
+ }
287
+ }
288
+
289
+ if (browser.safari) {
290
+ // For Safari, we have to check to see if history.length changed.
291
+ if (currentHistoryLength >= 0 && history.length != currentHistoryLength) {
292
+ //alert("did change: " + history.length + ", " + historyHash.length + "|" + historyHash[history.length] + "|>" + historyHash.join("|"));
293
+ // If it did change, then we have to look the old state up
294
+ // in our hand-maintained array since document.location.hash
295
+ // won't have changed, then call back into BrowserManager.
296
+ currentHistoryLength = history.length;
297
+ var flexAppUrl = historyHash[currentHistoryLength];
298
+ if (flexAppUrl == '') {
299
+ //flexAppUrl = defaultHash;
300
+ }
301
+ //ADR: to fix multiple
302
+ if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
303
+ var pl = getPlayers();
304
+ for (var i = 0; i < pl.length; i++) {
305
+ pl[i].browserURLChange(flexAppUrl);
306
+ }
307
+ } else {
308
+ getPlayer().browserURLChange(flexAppUrl);
309
+ }
310
+ _storeStates();
311
+ }
312
+ }
313
+ if (browser.firefox) {
314
+ if (currentHref != document.location.href) {
315
+ var bsl = backStack.length;
316
+
317
+ var urlActions = {
318
+ back: false,
319
+ forward: false,
320
+ set: false
321
+ }
322
+
323
+ if ((window.location.hash == initialHash || window.location.href == initialHref) && (bsl == 1)) {
324
+ urlActions.back = true;
325
+ // FIXME: could this ever be a forward button?
326
+ // we can't clear it because we still need to check for forwards. Ugg.
327
+ // clearInterval(this.locationTimer);
328
+ handleBackButton();
329
+ }
330
+
331
+ // first check to see if we could have gone forward. We always halt on
332
+ // a no-hash item.
333
+ if (forwardStack.length > 0) {
334
+ if (forwardStack[forwardStack.length-1].flexAppUrl == getHash()) {
335
+ urlActions.forward = true;
336
+ handleForwardButton();
337
+ }
338
+ }
339
+
340
+ // ok, that didn't work, try someplace back in the history stack
341
+ if ((bsl >= 2) && (backStack[bsl - 2])) {
342
+ if (backStack[bsl - 2].flexAppUrl == getHash()) {
343
+ urlActions.back = true;
344
+ handleBackButton();
345
+ }
346
+ }
347
+
348
+ if (!urlActions.back && !urlActions.forward) {
349
+ var foundInStacks = {
350
+ back: -1,
351
+ forward: -1
352
+ }
353
+
354
+ for (var i = 0; i < backStack.length; i++) {
355
+ if (backStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
356
+ arbitraryUrl = true;
357
+ foundInStacks.back = i;
358
+ }
359
+ }
360
+ for (var i = 0; i < forwardStack.length; i++) {
361
+ if (forwardStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
362
+ arbitraryUrl = true;
363
+ foundInStacks.forward = i;
364
+ }
365
+ }
366
+ handleArbitraryUrl();
367
+ }
368
+
369
+ // Firefox changed; do a callback into BrowserManager to tell it.
370
+ currentHref = document.location.href;
371
+ var flexAppUrl = getHash();
372
+ if (flexAppUrl == '') {
373
+ //flexAppUrl = defaultHash;
374
+ }
375
+ //ADR: to fix multiple
376
+ if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
377
+ var pl = getPlayers();
378
+ for (var i = 0; i < pl.length; i++) {
379
+ pl[i].browserURLChange(flexAppUrl);
380
+ }
381
+ } else {
382
+ getPlayer().browserURLChange(flexAppUrl);
383
+ }
384
+ }
385
+ }
386
+ //setTimeout(checkForUrlChange, 50);
387
+ }
388
+
389
+ /* Write an anchor into the page to legitimize it as a URL for Firefox et al. */
390
+ function addAnchor(flexAppUrl)
391
+ {
392
+ if (document.getElementsByName(flexAppUrl).length == 0) {
393
+ getAnchorElement().innerHTML += "<a name='" + flexAppUrl + "'>" + flexAppUrl + "</a>";
394
+ }
395
+ }
396
+
397
+ var _initialize = function () {
398
+ if (browser.ie)
399
+ {
400
+ var scripts = document.getElementsByTagName('script');
401
+ for (var i = 0, s; s = scripts[i]; i++) {
402
+ if (s.src.indexOf("history.js") > -1) {
403
+ var iframe_location = (new String(s.src)).replace("history.js", "historyFrame.html");
404
+ }
405
+ }
406
+ historyFrameSourcePrefix = iframe_location + "?";
407
+ var src = historyFrameSourcePrefix;
408
+
409
+ var iframe = document.createElement("iframe");
410
+ iframe.id = 'ie_historyFrame';
411
+ iframe.name = 'ie_historyFrame';
412
+ //iframe.src = historyFrameSourcePrefix;
413
+ try {
414
+ document.body.appendChild(iframe);
415
+ } catch(e) {
416
+ setTimeout(function() {
417
+ document.body.appendChild(iframe);
418
+ }, 0);
419
+ }
420
+ }
421
+
422
+ if (browser.safari)
423
+ {
424
+ var rememberDiv = document.createElement("div");
425
+ rememberDiv.id = 'safari_rememberDiv';
426
+ document.body.appendChild(rememberDiv);
427
+ rememberDiv.innerHTML = '<input type="text" id="safari_remember_field" style="width: 500px;">';
428
+
429
+ var formDiv = document.createElement("div");
430
+ formDiv.id = 'safari_formDiv';
431
+ document.body.appendChild(formDiv);
432
+
433
+ var reloader_content = document.createElement('div');
434
+ reloader_content.id = 'safarireloader';
435
+ var scripts = document.getElementsByTagName('script');
436
+ for (var i = 0, s; s = scripts[i]; i++) {
437
+ if (s.src.indexOf("history.js") > -1) {
438
+ html = (new String(s.src)).replace(".js", ".html");
439
+ }
440
+ }
441
+ reloader_content.innerHTML = '<iframe id="safarireloader-iframe" src="about:blank" frameborder="no" scrolling="no"></iframe>';
442
+ document.body.appendChild(reloader_content);
443
+ reloader_content.style.position = 'absolute';
444
+ reloader_content.style.left = reloader_content.style.top = '-9999px';
445
+ iframe = reloader_content.getElementsByTagName('iframe')[0];
446
+
447
+ if (document.getElementById("safari_remember_field").value != "" ) {
448
+ historyHash = document.getElementById("safari_remember_field").value.split(",");
449
+ }
450
+
451
+ }
452
+
453
+ if (browser.firefox)
454
+ {
455
+ var anchorDiv = document.createElement("div");
456
+ anchorDiv.id = 'firefox_anchorDiv';
457
+ document.body.appendChild(anchorDiv);
458
+ }
459
+
460
+ //setTimeout(checkForUrlChange, 50);
461
+ }
462
+
463
+ return {
464
+ historyHash: historyHash,
465
+ backStack: function() { return backStack; },
466
+ forwardStack: function() { return forwardStack },
467
+ getPlayer: getPlayer,
468
+ initialize: function(src) {
469
+ _initialize(src);
470
+ },
471
+ setURL: function(url) {
472
+ document.location.href = url;
473
+ },
474
+ getURL: function() {
475
+ return document.location.href;
476
+ },
477
+ getTitle: function() {
478
+ return document.title;
479
+ },
480
+ setTitle: function(title) {
481
+ try {
482
+ backStack[backStack.length - 1].title = title;
483
+ } catch(e) { }
484
+ //if on safari, set the title to be the empty string.
485
+ if (browser.safari) {
486
+ if (title == "") {
487
+ try {
488
+ var tmp = window.location.href.toString();
489
+ title = tmp.substring((tmp.lastIndexOf("/")+1), tmp.lastIndexOf("#"));
490
+ } catch(e) {
491
+ title = "";
492
+ }
493
+ }
494
+ }
495
+ document.title = title;
496
+ },
497
+ setDefaultURL: function(def)
498
+ {
499
+ defaultHash = def;
500
+ def = getHash();
501
+ //trailing ? is important else an extra frame gets added to the history
502
+ //when navigating back to the first page. Alternatively could check
503
+ //in history frame navigation to compare # and ?.
504
+ if (browser.ie)
505
+ {
506
+ window['_ie_firstload'] = true;
507
+ var sourceToSet = historyFrameSourcePrefix + def;
508
+ var func = function() {
509
+ getHistoryFrame().src = sourceToSet;
510
+ window.location.replace("#" + def);
511
+ setInterval(checkForUrlChange, 50);
512
+ }
513
+ try {
514
+ func();
515
+ } catch(e) {
516
+ window.setTimeout(function() { func(); }, 0);
517
+ }
518
+ }
519
+
520
+ if (browser.safari)
521
+ {
522
+ currentHistoryLength = history.length;
523
+ if (historyHash.length == 0) {
524
+ historyHash[currentHistoryLength] = def;
525
+ var newloc = "#" + def;
526
+ window.location.replace(newloc);
527
+ } else {
528
+ //alert(historyHash[historyHash.length-1]);
529
+ }
530
+ //setHash(def);
531
+ setInterval(checkForUrlChange, 50);
532
+ }
533
+
534
+
535
+ if (browser.firefox || browser.opera)
536
+ {
537
+ var reg = new RegExp("#" + def + "$");
538
+ if (window.location.toString().match(reg)) {
539
+ } else {
540
+ var newloc ="#" + def;
541
+ window.location.replace(newloc);
542
+ }
543
+ setInterval(checkForUrlChange, 50);
544
+ //setHash(def);
545
+ }
546
+
547
+ },
548
+
549
+ /* Set the current browser URL; called from inside BrowserManager to propagate
550
+ * the application state out to the container.
551
+ */
552
+ setBrowserURL: function(flexAppUrl, objectId) {
553
+ if (browser.ie && typeof objectId != "undefined") {
554
+ currentObjectId = objectId;
555
+ }
556
+ //fromIframe = fromIframe || false;
557
+ //fromFlex = fromFlex || false;
558
+ //alert("setBrowserURL: " + flexAppUrl);
559
+ //flexAppUrl = (flexAppUrl == "") ? defaultHash : flexAppUrl ;
560
+
561
+ var pos = document.location.href.indexOf('#');
562
+ var baseUrl = pos != -1 ? document.location.href.substr(0, pos) : document.location.href;
563
+ var newUrl = baseUrl + '#' + flexAppUrl;
564
+
565
+ if (document.location.href != newUrl && document.location.href + '#' != newUrl) {
566
+ currentHref = newUrl;
567
+ addHistoryEntry(baseUrl, newUrl, flexAppUrl);
568
+ currentHistoryLength = history.length;
569
+ }
570
+
571
+ return false;
572
+ },
573
+
574
+ browserURLChange: function(flexAppUrl) {
575
+ var objectId = null;
576
+ if (browser.ie && currentObjectId != null) {
577
+ objectId = currentObjectId;
578
+ }
579
+ pendingURL = '';
580
+
581
+ if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
582
+ var pl = getPlayers();
583
+ for (var i = 0; i < pl.length; i++) {
584
+ try {
585
+ pl[i].browserURLChange(flexAppUrl);
586
+ } catch(e) { }
587
+ }
588
+ } else {
589
+ try {
590
+ getPlayer(objectId).browserURLChange(flexAppUrl);
591
+ } catch(e) { }
592
+ }
593
+
594
+ currentObjectId = null;
595
+ }
596
+
597
+ }
598
+
599
+ })();
600
+
601
+ // Initialization
602
+
603
+ // Automated unit testing and other diagnostics
604
+
605
+ function setURL(url)
606
+ {
607
+ document.location.href = url;
608
+ }
609
+
610
+ function backButton()
611
+ {
612
+ history.back();
613
+ }
614
+
615
+ function forwardButton()
616
+ {
617
+ history.forward();
618
+ }
619
+
620
+ function goForwardOrBackInHistory(step)
621
+ {
622
+ history.go(step);
623
+ }
624
+
625
+ //BrowserHistoryUtils.addEvent(window, "load", function() { BrowserHistory.initialize(); });
626
+ (function(i) {
627
+ var u =navigator.userAgent;var e=/*@cc_on!@*/false;
628
+ var st = setTimeout;
629
+ if(/webkit/i.test(u)){
630
+ st(function(){
631
+ var dr=document.readyState;
632
+ if(dr=="loaded"||dr=="complete"){i()}
633
+ else{st(arguments.callee,10);}},10);
634
+ } else if((/mozilla/i.test(u)&&!/(compati)/.test(u)) || (/opera/i.test(u))){
635
+ document.addEventListener("DOMContentLoaded",i,false);
636
+ } else if(e){
637
+ (function(){
638
+ var t=document.createElement('doc:rdy');
639
+ try{t.doScroll('left');
640
+ i();t=null;
641
+ }catch(e){st(arguments.callee,0);}})();
642
+ } else{
643
+ window.onload=i;
644
+ }
645
+ })( function() {BrowserHistory.initialize();} );
@@ -0,0 +1,29 @@
1
+ <html>
2
+ <head>
3
+ <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
4
+ <META HTTP-EQUIV="Expires" CONTENT="-1">
5
+ </head>
6
+ <body>
7
+ <script>
8
+ function processUrl()
9
+ {
10
+
11
+ var pos = url.indexOf("?");
12
+ url = pos != -1 ? url.substr(pos + 1) : "";
13
+ if (!parent._ie_firstload) {
14
+ parent.BrowserHistory.setBrowserURL(url);
15
+ try {
16
+ parent.BrowserHistory.browserURLChange(url);
17
+ } catch(e) { }
18
+ } else {
19
+ parent._ie_firstload = false;
20
+ }
21
+ }
22
+
23
+ var url = document.location.href;
24
+ processUrl();
25
+ document.write(url);
26
+ </script>
27
+ Hidden frame for Browser History support.
28
+ </body>
29
+ </html>