From 2e04af953463643791f6362bd8ef4c6ba190abfa Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Wed, 18 Apr 2012 13:48:51 -0700 Subject: Squashed commit of the following: commit 2054551bfb01a0f4ca2e138b9d724835462d45cd Merge: 765c2da 616a853 Author: Valerio Virgillito Date: Wed Apr 18 13:48:21 2012 -0700 Merge branch 'refs/heads/master' into integration commit 765c2da8e1aa03550caf42b2bd5f367555ad2843 Author: Valerio Virgillito Date: Tue Apr 17 15:29:41 2012 -0700 updating the picasa carousel Signed-off-by: Valerio Virgillito commit 9484f1c82b81e27edf2dc0a1bcc1fa3b12077406 Merge: d27f2df cacb4a2 Author: Valerio Virgillito Date: Tue Apr 17 15:03:50 2012 -0700 Merge branch 'refs/heads/master' into integration commit d27f2df4d846064444263d7832d213535962abe7 Author: Valerio Virgillito Date: Wed Apr 11 10:39:36 2012 -0700 integrating new picasa carousel component Signed-off-by: Valerio Virgillito commit 6f98384c9ecbc8abe55ccfe1fc25a0c7ce22c493 Author: Valerio Virgillito 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 commit 1e83e26652266136802bc7af930379c1ecd631a6 Author: Valerio Virgillito Date: Mon Apr 9 22:10:45 2012 -0700 integrating montage v0.8 into ninja. Signed-off-by: Valerio Virgillito Signed-off-by: Valerio Virgillito --- node_modules/montage/montage.js | 45 ++++++++++++++++++++++++++++------------- 1 file changed, 31 insertions(+), 14 deletions(-) (limited to 'node_modules/montage/montage.js') 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") { })(); /** - * Initializes Montage and creates the application singleton if necessary. - * @param options - * @param callback + * Initializes Montage and creates the application singleton if + * necessary. */ exports.initMontage = function () { var platform = exports.getPlatform(); @@ -106,6 +105,14 @@ if (typeof window !== "undefined") { }); }; + if ('autoPackage' in params) { + montageRequire.injectPackageDescription(location, { + mappings: { + montage: "@" + } + }); + } + return montageRequire.loadPackage(location) .then(function (applicationRequire) { global.require = applicationRequire; @@ -126,6 +133,8 @@ if (typeof window !== "undefined") { @param config @param compiler */ + var reverseReelExpression = /((.*)\.reel)\/\2$/; + var reverseReelFunction = function ($0, $1) { return $1 }; exports.SerializationCompiler = function(config, compile) { return function(module) { compile(module); @@ -134,22 +143,30 @@ if (typeof window !== "undefined") { var defaultFactory = module.factory; module.factory = function(require, exports, module) { defaultFactory.call(this, require, exports, module); - for (var symbol in exports) { - var object = exports[symbol]; + for (var name in exports) { + var object = exports[name]; + // avoid attempting to initialize a non-object + if (!(object instanceof Object)) { // avoid attempting to reinitialize an aliased property - if (object.hasOwnProperty("_montage_metadata")) { - object._montage_metadata.aliases.push(symbol); - object._montage_metadata.objectName = symbol; + } else if (object.hasOwnProperty("_montage_metadata")) { + object._montage_metadata.aliases.push(name); + object._montage_metadata.objectName = name; } else if (!Object.isSealed(object)) { + var id = module.id.replace( + reverseReelExpression, + reverseReelFunction + ); Object.defineProperty( object, "_montage_metadata", { value: { require: require, - moduleId: module.id, - objectName: symbol, - aliases: [symbol], + module: id, + moduleId: id, // deprecated + property: name, + objectName: name, // deprecated + aliases: [name], isInstance: false } } @@ -380,10 +397,10 @@ if (typeof window !== "undefined") { }, - initMontage: function (montageRequire, applicationRequire, options) { + initMontage: function (montageRequire, applicationRequire, params) { // If a module was specified in the config then we initialize it now - if (options.module) { - applicationRequire.async(options.module) + if (params.module) { + applicationRequire.async(params.module) .end(); } else { // otherwise we load the application -- cgit v1.2.3