sandipanmandal / lwrte

Automatically exported from code.google.com/p/lwrte
0 stars 0 forks source link

FEATURE REQUEST: External Toolbar #32

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
First I wanted to say great work on your editor, it's really nice,
especially since it doesnt take forever to load like fck.

I want to request an option to have the toolbar and popup windows outside
of the iframe.

Thanks!

Original issue reported on code.google.com by brett.th...@gmail.com on 19 May 2009 at 9:49

GoogleCodeExporter commented 8 years ago
Never had to do this before but I would assume that you would have a button 
outside the iframe like 

<div class="button" id="dostuff" link="myeditor">DO stuff</div>
<textarea id="myeditor" class="rte"></textarea>

and some javascript something like 
<script>
$("div#dostuff").click(function(){
  var ed = $(this).attr("link");
  $("#"+ed).iframe.exec_command(........);
});
</script>

basically you can access and modify the content of an iframe because it is off 
the same domain so you can do alert(iframe.body.innerHTML) to look in an iframe 
 and 

var el = parent.getElementById("dostuff");
el.innerHTML = "stuff done";

to modify the parent window from inside the iframe with javascript.

hope this helps

Original comment by spambot....@googlemail.com on 3 Sep 2010 at 9:10