-
Notifications
You must be signed in to change notification settings - Fork 4
/
plugin.html
32 lines (32 loc) · 1.02 KB
/
plugin.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="plugin.js"></script>
<script>
var headers = { name: "Espruino Orion Integration", version: "1.0", description: "Plugin to allow the Espruino Board to be programmed from Orion" };
var provider = new orion.PluginProvider(headers);
var serviceImpl = {
run: function(selected,text) {
console.log("Program -> "+text);
document.cookie = "code="+window.btoa(text);
return selected;
}
};
var serviceProperties = {
name: "Program Espruino",
key: ["r", true, true] // Ctrl+Shift+r
};
provider.registerService("orion.edit.command", serviceImpl, serviceProperties);
provider.connect();
</script>
</head>
<body>
<h1>Espruino Orion Plugin</h1>
<ul>
<li>Add this plugin to Orion</li>
<li>Open https://www.espruino.com/orion in a separate window</li>
<li>Press Ctrl+Shift+R to program Espruino</li>
</ul>
</body>
</html>