-
-
Save Dykam/109196 to your computer and use it in GitHub Desktop.
Dykam's best Ubiqs.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CmdUtils.CreateCommand({ | |
name: "execute", | |
icon: "http://example.com/example.png", | |
homepage: "http://Dykam.nl", | |
author: {name: "Dykam", email: "dev@dykam.nl"}, | |
license: "GPL", | |
description: "Execute javascript.", | |
help: "Enter a javascript snippet.", | |
takes: {"code": /.*/}, | |
preview: function(pblock, code) { | |
pblock.innerHTML = "Result:\n" + eval(code.text); | |
}, | |
execute: function(code) { | |
CmdUtils.setSelection(eval(code.text)); | |
} | |
}); | |
CmdUtils.CreateCommand({ | |
name: "execute-ubiq", | |
icon: "http://example.com/example.png", | |
homepage: "http://Dykam.nl", | |
author: {name: "Dykam", email: "dev@dykam.nl"}, | |
license: "GPL", | |
description: "Execute javascript.", | |
help: "Enter a javascript snippet.", | |
takes: {"code": /.*/}, | |
preview: function(pblock, code) { | |
pblock.innerHTML = "Code to execute:\n" + code.text; | |
}, | |
execute: function(input) { | |
eval(code.text); | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment