Created
November 26, 2008 09:20
-
-
Save yoshimov/29333 to your computer and use it in GitHub Desktop.
Paste quoted text and url to current cursor position.
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: "paste-quoted-text-and-url", | |
description: "Paste quoted text and url to current cursor position.", | |
icon: "http://yoshimov.com/favicon.ico", | |
homepage: "http://yoshimov.com", | |
author: { name: "Yoshimov", email: "yoshimov@pobox.com"}, | |
preview: "Paste quoted text and url to current corsor position", | |
execute: function(){ | |
var d = Application.activeWindow.activeTab.document; | |
var st = '"' + d.getSelection() + '" '; | |
var text = st + d.location.href; | |
var opt = {text: text}; | |
CmdUtils.setSelection(text, opt); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment