Ticket #19881: 19881.2.patch
File 19881.2.patch, 6.0 KB (added by , 13 years ago) |
---|
-
wp-includes/js/imgareaselect/jquery.imgareaselect.dev.js
1 1 /* 2 2 * imgAreaSelect jQuery plugin 3 * version 0.9. 63 * version 0.9.8 4 4 * 5 5 * Copyright (c) 2008-2011 Michal Wojciechowski (odyniec.net) 6 6 * … … 55 55 56 56 scaleX, scaleY, 57 57 58 resizeMargin = 10,59 60 58 resize, 61 59 62 60 minWidth, minHeight, maxWidth, maxHeight, … … 134 132 imgOfs.top += ($img.outerHeight() - imgHeight) >> 1; 135 133 imgOfs.left += ($img.outerWidth() - imgWidth) >> 1; 136 134 137 minWidth = options.minWidth|| 0;138 minHeight = options.minHeight|| 0;139 maxWidth = min(options.maxWidth || 1<<24, imgWidth);140 maxHeight = min(options.maxHeight || 1<<24, imgHeight);135 minWidth = round(options.minWidth / scaleX) || 0; 136 minHeight = round(options.minHeight / scaleY) || 0; 137 maxWidth = round(min(options.maxWidth / scaleX || 1<<24, imgWidth)); 138 maxHeight = round(min(options.maxHeight / scaleY || 1<<24, imgHeight)); 141 139 142 140 if ($().jquery == '1.3.2' && position == 'fixed' && 143 141 !docElem['getBoundingClientRect']) … … 146 144 imgOfs.left += max(document.body.scrollLeft, docElem.scrollLeft); 147 145 } 148 146 149 parOfs = $.inArray($parent.css('position'), ['absolute', 'relative']) + 1?147 parOfs = /absolute|relative/.test($parent.css('position')) ? 150 148 { left: round($parent.offset().left) - $parent.scrollLeft(), 151 149 top: round($parent.offset().top) - $parent.scrollTop() } : 152 150 position == 'fixed' ? … … 365 363 } 366 364 367 365 function selectingMouseMove(event) { 368 x2 = resize == '' || /w|e/.test(resize) || aspectRatio ? evX(event) : viewX(selection.x2);369 y2 = resize == '' || /n|s/.test(resize) || aspectRatio ? evY(event) : viewY(selection.y2);366 x2 = /w|e|^$/.test(resize) || aspectRatio ? evX(event) : viewX(selection.x2); 367 y2 = /n|s|^$/.test(resize) || aspectRatio ? evY(event) : viewY(selection.y2); 370 368 371 369 doResize(); 372 370 … … 408 406 409 407 resize = ''; 410 408 411 if ( $outer.is(':not(:visible)'))409 if (!$outer.is(':visible')) 412 410 $box.add($outer).hide().fadeIn(options.fadeSpeed||0); 413 411 414 412 shown = true; … … 427 425 428 426 setSelection(selX(x1), selY(y1), selX(x1), selY(y1)); 429 427 430 options.onSelectChange(img, getSelection()); 431 options.onSelectEnd(img, getSelection()); 428 if (!this instanceof $.imgAreaSelect) { 429 options.onSelectChange(img, getSelection()); 430 options.onSelectEnd(img, getSelection()); 431 } 432 432 } 433 433 434 434 function imgMouseDown(event) { … … 606 606 $box.append($area.add($border).add($areaOpera).add($handles)); 607 607 608 608 if ($.browser.msie) { 609 if (o = $outer.css('filter').match(/opacity=( [0-9]+)/))609 if (o = $outer.css('filter').match(/opacity=(\d+)/)) 610 610 $outer.css('opacity', o[1]/100); 611 if (o = $border.css('filter').match(/opacity=( [0-9]+)/))611 if (o = $border.css('filter').match(/opacity=(\d+)/)) 612 612 $border.css('opacity', o[1]/100); 613 613 } 614 614 … … 656 656 657 657 this.setSelection = setSelection; 658 658 659 this.cancelSelection = cancelSelection; 660 659 661 this.update = doUpdate; 660 662 661 663 $p = $img; … … 689 691 img.complete || img.readyState == 'complete' || !$img.is('img') ? 690 692 imgLoad() : $img.one('load', imgLoad); 691 693 692 if ($.browser.msie && $.browser.version >= 9)694 if ($.browser.msie && $.browser.version >= 7) 693 695 img.src = img.src; 694 696 }; 695 697 -
wp-includes/js/imgareaselect/imgareaselect.css
20 20 21 21 .imgareaselect-border1, .imgareaselect-border2, 22 22 .imgareaselect-border3, .imgareaselect-border4 { 23 filter: alpha(opacity=50); 23 24 opacity: 0.5; 24 filter: alpha(opacity=50);25 25 } 26 26 27 27 .imgareaselect-handle { 28 28 background-color: #fff; 29 29 border: solid 1px #000; 30 opacity: 0.4;31 filter: alpha(opacity=40);30 filter: alpha(opacity=50); 31 opacity: 0.5; 32 32 } 33 33 34 34 .imgareaselect-outer { 35 35 background-color: #000; 36 opacity: 0.4;37 filter: alpha(opacity=40);36 filter: alpha(opacity=50); 37 opacity: 0.5; 38 38 } 39 39 40 40 .imgareaselect-selection { -
wp-includes/script-loader.php
253 253 254 254 $scripts->add( 'json2', "/wp-includes/js/json2$suffix.js", array(), '2011-02-23'); 255 255 256 $scripts->add( 'imgareaselect', "/wp-includes/js/imgareaselect/jquery.imgareaselect$suffix.js", array('jquery'), '0.9. 6-20110515', 1 );256 $scripts->add( 'imgareaselect', "/wp-includes/js/imgareaselect/jquery.imgareaselect$suffix.js", array('jquery'), '0.9.8', 1 ); 257 257 258 258 $scripts->add( 'password-strength-meter', "/wp-admin/js/password-strength-meter$suffix.js", array('jquery'), false, 1 ); 259 259 $scripts->localize( 'password-strength-meter', 'pwsL10n', array( … … 475 475 $styles->add( 'thickbox', '/wp-includes/js/thickbox/thickbox.css' ); 476 476 $styles->add( 'farbtastic', '/wp-admin/css/farbtastic.css', array(), '1.3u1' ); 477 477 $styles->add( 'jcrop', '/wp-includes/js/jcrop/jquery.Jcrop.css', array(), '0.9.8' ); 478 $styles->add( 'imgareaselect', '/wp-includes/js/imgareaselect/imgareaselect.css', array(), '0.9. 1' );478 $styles->add( 'imgareaselect', '/wp-includes/js/imgareaselect/imgareaselect.css', array(), '0.9.8' ); 479 479 $styles->add( 'admin-bar', "/wp-includes/css/admin-bar$suffix.css" ); 480 480 $styles->add( 'wp-jquery-ui-dialog', "/wp-includes/css/jquery-ui-dialog$suffix.css" ); 481 481 $styles->add( 'editor-buttons', "/wp-includes/css/editor$suffix.css" );