aboutsummaryrefslogtreecommitdiff
path: root/node_modules/montage/montage.js
diff options
context:
space:
mode:
authorValerio Virgillito2012-04-18 13:48:51 -0700
committerValerio Virgillito2012-04-18 13:48:51 -0700
commit2e04af953463643791f6362bd8ef4c6ba190abfa (patch)
treed07aaf646091ddf9dad5b030a7905055fd323490 /node_modules/montage/montage.js
parent616a8532099fec2a15855eac97cd85cb60c4451c (diff)
downloadninja-2e04af953463643791f6362bd8ef4c6ba190abfa.tar.gz
Squashed commit of the following:
commit 2054551bfb01a0f4ca2e138b9d724835462d45cd Merge: 765c2da 616a853 Author: Valerio Virgillito <valerio@motorola.com> Date: Wed Apr 18 13:48:21 2012 -0700 Merge branch 'refs/heads/master' into integration commit 765c2da8e1aa03550caf42b2bd5f367555ad2843 Author: Valerio Virgillito <valerio@motorola.com> Date: Tue Apr 17 15:29:41 2012 -0700 updating the picasa carousel Signed-off-by: Valerio Virgillito <valerio@motorola.com> commit 9484f1c82b81e27edf2dc0a1bcc1fa3b12077406 Merge: d27f2df cacb4a2 Author: Valerio Virgillito <valerio@motorola.com> Date: Tue Apr 17 15:03:50 2012 -0700 Merge branch 'refs/heads/master' into integration commit d27f2df4d846064444263d7832d213535962abe7 Author: Valerio Virgillito <valerio@motorola.com> Date: Wed Apr 11 10:39:36 2012 -0700 integrating new picasa carousel component Signed-off-by: Valerio Virgillito <valerio@motorola.com> commit 6f98384c9ecbc8abe55ccfe1fc25a0c7ce22c493 Author: Valerio Virgillito <valerio@motorola.com> Date: Tue Apr 10 14:33:00 2012 -0700 fixed the text area case issue Text area was renamed from TextArea to Textarea Signed-off-by: Valerio Virgillito <valerio@motorola.com> commit 1e83e26652266136802bc7af930379c1ecd631a6 Author: Valerio Virgillito <valerio@motorola.com> Date: Mon Apr 9 22:10:45 2012 -0700 integrating montage v0.8 into ninja. Signed-off-by: Valerio Virgillito <valerio@motorola.com> Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'node_modules/montage/montage.js')
-rwxr-xr-xnode_modules/montage/montage.js45
1 files changed, 31 insertions, 14 deletions
diff --git a/node_modules/montage/montage.js b/node_modules/montage/montage.js
index e9e9b455..05e1a52a 100755
--- a/node_modules/montage/montage.js
+++ b/node_modules/montage/montage.js
@@ -48,9 +48,8 @@ if (typeof window !== "undefined") {
48 })(); 48 })();
49 49
50 /** 50 /**
51 * Initializes Montage and creates the application singleton if necessary. 51 * Initializes Montage and creates the application singleton if
52 * @param options 52 * necessary.
53 * @param callback
54 */ 53 */
55 exports.initMontage = function () { 54 exports.initMontage = function () {
56 var platform = exports.getPlatform(); 55 var platform = exports.getPlatform();
@@ -106,6 +105,14 @@ if (typeof window !== "undefined") {
106 }); 105 });
107 }; 106 };
108 107
108 if ('autoPackage' in params) {
109 montageRequire.injectPackageDescription(location, {
110 mappings: {
111 montage: "@"
112 }
113 });
114 }
115
109 return montageRequire.loadPackage(location) 116 return montageRequire.loadPackage(location)
110 .then(function (applicationRequire) { 117 .then(function (applicationRequire) {
111 global.require = applicationRequire; 118 global.require = applicationRequire;
@@ -126,6 +133,8 @@ if (typeof window !== "undefined") {
126 @param config 133 @param config
127 @param compiler 134 @param compiler
128 */ 135 */
136 var reverseReelExpression = /((.*)\.reel)\/\2$/;
137 var reverseReelFunction = function ($0, $1) { return $1 };
129 exports.SerializationCompiler = function(config, compile) { 138 exports.SerializationCompiler = function(config, compile) {
130 return function(module) { 139 return function(module) {
131 compile(module); 140 compile(module);
@@ -134,22 +143,30 @@ if (typeof window !== "undefined") {
134 var defaultFactory = module.factory; 143 var defaultFactory = module.factory;
135 module.factory = function(require, exports, module) { 144 module.factory = function(require, exports, module) {
136 defaultFactory.call(this, require, exports, module); 145 defaultFactory.call(this, require, exports, module);
137 for (var symbol in exports) { 146 for (var name in exports) {
138 var object = exports[symbol]; 147 var object = exports[name];
148 // avoid attempting to initialize a non-object
149 if (!(object instanceof Object)) {
139 // avoid attempting to reinitialize an aliased property 150 // avoid attempting to reinitialize an aliased property
140 if (object.hasOwnProperty("_montage_metadata")) { 151 } else if (object.hasOwnProperty("_montage_metadata")) {
141 object._montage_metadata.aliases.push(symbol); 152 object._montage_metadata.aliases.push(name);
142 object._montage_metadata.objectName = symbol; 153 object._montage_metadata.objectName = name;
143 } else if (!Object.isSealed(object)) { 154 } else if (!Object.isSealed(object)) {
155 var id = module.id.replace(
156 reverseReelExpression,
157 reverseReelFunction
158 );
144 Object.defineProperty( 159 Object.defineProperty(
145 object, 160 object,
146 "_montage_metadata", 161 "_montage_metadata",
147 { 162 {
148 value: { 163 value: {
149 require: require, 164 require: require,
150 moduleId: module.id, 165 module: id,
151 objectName: symbol, 166 moduleId: id, // deprecated
152 aliases: [symbol], 167 property: name,
168 objectName: name, // deprecated
169 aliases: [name],
153 isInstance: false 170 isInstance: false
154 } 171 }
155 } 172 }
@@ -380,10 +397,10 @@ if (typeof window !== "undefined") {
380 397
381 }, 398 },
382 399
383 initMontage: function (montageRequire, applicationRequire, options) { 400 initMontage: function (montageRequire, applicationRequire, params) {
384 // If a module was specified in the config then we initialize it now 401 // If a module was specified in the config then we initialize it now
385 if (options.module) { 402 if (params.module) {
386 applicationRequire.async(options.module) 403 applicationRequire.async(params.module)
387 .end(); 404 .end();
388 } else { 405 } else {
389 // otherwise we load the application 406 // otherwise we load the application