Make WordPress Core

Ticket #44371: explicit-globals.patch

File explicit-globals.patch, 21.7 KB (added by omarreiss, 7 years ago)
  • src/js/_enqueues/admin/common.js

    diff --git src/js/_enqueues/admin/common.js src/js/_enqueues/admin/common.js
    index aba2b66..8b19276 100644
     
    11/* @output wp-admin/js/common.js */
    22
    33/* global setUserSetting, ajaxurl, commonL10n, alert, confirm, pagenow */
    4 var showNotice, adminMenu, columns, validateForm, screenMeta;
    54
    65/**
    76 *  Adds common WordPress functionality to the window.
    var showNotice, adminMenu, columns, validateForm, screenMeta; 
    2120 * @since 2.7.0
    2221 * @deprecated 3.3.0
    2322 */
    24 adminMenu = {
     23window.adminMenu = {
    2524        init : function() {},
    2625        fold : function() {},
    2726        restoreMenuState : function() {},
    adminMenu = { 
    3029};
    3130
    3231// Show/hide/save table columns.
    33 columns = {
     32window.columns = {
    3433
    3534        /**
    3635         * Initializes the column toggles in the screen options.
    $document.ready(function(){columns.init();}); 
    156155 *
    157156 * @returns {boolean} Returns true if all required fields are not an empty string.
    158157 */
    159 validateForm = function( form ) {
     158window.validateForm = function( form ) {
    160159        return !$( form )
    161160                .find( '.form-required' )
    162161                .filter( function() { return $( ':input:visible', this ).val() === ''; } )
    validateForm = function( form ) { 
    176175 *
    177176 * @returns {void}
    178177 */
    179 showNotice = {
     178window.showNotice = {
    180179
    181180        /**
    182181         * Shows a delete confirmation pop-up message.
    showNotice = { 
    217216 *
    218217 * @returns {void}
    219218 */
    220 screenMeta = {
     219window.screenMeta = {
    221220        element: null, // #screen-meta
    222221        toggles: null, // .screen-meta-toggle
    223222        page:    null, // #wpcontent
  • src/js/_enqueues/admin/edit-comments.js

    diff --git src/js/_enqueues/admin/edit-comments.js src/js/_enqueues/admin/edit-comments.js
    index e2371a2..b7e7ffd 100644
     
    11/* @output wp-admin/js/edit-comments.js */
    22
    33/* global adminCommentsL10n, thousandsSeparator, list_args, QTags, ajaxurl, wpAjax */
    4 var setCommentsList, theList, theExtraList, commentReply;
    54
    65(function($) {
    76var getCount, updateCount, updateCountText, updatePending, updateApproved,
    var getCount, updateCount, updateCountText, updatePending, updateApproved, 
    186185                });
    187186        };
    188187
    189 setCommentsList = function() {
     188window.setCommentsList = function() {
    190189        var totalInput, perPageInput, pageInput, dimAfter, delBefore, updateTotalCount, delAfter, refillTheExtraList, diff,
    191190                lastConfidentTime = 0;
    192191
    setCommentsList = function() { 
    562561                });
    563562        };
    564563
    565         theExtraList = $('#the-extra-comment-list').wpList( { alt: '', delColor: 'none', addColor: 'none' } );
    566         theList = $('#the-comment-list').wpList( { alt: '', delBefore: delBefore, dimAfter: dimAfter, delAfter: delAfter, addColor: 'none' } )
     564        window.theExtraList = $('#the-extra-comment-list').wpList( { alt: '', delColor: 'none', addColor: 'none' } );
     565        window.theList = $('#the-comment-list').wpList( { alt: '', delBefore: delBefore, dimAfter: dimAfter, delAfter: delAfter, addColor: 'none' } )
    567566                .bind('wpListDelEnd', function(e, s){
    568567                        var wpListsData = $(s.target).attr('data-wp-lists'), id = s.element.replace(/[^0-9]+/g, '');
    569568
    setCommentsList = function() { 
    572571                });
    573572};
    574573
    575 commentReply = {
     574window.commentReply = {
    576575        cid : '',
    577576        act : '',
    578577        originalContent : '',
  • src/js/_enqueues/admin/inline-edit-post.js

    diff --git src/js/_enqueues/admin/inline-edit-post.js src/js/_enqueues/admin/inline-edit-post.js
    index 8bc7d37..2c0c2d7 100644
    window.wp = window.wp || {}; 
    2222 * @property {string} what The prefix before the post id.
    2323 *
    2424 */
    25 var inlineEditPost;
    2625( function( $, wp ) {
    2726
    28         inlineEditPost = {
     27        window.inlineEditPost = {
    2928
    3029        /**
    3130         * Initializes the inline and bulk post editor.
  • src/js/_enqueues/admin/inline-edit-tax.js

    diff --git src/js/_enqueues/admin/inline-edit-tax.js src/js/_enqueues/admin/inline-edit-tax.js
    index d589135..882ac3f 100644
    window.wp = window.wp || {}; 
    1717 * @property {string} what The type property with a hash prefixed and a dash
    1818 *                         suffixed.
    1919 */
    20 var inlineEditTax;
    21 
    2220( function( $, wp ) {
    2321
    24 inlineEditTax = {
     22window.inlineEditTax = {
    2523
    2624        /**
    2725         * Initializes the inline taxonomy editor by adding event handlers to be able to
  • src/js/_enqueues/admin/media-upload.js

    diff --git src/js/_enqueues/admin/media-upload.js src/js/_enqueues/admin/media-upload.js
    index 136b0e4..154f1a1 100644
     
    1414
    1515/* global tinymce, QTags */
    1616
    17 var wpActiveEditor, send_to_editor;
    18 
    1917/**
    2018 * Sends the HTML passed in the parameters to TinyMCE.
    2119 *
    var wpActiveEditor, send_to_editor; 
    2826 *                         are unavailable. This means that the HTML was not
    2927 *                         sent to the editor.
    3028 */
    31 send_to_editor = function( html ) {
     29window.send_to_editor = function( html ) {
    3230        var editor,
    3331                hasTinymce = typeof tinymce !== 'undefined',
    3432                hasQuicktags = typeof QTags !== 'undefined';
    send_to_editor = function( html ) { 
    3735        if ( ! wpActiveEditor ) {
    3836                if ( hasTinymce && tinymce.activeEditor ) {
    3937                        editor = tinymce.activeEditor;
    40                         wpActiveEditor = editor.id;
     38                        window.wpActiveEditor = editor.id;
    4139                } else if ( ! hasQuicktags ) {
    4240                        return false;
    4341                }
  • src/js/_enqueues/admin/media.js

    diff --git src/js/_enqueues/admin/media.js src/js/_enqueues/admin/media.js
    index 68a9b75..fde4795 100644
     
    1212
    1313/* global ajaxurl, attachMediaBoxL10n, _wpMediaGridSettings, showNotice */
    1414
    15 var findPosts;
    16 
    1715( function( $ ){
    18         findPosts = {
     16        window.findPosts = {
    1917                /**
    2018                 * Opens a dialog to attach media to a post.
    2119                 *
  • src/js/_enqueues/admin/plugin-install.js

    diff --git src/js/_enqueues/admin/plugin-install.js src/js/_enqueues/admin/plugin-install.js
    index 1a2cf17..230dc6e 100644
     
    55 */
    66
    77/* global plugininstallL10n, tb_click, tb_remove */
    8 var tb_position;
     8
    99jQuery( document ).ready( function( $ ) {
    1010
    1111        var tbWindow,
    jQuery( document ).ready( function( $ ) { 
    1818                $wrap = $ ( '.wrap' ),
    1919                $body = $( document.body );
    2020
    21         tb_position = function() {
     21        window.tb_position = function() {
    2222                var width = $( window ).width(),
    2323                        H = $( window ).height() - ( ( 792 < width ) ? 60 : 20 ),
    2424                        W = ( 792 < width ) ? 772 : width - 20;
  • src/js/_enqueues/admin/post.js

    diff --git src/js/_enqueues/admin/post.js src/js/_enqueues/admin/post.js
    index 18f6907..ae61de2 100644
     
    77 /* global postL10n, ajaxurl, wpAjax, setPostThumbnailL10n, postboxes, pagenow, tinymce, alert, deleteUserSetting */
    88 /* global theList:true, theExtraList:true, getUserSetting, setUserSetting, commentReply */
    99
    10 var commentsBox, WPSetThumbnailHTML, WPSetThumbnailID, WPRemoveThumbnail, wptitlehint, makeSlugeditClickable, editPermalink;
    1110// Backwards compatibility: prevent fatal errors.
    12 makeSlugeditClickable = editPermalink = function(){};
     11window.makeSlugeditClickable = window.editPermalink = function(){};
    1312
    1413// Make sure the wp object exists.
    1514window.wp = window.wp || {};
    window.wp = window.wp || {}; 
    2423         *
    2524         * @namespace commentsBox
    2625         */
    27         commentsBox = {
     26        window.commentsBox = {
    2827                // Comment offset to use when fetching new comments.
    2928                st : 0,
    3029
    window.wp = window.wp || {}; 
    108107         *
    109108         * @global
    110109         */
    111         WPSetThumbnailHTML = function(html){
     110        window.WPSetThumbnailHTML = function(html){
    112111                $('.inside', '#postimagediv').html(html);
    113112        };
    114113
    window.wp = window.wp || {}; 
    119118         *
    120119         * @global
    121120         */
    122         WPSetThumbnailID = function(id){
     121        window.WPSetThumbnailID = function(id){
    123122                var field = $('input[value="_thumbnail_id"]', '#list-table');
    124123                if ( field.length > 0 ) {
    125124                        $('#meta\\[' + field.attr('id').match(/[0-9]+/) + '\\]\\[value\\]').text(id);
    window.wp = window.wp || {}; 
    133132         *
    134133         * @global
    135134         */
    136         WPRemoveThumbnail = function(nonce){
     135        window.WPRemoveThumbnail = function(nonce){
    137136                $.post(ajaxurl, {
    138137                        action: 'set-post-thumbnail', post_id: $( '#post_ID' ).val(), thumbnail_id: -1, _ajax_nonce: nonce, cookie: encodeURIComponent( document.cookie )
    139138                },
    jQuery(document).ready( function($) { 
    941940         *
    942941         * @returns void
    943942         */
    944         function editPermalink() {
     943        window.editPermalink = function() {
    945944                var i, slug_value,
    946945                        $el, revert_e,
    947946                        c = 0,
    jQuery(document).ready( function($) { 
    10481047         *
    10491048         * @returns void
    10501049         */
    1051         wptitlehint = function(id) {
     1050        window.wptitlehint = function(id) {
    10521051                id = id || 'title';
    10531052
    10541053                var title = $('#' + id), titleprompt = $('#' + id + '-prompt-text');
  • src/js/_enqueues/admin/postbox.js

    diff --git src/js/_enqueues/admin/postbox.js src/js/_enqueues/admin/postbox.js
    index 265da9f..914ee75 100644
     
    99
    1010/* global ajaxurl, postBoxL10n */
    1111
    12 /**
    13  * This object contains all function to handle the behaviour of the post boxes. The post boxes are the boxes you see
    14  * around the content on the edit page.
    15  *
    16  * @since 2.7.0
    17  *
    18  * @namespace postboxes
    19  *
    20  * @type {Object}
    21  */
    22 var postboxes;
    23 
    2412(function($) {
    2513        var $document = $( document );
    2614
    27         postboxes = {
     15        /**
     16         * This object contains all function to handle the behaviour of the post boxes. The post boxes are the boxes you see
     17         * around the content on the edit page.
     18         *
     19         * @since 2.7.0
     20         *
     21         * @namespace postboxes
     22         *
     23         * @type {Object}
     24         */
     25        window.postboxes = {
    2826
    2927                /**
    3028                 * Handles a click on either the postbox heading or the postbox open/close icon.
  • src/js/_enqueues/admin/tags-box.js

    diff --git src/js/_enqueues/admin/tags-box.js src/js/_enqueues/admin/tags-box.js
    index 982af4e..629816b 100644
     
    33/* jshint curly: false, eqeqeq: false */
    44/* global ajaxurl */
    55
    6 var tagBox, array_unique_noempty;
    7 
    86( function( $ ) {
    97        var tagDelimiter = ( window.tagsSuggestL10n && window.tagsSuggestL10n.tagDelimiter ) || ',';
    108
    var tagBox, array_unique_noempty; 
    2220         *
    2321         * @return {Array} A new array containing only the unique items.
    2422         */
    25         array_unique_noempty = function( array ) {
     23        window.array_unique_noempty = function( array ) {
    2624                var out = [];
    2725
    2826                // Trim the values and ensure they are unique.
    var tagBox, array_unique_noempty; 
    4745         *
    4846         * @global
    4947         */
    50         tagBox = {
     48        window.tagBox = {
    5149                /**
    5250                 * Cleans up tags by removing redundant characters.
    5351                 *
  • src/js/_enqueues/admin/widgets.js

    diff --git src/js/_enqueues/admin/widgets.js src/js/_enqueues/admin/widgets.js
    index 75ac338..fcbc7c7 100644
     
    11/* @output wp-admin/js/widgets.js */
    22
    33/* global ajaxurl, isRtl */
    4 var wpWidgets;
     4
    55(function($) {
    66        var $document = $( document );
    77
    8 wpWidgets = {
     8window.wpWidgets = {
    99        /**
    1010         * A closed Sidebar that gets a Widget dragged over it.
    1111         *
  • src/js/_enqueues/lib/ajax-response.js

    diff --git src/js/_enqueues/lib/ajax-response.js src/js/_enqueues/lib/ajax-response.js
    index 3a8199d..7feab3b 100644
     
    11/* @output wp-includes/js/wp-ajax-response.js */
    22
    3 var wpAjax = jQuery.extend( {
     3window.wpAjax = jQuery.extend( {
    44        unserialize: function( s ) {
    55                var r = {}, q, pp, i, p;
    66                if ( !s ) { return r; }
  • src/js/_enqueues/lib/comment-reply.js

    diff --git src/js/_enqueues/lib/comment-reply.js src/js/_enqueues/lib/comment-reply.js
    index fde5f51..0c09560 100644
     
    88 *
    99 * @type {Object}
    1010 */
    11 var addComment;
    12 addComment = ( function( window ) {
     11window.addComment = ( function( window ) {
    1312        // Avoid scope lookups on commonly used variables.
    1413        var document = window.document;
    1514
  • src/js/_enqueues/lib/cookies.js

    diff --git src/js/_enqueues/lib/cookies.js src/js/_enqueues/lib/cookies.js
    index eda46b7..b67ea24 100644
     
    77/* global userSettings */
    88/* exported getUserSetting, setUserSetting, deleteUserSetting */
    99
    10 var wpCookies = {
     10window.wpCookies = {
    1111// The following functions are from Cookie.js class in TinyMCE 3, Moxiecode, used under LGPL.
    1212
    1313        each: function( obj, cb, scope ) {
    var wpCookies = { 
    139139};
    140140
    141141// Returns the value as string. Second arg or empty string is returned when value is not set.
    142 function getUserSetting( name, def ) {
     142window.getUserSetting = function( name, def ) {
    143143        var settings = getAllUserSettings();
    144144
    145145        if ( settings.hasOwnProperty( name ) ) {
    function getUserSetting( name, def ) { 
    156156// Both name and value must be only ASCII letters, numbers or underscore
    157157// and the shorter, the better (cookies can store maximum 4KB). Not suitable to store text.
    158158// The value is converted and stored as string.
    159 function setUserSetting( name, value, _del ) {
     159window.setUserSetting = function( name, value, _del ) {
    160160        if ( 'object' !== typeof userSettings ) {
    161161                return false;
    162162        }
    function setUserSetting( name, value, _del ) { 
    188188        return name;
    189189}
    190190
    191 function deleteUserSetting( name ) {
     191window.deleteUserSetting = function( name ) {
    192192        return setUserSetting( name, '', 1 );
    193193}
    194194
    195195// Returns all settings as js object.
    196 function getAllUserSettings() {
     196window.getAllUserSettings = function() {
    197197        if ( 'object' !== typeof userSettings ) {
    198198                return {};
    199199        }
  • src/js/_enqueues/lib/gallery.js

    diff --git src/js/_enqueues/lib/gallery.js src/js/_enqueues/lib/gallery.js
    index 9a3453a..b572f9d 100644
    jQuery(document).ready(function($) { 
    8989jQuery(window).unload( function () { tinymce = tinyMCE = wpgallery = null; } ); // Cleanup
    9090
    9191/* gallery settings */
    92 var tinymce = null, tinyMCE, wpgallery;
     92window.tinymce = null;
    9393
    94 wpgallery = {
     94window.wpgallery = {
    9595        mcemode : false,
    9696        editor : {},
    9797        dom : {},
    wpgallery = { 
    121121                }
    122122
    123123                // Find window & API
    124                 tinymce = w.tinymce;
    125                 tinyMCE = w.tinyMCE;
     124                window.tinymce = w.tinymce;
     125                window.tinyMCE = w.tinyMCE;
    126126                t.editor = tinymce.EditorManager.activeEditor;
    127127
    128128                t.setup();
  • src/js/_enqueues/lib/link.js

    diff --git src/js/_enqueues/lib/link.js src/js/_enqueues/lib/link.js
    index c4dd8e8..a5ad064 100644
     
    11/* @output wp-includes/js/wplink.js */
    22
    3 var wpLink;
    4 
    53( function( $, wpLinkL10n, wp ) {
    64        var editor, searchTimer, River, Query, correctedURL, linkNode,
    75                emailRegexp = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,63}$/i,
    var wpLink; 
    1412                return linkNode || editor.dom.getParent( editor.selection.getNode(), 'a[href]' );
    1513        }
    1614
    17         wpLink = {
     15        window.wpLink = {
    1816                timeToTriggerRiver: 150,
    1917                minRiverAJAXDuration: 200,
    2018                riverBottomThreshold: 5,
  • src/js/_enqueues/lib/nav-menu.js

    diff --git src/js/_enqueues/lib/nav-menu.js src/js/_enqueues/lib/nav-menu.js
    index bccddc8..b22c45a 100644
     
    1111
    1212/* global menus, postboxes, columns, isRtl, navMenuL10n, ajaxurl */
    1313
    14 /**
    15  * Contains all the functions to handle WordPress navigation menus administration.
    16  *
    17  * @namespace
    18  */
    19 var wpNavMenu;
    20 
    2114(function($) {
    2215
    2316        var api;
    2417
    25         api = wpNavMenu = {
     18        /**
     19         * Contains all the functions to handle WordPress navigation menus administration.
     20         *
     21         * @namespace wpNavMenu
     22         */
     23        api = window.wpNavMenu = {
    2624
    2725                options : {
    2826                        menuItemDepthPerLevel : 30, // Do not use directly. Use depthToPx and pxToDepth instead.
  • src/js/_enqueues/lib/quicktags.js

    diff --git src/js/_enqueues/lib/quicktags.js src/js/_enqueues/lib/quicktags.js
    index 8906af1..96c4ade 100644
     
    2626
    2727/* global adminpage, wpActiveEditor, quicktagsL10n, wpLink, prompt */
    2828
    29 var QTags, edCanvas,
    30         edButtons = [];
     29window.edButtons = [];
    3130
    3231/* jshint ignore:start */
    3332
    var QTags, edCanvas, 
    3635 *
    3736 * Define all former global functions so plugins that hack quicktags.js directly don't cause fatal errors.
    3837 */
    39 var edAddTag = function(){},
    40 edCheckOpenTags = function(){},
    41 edCloseAllTags = function(){},
    42 edInsertImage = function(){},
    43 edInsertLink = function(){},
    44 edInsertTag = function(){},
    45 edLink = function(){},
    46 edQuickLink = function(){},
    47 edRemoveTag = function(){},
    48 edShowButton = function(){},
    49 edShowLinks = function(){},
    50 edSpell = function(){},
    51 edToolbar = 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(){},
     50window.edToolbar = function(){};
    5251
    5352/**
    5453 * Initialize new instance of the Quicktags editor
    5554 */
    56 function quicktags(settings) {
     55window.quicktags = function(settings) {
    5756        return new QTags(settings);
    5857}
    5958
    function quicktags(settings) { 
    6362 * Added for back compatibility
    6463 * @see QTags.insertContent()
    6564 */
    66 function edInsertContent(bah, txt) {
     65window.edInsertContent = function(bah, txt) {
    6766        return QTags.insertContent(txt);
    6867}
    6968
    function edInsertContent(bah, txt) { 
    7372 * Added for back compatibility, use QTags.addButton() as it gives more flexibility like type of button, button placement, etc.
    7473 * @see QTags.addButton()
    7574 */
    76 function edButton(id, display, tagStart, tagEnd, access) {
     75window.edButton = function(id, display, tagStart, tagEnd, access) {
    7776        return QTags.addButton( id, display, tagStart, tagEnd, access, '', -1 );
    7877}
    7978
    function edButton(id, display, tagStart, tagEnd, access) { 
    156155        })(),
    157156        qt;
    158157
    159         qt = QTags = function(settings) {
     158        qt = window.QTags = function(settings) {
    160159                if ( typeof(settings) === 'string' ) {
    161160                        settings = {id: settings};
    162161                } else if ( typeof(settings) !== 'object' ) {
    function edButton(id, display, tagStart, tagEnd, access) { 
    180179
    181180                if ( id === 'content' && typeof(adminpage) === 'string' && ( adminpage === 'post-new-php' || adminpage === 'post-php' ) ) {
    182181                        // back compat hack :-(
    183                         edCanvas = canvas;
     182                        window.edCanvas = canvas;
    184183                        toolbar_id = 'ed_toolbar';
    185184                } else {
    186185                        toolbar_id = name + '_toolbar';
  • src/js/_enqueues/wp/dashboard.js

    diff --git src/js/_enqueues/wp/dashboard.js src/js/_enqueues/wp/dashboard.js
    index bb1f8c5..e4266ba 100644
     
    11/* @output wp-admin/js/dashboard.js */
    22
    33/* global pagenow, ajaxurl, postboxes, wpActiveEditor:true */
    4 var ajaxWidgets, ajaxPopulateWidgets, quickPressLoad;
    54window.wp = window.wp || {};
    65
    76/**
    jQuery(document).ready( function($) { 
    5958         *
    6059         * @global
    6160         */
    62         ajaxWidgets = ['dashboard_primary'];
     61        window.ajaxWidgets = ['dashboard_primary'];
    6362
    6463        /**
    6564         * Triggers widget updates via AJAX.
    jQuery(document).ready( function($) { 
    7271         *
    7372         * @returns {void}
    7473         */
    75         ajaxPopulateWidgets = function(el) {
     74        window.ajaxPopulateWidgets = function(el) {
    7675                /**
    7776                 * Fetch the latest representation of the widget via Ajax and show it.
    7877                 *
    jQuery(document).ready( function($) { 
    102101                if ( el ) {
    103102                        el = el.toString();
    104103                        // If the element is available as AJAX widget, show it.
    105                         if ( $.inArray(el, ajaxWidgets) !== -1 ) {
     104                        if ( $.inArray(el, window.ajaxWidgets) !== -1 ) {
    106105                                // Show element without any delay.
    107106                                show(0, el);
    108107                        }
    109108                } else {
    110109                        // Walk through all ajaxWidgets, loading them after each other.
    111                         $.each( ajaxWidgets, show );
     110                        $.each( window.ajaxWidgets, show );
    112111                }
    113112        };
    114113
    115114        // Initially populate ajax widgets.
    116         ajaxPopulateWidgets();
     115        window.ajaxPopulateWidgets();
    117116
    118117        // Register ajax widgets as postbox toggles.
    119         postboxes.add_postbox_toggles(pagenow, { pbshow: ajaxPopulateWidgets } );
     118        postboxes.add_postbox_toggles(pagenow, { pbshow: window.ajaxPopulateWidgets } );
    120119
    121120        /**
    122121         * Control the Quick Press (Quick Draft) widget.
    jQuery(document).ready( function($) { 
    127126         *
    128127         * @returns {void}
    129128         */
    130         quickPressLoad = function() {
     129        window.quickPressLoad = function() {
    131130                var act = $('#quickpost-action'), t;
    132131
    133132                // Enable the submit buttons.
    jQuery(document).ready( function($) { 
    147146                                // Replace the form, and prepend the published post.
    148147                                $('#dashboard_quick_press .inside').html( data );
    149148                                $('#quick-press').removeClass('initial-form');
    150                                 quickPressLoad();
     149                                window.quickPressLoad();
    151150                                highlightLatestPost();
    152151
    153152                                // Focus the title to allow for quickly drafting another post.
    jQuery(document).ready( function($) { 
    208207
    209208                autoResizeTextarea();
    210209        };
    211         quickPressLoad();
     210        window.quickPressLoad();
    212211
    213212        // Enable the dragging functionality of the widgets.
    214213        $( '.meta-box-sortables' ).sortable( 'option', 'containment', '#wpwrap' );
  • src/js/_enqueues/wp/password-strength-meter.js

    diff --git src/js/_enqueues/wp/password-strength-meter.js src/js/_enqueues/wp/password-strength-meter.js
    index c9d2078..4ea5fbd 100644
     
    33/* global zxcvbn */
    44window.wp = window.wp || {};
    55
    6 var passwordStrength;
    76(function($){
    87
    98        /**
    var passwordStrength; 
    116115         *
    117116         * @type {wp.passwordStrength.meter}
    118117         */
    119         passwordStrength = wp.passwordStrength.meter;
     118        window.passwordStrength = wp.passwordStrength.meter;
    120119})(jQuery);
  • src/js/_enqueues/wp/theme.js

    diff --git src/js/_enqueues/wp/theme.js src/js/_enqueues/wp/theme.js
    index 3ded786..11837f4 100644
    $( document ).ready(function() { 
    20392039})( jQuery );
    20402040
    20412041// Align theme browser thickbox
    2042 var tb_position;
    20432042jQuery(document).ready( function($) {
    2044         tb_position = function() {
     2043        window.tb_position = function() {
    20452044                var tbWindow = $('#TB_window'),
    20462045                        width = $(window).width(),
    20472046                        H = $(window).height(),