Closed coderofsalvation closed 9 years ago
nvm, just solved my problem using the following hack:
+ }
+ addText: function(str) {
+ //_line.text = str;
+ //_line.cursor = str.length+1;
+ //self.refresh();
+ _readline.addText(str);
+ self.refresh();
+ }
};
function id(id) {
return "#"+id;
}
$("*").pastableNonInputable();
$("*").on('pasteText', function(ev, data) {
console.dir(data);
shell.addText(data.text);
});
using paste.js
boom! as said its a hack..but it works for me on chrome
Interesting. So addText is just a function added to readline to be able to add text outside of its key event loop?
exactly. Personally I could not find a (public) readline function which does that. (Doesnt mean there isnt any) Pasting text directly to the DOM resulted in readline erasing the paste, to simply redraw the readline buffer.
On Mon, Mar 16, 2015 at 5:07 PM, Arne Claassen notifications@github.com wrote:
Interesting. So addText is just a function added to readline to be able to add text outside of its key event loop?
— Reply to this email directly or view it on GitHub https://github.com/sdether/josh.js/issues/28#issuecomment-81764646.
Yeah, there isn't such a facility, since readline really was just an event processor. I think what you did makes sense and I'll take a look whether i can take that it verbatim, or if there some other things it should do. Haven't looked at the processing loop in a while
I see thank you for your thoughts. Maybe there's a way to decorate readline with a public function without having to edit readline.js . I'll let you know when I discover something new.
On Mon, Mar 16, 2015 at 9:06 PM, Arne Claassen notifications@github.com wrote:
Yeah, there isn't such a facility, since readline really was just an event processor. I think what you did makes sense and I'll take a look whether i can take that it verbatim, or if there some other things it should do. Haven't looked at the processing loop in a while
— Reply to this email directly or view it on GitHub https://github.com/sdether/josh.js/issues/28#issuecomment-81908343.
scenario: in another browsertab I have an url..I select the url, rightclick copy. I try to paste it into josh.js but it doesnt work on chrome 41.0
any ideas?
I tried:
Which got triggered, but I was unsuccesful in getting the data. Googled a bit, and decided to ask here before getting messy with hidden textareas :)