Revision 3709:c88e69474c34,
716 bytes
checked in by franck <carnet.franck.paul@…>, 7 years ago
(diff) |
use strict and no more linter warnings/errors as far as possible, switch from inline js to separate loaded file
|
Line | |
---|
1 | /*global $ */ |
---|
2 | 'use strict'; |
---|
3 | |
---|
4 | $(function() { |
---|
5 | $('#link-insert-cancel').click(function() { |
---|
6 | window.close(); |
---|
7 | }); |
---|
8 | |
---|
9 | $('#form-entries tr>td.maximal>a').click(function(e) { |
---|
10 | e.preventDefault(); |
---|
11 | var editor_name = window.opener.$.getEditorName(), |
---|
12 | editor = window.opener.CKEDITOR.instances[editor_name], |
---|
13 | link = '', |
---|
14 | selected_text = editor.getSelection().getNative().toString(); |
---|
15 | |
---|
16 | if (editor.mode == 'wysiwyg') { |
---|
17 | link = '<a class="ref-post" href="' + window.opener.$.stripBaseURL($(this).attr('title')) + '">' + selected_text + '</a>'; |
---|
18 | var element = window.opener.CKEDITOR.dom.element.createFromHtml(link); |
---|
19 | editor.insertElement(element); |
---|
20 | } |
---|
21 | window.close(); |
---|
22 | }); |
---|
23 | }); |
---|
Note: See
TracBrowser
for help on using the repository browser.