Closed GoogleCodeExporter closed 8 years ago
@ Martin
will you kindly post you implementation so I can copy it into the source base?
Original comment by Afro.Sys...@gmail.com
on 16 Dec 2007 at 10:33
This is what works for me. I downloaded version 0.0.3 from code.google.com and
changed it to what is attached.
I use it like this:
// have something like:
<input id="copyHere1" type="text" name="f1" value="" />
<input id="copyHere2" type="text" name="f2" value="" />
// then function
var copyit = function () {
var selObj = window.getSelection();
var text = "";
if (!selObj.isCollapsed) {
text = selObj.toString();
}
$("#" + this.params).val(text);
}
// and bind it like
$.hotkeys.add('Ctrl+1', {params: 'copyHere1'}, copyit);
$.hotkeys.add('Ctrl+2', {params: 'copyHere2'}, copyit);
Original comment by martin.m...@gmail.com
on 16 Dec 2007 at 10:52
Attachments:
Instead of:
$.hotkeys.add('Ctrl+1', {params: 'copyHere1'}, copyit);
do:
$.hotkeys.add('Ctrl+1', {target: 'copyHere1'}, copyit);
params is the parameter name not the member name of the object
Original comment by Afro.Sys...@gmail.com
on 6 Jan 2008 at 9:40
Original issue reported on code.google.com by
martin.m...@gmail.com
on 16 Dec 2007 at 10:05