Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Copy edited the developer guide documentation.

  • Loading branch information...
commit 0e6a84613fdc17c06d565e99582dd6840e95486d 1 parent dc2f56f
@zhouyaoji zhouyaoji authored
Showing with 236 additions and 284 deletions.
  1. +8 −7 docs/dev_guide/api_overview/index.rst
  2. +4 −2 docs/dev_guide/api_overview/mojito_addons.rst
  3. +10 −9 docs/dev_guide/api_overview/mojito_client_obj.rst
  4. +6 −5 docs/dev_guide/api_overview/mojito_rest_lib.rst
  5. +16 −17 docs/dev_guide/code_exs/binding_events.rst
  6. +4 −4 docs/dev_guide/code_exs/cookies.rst
  7. +2 −1  docs/dev_guide/code_exs/framed_assets.rst
  8. +3 −4 docs/dev_guide/code_exs/global_assets.rst
  9. +1 −1  docs/dev_guide/code_exs/htmlframe_view.rst
  10. +2 −2 docs/dev_guide/code_exs/multiple_mojits.rst
  11. +3 −4 docs/dev_guide/code_exs/scroll_views.rst
  12. +2 −2 docs/dev_guide/code_exs/views_multiple_devices.rst
  13. +43 −27 docs/dev_guide/faq/index.rst
  14. +2 −2 docs/dev_guide/getting_started/mojito_getting_started_tutorial.rst
  15. +7 −3 docs/dev_guide/index.rst
  16. +2 −1  docs/dev_guide/intro/mojito_binders.rst
  17. +7 −7 docs/dev_guide/intro/mojito_configuring.rst
  18. +3 −3 docs/dev_guide/intro/mojito_mojits.rst
  19. +1 −1  docs/dev_guide/intro/mojito_mvc.rst
  20. +10 −7 docs/dev_guide/reference/glossary.rst
  21. +54 −54 docs/dev_guide/reference/mojito_cmdline.rst
  22. +1 −2  docs/dev_guide/topics/mojito_composite_mojits.rst
  23. +2 −2 docs/dev_guide/topics/mojito_data.rst
  24. +1 −0  docs/dev_guide/topics/mojito_extensions.rst
  25. +17 −16 docs/dev_guide/topics/mojito_logging.rst
  26. +1 −1  docs/dev_guide/topics/mojito_npm.rst
  27. +9 −9 docs/dev_guide/topics/mojito_resource_store.rst
  28. +1 −1  docs/dev_guide/topics/mojito_run_dyn_defined_mojits.rst
  29. +5 −84 docs/dev_guide/topics/mojito_testing.rst
  30. +9 −6 docs/dev_guide/topics/mojito_using_contexts.rst
View
15 docs/dev_guide/api_overview/index.rst
@@ -9,15 +9,16 @@ This section introduces some of the main features of the Mojito API. Please see
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 when required in a controller.
+- **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 and is available when required in a
+ controller.
- **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.
+- **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.
.. toctree::
View
6 docs/dev_guide/api_overview/mojito_addons.rst
@@ -4,8 +4,10 @@ Action Context 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>`_
+object that is appended to the ``ActionContext`` object. The ``ActionContext`` object
+is available in each controller function, but controllers need to
+:ref:`require addons <addons-requiring>` before accessing addon methods.
+See the `ActionContext Class <../../api/classes/ActionContext.html>`_
for the addon classes.
The Action Context addons allow you to do the following:
View
19 docs/dev_guide/api_overview/mojito_client_obj.rst
@@ -2,19 +2,19 @@
Client Object
=============
-When Mojito starts up, the global object ``Y.mojito.client`` that represents the client runtime is
-created. The ``client`` object can be used to pause and resume mojits running within the page.
-See `Class Y.mojito.Client <../../api/classes/Y.mojito.Client.html>`_ in the
-`Mojito API Reference <../../api/>`_ for more details.
+When Mojito starts up, the global object ``Y.mojito.client`` that represents the client
+runtime is created. The ``client`` object can be used to pause and resume mojits running
+within the page. See `Class Y.mojito.Client <../../api/classes/Y.mojito.Client.html>`_ in
+the `Mojito API Reference <../../api/>`_ for more details.
.. _mojito_client_obj-pause:
Pausing Mojits
==============
-From the ``client`` object, you call the ``pause`` method as seen below to prevent any code from
-executing outside of the individual binders (within the Mojito framework) and to call ``onPause()``
-on all binders.
+From the ``client`` object, you call the ``pause`` method as seen below to prevent any
+code from executing outside of the individual binders (within the Mojito framework) and
+to call ``onPause()`` on all binders.
``Y.mojito.client.pause()``
@@ -23,8 +23,9 @@ on all binders.
Resuming Mojits
===============
-From the ``client`` object, you call the ``resume`` method as seen below to immediately execute all
-cached operations and notify all of the binders through the ``onResume`` function.
+From the ``client`` object, you call the ``resume`` method as seen below to immediately
+execute all cached operations and notify all of the binders through the ``onResume``
+function.
``Y.mojito.client.resume()``
View
11 docs/dev_guide/api_overview/mojito_rest_lib.rst
@@ -2,9 +2,10 @@
REST Library
============
-Mojito has a library to make it easier to make a REST calls to Web services from your model. For
-implementation details, see `Class Y.mojito.lib.REST <../../api/classes/Y.mojito.lib.REST.html>`_
-in the Mojito API documentation.
+Mojito has a library to make it easier to make a REST calls to Web services from your
+model. For implementation details, see
+`Class Y.mojito.lib.REST <../../api/classes/Y.mojito.lib.REST.html>`_ in the Mojito API
+documentation.
.. _mojito_rest_lib-incl:
@@ -31,8 +32,8 @@ which instructs YUI to load the library. Once the library is loaded, you can us
Example
=======
-In the model for the ``recipeSearch`` mojit below, the REST library is used to make a GET call to
-the Recipe Puppy API.
+In the model for the ``recipeSearch`` mojit below, the REST library is used to make a
+GET call to the Recipe Puppy API.
.. code-block:: javascript
View
33 docs/dev_guide/code_exs/binding_events.rst
@@ -11,7 +11,6 @@ Binding Events
Summary
=======
-
This example shows how to bind events to a mojit, configure code to run
on the client, and make AJAX calls to the YQL Web service. The application
listens for events and then makes AJAX calls to YQL to get Flickr photo
@@ -179,11 +178,11 @@ Binder Basics
#############
A mojit may have zero, one, or many binders within the ``binders`` directory. Each binder
-will be deployed to the browser along with the rest of the mojit code, where the client-side
-Mojito runtime will call it appropriately. On the client, the binder has a proxy
-object (``mojitProxy``) for interacting with the mojit it represents as well as with other
-mojits on the page. Methods can be called from the ``mojitProxy`` object that allow
-binders to listen for and fire events.
+will be deployed to the browser along with the rest of the mojit code, where the
+client-side Mojito runtime will call it appropriately. On the client, the binder has a
+proxy object (``mojitProxy``) for interacting with the mojit it represents as well as
+with other mojits on the page. Methods can be called from the ``mojitProxy`` object
+that allow binders to listen for and fire events.
The binder consists of a constructor, an initializer, and a bind function. The following
describes each component and indicates when the ``mojitProxy`` object can be used.
@@ -233,8 +232,8 @@ dissect and analyze the code. Let's begin by looking at the ``bind`` function o
In this code snippet of ``binders/index.js``, the ``bind`` function contains the nested
``updateDOM`` function that updates node content and attaches event handlers. Using the
-``mojitProxy`` object, the nested ``flipper`` function calls the ``index`` function of the
-controller. The callback ``updateDOM`` is passed to ``index`` to update the content.
+``mojitProxy`` object, the nested ``flipper`` function calls the ``index`` function of
+the controller. The callback ``updateDOM`` is passed to ``index`` to update the content.
.. code-block:: javascript
@@ -261,10 +260,10 @@ controller. The callback ``updateDOM`` is passed to ``index`` to update the cont
...
-The event handler for mouseovers and mouseouts are handled by the ``showOverlay`` function,
-which creates the overlay containing photo information. In the code snippet below,
-``showOverlay`` makes an AJAX call to YQL to get photo data that is placed in an unordered
-list for the overlay.
+The event handler for mouseovers and mouseouts are handled by the ``showOverlay``
+function, which creates the overlay containing photo information. In the code snippet
+below, ``showOverlay`` makes an AJAX call to YQL to get photo data that is placed in an
+unordered list for the overlay.
.. code-block:: javascript
@@ -501,8 +500,8 @@ To get the photo data, the controller depends on the model to call YQL to query
Flickr API. Using ``actionContext.get({model_name})`` lets you get a reference to the
model. The example controller below calls the ``getData`` from the model
``PagerMojitModel`` with ``actionContext.models.get('PagerMojitModel').getData`, which
-will get the returned data from YQL in the callback function. To use methods from models, you need
-to require the model in the ``requires`` array of the controller.
+will get the returned data from YQL in the callback function. To use methods from models,
+you need to require the model in the ``requires`` array of the controller.
.. code-block:: javascript
@@ -733,11 +732,11 @@ To set up and run ``binding_events``:
}
return actionContext.url.make('frame', 'index', Y.QueryString.stringify(mergedParams));
}
- }, '0.0.1', {requires: ['dump', 'mojito-url-addon', 'mojito-params-addon', 'PagerMojitModel']});
+ }, '0.0.1', {requires: ['dump', 'mojito-url-addon', 'mojito-params-addon', 'mojito-models-addon', 'PagerMojitModel']});
-#. To get Flickr photo information using YQL, create the file ``models/model.server.js`` with
- the code below. Be sure to replace the ``'{your_flickr_api_key}'`` with your own
+#. To get Flickr photo information using YQL, create the file ``models/model.server.js``
+ with the code below. Be sure to replace the ``'{your_flickr_api_key}'`` with your own
Flickr API key.
.. code-block:: javascript
View
8 docs/dev_guide/code_exs/cookies.rst
@@ -145,8 +145,8 @@ To set up and run ``using_cookies``:
]
#. Change to ``mojits/CookieMojit``.
-#. To set a cookie from your controller, replace the code in ``controller.server.js`` with the
- following:
+#. To set a cookie from your controller, replace the code in ``controller.server.js`` with
+ the following:
.. code-block:: javascript
@@ -168,8 +168,8 @@ To set up and run ``using_cookies``:
};
}, '0.0.1', {requires: ['mojito-cookie-addon']});
-#. To display the cookie values set in your controller, replace the code in ``views/index.hb.html``
- with the following:
+#. To display the cookie values set in your controller, replace the code in
+ ``views/index.hb.html`` with the following:
.. code-block:: html
View
3  docs/dev_guide/code_exs/framed_assets.rst
@@ -205,7 +205,8 @@ To create and run ``framed_assets``:
</ul>
</div>
-#. Replace the contents of ``assets/index.css`` for the CSS of your page with the following:
+#. Replace the contents of ``assets/index.css`` for the CSS of your page with the
+ following:
.. code-block:: css
View
7 docs/dev_guide/code_exs/global_assets.rst
@@ -12,10 +12,9 @@ Summary
=======
This example shows how to configure and use global assets in Mojito
-applications. In this
-example, the ``HTMLFrameMojit`` inserts global assets into the rendered
-view. See `Adding CSS <./adding_assets.html>`_ for an example that uses
-mojit-level assets.
+applications. In this example, the ``HTMLFrameMojit`` inserts global assets
+into the rendered view. See `Adding CSS <./adding_assets.html>`_ for an example
+that uses mojit-level assets.
The following topics will be covered:
View
2  docs/dev_guide/code_exs/htmlframe_view.rst
@@ -102,7 +102,7 @@ example, the child mojit creates the ``<div>`` tag and its content.
</body>
</html>
-The ``HTMLFrameMojit`` mojit can be used to allow dynamic run-time selection of running
+The ``HTMLFrameMojit`` mojit can be used to allow dynamic runtime selection of running
on the client or server. You can also use ``HTMLFrameMojit`` to include assets and control
language defaults. These subjects are discussed in
`Internationalizing Your Application <i18n_apps.html>`_.
View
4 docs/dev_guide/code_exs/multiple_mojits.rst
@@ -21,8 +21,8 @@ The following topics will be covered:
- embedding the rendered template into the HTML frame
.. tip::
- To learn how to use the Mojito built-in mojit ``HTMLFrameMojit`` to aggregate and
- display the output from child mojits, see
+ To learn how to use the Mojito built-in mojit ``HTMLFrameMojit`` to aggregate
+ and display the output from child mojits, see
`Using the HTML Frame Mojit <./htmlframe_view.html>`_.
.. _code_exs_multiple_mojits-notes:
View
7 docs/dev_guide/code_exs/scroll_views.rst
@@ -33,7 +33,7 @@ devices.
:width: 401px
In the ``application.json`` file for this code example, the customized
-CSS are specified in the ``assets`` array as seen below.
+CSS is specified in the ``assets`` array as seen below.
.. code-block:: javascript
@@ -99,11 +99,10 @@ photo URLs and the text for the image ``alt`` attribute is passed to the
}, '0.0.1', {requires: ['mojito']});
In the ``index.hb.html`` below, the YUI ScrollView module is included with
-``YUI.use``. To create the scrolling content widget, you need to create a
+``YUI.use``. To create the scrolling content widget, you need to create a
container, a header, and content frame with ``div`` tags that use YUI-specific
IDs and render a ScrollView object. For detailed instructions, see the
-`Getting Started <http://developer.yahoo.com/yui/3/scrollview/#start>`_ section
-on the YUI 3: ScrollView page.
+`ScrollView: Getting Started <http://developer.yahoo.com/yui/3/scrollview/#start>`_.
.. code-block:: html
View
4 docs/dev_guide/code_exs/views_multiple_devices.rst
@@ -55,7 +55,7 @@ Context Configurations
Mojito allows you to map contexts to a set of configurations based on runtime
factors. The context is defined by the ``setting`` property in the JSON
configuration files. The default value for ``setting`` is ``master``.
-Mojito will first look to see if a base context wasset on the command line
+Mojito will first look to see if a base context was set on the command line
with the ``--context`` option, then at the HTTP headers and query string.
In this example, we want contexts defined for different devices, so, in
the ``application.json`` file, we'll define contexts for Android, Blackberry,
@@ -228,7 +228,7 @@ To set up and run ``device_views``:
}
]
-#. To configure routing, replace the code in ``routes.json`` with the
+#. To configure routing, replace the code in ``routes.json`` with the
following:
.. code-block:: javascript
View
70 docs/dev_guide/faq/index.rst
@@ -104,9 +104,9 @@ General
.. _moj_langs:
.. topic:: **What languages can I use to develop mojits?**
- JavaScript is the programming language of Cocktails. All modules are written in JavaScript,
- and JavaScript only. Modules that require server-side execution do so through a server-side
- JavaScript execution engine.
+ JavaScript is the programming language of Cocktails. All modules are written in
+ JavaScript, and JavaScript only. Modules that require server-side execution do so
+ through a server-side JavaScript execution engine.
------------
@@ -115,7 +115,7 @@ General
The tools used in developing mojit modules (mojits) work offline, without requiring
access to networked resources. When networked (cloud) resources are required due to the
- moduleâ™s own nature, e.g., retrieving data from a back-end service, Cocktails provides
+ modules own nature, e.g., retrieving data from a back-end service, Cocktails provides
facilities to mock these resources and simulate their behavior with dummy (local)
implementations.
@@ -134,7 +134,8 @@ General
1. Install ``nodemon``: ``$ sudo npm install nodemon -g``
- 2. In your Mojito application directory, create the file ``devel.js`` with the following:
+ 2. In your Mojito application directory, create the file ``devel.js`` with the
+ following:
.. code-block:: javascript
@@ -190,12 +191,12 @@ General
------------
.. _moj_caching:
-.. topic:: **Does Mojito have API methods for handling caching? If not, what's the best way for Mojito
- applications to handle caching?**
+.. topic:: **Does Mojito have API methods for handling caching? If not, what's the best
+ way for Mojito applications to handle caching?**
- Mojito currently does not have any API methods for handling caching. Although there is no
- definitive solution for caching for Mojito, here are a few possible ways to cache for Mojito
- applications:
+ Mojito currently does not have any API methods for handling caching. Although there is
+ no definitive solution for caching for Mojito, here are a few possible ways to cache
+ for Mojito applications:
- **Client-Side Caching**
@@ -288,8 +289,9 @@ General
.. topic:: **How can I improve the performance of my Mojito application?**
The following sections offer some ideas about how to improve the performance of your
- Mojito application, but are by no means exhaustive. You should also review online articles
- about improving Node.js performance, such as `Blazing fast node.js: 10 performance tips
+ Mojito application, but are by no means exhaustive. You should also review online
+ articles about improving Node.js performance, such as
+ `Blazing fast node.js: 10 performance tips
from LinkedIn Mobile <http://bit.ly/uFyio2>`_ written by software engineer Shravya
Garlapati.
@@ -447,9 +449,9 @@ Mojits
.. .. _moj_reuse:
.. .. topic:: **Can I share or re-use mojits?**
-.. Although not available yet, Y Cocktails mojit gallery/repository will let developers share,
-.. discover, and select mojits to re-use in building their experiences. A common packaging format
-.. for mojits is used, based on the CommonJS specification.
+.. Although not available yet, Y Cocktails mojit gallery/repository will let developers
+.. share, discover, and select mojits to re-use in building their experiences. A
+.. common packaging format for mojits is used, based on the CommonJS specification.
Configuration
-------------
@@ -468,9 +470,9 @@ Configuration
.. _moj_client:
.. topic:: **How do you configure mojits to run on the client?**
- Run Mojito at build time to generate the html page using "mojito build html5app". This
- runs the Mojito infrastructure as if it were a running server instance and prints out
- the resulting HTML+JSON required to bootstrap a client-side mojit. This is what
+ Run Mojito at build time to generate the html page using ``mojito build html5app``.
+ This runs the Mojito infrastructure as if it were a running server instance and prints
+ out the resulting HTML+JSON required to bootstrap a client-side mojit. This is what
Livestand does. Among other things, it leads down a path where it's very hard to do
incremental builds because the Web server abstraction makes it hard to do the timestamp
resolution that incremental builds require. A better approach would be to allow people
@@ -703,9 +705,9 @@ Logging/Testing
.. _moj_log_level:
.. topic:: **How do I change the logging levels for my Mojito application?**
- You can set log levels for your application using the ``yui.config`` object in ``application.json``.
- You can also set default log levels using the ``yui.config`` object in the ``defaults.json``
- at the application or mojit level.
+ You can set log levels for your application using the ``yui.config`` object in
+ ``application.json``. You can also set default log levels using the ``yui.config``
+ object in the ``defaults.json`` at the application or mojit level.
See `Logging <../topics/mojito_logging.html>`_ for details and the code example
`Simple Logging <../code_exs/simple_logging.html>`_.
@@ -716,19 +718,33 @@ Logging/Testing
.. _moj_mod_log_exclusion:
.. topic:: **Is there a way to exclude specific modules from logging on the client?**
- Mojito does not offer such a fine-grain control over logging. Because each log
- statement tends to be associated with a module name, you could start Mojito with the
- following command to exclude the logs for certain modules:
+ Yes, you can use the ``logExclude`` property of the ``yui.config`` object to
+ exclude the logging of specified modules.
- ``$ mojito start 2>&1 | grep -v ModuleName``
+ For example, the logging configuration set by ``yui.config`` below excludes
+ logging from the module ``pagingBinder``:
+
+ .. code-block:: javascript
+
+ ...
+ "yui": {
+ "config": {
+ "logExclude": "pagingBinder",
+ "logLevel": "info"
+ }
+ }
+ ...
+
+ See `Including and Excluding Modules From Logging <../topics/mojito_logging.rst#logging_custom-include_exclude_src>`_
+ for more information.
------------
.. _moj_client_server_logging:
.. topic:: **Can logging be configured to be different for the client and server?**
- Yes, the ``application.json`` configuration file can contain a ``yui.config`` object that
- contain the properties ``logExclude`` and ``logInclude`` to log certain components
+ Yes, the ``application.json`` configuration file can contain a ``yui.config`` object
+ that contain the properties ``logExclude`` and ``logInclude`` to log certain components
of your application. You can also use context configurations to have different
configurations depending on the runtime environment.
View
4 docs/dev_guide/getting_started/mojito_getting_started_tutorial.rst
@@ -147,8 +147,8 @@ You will now modify the controller, so that the ``index`` function called in the
controller outputs different results.
#. Change to ``mojits/HelloMojit``.
-#. Edit ``controller.server.js`` and replace the string 'Just a simple mojit.' in
- the code with 'Hello World!'. Your ``controller.server.js`` should look similar
+#. Edit ``controller.server.js`` and replace the string 'Mojito is working.' in
+ the code with 'Doing well, thanks.'. Your ``controller.server.js`` should look similar
to the following code:
.. code-block:: javascript
View
10 docs/dev_guide/index.rst
@@ -19,9 +19,11 @@ Getting Started
===============
Ready to start creating apps? You'll start with a quickstart that will show
-you how to install Mojito and then get up an running with your first Mojito app.
+you how to install Mojito and then get up an running with Mojito.
Once you have Mojito installed and are familiar with the basic steps of creating
-an app, you can walk through the `Creating
+an app, you can walk through
+`Tutorial: Creating Your First Application <getting_started/mojito_getting_started_tutorial.html>`_
+to learn about mojits, how to configure routing, modify controller code, and run tests.
.. _mojito_doc_directory-topics:
@@ -52,6 +54,8 @@ Reference
The reference includes a glossary for Mojito and Cocktails terminology, a comprehensive
treatment of the Mojito command-line tool, and troubleshooting tips.
+.. _mojito_doc_directory-additional:
+
Additional Resources
====================
@@ -72,4 +76,4 @@ the YDN forum for Mojito.
api_overview/index
faq/index
reference/index
- resources/index
+ resources/index
View
3  docs/dev_guide/intro/mojito_binders.rst
@@ -19,7 +19,8 @@ Each binder will be deployed to the browser along with the rest of the mojit
code, where the client-side Mojito runtime will call it appropriately. The view
used to generate output determines which binder is used. Thus, if the ``simple``
view is used, the binder ``simple.js`` is used. This can be overridden by setting
-``view.binder`` in the ``meta`` argument to `ac.done <../../api/classes/ActionContext.html#method_done>`_.
+``view.binder`` in the ``meta`` argument to
+`ac.done <../../api/classes/ActionContext.html#method_done>`_.
If no binder matches the view, then no binder is used.
.. _mojito_binders-app_reqs:
View
14 docs/dev_guide/intro/mojito_configuring.rst
@@ -27,7 +27,7 @@ file is an array. Each item of the array is an object that configures
one component of Mojito, such as logging, assets, mojits, static resources, etc.
Each configuration object is required to have a ``settings`` property that
-specifies conditions for applying the configuration settings. These conditions
+specifies contexts for applying the configuration settings. These conditions
could be used to determine the configurations in different environments.
Below is the skeleton of a configuration file. See `Application Configuration`_
@@ -850,7 +850,7 @@ two ways to configure routing:
- Map Routes to Specific Mojit Instances and Actions
- Generate URLs from the Controller
-See `Code Examples: Configuring Routing <../code_exs/route_config.html>`_ to
+See `Code Examples: Configuring Routing <../code_exs/route_config.html>`_ to
see an example of configuring routing in a Mojito application.
@@ -1214,17 +1214,17 @@ application configurations in ``application.json`` with the method ``getAppConfi
of the ``Config`` addon.
For example, if you wanted to access the ``specs`` object defined in ``application.json``,
-you would use ``ac.config.getAppConfig()`` as shown here:
+you would use ``ac.config.getAppConfig().specs`` as shown here:
.. code-block:: javascript
YUI.add('myMojit', function(Y, NAME) {
Y.namespace('mojito.controllers')[NAME] = {
index: function(ac) {
- // Get the application configuration through
- // the Config addon.
- var app_config = ac.config.getAppConfig();
- Y.log(app_config);
+ // Get the 'specs' object from teh application configuration
+ // through the Config addon.
+ var app_specs = ac.config.getAppConfig().specs;
+ Y.log(app_specs);
ac.done({ status: "Showing app config in the log."});
}
};
View
6 docs/dev_guide/intro/mojito_mojits.rst
@@ -150,11 +150,11 @@ directory structure and files of a mojit.
Active View
###########
-The combination of a Mojit's view together with its user event handlers (as
+The combination of a mojit's view together with its user event handlers (as
distinct from system event handlers) is called its Active View. The Active View
-is that portion of a Mojit that always resides within the client, in order to
+is that portion of a mojit that always resides within the client, in order to
provide the actual presentation together with the immediate event handling that
-makes the Mojit responsive.
+makes the mojit responsive.
The event handlers within the Active View are intended to be very "thin"; they
perform translation of user gestures to mojit capabilities (e.g., button click
View
2  docs/dev_guide/intro/mojito_mvc.rst
@@ -677,7 +677,7 @@ to iterate through an array of strings:
{{/each}}
</ul>
-Another interesting block helper used in this example is #with, which will
+Another interesting block helper used in this example is ``#with``, which will
invoke a block when given a specified context. For example, in the code
snippet below, if the ``ul`` object is given, the property title is evaluated.
View
17 docs/dev_guide/reference/glossary.rst
@@ -28,7 +28,8 @@ addon
A namespacing object attached directly to the Action Context object that provides
additional functions. The ``ActionContext`` object is available in every controller
- function. See `Mojito API Overview: Addons <../api_overview/mojito_addons.html>`_ for more information.
+ function. See `Mojito API Overview: Addons <../api_overview/mojito_addons.html>`_ for
+ more information.
affinity
--------
@@ -138,6 +139,14 @@ OAuth
another site without giving out the user ID and password. See the
`Yahoo! OAuth Quick Start Guide <http://developer.yahoo.com/oauth/guide/oauth-guide.html>`_
for more information.
+
+template
+--------
+
+ Template files that are rendered into HTML and served to a device. These templates can
+ contain expressions (Handlebars) or tags (Mustache) that are replaced with values by a
+ view rendering engine.
+
view
----
@@ -154,13 +163,7 @@ view partial
partial, you can create that document fragment instead of iterating through the
collection in the view.
-template
--------------
- Template files that are rendered into HTML and served to a device. These templates can
- contain expressions (Handlebars) or tags (Mustache) that are replaced with values by a
- view rendering engine.
-
YUI
---
View
108 docs/dev_guide/reference/mojito_cmdline.rst
@@ -10,7 +10,7 @@ code base.
.. _mj_cmdlne-help:
Help
-####
+====
To show top-level help for this command line tool:
@@ -23,7 +23,7 @@ To show help for a specific command:
.. _mj_cmdlne-create_code:
Creating Code from Archetypes
-#############################
+=============================
Archetypes are used to create skeletons for the different types of artifacts
in a Mojito application. The skeletons only contain stripped down boilerplate
@@ -33,7 +33,7 @@ To create a skeleton for a Mojito application:
``$ mojito create app [<archetype-name>] <app-name>``
-This will create an empty application (i.e. one with no mojits) with the name
+This will create an empty application (i.e., one with no mojits) with the name
provided. The application is created in a directory named ``<app-name>`` within
the current directory. If no archetype name is provided, the default archetype
is used.
@@ -51,13 +51,13 @@ application directory. For example, the mojit ``MyMojit`` would be created in
As with application creation, if no archetype name is provided, the default
archetype is used. Depending upon the archetype, the skeleton may include any
-or all of controller, model, view, and binder.
+or all of the controller, model, view, and binder.
.. _mj_cmdlne-archetype:
Mojito Archetypes
-#################
+-----------------
Mojito offers the following three archetypes for applications and mojits.
@@ -73,24 +73,24 @@ Mojito offers the following three archetypes for applications and mojits.
.. _mj_cmdlne-testing:
Testing
-#######
+=======
Unit tests are run using YUI Test invoked using the Mojito command-line tool.
-Test output is written to the console and also to the file ``{CWD}/artifacts/test/result.xml``,
-where ``{CWD}`` is the current working directory. Note that it is not (yet)
-possible to specify an alternative output location.
+Test output is written to the console and also to the file
+``{CWD}/artifacts/test/result.xml``, where ``{CWD}`` is the current working directory.
+Note that it is not (yet) possible to specify an alternative output location.
- To run tests for an application:
- ``$ mojito test app <application-path>``
+ ``$ mojito test app <application-path>``
- To run the unit tests for a specific mojit:
- ``$ mojito test mojit <mojit-path> [<mojit-module>]``
+ ``$ mojito test mojit <mojit-path> [<mojit-module>]``
- If a mojit module (i.e., the YUI module for a portion of the mojit) is
- specified, only the tests for that module will be run. Otherwise all tests
- for the mojit will be run.
+ If a mojit module (i.e., the YUI module for a portion of the mojit) is
+ specified, only the tests for that module will be run. Otherwise all tests
+ for the mojit will be run.
To run functional and unit tests for the Mojito framework,
you would use the test framework `Yahoo! Arrow <https://github.com/yahoo/arrow>`_.
@@ -100,7 +100,7 @@ to run the framework tests for Mojito.
.. _mj_cmdlne-code_coverage:
Code Coverage
-#############
+=============
Code coverage is invoked in the same way as unit testing, but with the added
option ``--coverage`` or ``-c``. To run code coverage tests, you need to have
@@ -112,20 +112,20 @@ possible to specify an alternative output location.
- To run code coverage for a Mojito application:
- ``$ mojito test --coverage app <app-path>``
+ ``$ mojito test --coverage app <app-path>``
- To run code coverage for Mojito applications:
- ``$ mojito test app <app-path> --coverage``
+ ``$ mojito test app <app-path> --coverage``
- To run code coverage for a specific mojit:
- ``$ mojito test -c mojit <mojit-path>``
+ ``$ mojito test -c mojit <mojit-path>``
.. _mj_cmdlne-start_server:
Starting the Server
-###################
+===================
Use the following to start the server and run the application.
@@ -136,10 +136,10 @@ the application configuration file, ``application.json``. The default port
number is 8666. See :ref:`Specifying Context <mj_cmdline-context>` to learn
how to use the ``--context`` option.
-
+.. _mj_cmdlne-js_lint:
Sanitizing Code
-###############
+===============
Static code analysis is run using JSLint invoked using the Mojito command-line
tool. JSLint output is written to text files and to a ``jslint.html`` file,
@@ -148,27 +148,27 @@ below. Note that it is not possible to specify an alternative output location.
- To run JSLint on the Mojito framework code:
- ``$ mojito jslint``
+ ``$ mojito jslint``
- Output is written to ``{CWD}/artifacts/framework/jslint/``, where ``{CWD}``
- is the current working directory.
+ Output is written to ``{CWD}/artifacts/framework/jslint/``, where ``{CWD}``
+ is the current working directory.
- To run JSLint on an application, including all of its (owned) mojits:
- ``$ mojito jslint app <app-name>``
+ ``$ mojito jslint app <app-name>``
- Output is written to ``{app-dir}/artifacts/jslint/``.
+ Output is written to ``{app-dir}/artifacts/jslint/``.
- To run JSLint on a specific mojit:
- ``$ mojito jslint mojit <mojit-path>``
+ ``$ mojito jslint mojit <mojit-path>``
- Output is written to ``{app-dir}/artifacts/jslint/mojits/{mojit-name}``/.
+ Output is written to ``{app-dir}/artifacts/jslint/mojits/{mojit-name}``/.
.. _mj_cmdlne-document_code:
Documenting Code
-################
+================
API documentation is generated using `YUI Doc <http://developer.yahoo.com/yui/yuidoc/>`_,
which is invoked using the Mojito command-line tool. Documentation output is
@@ -177,51 +177,51 @@ possible to specify an alternative output location.
- To generate documentation for the Mojito framework itself:
- ``$ mojito docs mojito``
+ ``$ mojito docs mojito``
- Output is written to ``{CWD}/artifacts/docs/mojito/``, where ``{CWD}`` is
- the current working directory.
+ Output is written to ``{CWD}/artifacts/docs/mojito/``, where ``{CWD}`` is
+ the current working directory.
- To generate documentation for an application, including all of its (owned)
mojits, run the following from the application directory:
- ``$ mojito docs app``
+ ``$ mojito docs app``
- Output is written to ``{app-dir}/artifacts/docs/``.
+ Output is written to ``{app-dir}/artifacts/docs/``.
- To generate documentation for a specific mojit, run the following from the
application directory:
- ``$ mojito docs mojit <mojit-name>``
+ ``$ mojito docs mojit <mojit-name>``
- Output is written to ``{app-dir}/artifacts/docs/mojits/{mojit-name}/``.
+ Output is written to ``{app-dir}/artifacts/docs/mojits/{mojit-name}/``.
.. _mj_cmdlne-version_info:
Version Information
-###################
+===================
- To show the version for the Mojito framework itself:
- ``$ mojito version``
+ ``$ mojito version``
- To show the version for an application, run the following from the
application directory:
- ``$ mojito version app <app-name>``
+ ``$ mojito version app <app-name>``
- To show the version for a mojit, run the following from the application
directory:
- ``$ mojito version mojit <mojit-name>``
+ ``$ mojito version mojit <mojit-name>``
- Showing the version of the application and mojit requires that they have a
- ``package.json`` file.
+ Showing the version of the application and mojit requires that they have a
+ ``package.json`` file.
.. _mj_cmdlne-build_sys:
Build System
-############
+============
Mojito comes with a build command for generating an HTML5 offline Mojito
application that runs in different environments. The command must be run inside
@@ -236,14 +236,14 @@ option.
.. _build_sys-types:
Build Types
-===========
+-----------
The following sections describe the available build types.
.. _build_types-html5app:
html5app
---------
+########
To build an HTML 5 application, use the the following:
@@ -283,7 +283,7 @@ will also create a ``snapshot.json`` file that can be used tracking and updating
.. _mj_cmdlne-compile_sys:
Compile System
-##############
+==============
Mojito comes with a compile command for generating files to optimize an application for
production.
@@ -291,7 +291,7 @@ production.
.. _compile_sys-syntax
Syntax
-======
+------
Compile files with the command below where ``<type>`` can have the following values:
``all``, ``inlinecss``, ``views``, ``json``, or ``rollups``.
@@ -313,7 +313,7 @@ In addition, the compile command takes the following three options:
.. _compile_sys-inline_css:
Compiling Inline CSS
-====================
+--------------------
The command below creates files for adding inline CSS to a page. The CSS files in
``/mojits/{mojit_name}/assets/`` will be automatically included as inlined CSS in the
@@ -324,7 +324,7 @@ rendered views for mojits that are children of the ``HTMLFrameMojit``.
.. _compile_sys-views:
Compiling Views
-===============
+---------------
The command below pre-compiles the views in ``mojit/{mojit_name}/views`` so that a mojit's
controller and binder are attached to the views, making separate XHR call
@@ -336,7 +336,7 @@ controller and binder are attached to the views, making separate XHR call
Compiling Configuration
-=======================
+-----------------------
The command below using the type ``json`` reads the JSON configuration files, such as the
specs, definitions, and defaults, and compiles them into JavaScript.
@@ -347,7 +347,7 @@ specs, definitions, and defaults, and compiles them into JavaScript.
.. _compile_sys-rollups:
Compiling Rollups
-=================
+-----------------
The command below consolidates the YUI modules in the mojits into a single YUI module,
making only one ``<script>`` tag needed per page. Using the ``--app`` option creates a
@@ -359,7 +359,7 @@ framework code.
.. _compile_sys-all:
Compiling All
-=============
+-------------
The commands below compile inline CSS, views, and YUI modules.
@@ -370,7 +370,7 @@ The commands below compile inline CSS, views, and YUI modules.
.. _mj_cmdline-dependency:
Dependency Graphs
-#################
+=================
The command below generates the Graphviz file ``{CWD}/artifacts/gv/yui.client.dot``
(``{CWD}`` represents the current working directory) that describes the YUI module
@@ -392,7 +392,7 @@ The ``mojito gv`` command has the following options:
.. _mj_cmdline-context:
Specifying Context
-##################
+==================
When configuration files are read, a context is applied to determine which
values will be used for a given key. The applied context is a combination of
View
3  docs/dev_guide/topics/mojito_composite_mojits.rst
@@ -86,8 +86,7 @@ and displays the ``children`` object that lists the child mojits.
When the controller of the parent mojit calls ``ac.composite.done`` from the ``index``
function, the controllers of the mojit children execute ``ac.done`` from their
``index`` functions. The rendered views from the child mojits are then available
-as Handlebars expressions in the ``index`` template of the
-parent mojit.
+as Handlebars expressions in the ``index`` template of the parent mojit.
For example, in the example controller of the parent mojit below, the ``index``
function calls ``ac.composite.done``, which executes ``ac.done`` in the
View
4 docs/dev_guide/topics/mojito_data.rst
@@ -115,7 +115,7 @@ POST
----
The POST parameters come from the HTTP POST request body and often consist of
-form data. As with query string parameters, the Params addon has the method
+form data. As with query string parameters, the ``Params`` addon has the method
``getFromBody`` that allows you to specify a single parameter or get all of
the POST body parameters.
@@ -256,7 +256,7 @@ to determine whether the user gets a coupon.
var name = actionContext.params.getFromBody("name");
if(sendCoupon){
// Display coupon to user
- var coupon = getCoupon;
+ var coupon = sendCoupon;
}
actionContext.done(
{
View
1  docs/dev_guide/topics/mojito_extensions.rst
@@ -294,6 +294,7 @@ the ``require`` method for Node.js modules.
YUI Library
-----------
+
YUI libraries can be made available at the application or the mojit level.
Each file can only have one ``YUI.add`` statement. Other components, such
as controllers, models, etc., needing the library should specify the YUI
View
33 docs/dev_guide/topics/mojito_logging.rst
@@ -4,29 +4,31 @@ Logging
Mojito has its own logging system. When you call ``Y.log`` from within your mojits, your
log messages are intercepted and processed by Mojito. You can set logging levels
-to control the degree of detail in your log reports. You can also configure Mojito to enable
-log buffering, so performance during crucial runtime periods is not adversely affected.
+to control the degree of detail in your log reports. You can also configure Mojito to
+enable log buffering, so performance during crucial runtime periods is not adversely
+affected.
.. _mojito_logging-levels:
Log Levels
==========
-Mojito has the following five log levels:
+Mojito has the following six log levels:
-- ``DEBUG``
-- ``INFO``
-- ``WARN``
-- ``ERROR``
-- ``MOJITO``
+- ``debug``
+- ``info``
+- ``warn``
+- ``error``
+- ``mojito``
+- ``none``
All of them should be familiar except the last, which are framework-level messages that
indicate that an important framework event is occurring (one that users might want to
track).
-Setting a log level of ``WARN`` will filter out all ``DEBUG`` and ``INFO`` messages, while
-``WARN``, ``ERROR``, and ``MOJITO`` log messages will be processed. To see all
-log messages, set the log level to ``DEBUG``.
+Setting a log level of ``warn`` will filter out all ``debug`` and ``info`` messages, while
+``warn``, ``error``, and ``mojito`` log messages will be processed. To see all
+log messages, set the log level to ``debug``.
.. _mojito_logging-defaults:
@@ -45,7 +47,7 @@ Log Configuration
All the values above are configurable through the
`yui.config object <../intro/mojito_configuring.html#yui_config>`_ in the ``application.json``
file. In the example ``application.json`` below, the ``yui.config`` object
-overrides the defaults for ``logLevel`` and ``buffer``.
+overrides the default for ``logLevel``.
.. code-block:: javascript
@@ -54,7 +56,7 @@ overrides the defaults for ``logLevel`` and ``buffer``.
"settings": [ "master" ],
"yui": {
"config": {
- "level": "error",
+ "logLevel": "error",
}
},
...
@@ -125,7 +127,7 @@ the ``yui.config`` object.
...
"yui": {
"config": {
- "logLevel": "WARN"
+ "logLevel": "warn"
}
}
},
@@ -134,7 +136,7 @@ the ``yui.config`` object.
...
"yui": {
"config": {
- "logLevel": "INFO"
+ "logLevel": "info"
}
}
}
@@ -158,7 +160,6 @@ The configuration below excludes logging from the YUI module
"yui": {
"config": {
"logLevel": "INFO",
- "buffer": true,
"logExclude": { "FinanceModel": true }
}
}
View
2  docs/dev_guide/topics/mojito_npm.rst
@@ -206,7 +206,7 @@ mojit
*****
The ``mojit`` type specifies that the npm module contains a mojit. The
-resources in the mojit (controller, views, etc.) will be looked for at
+resources in the mojit (controller, models, views, etc.) will be looked for at
the location specified by the ``"location"`` field of the ``mojito`` object.
For example, the controller will be looked for in the following location,
where ``{name}`` is the name of the npm package:
View
18 docs/dev_guide/topics/mojito_resource_store.rst
@@ -121,7 +121,7 @@ populate the ``yui`` key of each resource.
Resource Versions
-----------------
-Because there can be multiple files which are all conceptually different
+Because there can be multiple files that are all conceptually different
versions of the same thing (e.g., ``views/index.hb.html`` and
``views/index.iphone.hb.html``), the |RS| defines **resource version**
as the metadata about each file and resource as the metadata about the file
@@ -608,7 +608,7 @@ Suppose an application has the following resources:
- ``controller.common.js``
- ``controller.common.iphone.js``
- ``controller.server.js``
-- ``controller.server.phone.js``
+- ``controller.server.iphone.js``
In this application, the POSL for context ``{device:browser}`` might
be ``['*']``, but the POSL for the context ``{device:iphone}`` might be
@@ -679,8 +679,8 @@ filter. For example, filter ``{mojit:'Foo'}`` will return all resources
.. note:: Because of the resolution process, the resources returned for filter
``{mojit:'Foo'}`` might contain shared resources.
-To get mojit-level resources (or versions) from multiple mojits, you'll have to c
-all the method ``getResourceVersions`` or ``getResources`` for each mojit.
+To get mojit-level resources (or versions) from multiple mojits, you'll have to
+call the method ``getResourceVersions`` or ``getResources`` for each mojit.
You can call ``listAllMojits`` to get a list of all mojits.
@@ -706,7 +706,7 @@ Anatomy of a |RS| Addon
The resource store addons are implemented using the |YUIPlugin|_ mechanism.
In essence, a Mojito addon is a YUI plugin, so the skeleton of a |RS| addon
-will be the same as a YUI Plugin.
+will be the same as that of a YUI Plugin.
See the |RSC|_ for the parameters and return values for the |RS| methods.
@@ -775,8 +775,8 @@ Key Methods
API documentation carefully and feel free to post any questions that you have to the
`Yahoo! Mojito Forum <http://developer.yahoo.com/forum/Yahoo-Mojito/>`_.
- Typically, you would hook into this method with the ``afterHostMethod`` method to register
- your own resource version types. This method should work together with your
+ Typically, you would hook into this method with the ``afterHostMethod`` method to
+ register your own resource version types. This method should work together with your
own version of the ``parseResourceVersion`` method.
.. js:function:: parseResourceVersion()
@@ -860,7 +860,7 @@ files.
RSAddonText.superclass.constructor.apply(this, arguments);
},
RSAddonText.NS = 'text';
- RSAddonText.ATT|RS| = {};
+ RSAddonText.ATTResourceStore = {};
Y.extend(RSAddonText, Y.Plugin.Base, {
@@ -928,7 +928,7 @@ files.
}
});
Y.namespace('mojito.addons.rs');
- Y.mojito.addons.rs.text = |RS|AddonText;
+ Y.mojito.addons.rs.text = ResourceStoreAddonText;
}, '0.0.1', { requires: ['plugin', 'oop']});
View
2  docs/dev_guide/topics/mojito_run_dyn_defined_mojits.rst
@@ -93,7 +93,7 @@ Configuring Child Instances
---------------------------
The configuration object passed to ``ac.composite.execute`` must have the
- ``children`` object to defines one or more mojit instances. In the ``cfg``
+``children`` object to defines one or more mojit instances. In the ``cfg``
object below, the child mojit instances ``news`` and ``sidebar`` are defined.
You can also specify the action to execute and pass configuration information
that includes parameters and assets.
View
89 docs/dev_guide/topics/mojito_testing.rst
@@ -77,9 +77,8 @@ have properly scoped values.
Types of Mojit Tests
--------------------
-The following three types of mojit tests exist:
+The following two types of mojit tests exist:
-- binder tests
- controller tests
- model tests
@@ -112,84 +111,6 @@ require the ``Foo-tests`` module as seen below.
...
}, 'VERSION', {requires: ['mojito-test', 'Foo']});
-.. _mojito_testing-binders:
-
-Binder Tests
-============
-
-You can create multiple binder tests and place them in the ``tests/binders``
-directory. For example, if your binder is ``binders/index.js``, the test file
-would be ``tests/binders/index.common-test.js``. Notice that the affinity is
-``common``, which can be used for binders on the client or server and is also
-the default binder test file.
-
-.. _binders_test-ex:
-
-Example
--------
-
-Below is the binder ``index.js`` that includes the ``FooBinderIndex`` module:
-
-.. code-block:: javascript
-
- YUI.add('FooBinderIndex', function(Y, NAME) {
- Y.namespace('mojito.binders')[NAME] = {
- init: function(mojitProxy) {
- this.mojitProxy = mojitProxy;
- },
- bind: function(node) {
- this.node = node;
- var nodeId = node.get('id');
- var binderId = this.mojitProxy._viewId;
- Y.log(nodeId + ' node bound', 'debug', NAME);
- if (nodeId !== binderId) {
- throw new Error("bad node binding to binder!");
- }
- this.node.append("<p>" + nodeId + " bound</p>");
- },
- _updateId: function(msg) {
- var nodeId = this.node.get('id');
- msg = msg || 'bound';
- this.node.one("p").set('innerHTML', nodeId + ' ' + msg);
- },
- handleClick: function(evt) {
- this.node.one('div').set('innerHTML', "clicked on " + new Date());
- }
- };
- }, '0.0.1', {requires: []});
-
-The test binder file ``tests/binders/index-common-tests.js`` below includes the
-module ``FooBinderIndex-tests`` and the requires ``array`` includes the
-``FooBinderIndex`` module:
-
-.. code-block:: javascript
-
- YUI.add('FooBinderIndex-tests', function(Y, NAME) {
- var suite = new YUITest.TestSuite(NAME),
- binder, A = YUITest.Assert;
- suite.add(new YUITest.TestCase({
- name: 'Foo binder index tests',
- setUp: function() {
- binder = Y.mojito.binders.FooBinderIndex;
- },
- tearDown: function() {
- binder = null;
- },
- 'test update id': function() {
- var node = Y.Node.create("<div id='guid123'></div>");
- binder.init({
- _guid: 'guid123'
- });
- binder.bind(node);
- binder._updateId('hello');
- var content = node.one('p').getContent();
- Y.log(content);
- A.areSame(content, 'guid123 hello', 'the node was not updated');
- }
- }));
- YUITest.TestRunner.add(suite);
- }, '0.0.1', {requires: ['mojito-test', 'node', 'FooBinderIndex']});
-
.. _mojito_testing-controller:
@@ -335,13 +256,13 @@ Configuring Mojito to Test MockActionContext Object
###################################################
To configure Mojito to use your ``MockActionContext`` object to run test,
-use the following:
+use the following, where ``{actionUnderTest}`` is the action you are testing.
.. code-block:: javascript
- Y.mojito.controller.actionUnderTest(ac);
+ Y.mojito.controller.{actionUnderTest}(ac);
-If ``actionUnderTest`` function fails to call the ``done`` function, calls
+If the ``{actionUnderTest}`` function fails to call the ``done`` function, calls
it more than one time, or calls it with the wrong parameters, the test will
fail.
@@ -536,7 +457,7 @@ module.
suite.add(new YUITest.TestCase({
name: 'Foo model tests',
setUp: function() {
- model = Y.mojito.models.Layout;
+ model = Y.mojito.models.FooModel;
},
tearDown: function() {
model = null;
View
15 docs/dev_guide/topics/mojito_using_contexts.rst
@@ -12,7 +12,7 @@ used based on various runtime factors. Many factors are predefined such as
language and device, but you can create custom ones as well. These runtime
factors are called **contexts** in Mojito and are mapped to user-defined
configurations. For example, you could set the configuration
-``logLevel`` to ``ERROR`` in the production context and set it to ``INFO``
+``logLevel`` to ``error`` in the production context and set it to ``info``
in the development context.
.. _context_configs_intro-why:
@@ -145,6 +145,9 @@ the following compound context: ``"environment:test,device:android"``
- ``device:opera-mini``
- ``device:palm``
- ``lang:{BCP 47 language tag}``
+- ``runtime:client``
+- ``runtime:server``
+
You can view the supported BCP 47 language tags and default contexts in the
@@ -250,10 +253,10 @@ then mapped to configurations.
.. _context_obj_setting-default:
Default Configurations
-``````````````````````
+**********************
Default configurations are used when no context is given. These configurations
-are found in the object where the settings array has the string "master" as
+are found in the object where the settings array has the string ``"master"`` as
seen below.
.. code-block:: javascript
@@ -271,7 +274,7 @@ seen below.
.. _context_obj_setting-simple:
Simple Context Configuration
-````````````````````````````
+****************************
The context is specified in the ``settings`` array of the configuration object.
@@ -291,7 +294,7 @@ The context is specified in the ``settings`` array of the configuration object.
.. _context_obj_setting-compound:
Compound Context Configuration
-``````````````````````````````
+******************************
Compound contexts are specified in the settings array as a series of contexts
separated by commas as seen below.
@@ -312,7 +315,7 @@ separated by commas as seen below.
.. _context_obj_setting-routing:
Routing Context Configuration
-`````````````````````````````
+*****************************
.. code-block:: javascript
Please sign in to comment.
Something went wrong with that request. Please try again.