diff --git a/wp-admin/css/colors-classic.css b/wp-admin/css/colors-classic.css
index 9aef89aa08..ed1be7902f 100644
--- a/wp-admin/css/colors-classic.css
+++ b/wp-admin/css/colors-classic.css
@@ -1572,3 +1572,8 @@ div.widgets-holder-wrap {
background-color: #F1F1F1;
border-color: #DDDDDD;
}
+
+.sidebar-name:hover {
+ color: #d54e21;
+}
+
diff --git a/wp-admin/css/colors-fresh.css b/wp-admin/css/colors-fresh.css
index f2e709b336..4ca9a38efb 100644
--- a/wp-admin/css/colors-fresh.css
+++ b/wp-admin/css/colors-fresh.css
@@ -1574,3 +1574,8 @@ div.widgets-holder-wrap {
background-color: #F1F1F1;
border-color: #DDDDDD;
}
+
+.sidebar-name:hover {
+ color: #d54e21;
+}
+
diff --git a/wp-admin/css/widgets.css b/wp-admin/css/widgets.css
index de2816dbca..3d5a449f6e 100644
--- a/wp-admin/css/widgets.css
+++ b/wp-admin/css/widgets.css
@@ -19,6 +19,7 @@ div.widget-liquid-right {
.widgets-sortables li {
width: 300px;
margin: 15px 0 18px;
+ position: relative;
}
#widgets-left .widgets-sortables li,
@@ -90,7 +91,7 @@ ul#widget-list {
}
.widget .widget-inside {
- margin: 15px;
+ padding: 15px;
font-size: 11px;
display: none;
}
diff --git a/wp-admin/includes/widgets.php b/wp-admin/includes/widgets.php
index a58f114500..b658bd0aaa 100644
--- a/wp-admin/includes/widgets.php
+++ b/wp-admin/includes/widgets.php
@@ -177,6 +177,8 @@ function wp_widget_control( $sidebar_args ) {
$widget_number = isset($control['params'][0]['number']) ? $control['params'][0]['number'] : '';
$id_base = isset($control['id_base']) ? $control['id_base'] : $widget_id;
+ $multi_number = isset($sidebar_args['_multi_num']) ? $sidebar_args['_multi_num'] : '';
+ $add_new = isset($sidebar_args['_add']) ? $sidebar_args['_add'] : '';
// We aren't showing a widget control, we're outputing a template for a mult-widget control
if ( isset($sidebar_args['_display']) && 'template' == $sidebar_args['_display'] && $widget_number ) {
@@ -185,8 +187,6 @@ function wp_widget_control( $sidebar_args ) {
// if given, id_base means widget id's should be constructed like {$id_base}-{$id_number}
if ( isset($control['id_base']) )
$id_format = $control['id_base'] . '-__i__';
-
- $multi_number = $sidebar_args['_multi_num'];
}
$wp_registered_widgets[$widget_id]['callback'] = $wp_registered_widgets[$widget_id]['_callback'];
@@ -215,15 +215,11 @@ function wp_widget_control( $sidebar_args ) {
-
-
+
+
-\n";
-
- if ( isset($sidebar_args['_add']) )
- echo "\t\t\t\n"; ?>
+
+
diff --git a/wp-admin/js/widgets.dev.js b/wp-admin/js/widgets.dev.js
index 7119352337..3c8c64e1ed 100644
--- a/wp-admin/js/widgets.dev.js
+++ b/wp-admin/js/widgets.dev.js
@@ -20,9 +20,8 @@ wpWidgets = {
connectToSortable: '.widgets-sortables',
handle: '.widget-title',
distance: 2,
- tolerance: 'pointer',
- // forcePlaceholderSize: true,
helper: 'clone',
+ zIndex: 5,
start: function() {
wpWidgets.fixWebkit(1);
},
@@ -41,17 +40,17 @@ wpWidgets = {
handle: '.widget-title',
cursor: 'move',
distance: 2,
- tolerance: 'pointer',
- // forcePlaceholderSize: true,
- // helper: 'clone',
opacity: 0.65,
start: function(e,ui) {
wpWidgets.fixWebkit(1);
+ ui.item.find('.widget-inside').hide();
+ ui.item.css({'marginLeft':'','width':''});
},
stop: function(e,ui) {
var add = ui.item.find('input.add_new').val(), n = ui.item.find('input.multi_number').val(), id = ui.item.attr('id'), sb = $(this).parent().attr('id');
+ ui.item.css({'marginLeft':'','width':''});
- if ( add ) {
+ if ( add && n ) {
if ( 'multi' == add ) {
ui.item.html( ui.item.html().replace(/<[^<>]+>/g, function(m){ return m.replace(/__i__/g, n); }) );
ui.item.attr( 'id', id.replace(/__i__/g, n) );
@@ -92,7 +91,7 @@ wpWidgets = {
save : function(data, sb, del, t) {
var a;
- sb = sb || '';
+
$('#' + sb + ' .ajax-feedback').css('visibility', 'visible');
a = {
@@ -122,7 +121,7 @@ wpWidgets = {
});
}
} else {
- $(t).parents('.widget-inside').hide();
+ $(t).parents('.widget-inside').hide('fast');
}
});
},
@@ -130,15 +129,27 @@ wpWidgets = {
fixWebkit : function(n) {
n = n ? 'none' : '';
$('body').css({
- WebkitUserSelect: n,
- KhtmlUserSelect: n
+ WebkitUserSelect: n,
+ KhtmlUserSelect: n
});
},
addEvents : function(sc) {
sc = sc || document;
$('a.widget-action', sc).click(function(){
- $(this).parents('.widget-top').siblings('.widget-inside').toggle();
+ var w = parseInt( $(this).parents('.widget').find('.widget-width').val(), 10 ), css = {}, inside = $(this).parents('.widget-top').siblings('.widget-inside');
+ if ( inside.is(':hidden') ) {
+ if ( w > 270 && inside.parents('.widgets-sortables').length ) {
+ css['width'] = w + 30 + 'px';
+ if ( inside.parents('.widget-liquid-right').length )
+ css['marginLeft'] = 270 - w + 'px';
+ inside.parents('.widget').css(css);
+ }
+ inside.show('fast');
+ } else {
+ inside.parents('.widget').css({'width':'','marginLeft':''});
+ inside.hide('fast');
+ }
return false;
});
$('.widget-control-save', sc).click(function(){
diff --git a/wp-admin/js/widgets.js b/wp-admin/js/widgets.js
index d0e6b3ed4f..e8cd040a9a 100644
--- a/wp-admin/js/widgets.js
+++ b/wp-admin/js/widgets.js
@@ -1 +1 @@
-var wpWidgets;(function(a){wpWidgets={init:function(){var b;a("h3.sidebar-name").click(function(){var d=a(this).siblings(".widgets-sortables");if(d.is(":visible")){d.hide().sortable("disable")}else{d.show().sortable("enable").sortable("refresh")}a(this).siblings("#widget-list").toggle()});this.addEvents();a("#widget-list .widget").draggable({connectToSortable:".widgets-sortables",handle:".widget-title",distance:2,tolerance:"pointer",helper:"clone",start:function(){wpWidgets.fixWebkit(1)},stop:function(d,c){if(b){a(b).hide()}b="";wpWidgets.fixWebkit()}});a(".widgets-sortables").sortable({placeholder:"widget-placeholder",connectWith:".widgets-sortables",items:".widget",handle:".widget-title",cursor:"move",distance:2,tolerance:"pointer",opacity:0.65,start:function(d,c){wpWidgets.fixWebkit(1)},stop:function(f,c){var d=c.item.find("input.add_new").val(),i=c.item.find("input.multi_number").val(),h=c.item.attr("id"),g=a(this).parent().attr("id");if(d){if("multi"==d){c.item.html(c.item.html().replace(/<[^<>]+>/g,function(e){return e.replace(/__i__/g,i)}));c.item.attr("id",h.replace(/__i__/g,i));i++;a("li#"+h).find("input.multi_number").val(i)}else{if("single"==d){c.item.attr("id","new-"+h);b="li#"+h}}wpWidgets.addEvents(c.item);wpWidgets.save(c.item.find("form").serializeArray(),g,0);c.item.find("input.add_new").val("")}wpWidgets.saveOrder(g);wpWidgets.fixWebkit()},receive:function(d,c){if(!a(this).is(":visible")){a(this).sortable("cancel")}}}).not(":visible").sortable("disable")},saveOrder:function(c){a("#"+c+" .ajax-feedback").css("visibility","visible");var b={action:"widgets-order",savewidgets:a("#_wpnonce_widgets").val()};a(".widgets-sortables").each(function(){b[a(this).parent().attr("id")]=a(this).sortable("toArray").join(",")});a.post(ajaxurl,b,function(){a(".ajax-feedback").css("visibility","hidden")})},save:function(e,f,c,d){var b;f=f||"";a("#"+f+" .ajax-feedback").css("visibility","visible");b={action:"save-widget",savewidgets:a("#_wpnonce_widgets").val(),sidebar:f};if(c){b.delete_widget=1}a.map(e,function(h,g){b[h.name]=h.value});a.post(ajaxurl,b,function(g){var h;a(".ajax-feedback").css("visibility","hidden");if(!d){return}if(c){a(d).parents("li.widget").remove();if(!b.widget_number){h=b["widget-id"];a("#available-widgets .widget-id").each(function(){if(a(this).val()==h){a(this).parents("li.widget").show()}})}}else{a(d).parents(".widget-inside").hide()}})},fixWebkit:function(b){b=b?"none":"";a("body").css({WebkitUserSelect:b,KhtmlUserSelect:b})},addEvents:function(b){b=b||document;a("a.widget-action",b).click(function(){a(this).parents(".widget-top").siblings(".widget-inside").toggle();return false});a(".widget-control-save",b).click(function(){wpWidgets.save(a(this).parents("form").serializeArray(),a(this).parents(".widgets-holder-wrap").attr("id"),0,this);return false});a(".widget-control-remove",b).click(function(){wpWidgets.save(a(this).parents("form").serializeArray(),a(this).parents(".widgets-holder-wrap").attr("id"),1,this);return false})}};a(document).ready(function(){wpWidgets.init()})})(jQuery);
\ No newline at end of file
+var wpWidgets;(function(a){wpWidgets={init:function(){var b;a("h3.sidebar-name").click(function(){var d=a(this).siblings(".widgets-sortables");if(d.is(":visible")){d.hide().sortable("disable")}else{d.show().sortable("enable").sortable("refresh")}a(this).siblings("#widget-list").toggle()});this.addEvents();a("#widget-list .widget").draggable({connectToSortable:".widgets-sortables",handle:".widget-title",distance:2,helper:"clone",zIndex:5,start:function(){wpWidgets.fixWebkit(1)},stop:function(d,c){if(b){a(b).hide()}b="";wpWidgets.fixWebkit()}});a(".widgets-sortables").sortable({placeholder:"widget-placeholder",connectWith:".widgets-sortables",items:".widget",handle:".widget-title",cursor:"move",distance:2,opacity:0.65,start:function(d,c){wpWidgets.fixWebkit(1);c.item.find(".widget-inside").hide();c.item.css({marginLeft:"",width:""})},stop:function(f,c){var d=c.item.find("input.add_new").val(),i=c.item.find("input.multi_number").val(),h=c.item.attr("id"),g=a(this).parent().attr("id");c.item.css({marginLeft:"",width:""});if(d&&i){if("multi"==d){c.item.html(c.item.html().replace(/<[^<>]+>/g,function(e){return e.replace(/__i__/g,i)}));c.item.attr("id",h.replace(/__i__/g,i));i++;a("li#"+h).find("input.multi_number").val(i)}else{if("single"==d){c.item.attr("id","new-"+h);b="li#"+h}}wpWidgets.addEvents(c.item);wpWidgets.save(c.item.find("form").serializeArray(),g,0);c.item.find("input.add_new").val("")}wpWidgets.saveOrder(g);wpWidgets.fixWebkit()},receive:function(d,c){if(!a(this).is(":visible")){a(this).sortable("cancel")}}}).not(":visible").sortable("disable")},saveOrder:function(c){a("#"+c+" .ajax-feedback").css("visibility","visible");var b={action:"widgets-order",savewidgets:a("#_wpnonce_widgets").val()};a(".widgets-sortables").each(function(){b[a(this).parent().attr("id")]=a(this).sortable("toArray").join(",")});a.post(ajaxurl,b,function(){a(".ajax-feedback").css("visibility","hidden")})},save:function(e,f,c,d){var b;a("#"+f+" .ajax-feedback").css("visibility","visible");b={action:"save-widget",savewidgets:a("#_wpnonce_widgets").val(),sidebar:f};if(c){b.delete_widget=1}a.map(e,function(h,g){b[h.name]=h.value});a.post(ajaxurl,b,function(g){var h;a(".ajax-feedback").css("visibility","hidden");if(!d){return}if(c){a(d).parents("li.widget").remove();if(!b.widget_number){h=b["widget-id"];a("#available-widgets .widget-id").each(function(){if(a(this).val()==h){a(this).parents("li.widget").show()}})}}else{a(d).parents(".widget-inside").hide("fast")}})},fixWebkit:function(b){b=b?"none":"";a("body").css({WebkitUserSelect:b,KhtmlUserSelect:b})},addEvents:function(b){b=b||document;a("a.widget-action",b).click(function(){var d=parseInt(a(this).parents(".widget").find(".widget-width").val(),10),e={},c=a(this).parents(".widget-top").siblings(".widget-inside");if(c.is(":hidden")){if(d>270&&c.parents(".widgets-sortables").length){e.width=d+30+"px";if(c.parents(".widget-liquid-right").length){e.marginLeft=270-d+"px"}c.parents(".widget").css(e)}c.show("fast")}else{c.parents(".widget").css({width:"",marginLeft:""});c.hide("fast")}return false});a(".widget-control-save",b).click(function(){wpWidgets.save(a(this).parents("form").serializeArray(),a(this).parents(".widgets-holder-wrap").attr("id"),0,this);return false});a(".widget-control-remove",b).click(function(){wpWidgets.save(a(this).parents("form").serializeArray(),a(this).parents(".widgets-holder-wrap").attr("id"),1,this);return false})}};a(document).ready(function(){wpWidgets.init()})})(jQuery);
\ No newline at end of file
diff --git a/wp-admin/widgets.php b/wp-admin/widgets.php
index 2b06451a18..82c4264bc9 100644
--- a/wp-admin/widgets.php
+++ b/wp-admin/widgets.php
@@ -126,18 +126,14 @@ $messages = array(
require_once( 'admin-header.php' ); ?>
-
-
-
-
-
-
This page is not 100% ready, please use only on test installations.
-
-