mirror of
https://github.com/pebble-dev/clay.git
synced 2026-08-27 20:36:33 -04:00
enable emulator support
This commit is contained in:
@@ -5,21 +5,7 @@ module.exports = function() {
|
||||
/** @type {ClayConfig} */
|
||||
var Clay = window.Clay = this;
|
||||
|
||||
Clay.on(Clay.EVENTS.BEFORE_BUILD, function() {
|
||||
|
||||
// register components here
|
||||
this.registerComponent(require('pebble-clay-components').heading);
|
||||
this.registerComponent(require('pebble-clay-components').text);
|
||||
this.registerComponent(require('pebble-clay-components').footer);
|
||||
this.registerComponent(require('pebble-clay-components').input);
|
||||
this.registerComponent(require('pebble-clay-components').color);
|
||||
this.registerComponent(require('pebble-clay-components').select);
|
||||
this.registerComponent(require('pebble-clay-components').toggle);
|
||||
this.registerComponent(require('pebble-clay-components').submit);
|
||||
});
|
||||
|
||||
Clay.on(Clay.EVENTS.AFTER_BUILD, function() {
|
||||
console.debug('KEEGAN: AFTER_BUILD', this);
|
||||
Clay.getItemByAppKey('cool_stuff').on('change', function() {
|
||||
if (this.get()) {
|
||||
Clay.getItemByAppKey('background').enable();
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Config Page Emulator</title>
|
||||
</head>
|
||||
<script>
|
||||
function getQueryParam(variable, defaultValue) {
|
||||
var query = location.search.substring(1);
|
||||
var vars = query.split('&');
|
||||
for (var i = 0; i < vars.length; i++) {
|
||||
var pair = vars[i].split('=');
|
||||
|
||||
if (pair[0] === variable) {
|
||||
return decodeURIComponent(pair[1]);
|
||||
}
|
||||
}
|
||||
return defaultValue || null;
|
||||
}
|
||||
|
||||
var returnTo = getQueryParam('return_to');
|
||||
var data = decodeURIComponent(location.hash.substring(1));
|
||||
if (data) {
|
||||
data = window.atob(data).replace('$$RETURN_TO$$', returnTo);
|
||||
window.location.href = 'data:text/html;base64,' + encodeURIComponent(window.btoa(data));
|
||||
}
|
||||
</script>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user