Make WordPress Core

Changeset 43579


Ignore:
Timestamp:
08/20/2018 01:33:59 PM (6 years ago)
Author:
azaozz
Message:

Reorder quicktags.js a bit to account for the order of defining vars and functions after [43577].

See #44371.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/js/_enqueues/lib/quicktags.js

    r43577 r43579  
    3636 * Define all former global functions so plugins that hack quicktags.js directly don't cause fatal errors.
    3737 */
    38 window.edAddTag = function(){},
    39 window.edCheckOpenTags = function(){},
    40 window.edCloseAllTags = function(){},
    41 window.edInsertImage = function(){},
    42 window.edInsertLink = function(){},
    43 window.edInsertTag = function(){},
    44 window.edLink = function(){},
    45 window.edQuickLink = function(){},
    46 window.edRemoveTag = function(){},
    47 window.edShowButton = function(){},
    48 window.edShowLinks = function(){},
    49 window.edSpell = function(){},
     38window.edAddTag = function(){};
     39window.edCheckOpenTags = function(){};
     40window.edCloseAllTags = function(){};
     41window.edInsertImage = function(){};
     42window.edInsertLink = function(){};
     43window.edInsertTag = function(){};
     44window.edLink = function(){};
     45window.edQuickLink = function(){};
     46window.edRemoveTag = function(){};
     47window.edShowButton = function(){};
     48window.edShowLinks = function(){};
     49window.edSpell = function(){};
    5050window.edToolbar = function(){};
    51 
    52 /**
    53  * Initialize new instance of the Quicktags editor
    54  */
    55 window.quicktags = function(settings) {
    56     return new QTags(settings);
    57 }
    58 
    59 /**
    60  * Inserts content at the caret in the active editor (textarea)
    61  *
    62  * Added for back compatibility
    63  * @see QTags.insertContent()
    64  */
    65 window.edInsertContent = function(bah, txt) {
    66     return QTags.insertContent(txt);
    67 }
    68 
    69 /**
    70  * Adds a button to all instances of the editor
    71  *
    72  * Added for back compatibility, use QTags.addButton() as it gives more flexibility like type of button, button placement, etc.
    73  * @see QTags.addButton()
    74  */
    75 window.edButton = function(id, display, tagStart, tagEnd, access) {
    76     return QTags.addButton( id, display, tagStart, tagEnd, access, '', -1 );
    77 }
    7851
    7952/* jshint ignore:end */
     
    748721
    749722})();
     723
     724/**
     725 * Initialize new instance of the Quicktags editor
     726 */
     727window.quicktags = function(settings) {
     728    return new window.QTags(settings);
     729};
     730
     731/**
     732 * Inserts content at the caret in the active editor (textarea)
     733 *
     734 * Added for back compatibility
     735 * @see QTags.insertContent()
     736 */
     737window.edInsertContent = function(bah, txt) {
     738    return window.QTags.insertContent(txt);
     739};
     740
     741/**
     742 * Adds a button to all instances of the editor
     743 *
     744 * Added for back compatibility, use QTags.addButton() as it gives more flexibility like type of button, button placement, etc.
     745 * @see QTags.addButton()
     746 */
     747window.edButton = function(id, display, tagStart, tagEnd, access) {
     748    return window.QTags.addButton( id, display, tagStart, tagEnd, access, '', -1 );
     749};
Note: See TracChangeset for help on using the changeset viewer.