Changeset 10916
- Timestamp:
- 04/13/2009 01:17:59 AM (16 years ago)
- Location:
- trunk/wp-admin
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/css/colors-classic.css
r10912 r10916 1573 1573 border-color: #DDDDDD; 1574 1574 } 1575 1576 .sidebar-name:hover { 1577 color: #d54e21; 1578 } 1579 -
trunk/wp-admin/css/colors-fresh.css
r10912 r10916 1575 1575 border-color: #DDDDDD; 1576 1576 } 1577 1578 .sidebar-name:hover { 1579 color: #d54e21; 1580 } 1581 -
trunk/wp-admin/css/widgets.css
r10912 r10916 20 20 width: 300px; 21 21 margin: 15px 0 18px; 22 position: relative; 22 23 } 23 24 … … 91 92 92 93 .widget .widget-inside { 93 margin: 15px;94 padding: 15px; 94 95 font-size: 11px; 95 96 display: none; -
trunk/wp-admin/includes/widgets.php
r10913 r10916 178 178 $widget_number = isset($control['params'][0]['number']) ? $control['params'][0]['number'] : ''; 179 179 $id_base = isset($control['id_base']) ? $control['id_base'] : $widget_id; 180 $multi_number = isset($sidebar_args['_multi_num']) ? $sidebar_args['_multi_num'] : ''; 181 $add_new = isset($sidebar_args['_add']) ? $sidebar_args['_add'] : ''; 180 182 181 183 // We aren't showing a widget control, we're outputing a template for a mult-widget control … … 186 188 if ( isset($control['id_base']) ) 187 189 $id_format = $control['id_base'] . '-__i__'; 188 189 $multi_number = $sidebar_args['_multi_num'];190 190 } 191 191 … … 216 216 <input type="hidden" name="widget-id" class="widget-id" value="<?php echo $id_format; ?>" /> 217 217 <input type="hidden" name="id_base" class="id_base" value="<?php echo $id_base; ?>" /> 218 <input type="hidden" name="widget-width" value="<?php echo $control['width']; ?>" />219 <input type="hidden" name="widget-height" value="<?php echo $control['height']; ?>" />218 <input type="hidden" name="widget-width" class="widget-width" value="<?php echo $control['width']; ?>" /> 219 <input type="hidden" name="widget-height" class="widget-height" value="<?php echo $control['height']; ?>" /> 220 220 <input type="hidden" name="widget_number" class="widget_number" value="<?php echo $widget_number; ?>" /> 221 <?php 222 if ( isset($multi_number) ) 223 echo "\t\t\t<input type='hidden' name='multi_number' class='multi_number' value='$multi_number' />\n"; 224 225 if ( isset($sidebar_args['_add']) ) 226 echo "\t\t\t<input type='hidden' name='add_new' class='add_new' value='" . $sidebar_args['_add'] . "' />\n"; ?> 221 <input type="hidden" name="multi_number" class="multi_number" value="<?php echo $multi_number; ?>" /> 222 <input type="hidden" name="add_new" class="add_new" value="<?php echo $add_new; ?>" /> 227 223 228 224 <div class="widget-control-actions"> -
trunk/wp-admin/js/widgets.dev.js
r10912 r10916 21 21 handle: '.widget-title', 22 22 distance: 2, 23 tolerance: 'pointer',24 // forcePlaceholderSize: true,25 23 helper: 'clone', 24 zIndex: 5, 26 25 start: function() { 27 26 wpWidgets.fixWebkit(1); … … 42 41 cursor: 'move', 43 42 distance: 2, 44 tolerance: 'pointer',45 // forcePlaceholderSize: true,46 // helper: 'clone',47 43 opacity: 0.65, 48 44 start: function(e,ui) { 49 45 wpWidgets.fixWebkit(1); 46 ui.item.find('.widget-inside').hide(); 47 ui.item.css({'marginLeft':'','width':''}); 50 48 }, 51 49 stop: function(e,ui) { 52 50 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'); 51 ui.item.css({'marginLeft':'','width':''}); 53 52 54 if ( add ) {53 if ( add && n ) { 55 54 if ( 'multi' == add ) { 56 55 ui.item.html( ui.item.html().replace(/<[^<>]+>/g, function(m){ return m.replace(/__i__/g, n); }) ); … … 93 92 save : function(data, sb, del, t) { 94 93 var a; 95 sb = sb || ''; 94 96 95 $('#' + sb + ' .ajax-feedback').css('visibility', 'visible'); 97 96 … … 123 122 } 124 123 } else { 125 $(t).parents('.widget-inside').hide( );124 $(t).parents('.widget-inside').hide('fast'); 126 125 } 127 126 }); … … 131 130 n = n ? 'none' : ''; 132 131 $('body').css({ 133 134 132 WebkitUserSelect: n, 133 KhtmlUserSelect: n 135 134 }); 136 135 }, … … 139 138 sc = sc || document; 140 139 $('a.widget-action', sc).click(function(){ 141 $(this).parents('.widget-top').siblings('.widget-inside').toggle(); 140 var w = parseInt( $(this).parents('.widget').find('.widget-width').val(), 10 ), css = {}, inside = $(this).parents('.widget-top').siblings('.widget-inside'); 141 if ( inside.is(':hidden') ) { 142 if ( w > 270 && inside.parents('.widgets-sortables').length ) { 143 css['width'] = w + 30 + 'px'; 144 if ( inside.parents('.widget-liquid-right').length ) 145 css['marginLeft'] = 270 - w + 'px'; 146 inside.parents('.widget').css(css); 147 } 148 inside.show('fast'); 149 } else { 150 inside.parents('.widget').css({'width':'','marginLeft':''}); 151 inside.hide('fast'); 152 } 142 153 return false; 143 154 }); -
trunk/wp-admin/js/widgets.js
r10912 r10916 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);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,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); -
trunk/wp-admin/widgets.php
r10912 r10916 127 127 require_once( 'admin-header.php' ); ?> 128 128 129 <div class="wrap"> 130 <?php screen_icon(); ?> 131 <h2><?php echo wp_specialchars( $title ); ?></h2> 132 129 133 <?php if ( isset($_GET['message']) && isset($messages[$_GET['message']]) ) : ?> 130 134 <div id="message" class="updated fade"><p><?php echo $messages[$_GET['message']]; ?></p></div> 131 135 <?php endif; ?> 132 133 134 <div id="message" class="updated"><p>This page is not 100% ready, please use only on test installations.</p></div>135 136 137 <div class="wrap">138 <?php screen_icon(); ?>139 <h2><?php echo wp_specialchars( $title ); ?></h2>140 136 141 137
Note: See TracChangeset
for help on using the changeset viewer.