We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents fd9fe18 + 6b01cd5 commit b2c01dfCopy full SHA for b2c01df
js/plugins/urlHandler.js
@@ -19,9 +19,14 @@
19
function handleQuery(key, val) {
20
Espruino.Core.Code.switchToCode(); // if in blockly
21
switch(key){
22
- case "code":
+ case "code": // Tef edit: when passing "encodedURIcomponent code" within the URL
23
Espruino.Core.EditorJavaScript.setCode(val);
24
break;
25
+ case "codefile": // Tef edit: ADDITION: when passing a file URL within the URL :)
26
+ $.ajax({ url: val, cache: false }).done(function( data ) {
27
+ Espruino.Core.EditorJavaScript.setCode(data);
28
+ });
29
+ break;
30
case "upload":
31
Espruino.Core.MenuPortSelector.ensureConnected(function() {
32
Espruino.Core.Terminal.focus(); // give the terminal focus
@@ -69,4 +74,4 @@
69
74
70
75
handle : handle, // handle a URL
71
76
};
72
-}());
77
+}());
0 commit comments