Line | |
---|
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(); |
---|
8 | var editor_name = window.opener.$.getEditorName(), |
---|
9 | editor = window.opener.CKEDITOR.instances[editor_name], |
---|
10 | link = '', |
---|
11 | selected_text = editor.getSelection().getNative().toString(); |
---|
12 | |
---|
13 | if (editor.mode=='wysiwyg') { |
---|
14 | link = '<a class="ref-post" href="'+window.opener.$.stripBaseURL($(this).attr('title'))+'">'+selected_text+'</a>'; |
---|
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.