| Revision 2751:a96ec5640056,
917 bytes
checked in by Nicolas <nikrou77@…>, 11 years ago
(diff) |
|
Each editor (ckeditor, legacy ones) loads its own context when it is active.
Add plugin_id parameter to transmit that context
Remove call of ckeditorExtraPlugins behavior until a good solution is found.
Closes #1983
|
| Line | |
|---|
| 1 | $(function() { |
|---|
| 2 | $('#link-insert-cancel').click(function() { |
|---|
| 3 | window.close(); |
|---|
| 4 | }); |
|---|
| 5 | |
|---|
| 6 | $('#link-insert-ok').click(function() { |
|---|
| 7 | var insert_form = $('#link-insert-form').get(0); |
|---|
| 8 | if (insert_form == undefined) { |
|---|
| 9 | return; |
|---|
| 10 | } |
|---|
| 11 | |
|---|
| 12 | var editor_name = window.opener.$.getEditorName(), |
|---|
| 13 | editor = window.opener.CKEDITOR.instances[editor_name], |
|---|
| 14 | link = '', |
|---|
| 15 | selected_text = editor.getSelection().getNative().toString(); |
|---|
| 16 | |
|---|
| 17 | if (editor.mode=='wysiwyg') { |
|---|
| 18 | link = '<a href="'+insert_form.elements.href.value+'"'; |
|---|
| 19 | if (insert_form.elements.title.value!='') { |
|---|
| 20 | link += ' title="'+insert_form.elements.title.value+'"'; |
|---|
| 21 | } |
|---|
| 22 | if (insert_form.elements.hreflang.value!='') { |
|---|
| 23 | link += ' hreflang="'+insert_form.elements.hreflang.value+'"'; |
|---|
| 24 | } |
|---|
| 25 | link += '>'+selected_text+'</a>'; |
|---|
| 26 | var element = window.opener.CKEDITOR.dom.element.createFromHtml(link); |
|---|
| 27 | editor.insertElement(element); |
|---|
| 28 | } |
|---|
| 29 | window.close(); |
|---|
| 30 | }); |
|---|
| 31 | }); |
|---|
Note: See
TracBrowser
for help on using the repository browser.