Rev | Line | |
---|
[2738] | 1 | $(function() { |
---|
| 2 | $('#link-insert-cancel').click(function() { |
---|
| 3 | window.close(); |
---|
| 4 | }); |
---|
| 5 | |
---|
| 6 | $('#form-entries tr>td.maximal>a').click(function(e) { |
---|
| 7 | e.preventDefault(); |
---|
[2751] | 8 | var editor_name = window.opener.$.getEditorName(), |
---|
[2738] | 9 | editor = window.opener.CKEDITOR.instances[editor_name], |
---|
| 10 | link = '', |
---|
| 11 | selected_text = editor.getSelection().getNative().toString(); |
---|
| 12 | |
---|
| 13 | if (editor.mode=='wysiwyg') { |
---|
[2901] | 14 | link = '<a class="ref-post" href="'+window.opener.$.stripBaseURL($(this).attr('title'))+'">'+selected_text+'</a>'; |
---|
[2738] | 15 | var element = window.opener.CKEDITOR.dom.element.createFromHtml(link); |
---|
| 16 | editor.insertElement(element); |
---|
| 17 | } |
---|
| 18 | window.close(); |
---|
| 19 | }); |
---|
| 20 | }); |
---|
Note: See
TracBrowser
for help on using the repository browser.