<!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>[18926] trunk: Make iPad support usable again, add viewport meta, see #18863</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/18926">18926</a></dd>
<dt>Author</dt> <dd>azaozz</dd>
<dt>Date</dt> <dd>2011-10-10 04:19:05 +0000 (Mon, 10 Oct 2011)</dd>
</dl>
<h3>Log Message</h3>
<pre>Make iPad support usable again, add viewport meta, see <a href="http://core.trac.wordpress.org/ticket/18863">#18863</a></pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminincludesmiscphp">trunk/wp-admin/includes/misc.php</a></li>
<li><a href="#trunkwpadminjscommondevjs">trunk/wp-admin/js/common.dev.js</a></li>
<li><a href="#trunkwpadminjscommonjs">trunk/wp-admin/js/common.js</a></li>
<li><a href="#trunkwpadminjspostboxdevjs">trunk/wp-admin/js/postbox.dev.js</a></li>
<li><a href="#trunkwpadminjspostboxjs">trunk/wp-admin/js/postbox.js</a></li>
<li><a href="#trunkwpincludesscriptloaderphp">trunk/wp-includes/script-loader.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminincludesmiscphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/misc.php (18925 => 18926)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/misc.php        2011-10-09 17:30:51 UTC (rev 18925)
+++ trunk/wp-admin/includes/misc.php        2011-10-10 04:19:05 UTC (rev 18926)
</span><span class="lines">@@ -584,4 +584,12 @@
</span><span class="cx"> </fieldset>
</span><span class="cx"> <?php
</span><span class="cx"> }
</span><del>-?>
</del><ins>+
+function _ipad_meta() {
+        if ( strpos($_SERVER['HTTP_USER_AGENT'], 'iPad') !== false ) { ?>
+                <meta name="viewport" id="ipad-viewportmeta" content="width=750, initial-scale=1, maximum-scale=1">
+        <?php
+        }
+}
+add_action('admin_head', '_ipad_meta');
+
</ins></span></pre></div>
<a id="trunkwpadminjscommondevjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/js/common.dev.js (18925 => 18926)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/common.dev.js        2011-10-09 17:30:51 UTC (rev 18925)
+++ trunk/wp-admin/js/common.dev.js        2011-10-10 04:19:05 UTC (rev 18926)
</span><span class="lines">@@ -187,7 +187,7 @@
</span><span class="cx">
</span><span class="cx"> $(document).ready( function() {
</span><span class="cx">         var lastClicked = false, checks, first, last, checked, menu = $('#adminmenu'),
</span><del>-                pageInput = $('input.current-page'), currentPage = pageInput.val(), folded;
</del><ins>+                pageInput = $('input.current-page'), currentPage = pageInput.val(), folded, vp = document.getElementById('ipad-viewportmeta');
</ins><span class="cx">
</span><span class="cx">         // admin menu
</span><span class="cx">         $('#collapse-menu', menu).click(function(){
</span><span class="lines">@@ -356,6 +356,20 @@
</span><span class="cx">                 }
</span><span class="cx">
</span><span class="cx">         }).triggerHandler('resize');
</span><ins>+
+        // iPad orientation scale fix
+        if ( vp ) {
+                document.body.addEventListener('gesturestart', function(){
+                        if ( vp.content.indexOf('maximum-scale=1') != -1 )
+                                vp.content = 'width=750px, maximum-scale=5, initial-scale=1';
+                }, false);
+                document.body.addEventListener('gestureend', function(){
+                        setTimeout(function(){
+                                if ( vp.content.indexOf('maximum-scale=1') == -1 )
+                                        vp.content = 'width=750px, maximum-scale=1, initial-scale=1';
+                        }, 2000);
+                }, false);
+        }
</ins><span class="cx"> });
</span><span class="cx">
</span><span class="cx"> // internal use
</span></span></pre></div>
<a id="trunkwpadminjscommonjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/js/common.js (18925 => 18926)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/common.js        2011-10-09 17:30:51 UTC (rev 18925)
+++ trunk/wp-admin/js/common.js        2011-10-10 04:19:05 UTC (rev 18926)
</span><span class="lines">@@ -1 +1 @@
</span><del>-var showNotice,adminMenu,columns,validateForm,screenMeta,autofold_menu;(function(a){adminMenu={init:function(){},fold:function(){},restoreMenuState:function(){},toggle:function(){},favorites:function(){}};columns={init:function(){var b=this;a(".hide-column-tog","#adv-settings").click(function(){var d=a(this),c=d.val();if(d.prop("checked")){b.checked(c)}else{b.unchecked(c)}columns.saveManageColumnsState()})},saveManageColumnsState:function(){var b=this.hidden();a.post(ajaxurl,{action:"hidden-columns",hidden:b,screenoptionnonce:a("#screenoptionnonce").val(),page:pagenow})},checked:function(b){a(".column-"+b).show();this.colSpanChange(+1)},unchecked:function(b){a(".column-"+b).hide();this.colSpanChange(-1)},hidden:function(){return a(".manage-column").filter(":hidden").map(function(){return this.id}).get().join(",")},useCheckboxesForHidden:function(){this.hidden=funct
ion(){return a(".hide-column-tog").not(":checked").map(function(){var b=this.id;return b.substring(b,b.length-5)}).get().join(",")}},colSpanChange:function(b){var d=a("table").find(".colspanchange"),c;if(!d.length){return}c=parseInt(d.attr("colspan"),10)+b;d.attr("colspan",c.toString())}};a(document).ready(function(){columns.init()});validateForm=function(b){return !a(b).find(".form-required").filter(function(){return a("input:visible",this).val()==""}).addClass("form-invalid").find("input:visible").change(function(){a(this).closest(".form-invalid").removeClass("form-invalid")}).size()};showNotice={warn:function(){var b=commonL10n.warnDelete||"";if(confirm(b)){return true}return false},note:function(b){alert(b)}};screenMeta={element:null,toggles:null,page:null,padding:null,top:null,map:{"wp-admin-bar-screen-options":&
quot;screen-options-wrap","wp-admin-bar-help":"contextual-help-wrap"},init:function(){screenMeta.element=a("#screen-meta");screenMeta.toggles=a(".screen-meta-toggle");screenMeta.page=a("#wpcontent");screenMeta.toggles.click(screenMeta.toggleEvent)},toggleEvent:function(c){var b;c.preventDefault();if(!screenMeta.map[this.id]){return}b=a("#"+screenMeta.map[this.id]);if(b.is(":visible")){screenMeta.close(b,a(this))}else{screenMeta.open(b,a(this))}},open:function(b,c){screenMeta.toggles.filter(".selected").click();c.addClass("selected");screenMeta.padding=parseInt(screenMeta.page.css("paddingTop"),10);screenMeta.top=parseInt(screenMeta.element.css("top"),10);b.show();screenMeta.refresh()},refresh:function(b,c){screenMeta.element.css({top:0});screenMeta.page.css({paddingTop:screenMeta.padding+screenMeta.element.outerHeight()})},close:function(b,c){screenMeta.element.
css({top:screenMeta.top});screenMeta.page.css({paddingTop:screenMeta.padding});b.hide();c.removeClass("selected")}};a(".contextual-help-tabs").delegate("a","click focus",function(g){var f=a(this),c,d,b;g.preventDefault();if(f.is(".active a")){return false}a(".contextual-help-tabs .active").removeClass("active");f.parent("li").addClass("active");c=a(f.attr("href"));a(".help-tab-content").not(c).removeClass("active").hide();c.addClass("active").show();d=a("#contextual-help-wrap").children();d.height("auto");b=Math.max.apply(null,a.map(d,function(e){return a(e).height()}));d.height(b);screenMeta.refresh()});a(document).ready(function(){var i=false,c,e,j,h,b=a("#adminmenu"),d=a("input.current-page"),f=d.val(),g;a("#collapse-menu",b).click(function(){var k=a(document.body);if(k.hasClass("folded&quo
t;)){k.removeClass("folded");deleteUserSetting("mfold")}else{k.addClass("folded");setUserSetting("mfold","f")}return false});a("li.wp-has-submenu",b).hoverIntent({over:function(q){var l,n,r,p,k=a(this).find(".wp-submenu");l=a(this).offset().top+k.height()+1;n=a("#wpwrap").height();r=60+l-n;p=a(window).height()+a(window).scrollTop()-15;if(p<(l-r)){r=l-p}if(r>1){k.css({marginTop:"-"+r+"px"})}else{if(k.css("marginTop")){k.css({marginTop:""})}}k.addClass("sub-open")},out:function(){a(this).find(".wp-submenu").removeClass("sub-open")},timeout:200,sensitivity:7,interval:90});a("div.wrap h2:first").nextAll("div.updated, div.error").addClass("below-h2");a("div.updated, div.error").not(".below-h2, .inline").insertAfter(a("div.wrap h2:first"));screenMeta.init();a("tbo
dy").children().children(".check-column").find(":checkbox").click(function(k){if("undefined"==k.shiftKey){return true}if(k.shiftKey){if(!i){return true}c=a(i).closest("form").find(":checkbox");e=c.index(i);j=c.index(this);h=a(this).prop("checked");if(0<e&&0<j&&e!=j){c.slice(e,j).prop("checked",function(){if(a(this).closest("tr").is(":visible")){return h}return false})}}i=this;return true});a("thead, tfoot").find(".check-column :checkbox").click(function(m){var n=a(this).prop("checked"),l="undefined"==typeof toggleWithKeyboard?false:toggleWithKeyboard,k=m.shiftKey||l;a(this).closest("table").children("tbody").filter(":visible").children().children(".check-column").find(":checkbox").prop("checked",function(){if(a(this).closest("tr").is(":hidden"
;)){return false}if(k){return a(this).prop("checked")}else{if(n){return true}}return false});a(this).closest("table").children("thead, tfoot").filter(":visible").children().children(".check-column").find(":checkbox").prop("checked",function(){if(k){return false}else{if(n){return true}}return false})});a("#default-password-nag-no").click(function(){setUserSetting("default_password_nag","hide");a("div.default-password-nag").hide();return false});a("#newcontent").bind("keydown.wpevent_InsertTab",function(p){if(p.keyCode!=9){return true}var m=p.target,r=m.selectionStart,l=m.selectionEnd,q=m.value,k,o;try{this.lastKey=9}catch(n){}if(document.selection){m.focus();o=document.selection.createRange();o.text="\t"}else{if(r>=0){k=this.scrollTop;m.value=q.substring(0,r).concat("\t",q.substring(l));m.selectionStart=m.selectionEnd=r+1;th
is.scrollTop=k}}if(p.stopPropagation){p.stopPropagation()}if(p.preventDefault){p.preventDefault()}});a("#newcontent").bind("blur.wpevent_InsertTab",function(k){if(this.lastKey&&9==this.lastKey){this.focus()}});if(d.length){d.closest("form").submit(function(k){if(a('select[name="action"]').val()==-1&&a('select[name="action2"]').val()==-1&&d.val()==f){d.val("1")}})}a(window).bind("resize.autofold",function(){if(getUserSetting("mfold")=="f"){return}var k=a(window).width();if(k<=800){if(!g){a(document.body).addClass("folded");g=true}}else{if(g){a(document.body).removeClass("folded");g=false}}}).triggerHandler("resize")});a(document).bind("wp_CloseOnEscape",function(c,b){if(typeof(b.cb)!="function"){return}if(typeof(b.condition)!="function"||b.condition()){b.cb()}return true})})(jQuery);
</del><span class="cx">\ No newline at end of file
</span><ins>+var showNotice,adminMenu,columns,validateForm,screenMeta,autofold_menu;(function(a){adminMenu={init:function(){},fold:function(){},restoreMenuState:function(){},toggle:function(){},favorites:function(){}};columns={init:function(){var b=this;a(".hide-column-tog","#adv-settings").click(function(){var d=a(this),c=d.val();if(d.prop("checked")){b.checked(c)}else{b.unchecked(c)}columns.saveManageColumnsState()})},saveManageColumnsState:function(){var b=this.hidden();a.post(ajaxurl,{action:"hidden-columns",hidden:b,screenoptionnonce:a("#screenoptionnonce").val(),page:pagenow})},checked:function(b){a(".column-"+b).show();this.colSpanChange(+1)},unchecked:function(b){a(".column-"+b).hide();this.colSpanChange(-1)},hidden:function(){return a(".manage-column").filter(":hidden").map(function(){return this.id}).get().join(",")},useCheckboxesForHidden:function(){this.hidden=funct
ion(){return a(".hide-column-tog").not(":checked").map(function(){var b=this.id;return b.substring(b,b.length-5)}).get().join(",")}},colSpanChange:function(b){var d=a("table").find(".colspanchange"),c;if(!d.length){return}c=parseInt(d.attr("colspan"),10)+b;d.attr("colspan",c.toString())}};a(document).ready(function(){columns.init()});validateForm=function(b){return !a(b).find(".form-required").filter(function(){return a("input:visible",this).val()==""}).addClass("form-invalid").find("input:visible").change(function(){a(this).closest(".form-invalid").removeClass("form-invalid")}).size()};showNotice={warn:function(){var b=commonL10n.warnDelete||"";if(confirm(b)){return true}return false},note:function(b){alert(b)}};screenMeta={element:null,toggles:null,page:null,padding:null,top:null,map:{"wp-admin-bar-screen-options":&
quot;screen-options-wrap","wp-admin-bar-help":"contextual-help-wrap"},init:function(){screenMeta.element=a("#screen-meta");screenMeta.toggles=a(".screen-meta-toggle");screenMeta.page=a("#wpcontent");screenMeta.toggles.click(screenMeta.toggleEvent)},toggleEvent:function(c){var b;c.preventDefault();if(!screenMeta.map[this.id]){return}b=a("#"+screenMeta.map[this.id]);if(b.is(":visible")){screenMeta.close(b,a(this))}else{screenMeta.open(b,a(this))}},open:function(b,c){screenMeta.toggles.filter(".selected").click();c.addClass("selected");screenMeta.padding=parseInt(screenMeta.page.css("paddingTop"),10);screenMeta.top=parseInt(screenMeta.element.css("top"),10);b.show();screenMeta.refresh()},refresh:function(b,c){screenMeta.element.css({top:0});screenMeta.page.css({paddingTop:screenMeta.padding+screenMeta.element.outerHeight()})},close:function(b,c){screenMeta.element.
css({top:screenMeta.top});screenMeta.page.css({paddingTop:screenMeta.padding});b.hide();c.removeClass("selected")}};a(".contextual-help-tabs").delegate("a","click focus",function(g){var f=a(this),c,d,b;g.preventDefault();if(f.is(".active a")){return false}a(".contextual-help-tabs .active").removeClass("active");f.parent("li").addClass("active");c=a(f.attr("href"));a(".help-tab-content").not(c).removeClass("active").hide();c.addClass("active").show();d=a("#contextual-help-wrap").children();d.height("auto");b=Math.max.apply(null,a.map(d,function(e){return a(e).height()}));d.height(b);screenMeta.refresh()});a(document).ready(function(){var j=false,d,f,k,i,c=a("#adminmenu"),e=a("input.current-page"),g=e.val(),h,b=document.getElementById("ipad-viewportmeta");a("#collapse-menu",c).click(functio
n(){var l=a(document.body);if(l.hasClass("folded")){l.removeClass("folded");deleteUserSetting("mfold")}else{l.addClass("folded");setUserSetting("mfold","f")}return false});a("li.wp-has-submenu",c).hoverIntent({over:function(r){var n,p,s,q,l=a(this).find(".wp-submenu");n=a(this).offset().top+l.height()+1;p=a("#wpwrap").height();s=60+n-p;q=a(window).height()+a(window).scrollTop()-15;if(q<(n-s)){s=n-q}if(s>1){l.css({marginTop:"-"+s+"px"})}else{if(l.css("marginTop")){l.css({marginTop:""})}}l.addClass("sub-open")},out:function(){a(this).find(".wp-submenu").removeClass("sub-open")},timeout:200,sensitivity:7,interval:90});a("div.wrap h2:first").nextAll("div.updated, div.error").addClass("below-h2");a("div.updated, div.error").not(".below-h2, .inline").insertAfter(a(&quo
t;div.wrap h2:first"));screenMeta.init();a("tbody").children().children(".check-column").find(":checkbox").click(function(l){if("undefined"==l.shiftKey){return true}if(l.shiftKey){if(!j){return true}d=a(j).closest("form").find(":checkbox");f=d.index(j);k=d.index(this);i=a(this).prop("checked");if(0<f&&0<k&&f!=k){d.slice(f,k).prop("checked",function(){if(a(this).closest("tr").is(":visible")){return i}return false})}}j=this;return true});a("thead, tfoot").find(".check-column :checkbox").click(function(n){var o=a(this).prop("checked"),m="undefined"==typeof toggleWithKeyboard?false:toggleWithKeyboard,l=n.shiftKey||m;a(this).closest("table").children("tbody").filter(":visible").children().children(".check-column").find(":checkbox").prop("checked",function()
{if(a(this).closest("tr").is(":hidden")){return false}if(l){return a(this).prop("checked")}else{if(o){return true}}return false});a(this).closest("table").children("thead, tfoot").filter(":visible").children().children(".check-column").find(":checkbox").prop("checked",function(){if(l){return false}else{if(o){return true}}return false})});a("#default-password-nag-no").click(function(){setUserSetting("default_password_nag","hide");a("div.default-password-nag").hide();return false});a("#newcontent").bind("keydown.wpevent_InsertTab",function(q){if(q.keyCode!=9){return true}var n=q.target,s=n.selectionStart,m=n.selectionEnd,r=n.value,l,p;try{this.lastKey=9}catch(o){}if(document.selection){n.focus();p=document.selection.createRange();p.text="\t"}else{if(s>=0){l=this.scrollTop;n.value=r.substring(0,s).concat("\t&quo
t;,r.substring(m));n.selectionStart=n.selectionEnd=s+1;this.scrollTop=l}}if(q.stopPropagation){q.stopPropagation()}if(q.preventDefault){q.preventDefault()}});a("#newcontent").bind("blur.wpevent_InsertTab",function(l){if(this.lastKey&&9==this.lastKey){this.focus()}});if(e.length){e.closest("form").submit(function(l){if(a('select[name="action"]').val()==-1&&a('select[name="action2"]').val()==-1&&e.val()==g){e.val("1")}})}a(window).bind("resize.autofold",function(){if(getUserSetting("mfold")=="f"){return}var l=a(window).width();if(l<=800){if(!h){a(document.body).addClass("folded");h=true}}else{if(h){a(document.body).removeClass("folded");h=false}}}).triggerHandler("resize");if(b){document.body.addEventListener("gesturestart",function(){if(b.content.indexOf("maximum-scale=1")!=-1){b.content="width=750px, maxim
um-scale=5, initial-scale=1"}},false);document.body.addEventListener("gestureend",function(){setTimeout(function(){if(b.content.indexOf("maximum-scale=1")==-1){b.content="width=750px, maximum-scale=1, initial-scale=1"}},2000)},false)}});a(document).bind("wp_CloseOnEscape",function(c,b){if(typeof(b.cb)!="function"){return}if(typeof(b.condition)!="function"||b.condition()){b.cb()}return true})})(jQuery);
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpadminjspostboxdevjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/js/postbox.dev.js (18925 => 18926)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/postbox.dev.js        2011-10-09 17:30:51 UTC (rev 18925)
+++ trunk/wp-admin/js/postbox.dev.js        2011-10-10 04:19:05 UTC (rev 18926)
</span><span class="lines">@@ -1,11 +1,11 @@
</span><del>-var postboxes;
</del><ins>+var postboxes, is_iPad = navigator.userAgent.match(/iPad/);
</ins><span class="cx">
</span><span class="cx"> (function($) {
</span><span class="cx">         postboxes = {
</span><span class="cx">                 add_postbox_toggles : function(page, args) {
</span><span class="cx">                         this.init(page, args);
</span><span class="cx">
</span><del>-                        $('.postbox h3, .postbox .handlediv').click( function() {
</del><ins>+                        $('.postbox h3, .postbox .handlediv').bind('click.postboxes', function() {
</ins><span class="cx">                                 var p = $(this).parent('.postbox'), id = p.attr('id');
</span><span class="cx">
</span><span class="cx">                                 if ( 'dashboard_browser_nag' == id )
</span><span class="lines">@@ -26,13 +26,13 @@
</span><span class="cx">                                 e.stopPropagation();
</span><span class="cx">                         });
</span><span class="cx">
</span><del>-                        $('.postbox a.dismiss').click( function(e) {
</del><ins>+                        $('.postbox a.dismiss').bind('click.postboxes', function(e) {
</ins><span class="cx">                                 var hide_id = $(this).parents('.postbox').attr('id') + '-hide';
</span><span class="cx">                                 $( '#' + hide_id ).prop('checked', false).triggerHandler('click');
</span><span class="cx">                                 return false;
</span><span class="cx">                         });
</span><span class="cx">
</span><del>-                        $('.hide-postbox-tog').click( function() {
</del><ins>+                        $('.hide-postbox-tog').bind('click.postboxes', function() {
</ins><span class="cx">                                 var box = $(this).val();
</span><span class="cx">
</span><span class="cx">                                 if ( $(this).prop('checked') ) {
</span><span class="lines">@@ -48,71 +48,13 @@
</span><span class="cx">                                 postboxes._mark_area();
</span><span class="cx">                         });
</span><span class="cx">
</span><del>-                        $('.columns-prefs input[type="radio"]').click(function(){
-                                var num = $(this).val(), i, el, done, ps = $('#poststuff'), move;
</del><ins>+                        $('.columns-prefs input[type="radio"]').bind('click.postboxes', function(){
+                                var n = parseInt($(this).val(), 10), pb = postboxes;
</ins><span class="cx">
</span><del>-                                num = parseInt(num, 10);
-
-                                if ( ps.length ) { // edit pages
-
-                                        if ( num == 2 ) {
-                                                $('.wrap').removeClass('columns-1').addClass('columns-2');
-                                                ps.addClass('has-right-sidebar');
-
-                                                if ( !$('#side-info-column #side-sortables').length )
-                                                        $('#side-info-column').append( $('#side-sortables') );
-
-                                        } else if ( num == 1 ) {
-                                                $('.wrap').removeClass('columns-2').addClass('columns-1');
-                                                ps.removeClass('has-right-sidebar');
-
-                                                if ( !$('#post-body-content #side-sortables').length )
-                                                        $('#normal-sortables').before( $('#side-sortables') );
-                                        }
-
-                                } else { // dashboard
-                                        for ( i = 4; ( i > num && i > 1 ); i-- ) {
-                                                el = $('#' + postboxes._colname(i) + '-sortables');
-                                                $('#' + postboxes._colname(i-1) + '-sortables').append(el.children('.postbox'));
-                                                el.parent().hide();
-                                        }
-
-                                        for ( i = num; i > 0; i-- ) {
-                                                el = $('#' + postboxes._colname(i) + '-sortables');
-                                                done = false;
-
-                                                if ( el.parent().is(':hidden') ) {
-                                                        switch ( i ) {
-                                                                case 4:
-                                                                        move = $('.postbox:visible', $('#column3-sortables'));
-                                                                        if ( move.length > 1 ) {
-                                                                                el.append( move.last() );
-                                                                                done = true;
-                                                                        }
-                                                                case 3:
-                                                                        move = $('.postbox:visible', $('#side-sortables'));
-                                                                        if ( !done && move.length > 1 ) {
-                                                                                el.append( move.last() );
-                                                                                done = true;
-                                                                        }
-                                                                case 2:
-                                                                        move = $('.postbox:visible', $('#normal-sortables'));
-                                                                        if ( !done && move.length > 1 ) {
-                                                                                el.append( move.last() );
-                                                                                done = true;
-                                                                        }
-                                                                default:
-                                                                        if ( !done )
-                                                                                el.addClass('empty-container')
-                                                        }
-
-                                                        el.parent().show();
-                                                }
-                                        }
-
-                                        $('.postbox-container:visible').css('width', 100/num + '%');
</del><ins>+                                if ( n ) {
+                                        pb._pb_edit(n);
+                                        pb.save_order(page);
</ins><span class="cx">                                 }
</span><del>-                                postboxes.save_order(page);
</del><span class="cx">                         });
</span><span class="cx">                 },
</span><span class="cx">
</span><span class="lines">@@ -137,7 +79,6 @@
</span><span class="cx">                                         }
</span><span class="cx">
</span><span class="cx">                                         postboxes.save_order(page);
</span><del>-                                        ui.item.parent().removeClass('temp-border');
</del><span class="cx">                                 },
</span><span class="cx">                                 receive: function(e,ui) {
</span><span class="cx">                                         if ( 'dashboard_browser_nag' == ui.item[0].id )
</span><span class="lines">@@ -146,6 +87,12 @@
</span><span class="cx">                                         postboxes._mark_area();
</span><span class="cx">                                 }
</span><span class="cx">                         });
</span><ins>+
+                        if ( navigator.userAgent.match(/iPad/) ) {
+                                $(document.body).bind('orientationchange', function(){ postboxes._pb_change(); });
+                                this._pb_change();
+                        }
+
</ins><span class="cx">                         this._mark_area();
</span><span class="cx">                 },
</span><span class="cx">
</span><span class="lines">@@ -195,7 +142,7 @@
</span><span class="cx">                                         return '';
</span><span class="cx">                         }
</span><span class="cx">                 },
</span><del>-                
</del><ins>+
</ins><span class="cx">                 _mark_area : function() {
</span><span class="cx">                         $('#side-info-column .meta-box-sortables:visible, #dashboard-widgets .meta-box-sortables:visible').each(function(n, el){
</span><span class="cx">                                 var t = $(this);
</span><span class="lines">@@ -207,6 +154,85 @@
</span><span class="cx">                         });
</span><span class="cx">                 },
</span><span class="cx">
</span><ins>+                _pb_edit : function(n) {
+                        var ps = $('#poststuff'), i, el, done, pb = postboxes, visible = $('.postbox-container:visible').length;
+
+                        if ( n == visible )
+                                return;
+
+                        if ( ps.length ) {
+                                if ( n == 2 ) {
+                                        $('.wrap').removeClass('columns-1').addClass('columns-2');
+                                        ps.addClass('has-right-sidebar');
+
+                                        if ( !$('#side-info-column #side-sortables').length )
+                                                $('#side-info-column').append( $('#side-sortables') );
+
+                                } else if ( n == 1 ) {
+                                        $('.wrap').removeClass('columns-2').addClass('columns-1');
+                                        ps.removeClass('has-right-sidebar');
+
+                                        if ( !$('#post-body-content #side-sortables').length )
+                                                $('#normal-sortables').before( $('#side-sortables') );
+                                }
+                        } else {
+                                for ( i = 4; ( i > n && i > 1 ); i-- ) {
+                                        el = $('#' + postboxes._colname(i) + '-sortables');
+                                        $('#' + postboxes._colname(i-1) + '-sortables').append(el.children('.postbox'));
+                                        el.parent().hide();
+                                }
+
+                                for ( i = n; i > 0; i-- ) {
+                                        el = $('#' + postboxes._colname(i) + '-sortables');
+                                        done = false;
+
+                                        if ( el.parent().is(':hidden') ) {
+                                                switch ( i ) {
+                                                        case 4:
+                                                                done = pb._move_one( el, $('.postbox:visible', $('#column3-sortables')) );
+                                                        case 3:
+                                                                if ( !done )
+                                                                        done = pb._move_one( el, $('.postbox:visible', $('#side-sortables')) );
+                                                        case 2:
+                                                                if ( !done )
+                                                                        done = pb._move_one( el, $('.postbox:visible', $('#normal-sortables')) );
+                                                        default:
+                                                                if ( !done )
+                                                                        el.addClass('empty-container')
+                                                }
+
+                                                el.parent().show();
+                                        }
+                                }
+
+                                $('.postbox-container:visible').css('width', 100/n + '%');
+                        }
+                },
+
+                _pb_change : function() {
+                        switch ( window.orientation ) {
+                                case 90:
+                                case -90:
+                                        this._pb_edit(2);
+                                        break;
+                                case 0:
+                                case 180:
+                                        if ( $('#poststuff').length )
+                                                this._pb_edit(1);
+                                        else
+                                                this._pb_edit(2);
+                                        break;
+                        }
+                },
+
+                _move_one : function(el, move) {
+                        if ( move.length > 1 ) {
+                                el.append( move.last() );
+                                return true;
+                        }
+                        return false;
+                },
+
</ins><span class="cx">                 /* Callbacks */
</span><span class="cx">                 pbshow : false,
</span><span class="cx">
</span></span></pre></div>
<a id="trunkwpadminjspostboxjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/js/postbox.js (18925 => 18926)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/postbox.js        2011-10-09 17:30:51 UTC (rev 18925)
+++ trunk/wp-admin/js/postbox.js        2011-10-10 04:19:05 UTC (rev 18926)
</span><span class="lines">@@ -1 +1 @@
</span><del>-var postboxes;(function(a){postboxes={add_postbox_toggles:function(c,b){this.init(c,b);a(".postbox h3, .postbox .handlediv").click(function(){var d=a(this).parent(".postbox"),e=d.attr("id");if("dashboard_browser_nag"==e){return}d.toggleClass("closed");postboxes.save_state(c);if(e){if(!d.hasClass("closed")&&a.isFunction(postboxes.pbshow)){postboxes.pbshow(e)}else{if(d.hasClass("closed")&&a.isFunction(postboxes.pbhide)){postboxes.pbhide(e)}}}});a(".postbox h3 a").click(function(d){d.stopPropagation()});a(".postbox a.dismiss").click(function(f){var d=a(this).parents(".postbox").attr("id")+"-hide";a("#"+d).prop("checked",false).triggerHandler("click");return false});a(".hide-postbox-tog").click(function(){var d=a(this).val();if(a(this).prop("checked")){a("#"+d).show();if(a.i
sFunction(postboxes.pbshow)){postboxes.pbshow(d)}}else{a("#"+d).hide();if(a.isFunction(postboxes.pbhide)){postboxes.pbhide(d)}}postboxes.save_state(c);postboxes._mark_area()});a('.columns-prefs input[type="radio"]').click(function(){var f=a(this).val(),g,h,e,j=a("#poststuff"),d;f=parseInt(f,10);if(j.length){if(f==2){a(".wrap").removeClass("columns-1").addClass("columns-2");j.addClass("has-right-sidebar");if(!a("#side-info-column #side-sortables").length){a("#side-info-column").append(a("#side-sortables"))}}else{if(f==1){a(".wrap").removeClass("columns-2").addClass("columns-1");j.removeClass("has-right-sidebar");if(!a("#post-body-content #side-sortables").length){a("#normal-sortables").before(a("#side-sortables"))}}}}else{for(g=4;(g>f&&g>1);g--){h=a("#"+postboxes._colname(g)+"-sor
tables");a("#"+postboxes._colname(g-1)+"-sortables").append(h.children(".postbox"));h.parent().hide()}for(g=f;g>0;g--){h=a("#"+postboxes._colname(g)+"-sortables");e=false;if(h.parent().is(":hidden")){switch(g){case 4:d=a(".postbox:visible",a("#column3-sortables"));if(d.length>1){h.append(d.last());e=true}case 3:d=a(".postbox:visible",a("#side-sortables"));if(!e&&d.length>1){h.append(d.last());e=true}case 2:d=a(".postbox:visible",a("#normal-sortables"));if(!e&&d.length>1){h.append(d.last());e=true}default:if(!e){h.addClass("empty-container")}}h.parent().show()}}a(".postbox-container:visible").css("width",100/f+"%")}postboxes.save_order(c)})},init:function(c,b){a.extend(this,b||{});a("#wpbody-content").css("overflow","hidden");a(".meta-box-sortables&quo
t;).sortable({placeholder:"sortable-placeholder",connectWith:".meta-box-sortables",items:".postbox",handle:".hndle",cursor:"move",distance:2,tolerance:"pointer",forcePlaceholderSize:true,helper:"clone",opacity:0.65,stop:function(f,d){if(a(this).find("#dashboard_browser_nag").is(":visible")&&"dashboard_browser_nag"!=this.firstChild.id){a(this).sortable("cancel");return}postboxes.save_order(c);d.item.parent().removeClass("temp-border")},receive:function(f,d){if("dashboard_browser_nag"==d.item[0].id){a(d.sender).sortable("cancel")}postboxes._mark_area()}});this._mark_area()},save_state:function(d){var b=a(".postbox").filter(".closed").map(function(){return this.id}).get().join(","),c=a(".postbox").filter(":hidden").map(function(){return this.id}).get().join(",");a.post(ajax
url,{action:"closed-postboxes",closed:b,hidden:c,closedpostboxesnonce:jQuery("#closedpostboxesnonce").val(),page:d})},save_order:function(c){var b,d=a(".columns-prefs input:checked").val()||0;b={action:"meta-box-order",_ajax_nonce:a("#meta-box-order-nonce").val(),page_columns:d,page:c};a(".meta-box-sortables").each(function(){b["order["+this.id.split("-")[0]+"]"]=a(this).sortable("toArray").join(",")});a.post(ajaxurl,b)},_colname:function(b){switch(b){case 1:return"normal";break;case 2:return"side";break;case 3:return"column3";break;case 4:return"column4";break;default:return""}},_mark_area:function(){a("#side-info-column .meta-box-sortables:visible, #dashboard-widgets .meta-box-sortables:visible").each(function(d,c){var b=a(this);if(!b.children(".postbox:visible").length){b.addClass("empty-co
ntainer")}else{b.removeClass("empty-container")}})},pbshow:false,pbhide:false}}(jQuery));
</del><span class="cx">\ No newline at end of file
</span><ins>+var postboxes,is_iPad=navigator.userAgent.match(/iPad/);(function(a){postboxes={add_postbox_toggles:function(c,b){this.init(c,b);a(".postbox h3, .postbox .handlediv").bind("click.postboxes",function(){var d=a(this).parent(".postbox"),e=d.attr("id");if("dashboard_browser_nag"==e){return}d.toggleClass("closed");postboxes.save_state(c);if(e){if(!d.hasClass("closed")&&a.isFunction(postboxes.pbshow)){postboxes.pbshow(e)}else{if(d.hasClass("closed")&&a.isFunction(postboxes.pbhide)){postboxes.pbhide(e)}}}});a(".postbox h3 a").click(function(d){d.stopPropagation()});a(".postbox a.dismiss").bind("click.postboxes",function(f){var d=a(this).parents(".postbox").attr("id")+"-hide";a("#"+d).prop("checked",false).triggerHandler("click");return false});a(".hide-postbox-tog").bind("
click.postboxes",function(){var d=a(this).val();if(a(this).prop("checked")){a("#"+d).show();if(a.isFunction(postboxes.pbshow)){postboxes.pbshow(d)}}else{a("#"+d).hide();if(a.isFunction(postboxes.pbhide)){postboxes.pbhide(d)}}postboxes.save_state(c);postboxes._mark_area()});a('.columns-prefs input[type="radio"]').bind("click.postboxes",function(){var e=parseInt(a(this).val(),10),d=postboxes;if(e){d._pb_edit(e);d.save_order(c)}})},init:function(c,b){a.extend(this,b||{});a("#wpbody-content").css("overflow","hidden");a(".meta-box-sortables").sortable({placeholder:"sortable-placeholder",connectWith:".meta-box-sortables",items:".postbox",handle:".hndle",cursor:"move",distance:2,tolerance:"pointer",forcePlaceholderSize:true,helper:"clone",opacity:0.65,stop:function(f,d){if(a(this).find("#dashboard_browser_nag"
).is(":visible")&&"dashboard_browser_nag"!=this.firstChild.id){a(this).sortable("cancel");return}postboxes.save_order(c)},receive:function(f,d){if("dashboard_browser_nag"==d.item[0].id){a(d.sender).sortable("cancel")}postboxes._mark_area()}});if(navigator.userAgent.match(/iPad/)){a(document.body).bind("orientationchange",function(){postboxes._pb_change()});this._pb_change()}this._mark_area()},save_state:function(d){var b=a(".postbox").filter(".closed").map(function(){return this.id}).get().join(","),c=a(".postbox").filter(":hidden").map(function(){return this.id}).get().join(",");a.post(ajaxurl,{action:"closed-postboxes",closed:b,hidden:c,closedpostboxesnonce:jQuery("#closedpostboxesnonce").val(),page:d})},save_order:function(c){var b,d=a(".columns-prefs input:checked").val()||0;b={action:"meta-box-order",_aja
x_nonce:a("#meta-box-order-nonce").val(),page_columns:d,page:c};a(".meta-box-sortables").each(function(){b["order["+this.id.split("-")[0]+"]"]=a(this).sortable("toArray").join(",")});a.post(ajaxurl,b)},_colname:function(b){switch(b){case 1:return"normal";break;case 2:return"side";break;case 3:return"column3";break;case 4:return"column4";break;default:return""}},_mark_area:function(){a("#side-info-column .meta-box-sortables:visible, #dashboard-widgets .meta-box-sortables:visible").each(function(d,c){var b=a(this);if(!b.children(".postbox:visible").length){b.addClass("empty-container")}else{b.removeClass("empty-container")}})},_pb_edit:function(h){var g=a("#poststuff"),d,e,b,c=postboxes,f=a(".postbox-container:visible").length;if(h==f){return}if(g.length){if(h==2){a(".wrap").removeClass(&qu
ot;columns-1").addClass("columns-2");g.addClass("has-right-sidebar");if(!a("#side-info-column #side-sortables").length){a("#side-info-column").append(a("#side-sortables"))}}else{if(h==1){a(".wrap").removeClass("columns-2").addClass("columns-1");g.removeClass("has-right-sidebar");if(!a("#post-body-content #side-sortables").length){a("#normal-sortables").before(a("#side-sortables"))}}}}else{for(d=4;(d>h&&d>1);d--){e=a("#"+postboxes._colname(d)+"-sortables");a("#"+postboxes._colname(d-1)+"-sortables").append(e.children(".postbox"));e.parent().hide()}for(d=h;d>0;d--){e=a("#"+postboxes._colname(d)+"-sortables");b=false;if(e.parent().is(":hidden")){switch(d){case 4:b=c._move_one(e,a(".postbox:visible",a("#column3-sortables")));case 3:if(!b){b=
c._move_one(e,a(".postbox:visible",a("#side-sortables")))}case 2:if(!b){b=c._move_one(e,a(".postbox:visible",a("#normal-sortables")))}default:if(!b){e.addClass("empty-container")}}e.parent().show()}}a(".postbox-container:visible").css("width",100/h+"%")}},_pb_change:function(){switch(window.orientation){case 90:case -90:this._pb_edit(2);break;case 0:case 180:if(a("#poststuff").length){this._pb_edit(1)}else{this._pb_edit(2)}break}},_move_one:function(c,b){if(b.length>1){c.append(b.last());return true}return false},pbshow:false,pbhide:false}}(jQuery));
</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 (18925 => 18926)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/script-loader.php        2011-10-09 17:30:51 UTC (rev 18925)
+++ trunk/wp-includes/script-loader.php        2011-10-10 04:19:05 UTC (rev 18926)
</span><span class="lines">@@ -61,7 +61,7 @@
</span><span class="cx">
</span><span class="cx">         $scripts->add( 'utils', "/wp-admin/js/utils$suffix.js", false, '20101110' );
</span><span class="cx">
</span><del>-        $scripts->add( 'common', "/wp-admin/js/common$suffix.js", array('jquery', 'hoverIntent', 'utils'), '20111005', 1 );
</del><ins>+        $scripts->add( 'common', "/wp-admin/js/common$suffix.js", array('jquery', 'hoverIntent', 'utils'), '20111009', 1 );
</ins><span class="cx">         $scripts->add_script_data( 'common', 'commonL10n', array(
</span><span class="cx">                 'warnDelete' => __("You are about to permanently delete the selected items.\n 'Cancel' to stop, 'OK' to delete.")
</span><span class="cx">         ) );
</span><span class="lines">@@ -305,7 +305,7 @@
</span><span class="cx">
</span><span class="cx">                 $scripts->add( 'xfn', "/wp-admin/js/xfn$suffix.js", array('jquery'), '20110524', 1 );
</span><span class="cx">
</span><del>-                $scripts->add( 'postbox', "/wp-admin/js/postbox$suffix.js", array('jquery-ui-sortable'), '20111009', 1 );
</del><ins>+                $scripts->add( 'postbox', "/wp-admin/js/postbox$suffix.js", array('jquery-ui-sortable'), '20111009a', 1 );
</ins><span class="cx">
</span><span class="cx">                 $scripts->add( 'post', "/wp-admin/js/post$suffix.js", array('suggest', 'wp-lists', 'postbox'), '20110524', 1 );
</span><span class="cx">                 $scripts->add_script_data( 'post', 'postL10n', array(
</span></span></pre>
</div>
</div>
</body>
</html>