<!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" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { 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, #msg p { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul { overflow: auto; }
#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>
<title>[11870] trunk: Fix error in widgets.js, props Denis-de-Bernardy, see #10021</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/11870">11870</a></dd>
<dt>Author</dt> <dd>azaozz</dd>
<dt>Date</dt> <dd>2009-08-24 19:16:53 +0000 (Mon, 24 Aug 2009)</dd>
</dl>
<h3>Log Message</h3>
<pre>Fix error in widgets.js, props Denis-de-Bernardy, see <a href="http://trac.wordpress.org/ticket/10021">#10021</a></pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminjswidgetsdevjs">trunk/wp-admin/js/widgets.dev.js</a></li>
<li><a href="#trunkwpadminjswidgetsjs">trunk/wp-admin/js/widgets.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="trunkwpadminjswidgetsdevjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/js/widgets.dev.js (11869 => 11870)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/widgets.dev.js        2009-08-24 18:03:49 UTC (rev 11869)
+++ trunk/wp-admin/js/widgets.dev.js        2009-08-24 19:16:53 UTC (rev 11870)
</span><span class="lines">@@ -137,7 +137,7 @@
</span><span class="cx">                                 if ( !$(this).is(':visible') )
</span><span class="cx">                                         $(this).sortable('cancel');
</span><span class="cx">                         }
</span><del>-                })..sortable('option', 'connectWith', 'div.widgets-sortables').parent().filter('.closed').children('.widgets-sortables').sortable('disable');
</del><ins>+                }).sortable('option', 'connectWith', 'div.widgets-sortables').parent().filter('.closed').children('.widgets-sortables').sortable('disable');
</ins><span class="cx">
</span><span class="cx">                 $('#available-widgets').droppable({
</span><span class="cx">                         tolerance: 'pointer',
</span></span></pre></div>
<a id="trunkwpadminjswidgetsjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/js/widgets.js (11869 => 11870)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/widgets.js        2009-08-24 18:03:49 UTC (rev 11869)
+++ trunk/wp-admin/js/widgets.js        2009-08-24 19:16:53 UTC (rev 11870)
</span><span class="lines">@@ -1 +1 @@
</span><del>-var wpWidgets;(function(a){wpWidgets={init:function(){var c,b=a("div.widgets-sortables");a("#widgets-right").children(".widgets-holder-wrap").children(".sidebar-name").click(function(){var e=a(this).siblings(".widgets-sortables"),d=a(this).parent();if(!d.hasClass("closed")){e.sortable("disable");d.addClass("closed")}else{d.removeClass("closed");e.sortable("enable").sortable("refresh")}});a("#widgets-left").children(".widgets-holder-wrap").children(".sidebar-name").click(function(){a(this).siblings(".widget-holder").parent().toggleClass("closed")});b.not("#wp_inactive_widgets").each(function(){var e=50,d=a(this).children(".widget").length;e=e+parseInt(d*48,10);a(this).css("minHeight",e+"px")});a("a.widget-action").live("click",function(){var f={},g=a(this).closest("div.widget"),d=g.children(".widget-inside"),e=parseInt(g.find("input.widget-width").val(),10);if(d.is(":hidden")){if(e>250&&d.closest("div.widgets-sortables").length){f.width=e+30+"px";if(d.closest("div.widget-liquid-right").length){f.marginLeft=235-e+"px"}g.css(f)}wpWidgets.fixLabels(g);d.slideDown("fast")}else{d.slideUp("fast",function(){g.css({width:"",marginLeft:""})})}return false});a("input.widget-control-save").live("click",function(){wpWidgets.save(a(this).closest("div.widget"),0,1,0);return false});a("a.widget-control-remove").live("click",function(){wpWidgets.save(a(this).closest("div.widget"),1,1,0);return false});a("a.widget-control-close").live("click",function(){wpWidgets.close(a(this).closest("div.widget"));return false});b.children(".widget").each(function(){wpWidgets.appendTitle(this);if(a("p.widget-error",this).length){a("a.widget-action",this).click()}});a("#widget-list").children(".widget").draggable({connectToSortable:"div.widgets-sortables",handle:"> .widget-top > .widget-title",distance:2,helper:"clone",zIndex:5,containment:"document",start:function(f,d){wpWidgets.fixWebkit(1);d.helper.find("div.widget-description").hide()},stop:function(f,d){if(c){a(c).hide()}c="";wpWidgets.fixWebkit()}});b.sortable({placeholder:"widget-placeholder",items:"> .widget",handle:"> .widget-top > .widget-title",cursor:"move",distance:2,containment:"document",start:function(f,d){wpWidgets.fixWebkit(1);d.item.children(".widget-inside").hide();d.item.css({marginLeft:"",width:""})},stop:function(g,d){if(d.item.hasClass("ui-draggable")){d.item.draggable("destroy")}if(d.item.hasClass("deleting")){wpWidgets.save(d.item,1,0,1);d.item.remove();return}var f=d.item.find("input.add_new").val(),j=d.item.find("input.multi_number").val(),i=d.item.attr("id"),h=a(this).attr("id");d.item.css({marginLeft:"",width:""});wpWidgets.fixWebkit();if(f){if("multi"==f){d.item.html(d.item.html().replace(/<[^<>]+>/g,function(e){return e.replace(/__i__|%i%/g,j)}));d.item.attr("id",i.replace(/__i__|%i%/g,j));j++;a("div#"+i).find("input.multi_number").val(j)}else{if("single"==f){d.item.attr("id","new-"+i);c="div#"+i}}wpWidgets.save(d.item,0,0,1);d.item.find("input.add_new").val("");d.item.find("a.widget-action").click();return}wpWidgets.saveOrder(h)},receive:function(f,d){if(!a(this).is(":visible")){a(this).sortable("cancel")}}})..sortable("option","connectWith","div.widgets-sortables").parent().filter(".closed").children(".widgets-sortables").sortable("disable");a("#available-widgets").droppable({tolerance:"pointer",accept:function(d){return a(d).parent().attr("id")!="widget-list"},drop:function(f,d){d.draggable.addClass("deleting");a("#removing-widget").hide().children("span").html("")},over:function(f,d){d.draggable.addClass("deleting");a("div.widget-placeholder").hide();if(d.draggable.hasClass("ui-sortable-helper")){a("#removing-widget").show().children("span").html(d.draggable.find("div.widget-title").children("h4").html())}},out:function(f,d){d.draggable.removeClass("deleting");a("div.widget-placeholder").show();a("#removing-widget").hide().children("span").html("")}})},saveOrder:function(c){if(c){a("#"+c).closest("div.widgets-holder-wrap").find("img.ajax-feedback").css("visibility","visible")}var b={action:"widgets-order",savewidgets:a("#_wpnonce_widgets").val(),sidebars:[]};a("div.widgets-sortables").each(function(){b["sidebars["+a(this).attr("id")+"]"]=a(this).sortable("toArray").join(",")});a.post(ajaxurl,b,function(){a("img.ajax-feedback").css("visibility","hidden")});this.resize()},save:function(g,d,e,b){var h=g.closest("div.widgets-sortables").attr("id"),f=g.find("form").serialize(),c;g=a(g);a(".ajax-feedback",g).css("visibility","visible");c={action:"save-widget",savewidgets:a("#_wpnonce_widgets").val(),sidebar:h};if(d){c.delete_widget=1}f+="&"+a.param(c);a.post(ajaxurl,f,function(i){var j;if(d){if(!a("input.widget_number",g).val()){j=a("input.widget-id",g).val();a("#available-widgets").find("input.widget-id").each(function(){if(a(this).val()==j){a(this).closest("div.widget").show()}})}if(e){b=0;g.slideUp("fast",function(){a(this).remove();wpWidgets.saveOrder()})}else{g.remove();wpWidgets.resize()}}else{a(".ajax-feedback").css("visibility","hidden");if(i&&i.length>2){a("div.widget-content",g).html(i);wpWidgets.appendTitle(g);wpWidgets.fixLabels(g)}}if(b){wpWidgets.saveOrder()}})},appendTitle:function(b){var c=a('input[id*="-title"]',b);if(c=c.val()){c=c.replace(/<[^<>]+>/g,"").replace(/</g,"&lt;").replace(/>/g,"&gt;");a(b).children(".widget-top").children(".widget-title").children().children(".in-widget-title").html(": "+c)}},resize:function(){a("div.widgets-sortables").not("#wp_inactive_widgets").each(function(){var c=50,b=a(this).children(".widget").length;c=c+parseInt(b*48,10);a(this).css("minHeight",c+"px")})},fixWebkit:function(b){b=b?"none":"";a("body").css({WebkitUserSelect:b,KhtmlUserSelect:b})},fixLabels:function(b){b.children(".widget-inside").find("label").each(function(){var c=a(this).attr("for");if(c&&c==a("input",this).attr("id")){a(this).removeAttr("for")}})},close:function(b){b.children(".widget-inside").slideUp("fast",function(){b.css({width:"",marginLeft:""})})}};a(document).ready(function(b){wpWidgets.init()})})(jQuery);
</del><span class="cx">\ No newline at end of file
</span><ins>+var wpWidgets;(function(a){wpWidgets={init:function(){var c,b=a("div.widgets-sortables");a("#widgets-right").children(".widgets-holder-wrap").children(".sidebar-name").click(function(){var e=a(this).siblings(".widgets-sortables"),d=a(this).parent();if(!d.hasClass("closed")){e.sortable("disable");d.addClass("closed")}else{d.removeClass("closed");e.sortable("enable").sortable("refresh")}});a("#widgets-left").children(".widgets-holder-wrap").children(".sidebar-name").click(function(){a(this).siblings(".widget-holder").parent().toggleClass("closed")});b.not("#wp_inactive_widgets").each(function(){var e=50,d=a(this).children(".widget").length;e=e+parseInt(d*48,10);a(this).css("minHeight",e+"px")});a("a.widget-action").live("click",function(){var f={},g=a(this).closest("div.widget"),d=g.children(".widget-inside"),e=parseInt(g.find("input.widget-width").val(),10);if(d.is(":hidden")){if(e>250&&d.closest("div.widgets-sortables").length){f.width=e+30+"px";if(d.closest("div.widget-liquid-right").length){f.marginLeft=235-e+"px"}g.css(f)}wpWidgets.fixLabels(g);d.slideDown("fast")}else{d.slideUp("fast",function(){g.css({width:"",marginLeft:""})})}return false});a("input.widget-control-save").live("click",function(){wpWidgets.save(a(this).closest("div.widget"),0,1,0);return false});a("a.widget-control-remove").live("click",function(){wpWidgets.save(a(this).closest("div.widget"),1,1,0);return false});a("a.widget-control-close").live("click",function(){wpWidgets.close(a(this).closest("div.widget"));return false});b.children(".widget").each(function(){wpWidgets.appendTitle(this);if(a("p.widget-error",this).length){a("a.widget-action",this).click()}});a("#widget-list").children(".widget").draggable({connectToSortable:"div.widgets-sortables",handle:"> .widget-top > .widget-title",distance:2,helper:"clone",zIndex:5,containment:"document",start:function(f,d){wpWidgets.fixWebkit(1);d.helper.find("div.widget-description").hide()},stop:function(f,d){if(c){a(c).hide()}c="";wpWidgets.fixWebkit()}});b.sortable({placeholder:"widget-placeholder",items:"> .widget",handle:"> .widget-top > .widget-title",cursor:"move",distance:2,containment:"document",start:function(f,d){wpWidgets.fixWebkit(1);d.item.children(".widget-inside").hide();d.item.css({marginLeft:"",width:""})},stop:function(g,d){if(d.item.hasClass("ui-draggable")){d.item.draggable("destroy")}if(d.item.hasClass("deleting")){wpWidgets.save(d.item,1,0,1);d.item.remove();return}var f=d.item.find("input.add_new").val(),j=d.item.find("input.multi_number").val(),i=d.item.attr("id"),h=a(this).attr("id");d.item.css({marginLeft:"",width:""});wpWidgets.fixWebkit();if(f){if("multi"==f){d.item.html(d.item.html().replace(/<[^<>]+>/g,function(e){return e.replace(/__i__|%i%/g,j)}));d.item.attr("id",i.replace(/__i__|%i%/g,j));j++;a("div#"+i).find("input.multi_number").val(j)}else{if("single"==f){d.item.attr("id","new-"+i);c="div#"+i}}wpWidgets.save(d.item,0,0,1);d.item.find("input.add_new").val("");d.item.find("a.widget-action").click();return}wpWidgets.saveOrder(h)},receive:function(f,d){if(!a(this).is(":visible")){a(this).sortable("cancel")}}}).sortable("option","connectWith","div.widgets-sortables").parent().filter(".closed").children(".widgets-sortables").sortable("disable");a("#available-widgets").droppable({tolerance:"pointer",accept:function(d){return a(d).parent().attr("id")!="widget-list"},drop:function(f,d){d.draggable.addClass("deleting");a("#removing-widget").hide().children("span").html("")},over:function(f,d){d.draggable.addClass("deleting");a("div.widget-placeholder").hide();if(d.draggable.hasClass("ui-sortable-helper")){a("#removing-widget").show().children("span").html(d.draggable.find("div.widget-title").children("h4").html())}},out:function(f,d){d.draggable.removeClass("deleting");a("div.widget-placeholder").show();a("#removing-widget").hide().children("span").html("")}})},saveOrder:function(c){if(c){a("#"+c).closest("div.widgets-holder-wrap").find("img.ajax-feedback").css("visibility","visible")}var b={action:"widgets-order",savewidgets:a("#_wpnonce_widgets").val(),sidebars:[]};a("div.widgets-sortables").each(function(){b["sidebars["+a(this).attr("id")+"]"]=a(this).sortable("toArray").join(",")});a.post(ajaxurl,b,function(){a("img.ajax-feedback").css("visibility","hidden")});this.resize()},save:function(g,d,e,b){var h=g.closest("div.widgets-sortables").attr("id"),f=g.find("form").serialize(),c;g=a(g);a(".ajax-feedback",g).css("visibility","visible");c={action:"save-widget",savewidgets:a("#_wpnonce_widgets").val(),sidebar:h};if(d){c.delete_widget=1}f+="&"+a.param(c);a.post(ajaxurl,f,function(i){var j;if(d){if(!a("input.widget_number",g).val()){j=a("input.widget-id",g).val();a("#available-widgets").find("input.widget-id").each(function(){if(a(this).val()==j){a(this).closest("div.widget").show()}})}if(e){b=0;g.slideUp("fast",function(){a(this).remove();wpWidgets.saveOrder()})}else{g.remove();wpWidgets.resize()}}else{a(".ajax-feedback").css("visibility","hidden");if(i&&i.length>2){a("div.widget-content",g).html(i);wpWidgets.appendTitle(g);wpWidgets.fixLabels(g)}}if(b){wpWidgets.saveOrder()}})},appendTitle:function(b){var c=a('input[id*="-title"]',b);if(c=c.val()){c=c.replace(/<[^<>]+>/g,"").replace(/</g,"&lt;").replace(/>/g,"&gt;");a(b).children(".widget-top").children(".widget-title").children().children(".in-widget-title").html(": "+c)}},resize:function(){a("div.widgets-sortables").not("#wp_inactive_widgets").each(function(){var c=50,b=a(this).children(".widget").length;c=c+parseInt(b*48,10);a(this).css("minHeight",c+"px")})},fixWebkit:function(b){b=b?"none":"";a("body").css({WebkitUserSelect:b,KhtmlUserSelect:b})},fixLabels:function(b){b.children(".widget-inside").find("label").each(function(){var c=a(this).attr("for");if(c&&c==a("input",this).attr("id")){a(this).removeAttr("for")}})},close:function(b){b.children(".widget-inside").slideUp("fast",function(){b.css({width:"",marginLeft:""})})}};a(document).ready(function(b){wpWidgets.init()})})(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 (11869 => 11870)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/script-loader.php        2009-08-24 18:03:49 UTC (rev 11869)
+++ trunk/wp-includes/script-loader.php        2009-08-24 19:16:53 UTC (rev 11870)
</span><span class="lines">@@ -343,7 +343,7 @@
</span><span class="cx">                 $scripts->add( 'media-upload', "/wp-admin/js/media-upload$suffix.js", array( 'thickbox' ), '20090114' );
</span><span class="cx">                 $scripts->add_data( 'media-upload', 'group', 1 );
</span><span class="cx">
</span><del>-                $scripts->add( 'admin-widgets', "/wp-admin/js/widgets$suffix.js", array( 'jquery-ui-sortable', 'jquery-ui-draggable', 'jquery-ui-droppable' ), '20090820' );
</del><ins>+                $scripts->add( 'admin-widgets', "/wp-admin/js/widgets$suffix.js", array( 'jquery-ui-sortable', 'jquery-ui-draggable', 'jquery-ui-droppable' ), '20090824' );
</ins><span class="cx">                 $scripts->add_data( 'admin-widgets', 'group', 1 );
</span><span class="cx">
</span><span class="cx">                 $scripts->add( 'word-count', "/wp-admin/js/word-count$suffix.js", array( 'jquery' ), '20090422' );
</span></span></pre>
</div>
</div>
</body>
</html>