forked from FOSS/BangleApps
32 lines
981 B
HTML
32 lines
981 B
HTML
<html>
|
|
<head>
|
|
<link rel="stylesheet" href="../../css/spectre.min.css">
|
|
</head>
|
|
<body>
|
|
|
|
<p>Actions: <input type="text" id="subjects" class="form-input" value="Triggers eg. LIGHT,DOOR,..."></p>
|
|
<p>Click <button id="upload" class="btn btn-primary">Upload</button></p>
|
|
|
|
<script src="../../core/lib/customize.js"></script>
|
|
|
|
<script>
|
|
// When the 'upload' button is clicked...
|
|
document.getElementById("upload").addEventListener("click", function() {
|
|
// get the text to add
|
|
var text = document.getElementById("subjects").value;
|
|
console.log(text);
|
|
// build the app's text using a templated String
|
|
var app = text;
|
|
// send finished app (in addition to contents of app.json)
|
|
sendCustomizedApp({
|
|
storage:[
|
|
{name:"ha.trigger.txt", url:"ha.trigger.txt", content:app},
|
|
]
|
|
});
|
|
console.log("Sent ha.trigger.txt!");
|
|
});
|
|
|
|
</script>
|
|
</body>
|
|
</html>
|