EasyUI Forum

General Category => General Discussion => Topic started by: catpaw on June 15, 2017, 04:48:35 PM



Title: texteditor copy/paste/cut
Post by: catpaw on June 15, 2017, 04:48:35 PM
hi all

There's any way to enable paste images into the text editor. Same to the cut and copy functions.

I tried to paste a image print with ctrl+c and ctrl+v and nothing happend in the texteditor  ???

Please some help, thanks


Title: Re: texteditor copy/paste/cut
Post by: stworthy on June 16, 2017, 04:11:02 AM
You must select the image totally before pasting to the texteditor component.


Title: Re: texteditor copy/paste/cut
Post by: catpaw on June 20, 2017, 04:22:56 PM
I did but does not paste in the area editor

:(


Title: Re: texteditor copy/paste/cut
Post by: catpaw on June 22, 2017, 11:59:03 AM
I even have buttons declared for this purpose

Code:
title:'Portapapeles',
tools:[{
name:'paste',
text:'Pegar',
iconCls:'icon-paste-large',
iconAlign:'top',
size:'large',
onClick:function(){
$('#editor').texteditor('getEditor').texteditor('execCommand','paste');
}
},{
type:'toolbar',
dir:'v',
tools:[{
name:'cut',
text:'Cut',
iconCls:'icon-cut',
onClick:function(){
$('#editor').texteditor('getEditor').texteditor('execCommand','cut');
}
},{
name:'copy',
text:'Copy',
iconCls:'icon-copy',
onClick:function(){
$('#editor').texteditor('getEditor').texteditor('execCommand','copy');
}
}]
}]


But it does not work either


Title: Re: texteditor copy/paste/cut
Post by: stworthy on June 23, 2017, 06:34:05 AM
Call the 'queryCommandSupported' method to see if these command is supported in your browser.
Code:
var result = document.queryCommandSupported('copy');
console.log(result);


Title: Re: texteditor copy/paste/cut
Post by: catpaw on June 23, 2017, 08:06:30 AM
hi stworthy

I has putting the validation like

Code:
name:'paste',
text:'Pegar',
iconCls:'icon-paste-large',
iconAlign:'top',
size:'large',
onClick:function(){
$('#editor').texteditor('getEditor').texteditor('execCommand','paste');
var result = document.queryCommandSupported('paste');
console.log(result);
}

the console wrote true but the image was not paste

The scenario was:

I has cutout an image with the windows tool "cutout" and I has clicked copy boton (cutout tool).
then I has clicked "paste" boton (texteditor easyui)
the image was not copied to the area editor (texteditor easyui) and console wrote: true