EasyUI Forum
March 28, 2024, 09:28:17 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: texteditor copy/paste/cut  (Read 7626 times)
catpaw
Jr. Member
**
Posts: 85


View Profile Email
« 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  Huh

Please some help, thanks
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: June 16, 2017, 04:11:02 AM »

You must select the image totally before pasting to the texteditor component.
Logged
catpaw
Jr. Member
**
Posts: 85


View Profile Email
« Reply #2 on: June 20, 2017, 04:22:56 PM »

I did but does not paste in the area editor

Sad
Logged
catpaw
Jr. Member
**
Posts: 85


View Profile Email
« Reply #3 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
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #4 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);
Logged
catpaw
Jr. Member
**
Posts: 85


View Profile Email
« Reply #5 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  


Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!