I have now tried several things, but i need some help.
I have made a new plugin that calls a window like this:
CKEDITOR.plugins.add('specialcode',
{
init: function(editor)
{
var pluginName = 'specialcode';
editor.ui.addButton('specialcode',
{
label: 'specialcode',
command: pluginName,
icon: this.path + 'myplugin.png',
click: function (editor) { window.open('/specialcode.asp','Image Browser','width=900,height=600'); }
});
}
});
This is working fine.
The windows opens and here i have several div tags.
Each div tag contains different HTML code, and when i click a div tag, the content must be put into the editor, but how can i get the content from a div tag insert into the editor with InsertHTML?
It's important that i can get the content form my ASP document because it is generated from a database.
I'm new to CKeditor, but in the Innovastudio editor, i used something like this:
<script>
function insertObject(sHTML)
{
var obj=(opener?opener:openerWin).oUtil.obj;
obj.insertHTML(sHTML);
}
</script>
<div onClick="insertObject(document.getElementById('div1').innerHTML);self.close();">Click to insert form</div>
<div id="div1" style="display:none">This is the content that i insert into the editor</div>
I have made a new plugin that calls a window like this:
CKEDITOR.plugins.add('specialcode',
{
init: function(editor)
{
var pluginName = 'specialcode';
editor.ui.addButton('specialcode',
{
label: 'specialcode',
command: pluginName,
icon: this.path + 'myplugin.png',
click: function (editor) { window.open('/specialcode.asp','Image Browser','width=900,height=600'); }
});
}
});
This is working fine.
The windows opens and here i have several div tags.
Each div tag contains different HTML code, and when i click a div tag, the content must be put into the editor, but how can i get the content from a div tag insert into the editor with InsertHTML?
It's important that i can get the content form my ASP document because it is generated from a database.
I'm new to CKeditor, but in the Innovastudio editor, i used something like this:
<script>
function insertObject(sHTML)
{
var obj=(opener?opener:openerWin).oUtil.obj;
obj.insertHTML(sHTML);
}
</script>
<div onClick="insertObject(document.getElementById('div1').innerHTML);self.close();">Click to insert form</div>
<div id="div1" style="display:none">This is the content that i insert into the editor</div>

Re: Insert html from from window
viewtopic.php?f=11&t=22878
Re: Insert html from from window
http://docs.cksource.com/CKEditor_3.x/Developers_Guide/File_Browser_%28Uploader%29/Custom_File_Browser
Re: Insert html from from window
Re: Insert html from from window
Re: Insert html from from window
Re: Insert html from from window
Re: Insert html from from window
Re: Insert html from from window
Re: Insert html from from window
function insertObject(sHTML) { window.opener.CKEDITOR.instances.__EDITORNAME__.insertHTML(sHTML); }Replace __EDITORNAME__ with ID of your editors textarea.
Re: Insert html from from window
<script language="javascript">
function insertObject(sHTML)
{
window.opener.CKEDITOR.instances.txtContent.insertHTML(sHTML);
}
</script>
<div onClick="insertObject(document.getElementById('div1').innerHTML);self.close();">Click to insert form</div>
<div id="div1" style="display:none">This is the content that i insert into the editor</div>
txtContent is the ID of my editortextarea.
Nothing is insert onclick and firebud reports this:
window.opener.CKEDITOR.instances.txtContent.insertHTML is not a function
Re: Insert html from from window
Re: Insert html from from window
I'm not using frames
My plugin looks like this
CKEDITOR.plugins.add('specialcode',
{
init: function(editor)
{
var pluginName = 'specialcode';
editor.ui.addButton('specialcode',
{
label: 'specialcode',
command: pluginName,
icon: this.path + 'myplugin.png',
click: function (editor) { window.open('/specialcode.asp','Image Browser','width=900,height=600'); }
});
}
});
Re: Insert html from from window
This works, no idea why.
Re: Insert html from from window
Re: Insert html from from window
CKEDITOR.dialog.getCurrent().on("ok", function() { var oEditor = window.opener.CKEDITOR.instances.txtContent; oEditor.insertHtml( sHTML ); var tree = $find("<%= this.SwitchableTreeView.TreeView.ClientID %>"); // Considering single node selection mode. var selectedNode = tree.get_selectedNodes()[0]; if (selectedNode != null) { console.log(selectedNode); <%= INSERT_NODE_FUNCTION_NAME %>(selectedNode); } });http://localhost/INNOMATE/DataUI/ckedit ... e&Id=9:121
Re: Insert html from from window
Re: Insert html from from window
This is only to send data from a popup back to CKEditor. You are using a dialog. A dialog window is simply a draggable div.