| 1 | Index: wp-includes/js/jquery/jquery.color.js |
|---|
| 2 | =================================================================== |
|---|
| 3 | --- wp-includes/js/jquery/jquery.color.js (revision 7044) |
|---|
| 4 | +++ wp-includes/js/jquery/jquery.color.js (working copy) |
|---|
| 5 | @@ -1,9 +1,128 @@ |
|---|
| 6 | -(function(jQuery){jQuery.each(['backgroundColor','borderBottomColor','borderLeftColor','borderRightColor','borderTopColor','color','outlineColor'],function(i,attr){jQuery.fx.step[attr]=function(fx){if(fx.state==0){fx.start=getColor(fx.elem,attr);fx.end=getRGB(fx.end);} |
|---|
| 7 | -fx.elem.style[attr]="rgb("+[Math.max(Math.min(parseInt((fx.pos*(fx.end[0]-fx.start[0]))+fx.start[0]),255),0),Math.max(Math.min(parseInt((fx.pos*(fx.end[1]-fx.start[1]))+fx.start[1]),255),0),Math.max(Math.min(parseInt((fx.pos*(fx.end[2]-fx.start[2]))+fx.start[2]),255),0)].join(",")+")";}});function getRGB(color){var result;if(color&&color.constructor==Array&&color.length==3) |
|---|
| 8 | -return color;if(result=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color)) |
|---|
| 9 | -return[parseInt(result[1]),parseInt(result[2]),parseInt(result[3])];if(result=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color)) |
|---|
| 10 | -return[parseFloat(result[1])*2.55,parseFloat(result[2])*2.55,parseFloat(result[3])*2.55];if(result=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color)) |
|---|
| 11 | -return[parseInt(result[1],16),parseInt(result[2],16),parseInt(result[3],16)];if(result=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color)) |
|---|
| 12 | -return[parseInt(result[1]+result[1],16),parseInt(result[2]+result[2],16),parseInt(result[3]+result[3],16)];return colors[jQuery.trim(color).toLowerCase()];} |
|---|
| 13 | -function getColor(elem,attr){var color;do{color=jQuery.curCSS(elem,attr);if(color!=''&&color!='transparent'||jQuery.nodeName(elem,"body")) |
|---|
| 14 | -break;attr="backgroundColor";}while(elem=elem.parentNode);return getRGB(color);};var colors={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]};})(jQuery); |
|---|
| 15 | \ No newline at end of file |
|---|
| 16 | +/* |
|---|
| 17 | + * jQuery Color Animations |
|---|
| 18 | + * Copyright 2007 John Resig |
|---|
| 19 | + * Released under the MIT and GPL licenses. |
|---|
| 20 | + */ |
|---|
| 21 | + |
|---|
| 22 | +(function(jQuery){ |
|---|
| 23 | + |
|---|
| 24 | + // We override the animation for all of these color styles |
|---|
| 25 | + jQuery.each(['backgroundColor', 'borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor', 'color', 'outlineColor'], function(i,attr){ |
|---|
| 26 | + jQuery.fx.step[attr] = function(fx){ |
|---|
| 27 | + if ( fx.state == 0 ) { |
|---|
| 28 | + fx.start = getColor( fx.elem, attr ); |
|---|
| 29 | + fx.end = getRGB( fx.end ); |
|---|
| 30 | + } |
|---|
| 31 | + |
|---|
| 32 | + fx.elem.style[attr] = "rgb(" + [ |
|---|
| 33 | + Math.max(Math.min( parseInt((fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0]), 255), 0), |
|---|
| 34 | + Math.max(Math.min( parseInt((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1]), 255), 0), |
|---|
| 35 | + Math.max(Math.min( parseInt((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2]), 255), 0) |
|---|
| 36 | + ].join(",") + ")"; |
|---|
| 37 | + } |
|---|
| 38 | + }); |
|---|
| 39 | + |
|---|
| 40 | + // Color Conversion functions from highlightFade |
|---|
| 41 | + // By Blair Mitchelmore |
|---|
| 42 | + // http://jquery.offput.ca/highlightFade/ |
|---|
| 43 | + |
|---|
| 44 | + // Parse strings looking for color tuples [255,255,255] |
|---|
| 45 | + function getRGB(color) { |
|---|
| 46 | + var result; |
|---|
| 47 | + |
|---|
| 48 | + // Check if we're already dealing with an array of colors |
|---|
| 49 | + if ( color && color.constructor == Array && color.length == 3 ) |
|---|
| 50 | + return color; |
|---|
| 51 | + |
|---|
| 52 | + // Look for rgb(num,num,num) |
|---|
| 53 | + if (result = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color)) |
|---|
| 54 | + return [parseInt(result[1]), parseInt(result[2]), parseInt(result[3])]; |
|---|
| 55 | + |
|---|
| 56 | + // Look for rgb(num%,num%,num%) |
|---|
| 57 | + if (result = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color)) |
|---|
| 58 | + return [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55]; |
|---|
| 59 | + |
|---|
| 60 | + // Look for #a0b1c2 |
|---|
| 61 | + if (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color)) |
|---|
| 62 | + return [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)]; |
|---|
| 63 | + |
|---|
| 64 | + // Look for #fff |
|---|
| 65 | + if (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color)) |
|---|
| 66 | + return [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)]; |
|---|
| 67 | + |
|---|
| 68 | + // Look for rgba(0, 0, 0, 0) == transparent in Safari 3 |
|---|
| 69 | + if (result = /rgba\(0, 0, 0, 0\)/.exec(color)) |
|---|
| 70 | + return colors['transparent'] |
|---|
| 71 | + |
|---|
| 72 | + // Otherwise, we're most likely dealing with a named color |
|---|
| 73 | + return colors[jQuery.trim(color).toLowerCase()]; |
|---|
| 74 | + } |
|---|
| 75 | + |
|---|
| 76 | + function getColor(elem, attr) { |
|---|
| 77 | + var color; |
|---|
| 78 | + |
|---|
| 79 | + do { |
|---|
| 80 | + color = jQuery.curCSS(elem, attr); |
|---|
| 81 | + |
|---|
| 82 | + // Keep going until we find an element that has color, or we hit the body |
|---|
| 83 | + if ( color != '' && color != 'transparent' || jQuery.nodeName(elem, "body") ) |
|---|
| 84 | + break; |
|---|
| 85 | + |
|---|
| 86 | + attr = "backgroundColor"; |
|---|
| 87 | + } while ( elem = elem.parentNode ); |
|---|
| 88 | + |
|---|
| 89 | + return getRGB(color); |
|---|
| 90 | + }; |
|---|
| 91 | + |
|---|
| 92 | + // Some named colors to work with |
|---|
| 93 | + // From Interface by Stefan Petre |
|---|
| 94 | + // http://interface.eyecon.ro/ |
|---|
| 95 | + |
|---|
| 96 | + var colors = { |
|---|
| 97 | + aqua:[0,255,255], |
|---|
| 98 | + azure:[240,255,255], |
|---|
| 99 | + beige:[245,245,220], |
|---|
| 100 | + black:[0,0,0], |
|---|
| 101 | + blue:[0,0,255], |
|---|
| 102 | + brown:[165,42,42], |
|---|
| 103 | + cyan:[0,255,255], |
|---|
| 104 | + darkblue:[0,0,139], |
|---|
| 105 | + darkcyan:[0,139,139], |
|---|
| 106 | + darkgrey:[169,169,169], |
|---|
| 107 | + darkgreen:[0,100,0], |
|---|
| 108 | + darkkhaki:[189,183,107], |
|---|
| 109 | + darkmagenta:[139,0,139], |
|---|
| 110 | + darkolivegreen:[85,107,47], |
|---|
| 111 | + darkorange:[255,140,0], |
|---|
| 112 | + darkorchid:[153,50,204], |
|---|
| 113 | + darkred:[139,0,0], |
|---|
| 114 | + darksalmon:[233,150,122], |
|---|
| 115 | + darkviolet:[148,0,211], |
|---|
| 116 | + fuchsia:[255,0,255], |
|---|
| 117 | + gold:[255,215,0], |
|---|
| 118 | + green:[0,128,0], |
|---|
| 119 | + indigo:[75,0,130], |
|---|
| 120 | + khaki:[240,230,140], |
|---|
| 121 | + lightblue:[173,216,230], |
|---|
| 122 | + lightcyan:[224,255,255], |
|---|
| 123 | + lightgreen:[144,238,144], |
|---|
| 124 | + lightgrey:[211,211,211], |
|---|
| 125 | + lightpink:[255,182,193], |
|---|
| 126 | + lightyellow:[255,255,224], |
|---|
| 127 | + lime:[0,255,0], |
|---|
| 128 | + magenta:[255,0,255], |
|---|
| 129 | + maroon:[128,0,0], |
|---|
| 130 | + navy:[0,0,128], |
|---|
| 131 | + olive:[128,128,0], |
|---|
| 132 | + orange:[255,165,0], |
|---|
| 133 | + pink:[255,192,203], |
|---|
| 134 | + purple:[128,0,128], |
|---|
| 135 | + violet:[128,0,128], |
|---|
| 136 | + red:[255,0,0], |
|---|
| 137 | + silver:[192,192,192], |
|---|
| 138 | + white:[255,255,255], |
|---|
| 139 | + yellow:[255,255,0], |
|---|
| 140 | + transparent: [255,255,255] |
|---|
| 141 | + }; |
|---|
| 142 | + |
|---|
| 143 | +})(jQuery); |
|---|
| 144 | Index: wp-includes/js/wp-lists.js |
|---|
| 145 | =================================================================== |
|---|
| 146 | --- wp-includes/js/wp-lists.js (revision 7044) |
|---|
| 147 | +++ wp-includes/js/wp-lists.js (working copy) |
|---|
| 148 | @@ -21,9 +21,9 @@ |
|---|
| 149 | var err = ''; |
|---|
| 150 | errs.each( function() { |
|---|
| 151 | var code = $(this).attr('code'); |
|---|
| 152 | - if ( formField = $('wp_error_data[@code="' + code + '"] form-field', x).text() ) |
|---|
| 153 | + if ( formField = $('wp_error_data[code="' + code + '"] form-field', x).text() ) |
|---|
| 154 | code = formField; |
|---|
| 155 | - wpAjax.invalidateForm( $('#' + e + ' :input[@name="' + code + '"]' ).parents('.form-field:first') ); |
|---|
| 156 | + wpAjax.invalidateForm( $('#' + e + ' :input[name="' + code + '"]' ).parents('.form-field:first') ); |
|---|
| 157 | err += '<p>' + this.firstChild.nodeValue + '</p>'; |
|---|
| 158 | } ); |
|---|
| 159 | return !re.html( '<div class="error">' + err + '</div>' ); |
|---|
| 160 | @@ -58,7 +58,7 @@ |
|---|
| 161 | |
|---|
| 162 | nonce: function(e,s) { |
|---|
| 163 | var url = wpAjax.unserialize(e.attr('href')); |
|---|
| 164 | - return s.nonce || url._ajax_nonce || $('#' + s.element + ' input[@name=_ajax_nonce]').val() || url._wpnonce || $('#' + s.element + ' input[@name=_wpnonce]').val() || 0; |
|---|
| 165 | + return s.nonce || url._ajax_nonce || $('#' + s.element + ' input[name=_ajax_nonce]').val() || url._wpnonce || $('#' + s.element + ' input[name=_wpnonce]').val() || 0; |
|---|
| 166 | }, |
|---|
| 167 | |
|---|
| 168 | parseClass: function(e,t) { |
|---|
| 169 | @@ -74,11 +74,11 @@ |
|---|
| 170 | }, s || {} ); |
|---|
| 171 | if ( $.isFunction( s.confirm ) ) { |
|---|
| 172 | if ( 'add' != a ) { |
|---|
| 173 | - bg = $('#' + s.element).css('background-color'); |
|---|
| 174 | - $('#' + s.element).css('background-color', '#FF9966'); |
|---|
| 175 | + bg = $('#' + s.element).css('backgroundColor'); |
|---|
| 176 | + $('#' + s.element).css('backgroundColor', '#FF9966'); |
|---|
| 177 | } |
|---|
| 178 | r = s.confirm.call(this,e,s,a,bg); |
|---|
| 179 | - if ( 'add' != a ) { $('#' + s.element).css('background-color', bg ); } |
|---|
| 180 | + if ( 'add' != a ) { $('#' + s.element).css('backgroundColor', bg ); } |
|---|
| 181 | if ( !r ) { return false; } |
|---|
| 182 | } |
|---|
| 183 | return s; |
|---|
| 184 | @@ -94,7 +94,7 @@ |
|---|
| 185 | s = wpList.pre.call( list, e, s, 'add' ); |
|---|
| 186 | if ( !s ) { return false; } |
|---|
| 187 | |
|---|
| 188 | - if ( !e.is("[@class^=add:" + list.id + ":]") ) { return !wpList.add.call( list, e, s ); } |
|---|
| 189 | + if ( !e.is("[class^=add:" + list.id + ":]") ) { return !wpList.add.call( list, e, s ); } |
|---|
| 190 | |
|---|
| 191 | if ( !s.element ) { return true; } |
|---|
| 192 | |
|---|
| 193 | @@ -102,8 +102,8 @@ |
|---|
| 194 | |
|---|
| 195 | s.nonce = wpList.nonce(e,s); |
|---|
| 196 | |
|---|
| 197 | - var es = $('#' + s.element + ' :input').not('[@name=_ajax_nonce], [@name=_wpnonce], [@name=action]'); |
|---|
| 198 | - var required = $('#' + s.element + ' .form-required:has(:input[@value=""]), #' + s.element + ' .form-required:input[@value=""]'); |
|---|
| 199 | + var es = $('#' + s.element + ' :input').not('[name=_ajax_nonce], [name=_wpnonce], [name=action]'); |
|---|
| 200 | + var required = $('#' + s.element + ' .form-required:has(:input[value=""]), #' + s.element + ' .form-required:input[value=""]'); |
|---|
| 201 | if ( required.size() ) { |
|---|
| 202 | wpAjax.invalidateForm( required ); |
|---|
| 203 | return false; |
|---|
| 204 | @@ -172,28 +172,32 @@ |
|---|
| 205 | } |
|---|
| 206 | if ( !s.data._ajax_nonce ) { return true; } |
|---|
| 207 | |
|---|
| 208 | - var func = function() { list.wpList.recolor(); }; |
|---|
| 209 | - var hideTO = -1; |
|---|
| 210 | + var element = $('#' + s.element); |
|---|
| 211 | + |
|---|
| 212 | if ( 'none' != s.delColor ) { |
|---|
| 213 | - $('#' + s.element).animate( { backgroundColor: s.delColor }, 100 ).slideUp(); |
|---|
| 214 | - hideTO = setTimeout(func, 500); |
|---|
| 215 | + var anim = 'slideUp'; |
|---|
| 216 | + if ( element.css( 'display' ).match(/table/) ) |
|---|
| 217 | + anim = 'fadeOut'; // Can't slideup table rows and other table elements. Known jQuery bug |
|---|
| 218 | + element |
|---|
| 219 | + .animate( { backgroundColor: s.delColor }, 'fast' )[anim]( 'fast' ) |
|---|
| 220 | + .queue( function() { list.wpList.recolor(); $(this).dequeue(); } ); |
|---|
| 221 | } else { |
|---|
| 222 | - func(); |
|---|
| 223 | + list.wpList.recolor(); |
|---|
| 224 | } |
|---|
| 225 | |
|---|
| 226 | s.success = function(r) { |
|---|
| 227 | if ( !wpAjax.parseAjaxResponse(r, s.response, s.element) ) { |
|---|
| 228 | - clearTimeout(hideTO); |
|---|
| 229 | - func = function() { $('#' + s.element).css( 'background-color', '#FF3333' ).show(); list.wpList.recolor(); }; |
|---|
| 230 | - func(); setTimeout(func, 705); // In case it's still fading |
|---|
| 231 | + element.stop().css( 'backgroundColor', '#FF3333' ).show().queue( function() { list.wpList.recolor(); $(this).dequeue(); } ); |
|---|
| 232 | return false; |
|---|
| 233 | } |
|---|
| 234 | if ( $.isFunction(s.delAfter) ) { |
|---|
| 235 | var o = this.complete; |
|---|
| 236 | this.complete = function(x,st) { |
|---|
| 237 | - var _s = $.extend( { xml: x, status: st }, s ); |
|---|
| 238 | - s.delAfter( r, _s ); |
|---|
| 239 | - if ( $.isFunction(o) ) { o(x,st); } |
|---|
| 240 | + element.queue( function() { |
|---|
| 241 | + var _s = $.extend( { xml: x, status: st }, s ); |
|---|
| 242 | + s.delAfter( r, _s ); |
|---|
| 243 | + if ( $.isFunction(o) ) { o(x,st); } |
|---|
| 244 | + } ).dequeue(); |
|---|
| 245 | }; |
|---|
| 246 | } |
|---|
| 247 | }; |
|---|
| 248 | @@ -227,34 +231,33 @@ |
|---|
| 249 | if ( !s ) { return true; } |
|---|
| 250 | } |
|---|
| 251 | |
|---|
| 252 | - var thisclass = $('#' + s.element).attr('class'); |
|---|
| 253 | - if ( thisclass && thisclass.match(/alternate/) ) |
|---|
| 254 | - var color = '#f1f1f1'; |
|---|
| 255 | - else |
|---|
| 256 | - var color = '#fff'; |
|---|
| 257 | - var isClass = $('#' + s.element).toggleClass(s.dimClass).is('.' + s.dimClass); |
|---|
| 258 | - if ( isClass && 'none' != s.dimAddColor ) { |
|---|
| 259 | - $('#' + s.element).animate( { backgroundColor: s.dimAddColor }, 50 ).animate( { backgroundColor: color }, 400 ); |
|---|
| 260 | + var element = $('#' + s.element); |
|---|
| 261 | + var isClass = element.toggleClass(s.dimClass).is('.' + s.dimClass); |
|---|
| 262 | + var color = wpList.getColor( element ); |
|---|
| 263 | + element.toggleClass( s.dimClass ) |
|---|
| 264 | + var dimColor = isClass ? s.dimAddColor : s.dimDelColor; |
|---|
| 265 | + if ( 'none' != dimColor ) { |
|---|
| 266 | + element |
|---|
| 267 | + .animate( { backgroundColor: dimColor }, 'fast' ) |
|---|
| 268 | + .queue( function() { element.toggleClass(s.dimClass); $(this).dequeue(); } ) |
|---|
| 269 | + .animate( { backgroundColor: color }, { complete: function() { $(this).css( 'backgroundColor', '' ); } } ); |
|---|
| 270 | } |
|---|
| 271 | - else if ( !isClass && 'none' != s.dimDelColor ) { |
|---|
| 272 | - $('#' + s.element).animate( { backgroundColor: s.dimDelColor }, 50 ).animate( { backgroundColor: color }, 400 ); |
|---|
| 273 | - } |
|---|
| 274 | |
|---|
| 275 | if ( !s.data._ajax_nonce ) { return true; } |
|---|
| 276 | |
|---|
| 277 | s.success = function(r) { |
|---|
| 278 | if ( !wpAjax.parseAjaxResponse(r, s.response, s.element) ) { |
|---|
| 279 | - clearTimeout(dimTO); |
|---|
| 280 | - func = function() { $('#' + s.element).css( 'background-color', '#FF3333' )[isClass?'removeClass':'addClass'](s.dimClass); }; |
|---|
| 281 | - func(); setTimeout(func, 705); |
|---|
| 282 | + element.stop().css( 'backgroundColor', '#FF3333' )[isClass?'removeClass':'addClass'](s.dimClass).show().queue( function() { list.wpList.recolor(); $(this).dequeue(); } ); |
|---|
| 283 | return false; |
|---|
| 284 | } |
|---|
| 285 | if ( $.isFunction(s.dimAfter) ) { |
|---|
| 286 | var o = this.complete; |
|---|
| 287 | this.complete = function(x,st) { |
|---|
| 288 | - var _s = $.extend( { xml: x, status: st }, s ); |
|---|
| 289 | - s.dimAfter( r, _s ); |
|---|
| 290 | - if ( $.isFunction(o) ) { o(x,st); } |
|---|
| 291 | + element.queue( function() { |
|---|
| 292 | + var _s = $.extend( { xml: x, status: st }, s ); |
|---|
| 293 | + s.dimAfter( r, _s ); |
|---|
| 294 | + if ( $.isFunction(o) ) { o(x,st); } |
|---|
| 295 | + } ).dequeue(); |
|---|
| 296 | }; |
|---|
| 297 | } |
|---|
| 298 | }; |
|---|
| 299 | @@ -263,6 +266,19 @@ |
|---|
| 300 | return false; |
|---|
| 301 | }, |
|---|
| 302 | |
|---|
| 303 | + // From jquery.color.js: jQuery Color Animation by John Resig |
|---|
| 304 | + getColor: function( el ) { |
|---|
| 305 | + if ( el.constructor == Object ) |
|---|
| 306 | + el = el.get(0); |
|---|
| 307 | + var elem = el, color, rgbaTrans = new RegExp( "rgba\\(\\s*0,\\s*0,\\s*0,\\s*0\\s*\\)", "i" ); |
|---|
| 308 | + do { |
|---|
| 309 | + color = jQuery.curCSS(elem, 'backgroundColor'); |
|---|
| 310 | + if ( color != '' && color != 'transparent' && !color.match(rgbaTrans) || jQuery.nodeName(elem, "body") ) |
|---|
| 311 | + break; |
|---|
| 312 | + } while ( elem = elem.parentNode ); |
|---|
| 313 | + return color || '#ffffff'; |
|---|
| 314 | + }, |
|---|
| 315 | + |
|---|
| 316 | add: function( e, s ) { |
|---|
| 317 | list = $(this); |
|---|
| 318 | e = $(e); |
|---|
| 319 | @@ -271,7 +287,6 @@ |
|---|
| 320 | var _s = { pos: 0, id: 0, oldId: null }; |
|---|
| 321 | if ( 'string' == typeof s ) { s = { what: s }; } |
|---|
| 322 | s = $.extend(_s, this.wpList.settings, s); |
|---|
| 323 | - |
|---|
| 324 | if ( !e.size() || !s.what ) { return false; } |
|---|
| 325 | if ( s.oldId ) { old = $('#' + s.what + '-' + s.oldId); } |
|---|
| 326 | if ( s.id && ( s.id != s.oldId || !old || !old.size() ) ) { $('#' + s.what + '-' + s.id).remove(); } |
|---|
| 327 | @@ -299,9 +314,8 @@ |
|---|
| 328 | } |
|---|
| 329 | |
|---|
| 330 | if ( 'none' != s.addColor ) { |
|---|
| 331 | - var b = e.css( 'background-color' ); |
|---|
| 332 | - if ( b == 'transparent' ) { b = ''; } |
|---|
| 333 | - e.css('background-color', s.addColor).animate( { backgroundColor: '#fff' }, 300 ); |
|---|
| 334 | + var color = wpList.getColor( e ); |
|---|
| 335 | + e.css( 'backgroundColor', s.addColor ).animate( { backgroundColor: color }, { complete: function() { $(this).css( 'backgroundColor', '' ); } } ); |
|---|
| 336 | } |
|---|
| 337 | list.each( function() { this.wpList.process( e ); } ); |
|---|
| 338 | return e; |
|---|
| 339 | @@ -323,7 +337,7 @@ |
|---|
| 340 | |
|---|
| 341 | process: function(el) { |
|---|
| 342 | var list = this; |
|---|
| 343 | - var a = $("[@class^=add:" + list.id + ":]", el || null) |
|---|
| 344 | + $("[class^=add:" + list.id + ":]", el || null) |
|---|
| 345 | .filter('form').submit( function() { return list.wpList.add(this); } ).end() |
|---|
| 346 | .not('form').click( function() { return list.wpList.add(this); } ).each( function() { |
|---|
| 347 | var addEl = this; |
|---|
| 348 | @@ -343,8 +357,8 @@ |
|---|
| 349 | } |
|---|
| 350 | } ); |
|---|
| 351 | } ); |
|---|
| 352 | - var d = $("[@class^=delete:" + list.id + ":]", el || null).click( function() { return list.wpList.del(this); } ); |
|---|
| 353 | - var c = $("[@class^=dim:" + list.id + ":]", el || null).click( function() { return list.wpList.dim(this); } ); |
|---|
| 354 | + $("[class^=delete:" + list.id + ":]", el || null).click( function() { return list.wpList.del(this); } ); |
|---|
| 355 | + $("[class^=dim:" + list.id + ":]", el || null).click( function() { return list.wpList.dim(this); } ); |
|---|
| 356 | }, |
|---|
| 357 | |
|---|
| 358 | recolor: function() { |
|---|
| 359 | Index: wp-includes/script-loader.php |
|---|
| 360 | =================================================================== |
|---|
| 361 | --- wp-includes/script-loader.php (revision 7044) |
|---|
| 362 | +++ wp-includes/script-loader.php (working copy) |
|---|
| 363 | @@ -67,7 +67,7 @@ |
|---|
| 364 | 'delText' => __('Are you sure you want to delete this %thing%?') |
|---|
| 365 | ) ); |
|---|
| 366 | |
|---|
| 367 | - $this->add( 'wp-lists', '/wp-includes/js/wp-lists.js', array('jquery'), '20080110' ); |
|---|
| 368 | + $this->add( 'wp-lists', '/wp-includes/js/wp-lists.js', array('jquery'), '20080226' ); |
|---|
| 369 | $this->localize( 'wp-lists', 'wpListL10n', array( |
|---|
| 370 | 'url' => get_option( 'siteurl' ) . '/wp-admin/admin-ajax.php' |
|---|
| 371 | ) ); |
|---|
| 372 | Index: wp-admin/edit-comments.php |
|---|
| 373 | =================================================================== |
|---|
| 374 | --- wp-admin/edit-comments.php (revision 7044) |
|---|
| 375 | +++ wp-admin/edit-comments.php (working copy) |
|---|
| 376 | @@ -88,7 +88,7 @@ |
|---|
| 377 | <?php |
|---|
| 378 | $status_links = array(); |
|---|
| 379 | $num_comments = wp_count_comments(); |
|---|
| 380 | -$stati = array('moderated' => sprintf(__('Awaiting Moderation (%s)'), $num_comments->moderated), 'approved' => __('Approved')); |
|---|
| 381 | +$stati = array('moderated' => sprintf(__('Awaiting Moderation (%s)'), "<span class='comment-count'>$num_comments->moderated</span>"), 'approved' => __('Approved')); |
|---|
| 382 | foreach ( $stati as $status => $label ) { |
|---|
| 383 | $class = ''; |
|---|
| 384 | |
|---|
| 385 | @@ -178,9 +178,9 @@ |
|---|
| 386 | foreach ($comments as $comment) { |
|---|
| 387 | $post = get_post($comment->comment_post_ID); |
|---|
| 388 | $authordata = get_userdata($post->post_author); |
|---|
| 389 | - $comment_status = wp_get_comment_status($comment->comment_ID); |
|---|
| 390 | + $the_comment_status = wp_get_comment_status($comment->comment_ID); |
|---|
| 391 | $class = ('alternate' == $class) ? '' : ''; |
|---|
| 392 | - $class .= ('unapproved' == $comment_status) ? ' unapproved' : ''; |
|---|
| 393 | + $class .= ('unapproved' == $the_comment_status) ? ' unapproved' : ''; |
|---|
| 394 | $post_link = '<a href="' . get_comment_link() . '">' . get_the_title($comment->comment_post_ID) . '</a>'; |
|---|
| 395 | $author_url = get_comment_author_url(); |
|---|
| 396 | if ( 'http://' == $author_url ) |
|---|
| 397 | @@ -217,8 +217,12 @@ |
|---|
| 398 | <td><?php comment_date(__('Y/m/d')); ?></td> |
|---|
| 399 | <td> |
|---|
| 400 | <?php if ( current_user_can('edit_post', $comment->comment_post_ID) ) { |
|---|
| 401 | - if ( 'approved' != $comment_status ) |
|---|
| 402 | - echo "<a href='$approve_url' class='delete:the-comment-list:comment-$comment->comment_ID:33FF33:action=dim-comment' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a> | '; |
|---|
| 403 | + if ( 'approved' != $the_comment_status ) { |
|---|
| 404 | + if ( $comment_status ) // we're looking at list of only approved or only unapproved comments |
|---|
| 405 | + echo "<a href='$approve_url' class='delete:the-comment-list:comment-$comment->comment_ID:33FF33:action=dim-comment' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a> | '; |
|---|
| 406 | + else // we're looking at all comments |
|---|
| 407 | + echo "<span class='approve'><a href='$approve_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:none:33FF33' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a> | </span>'; |
|---|
| 408 | + } |
|---|
| 409 | echo "<a href='$spam_url' class='delete:the-comment-list:comment-$comment->comment_ID::spam=1' title='" . __( 'Mark this comment as spam' ) . "'>" . __( 'Spam' ) . '</a> | '; |
|---|
| 410 | echo "<a href='$delete_url' class='delete:the-comment-list:comment-$comment->comment_ID delete'>" . __('Delete') . '</a>'; |
|---|
| 411 | } |
|---|
| 412 | Index: wp-admin/includes/template.php |
|---|
| 413 | =================================================================== |
|---|
| 414 | --- wp-admin/includes/template.php (revision 7044) |
|---|
| 415 | +++ wp-admin/includes/template.php (working copy) |
|---|
| 416 | @@ -416,7 +416,7 @@ |
|---|
| 417 | $pending_phrase = sprintf( __('%s pending'), number_format( $left ) ); |
|---|
| 418 | if ( $left ) |
|---|
| 419 | echo '<strong>'; |
|---|
| 420 | - comments_number("<a href='edit-pages.php?p=$id&c=1' title='$pending_phrase' class='post-com-count comment-count'><span>" . __('0') . '</span></a>', "<a href='edit-pages.php?p=$id&c=1' title='$pending_phrase' class='post-com-count comment-count'><span>" . __('1') . '</span></a>', "<a href='edit-pages.php?p=$id&c=1' title='$pending_phrase' class='post-com-count comment-count'><span>" . __('%') . '</span></a>'); |
|---|
| 421 | + comments_number("<a href='edit-pages.php?p=$id&c=1' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . __('0') . '</span></a>', "<a href='edit-pages.php?p=$id&c=1' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . __('1') . '</span></a>', "<a href='edit-pages.php?p=$id&c=1' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . __('%') . '</span></a>'); |
|---|
| 422 | if ( $left ) |
|---|
| 423 | echo '</strong>'; |
|---|
| 424 | ?> |
|---|
| 425 | Index: wp-admin/js/edit-comments.js |
|---|
| 426 | =================================================================== |
|---|
| 427 | --- wp-admin/js/edit-comments.js (revision 7044) |
|---|
| 428 | +++ wp-admin/js/edit-comments.js (working copy) |
|---|
| 429 | @@ -2,7 +2,7 @@ |
|---|
| 430 | jQuery(function($) { |
|---|
| 431 | |
|---|
| 432 | var dimAfter = function( r, settings ) { |
|---|
| 433 | - $('.comment-count span').each( function() { |
|---|
| 434 | + $('span.comment-count').each( function() { |
|---|
| 435 | var a = $(this); |
|---|
| 436 | var n = parseInt(a.html(),10) + ( $('#' + settings.element).is('.' + settings.dimClass) ? 1 : -1 ); |
|---|
| 437 | a.html( n.toString() ); |
|---|
| 438 | @@ -16,7 +16,7 @@ |
|---|
| 439 | } |
|---|
| 440 | |
|---|
| 441 | var delAfter = function( r, settings ) { |
|---|
| 442 | - $('.comment-count span').each( function() { |
|---|
| 443 | + $('span.comment-count').each( function() { |
|---|
| 444 | var a = $(this); |
|---|
| 445 | if ( a.parent('.current').size() || $('#' + settings.element).is('.unapproved') && parseInt(a.html(),10) > 0 ) { |
|---|
| 446 | var n = parseInt(a.html(),10) - 1; |
|---|
| 447 | Index: wp-admin/js/common.js |
|---|
| 448 | =================================================================== |
|---|
| 449 | --- wp-admin/js/common.js (revision 7044) |
|---|
| 450 | +++ wp-admin/js/common.js (working copy) |
|---|
| 451 | @@ -2,5 +2,6 @@ |
|---|
| 452 | // pulse |
|---|
| 453 | jQuery('.fade').animate( { backgroundColor: '#ffffe0' }, 300).animate( { backgroundColor: '#fffbcc' }, 300).animate( { backgroundColor: '#ffffe0' }, 300).animate( { backgroundColor: '#fffbcc' }, 300); |
|---|
| 454 | |
|---|
| 455 | + // Reveal |
|---|
| 456 | jQuery('.wp-no-js-hidden').removeClass( 'wp-no-js-hidden' ); |
|---|
| 457 | }); |
|---|
| 458 | Index: wp-admin/edit-post-rows.php |
|---|
| 459 | =================================================================== |
|---|
| 460 | --- wp-admin/edit-post-rows.php (revision 7044) |
|---|
| 461 | +++ wp-admin/edit-post-rows.php (working copy) |
|---|
| 462 | @@ -113,7 +113,7 @@ |
|---|
| 463 | $pending_phrase = sprintf( __('%s pending'), number_format( $left ) ); |
|---|
| 464 | if ( $left ) |
|---|
| 465 | echo '<strong>'; |
|---|
| 466 | - comments_number("<a href='edit.php?p=$id&c=1' title='$pending_phrase' class='post-com-count comment-count'><span>" . __('0') . '</span></a>', "<a href='edit.php?p=$id&c=1' title='$pending_phrase' class='post-com-count comment-count'><span>" . __('1') . '</span></a>', "<a href='edit.php?p=$id&c=1' title='$pending_phrase' class='post-com-count comment-count'><span>" . __('%') . '</span></a>'); |
|---|
| 467 | + comments_number("<a href='edit.php?p=$id&c=1' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . __('0') . '</span></a>', "<a href='edit.php?p=$id&c=1' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . __('1') . '</span></a>', "<a href='edit.php?p=$id&c=1' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . __('%') . '</span></a>'); |
|---|
| 468 | if ( $left ) |
|---|
| 469 | echo '</strong>'; |
|---|
| 470 | ?> |
|---|
| 471 | Index: wp-admin/menu.php |
|---|
| 472 | =================================================================== |
|---|
| 473 | --- wp-admin/menu.php (revision 7044) |
|---|
| 474 | +++ wp-admin/menu.php (working copy) |
|---|
| 475 | @@ -17,7 +17,7 @@ |
|---|
| 476 | |
|---|
| 477 | $awaiting_mod = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = '0'"); |
|---|
| 478 | $menu[15] = array(__('Design'), 'switch_themes', 'themes.php'); |
|---|
| 479 | -$menu[20] = array( sprintf( __('Comments %s'), "<span id='awaiting-mod' class='comment-count'><span>$awaiting_mod</span></span>" ), 'edit_posts', 'edit-comments.php'); |
|---|
| 480 | +$menu[20] = array( sprintf( __('Comments %s'), "<span id='awaiting-mod'><span class='comment-count'>$awaiting_mod</span></span>" ), 'edit_posts', 'edit-comments.php'); |
|---|
| 481 | $menu[30] = array(__('Settings'), 'manage_options', 'options-general.php'); |
|---|
| 482 | $menu[35] = array(__('Plugins'), 'activate_plugins', 'plugins.php'); |
|---|
| 483 | if ( current_user_can('edit_users') ) |
|---|