jackysee (owner)

Revisions

  • 038e8a Wed Jan 21 19:00:57 -0800 2009
gist: 50394 Download_button fork
public
Public Clone URL: git://gist.github.com/50394.git
Embed All Files: show embed
x #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
CmdUtils.CreateCommand({
  name: "css-insert",
  author: { name: "Jacky", email: "jackysee at gmail"},
  license: "GPL",
  description: "Insert CSS",
  help: "css body{line-height:1.5em;}",
  takes: {"input": noun_arb_text},
  preview: function( pblock, input ) {
    pblock.innerHTML = "Insert CSS rule: " + input.text ;
  },
  execute: function(input) {
    var doc = Application.activeWindow.activeTab.document;
    var tag = doc.createElement("style");
    tag.type = "text/css";
    doc.getElementsByTagName("head")[0].appendChild(tag);
    tag.innerHTML = input.text;
  }
});