PasteBox Bespin Command Extension

1 view
Skip to first unread message

antimatter15

unread,
Feb 25, 2009, 10:35:14 PM2/25/09
to Bespin Extension Developers
So I was playing around with bespin and made this quick-and-dirty
plugin that opens a window with a textbox with the contents of the
document so you can, say copy and paste it onto another document, or
use it to paste stuff into the document.

{
name: 'pastebox',
takes: [],
preview: 'Creates a new window where you can paste stuff in',
execute: function(self, args) {
var pbw = window.open("", "PasteBox", "width=400,height=300");
pbw.document.open();

pbw.document.write("<h3>Paste Something in this textbox <button
onclick='window.opener.pasteboxfinish(window)'>Paste</button></h3>"+
"<textarea id='tp' style='width: 100%;height: 80%'></
textarea><br>");
pbw.document.close();

pbw.document.getElementById("tp").value =
self.editor.model.getDocument();


window.pasteboxfinish = function(pw){
self.editor.model.insertDocument(pw.document.getElementById
("tp").value);

_commandLine.showInfo("Done! It hopefully worked!");
}
}
}

Dion Almaer

unread,
Feb 26, 2009, 4:24:55 PM2/26/09
to bespi...@googlegroups.com
This is fantastic! Thanks!

Do you mind if we add this to a "Commands" area on the Bespin Wiki?

If you could give us a name/url then we can link back to you :)

antimatter15

unread,
Feb 26, 2009, 9:56:34 PM2/26/09
to Bespin Extension Developers
Ok. My url is http://antimatter15.com/

On Feb 26, 4:24 pm, Dion Almaer <d...@almaer.com> wrote:
> This is fantastic! Thanks!
>
> Do you mind if we add this to a "Commands" area on the Bespin Wiki?
>
> If you could give us a name/url then we can link back to you :)
>

Dion Almaer

unread,
Feb 26, 2009, 10:09:49 PM2/26/09
to bespi...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages