make Clay work with phone apps

This commit is contained in:
Keegan
2016-02-09 17:21:16 -08:00
parent d6caa1527b
commit 41334698bd
38 changed files with 655 additions and 61 deletions
+11 -4
View File
@@ -1,13 +1,20 @@
'use strict';
var $ = require('./vendor/minified/minified').$;
var _ = require('./vendor/minified/minified')._;
var minified = require('./vendor/minified');
var ClayConfig = require('./lib/clay-config');
var config = _.extend([], window.clayConfig || []);
var $ = minified.$;
var _ = minified._;
var config = _.extend([], window.clayConfig || []);
var settings = _.extend({}, window.claySettings || {});
var returnTo = window.returnTo || 'pebblejs://close#';
var customFn = window.customFn || function() {};
var clayComponents = window.clayComponents || {};
_.eachObj(clayComponents, function(key, component) {
ClayConfig.registerComponent(component);
});
var $mainForm = $('#main-form');
var clayConfig = new ClayConfig(settings, config, $mainForm);
@@ -27,7 +34,7 @@ clayConfig.on(clayConfig.EVENTS.AFTER_BUILD, function() {
});
// Run the custom function in the context of the ClayConfig
customFn.call(clayConfig);
customFn.call(clayConfig, minified);
// Now that we have given the dev's custom code to run and attach listeners,
// we build the config