Changeset 11160
- Timestamp:
- 05/03/2009 05:27:13 AM (16 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/css/colors-classic.css
r11146 r11160 427 427 } 428 428 429 div#available-widgets-filter,430 429 .commentlist li { 431 430 border-bottom-color: #ccc; … … 609 608 610 609 .widget, 610 #widget-list .widget-top, 611 611 .postbox, 612 612 #titlediv, … … 981 981 #post-status-info, 982 982 #titlediv #title, 983 .editwidget .widget- control{983 .editwidget .widget-inside { 984 984 border-color: #dfdfdf; 985 985 } … … 1605 1605 } 1606 1606 1607 div.widgets-holder-wrap { 1608 background-color: #f1f1f1; 1607 div.widgets-sortables, 1608 #widgets-left .inactive { 1609 background-color: #f1f1f1; 1609 1610 border-color: #ddd; 1611 } 1612 1613 #available-widgets .widget-holder { 1614 background-color: #fff; 1615 border-color: #ddd; 1616 } 1617 1618 #widgets-left h3.sidebar-name { 1619 background-color: #aaa; 1620 background-image: url(../images/ed-bg-vs.gif); 1621 text-shadow: #FFFFFF 0 -1px 0; 1622 border-color: #dfdfdf; 1623 } 1624 1625 #widgets-right h3.sidebar-name { 1626 background-image: url(../images/fav.png); 1627 text-shadow: #3f3f3f 0 -1px 0; 1628 background-color: #636363; 1629 border-color: #636363; 1630 color: #fff; 1610 1631 } 1611 1632 -
trunk/wp-admin/css/colors-fresh.css
r11146 r11160 1 1 html { 2 2 background-color: #f9f9f9; 3 } 4 5 * html input, 6 * html .widget { 7 border-color: #dfdfdf; 8 } 9 10 textarea, 11 input, 12 select { 13 border-color: #DFDFDF; 14 } 15 16 kbd, 17 code { 18 background: #eaeaea; 19 } 20 21 input[readonly] { 22 background-color: #eee; 3 23 } 4 24 … … 28 48 body > #upload-menu { 29 49 border-bottom-color: #fff; 30 }31 32 kbd, code {33 background: #eaeaea;34 50 } 35 51 … … 403 419 } 404 420 405 div#available-widgets-filter,406 421 .commentlist li { 407 422 border-bottom-color: #ccc; … … 606 621 607 622 .widget, 623 #widget-list .widget-top, 608 624 .postbox, 609 625 #titlediv, … … 948 964 #post-status-info, 949 965 #titlediv #title, 950 .editwidget .widget- control{966 .editwidget .widget-inside { 951 967 border-color: #dfdfdf; 952 968 } … … 1550 1566 } 1551 1567 1552 input[readonly] {1553 background-color: #eee;1554 }1555 1556 1568 .popular-tags, 1557 1569 .feature-filter { … … 1568 1580 } 1569 1581 1570 div.widgets-holder-wrap { 1571 background-color: #F1F1F1; 1572 border-color: #DDDDDD; 1582 div.widgets-sortables, 1583 #widgets-left .inactive { 1584 background-color: #f1f1f1; 1585 border-color: #ddd; 1586 } 1587 1588 #available-widgets .widget-holder { 1589 background-color: #fff; 1590 border-color: #ddd; 1591 } 1592 1593 #widgets-left h3.sidebar-name { 1594 background-color: #aaa; 1595 background-image: url(../images/ed-bg.gif); 1596 text-shadow: #FFFFFF 0 -1px 0; 1597 border-color: #dfdfdf; 1598 } 1599 1600 #widgets-right h3.sidebar-name { 1601 background-image: url(../images/fav.png); 1602 text-shadow: #3f3f3f 0 -1px 0; 1603 background-color: #636363; 1604 border-color: #636363; 1605 color: #fff; 1573 1606 } 1574 1607 … … 1576 1609 color: #d54e21; 1577 1610 } 1578 1579 textarea,1580 input,1581 select {1582 border-color: #DFDFDF;1583 }1584 1585 * html input,1586 * html .widget {1587 border-color: #dfdfdf;1588 } -
trunk/wp-admin/css/widgets.css
r11133 r11160 1 html, 2 body { 3 min-width: 950px; 4 } 5 1 6 /* 2 column liquid layout */ 2 7 div.widget-liquid-left { … … 8 13 9 14 div#widgets-left { 10 margin-right: 335px; 15 margin-left: 5px; 16 margin-right: 325px; 17 } 18 19 div#widgets-right { 20 width: 285px; 21 margin: 0 auto; 11 22 } 12 23 … … 14 25 float: right; 15 26 clear: right; 16 width: 320px;17 }18 19 .widgets-sortables li {20 27 width: 300px; 21 margin: 15px 0 18px; 28 } 29 30 .widget-liquid-right .widget, 31 #wp_inactive_widgets .widget { 32 width: 250px; 33 margin: 0 auto 20px; 22 34 position: relative; 23 35 } 24 36 25 #widgets-left .widgets-sortables li, 26 #widgets-left #widget-list li { 27 float: left; 28 margin: 0 15px 18px 3px; 29 width: 300px; 30 } 31 32 .widget-placeholder { 33 border-width: 1px; 34 border-style: dashed; 35 margin-bottom: 20px; 36 height: 25px; 37 width: 298px; 38 } 39 40 div.widgets-holder-wrap { 41 padding: 8px 8px 0; 42 margin: 12px 0; 37 #wp_inactive_widgets .widget { 38 margin: 0 10px 20px; 39 float: left; 40 } 41 42 .widget-liquid-right .sidebar-name { 43 width: 256px; 44 } 45 46 h3.sidebar-name { 47 background-repeat: repeat-x; 48 background-position: 0 0; 49 margin: 0; 50 cursor: pointer; 51 font-size: 13px; 52 padding: 5px 12px; 43 53 border-width: 1px; 44 54 border-style: solid; 45 -moz-border-radius: 6px; 55 -moz-border-radius-topleft: 8px; 56 -moz-border-radius-topright: 8px; 57 -webkit-border-top-right-radius: 8px; 58 -webkit-border-top-left-radius: 8px; 59 -khtml-border-top-right-radius: 8px; 60 -khtml-border-top-left-radius: 8px; 61 border-top-right-radius: 8px; 62 border-top-left-radius: 8px; 63 } 64 65 .js .closed h3.sidebar-name { 66 -moz-border-radius-bottomleft: 8px; 67 -moz-border-radius-bottomright: 8px; 68 -webkit-border-bottom-right-radius: 8px; 69 -webkit-border-bottom-left-radius: 8px; 70 -khtml-border-bottom-right-radius: 8px; 71 -khtml-border-bottom-left-radius: 8px; 72 border-bottom-right-radius: 8px; 73 border-bottom-left-radius: 8px; 74 } 75 76 .widget-liquid-right .widgets-sortables, 77 #widgets-left .widget-holder { 78 border-width: 0 1px 1px; 79 border-style: none solid solid; 80 -moz-border-radius-bottomleft: 8px; 81 -moz-border-radius-bottomright: 8px; 82 -webkit-border-bottom-right-radius: 8px; 83 -webkit-border-bottom-left-radius: 8px; 84 -khtml-border-bottom-right-radius: 8px; 85 -khtml-border-bottom-left-radius: 8px; 86 border-bottom-right-radius: 8px; 87 border-bottom-left-radius: 8px; 88 } 89 90 .js .closed .widgets-sortables, 91 .js .closed .widget-holder { 92 display: none; 93 } 94 95 .widget-liquid-right .widgets-sortables { 96 padding: 15px 0 0; 97 width: 280px; 98 } 99 100 #available-widgets .widget-holder { 101 padding: 15px 5px 0; 102 } 103 104 #wp_inactive_widgets { 105 padding: 5px 5px 0; 106 } 107 108 #widget-list .widget { 109 width: 250px; 110 margin: 0 10px 15px; 111 border: 0 none; 112 float: left; 113 } 114 115 #widget-list .widget-description { 116 padding: 5px 8px; 117 } 118 119 #widget-list .widget-top { 120 border-width: 1px; 121 border-style: solid; 122 -moz-border-radius: 6px; 46 123 -khtml-border-radius: 6px; 47 124 -webkit-border-radius: 6px; … … 49 126 } 50 127 128 .widget-placeholder { 129 border-width: 1px; 130 border-style: dashed; 131 margin: 0 auto 20px; 132 height: 26px; 133 width: 250px; 134 } 135 136 #wp_inactive_widgets .widget-placeholder { 137 margin: 0 10px 20px; 138 float: left; 139 } 140 141 div.widgets-holder-wrap { 142 padding: 0; 143 margin: 10px 0 20px; 144 } 145 51 146 #widgets-left #available-widgets { 52 147 background-color: transparent; 53 148 border: 0 none; 54 }55 56 div#available-widgets-filter {57 border-bottom-width: 1px;58 border-bottom-style: solid;59 149 } 60 150 … … 73 163 74 164 .widget-top .widget-title { 75 margin-right: 30px;76 165 padding: 7px 9px; 77 166 } … … 81 170 } 82 171 83 .widget-title-action a{172 a.widget-action { 84 173 display: block; 85 174 width: 24px; … … 87 176 } 88 177 89 .widget-top:hover .widget-title-action a { 178 #available-widgets a.widget-action { 179 display: none; 180 } 181 182 .widget-top:hover a.widget-action { 90 183 background: url("../images/menu-bits.gif") no-repeat scroll 0 -110px; 91 184 } 92 185 93 .widget .widget-inside { 186 .widget .widget-inside, 187 .widget .widget-description { 94 188 padding: 15px; 95 189 font-size: 11px; 96 display: none;97 } 98 99 .widget- control,190 line-height: 16px; 191 } 192 193 .widget-inside, 100 194 .widget-description { 101 195 display: none; 102 196 } 103 197 104 #available-widgets .widget-description, 105 .widget-liquid-right .widget-control, 106 #wp_inactive_widgets .widget-control { 107 display: block; 108 } 109 110 .widget .widget-control p { 198 #available-widgets .widget-description { 199 display: block; 200 } 201 202 .widget .widget-inside p { 111 203 margin: 0 0 1em; 112 204 padding: 0; … … 118 210 } 119 211 120 .sidebar-name {121 margin: 0 0 12px;122 padding: 6px;123 cursor: pointer;124 }125 126 212 .widgets-sortables { 127 min-height: 50px;213 min-height: 90px; 128 214 } 129 215 … … 149 235 150 236 .widget-control-edit { 151 font-size: 10px; 237 display: block; 238 font-size: 11px; 152 239 font-weight: normal; 153 } 154 155 .editwidget .widget-control { 240 line-height: 24px; 241 padding: 0 8px 0 0; 242 } 243 244 a.widget-control-edit { 245 text-decoration: none; 246 } 247 248 .widget-control-edit .add, 249 .widget-control-edit .edit { 250 display: none; 251 } 252 253 #available-widgets .widget-control-edit .add { 254 display: block; 255 } 256 257 #widgets-right .widget-control-edit .edit, 258 #wp_inactive_widgets .widget-control-edit .edit { 259 display: block; 260 } 261 262 .editwidget { 263 margin: 0 auto 15px; 264 } 265 266 .editwidget .widget-inside { 156 267 display: block; 157 268 border-width: 1px; … … 164 275 } 165 276 166 .widget-position table { 167 width: 100%; 168 margin-top: 12px; 169 } 170 171 .widget-position table td { 172 height: 3em; 173 line-height: 3em; 174 vertical-align: middle; 175 } 176 177 #wp_inactive_widgets .sidebar-name { 178 margin: 0; 179 padding: 2px 0; 180 } 181 182 #wp_inactive_widgets p.description { 183 margin: 0 0 15px; 184 } 277 #widgets-left p.description { 278 margin: 5px 15px 8px; 279 } 280 281 .widget-position { 282 margin-top: 8px; 283 } 284 285 .inactive { 286 padding-top: 2px; 287 } -
trunk/wp-admin/includes/widgets.php
r11155 r11160 20 20 global $wp_registered_widgets, $sidebars_widgets, $wp_registered_widget_controls; 21 21 22 $no_widgets_shown = true; 23 $already_shown = array(); ?> 24 25 <ul id="widget-list"> 26 <?php 27 foreach ( $wp_registered_widgets as $name => $widget ) { 28 if ( in_array( $widget['callback'], $already_shown ) ) // We already showed this multi-widget 22 $done = array(); 23 $sort = array_keys($wp_registered_widgets); 24 natcasesort($sort); ?> 25 26 <div class="widget-holder"> 27 <div id="widget-list"> 28 <?php 29 foreach ( $sort as $val ) { 30 $widget = $wp_registered_widgets[$val]; 31 if ( in_array( $widget['callback'], $done, true ) ) // We already showed this multi-widget 29 32 continue; 30 33 31 34 $sidebar = is_active_widget( $widget['callback'], $widget['id'] ); 35 $done[] = $widget['callback']; 32 36 33 37 if ( ! isset( $widget['params'][0] ) ) 34 38 $widget['params'][0] = array(); 35 36 $already_shown[] = $widget['callback'];37 $no_widgets_shown = false;38 39 39 40 $args = array( 'widget_id' => $widget['id'], 'widget_name' => $widget['name'], '_display' => 'template' ); … … 52 53 $args = wp_list_widget_controls_dynamic_sidebar( array( 0 => $args, 1 => $widget['params'][0] ) ); 53 54 call_user_func_array( 'wp_widget_control', $args ); 54 } 55 56 if ( $no_widgets_shown ) 57 echo '<li>' . __( 'No matching widgets' ) . "</li>\n"; ?> 58 </ul> 55 } ?> 56 </div> 57 <br class='clear' /> 58 </div> 59 59 <?php 60 60 } … … 67 67 * @param string $sidebar 68 68 */ 69 function wp_list_widget_controls( $sidebar , $hide = false) {69 function wp_list_widget_controls( $sidebar ) { 70 70 add_filter( 'dynamic_sidebar_params', 'wp_list_widget_controls_dynamic_sidebar' ); 71 ?> 72 73 <ul class="widgets-sortables<?php echo $hide ? ' hide-if-js' : ''; ?>"> 74 <?php dynamic_sidebar( $sidebar ); ?> 75 </ul> 76 77 <?php 71 72 echo "\t<div id='$sidebar' class='widgets-sortables'>\n"; 73 dynamic_sidebar( $sidebar ); 74 echo "\t</div>\n"; 78 75 } 79 76 … … 95 92 $hidden = isset($params[0]['_hide']) ? ' style="display:none;"' : ''; 96 93 97 $params[0]['before_widget'] = "< liid='widget-${i}_$id' class='widget'$hidden>";98 $params[0]['after_widget'] = "</ li>";94 $params[0]['before_widget'] = "<div id='widget-${i}_$id' class='widget'$hidden>"; 95 $params[0]['after_widget'] = "</div>"; 99 96 $params[0]['before_title'] = "%BEG_OF_TITLE%"; // deprecated 100 97 $params[0]['after_title'] = "%END_OF_TITLE%"; // deprecated … … 172 169 <div class="widget-top"> 173 170 <div class="widget-title-action"> 174 <a class="widget-action widget-control-edit" href="<?php echo clean_url( add_query_arg( $query_arg ) ); ?>"></a> 171 <a class="widget-action hide-if-no-js" href="#available-widgets"></a> 172 <a class="widget-control-edit hide-if-js" href="<?php echo clean_url( add_query_arg( $query_arg ) ); ?>"><span class="edit"><?php _e('Edit'); ?></span><span class="add"><?php _e('Add'); ?></span></a> 175 173 </div> 176 174 <div class="widget-title"><h4><?php echo $widget_title ?></h4></div> … … 179 177 <div class="widget-inside"> 180 178 <form action="" method="post"> 181 <div class="widget-control">182 179 <?php 183 180 if ( isset($control['callback']) ) … … 201 198 <br class="clear" /> 202 199 </div> 203 </div>204 200 </form> 201 </div> 205 202 206 203 <div class="widget-description"> 207 204 <?php echo ( $widget_description = wp_widget_description($widget_id) ) ? "$widget_description\n" : "$widget_title\n"; ?> 208 205 </div> 209 </div>210 206 <?php 211 207 echo $sidebar_args['after_widget']; -
trunk/wp-admin/js/widgets.dev.js
r11093 r11160 5 5 wpWidgets = { 6 6 init : function() { 7 var rem; 8 $('h3.sidebar-name').click(function(){ 7 var rem, hr = $('#available-widgets .widget-holder').height(), firstsb = $('#widgets-right .widgets-holder-wrap .widgets-sortables:first'), hl = firstsb.height(); 8 9 $('#widgets-right h3.sidebar-name').click(function(){ 9 10 var c = $(this).siblings('.widgets-sortables'); 10 11 if ( c.is(':visible') ) { 11 12 c.hide().sortable('disable'); 13 $(this).parent().addClass('closed'); 12 14 } else { 13 15 c.show().sortable('enable').sortable('refresh'); 16 $(this).parent().removeClass('closed'); 14 17 } 15 $(this).siblings('#widget-list').toggle();16 18 }); 17 this.addEvents(); 19 20 $('#widgets-left h3.sidebar-name').click(function(){ 21 if ( $(this).siblings('.widget-holder').is(':visible') ) { 22 $(this).parent().addClass('closed'); 23 } else { 24 $(this).parent().removeClass('closed'); 25 } 26 }); 27 28 if ( hr > hl ) 29 firstsb.css('minHeight', hr + 'px'); 30 31 this.addEvents(); 18 32 $('.widget-error').parents('.widget').find('a.widget-action').click(); 19 33 … … 24 38 helper: 'clone', 25 39 zIndex: 5, 26 start: function( ) {40 start: function(e,ui) { 27 41 wpWidgets.fixWebkit(1); 42 ui.helper.find('.widget-description').hide(); 28 43 }, 29 44 stop: function(e,ui) { … … 49 64 }, 50 65 stop: function(e,ui) { 51 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');66 var add = ui.item.find('input.add_new').val(), n = ui.item.find('input.multi_number').val(), id = ui.item.attr('id'), sb = $(this).attr('id'); 52 67 ui.item.css({'marginLeft':'','width':''}); 53 68 … … 57 72 ui.item.attr( 'id', id.replace(/__i__/g, n) ); 58 73 n++; 59 $(' li#' + id).find('input.multi_number').val(n);74 $('div#' + id).find('input.multi_number').val(n); 60 75 } else if ( 'single' == add ) { 61 76 ui.item.attr( 'id', 'new-' + id ); 62 rem = ' li#' + id;77 rem = 'div#' + id; 63 78 } 64 79 wpWidgets.addEvents(ui.item); … … 79 94 80 95 saveOrder : function(sb) { 81 $('#' + sb + '.ajax-feedback').css('visibility', 'visible');96 $('#' + sb).parents('.widgets-holder-wrap').find('.ajax-feedback').css('visibility', 'visible'); 82 97 83 98 var a = { … … 88 103 89 104 $('.widgets-sortables').each( function() { 90 a['sidebars[' + $(this). parent().attr('id') + ']'] = $(this).sortable('toArray').join(',');105 a['sidebars[' + $(this).attr('id') + ']'] = $(this).sortable('toArray').join(','); 91 106 }); 92 107 … … 97 112 98 113 save : function(data, sb, del, t) { 99 $('#' + sb + '.ajax-feedback').css('visibility', 'visible');114 $('#' + sb).parents('.widgets-holder-wrap').find('.ajax-feedback').css('visibility', 'visible'); 100 115 101 116 var a = { … … 117 132 118 133 if ( del ) { 119 $(t).parents(' li.widget').slideUp('normal', function(){ $(this).remove(); });134 $(t).parents('.widget').slideUp('normal', function(){ $(this).remove(); }); 120 135 if ( !a.widget_number ) { 121 136 id = a['widget-id']; 122 137 $('#available-widgets .widget-id').each(function(){ 123 138 if ( $(this).val() == id ) 124 $(this).parents(' li.widget').show();139 $(this).parents('.widget').show(); 125 140 }); 126 141 } 127 142 } else { 128 $(t).parents('.widget-inside').slideUp('normal', function(){ $(this).parents(' li.widget').css({'width':'','marginLeft':''}); });143 $(t).parents('.widget-inside').slideUp('normal', function(){ $(this).parents('.widget').css({'width':'','marginLeft':''}); }); 129 144 } 130 145 }); … … 144 159 var w = parseInt( $(this).parents('.widget').find('.widget-width').val(), 10 ), css = {}, inside = $(this).parents('.widget-top').siblings('.widget-inside'); 145 160 if ( inside.is(':hidden') ) { 146 if ( w > 2 70 && inside.parents('.widgets-sortables').length ) {161 if ( w > 250 && inside.parents('.widgets-sortables').length ) { 147 162 css['width'] = w + 30 + 'px'; 148 163 if ( inside.parents('.widget-liquid-right').length ) 149 css['marginLeft'] = 2 70- w + 'px';164 css['marginLeft'] = 234 - w + 'px'; 150 165 inside.parents('.widget').css(css); 151 166 } … … 157 172 }); 158 173 $('.widget-control-save', sc).click(function(){ 159 wpWidgets.save( $(this).parents('form').serializeArray(), $(this).parents('.widgets- holder-wrap').attr('id'), 0, this );174 wpWidgets.save( $(this).parents('form').serializeArray(), $(this).parents('.widgets-sortables').attr('id'), 0, this ); 160 175 return false; 161 176 }); 162 177 $('.widget-control-remove', sc).click(function(){ 163 wpWidgets.save( $(this).parents('form').serializeArray(), $(this).parents('.widgets- holder-wrap').attr('id'), 1, this );178 wpWidgets.save( $(this).parents('form').serializeArray(), $(this).parents('.widgets-sortables').attr('id'), 1, this ); 164 179 return false; 165 180 }); -
trunk/wp-admin/js/widgets.js
r11093 r11160 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-error").parents(".widget").find("a.widget-action").click();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){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,0);c.item.find("input.add_new").val("");c.item.find("a.widget-action").click()}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(),sidebars:[]};a(".widgets-sortables").each(function(){b["sidebars["+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){a("#"+f+" .ajax-feedback").css("visibility","visible");var 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").slideUp("normal",function(){a(this).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").slideUp("normal",function(){a(this).parents("li.widget").css({width:"",marginLeft:""})})}})},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.slideDown("normal")}else{c.slideUp("normal",function(){c.parents(".widget").css({width:"",marginLeft:""})})}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 e,d=a("#available-widgets .widget-holder").height(),c=a("#widgets-right .widgets-holder-wrap .widgets-sortables:first"),b=c.height();a("#widgets-right h3.sidebar-name").click(function(){var f=a(this).siblings(".widgets-sortables");if(f.is(":visible")){f.hide().sortable("disable");a(this).parent().addClass("closed")}else{f.show().sortable("enable").sortable("refresh");a(this).parent().removeClass("closed")}});a("#widgets-left h3.sidebar-name").click(function(){if(a(this).siblings(".widget-holder").is(":visible")){a(this).parent().addClass("closed")}else{a(this).parent().removeClass("closed")}});if(d>b){c.css("minHeight",d+"px")}this.addEvents();a(".widget-error").parents(".widget").find("a.widget-action").click();a("#widget-list .widget").draggable({connectToSortable:".widgets-sortables",handle:".widget-title",distance:2,helper:"clone",zIndex:5,start:function(g,f){wpWidgets.fixWebkit(1);f.helper.find(".widget-description").hide()},stop:function(g,f){if(e){a(e).hide()}e="";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(g,f){wpWidgets.fixWebkit(1);f.item.find(".widget-inside").hide();f.item.css({marginLeft:"",width:""})},stop:function(h,f){var g=f.item.find("input.add_new").val(),k=f.item.find("input.multi_number").val(),j=f.item.attr("id"),i=a(this).attr("id");f.item.css({marginLeft:"",width:""});if(g){if("multi"==g){f.item.html(f.item.html().replace(/<[^<>]+>/g,function(l){return l.replace(/__i__/g,k)}));f.item.attr("id",j.replace(/__i__/g,k));k++;a("div#"+j).find("input.multi_number").val(k)}else{if("single"==g){f.item.attr("id","new-"+j);e="div#"+j}}wpWidgets.addEvents(f.item);wpWidgets.save(f.item.find("form").serializeArray(),i,0,0);f.item.find("input.add_new").val("");f.item.find("a.widget-action").click()}wpWidgets.saveOrder(i);wpWidgets.fixWebkit()},receive:function(g,f){if(!a(this).is(":visible")){a(this).sortable("cancel")}}}).not(":visible").sortable("disable")},saveOrder:function(c){a("#"+c).parents(".widgets-holder-wrap").find(".ajax-feedback").css("visibility","visible");var b={action:"widgets-order",savewidgets:a("#_wpnonce_widgets").val(),sidebars:[]};a(".widgets-sortables").each(function(){b["sidebars["+a(this).attr("id")+"]"]=a(this).sortable("toArray").join(",")});a.post(ajaxurl,b,function(){a(".ajax-feedback").css("visibility","hidden")})},save:function(e,f,c,d){a("#"+f).parents(".widgets-holder-wrap").find(".ajax-feedback").css("visibility","visible");var 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(".widget").slideUp("normal",function(){a(this).remove()});if(!b.widget_number){h=b["widget-id"];a("#available-widgets .widget-id").each(function(){if(a(this).val()==h){a(this).parents(".widget").show()}})}}else{a(d).parents(".widget-inside").slideUp("normal",function(){a(this).parents(".widget").css({width:"",marginLeft:""})})}})},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>250&&c.parents(".widgets-sortables").length){e.width=d+30+"px";if(c.parents(".widget-liquid-right").length){e.marginLeft=234-d+"px"}c.parents(".widget").css(e)}c.slideDown("normal")}else{c.slideUp("normal",function(){c.parents(".widget").css({width:"",marginLeft:""})})}return false});a(".widget-control-save",b).click(function(){wpWidgets.save(a(this).parents("form").serializeArray(),a(this).parents(".widgets-sortables").attr("id"),0,this);return false});a(".widget-control-remove",b).click(function(){wpWidgets.save(a(this).parents("form").serializeArray(),a(this).parents(".widgets-sortables").attr("id"),1,this);return false})}};a(document).ready(function(){wpWidgets.init()})})(jQuery); -
trunk/wp-admin/widgets.php
r11150 r11160 256 256 257 257 <form action="widgets.php" method="post"> 258 <div class="widget- control">258 <div class="widget-inside"> 259 259 <?php call_user_func_array( $control_callback, $control['params'] ); ?> 260 260 </div> 261 261 262 <p class="describe"><?php _e('Select both the sidebar for this widget and the position of the widget in that sidebar.'); ?></p> 262 263 <div class="widget-position"> 263 264 <table class="widefat"><thead><tr><th><?php _e('Sidebar'); ?></th><th><?php _e('Position'); ?></th></tr></thead><tbody> … … 300 301 <input type="hidden" name="multi_number" class="multi_number" value="<?php echo attr($multi_number); ?>" /> 301 302 <?php wp_nonce_field("save-delete-widget-$widget_id"); ?> 303 <br class="clear" /> 302 304 </div> 303 305 </form> … … 342 344 </div> 343 345 344 <div id="wp_inactive_widgets"class="widgets-holder-wrap">346 <div class="widgets-holder-wrap"> 345 347 <h3 class="sidebar-name"><?php _e('Inactive Widgets'); ?> 346 348 <span><img src="images/wpspin.gif" class="ajax-feedback" title="" alt="" /></span></h3> 347 <p class="description"><?php _e('Drag widgets here to remove them from the web site but keep their settings.'); ?></p> 349 <div class="widget-holder inactive"> 350 <p class="description"><?php _e('Drag widgets here to remove them from the sidebar but keep their settings.'); ?></p> 348 351 <?php wp_list_widget_controls('wp_inactive_widgets'); ?> 349 352 <br class="clear" /> 353 </div> 350 354 </div> 351 355 </div> … … 353 357 354 358 <div class="widget-liquid-right"> 359 <div id="widgets-right"> 355 360 <?php 356 361 $i = 0; 357 362 foreach ( $wp_registered_sidebars as $sidebar => $registered_sidebar ) { 358 363 if ( 'wp_inactive_widgets' == $sidebar ) 359 continue; ?> 360 <div id="<?php echo attr( $sidebar ); ?>" class="widgets-holder-wrap"> 364 continue; 365 $closed = $i ? ' closed' : ''; ?> 366 <div class="widgets-holder-wrap<?php echo $closed; ?>"> 361 367 <h3 class="sidebar-name"><?php echo wp_specialchars( $registered_sidebar['name'] ); ?> 362 368 <span><img src="images/wpspin.gif" class="ajax-feedback" title="" alt="" /></span></h3> 363 <?php wp_list_widget_controls( $sidebar , $i); // Show the control forms for each of the widgets in this sidebar ?>369 <?php wp_list_widget_controls( $sidebar ); // Show the control forms for each of the widgets in this sidebar ?> 364 370 </div> 365 371 <?php 366 372 $i++; 367 373 } ?> 374 </div> 368 375 </div> 369 376 <form action="" method="post"> -
trunk/wp-includes/default-widgets.php
r11109 r11160 577 577 <p><label for="<?php echo $this->get_field_id('number'); ?>"> 578 578 <?php _e('Number of posts to show:'); ?> 579 <input id="<?php echo $this->get_field_id('number'); ?>" name="<?php echo $this->get_field_name('number'); ?>" type="text" value="<?php echo $number; ?>" /></label>579 <input id="<?php echo $this->get_field_id('number'); ?>" name="<?php echo $this->get_field_name('number'); ?>" type="text" value="<?php echo $number; ?>" size="3" /></label> 580 580 <br /><small><?php _e('(at most 15)'); ?></small></p> 581 581 <?php … … 664 664 <p><label for="<?php echo $this->get_field_id('number'); ?>"> 665 665 <?php _e('Number of comments to show:'); ?> 666 <input id="<?php echo $this->get_field_id('number'); ?>" name="<?php echo $this->get_field_name('number'); ?>" type="text" value="<?php echo $number; ?>" /></label>666 <input id="<?php echo $this->get_field_id('number'); ?>" name="<?php echo $this->get_field_name('number'); ?>" type="text" value="<?php echo $number; ?>" size="3" /></label> 667 667 <br /><small><?php _e('(at most 15)'); ?></small></p> 668 668 <?php -
trunk/wp-includes/script-loader.php
r11119 r11160 331 331 $scripts->add_data( 'media-upload', 'group', 1 ); 332 332 333 $scripts->add( 'admin-widgets', "/wp-admin/js/widgets$suffix.js", array( 'jquery-ui-sortable', 'jquery-ui-draggable' ), '20090 426' );333 $scripts->add( 'admin-widgets', "/wp-admin/js/widgets$suffix.js", array( 'jquery-ui-sortable', 'jquery-ui-draggable' ), '20090502' ); 334 334 $scripts->add_data( 'admin-widgets', 'group', 1 ); 335 335 … … 425 425 $styles->add_data( 'ie', 'conditional', 'lte IE 7' ); 426 426 427 $styles->add( 'colors', true, array(), '20090 419' ); // Register "meta" stylesheet for admin colors427 $styles->add( 'colors', true, array(), '20090502' ); // Register "meta" stylesheet for admin colors 428 428 $styles->add( 'colors-fresh', '/wp-admin/css/colors-fresh.css', array(), '20081210'); // for login.php. Is there a better way? 429 429 $styles->add_data( 'colors-fresh', 'rtl', true ); … … 433 433 $styles->add( 'global', '/wp-admin/css/global.css', array(), '20090415' ); 434 434 $styles->add( 'media', '/wp-admin/css/media.css', array(), '20090325' ); 435 $styles->add( 'widgets', '/wp-admin/css/widgets.css', array(), '20090 419' );435 $styles->add( 'widgets', '/wp-admin/css/widgets.css', array(), '20090502' ); 436 436 $styles->add( 'dashboard', '/wp-admin/css/dashboard.css', array(), '20090305' ); 437 437 $styles->add( 'install', '/wp-admin/css/install.css', array(), '20081210' ); -
trunk/wp-includes/widgets.php
r11155 r11160 824 824 $sidebars_widgets = wp_get_sidebars_widgets(false); 825 825 826 if ( is_array($sidebars_widgets) ) foreach ( $sidebars_widgets as $sidebar => $widgets ) 827 if ( 'wp_inactive_widgets' == $sidebar ) 828 continue; 829 830 if ( is_array($widgets) ) foreach ( $widgets as $widget ) 831 if ( ( $callback && isset($wp_registered_widgets[$widget]['callback']) && $wp_registered_widgets[$widget]['callback'] == $callback ) || ( $id_base && preg_replace( '/-[0-9]+$/', '', $widget ) == $id_base ) ) { 832 if ( !$widget_id || $widget_id == $wp_registered_widgets[$widget]['id'] ) 833 return $sidebar; 826 if ( is_array($sidebars_widgets) ) { 827 foreach ( $sidebars_widgets as $sidebar => $widgets ) { 828 if ( is_array($widgets) ) { 829 foreach ( $widgets as $widget ) { 830 if ( ( $callback && isset($wp_registered_widgets[$widget]['callback']) && $wp_registered_widgets[$widget]['callback'] == $callback ) || ( $id_base && preg_replace( '/-[0-9]+$/', '', $widget ) == $id_base ) ) { 831 if ( !$widget_id || $widget_id == $wp_registered_widgets[$widget]['id'] ) 832 return $sidebar; 833 } 834 } 834 835 } 835 836 } 837 } 836 838 return false; 837 839 }
Note: See TracChangeset
for help on using the changeset viewer.