Make WordPress Core

Ticket #44371: explicit-globals.2.patch

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

    diff --git src/js/_enqueues/admin/common.js src/js/_enqueues/admin/common.js
    index 26abce8..e61b824 100644
     
    33 */
    44
    55/* global setUserSetting, ajaxurl, commonL10n, alert, confirm, pagenow */
    6 var showNotice, adminMenu, columns, validateForm, screenMeta;
    76
    87/**
    98 *  Adds common WordPress functionality to the window.
    var showNotice, adminMenu, columns, validateForm, screenMeta; 
    2322 * @since 2.7.0
    2423 * @deprecated 3.3.0
    2524 */
    26 adminMenu = {
     25window.adminMenu = {
    2726        init : function() {},
    2827        fold : function() {},
    2928        restoreMenuState : function() {},
    adminMenu = { 
    3231};
    3332
    3433// Show/hide/save table columns.
    35 columns = {
     34window.columns = {
    3635
    3736        /**
    3837         * Initializes the column toggles in the screen options.
    $document.ready(function(){columns.init();}); 
    158157 *
    159158 * @returns {boolean} Returns true if all required fields are not an empty string.
    160159 */
    161 validateForm = function( form ) {
     160window.validateForm = function( form ) {
    162161        return !$( form )
    163162                .find( '.form-required' )
    164163                .filter( function() { return $( ':input:visible', this ).val() === ''; } )
    validateForm = function( form ) { 
    178177 *
    179178 * @returns {void}
    180179 */
    181 showNotice = {
     180window.showNotice = {
    182181
    183182        /**
    184183         * Shows a delete confirmation pop-up message.
    showNotice = { 
    219218 *
    220219 * @returns {void}
    221220 */
    222 screenMeta = {
     221window.screenMeta = {
    223222        element: null, // #screen-meta
    224223        toggles: null, // .screen-meta-toggle
    225224        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 c928ceb..f41f699 100644
     
    33 */
    44
    55/* global adminCommentsL10n, thousandsSeparator, list_args, QTags, ajaxurl, wpAjax */
    6 var setCommentsList, theList, theExtraList, commentReply;
    76
    87(function($) {
    98var getCount, updateCount, updateCountText, updatePending, updateApproved,
    var getCount, updateCount, updateCountText, updatePending, updateApproved, 
    188187                });
    189188        };
    190189
    191 setCommentsList = function() {
     190window.setCommentsList = function() {
    192191        var totalInput, perPageInput, pageInput, dimAfter, delBefore, updateTotalCount, delAfter, refillTheExtraList, diff,
    193192                lastConfidentTime = 0;
    194193
    setCommentsList = function() { 
    564563                });
    565564        };
    566565
    567         theExtraList = $('#the-extra-comment-list').wpList( { alt: '', delColor: 'none', addColor: 'none' } );
    568         theList = $('#the-comment-list').wpList( { alt: '', delBefore: delBefore, dimAfter: dimAfter, delAfter: delAfter, addColor: 'none' } )
     566        window.theExtraList = $('#the-extra-comment-list').wpList( { alt: '', delColor: 'none', addColor: 'none' } );
     567        window.theList = $('#the-comment-list').wpList( { alt: '', delBefore: delBefore, dimAfter: dimAfter, delAfter: delAfter, addColor: 'none' } )
    569568                .bind('wpListDelEnd', function(e, s){
    570569                        var wpListsData = $(s.target).attr('data-wp-lists'), id = s.element.replace(/[^0-9]+/g, '');
    571570
    setCommentsList = function() { 
    574573                });
    575574};
    576575
    577 commentReply = {
     576window.commentReply = {
    578577        cid : '',
    579578        act : '',
    580579        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..4fd6437 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                }
    send_to_editor = function( html ) { 
    6462        }
    6563};
    6664
    67 var tb_position;
    6865(function($) {
    6966        /**
    7067         * Recalculates and applies the new ThickBox position based on the current
    var tb_position; 
    7774         * @returns {Object[]} Array containing jQuery objects for all the found
    7875         *                     ThickBox anchors.
    7976         */
    80         tb_position = function() {
     77        window.tb_position = function() {
    8178                var tbWindow = $('#TB_window'),
    8279                        width = $(window).width(),
    8380                        H = $(window).height(),
  • 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..3f8ec2d 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($) { 
    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/set-post-thumbnail.js

    diff --git src/js/_enqueues/admin/set-post-thumbnail.js src/js/_enqueues/admin/set-post-thumbnail.js
    index 9df25db..dfeff94 100644
     
    55/* global setPostThumbnailL10n, ajaxurl, post_id, alert */
    66/* exported WPSetAsThumbnail */
    77
    8 function WPSetAsThumbnail( id, nonce ) {
     8window.WPSetAsThumbnail = function( id, nonce ) {
    99        var $link = jQuery('a#wp-post-thumbnail-' + id);
    1010
    1111        $link.text( setPostThumbnailL10n.saving );
  • src/js/_enqueues/admin/tags-box.js

    diff --git src/js/_enqueues/admin/tags-box.js src/js/_enqueues/admin/tags-box.js
    index 49c82fb..8dcf359 100644
     
    55/* jshint curly: false, eqeqeq: false */
    66/* global ajaxurl */
    77
    8 var tagBox, array_unique_noempty;
    9 
    108( function( $ ) {
    119        var tagDelimiter = ( window.tagsSuggestL10n && window.tagsSuggestL10n.tagDelimiter ) || ',';
    1210
    var tagBox, array_unique_noempty; 
    2422         *
    2523         * @return {Array} A new array containing only the unique items.
    2624         */
    27         array_unique_noempty = function( array ) {
     25        window.array_unique_noempty = function( array ) {
    2826                var out = [];
    2927
    3028                // Trim the values and ensure they are unique.
    var tagBox, array_unique_noempty; 
    4947         *
    5048         * @global
    5149         */
    52         tagBox = {
     50        window.tagBox = {
    5351                /**
    5452                 * Cleans up tags by removing redundant characters.
    5553                 *
  • src/js/_enqueues/admin/widgets.js

    diff --git src/js/_enqueues/admin/widgets.js src/js/_enqueues/admin/widgets.js
    index 227890f..ab4c9c9 100644
     
    33 */
    44
    55/* global ajaxurl, isRtl */
    6 var wpWidgets;
     6
    77(function($) {
    88        var $document = $( document );
    99
    10 wpWidgets = {
     10window.wpWidgets = {
    1111        /**
    1212         * A closed Sidebar that gets a Widget dragged over it.
    1313         *
  • src/js/_enqueues/lib/ajax-response.js

    diff --git src/js/_enqueues/lib/ajax-response.js src/js/_enqueues/lib/ajax-response.js
    index 717c1b3..1687d04 100644
     
    22 * @output wp-includes/js/wp-ajax-response.js
    33 */
    44
    5 var wpAjax = jQuery.extend( {
     5window.wpAjax = jQuery.extend( {
    66        unserialize: function( s ) {
    77                var r = {}, q, pp, i, p;
    88                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 c0ba093..a2bafbc 100644
    jQuery(document).ready(function($) { 
    9191jQuery(window).unload( function () { tinymce = tinyMCE = wpgallery = null; } ); // Cleanup
    9292
    9393/* gallery settings */
    94 var tinymce = null, tinyMCE, wpgallery;
     94window.tinymce = null;
    9595
    96 wpgallery = {
     96window.wpgallery = {
    9797        mcemode : false,
    9898        editor : {},
    9999        dom : {},
    wpgallery = { 
    123123                }
    124124
    125125                // Find window & API
    126                 tinymce = w.tinymce;
    127                 tinyMCE = w.tinyMCE;
     126                window.tinymce = w.tinymce;
     127                window.tinyMCE = w.tinyMCE;
    128128                t.editor = tinymce.EditorManager.activeEditor;
    129129
    130130                t.setup();
  • src/js/_enqueues/lib/link.js

    diff --git src/js/_enqueues/lib/link.js src/js/_enqueues/lib/link.js
    index a89bd57..4b10a37 100644
     
    22 * @output wp-includes/js/wplink.js
    33 */
    44
    5 var wpLink;
    6 
    75( function( $, wpLinkL10n, wp ) {
    86        var editor, searchTimer, River, Query, correctedURL, linkNode,
    97                emailRegexp = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,63}$/i,
    var wpLink; 
    1614                return linkNode || editor.dom.getParent( editor.selection.getNode(), 'a[href]' );
    1715        }
    1816
    19         wpLink = {
     17        window.wpLink = {
    2018                timeToTriggerRiver: 150,
    2119                minRiverAJAXDuration: 200,
    2220                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 0719c87..e066a20 100644
     
    33 */
    44
    55/* global pagenow, ajaxurl, postboxes, wpActiveEditor:true */
    6 var ajaxWidgets, ajaxPopulateWidgets, quickPressLoad;
    76window.wp = window.wp || {};
    87
    98/**
    jQuery(document).ready( function($) { 
    6160         *
    6261         * @global
    6362         */
    64         ajaxWidgets = ['dashboard_primary'];
     63        window.ajaxWidgets = ['dashboard_primary'];
    6564
    6665        /**
    6766         * Triggers widget updates via AJAX.
    jQuery(document).ready( function($) { 
    7473         *
    7574         * @returns {void}
    7675         */
    77         ajaxPopulateWidgets = function(el) {
     76        window.ajaxPopulateWidgets = function(el) {
    7877                /**
    7978                 * Fetch the latest representation of the widget via Ajax and show it.
    8079                 *
    jQuery(document).ready( function($) { 
    104103                if ( el ) {
    105104                        el = el.toString();
    106105                        // If the element is available as AJAX widget, show it.
    107                         if ( $.inArray(el, ajaxWidgets) !== -1 ) {
     106                        if ( $.inArray(el, window.ajaxWidgets) !== -1 ) {
    108107                                // Show element without any delay.
    109108                                show(0, el);
    110109                        }
    111110                } else {
    112111                        // Walk through all ajaxWidgets, loading them after each other.
    113                         $.each( ajaxWidgets, show );
     112                        $.each( window.ajaxWidgets, show );
    114113                }
    115114        };
    116115
    117116        // Initially populate ajax widgets.
    118         ajaxPopulateWidgets();
     117        window.ajaxPopulateWidgets();
    119118
    120119        // Register ajax widgets as postbox toggles.
    121         postboxes.add_postbox_toggles(pagenow, { pbshow: ajaxPopulateWidgets } );
     120        postboxes.add_postbox_toggles(pagenow, { pbshow: window.ajaxPopulateWidgets } );
    122121
    123122        /**
    124123         * Control the Quick Press (Quick Draft) widget.
    jQuery(document).ready( function($) { 
    129128         *
    130129         * @returns {void}
    131130         */
    132         quickPressLoad = function() {
     131        window.quickPressLoad = function() {
    133132                var act = $('#quickpost-action'), t;
    134133
    135134                // Enable the submit buttons.
    jQuery(document).ready( function($) { 
    149148                                // Replace the form, and prepend the published post.
    150149                                $('#dashboard_quick_press .inside').html( data );
    151150                                $('#quick-press').removeClass('initial-form');
    152                                 quickPressLoad();
     151                                window.quickPressLoad();
    153152                                highlightLatestPost();
    154153
    155154                                // Focus the title to allow for quickly drafting another post.
    jQuery(document).ready( function($) { 
    210209
    211210                autoResizeTextarea();
    212211        };
    213         quickPressLoad();
     212        window.quickPressLoad();
    214213
    215214        // Enable the dragging functionality of the widgets.
    216215        $( '.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 14ef407..753f697 100644
     
    55/* global zxcvbn */
    66window.wp = window.wp || {};
    77
    8 var passwordStrength;
    98(function($){
    109
    1110        /**
    var passwordStrength; 
    118117         *
    119118         * @type {wp.passwordStrength.meter}
    120119         */
    121         passwordStrength = wp.passwordStrength.meter;
     120        window.passwordStrength = wp.passwordStrength.meter;
    122121})(jQuery);
  • src/js/_enqueues/wp/theme.js

    diff --git src/js/_enqueues/wp/theme.js src/js/_enqueues/wp/theme.js
    index 9eefeb4..8b7d927 100644
    $( document ).ready(function() { 
    20412041})( jQuery );
    20422042
    20432043// Align theme browser thickbox
    2044 var tb_position;
    20452044jQuery(document).ready( function($) {
    2046         tb_position = function() {
     2045        window.tb_position = function() {
    20472046                var tbWindow = $('#TB_window'),
    20482047                        width = $(window).width(),
    20492048                        H = $(window).height(),