emergent-core 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.bnsignore +16 -0
- data/History.txt +4 -0
- data/Manifest.txt +348 -0
- data/README.rdoc +47 -0
- data/Rakefile +39 -0
- data/app_generators/emergent_core/USAGE +5 -0
- data/app_generators/emergent_core/emergent_core_generator.rb +73 -0
- data/app_generators/emergent_core/templates/core/actionscript.properties +16 -0
- data/app_generators/emergent_core/templates/core/actionscriptair.properties +16 -0
- data/app_generators/emergent_core/templates/core/app.yaml.erb +12 -0
- data/app_generators/emergent_core/templates/core/default_tasks.rake +51 -0
- data/app_generators/emergent_core/templates/core/empty.txt +0 -0
- data/app_generators/emergent_core/templates/core/expressInstall.swf +0 -0
- data/app_generators/emergent_core/templates/core/flex.properties +2 -0
- data/app_generators/emergent_core/templates/core/generate.rb +17 -0
- data/app_generators/emergent_core/templates/core/html-template/AC_OETags.js +276 -0
- data/app_generators/emergent_core/templates/core/html-template/history/history.css +6 -0
- data/app_generators/emergent_core/templates/core/html-template/history/history.js +645 -0
- data/app_generators/emergent_core/templates/core/html-template/history/historyFrame.html +29 -0
- data/app_generators/emergent_core/templates/core/html-template/index.template.html +121 -0
- data/app_generators/emergent_core/templates/core/html-template/playerProductInstall.swf +0 -0
- data/app_generators/emergent_core/templates/core/index.html.erb +18 -0
- data/app_generators/emergent_core/templates/core/index.yaml +11 -0
- data/app_generators/emergent_core/templates/core/mainair-app.xml +134 -0
- data/app_generators/emergent_core/templates/core/mainapp-config.xml +21 -0
- data/app_generators/emergent_core/templates/core/mainapp.mxml +106 -0
- data/app_generators/emergent_core/templates/core/project-textmate.erb +52 -0
- data/app_generators/emergent_core/templates/core/project.properties +18 -0
- data/app_generators/emergent_core/templates/core/projectair.properties +24 -0
- data/app_generators/emergent_core/templates/core/swfobject.js +5 -0
- data/bin/emergent +17 -0
- data/lib/emergent_core.rb +49 -0
- data/lib/restfulx/active_foo.rb +194 -0
- data/lib/restfulx/active_record_tasks.rb +81 -0
- data/lib/restfulx/configuration.rb +76 -0
- data/lib/restfulx/datamapper_foo.rb +31 -0
- data/lib/restfulx/rails/recipes.rb +60 -0
- data/lib/restfulx/rails/swf_helper.rb +60 -0
- data/lib/restfulx/tasks.rb +85 -0
- data/lib/restfulx.rb +117 -0
- data/rails_generators/emergent_cms/USAGE +5 -0
- data/rails_generators/emergent_cms/emergent_cms_generator.rb +21 -0
- data/rails_generators/emergent_cms/templates/PagesEditModel.as +114 -0
- data/rails_generators/emergent_cms/templates/PagesEditView.mxml +102 -0
- data/rails_generators/emergent_config/USAGE +5 -0
- data/rails_generators/emergent_config/emergent_config_generator.rb +330 -0
- data/rails_generators/emergent_config/templates/app/controllers/accounts_controller.rb +104 -0
- data/rails_generators/emergent_config/templates/app/controllers/addresses_controller.rb +97 -0
- data/rails_generators/emergent_config/templates/app/controllers/application.rb +26 -0
- data/rails_generators/emergent_config/templates/app/controllers/assets_controller.rb +1 -0
- data/rails_generators/emergent_config/templates/app/controllers/content_assignments_controller.rb +97 -0
- data/rails_generators/emergent_config/templates/app/controllers/contents_controller.rb +114 -0
- data/rails_generators/emergent_config/templates/app/controllers/sessions_controller.rb +72 -0
- data/rails_generators/emergent_config/templates/app/controllers/sites_controller.rb +1 -0
- data/rails_generators/emergent_config/templates/app/controllers/users_controller.rb +97 -0
- data/rails_generators/emergent_config/templates/app/flex/application/controllers/command/ICommand.as +16 -0
- data/rails_generators/emergent_config/templates/app/flex/application/controllers/command/Undoable.as +46 -0
- data/rails_generators/emergent_config/templates/app/flex/application/controllers/command/UpdateDocumentCommand.as +73 -0
- data/rails_generators/emergent_config/templates/app/flex/application/controllers/event/DocumentEvent.as +46 -0
- data/rails_generators/emergent_config/templates/app/flex/application/controllers/event/NavigationEvent.as +31 -0
- data/rails_generators/emergent_config/templates/app/flex/application/controllers/event/ResourceEvent.as +27 -0
- data/rails_generators/emergent_config/templates/app/flex/application/controllers/event/UndoEvent.as +36 -0
- data/rails_generators/emergent_config/templates/app/flex/application/controllers/manager/AboutUsManager.as +15 -0
- data/rails_generators/emergent_config/templates/app/flex/application/controllers/manager/AccountManager.as +31 -0
- data/rails_generators/emergent_config/templates/app/flex/application/controllers/manager/AuthenticationManager.as +76 -0
- data/rails_generators/emergent_config/templates/app/flex/application/controllers/manager/ContentManager.as +92 -0
- data/rails_generators/emergent_config/templates/app/flex/application/controllers/manager/DocumentManager.as +131 -0
- data/rails_generators/emergent_config/templates/app/flex/application/controllers/manager/DocumentsManager.as +156 -0
- data/rails_generators/emergent_config/templates/app/flex/application/controllers/manager/HomeManager.as +18 -0
- data/rails_generators/emergent_config/templates/app/flex/application/controllers/manager/MainManager.as +23 -0
- data/rails_generators/emergent_config/templates/app/flex/application/controllers/manager/PagesManager.as +71 -0
- data/rails_generators/emergent_config/templates/app/flex/application/controllers/manager/ResourceManager.as +195 -0
- data/rails_generators/emergent_config/templates/app/flex/application/controllers/manager/SiteManager.as +25 -0
- data/rails_generators/emergent_config/templates/app/flex/application/controllers/manager/UndoManager.as +143 -0
- data/rails_generators/emergent_config/templates/app/flex/application/controllers/map/DocumentMap.mxml +123 -0
- data/rails_generators/emergent_config/templates/app/flex/application/controllers/map/DocumentsMap.mxml +134 -0
- data/rails_generators/emergent_config/templates/app/flex/application/controllers/map/ManagerPresentationModelMap.mxml +59 -0
- data/rails_generators/emergent_config/templates/app/flex/application/controllers/map/ObjectMap.mxml +75 -0
- data/rails_generators/emergent_config/templates/app/flex/application/controllers/map/PresentationModelViewMap.mxml +81 -0
- data/rails_generators/emergent_config/templates/app/flex/application/controllers/map/PresenterViewMap.mxml +67 -0
- data/rails_generators/emergent_config/templates/app/flex/application/models/constant/DocumentType.as +52 -0
- data/rails_generators/emergent_config/templates/app/flex/application/models/constant/Resource.as +25 -0
- data/rails_generators/emergent_config/templates/app/flex/application/models/constant/ResourceAction.as +28 -0
- data/rails_generators/emergent_config/templates/app/flex/application/models/constant/ResourceResult.as +8 -0
- data/rails_generators/emergent_config/templates/app/flex/application/models/domain/Account.as +32 -0
- data/rails_generators/emergent_config/templates/app/flex/application/models/domain/Address.as +26 -0
- data/rails_generators/emergent_config/templates/app/flex/application/models/domain/Asset.as +25 -0
- data/rails_generators/emergent_config/templates/app/flex/application/models/domain/AssetAssignment.as +25 -0
- data/rails_generators/emergent_config/templates/app/flex/application/models/domain/Content.as +46 -0
- data/rails_generators/emergent_config/templates/app/flex/application/models/domain/ContentAssignment.as +33 -0
- data/rails_generators/emergent_config/templates/app/flex/application/models/domain/Document.as +131 -0
- data/rails_generators/emergent_config/templates/app/flex/application/models/domain/PlainDocument.as +19 -0
- data/rails_generators/emergent_config/templates/app/flex/application/models/domain/RichDocument.as +19 -0
- data/rails_generators/emergent_config/templates/app/flex/application/models/domain/Session.as +13 -0
- data/rails_generators/emergent_config/templates/app/flex/application/models/domain/Snapshot.as +21 -0
- data/rails_generators/emergent_config/templates/app/flex/application/models/domain/User.as +28 -0
- data/rails_generators/emergent_config/templates/app/flex/application/models/factory/DocumentFactory.as +61 -0
- data/rails_generators/emergent_config/templates/app/flex/application/models/factory/DocumentViewFactory.as +59 -0
- data/rails_generators/emergent_config/templates/app/flex/application/models/factory/ResourceFactory.as +28 -0
- data/rails_generators/emergent_config/templates/app/flex/application/models/presentation/AboutUsModel.as +22 -0
- data/rails_generators/emergent_config/templates/app/flex/application/models/presentation/AccountModel.as +68 -0
- data/rails_generators/emergent_config/templates/app/flex/application/models/presentation/AuthenticationModel.as +44 -0
- data/rails_generators/emergent_config/templates/app/flex/application/models/presentation/ContactUsModel.as +45 -0
- data/rails_generators/emergent_config/templates/app/flex/application/models/presentation/ContentModel.as +70 -0
- data/rails_generators/emergent_config/templates/app/flex/application/models/presentation/DocumentModel.as +235 -0
- data/rails_generators/emergent_config/templates/app/flex/application/models/presentation/DocumentsModel.as +169 -0
- data/rails_generators/emergent_config/templates/app/flex/application/models/presentation/HomeModel.as +23 -0
- data/rails_generators/emergent_config/templates/app/flex/application/models/presentation/MainModel.as +35 -0
- data/rails_generators/emergent_config/templates/app/flex/application/models/presentation/PagesModel.as +44 -0
- data/rails_generators/emergent_config/templates/app/flex/application/models/presentation/ProfileModel.as +99 -0
- data/rails_generators/emergent_config/templates/app/flex/application/models/presentation/ResourceModel.as +100 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/about_us/about_us.mxml +105 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/account/account.mxml +97 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/contact_us/contact_us.mxml +65 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/document/document.mxml +71 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/document/documents.mxml +201 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/document/plain_document.mxml +9 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/document/rich_document.mxml +12 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/gallery/gallery.mxml +37 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/home/home.mxml +58 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/home/home_presenter.as +81 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/home/home_troparchy.mxml +71 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/login/login.mxml +50 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/main/main.mxml +131 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/main/main_presenter.as +166 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/main/main_troparchy.mxml +74 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/navigation/navigation_bar_bottom_model.as +13 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/navigation/navigation_bar_bottom_presenter.as +10 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/navigation/navigation_bar_bottom_view.mxml +48 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/navigation/navigation_bar_left_model.as +13 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/navigation/navigation_bar_left_presenter.as +10 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/navigation/navigation_bar_left_view.mxml +43 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/navigation/navigation_bar_right_model.as +13 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/navigation/navigation_bar_right_presenter.as +10 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/navigation/navigation_bar_right_view.mxml +47 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/navigation/navigation_bar_top_model.as +13 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/navigation/navigation_bar_top_presenter.as +10 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/navigation/navigation_bar_top_view.mxml +49 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/navigation/navigation_bars_presenter.as +63 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/navigation/navigation_bars_troparchy.mxml +63 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/navigation/navigation_bars_view.mxml +59 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/pages/pages.mxml +44 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/pages/pages_presenter.as +83 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/pages/pages_troparchy.mxml +62 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/profile/profile.mxml +73 -0
- data/rails_generators/emergent_config/templates/app/flex/assets/fonts/MyriadPro-Bold.otf +0 -0
- data/rails_generators/emergent_config/templates/app/flex/assets/fonts/MyriadPro-Regular.otf +0 -0
- data/rails_generators/emergent_config/templates/app/flex/assets/html/lorem.html +3 -0
- data/rails_generators/emergent_config/templates/app/flex/assets/images/alexgrey/Picture10.png +0 -0
- data/rails_generators/emergent_config/templates/app/flex/assets/images/alexgrey/Picture11.png +0 -0
- data/rails_generators/emergent_config/templates/app/flex/assets/images/alexgrey/Picture12.png +0 -0
- data/rails_generators/emergent_config/templates/app/flex/assets/images/alexgrey/Picture13.png +0 -0
- data/rails_generators/emergent_config/templates/app/flex/assets/images/alexgrey/Picture14.png +0 -0
- data/rails_generators/emergent_config/templates/app/flex/assets/images/alexgrey/Picture3.png +0 -0
- data/rails_generators/emergent_config/templates/app/flex/assets/images/alexgrey/Picture4.png +0 -0
- data/rails_generators/emergent_config/templates/app/flex/assets/images/alexgrey/Picture5.png +0 -0
- data/rails_generators/emergent_config/templates/app/flex/assets/images/alexgrey/Picture6.png +0 -0
- data/rails_generators/emergent_config/templates/app/flex/assets/images/alexgrey/Picture7.png +0 -0
- data/rails_generators/emergent_config/templates/app/flex/assets/images/alexgrey/Picture8.png +0 -0
- data/rails_generators/emergent_config/templates/app/flex/assets/images/alexgrey/Picture9.png +0 -0
- data/rails_generators/emergent_config/templates/app/flex/assets/images/hot_nebula_0.jpg +0 -0
- data/rails_generators/emergent_config/templates/app/flex/assets/images/hot_nebula_180.jpg +0 -0
- data/rails_generators/emergent_config/templates/app/flex/assets/images/hot_nebula_270.jpg +0 -0
- data/rails_generators/emergent_config/templates/app/flex/assets/images/hot_nebula_90.jpg +0 -0
- data/rails_generators/emergent_config/templates/app/flex/assets/images/hot_nebula_bottom.jpg +0 -0
- data/rails_generators/emergent_config/templates/app/flex/assets/images/hot_nebula_top.jpg +0 -0
- data/rails_generators/emergent_config/templates/app/flex/assets/styles/itunes7Bg.jpg +0 -0
- data/rails_generators/emergent_config/templates/app/flex/assets/styles/jukebox.css +764 -0
- data/rails_generators/emergent_config/templates/app/flex/assets/styles/jukeboxGfx.swf +0 -0
- data/rails_generators/emergent_config/templates/app/flex/assets/styles/obsidian.css +734 -0
- data/rails_generators/emergent_config/templates/app/flex/assets/styles/obsidianBg.jpg +0 -0
- data/rails_generators/emergent_config/templates/app/flex/assets/styles/obsidianGfx.swf +0 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/actions/LayoutAction.as +377 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/actions/SimpleLayoutAction.as +210 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/animators/FourDTweenCollection.mxml +50 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/animators/IAnimator.as +39 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/animators/TweenMaxAnimator.as +269 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/cameras/AstroCamera.as +177 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/components/FourDDataGrid.mxml +105 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/components/FourDItemRenderer.mxml +54 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/CenterPerspectiveProjection.as +72 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/ComplexCondition.as +44 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/ConditionsUtil.as +82 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/FourDComponent.as +309 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/InstanceMethodInvoker.as +50 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/InstancePropertyInjector.as +43 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/MethodCaller.as +51 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/Pathway.as +10 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/PathwayEvent.as +28 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/Pheron.as +34 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/Pheron2.as +41 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/PheronReceptor.as +125 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/Properties.as +57 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/Router.as +50 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/RouterUtil.as +70 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/SimpleCondition.as +42 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/SimpleZSortVO.as +1 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/SimpleZSorter.as +1 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/Tecton.as +70 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/Tecton2.as +234 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/TectonCache.as +111 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/TectonEvent.as +39 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/TectonMap.as +515 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/TectonMap2.as +289 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/TectonMapSample.mxml +73 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/TectonReceptor.as +43 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/TectonScope.as +38 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/TectonScopeProperties.as +18 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/TectonUtils.as +51 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/events/LayoutActionEvent.as +75 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/layouts/CarouselLayout.as +85 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/layouts/CircleLayout.as +102 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/layouts/CoverFlowLayout.as +136 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/layouts/FourDLayout.as +272 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/utils/TweenUtil.as +110 -0
- data/rails_generators/emergent_config/templates/app/helpers/accounts_helper.rb +93 -0
- data/rails_generators/emergent_config/templates/app/helpers/application_helper.rb +3 -0
- data/rails_generators/emergent_config/templates/app/models/account.rb +84 -0
- data/rails_generators/emergent_config/templates/app/models/account_mailer.rb +24 -0
- data/rails_generators/emergent_config/templates/app/models/account_observer.rb +17 -0
- data/rails_generators/emergent_config/templates/app/models/address.rb +2 -0
- data/rails_generators/emergent_config/templates/app/models/asset.rb +6 -0
- data/rails_generators/emergent_config/templates/app/models/asset_assignment.rb +4 -0
- data/rails_generators/emergent_config/templates/app/models/category.rb +35 -0
- data/rails_generators/emergent_config/templates/app/models/comment.rb +98 -0
- data/rails_generators/emergent_config/templates/app/models/content.rb +89 -0
- data/rails_generators/emergent_config/templates/app/models/content_assignment.rb +21 -0
- data/rails_generators/emergent_config/templates/app/models/image.rb +3 -0
- data/rails_generators/emergent_config/templates/app/models/post.rb +76 -0
- data/rails_generators/emergent_config/templates/app/models/section.rb +97 -0
- data/rails_generators/emergent_config/templates/app/models/site.rb +1 -0
- data/rails_generators/emergent_config/templates/app/models/tag.rb +1 -0
- data/rails_generators/emergent_config/templates/app/models/user.rb +4 -0
- data/rails_generators/emergent_config/templates/app/views/account_mailer/activation.erb +3 -0
- data/rails_generators/emergent_config/templates/app/views/account_mailer/signup_notification.erb +8 -0
- data/rails_generators/emergent_config/templates/config/Capfile +4 -0
- data/rails_generators/emergent_config/templates/config/README.txt +18 -0
- data/rails_generators/emergent_config/templates/config/deploy.rb +36 -0
- data/rails_generators/emergent_config/templates/config/routes.rb +72 -0
- data/rails_generators/emergent_config/templates/core/actionscript.properties +16 -0
- data/rails_generators/emergent_config/templates/core/actionscriptair.properties +16 -0
- data/rails_generators/emergent_config/templates/core/app.yaml.erb +12 -0
- data/rails_generators/emergent_config/templates/core/default_tasks.rake +51 -0
- data/rails_generators/emergent_config/templates/core/emergent_tasks.rake +42 -0
- data/rails_generators/emergent_config/templates/core/empty.txt +0 -0
- data/rails_generators/emergent_config/templates/core/expressInstall.swf +0 -0
- data/rails_generators/emergent_config/templates/core/flex.properties +2 -0
- data/rails_generators/emergent_config/templates/core/generate.rb +17 -0
- data/rails_generators/emergent_config/templates/core/html-template/AC_OETags.js +276 -0
- data/rails_generators/emergent_config/templates/core/html-template/history/history.css +6 -0
- data/rails_generators/emergent_config/templates/core/html-template/history/history.js +645 -0
- data/rails_generators/emergent_config/templates/core/html-template/history/historyFrame.html +29 -0
- data/rails_generators/emergent_config/templates/core/html-template/index.template.html +121 -0
- data/rails_generators/emergent_config/templates/core/html-template/playerProductInstall.swf +0 -0
- data/rails_generators/emergent_config/templates/core/index.html.erb +18 -0
- data/rails_generators/emergent_config/templates/core/index.yaml +11 -0
- data/rails_generators/emergent_config/templates/core/mainair-app.xml +134 -0
- data/rails_generators/emergent_config/templates/core/mainapp-config.xml +21 -0
- data/rails_generators/emergent_config/templates/core/mainapp.mxml +101 -0
- data/rails_generators/emergent_config/templates/core/project-textmate.erb +52 -0
- data/rails_generators/emergent_config/templates/core/project.properties +18 -0
- data/rails_generators/emergent_config/templates/core/projectair.properties +24 -0
- data/rails_generators/emergent_config/templates/core/restfulx.yml +14 -0
- data/rails_generators/emergent_config/templates/core/restfulx_tasks.rake +6 -0
- data/rails_generators/emergent_config/templates/core/swfobject.js +5 -0
- data/rails_generators/emergent_config/templates/db/migrate/create_accounts.rb +40 -0
- data/rails_generators/emergent_config/templates/db/migrate/create_addresses.rb +18 -0
- data/rails_generators/emergent_config/templates/db/migrate/create_asset_assignments.rb +19 -0
- data/rails_generators/emergent_config/templates/db/migrate/create_assets.rb +20 -0
- data/rails_generators/emergent_config/templates/db/migrate/create_content_assignments.rb +26 -0
- data/rails_generators/emergent_config/templates/db/migrate/create_contents.rb +21 -0
- data/rails_generators/emergent_config/templates/db/migrate/create_sessions.rb +16 -0
- data/rails_generators/emergent_config/templates/db/migrate/create_sites.rb +27 -0
- data/rails_generators/emergent_config/templates/db/migrate/create_users.rb +15 -0
- data/rails_generators/emergent_config/templates/lib/analytics.swc +0 -0
- data/rails_generators/emergent_config/templates/lib/app_controller.rb.erb +26 -0
- data/rails_generators/emergent_config/templates/lib/as3corelib-0.92.1.swc +0 -0
- data/rails_generators/emergent_config/templates/lib/as3crypto-1.3patched.swc +0 -0
- data/rails_generators/emergent_config/templates/lib/as3crypto.swc +0 -0
- data/rails_generators/emergent_config/templates/lib/as3ds-1.04.swc +0 -0
- data/rails_generators/emergent_config/templates/lib/as3httpclientlib-1.0.swc +0 -0
- data/rails_generators/emergent_config/templates/lib/authenticated_system.rb +189 -0
- data/rails_generators/emergent_config/templates/lib/authenticated_test_helper.rb +11 -0
- data/rails_generators/emergent_config/templates/lib/containerEx.swc +0 -0
- data/rails_generators/emergent_config/templates/lib/flare.swc +0 -0
- data/rails_generators/emergent_config/templates/lib/flash_session_hack.rb +27 -0
- data/rails_generators/emergent_config/templates/lib/flex2BrowserManager.swc +0 -0
- data/rails_generators/emergent_config/templates/lib/flexlib.swc +0 -0
- data/rails_generators/emergent_config/templates/lib/fluint.swc +0 -0
- data/rails_generators/emergent_config/templates/lib/mate_0_8_6_enhanced.swc +0 -0
- data/rails_generators/emergent_config/templates/lib/openflux.swc +0 -0
- data/rails_generators/emergent_config/templates/lib/pv3d.swc +0 -0
- data/rails_generators/emergent_config/templates/lib/restfulx.swc +0 -0
- data/rails_generators/emergent_config/templates/lib/site_keys.rb +38 -0
- data/rails_generators/emergent_config/templates/lib/tweenMax.swc +0 -0
- data/rails_generators/emergent_config/templates/lib/urlkitFlex3.swc +0 -0
- data/rails_generators/emergent_config/templates/shell_script +31 -0
- data/rails_generators/emergent_controller/USAGE +5 -0
- data/rails_generators/emergent_controller/emergent_controller_generator.rb +25 -0
- data/rails_generators/emergent_controller/templates/controller.as.erb +37 -0
- data/rails_generators/emergent_core/USAGE +5 -0
- data/rails_generators/emergent_core/emergent_core_generator.rb +157 -0
- data/rails_generators/emergent_iphone/USAGE +5 -0
- data/rails_generators/emergent_iphone/emergent_iphone_generator.rb +27 -0
- data/rails_generators/emergent_scaffold/USAGE +5 -0
- data/rails_generators/emergent_scaffold/emergent_scaffold_generator.rb +157 -0
- data/rails_generators/emergent_scaffold/templates/component.mxml.erb +101 -0
- data/rails_generators/emergent_scaffold/templates/controller.rb.erb +101 -0
- data/rails_generators/emergent_scaffold/templates/edit_index_view.mxml.erb +114 -0
- data/rails_generators/emergent_scaffold/templates/edit_show_view.mxml.erb +84 -0
- data/rails_generators/emergent_scaffold/templates/filter_view.mxml.erb +1 -0
- data/rails_generators/emergent_scaffold/templates/fixtures.yml.erb +128 -0
- data/rails_generators/emergent_scaffold/templates/index_view.mxml.erb +58 -0
- data/rails_generators/emergent_scaffold/templates/item_renderer.mxml.erb +53 -0
- data/rails_generators/emergent_scaffold/templates/manager.as.erb +31 -0
- data/rails_generators/emergent_scaffold/templates/migration.rb.erb +22 -0
- data/rails_generators/emergent_scaffold/templates/model.as.erb +42 -0
- data/rails_generators/emergent_scaffold/templates/model.rb.erb +11 -0
- data/rails_generators/emergent_scaffold/templates/presentation_model.as.erb +33 -0
- data/rails_generators/emergent_scaffold/templates/presenter.as.erb +98 -0
- data/rails_generators/emergent_scaffold/templates/show_view.mxml.erb +50 -0
- data/rails_generators/emergent_scaffold/templates/view_map.mxml.erb +40 -0
- data/rails_generators/emergent_scaffold/templates/views_panel.mxml.erb +64 -0
- data/rails_generators/emergent_styler/USAGE +5 -0
- data/rails_generators/emergent_styler/emergent_styler_generator.rb +21 -0
- data/rails_generators/rx_yaml_scaffold/USAGE +51 -0
- data/rails_generators/rx_yaml_scaffold/rx_yaml_scaffold_generator.rb +49 -0
- data/script/console +10 -0
- data/script/destroy +14 -0
- data/script/generate +14 -0
- data/spec/emergent_core_spec.rb +7 -0
- data/spec/spec_helper.rb +16 -0
- data/tasks/ann.rake +80 -0
- data/tasks/bones.rake +20 -0
- data/tasks/gem.rake +201 -0
- data/tasks/git.rake +40 -0
- data/tasks/manifest.rake +48 -0
- data/tasks/notes.rake +27 -0
- data/tasks/post_load.rake +39 -0
- data/tasks/rdoc.rake +50 -0
- data/tasks/rubyforge.rake +55 -0
- data/tasks/setup.rb +279 -0
- data/tasks/spec.rake +54 -0
- data/tasks/svn.rake +47 -0
- data/tasks/test.rake +40 -0
- data/test/test_emergent_core.rb +0 -0
- data/test/test_emergent_iphone_generator.rb +46 -0
- data/test/test_generator_helper.rb +29 -0
- metadata +437 -0
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
package com.fourD.core
|
|
2
|
+
{
|
|
3
|
+
import flash.utils.Dictionary;
|
|
4
|
+
|
|
5
|
+
public class TectonCache
|
|
6
|
+
{
|
|
7
|
+
public function TectonCache()
|
|
8
|
+
{
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
public static function addCachedInstance(key:*, instance:*, type:String, scope:IScope):void
|
|
12
|
+
{
|
|
13
|
+
if(type == NONE) return;
|
|
14
|
+
if(type == INHERIT)
|
|
15
|
+
{
|
|
16
|
+
type = scope.eventMap.cache;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
var cacheCollection:Dictionary;
|
|
20
|
+
if(type == LOCAL)
|
|
21
|
+
{
|
|
22
|
+
cacheCollection = scope.eventMap.getCacheCollection()
|
|
23
|
+
}
|
|
24
|
+
else
|
|
25
|
+
{
|
|
26
|
+
cacheCollection = scope.getManager().getCacheCollection();
|
|
27
|
+
}
|
|
28
|
+
if (key is Array) {
|
|
29
|
+
switch(key.length)
|
|
30
|
+
{
|
|
31
|
+
case 1:
|
|
32
|
+
if (cacheCollection[0] == undefined) {
|
|
33
|
+
if (!1 is Array) { cacheCollection[0] = new Dictionary(true); }
|
|
34
|
+
else if (1 is Array) { cacheCollection[0] = new Array(); }
|
|
35
|
+
}
|
|
36
|
+
if (cacheCollection[0] is Array) { cacheCollection[0].push(instance); }
|
|
37
|
+
else if (cacheCollection[0] is Dictionary) { cacheCollection[0][instance]; }
|
|
38
|
+
else (cacheCollection[0] = instance;
|
|
39
|
+
break;
|
|
40
|
+
case 2:
|
|
41
|
+
if (cacheCollection[0][1] == undefined) {
|
|
42
|
+
if (!2 is Array) { cacheCollection[0][1] = new Dictionary(true); }
|
|
43
|
+
else if (2 is Array) { cacheCollection[0][1] = new Array(); }
|
|
44
|
+
}
|
|
45
|
+
if (cacheCollection[0][1] is Array) { cacheCollection[0][1].push(instance); }
|
|
46
|
+
else if (cacheCollection[0][1] is Dictionary) { cacheCollection[0][1][instance]; }
|
|
47
|
+
else (cacheCollection[0][1] = instance;
|
|
48
|
+
break;
|
|
49
|
+
case 3:
|
|
50
|
+
if (cacheCollection[0][1][2] == undefined) {
|
|
51
|
+
if (!3 is Array) { cacheCollection[0][1][2] = new Dictionary(true); }
|
|
52
|
+
else if (3 is Array) { cacheCollection[0][1][2] = new Array(); }
|
|
53
|
+
}
|
|
54
|
+
if (cacheCollection[0][1][2] is Array) { cacheCollection[0][1][2].push(instance); }
|
|
55
|
+
else if (cacheCollection[0][1][2] is Dictionary) { cacheCollection[0][1][2][instance]; }
|
|
56
|
+
else (cacheCollection[0][1][2] = instance;
|
|
57
|
+
break;
|
|
58
|
+
case 4:
|
|
59
|
+
if (cacheCollection[0][1][2][3] == undefined) {
|
|
60
|
+
if (!4 is Array) { cacheCollection[0][1][2][3] = new Dictionary(true); }
|
|
61
|
+
else if (4 is Array) { cacheCollection[0][1][2][3] = new Array(); }
|
|
62
|
+
}
|
|
63
|
+
if (cacheCollection[0][1][2][3] is Array) { cacheCollection[0][1][2][3].push(instance); }
|
|
64
|
+
else if (cacheCollection[0][1][2][3] is Dictionary) { cacheCollection[0][1][2][3][instance]; }
|
|
65
|
+
else (cacheCollection[0][1][2][3] = instance;
|
|
66
|
+
break;
|
|
67
|
+
}
|
|
68
|
+
} else {
|
|
69
|
+
cacheCollection[key] = instance;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
public static function getCachedInstance(key:*, type:String, scope:IScope):Object
|
|
74
|
+
{
|
|
75
|
+
if(type == INHERIT)
|
|
76
|
+
{
|
|
77
|
+
type = scope.eventMap.cache;
|
|
78
|
+
}
|
|
79
|
+
var cacheCollection:Dictionary;
|
|
80
|
+
if(type == LOCAL)
|
|
81
|
+
{
|
|
82
|
+
cacheCollection = scope.eventMap.getCacheCollection()
|
|
83
|
+
}
|
|
84
|
+
else
|
|
85
|
+
{
|
|
86
|
+
cacheCollection = scope.getManager().getCacheCollection();
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if (key is Array) {
|
|
90
|
+
switch(key.length)
|
|
91
|
+
{
|
|
92
|
+
case 1:
|
|
93
|
+
return cacheCollection[0];
|
|
94
|
+
break;
|
|
95
|
+
case 2:
|
|
96
|
+
return cacheCollection[0][1];
|
|
97
|
+
break;
|
|
98
|
+
case 3:
|
|
99
|
+
return cacheCollection[0][1][2];
|
|
100
|
+
break;
|
|
101
|
+
case 4:
|
|
102
|
+
return cacheCollection[0][1][2][3];
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
} else {
|
|
106
|
+
return cacheCollection[key];
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
}
|
|
111
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
package com.fourD.core {
|
|
2
|
+
|
|
3
|
+
import flash.display.DisplayObject;
|
|
4
|
+
import flash.events.*;
|
|
5
|
+
|
|
6
|
+
public class TectonEvent extends Event {
|
|
7
|
+
|
|
8
|
+
public static const INITIALIZE:String = "initializeTectonEvent";
|
|
9
|
+
public static const START:String = "runTectonEvent";
|
|
10
|
+
public static const COMPLETE:String = "runCompleteTectonEvent";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Tecton that dispatched this event, which has a reference to a view (tropon)
|
|
14
|
+
* and the action that will be run (tweens or functions).
|
|
15
|
+
* A tecton has a ton of information with it.
|
|
16
|
+
*/
|
|
17
|
+
public var tropon:DisplayObject;
|
|
18
|
+
|
|
19
|
+
public var tecton:Tecton;
|
|
20
|
+
|
|
21
|
+
public var actionParams:Object;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* A PathwayEvent tells the View how to respond when some new data is loaded
|
|
25
|
+
* or you want to peform some super sophisticated animation sequence
|
|
26
|
+
* It also allows you to finely control the View state logic
|
|
27
|
+
* Edit this as you see fit.
|
|
28
|
+
*/
|
|
29
|
+
public function TectonEvent(type:String, bubbles:Boolean = false)
|
|
30
|
+
{
|
|
31
|
+
super(type, bubbles);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
override public function clone():Event
|
|
35
|
+
{
|
|
36
|
+
return new TectonEvent(type, bubbles);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,515 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2008 (c) Lance Pollard
|
|
3
|
+
* www.systemsofseven.com/blog
|
|
4
|
+
* www.4ddesignlab.com
|
|
5
|
+
* LanceJPollard@gmail.com
|
|
6
|
+
*
|
|
7
|
+
* Permission is hereby granted, free of charge, to any person
|
|
8
|
+
* obtaining a copy of this software and associated documentation
|
|
9
|
+
* files (the "Software"), to deal in the Software without
|
|
10
|
+
* restriction, including without limitation the rights to use,
|
|
11
|
+
* copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
12
|
+
* copies of the Software, and to permit persons to whom the
|
|
13
|
+
* Software is furnished to do so, subject to the following
|
|
14
|
+
* conditions:
|
|
15
|
+
*
|
|
16
|
+
* The above copyright notice and this permission notice shall be
|
|
17
|
+
* included in all copies or substantial portions of the Software.
|
|
18
|
+
*
|
|
19
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
20
|
+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
21
|
+
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
22
|
+
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
23
|
+
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
24
|
+
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
25
|
+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
26
|
+
* OTHER DEALINGS IN THE SOFTWARE.
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
package com.fourD.core
|
|
30
|
+
{
|
|
31
|
+
import com.asfusion.mate.core.EventMap;
|
|
32
|
+
|
|
33
|
+
import flash.net.registerClassAlias;
|
|
34
|
+
import flash.utils.Dictionary;
|
|
35
|
+
import flash.utils.getQualifiedClassName;
|
|
36
|
+
|
|
37
|
+
import mx.binding.utils.ChangeWatcher;
|
|
38
|
+
import mx.events.FlexEvent;
|
|
39
|
+
import mx.events.PropertyChangeEvent;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* 1) Collect all XML of components using describeType into an array
|
|
43
|
+
* 2) For each "extendsClass" in the XML for each component, slowly build
|
|
44
|
+
* a map of the components' tree/hierarchy
|
|
45
|
+
*/
|
|
46
|
+
public class TectonMap extends EventMap {
|
|
47
|
+
|
|
48
|
+
/** Tropons keeps a map of parent views to child views */
|
|
49
|
+
[Bindable]
|
|
50
|
+
public var tropons:Array;
|
|
51
|
+
|
|
52
|
+
public var tectonMap:Dictionary;
|
|
53
|
+
public var tectonStringMap:Dictionary;
|
|
54
|
+
|
|
55
|
+
/** map used in routing... the tropon and action in the url are turned into a tecton */
|
|
56
|
+
public var troponAndActionToTecton:Dictionary;
|
|
57
|
+
|
|
58
|
+
/** the tectons that are listening for tectons to start and whatnot */
|
|
59
|
+
public var tectonReceptors:Dictionary;
|
|
60
|
+
|
|
61
|
+
/** maps tectons to tropons (actions to objects in a system) */
|
|
62
|
+
public var tectonTroponMap:Dictionary;
|
|
63
|
+
|
|
64
|
+
/** if you only have a string of the view, turn it into the actual view */
|
|
65
|
+
public var troponNameToTropon:Dictionary;
|
|
66
|
+
|
|
67
|
+
/** creates a map or path of a currently active string of tectons */
|
|
68
|
+
public var tectonPathway:Dictionary;
|
|
69
|
+
|
|
70
|
+
/** in case you are dynamically creating a new tecton, figure out which one from the tropon class */
|
|
71
|
+
public var troponClassToTecton:Dictionary;
|
|
72
|
+
|
|
73
|
+
/** holds our tecton objects from XML (easily done in RestfulX) */
|
|
74
|
+
private var _tectons:Array; [Bindable]
|
|
75
|
+
public function get tectons():Array { return _tectons; }
|
|
76
|
+
public function set tectons(value:Array):void {
|
|
77
|
+
_tectons = value;
|
|
78
|
+
trace("TECTONS SET");
|
|
79
|
+
if (_tectons) { initializeMaps(); }
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/** global dispatcher injected by the application */
|
|
83
|
+
private var _dispatcher:IEventDispatcher; [Bindable]
|
|
84
|
+
public function get dispatcher():IEventDispatcher { return _dispatcher; }
|
|
85
|
+
public function set dispatcher(value:IEventDispatcher):void {
|
|
86
|
+
_dispatcher = value;
|
|
87
|
+
if (_dispatcher) { attachHandlers(); }
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
public function TectonMap() {
|
|
91
|
+
super();
|
|
92
|
+
trace("TECTONMAP CONSTRUCTOR");
|
|
93
|
+
troponAndActionToTecton = new Dictionary(true);
|
|
94
|
+
tectonMap = new Dictionary(true);
|
|
95
|
+
tectonReceptors = new Dictionary(true);
|
|
96
|
+
tectonTroponMap = new Dictionary(true);
|
|
97
|
+
troponNameToTropon = new Dictionary(true);
|
|
98
|
+
tectonPathway = new Dictionary(true);
|
|
99
|
+
troponClassToTecton = new Dictionary(true);
|
|
100
|
+
dispatcher = this.getDispatcher();
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
private function initializeMaps():void {
|
|
104
|
+
var i:int=0, len:int = tectons.length;
|
|
105
|
+
trace("INITIALIZE MAPS!");
|
|
106
|
+
// 1) create map of tectonReceptors to tectons
|
|
107
|
+
// 2) create map of tropons (from the troponTree) to tectons
|
|
108
|
+
var tecton:Tecton, tropon:*, tropons:Array, action:String, kanon:*;
|
|
109
|
+
for (i; i < len; i++) {
|
|
110
|
+
tecton = tectons[i];
|
|
111
|
+
var fqnTecton:String = getQualifiedClassName(tecton);
|
|
112
|
+
registerClassAlias(fqnTecton.replace("::","."), Tecton);
|
|
113
|
+
action = tecton.actionName;
|
|
114
|
+
if (tecton.tropon) {
|
|
115
|
+
trace("tecton exists");
|
|
116
|
+
tropon = tecton.tropon;
|
|
117
|
+
if (!tropon is Class) {
|
|
118
|
+
trace("tropon is displayObject");
|
|
119
|
+
trace(tropon);
|
|
120
|
+
if (!tecton.kanon) {
|
|
121
|
+
trace("kanon wasn't explicitly defined");
|
|
122
|
+
kanon = tropon.parent;
|
|
123
|
+
}
|
|
124
|
+
} else if (tropon is Class) {
|
|
125
|
+
trace("tropon is class = " + tropon);
|
|
126
|
+
if (!tecton.kanon) {
|
|
127
|
+
trace("kanon doesn't exist for class");
|
|
128
|
+
//THROW ERROR
|
|
129
|
+
} else {
|
|
130
|
+
kanon = tecton.kanon;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
else if (tecton.tropons) {
|
|
135
|
+
tropons = tecton.tropons;
|
|
136
|
+
}
|
|
137
|
+
// doesn't matter if it's a Class or DisplayObject :)
|
|
138
|
+
var fqnKanon:String = getQualifiedClassName(kanon);
|
|
139
|
+
var fqnTropon:String;
|
|
140
|
+
var j:int=0, lenj:int;
|
|
141
|
+
trace(tropon);
|
|
142
|
+
if (tropon != null) {
|
|
143
|
+
trace("Tropon is not equal to null");
|
|
144
|
+
fqnTropon = getQualifiedClassName(tropon);
|
|
145
|
+
if (tectonMap[fqnKanon] == undefined) {
|
|
146
|
+
tectonMap[fqnKanon] = new Dictionary(true); trace("first dictionary");
|
|
147
|
+
}
|
|
148
|
+
if (tectonMap[fqnKanon][fqnTropon] == undefined) {
|
|
149
|
+
tectonMap[fqnKanon][fqnTropon] = new Dictionary(true); trace("second dictionary");
|
|
150
|
+
}
|
|
151
|
+
if (action) {
|
|
152
|
+
tectonMap[fqnKanon][fqnTropon][action] = tecton;
|
|
153
|
+
trace("ALL OF IT: " + "\nKanon = " + fqnKanon + "\nTropon = " + fqnTropon + "\nAction = " + action);
|
|
154
|
+
}
|
|
155
|
+
} else if (tropons != null && tropon == null) {
|
|
156
|
+
lenj = tropons.length;
|
|
157
|
+
for (j; j < lenj; j++) {
|
|
158
|
+
tropon = tropons[j];
|
|
159
|
+
fqnTropon = getQualifiedClassName(tropon);
|
|
160
|
+
if (tectonMap[fqnKanon] == undefined) { tectonMap[fqnKanon] = new Dictionary(true); }
|
|
161
|
+
if (tectonMap[fqnKanon][fqnTropon] == undefined) { tectonMap[fqnKanon][fqnTropon] = new Dictionary(true); }
|
|
162
|
+
if (action) { tectonMap[fqnKanon][fqnTropon][action] = tecton; }
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
if (tecton.receptors != null) {
|
|
167
|
+
lenj = tecton.receptors.length;
|
|
168
|
+
for (j; j < lenj; j++) {
|
|
169
|
+
var receptor:Object = tecton.receptors[j];
|
|
170
|
+
if (tectonReceptors[tecton] == undefined) { tectonReceptors[tecton] = new Dictionary(true); }
|
|
171
|
+
if (tectonReceptors[tecton][receptor.eventType] == undefined) { tectonReceptors[tecton][receptor.eventType] = new Array(); }
|
|
172
|
+
tectonReceptors[tecton][receptor.eventType].push(receptor.tecton);
|
|
173
|
+
// PheronEvent has a "type" of the tecton defined
|
|
174
|
+
//receptor.tecton.addEventListener(
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/* lenj = tecton.tropons.length;
|
|
179
|
+
|
|
180
|
+
for (j; j < lenj; j++) {
|
|
181
|
+
trace("IN LOOP FOR TROPON AND ACTION");
|
|
182
|
+
tropon = tecton.tropons[i];
|
|
183
|
+
if (tecton.tropon == tropon) {
|
|
184
|
+
if (troponAndActionToTecton[tropon] == undefined) {
|
|
185
|
+
troponAndActionToTecton[tropon] = new Dictionary(true);
|
|
186
|
+
};
|
|
187
|
+
// 2) create map of actions + tropons to tectons
|
|
188
|
+
troponAndActionToTecton[tropon][action] = tecton;
|
|
189
|
+
if (tectonTroponMap[tecton] == undefined) {
|
|
190
|
+
tectonTroponMap[tecton] = new Array();
|
|
191
|
+
};
|
|
192
|
+
// 3) create a map of tectons to tropons
|
|
193
|
+
tectonTroponMap[tecton].push(tropon);
|
|
194
|
+
if (tectonTroponMap[tropon] == undefined) {
|
|
195
|
+
tectonTroponMap[tropon] = new Array();
|
|
196
|
+
};
|
|
197
|
+
// 3) create a reverse map of tropons to tectons
|
|
198
|
+
tectonTroponMap[tropon].push(tecton);
|
|
199
|
+
}
|
|
200
|
+
} */
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
private function attachHandlers():void {
|
|
205
|
+
dispatcher.addEventListener(TectonEvent.INITIALIZE, routeTectonEvent);
|
|
206
|
+
dispatcher.addEventListener(TectonEvent.START, routeTectonEvent);
|
|
207
|
+
dispatcher.addEventListener(TectonEvent.COMPLETE, routeTectonEvent);
|
|
208
|
+
|
|
209
|
+
dispatcher.addEventListener(PathwayEvent.TRAVERSE, routePathwayEvent);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
private function routeTectonEvent(event:TectonEvent):void {
|
|
213
|
+
var type:String = event.type;
|
|
214
|
+
var tecton:Tecton = event.tecton;
|
|
215
|
+
if (type == TectonEvent.INITIALIZE) { initialize(tecton); }
|
|
216
|
+
else if (type == TectonEvent.START) { run(tecton); }
|
|
217
|
+
else if (type == TectonEvent.COMPLETE) { complete(tecton); }
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
private function routePathwayEvent(event:PathwayEvent):void {
|
|
221
|
+
trace("pathwayEvent");
|
|
222
|
+
var type:String = event.type;
|
|
223
|
+
var url:Array = event.url;
|
|
224
|
+
var i:int=0, len:int = url.length;
|
|
225
|
+
var tropon:*, action:String, tecton:Tecton, kanon:*;
|
|
226
|
+
var fqnTropon:String, fqnKanon:String;
|
|
227
|
+
for (i; i < len; i++) {
|
|
228
|
+
tropon = url[i].view;
|
|
229
|
+
kanon = tropon.parent;
|
|
230
|
+
fqnTropon = getQualifiedClassName(tropon);
|
|
231
|
+
fqnKanon = getQualifiedClassName(kanon);
|
|
232
|
+
trace("tropon = " + tropon);
|
|
233
|
+
trace("kanon = " + kanon);
|
|
234
|
+
action = url[i].action;
|
|
235
|
+
trace("action = " + action);
|
|
236
|
+
// somehow wait for the first one to be done, then the second...
|
|
237
|
+
//tecton = ObjectUtil.copy(tectonMap[fqnKanon][fqnTropon][action]) as Tecton;
|
|
238
|
+
tecton = TectonUtils.clone(tectonMap[fqnKanon][fqnTropon][action]) as Tecton;
|
|
239
|
+
tecton.tropon = tropon;
|
|
240
|
+
//tecton.tropon = tropon;
|
|
241
|
+
trace("tectonClass = " + tecton);
|
|
242
|
+
|
|
243
|
+
initialize(tecton);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
public function initialize(tecton:Tecton):void {
|
|
248
|
+
// 1) check conditions to see if the current tecton should even be run,
|
|
249
|
+
// then 2) dispatch pherons to allow the receptor tectons to execute and repeat the cycle...
|
|
250
|
+
// if tecton is actually the tecton name...
|
|
251
|
+
// 1) Find tecton
|
|
252
|
+
if (!tecton) { return; } // throw error
|
|
253
|
+
|
|
254
|
+
// 2) validate tecton conditions to see if it's viable
|
|
255
|
+
var conditions:Array = tecton.conditions;
|
|
256
|
+
if (conditions != null) {
|
|
257
|
+
var value:Boolean = ConditionsUtil.validateConditions(conditions)
|
|
258
|
+
if (!value) { return; }
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
// 3) tecton is now initialized
|
|
262
|
+
trace("does tecton exist?? -> " + tecton);
|
|
263
|
+
tecton.isInitialized = true;
|
|
264
|
+
// 4) Find tectons that are listening for this tecton to initialize
|
|
265
|
+
var receptorTectons:Array = findReceptorTectons(tecton, TectonEvent.INITIALIZE);
|
|
266
|
+
trace("now receptors = "+ receptorTectons);
|
|
267
|
+
if (receptorTectons != null) {
|
|
268
|
+
// 5) Don't execute this tecton until the receptor tectons have initialized
|
|
269
|
+
waitForTectonInitialized(receptorTectons, tecton);
|
|
270
|
+
// 6) execute receptor tectons
|
|
271
|
+
execute(receptorTectons);
|
|
272
|
+
} else {
|
|
273
|
+
execute(tecton);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
public function run(tecton:Tecton):void {
|
|
278
|
+
trace("RUN TECTON");
|
|
279
|
+
trace(tecton.tropon);
|
|
280
|
+
trace("parent of tecton is " + tecton.tropon.parent);
|
|
281
|
+
trace("presenter = " + tecton.tropon.parent.presenter);
|
|
282
|
+
var tropon:* = tecton.tropon;
|
|
283
|
+
var params:Object = new Object();
|
|
284
|
+
var paramsArray:Array;
|
|
285
|
+
if (tecton.actions) {
|
|
286
|
+
var i:int=0, len:int = tecton.actions.length;
|
|
287
|
+
for (i; i < len; i++) {
|
|
288
|
+
var action:* = tecton.actions[i];
|
|
289
|
+
if (action is InstanceMethodInvoker) {
|
|
290
|
+
trace("action is method invoker!");
|
|
291
|
+
action.ins = tropon.parent.presenter;
|
|
292
|
+
action.run();
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
/* if (tecton.actions is Array || !tecton.action is Function) {
|
|
297
|
+
// tropon.tweens = tecton.action;
|
|
298
|
+
params.when = "onStart";
|
|
299
|
+
params.fxn = tectonStarted;
|
|
300
|
+
params.functionParams = [tecton];
|
|
301
|
+
params.when = "onComplete";
|
|
302
|
+
params.fxn = tectonCompleted;
|
|
303
|
+
params.functionParams = [tecton];
|
|
304
|
+
if (tecton.actionParams) {
|
|
305
|
+
if (tecton.actionParams is Array) {
|
|
306
|
+
tecton.actionParams.push(params);
|
|
307
|
+
} else {
|
|
308
|
+
paramsArray = [params, tecton.actionParams];
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
} else {
|
|
312
|
+
paramsArray = [params];
|
|
313
|
+
}
|
|
314
|
+
// tropon.tweenParams = paramsArray;
|
|
315
|
+
} else if (tecton.action is Function) {
|
|
316
|
+
// tropon.tweenFunction = tecton.action;
|
|
317
|
+
// if (tecton.actionParams) { tropon.tweenFunctionParams = tecton.actionParams; }
|
|
318
|
+
}
|
|
319
|
+
(tropon as Object).tween();
|
|
320
|
+
tecton.isRunning = true;
|
|
321
|
+
|
|
322
|
+
var receptorTectons:Array = findReceptorTectons(tecton, TectonEvent.RUN);
|
|
323
|
+
if (receptorTectons) {
|
|
324
|
+
execute(receptorTectons);
|
|
325
|
+
} */
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
protected function execute(tectons:*):void {
|
|
329
|
+
if (tectons is Array) {
|
|
330
|
+
var i:int=0, len:int = tectons.length;
|
|
331
|
+
for (i; i < len; i++) {
|
|
332
|
+
execute(tectons[i]);
|
|
333
|
+
}
|
|
334
|
+
} else {
|
|
335
|
+
var tecton:Tecton = tectons;
|
|
336
|
+
if (!tecton.isInitialized) { initialize(tecton); }
|
|
337
|
+
if (!tecton.isRunning && tecton.isInitialized) { run(tecton); }
|
|
338
|
+
else { return; }
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
private function findReceptorTectons(tecton:*, phase:String):Array {
|
|
343
|
+
var receptorTectons:Array;
|
|
344
|
+
if (tectonReceptors[tecton] != undefined && tectonReceptors[tecton][phase] != undefined) {
|
|
345
|
+
trace("RECEPTORS EXIST");
|
|
346
|
+
receptorTectons = tectonReceptors[tecton][phase];
|
|
347
|
+
}
|
|
348
|
+
if (receptorTectons != null) {
|
|
349
|
+
trace("recpecptors aren't null");
|
|
350
|
+
var i:int=0, len:int = receptorTectons.length;
|
|
351
|
+
for (i; i < len; i++) {
|
|
352
|
+
// map of child to parent
|
|
353
|
+
tectonPathway[receptorTectons[i]] = tecton;
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
trace("return receptors = " + receptorTectons);
|
|
357
|
+
return receptorTectons;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
public function complete(tecton:*, target:*=null):void {
|
|
361
|
+
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
private function waitForTectonInitialized(tectons:Array, callBackTecton:*):void {
|
|
365
|
+
var i:int=0, len:int = tectons.length;
|
|
366
|
+
for (i; i < len; i++) {
|
|
367
|
+
var tecton:* = tectons[i];
|
|
368
|
+
ChangeWatcher.watch(tecton, "isInitialized", tectonInitialized);
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
private function tectonInitialized(event:PropertyChangeEvent):void {
|
|
373
|
+
// var tecton:* = event.source;
|
|
374
|
+
// var property:* = event.property;
|
|
375
|
+
var count:int = 0;
|
|
376
|
+
var numTectons:int = 0;
|
|
377
|
+
for each (var tecton:* in tectonPathway) {
|
|
378
|
+
numTectons ++;
|
|
379
|
+
if (tecton.isInitialized) { count++; }
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
if (count == numTectons) {
|
|
383
|
+
var initializedTecton:* = tectonPathway[event.source];
|
|
384
|
+
run(initializedTecton);
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
/** tectonStarted and tectonCompleted simply restart the initialization process */
|
|
389
|
+
private function tectonStarted(tecton:*):void {
|
|
390
|
+
tecton.isComplete = false;
|
|
391
|
+
tecton.isRunning = true;
|
|
392
|
+
// dispatcher.dispatchEvent(new Pheron());
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
private function tectonCompleted(tecton:*):void {
|
|
396
|
+
tecton.isRunning = false;
|
|
397
|
+
tecton.isComplete = true;
|
|
398
|
+
// dispatcher.dispatchEvent(new Pheron());
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
/* private function createTroponTreeMap():void {
|
|
402
|
+
for each (var view:Class in views) {
|
|
403
|
+
var fqn:String = getQualifiedClassName(view);
|
|
404
|
+
|
|
405
|
+
var viewName:String = fqn.split("::")[1] as String;
|
|
406
|
+
viewClasses[view] = fqn;
|
|
407
|
+
viewClasses[fqn] = view;
|
|
408
|
+
}
|
|
409
|
+
// once we have set up the core data structures we need another pass to compute
|
|
410
|
+
// the hierarchy of the components/views
|
|
411
|
+
views.forEach(function(elm:Class, index:int, array:Array):void {
|
|
412
|
+
extractMetadata(elm);
|
|
413
|
+
});
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
private function extractMetadata(viewClass:Class):void {
|
|
417
|
+
var fqn:String = viewClasses[viewClass];
|
|
418
|
+
var view:UIComponent = viewInstances[viewClass];
|
|
419
|
+
var meta:XML = describeType(view);
|
|
420
|
+
|
|
421
|
+
// extract superclasses
|
|
422
|
+
for each (var node:XML in meta..accessor) {
|
|
423
|
+
var declaredBy:String = node.@declaredBy;
|
|
424
|
+
var name:String = node.@name;
|
|
425
|
+
var child:UIComponent;
|
|
426
|
+
// if the accessor was declared in one of your classes and it's a UIComponent...
|
|
427
|
+
// if (viewClasses[declaredBy] && view[name] is UIComponent) {
|
|
428
|
+
// child = view[name] as UIComponent;
|
|
429
|
+
// mapChildToParent(troponMap, view, child);
|
|
430
|
+
// }
|
|
431
|
+
}
|
|
432
|
+
} */
|
|
433
|
+
|
|
434
|
+
private function mapChildToParent(map:*, parent:String, child:*):void {
|
|
435
|
+
if (map[parent] == undefined) map[parent] = [];
|
|
436
|
+
map[parent].push(child);
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
/** Actions are defined by the parent, with a name and a target
|
|
440
|
+
* The steps to running an action:
|
|
441
|
+
* 1) Find the current action by name
|
|
442
|
+
* 2) Find the target object by either the data object or the renderer
|
|
443
|
+
* 3) If the action is already active, skip the whole process
|
|
444
|
+
* 4) If the action isn't active, run other actions first to prepare the landscape
|
|
445
|
+
* 5) After the preparation, run the action and set the action to Active
|
|
446
|
+
* 6) After the action is run, dispatch an Event?
|
|
447
|
+
*/
|
|
448
|
+
/* public function action(action:*, callBackAction:*=null, delay:Number=NaN):void {
|
|
449
|
+
if (this.actions == null || action == null) { return; }
|
|
450
|
+
|
|
451
|
+
if (action is String) {
|
|
452
|
+
var i:int=0, len:int = view.actions.length;
|
|
453
|
+
for (i; i < len; i++) {
|
|
454
|
+
// 1) Find action by name
|
|
455
|
+
if (view.actions[i].name == action as String) { action = view.actions[i]; continue; }
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
// 2) If action is already active, skip it
|
|
460
|
+
if (action.isActive) { return; }
|
|
461
|
+
|
|
462
|
+
if (!action.isPrepared) { beforeAction(action, callBackAction, delay); }
|
|
463
|
+
|
|
464
|
+
// 3) If the action isn't yet prepared, skip it, and on the call back run straight through
|
|
465
|
+
if (!action.isPrepared) {
|
|
466
|
+
prepareForAction(action.preparationActions, action, delay);
|
|
467
|
+
action.isPrepared = true;
|
|
468
|
+
// jump out of the method so you can have time to execute other methods and then come back.
|
|
469
|
+
return;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
// 4) Figure out if the target is an index, renderer, or data item
|
|
473
|
+
var view:UIComponent;
|
|
474
|
+
if (target is int) { view = getRendererForItemAt(target as int); }
|
|
475
|
+
else if (target is UIComponent) { view = target as UIComponent; }
|
|
476
|
+
else { view = itemToRenderer[target]; }
|
|
477
|
+
|
|
478
|
+
// there may be onCompleteParams and such here. These should all be executed in a single function,
|
|
479
|
+
// in this class, call it executeTweenParams(params:Object);
|
|
480
|
+
view.tweens = action.tweens;
|
|
481
|
+
view.tween();
|
|
482
|
+
// blah blah blah
|
|
483
|
+
afterAction(target, actionName, callBackTarget, callBackAction);
|
|
484
|
+
} */
|
|
485
|
+
|
|
486
|
+
public function afterAction(action:*, callBackAction:*=null):void {
|
|
487
|
+
if (action) { action(action, callBackAction); }
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
|
|
491
|
+
|
|
492
|
+
/** Tween functions to handle transitions between NavigationEvents */
|
|
493
|
+
protected function onStart(params:Object):void {
|
|
494
|
+
executeParams(params);
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
protected function onComplete(params:Object=null):void {
|
|
498
|
+
executeParams(params);
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
/** This is where you define what can be found in that params object */
|
|
502
|
+
protected function executeParams(p:Object=null):void {
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
/**
|
|
506
|
+
* Handle view creation complete initialization
|
|
507
|
+
* Override in subclasses
|
|
508
|
+
* @param event creation complete event
|
|
509
|
+
*
|
|
510
|
+
*/
|
|
511
|
+
protected function onCreationComplete(event:FlexEvent):void
|
|
512
|
+
{
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
}
|