Dotclear

source: plugins/dcCKEditor/js/popup_posts.js @ 3705:a37d1b34550a

Revision 3705:a37d1b34550a, 715 bytes checked in by franck <carnet.franck.paul@…>, 7 years ago (diff)

use strict and no more linter warnings/errors

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

Sites map