javascriptmvc 3.0.0.pre15
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.gitignore +21 -0
- data/README.markdown +15 -0
- data/Rakefile +17 -0
- data/VERSION +1 -0
- data/bin/jmvc-build +4 -0
- data/bin/jmvc-gen +4 -0
- data/bin/jmvc-get +4 -0
- data/bin/jmvc-init +4 -0
- data/bin/jmvc-update +4 -0
- data/lib/javascriptmvc.rb +97 -0
- data/lib/javascriptmvc/documentjs/README +0 -0
- data/lib/javascriptmvc/documentjs/add.js +76 -0
- data/lib/javascriptmvc/documentjs/application.js +285 -0
- data/lib/javascriptmvc/documentjs/attribute.js +61 -0
- data/lib/javascriptmvc/documentjs/baseclass.js +537 -0
- data/lib/javascriptmvc/documentjs/class.js +141 -0
- data/lib/javascriptmvc/documentjs/constructor.js +145 -0
- data/lib/javascriptmvc/documentjs/directives.js +394 -0
- data/lib/javascriptmvc/documentjs/distance.js +49 -0
- data/lib/javascriptmvc/documentjs/document +21 -0
- data/lib/javascriptmvc/documentjs/documentjs.js +76 -0
- data/lib/javascriptmvc/documentjs/file.js +55 -0
- data/lib/javascriptmvc/documentjs/function.js +112 -0
- data/lib/javascriptmvc/documentjs/jmvcdoc/images/close.png +0 -0
- data/lib/javascriptmvc/documentjs/jmvcdoc/images/download.png +0 -0
- data/lib/javascriptmvc/documentjs/jmvcdoc/images/fav-off.png +0 -0
- data/lib/javascriptmvc/documentjs/jmvcdoc/images/fav-on.png +0 -0
- data/lib/javascriptmvc/documentjs/jmvcdoc/images/favicon.ico +0 -0
- data/lib/javascriptmvc/documentjs/jmvcdoc/images/logo.png +0 -0
- data/lib/javascriptmvc/documentjs/jmvcdoc/images/pre.png +0 -0
- data/lib/javascriptmvc/documentjs/jmvcdoc/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/lib/javascriptmvc/documentjs/jmvcdoc/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/lib/javascriptmvc/documentjs/jmvcdoc/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/lib/javascriptmvc/documentjs/jmvcdoc/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/lib/javascriptmvc/documentjs/jmvcdoc/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/lib/javascriptmvc/documentjs/jmvcdoc/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/lib/javascriptmvc/documentjs/jmvcdoc/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/lib/javascriptmvc/documentjs/jmvcdoc/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/lib/javascriptmvc/documentjs/jmvcdoc/images/ui-icons_222222_256x240.png +0 -0
- data/lib/javascriptmvc/documentjs/jmvcdoc/images/ui-icons_2e83ff_256x240.png +0 -0
- data/lib/javascriptmvc/documentjs/jmvcdoc/images/ui-icons_454545_256x240.png +0 -0
- data/lib/javascriptmvc/documentjs/jmvcdoc/images/ui-icons_888888_256x240.png +0 -0
- data/lib/javascriptmvc/documentjs/jmvcdoc/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/lib/javascriptmvc/documentjs/jmvcdoc/images/video.png +0 -0
- data/lib/javascriptmvc/documentjs/jmvcdoc/production.js +552 -0
- data/lib/javascriptmvc/documentjs/jmvcdoc/style.css +354 -0
- data/lib/javascriptmvc/documentjs/jmvcdoc/summary.ejs +134 -0
- data/lib/javascriptmvc/documentjs/json.js +172 -0
- data/lib/javascriptmvc/documentjs/page.js +107 -0
- data/lib/javascriptmvc/documentjs/pair.js +302 -0
- data/lib/javascriptmvc/documentjs/prototype.js +13 -0
- data/lib/javascriptmvc/documentjs/scripts/build.js +6 -0
- data/lib/javascriptmvc/documentjs/static.js +25 -0
- data/lib/javascriptmvc/documentjs/test/docs/Something.json +1 -0
- data/lib/javascriptmvc/documentjs/test/docs/searchData.json +1 -0
- data/lib/javascriptmvc/documentjs/test/something.js +8 -0
- data/lib/javascriptmvc/documentjs/test/test.html +6 -0
- data/lib/javascriptmvc/documentjs/test_doc.html +1 -0
- data/lib/javascriptmvc/documentjs/update +5 -0
- data/lib/javascriptmvc/funcunit/README +17 -0
- data/lib/javascriptmvc/funcunit/autosuggest/auto_suggest.js +495 -0
- data/lib/javascriptmvc/funcunit/autosuggest/autosuggest.css +24 -0
- data/lib/javascriptmvc/funcunit/autosuggest/autosuggest.html +26 -0
- data/lib/javascriptmvc/funcunit/autosuggest/autosuggest.js +17 -0
- data/lib/javascriptmvc/funcunit/autosuggest/autosuggest_test.js +14 -0
- data/lib/javascriptmvc/funcunit/autosuggest/funcunit.html +15 -0
- data/lib/javascriptmvc/funcunit/build.js +54 -0
- data/lib/javascriptmvc/funcunit/drivers/selenium.js +129 -0
- data/lib/javascriptmvc/funcunit/drivers/standard.js +169 -0
- data/lib/javascriptmvc/funcunit/envjs +13 -0
- data/lib/javascriptmvc/funcunit/envjs.bat +28 -0
- data/lib/javascriptmvc/funcunit/funcunit.html +20 -0
- data/lib/javascriptmvc/funcunit/funcunit.js +1509 -0
- data/lib/javascriptmvc/funcunit/java/selenium-java-client-driver.jar +0 -0
- data/lib/javascriptmvc/funcunit/java/selenium-server.jar +0 -0
- data/lib/javascriptmvc/funcunit/qunit.html +22 -0
- data/lib/javascriptmvc/funcunit/qunit/qunit.css +119 -0
- data/lib/javascriptmvc/funcunit/qunit/qunit.js +1124 -0
- data/lib/javascriptmvc/funcunit/qunit/rhino/rhino.js +24 -0
- data/lib/javascriptmvc/funcunit/qunit/test/qunit.html +18 -0
- data/lib/javascriptmvc/funcunit/qunit/test/test.js +7 -0
- data/lib/javascriptmvc/funcunit/resources/funcunit.js +31 -0
- data/lib/javascriptmvc/funcunit/resources/jquery.js +6378 -0
- data/lib/javascriptmvc/funcunit/resources/json.js +201 -0
- data/lib/javascriptmvc/funcunit/resources/selenium_start.js +43 -0
- data/lib/javascriptmvc/funcunit/scripts/run.js +36 -0
- data/lib/javascriptmvc/funcunit/scripts/test.js +55 -0
- data/lib/javascriptmvc/funcunit/settings.js +10 -0
- data/lib/javascriptmvc/funcunit/synthetic/browsers.js +151 -0
- data/lib/javascriptmvc/funcunit/synthetic/demo.html +150 -0
- data/lib/javascriptmvc/funcunit/synthetic/demo/record.js +254 -0
- data/lib/javascriptmvc/funcunit/synthetic/drag/drag.html +41 -0
- data/lib/javascriptmvc/funcunit/synthetic/drag/drag.js +268 -0
- data/lib/javascriptmvc/funcunit/synthetic/drag/qunit.html +20 -0
- data/lib/javascriptmvc/funcunit/synthetic/drag/test/qunit/drag_test.js +195 -0
- data/lib/javascriptmvc/funcunit/synthetic/drag/test/qunit/qunit.js +7 -0
- data/lib/javascriptmvc/funcunit/synthetic/key.js +832 -0
- data/lib/javascriptmvc/funcunit/synthetic/mouse.js +291 -0
- data/lib/javascriptmvc/funcunit/synthetic/qunit.html +22 -0
- data/lib/javascriptmvc/funcunit/synthetic/recorder.html +303 -0
- data/lib/javascriptmvc/funcunit/synthetic/synthetic.html +85 -0
- data/lib/javascriptmvc/funcunit/synthetic/synthetic.js +796 -0
- data/lib/javascriptmvc/funcunit/synthetic/test/qunit/key_test.js +391 -0
- data/lib/javascriptmvc/funcunit/synthetic/test/qunit/mouse_test.js +233 -0
- data/lib/javascriptmvc/funcunit/synthetic/test/qunit/qunit.js +6 -0
- data/lib/javascriptmvc/funcunit/synthetic/test/qunit/synthetic_test.js +91 -0
- data/lib/javascriptmvc/funcunit/synthetic/test/submit.html +29 -0
- data/lib/javascriptmvc/funcunit/synthetic/test/submitted.html +3 -0
- data/lib/javascriptmvc/funcunit/template.html +18 -0
- data/lib/javascriptmvc/funcunit/test/drag.html +63 -0
- data/lib/javascriptmvc/funcunit/test/funcunit/funcunit.js +3 -0
- data/lib/javascriptmvc/funcunit/test/funcunit/funcunit_test.js +87 -0
- data/lib/javascriptmvc/funcunit/test/funcunit/open_test.js +28 -0
- data/lib/javascriptmvc/funcunit/test/funcunit/protodrag_test.js +13 -0
- data/lib/javascriptmvc/funcunit/test/funcunit/syn_test.js +41 -0
- data/lib/javascriptmvc/funcunit/test/jquery.event.drag.js +801 -0
- data/lib/javascriptmvc/funcunit/test/jquery.event.drop.js +439 -0
- data/lib/javascriptmvc/funcunit/test/jquery.js +6360 -0
- data/lib/javascriptmvc/funcunit/test/myapp.html +103 -0
- data/lib/javascriptmvc/funcunit/test/myotherapp.html +15 -0
- data/lib/javascriptmvc/funcunit/test/protodrag/dragdrop.js +974 -0
- data/lib/javascriptmvc/funcunit/test/protodrag/effects.js +1123 -0
- data/lib/javascriptmvc/funcunit/test/protodrag/funcunit_test.js +20 -0
- data/lib/javascriptmvc/funcunit/test/protodrag/myapp.html +63 -0
- data/lib/javascriptmvc/funcunit/test/protodrag/prototype.js +4874 -0
- data/lib/javascriptmvc/funcunit/test/protodrag/scriptaculous.js +68 -0
- data/lib/javascriptmvc/funcunit/update +5 -0
- data/lib/javascriptmvc/jquery/README +24 -0
- data/lib/javascriptmvc/jquery/build.js +73 -0
- data/lib/javascriptmvc/jquery/class/class.html +109 -0
- data/lib/javascriptmvc/jquery/class/class.js +627 -0
- data/lib/javascriptmvc/jquery/class/qunit.html +15 -0
- data/lib/javascriptmvc/jquery/class/test/qunit/class_test.js +146 -0
- data/lib/javascriptmvc/jquery/class/test/qunit/qunit.js +5 -0
- data/lib/javascriptmvc/jquery/class/test/qunit/test.html +20 -0
- data/lib/javascriptmvc/jquery/controller/controller.html +89 -0
- data/lib/javascriptmvc/jquery/controller/controller.js +735 -0
- data/lib/javascriptmvc/jquery/controller/history/history.html +44 -0
- data/lib/javascriptmvc/jquery/controller/history/history.js +177 -0
- data/lib/javascriptmvc/jquery/controller/qunit.html +21 -0
- data/lib/javascriptmvc/jquery/controller/subscribe/funcunit.html +21 -0
- data/lib/javascriptmvc/jquery/controller/subscribe/scripts/compress.js +6 -0
- data/lib/javascriptmvc/jquery/controller/subscribe/scripts/docs.js +6 -0
- data/lib/javascriptmvc/jquery/controller/subscribe/subscribe.html +56 -0
- data/lib/javascriptmvc/jquery/controller/subscribe/subscribe.js +27 -0
- data/lib/javascriptmvc/jquery/controller/subscribe/test/funcunit/funcunit.js +3 -0
- data/lib/javascriptmvc/jquery/controller/subscribe/test/funcunit/run.js +10 -0
- data/lib/javascriptmvc/jquery/controller/subscribe/test/funcunit/subscribe_test.js +11 -0
- data/lib/javascriptmvc/jquery/controller/subscribe/test/qunit/qunit.html +21 -0
- data/lib/javascriptmvc/jquery/controller/subscribe/test/qunit/qunit.js +9 -0
- data/lib/javascriptmvc/jquery/controller/subscribe/test/qunit/run.js +2 -0
- data/lib/javascriptmvc/jquery/controller/subscribe/test/qunit/subscribe_test.js +4 -0
- data/lib/javascriptmvc/jquery/controller/test/qunit/controller_test.js +170 -0
- data/lib/javascriptmvc/jquery/controller/test/qunit/qunit.js +9 -0
- data/lib/javascriptmvc/jquery/controller/view/qunit.html +21 -0
- data/lib/javascriptmvc/jquery/controller/view/test/qunit/controller_view_test.js +15 -0
- data/lib/javascriptmvc/jquery/controller/view/test/qunit/qunit.js +6 -0
- data/lib/javascriptmvc/jquery/controller/view/test/qunit/views/init.micro +1 -0
- data/lib/javascriptmvc/jquery/controller/view/view.js +102 -0
- data/lib/javascriptmvc/jquery/dom/closest/closest.html +23 -0
- data/lib/javascriptmvc/jquery/dom/closest/closest.js +47 -0
- data/lib/javascriptmvc/jquery/dom/closest/funcunit.html +20 -0
- data/lib/javascriptmvc/jquery/dom/closest/qunit.html +22 -0
- data/lib/javascriptmvc/jquery/dom/closest/scripts/compress.js +3 -0
- data/lib/javascriptmvc/jquery/dom/closest/scripts/doc.js +4 -0
- data/lib/javascriptmvc/jquery/dom/closest/scripts/test.js +55 -0
- data/lib/javascriptmvc/jquery/dom/closest/settings.js +40 -0
- data/lib/javascriptmvc/jquery/dom/closest/test/funcunit/funcunit.js +3 -0
- data/lib/javascriptmvc/jquery/dom/closest/test/funcunit/tests/basic.js +11 -0
- data/lib/javascriptmvc/jquery/dom/closest/test/qunit/qunit.js +4 -0
- data/lib/javascriptmvc/jquery/dom/closest/test/qunit/tests/basic.js +4 -0
- data/lib/javascriptmvc/jquery/dom/compare/compare.html +88 -0
- data/lib/javascriptmvc/jquery/dom/compare/compare.js +67 -0
- data/lib/javascriptmvc/jquery/dom/compare/qunit.html +20 -0
- data/lib/javascriptmvc/jquery/dom/compare/test/qunit/compare_test.js +19 -0
- data/lib/javascriptmvc/jquery/dom/compare/test/qunit/qunit.js +5 -0
- data/lib/javascriptmvc/jquery/dom/cookie/cookie.html +25 -0
- data/lib/javascriptmvc/jquery/dom/cookie/cookie.js +119 -0
- data/lib/javascriptmvc/jquery/dom/cookie/scripts/compress.js +6 -0
- data/lib/javascriptmvc/jquery/dom/cookie/scripts/doc.js +6 -0
- data/lib/javascriptmvc/jquery/dom/cookie/test/funcunit/cookie_test.js +11 -0
- data/lib/javascriptmvc/jquery/dom/cookie/test/funcunit/funcunit.html +21 -0
- data/lib/javascriptmvc/jquery/dom/cookie/test/funcunit/funcunit.js +3 -0
- data/lib/javascriptmvc/jquery/dom/cookie/test/funcunit/run.js +10 -0
- data/lib/javascriptmvc/jquery/dom/cookie/test/qunit/cookie_test.js +4 -0
- data/lib/javascriptmvc/jquery/dom/cookie/test/qunit/qunit.html +21 -0
- data/lib/javascriptmvc/jquery/dom/cookie/test/qunit/qunit.js +9 -0
- data/lib/javascriptmvc/jquery/dom/cookie/test/qunit/run.js +2 -0
- data/lib/javascriptmvc/jquery/dom/cur_styles/cur_styles.html +71 -0
- data/lib/javascriptmvc/jquery/dom/cur_styles/cur_styles.js +120 -0
- data/lib/javascriptmvc/jquery/dom/cur_styles/qunit.html +22 -0
- data/lib/javascriptmvc/jquery/dom/cur_styles/test/qunit/curStyles.micro +3 -0
- data/lib/javascriptmvc/jquery/dom/cur_styles/test/qunit/cur_styles_test.js +22 -0
- data/lib/javascriptmvc/jquery/dom/cur_styles/test/qunit/outer.micro +0 -0
- data/lib/javascriptmvc/jquery/dom/cur_styles/test/qunit/qunit.js +4 -0
- data/lib/javascriptmvc/jquery/dom/dimensions/curstyles.html +22 -0
- data/lib/javascriptmvc/jquery/dom/dimensions/dimensions.html +132 -0
- data/lib/javascriptmvc/jquery/dom/dimensions/dimensions.js +140 -0
- data/lib/javascriptmvc/jquery/dom/dimensions/qunit.html +22 -0
- data/lib/javascriptmvc/jquery/dom/dimensions/test/qunit/curStyles.micro +3 -0
- data/lib/javascriptmvc/jquery/dom/dimensions/test/qunit/dimensions_test.js +8 -0
- data/lib/javascriptmvc/jquery/dom/dimensions/test/qunit/outer.micro +0 -0
- data/lib/javascriptmvc/jquery/dom/dimensions/test/qunit/qunit.js +4 -0
- data/lib/javascriptmvc/jquery/dom/dom.js +7 -0
- data/lib/javascriptmvc/jquery/dom/fixture/fixture.html +143 -0
- data/lib/javascriptmvc/jquery/dom/fixture/fixture.js +521 -0
- data/lib/javascriptmvc/jquery/dom/fixture/fixtures/messages.html +31 -0
- data/lib/javascriptmvc/jquery/dom/fixture/fixtures/test.json +3 -0
- data/lib/javascriptmvc/jquery/dom/fixture/qunit.html +22 -0
- data/lib/javascriptmvc/jquery/dom/fixture/test/qunit/fixture_test.js +50 -0
- data/lib/javascriptmvc/jquery/dom/fixture/test/qunit/qunit.js +4 -0
- data/lib/javascriptmvc/jquery/dom/form_params/form_params.html +57 -0
- data/lib/javascriptmvc/jquery/dom/form_params/form_params.js +106 -0
- data/lib/javascriptmvc/jquery/dom/form_params/qunit.html +22 -0
- data/lib/javascriptmvc/jquery/dom/form_params/test/qunit/basics.micro +27 -0
- data/lib/javascriptmvc/jquery/dom/form_params/test/qunit/checkbox.micro +20 -0
- data/lib/javascriptmvc/jquery/dom/form_params/test/qunit/form_params_test.js +43 -0
- data/lib/javascriptmvc/jquery/dom/form_params/test/qunit/qunit.js +4 -0
- data/lib/javascriptmvc/jquery/dom/form_params/test/qunit/truthy.micro +8 -0
- data/lib/javascriptmvc/jquery/dom/within/within.js +67 -0
- data/lib/javascriptmvc/jquery/error/background.png +0 -0
- data/lib/javascriptmvc/jquery/error/error.html +31 -0
- data/lib/javascriptmvc/jquery/error/error.js +227 -0
- data/lib/javascriptmvc/jquery/error/setup.js +4 -0
- data/lib/javascriptmvc/jquery/error/test/test.html +23 -0
- data/lib/javascriptmvc/jquery/error/test/test.js +4 -0
- data/lib/javascriptmvc/jquery/event/default/compress.js +7 -0
- data/lib/javascriptmvc/jquery/event/default/default.html +85 -0
- data/lib/javascriptmvc/jquery/event/default/default.js +193 -0
- data/lib/javascriptmvc/jquery/event/default/defaultjquery.html +117 -0
- data/lib/javascriptmvc/jquery/event/default/qunit.html +22 -0
- data/lib/javascriptmvc/jquery/event/default/test/qunit/default_test.js +104 -0
- data/lib/javascriptmvc/jquery/event/default/test/qunit/html.micro +8 -0
- data/lib/javascriptmvc/jquery/event/default/test/qunit/qunit.js +6 -0
- data/lib/javascriptmvc/jquery/event/default/test/qunit/run.js +2 -0
- data/lib/javascriptmvc/jquery/event/destroyed/destroyed.html +24 -0
- data/lib/javascriptmvc/jquery/event/destroyed/destroyed.js +40 -0
- data/lib/javascriptmvc/jquery/event/destroyed/destroyed_menu.html +96 -0
- data/lib/javascriptmvc/jquery/event/destroyed/qunit.html +21 -0
- data/lib/javascriptmvc/jquery/event/destroyed/test/qunit/destroyed_test.js +12 -0
- data/lib/javascriptmvc/jquery/event/destroyed/test/qunit/qunit.js +6 -0
- data/lib/javascriptmvc/jquery/event/drag/drag.html +105 -0
- data/lib/javascriptmvc/jquery/event/drag/drag.js +466 -0
- data/lib/javascriptmvc/jquery/event/drag/limit/limit.html +74 -0
- data/lib/javascriptmvc/jquery/event/drag/limit/limit.js +56 -0
- data/lib/javascriptmvc/jquery/event/drag/limit/scripts/compress.js +6 -0
- data/lib/javascriptmvc/jquery/event/drag/limit/scripts/doc.js +6 -0
- data/lib/javascriptmvc/jquery/event/drag/limit/test/funcunit/funcunit.html +21 -0
- data/lib/javascriptmvc/jquery/event/drag/limit/test/funcunit/funcunit.js +3 -0
- data/lib/javascriptmvc/jquery/event/drag/limit/test/funcunit/limit_test.js +11 -0
- data/lib/javascriptmvc/jquery/event/drag/limit/test/funcunit/run.js +10 -0
- data/lib/javascriptmvc/jquery/event/drag/limit/test/qunit/limit_test.js +4 -0
- data/lib/javascriptmvc/jquery/event/drag/limit/test/qunit/qunit.html +21 -0
- data/lib/javascriptmvc/jquery/event/drag/limit/test/qunit/qunit.js +9 -0
- data/lib/javascriptmvc/jquery/event/drag/limit/test/qunit/run.js +2 -0
- data/lib/javascriptmvc/jquery/event/drag/qunit.html +16 -0
- data/lib/javascriptmvc/jquery/event/drag/scroll/scroll.js +120 -0
- data/lib/javascriptmvc/jquery/event/drag/test/qunit/drag_test.js +130 -0
- data/lib/javascriptmvc/jquery/event/drag/test/qunit/qunit.js +4 -0
- data/lib/javascriptmvc/jquery/event/drop/drop.html +74 -0
- data/lib/javascriptmvc/jquery/event/drop/drop.js +301 -0
- data/lib/javascriptmvc/jquery/event/event.js +6 -0
- data/lib/javascriptmvc/jquery/event/hashchange/hashchange.js +245 -0
- data/lib/javascriptmvc/jquery/event/hover/compress.js +7 -0
- data/lib/javascriptmvc/jquery/event/hover/hover.html +56 -0
- data/lib/javascriptmvc/jquery/event/hover/hover.js +219 -0
- data/lib/javascriptmvc/jquery/event/hover/qunit.html +16 -0
- data/lib/javascriptmvc/jquery/event/hover/test/qunit/hover_test.js +55 -0
- data/lib/javascriptmvc/jquery/event/hover/test/qunit/qunit.js +4 -0
- data/lib/javascriptmvc/jquery/event/livehack/compress.js +7 -0
- data/lib/javascriptmvc/jquery/event/livehack/funcunit.html +21 -0
- data/lib/javascriptmvc/jquery/event/livehack/livehack.html +25 -0
- data/lib/javascriptmvc/jquery/event/livehack/livehack.js +167 -0
- data/lib/javascriptmvc/jquery/event/offline/funcunit.html +20 -0
- data/lib/javascriptmvc/jquery/event/offline/offline.html +26 -0
- data/lib/javascriptmvc/jquery/event/offline/offline.js +36 -0
- data/lib/javascriptmvc/jquery/event/offline/qunit.html +22 -0
- data/lib/javascriptmvc/jquery/event/offline/scripts/compress.js +3 -0
- data/lib/javascriptmvc/jquery/event/offline/scripts/doc.js +4 -0
- data/lib/javascriptmvc/jquery/event/offline/settings.js +41 -0
- data/lib/javascriptmvc/jquery/event/offline/test/funcunit/funcunit.js +3 -0
- data/lib/javascriptmvc/jquery/event/offline/test/funcunit/tests/basic.js +11 -0
- data/lib/javascriptmvc/jquery/event/offline/test/qunit/qunit.js +4 -0
- data/lib/javascriptmvc/jquery/event/offline/test/qunit/tests/basic.js +4 -0
- data/lib/javascriptmvc/jquery/event/resize/funcunit.html +20 -0
- data/lib/javascriptmvc/jquery/event/resize/qunit.html +22 -0
- data/lib/javascriptmvc/jquery/event/resize/resize.html +23 -0
- data/lib/javascriptmvc/jquery/event/resize/resize.js +50 -0
- data/lib/javascriptmvc/jquery/event/resize/scripts/compress.js +3 -0
- data/lib/javascriptmvc/jquery/event/resize/scripts/doc.js +4 -0
- data/lib/javascriptmvc/jquery/event/resize/scripts/test.js +55 -0
- data/lib/javascriptmvc/jquery/event/resize/settings.js +40 -0
- data/lib/javascriptmvc/jquery/event/resize/test/funcunit/funcunit.js +3 -0
- data/lib/javascriptmvc/jquery/event/resize/test/funcunit/tests/basic.js +11 -0
- data/lib/javascriptmvc/jquery/event/resize/test/qunit/qunit.js +4 -0
- data/lib/javascriptmvc/jquery/event/resize/test/qunit/tests/basic.js +4 -0
- data/lib/javascriptmvc/jquery/event/select/scripts/compress.js +6 -0
- data/lib/javascriptmvc/jquery/event/select/scripts/doc.js +6 -0
- data/lib/javascriptmvc/jquery/event/select/select.html +63 -0
- data/lib/javascriptmvc/jquery/event/select/select.js +65 -0
- data/lib/javascriptmvc/jquery/event/select/test/funcunit/funcunit.html +21 -0
- data/lib/javascriptmvc/jquery/event/select/test/funcunit/funcunit.js +3 -0
- data/lib/javascriptmvc/jquery/event/select/test/funcunit/run.js +10 -0
- data/lib/javascriptmvc/jquery/event/select/test/funcunit/select_test.js +11 -0
- data/lib/javascriptmvc/jquery/event/select/test/qunit/qunit.html +21 -0
- data/lib/javascriptmvc/jquery/event/select/test/qunit/qunit.js +5 -0
- data/lib/javascriptmvc/jquery/event/select/test/qunit/run.js +2 -0
- data/lib/javascriptmvc/jquery/event/select/test/qunit/select_test.js +4 -0
- data/lib/javascriptmvc/jquery/generate/app +23 -0
- data/lib/javascriptmvc/jquery/generate/controller +21 -0
- data/lib/javascriptmvc/jquery/generate/model +26 -0
- data/lib/javascriptmvc/jquery/generate/page +20 -0
- data/lib/javascriptmvc/jquery/generate/plugin +20 -0
- data/lib/javascriptmvc/jquery/generate/scaffold +23 -0
- data/lib/javascriptmvc/jquery/generate/templates/app/(application_name).css.ejs +4 -0
- data/lib/javascriptmvc/jquery/generate/templates/app/(application_name).html.ejs +23 -0
- data/lib/javascriptmvc/jquery/generate/templates/app/(application_name).js.ejs +21 -0
- data/lib/javascriptmvc/jquery/generate/templates/app/controllers/.ignore +0 -0
- data/lib/javascriptmvc/jquery/generate/templates/app/docs/.ignore +0 -0
- data/lib/javascriptmvc/jquery/generate/templates/app/fixtures/.ignore +0 -0
- data/lib/javascriptmvc/jquery/generate/templates/app/funcunit.html.ejs +15 -0
- data/lib/javascriptmvc/jquery/generate/templates/app/models/.ignore +0 -0
- data/lib/javascriptmvc/jquery/generate/templates/app/qunit.html.ejs +20 -0
- data/lib/javascriptmvc/jquery/generate/templates/app/resources/.ignore +0 -0
- data/lib/javascriptmvc/jquery/generate/templates/app/scripts/build.js.ejs +6 -0
- data/lib/javascriptmvc/jquery/generate/templates/app/scripts/clean.js.ejs +6 -0
- data/lib/javascriptmvc/jquery/generate/templates/app/scripts/docs.js.ejs +4 -0
- data/lib/javascriptmvc/jquery/generate/templates/app/test/funcunit/(application_name)_test.js.ejs +9 -0
- data/lib/javascriptmvc/jquery/generate/templates/app/test/funcunit/funcunit.js.ejs +3 -0
- data/lib/javascriptmvc/jquery/generate/templates/app/test/qunit/(application_name)_test.js.ejs +5 -0
- data/lib/javascriptmvc/jquery/generate/templates/app/test/qunit/qunit.js.ejs +3 -0
- data/lib/javascriptmvc/jquery/generate/templates/app/views/.ignore +0 -0
- data/lib/javascriptmvc/jquery/generate/templates/controller/controllers/(underscore)_controller.js.ejs +12 -0
- data/lib/javascriptmvc/jquery/generate/templates/model/fixtures.link +1 -0
- data/lib/javascriptmvc/jquery/generate/templates/model/models.link +1 -0
- data/lib/javascriptmvc/jquery/generate/templates/model/test/qunit.link +1 -0
- data/lib/javascriptmvc/jquery/generate/templates/page.ejs +23 -0
- data/lib/javascriptmvc/jquery/generate/templates/plugin/(application_name).html.ejs +23 -0
- data/lib/javascriptmvc/jquery/generate/templates/plugin/(application_name).js.ejs +3 -0
- data/lib/javascriptmvc/jquery/generate/templates/plugin/fixtures/.ignore +0 -0
- data/lib/javascriptmvc/jquery/generate/templates/plugin/funcunit.html.ejs +15 -0
- data/lib/javascriptmvc/jquery/generate/templates/plugin/qunit.html.ejs +20 -0
- data/lib/javascriptmvc/jquery/generate/templates/plugin/resources/.ignore +0 -0
- data/lib/javascriptmvc/jquery/generate/templates/plugin/scripts.link +1 -0
- data/lib/javascriptmvc/jquery/generate/templates/plugin/test.link +1 -0
- data/lib/javascriptmvc/jquery/generate/templates/plugin/views/.ignore +0 -0
- data/lib/javascriptmvc/jquery/generate/templates/scaffold/controllers/(underscore)_controller.js.ejs +96 -0
- data/lib/javascriptmvc/jquery/generate/templates/scaffold/fixtures/(plural).json.get.ejs +3 -0
- data/lib/javascriptmvc/jquery/generate/templates/scaffold/models/(underscore).js.ejs +83 -0
- data/lib/javascriptmvc/jquery/generate/templates/scaffold/test/funcunit/(underscore)_controller_test.js.ejs +63 -0
- data/lib/javascriptmvc/jquery/generate/templates/scaffold/test/qunit/(underscore)_test.js.ejs +45 -0
- data/lib/javascriptmvc/jquery/generate/templates/scaffold/views/(underscore)/edit.ejs.ejs +10 -0
- data/lib/javascriptmvc/jquery/generate/templates/scaffold/views/(underscore)/init.ejs.ejs +26 -0
- data/lib/javascriptmvc/jquery/generate/templates/scaffold/views/(underscore)/list.ejs.ejs +5 -0
- data/lib/javascriptmvc/jquery/generate/templates/scaffold/views/(underscore)/show.ejs.ejs +10 -0
- data/lib/javascriptmvc/jquery/jquery.js +6360 -0
- data/lib/javascriptmvc/jquery/lang/json/json.html +25 -0
- data/lib/javascriptmvc/jquery/lang/json/json.js +201 -0
- data/lib/javascriptmvc/jquery/lang/json/scripts/compress.js +6 -0
- data/lib/javascriptmvc/jquery/lang/json/scripts/doc.js +6 -0
- data/lib/javascriptmvc/jquery/lang/json/test/funcunit/funcunit.html +21 -0
- data/lib/javascriptmvc/jquery/lang/json/test/funcunit/funcunit.js +3 -0
- data/lib/javascriptmvc/jquery/lang/json/test/funcunit/json_test.js +11 -0
- data/lib/javascriptmvc/jquery/lang/json/test/funcunit/run.js +10 -0
- data/lib/javascriptmvc/jquery/lang/json/test/qunit/json_test.js +4 -0
- data/lib/javascriptmvc/jquery/lang/json/test/qunit/qunit.html +21 -0
- data/lib/javascriptmvc/jquery/lang/json/test/qunit/qunit.js +9 -0
- data/lib/javascriptmvc/jquery/lang/json/test/qunit/run.js +2 -0
- data/lib/javascriptmvc/jquery/lang/lang.html +27 -0
- data/lib/javascriptmvc/jquery/lang/lang.js +104 -0
- data/lib/javascriptmvc/jquery/lang/openajax/openajax.js +202 -0
- data/lib/javascriptmvc/jquery/lang/rsplit/rsplit.js +31 -0
- data/lib/javascriptmvc/jquery/lang/vector/vector.js +167 -0
- data/lib/javascriptmvc/jquery/model/associations/associations.html +25 -0
- data/lib/javascriptmvc/jquery/model/associations/associations.js +46 -0
- data/lib/javascriptmvc/jquery/model/associations/qunit.html +21 -0
- data/lib/javascriptmvc/jquery/model/associations/test/qunit/associations_test.js +51 -0
- data/lib/javascriptmvc/jquery/model/associations/test/qunit/qunit.js +9 -0
- data/lib/javascriptmvc/jquery/model/associations/test/qunit/run.js +2 -0
- data/lib/javascriptmvc/jquery/model/backup/backup.js +82 -0
- data/lib/javascriptmvc/jquery/model/json_rest/json_rest.js +91 -0
- data/lib/javascriptmvc/jquery/model/list/list.js +148 -0
- data/lib/javascriptmvc/jquery/model/list/qunit.html +16 -0
- data/lib/javascriptmvc/jquery/model/list/test/qunit/list_test.js +58 -0
- data/lib/javascriptmvc/jquery/model/list/test/qunit/qunit.js +6 -0
- data/lib/javascriptmvc/jquery/model/list/test/qunit/run.js +0 -0
- data/lib/javascriptmvc/jquery/model/model.js +537 -0
- data/lib/javascriptmvc/jquery/model/qunit.html +17 -0
- data/lib/javascriptmvc/jquery/model/store/store.js +66 -0
- data/lib/javascriptmvc/jquery/model/test/qunit/model_test.js +71 -0
- data/lib/javascriptmvc/jquery/model/test/qunit/qunit.js +5 -0
- data/lib/javascriptmvc/jquery/qunit.html +15 -0
- data/lib/javascriptmvc/jquery/test/funcunit/funcunit.html +21 -0
- data/lib/javascriptmvc/jquery/test/funcunit/funcunit.js +3 -0
- data/lib/javascriptmvc/jquery/test/funcunit/jquerytest_test.js +11 -0
- data/lib/javascriptmvc/jquery/test/funcunit/run.js +10 -0
- data/lib/javascriptmvc/jquery/test/qunit/qunit.js +22 -0
- data/lib/javascriptmvc/jquery/update +5 -0
- data/lib/javascriptmvc/jquery/view/compress.js +7 -0
- data/lib/javascriptmvc/jquery/view/ejs/ejs.html +25 -0
- data/lib/javascriptmvc/jquery/view/ejs/ejs.js +489 -0
- data/lib/javascriptmvc/jquery/view/ejs/funcunit.html +21 -0
- data/lib/javascriptmvc/jquery/view/ejs/test/funcunit/ejs_test.js +11 -0
- data/lib/javascriptmvc/jquery/view/ejs/test/funcunit/funcunit.js +3 -0
- data/lib/javascriptmvc/jquery/view/ejs/test/funcunit/run.js +10 -0
- data/lib/javascriptmvc/jquery/view/ejs/test/qunit/ejs_test.js +4 -0
- data/lib/javascriptmvc/jquery/view/ejs/test/qunit/qunit.html +21 -0
- data/lib/javascriptmvc/jquery/view/ejs/test/qunit/qunit.js +9 -0
- data/lib/javascriptmvc/jquery/view/ejs/test/qunit/run.js +2 -0
- data/lib/javascriptmvc/jquery/view/fulljslint.js +3774 -0
- data/lib/javascriptmvc/jquery/view/helpers/helpers.js +338 -0
- data/lib/javascriptmvc/jquery/view/jaml/compress.js +7 -0
- data/lib/javascriptmvc/jquery/view/jaml/funcunit.html +21 -0
- data/lib/javascriptmvc/jquery/view/jaml/jaml.html +25 -0
- data/lib/javascriptmvc/jquery/view/jaml/jaml.js +73 -0
- data/lib/javascriptmvc/jquery/view/jaml/node.js +149 -0
- data/lib/javascriptmvc/jquery/view/jaml/template.js +131 -0
- data/lib/javascriptmvc/jquery/view/jaml/test/funcunit/funcunit.js +3 -0
- data/lib/javascriptmvc/jquery/view/jaml/test/funcunit/jaml_test.js +11 -0
- data/lib/javascriptmvc/jquery/view/jaml/test/funcunit/run.js +10 -0
- data/lib/javascriptmvc/jquery/view/jaml/test/qunit/jaml_test.js +4 -0
- data/lib/javascriptmvc/jquery/view/jaml/test/qunit/qunit.html +21 -0
- data/lib/javascriptmvc/jquery/view/jaml/test/qunit/qunit.js +9 -0
- data/lib/javascriptmvc/jquery/view/jaml/test/qunit/run.js +2 -0
- data/lib/javascriptmvc/jquery/view/micro/compress.js +7 -0
- data/lib/javascriptmvc/jquery/view/micro/funcunit.html +21 -0
- data/lib/javascriptmvc/jquery/view/micro/micro.html +25 -0
- data/lib/javascriptmvc/jquery/view/micro/micro.js +57 -0
- data/lib/javascriptmvc/jquery/view/micro/test/funcunit/funcunit.js +3 -0
- data/lib/javascriptmvc/jquery/view/micro/test/funcunit/micro_test.js +11 -0
- data/lib/javascriptmvc/jquery/view/micro/test/funcunit/run.js +10 -0
- data/lib/javascriptmvc/jquery/view/micro/test/qunit/micro_test.js +4 -0
- data/lib/javascriptmvc/jquery/view/micro/test/qunit/qunit.html +21 -0
- data/lib/javascriptmvc/jquery/view/micro/test/qunit/qunit.js +9 -0
- data/lib/javascriptmvc/jquery/view/micro/test/qunit/run.js +2 -0
- data/lib/javascriptmvc/jquery/view/qunit.html +16 -0
- data/lib/javascriptmvc/jquery/view/test/compression/compression.html +12 -0
- data/lib/javascriptmvc/jquery/view/test/compression/compression.js +11 -0
- data/lib/javascriptmvc/jquery/view/test/compression/run.js +36 -0
- data/lib/javascriptmvc/jquery/view/test/funcunit/funcunit.js +3 -0
- data/lib/javascriptmvc/jquery/view/test/funcunit/run.js +10 -0
- data/lib/javascriptmvc/jquery/view/test/funcunit/view_test.js +11 -0
- data/lib/javascriptmvc/jquery/view/test/qunit/nested_plugin.ejs +1 -0
- data/lib/javascriptmvc/jquery/view/test/qunit/plugin.ejs +1 -0
- data/lib/javascriptmvc/jquery/view/test/qunit/qunit.js +9 -0
- data/lib/javascriptmvc/jquery/view/test/qunit/template.ejs +1 -0
- data/lib/javascriptmvc/jquery/view/test/qunit/template.jaml +3 -0
- data/lib/javascriptmvc/jquery/view/test/qunit/template.micro +1 -0
- data/lib/javascriptmvc/jquery/view/test/qunit/template.tmpl +1 -0
- data/lib/javascriptmvc/jquery/view/test/qunit/view_test.js +24 -0
- data/lib/javascriptmvc/jquery/view/tmpl/tmpl.js +150 -0
- data/lib/javascriptmvc/jquery/view/view.html +65 -0
- data/lib/javascriptmvc/jquery/view/view.js +296 -0
- data/lib/javascriptmvc/js +56 -0
- data/lib/javascriptmvc/js.bat +57 -0
- data/lib/javascriptmvc/steal/README +26 -0
- data/lib/javascriptmvc/steal/build/apps/apps.js +208 -0
- data/lib/javascriptmvc/steal/build/apps/test.js +4 -0
- data/lib/javascriptmvc/steal/build/build.js +281 -0
- data/lib/javascriptmvc/steal/build/pluginify.js +73 -0
- data/lib/javascriptmvc/steal/build/scripts/compiler.jar +0 -0
- data/lib/javascriptmvc/steal/build/scripts/scripts.js +155 -0
- data/lib/javascriptmvc/steal/build/styles/cssmin.js +17 -0
- data/lib/javascriptmvc/steal/build/styles/styles.js +84 -0
- data/lib/javascriptmvc/steal/build/test/basicpage.html +6 -0
- data/lib/javascriptmvc/steal/build/test/basicproduction.js +1 -0
- data/lib/javascriptmvc/steal/build/test/basicsource.js +6 -0
- data/lib/javascriptmvc/steal/build/test/css/css/css1.css +1 -0
- data/lib/javascriptmvc/steal/build/test/css/css/justin.png +0 -0
- data/lib/javascriptmvc/steal/build/test/css/css2.css +5 -0
- data/lib/javascriptmvc/steal/build/test/css/page.html +9 -0
- data/lib/javascriptmvc/steal/build/test/css/production.css +1 -0
- data/lib/javascriptmvc/steal/build/test/css/test.js +7 -0
- data/lib/javascriptmvc/steal/build/test/css/upload.PNG +0 -0
- data/lib/javascriptmvc/steal/build/test/foreign.html +6 -0
- data/lib/javascriptmvc/steal/build/test/foreign.js +2 -0
- data/lib/javascriptmvc/steal/build/test/removecode.js +11 -0
- data/lib/javascriptmvc/steal/build/test/run.js +57 -0
- data/lib/javascriptmvc/steal/build/test/stealpage.html +10 -0
- data/lib/javascriptmvc/steal/build/test/stealprodpage.html +10 -0
- data/lib/javascriptmvc/steal/build/test/test.js +3 -0
- data/lib/javascriptmvc/steal/buildjs +21 -0
- data/lib/javascriptmvc/steal/clean/beautify.js +1108 -0
- data/lib/javascriptmvc/steal/clean/clean.js +179 -0
- data/lib/javascriptmvc/steal/clean/jslint.js +5662 -0
- data/lib/javascriptmvc/steal/clean/test.js +7 -0
- data/lib/javascriptmvc/steal/cleanjs +5 -0
- data/lib/javascriptmvc/steal/coffee/coffee-script.js +9 -0
- data/lib/javascriptmvc/steal/coffee/coffee.js +56 -0
- data/lib/javascriptmvc/steal/dev/dev.js +83 -0
- data/lib/javascriptmvc/steal/end.js +1 -0
- data/lib/javascriptmvc/steal/generate/app +23 -0
- data/lib/javascriptmvc/steal/generate/ejs.js +470 -0
- data/lib/javascriptmvc/steal/generate/generate.js +211 -0
- data/lib/javascriptmvc/steal/generate/inflector.js +117 -0
- data/lib/javascriptmvc/steal/generate/system.js +33 -0
- data/lib/javascriptmvc/steal/generate/templates/app/(application_name).css.ejs +10 -0
- data/lib/javascriptmvc/steal/generate/templates/app/(application_name).html.ejs +18 -0
- data/lib/javascriptmvc/steal/generate/templates/app/(application_name).js.ejs +10 -0
- data/lib/javascriptmvc/steal/generate/templates/app/docs/.ignore +0 -0
- data/lib/javascriptmvc/steal/generate/templates/app/resources/.ignore +0 -0
- data/lib/javascriptmvc/steal/generate/templates/app/resources/example.coffee.ejs +5 -0
- data/lib/javascriptmvc/steal/generate/templates/app/resources/example.js.ejs +13 -0
- data/lib/javascriptmvc/steal/generate/templates/app/resources/example.less.ejs +9 -0
- data/lib/javascriptmvc/steal/generate/templates/app/scripts/build.js.ejs +6 -0
- data/lib/javascriptmvc/steal/generate/templates/app/scripts/clean.js.ejs +6 -0
- data/lib/javascriptmvc/steal/generate/templates/app/test/.ignore +0 -0
- data/lib/javascriptmvc/steal/generate/templates/page.ejs +23 -0
- data/lib/javascriptmvc/steal/generate/test/test.js +92 -0
- data/lib/javascriptmvc/steal/get/get.js +163 -0
- data/lib/javascriptmvc/steal/get/gets.json +10 -0
- data/lib/javascriptmvc/steal/get/getter.js +115 -0
- data/lib/javascriptmvc/steal/get/github.js +134 -0
- data/lib/javascriptmvc/steal/get/json.js +172 -0
- data/lib/javascriptmvc/steal/getjs +5 -0
- data/lib/javascriptmvc/steal/js +56 -0
- data/lib/javascriptmvc/steal/js.bat +57 -0
- data/lib/javascriptmvc/steal/less/less.js +117 -0
- data/lib/javascriptmvc/steal/less/less_engine.js +2529 -0
- data/lib/javascriptmvc/steal/rhino/blank.html +6 -0
- data/lib/javascriptmvc/steal/rhino/build.js +31 -0
- data/lib/javascriptmvc/steal/rhino/docs.js +68 -0
- data/lib/javascriptmvc/steal/rhino/empty.html +12 -0
- data/lib/javascriptmvc/steal/rhino/env.js +11537 -0
- data/lib/javascriptmvc/steal/rhino/file.js +299 -0
- data/lib/javascriptmvc/steal/rhino/js.jar +0 -0
- data/lib/javascriptmvc/steal/rhino/loader.js +8 -0
- data/lib/javascriptmvc/steal/rhino/prompt.js +49 -0
- data/lib/javascriptmvc/steal/rhino/steal.js +122 -0
- data/lib/javascriptmvc/steal/rhino/test.js +16 -0
- data/lib/javascriptmvc/steal/steal.js +1317 -0
- data/lib/javascriptmvc/steal/steal.production.js +23 -0
- data/lib/javascriptmvc/steal/test/absoluteurl.html +7 -0
- data/lib/javascriptmvc/steal/test/absoluteurl/absoluteurl.js +1 -0
- data/lib/javascriptmvc/steal/test/absoluteurl/alert.js +1 -0
- data/lib/javascriptmvc/steal/test/another/two.js +2 -0
- data/lib/javascriptmvc/steal/test/one/four.js +1 -0
- data/lib/javascriptmvc/steal/test/one/one.js +6 -0
- data/lib/javascriptmvc/steal/test/qunit/qunit.html +22 -0
- data/lib/javascriptmvc/steal/test/qunit/qunit.js +3 -0
- data/lib/javascriptmvc/steal/test/qunit/steal_test.js +197 -0
- data/lib/javascriptmvc/steal/test/run.js +12 -0
- data/lib/javascriptmvc/steal/test/steal.html +37 -0
- data/lib/javascriptmvc/steal/test/test.js +82 -0
- data/lib/javascriptmvc/steal/test/three.js +3 -0
- data/lib/javascriptmvc/steal/testing/test.html +20 -0
- data/lib/javascriptmvc/steal/testing/testing.js +48 -0
- data/lib/javascriptmvc/steal/update +5 -0
- metadata +622 -0
@@ -0,0 +1,17 @@
|
|
1
|
+
<html>
|
2
|
+
<head>
|
3
|
+
<link rel="stylesheet" type="text/css" href="../../funcunit/qunit/qunit.css" />
|
4
|
+
</head>
|
5
|
+
<body>
|
6
|
+
|
7
|
+
<h1 id="qunit-header">Model Test Suite</h1>
|
8
|
+
<h2 id="qunit-banner"></h2>
|
9
|
+
<div id="qunit-testrunner-toolbar"></div>
|
10
|
+
<h2 id="qunit-userAgent"></h2>
|
11
|
+
<ol id="qunit-tests"></ol>
|
12
|
+
<div id="qunit-test-area"></div>
|
13
|
+
<a href='associations/qunit.html'>associations</a>
|
14
|
+
<a href='list/qunit.html'>list</a>
|
15
|
+
<script type='text/javascript' src='../../steal/steal.js?steal[app]=jquery/model/test/qunit'></script>
|
16
|
+
</body>
|
17
|
+
</html>
|
@@ -0,0 +1,66 @@
|
|
1
|
+
// provides very simple storage
|
2
|
+
// var store = new jQuery.Store();
|
3
|
+
// when its being extended, it should make a new simplestore
|
4
|
+
steal.plugins('jquery/model').then(function() {
|
5
|
+
/**
|
6
|
+
* Provides simple storage for elements. Replace this store with Gears!
|
7
|
+
*/
|
8
|
+
jQuery.Class.extend("jQuery.Model.Store", /* @prototype */ {
|
9
|
+
/**
|
10
|
+
*
|
11
|
+
* @param {Object} klass
|
12
|
+
*/
|
13
|
+
init: function( klass ) {
|
14
|
+
this._data = {};
|
15
|
+
this.storing_class = klass;
|
16
|
+
},
|
17
|
+
/**
|
18
|
+
*
|
19
|
+
* @param {Object} id
|
20
|
+
*/
|
21
|
+
findOne: function( id ) {
|
22
|
+
return id ? this._data[id] : null;
|
23
|
+
},
|
24
|
+
/**
|
25
|
+
*
|
26
|
+
* @param {Object} obj
|
27
|
+
*/
|
28
|
+
create: function( obj ) {
|
29
|
+
var id = obj[obj.Class.id];
|
30
|
+
this._data[id] = obj;
|
31
|
+
},
|
32
|
+
/**
|
33
|
+
*
|
34
|
+
* @param {Object} id
|
35
|
+
*/
|
36
|
+
destroy: function( id ) {
|
37
|
+
delete this._data[id];
|
38
|
+
},
|
39
|
+
/**
|
40
|
+
* Finds instances using a test function. If no test function is provided returns all instances.
|
41
|
+
* @param {Function} f
|
42
|
+
* @return {Array}
|
43
|
+
*/
|
44
|
+
find: function( f ) {
|
45
|
+
var instances = [];
|
46
|
+
for ( var id in this._data ) {
|
47
|
+
var inst = this._data[id];
|
48
|
+
if (!f || f(inst) ) instances.push(inst);
|
49
|
+
}
|
50
|
+
return instances;
|
51
|
+
},
|
52
|
+
/**
|
53
|
+
* Clears instances
|
54
|
+
*/
|
55
|
+
clear: function() {
|
56
|
+
this._data = {};
|
57
|
+
},
|
58
|
+
/**
|
59
|
+
* Returns if there is no instances
|
60
|
+
* @return {Boolean}
|
61
|
+
*/
|
62
|
+
isEmpty: function() {
|
63
|
+
return !this.find().length;
|
64
|
+
}
|
65
|
+
});
|
66
|
+
});
|
@@ -0,0 +1,71 @@
|
|
1
|
+
module("jquery/model", {
|
2
|
+
setup: function() {
|
3
|
+
var ids = 0;
|
4
|
+
$.Model.extend("Person",{
|
5
|
+
findAll: function( params, success, error ) {
|
6
|
+
success("findAll");
|
7
|
+
},
|
8
|
+
findOne: function( params, success, error ) {
|
9
|
+
success("findOne");
|
10
|
+
},
|
11
|
+
create: function( params, success, error ) {
|
12
|
+
success({zoo: "zed", id: (++ids)},"create");
|
13
|
+
},
|
14
|
+
destroy: function( id, success, error ) {
|
15
|
+
success("destroy");
|
16
|
+
},
|
17
|
+
update: function( id, attrs, success, error ) {
|
18
|
+
success({zoo: "monkeys"},"update");
|
19
|
+
}
|
20
|
+
},{
|
21
|
+
prettyName: function() {
|
22
|
+
return "Mr. "+this.name;
|
23
|
+
}
|
24
|
+
})
|
25
|
+
}
|
26
|
+
})
|
27
|
+
|
28
|
+
|
29
|
+
test("CRUD", function(){
|
30
|
+
|
31
|
+
Person.findAll({}, function(response){
|
32
|
+
equals("findAll", response)
|
33
|
+
})
|
34
|
+
Person.findOne({}, function(response){
|
35
|
+
equals("findOne", response)
|
36
|
+
})
|
37
|
+
var person;
|
38
|
+
new Person({foo: "bar"}).save(function(inst, attrs, create){
|
39
|
+
equals(create, "create")
|
40
|
+
equals("bar", inst.foo)
|
41
|
+
equals("zed", inst.zoo)
|
42
|
+
ok(inst.save, "has save function");
|
43
|
+
person = inst;
|
44
|
+
});
|
45
|
+
person.update({zoo: "monkey"},function(inst, attrs, update){
|
46
|
+
equals(inst, person, "we get back the same instance");
|
47
|
+
equals(person.zoo, "monkeys", "updated to monkeys zoo! This tests that you callback with the attrs")
|
48
|
+
})
|
49
|
+
})
|
50
|
+
test("hookup and model", function(){
|
51
|
+
var div = $("<div/>")
|
52
|
+
var p = new Person({foo: "bar2", id: 5});
|
53
|
+
p.hookup( div[0] );
|
54
|
+
ok(div.hasClass("person"), "has person");
|
55
|
+
ok(div.hasClass("person_5"), "has person_5");
|
56
|
+
equals(p, div.model(),"gets model" )
|
57
|
+
})
|
58
|
+
test("guess type", function(){
|
59
|
+
equals("array", $.Model.guessType( [] ) );
|
60
|
+
equals("date", $.Model.guessType( new Date() ) );
|
61
|
+
equals("boolean", $.Model.guessType( true ) );
|
62
|
+
equals("number", $.Model.guessType( "1" ) );
|
63
|
+
equals("string", $.Model.guessType( "a" ) );
|
64
|
+
})
|
65
|
+
|
66
|
+
test("wrapMany", function(){
|
67
|
+
var people = Person.wrapMany([
|
68
|
+
{id: 1, name: "Justin"}
|
69
|
+
])
|
70
|
+
equals(people[0].prettyName(),"Mr. Justin","wraps wrapping works")
|
71
|
+
})
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<html>
|
2
|
+
<head>
|
3
|
+
<link rel="stylesheet" type="text/css" href="../funcunit/qunit/qunit.css" />
|
4
|
+
</head>
|
5
|
+
<body>
|
6
|
+
|
7
|
+
<h1 id="qunit-header">JavaScriptMVC jQuery Test Suite</h1>
|
8
|
+
<h2 id="qunit-banner"></h2>
|
9
|
+
<div id="qunit-testrunner-toolbar"></div>
|
10
|
+
<h2 id="qunit-userAgent"></h2>
|
11
|
+
<ol id="qunit-tests"></ol>
|
12
|
+
<div id="qunit-test-area"></div>
|
13
|
+
<script type='text/javascript' src='../steal/steal.js?steal[app]=jquery/test/qunit'></script>
|
14
|
+
</body>
|
15
|
+
</html>
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<html>
|
2
|
+
<head>
|
3
|
+
<link rel="stylesheet" type="text/css" href="../steal/test/qunit/qunit.css" />
|
4
|
+
<style>
|
5
|
+
body {
|
6
|
+
margin: 0px; padding: 0px;
|
7
|
+
}
|
8
|
+
</style>
|
9
|
+
<script type='text/javascript' src='../steal/steal.js?steal[app]=jquerytest/test/funcunit'></script>
|
10
|
+
</head>
|
11
|
+
<body>
|
12
|
+
|
13
|
+
<h1 id="qunit-header">jquerytest Test Suite</h1>
|
14
|
+
<h2 id="qunit-banner"></h2>
|
15
|
+
<div id="qunit-testrunner-toolbar"></div>
|
16
|
+
<h2 id="qunit-userAgent"></h2>
|
17
|
+
<div id="test-content"></div>
|
18
|
+
<ol id="qunit-tests"></ol>
|
19
|
+
<div id="qunit-test-area"></div>
|
20
|
+
</body>
|
21
|
+
</html>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
//load("jquerytest/test/funcunit/run.js")
|
2
|
+
|
3
|
+
|
4
|
+
//load global selenium settings, change if you want something different
|
5
|
+
load('settings/selenium.js')
|
6
|
+
|
7
|
+
load('steal/rhino/loader.js');
|
8
|
+
rhinoLoader(function(){
|
9
|
+
steal.plugins('jquerytest/test/funcunit'); // load tests
|
10
|
+
}, true);
|
@@ -0,0 +1,22 @@
|
|
1
|
+
//we probably have to have this only describing where the tests are
|
2
|
+
steal.plugins(
|
3
|
+
'jquery/class/test/qunit',
|
4
|
+
'jquery/controller/test/qunit',
|
5
|
+
'jquery/controller/view/test/qunit',
|
6
|
+
|
7
|
+
'jquery/dom/compare/test/qunit',
|
8
|
+
'jquery/dom/cur_styles/test/qunit',
|
9
|
+
'jquery/dom/dimensions/test/qunit',
|
10
|
+
'jquery/dom/fixture/test/qunit',
|
11
|
+
'jquery/dom/form_params/test/qunit',
|
12
|
+
'jquery/event/default/test/qunit',
|
13
|
+
'jquery/event/destroyed/test/qunit',
|
14
|
+
'jquery/event/hover/test/qunit',
|
15
|
+
'jquery/event/drag/test/qunit',
|
16
|
+
|
17
|
+
'jquery/model/test/qunit',
|
18
|
+
'jquery/model/associations/test/qunit',
|
19
|
+
'jquery/model/list/test/qunit',
|
20
|
+
|
21
|
+
'jquery/view/test/qunit'
|
22
|
+
)
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
|
2
|
+
"http://www.w3.org/TR/html4/strict.dtd">
|
3
|
+
<html lang="en">
|
4
|
+
<head>
|
5
|
+
<title>ejs</title>
|
6
|
+
<style type='text/css'>
|
7
|
+
body {font-family: verdana}
|
8
|
+
.error {border: solid 1px red;}
|
9
|
+
.error_text { color: red; font-size: 10px;}
|
10
|
+
td {padding: 3px;}
|
11
|
+
</style>
|
12
|
+
</head>
|
13
|
+
<body>
|
14
|
+
<h1>Welcome to JavaScriptMVC 3.0!</h1>
|
15
|
+
<ul>
|
16
|
+
<li>Include plugins and files in <i>jquery/view/ejs/ejs.js</i>.</li>
|
17
|
+
<li>Change to production mode by changing <i>development</i> to <i>production</i> in this file.</li>
|
18
|
+
</ul>
|
19
|
+
<script type='text/javascript'
|
20
|
+
src='../../../steal/steal.js?steal[app]=jquery/view/ejs&steal[env]=development'
|
21
|
+
package='main.js'
|
22
|
+
compress='false'>
|
23
|
+
</script>
|
24
|
+
</body>
|
25
|
+
</html>
|
@@ -0,0 +1,489 @@
|
|
1
|
+
steal.plugins('jquery/view', 'jquery/lang/rsplit').then(function( $ ) {
|
2
|
+
|
3
|
+
//helpers we use
|
4
|
+
var chop = function( string ) {
|
5
|
+
return string.substr(0, string.length - 1);
|
6
|
+
},
|
7
|
+
extend = $.extend,
|
8
|
+
isArray = $.isArray,
|
9
|
+
EJS = function( options ) {
|
10
|
+
//returns a renderer
|
11
|
+
if ( this.constructor != EJS ) {
|
12
|
+
var ejs = new EJS(options);
|
13
|
+
return function( data, helpers ) {
|
14
|
+
return ejs.render(data, helpers)
|
15
|
+
};
|
16
|
+
}
|
17
|
+
|
18
|
+
//if a function, set func as template func
|
19
|
+
if ( typeof options == "function" ) {
|
20
|
+
this.template = {};
|
21
|
+
this.template.process = options;
|
22
|
+
return;
|
23
|
+
}
|
24
|
+
//set options on self
|
25
|
+
$.extend(this, EJS.options, options)
|
26
|
+
|
27
|
+
var template = new EJS.Compiler(this.text, this.type);
|
28
|
+
|
29
|
+
template.compile(options, this.name);
|
30
|
+
|
31
|
+
this.template = template;
|
32
|
+
};
|
33
|
+
/**
|
34
|
+
* @constructor jQuery.View.EJS
|
35
|
+
* @plugin view
|
36
|
+
* Ejs provides <a href="http://www.ruby-doc.org/stdlib/libdoc/erb/rdoc/">ERB</a>
|
37
|
+
* style client side templates. Use them with controllers to easily build html and inject
|
38
|
+
* it into the DOM.
|
39
|
+
* <h3>Example</h3>
|
40
|
+
* The following generates a list of tasks:
|
41
|
+
* @codestart html
|
42
|
+
* <ul>
|
43
|
+
* <% for(var i = 0; i < tasks.length; i++){ %>
|
44
|
+
* <li class="task <%= tasks[i].identity %>"><%= tasks[i].name %></li>
|
45
|
+
* <% } %>
|
46
|
+
* </ul>
|
47
|
+
* @codeend
|
48
|
+
* For the following examples, we assume this view is in <i>'views\tasks\list.ejs'</i>
|
49
|
+
* <h2>Use</h2>
|
50
|
+
* There are 2 common ways to use Views:
|
51
|
+
* <ul>
|
52
|
+
* <li>Controller's [jQuery.Controller.prototype.view view function]</li>
|
53
|
+
* <li>The jQuery Helpers: [jQuery.fn.after after],
|
54
|
+
* [jQuery.fn.append append],
|
55
|
+
* [jQuery.fn.before before],
|
56
|
+
* [jQuery.fn.before html],
|
57
|
+
* [jQuery.fn.before prepend],
|
58
|
+
* [jQuery.fn.before replace], and
|
59
|
+
* [jQuery.fn.before text].</li>
|
60
|
+
* </ul>
|
61
|
+
* <h3>View</h3>
|
62
|
+
* jQuery.Controller.prototype.view is the preferred way of rendering a view.
|
63
|
+
* You can find all the options for render in
|
64
|
+
* its [jQuery.Controller.prototype.view documentation], but here is a brief example of rendering the
|
65
|
+
* <i>list.ejs</i> view from a controller:
|
66
|
+
* @codestart
|
67
|
+
* $.Controller.extend("TasksController",{
|
68
|
+
* init: function( el ) {
|
69
|
+
* Task.findAll({},this.callback('list'))
|
70
|
+
* },
|
71
|
+
* list: function( tasks ) {
|
72
|
+
* this.element.html(
|
73
|
+
* this.view("list", {tasks: tasks})
|
74
|
+
* )
|
75
|
+
* }
|
76
|
+
* })
|
77
|
+
* @codeend
|
78
|
+
*
|
79
|
+
*
|
80
|
+
* <h2>View Helpers</h2>
|
81
|
+
* View Helpers return html code. View by default only comes with
|
82
|
+
* [jQuery.View.EJS.Helpers.prototype.view view] and [jQuery.View.Helpers.prototype.to_text to_text].
|
83
|
+
* You can include more with the view/helpers plugin. But, you can easily make your own!
|
84
|
+
* Learn how in the [jQuery.View.EJS.Helpers Helpers] page.
|
85
|
+
*
|
86
|
+
* @init Creates a new view
|
87
|
+
* @param {Object} options A hash with the following options
|
88
|
+
* <table class="options">
|
89
|
+
* <tbody><tr><th>Option</th><th>Default</th><th>Description</th></tr>
|
90
|
+
* <tr>
|
91
|
+
* <td>url</td>
|
92
|
+
* <td> </td>
|
93
|
+
* <td>loads the template from a file. This path should be relative to <i>[jQuery.root]</i>.
|
94
|
+
* </td>
|
95
|
+
* </tr>
|
96
|
+
* <tr>
|
97
|
+
* <td>text</td>
|
98
|
+
* <td> </td>
|
99
|
+
* <td>uses the provided text as the template. Example:<br/><code>new View({text: '<%=user%>'})</code>
|
100
|
+
* </td>
|
101
|
+
* </tr>
|
102
|
+
* <tr>
|
103
|
+
* <td>element</td>
|
104
|
+
* <td> </td>
|
105
|
+
* <td>loads a template from the innerHTML or value of the element.
|
106
|
+
* </td>
|
107
|
+
* </tr>
|
108
|
+
* <tr>
|
109
|
+
* <td>type</td>
|
110
|
+
* <td>'<'</td>
|
111
|
+
* <td>type of magic tags. Options are '<' or '['
|
112
|
+
* </td>
|
113
|
+
* </tr>
|
114
|
+
* <tr>
|
115
|
+
* <td>name</td>
|
116
|
+
* <td>the element ID or url </td>
|
117
|
+
* <td>an optional name that is used for caching.
|
118
|
+
* </td>
|
119
|
+
* </tr>
|
120
|
+
* <tr>
|
121
|
+
* <td>cache</td>
|
122
|
+
* <td>true in production mode, false in other modes</td>
|
123
|
+
* <td>true to cache template.
|
124
|
+
* </td>
|
125
|
+
* </tr>
|
126
|
+
*
|
127
|
+
* </tbody></table>
|
128
|
+
*/
|
129
|
+
$.View.EJS = EJS;
|
130
|
+
/**
|
131
|
+
* @Prototype
|
132
|
+
*/
|
133
|
+
EJS.prototype = {
|
134
|
+
constructor: EJS,
|
135
|
+
/**
|
136
|
+
* Renders an object with extra view helpers attached to the view.
|
137
|
+
* @param {Object} object data to be rendered
|
138
|
+
* @param {Object} extra_helpers an object with additonal view helpers
|
139
|
+
* @return {String} returns the result of the string
|
140
|
+
*/
|
141
|
+
render: function( object, extra_helpers ) {
|
142
|
+
object = object || {};
|
143
|
+
this._extra_helpers = extra_helpers;
|
144
|
+
var v = new EJS.Helpers(object, extra_helpers || {});
|
145
|
+
return this.template.process.call(object, object, v);
|
146
|
+
},
|
147
|
+
out: function() {
|
148
|
+
return this.template.out;
|
149
|
+
}
|
150
|
+
};
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
/* @Static*/
|
157
|
+
EJS.Scanner = function( source, left, right ) {
|
158
|
+
|
159
|
+
extend(this, {
|
160
|
+
left_delimiter: left + '%',
|
161
|
+
right_delimiter: '%' + right,
|
162
|
+
double_left: left + '%%',
|
163
|
+
double_right: '%%' + right,
|
164
|
+
left_equal: left + '%=',
|
165
|
+
left_comment: left + '%#'
|
166
|
+
})
|
167
|
+
|
168
|
+
this.SplitRegexp = (left == '[' ? /(\[%%)|(%%\])|(\[%=)|(\[%#)|(\[%)|(%\]\n)|(%\])|(\n)/ : new RegExp('(' + this.double_left + ')|(%%' + this.double_right + ')|(' + this.left_equal + ')|(' + this.left_comment + ')|(' + this.left_delimiter + ')|(' + this.right_delimiter + '\n)|(' + this.right_delimiter + ')|(\n)'));
|
169
|
+
|
170
|
+
this.source = source;
|
171
|
+
this.stag = null;
|
172
|
+
this.lines = 0;
|
173
|
+
};
|
174
|
+
EJS.Scanner.to_text = function( input ) {
|
175
|
+
var myid;
|
176
|
+
if ( input == null || input === undefined ) return '';
|
177
|
+
|
178
|
+
if ( input instanceof Date ) return input.toDateString();
|
179
|
+
if ( input.hookup ) {
|
180
|
+
myid = $.View.hookup(function( el, id ) {
|
181
|
+
input.hookup.call(input, el, id)
|
182
|
+
});
|
183
|
+
return "data-view-id='" + myid + "'"
|
184
|
+
}
|
185
|
+
if ( typeof input == 'function' ) return "data-view-id='" + $.View.hookup(input) + "'";
|
186
|
+
|
187
|
+
if ( isArray(input) ) {
|
188
|
+
myid = $.View.hookup(function( el, id ) {
|
189
|
+
for ( var i = 0; i < input.length; i++ ) {
|
190
|
+
input[i].hookup ? input[i].hookup(el, id) : input[i](el, id)
|
191
|
+
}
|
192
|
+
});
|
193
|
+
return "data-view-id='" + myid + "'"
|
194
|
+
}
|
195
|
+
if ( input.nodeName || input.jQuery ) {
|
196
|
+
throw "elements in views are not supported"
|
197
|
+
}
|
198
|
+
|
199
|
+
if ( input.toString ) return myid ? input.toString(myid) : input.toString();
|
200
|
+
return '';
|
201
|
+
};
|
202
|
+
|
203
|
+
EJS.Scanner.prototype = {
|
204
|
+
scan: function( block ) {
|
205
|
+
var regex = this.SplitRegexp;
|
206
|
+
if (!this.source == '' ) {
|
207
|
+
var source_split = $.String.rsplit(this.source, /\n/);
|
208
|
+
for ( var i = 0; i < source_split.length; i++ ) {
|
209
|
+
var item = source_split[i];
|
210
|
+
this.scanline(item, regex, block);
|
211
|
+
}
|
212
|
+
}
|
213
|
+
},
|
214
|
+
scanline: function( line, regex, block ) {
|
215
|
+
this.lines++;
|
216
|
+
var line_split = $.String.rsplit(line, regex);
|
217
|
+
for ( var i = 0; i < line_split.length; i++ ) {
|
218
|
+
var token = line_split[i];
|
219
|
+
if ( token != null ) {
|
220
|
+
try {
|
221
|
+
block(token, this);
|
222
|
+
} catch (e) {
|
223
|
+
throw {
|
224
|
+
type: 'jQuery.View.EJS.Scanner',
|
225
|
+
line: this.lines
|
226
|
+
};
|
227
|
+
}
|
228
|
+
}
|
229
|
+
}
|
230
|
+
}
|
231
|
+
};
|
232
|
+
|
233
|
+
|
234
|
+
EJS.Buffer = function( pre_cmd, post_cmd ) {
|
235
|
+
this.line = new Array();
|
236
|
+
this.script = "";
|
237
|
+
this.pre_cmd = pre_cmd;
|
238
|
+
this.post_cmd = post_cmd;
|
239
|
+
for ( var i = 0; i < this.pre_cmd.length; i++ ) {
|
240
|
+
this.push(pre_cmd[i]);
|
241
|
+
}
|
242
|
+
};
|
243
|
+
EJS.Buffer.prototype = {
|
244
|
+
|
245
|
+
push: function( cmd ) {
|
246
|
+
this.line.push(cmd);
|
247
|
+
},
|
248
|
+
|
249
|
+
cr: function() {
|
250
|
+
this.script = this.script + this.line.join('; ');
|
251
|
+
this.line = new Array();
|
252
|
+
this.script = this.script + "\n";
|
253
|
+
},
|
254
|
+
|
255
|
+
close: function() {
|
256
|
+
if ( this.line.length > 0 ) {
|
257
|
+
for ( var i = 0; i < this.post_cmd.length; i++ ) {
|
258
|
+
this.push(pre_cmd[i]);
|
259
|
+
}
|
260
|
+
this.script = this.script + this.line.join('; ');
|
261
|
+
line = null;
|
262
|
+
}
|
263
|
+
}
|
264
|
+
|
265
|
+
};
|
266
|
+
|
267
|
+
EJS.Compiler = function( source, left ) {
|
268
|
+
this.pre_cmd = ['var ___ViewO = [];'];
|
269
|
+
this.post_cmd = new Array();
|
270
|
+
this.source = ' ';
|
271
|
+
if ( source != null ) {
|
272
|
+
if ( typeof source == 'string' ) {
|
273
|
+
source = source.replace(/\r\n/g, "\n");
|
274
|
+
source = source.replace(/\r/g, "\n");
|
275
|
+
this.source = source;
|
276
|
+
} else if ( source.innerHTML ) {
|
277
|
+
this.source = source.innerHTML;
|
278
|
+
}
|
279
|
+
if ( typeof this.source != 'string' ) {
|
280
|
+
this.source = "";
|
281
|
+
}
|
282
|
+
}
|
283
|
+
left = left || '<';
|
284
|
+
var right = '>';
|
285
|
+
switch ( left ) {
|
286
|
+
case '[':
|
287
|
+
right = ']';
|
288
|
+
break;
|
289
|
+
case '<':
|
290
|
+
break;
|
291
|
+
default:
|
292
|
+
throw left + ' is not a supported deliminator';
|
293
|
+
break;
|
294
|
+
}
|
295
|
+
this.scanner = new EJS.Scanner(this.source, left, right);
|
296
|
+
this.out = '';
|
297
|
+
};
|
298
|
+
EJS.Compiler.prototype = {
|
299
|
+
compile: function( options, name ) {
|
300
|
+
options = options || {};
|
301
|
+
this.out = '';
|
302
|
+
var put_cmd = "___ViewO.push(",
|
303
|
+
insert_cmd = put_cmd,
|
304
|
+
buff = new EJS.Buffer(this.pre_cmd, this.post_cmd),
|
305
|
+
content = '',
|
306
|
+
clean = function( content ) {
|
307
|
+
content = content.replace(/\\/g, '\\\\');
|
308
|
+
content = content.replace(/\n/g, '\\n');
|
309
|
+
content = content.replace(/"/g, '\\"');
|
310
|
+
return content;
|
311
|
+
};
|
312
|
+
this.scanner.scan(function( token, scanner ) {
|
313
|
+
if ( scanner.stag == null ) {
|
314
|
+
switch ( token ) {
|
315
|
+
case '\n':
|
316
|
+
content = content + "\n";
|
317
|
+
buff.push(put_cmd + '"' + clean(content) + '");');
|
318
|
+
buff.cr();
|
319
|
+
content = '';
|
320
|
+
break;
|
321
|
+
case scanner.left_delimiter:
|
322
|
+
case scanner.left_equal:
|
323
|
+
case scanner.left_comment:
|
324
|
+
scanner.stag = token;
|
325
|
+
if ( content.length > 0 ) {
|
326
|
+
buff.push(put_cmd + '"' + clean(content) + '")');
|
327
|
+
}
|
328
|
+
content = '';
|
329
|
+
break;
|
330
|
+
case scanner.double_left:
|
331
|
+
content = content + scanner.left_delimiter;
|
332
|
+
break;
|
333
|
+
default:
|
334
|
+
content = content + token;
|
335
|
+
break;
|
336
|
+
}
|
337
|
+
}
|
338
|
+
else {
|
339
|
+
switch ( token ) {
|
340
|
+
case scanner.right_delimiter:
|
341
|
+
switch ( scanner.stag ) {
|
342
|
+
case scanner.left_delimiter:
|
343
|
+
if ( content[content.length - 1] == '\n' ) {
|
344
|
+
content = chop(content);
|
345
|
+
buff.push(content);
|
346
|
+
buff.cr();
|
347
|
+
}
|
348
|
+
else {
|
349
|
+
buff.push(content);
|
350
|
+
}
|
351
|
+
break;
|
352
|
+
case scanner.left_equal:
|
353
|
+
buff.push(insert_cmd + "(jQuery.View.EJS.Scanner.to_text(" + content + ")))");
|
354
|
+
break;
|
355
|
+
}
|
356
|
+
scanner.stag = null;
|
357
|
+
content = '';
|
358
|
+
break;
|
359
|
+
case scanner.double_right:
|
360
|
+
content = content + scanner.right_delimiter;
|
361
|
+
break;
|
362
|
+
default:
|
363
|
+
content = content + token;
|
364
|
+
break;
|
365
|
+
}
|
366
|
+
}
|
367
|
+
});
|
368
|
+
if ( content.length > 0 ) {
|
369
|
+
// Should be content.dump in Ruby
|
370
|
+
buff.push(put_cmd + '"' + clean(content) + '")');
|
371
|
+
}
|
372
|
+
buff.close();
|
373
|
+
this.out = buff.script + ";";
|
374
|
+
var to_be_evaled = '/*' + name + '*/this.process = function(_CONTEXT,_VIEW) { try { with(_VIEW) { with (_CONTEXT) {' + this.out + " return ___ViewO.join('');}}}catch(e){e.lineNumber=null;throw e;}};";
|
375
|
+
|
376
|
+
eval(to_be_evaled);
|
377
|
+
}
|
378
|
+
};
|
379
|
+
|
380
|
+
|
381
|
+
//type, cache, folder
|
382
|
+
/**
|
383
|
+
* @attribute options
|
384
|
+
* Sets default options for all views
|
385
|
+
* <table class="options">
|
386
|
+
* <tbody><tr><th>Option</th><th>Default</th><th>Description</th></tr>
|
387
|
+
* <tr>
|
388
|
+
* <td>type</td>
|
389
|
+
* <td>'<'</td>
|
390
|
+
* <td>type of magic tags. Options are '<' or '['
|
391
|
+
* </td>
|
392
|
+
* </tr>
|
393
|
+
* <tr>
|
394
|
+
* <td>cache</td>
|
395
|
+
* <td>true in production mode, false in other modes</td>
|
396
|
+
* <td>true to cache template.
|
397
|
+
* </td>
|
398
|
+
* </tr>
|
399
|
+
* </tbody></table>
|
400
|
+
*
|
401
|
+
*/
|
402
|
+
EJS.options = {
|
403
|
+
cache: true,
|
404
|
+
type: '<',
|
405
|
+
ext: '.ejs'
|
406
|
+
}
|
407
|
+
EJS.INVALID_PATH = -1;
|
408
|
+
|
409
|
+
|
410
|
+
|
411
|
+
/**
|
412
|
+
* @constructor jQuery.View.EJS.Helpers
|
413
|
+
* By adding functions to jQuery.View.EJS.Helpers.prototype, those functions will be available in the
|
414
|
+
* views.
|
415
|
+
* @init Creates a view helper. This function is called internally. You should never call it.
|
416
|
+
* @param {Object} data The data passed to the view. Helpers have access to it through this._data
|
417
|
+
*/
|
418
|
+
EJS.Helpers = function( data, extras ) {
|
419
|
+
this._data = data;
|
420
|
+
this._extras = extras;
|
421
|
+
extend(this, extras);
|
422
|
+
}; /* @prototype*/
|
423
|
+
EJS.Helpers.prototype = {
|
424
|
+
/**
|
425
|
+
* Renders a partial view. This is deprecated in favor of <code>$.View()</code>.
|
426
|
+
*/
|
427
|
+
view: function( url, data, helpers ) {
|
428
|
+
if (!helpers ) helpers = this._extras
|
429
|
+
if (!data ) data = this._data;
|
430
|
+
return $.View(url, data, helpers) //new EJS(options).render(data, helpers);
|
431
|
+
},
|
432
|
+
/**
|
433
|
+
* Converts response to text.
|
434
|
+
*/
|
435
|
+
to_text: function( input, null_text ) {
|
436
|
+
if ( input == null || input === undefined ) return null_text || '';
|
437
|
+
if ( input instanceof Date ) return input.toDateString();
|
438
|
+
if ( input.toString ) return input.toString().replace(/\n/g, '<br />').replace(/''/g, "'");
|
439
|
+
return '';
|
440
|
+
},
|
441
|
+
/**
|
442
|
+
* Makes a plugin
|
443
|
+
* @param {String} name the plugin name
|
444
|
+
*/
|
445
|
+
plugin: function( name ) {
|
446
|
+
var args = $.makeArray(arguments),
|
447
|
+
widget = args.shift();
|
448
|
+
return function( el ) {
|
449
|
+
var jq = $(el)
|
450
|
+
jq[widget].apply(jq, args);
|
451
|
+
}
|
452
|
+
}
|
453
|
+
};
|
454
|
+
|
455
|
+
|
456
|
+
$.View.register({
|
457
|
+
suffix: "ejs",
|
458
|
+
//returns a function that renders the view
|
459
|
+
get: function( id, url ) {
|
460
|
+
var text = $.ajax({
|
461
|
+
async: false,
|
462
|
+
url: url,
|
463
|
+
dataType: "text",
|
464
|
+
error: function() {
|
465
|
+
throw "ejs.js ERROR: There is no template or an empty template at " + url;
|
466
|
+
}
|
467
|
+
}).responseText
|
468
|
+
if (!text.match(/[^\s]/) ) {
|
469
|
+
throw "ejs.js ERROR: There is no template or an empty template at " + url;
|
470
|
+
}
|
471
|
+
return this.renderer(id, text);
|
472
|
+
},
|
473
|
+
script: function( id, src ) {
|
474
|
+
return "jQuery.View.EJS(function(_CONTEXT,_VIEW) { try { with(_VIEW) { with (_CONTEXT) {" + new EJS({
|
475
|
+
text: src
|
476
|
+
}).out() + " return ___ViewO.join('');}}}catch(e){e.lineNumber=null;throw e;}})";
|
477
|
+
},
|
478
|
+
renderer: function( id, text ) {
|
479
|
+
var ejs = new EJS({
|
480
|
+
text: text,
|
481
|
+
name: id
|
482
|
+
})
|
483
|
+
return function( data, helpers ) {
|
484
|
+
return ejs.render.call(ejs, data, helpers)
|
485
|
+
}
|
486
|
+
}
|
487
|
+
})
|
488
|
+
|
489
|
+
});
|