mirror of
https://github.com/pebble-dev/clay.git
synced 2026-08-31 14:26:45 -04:00
add eslint and clean up code
This commit is contained in:
@@ -2,28 +2,24 @@
|
||||
|
||||
var $ = require('./vendor/minified/minified').$;
|
||||
var _ = require('./vendor/minified/minified')._;
|
||||
var Api = require('./lib/api');
|
||||
var ClayConfig = require('./lib/clay-config');
|
||||
var config = _.extend([], window.clayConfig || []);
|
||||
|
||||
var settings = _.extend({}, window.claySettings || {});
|
||||
var returnTo = window.returnTo || 'pebblejs://close#';
|
||||
var customFn = window.customFn || function() {};
|
||||
|
||||
var api = new Api(settings);
|
||||
var $mainForm = $('#main-form');
|
||||
var clayConfig = new ClayConfig(settings, config, $mainForm);
|
||||
|
||||
function submit(event) {
|
||||
_.each(api.itemsByAppKey, function(appKey, item) {
|
||||
settings[appKey] = item.get();
|
||||
});
|
||||
// Set the return URL depending on the runtime environment
|
||||
location.href = returnTo + encodeURIComponent(JSON.stringify(settings));
|
||||
location.href =
|
||||
returnTo + encodeURIComponent(JSON.stringify(clayConfig.getSettings()));
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}
|
||||
|
||||
api.addItem(config, $mainForm);
|
||||
$mainForm.on('|submit', submit);
|
||||
|
||||
//$mainForm.on('submit', submit);
|
||||
|
||||
customFn.call(api);
|
||||
customFn.call(clayConfig);
|
||||
|
||||
Reference in New Issue
Block a user