Make WordPress Core

Ticket #44371: explicit-globals.3.patch

File explicit-globals.3.patch, 24.7 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..00efd85 100644
     
    33 */
    44
    55/* global setUserSetting, ajaxurl, commonL10n, alert, confirm, pagenow */
    6 var showNotice, adminMenu, columns, validateForm, screenMeta;
     6/* global columns, screenMeta */
    77
    88/**
    99 *  Adds common WordPress functionality to the window.
    var showNotice, adminMenu, columns, validateForm, screenMeta; 
    2323 * @since 2.7.0
    2424 * @deprecated 3.3.0
    2525 */
    26 adminMenu = {
     26window.adminMenu = {
    2727        init : function() {},
    2828        fold : function() {},
    2929        restoreMenuState : function() {},
    adminMenu = { 
    3232};
    3333
    3434// Show/hide/save table columns.
    35 columns = {
     35window.columns = {
    3636
    3737        /**
    3838         * Initializes the column toggles in the screen options.
    $document.ready(function(){columns.init();}); 
    158158 *
    159159 * @returns {boolean} Returns true if all required fields are not an empty string.
    160160 */
    161 validateForm = function( form ) {
     161window.validateForm = function( form ) {
    162162        return !$( form )
    163163                .find( '.form-required' )
    164164                .filter( function() { return $( ':input:visible', this ).val() === ''; } )
    validateForm = function( form ) { 
    178178 *
    179179 * @returns {void}
    180180 */
    181 showNotice = {
     181window.showNotice = {
    182182
    183183        /**
    184184         * Shows a delete confirmation pop-up message.
    showNotice = { 
    219219 *
    220220 * @returns {void}
    221221 */
    222 screenMeta = {
     222window.screenMeta = {
    223223        element: null, // #screen-meta
    224224        toggles: null, // .screen-meta-toggle
    225225        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..626a6b6 100644
     
    33 */
    44
    55/* global adminCommentsL10n, thousandsSeparator, list_args, QTags, ajaxurl, wpAjax */
    6 var setCommentsList, theList, theExtraList, commentReply;
     6/* global commentReply, theExtraList, theList, setCommentsList */
    77
    88(function($) {
    99var getCount, updateCount, updateCountText, updatePending, updateApproved,
    var getCount, updateCount, updateCountText, updatePending, updateApproved, 
    188188                });
    189189        };
    190190
    191 setCommentsList = function() {
     191window.setCommentsList = function() {
    192192        var totalInput, perPageInput, pageInput, dimAfter, delBefore, updateTotalCount, delAfter, refillTheExtraList, diff,
    193193                lastConfidentTime = 0;
    194194
    setCommentsList = function() { 
    564564                });
    565565        };
    566566
    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' } )
     567        window.theExtraList = $('#the-extra-comment-list').wpList( { alt: '', delColor: 'none', addColor: 'none' } );
     568        window.theList = $('#the-comment-list').wpList( { alt: '', delBefore: delBefore, dimAfter: dimAfter, delAfter: delAfter, addColor: 'none' } )
    569569                .bind('wpListDelEnd', function(e, s){
    570570                        var wpListsData = $(s.target).attr('data-wp-lists'), id = s.element.replace(/[^0-9]+/g, '');
    571571
    setCommentsList = function() { 
    574574                });
    575575};
    576576
    577 commentReply = {
     577window.commentReply = {
    578578        cid : '',
    579579        act : '',
    580580        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..cdca55d 100644
     
    55 * @output wp-admin/js/inline-edit-post.js
    66 */
    77
    8 /* global inlineEditL10n, ajaxurl, typenow */
     8/* global inlineEditL10n, ajaxurl, typenow, inlineEditPost */
    99
    1010window.wp = window.wp || {};
    1111
    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..bea0196 100644
     
    44 * @output wp-admin/js/inline-edit-tax.js
    55 */
    66
    7 /* global inlineEditL10n, ajaxurl */
     7/* global inlineEditL10n, ajaxurl, inlineEditTax */
    88
    99window.wp = window.wp || {};
    1010
    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..9055cf9 100644
     
    1212 * @requires jQuery
    1313 */
    1414
    15 /* global tinymce, QTags */
    16 
    17 var wpActiveEditor, send_to_editor;
     15/* global tinymce, QTags, wpActiveEditor, tb_position */
    1816
    1917/**
    2018 * Sends the HTML passed in the parameters to TinyMCE.
    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..4d9a5ec 100644
     
    1010 * @requires jQuery
    1111 */
    1212
    13 /* global ajaxurl, attachMediaBoxL10n, _wpMediaGridSettings, showNotice */
    14 
    15 var findPosts;
     13/* global ajaxurl, attachMediaBoxL10n, _wpMediaGridSettings, showNotice, findPosts */
    1614
    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..b6cd1d7 100644
     
    44 * @output wp-admin/js/plugin-install.js
    55 */
    66
    7 /* global plugininstallL10n, tb_click, tb_remove */
    8 var tb_position;
     7/* global plugininstallL10n, tb_click, tb_remove, 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..534915d 100644
     
    55 */
    66
    77 /* global postL10n, ajaxurl, wpAjax, setPostThumbnailL10n, postboxes, pagenow, tinymce, alert, deleteUserSetting */
    8  /* global theList:true, theExtraList:true, getUserSetting, setUserSetting, commentReply */
     8 /* global theList:true, theExtraList:true, getUserSetting, setUserSetting, commentReply, commentsBox */
     9 /* global WPSetThumbnailHTML, wptitlehint */
    910
    10 var commentsBox, WPSetThumbnailHTML, WPSetThumbnailID, WPRemoveThumbnail, wptitlehint, makeSlugeditClickable, editPermalink;
    1111// Backwards compatibility: prevent fatal errors.
    12 makeSlugeditClickable = editPermalink = function(){};
     12window.makeSlugeditClickable = window.editPermalink = function(){};
    1313
    1414// Make sure the wp object exists.
    1515window.wp = window.wp || {};
    window.wp = window.wp || {}; 
    2424         *
    2525         * @namespace commentsBox
    2626         */
    27         commentsBox = {
     27        window.commentsBox = {
    2828                // Comment offset to use when fetching new comments.
    2929                st : 0,
    3030
    window.wp = window.wp || {}; 
    108108         *
    109109         * @global
    110110         */
    111         WPSetThumbnailHTML = function(html){
     111        window.WPSetThumbnailHTML = function(html){
    112112                $('.inside', '#postimagediv').html(html);
    113113        };
    114114
    window.wp = window.wp || {}; 
    119119         *
    120120         * @global
    121121         */
    122         WPSetThumbnailID = function(id){
     122        window.WPSetThumbnailID = function(id){
    123123                var field = $('input[value="_thumbnail_id"]', '#list-table');
    124124                if ( field.length > 0 ) {
    125125                        $('#meta\\[' + field.attr('id').match(/[0-9]+/) + '\\]\\[value\\]').text(id);
    window.wp = window.wp || {}; 
    133133         *
    134134         * @global
    135135         */
    136         WPRemoveThumbnail = function(nonce){
     136        window.WPRemoveThumbnail = function(nonce){
    137137                $.post(ajaxurl, {
    138138                        action: 'set-post-thumbnail', post_id: $( '#post_ID' ).val(), thumbnail_id: -1, _ajax_nonce: nonce, cookie: encodeURIComponent( document.cookie )
    139139                },
    jQuery(document).ready( function($) { 
    10481048         *
    10491049         * @returns void
    10501050         */
    1051         wptitlehint = function(id) {
     1051        window.wptitlehint = function(id) {
    10521052                id = id || 'title';
    10531053
    10541054                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..88facb1 100644
     
    77 * @output wp-admin/js/postbox.js
    88 */
    99
    10 /* global ajaxurl, postBoxL10n */
    11 
    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;
     10/* global ajaxurl, postBoxL10n, postboxes */
    2311
    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..0f3849a 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 );
    function WPSetAsThumbnail( id, nonce ) { 
    2525                }
    2626        }
    2727        );
    28 }
     28};
  • 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..d47cbed 100644
     
    33 */
    44
    55/* jshint curly: false, eqeqeq: false */
    6 /* global ajaxurl */
    7 
    8 var tagBox, array_unique_noempty;
     6/* global ajaxurl, tagBox, array_unique_noempty */
    97
    108( function( $ ) {
    119        var tagDelimiter = ( window.tagsSuggestL10n && window.tagsSuggestL10n.tagDelimiter ) || ',';
    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..00ae62d 100644
     
    22 * @output wp-admin/js/widgets.js
    33 */
    44
    5 /* global ajaxurl, isRtl */
    6 var wpWidgets;
     5/* global ajaxurl, isRtl, 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..fd71ff3 100644
     
    22 * @output wp-includes/js/wp-ajax-response.js
    33 */
    44
    5 var wpAjax = jQuery.extend( {
     5 /* global wpAjax */
     6
     7window.wpAjax = jQuery.extend( {
    68        unserialize: function( s ) {
    79                var r = {}, q, pp, i, p;
    810                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..ac74bdb 100644
     
    44 * @output wp-includes/js/utils.js
    55 */
    66
    7 /* global userSettings */
     7/* global userSettings, getAllUserSettings, wpCookies, setUserSetting */
    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 ) { 
    151151        }
    152152
    153153        return '';
    154 }
     154};
    155155
    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 ) { 
    186186        wpCookies.set( 'wp-settings-time-' + uid, userSettings.time, 31536000, path, '', secure );
    187187
    188188        return name;
    189 }
     189};
    190190
    191 function deleteUserSetting( name ) {
     191window.deleteUserSetting = function( name ) {
    192192        return setUserSetting( name, '', 1 );
    193 }
     193};
    194194
    195195// Returns all settings as js object.
    196 function getAllUserSettings() {
     196window.getAllUserSettings = function() {
    197197        if ( 'object' !== typeof userSettings ) {
    198198                return {};
    199199        }
    200200
    201201        return wpCookies.getHash( 'wp-settings-' + userSettings.uid ) || {};
    202 }
     202};
  • src/js/_enqueues/lib/gallery.js

    diff --git src/js/_enqueues/lib/gallery.js src/js/_enqueues/lib/gallery.js
    index c0ba093..36cb086 100644
     
    22 * @output wp-admin/js/gallery.js
    33 */
    44
    5 /* global unescape, getUserSetting, setUserSetting */
     5/* global unescape, getUserSetting, setUserSetting, wpgallery, tinymce */
    66
    77jQuery(document).ready(function($) {
    88        var gallerySortable, gallerySortableInit, sortIt, clearAll, w, desc = false;
    jQuery(document).ready(function($) { 
    8888        }
    8989});
    9090
    91 jQuery(window).unload( function () { tinymce = tinyMCE = wpgallery = null; } ); // Cleanup
     91jQuery(window).unload( function () { window.tinymce = window.tinyMCE = window.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..ff9b3c4 100644
     
    22 * @output wp-includes/js/wplink.js
    33 */
    44
    5 var wpLink;
     5 /* global wpLink */
    66
    77( function( $, wpLinkL10n, wp ) {
    88        var editor, searchTimer, River, Query, correctedURL, linkNode,
    var wpLink; 
    1616                return linkNode || editor.dom.getParent( editor.selection.getNode(), 'a[href]' );
    1717        }
    1818
    19         wpLink = {
     19        window.wpLink = {
    2020                timeToTriggerRiver: 150,
    2121                minRiverAJAXDuration: 200,
    2222                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..40f6787 100644
     
    99 * @output wp-admin/js/nav-menu.js
    1010 */
    1111
    12 /* global menus, postboxes, columns, isRtl, navMenuL10n, ajaxurl */
    13 
    14 /**
    15  * Contains all the functions to handle WordPress navigation menus administration.
    16  *
    17  * @namespace
    18  */
    19 var wpNavMenu;
     12/* global menus, postboxes, columns, isRtl, navMenuL10n, ajaxurl, wpNavMenu */
    2013
    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..8e737df 100644
     
    2424// by Alex King
    2525// http://www.alexking.org/
    2626
    27 /* global adminpage, wpActiveEditor, quicktagsL10n, wpLink, prompt */
     27/* global adminpage, wpActiveEditor, quicktagsL10n, wpLink, prompt, edButtons */
    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..596b097 100644
     
    22 * @output wp-admin/js/theme.js
    33 */
    44
    5 /* global _wpThemeSettings, confirm */
     5/* global _wpThemeSettings, confirm, tb_position */
    66window.wp = window.wp || {};
    77
    88( function($) {
    $( 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(),