Browse files

Merge branch 'develop' of github.com:yahoo/mojito into develop

  • Loading branch information...
2 parents 63f7357 + e8a9cfa commit 19a01c1cec3af71613fe520dc36e25f10dd713c3 Lichun Zhan committed Sep 6, 2012
Showing with 1,291 additions and 417 deletions.
  1. +13 −8 lib/app/addons/rs/config.server.js
  2. +17 −9 lib/app/addons/rs/selector.server.js
  3. +5 −5 lib/app/addons/rs/yui.server.js
  4. +21 −10 lib/app/autoload/util.common.js
  5. +4 −1 lib/app/commands/build.js
  6. +4 −1 lib/app/commands/compile.js
  7. +4 −1 lib/app/commands/gv.js
  8. +4 −1 lib/app/commands/test.js
  9. +4 −2 lib/app/middleware/mojito-contextualizer.js
  10. +4 −1 lib/index.js
  11. +13 −12 lib/store.server.js
  12. +12 −4 tests/base/mojito-test.js
  13. +2 −2 tests/func/applications/frameworkapp/commandline/mojits/Coverage/controller.server.js
  14. +1 −1 tests/func/applications/frameworkapp/commandline/mojits/ExecuteCommand/controller.server.js
  15. +3 −3 tests/func/applications/frameworkapp/common/just_one_mojit/one_level_in/Binders/controller.common.js
  16. +3 −3 tests/func/applications/frameworkapp/common/mojits/ACMojit/controller.common.js
  17. +3 −3 tests/func/applications/frameworkapp/common/mojits/BlueChild/controller.common.js
  18. +3 −3 tests/func/applications/frameworkapp/common/mojits/BroadCast/controller.common.js
  19. +2 −2 tests/func/applications/frameworkapp/common/mojits/CM_Layout/controller.common.js
  20. +3 −3 tests/func/applications/frameworkapp/common/mojits/CM_Nav/controller.common.js
  21. +3 −3 tests/func/applications/frameworkapp/common/mojits/ClientCookie/controller.common.js
  22. +3 −3 tests/func/applications/frameworkapp/common/mojits/Coverage/controller.common.js
  23. +3 −3 tests/func/applications/frameworkapp/common/mojits/CoverageClient/controller.common.js
  24. +2 −2 tests/func/applications/frameworkapp/common/mojits/DepCheckParent/controller.common.js
  25. +3 −3 tests/func/applications/frameworkapp/common/mojits/GlobalMojit/controller.common.js
  26. +3 −3 tests/func/applications/frameworkapp/common/mojits/GreenChild/controller.common.js
  27. +2 −2 tests/func/applications/frameworkapp/common/mojits/LazyChild/controller.common.js
  28. +2 −2 tests/func/applications/frameworkapp/common/mojits/LazyParent/controller.common.js
  29. +3 −3 tests/func/applications/frameworkapp/common/mojits/MergePoster/controller.common.js
  30. +3 −3 tests/func/applications/frameworkapp/common/mojits/MetaChild/controller.common.js
  31. +2 −2 tests/func/applications/frameworkapp/common/mojits/MobileDevices/controller.server.js
  32. +2 −2 tests/func/applications/frameworkapp/common/mojits/MojitContainer/controller.common.js
  33. +2 −2 tests/func/applications/frameworkapp/common/mojits/MojitProxyMojit/controller.common.js
  34. +2 −2 tests/func/applications/frameworkapp/common/mojits/PartialMojit/controller.common.js
  35. +3 −3 tests/func/applications/frameworkapp/common/mojits/Poster/controller.common.js
  36. +3 −3 tests/func/applications/frameworkapp/common/mojits/RedChild/controller.common.js
  37. +3 −2 tests/func/applications/frameworkapp/common/mojits/SearchMojit/controller.common.js
  38. +2 −2 tests/func/applications/frameworkapp/common/mojits/SearchResult/controller.common.js
  39. +3 −3 tests/func/applications/frameworkapp/common/mojits/Stateful/controller.common.js
  40. +2 −2 tests/func/applications/frameworkapp/common/mojits/TestsLayout/controller.common.js
  41. +3 −3 tests/func/applications/frameworkapp/common/mojits_params/GetParams/controller.common.js
  42. +3 −3 tests/func/applications/frameworkapp/common/mojits_params/MergeParams/controller.common.js
  43. +3 −3 tests/func/applications/frameworkapp/common/mojits_params/PostParams/controller.common.js
  44. +3 −3 tests/func/applications/frameworkapp/common/mojits_params/RouteParams/controller.common.js
  45. +3 −3 ...plications/frameworkapp/common/mojits_subdir1/other_mojits/AccessGlobalMojit/controller.common.js
  46. +3 −3 ...unc/applications/frameworkapp/common/mojits_subdir1/other_mojits/AssetsMojit/controller.common.js
  47. +3 −3 tests/func/applications/frameworkapp/common/mojits_subdir1/other_mojits/CM_News/controller.common.js
  48. +3 −3 ...unc/applications/frameworkapp/common/mojits_subdir1/other_mojits/ConfigMojit/controller.common.js
  49. +3 −3 tests/func/applications/frameworkapp/common/mojits_subdir2/mojits/SimpleModel/controller.common.js
  50. +3 −3 tests/func/applications/frameworkapp/configapp/mojits/Coverage/controller.common.js
  51. +2 −2 tests/func/applications/frameworkapp/configapp/mojits/myMojit/controller.server.js
  52. +3 −3 tests/func/applications/frameworkapp/routing/mojits/Coverage/controller.server.js
  53. +3 −3 tests/func/applications/frameworkapp/routing/mojits/Poster/controller.server.js
  54. +3 −3 tests/func/applications/frameworkapp/routing/mojits/ShowUrl/controller.server.js
  55. +3 −3 tests/func/applications/frameworkapp/routing/mojits/SimpleRoute/controller.server.js
  56. +3 −3 tests/func/applications/frameworkapp/routing/mojits/SimpleRoute2/controller.server.js
  57. +2 −2 tests/func/applications/frameworkapp/serveronly/mojits/ConfigExpose/controller.common.js
  58. +1 −1 tests/func/applications/frameworkapp/serveronly/mojits/Container/controller.server.js
  59. +2 −2 tests/func/applications/frameworkapp/serveronly/mojits/Cookies/controller.server.js
  60. +3 −3 tests/func/applications/frameworkapp/serveronly/mojits/Coverage/controller.server.js
  61. +3 −3 tests/func/applications/frameworkapp/serveronly/mojits/HttpAddonChild/controller.server.js
  62. +3 −3 tests/func/applications/frameworkapp/serveronly/mojits/HttpAddonParent/controller.server.js
  63. +1 −1 tests/func/applications/frameworkapp/serveronly/mojits/MultiAction/controller.server.js
  64. +2 −2 tests/func/applications/frameworkapp/serveronly/mojits/OtherFeatures/controller.server.js
  65. +3 −3 tests/func/applications/frameworkapp/serveronly/mojits/RESTLib/controller.common.js
  66. +1 −1 tests/func/applications/frameworkapp/serveronly/mojits/RefreshChild/controller.server.js
  67. +1 −1 tests/func/applications/frameworkapp/serveronly/mojits/RefreshParent/controller.server.js
  68. +3 −3 tests/func/applications/frameworkapp/serveronly/mojits/ServerCookie/controller.server.js
  69. +3 −3 tests/func/applications/frameworkapp/serveronly/mojits/Yca/controller.common.js
  70. +3 −3 tests/func/applications/frameworkapp/serveronly/mojits/YckMojit/controller.common.js
  71. +3 −3 tests/func/applications/frameworkapp/serveronly/mojits/YivParams/controller.common.js
  72. +3 −3 tests/func/applications/frameworkapp/test_files/mojits/CM_Footer/controller.common.js
  73. +3 −3 tests/func/applications/frameworkapp/usecase/mojits/Coverage/controller.server.js
  74. +3 −3 tests/func/applications/frameworkapp/usecase/mojits/Flickr/controller.common.js
  75. +3 −3 tests/func/applications/frameworkapp/usecase/mojits/FlickrBrowser/controller.common.js
  76. +3 −3 tests/func/applications/frameworkapp/usecase/mojits/FlickrDetail/controller.common.js
  77. +2 −2 tests/func/applications/frameworkapp/usecase/mojits/HelloMojit/controller.server.js
  78. +3 −3 tests/func/applications/frameworkapp/usecase/mojits/PagedFlickr/controller.common.js
  79. +3 −3 tests/func/applications/frameworkapp/usecase/mojits/PagedFlickr2/controller.common.js
  80. +3 −3 tests/func/applications/frameworkapp/usecase/mojits/PagedFlickr5/controller.common.js
  81. +3 −3 tests/func/applications/frameworkapp/usecase/mojits/i18nMojit/controller.server.js
  82. +3 −3 tests/func/applications/frameworkapp/usecase/mojits/i18n_Mojit/controller.server.js
  83. +0 −8 tests/func/common/testclientpause.js
  84. +0 −8 tests/func/common/testclientresume.js
  85. +35 −22 tests/func/common/testcompositemojitclient.js
  86. +2 −10 tests/func/common/testcontrollercachingclient.js
  87. +24 −15 tests/func/common/testlazyloadclient.js
  88. +1 −8 tests/func/common/testmergeparamsserver.js
  89. +1 −9 tests/func/common/testmergeparamssimpleserver.js
  90. +1 −9 tests/func/common/testmojitproxybroadcastdynamic.js
  91. +3 −11 tests/func/common/testmojitproxybroadcaststaticlisten.js
  92. +2 −10 tests/func/common/testmojitproxybroadcaststaticlisten1.js
  93. +2 −9 tests/func/common/testmojitproxybroadcaststaticlisten2.js
  94. +2 −10 tests/func/common/testmojitproxybroadcaststaticlistenall.js
  95. +0 −8 tests/func/common/testmojitproxydestroychild.js
  96. +1 −9 tests/func/common/testpostparamsserver.js
  97. +1 −9 tests/func/common/testpostparamssimpleserver.js
  98. +1 −9 tests/func/common/teststatefulclient.js
  99. +2 −2 tests/func/usecases/testpagedflickr-de-page2.js
  100. +1 −1 tests/func/usecases/usecasestest_descriptor.json
  101. 0 tests/unit/lib/app/addons/ac/test-carrier.server.js
  102. +98 −7 tests/unit/lib/app/addons/ac/test-deploy.server.js
  103. +3 −3 tests/unit/lib/app/addons/view-engines/test-hb.server.js
  104. +8 −0 tests/unit/lib/app/autoload/autoload_test_descriptor.json
  105. +1 −0 tests/unit/lib/app/autoload/test-mojito-client.client.js
  106. +2 −2 tests/unit/lib/app/autoload/test-store.client.js
  107. +55 −0 tests/unit/lib/app/autoload/test-view-renderer.common.js
  108. +147 −0 tests/unit/lib/app/middleware/test-contextualizer.js
  109. +289 −0 tests/unit/lib/app/middleware/test-handler-tunnel.js
  110. +280 −0 tests/unit/lib/app/middleware/test-router.js
  111. +40 −0 tests/unit/lib/app/middleware/test_descriptor.json
View
21 lib/app/addons/rs/config.server.js
@@ -47,7 +47,7 @@ YUI.add('addon-rs-config', function(Y, NAME) {
this.beforeHostMethod('parseResourceVersion', this.parseResourceVersion, this);
this._jsonCache = {}; // fullPath: contents as JSON object
- this._ycbCache = {}; // fullPath: YCB config object
+ this._ycbCache = {}; // fullPath: context: YCB config object
this._ycbDims = this._readYcbDimensions();
},
@@ -58,7 +58,7 @@ YUI.add('addon-rs-config', function(Y, NAME) {
* @return {object} the YCB dimensions structure for the app
*/
getDimensions: function() {
- return Y.clone(this._ycbDims, true);
+ return Y.mojito.util.copy(this._ycbDims);
},
@@ -85,7 +85,7 @@ YUI.add('addon-rs-config', function(Y, NAME) {
}
this._jsonCache[fullPath] = json;
}
- return Y.clone(json, true);
+ return Y.mojito.util.copy(json);
},
@@ -107,14 +107,19 @@ YUI.add('addon-rs-config', function(Y, NAME) {
store.validateContext(ctx);
- ycb = this._ycbCache[fullPath];
+ if (!this._ycbCache[fullPath]) {
+ this._ycbCache[fullPath] = {};
+ }
+
+ cacheKey = Y.JSON.stringify(ctx);
+ ycb = this._ycbCache[fullPath][cacheKey];
if (!ycb) {
json = this.readConfigJSON(fullPath);
json = this._ycbDims.concat(json);
- ycb = new libycb.Ycb(json);
- this._ycbCache[fullPath] = ycb;
+ ycb = libycb.read(json, ctx);
+ this._ycbCache[fullPath][cacheKey] = ycb;
}
- return ycb.read(ctx, {});
+ return Y.mojito.util.copy(ycb);
},
@@ -220,4 +225,4 @@ YUI.add('addon-rs-config', function(Y, NAME) {
Y.namespace('mojito.addons.rs');
Y.mojito.addons.rs.config = RSAddonConfig;
-}, '0.0.1', { requires: ['plugin', 'oop', 'json-parse']});
+}, '0.0.1', { requires: ['plugin', 'oop', 'json-parse', 'mojito-util']});
View
26 lib/app/addons/rs/selector.server.js
@@ -46,6 +46,7 @@ YUI.add('addon-rs-selector', function(Y, NAME) {
json = dims.concat(json);
// TODO: use rs.config for this too
this._appConfigYCB = new libycb.Ycb(json);
+ this._poslCache = {}; // context: POSL
},
@@ -79,22 +80,29 @@ YUI.add('addon-rs-selector', function(Y, NAME) {
*/
getPOSLFromContext: function(ctx) {
var store = this.get('host'),
- sels = ['*'],
+ cacheKey,
+ posl,
p,
part,
parts;
store.validateContext(ctx);
- // TODO: use rs.config for this too
- parts = this._appConfigYCB.readNoMerge(ctx, {});
- for (p = 0; p < parts.length; p += 1) {
- part = parts[p];
- if (part.selector && store.selectors[part.selector]) {
- sels.unshift(part.selector);
+ cacheKey = Y.JSON.stringify(ctx);
+ posl = this._poslCache[cacheKey];
+ if (!posl) {
+ posl = ['*'];
+ // TODO: use rs.config for this too
+ parts = this._appConfigYCB.readNoMerge(ctx, {});
+ for (p = 0; p < parts.length; p += 1) {
+ part = parts[p];
+ if (part.selector && store.selectors[part.selector]) {
+ posl.unshift(part.selector);
+ }
}
+ this._poslCache[cacheKey] = posl;
}
- return sels;
+ return Y.mojito.util.copy(posl);
},
@@ -189,4 +197,4 @@ YUI.add('addon-rs-selector', function(Y, NAME) {
Y.namespace('mojito.addons.rs');
Y.mojito.addons.rs.selector = RSAddonSelector;
-}, '0.0.1', { requires: ['plugin', 'oop', 'json-stringify']});
+}, '0.0.1', { requires: ['plugin', 'oop', 'json-stringify', 'mojito-util']});
View
10 lib/app/addons/rs/yui.server.js
@@ -298,7 +298,7 @@ YUI.add('addon-rs-yui', function(Y, NAME) {
dest.views[res.name]['binder-module'] = res.yui.name;
sorted = this._getYUIDependencies('client', poslKey, ctx.lang, res.yui.name);
if (sorted && sorted.paths) {
- dest.views[res.name]['binder-yui-sorted'] = Y.clone(sorted.paths, true);
+ dest.views[res.name]['binder-yui-sorted'] = Y.mojito.util.copy(sorted.paths);
}
}
if (res.type === 'controller') {
@@ -308,7 +308,7 @@ YUI.add('addon-rs-yui', function(Y, NAME) {
dest.yui.sorted = sorted.sorted.slice();
}
if (this.usePrecomputed && sorted && sorted.paths) {
- dest.yui.sortedPaths = Y.clone(sorted.paths, true);
+ dest.yui.sortedPaths = Y.mojito.util.copy(sorted.paths);
}
}
}
@@ -386,7 +386,7 @@ YUI.add('addon-rs-yui', function(Y, NAME) {
if (!this.modules[env][poslKey]) {
this.modules[env][poslKey] = {};
}
- this.modules[env][poslKey][mojit] = Y.clone(modules, true);
+ this.modules[env][poslKey][mojit] = Y.mojito.util.copy(modules);
// we always want to do calculations for no-lang
if (!langs['']) {
@@ -398,7 +398,7 @@ YUI.add('addon-rs-yui', function(Y, NAME) {
lang = langs[langName];
if (controller) {
- required = Y.clone(controllerRequired, true);
+ required = Y.mojito.util.copy(controllerRequired);
required['mojito-dispatcher'] = true;
required[controller.yui.name] = true;
if (lang && lang.yui) {
@@ -638,4 +638,4 @@ YUI.add('addon-rs-yui', function(Y, NAME) {
Y.namespace('mojito.addons.rs');
Y.mojito.addons.rs.yui = RSAddonYUI;
-}, '0.0.1', { requires: ['plugin', 'oop', 'loader-base', 'json-stringify']});
+}, '0.0.1', { requires: ['plugin', 'oop', 'loader-base', 'json-stringify', 'mojito-util']});
View
31 lib/app/autoload/util.common.js
@@ -191,18 +191,29 @@ YUI.add('mojito-util', function(Y) {
},
- copy: function(obj) {
- var temp = null,
- key = '';
-
- if (!obj || typeof obj !== 'object') { return obj; }
- temp = new obj.constructor();
- for (key in obj) {
- if (obj.hasOwnProperty(key)) {
- temp[key] = Y.mojito.util.copy(obj[key]);
+ copy: function(oldObj) {
+ var newObj,
+ key;
+
+ if (!oldObj || typeof oldObj !== 'object') {
+ return oldObj;
+ }
+
+ if ('[object Array]' === Object.prototype.toString.apply(oldObj)) {
+ newObj = [];
+ for (key = 0; key < oldObj.length; key += 1) {
+ newObj[key] = Y.mojito.util.copy(oldObj[key]);
+ }
+ return newObj;
+ }
+
+ newObj = {};
+ for (key in oldObj) {
+ if (oldObj.hasOwnProperty(key)) {
+ newObj[key] = Y.mojito.util.copy(oldObj[key]);
}
}
- return temp;
+ return newObj;
},
View
5 lib/app/commands/build.js
@@ -76,12 +76,15 @@ exports.run = function(params, options, callback) {
Y.applyConfig({
useSync: true,
modules: {
+ 'mojito-util': {
+ fullpath: libpath.join(__dirname, '../../app/autoload/util.common.js')
+ },
'mojito-resource-store': {
fullpath: libpath.join(__dirname, '../../store.server.js')
}
}
});
- Y.use('mojito-resource-store');
+ Y.use('mojito-util', 'mojito-resource-store');
Y.applyConfig({useSync: false});
store = new Y.mojito.ResourceStore({
root: cwd,
View
5 lib/app/commands/compile.js
@@ -195,12 +195,15 @@ function makeStore(cfg) {
Y.applyConfig({
useSync: true,
modules: {
+ 'mojito-util': {
+ fullpath: libpath.join(__dirname, '../../app/autoload/util.common.js')
+ },
'mojito-resource-store': {
fullpath: libpath.join(__dirname, '../../store.server.js')
}
}
});
- Y.use('mojito-resource-store');
+ Y.use('mojito-util', 'mojito-resource-store');
store = new Y.mojito.ResourceStore(cfg);
Y.applyConfig({useSync: true});
return store;
View
5 lib/app/commands/gv.js
@@ -440,12 +440,15 @@ run = function(params, options) {
Y.applyConfig({
useSync: true,
modules: {
+ 'mojito-util': {
+ fullpath: libpath.join(__dirname, '../../app/autoload/util.common.js')
+ },
'mojito-resource-store': {
fullpath: libpath.join(__dirname, '../../store.server.js')
}
}
});
- Y.use('mojito-resource-store');
+ Y.use('mojito-util', 'mojito-resource-store');
// load details
store = new Y.mojito.ResourceStore({
View
5 lib/app/commands/test.js
@@ -700,12 +700,15 @@ runTests = function(opts) {
Ystore.applyConfig({
useSync: true,
modules: {
+ 'mojito-util': {
+ fullpath: pathlib.join(targetMojitoPath, 'lib/app/autoload/util.common.js')
+ },
'mojito-resource-store': {
fullpath: pathlib.join(targetMojitoPath, 'lib/store.server.js')
}
}
});
- Ystore.use('mojito-resource-store');
+ Ystore.use('mojito-util', 'mojito-resource-store');
store = new Ystore.mojito.ResourceStore({
root: testPath,
context: {},
View
6 lib/app/middleware/mojito-contextualizer.js
@@ -106,15 +106,17 @@ RequestContextualizer.prototype = {
_language: function(al, def) {
+ al = (al || '').trim();
+
if (!al) {
return def;
}
- var list = al.split(','),
+ var list = al.split(/ *, */), // accept-language value can have spaces
chosen,
matches;
- if (!list.length) {
+ if (!list[0].length) { // split always returns an array
return def;
}
View
5 lib/index.js
@@ -141,13 +141,16 @@ MojitoServer.prototype = {
Y.applyConfig({
modules: {
+ 'mojito-util': {
+ fullpath: libpath.join(__dirname, 'app/autoload/util.common.js')
+ },
'mojito-resource-store': {
fullpath: libpath.join(__dirname, 'store.server.js')
}
}
});
Y.applyConfig({ useSync: true });
- Y.use('mojito-resource-store');
+ Y.use('mojito-util', 'mojito-resource-store');
store = new Y.mojito.ResourceStore({
root: options.dir,
context: options.context,
View
25 lib/store.server.js
@@ -268,7 +268,7 @@ YUI.add('mojito-resource-store', function(Y, NAME) {
* @return {object} the context
*/
getStaticContext: function() {
- return Y.clone(this._config.context, true);
+ return Y.mojito.util.copy(this._config.context);
},
@@ -278,7 +278,7 @@ YUI.add('mojito-resource-store', function(Y, NAME) {
* @return {object} the configuration from applications.json
*/
getStaticAppConfig: function() {
- return Y.clone(this._appConfigStatic, true);
+ return Y.mojito.util.copy(this._appConfigStatic);
},
@@ -288,7 +288,7 @@ YUI.add('mojito-resource-store', function(Y, NAME) {
* @return {object} the configuration for mojito
*/
getFrameworkConfig: function() {
- return Y.clone(this._fwConfig, true);
+ return Y.mojito.util.copy(this._fwConfig);
},
@@ -305,18 +305,18 @@ YUI.add('mojito-resource-store', function(Y, NAME) {
this.validateContext(ctx);
if (this._appConfigStatic && (!ctx || !Object.keys(ctx).length)) {
- return Y.clone(this._appConfigStatic, true);
+ return Y.mojito.util.copy(this._appConfigStatic);
}
// start with the base
- appConfig = Y.clone(this._fwConfig.appConfigBase, true);
+ appConfig = Y.mojito.util.copy(this._fwConfig.appConfigBase);
// apply the read values from the file
ycb = this.config.readConfigYCB(this._libs.path.join(this._config.root, 'application.json'), ctx);
this.mergeRecursive(appConfig, ycb);
// apply the passed-in overrides
- this.mergeRecursive(appConfig, Y.clone(this._config.appConfig, true));
+ this.mergeRecursive(appConfig, Y.mojito.util.copy(this._config.appConfig));
return appConfig;
},
@@ -492,7 +492,7 @@ YUI.add('mojito-resource-store', function(Y, NAME) {
this.validateContext(ctx);
if (cacheValue) {
- cb(null, Y.clone(cacheValue, true));
+ cb(null, Y.mojito.util.copy(cacheValue));
return;
}
@@ -520,12 +520,12 @@ YUI.add('mojito-resource-store', function(Y, NAME) {
}
spec = this.mergeRecursive(spec, instance);
if (spec.defaults && spec.defaults.config) {
- config = Y.clone(spec.defaults.config, true);
+ config = Y.mojito.util.copy(spec.defaults.config);
this.mergeRecursive(config, spec.config);
spec.config = config;
}
- this._expandInstanceCache[env][cacheKey] = Y.clone(spec, true);
+ this._expandInstanceCache[env][cacheKey] = Y.mojito.util.copy(spec);
cb(null, spec);
},
@@ -695,7 +695,7 @@ YUI.add('mojito-resource-store', function(Y, NAME) {
for (r = 0; r < ress.length; r += 1) {
res = ress[r];
if (fixedPaths[res.source.fs.fullPath]) {
- routes = Y.clone(this.config.readConfigYCB(res.source.fs.fullPath, ctx), true);
+ routes = Y.mojito.util.copy(this.config.readConfigYCB(res.source.fs.fullPath, ctx));
out = Y.merge(out, routes);
}
}
@@ -1674,7 +1674,7 @@ YUI.add('mojito-resource-store', function(Y, NAME) {
if (versions.hasOwnProperty(resid)) {
highest = Math.max.apply(Math, Object.keys(versions[resid]));
//console.log('--DEBUG-- highest=' + highest + ' -- ' + resid);
- chosen = Y.clone(versions[resid][highest], true);
+ chosen = Y.mojito.util.copy(versions[resid][highest]);
out.push(chosen);
}
}
@@ -1883,5 +1883,6 @@ YUI.add('mojito-resource-store', function(Y, NAME) {
}, '0.0.1', { requires: [
'base',
'json-stringify',
- 'oop'
+ 'oop',
+ 'mojito-util'
]});
View
16 tests/base/mojito-test.js
@@ -68,10 +68,7 @@ YUI.add('mojito-client-store', function(Y, NAME) {});
YUI.add('mojito-util', function(Y, NAME) {});
YUI.add('mojito-view-renderer', function(Y, NAME) {});
-/*
- * Add a mojito-test module containing the mocking support we want for other
- * Mojito components.
- */
+
YUI.add('mojito-test', function(Y, NAME) {
function EasyMock() {
@@ -182,6 +179,17 @@ YUI.add('mojito-test', function(Y, NAME) {
return mock;
}
+ /**
+ * Get the full path to something, given it's path relative to the mojito
+ * repo directory
+ * @method {projpath}
+ * @param {string} relpath relative to repo base directory
+ * @return {string} absolute filesystem path
+ */
+ Y.mojito.projpath = function (relpath) {
+ return require('path').resolve(__dirname, '../../' + relpath);
+ };
+
Y.mojito.MockActionContext = MockActionContext;
Y.mojito.EasyMock = EasyMock;
View
4 tests/func/applications/frameworkapp/commandline/mojits/Coverage/controller.server.js
@@ -1,9 +1,9 @@
/*
* Copyright (c) 2011 Yahoo! Inc. All rights reserved.
*/
-YUI.add('Coverage', function(Y) {
+YUI.add('Coverage', function(Y, NAME) {
- Y.mojito.controller = {
+ Y.namespace('mojito.controllers')[NAME] = {
init: function(config) {
this.config = config;
View
2 tests/func/applications/frameworkapp/commandline/mojits/ExecuteCommand/controller.server.js
@@ -15,7 +15,7 @@ YUI.add('ExecuteCommand', function(Y, NAME) {
* @class Controller
* @constructor
*/
- Y.mojito.controller = {
+ Y.namespace('mojito.controllers')[NAME] = {
init: function(spec) {
this.spec = spec;
View
6 ...applications/frameworkapp/common/just_one_mojit/one_level_in/Binders/controller.common.js
@@ -1,7 +1,7 @@
/*
* Copyright (c) 2011 Yahoo! Inc. All rights reserved.
*/
-YUI.add('Binders', function(Y) {
+YUI.add('Binders', function(Y, NAME) {
/**
* The Binders module.
@@ -15,7 +15,7 @@ YUI.add('Binders', function(Y) {
* @class Controller
* @constructor
*/
- Y.mojito.controller = {
+ Y.namespace('mojito.controllers')[NAME] = {
init: function(mojitSpec) {
this.spec = mojitSpec;
@@ -44,4 +44,4 @@ YUI.add('Binders', function(Y) {
}
};
-}, '0.0.1', {requires: []});
+}, '0.0.1', {requires: ['mojito']});
View
6 tests/func/applications/frameworkapp/common/mojits/ACMojit/controller.common.js
@@ -1,6 +1,6 @@
-YUI.add('ActionContextMojit', function(Y) {
+YUI.add('ActionContextMojit', function(Y, NAME) {
- Y.mojito.controller = {
+ Y.namespace('mojito.controllers')[NAME] = {
/**
* Method corresponding to the 'index' action.
@@ -76,4 +76,4 @@ YUI.add('ActionContextMojit', function(Y) {
};
-}, '0.0.1', {requires: []});
+}, '0.0.1', {requires: ['mojito']});
View
6 tests/func/applications/frameworkapp/common/mojits/BlueChild/controller.common.js
@@ -1,7 +1,7 @@
/*
* Copyright (c) 2011 Yahoo! Inc. All rights reserved.
*/
-YUI.add('BlueChild', function(Y) {
+YUI.add('BlueChild', function(Y, NAME) {
/**
* The BlueChild module.
@@ -15,7 +15,7 @@ YUI.add('BlueChild', function(Y) {
* @class Controller
* @constructor
*/
- Y.mojito.controller = {
+ Y.namespace('mojito.controllers')[NAME] = {
init: function(spec) {
this.spec = spec;
@@ -33,4 +33,4 @@ YUI.add('BlueChild', function(Y) {
};
-}, '0.0.1', {requires: []});
+}, '0.0.1', {requires: ['mojito']});
View
6 tests/func/applications/frameworkapp/common/mojits/BroadCast/controller.common.js
@@ -1,7 +1,7 @@
/*
* Copyright (c) 2011 Yahoo! Inc. All rights reserved.
*/
-YUI.add('BroadCast', function(Y) {
+YUI.add('BroadCast', function(Y, NAME) {
/**
* The Parent module.
@@ -15,7 +15,7 @@ YUI.add('BroadCast', function(Y) {
* @class Controller
* @constructor
*/
- Y.mojito.controller = {
+ Y.namespace('mojito.controllers')[NAME] = {
init: function(spec) {
this.spec = spec;
@@ -125,4 +125,4 @@ YUI.add('BroadCast', function(Y) {
};
-}, '0.0.1', {requires: []});
+}, '0.0.1', {requires: ['mojito']});
View
4 tests/func/applications/frameworkapp/common/mojits/CM_Layout/controller.common.js
@@ -15,7 +15,7 @@ YUI.add('CM_Layout', function(Y, NAME) {
* @class Controller
* @constructor
*/
- Y.mojito.controller = {
+ Y.namespace('mojito.controllers')[NAME] = {
init: function(config) {
this.config = config;
@@ -72,4 +72,4 @@ YUI.add('CM_Layout', function(Y, NAME) {
}
};
-}, '0.0.1', {requires: []});
+}, '0.0.1', {requires: ['mojito']});
View
6 tests/func/applications/frameworkapp/common/mojits/CM_Nav/controller.common.js
@@ -1,7 +1,7 @@
/*
* Copyright (c) 2011 Yahoo! Inc. All rights reserved.
*/
-YUI.add('CM_Nav', function(Y) {
+YUI.add('CM_Nav', function(Y, NAME) {
/**
* The CM_Nav module.
@@ -15,7 +15,7 @@ YUI.add('CM_Nav', function(Y) {
* @class Controller
* @constructor
*/
- Y.mojito.controller = {
+ Y.namespace('mojito.controllers')[NAME] = {
init: function(config) {
this.config = config;
@@ -33,4 +33,4 @@ YUI.add('CM_Nav', function(Y) {
};
-}, '0.0.1', {requires: []});
+}, '0.0.1', {requires: ['mojito']});
View
6 tests/func/applications/frameworkapp/common/mojits/ClientCookie/controller.common.js
@@ -1,7 +1,7 @@
/*
* Copyright (c) 2011 Yahoo! Inc. All rights reserved.
*/
-YUI.add('ClientCookie', function(Y) {
+YUI.add('ClientCookie', function(Y, NAME) {
/**
* The ClientCookie module.
@@ -15,7 +15,7 @@ YUI.add('ClientCookie', function(Y) {
* @class Controller
* @constructor
*/
- Y.mojito.controller = {
+ Y.namespace('mojito.controllers')[NAME] = {
init: function(config) {
this.config = config;
@@ -53,4 +53,4 @@ YUI.add('ClientCookie', function(Y) {
};
-}, '0.0.1', {requires: ['mojito-cookie-addon']});
+}, '0.0.1', {requires: ['mojito', 'mojito-cookie-addon']});
View
6 tests/func/applications/frameworkapp/common/mojits/Coverage/controller.common.js
@@ -1,9 +1,9 @@
/*
* Copyright (c) 2011 Yahoo! Inc. All rights reserved.
*/
-YUI.add('Coverage', function(Y) {
+YUI.add('Coverage', function(Y, NAME) {
- Y.mojito.controller = {
+ Y.namespace('mojito.controllers')[NAME] = {
init: function(config) {
this.config = config;
@@ -37,4 +37,4 @@ YUI.add('Coverage', function(Y) {
}
};
-}, '0.0.1', {requires: []});
+}, '0.0.1', {requires: ['mojito']});
View
6 tests/func/applications/frameworkapp/common/mojits/CoverageClient/controller.common.js
@@ -1,9 +1,9 @@
/*
* Copyright (c) 2011 Yahoo! Inc. All rights reserved.
*/
-YUI.add('CoverageClient', function(Y) {
+YUI.add('CoverageClient', function(Y, NAME) {
- Y.mojito.controller = {
+ Y.namespace('mojito.controllers')[NAME] = {
init: function(config) {
this.config = config;
@@ -59,4 +59,4 @@ YUI.add('CoverageClient', function(Y) {
};
-}, '0.0.1', {requires: ['mojito-http-addon', 'yiv-ac-plugin']});
+}, '0.0.1', {requires: ['mojito', 'mojito-http-addon', 'yiv-ac-plugin']});
View
4 tests/func/applications/frameworkapp/common/mojits/DepCheckParent/controller.common.js
@@ -3,7 +3,7 @@
*/
YUI.add('DepCheckParent', function(Y, NAME) {
- Y.mojito.controller = {
+ Y.namespace('mojito.controllers')[NAME] = {
'index': function(ac) {
ac.done();
},
@@ -35,4 +35,4 @@
}
};
-}, '0.0.1', {requires: ['mojito-intl-addon', 'mojito-util','querystring-stringify','AppLevelMojitModel','mojito-meta-addon']});
+}, '0.0.1', {requires: ['mojito', 'mojito-intl-addon', 'mojito-util','querystring-stringify','AppLevelMojitModel','mojito-meta-addon']});
View
6 tests/func/applications/frameworkapp/common/mojits/GlobalMojit/controller.common.js
@@ -1,7 +1,7 @@
/*
* Copyright (c) 2011 Yahoo! Inc. All rights reserved.
*/
-YUI.add('GlobalMojit', function(Y) {
+YUI.add('GlobalMojit', function(Y, NAME) {
/**
* The GlobalMojit module.
@@ -15,7 +15,7 @@ YUI.add('GlobalMojit', function(Y) {
* @class Controller
* @constructor
*/
- Y.mojito.controller = {
+ Y.namespace('mojito.controllers')[NAME] = {
init: function(config) {
this.config = config;
@@ -33,4 +33,4 @@ YUI.add('GlobalMojit', function(Y) {
};
-}, '0.0.1', {requires: []});
+}, '0.0.1', {requires: ['mojito']});
View
6 tests/func/applications/frameworkapp/common/mojits/GreenChild/controller.common.js
@@ -1,7 +1,7 @@
/*
* Copyright (c) 2011 Yahoo! Inc. All rights reserved.
*/
-YUI.add('GreenChild', function(Y) {
+YUI.add('GreenChild', function(Y, NAME) {
/**
* The GreenChild module.
@@ -15,7 +15,7 @@ YUI.add('GreenChild', function(Y) {
* @class Controller
* @constructor
*/
- Y.mojito.controller = {
+ Y.namespace('mojito.controllers')[NAME] = {
init: function(spec) {
this.spec = spec;
@@ -34,4 +34,4 @@ YUI.add('GreenChild', function(Y) {
};
-}, '0.0.1', {requires: []});
+}, '0.0.1', {requires: ['mojito']});
View
4 tests/func/applications/frameworkapp/common/mojits/LazyChild/controller.common.js
@@ -1,7 +1,7 @@
/*
* Copyright (c) 2011 Yahoo! Inc. All rights reserved.
*/
-YUI.add('LazyChild', function(Y) {
+YUI.add('LazyChild', function(Y, NAME) {
/**
* The LazyPants module.
@@ -15,7 +15,7 @@ YUI.add('LazyChild', function(Y) {
* @class Controller
* @constructor
*/
- Y.mojito.controller = {
+ Y.namespace('mojito.controllers')[NAME] = {
/**
* Method corresponding to the 'index' action.
View
4 tests/func/applications/frameworkapp/common/mojits/LazyParent/controller.common.js
@@ -1,7 +1,7 @@
/*
* Copyright (c) 2011 Yahoo! Inc. All rights reserved.
*/
-YUI.add('Container', function(Y) {
+YUI.add('Container', function(Y, NAME) {
/**
* The Container module.
@@ -15,7 +15,7 @@ YUI.add('Container', function(Y) {
* @class Controller
* @constructor
*/
- Y.mojito.controller = {
+ Y.namespace('mojito.controllers')[NAME] = {
/**
* Method corresponding to the 'index' action.
View
6 tests/func/applications/frameworkapp/common/mojits/MergePoster/controller.common.js
@@ -1,6 +1,6 @@
-YUI.add('MergePoster', function(Y) {
+YUI.add('MergePoster', function(Y, NAME) {
- Y.mojito.controller = {
+ Y.namespace('mojito.controllers')[NAME] = {
index: function(actionContext) {
actionContext.done({
@@ -10,4 +10,4 @@ YUI.add('MergePoster', function(Y) {
};
-}, '0.0.1', {requires: []});
+}, '0.0.1', {requires: ['mojito']});
View
6 tests/func/applications/frameworkapp/common/mojits/MetaChild/controller.common.js
@@ -1,7 +1,7 @@
/*
* Copyright (c) 2011 Yahoo! Inc. All rights reserved.
*/
-YUI.add('MetaChild', function(Y) {
+YUI.add('MetaChild', function(Y, NAME) {
/**
* The Stateful module.
@@ -15,7 +15,7 @@ YUI.add('MetaChild', function(Y) {
* @class Controller
* @constructor
*/
- Y.mojito.controller = {
+ Y.namespace('mojito.controllers')[NAME] = {
init: function(spec) {
this.spec = spec;
@@ -39,4 +39,4 @@ YUI.add('MetaChild', function(Y) {
}
};
-}, '0.0.1', {requires: ['mojito-meta-addon']});
+}, '0.0.1', {requires: ['mojito', 'mojito-meta-addon']});
View
4 tests/func/applications/frameworkapp/common/mojits/MobileDevices/controller.server.js
@@ -1,9 +1,9 @@
/*
* Copyright (c) 2011 Yahoo! Inc. All rights reserved.
*/
-YUI.add('MobileDevices', function(Y) {
+YUI.add('MobileDevices', function(Y, NAME) {
- Y.mojito.controller = {
+ Y.namespace('mojito.controllers')[NAME] = {
index: function(ac) {
ac.done();
View
4 tests/func/applications/frameworkapp/common/mojits/MojitContainer/controller.common.js
@@ -15,7 +15,7 @@ YUI.add('MojitContainer', function(Y, NAME) {
* @class Controller
* @constructor
*/
- Y.mojito.controller = {
+ Y.namespace('mojito.controllers')[NAME] = {
init: function(spec) {
this.spec = spec;
@@ -43,4 +43,4 @@ YUI.add('MojitContainer', function(Y, NAME) {
};
-}, '0.0.1', {requires: []});
+}, '0.0.1', {requires: ['mojito']});
View
4 tests/func/applications/frameworkapp/common/mojits/MojitProxyMojit/controller.common.js
@@ -1,7 +1,7 @@
/*
* Copyright (c) 2011 Yahoo! Inc. All rights reserved.
*/
-YUI.add('MojitProxyMojit', function(Y) {
+YUI.add('MojitProxyMojit', function(Y, NAME) {
/**
* The MojitProxyMojit module.
@@ -15,7 +15,7 @@ YUI.add('MojitProxyMojit', function(Y) {
* @class Controller
* @constructor
*/
- Y.mojito.controller = {
+ Y.namespace('mojito.controllers')[NAME] = {
init: function(spec) {
this.spec = spec;
View
4 tests/func/applications/frameworkapp/common/mojits/PartialMojit/controller.common.js
@@ -1,7 +1,7 @@
/*
* Copyright (c) 2011 Yahoo! Inc. All rights reserved.
*/
-YUI.add('PartialMojit', function(Y) {
+YUI.add('PartialMojit', function(Y, NAME) {
/**
* The PartialMojit module.
@@ -15,7 +15,7 @@ YUI.add('PartialMojit', function(Y) {
* @class Controller
* @constructor
*/
- Y.mojito.controller = {
+ Y.namespace('mojito.controllers')[NAME] = {
init: function(spec) {
this.spec = spec;
View
6 tests/func/applications/frameworkapp/common/mojits/Poster/controller.common.js
@@ -1,6 +1,6 @@
-YUI.add('Poster', function(Y) {
+YUI.add('Poster', function(Y, NAME) {
- Y.mojito.controller = {
+ Y.namespace('mojito.controllers')[NAME] = {
index: function(actionContext) {
actionContext.done({
@@ -12,4 +12,4 @@ YUI.add('Poster', function(Y) {
};
-}, '0.0.1', {requires: []});
+}, '0.0.1', {requires: ['mojito']});
View
6 tests/func/applications/frameworkapp/common/mojits/RedChild/controller.common.js
@@ -1,7 +1,7 @@
/*
* Copyright (c) 2011 Yahoo! Inc. All rights reserved.
*/
-YUI.add('RedChild', function(Y) {
+YUI.add('RedChild', function(Y, NAME) {
/**
* The RedChild module.
@@ -15,7 +15,7 @@ YUI.add('RedChild', function(Y) {
* @class Controller
* @constructor
*/
- Y.mojito.controller = {
+ Y.namespace('mojito.controllers')[NAME] = {
init: function(spec) {
this.spec = spec;
@@ -34,4 +34,4 @@ YUI.add('RedChild', function(Y) {
};
-}, '0.0.1', {requires: []});
+}, '0.0.1', {requires: ['mojito']});
View
5 tests/func/applications/frameworkapp/common/mojits/SearchMojit/controller.common.js
@@ -1,8 +1,9 @@
/*
* Copyright (c) 2011 Yahoo! Inc. All rights reserved.
*/
-YUI.add('SearchMojit', function(Y) {
- Y.mojito.controller = {
+YUI.add('SearchMojit', function(Y, NAME) {
+
+ Y.namespace('mojito.controllers')[NAME] = {
index: function(ac)
{
View
4 tests/func/applications/frameworkapp/common/mojits/SearchResult/controller.common.js
@@ -1,7 +1,7 @@
/*
* Copyright (c) 2011 Yahoo! Inc. All rights reserved.
*/
-YUI.add('SearchResult', function(Y) {
+YUI.add('SearchResult', function(Y, NAME) {
/**
* The SearchResult module.
@@ -15,7 +15,7 @@ YUI.add('SearchResult', function(Y) {
* @class Controller
* @constructor
*/
- Y.mojito.controller = {
+ Y.namespace('mojito.controllers')[NAME] = {
/**
* Method corresponding to the 'index' action.
View
6 tests/func/applications/frameworkapp/common/mojits/Stateful/controller.common.js
@@ -1,7 +1,7 @@
/*
* Copyright (c) 2011 Yahoo! Inc. All rights reserved.
*/
-YUI.add('Stateful', function(Y) {
+YUI.add('Stateful', function(Y, NAME) {
/**
* The Stateful module.
@@ -15,7 +15,7 @@ YUI.add('Stateful', function(Y) {
* @class Controller
* @constructor
*/
- Y.mojito.controller = {
+ Y.namespace('mojito.controllers')[NAME] = {
init: function(spec) {
this.spec = spec;
@@ -42,4 +42,4 @@ YUI.add('Stateful', function(Y) {
};
-}, '0.0.1', {requires: []});
+}, '0.0.1', {requires: ['mojito']});
View
4 tests/func/applications/frameworkapp/common/mojits/TestsLayout/controller.common.js
@@ -15,7 +15,7 @@ YUI.add('TestsLayout', function(Y, NAME) {
* @class Controller
* @constructor
*/
- Y.mojito.controller = {
+ Y.namespace('mojito.controllers')[NAME] = {
init: function(mojitSpec) {
this.spec = mojitSpec;
@@ -74,4 +74,4 @@ YUI.add('TestsLayout', function(Y, NAME) {
}
};
-}, '0.0.1', {requires: []});
+}, '0.0.1', {requires: ['mojito']});
View
6 tests/func/applications/frameworkapp/common/mojits_params/GetParams/controller.common.js
@@ -1,6 +1,6 @@
-YUI.add('GetParams', function(Y) {
+YUI.add('GetParams', function(Y, NAME) {
- Y.mojito.controller = {
+ Y.namespace('mojito.controllers')[NAME] = {
index: function(ac){
ac.done();
},
@@ -46,4 +46,4 @@ YUI.add('GetParams', function(Y) {
});
}
};
-}, '0.0.1', {requires: []});
+}, '0.0.1', {requires: ['mojito']});
View
6 tests/func/applications/frameworkapp/common/mojits_params/MergeParams/controller.common.js
@@ -1,6 +1,6 @@
-YUI.add('MergeParams', function(Y) {
+YUI.add('MergeParams', function(Y, NAME) {
- Y.mojito.controller = {
+ Y.namespace('mojito.controllers')[NAME] = {
index: function(ac) {
ac.done();
},
@@ -103,4 +103,4 @@ YUI.add('MergeParams', function(Y) {
return paramsArray;
}
-}, '0.0.1', {requires: []});
+}, '0.0.1', {requires: ['mojito']});
View
6 tests/func/applications/frameworkapp/common/mojits_params/PostParams/controller.common.js
@@ -1,6 +1,6 @@
-YUI.add('PostParams', function(Y) {
+YUI.add('PostParams', function(Y, NAME) {
- Y.mojito.controller = {
+ Y.namespace('mojito.controllers')[NAME] = {
index: function(ac) {
ac.done();
},
@@ -24,4 +24,4 @@ YUI.add('PostParams', function(Y) {
}
};
-}, '0.0.1', {requires: []});
+}, '0.0.1', {requires: ['mojito']});
View
6 tests/func/applications/frameworkapp/common/mojits_params/RouteParams/controller.common.js
@@ -1,6 +1,6 @@
-YUI.add('RouteParams', function(Y) {
+YUI.add('RouteParams', function(Y, NAME) {
- Y.mojito.controller = {
+ Y.namespace('mojito.controllers')[NAME] = {
index: function(ac){
ac.done();
},
@@ -33,4 +33,4 @@ YUI.add('RouteParams', function(Y) {
};
-}, '0.0.1', {requires: []});
+}, '0.0.1', {requires: ['mojito']});
View
6 ...ns/frameworkapp/common/mojits_subdir1/other_mojits/AccessGlobalMojit/controller.common.js
@@ -1,9 +1,9 @@
/*
* Copyright (c) 2011 Yahoo! Inc. All rights reserved.
*/
-YUI.add('AccessGlobalMojit', function(Y) {
+YUI.add('AccessGlobalMojit', function(Y, NAME) {
- Y.mojito.controller = {
+ Y.namespace('mojito.controllers')[NAME] = {
init: function(config) {
this.config = config;
@@ -23,4 +23,4 @@ YUI.add('AccessGlobalMojit', function(Y) {
};
-}, '0.0.1', {requires: ['GlobalMojitModel', 'mojito-mytest-addon', 'BindersModel']});
+}, '0.0.1', {requires: ['mojito', 'GlobalMojitModel', 'mojito-mytest-addon', 'BindersModel']});
View
6 ...ications/frameworkapp/common/mojits_subdir1/other_mojits/AssetsMojit/controller.common.js
@@ -1,9 +1,9 @@
/*
* Copyright (c) 2011 Yahoo! Inc. All rights reserved.
*/
-YUI.add('AssetsMojit', function(Y) {
+YUI.add('AssetsMojit', function(Y, NAME) {
- Y.mojito.controller = {
+ Y.namespace('mojito.controllers')[NAME] = {
init: function(config) {
this.config = config;
@@ -87,4 +87,4 @@ YUI.add('AssetsMojit', function(Y) {
}
};
-}, '0.0.1', {requires: []});
+}, '0.0.1', {requires: ['mojito']});
View
6 ...applications/frameworkapp/common/mojits_subdir1/other_mojits/CM_News/controller.common.js
@@ -1,7 +1,7 @@
/*
* Copyright (c) 2011 Yahoo! Inc. All rights reserved.
*/
-YUI.add('CM_News', function(Y) {
+YUI.add('CM_News', function(Y, NAME) {
/**
* The CM_News module.
@@ -15,7 +15,7 @@ YUI.add('CM_News', function(Y) {
* @class Controller
* @constructor
*/
- Y.mojito.controller = {
+ Y.namespace('mojito.controllers')[NAME] = {
init: function(config) {
this.config = config;
@@ -33,4 +33,4 @@ YUI.add('CM_News', function(Y) {
};
-}, '0.0.1', {requires: []});
+}, '0.0.1', {requires: ['mojito']});
View
6 ...ications/frameworkapp/common/mojits_subdir1/other_mojits/ConfigMojit/controller.common.js
@@ -1,7 +1,7 @@
/*
* Copyright (c) 2011 Yahoo! Inc. All rights reserved.
*/
-YUI.add('ConfigMojit', function(Y) {
+YUI.add('ConfigMojit', function(Y, NAME) {
/**
* The ConfigMojit module.
@@ -15,7 +15,7 @@ YUI.add('ConfigMojit', function(Y) {
* @class Controller
* @constructor
*/
- Y.mojito.controller = {
+ Y.namespace('mojito.controllers')[NAME] = {
init: function(config) {
this.config = config;
@@ -68,4 +68,4 @@ YUI.add('ConfigMojit', function(Y) {
};
-}, '0.0.1', {requires: [ 'mojito-config-addon' ]});
+}, '0.0.1', {requires: [ 'mojito', 'mojito-config-addon' ]});
View
6 ...c/applications/frameworkapp/common/mojits_subdir2/mojits/SimpleModel/controller.common.js
@@ -1,9 +1,9 @@
/*
* Copyright (c) 2011 Yahoo! Inc. All rights reserved.
*/
-YUI.add('SimpleModel', function(Y) {
+YUI.add('SimpleModel', function(Y, NAME) {
- Y.mojito.controller = {
+ Y.namespace('mojito.controllers')[NAME] = {
index: function(ac) {
ac.done();
@@ -29,4 +29,4 @@ YUI.add('SimpleModel', function(Y) {
};
-}, '0.0.1', {requires: []});
+}, '0.0.1', {requires: ['mojito']});
View
6 tests/func/applications/frameworkapp/configapp/mojits/Coverage/controller.common.js
@@ -1,9 +1,9 @@
/*
* Copyright (c) 2011 Yahoo! Inc. All rights reserved.
*/
-YUI.add('Coverage', function(Y) {
+YUI.add('Coverage', function(Y, NAME) {
- Y.mojito.controller = {
+ Y.namespace('mojito.controllers')[NAME] = {
init: function(config) {
this.config = config;
@@ -37,4 +37,4 @@ YUI.add('Coverage', function(Y) {
}
};
-}, '0.0.1', {requires: []});
+}, '0.0.1', {requires: ['mojito']});
View
4 tests/func/applications/frameworkapp/configapp/mojits/myMojit/controller.server.js
@@ -1,7 +1,7 @@
/*
* Copyright (c) 2011 Yahoo! Inc. All rights reserved.
*/
-YUI.add('myMojit', function(Y) {
+YUI.add('myMojit', function(Y, NAME) {
/**
* The TestMojit module.
@@ -15,7 +15,7 @@ YUI.add('myMojit', function(Y) {
* @class Controller
* @constructor
*/
- Y.mojito.controller = {
+ Y.namespace('mojito.controllers')[NAME] = {
/**
* Method corresponding to the 'index' action.
View
6 tests/func/applications/frameworkapp/routing/mojits/Coverage/controller.server.js
@@ -1,9 +1,9 @@
/*
* Copyright (c) 2011 Yahoo! Inc. All rights reserved.
*/
-YUI.add('Coverage', function(Y) {
+YUI.add('Coverage', function(Y, NAME) {
- Y.mojito.controller = {
+ Y.namespace('mojito.controllers')[NAME] = {
init: function(config) {
this.config = config;
@@ -37,4 +37,4 @@ YUI.add('Coverage', function(Y) {
}
};
-}, '0.0.1', {requires: []});
+}, '0.0.1', {requires: ['mojito']});
View
6 tests/func/applications/frameworkapp/routing/mojits/Poster/controller.server.js
@@ -1,7 +1,7 @@
/*
* Copyright (c) 2011 Yahoo! Inc. All rights reserved.
*/
-YUI.add('Poster', function(Y) {
+YUI.add('Poster', function(Y, NAME) {
/**
* The Poster module.
@@ -15,7 +15,7 @@ YUI.add('Poster', function(Y) {
* @class Controller
* @constructor
*/
- Y.mojito.controller = {
+ Y.namespace('mojito.controllers')[NAME] = {
init: function(config) {
this.config = config;
@@ -34,4 +34,4 @@ YUI.add('Poster', function(Y) {
};
-}, '0.0.1', {requires: ['mojito-http-addon']});
+}, '0.0.1', {requires: ['mojito', 'mojito-http-addon']});
View
6 tests/func/applications/frameworkapp/routing/mojits/ShowUrl/controller.server.js
@@ -1,7 +1,7 @@
/*
* Copyright (c) 2011 Yahoo! Inc. All rights reserved.
*/
-YUI.add('ShowUrl', function(Y) {
+YUI.add('ShowUrl', function(Y, NAME) {
/**
* The ShowUrl module.
@@ -15,7 +15,7 @@ YUI.add('ShowUrl', function(Y) {
* @class Controller
* @constructor
*/
- Y.mojito.controller = {
+ Y.namespace('mojito.controllers')[NAME] = {
init: function(config) {
this.config = config;
@@ -91,4 +91,4 @@ YUI.add('ShowUrl', function(Y) {
}
};
-}, '0.0.1', {requires: ['mojito-http-addon']});
+}, '0.0.1', {requires: ['mojito', 'mojito-http-addon']});
View
6 tests/func/applications/frameworkapp/routing/mojits/SimpleRoute/controller.server.js
@@ -1,7 +1,7 @@
/*
* Copyright (c) 2011 Yahoo! Inc. All rights reserved.
*/
-YUI.add('SimpleRoute', function(Y) {
+YUI.add('SimpleRoute', function(Y, NAME) {
/**
* The SimpleRoute module.
@@ -15,7 +15,7 @@ YUI.add('SimpleRoute', function(Y) {
* @class Controller
* @constructor
*/
- Y.mojito.controller = {
+ Y.namespace('mojito.controllers')[NAME] = {
init: function(mojitSpec) {
this.spec = mojitSpec;
@@ -43,4 +43,4 @@ YUI.add('SimpleRoute', function(Y) {
};
-}, '0.0.1', {requires: ['mojito-http-addon']});
+}, '0.0.1', {requires: ['mojito', 'mojito-http-addon']});
View
6 tests/func/applications/frameworkapp/routing/mojits/SimpleRoute2/controller.server.js
@@ -1,7 +1,7 @@
/*
* Copyright (c) 2011 Yahoo! Inc. All rights reserved.
*/
-YUI.add('SimpleRoute2', function(Y) {
+YUI.add('SimpleRoute2', function(Y, NAME) {
/**
* The SimpleRoute2 module.
@@ -15,7 +15,7 @@ YUI.add('SimpleRoute2', function(Y) {
* @class Controller
* @constructor
*/
- Y.mojito.controller = {
+ Y.namespace('mojito.controllers')[NAME] = {
init: function(config) {
this.config = config;
@@ -37,4 +37,4 @@ YUI.add('SimpleRoute2', function(Y) {
};
-}, '0.0.1', {requires: ['mojito-http-addon']});
+}, '0.0.1', {requires: ['mojito', 'mojito-http-addon']});
View
4 tests/func/applications/frameworkapp/serveronly/mojits/ConfigExpose/controller.common.js
@@ -1,9 +1,9 @@
/*
* Copyright (c) 2011 Yahoo! Inc. All rights reserved.
*/
-YUI.add('ConfigExpose', function(Y) {
+YUI.add('ConfigExpose', function(Y, NAME) {
- Y.mojito.controller = {
+ Y.namespace('mojito.controllers')[NAME] = {
index: function(ac) {
ac.done();
View
2 tests/func/applications/frameworkapp/serveronly/mojits/Container/controller.server.js
@@ -16,7 +16,7 @@ YUI.add('Container', function(Y, NAME) {
* @class Controller
* @constructor
*/
- Y.mojito.controllers[NAME] = {
+ Y.namespace('mojito.controllers')[NAME] = {
init: function(config) {
this.config = config;
View
4 tests/func/applications/frameworkapp/serveronly/mojits/Cookies/controller.server.js
@@ -1,7 +1,7 @@
/*
* Copyright (c) 2011 Yahoo! Inc. All rights reserved.
*/
-YUI.add('Cookies', function(Y) {
+YUI.add('Cookies', function(Y, NAME) {
/**
* The Cookies module.
@@ -15,7 +15,7 @@ YUI.add('Cookies', function(Y) {
* @class Controller
* @constructor
*/
- Y.mojito.controller = {
+ Y.namespace('mojito.controllers')[NAME] = {
init: function(config) {
this.config = config;
},
View
6 tests/func/applications/frameworkapp/serveronly/mojits/Coverage/controller.server.js
@@ -1,9 +1,9 @@
/*
* Copyright (c) 2011 Yahoo! Inc. All rights reserved.
*/
-YUI.add('Coverage', function(Y) {
+YUI.add('Coverage', function(Y, NAME) {
- Y.mojito.controller = {
+ Y.namespace('mojito.controllers')[NAME] = {
init: function(config) {
this.config = config;
@@ -37,4 +37,4 @@ YUI.add('Coverage', function(Y) {
}
};
-}, '0.0.1', {requires: []});
+}, '0.0.1', {requires: ['mojito']});
View
6 tests/func/applications/frameworkapp/serveronly/mojits/HttpAddonChild/controller.server.js
@@ -1,7 +1,7 @@
/*
* Copyright (c) 2011 Yahoo! Inc. All rights reserved.
*/
-YUI.add('HttpAddonChild', function(Y) {
+YUI.add('HttpAddonChild', function(Y, NAME) {
/**
* The HttpAddonChild module.
@@ -15,7 +15,7 @@ YUI.add('HttpAddonChild', function(Y) {
* @class Controller
* @constructor
*/
- Y.mojito.controller = {
+ Y.namespace('mojito.controllers')[NAME] = {
init: function(mojitSpec) {
this.spec = mojitSpec;
@@ -34,4 +34,4 @@ YUI.add('HttpAddonChild', function(Y) {
}
};
-}, '0.0.1', {requires: ['mojito-http-addon']});
+}, '0.0.1', {requires: ['mojito', 'mojito-http-addon']});
View
6 tests/func/applications/frameworkapp/serveronly/mojits/HttpAddonParent/controller.server.js
@@ -1,7 +1,7 @@
/*
* Copyright (c) 2011 Yahoo! Inc. All rights reserved.
*/
-YUI.add('HttpAddonParent', function(Y) {
+YUI.add('HttpAddonParent', function(Y, NAME) {
/**
* The HttpAddonParent module.
@@ -15,7 +15,7 @@ YUI.add('HttpAddonParent', function(Y) {
* @class Controller
* @constructor
*/
- Y.mojito.controller = {
+ Y.namespace('mojito.controllers')[NAME] = {
init: function(mojitSpec) {
this.spec = mojitSpec;
@@ -196,4 +196,4 @@ YUI.add('HttpAddonParent', function(Y) {
}
};
-}, '0.0.1', {requires: ['mojito-http-addon']});
+}, '0.0.1', {requires: ['mojito', 'mojito-http-addon']});
View
2 tests/func/applications/frameworkapp/serveronly/mojits/MultiAction/controller.server.js
@@ -16,7 +16,7 @@ YUI.add('MultiAction', function(Y, NAME) {
* @class Controller
* @constructor
*/
- Y.mojito.controllers[NAME] = {
+ Y.namespace('mojito.controllers')[NAME] = {
init: function(config) {
this.config = config;
View
4 tests/func/applications/frameworkapp/serveronly/mojits/OtherFeatures/controller.server.js
@@ -1,7 +1,7 @@
/*
* Copyright (c) 2012 Yahoo! Inc. All rights reserved.
*/
-YUI.add('OtherFeatures', function(Y) {
+YUI.add('OtherFeatures', function(Y, NAME) {
/**
* The OtherFeatures module.
@@ -15,7 +15,7 @@ YUI.add('OtherFeatures', function(Y) {
* @class Controller
* @constructor
*/
- Y.mojito.controller = {
+ Y.namespace('mojito.controllers')[NAME] = {
/**
* Method corresponding to the 'index' action.
View
6 tests/func/applications/frameworkapp/serveronly/mojits/RESTLib/controller.common.js
@@ -1,7 +1,7 @@
/*
* Copyright (c) 2011 Yahoo! Inc. All rights reserved.
*/
-YUI.add('RESTLib', function(Y) {
+YUI.add('RESTLib', function(Y, NAME) {
/**
* The RESTLib module.
@@ -15,7 +15,7 @@ YUI.add('RESTLib', function(Y) {
* @class Controller
* @constructor
*/
- Y.mojito.controller = {
+ Y.namespace('mojito.controllers')[NAME] = {
init: function(config) {
this.config = config;
@@ -370,4 +370,4 @@ YUI.add('RESTLib', function(Y) {
return hostPort;
}
-}, '0.0.1', {requires: ['mojito-http-addon']});
+}, '0.0.1', {requires: ['mojito', 'mojito-http-addon']});
View
2 tests/func/applications/frameworkapp/serveronly/mojits/RefreshChild/controller.server.js
@@ -16,7 +16,7 @@ YUI.add('RefreshChild', function(Y, NAME) {
* @class Controller
* @constructor
*/
- Y.mojito.controllers[NAME] = {
+ Y.namespace('mojito.controllers')[NAME] = {
init: function(config) {
this.config = config;
View
2 tests/func/applications/frameworkapp/serveronly/mojits/RefreshParent/controller.server.js
@@ -16,7 +16,7 @@ YUI.add('RefreshParent', function(Y, NAME) {
* @class Controller
* @constructor
*/
- Y.mojito.controllers[NAME] = {
+ Y.namespace('mojito.controllers')[NAME] = {
init: function(config) {
this.config = config;
View
6 tests/func/applications/frameworkapp/serveronly/mojits/ServerCookie/controller.server.js
<
@@ -4,9 +4,9 @@
* See the accompanying LICENSE file for terms.
*/
-YUI.add('CookieMojit', function(Y) {
+YUI.add('CookieMojit', function(Y, NAME) {
- Y.mojito.controller = {
+ Y.namespace('mojito.controllers')[NAME] = {
init: function(config) {
this.config = config;
},
@@ -23,4 +23,4 @@ YUI.add('CookieMojit', function(Y) {
);