I'm trying to attach an on paste event in an atto plugin. For this I would like to use the yui gallery library:
YUI({ //Last Gallery Build of this module gallery: 'gallery-2010.08.11-20-39' }).use('gallery-event-pasted', function(Y) { var onPasted = function(evt) { alert('pasted!\n\nwas: "' + evt.prevVal + '"\n\nnow: "' + evt.newVal + '"'); }; // fire when any text is pasted into textfield Y.one('#mytextarea').on('pasted', onPasted); // fire only if pasted text changed field's value Y.one('#mytextarea2').on('pasted', onPasted, null, true); });Unfortunately, I can not get this to work.
https://yuilibrary.com/gallery-archive/gallery/show/event-pasted.html
I want to use the onpaste event similar to:
this.get('host').on('pasted', function (e) {
console.log("pasted!");
}, this);
in the initializer function of the plugin.
Can you please show me a way how to integrate the gallery method correctly!