Dotclear


Ignore:
Timestamp:
09/18/18 20:22:10 (7 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

Use let and const rather than var (ES2015/ES6), use template string where is more efficient

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/dcCKEditor/js/popup_posts.js

    r3709 r3880  
    99  $('#form-entries tr>td.maximal>a').click(function(e) { 
    1010    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(); 
     11    const editor_name = window.opener.$.getEditorName(); 
     12    const editor = window.opener.CKEDITOR.instances[editor_name]; 
     13    let link = ''; 
     14    const selected_text = editor.getSelection().getNative().toString(); 
    1515 
    1616    if (editor.mode == 'wysiwyg') { 
    1717      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); 
     18      const element = window.opener.CKEDITOR.dom.element.createFromHtml(link); 
    1919      editor.insertElement(element); 
    2020    } 
Note: See TracChangeset for help on using the changeset viewer.

Sites map