-
-
Save jackysee/50394 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: "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; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment