Permalink
Browse files

Merge

  • Loading branch information...
2 parents 1d5c69e + 03a9843 commit d1d39c4451fafe5943e36edfaf487a5d2b3f60dc @retro retro committed Jul 27, 2012
Showing with 1,373 additions and 2,526 deletions.
  1. +2 −2 .gitignore
  2. +3 −0 .gitmodules
  3. +1 −1 can
  4. +1 −0 canui
  5. 0 jmvc/docs/keep.me → docs.html
  6. +1 −1 documentjs
  7. +1 −1 funcunit
  8. +0 −87 jmvc/docs.html
  9. +1 −0 jmvc/docs/FuncUnit.json
  10. +1 −0 jmvc/docs/ajaxy.json
  11. +1 −0 jmvc/docs/compressing.json
  12. +1 −0 jmvc/docs/contacts.dc.json
  13. +1 −0 jmvc/docs/contacts.designing.json
  14. +1 −0 jmvc/docs/contacts.glue.json
  15. +1 −0 jmvc/docs/contacts.json
  16. +1 −0 jmvc/docs/creating.json
  17. +1 −0 jmvc/docs/documenting.json
  18. +1 −0 jmvc/docs/examples.json
  19. +1 −0 jmvc/docs/funcunit.actions.json
  20. +1 −0 jmvc/docs/funcunit.coverage.json
  21. +1 −0 jmvc/docs/funcunit.demos.json
  22. +1 −0 jmvc/docs/funcunit.envjs.json
  23. +1 −0 jmvc/docs/funcunit.features.json
  24. +1 −0 jmvc/docs/funcunit.finding.json
  25. +1 −0 jmvc/docs/funcunit.getstarted.json
  26. +1 −0 jmvc/docs/funcunit.getters.json
  27. +1 −0 jmvc/docs/funcunit.integrations.json
  28. +1 −0 jmvc/docs/funcunit.jenkins.json
  29. +1 −0 jmvc/docs/funcunit.maven.json
  30. +1 −0 jmvc/docs/funcunit.phantomjs.json
  31. +1 −0 jmvc/docs/funcunit.remote.json
  32. +1 −0 jmvc/docs/funcunit.selenium.json
  33. +1 −0 jmvc/docs/funcunit.waits.json
  34. +1 −0 jmvc/docs/getstarted.json
  35. +1 −0 jmvc/docs/index.json
  36. +1 −0 jmvc/docs/installing.json
  37. +1 −0 jmvc/docs/jQuery.Controller.json
  38. +1 −0 jmvc/docs/jQuery.Model.json
  39. +1 −0 jmvc/docs/jQuery.Range.json
  40. +1 −0 jmvc/docs/jQuery.View.json
  41. +1 −0 jmvc/docs/jQuery.animate.json
  42. +1 −0 jmvc/docs/jQuery.compare.json
  43. +1 −0 jmvc/docs/jQuery.dimensions.json
  44. +1 −0 jmvc/docs/jQuery.event.default.json
  45. +1 −0 jmvc/docs/jQuery.event.destroyed.json
  46. +1 −0 jmvc/docs/jQuery.event.drag.json
  47. +1 −0 jmvc/docs/jQuery.event.drop.json
  48. +1 −0 jmvc/docs/jQuery.event.fastfix.json
  49. +1 −0 jmvc/docs/jQuery.event.hover.json
  50. +1 −0 jmvc/docs/jQuery.event.key.json
  51. +1 −0 jmvc/docs/jQuery.event.pause.json
  52. +1 −0 jmvc/docs/jQuery.event.resize.json
  53. +1 −0 jmvc/docs/jQuery.event.selection.json
  54. +1 −0 jmvc/docs/jQuery.event.swipe.json
  55. +1 −0 jmvc/docs/jQuery.event.tap.json
  56. +1 −0 jmvc/docs/jQuery.formParams.json
  57. +1 −0 jmvc/docs/jQuery.selection.json
  58. +1 −0 jmvc/docs/jQuery.styles.json
  59. +1 −0 jmvc/docs/jQuery.within.json
  60. +1 −0 jmvc/docs/jquery.controller.listening.json
  61. +1 −0 jmvc/docs/jquery.controller.plugin.json
  62. +1 −0 jmvc/docs/jquery.model.deferreds.json
  63. +1 −0 jmvc/docs/jquery.model.encapsulate.json
  64. +1 −0 jmvc/docs/jquery.model.typeconversion.json
  65. +1 −0 jmvc/docs/jquerypp.json
  66. +1 −0 jmvc/docs/license.json
  67. +1 −0 jmvc/docs/migrate.json
  68. +1 −0 jmvc/docs/mvc.class.json
  69. +1 −0 jmvc/docs/mvc.controller.json
  70. +1 −0 jmvc/docs/mvc.json
  71. +1 −0 jmvc/docs/mvc.model.json
  72. +1 −0 jmvc/docs/mvc.view.json
  73. +1 −0 jmvc/docs/observe.json
  74. +1 −0 jmvc/docs/organizing.json
  75. +1 −0 jmvc/docs/playermx.json
  76. +1 −0 jmvc/docs/rapidstart.json
  77. +1 −0 jmvc/docs/readme.json
  78. +1 −0 jmvc/docs/reverse.json
  79. +1 −0 jmvc/docs/rootfolder.json
  80. +1 −0 jmvc/docs/searchData.json
  81. +1 −0 jmvc/docs/services.json
  82. +1 −0 jmvc/docs/srchr.json
  83. +1 −0 jmvc/docs/steal.URI.cur.json
  84. +1 −0 jmvc/docs/steal.URI.json
  85. +1 −0 jmvc/docs/steal.URI.page.json
  86. +1 −0 jmvc/docs/steal.URI.prototype.json
  87. +1 −0 jmvc/docs/steal.URI.prototype.normalize.json
  88. +1 −0 jmvc/docs/steal.URI.root.json
  89. +1 −0 jmvc/docs/steal.json
  90. +1 −0 jmvc/docs/steal.static.add.json
  91. +1 −0 jmvc/docs/steal.static.bind.json
  92. +1 −0 jmvc/docs/steal.static.has.json
  93. +1 −0 jmvc/docs/steal.static.json
  94. +1 −0 jmvc/docs/steal.static.load.json
  95. +1 −0 jmvc/docs/steal.static.loadHas.json
  96. +1 −0 jmvc/docs/steal.static.makeOptions.json
  97. +1 −0 jmvc/docs/steal.static.map.json
  98. +1 −0 jmvc/docs/steal.static.options.json
  99. +1 −0 jmvc/docs/steal.static.packs.json
  100. +1 −0 jmvc/docs/steal.static.request.json
  101. +1 −0 jmvc/docs/steal.static.require.json
  102. +1 −0 jmvc/docs/steal.static.then.json
  103. +1 −0 jmvc/docs/steal.static.type.json
  104. +1 −0 jmvc/docs/steal.static.unbind.json
  105. +1 −0 jmvc/docs/stealjs.json
  106. +1 −0 jmvc/docs/testing.json
  107. +1 −0 jmvc/docs/todo.json
  108. +1 −0 jmvc/docs/tutorials.json
  109. +1 −0 jmvc/docs/tutorials.steal.json
  110. +1 −0 jmvc/docs/view.deferreds.json
  111. BIN jmvc/fonts/museo_slab_500-webfont.eot
  112. +0 −247 jmvc/fonts/museo_slab_500-webfont.svg
  113. BIN jmvc/fonts/museo_slab_500-webfont.ttf
  114. BIN jmvc/fonts/museo_slab_500-webfont.woff
  115. +0 −12 jmvc/fonts/museoslab.css
  116. +23 −0 jmvc/generate/app
  117. +35 −0 jmvc/generate/coffee/controller
  118. +11 −0 jmvc/generate/coffee/templates/controller/(underscore).coffee.ejs
  119. +24 −0 jmvc/generate/coffee/templates/controller/(underscore).html.ejs
  120. +7 −0 jmvc/generate/coffee/templates/controller/(underscore)_test.coffee.ejs
  121. +16 −0 jmvc/generate/coffee/templates/controller/funcunit.html.ejs
  122. +36 −0 jmvc/generate/controller
  123. +74 −0 jmvc/generate/model
  124. +21 −0 jmvc/generate/page
  125. +20 −0 jmvc/generate/plugin
  126. +74 −0 jmvc/generate/scaffold
  127. +29 −0 jmvc/generate/templates/app/(application_name).css.ejs
  128. +28 −0 jmvc/generate/templates/app/(application_name).html.ejs
  129. +7 −0 jmvc/generate/templates/app/(application_name).js.ejs
  130. +3 −0 jmvc/generate/templates/app/(application_name).md.ejs
  131. 0 jmvc/generate/templates/app/docs/.ignore
  132. 0 jmvc/generate/templates/app/fixtures/.ignore
  133. +5 −0 jmvc/generate/templates/app/fixtures/fixtures.js.ejs
  134. +15 −0 jmvc/generate/templates/app/funcunit.html.ejs
  135. 0 jmvc/generate/templates/app/models/.ignore
  136. +2 −0 jmvc/generate/templates/app/models/models.js.ejs
  137. +18 −0 jmvc/generate/templates/app/qunit.html.ejs
  138. +3 −3 jmvc/{site/scripts/build.html → generate/templates/app/scripts/build.html.ejs}
  139. +6 −0 jmvc/generate/templates/app/scripts/build.js.ejs
  140. +17 −0 jmvc/generate/templates/app/scripts/clean.js.ejs
  141. +7 −0 jmvc/generate/templates/app/scripts/crawl.js.ejs
  142. +8 −0 jmvc/generate/templates/app/scripts/docs.js.ejs
  143. +11 −0 jmvc/generate/templates/app/test/funcunit/(application_name)_test.js.ejs
  144. +2 −0 jmvc/generate/templates/app/test/funcunit/funcunit.js.ejs
  145. +7 −0 jmvc/generate/templates/app/test/qunit/(application_name)_test.js.ejs
  146. +1 −0 jmvc/generate/templates/app/test/qunit/qunit.js.ejs
  147. +25 −0 jmvc/generate/templates/control/(underscore).html.ejs
  148. +21 −0 jmvc/generate/templates/control/(underscore).js.ejs
  149. +14 −0 jmvc/generate/templates/control/(underscore)_test.js.ejs
  150. +16 −0 jmvc/generate/templates/control/funcunit.html.ejs
  151. 0 jmvc/generate/templates/control/views/.ignore
  152. +1 −0 jmvc/generate/templates/control/views/init.ejs.ejs
  153. +7 −0 jmvc/generate/templates/fixturemake.ejs
  154. +75 −0 jmvc/generate/templates/model.js
  155. +21 −0 jmvc/generate/templates/model/models/(underscore).js.ejs
  156. +51 −0 jmvc/generate/templates/model/test/qunit/(underscore)_test.js.ejs
  157. +22 −0 jmvc/generate/templates/page.ejs
  158. +24 −0 jmvc/generate/templates/plugin/(application_name).html.ejs
  159. +3 −0 jmvc/generate/templates/plugin/(application_name).js.ejs
  160. +10 −0 jmvc/generate/templates/plugin/(application_name)_test.js.ejs
  161. +18 −0 jmvc/generate/templates/plugin/qunit.html.ejs
  162. +29 −0 jmvc/generate/templates/scaffold/create/create.html.ejs
  163. +31 −0 jmvc/generate/templates/scaffold/create/create.js.ejs
  164. +22 −0 jmvc/generate/templates/scaffold/create/create_test.js.ejs
  165. +15 −0 jmvc/generate/templates/scaffold/create/funcunit.html.ejs
  166. +9 −0 jmvc/generate/templates/scaffold/create/views/init.ejs.ejs
  167. +15 −0 jmvc/generate/templates/scaffold/list/funcunit.html.ejs
  168. +31 −0 jmvc/generate/templates/scaffold/list/list.html.ejs
  169. +42 −0 jmvc/generate/templates/scaffold/list/list.js.ejs
  170. +26 −0 jmvc/generate/templates/scaffold/list/list_test.js.ejs
  171. +2 −0 jmvc/generate/templates/scaffold/list/views/(underscore).ejs.ejs
  172. +5 −0 jmvc/generate/templates/scaffold/list/views/init.ejs.ejs
  173. +2 −0 jmvc/generate/templates/scaffoldHookup.ejs
  174. +60 −0 jmvc/generate/test/app_plugin_model_controller.js
  175. +3 −0 jmvc/generate/test/run.js
  176. +87 −0 jmvc/generate/test/scaffold.js
  177. BIN jmvc/images/add_tag_example.png
  178. BIN jmvc/images/backgrounds/body.png
  179. BIN jmvc/images/backgrounds/bottom.png
  180. BIN jmvc/images/backgrounds/calendar.png
  181. BIN jmvc/images/backgrounds/download/documentjs.png
  182. BIN jmvc/images/backgrounds/download/funcunit.png
  183. BIN jmvc/images/backgrounds/download/javascriptmvc.png
  184. BIN jmvc/images/backgrounds/download/jquerymx.png
  185. BIN jmvc/images/backgrounds/download/stealjs.png
  186. BIN jmvc/images/backgrounds/download/syn.png
  187. BIN jmvc/images/backgrounds/greenbox.png
  188. BIN jmvc/images/backgrounds/link_hover.png
  189. BIN jmvc/images/backgrounds/navigation.png
  190. BIN jmvc/images/backgrounds/quote.png
  191. BIN jmvc/images/class.png
  192. BIN jmvc/images/controller.png
  193. BIN jmvc/images/coverage_commandline.png
  194. BIN jmvc/images/coverage_file.png
  195. BIN jmvc/images/coverage_report.png
  196. BIN jmvc/images/crm_doc_demo_1.png
  197. BIN jmvc/images/crm_doc_demo_2.png
  198. BIN jmvc/images/damnit.png
  199. BIN jmvc/images/documentjs.png
  200. BIN jmvc/images/download_button.png
  201. BIN jmvc/images/extensions.png
  202. BIN jmvc/images/follow_twitter.png
  203. BIN jmvc/images/fork.png
  204. BIN jmvc/images/funcunit.png
  205. BIN jmvc/images/funcunit_medium.png
  206. BIN jmvc/images/funcunit_small.png
  207. BIN jmvc/images/funcunitfolder.png
  208. BIN jmvc/images/funcunithtml.png
  209. BIN jmvc/images/generator.png
  210. BIN jmvc/images/header.png
  211. BIN jmvc/images/iepopups.png
  212. BIN jmvc/images/iesecurity.png
  213. BIN jmvc/images/logo.png
  214. BIN jmvc/images/model.png
  215. BIN jmvc/images/page_type_example.png
  216. BIN jmvc/images/parent_tag_example.png
  217. BIN jmvc/images/phui.png
  218. BIN jmvc/images/plugin_tag_example.png
  219. BIN jmvc/images/return_tag_example.png
  220. BIN jmvc/images/rss.png
  221. BIN jmvc/images/steal.png
  222. BIN jmvc/images/tag_tag_example.png
  223. BIN jmvc/images/team/brian.png
  224. BIN jmvc/images/team/joe.png
  225. BIN jmvc/images/team/justin.png
  226. BIN jmvc/images/team/lee.png
  227. BIN jmvc/images/team/matt.png
  228. BIN jmvc/images/team/max.png
  229. BIN jmvc/images/team/michael.png
  230. BIN jmvc/images/team/trey.png
  231. BIN jmvc/images/test_cookbook_example.png
  232. BIN jmvc/images/test_tag_example.png
  233. BIN jmvc/images/test_tag_test_example.png
  234. BIN jmvc/images/update.png
  235. BIN jmvc/images/view.png
  236. +0 −23 jmvc/jmvc.html
  237. +0 −58 jmvc/jmvc.js
  238. +0 −128 jmvc/pages/developingjmvc.js
  239. +0 −187 jmvc/pages/developingwithgit.js
  240. +0 −53 jmvc/pages/folders.js
  241. +0 −30 jmvc/pages/help.js
  242. +0 −106 jmvc/pages/init.js
  243. +0 −119 jmvc/pages/learn.js
  244. +0 −91 jmvc/pages/why.js
  245. +0 −4 jmvc/scripts/compress.js
  246. +0 −9 jmvc/scripts/crawl.js
  247. +0 −21 jmvc/scripts/doc.js
  248. +0 −116 jmvc/site/builder.css
  249. +0 −1 jmvc/site/production.css
  250. +0 −231 jmvc/site/production.js
  251. +0 −6 jmvc/site/scripts/build.js
  252. +0 −6 jmvc/site/scripts/clean.js
  253. +0 −189 jmvc/site/site.js
  254. +0 −578 jmvc/site/site.less
  255. +0 −10 jmvc/site/views/blog.ejs
  256. +0 −3 jmvc/stylesheets/application.css
  257. +0 −48 jmvc/stylesheets/reset.css
  258. +0 −87 jmvc/summary.ejs
  259. +1 −1 jquery
  260. +1 −0 ...ultibuild_app_x-steal_build_apps_test_multibuild_app_y-steal_build_apps_test_multibuild_app_z.css
  261. +2 −0 ...multibuild_app_x-steal_build_apps_test_multibuild_app_y-steal_build_apps_test_multibuild_app_z.js
  262. +1 −0 packages/steal_build_apps_test_multibuild_app_x-steal_build_apps_test_multibuild_app_y.css
  263. +1 −0 packages/steal_build_apps_test_multibuild_app_x-steal_build_apps_test_multibuild_app_y.js
  264. +1 −0 packages/steal_build_apps_test_multibuild_app_y-steal_build_apps_test_multibuild_app_z.css
  265. +1 −0 packages/steal_build_apps_test_multibuild_app_y-steal_build_apps_test_multibuild_app_z.js
  266. +9 −28 readme.md
  267. +2 −2 site/docs.html
  268. +1 −1 site/scripts/doc.js
  269. +1 −1 site/summary.ejs
  270. +1 −1 steal
  271. +11 −5 stealconfig.js
  272. +1 −1 tutorials/ajaxy/ajaxy.md
  273. +5 −10 tutorials/getstarted/creating.md
  274. +10 −10 tutorials/getstarted/getstarted.md
  275. +15 −7 tutorials/installing.md
  276. +1 −1 tutorials/rapidstart/rapidstart.md
View
@@ -1,8 +1,8 @@
-jmvc/docs/*
+site/docs/*
.tmp*
cookbook/*
docs/*
scripts/key
.DS_Store
html/
-.idea
+.idea
View
@@ -13,3 +13,6 @@
[submodule "can"]
path = can
url = git@github.com:jupiterjs/canjs.git
+[submodule "canui"]
+ path = canui
+ url = git://github.com/jupiterjs/canui.git
Submodule can updated from d15c0f to e81899
Submodule canui added at d8b505
File renamed without changes.
View
@@ -1,87 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-<html lang="en">
-<head>
- <title>JavaScriptMVC</title>
-
- <link rel="shortcut icon" href="../documentjs/jmvcdoc/images/favicon.ico"/>
- <script type="text/javascript">
-
- var _gaq = _gaq || [];
- _gaq.push(['_setAccount', 'UA-xxxxx-4']);
- _gaq.push(['_trackPageview']);
-
- (function() {
- var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
- ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
- var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
- })();
-
-</script>
-</head>
-<body>
-<div id='documentation'>
- <div id='top'>
- <div class="content">
- <div id="searchRoundCorners">
- <input id='search' type='input' disabled='true'/>
- </div>
- <div id='defaults'>
- <ul id="menu" class="ui-menu">
- <li class="ui-menu-item">
- <a class="menuLink" href="#favorites"><span class="menuSpan">Favorites</span></a>
- </li>
- <li class="ui-menu-item">
- <a class="menuLink" href="../follow.html" title="Follow"><span
- class="menuSpan red">Follow</span></a>
- </li>
- <li class="ui-menu-item">
- <a class="menuLink" href="../contribute.html" title="Contribute"><span class="menuSpan red">Contribute</span></a>
- </li>
- <li class="ui-menu-item">
- <a class="menuLink" href="../code.html" title="Code"><span class="menuSpan red">Code</span></a>
- </li>
- </ul>
- </div>
- <div class="logo-text"><a href='http://javascriptmvc.com'><img
- src='../documentjs/jmvcdoc/images/logo80x30.png' class="logo-image"/></a></div>
- </div>
- </div>
- <div id='bottom'>
- <div id='nav'>
- <a>Loading ... </a>
- </div>
- <div id='doc_container'>
- <div id='doc'>
-
- </div>
- <div id="disqus_thread"></div>
- </div>
- </div>
-</div>
-<div id='low'>
- <a href="http://jupiterit.com">&copy; Jupiter Consulting - JavaScriptMVC Training and Support</a>
- <a class="api_links" href="http://javascriptmvc.com/docs/api.html#&who=api"></a>
-</div>
-<script type='text/javascript'>
- DOCS_SRC_MAP = {
- 'funcunit' : 'https://github.com/jupiterjs/funcunit',
- 'jquery' : 'https://github.com/jupiterjs/jquerymx',
- 'steal' : 'https://github.com/jupiterjs/steal',
- 'documentjs' : 'https://github.com/jupiterjs/documentjs',
- mxui : 'https://github.com/jupiterjs/mxui'
- };
- DOCS_LOCATION = "docs/" //adds searchData to this
- JMVCDOC_TIMESTAMP = 266365774
- COMMENTS_LOCATION = 'http://jmvcs3.disqus.com/embed.js';
-</script>
-<script type='text/javascript'
- src='../steal/steal.js?documentjs/jmvcdoc'>
-</script>
-
-<style type="text/css">
- body > iframe { width: 0;}
- #dsq-content #dsq-form-area .dsq-attach-media-container iframe { height: 13px; padding: 0;}
-</style>
- </body>
-</html>
@@ -0,0 +1 @@
+c({"name": "FuncUnit", "children": ["funcunit.actions", "funcunit.getters", "funcunit.coverage", "funcunit.demos", "funcunit.features", "funcunit.finding", "funcunit.integrations", "funcunit.remote", "funcunit.waits"]})
@@ -0,0 +1 @@
+c({"name": "ajaxy", "type": "page", "comment": "<p>This tutorial walks you through building a simple widget\nthat listens for changes in the browser location hash\nand updates the content of the page. It demonstrates how to make\na site Google crawlable and searchable.</p>\n\n<h2>The App</h2>\n\n<p>We'll make a mini app that updates the contents of page with an\nAjax request when a user clicks on a navigation link. Then, we'll make this searchable\nwith the <code>ajaxy/scripts/crawl.js</code> script.</p>\n\n<div class='demo_wrapper' data-demo-src='tutorials/ajaxy/ajaxy.html'></div>\n\n<p>The crawl script generates html pages that Google can use as a representation\nof the content of an Ajax application. Read Google's documentation on its\n[http://code.google.com/web/ajaxcrawling/docs/getting-started.html Ajax crawling API]\n before continuing this tutorial.</p>\n\n<h2>Setup</h2>\n\n<p>[installing Download and install] the latest version of JavaScriptMVC.</p>\n\n<p>After installing JavaScriptMVC, open a command line to \nthe [steal.static.root steal.root] folder (where you unzipped \nJavaScriptMVC). </p>\n\n<p>We'll use the application generator to generate an application\nskeleton folder. Run:</p>\n\n<pre><code>js jquery/generate/app ajaxy\n</code></pre>\n\n<h2>The Code</h2>\n\n<p>In the generated ajaxy folder, you'll find <code>ajaxy.html</code>\nand <code>ajaxy.js</code>. We'll add a content area\nand few links to \n<code>ajaxy.html</code>. When we click on links,\nwe'll make <code>ajaxy.js</code> load content into\nthe content area.</p>\n\n<p>Change <code>ajaxy.html</code> so it looks like:</p>\n\n<pre><code class='xml'>&lt;!DOCTYPE HTML>\n&lt;html lang=\"en\">\n &lt;head>\n &lt;title>Ajaxy&lt;/title>\n &lt;meta name=\"fragment\" content=\"!\">\n &lt;/head>\n &lt;body>\n &lt;a href='#!videos'>Videos&lt;/a>\n &lt;a href='#!articles'>Articles&lt;/a>\n &lt;a href='#!images'>Images&lt;/a>\n &lt;div id='content'>&lt;/div>\n &lt;script type='text/javascript' \n src='../steal/steal.js?ajaxy,development'> \n &lt;/script>\n &lt;/body>\n&lt;/html></code></pre>\n\n<p>Notice that the page includes a <code>&lt;meta name=\"fragment\" content=\"!\"&gt;</code>\ntag. This tells to Google to process <code>ajaxy.html</code> as having Ajax content.</p>\n\n<p>Next, add some content to show when these links are clicked. Put the following content\nin each file:</p>\n\n<p><strong>ajaxy/fixtures/articles.html</strong></p>\n\n<pre><code class='xml'>&lt;h1>Articles&lt;/h1>\n&lt;p>Some articles.&lt;/p></code></pre>\n\n<p><strong>ajaxy/fixtures/images.html</strong></p>\n\n<pre><code class='xml'>&lt;h1>Images&lt;/h1>\n&lt;p>Some images.&lt;/p></code></pre>\n\n<p><strong>ajaxy/fixtures/videos.html</strong></p>\n\n<pre><code class='xml'>&lt;h1>Videos&lt;/h1>\n&lt;p>Some videos.&lt;/p></code></pre>\n\n<p>Finally, change <code>ajaxy.js</code> to look like:</p>\n\n<pre><code>steal('jquery/controller',\n 'jquery/event/hashchange', \n 'steal/html',function(){\n\n$.Controller('Ajaxy',{\n init : function(){\n this.updateContent()\n },\n \"{window} hashchange\" : function(){\n this.updateContent();\n },\n updateContent : function(){\n var hash = window.location.hash.substr(2),\n url = \"fixtures/\"+(hash || \"videos\")+\".html\";\n\n // postpone reading the html \n steal.html.wait();\n\n $.get(url, {}, this.callback('replaceContent'),\"text\" )\n },\n replaceContent : function(html){\n this.element.html(html);\n\n // indicate the html is ready to be crawled\n steal.html.ready();\n }\n})\n\n$('#content').ajaxy();\n\n});\n</code></pre>\n\n<p>When a hashchange (<code>\"{window} hashchange\"</code>) event occurs, Ajaxy\nuses the <code>window.location.hash</code> value to make a \nrequest (<code>$.get</code>)\nfor content in the<code>fixtures</code> folder. </p>\n\n<p>When the content is retrieved, it replaces the element's \nhtml (<code>this.element.html(...)</code>).</p>\n\n<p>Ajaxy also calls <code>updateContent</code> to load content when\nthe page loads initially. </p>\n\n<h2>Crawling and scraping</h2>\n\n<p>To crawl your site and generate google-searchable html, run:</p>\n\n<pre><code class='none'>js ajaxy/scripts/crawl.js</code></pre>\n\n<p>This script peforms the following actions:</p>\n\n<ol>\n<li>Opens a page in a headless browser.</li>\n<li>Waits until its content is ready.</li>\n<li>Scrapes its contents.</li>\n<li>Writes the contents to a file.</li>\n<li>Adds any links in the page that start with #! to be indexed</li>\n<li>Changes <code>window.location.hash</code> to the next index-able page</li>\n<li>Goto #2 and repeats until all pages have been loaded</li>\n</ol>\n\n<h2>Pausing the html scraping.</h2>\n\n<p>By default, the contents are scraped immediately after the page's scripts have loaded or\nthe window.location.hash has changed. The Ajax request for content\nhappens asynchronously so we have to tell [steal.html] to wait to scrape the content.</p>\n\n<p>To do this, Ajaxy calls:</p>\n\n<pre><code>steal.html.wait();\n</code></pre>\n\n<p>before the Ajax request. And when the page is ready, Ajaxy calls:</p>\n\n<pre><code>steal.html.ready();\n</code></pre>\n\n<h2>Getting Google To Crawl Your Site</h2>\n\n<p>If you haven't already, read up on \nGoogle's [http://code.google.com/web/ajaxcrawling/docs/getting-started.html Ajax crawling API].</p>\n\n<p>When google wants to crawl your site, it will send a \nrequest to your page with <code>_escaped_fragment=</code>. </p>\n\n<p>When your server sees this param, redirect google to the generated html page. For example, when the Google Spider requests <code>http://mysite.com?_escaped_fragment=val</code>, this is its attempt to crawl <code>http://mysite.com#!val</code>. You should redirect this request to <code>http://mysite.com/html/val.html</code>.</p>\n\n<p>Yes, it's that easy!</p>\n\n<h2>Phantom for Advanced Pages</h2>\n\n<p>By default the crawl script uses EnvJS to open your page and build a static snapshot. For some pages, EnvJS won't be powerful enough to accurately simulate everything. If your page experiences errors, you can use PhantomJS (headless Webkit) to generate snapshots instead, which may work better.</p>\n\n<p>To turn on Phantom:</p>\n\n<ol>\n<li>Install it using the install instructions [funcunit.phantomjs here]</li>\n<li><p>Open scripts/crawl.js and change the second parameter of steal.html.crawl to an options object with a browser option, like this:</p>\n\n<p>steal('steal/html', function(){\n steal.html.crawl(\"ajaxy/ajaxy.html\", \n {\n out: 'ajaxy/out',\n browser: 'phantomjs'\n })\n})</p></li>\n</ol>", "title": "Searchable Ajax Apps", "parents": ["tutorials"], "order": 7, "src": "tutorials/ajaxy/ajaxy.md", "children": []})
@@ -0,0 +1 @@
+c({"name": "compressing", "type": "page", "comment": "<p>There is a large overhead associated with downloading many JavaScript files. \nServer side compression makes it simple to concatenate and compress your code into one file.</p>\n<h2>Compress Script\n</h2>\n<p>To compress your application, run the following command from a console:\n</p>\n\n<p><pre><code class='javascript'>C:\\workspace\\Cookbook>js cookbook\\scripts\\build.js\n steal/steal.js\n ...\n ignore ../steal/dev/dev.js\n ...\nPackage #0: 'cookbook/production.js'.</code></pre><p>Verify that production.js was created by checking your <b>'cookbook'</b> folder.</p></p>\n\n<h2>Switch to Production Mode</h2>\n\n<p>Switch to production mode by changing the script tag to include steal.production.js:\n</p>\n\n<p><pre><code class='html'>&lt;script type='text/javascript' \n src='../steal/steal.<span style=\"text-decoration:underline;\"><b>production</b></span>.js?cookbook'>\n&lt;/script></code></pre><h2>Reload and verify</h2></p>\n\n<p>Reload your page. Only two JavaScript files will load: steal.production.js and production.js. \nNot bad considering 28 files are loaded in development mode.</p>\n\n<p>When you're ready, learn how to [documenting Document Cookbook]</p>", "title": "Compressing Cookbook", "parents": ["getstarted"], "order": 2, "src": "tutorials/getstarted/compressing.md", "children": []})
@@ -0,0 +1 @@
+c({"name": "contacts.dc", "type": "page", "comment": "<p>The secret to building large applications is never build large applications. Understanding how to divide your application is the first step towards maintainable architecture. This section covers why and how to divide up your app and uses contacts as an example.</p>\n\n<h2>Isolation</h2>\n\n<p>The goal for dividing your application should be to create modules that are isolated.</p>\n\n<p>Isolated modules are dumb, lonely, and replaceable. Dumb because they are limited to one specific purpose, for example showing a list of data. Lonely because they rarely reference other modules. Replaceable because they have a simple API, making them easy to swap out.</p>\n\n<p>Isolated modules are easily testable because they have a small, well defined scope. Each piece can be worked on in parallel because the code is divided. Reuse is easier because the modules are not coupled to each other.</p>\n\n<h2>Dividing Contacts</h2>\n\n<p>The contacts app has 3 lists that filter the grid of contacts. You can create additional categories and contacts by clicking the 'new' icon.</p>\n\n<p>The application can be divided up into a few widgets:</p>\n\n<ul>\n<li>List - accepts a generic data source and layout, renders and updates the list.</li>\n<li>Grid - accepts a generic data source, renders a grid.</li>\n<li>Sort - sorts the grid items.</li>\n<li>Create - renders a form to create a new instance from a data source.</li>\n</ul>\n\n<p>Heres a visual representation of how this app is broken up into modules.</p>\n\n<p><img class='image_tag' src='tutorials/images/contacts_widgets.jpg' /></p>\n\n<h2>Folder Structure</h2>\n\n<p>The code for these widgets is divided into three top level folders: MXUI, Jupiter, and Contacts.</p>\n\n<h3>MXUI</h3>\n\n<p>[https://github.com/jupiterjs/mxui MXUI] (jQueryMX User Interface) is a JavaScriptMVC widget library. The Grid and List widgets from MXUI are used in Contacts.</p>\n\n<h3>Jupiter</h3>\n\n<p>Each isolated module lives in its own directory. Those directories are then grouped in a namespace, for example <em>Jupiter</em> or the name of your company. These modules are intended to be reused across applications.</p>\n\n<p>The Jupiter folder contains:</p>\n\n<ul>\n<li>create - renders a form to create a new instance from a data source.</li>\n<li>style - attaches jQuery UI styles to elements.</li>\n<li>scrollable_grid - creates a infinitely scrollable grid using the MXUI grid. </li>\n</ul>\n\n<h3>Contacts</h3>\n\n<p>Finally, we need a widget that loads the modules and ties them together into a application. In this application, the contacts folder contains this 'application widget'.</p>\n\n<p>This widget will be where the application starts, loading each module, initializing them, and gluing them together.</p>\n\n<pre><code>$.Controller(\"Contacts.Controller\", {\n init: function(){\n\n this.params = new Mxui.Data();\n\n $(\"#category .list_wrapper\").mxui_data_list({\n model : Contacts.Models.Category,\n show : \"//contacts/views/categoryList\",\n create: \"//contacts/views/categoryCreate\"\n });\n\n $(\"#location .list_wrapper\").mxui_data_list({\n model : Contacts.Models.Location,\n show : \"//contacts/views/categoryList\",\n create: \"//contacts/views/categoryCreate\"\n });\n</code></pre>\n\n<p>The contacts widget listens for events using event delegation and communicates with cousin widgets.</p>\n\n<pre><code>\"#category .list_wrapper activate\": function(el, ev, item){\n this.params.attr(\"categoryId\", item.id);\n}, \n\"#category .list_wrapper deactivate\": function(el, ev, item){\n this.params.attr(\"categoryId\", null);\n}\n</code></pre>\n\n<p>In the [contacts.glue Gluing Modules Together] section, we will touch more on the pattern used to facilitate this cross-widget communication.</p>\n\n<p>Additionally in the contacts folder, you will find the building blocks of any JavascriptMVC application: models for communication with the server, fixtures for simulating AJAX responses from the server, and functional tests for testing the application.</p>\n\n<p>In the next section, we will get into more detail about [contacts.designing how to design each module].</p>", "title": "Divide and Conquer", "parents": ["contacts"], "order": 0, "src": "tutorials/examples/contacts/dc.md", "children": []})
Oops, something went wrong.

0 comments on commit d1d39c4

Please sign in to comment.