<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[23036] trunk: Move utils.js (cookie and user setting functions) to wp-includes to enable front-end use.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg > ul, #logmsg > ol { margin-left: 0; margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://core.trac.wordpress.org/changeset/23036">23036</a></dd>
<dt>Author</dt> <dd>nacin</dd>
<dt>Date</dt> <dd>2012-12-04 19:29:56 +0000 (Tue, 04 Dec 2012)</dd>
</dl>
<h3>Log Message</h3>
<pre>Move utils.js (cookie and user setting functions) to wp-includes to enable front-end use.
Make it a dependency of media-views (and therefore media-editor). Move its userSettings JS object from admin-header to being paired with the script in script loader.
see <a href="http://core.trac.wordpress.org/ticket/22730">#22730</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminadminheaderphp">trunk/wp-admin/admin-header.php</a></li>
<li><a href="#trunkwpincludesscriptloaderphp">trunk/wp-includes/script-loader.php</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkwpincludesjsutilsjs">trunk/wp-includes/js/utils.js</a></li>
<li><a href="#trunkwpincludesjsutilsminjs">trunk/wp-includes/js/utils.min.js</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkwpadminjsutilsjs">trunk/wp-admin/js/utils.js</a></li>
<li><a href="#trunkwpadminjsutilsminjs">trunk/wp-admin/js/utils.min.js</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminadminheaderphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/admin-header.php (23035 => 23036)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/admin-header.php        2012-12-04 18:58:30 UTC (rev 23035)
+++ trunk/wp-admin/admin-header.php        2012-12-04 19:29:56 UTC (rev 23036)
</span><span class="lines">@@ -50,12 +50,7 @@
</span><span class="cx"> ?>
</span><span class="cx"> <script type="text/javascript">
</span><span class="cx"> addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
</span><del>-var userSettings = {
-                'url': '<?php echo SITECOOKIEPATH; ?>',
-                'uid': '<?php if ( ! isset($current_user) ) $current_user = wp_get_current_user(); echo $current_user->ID; ?>',
-                'time':'<?php echo time() ?>'
-        },
-        ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>',
</del><ins>+var ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>',
</ins><span class="cx">         pagenow = '<?php echo $current_screen->id; ?>',
</span><span class="cx">         typenow = '<?php echo $current_screen->post_type; ?>',
</span><span class="cx">         adminpage = '<?php echo $admin_body_class; ?>',
</span></span></pre></div>
<a id="trunkwpadminjsutilsjs"></a>
<div class="delfile"><h4>Deleted: trunk/wp-admin/js/utils.js (23035 => 23036)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/utils.js        2012-12-04 18:58:30 UTC (rev 23035)
+++ trunk/wp-admin/js/utils.js        2012-12-04 19:29:56 UTC (rev 23036)
</span><span class="lines">@@ -1,171 +0,0 @@
</span><del>-// utility functions
-
-var wpCookies = {
-// The following functions are from Cookie.js class in TinyMCE, Moxiecode, used under LGPL.
-
-        each : function(obj, cb, scope) {
-                var n, l;
-
-                if ( !obj )
-                        return 0;
-
-                scope = scope || obj;
-
-                if ( typeof(obj.length) != 'undefined' ) {
-                        for ( n = 0, l = obj.length; n < l; n++ ) {
-                                if ( cb.call(scope, obj[n], n, obj) === false )
-                                        return 0;
-                        }
-                } else {
-                        for ( n in obj ) {
-                                if ( obj.hasOwnProperty(n) ) {
-                                        if ( cb.call(scope, obj[n], n, obj) === false ) {
-                                                return 0;
-                                        }
-                                }
-                        }
-                }
-                return 1;
-        },
-
-        /**
-         * Get a multi-values cookie.
-         * Returns a JS object with the name: 'value' pairs.
-         */
-        getHash : function(name) {
-                var all = this.get(name), ret;
-
-                if ( all ) {
-                        this.each( all.split('&'), function(pair) {
-                                pair = pair.split('=');
-                                ret = ret || {};
-                                ret[pair[0]] = pair[1];
-                        });
-                }
-                return ret;
-        },
-
-        /**
-         * Set a multi-values cookie.
-         *
-         * 'values_obj' is the JS object that is stored. It is encoded as URI in wpCookies.set().
-         */
-        setHash : function(name, values_obj, expires, path, domain, secure) {
-                var str = '';
-
-                this.each(values_obj, function(val, key) {
-                        str += (!str ? '' : '&') + key + '=' + val;
-                });
-
-                this.set(name, str, expires, path, domain, secure);
-        },
-
-        /**
-         * Get a cookie.
-         */
-        get : function(name) {
-                var cookie = document.cookie, e, p = name + "=", b;
-
-                if ( !cookie )
-                        return;
-
-                b = cookie.indexOf("; " + p);
-
-                if ( b == -1 ) {
-                        b = cookie.indexOf(p);
-
-                        if ( b != 0 )
-                                return null;
-
-                } else {
-                        b += 2;
-                }
-
-                e = cookie.indexOf(";", b);
-
-                if ( e == -1 )
-                        e = cookie.length;
-
-                return decodeURIComponent( cookie.substring(b + p.length, e) );
-        },
-
-        /**
-         * Set a cookie.
-         *
-         * The 'expires' arg can be either a JS Date() object set to the expiration date (back-compat)
-         * or the number of seconds until expiration
-         */
-        set : function(name, value, expires, path, domain, secure) {
-                var d = new Date();
-
-                if ( typeof(expires) == 'object' && expires.toGMTString ) {
-                        expires = expires.toGMTString();
-                } else if ( parseInt(expires, 10) ) {
-                        d.setTime( d.getTime() + ( parseInt(expires, 10) * 1000 ) ); // time must be in miliseconds
-                        expires = d.toGMTString();
-                } else {
-                        expires = '';
-                }
-
-                document.cookie = name + "=" + encodeURIComponent(value) +
-                        ((expires) ? "; expires=" + expires : "") +
-                        ((path) ? "; path=" + path : "") +
-                        ((domain) ? "; domain=" + domain : "") +
-                        ((secure) ? "; secure" : "");
-        },
-
-        /**
-         * Remove a cookie.
-         *
-         * This is done by setting it to an empty value and setting the expiration time in the past.
-         */
-        remove : function(name, path) {
-                this.set(name, '', -1000, path);
-        }
-};
-
-// Returns the value as string. Second arg or empty string is returned when value is not set.
-function getUserSetting( name, def ) {
-        var obj = getAllUserSettings();
-
-        if ( obj.hasOwnProperty(name) )
-                return obj[name];
-
-        if ( typeof def != 'undefined' )
-                return def;
-
-        return '';
-}
-
-// Both name and value must be only ASCII letters, numbers or underscore
-// and the shorter, the better (cookies can store maximum 4KB). Not suitable to store text.
-function setUserSetting( name, value, _del ) {
-        if ( 'object' !== typeof userSettings )
-                return false;
-
-        var cookie = 'wp-settings-' + userSettings.uid, all = wpCookies.getHash(cookie) || {}, path = userSettings.url,
-        n = name.toString().replace(/[^A-Za-z0-9_]/, ''), v = value.toString().replace(/[^A-Za-z0-9_]/, '');
-
-        if ( _del ) {
-                delete all[n];
-        } else {
-                all[n] = v;
-        }
-
-        wpCookies.setHash(cookie, all, 31536000, path);
-        wpCookies.set('wp-settings-time-'+userSettings.uid, userSettings.time, 31536000, path);
-
-        return name;
-}
-
-function deleteUserSetting( name ) {
-        return setUserSetting( name, '', 1 );
-}
-
-// Returns all settings as js object.
-function getAllUserSettings() {
-        if ( 'object' !== typeof userSettings )
-                return {};
-
-        return wpCookies.getHash('wp-settings-' + userSettings.uid) || {};
-}
</del></span></pre></div>
<a id="trunkwpadminjsutilsminjs"></a>
<div class="delfile"><h4>Deleted: trunk/wp-admin/js/utils.min.js (23035 => 23036)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/utils.min.js        2012-12-04 18:58:30 UTC (rev 23035)
+++ trunk/wp-admin/js/utils.min.js        2012-12-04 19:29:56 UTC (rev 23036)
</span><span class="lines">@@ -1 +0,0 @@
</span><del>-var wpCookies={each:function(d,a,c){var e,b;if(!d){return 0}c=c||d;if(typeof(d.length)!="undefined"){for(e=0,b=d.length;e<b;e++){if(a.call(c,d[e],e,d)===false){return 0}}}else{for(e in d){if(d.hasOwnProperty(e)){if(a.call(c,d[e],e,d)===false){return 0}}}}return 1},getHash:function(b){var c=this.get(b),a;if(c){this.each(c.split("&"),function(d){d=d.split("=");a=a||{};a[d[0]]=d[1]})}return a},setHash:function(b,c,a,f,d,e){var g="";this.each(c,function(i,h){g+=(!g?"":"&")+h+"="+i});this.set(b,g,a,f,d,e)},get:function(c){var d=document.cookie,g,f=c+"=",a;if(!d){return}a=d.indexOf("; "+f);if(a==-1){a=d.indexOf(f);if(a!=0){return null}}else{a+=2}g=d.indexOf(";",a);if(g==-1){g=d.length}return decodeURIComponent(d.substring(a+f.length,g))},set:function(b,e,a,g,c,f){var h=new Date();if(typeof(a)=="object"&&a.toGMTString){a=a.toGMTString()}else{i
f(parseInt(a,10)){h.setTime(h.getTime()+(parseInt(a,10)*1000));a=h.toGMTString()}else{a=""}}document.cookie=b+"="+encodeURIComponent(e)+((a)?"; expires="+a:"")+((g)?"; path="+g:"")+((c)?"; domain="+c:"")+((f)?"; secure":"")},remove:function(a,b){this.set(a,"",-1000,b)}};function getUserSetting(a,b){var c=getAllUserSettings();if(c.hasOwnProperty(a)){return c[a]}if(typeof b!="undefined"){return b}return""}function setUserSetting(c,f,b){if("object"!==typeof userSettings){return false}var d="wp-settings-"+userSettings.uid,e=wpCookies.getHash(d)||{},g=userSettings.url,h=c.toString().replace(/[^A-Za-z0-9_]/,""),a=f.toString().replace(/[^A-Za-z0-9_]/,"");if(b){delete e[h]}else{e[h]=a}wpCookies.setHash(d,e,31536000,g);wpCookies.set("wp-settings-time-"+userSettings.uid,userSettings.time,31536000,g);return c
}function deleteUserSetting(a){return setUserSetting(a,"",1)}function getAllUserSettings(){if("object"!==typeof userSettings){return{}}return wpCookies.getHash("wp-settings-"+userSettings.uid)||{}};
</del><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpincludesjsutilsjsfromrev23022trunkwpadminjsutilsjs"></a>
<div class="copfile"><h4>Copied: trunk/wp-includes/js/utils.js (from rev 23022, trunk/wp-admin/js/utils.js) (0 => 23036)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/utils.js         (rev 0)
+++ trunk/wp-includes/js/utils.js        2012-12-04 19:29:56 UTC (rev 23036)
</span><span class="lines">@@ -0,0 +1,171 @@
</span><ins>+// utility functions
+
+var wpCookies = {
+// The following functions are from Cookie.js class in TinyMCE, Moxiecode, used under LGPL.
+
+        each : function(obj, cb, scope) {
+                var n, l;
+
+                if ( !obj )
+                        return 0;
+
+                scope = scope || obj;
+
+                if ( typeof(obj.length) != 'undefined' ) {
+                        for ( n = 0, l = obj.length; n < l; n++ ) {
+                                if ( cb.call(scope, obj[n], n, obj) === false )
+                                        return 0;
+                        }
+                } else {
+                        for ( n in obj ) {
+                                if ( obj.hasOwnProperty(n) ) {
+                                        if ( cb.call(scope, obj[n], n, obj) === false ) {
+                                                return 0;
+                                        }
+                                }
+                        }
+                }
+                return 1;
+        },
+
+        /**
+         * Get a multi-values cookie.
+         * Returns a JS object with the name: 'value' pairs.
+         */
+        getHash : function(name) {
+                var all = this.get(name), ret;
+
+                if ( all ) {
+                        this.each( all.split('&'), function(pair) {
+                                pair = pair.split('=');
+                                ret = ret || {};
+                                ret[pair[0]] = pair[1];
+                        });
+                }
+                return ret;
+        },
+
+        /**
+         * Set a multi-values cookie.
+         *
+         * 'values_obj' is the JS object that is stored. It is encoded as URI in wpCookies.set().
+         */
+        setHash : function(name, values_obj, expires, path, domain, secure) {
+                var str = '';
+
+                this.each(values_obj, function(val, key) {
+                        str += (!str ? '' : '&') + key + '=' + val;
+                });
+
+                this.set(name, str, expires, path, domain, secure);
+        },
+
+        /**
+         * Get a cookie.
+         */
+        get : function(name) {
+                var cookie = document.cookie, e, p = name + "=", b;
+
+                if ( !cookie )
+                        return;
+
+                b = cookie.indexOf("; " + p);
+
+                if ( b == -1 ) {
+                        b = cookie.indexOf(p);
+
+                        if ( b != 0 )
+                                return null;
+
+                } else {
+                        b += 2;
+                }
+
+                e = cookie.indexOf(";", b);
+
+                if ( e == -1 )
+                        e = cookie.length;
+
+                return decodeURIComponent( cookie.substring(b + p.length, e) );
+        },
+
+        /**
+         * Set a cookie.
+         *
+         * The 'expires' arg can be either a JS Date() object set to the expiration date (back-compat)
+         * or the number of seconds until expiration
+         */
+        set : function(name, value, expires, path, domain, secure) {
+                var d = new Date();
+
+                if ( typeof(expires) == 'object' && expires.toGMTString ) {
+                        expires = expires.toGMTString();
+                } else if ( parseInt(expires, 10) ) {
+                        d.setTime( d.getTime() + ( parseInt(expires, 10) * 1000 ) ); // time must be in miliseconds
+                        expires = d.toGMTString();
+                } else {
+                        expires = '';
+                }
+
+                document.cookie = name + "=" + encodeURIComponent(value) +
+                        ((expires) ? "; expires=" + expires : "") +
+                        ((path) ? "; path=" + path : "") +
+                        ((domain) ? "; domain=" + domain : "") +
+                        ((secure) ? "; secure" : "");
+        },
+
+        /**
+         * Remove a cookie.
+         *
+         * This is done by setting it to an empty value and setting the expiration time in the past.
+         */
+        remove : function(name, path) {
+                this.set(name, '', -1000, path);
+        }
+};
+
+// Returns the value as string. Second arg or empty string is returned when value is not set.
+function getUserSetting( name, def ) {
+        var obj = getAllUserSettings();
+
+        if ( obj.hasOwnProperty(name) )
+                return obj[name];
+
+        if ( typeof def != 'undefined' )
+                return def;
+
+        return '';
+}
+
+// Both name and value must be only ASCII letters, numbers or underscore
+// and the shorter, the better (cookies can store maximum 4KB). Not suitable to store text.
+function setUserSetting( name, value, _del ) {
+        if ( 'object' !== typeof userSettings )
+                return false;
+
+        var cookie = 'wp-settings-' + userSettings.uid, all = wpCookies.getHash(cookie) || {}, path = userSettings.url,
+        n = name.toString().replace(/[^A-Za-z0-9_]/, ''), v = value.toString().replace(/[^A-Za-z0-9_]/, '');
+
+        if ( _del ) {
+                delete all[n];
+        } else {
+                all[n] = v;
+        }
+
+        wpCookies.setHash(cookie, all, 31536000, path);
+        wpCookies.set('wp-settings-time-'+userSettings.uid, userSettings.time, 31536000, path);
+
+        return name;
+}
+
+function deleteUserSetting( name ) {
+        return setUserSetting( name, '', 1 );
+}
+
+// Returns all settings as js object.
+function getAllUserSettings() {
+        if ( 'object' !== typeof userSettings )
+                return {};
+
+        return wpCookies.getHash('wp-settings-' + userSettings.uid) || {};
+}
</ins></span></pre></div>
<a id="trunkwpincludesjsutilsminjsfromrev23022trunkwpadminjsutilsminjs"></a>
<div class="copfile"><h4>Copied: trunk/wp-includes/js/utils.min.js (from rev 23022, trunk/wp-admin/js/utils.min.js) (0 => 23036)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/utils.min.js         (rev 0)
+++ trunk/wp-includes/js/utils.min.js        2012-12-04 19:29:56 UTC (rev 23036)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+var wpCookies={each:function(d,a,c){var e,b;if(!d){return 0}c=c||d;if(typeof(d.length)!="undefined"){for(e=0,b=d.length;e<b;e++){if(a.call(c,d[e],e,d)===false){return 0}}}else{for(e in d){if(d.hasOwnProperty(e)){if(a.call(c,d[e],e,d)===false){return 0}}}}return 1},getHash:function(b){var c=this.get(b),a;if(c){this.each(c.split("&"),function(d){d=d.split("=");a=a||{};a[d[0]]=d[1]})}return a},setHash:function(b,c,a,f,d,e){var g="";this.each(c,function(i,h){g+=(!g?"":"&")+h+"="+i});this.set(b,g,a,f,d,e)},get:function(c){var d=document.cookie,g,f=c+"=",a;if(!d){return}a=d.indexOf("; "+f);if(a==-1){a=d.indexOf(f);if(a!=0){return null}}else{a+=2}g=d.indexOf(";",a);if(g==-1){g=d.length}return decodeURIComponent(d.substring(a+f.length,g))},set:function(b,e,a,g,c,f){var h=new Date();if(typeof(a)=="object"&&a.toGMTString){a=a.toGMTString()}else{i
f(parseInt(a,10)){h.setTime(h.getTime()+(parseInt(a,10)*1000));a=h.toGMTString()}else{a=""}}document.cookie=b+"="+encodeURIComponent(e)+((a)?"; expires="+a:"")+((g)?"; path="+g:"")+((c)?"; domain="+c:"")+((f)?"; secure":"")},remove:function(a,b){this.set(a,"",-1000,b)}};function getUserSetting(a,b){var c=getAllUserSettings();if(c.hasOwnProperty(a)){return c[a]}if(typeof b!="undefined"){return b}return""}function setUserSetting(c,f,b){if("object"!==typeof userSettings){return false}var d="wp-settings-"+userSettings.uid,e=wpCookies.getHash(d)||{},g=userSettings.url,h=c.toString().replace(/[^A-Za-z0-9_]/,""),a=f.toString().replace(/[^A-Za-z0-9_]/,"");if(b){delete e[h]}else{e[h]=a}wpCookies.setHash(d,e,31536000,g);wpCookies.set("wp-settings-time-"+userSettings.uid,userSettings.time,31536000,g);return c
}function deleteUserSetting(a){return setUserSetting(a,"",1)}function getAllUserSettings(){if("object"!==typeof userSettings){return{}}return wpCookies.getHash("wp-settings-"+userSettings.uid)||{}};
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpincludesscriptloaderphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/script-loader.php (23035 => 23036)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/script-loader.php        2012-12-04 18:58:30 UTC (rev 23035)
+++ trunk/wp-includes/script-loader.php        2012-12-04 19:29:56 UTC (rev 23036)
</span><span class="lines">@@ -59,7 +59,12 @@
</span><span class="cx">
</span><span class="cx">         $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
</span><span class="cx">
</span><del>-        $scripts->add( 'utils', "/wp-admin/js/utils$suffix.js" );
</del><ins>+        $scripts->add( 'utils', "/wp-includes/js/utils$suffix.js" );
+        did_action( 'init' ) && $scripts->localize( 'utils', 'userSettings', array(
+                'url' => (string) SITECOOKIEPATH,
+                'uid' => (string) get_current_user_id(),
+                'time' => (string) time(),
+        ) );
</ins><span class="cx">
</span><span class="cx">         $scripts->add( 'common', "/wp-admin/js/common$suffix.js", array('jquery', 'hoverIntent', 'utils'), false, 1 );
</span><span class="cx">         did_action( 'init' ) && $scripts->localize( 'common', 'commonL10n', array(
</span><span class="lines">@@ -329,7 +334,7 @@
</span><span class="cx">
</span><span class="cx">         // To enqueue media-views or media-editor, call wp_enqueue_media().
</span><span class="cx">         // Both rely on numerous settings, styles, and templates to operate correctly.
</span><del>-        $scripts->add( 'media-views', "/wp-includes/js/media-views$suffix.js", array( 'media-models', 'wp-plupload', 'jquery-ui-sortable' ), false, 1 );
</del><ins>+        $scripts->add( 'media-views', "/wp-includes/js/media-views$suffix.js", array( 'utils', 'media-models', 'wp-plupload', 'jquery-ui-sortable' ), false, 1 );
</ins><span class="cx">         $scripts->add( 'media-editor', "/wp-includes/js/media-editor$suffix.js", array( 'shortcode', 'media-views' ), false, 1 );
</span><span class="cx">         $scripts->add( 'mce-view', "/wp-includes/js/mce-view$suffix.js", array( 'shortcode', 'media-models' ), false, 1 );
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>