-
-
Save achimbode/67576 to your computer and use it in GitHub Desktop.
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: "copytest", | |
icon: "http://vfh30.tfh-berlin.de/4c4m/favicon.ico", | |
homepage: "http://www.achimbo.de/", | |
author: { name: "Achim Bode", email: "achimbode@gmx.net"}, | |
license: "MPL", | |
description: "Wat dat ding macht (desription)", | |
help: "Wie man dat anwendet (how to use your command)", | |
takes: {"input": noun_arb_text}, | |
_copy: function( copytext ) { | |
const gClipboardHelper = Components.classes["@mozilla.org/widget/clipboardhelper;1"]. | |
getService(Components.interfaces.nsIClipboardHelper); | |
gClipboardHelper.copyString("Put me on the clipboard, please."); | |
} | |
preview: function( pblock, input ) { | |
var template = "Hello ${name}"; | |
pblock.innerHTML = CmdUtils.renderTemplate(template, {"name": "World!"}); | |
}, | |
execute: function(input) { | |
this._copy( input.html ); | |
CmdUtils.setSelection("You selected: "+input.html); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment