From 9a30ad75b8b575d1f39a854a6aa9710ecbecc0aa Mon Sep 17 00:00:00 2001 From: Romain Dardour Date: Tue, 22 Apr 2014 17:15:59 +0200 Subject: [PATCH 01/39] Fallback Helper --- src/utils/handlebars-helpers.coffee | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/utils/handlebars-helpers.coffee b/src/utils/handlebars-helpers.coffee index fea15625..423126ab 100644 --- a/src/utils/handlebars-helpers.coffee +++ b/src/utils/handlebars-helpers.coffee @@ -14,6 +14,21 @@ define ['underscore', 'moment'], (_, moment)-> ### + ###* + * Fallback Helper for falsy values. + * + * user.picture = undefined + * + * + * => + * + * @param {String} value Anything + * @param {String} fallback + * @return {String} value if value is truthy, otherwise fallback + ### + HandlebarsHelpers.or = (first, second) -> first || second + + ###* * Generates an image representation for a social object. * From 741e260c1dc97b001dd533c0d4b58a3d9122fc7f Mon Sep 17 00:00:00 2001 From: Xavier Cambar Date: Tue, 6 May 2014 11:51:16 +0200 Subject: [PATCH 02/39] Fixes mapping of services in config --- spec/remote/config-normalizer_spec.js | 5 +++-- src/remote/config-normalizer.coffee | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/spec/remote/config-normalizer_spec.js b/spec/remote/config-normalizer_spec.js index d5e999b3..8b3fc859 100644 --- a/spec/remote/config-normalizer_spec.js +++ b/spec/remote/config-normalizer_spec.js @@ -33,7 +33,7 @@ define(['lib/remote/config-normalizer'], function (CfgNorm) { }; var types = { auth: ['fb_app', 'abc'], - other: ['mp'] + other: ['mp', 'np_stuff'] }; this.normalizer.sortServicesByType(settings, types).should.eql({ auth: { @@ -41,7 +41,8 @@ define(['lib/remote/config-normalizer'], function (CfgNorm) { abc: {} }, other: { - mp: {} + mp: {}, + np: {} } }); }); diff --git a/src/remote/config-normalizer.coffee b/src/remote/config-normalizer.coffee index 460fe144..08688c17 100644 --- a/src/remote/config-normalizer.coffee +++ b/src/remote/config-normalizer.coffee @@ -1,7 +1,9 @@ define ['underscore'], (_)-> flattenSettings = (settings, name)-> - [name.replace(/_app$/, ''), settings[name] || {}] + nameArray = name.split('_') + nameArray.pop() if nameArray.length > 1 + [nameArray.join('_'), settings[name] || {}] class ConfigNormalizer constructor: (cfg)-> From a8a7aba3321e5ce31613cae43160ca6f9e3ef309 Mon Sep 17 00:00:00 2001 From: Stephane Bellity Date: Fri, 9 May 2014 11:29:08 +0200 Subject: [PATCH 03/39] Build debug versions of the libs --- .grunt/api.json | 2 +- .grunt/client.json | 2 +- .grunt/remote.json | 2 +- Gruntfile.js | 31 +++++++++++++++++++++++++------ package.json | 2 +- 5 files changed, 29 insertions(+), 10 deletions(-) diff --git a/.grunt/api.json b/.grunt/api.json index 5e5db71a..05cb94bb 100644 --- a/.grunt/api.json +++ b/.grunt/api.json @@ -34,7 +34,7 @@ "domready", "lib/bootstrap" ], - "out": "dist/<%= PKG_VERSION %>/hull.api.js", + "out": "dist/<%= PKG_VERSION %>/hull.api.debug.js", "wrap": { "start": "(function(){var require, requirejs, define, root={}, HULL_ENV='api'; (function () {", "end": ";}).call(root);})();" diff --git a/.grunt/client.json b/.grunt/client.json index 2b5ac496..b91baa7c 100644 --- a/.grunt/client.json +++ b/.grunt/client.json @@ -54,7 +54,7 @@ "lib/bootstrap", "moment" ], - "out": "dist/<%= PKG_VERSION %>/hull.js", + "out": "dist/<%= PKG_VERSION %>/hull.debug.js", "wrap": { "start": "(function(){var require, requirejs, define, root={jQuery: window.jQuery}, HULL_ENV = 'client'; (function () {", "end": ";}).call(root);})();" diff --git a/.grunt/remote.json b/.grunt/remote.json index ddaf6101..2907f6a2 100644 --- a/.grunt/remote.json +++ b/.grunt/remote.json @@ -45,6 +45,6 @@ "aura-extensions/aura-purl", "aura-extensions/aura-uuid" ], - "out": "dist/<%= PKG_VERSION %>/hull-remote.js" + "out": "dist/<%= PKG_VERSION %>/hull-remote.debug.js" } } diff --git a/Gruntfile.js b/Gruntfile.js index 6f5ca99f..a9980a24 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -10,6 +10,7 @@ module.exports = function (grunt) { grunt.loadNpmTasks('grunt-contrib-requirejs'); grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadNpmTasks('grunt-contrib-symlink'); + grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-hull-dox'); grunt.loadNpmTasks('grunt-hull-widgets'); grunt.loadNpmTasks('grunt-s3'); @@ -51,20 +52,20 @@ module.exports = function (grunt) { //Augment the require.js configuation with some computed elements var apiRJSConfig = (function () { var _c = apiConfig.requireJS; - _c.optimize = grunt.option('dev') ? "none" : "uglify"; + _c.optimize = 'none'; return _c; })(); var clientRJSConfig = (function () { var _c = clientConfig.requireJS; _c.include = _c.include.concat(auraExtensions).concat(clientLibs); - _c.optimize = grunt.option('dev') ? "none" : "uglify"; + _c.optimize = 'none'; return _c; })(); var remoteRJSConfig = (function () { var _c = remoteConfig.requireJS; _c.include = _c.include.concat(remoteLibs).concat(vendorLibs); - _c.optimize = grunt.option('dev') ? "none" : "uglify"; + _c.optimize = 'none'; return _c; })(); @@ -75,6 +76,24 @@ module.exports = function (grunt) { configFile: 'karma.conf.js' } }, + uglify: { + options: {}, + api: { + files: { + 'dist/<%= PKG_VERSION%>/hull.api.js' : ['dist/<%= PKG_VERSION%>/hull.api.debug.js'] + } + }, + client: { + files: { + 'dist/<%= PKG_VERSION%>/hull.js' : ['dist/<%= PKG_VERSION%>/hull.debug.js'] + } + }, + remote: { + files: { + 'dist/<%= PKG_VERSION%>/hull-remote.js' : ['dist/<%= PKG_VERSION%>/hull-remote.debug.js'] + } + } + }, clean: { client: { src: ['dist/current', 'lib/client/**/*'] @@ -243,9 +262,9 @@ module.exports = function (grunt) { } }, dist: { - "remote": ['version', 'clean:remote', 'coffee:remote', 'wrap', 'version', 'requirejs:remote', 'symlink:current'], - "client": ['version', 'clean:client', 'coffee:client', 'wrap', 'version', 'requirejs:client', 'cssmin', 'symlink:current'], - "api": ['version', 'clean:client', 'coffee:api', 'wrap', 'version', 'requirejs:api', 'symlink:current'], + "remote": ['version', 'clean:remote', 'coffee:remote', 'wrap', 'version', 'requirejs:remote', 'uglify:remote', 'symlink:current'], + "client": ['version', 'clean:client', 'coffee:client', 'wrap', 'version', 'requirejs:client', 'uglify:client', 'cssmin', 'symlink:current'], + "api": ['version', 'clean:client', 'coffee:api', 'wrap', 'version', 'requirejs:api', 'uglify:api', 'symlink:current'], "client-no-underscore": ['version', 'clean:client', 'coffee:client', 'wrap', 'version', 'requirejs:client-no-underscore'], "client-no-backbone": ['version', 'clean:client', 'coffee:client', 'wrap', 'version', 'requirejs:client-no-backbone'], "widgets": ["version", "hull_widgets"], diff --git a/package.json b/package.json index e8b67be1..bdc58061 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "grunt-contrib-connect": "0.1.2", "grunt-contrib-handlebars": "0.5.9", "grunt-contrib-requirejs": "0.4.0", - "grunt-contrib-uglify": "0.1.1", + "grunt-contrib-uglify": "0.4.0", "grunt-contrib-watch": "0.5.3", "grunt-contrib-symlink": "0.2.0", "grunt-hull-dox": "git://github.com/hull/grunt-hull-dox.git", From 9a18d25392b66fcb25eb63a74e8256b0c0f18d9f Mon Sep 17 00:00:00 2001 From: Xavier Cambar Date: Wed, 14 May 2014 15:33:40 +0200 Subject: [PATCH 04/39] Fixes Mixpanel integration in analytics.js --- bower.json | 2 +- src/remote/services/hull.coffee | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/bower.json b/bower.json index 5d490ddb..21a6d276 100644 --- a/bower.json +++ b/bower.json @@ -6,7 +6,7 @@ "jquery": "1.10.*", "aura": "hull/aura#28f8475389ff5f3cdad493b98768ac5c684e0103", "backbone": "0.9.9", - "analytics": "hull/analytics#1.0.8-hull", + "analytics": "hull/analytics#1.3.30-hull", "cookies-js": "0.3.1", "base64": "0.1.1", "jquery-file-upload": "7.2.1", diff --git a/src/remote/services/hull.coffee b/src/remote/services/hull.coffee index a184ea92..84fecdbf 100644 --- a/src/remote/services/hull.coffee +++ b/src/remote/services/hull.coffee @@ -19,7 +19,6 @@ define ['jquery', 'underscore', '../handler'], ($, _, Handler)-> initInfo = url: app.config.data.request.url.href path: app.config.data.request.url.path - $referrer: app.config.data.request.referrer?.href referrer: app.config.data.request.referrer?.href browser_id: getBrowserId() session_id: getSessionId() From 3264b98ca4c3004e1ea10f7a9d769a64d4542926 Mon Sep 17 00:00:00 2001 From: Xavier Cambar Date: Wed, 14 May 2014 16:00:11 +0200 Subject: [PATCH 05/39] Adds referring domain o tracking data --- src/remote/services/hull.coffee | 1 + 1 file changed, 1 insertion(+) diff --git a/src/remote/services/hull.coffee b/src/remote/services/hull.coffee index 84fecdbf..948f8092 100644 --- a/src/remote/services/hull.coffee +++ b/src/remote/services/hull.coffee @@ -20,6 +20,7 @@ define ['jquery', 'underscore', '../handler'], ($, _, Handler)-> url: app.config.data.request.url.href path: app.config.data.request.url.path referrer: app.config.data.request.referrer?.href + referring_domain: app.config.data.request.referrer?.host browser_id: getBrowserId() session_id: getSessionId() identify = (me) -> From b3ea8782e6e9cffcad57603747184633fbbd6871 Mon Sep 17 00:00:00 2001 From: Xavier Cambar Date: Thu, 15 May 2014 17:41:50 +0200 Subject: [PATCH 06/39] Copy instead of minify when in dev mode --- .grunt/helpers.js | 13 +++++++++++++ Gruntfile.js | 26 ++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/.grunt/helpers.js b/.grunt/helpers.js index d23e20a8..ffb1c98e 100644 --- a/.grunt/helpers.js +++ b/.grunt/helpers.js @@ -71,6 +71,19 @@ module.exports = function (grunt) { }] } }; + }, + updateDistTask: function (config, isDev) { + config = config.dist; + if (!isDev || !config) return; + + var subKeys = ['remote', 'api', 'client']; + subKeys.forEach(function (key) { + var subTask = config[key]; + var lookedUpName = 'uglify:' + key; + var lookedUpIdx = subTask.indexOf(lookedUpName); + if (lookedUpIdx === -1) return; + subTask.splice(lookedUpIdx, 1, 'copy:' + key); + }); } }; }; diff --git a/Gruntfile.js b/Gruntfile.js index a9980a24..e5874553 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -20,6 +20,7 @@ module.exports = function (grunt) { grunt.loadNpmTasks('grunt-bump'); grunt.loadNpmTasks('grunt-invalidate-cloudfront'); grunt.loadNpmTasks('grunt-contrib-cssmin'); + grunt.loadNpmTasks('grunt-contrib-copy'); var clientConfig = grunt.file.readJSON('.grunt/client.json'); var remoteConfig = grunt.file.readJSON('.grunt/remote.json'); @@ -76,6 +77,29 @@ module.exports = function (grunt) { configFile: 'karma.conf.js' } }, + copy: { + api: { + files: [{ + expand: false, + src: ['dist/<%= PKG_VERSION%>/hull.api.debug.js'], + dest: 'dist/<%= PKG_VERSION%>/hull.api.js' + }] + }, + client: { + files: [{ + expand: false, + src: ['dist/<%= PKG_VERSION%>/hull.debug.js'], + dest: 'dist/<%= PKG_VERSION%>/hull.js' + }] + }, + remote: { + files: [{ + expand: false, + src: ['dist/<%= PKG_VERSION%>/hull-remote.debug.js'], + dest: 'dist/<%= PKG_VERSION%>/hull-remote.js' + }] + } + }, uglify: { options: {}, api: { @@ -273,6 +297,8 @@ module.exports = function (grunt) { } }; + helpers.updateDistTask(gruntConfig, !!grunt.option('dev')); + helpers.appendAWSConfig(gruntConfig); helpers.cloudFrontConfig(gruntConfig); grunt.initConfig(gruntConfig); From 75dd67e09325c50d13c296cac8dc92b42b87054f Mon Sep 17 00:00:00 2001 From: Xavier Cambar Date: Thu, 15 May 2014 18:03:22 +0200 Subject: [PATCH 07/39] Build optmized flavours --- Gruntfile.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index e5874553..7cf08093 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -184,17 +184,19 @@ module.exports = function (grunt) { options: (function (c) { c.paths.underscore = 'empty:'; c.paths.backbone = 'empty:'; - c.out = c.out.replace('hull.js', 'hull.no-backbone.js'); + c.out = c.out.replace('hull.debug.js', 'hull.no-backbone.js'); c.wrap.start = c.wrap.start + ";root._ = window._;"; c.wrap.start = c.wrap.start + ";root.Backbone = window.Backbone;"; + c.optimize = "uglify"; return c; })(clone(clientRJSConfig, true)) }, "client-no-underscore": { options: (function (c) { c.paths.underscore = 'empty:'; - c.out = c.out.replace('hull.js', 'hull.no-underscore.js'); + c.out = c.out.replace('hull.debug.js', 'hull.no-underscore.js'); c.wrap.start = c.wrap.start + ";root._ = window._;"; + c.optimize = "uglify"; return c; })(clone(clientRJSConfig, true)) }, From ae71c8e095b148f11228cf49cc6df13a0698745c Mon Sep 17 00:00:00 2001 From: Xavier Cambar Date: Thu, 15 May 2014 18:17:04 +0200 Subject: [PATCH 08/39] Update Moment --- bower.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bower.json b/bower.json index 5d490ddb..a7fbbce7 100644 --- a/bower.json +++ b/bower.json @@ -10,7 +10,7 @@ "cookies-js": "0.3.1", "base64": "0.1.1", "jquery-file-upload": "7.2.1", - "moment": "1.7.2", + "moment": "2.6.0", "underscore.string": "2.3.1", "twitter-text": "1.6.1", "q": "~0.9.7", From 57e222c01d121ad97f11e6a3b58cb9d93da6b672 Mon Sep 17 00:00:00 2001 From: Stephane Bellity Date: Mon, 19 May 2014 18:23:34 +0200 Subject: [PATCH 09/39] Filtering tracks + expose FB.ui methods and display FB modals in iframe --- src/api/xdm.coffee | 50 +++++++++++++++++++++++++++-- src/bootstrap.coffee | 17 ++++++++++ src/hull.coffee | 6 ++-- src/remote/services.coffee | 17 +++++++--- src/remote/services/facebook.coffee | 38 ++++++++++++++++++++-- src/remote/services/hull.coffee | 41 +++++++++++++++++++++-- 6 files changed, 155 insertions(+), 14 deletions(-) diff --git a/src/api/xdm.coffee b/src/api/xdm.coffee index 4da21f3f..ead83a79 100644 --- a/src/api/xdm.coffee +++ b/src/api/xdm.coffee @@ -1,4 +1,4 @@ -define ['domready', 'lib/utils/promises', 'xdm', 'lib/utils/version'], (domready, promises, xdm, version)-> +define ['domready', 'lib/utils/promises', 'xdm', 'lib/utils/version', 'underscore'], (domready, promises, xdm, version, _)-> # Builds the URL used by xdm # Based upon the (app) configuration @@ -6,6 +6,7 @@ define ['domready', 'lib/utils/promises', 'xdm', 'lib/utils/version'], (domready remoteUrl = "#{config.orgUrl}/api/v1/#{config.appId}/remote.html?v=#{version}" remoteUrl += "&js=#{config.jsUrl}" if config.jsUrl remoteUrl += "&uid=#{config.uid}" if config.uid + remoteUrl += "&debug_remote=true" if config.debugRemote accessToken = config.accessToken || config.appSecret remoteUrl += "&access_token=#{accessToken}" if accessToken? remoteUrl += "&user_hash=#{config.userHash}" if config.userHash != undefined @@ -34,6 +35,40 @@ define ['domready', 'lib/utils/promises', 'xdm', 'lib/utils/version'], (domready window.clearTimeout(timeout) deferred.resolve { rpc: rpc, config: remoteConfig } + getClientConfig = -> config + + + hiddenFrameStyle = + top: '-20px' + left: '-20px' + bottom: 'auto' + right: 'auto' + width: '1px' + height: '1px' + display: 'block' + position: 'fixed' + zIndex: undefined + overflow: 'hidden' + + shownFrameStyle = + top: '0px' + left: '0px' + right: '0px' + bottom: '0px' + width: '100%' + height: '100%' + display: 'block' + position: 'fixed' + zIndex: 10000 + overflow: 'auto' + + + showIframe = -> applyFrameStyle(shownFrameStyle) + hideIframe = -> applyFrameStyle(hiddenFrameStyle) + + applyFrameStyle = (styles)-> + _.map styles, (v,k)-> rpc.iframe.style[k] = v + domready -> timeout = setTimeout( ()-> @@ -49,11 +84,20 @@ define ['domready', 'lib/utils/promises', 'xdm', 'lib/utils/version'], (domready width: "1px" style: position: 'fixed' - width: "0" + width: "1px" + height: "1px" top: '-20px' left: '-20px' + overflow: 'hidden' , remote: message: {}, ready: {} - local: message: onMessage, ready: readyFn, userUpdate: userUpdate, settingsUpdate: settingsUpdate + local: + message: onMessage, + ready: readyFn, + userUpdate: userUpdate, + settingsUpdate: settingsUpdate + getClientConfig: getClientConfig + show: showIframe + hide: hideIframe deferred.promise diff --git a/src/bootstrap.coffee b/src/bootstrap.coffee index 0f4f99c7..efd3534a 100644 --- a/src/bootstrap.coffee +++ b/src/bootstrap.coffee @@ -73,6 +73,7 @@ preInit = (isMain, config, cb, errb)-> lock.run -> _config = _extend {}, config + _config.track = getTrackConfig(_config.track) if _config.track? _config.namespace = 'hull' _config.debug = config.debug && { enable: true } _success = (args...)-> successCb [config, isMain, cb or ->].concat(args)... @@ -87,6 +88,22 @@ initApi = (config, args...)-> initMain = (config, args...)-> preInit [true, config].concat(args)... +getTrackConfig = (cfg)-> + return unless cfg? + stringify = (a)-> + + ret = switch (Object.prototype.toString.call(cfg).match(/^\[object (.*)\]$/)[1]) + when "Object" + if cfg.only? + { only: (m.toString() for m in cfg.only) } + else if cfg.ignore? + { ignore: (m.toString() for m in cfg.ignore) } + when "RegExp" + { only: cfg.toString() } + when "Array" + { only: (m.toString() for m in cfg) } + ret + _hull = window.Hull = on: createPool 'on' track: createPool 'track' diff --git a/src/hull.coffee b/src/hull.coffee index a2eb9847..cde2a276 100644 --- a/src/hull.coffee +++ b/src/hull.coffee @@ -13,7 +13,7 @@ define ['underscore', 'lib/utils/promises', 'aura/aura', 'lib/utils/handlebars', # _.extend(HullDef, sb); # After app init, call the queued events - setupApp = (app, api)-> + setupApp = (app, api, extensions=[])-> app .use(hullApiMiddleware(api)) .use('aura-extensions/aura-base64') @@ -35,6 +35,8 @@ define ['underscore', 'lib/utils/promises', 'aura/aura', 'lib/utils/handlebars', .use('lib/client/component/component') .use('lib/client/component/templates') .use('lib/client/component/datasource') + app.use(ext) for ext in extensions + app init: (config)-> appPromise = HullAPI.init(config) @@ -47,7 +49,7 @@ define ['underscore', 'lib/utils/promises', 'aura/aura', 'lib/utils/handlebars', remoteConfig: successResult.raw.remoteConfig login: successResult.api.login logout: successResult.api.logout - app: setupApp(app, deps) + app: setupApp(app, deps, (config.extensions || [])) api: successResult components: true success: (appParts)-> diff --git a/src/remote/services.coffee b/src/remote/services.coffee index b732e0bd..a269db0d 100644 --- a/src/remote/services.coffee +++ b/src/remote/services.coffee @@ -1,12 +1,11 @@ define ['underscore', 'xdm'], (_, xdm)-> - catchAll = (res)-> - console.warn("CatchAll Handler: ", res) - res + catchAll = (res)-> res (app)-> rpc = null initialize: (app)-> + dfd = $.Deferred() core = app.core core.routeHandlers = {} @@ -14,6 +13,7 @@ define ['underscore', 'xdm'], (_, xdm)-> throw new Error("Path not recognized #{JSON.stringify(req)}") unless req.path handler = core.routeHandlers[req.provider] + if _.isFunction handler handler(req, callback, errback) else @@ -30,19 +30,26 @@ define ['underscore', 'xdm'], (_, xdm)-> rpc = new xdm.Rpc({ acl: app.config.appDomains }, { - remote: { message: {}, ready: {}, userUpdate: {}, settingsUpdate: {} } + remote: { message: {}, ready: {}, userUpdate: {}, settingsUpdate: {}, getClientConfig: {}, show: {}, hide: {} } local: { message: onRemoteMessage } }) + rpc.getClientConfig (cfg)-> + core.clientConfig = cfg + dfd.resolve(cfg) catch e + dfd.reject(e) rpcFall = new xdm.Rpc({}, remote: {message: {}} ) rpcFall.message error: "#{e.message}, please make sure this domain is whitelisted for this app." - true + dfd.promise() afterAppStart: (app)-> return throw 'Unable to start Hull.' unless rpc rpc.ready(app.config) app.sandbox.on 'remote.user.update', rpc.userUpdate.bind(rpc) app.sandbox.on 'remote.settings.update', rpc.settingsUpdate.bind(rpc) + app.sandbox.on 'remote.iframe.show', -> rpc.show() + app.sandbox.on 'remote.iframe.hide', -> rpc.hide() + diff --git a/src/remote/services/facebook.coffee b/src/remote/services/facebook.coffee index 80dde87e..4f6d8202 100644 --- a/src/remote/services/facebook.coffee +++ b/src/remote/services/facebook.coffee @@ -2,6 +2,11 @@ define ['lib/utils/promises', 'underscore'], (promises, _) -> slice = Array.prototype.slice + showIframe = -> + hideIframe = -> + + uiHandlers = {} + ensureLoggedIn = (base) -> -> args = slice.call(arguments) @@ -9,8 +14,9 @@ define ['lib/utils/promises', 'underscore'], (promises, _) -> base.apply(undefined, args) , true - resp = (req, callback, errback) -> + resp = (req, callback, errback, hideIt) -> (res) -> + hideIframe() if hideIt if (res && !res.error) callback({ response: res, provider: 'facebook' }) else @@ -24,9 +30,21 @@ define ['lib/utils/promises', 'underscore'], (promises, _) -> path = req.path if path == 'fql.query' FB.api({ method: 'fql.query', query: req.params.query }, resp(req, callback, errback)) + else if /^ui\./.test(path) + prms = _.clone(req.params) + prms.method = path.replace(/^ui\./, '') + showIframe() + cb = resp(req, callback, errback, true) + uiHandler = uiHandlers[path] + _.delay -> + FB.ui prms, (response)-> + uiHandler(req, response) if _.isFunction(uiHandler) + cb(response) + , 100 else FB.api path, req.method, req.params, resp(req, callback, (msg, res)-> res.time = new Date(); callback(res)) - + + initialize: (app)-> fb = document.createElement 'script' @@ -35,12 +53,28 @@ define ['lib/utils/promises', 'underscore'], (promises, _) -> fb.src = "https://connect.facebook.net/en_US/all.js" (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(fb); + showIframe = -> + app.core.mediator.emit('remote.iframe.show') + + hideIframe = -> + app.core.mediator.emit('remote.iframe.hide') + dfd = promises.deferred() + window.fbAsyncInit = ()-> FB.init app.config.settings.auth.facebook dfd.resolve({}) + app.core.routeHandlers.facebook = ()-> args = arguments dfd.promise.then ()-> api.apply(undefined, args) undefined + + uiHandlers['ui.apprequests'] = (req, res)-> + opts = { path: 'services/facebook/apprequests', method: 'post', params: res } + noop = -> + app.core.routeHandlers.hull(opts, noop, noop) + + + diff --git a/src/remote/services/hull.coffee b/src/remote/services/hull.coffee index a184ea92..dd2343b0 100644 --- a/src/remote/services/hull.coffee +++ b/src/remote/services/hull.coffee @@ -1,5 +1,6 @@ define ['jquery', 'underscore', '../handler'], ($, _, Handler)-> (app)-> + createOrRefreshUuid = (key, expires) -> uuid = app.core.cookies.get(key) || app.core.util.uuid() app.core.cookies.set(key, uuid, { @@ -56,8 +57,43 @@ define ['jquery', 'underscore', '../handler'], ($, _, Handler)-> error(h.response) return + + class TrackEventMatcher + + constructor: (cfg)-> + if cfg == false || cfg?.ignore? + @mode = 'ignore' + @_initMatchers(cfg.ignore) + else if !cfg? + @mode = 'match_all' + else + @mode = 'match' + @_initMatchers(cfg?.only || cfg) + + _initMatchers: (m)-> + m = [m] if _.isString(m) + @matchers = _.map _.compact(m), (c)-> + _c = c.toString() + if /^\/.*\/$/.test(_c) + new RegExp(_c.slice(1,-1)) + else + _c + + weTrackIt: (event)-> + return false unless event? + return true if @mode == 'match_all' + ret = _.some _.map @matchers, (m)-> + if _.isFunction(m.test) + m.test(event) + else + m == event + if @mode == 'ignore' + return !ret + else + return ret + doTrack = (event, params={})-> - return unless event + return unless app.core.trackMatcher.weTrackIt(event) params.hull_app_id = app.config?.appId params.hull_app_name = app.config?.data?.app?.name _.defaults params, initInfo @@ -69,7 +105,6 @@ define ['jquery', 'underscore', '../handler'], ($, _, Handler)-> [eventName, trackParams] = JSON.parse(atob(track)) doTrack(eventName, trackParams) catch error - console.warn 'Invalid Tracking header' "Invalid Tracking header" handler.after trackAction @@ -96,6 +131,8 @@ define ['jquery', 'underscore', '../handler'], ($, _, Handler)-> initialize: (app)-> + app.core.trackMatcher = new TrackEventMatcher(app.core.clientConfig.track) + analytics = require('analytics') settings = app.config.settings.analytics || {} analyticsSettings = {} From d0168ae3f8194c1c6e402f117836561b4ed6bc61 Mon Sep 17 00:00:00 2001 From: Stephane Bellity Date: Tue, 20 May 2014 16:14:36 +0200 Subject: [PATCH 10/39] mask the iframe on click --- src/remote/services.coffee | 1 + 1 file changed, 1 insertion(+) diff --git a/src/remote/services.coffee b/src/remote/services.coffee index a269db0d..96ab908b 100644 --- a/src/remote/services.coffee +++ b/src/remote/services.coffee @@ -52,4 +52,5 @@ define ['underscore', 'xdm'], (_, xdm)-> app.sandbox.on 'remote.settings.update', rpc.settingsUpdate.bind(rpc) app.sandbox.on 'remote.iframe.show', -> rpc.show() app.sandbox.on 'remote.iframe.hide', -> rpc.hide() + $('html').on 'click', (e)-> rpc.hide() From a4a5b583e31aae1a32e7e1034b62b220329034aa Mon Sep 17 00:00:00 2001 From: Stephane Bellity Date: Tue, 20 May 2014 16:16:16 +0200 Subject: [PATCH 11/39] Don't fail to list comments if a user is null --- aura_components/comments/list/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aura_components/comments/list/main.js b/aura_components/comments/list/main.js index f2ceb5e1..a5bc1ed3 100644 --- a/aura_components/comments/list/main.js +++ b/aura_components/comments/list/main.js @@ -68,7 +68,7 @@ Hull.component({ beforeRender: function(data) { this.sandbox.util._.each(data.comments, function(c) { - c.isDeletable = (c.user.id === data.me.id); + c.isDeletable = (c.user && c.user.id === data.me.id); return c; }, this); return data; From 8fa103453854552bcdd1a721de000743584441b1 Mon Sep 17 00:00:00 2001 From: Stephane Bellity Date: Tue, 20 May 2014 16:16:48 +0200 Subject: [PATCH 12/39] ignore local app/*html files --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 082c2a1c..79a92621 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ app/app.js /build /local_components /grunt-aws.json +app/*html \ No newline at end of file From e81ae9148bff8fe8c58c4c536295b1e14d9125e2 Mon Sep 17 00:00:00 2001 From: Stephane Bellity Date: Tue, 20 May 2014 16:25:13 +0200 Subject: [PATCH 13/39] Don't run karma test in dev mode --- Gruntfile.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Gruntfile.js b/Gruntfile.js index 6f5ca99f..6ab06083 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -257,8 +257,14 @@ module.exports = function (grunt) { helpers.appendAWSConfig(gruntConfig); helpers.cloudFrontConfig(gruntConfig); grunt.initConfig(gruntConfig); + + if (grunt.option('dev')) { + grunt.registerTask('test', ['version']); + } else { + grunt.registerTask('test', ['version', 'karma:test']); + } - grunt.registerTask('test', ['version', 'karma:test']); + grunt.registerTask('test', ['version']); grunt.registerTask('reset', ['clean:reset']); //These tasks are the only ones needed to be used From 767e65f6473fa2f33080f0f959663c0852aa9351 Mon Sep 17 00:00:00 2001 From: Stephane Bellity Date: Thu, 22 May 2014 10:49:15 +0200 Subject: [PATCH 14/39] Tracking for fb.ui events --- src/remote/services/facebook.coffee | 25 ++++++++++++++++++++----- src/remote/services/hull.coffee | 6 +++--- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/src/remote/services/facebook.coffee b/src/remote/services/facebook.coffee index 4f6d8202..9613942e 100644 --- a/src/remote/services/facebook.coffee +++ b/src/remote/services/facebook.coffee @@ -4,8 +4,9 @@ define ['lib/utils/promises', 'underscore'], (promises, _) -> showIframe = -> hideIframe = -> - uiHandlers = {} + trackHandler = -> + utils = {} ensureLoggedIn = (base) -> -> @@ -35,10 +36,19 @@ define ['lib/utils/promises', 'underscore'], (promises, _) -> prms.method = path.replace(/^ui\./, '') showIframe() cb = resp(req, callback, errback, true) - uiHandler = uiHandlers[path] + uiHandler = uiHandlers[path] || -> + trackParams = { ui_request_id: utils?.uuid?() || (new Date()).getTime() } + trackHandler({ path: "facebook.#{req.path}.open", params: _.extend({}, req.params, trackParams) }) _.delay -> FB.ui prms, (response)-> - uiHandler(req, response) if _.isFunction(uiHandler) + path = "facebook.#{req.path}." + if response.error_code + path += "error" + else + path += "success" + + trackHandler({ path: "facebook.#{req.path}.error", params: _.extend({}, response, trackParams) }) + uiHandler(req, response) cb(response) , 100 else @@ -75,6 +85,11 @@ define ['lib/utils/promises', 'underscore'], (promises, _) -> opts = { path: 'services/facebook/apprequests', method: 'post', params: res } noop = -> app.core.routeHandlers.hull(opts, noop, noop) - - + + uiHandlers['ui.share'] = (req, res)-> + opts = { path: 'services/facebook/share', method: 'post', params: res } + noop = -> + app.core.routeHandlers.hull(opts, noop, noop) + trackHandler = app.core.routeHandlers.track + utils = app.core.util diff --git a/src/remote/services/hull.coffee b/src/remote/services/hull.coffee index dd2343b0..14b735f2 100644 --- a/src/remote/services/hull.coffee +++ b/src/remote/services/hull.coffee @@ -106,7 +106,7 @@ define ['jquery', 'underscore', '../handler'], ($, _, Handler)-> doTrack(eventName, trackParams) catch error "Invalid Tracking header" - handler.after trackAction + handler.after trackAction trackHandler = (req, callback, errback)-> eventName = req.path @@ -119,9 +119,9 @@ define ['jquery', 'underscore', '../handler'], ($, _, Handler)-> data: req.params promise.then (h)-> h.provider = 't' - callback(h) + callback && callback(h) , (err)-> - errback(err.response) + errback && errback(err.response) return require: From 8595ff096b533d5d721cf220770ce3689b5ccf4c Mon Sep 17 00:00:00 2001 From: Xavier Cambar Date: Thu, 22 May 2014 13:11:06 +0200 Subject: [PATCH 15/39] User changes when logs in with another provider User.login('facebook') (-> User1) then User.login('twitter') (-> User2) is handled --- src/api/api.coffee | 3 +++ src/api/auth.coffee | 4 +++- src/api/xdm.coffee | 10 +++++----- src/remote/current-user.coffee | 2 +- src/remote/services.coffee | 4 +++- 5 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/api/api.coffee b/src/api/api.coffee index 2971f7c4..c1bce63f 100644 --- a/src/api/api.coffee +++ b/src/api/api.coffee @@ -34,6 +34,9 @@ define ['underscore', '../utils/cookies', '../utils/version', '../api/params', ' cookie.remove(cookieName, path: "/") rpc = null + api.clearToken = -> + rpc.clearUserToken() + # This will be executed exactly Once. The next call will be immediately resolved. onRemoteReady = (remoteObj)-> rpc = remoteObj.rpc diff --git a/src/api/auth.coffee b/src/api/auth.coffee index 314767f9..657ae6a9 100644 --- a/src/api/auth.coffee +++ b/src/api/auth.coffee @@ -30,7 +30,9 @@ define ['underscore', '../utils/promises', '../utils/version'], (_, promises, ve if _.isString(optionsOrPassword) promise = apiFn('users/login', 'post', { login: loginOrProvider, password: optionsOrPassword }) else - promise = loginWithProvider(loginOrProvider, optionsOrPassword).then(-> apiFn('me')) + promise = loginWithProvider(loginOrProvider, optionsOrPassword).then -> + apiFn.clearToken() + apiFn('me') evtPromise = promise.then loginComplete, loginFailed evtPromise.then(callback) if _.isFunction(callback) diff --git a/src/api/xdm.coffee b/src/api/xdm.coffee index ead83a79..3e63e58d 100644 --- a/src/api/xdm.coffee +++ b/src/api/xdm.coffee @@ -38,7 +38,7 @@ define ['domready', 'lib/utils/promises', 'xdm', 'lib/utils/version', 'underscor getClientConfig = -> config - hiddenFrameStyle = + hiddenFrameStyle = top: '-20px' left: '-20px' bottom: 'auto' @@ -90,11 +90,11 @@ define ['domready', 'lib/utils/promises', 'xdm', 'lib/utils/version', 'underscor left: '-20px' overflow: 'hidden' , - remote: message: {}, ready: {} + remote: message: {}, ready: {}, clearUserToken: {} local: - message: onMessage, - ready: readyFn, - userUpdate: userUpdate, + message: onMessage + ready: readyFn + userUpdate: userUpdate settingsUpdate: settingsUpdate getClientConfig: getClientConfig show: showIframe diff --git a/src/remote/current-user.coffee b/src/remote/current-user.coffee index 24d30d66..b3e67e4f 100644 --- a/src/remote/current-user.coffee +++ b/src/remote/current-user.coffee @@ -37,7 +37,7 @@ define ()-> else if userManager.isUserUpdate(h.response) userManager.currentUser = h.response app.sandbox.emit 'remote.user.update', userManager.currentUser - + diff --git a/src/remote/services.coffee b/src/remote/services.coffee index 96ab908b..152a807e 100644 --- a/src/remote/services.coffee +++ b/src/remote/services.coffee @@ -26,12 +26,14 @@ define ['underscore', 'xdm'], (_, xdm)-> else errback(catchAll(req)) + clearUserToken = -> + core.handler.headers['Hull-Access-Token'] = undefined try rpc = new xdm.Rpc({ acl: app.config.appDomains }, { remote: { message: {}, ready: {}, userUpdate: {}, settingsUpdate: {}, getClientConfig: {}, show: {}, hide: {} } - local: { message: onRemoteMessage } + local: { message: onRemoteMessage, clearUserToken: clearUserToken } }) rpc.getClientConfig (cfg)-> core.clientConfig = cfg From 2f19e306d99335f63d18c09550a016a0361151c0 Mon Sep 17 00:00:00 2001 From: Xavier Cambar Date: Thu, 22 May 2014 15:39:21 +0200 Subject: [PATCH 16/39] Release 0.8.32 --- app/index.html | 6 +----- bower.json | 2 +- package.json | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/app/index.html b/app/index.html index e42e95e6..ca754dcb 100644 --- a/app/index.html +++ b/app/index.html @@ -11,10 +11,6 @@ -
- Hello -
-
+
diff --git a/bower.json b/bower.json index 5d490ddb..70c4c25e 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "hull-js", - "version": "0.8.30", + "version": "0.8.32", "main": "./lib/hull.js", "dependencies": { "jquery": "1.10.*", diff --git a/package.json b/package.json index bdc58061..2c1474f3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hull-js", - "version": "0.8.30", + "version": "0.8.32", "devDependencies": { "grunt": "~0.4.1", "grunt-s3": "0.2.0-alpha", From 9d09009211f1a84f399be7c12aa621268b0937e9 Mon Sep 17 00:00:00 2001 From: Jimmy Oliger Date: Fri, 23 May 2014 17:44:18 +0200 Subject: [PATCH 17/39] [Shopify] Add message for diabled_customer error --- aura_components/login/shopify/main.js | 1 + 1 file changed, 1 insertion(+) diff --git a/aura_components/login/shopify/main.js b/aura_components/login/shopify/main.js index d9e02b01..3f3e9c27 100644 --- a/aura_components/login/shopify/main.js +++ b/aura_components/login/shopify/main.js @@ -14,6 +14,7 @@ Hull.component({ authFailedMessage: 'You did not fully authorize or "{{provider}}" app is not well configured.', windowClosedMessage: 'Authorization window has been closed.', customerExistsMessage: '"{{email}}" is already associated with an account... Please log in with your password. If you have forgotten your password, you can reset your password here.', + disabledCustomerMessage: 'An email has been sent to {{email}}, please click the link included to verify your email address.', fallbackMessage: 'Bummer, something went wrong during authentication.' }, From a3680f048ec42b6a041a9b04d4b2717e4bd2d0bc Mon Sep 17 00:00:00 2001 From: Xavier Cambar Date: Mon, 26 May 2014 19:33:27 +0200 Subject: [PATCH 18/39] Chaining events for login --- src/api/auth.coffee | 11 +++++++---- src/remote/services.coffee | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/api/auth.coffee b/src/api/auth.coffee index 657ae6a9..e901c97b 100644 --- a/src/api/auth.coffee +++ b/src/api/auth.coffee @@ -10,9 +10,10 @@ define ['underscore', '../utils/promises', '../utils/version'], (_, promises, ve _popupInterval = null loginComplete = (me)-> - emitter.emit('hull.auth.login', me) - unless me?.stats?.sign_in_count? - emitter.emit('hull.auth.create', me) + emitter.once 'hull.settings.update', -> + emitter.emit('hull.auth.login', me) + unless me?.stats?.sign_in_count? + emitter.emit('hull.auth.create', me) me loginFailed = (err)-> @@ -28,7 +29,9 @@ define ['underscore', '../utils/promises', '../utils/version'], (_, promises, ve throw new TypeError("'loginOrProvider' must be a String") unless _.isString(loginOrProvider) if _.isString(optionsOrPassword) - promise = apiFn('users/login', 'post', { login: loginOrProvider, password: optionsOrPassword }) + promise = apiFn('users/login', 'post', { login: loginOrProvider, password: optionsOrPassword }).then -> + apiFn.clearToken() + apiFn('me') else promise = loginWithProvider(loginOrProvider, optionsOrPassword).then -> apiFn.clearToken() diff --git a/src/remote/services.coffee b/src/remote/services.coffee index 152a807e..1b21fa30 100644 --- a/src/remote/services.coffee +++ b/src/remote/services.coffee @@ -13,7 +13,7 @@ define ['underscore', 'xdm'], (_, xdm)-> throw new Error("Path not recognized #{JSON.stringify(req)}") unless req.path handler = core.routeHandlers[req.provider] - + if _.isFunction handler handler(req, callback, errback) else From 5da3e0b905bd5ad6a791d48e8dc1dfe263aecbab Mon Sep 17 00:00:00 2001 From: Xavier Cambar Date: Tue, 27 May 2014 15:36:49 +0200 Subject: [PATCH 19/39] Adds safety nets in case settings update fails --- src/api/auth.coffee | 14 ++++++++++++-- src/api/current-user.coffee | 5 +---- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/api/auth.coffee b/src/api/auth.coffee index e901c97b..f203b570 100644 --- a/src/api/auth.coffee +++ b/src/api/auth.coffee @@ -10,11 +10,21 @@ define ['underscore', '../utils/promises', '../utils/version'], (_, promises, ve _popupInterval = null loginComplete = (me)-> - emitter.once 'hull.settings.update', -> + dfd = promises.deferred() + promise = dfd.promise + promise.then -> emitter.emit('hull.auth.login', me) unless me?.stats?.sign_in_count? emitter.emit('hull.auth.create', me) - me + , (err)-> + emitter.emit('hull.auth.fail', err) + emitter.once 'hull.settings.update', -> + # user has been set, settings have been update. Yay! + dfd.resolve me + # Setup a delay to launch rejection + rejectable = _.bind(dfd.reject, dfd) + _.delay rejectable, 30000, new Error('Timeout for login') + promise loginFailed = (err)-> emitter.emit('hull.auth.fail', err) diff --git a/src/api/current-user.coffee b/src/api/current-user.coffee index 6fcd10f1..6df758e1 100644 --- a/src/api/current-user.coffee +++ b/src/api/current-user.coffee @@ -6,10 +6,7 @@ define ()-> emitter.on 'hull.auth.login', (me)-> _currentUser = me emitter.on 'hull.auth.update', (me)-> - unless _currentUser?.id - if me.id - emitter.emit 'hull.auth.login', me - else + if _currentUser?.id if _currentUser.id == me.id _currentUser = me else unless me?.id From 677c546ad2fb9b56bf9828e8a552c7156b55bf5a Mon Sep 17 00:00:00 2001 From: Xavier Cambar Date: Wed, 28 May 2014 12:39:57 +0200 Subject: [PATCH 20/39] The test suite has been disabled. Reenabling it. --- Gruntfile.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index d09389c1..6fb8a68e 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -304,19 +304,14 @@ module.exports = function (grunt) { helpers.appendAWSConfig(gruntConfig); helpers.cloudFrontConfig(gruntConfig); grunt.initConfig(gruntConfig); - - if (grunt.option('dev')) { - grunt.registerTask('test', ['version']); - } else { - grunt.registerTask('test', ['version', 'karma:test']); - } - grunt.registerTask('test', ['version']); + grunt.registerTask('test', ['version', 'karma:test']); + grunt.registerTask('reset', ['clean:reset']); //These tasks are the only ones needed to be used grunt.registerTask('default', 'server'); - grunt.registerTask('server', ['connect', 'dist:remote', 'dist:client', 'dist:api', 'dist:widgets', 'watch']); + grunt.registerTask('server', ['connect', 'dist:remote', 'dist:client', 'test', 'dist:api', 'dist:widgets', 'watch']); grunt.registerTask('deploy', ['dist', 's3:prod']); require('./.grunt/customTasks')(grunt); From 426c991e03c0a7f17ef7d4c94272e79c97f99556 Mon Sep 17 00:00:00 2001 From: Xavier Cambar Date: Wed, 28 May 2014 17:47:10 +0200 Subject: [PATCH 21/39] Includes grunt-hull-components into hull.js build system --- Gruntfile.js | 18 ++++++++++-------- app/index.html | 4 +++- package.json | 4 ++-- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 6fb8a68e..7cf55b68 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -12,7 +12,7 @@ module.exports = function (grunt) { grunt.loadNpmTasks('grunt-contrib-symlink'); grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-hull-dox'); - grunt.loadNpmTasks('grunt-hull-widgets'); + grunt.loadNpmTasks('grunt-hull-components'); grunt.loadNpmTasks('grunt-s3'); grunt.loadNpmTasks('grunt-git-describe'); grunt.loadNpmTasks('grunt-wrap'); @@ -249,13 +249,15 @@ module.exports = function (grunt) { template: "define(function () { return '<%= PKG_VERSION %>';});", dest: 'lib/utils/version.js' }, - hull_widgets: { - hull: { + hull_components: { + options: { + optimize: !grunt.option('dev'), + config: {} + }, + all: { src: 'aura_components', - before: [], - dest: 'dist/<%= PKG_VERSION%>', - optimize: !grunt.option('dev') - } + dest: 'dist/<%= PKG_VERSION%>/aura_components' + }, }, describe: { out: 'dist/<%= PKG_VERSION%>/REVISION' @@ -293,7 +295,7 @@ module.exports = function (grunt) { "api": ['version', 'clean:client', 'coffee:api', 'wrap', 'version', 'requirejs:api', 'uglify:api', 'symlink:current'], "client-no-underscore": ['version', 'clean:client', 'coffee:client', 'wrap', 'version', 'requirejs:client-no-underscore'], "client-no-backbone": ['version', 'clean:client', 'coffee:client', 'wrap', 'version', 'requirejs:client-no-backbone'], - "widgets": ["version", "hull_widgets"], + "widgets": ["version", "hull_components:all"], "docs": ['dox'], "describe": ['describe'] } diff --git a/app/index.html b/app/index.html index ca754dcb..832b6266 100644 --- a/app/index.html +++ b/app/index.html @@ -7,10 +7,12 @@ Hull App... - +
+
+
diff --git a/package.json b/package.json index 2c1474f3..09c37ca5 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,6 @@ "grunt-contrib-watch": "0.5.3", "grunt-contrib-symlink": "0.2.0", "grunt-hull-dox": "git://github.com/hull/grunt-hull-dox.git", - "grunt-hull-widgets": "~0.7.0", "bower": "~1.3.1", "grunt-wrap": "~0.2.0", "git-rev": "~0.2.1", @@ -30,7 +29,8 @@ "semver": "~2.2.1", "grunt-bump": "0.0.13", "grunt-invalidate-cloudfront": "~0.1.4", - "grunt-contrib-cssmin": "0.9.0" + "grunt-contrib-cssmin": "0.9.0", + "grunt-hull-components": "~0.1.0" }, "scripts": { "postinstall": "$(npm bin)/bower install", From 31fa3f422a008a078b2fa18043804b717034df9b Mon Sep 17 00:00:00 2001 From: Stephane Bellity Date: Fri, 30 May 2014 10:32:01 +0200 Subject: [PATCH 22/39] Adding purl extension --- src/hull.coffee | 1 + 1 file changed, 1 insertion(+) diff --git a/src/hull.coffee b/src/hull.coffee index cde2a276..873d03c7 100644 --- a/src/hull.coffee +++ b/src/hull.coffee @@ -26,6 +26,7 @@ define ['underscore', 'lib/utils/promises', 'aura/aura', 'lib/utils/handlebars', .use('aura-extensions/hull-helpers') .use('aura-extensions/hull-utils') .use('aura-extensions/aura-form-serialize') + .use('aura-extensions/aura-purl') .use('aura-extensions/aura-component-validate-options') .use('aura-extensions/aura-component-require') .use('aura-extensions/hull-component-normalize-id') From ddcd101a69b016ca27b272ba1ada82f89044a7cc Mon Sep 17 00:00:00 2001 From: Xavier Cambar Date: Tue, 3 Jun 2014 13:26:07 +0200 Subject: [PATCH 23/39] Uses Hull.util = app.sandboxes.create().util when using components --- spec/api/current_user_spec.js | 4 ++-- src/hull.coffee | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/api/current_user_spec.js b/spec/api/current_user_spec.js index 0d24b04c..e3ad62d5 100644 --- a/spec/api/current_user_spec.js +++ b/spec/api/current_user_spec.js @@ -64,10 +64,10 @@ define(['lib/api/current-user'], function (currentUserFn) { this.updateListener({}); expect(this.userFn()).to.be.false; }); - it('should delegate to login if the update has id', function () { + it('should not delegate to login if the update has id', function () { var user = { id: 'yop' }; this.updateListener(user); - this.femit.emit.should.have.been.calledWith('hull.auth.login', user); + this.femit.emit.should.not.have.been.calledWith('hull.auth.login', user); }); }); describe('when there is a current user', function () { diff --git a/src/hull.coffee b/src/hull.coffee index 873d03c7..c319414c 100644 --- a/src/hull.coffee +++ b/src/hull.coffee @@ -58,7 +58,7 @@ define ['underscore', 'lib/utils/promises', 'aura/aura', 'lib/utils/handlebars', booted = apiParts.exports return booted unless appParts.components booted.component = componentRegistrar(define) - booted.util.Handlebars = Handlebars + booted.util = appParts.app.sandboxes.create().util booted.define = define booted.parse = (el, options={})-> appParts.app.core.appSandbox.start(el, options) From 25ae7c2de8312f0787a0558924d8bae4b0e2c02b Mon Sep 17 00:00:00 2001 From: Xavier Cambar Date: Tue, 3 Jun 2014 13:32:04 +0200 Subject: [PATCH 24/39] Release 0.8.33 --- app/index.html | 2 +- bower.json | 2 +- package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/index.html b/app/index.html index ca754dcb..5d5b87d0 100644 --- a/app/index.html +++ b/app/index.html @@ -7,7 +7,7 @@ Hull App... - + diff --git a/bower.json b/bower.json index db8e82bc..6b13cbc6 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "hull-js", - "version": "0.8.32", + "version": "0.8.33", "main": "./lib/hull.js", "dependencies": { "jquery": "1.10.*", diff --git a/package.json b/package.json index 2c1474f3..a23a21bd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hull-js", - "version": "0.8.32", + "version": "0.8.33", "devDependencies": { "grunt": "~0.4.1", "grunt-s3": "0.2.0-alpha", From f001a65e10597653a37d232e32d4b478aee5c014 Mon Sep 17 00:00:00 2001 From: Xavier Cambar Date: Tue, 3 Jun 2014 16:30:11 +0200 Subject: [PATCH 25/39] Remove Hull.util.eventEmitter from hull.api.js - Restores Hull.util.Handlebars in Hull with components --- spec/hull_api_spec.js | 1 - src/hull.api.coffee | 1 - src/hull.coffee | 3 ++- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/spec/hull_api_spec.js b/spec/hull_api_spec.js index 1981b166..5786ad82 100644 --- a/spec/hull_api_spec.js +++ b/spec/hull_api_spec.js @@ -90,7 +90,6 @@ define(['squire', 'lib/utils/promises'], function (Squire, promises) { }); it('should expose some utils', function () { this.flavour.util.entity.should.eql(this.entityMock); - this.flavour.util.eventEmitter.should.eql(this.emitterMock); }); it('should expose the config getter method', function () { this.flavour.config.should.be.a('function'); diff --git a/src/hull.api.coffee b/src/hull.api.coffee index 377cabaa..34ca151a 100644 --- a/src/hull.api.coffee +++ b/src/hull.api.coffee @@ -65,7 +65,6 @@ define [ promise util: entity: entity - eventEmitter: _emitter trait: Traits.setup(api.api).build created.api.create = create raw: api diff --git a/src/hull.coffee b/src/hull.coffee index c319414c..1003a627 100644 --- a/src/hull.coffee +++ b/src/hull.coffee @@ -58,7 +58,8 @@ define ['underscore', 'lib/utils/promises', 'aura/aura', 'lib/utils/handlebars', booted = apiParts.exports return booted unless appParts.components booted.component = componentRegistrar(define) - booted.util = appParts.app.sandboxes.create().util + booted.util = appParts.app.sandbox.util + booted.util.Handlebars = Handlebars booted.define = define booted.parse = (el, options={})-> appParts.app.core.appSandbox.start(el, options) From 6afb94acb2a9281ae92cdb35bc463a802fbf8cda Mon Sep 17 00:00:00 2001 From: Xavier Cambar Date: Tue, 3 Jun 2014 17:26:53 +0200 Subject: [PATCH 26/39] Uses internal Handlebars in login/shopify --- aura_components/login/shopify/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aura_components/login/shopify/main.js b/aura_components/login/shopify/main.js index 3f3e9c27..523eba4d 100644 --- a/aura_components/login/shopify/main.js +++ b/aura_components/login/shopify/main.js @@ -152,7 +152,7 @@ Hull.component({ this._templates = this._templates || {}; if (!this._templates[key]) { - this._templates[key] = Hull.util.Handlebars.compile(this.options[key] || this.defaultMessages[key]); + this._templates[key] = this.sandbox.util.Handlebars.compile(this.options[key] || this.defaultMessages[key]); } return this._templates[key](locals); From a74a59be1e7ae09dbee056e0351c67adfb67ce72 Mon Sep 17 00:00:00 2001 From: Xavier Cambar Date: Tue, 3 Jun 2014 17:33:58 +0200 Subject: [PATCH 27/39] Release 0.8.34 --- app/index.html | 1 + bower.json | 2 +- package.json | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/index.html b/app/index.html index 5d5b87d0..8d1d646c 100644 --- a/app/index.html +++ b/app/index.html @@ -12,5 +12,6 @@
+
diff --git a/bower.json b/bower.json index 6b13cbc6..95ed14ca 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "hull-js", - "version": "0.8.33", + "version": "0.8.34", "main": "./lib/hull.js", "dependencies": { "jquery": "1.10.*", diff --git a/package.json b/package.json index a23a21bd..ae90178b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hull-js", - "version": "0.8.33", + "version": "0.8.34", "devDependencies": { "grunt": "~0.4.1", "grunt-s3": "0.2.0-alpha", From 431fff9eaf711bd242fd6d42da6aa2247babd1ea Mon Sep 17 00:00:00 2001 From: Xavier Cambar Date: Wed, 4 Jun 2014 13:38:40 +0200 Subject: [PATCH 28/39] Fixes node modules versions --- package.json | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index ae90178b..b30a8842 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "hull-js", "version": "0.8.34", "devDependencies": { - "grunt": "~0.4.1", + "grunt": "0.4.2", "grunt-s3": "0.2.0-alpha", "grunt-git-describe": "git://github.com/hull/grunt-git-describe.git", "grunt-contrib-clean": "0.4.0", @@ -15,22 +15,23 @@ "grunt-contrib-watch": "0.5.3", "grunt-contrib-symlink": "0.2.0", "grunt-hull-dox": "git://github.com/hull/grunt-hull-dox.git", - "grunt-hull-widgets": "~0.7.0", - "bower": "~1.3.1", - "grunt-wrap": "~0.2.0", - "git-rev": "~0.2.1", - "grunt-contrib-copy": "~0.4.1", - "karma": "~0.10.8", - "karma-mocha": "~0.1.1", + "grunt-hull-widgets": "0.7.0", + "bower": "1.3.1", + "grunt-wrap": "0.2.0", + "git-rev": "0.2.1", + "grunt-contrib-copy": "0.4.1", + "karma": "0.10.9", + "karma-mocha": "0.1.1", "grunt-karma": "~0.6.2", - "karma-coffee-preprocessor": "~0.1.1", + "karma-coffee-preprocessor": "0.1.2", "karma-chai": "0.0.2", "karma-chai-sinon": "0.1.0", "karma-spec-reporter": "0.0.6", - "semver": "~2.2.1", + "semver": "2.2.1", "grunt-bump": "0.0.13", - "grunt-invalidate-cloudfront": "~0.1.4", - "grunt-contrib-cssmin": "0.9.0" + "grunt-invalidate-cloudfront": "0.1.4", + "grunt-contrib-cssmin": "0.9.0", + "mocha": "1.17.1" }, "scripts": { "postinstall": "$(npm bin)/bower install", @@ -40,6 +41,6 @@ "node": "~0.10.0" }, "dependencies": { - "bower": "~1.3.1" + "bower": "1.3.1" } } From 933a8e0c3e300b9630ca8ec80777715c67871aed Mon Sep 17 00:00:00 2001 From: Xavier Cambar Date: Wed, 4 Jun 2014 13:46:28 +0200 Subject: [PATCH 29/39] Updates squire --- bower.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bower.json b/bower.json index 95ed14ca..52cdbb37 100644 --- a/bower.json +++ b/bower.json @@ -25,6 +25,6 @@ "purl" : "2.3.1" }, "devDependencies": { - "squire": "*" + "squire": "0.2.0" } } From 5ae32d3a662f952a1e8b017faacfc26e09b436c3 Mon Sep 17 00:00:00 2001 From: Xavier Cambar Date: Wed, 4 Jun 2014 14:36:45 +0200 Subject: [PATCH 30/39] Correct version of the updated grunt-hull-components --- Gruntfile.js | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 7cf55b68..9b684f79 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -220,9 +220,9 @@ module.exports = function (grunt) { } }, watch: { - widgets: { + components: { files: ['aura_components/**/*'], - tasks: ['dist:widgets', 'cssmin'] + tasks: ['dist:components', 'cssmin'] }, remote: { files: remoteConfig.coffeeFiles, @@ -251,10 +251,10 @@ module.exports = function (grunt) { }, hull_components: { options: { - optimize: !grunt.option('dev'), - config: {} + optimize: !grunt.option('dev') }, - all: { + hull: { + sourceName: "hull", src: 'aura_components', dest: 'dist/<%= PKG_VERSION%>/aura_components' }, @@ -295,7 +295,7 @@ module.exports = function (grunt) { "api": ['version', 'clean:client', 'coffee:api', 'wrap', 'version', 'requirejs:api', 'uglify:api', 'symlink:current'], "client-no-underscore": ['version', 'clean:client', 'coffee:client', 'wrap', 'version', 'requirejs:client-no-underscore'], "client-no-backbone": ['version', 'clean:client', 'coffee:client', 'wrap', 'version', 'requirejs:client-no-backbone'], - "widgets": ["version", "hull_components:all"], + "components": ["version", "hull_components:hull"], "docs": ['dox'], "describe": ['describe'] } @@ -313,7 +313,7 @@ module.exports = function (grunt) { //These tasks are the only ones needed to be used grunt.registerTask('default', 'server'); - grunt.registerTask('server', ['connect', 'dist:remote', 'dist:client', 'test', 'dist:api', 'dist:widgets', 'watch']); + grunt.registerTask('server', ['connect', 'dist:remote', 'dist:client', 'test', 'dist:api', 'dist:components', 'watch']); grunt.registerTask('deploy', ['dist', 's3:prod']); require('./.grunt/customTasks')(grunt); diff --git a/package.json b/package.json index b30a8842..52546c08 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "grunt-contrib-watch": "0.5.3", "grunt-contrib-symlink": "0.2.0", "grunt-hull-dox": "git://github.com/hull/grunt-hull-dox.git", - "grunt-hull-widgets": "0.7.0", + "grunt-hull-components": "0.2.0-beta", "bower": "1.3.1", "grunt-wrap": "0.2.0", "git-rev": "0.2.1", From 7ca9df9dbe5ca6b83a9bab87d10b06a770c436c9 Mon Sep 17 00:00:00 2001 From: Xavier Cambar Date: Wed, 4 Jun 2014 18:05:20 +0200 Subject: [PATCH 31/39] Indicates the provider used to login in hull.auth.login tracking data --- src/api/auth.coffee | 11 +++++++---- src/hull.api.coffee | 5 ++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/api/auth.coffee b/src/api/auth.coffee index f203b570..1bb52d99 100644 --- a/src/api/auth.coffee +++ b/src/api/auth.coffee @@ -9,11 +9,11 @@ define ['underscore', '../utils/promises', '../utils/version'], (_, promises, ve authenticating = null _popupInterval = null - loginComplete = (me)-> + loginComplete = (provider, me)-> dfd = promises.deferred() promise = dfd.promise promise.then -> - emitter.emit('hull.auth.login', me) + emitter.emit('hull.auth.login', me, provider) unless me?.stats?.sign_in_count? emitter.emit('hull.auth.create', me) , (err)-> @@ -31,8 +31,10 @@ define ['underscore', '../utils/promises', '../utils/version'], (_, promises, ve throw err err + emailLoginComplete = _.bind(loginComplete, undefined, 'email') + signup = (user) -> - apiFn('users', 'post', user).then loginComplete, loginFailed + apiFn('users', 'post', user).then emailLoginComplete, loginFailed login = (loginOrProvider, optionsOrPassword, callback) -> @@ -42,12 +44,13 @@ define ['underscore', '../utils/promises', '../utils/version'], (_, promises, ve promise = apiFn('users/login', 'post', { login: loginOrProvider, password: optionsOrPassword }).then -> apiFn.clearToken() apiFn('me') + evtPromise = promise.then emailLoginComplete, loginFailed else promise = loginWithProvider(loginOrProvider, optionsOrPassword).then -> apiFn.clearToken() apiFn('me') + evtPromise = promise.then _.bind(loginComplete, undefined, loginOrProvider), loginFailed - evtPromise = promise.then loginComplete, loginFailed evtPromise.then(callback) if _.isFunction(callback) promise diff --git a/src/hull.api.coffee b/src/hull.api.coffee index 34ca151a..a3b4d059 100644 --- a/src/hull.api.coffee +++ b/src/hull.api.coffee @@ -17,10 +17,9 @@ define [ _emitter.on 'hull.auth.create', (me)-> providers = _.pluck me.identities, 'provider' _reporting.track 'hull.auth.create', providers: providers, main_identity: me.main_identity - _emitter.on 'hull.auth.login', (me)-> - #TODO Add the provider used to login + _emitter.on 'hull.auth.login', (me, provider)-> providers = _.pluck me.identities, 'provider' - _reporting.track 'hull.auth.login', providers: providers, main_identity: me.main_identity + _reporting.track 'hull.auth.login', { provider: provider, providers: providers, main_identity: me.main_identity } _emitter.on 'hull.auth.logout', ()-> _reporting.track('hull.auth.logout') noCurentUserDeferred = promises.deferred() From 0281dae528c1cb2e949ebf1e6a2599369ff49937 Mon Sep 17 00:00:00 2001 From: Xavier Cambar Date: Wed, 4 Jun 2014 18:32:42 +0200 Subject: [PATCH 32/39] Fallbacks to main_identity if not available --- src/hull.api.coffee | 1 + 1 file changed, 1 insertion(+) diff --git a/src/hull.api.coffee b/src/hull.api.coffee index a3b4d059..0944c3e9 100644 --- a/src/hull.api.coffee +++ b/src/hull.api.coffee @@ -19,6 +19,7 @@ define [ _reporting.track 'hull.auth.create', providers: providers, main_identity: me.main_identity _emitter.on 'hull.auth.login', (me, provider)-> providers = _.pluck me.identities, 'provider' + provider = provider || me.main_identity _reporting.track 'hull.auth.login', { provider: provider, providers: providers, main_identity: me.main_identity } _emitter.on 'hull.auth.logout', ()-> _reporting.track('hull.auth.logout') From 090cfcd28fa74e9d1ed9985b1780e0a84d95e067 Mon Sep 17 00:00:00 2001 From: Xavier Cambar Date: Mon, 9 Jun 2014 11:58:16 +0200 Subject: [PATCH 33/39] Adds an option to output prettified JSON in the Handlebars helper --- src/utils/handlebars-helpers.coffee | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/utils/handlebars-helpers.coffee b/src/utils/handlebars-helpers.coffee index 423126ab..a4a8bd80 100644 --- a/src/utils/handlebars-helpers.coffee +++ b/src/utils/handlebars-helpers.coffee @@ -18,7 +18,7 @@ define ['underscore', 'moment'], (_, moment)-> * Fallback Helper for falsy values. * * user.picture = undefined - * + * * * => * @@ -104,8 +104,11 @@ define ['underscore', 'moment'], (_, moment)-> * @param {Object} obj Any javascript object * @return {String} A String dump of the object ### - HandlebarsHelpers.json = (obj)-> - JSON.stringify obj + HandlebarsHelpers.json = (obj, pretty)-> + if (pretty) + JSON.stringify obj, null, 2 + else + JSON.stringify obj ###* From 492d472072df2a7e567ba4e93007d3cdfb5373e9 Mon Sep 17 00:00:00 2001 From: Xavier Cambar Date: Wed, 11 Jun 2014 18:35:29 +0200 Subject: [PATCH 34/39] Adds sandbox.currentUser in the components --- src/hull.coffee | 1 + 1 file changed, 1 insertion(+) diff --git a/src/hull.coffee b/src/hull.coffee index 1003a627..6f4ec0c1 100644 --- a/src/hull.coffee +++ b/src/hull.coffee @@ -58,6 +58,7 @@ define ['underscore', 'lib/utils/promises', 'aura/aura', 'lib/utils/handlebars', booted = apiParts.exports return booted unless appParts.components booted.component = componentRegistrar(define) + appParts.app.sandbox.currentUser = apiParts.exports.currentUser booted.util = appParts.app.sandbox.util booted.util.Handlebars = Handlebars booted.define = define From ba009ebf0258e9b2661c150d470a5704d5f0574b Mon Sep 17 00:00:00 2001 From: Stephane Bellity Date: Tue, 1 Jul 2014 12:19:22 +0200 Subject: [PATCH 35/39] fix tracking on facebook.ui.* --- src/remote/services/facebook.coffee | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/remote/services/facebook.coffee b/src/remote/services/facebook.coffee index 9613942e..484c25b3 100644 --- a/src/remote/services/facebook.coffee +++ b/src/remote/services/facebook.coffee @@ -41,13 +41,14 @@ define ['lib/utils/promises', 'underscore'], (promises, _) -> trackHandler({ path: "facebook.#{req.path}.open", params: _.extend({}, req.params, trackParams) }) _.delay -> FB.ui prms, (response)-> + path = "facebook.#{req.path}." - if response.error_code + if !response || response.error_code path += "error" else path += "success" - trackHandler({ path: "facebook.#{req.path}.error", params: _.extend({}, response, trackParams) }) + trackHandler({ path: path, params: _.extend({}, response, trackParams) }) uiHandler(req, response) cb(response) , 100 @@ -91,5 +92,7 @@ define ['lib/utils/promises', 'underscore'], (promises, _) -> noop = -> app.core.routeHandlers.hull(opts, noop, noop) + uiHandlers['ui.feed'] = uiHandlers['ui.share'] + trackHandler = app.core.routeHandlers.track utils = app.core.util From d3a2b7940dd77e1357488f715cb6cb52d6aaf0a9 Mon Sep 17 00:00:00 2001 From: Xavier Cambar Date: Tue, 1 Jul 2014 12:22:08 +0200 Subject: [PATCH 36/39] Release 0.8.35 --- bower.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bower.json b/bower.json index 52cdbb37..189a9742 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "hull-js", - "version": "0.8.34", + "version": "0.8.35", "main": "./lib/hull.js", "dependencies": { "jquery": "1.10.*", diff --git a/package.json b/package.json index 52546c08..edf0a121 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hull-js", - "version": "0.8.34", + "version": "0.8.35", "devDependencies": { "grunt": "0.4.2", "grunt-s3": "0.2.0-alpha", From dddda4ab8d9ad0c93f2b417e18187b127a3d679b Mon Sep 17 00:00:00 2001 From: Xavier Cambar Date: Thu, 3 Jul 2014 16:15:03 +0200 Subject: [PATCH 37/39] Exposes promises in the sandbox --- src/hull.coffee | 1 + 1 file changed, 1 insertion(+) diff --git a/src/hull.coffee b/src/hull.coffee index 6f4ec0c1..d5509eee 100644 --- a/src/hull.coffee +++ b/src/hull.coffee @@ -59,6 +59,7 @@ define ['underscore', 'lib/utils/promises', 'aura/aura', 'lib/utils/handlebars', return booted unless appParts.components booted.component = componentRegistrar(define) appParts.app.sandbox.currentUser = apiParts.exports.currentUser + appParts.app.sandbox.promises = promises booted.util = appParts.app.sandbox.util booted.util.Handlebars = Handlebars booted.define = define From c1d44685eaa307194526662984f464ae373ce8a8 Mon Sep 17 00:00:00 2001 From: Jimmy Oliger Date: Fri, 18 Jul 2014 11:33:17 +0200 Subject: [PATCH 38/39] document how to set options to shopify component. --- aura_components/login/shopify/options.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/aura_components/login/shopify/options.md b/aura_components/login/shopify/options.md index bfefc294..58e78df5 100644 --- a/aura_components/login/shopify/options.md +++ b/aura_components/login/shopify/options.md @@ -1,6 +1,18 @@ Shopify Component Options ========================= +You can customize your login buttons by adding options to your snippet. + +```html +
Loading Social Login...
; +``` + +This is the default snippet. Let's say we want to change the 'Sign In with Facebook' to 'Connect with Facebook'. To do that we need to set the `data-sign-in-message` to `Connect with {{provider}}`. + +```html +
Loading Social Login...
; +``` + ## Core ### `data-show-link-identity` From 9dec8de90b33f5c1b562ea9cf08f364d4faf61ba Mon Sep 17 00:00:00 2001 From: Stephane Bellity Date: Tue, 22 Jul 2014 18:33:15 +0200 Subject: [PATCH 39/39] use the appId as the xdm channel --- src/api/xdm.coffee | 1 + 1 file changed, 1 insertion(+) diff --git a/src/api/xdm.coffee b/src/api/xdm.coffee index 3e63e58d..28fbc563 100644 --- a/src/api/xdm.coffee +++ b/src/api/xdm.coffee @@ -78,6 +78,7 @@ define ['domready', 'lib/utils/promises', 'xdm', 'lib/utils/version', 'underscor rpc = new xdm.Rpc remote: buildRemoteUrl config container: document.body + channel: config.appId props: tabIndex: -1 height: "0"