Permalink
Browse files

Merge branch 'develop-perf' of git://github.com/yahoo/mojito into par…

…tials
  • Loading branch information...
2 parents a2311e4 + 5457737 commit 82fcda6aeba4acac1046c5fa8647d1f27274e405 @caridy committed Nov 17, 2012
Showing with 110 additions and 2,965 deletions.
  1. +14 −26 docs/dev_guide/code_exs/route_config.rst
  2. +1 −1 docs/dev_guide/reference/mojito_troubleshooting.rst
  3. +3 −6 examples/developer-guide/adding_view_engines/mojits/myMojit/controller.server.js
  4. +2 −2 examples/developer-guide/adding_view_engines/mojits/myMojit/models/foo.server.js
  5. +0 −37 examples/developer-guide/adding_view_engines/mojits/myMojit/tests/binders/index.common-tests.js
  6. +0 −101 examples/developer-guide/adding_view_engines/mojits/myMojit/tests/controller.server-tests.js
  7. +0 −39 examples/developer-guide/adding_view_engines/mojits/myMojit/tests/models/foo.server-tests.js
  8. +0 −3 examples/developer-guide/binding_events/mojits/PagerMojit/controller.server.js
  9. +10 −14 examples/developer-guide/binding_events/mojits/PagerMojit/models/model.server.js
  10. +0 −39 examples/developer-guide/binding_events/mojits/PagerMojit/tests/binders/index.common-tests.js
  11. +0 −42 examples/developer-guide/binding_events/mojits/PagerMojit/tests/controller.server-tests.js
  12. +0 −34 examples/developer-guide/binding_events/mojits/PagerMojit/tests/models/model.server-tests.js
  13. +0 −1 examples/developer-guide/configure_routing/application.json
  14. +0 −3 examples/developer-guide/configure_routing/mojits/RoutingMojit/controller.server.js
  15. +2 −2 examples/developer-guide/configure_routing/mojits/RoutingMojit/models/model.server.js
  16. +0 −39 examples/developer-guide/configure_routing/mojits/RoutingMojit/tests/binders/index.common-tests.js
  17. +0 −42 examples/developer-guide/configure_routing/mojits/RoutingMojit/tests/controller.server-tests.js
  18. +0 −34 examples/developer-guide/configure_routing/mojits/RoutingMojit/tests/models/model.server-tests.js
  19. +1 −3 examples/developer-guide/device_assets/mojits/device/controller.server.js
  20. +0 −41 examples/developer-guide/device_assets/mojits/device/tests/controller.server-tests.js
  21. +1 −3 examples/developer-guide/device_views/mojits/device/controller.server.js
  22. +2 −3 examples/developer-guide/device_views/mojits/device/models/model.server.js
  23. +0 −39 examples/developer-guide/device_views/mojits/device/tests/binders/index.common-tests.js
  24. +0 −42 examples/developer-guide/device_views/mojits/device/tests/controller.server-tests.js
  25. +0 −33 examples/developer-guide/device_views/mojits/device/tests/models/model.server-tests.js
  26. +0 −3 examples/developer-guide/framed_assets/mojits/framed/controller.server.js
  27. +2 −2 examples/developer-guide/framed_assets/mojits/framed/models/model.server.js
  28. +0 −39 examples/developer-guide/framed_assets/mojits/framed/tests/binders/index.common-tests.js
  29. +0 −41 examples/developer-guide/framed_assets/mojits/framed/tests/controller.server-tests.js
  30. +0 −34 examples/developer-guide/framed_assets/mojits/framed/tests/models/model.server-tests.js
  31. +7 −12 examples/developer-guide/framed_config/mojits/MainMojit/binders/binder.js
  32. +2 −2 examples/developer-guide/framed_config/mojits/MainMojit/models/model.server.js
  33. +0 −41 examples/developer-guide/framed_config/mojits/MainMojit/tests/controller.server-tests.js
  34. +0 −33 examples/developer-guide/framed_config/mojits/MainMojit/tests/model.server-tests.js
  35. +2 −2 examples/developer-guide/generating_urls/mojits/GenURLMojit/models/model.server.js
  36. +0 −39 examples/developer-guide/generating_urls/mojits/GenURLMojit/tests/binders/index.common-tests.js
  37. +0 −41 examples/developer-guide/generating_urls/mojits/GenURLMojit/tests/controller.server-tests.js
  38. +0 −33 examples/developer-guide/generating_urls/mojits/GenURLMojit/tests/models/model.server-tests.js
  39. +0 −4 examples/developer-guide/hello/mojits/HelloMojit/controller.server.js
  40. +2 −2 examples/developer-guide/hello/mojits/HelloMojit/models/model.server.js
  41. +0 −39 examples/developer-guide/hello/mojits/HelloMojit/tests/binders/index.common-tests.js
  42. +0 −41 examples/developer-guide/hello/mojits/HelloMojit/tests/controller.server-tests.js
  43. +0 −34 examples/developer-guide/hello/mojits/HelloMojit/tests/models/model.server-tests.js
  44. +0 −3 examples/developer-guide/htmlframe_mojit/mojits/framed/controller.server.js
  45. +2 −2 examples/developer-guide/htmlframe_mojit/mojits/framed/models/model.server.js
  46. +0 −39 examples/developer-guide/htmlframe_mojit/mojits/framed/tests/binders/index.common-tests.js
  47. +0 −41 examples/developer-guide/htmlframe_mojit/mojits/framed/tests/controller.server-tests.js
  48. +0 −33 examples/developer-guide/htmlframe_mojit/mojits/framed/tests/models/model.server-tests.js
  49. +0 −3 examples/developer-guide/inter-mojit/mojits/MasterMojit/controller.server.js
  50. +0 −41 examples/developer-guide/inter-mojit/mojits/MasterMojit/tests/controller.server-tests.js
  51. +0 −3 examples/developer-guide/inter-mojit/mojits/ReceiverMojit/controller.server.js
  52. +0 −41 examples/developer-guide/inter-mojit/mojits/ReceiverMojit/tests/controller.server-tests.js
  53. +0 −3 examples/developer-guide/inter-mojit/mojits/SenderMojit/controller.server.js
  54. +0 −41 examples/developer-guide/inter-mojit/mojits/SenderMojit/tests/controller.server-tests.js
  55. +0 −3 examples/developer-guide/locale_i18n/mojits/i18n/controller.server.js
  56. +2 −2 examples/developer-guide/locale_i18n/mojits/i18n/models/model.server.js
  57. +0 −39 examples/developer-guide/locale_i18n/mojits/i18n/tests/binders/index.common-tests.js
  58. +0 −41 examples/developer-guide/locale_i18n/mojits/i18n/tests/controller.server-tests.js
  59. +0 −33 examples/developer-guide/locale_i18n/mojits/i18n/tests/models/model.server-tests.js
  60. +0 −3 examples/developer-guide/model_yql/mojits/flickr/controller.server.js
  61. +2 −1 examples/developer-guide/model_yql/mojits/flickr/models/model.server.js
  62. +0 −39 examples/developer-guide/model_yql/mojits/flickr/tests/binders/index.common-tests.js
  63. +0 −41 examples/developer-guide/model_yql/mojits/flickr/tests/controller.server-tests.js
  64. +0 −34 examples/developer-guide/model_yql/mojits/flickr/tests/models/model.server-tests.js
  65. +0 −3 examples/developer-guide/multiple_mojits/mojits/BodyMojit/controller.server.js
  66. +2 −2 examples/developer-guide/multiple_mojits/mojits/BodyMojit/models/model.server.js
  67. +0 −39 examples/developer-guide/multiple_mojits/mojits/BodyMojit/tests/binders/index.common-tests.js
  68. +0 −41 examples/developer-guide/multiple_mojits/mojits/BodyMojit/tests/controller.server-tests.js
  69. +0 −33 examples/developer-guide/multiple_mojits/mojits/BodyMojit/tests/models/model.server-tests.js
  70. +0 −3 examples/developer-guide/multiple_mojits/mojits/FooterMojit/controller.server.js
  71. +2 −2 examples/developer-guide/multiple_mojits/mojits/FooterMojit/models/model.server.js
  72. +0 −39 examples/developer-guide/multiple_mojits/mojits/FooterMojit/tests/binders/index.common-tests.js
  73. +0 −41 examples/developer-guide/multiple_mojits/mojits/FooterMojit/tests/controller.server-tests.js
  74. +0 −33 examples/developer-guide/multiple_mojits/mojits/FooterMojit/tests/models/model.server-tests.js
  75. +2 −2 examples/developer-guide/multiple_mojits/mojits/FrameMojit/models/model.server.js
  76. +0 −39 examples/developer-guide/multiple_mojits/mojits/FrameMojit/tests/binders/index.common-tests.js
  77. +0 −41 examples/developer-guide/multiple_mojits/mojits/FrameMojit/tests/controller.server-tests.js
  78. +0 −33 examples/developer-guide/multiple_mojits/mojits/FrameMojit/tests/models/model.server-tests.js
  79. +0 −3 examples/developer-guide/multiple_mojits/mojits/HeaderMojit/controller.server.js
  80. +2 −3 examples/developer-guide/multiple_mojits/mojits/HeaderMojit/models/model.server.js
  81. +0 −39 examples/developer-guide/multiple_mojits/mojits/HeaderMojit/tests/binders/index.common-tests.js
  82. +0 −41 examples/developer-guide/multiple_mojits/mojits/HeaderMojit/tests/controller.server-tests.js
  83. +0 −33 examples/developer-guide/multiple_mojits/mojits/HeaderMojit/tests/models/model.server-tests.js
  84. +3 −2 examples/developer-guide/scroll_views/mojits/scroll/models/model.server.js
  85. +0 −42 examples/developer-guide/scroll_views/mojits/scroll/tests/controller.server-tests.js
  86. +0 −33 examples/developer-guide/scroll_views/mojits/scroll/tests/model.server-tests.js
  87. +0 −3 examples/developer-guide/simple_assets/mojits/simple/controller.server.js
  88. +2 −3 examples/developer-guide/simple_assets/mojits/simple/models/model.server.js
  89. +0 −39 examples/developer-guide/simple_assets/mojits/simple/tests/binders/index.common-tests.js
  90. +0 −41 examples/developer-guide/simple_assets/mojits/simple/tests/controller.server-tests.js
  91. +0 −33 examples/developer-guide/simple_assets/mojits/simple/tests/models/model.server-tests.js
  92. +0 −4 examples/developer-guide/simple_config/mojits/SimpleMojit/controller.server.js
  93. +2 −2 examples/developer-guide/simple_config/mojits/SimpleMojit/models/model.server.js
  94. +0 −39 examples/developer-guide/simple_config/mojits/SimpleMojit/tests/binders/index.common-tests.js
  95. +0 −41 examples/developer-guide/simple_config/mojits/SimpleMojit/tests/controller.server-tests.js
  96. +0 −33 examples/developer-guide/simple_config/mojits/SimpleMojit/tests/models/model.server-tests.js
  97. +0 −4 examples/developer-guide/simple_logging/mojits/log/controller.server.js
  98. +2 −2 examples/developer-guide/simple_logging/mojits/log/models/foo.server.js
  99. +0 −40 examples/developer-guide/simple_logging/mojits/log/tests/binders/index.common-tests.js
  100. +0 −41 examples/developer-guide/simple_logging/mojits/log/tests/controller.server-tests.js
  101. +0 −33 examples/developer-guide/simple_logging/mojits/log/tests/models/model.server-tests.js
  102. +0 −3 examples/developer-guide/simple_view/mojits/simple/controller.server.js
  103. +2 −2 examples/developer-guide/simple_view/mojits/simple/models/model.server.js
  104. +0 −39 examples/developer-guide/simple_view/mojits/simple/tests/binders/index.common-tests.js
  105. +0 −41 examples/developer-guide/simple_view/mojits/simple/tests/controller.server-tests.js
  106. +0 −33 examples/developer-guide/simple_view/mojits/simple/tests/models/model.server-tests.js
  107. +0 −3 examples/developer-guide/unittest_model_controller/mojits/flickr/controller.server.js
  108. +1 −1 examples/developer-guide/unittest_model_controller/mojits/flickr/models/model.server.js
  109. +0 −32 examples/developer-guide/unittest_model_controller/mojits/flickr/tests/binders/index-common-tests.js
  110. +0 −56 examples/developer-guide/unittest_model_controller/mojits/flickr/tests/controller.server-tests.js
  111. +0 −30 examples/developer-guide/unittest_model_controller/mojits/flickr/tests/models/model.server-tests.js
  112. +2 −6 examples/developer-guide/using_configs/mojits/ContactUs/controller.server.js
  113. +0 −3 examples/developer-guide/using_cookies/mojits/CookieMojit/controller.server.js
  114. +2 −2 examples/developer-guide/using_cookies/mojits/CookieMojit/models/model.server.js
  115. +0 −39 examples/developer-guide/using_cookies/mojits/CookieMojit/tests/binders/index.common-tests.js
  116. +0 −41 examples/developer-guide/using_cookies/mojits/CookieMojit/tests/controller.server-tests.js
  117. +0 −33 examples/developer-guide/using_cookies/mojits/CookieMojit/tests/models/model.server-tests.js
  118. +0 −3 examples/developer-guide/using_parameters/mojits/QueryMojit/controller.server.js
  119. +2 −2 examples/developer-guide/using_parameters/mojits/QueryMojit/models/model.server.js
  120. +0 −39 examples/developer-guide/using_parameters/mojits/QueryMojit/tests/binders/index.common-tests.js
  121. +0 −41 examples/developer-guide/using_parameters/mojits/QueryMojit/tests/controller.server-tests.js
  122. +0 −33 examples/developer-guide/using_parameters/mojits/QueryMojit/tests/models/model.server-tests.js
  123. +2 −2 lib/app/autoload/dispatch.common.js
  124. +0 −10 lib/app/autoload/mojito-client.client.js
  125. +8 −2 lib/app/autoload/store.client.js
  126. +7 −0 lib/app/autoload/store.server.js
  127. +2 −0 lib/app/mojits/LazyLoad/controller.common.js
  128. +1 −1 tests/func/applications/frameworkapp/common/mojits/BlueChild/controller.common.js
  129. +1 −1 tests/func/applications/frameworkapp/common/mojits/GreenChild/controller.common.js
  130. +1 −1 tests/func/applications/frameworkapp/common/mojits/MetaChild/controller.common.js
  131. +1 −1 tests/func/applications/frameworkapp/common/mojits/PartialMojit/controller.common.js
  132. +1 −1 tests/func/applications/frameworkapp/common/mojits/RedChild/controller.common.js
  133. +1 −0 tests/func/applications/frameworkapp/common/mojits/SearchMojit/controller.common.js
  134. +1 −1 tests/func/applications/frameworkapp/common/mojits/Stateful/controller.common.js
  135. +1 −1 tests/unit/lib/app/autoload/test-store.server.js
View
40 docs/dev_guide/code_exs/route_config.rst
@@ -161,56 +161,45 @@ To set up and run ``configure_routing``:
.. code-block:: javascript
YUI.add('RoutingMojit', function(Y, NAME) {
- Y.namespace('mojito.controllers')[NAME] = {
-
- index: function(ac) {
- ac.done(route_info(ac));
- },
- show: function(ac){
- ac.done(route_info(ac));
- }
- };
// Builds object containing route information
function route_info(ac) {
var methods = "",
name = "",
action = ac.action,
- path = ac.http.getRequest().url;
- ac.url.getRouteMaker();
+ path = ac.http.getRequest().url,
+ routes = ac.config.getRoutes();
if (action === "index" && path === "/") {
- name = ac.app.routes.root_route.name;
- Object.keys(ac.app.routes.root_route.verbs).forEach(function(n) {
+ name = "root_route";
+ routes.root_route.verbs.forEach(function(n) {
methods += n + ", ";
});
- } else if (action === "index") {
- name = ac.app.routes.index_route.name;
- Object.keys(ac.app.routes.index_route.verbs).forEach(function(n) {
- methods += n + ", ";
+ } else if (action==="index") {
+ name = "index_route";
+ routes.index_route.verbs.forEach(function(n) {
+ methods += n + ", ";
});
} else {
- name = ac.app.routes.show_route.name;
- Object.keys(ac.app.routes.show_route.verbs).forEach(function(n) {
- methods += n + ", ";
+ name = "show_route";
+ routes.show_route.verbs.forEach(function(n) {
+ methods += n + ", ";
});
}
+ methods = methods.toUpperCase();
return {
"path": path,
"name": name,
"methods": methods.replace(/, $/, "")
};
}
Y.namespace('mojito.controllers')[NAME] = {
- init: function (config) {
- this.config = config;
- },
index: function (ac) {
ac.done(route_info(ac));
},
- show: function (ac) {
+ show: function (ac) {
ac.done(route_info(ac));
}
};
- }, '0.0.1', {requires: ['mojito-url-addon', 'mojito-http-addon']});
+ }, '0.0.1', {requires: ['mojito-config-addon', 'mojito-http-addon']});
#. To display your route information in your ``index`` template, replace the content of
``index.hb.html`` with the following:
@@ -249,4 +238,3 @@ Source Code
- `Route Configuration <http://github.com/yahoo/mojito/tree/master/examples/developer-guide/configure_routing/routes.json>`_
- `Configure Routing Application <http://github.com/yahoo/mojito/tree/master/examples/developer-guide/configure_routing/>`_
-
View
2 docs/dev_guide/reference/mojito_troubleshooting.rst
@@ -38,7 +38,7 @@ an error or the value is not found.*
**A:**
Try inspecting the ``spec`` object that is found in the ``ActionContext`` object for the
key. If ``ac`` is the ``ActionContext`` object, you can access the ``specs` object with the
-following: ``ac.app.config.specs``.
+following: ``ac.config.getAppConfig().specs``.
If you need to examine the entire ``ActionContext`` object, you can use the
``console.log(ac)`` or the following code:
View
9 examples/developer-guide/adding_view_engines/mojits/myMojit/controller.server.js
@@ -2,18 +2,15 @@
YUI.add('myMojit', function (Y, NAME) {
- Y.mojito.controllers[NAME] = {
+ Y.namespace('mojito.controllers')[NAME] = {
- init: function (config) {
- this.config = config;
- },
default_ve: function (ac) {
ac.done({
"title": "Handlebars at work!",
"view_engines": [
{"name": "EJS"},
{"name": "Jade"},
- {"name": "dust"},
+ {"name": "Dust"},
{"name": "underscore" }
],
"ul": { "title": 'Here are some of the other available rendering engines:' }
@@ -27,4 +24,4 @@ YUI.add('myMojit', function (Y, NAME) {
});
}
};
-}, '0.0.1', {requires: ['mojito', 'myMojitModelFoo']});
+}, '0.0.1', {requires: ['mojito', 'myMojitModelFoo']});
View
4 examples/developer-guide/adding_view_engines/mojits/myMojit/models/foo.server.js
@@ -16,7 +16,7 @@ YUI.add('myMojitModelFoo', function(Y, NAME) {
* @class myMojitModelFoo
* @constructor
*/
- Y.mojito.models[NAME] = {
+ Y.namespace('mojito.models')[NAME] = {
init: function(config) {
this.config = config;
@@ -34,4 +34,4 @@ YUI.add('myMojitModelFoo', function(Y, NAME) {
};
-}, '0.0.1', {requires: ['mojito']});
+}, '0.0.1', {requires: []});
View
37 ...es/developer-guide/adding_view_engines/mojits/myMojit/tests/binders/index.common-tests.js
@@ -1,37 +0,0 @@
-/*
- * Copyright (c) 2012 Yahoo! Inc. All rights reserved.
- */
-YUI.add('myMojitBinderIndex-tests', function(Y, NAME) {
-
- var suite = new YUITest.TestSuite(NAME),
- binder,
- A = YUITest.Assert;
-
- suite.add(new YUITest.TestCase({
-
- name: 'myMojit index binder tests',
-
- setUp: function() {
- binder = Y.mojito.binders.myMojitBinderIndex;
- },
- tearDown: function() {
- binder = null;
- },
-
- 'TODO: test update id': function() {
- var node = Y.Node.create("<div id='guid123'></div>");
- binder.init({
- _guid: 'guid123'
- });
- binder.bind(node);
-
- // there is nothing to test in the binder initially
- A.skip();
-
- }
-
- }));
-
- YUITest.TestRunner.add(suite);
-
-}, '0.0.1', {requires: ['mojito-test', 'node', 'myMojitBinderIndex']});
View
101 examples/developer-guide/adding_view_engines/mojits/myMojit/tests/controller.server-tests.js
@@ -1,101 +0,0 @@
-/*
- * Copyright (c) 2012 Yahoo! Inc. All rights reserved.
- */
-
-YUI.add('myMojit-tests', function(Y) {
-
- var suite = new YUITest.TestSuite('myMojit-tests'),
- controller = null,
- A = YUITest.Assert;
-
- suite.add(new YUITest.TestCase({
-
- name: 'myMojit user tests',
-
- setUp: function() {
- controller = Y.mojito.controllers.myMojit;
- },
- tearDown: function() {
- controller = null;
- },
- 'test mojit': function() {
- var ac,
- doneResults;
- ac = {
- done: function(data) {
- doneResults = data;
- }
- };
- A.isNotNull(controller);
- A.isFunction(controller.index);
- A.isFunction(controller.default_ve);
- A.isFunction(controller.added_ve);
- },
- 'test index': function() {
- var ac,
- doneResults;
- ac = {
- done: function(data) {
- doneResults = data;
- }
- };
- controller.index(ac);
- A.isString(doneResults);
- A.areSame('Mojito is working.', doneResults);
- },
- 'test default_ve': function() {
- var ac,
- doneResults;
- ac = {
- done: function(data) {
- doneResults = data;
- }
- };
- controller.default_ve(ac);
- A.isObject(doneResults);
- var test_data = {
- "title": "Mustache at work!",
- "view_engines": [
- {"name": "Handlebars"},
- {"name": "EJS"},
- {"name": "Jade"},
- {"name": "dust"},
- {"name": "underscore" }
- ],
- "ul": { "title": 'Here are some of the other available rendering engines:' }
- };
- A.areSame(test_data.title,doneResults.title);
- A.areSame(test_data.view_engines.length,doneResults.view_engines.length);
- var arr_size = test_data.view_engines.length;
- for(var i=0;i<arr_size;i++){
- A.areSame(test_data.view_engines[i].name,doneResults.view_engines[i].name);
- }
- // A.areSame(test_data.ul.title,doneResults.ul.title);
- },
- 'test added_ve': function() {
- var ac,
- doneResults;
- ac = {
- done: function(data) {
- doneResults = data;
- }
- };
- controller.added_ve(ac);
- var test_data = {
- "title": "Handlebars at work!",
- "view_engines": [ "Mustache","EJS","Jade", "dust","underscore" ],
- "ul": { "title": 'Here are some of the other available rendering engines:' }
- };
- A.isObject(doneResults);
- A.areSame(test_data.title,doneResults.title);
- A.areSame(test_data.view_engines.length,doneResults.view_engines.length);
- var arr_size = test_data.view_engines.length;
- for(var i=0;i<arr_size;i++){
- A.areSame(test_data.view_engines[i],doneResults.view_engines[i]);
- }
- A.areSame(test_data.ul.title,doneResults.ul.title);
- }
- }));
- YUITest.TestRunner.add(suite);
-
-}, '0.0.1', {requires: ['mojito-test', 'myMojit','json-stringify']});
View
39 examples/developer-guide/adding_view_engines/mojits/myMojit/tests/models/foo.server-tests.js
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2012 Yahoo! Inc. All rights reserved.
- */
-
-YUI.add('myMojitModelFoo-tests', function(Y, NAME) {
-
- var suite = new YUITest.TestSuite(NAME),
- model = null,
- A = YUITest.Assert;
-
- suite.add(new YUITest.TestCase({
-
- name: 'myMojitModelFoo user tests',
-
- setUp: function() {
- model = Y.mojito.models.myMojitModelFoo;
- },
- tearDown: function() {
- model = null;
- },
-
- 'test mojit model': function() {
- var called = false;
- A.isNotNull(model);
- A.isFunction(model.getData);
- model.getData(function(err, data) {
- called = true;
- A.isTrue(!err);
- A.isObject(data);
- A.areSame('data', data.some);
- });
- A.isTrue(called);
- }
-
- }));
-
- YUITest.TestRunner.add(suite);
-
-}, '0.0.1', {requires: ['mojito-test', 'myMojitModelFoo']});
View
3 examples/developer-guide/binding_events/mojits/PagerMojit/controller.server.js
@@ -38,9 +38,6 @@ YUI.add('PagerMojit', function (Y, NAME) {
* @constructor
*/
Y.namespace('mojito.controllers')[NAME] = {
- init: function(config) {
- this.config = config;
- },
index: function(actionContext) {
var page = 0,
start,
View
24 examples/developer-guide/binding_events/mojits/PagerMojit/models/model.server.js
@@ -6,19 +6,19 @@
/*jslint anon:true, sloppy:true, nomen:true*/
-YUI.add('PagerMojitModel', function(Y) {
+YUI.add('PagerMojitModel', function(Y, NAME) {
var API_KEY = '84921e87fb8f2fc338c3ff9bf51a412e';
/**
- * The PagerMojitModel module.
- * @module PagerMojitModel
- */
+ * The PagerMojitModel module.
+ * @module PagerMojitModel
+ */
/**
- * Constructor for the Model class.
- * @class Model
- * @constructor
- */
- Y.mojito.models.PagerMojitModel = {
+ * Constructor for the Model class.
+ * @class Model
+ * @constructor
+ */
+ Y.namespace('mojito.models')[NAME] = {
init: function(config) {
this.config = config;
},
@@ -57,8 +57,4 @@ YUI.add('PagerMojitModel', function(Y) {
});
}
};
-}, '0.0.1', {requires: [
- 'mojito',
- 'mojito-models-addon',
- 'yql'
-]});
+}, '0.0.1', {requires: ['mojito', 'yql']});
View
39 ...ples/developer-guide/binding_events/mojits/PagerMojit/tests/binders/index.common-tests.js
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2011-2012, Yahoo! Inc. All rights reserved.
- * Copyrights licensed under the New BSD License.
- * See the accompanying LICENSE file for terms.
- */
-
-YUI.add('PagerMojitBinderIndex-tests', function(Y, NAME) {
-
- var suite = new YUITest.TestSuite(NAME),
- binder,
- A = YUITest.Assert;
-
- suite.add(new YUITest.TestCase({
-
- name: 'PagerMojit index binder tests',
-
- setUp: function() {
- binder = Y.mojito.binders.PagerMojitBinderIndex;
- },
- tearDown: function() {
- binder = null;
- },
-
- 'TODO: test update id': function() {
- var node = Y.Node.create("<div id='guid123'></div>");
- binder.init({
- _guid: 'guid123'
- });
- binder.bind(node);
-
- A.skip();
-
- }
-
- }));
-
- YUITest.TestRunner.add(suite);
-
-}, '0.0.1', {requires: ['mojito-test', 'node', 'PagerMojitBinderIndex']});
View
42 examples/developer-guide/binding_events/mojits/PagerMojit/tests/controller.server-tests.js
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2011-2012, Yahoo! Inc. All rights reserved.
- * Copyrights licensed under the New BSD License.
- * See the accompanying LICENSE file for terms.
- */
-
-
-YUI.add('PagerMojit-tests', function(Y) {
-
- var suite = new YUITest.TestSuite('PagerMojit-tests'),
- controller = null,
- A = YUITest.Assert;
-
- suite.add(new YUITest.TestCase({
-
- name: 'PagerMojit user tests',
-
- setUp: function() {
- controller = Y.mojito.controllers.PagerMojit;
- },
- tearDown: function() {
- controller = null;
- },
-
- 'test mojit': function() {
- var ac, results;
- A.isNotNull(controller);
- A.isFunction(controller.index);
- ac = {
- done: function(data) {
- results = data;
- }
- };
- controller.index(ac);
- A.areSame('Mojito is working.', results);
- }
-
- }));
-
- YUITest.TestRunner.add(suite);
-
-}, '0.0.1', {requires: ['mojito-test', 'PagerMojit']});
View
34 examples/developer-guide/binding_events/mojits/PagerMojit/tests/models/model.server-tests.js
@@ -1,34 +0,0 @@
-/*
- * Copyright (c) 2011-2012, Yahoo! Inc. All rights reserved.
- * Copyrights licensed under the New BSD License.
- * See the accompanying LICENSE file for terms.
- */
-
-
-YUI.add('PagerMojitModel-tests', function(Y) {
-
- var suite = new YUITest.TestSuite('PagerMojitModel-tests'),
- model = null,
- A = YUITest.Assert;
-
- suite.add(new YUITest.TestCase({
-
- name: 'PagerMojit model user tests',
-
- setUp: function() {
- model = Y.mojito.models.PagerMojit;
- },
- tearDown: function() {
- model = null;
- },
-
- 'test mojit model': function() {
- A.isNotNull(model);
- A.isFunction(model.getData);
- }
-
- }));
-
- YUITest.TestRunner.add(suite);
-
-}, '0.0.1', {requires: ['mojito-test', 'PagerMojitModel']});
View
1 examples/developer-guide/configure_routing/application.json
@@ -1,7 +1,6 @@
[
{
"settings": [ "master" ],
- "appPort": 8666,
"specs": {
"mapped_mojit": {
"type": "RoutingMojit"
View
3 examples/developer-guide/configure_routing/mojits/RoutingMojit/controller.server.js
@@ -38,9 +38,6 @@ YUI.add('RoutingMojit', function(Y, NAME) {
};
}
Y.namespace('mojito.controllers')[NAME] = {
- init: function (config) {
- this.config = config;
- },
index: function (ac) {
ac.done(route_info(ac));
},
View
4 examples/developer-guide/configure_routing/mojits/RoutingMojit/models/model.server.js
@@ -6,7 +6,7 @@
/*jslint anon:true, sloppy:true, nomen:true*/
-YUI.add('RoutingMojitModel', function (Y) {
+YUI.add('RoutingMojitModel', function (Y, NAME) {
/**
* The RoutingMojitModel module.
@@ -20,7 +20,7 @@ YUI.add('RoutingMojitModel', function (Y) {
* @class Model
* @constructor
*/
- Y.mojito.models.RoutingMojit = {
+ Y.namespace('mojito.models')[NAME] = {
init: function (config) {
this.config = config;
View
39 ...developer-guide/configure_routing/mojits/RoutingMojit/tests/binders/index.common-tests.js
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2011-2012, Yahoo! Inc. All rights reserved.
- * Copyrights licensed under the New BSD License.
- * See the accompanying LICENSE file for terms.
- */
-
-YUI.add('RoutingMojitBinderIndex-tests', function(Y, NAME) {
-
- var suite = new YUITest.TestSuite(NAME),
- binder,
- A = YUITest.Assert;
-
- suite.add(new YUITest.TestCase({
-
- name: 'RoutingMojit index binder tests',
-
- setUp: function() {
- binder = Y.mojito.binders.RoutingMojitBinderIndex;
- },
- tearDown: function() {
- binder = null;
- },
-
- 'TODO: test update id': function() {
- var node = Y.Node.create("<div id='guid123'></div>");
- binder.init({
- _guid: 'guid123'
- });
- binder.bind(node);
-
- A.skip();
-
- }
-
- }));
-
- YUITest.TestRunner.add(suite);
-
-}, '0.0.1', {requires: ['mojito-test', 'node', 'RoutingMojitBinderIndex']});
View
42 ...es/developer-guide/configure_routing/mojits/RoutingMojit/tests/controller.server-tests.js
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2011-2012, Yahoo! Inc. All rights reserved.
- * Copyrights licensed under the New BSD License.
- * See the accompanying LICENSE file for terms.
- */
-
-
-YUI.add('RoutingMojit-tests', function(Y) {
-
- var suite = new YUITest.TestSuite('RoutingMojit-tests'),
- controller = null,
- A = YUITest.Assert;
-
- suite.add(new YUITest.TestCase({
-
- name: 'RoutingMojit user tests',
-
- setUp: function() {
- controller = Y.mojito.controllers.RoutingMojit;
- },
- tearDown: function() {
- controller = null;
- },
-
- 'test mojit': function() {
- var ac, results;
- A.isNotNull(controller);
- A.isFunction(controller.index);
- ac = {
- done: function(data) {
- results = data;
- }
- };
- controller.index(ac);
- A.areSame('Mojito is working.', results);
- }
-
- }));
-
- YUITest.TestRunner.add(suite);
-
-}, '0.0.1', {requires: ['mojito-test', 'RoutingMojit']});
View
34 .../developer-guide/configure_routing/mojits/RoutingMojit/tests/models/model.server-tests.js
@@ -1,34 +0,0 @@
-/*
- * Copyright (c) 2011-2012, Yahoo! Inc. All rights reserved.
- * Copyrights licensed under the New BSD License.
- * See the accompanying LICENSE file for terms.
- */
-
-
-YUI.add('RoutingMojitModel-tests', function(Y) {
-
- var suite = new YUITest.TestSuite('RoutingMojitModel-tests'),
- model = null,
- A = YUITest.Assert;
-
- suite.add(new YUITest.TestCase({
-
- name: 'RoutingMojit model user tests',
-
- setUp: function() {
- model = Y.mojito.models.RoutingMojit;
- },
- tearDown: function() {
- model = null;
- },
-
- 'test mojit model': function() {
- A.isNotNull(model);
- A.isFunction(model.getData);
- }
-
- }));
-
- YUITest.TestRunner.add(suite);
-
-}, '0.0.1', {requires: ['mojito-test', 'RoutingMojitModel']});
View
4 examples/developer-guide/device_assets/mojits/device/controller.server.js
@@ -8,9 +8,7 @@
YUI.add('device', function (Y, NAME) {
Y.namespace('mojito.controllers')[NAME] = {
- init: function(config) {
- this.config = config;
- },
+
index: function(ac) {
var device = ac.context.device, css = '/static/device/assets/simple';
if (device === 'iphone') {
View
41 examples/developer-guide/device_assets/mojits/device/tests/controller.server-tests.js
@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2011-2012, Yahoo! Inc. All rights reserved.
- * Copyrights licensed under the New BSD License.
- * See the accompanying LICENSE file for terms.
- */
-
-YUI.add('device-tests', function(Y) {
-
- var suite = new YUITest.TestSuite('device-tests'),
- controller = null,
- A = YUITest.Assert;
-
- suite.add(new YUITest.TestCase({
-
- name: 'device user tests',
-
- setUp: function() {
- controller = Y.mojito.controllers.device;
- },
- tearDown: function() {
- controller = null;
- },
-
- 'test mojit': function() {
- var ac, results;
- A.isNotNull(controller);
- A.isFunction(controller.index);
- ac = {
- done: function(data) {
- results = data;
- }
- };
- controller.index(ac);
- A.areSame('Mojito is working.', results);
- }
-
- }));
-
- YUITest.TestRunner.add(suite);
-
-}, '0.0.1', {requires: ['mojito-test', 'device']});
View
4 examples/developer-guide/device_views/mojits/device/controller.server.js
@@ -9,9 +9,7 @@
YUI.add('device', function (Y, NAME) {
Y.namespace('mojito.controllers')[NAME] = {
- init: function(config) {
- this.config = config;
- },
+
/* Method corresponding to the 'index' action.
*
* @param ac {Object} The action context that
View
5 examples/developer-guide/device_views/mojits/device/models/model.server.js
@@ -5,8 +5,7 @@
*/
/*jslint anon:true, sloppy:true, nomen:true*/
-
-YUI.add('deviceModel', function (Y) {
+YUI.add('deviceModel', function (Y, NAME) {
/**
* The deviceModel module.
@@ -20,7 +19,7 @@ YUI.add('deviceModel', function (Y) {
* @class Model
* @constructor
*/
- Y.mojito.models.device = {
+ Y.namespace('mojito.models')[NAME] = {
init: function (config) {
this.config = config;
View
39 examples/developer-guide/device_views/mojits/device/tests/binders/index.common-tests.js
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2011-2012, Yahoo! Inc. All rights reserved.
- * Copyrights licensed under the New BSD License.
- * See the accompanying LICENSE file for terms.
- */
-
-YUI.add('deviceBinderIndex-tests', function(Y, NAME) {
-
- var suite = new YUITest.TestSuite(NAME),
- binder,
- A = YUITest.Assert;
-
- suite.add(new YUITest.TestCase({
-
- name: 'device index binder tests',
-
- setUp: function() {
- binder = Y.mojito.binders.deviceBinderIndex;
- },
- tearDown: function() {
- binder = null;
- },
-
- 'TODO: test update id': function() {
- var node = Y.Node.create("<div id='guid123'></div>");
- binder.init({
- _guid: 'guid123'
- });
- binder.bind(node);
-
- A.skip();
-
- }
-
- }));
-
- YUITest.TestRunner.add(suite);
-
-}, '0.0.1', {requires: ['mojito-test', 'node', 'deviceBinderIndex']});
View
42 examples/developer-guide/device_views/mojits/device/tests/controller.server-tests.js
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2011-2012, Yahoo! Inc. All rights reserved.
- * Copyrights licensed under the New BSD License.
- * See the accompanying LICENSE file for terms.
- */
-
-
-YUI.add('device-tests', function(Y) {
-
- var suite = new YUITest.TestSuite('device-tests'),
- controller = null,
- A = YUITest.Assert;
-
- suite.add(new YUITest.TestCase({
-
- name: 'device user tests',
-
- setUp: function() {
- controller = Y.mojito.controllers.device;
- },
- tearDown: function() {
- controller = null;
- },
-
- 'test mojit': function() {
- var ac, results;
- A.isNotNull(controller);
- A.isFunction(controller.index);
- ac = {
- done: function(data) {
- results = data;
- }
- };
- controller.index(ac);
- A.areSame('Mojito is working.', results);
- }
-
- }));
-
- YUITest.TestRunner.add(suite);
-
-}, '0.0.1', {requires: ['mojito-test', 'device']});
View
33 examples/developer-guide/device_views/mojits/device/tests/models/model.server-tests.js
@@ -1,33 +0,0 @@
-/*
- * Copyright (c) 2011-2012, Yahoo! Inc. All rights reserved.
- * Copyrights licensed under the New BSD License.
- * See the accompanying LICENSE file for terms.
- */
-
-YUI.add('deviceModel-tests', function(Y) {
-
- var suite = new YUITest.TestSuite('deviceModel-tests'),
- model = null,
- A = YUITest.Assert;
-
- suite.add(new YUITest.TestCase({
-
- name: 'device model user tests',
-
- setUp: function() {
- model = Y.mojito.models.device;
- },
- tearDown: function() {
- model = null;
- },
-
- 'test mojit model': function() {
- A.isNotNull(model);
- A.isFunction(model.getData);
- }
-
- }));
-
- YUITest.TestRunner.add(suite);
-
-}, '0.0.1', {requires: ['mojito-test', 'deviceModel']});
View
3 examples/developer-guide/framed_assets/mojits/framed/controller.server.js
@@ -8,9 +8,6 @@
YUI.add('framed', function (Y, NAME) {
Y.namespace('mojito.controllers')[NAME] = {
- init: function (config) {
- this.config = config;
- },
index: function (ac) {
var data = {
title: "Framed Assets",
View
4 examples/developer-guide/framed_assets/mojits/framed/models/model.server.js
@@ -6,7 +6,7 @@
/*jslint anon:true, sloppy:true, nomen:true*/
-YUI.add('framedModel', function (Y) {
+YUI.add('framedModel', function (Y, NAME) {
/**
* The framedModel module.
@@ -20,7 +20,7 @@ YUI.add('framedModel', function (Y) {
* @class Model
* @constructor
*/
- Y.mojito.models.framed = {
+ Y.namespace('mojito.models')[NAME] = {
init: function (config) {
this.config = config;
View
39 examples/developer-guide/framed_assets/mojits/framed/tests/binders/index.common-tests.js
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2011-2012, Yahoo! Inc. All rights reserved.
- * Copyrights licensed under the New BSD License.
- * See the accompanying LICENSE file for terms.
- */
-
-YUI.add('framedBinderIndex-tests', function(Y, NAME) {
-
- var suite = new YUITest.TestSuite(NAME),
- binder,
- A = YUITest.Assert;
-
- suite.add(new YUITest.TestCase({
-
- name: 'framed index binder tests',
-
- setUp: function() {
- binder = Y.mojito.binders.framedBinderIndex;
- },
- tearDown: function() {
- binder = null;
- },
-
- 'TODO: test update id': function() {
- var node = Y.Node.create("<div id='guid123'></div>");
- binder.init({
- _guid: 'guid123'
- });
- binder.bind(node);
-
- A.skip();
-
- }
-
- }));
-
- YUITest.TestRunner.add(suite);
-
-}, '0.0.1', {requires: ['mojito-test', 'node', 'framedBinderIndex']});
View
41 examples/developer-guide/framed_assets/mojits/framed/tests/controller.server-tests.js
@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2011-2012, Yahoo! Inc. All rights reserved.
- * Copyrights licensed under the New BSD License.
- * See the accompanying LICENSE file for terms.
- */
-
-YUI.add('framed-tests', function(Y) {
-
- var suite = new YUITest.TestSuite('framed-tests'),
- controller = null,
- A = YUITest.Assert;
-
- suite.add(new YUITest.TestCase({
-
- name: 'framed user tests',
-
- setUp: function() {
- controller = Y.mojito.controllers.framed;
- },
- tearDown: function() {
- controller = null;
- },
-
- 'test mojit': function() {
- var ac, results;
- A.isNotNull(controller);
- A.isFunction(controller.index);
- ac = {
- done: function(data) {
- results = data;
- }
- };
- controller.index(ac);
- A.areSame('Mojito is working.', results);
- }
-
- }));
-
- YUITest.TestRunner.add(suite);
-
-}, '0.0.1', {requires: ['mojito-test', 'framed']});
View
34 examples/developer-guide/framed_assets/mojits/framed/tests/models/model.server-tests.js
@@ -1,34 +0,0 @@
-/*
- * Copyright (c) 2011-2012, Yahoo! Inc. All rights reserved.
- * Copyrights licensed under the New BSD License.
- * See the accompanying LICENSE file for terms.
- */
-
-
-YUI.add('framedModel-tests', function(Y) {
-
- var suite = new YUITest.TestSuite('framedModel-tests'),
- model = null,
- A = YUITest.Assert;
-
- suite.add(new YUITest.TestCase({
-
- name: 'framed model user tests',
-
- setUp: function() {
- model = Y.mojito.models.framed;
- },
- tearDown: function() {
- model = null;
- },
-
- 'test mojit model': function() {
- A.isNotNull(model);
- A.isFunction(model.getData);
- }
-
- }));
-
- YUITest.TestRunner.add(suite);
-
-}, '0.0.1', {requires: ['mojito-test', 'framedModel']});
View
19 examples/developer-guide/framed_config/mojits/MainMojit/binders/binder.js
@@ -6,12 +6,12 @@
/*jslint anon:true, sloppy:true, nomen:true*/
-YUI.add('MainMojitBinder', function(Y) {
+YUI.add('MainMojitBinder', function (Y, NAME) {
/**
- * The MainMojitBinder module.
+ * The HelloMojitBinderIndex module.
*
- * @module MainMojitBinder
+ * @module HelloMojitBinderIndex
*/
/**
@@ -23,17 +23,14 @@ YUI.add('MainMojitBinder', function(Y) {
* @class Binder
* @constructor
*/
- function Binder(mojitProxy) {
- this.mojitProxy = mojitProxy;
- }
-
- Binder.prototype = {
+ Y.namespace('mojito.binders')[NAME] = {
/**
* Binder initialization method, invoked after all binders on the page
* have been constructed.
*/
- init: function () {
+ init: function (mojitProxy) {
+ this.mojitProxy = mojitProxy;
},
/**
@@ -48,6 +45,4 @@ YUI.add('MainMojitBinder', function(Y) {
};
- Y.mojito.registerEventBinder('MainMojit', Binder);
-
-}, '0.0.1', {requires: ['mojito']});
+}, '0.0.1', {requires: []});
View
4 examples/developer-guide/framed_config/mojits/MainMojit/models/model.server.js
@@ -6,9 +6,9 @@
/*jslint anon:true, sloppy:true, nomen:true*/
-YUI.add('MainMojitModel', function (Y) {
+YUI.add('MainMojitModel', function (Y, NAME) {
- Y.mojito.models.MainMojit = {
+ Y.namespace('mojito.models')[NAME] = {
getData: function (callback) {
callback({some: 'data'});
View
41 examples/developer-guide/framed_config/mojits/MainMojit/tests/controller.server-tests.js
@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2011-2012, Yahoo! Inc. All rights reserved.
- * Copyrights licensed under the New BSD License.
- * See the accompanying LICENSE file for terms.
- */
-
-YUI.add('MainMojit-tests', function(Y, NAME) {
-
- var suite = new YUITest.TestSuite(NAME),
- controller = null,
- A = YUITest.Assert;
-
- suite.add(new YUITest.TestCase({
-
- name: 'MainMojit user tests',
-
- setUp: function() {
- controller = new Y.mojit.test.MainMojit.controller();
- },
- tearDown: function() {
- controller = null;
- },
-
- 'test mojit': function() {
- var ac, results;
- A.isNotNull(controller);
- A.isFunction(controller.index);
- ac = {
- done: function(data) {
- results = data;
- }
- };
- controller.index(ac);
- A.areSame('Mojito is working.', results);
- }
-
- }));
-
- YUITest.TestRunner.add(suite);
-
-}, '0.0.1', {requires: ['mojit-test', 'MainMojit']});
View
33 examples/developer-guide/framed_config/mojits/MainMojit/tests/model.server-tests.js
@@ -1,33 +0,0 @@
-/*
- * Copyright (c) 2011-2012, Yahoo! Inc. All rights reserved.
- * Copyrights licensed under the New BSD License.
- * See the accompanying LICENSE file for terms.
- */
-
-YUI.add('MainMojitModel-tests', function(Y, NAME) {
-
- var suite = new YUITest.TestSuite(NAME),
- model = null,
- A = YUITest.Assert;
-
- suite.add(new YUITest.TestCase({
-
- name: 'MainMojit model user tests',
-
- setUp: function() {
- model = new Y.mojit.test.MainMojit.model();
- },
- tearDown: function() {
- model = null;
- },
-
- 'test mojit model': function() {
- A.isNotNull(model);
- A.isFunction(model.getData);
- }
-
- }));
-
- YUITest.TestRunner.add(suite);
-
-}, '0.0.1', {requires: ['mojit-test', 'MainMojitModel']});
View
4 examples/developer-guide/generating_urls/mojits/GenURLMojit/models/model.server.js
@@ -6,7 +6,7 @@
/*jslint anon:true, sloppy:true, nomen:true*/
-YUI.add('GenURLMojitModel', function(Y) {
+YUI.add('GenURLMojitModel', function(Y, NAME) {
/**
* The GenURLMojitModel module.
@@ -20,7 +20,7 @@ YUI.add('GenURLMojitModel', function(Y) {
* @class Model
* @constructor
*/
- Y.mojito.models.GenURLMojit = {
+ Y.namespace('mojito.models')[NAME] = {
init: function (config) {
this.config = config;
View
39 ...es/developer-guide/generating_urls/mojits/GenURLMojit/tests/binders/index.common-tests.js
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2011-2012, Yahoo! Inc. All rights reserved.
- * Copyrights licensed under the New BSD License.
- * See the accompanying LICENSE file for terms.
- */
-
-YUI.add('GenURLMojitBinderIndex-tests', function(Y, NAME) {
-
- var suite = new YUITest.TestSuite(NAME),
- binder,
- A = YUITest.Assert;
-
- suite.add(new YUITest.TestCase({
-
- name: 'GenURLMojit index binder tests',
-
- setUp: function() {
- binder = Y.mojito.binders.GenURLMojitBinderIndex;
- },
- tearDown: function() {
- binder = null;
- },
-
- 'TODO: test update id': function() {
- var node = Y.Node.create("<div id='guid123'></div>");
- binder.init({
- _guid: 'guid123'
- });
- binder.bind(node);
-
- A.skip();
-
- }
-
- }));
-
- YUITest.TestRunner.add(suite);
-
-}, '0.0.1', {requires: ['mojito-test', 'node', 'GenURLMojitBinderIndex']});
View
41 examples/developer-guide/generating_urls/mojits/GenURLMojit/tests/controller.server-tests.js
@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2011-2012, Yahoo! Inc. All rights reserved.
- * Copyrights licensed under the New BSD License.
- * See the accompanying LICENSE file for terms.
- */
-
-YUI.add('GenURLMojit-tests', function(Y) {
-
- var suite = new YUITest.TestSuite('GenURLMojit-tests'),
- controller = null,
- A = YUITest.Assert;
-
- suite.add(new YUITest.TestCase({
-
- name: 'GenURLMojit user tests',
-
- setUp: function() {
- controller = Y.mojito.controllers.GenURLMojit;
- },
- tearDown: function() {
- controller = null;
- },
-
- 'test mojit': function() {
- var ac, results;
- A.isNotNull(controller);
- A.isFunction(controller.index);
- ac = {
- done: function(data) {
- results = data;
- }
- };
- controller.index(ac);
- A.areSame('Mojito is working.', results);
- }
-
- }));
-
- YUITest.TestRunner.add(suite);
-
-}, '0.0.1', {requires: ['mojito-test', 'GenURLMojit']});
View
33 ...les/developer-guide/generating_urls/mojits/GenURLMojit/tests/models/model.server-tests.js
@@ -1,33 +0,0 @@
-/*
- * Copyright (c) 2011-2012, Yahoo! Inc. All rights reserved.
- * Copyrights licensed under the New BSD License.
- * See the accompanying LICENSE file for terms.
- */
-
-YUI.add('GenURLMojitModel-tests', function(Y) {
-
- var suite = new YUITest.TestSuite('GenURLMojitModel-tests'),
- model = null,
- A = YUITest.Assert;
-
- suite.add(new YUITest.TestCase({
-
- name: 'GenURLMojit model user tests',
-
- setUp: function() {
- model = Y.mojito.models.GenURLMojit;
- },
- tearDown: function() {
- model = null;
- },
-
- 'test mojit model': function() {
- A.isNotNull(model);
- A.isFunction(model.getData);
- }
-
- }));
-
- YUITest.TestRunner.add(suite);
-
-}, '0.0.1', {requires: ['mojito-test', 'GenURLMojitModel']});
View
4 examples/developer-guide/hello/mojits/HelloMojit/controller.server.js
@@ -22,10 +22,6 @@ YUI.add('HelloMojit', function (Y, NAME) {
*/
Y.namespace('mojito.controllers')[NAME] = {
- init: function (config) {
- this.config = config;
- },
-
/**
* Method corresponding to the 'index' action.
*
View
4 examples/developer-guide/hello/mojits/HelloMojit/models/model.server.js
@@ -6,7 +6,7 @@
/*jslint anon:true, sloppy:true, nomen:true*/
-YUI.add('HelloMojitModel', function (Y) {
+YUI.add('HelloMojitModel', function (Y, NAME) {
/**
* The HelloMojitModel module.
@@ -20,7 +20,7 @@ YUI.add('HelloMojitModel', function (Y) {
* @class Model
* @constructor
*/
- Y.mojito.models.HelloMojit = {
+ Y.namespace('mojito.models')[NAME] = {
init: function (config) {
this.config = config;
View
39 examples/developer-guide/hello/mojits/HelloMojit/tests/binders/index.common-tests.js
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2011-2012, Yahoo! Inc. All rights reserved.
- * Copyrights licensed under the New BSD License.
- * See the accompanying LICENSE file for terms.
- */
-
-YUI.add('HelloMojitBinderIndex-tests', function(Y, NAME) {
-
- var suite = new YUITest.TestSuite(NAME),
- binder,
- A = YUITest.Assert;
-
- suite.add(new YUITest.TestCase({
-
- name: 'HelloMojit index binder tests',
-
- setUp: function() {
- binder = Y.mojito.binders.HelloMojitBinderIndex;
- },
- tearDown: function() {
- binder = null;
- },
-
- 'TODO: test update id': function() {
- var node = Y.Node.create("<div id='guid123'></div>");
- binder.init({
- _guid: 'guid123'
- });
- binder.bind(node);
-
- A.skip();
-
- }
-
- }));
-
- YUITest.TestRunner.add(suite);
-
-}, '0.0.1', {requires: ['mojito-test', 'node', 'HelloMojitBinderIndex']});
View
41 examples/developer-guide/hello/mojits/HelloMojit/tests/controller.server-tests.js
@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2011-2012, Yahoo! Inc. All rights reserved.
- * Copyrights licensed under the New BSD License.
- * See the accompanying LICENSE file for terms.
- */
-
-YUI.add('HelloMojit-tests', function(Y) {
-
- var suite = new YUITest.TestSuite('HelloMojit-tests'),
- controller = null,
- A = YUITest.Assert;
-
- suite.add(new YUITest.TestCase({
-
- name: 'HelloMojit user tests',
-
- setUp: function() {
- controller = Y.mojito.controllers.HelloMojit;
- },
- tearDown: function() {
- controller = null;
- },
-
- 'test mojit': function() {
- var ac, results;
- A.isNotNull(controller);
- A.isFunction(controller.index);
- ac = {
- done: function(data) {
- results = data;
- }
- };
- controller.index(ac);
- A.areSame('Hello World!', results);
- }
-
- }));
-
- YUITest.TestRunner.add(suite);
-
-}, '0.0.1', {requires: ['mojito-test', 'HelloMojit']});
View
34 examples/developer-guide/hello/mojits/HelloMojit/tests/models/model.server-tests.js
@@ -1,34 +0,0 @@
-/*
- * Copyright (c) 2011-2012, Yahoo! Inc. All rights reserved.
- * Copyrights licensed under the New BSD License.
- * See the accompanying LICENSE file for terms.
- */
-
-
-YUI.add('HelloMojitModel-tests', function(Y) {
-
- var suite = new YUITest.TestSuite('HelloMojitModel-tests'),
- model = null,
- A = YUITest.Assert;
-
- suite.add(new YUITest.TestCase({
-
- name: 'HelloMojit model user tests',
-
- setUp: function() {
- model = Y.mojito.models.HelloMojit;
- },
- tearDown: function() {
- model = null;
- },
-
- 'test mojit model': function() {
- A.isNotNull(model);
- A.isFunction(model.getData);
- }
-
- }));
-
- YUITest.TestRunner.add(suite);
-
-}, '0.0.1', {requires: ['mojito-test', 'HelloMojitModel']});
View
3 examples/developer-guide/htmlframe_mojit/mojits/framed/controller.server.js
@@ -9,9 +9,6 @@
YUI.add('framed', function (Y, NAME) {
Y.namespace('mojito.controllers')[NAME] = {
- init: function (config) {
- this.config = config;
- },
index: function (ac) {
ac.done({app_name: 'Framed Mojit'});
}
View
4 examples/developer-guide/htmlframe_mojit/mojits/framed/models/model.server.js
@@ -6,7 +6,7 @@
/*jslint anon:true, sloppy:true, nomen:true*/
-YUI.add('framedModel', function(Y) {
+YUI.add('framedModel', function(Y, NAME) {
/**
* The framedModel module.
@@ -20,7 +20,7 @@ YUI.add('framedModel', function(Y) {
* @class Model
* @constructor
*/
- Y.mojito.models.framed = {
+ Y.namespace('mojito.models')[NAME] = {
init: function (config) {
this.config = config;
View
39 examples/developer-guide/htmlframe_mojit/mojits/framed/tests/binders/index.common-tests.js
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2011-2012, Yahoo! Inc. All rights reserved.
- * Copyrights licensed under the New BSD License.
- * See the accompanying LICENSE file for terms.
- */
-
-YUI.add('framedBinderIndex-tests', function(Y, NAME) {
-
- var suite = new YUITest.TestSuite(NAME),
- binder,
- A = YUITest.Assert;
-
- suite.add(new YUITest.TestCase({
-
- name: 'framed index binder tests',
-
- setUp: function() {
- binder = Y.mojito.binders.framedBinderIndex;
- },
- tearDown: function() {
- binder = null;
- },
-
- 'TODO: test update id': function() {
- var node = Y.Node.create("<div id='guid123'></div>");
- binder.init({
- _guid: 'guid123'
- });
- binder.bind(node);
-
- A.skip();
-
- }
-
- }));
-
- YUITest.TestRunner.add(suite);
-
-}, '0.0.1', {requires: ['mojito-test', 'node', 'framedBinderIndex']});
View
41 examples/developer-guide/htmlframe_mojit/mojits/framed/tests/controller.server-tests.js
@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2011-2012, Yahoo! Inc. All rights reserved.
- * Copyrights licensed under the New BSD License.
- * See the accompanying LICENSE file for terms.
- */
-
-YUI.add('framed-tests', function(Y) {
-
- var suite = new YUITest.TestSuite('framed-tests'),
- controller = null,
- A = YUITest.Assert;
-
- suite.add(new YUITest.TestCase({
-
- name: 'framed user tests',
-
- setUp: function() {
- controller = Y.mojito.controllers.framed;
- },
- tearDown: function() {
- controller = null;
- },
-
- 'test mojit': function() {
- var ac, results;
- A.isNotNull(controller);
- A.isFunction(controller.index);
- ac = {
- done: function(data) {
- results = data;
- }
- };
- controller.index(ac);
- A.areSame('Mojito is working.', results);
- }
-
- }));
-
- YUITest.TestRunner.add(suite);
-
-}, '0.0.1', {requires: ['mojito-test', 'framed']});
View
33 examples/developer-guide/htmlframe_mojit/mojits/framed/tests/models/model.server-tests.js
@@ -1,33 +0,0 @@
-/*
- * Copyright (c) 2011-2012, Yahoo! Inc. All rights reserved.
- * Copyrights licensed under the New BSD License.
- * See the accompanying LICENSE file for terms.
- */
-
-YUI.add('framedModel-tests', function(Y) {
-
- var suite = new YUITest.TestSuite('framedModel-tests'),
- model = null,
- A = YUITest.Assert;
-
- suite.add(new YUITest.TestCase({
-
- name: 'framed model user tests',
-
- setUp: function() {
- model = Y.mojito.models.framed;
- },
- tearDown: function() {
- model = null;
- },
-
- 'test mojit model': function() {
- A.isNotNull(model);
- A.isFunction(model.getData);
- }
-
- }));
-
- YUITest.TestRunner.add(suite);
-
-}, '0.0.1', {requires: ['mojito-test', 'framedModel']});
View
3 examples/developer-guide/inter-mojit/mojits/MasterMojit/controller.server.js
@@ -10,9 +10,6 @@ YUI.add('MasterMojit', function (Y, NAME) {
Y.namespace('mojito.controllers')[NAME] = {
- init: function (config) {
- this.config = config;
- },
"index": function (actionContext) {
actionContext.composite.done();
}
View
41 examples/developer-guide/inter-mojit/mojits/MasterMojit/tests/controller.server-tests.js
@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2011-2012, Yahoo! Inc. All rights reserved.
- * Copyrights licensed under the New BSD License.
- * See the accompanying LICENSE file for terms.
- */
-
-YUI.add('MasterMojit-tests', function(Y, NAME) {
-
- var suite = new YUITest.TestSuite(NAME),
- controller = null,
- A = YUITest.Assert;
-
- suite.add(new YUITest.TestCase({
-
- name: 'MasterMojit user tests',
-
- setUp: function() {
- controller = new Y.mojit.test.MasterMojit.controller();
- },
- tearDown: function() {
- controller = null;
- },
-
- 'test mojit': function() {
- var ac, results;
- A.isNotNull(controller);
- A.isFunction(controller.index);
- ac = {
- done: function(data) {
- results = data;
- }
- };
- controller.index(ac);
- A.areSame('Mojito is working.', results);
- }
-
- }));
-
- YUITest.TestRunner.add(suite);
-
-}, '0.0.1', {requires: ['mojit-test', 'MasterMojit']});
View
3 examples/developer-guide/inter-mojit/mojits/ReceiverMojit/controller.server.js
@@ -9,9 +9,6 @@
YUI.add('ReceiverMojit', function (Y, NAME) {
Y.namespace('mojito.controllers')[NAME] = {
- init: function(config) {
- this.config = config;
- },
index: function (actionContext) {
actionContext.done({title: 'This is the receiver mojit'});
},
View
41 examples/developer-guide/inter-mojit/mojits/ReceiverMojit/tests/controller.server-tests.js
@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2011-2012, Yahoo! Inc. All rights reserved.
- * Copyrights licensed under the New BSD License.
- * See the accompanying LICENSE file for terms.
- */
-
-YUI.add('ReceiverMojit-tests', function(Y, NAME) {
-
- var suite = new YUITest.TestSuite(NAME),
- controller = null,
- A = YUITest.Assert;
-
- suite.add(new YUITest.TestCase({
-
- name: 'ReceiverMojit user tests',
-
- setUp: function() {
- controller = new Y.mojit.test.ReceiverMojit.controller();
- },
- tearDown: function() {
- controller = null;
- },
-
- 'test mojit': function() {
- var ac, results;
- A.isNotNull(controller);
- A.isFunction(controller.index);
- ac = {
- done: function(data) {
- results = data;
- }
- };
- controller.index(ac);
- A.areSame('Mojito is working.', results);
- }
-
- }));
-
- YUITest.TestRunner.add(suite);
-
-}, '0.0.1', {requires: ['mojit-test', 'ReceiverMojit']});
View
3 examples/developer-guide/inter-mojit/mojits/SenderMojit/controller.server.js
@@ -9,9 +9,6 @@
YUI.add('SenderMojit', function (Y, NAME) {
Y.namespace('mojito.controllers')[NAME] = {
- init: function(config) {
- this.config = config;
- },
"index": function (actionContext) {
actionContext.done({title: 'List of images for testing'});
}
View
41 examples/developer-guide/inter-mojit/mojits/SenderMojit/tests/controller.server-tests.js
@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2011-2012, Yahoo! Inc. All rights reserved.
- * Copyrights licensed under the New BSD License.
- * See the accompanying LICENSE file for terms.
- */
-
-YUI.add('SenderMojit-tests', function(Y, NAME) {
-
- var suite = new YUITest.TestSuite(NAME),
- controller = null,
- A = YUITest.Assert;
-
- suite.add(new YUITest.TestCase({
-
- name: 'SenderMojit user tests',
-
- setUp: function() {
- controller = new Y.mojit.test.SenderMojit.controller();
- },
- tearDown: function() {
- controller = null;
- },
-
- 'test mojit': function() {
- var ac, results;
- A.isNotNull(controller);
- A.isFunction(controller.index);
- ac = {
- done: function(data) {
- results = data;
- }
- };
- controller.index(ac);
- A.areSame('Mojito is working.', results);
- }
-
- }));
-
- YUITest.TestRunner.add(suite);
-
-}, '0.0.1', {requires: ['mojit-test', 'SenderMojit']});
View
3 examples/developer-guide/locale_i18n/mojits/i18n/controller.server.js
@@ -8,9 +8,6 @@
YUI.add('i18n', function (Y, NAME) {
Y.namespace('mojito.controllers')[NAME] = {
- init: function(config) {
- this.config = config;
- },
index: function (ac) {
// Default.
ac.done({
View
4 examples/developer-guide/locale_i18n/mojits/i18n/models/model.server.js
@@ -6,7 +6,7 @@
/*jslint anon:true, sloppy:true, nomen:true*/
-YUI.add('i18nModel', function (Y) {
+YUI.add('i18nModel', function (Y, NAME) {
/**
* The i18nModel module.
@@ -20,7 +20,7 @@ YUI.add('i18nModel', function (Y) {
* @class Model
* @constructor
*/
- Y.mojito.models.i18n = {
+ Y.namespace('mojito.models')[NAME] = {
init: function (config) {
this.config = config;