Permalink
Browse files

merge develop into develop-perf

  • Loading branch information...
drewfish committed Oct 15, 2012
1 parent 6403297 commit e5a44b3ee9225b838549716d5143ba3729446d20
Showing with 2,381 additions and 1,951 deletions.
  1. +12 −6 docs/dev_guide/api_overview/index.rst
  2. +10 −7 docs/dev_guide/api_overview/mojito_action_context.rst
  3. +11 −5 docs/dev_guide/api_overview/mojito_addons.rst
  4. +4 −4 docs/dev_guide/api_overview/mojito_rest_lib.rst
  5. +4 −3 docs/dev_guide/code_exs/adding_assets.rst
  6. +10 −10 docs/dev_guide/code_exs/binding_events.rst
  7. +7 −7 docs/dev_guide/code_exs/calling_yql.rst
  8. +7 −6 docs/dev_guide/code_exs/cookies.rst
  9. +4 −4 docs/dev_guide/code_exs/dynamic_assets.rst
  10. +8 −5 docs/dev_guide/code_exs/framed_assets.rst
  11. +4 −4 docs/dev_guide/code_exs/generating_urls.rst
  12. +2 −2 docs/dev_guide/code_exs/global_assets.rst
  13. +2 −2 docs/dev_guide/code_exs/htmlframe_view.rst
  14. +8 −8 docs/dev_guide/code_exs/i18n_apps.rst
  15. +12 −12 docs/dev_guide/code_exs/intermojit_communication.rst
  16. +10 −10 docs/dev_guide/code_exs/multiple_mojits.rst
  17. +2 −2 docs/dev_guide/code_exs/query_params.rst
  18. +2 −2 docs/dev_guide/code_exs/route_config.rst
  19. +8 −8 docs/dev_guide/code_exs/scroll_views.rst
  20. +1 −1 docs/dev_guide/code_exs/simple_logging.rst
  21. +4 −3 docs/dev_guide/code_exs/simple_view_template.rst
  22. +1 −1 docs/dev_guide/code_exs/view_engines.rst
  23. +2 −2 docs/dev_guide/code_exs/views_multiple_devices.rst
  24. +6 −4 docs/dev_guide/code_exs/yui_modules.rst
  25. +1 −1 docs/dev_guide/getting_started/mojito_getting_started_tutorial.rst
  26. +208 −149 docs/dev_guide/intro/mojito_configuring.rst
  27. +37 −38 docs/dev_guide/intro/mojito_mvc.rst
  28. +4 −6 docs/dev_guide/topics/mojito_assets.rst
  29. +4 −6 docs/dev_guide/topics/mojito_composite_mojits.rst
  30. +20 −20 docs/dev_guide/topics/mojito_data.rst
  31. +5 −7 docs/dev_guide/topics/mojito_extensions.rst
  32. +4 −6 docs/dev_guide/topics/mojito_framework_mojits.rst
  33. +126 −103 docs/dev_guide/topics/mojito_logging.rst
  34. +4 −6 docs/dev_guide/topics/mojito_npm.rst
  35. +5 −5 docs/dev_guide/topics/mojito_resource_store.rst
  36. +22 −25 docs/dev_guide/topics/mojito_run_dyn_defined_mojits.rst
  37. +174 −4 docs/dev_guide/topics/mojito_testing.rst
  38. +30 −29 examples/developer-guide/adding_view_engines/addons/view-engines/ejs.server.js
  39. +27 −25 examples/developer-guide/adding_view_engines/mojits/myMojit/controller.server.js
  40. +3 −1 examples/developer-guide/binding_events/index.js
  41. +83 −81 examples/developer-guide/binding_events/mojits/PagerMojit/binders/index.js
  42. +74 −64 examples/developer-guide/binding_events/mojits/PagerMojit/controller.server.js
  43. +50 −44 examples/developer-guide/binding_events/mojits/PagerMojit/models/model.server.js
  44. +4 −3 examples/developer-guide/configure_routing/mojits/RoutingMojit/binders/index.js
  45. +41 −39 examples/developer-guide/configure_routing/mojits/RoutingMojit/controller.server.js
  46. +6 −4 examples/developer-guide/configure_routing/mojits/RoutingMojit/models/model.server.js
  47. +32 −30 examples/developer-guide/device_assets/mojits/device/controller.server.js
  48. +5 −3 examples/developer-guide/device_views/mojits/device/binders/index.js
  49. +17 −15 examples/developer-guide/device_views/mojits/device/controller.server.js
  50. +6 −4 examples/developer-guide/device_views/mojits/device/models/model.server.js
  51. +5 −3 examples/developer-guide/framed_assets/mojits/framed/binders/index.js
  52. +21 −19 examples/developer-guide/framed_assets/mojits/framed/controller.server.js
  53. +6 −4 examples/developer-guide/framed_assets/mojits/framed/models/model.server.js
  54. +4 −2 examples/developer-guide/framed_config/mojits/MainMojit/binders/binder.js
  55. +22 −20 examples/developer-guide/framed_config/mojits/MainMojit/controller.server.js
  56. +5 −3 examples/developer-guide/framed_config/mojits/MainMojit/models/model.server.js
  57. +5 −3 examples/developer-guide/generating_urls/mojits/GenURLMojit/binders/index.js
  58. +17 −14 examples/developer-guide/generating_urls/mojits/GenURLMojit/controller.server.js
  59. +6 −4 examples/developer-guide/generating_urls/mojits/GenURLMojit/models/model.server.js
  60. +4 −2 examples/developer-guide/global_assets/mojits/OhHai/controller.server.js
  61. +5 −3 examples/developer-guide/hello/mojits/HelloMojit/binders/index.js
  62. +5 −3 examples/developer-guide/hello/mojits/HelloMojit/controller.server.js
  63. +6 −4 examples/developer-guide/hello/mojits/HelloMojit/models/model.server.js
  64. +5 −3 examples/developer-guide/htmlframe_mojit/mojits/framed/binders/index.js
  65. +11 −9 examples/developer-guide/htmlframe_mojit/mojits/framed/controller.server.js
  66. +6 −4 examples/developer-guide/htmlframe_mojit/mojits/framed/models/model.server.js
  67. +5 −3 examples/developer-guide/inter-mojit/index.js
  68. +9 −7 examples/developer-guide/inter-mojit/mojits/MasterMojit/binders/index.js
  69. +6 −4 examples/developer-guide/inter-mojit/mojits/MasterMojit/controller.server.js
  70. +6 −4 examples/developer-guide/inter-mojit/mojits/ReceiverMojit/binders/index.js
  71. +8 −6 examples/developer-guide/inter-mojit/mojits/ReceiverMojit/controller.server.js
  72. +6 −4 examples/developer-guide/inter-mojit/mojits/SenderMojit/binders/index.js
  73. +5 −3 examples/developer-guide/inter-mojit/mojits/SenderMojit/controller.server.js
  74. +4 −2 examples/developer-guide/locale_i18n/mojits/i18n/binders/index.js
  75. +14 −14 examples/developer-guide/locale_i18n/mojits/i18n/controller.server.js
  76. +11 −9 examples/developer-guide/locale_i18n/mojits/i18n/lang/i18n_en-AU.js
  77. +11 −9 examples/developer-guide/locale_i18n/mojits/i18n/lang/i18n_en-US.js
  78. +11 −9 examples/developer-guide/locale_i18n/mojits/i18n/lang/i18n_fr-FR.js
  79. +6 −4 examples/developer-guide/locale_i18n/mojits/i18n/models/model.server.js
  80. +4 −2 examples/developer-guide/model_yql/mojits/flickr/binders/index.js
  81. +34 −32 examples/developer-guide/model_yql/mojits/flickr/controller.server.js
  82. +48 −49 examples/developer-guide/model_yql/mojits/flickr/models/model.server.js
  83. +4 −2 examples/developer-guide/multiple_mojits/mojits/BodyMojit/binders/index.js
  84. +11 −9 examples/developer-guide/multiple_mojits/mojits/BodyMojit/controller.server.js
  85. +6 −4 examples/developer-guide/multiple_mojits/mojits/BodyMojit/models/model.server.js
  86. +5 −3 examples/developer-guide/multiple_mojits/mojits/FooterMojit/binders/index.js
  87. +10 −8 examples/developer-guide/multiple_mojits/mojits/FooterMojit/controller.server.js
  88. +6 −4 examples/developer-guide/multiple_mojits/mojits/FooterMojit/models/model.server.js
  89. +4 −2 examples/developer-guide/multiple_mojits/mojits/FrameMojit/binders/index.js
  90. +10 −8 examples/developer-guide/multiple_mojits/mojits/FrameMojit/controller.server.js
  91. +6 −4 examples/developer-guide/multiple_mojits/mojits/FrameMojit/models/model.server.js
  92. +5 −3 examples/developer-guide/multiple_mojits/mojits/HeaderMojit/binders/index.js
  93. +11 −9 examples/developer-guide/multiple_mojits/mojits/HeaderMojit/controller.server.js
  94. +6 −4 examples/developer-guide/multiple_mojits/mojits/HeaderMojit/models/model.server.js
  95. +6 −4 examples/developer-guide/scroll_views/index.js
  96. +9 −7 examples/developer-guide/scroll_views/mojits/scroll/binders/binder.js
  97. +32 −30 examples/developer-guide/scroll_views/mojits/scroll/controller.server.js
  98. +2 −0 examples/developer-guide/scroll_views/mojits/scroll/lang/scroll_en.js
  99. +11 −9 examples/developer-guide/scroll_views/mojits/scroll/models/model.server.js
  100. +2 −0 examples/developer-guide/simple_assets/mojits/simple/binders/index.js
  101. +37 −35 examples/developer-guide/simple_assets/mojits/simple/controller.server.js
  102. +6 −4 examples/developer-guide/simple_assets/mojits/simple/models/model.server.js
  103. +5 −3 examples/developer-guide/simple_config/mojits/SimpleMojit/binders/index.js
  104. +5 −3 examples/developer-guide/simple_config/mojits/SimpleMojit/controller.server.js
  105. +6 −4 examples/developer-guide/simple_config/mojits/SimpleMojit/models/model.server.js
  106. +8 −6 examples/developer-guide/simple_logging/mojits/log/binders/index.js
  107. +28 −26 examples/developer-guide/simple_logging/mojits/log/controller.server.js
  108. +8 −6 examples/developer-guide/simple_logging/mojits/log/models/foo.server.js
  109. +5 −3 examples/developer-guide/simple_view/mojits/simple/binders/index.js
  110. +23 −19 examples/developer-guide/simple_view/mojits/simple/controller.server.js
  111. +6 −4 examples/developer-guide/simple_view/mojits/simple/models/model.server.js
  112. +15 −11 examples/developer-guide/unittest_model_controller/mojits/flickr/binders/index.js
  113. +25 −24 examples/developer-guide/unittest_model_controller/mojits/flickr/controller.server.js
  114. +50 −49 examples/developer-guide/unittest_model_controller/mojits/flickr/models/model.server.js
  115. +7 −4 examples/developer-guide/using_configs/mojits/ContactUs/controller.server.js
  116. +5 −3 examples/developer-guide/using_cookies/mojits/CookieMojit/binders/index.js
  117. +20 −18 examples/developer-guide/using_cookies/mojits/CookieMojit/controller.server.js
  118. +6 −4 examples/developer-guide/using_cookies/mojits/CookieMojit/models/model.server.js
  119. +5 −3 examples/developer-guide/using_parameters/mojits/QueryMojit/binders/index.js
  120. +75 −73 examples/developer-guide/using_parameters/mojits/QueryMojit/controller.server.js
  121. +6 −4 examples/developer-guide/using_parameters/mojits/QueryMojit/models/model.server.js
  122. +241 −240 examples/developer-guide/yui_module/autoload/storage-lite.client.js
  123. +5 −3 examples/developer-guide/yui_module/mojits/Notepad/binders/index.js
  124. +4 −2 examples/developer-guide/yui_module/mojits/Notepad/controller.server.js
  125. +8 −14 lib/app/archetypes/app/default/index.js
  126. +23 −4 lib/app/archetypes/app/default/server.js
  127. +8 −14 lib/app/archetypes/app/full/index.js
  128. +23 −4 lib/app/archetypes/app/full/server.js
  129. +23 −4 lib/app/archetypes/app/simple/server.js
  130. +0 −37 lib/app/archetypes/mojit/default/tests/binders/index.client-tests.js.hb
  131. +0 −36 lib/app/archetypes/mojit/full/tests/binders/index.clients-test.js.hb
  132. +3 −4 lib/app/commands/build.js
  133. +2 −2 lib/app/commands/compile.js
  134. +1 −1 lib/app/commands/start.js
  135. +8 −2 lib/app/middleware/mojito-handler-static.js
  136. +8 −5 lib/index.js
  137. +3 −3 lib/management/cli.js
  138. +53 −37 lib/mojito.js
  139. +14 −7 tests/func/examples/developerguide/test_simple_view.js
  140. +3 −19 tests/unit/lib/test-mojito.js
@@ -3,15 +3,21 @@
Mojito API Overview
===================
-This section introduces some of the main features of the Mojito API. Please see the `Mojito API documentation <../../api/>`_ that has been built using `YUI Doc <http://yuilibrary.com/projects/yuidoc>`_ and is continuously updated.
+This section introduces some of the main features of the Mojito API. Please see the
+`Mojito API documentation <../../api/>`_ that has been built using
+`YUI Doc <http://yuilibrary.com/projects/yuidoc>`_ and is continuously updated.
The API contains the following five modules:
-- **ActionContext** - is a key module of the Mojito framework, giving you access to the frameworks features from within a controller function.
-- **Addons** - extensions that provide functionality that lives both on the server and/or client. Each addon provides additional functions through a namespace that is attached directly to the ``Action Context`` object available in every controller function.
-- **CommonLibs** - is a utility library containing methods to handle cookies, access input parameters, and make REST calls.
-- **MojitoClient** - is the client-side Mojito runtime module containing methods that allow inter-mojit communication through the ``mojitProxy`` object.
-
+- **ActionContext** - is a key module of the Mojito framework, giving you access to the frameworks
+ features from within a controller function.
+- **Addons** - extensions that provide functionality that lives both on the server and/or client.
+ Each addon provides additional functions through a namespace that is attached directly to the
+ ``Action Context`` object available in every controller function.
+- **CommonLibs** - is a utility library containing methods to handle cookies, access input
+ parameters, and make REST calls.
+- **MojitoClient** - is the client-side Mojito runtime module containing methods that allow
+ inter-mojit communication through the ``mojitProxy`` object.
- **MojitServer** - is the module that provides access to the Mojito server.
@@ -4,16 +4,19 @@
Action Context
==============
-The Action Context is an essential element of the Mojito framework that gives you access to the frameworks features from within a controller function. To use the Action Context,
-you create an instance of the ``ActionContext`` class, which we will call ``ac`` for short. From ``ac``, you can call methods to execute mojit actions within either a server or
-client context. See the `ActionContext Class <../../api/classes/ActionContext.html>`_ for the methods available from ``ac``.
-
-One of the most common methods used from an instance of the ``ActionContext`` class is ``done``, which lets you pass data from the controller to a view. In the example ``controller.server.js`` below,
+The Action Context is an essential element of the Mojito framework that gives you access to the
+frameworks features from within a controller function. To use the Action Context, you create an
+instance of the ``ActionContext`` class, which we will call ``ac`` for short. From ``ac``, you can
+call methods to execute mojit actions within either a server or client context. See the
+`ActionContext Class <../../api/classes/ActionContext.html>`_ for the methods available from ``ac``.
+
+One of the most common methods used from an instance of the ``ActionContext`` class is ``done``,
+which lets you pass data from the controller to a view. In the example ``controller.server.js`` below,
the ``done`` method sends the ``data`` object to the ``index`` template.
.. code-block:: javascript
- YUI.add('HelloMojit', function(Y) {
+ YUI.add('HelloMojit', function(Y, NAME) {
/**
* The HelloMojit module.
*
@@ -25,7 +28,7 @@ the ``done`` method sends the ``data`` object to the ``index`` template.
* @class Controller
* @constructor
*/
- Y.mojito.controller = {
+ Y.namespace('mojito.controllers')[NAME] = {
init: function(config) {
this.config = config;
},
@@ -4,8 +4,10 @@
Addons
======
-The Action Context uses a mechanism called addons to provide functionality that lives both on the server and client. Each addon provides additional functions through a namespacing object,
-which is appended to the ``ActionContext`` object that is available in every controller function. See the `ActionContext Class <../../api/classes/ActionContext.html>`_ for the addon classes.
+The Action Context uses a mechanism called addons to provide functionality that lives both on the
+server and client. Each addon provides additional functions through a namespacing object,
+which is appended to the ``ActionContext`` object that is available in every controller function.
+See the `ActionContext Class <../../api/classes/ActionContext.html>`_ for the addon classes.
Addons allow you to do the following:
@@ -20,11 +22,13 @@ Addons allow you to do the following:
Syntax
######
-Using the ActionContext object ``ac``, you would call a ``{method}`` from an ``{addon}`` with the following syntax:
+Using the ActionContext object ``ac``, you would call a ``{method}`` from an ``{addon}`` with the
+following syntax:
``ac.{addon}.{method}``
-For example, to get all of the query string parameters, you would use the ``Params`` addon with the ``url`` method as seen here:
+For example, to get all of the query string parameters, you would use the ``Params`` addon with the
+``url`` method as seen here:
``ac.params.url()``
@@ -43,6 +47,8 @@ The following code examples use the addons in parentheses:
Creating Addons
###############
-Because customized addons are not part of the standard API, but an extension of the API, the instructions for creating addons can be found in `Creating New Addons <../topics/mojito_extensions.html#creating-new-addons>`_.
+Because customized addons are not part of the standard API, but an extension of the API, the
+instructions for creating addons can be found in
+`Creating New Addons <../topics/mojito_extensions.html#creating-new-addons>`_.
@@ -17,7 +17,7 @@ instructs YUI to load the library. Once the library is loaded, you can use
.. code-block:: javascript
- YUI.add('MyModel', function(Y) {
+ YUI.add('MyModel', function(Y, NAME) {
...
// Make the REST call.
Y.mojito.lib.REST.GET("http://example.com");
@@ -33,9 +33,9 @@ the Recipe Puppy API.
.. code-block:: javascript
- YUI.add('ProductSearchModel', function(Y) {
- Y.mojito.models.RecipeSearch = {
- init: function(config) {
+ YUI.add('ProductSearchModel', function(Y, NAME) {
+ Y.namespace('mojito.models')[NAME] = {
+ init: function(config) {
this.config = config;
},
recipeSearch: function(count, cb) {
@@ -171,7 +171,7 @@ To create and run ``simple_assets``:
.. code-block:: javascript
- YUI.add('simple', function(Y,NAME) {
+ YUI.add('simple', function(Y, NAME) {
/**
* The simple module.
*
@@ -183,7 +183,7 @@ To create and run ``simple_assets``:
* @class Controller
* @constructor
*/
- Y.mojito.controllers[NAME] = {
+ Y.namespace('mojito.controllers')[NAME] = {
init: function(config) {
this.config = config;
},
@@ -208,7 +208,8 @@ To create and run ``simple_assets``:
};
}, '0.0.1', {requires: []});
-#. Include the assets in your template by replacing the code in ``views/index.hb.html`` with the following:
+#. Include the assets in your template by replacing the code in ``views/index.hb.html`` with the
+ following:
.. code-block:: html
@@ -61,7 +61,7 @@ get Flickr photo information. To access the utility in your model, specify ``'yq
.. code-block:: javascript
- YUI.add('PagerMojitModel', function(Y,NAME) {
+ YUI.add('PagerMojitModel', function(Y, NAME) {
...
/* Code for PagerMojitModel */
...
@@ -87,7 +87,7 @@ the controller through the ``callback`` function.
.. code-block:: javascript
- YUI.add('PagerMojitModel', function(Y,NAME) {
+ YUI.add('PagerMojitModel', function(Y, NAME) {
/**
* The PagerMojitModel module.
* @module PagerMojitModel
@@ -97,7 +97,7 @@ the controller through the ``callback`` function.
* @class Model
* @constructor
**/
- Y.mojito.models.simple = {
+ Y.namespace('mojito.models')[NAME] = {
init: function(config) {
this.config = config;
},
@@ -502,7 +502,7 @@ the **next** and **prev** links.
.. code-block:: javascript
- YUI.add('PagerMojit', function(Y,NAME) {
+ YUI.add('PagerMojit', function(Y, NAME) {
/**
* The PagerMojit module.
* @module PagerMojit */
@@ -512,7 +512,7 @@ the **next** and **prev** links.
* @class Controller
* @constructor
*/
- Y.mojito.controllers[NAME] = {
+ Y.namespace('mojito.controllers')[NAME] = {
init: function(config) {
this.config = config;
},
@@ -624,14 +624,14 @@ To set up and run ``binding_events``:
.. code-block:: javascript
- YUI.add('PagerMojit', function(Y,NAME) {
+ YUI.add('PagerMojit', function(Y, NAME) {
var PAGE_SIZE = 10;
/**
* Constructor for the Controller class.
* @class Controller
* @constructor
*/
- Y.mojito.controllers[NAME] = {
+ Y.namespace('mojito.controllers')[NAME] = {
init: function(config) {
this.config = config;
},
@@ -686,7 +686,7 @@ To set up and run ``binding_events``:
.. code-block:: javascript
- YUI.add('PagerMojitModel', function(Y,NAME) {
+ YUI.add('PagerMojitModel', function(Y, NAME) {
/**
* The PagerMojitModel module.
* @module PagerMojitModel
@@ -696,7 +696,7 @@ To set up and run ``binding_events``:
* @class Model
* @constructor
*/
- Y.mojito.models.PagerMojit = {
+ Y.namespace('mojito.models')[NAME] = {
init: function(config) {
this.config = config;
},
@@ -885,4 +885,4 @@ Source Code
- `Application Configuration <http://github.com/yahoo/mojito/tree/master/examples/developer-guide/binding_events/application.json>`_
- `Mojit Binder <http://github.com/yahoo/mojito/tree/master/examples/developer-guide/binding_events/mojits/PagerMojit/binders/index.js>`_
-- `Binding Events Application <http://github.com/yahoo/mojito/tree/master/examples/developer-guide/binding_events/>`_
+- `Binding Events Application <http://github.com/yahoo/mojito/tree/master/examples/developer-guide/binding_events/>`_
@@ -92,10 +92,10 @@ function.
.. code-block: javascript
- YUI.add('flickrModel', function(Y,NAME) {
+ YUI.add('flickrModel', function(Y, NAME) {
// Flickr requires an API key
var API_KEY = '84921e87fb8f2fc338c3ff9bf51a412e';
- Y.mojito.models.flickr = {
+ Y.namespace('mojito.models')[NAME] = {
init: function(config) {
this.config = config;
},
@@ -176,8 +176,8 @@ the ``index`` template.
.. code-block:: javascript
- YUI.add('flickr', function(Y,NAME) {
- Y.mojito.controllers[NAME] = {
+ YUI.add('flickr', function(Y, NAME) {
+ Y.namespace('mojito.controllers')[NAME] = {
init: function(config) {
this.config = config;
},
@@ -265,11 +265,11 @@ To set up and run ``model_yql``:
.. code-block:: javascript
- YUI.add('flickrModel', function(Y,NAME) {
+ YUI.add('flickrModel', function(Y, NAME) {
// Replace '{Flickr API Key}' with your own Flickr
// API key.
var API_KEY = '{Flickr API Key}';
- Y.mojito.models.flickr = {
+ Y.namespace('mojito.models')[NAME] = {
init: function(config) {
this.config = config;
},
@@ -325,7 +325,7 @@ To set up and run ``model_yql``:
.. code-block:: javascript
- YUI.add('flickrModel', function(Y,NAME) {
+ YUI.add('flickrModel', function(Y, NAME) {
// Replace '{Flickr API Key}' with your own Flickr
// API key.
var API_KEY = '{Flickr API Key}';
@@ -34,8 +34,8 @@ these methods for getting and setting cookies should be familiar as Mojito uses
.. code-block:: javascript
- YUI.add('CookieMojit', function(Y,NAME) {
- Y.mojito.controllers[NAME] = {
+ YUI.add('CookieMojit', function(Y, NAME) {
+ Y.namespace('mojito.controllers')[NAME] = {
init: function(config) {
this.config = config;
},
@@ -65,7 +65,8 @@ cookie. To use the YUI Cookie module, first include the module with ``YUI().use`
<div id="{{mojit_view_id}}" class="mojit">
<h2>{{title}}</h2>
<div>
- <p>This is a demo showing how to read read cookies from browser, and how to write cookies to browser from the Mojit.</p>
+ <p>This is a demo showing how to read read cookies from browser, and how to write cookies to
+ browser from the Mojit.</p>
</div>
<div>
<p>Value of request cookie sent by browser: {{request_cookie_value}}</p>
@@ -140,8 +141,8 @@ To set up and run ``using_cookies``:
.. code-block:: javascript
- YUI.add('CookieMojit', function(Y,NAME) {
- Y.mojito.controllers[NAME] = {
+ YUI.add('CookieMojit', function(Y, NAME) {
+ Y.namespace('mojito.controllers')[NAME] = {
init: function(config) {
this.config = config;
},
@@ -201,4 +202,4 @@ Source Code
===========
- `Mojit Controller <http://github.com/yahoo/mojito/tree/master/examples/developer-guide/using_cookies/mojits/CookieMojit/controller.server.js>`_
-- `Using Cookie Application <http://github.com/yahoo/mojito/tree/master/examples/developer-guide/using_cookies/>`_
+- `Using Cookie Application <http://github.com/yahoo/mojito/tree/master/examples/developer-guide/using_cookies/>`_
@@ -92,8 +92,8 @@ The appropriate CSS file is dynamically attached to the template with ``ac.asset
.. code-block:: javascript
- YUI.add('device', function(Y,NAME){
- Y.mojito.controllers[NAME] = {
+ YUI.add('device', function(Y, NAME){
+ Y.namespace('mojito.controllers')[NAME] = {
init: function(config) {
this.config = config;
},
@@ -231,8 +231,8 @@ To create and run ``device_assets``:
.. code-block:: javascript
- YUI.add('device', function(Y,NAME){
- Y.mojito.controllers[NAME] = {
+ YUI.add('device', function(Y, NAME){
+ Y.namespace('mojito.controllers')[NAME] = {
init: function(config) {
this.config = config;
},
@@ -103,7 +103,8 @@ To create and run ``framed_assets``:
#. Create your mojit.
``$ mojito create mojit framed``
-#. To configure your application to have assets, replace the code in ``application.json`` with the following:
+#. To configure your application to have assets, replace the code in ``application.json`` with the
+ following:
.. code-block:: javascript
@@ -146,12 +147,13 @@ To create and run ``framed_assets``:
]
#. Change to ``mojits/framed``.
-#. Modify your controller to pass an array of objects to the template by replacing the code in ``controller.server.js`` with the following:
+#. Modify your controller to pass an array of objects to the template by replacing the code in
+ ``controller.server.js`` with the following:
.. code-block:: javascript
- YUI.add('framed', function(Y,NAME) {
- Y.mojito.controllers[NAME] = {
+ YUI.add('framed', function(Y, NAME) {
+ Y.namespace('mojito.controllers')[NAME] = {
init: function(config) {
this.config = config;
},
@@ -171,7 +173,8 @@ To create and run ``framed_assets``:
};
}, '0.0.1', {requires: []});
-#. Include the assets in your template by replacing the code in ``views/index.hb.html`` with the following:
+#. Include the assets in your template by replacing the code in ``views/index.hb.html`` with the
+ following:
.. code-block:: html
Oops, something went wrong.

0 comments on commit e5a44b3

Please sign in to comment.