<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[17934] trunk/wp-includes: Update imgareaselect Jquery plugin, props duck_, fixes #17446</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg > ul, #logmsg > ol { margin-left: 0; margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/17934">17934</a></dd>
<dt>Author</dt> <dd>azaozz</dd>
<dt>Date</dt> <dd>2011-05-15 18:03:51 +0000 (Sun, 15 May 2011)</dd>
</dl>
<h3>Log Message</h3>
<pre>Update imgareaselect Jquery plugin, props duck_, fixes <a href="http://trac.wordpress.org/ticket/17446">#17446</a></pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpincludesjsimgareaselectjqueryimgareaselectdevjs">trunk/wp-includes/js/imgareaselect/jquery.imgareaselect.dev.js</a></li>
<li><a href="#trunkwpincludesjsimgareaselectjqueryimgareaselectjs">trunk/wp-includes/js/imgareaselect/jquery.imgareaselect.js</a></li>
<li><a href="#trunkwpincludesscriptloaderphp">trunk/wp-includes/script-loader.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpincludesjsimgareaselectjqueryimgareaselectdevjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/imgareaselect/jquery.imgareaselect.dev.js (17933 => 17934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/imgareaselect/jquery.imgareaselect.dev.js        2011-05-15 08:54:32 UTC (rev 17933)
+++ trunk/wp-includes/js/imgareaselect/jquery.imgareaselect.dev.js        2011-05-15 18:03:51 UTC (rev 17934)
</span><span class="lines">@@ -1,8 +1,8 @@
</span><span class="cx"> /*
</span><span class="cx"> * imgAreaSelect jQuery plugin
</span><del>- * version 0.9.1
</del><ins>+ * version 0.9.6
</ins><span class="cx"> *
</span><del>- * Copyright (c) 2008-2009 Michal Wojciechowski (odyniec.net)
</del><ins>+ * Copyright (c) 2008-2011 Michal Wojciechowski (odyniec.net)
</ins><span class="cx"> *
</span><span class="cx"> * Dual licensed under the MIT (MIT-LICENSE.txt)
</span><span class="cx"> * and GPL (GPL-LICENSE.txt) licenses.
</span><span class="lines">@@ -39,13 +39,13 @@
</span><span class="cx">
</span><span class="cx"> left, top,
</span><span class="cx">
</span><del>- imgOfs,
</del><ins>+ imgOfs = { left: 0, top: 0 },
</ins><span class="cx">
</span><span class="cx"> imgWidth, imgHeight,
</span><span class="cx">
</span><span class="cx"> $parent,
</span><span class="cx">
</span><del>- parOfs,
</del><ins>+ parOfs = { left: 0, top: 0 },
</ins><span class="cx">
</span><span class="cx"> zIndex = 0,
</span><span class="cx">
</span><span class="lines">@@ -59,6 +59,8 @@
</span><span class="cx">
</span><span class="cx"> resize,
</span><span class="cx">
</span><ins>+ minWidth, minHeight, maxWidth, maxHeight,
+
</ins><span class="cx"> aspectRatio,
</span><span class="cx">
</span><span class="cx"> shown,
</span><span class="lines">@@ -67,6 +69,8 @@
</span><span class="cx">
</span><span class="cx"> selection = { x1: 0, y1: 0, x2: 0, y2: 0, width: 0, height: 0 },
</span><span class="cx">
</span><ins>+ docElem = document.documentElement,
+
</ins><span class="cx"> $p, d, i, o, w, h, adjusted;
</span><span class="cx">
</span><span class="cx"> function viewX(x) {
</span><span class="lines">@@ -108,14 +112,14 @@
</span><span class="cx"> var sx = noScale || scaleX, sy = noScale || scaleY;
</span><span class="cx">
</span><span class="cx"> selection = {
</span><del>- x1: round(x1 / sx),
- y1: round(y1 / sy),
- x2: round(x2 / sx),
- y2: round(y2 / sy)
</del><ins>+ x1: round(x1 / sx || 0),
+ y1: round(y1 / sy || 0),
+ x2: round(x2 / sx || 0),
+ y2: round(y2 / sy || 0)
</ins><span class="cx"> };
</span><span class="cx">
</span><del>- selection.width = (x2 = viewX(selection.x2)) - (x1 = viewX(selection.x1));
- selection.height = (y2 = viewX(selection.y2)) - (y1 = viewX(selection.y1));
</del><ins>+ selection.width = selection.x2 - selection.x1;
+ selection.height = selection.y2 - selection.y1;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> function adjust() {
</span><span class="lines">@@ -124,13 +128,22 @@
</span><span class="cx">
</span><span class="cx"> imgOfs = { left: round($img.offset().left), top: round($img.offset().top) };
</span><span class="cx">
</span><del>- imgWidth = $img.width();
- imgHeight = $img.height();
</del><ins>+ imgWidth = $img.innerWidth();
+ imgHeight = $img.innerHeight();
</ins><span class="cx">
</span><del>- if ($().jquery == '1.3.2' && $.browser.safari && position == 'fixed') {
- imgOfs.top += max(document.documentElement.scrollTop, $('body').scrollTop());
</del><ins>+ imgOfs.top += ($img.outerHeight() - imgHeight) >> 1;
+ imgOfs.left += ($img.outerWidth() - imgWidth) >> 1;
</ins><span class="cx">
</span><del>- imgOfs.left += max(document.documentElement.scrollLeft, $('body').scrollLeft());
</del><ins>+ minWidth = options.minWidth || 0;
+ minHeight = options.minHeight || 0;
+ maxWidth = min(options.maxWidth || 1<<24, imgWidth);
+ maxHeight = min(options.maxHeight || 1<<24, imgHeight);
+
+ if ($().jquery == '1.3.2' && position == 'fixed' &&
+ !docElem['getBoundingClientRect'])
+ {
+ imgOfs.top += max(document.body.scrollTop, docElem.scrollTop);
+ imgOfs.left += max(document.body.scrollLeft, docElem.scrollLeft);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> parOfs = $.inArray($parent.css('position'), ['absolute', 'relative']) + 1 ?
</span><span class="lines">@@ -142,6 +155,9 @@
</span><span class="cx">
</span><span class="cx"> left = viewX(0);
</span><span class="cx"> top = viewY(0);
</span><ins>+
+ if (selection.x2 > imgWidth || selection.y2 > imgHeight)
+ doResize();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> function update(resetKeyPress) {
</span><span class="lines">@@ -170,10 +186,10 @@
</span><span class="cx">
</span><span class="cx"> switch ($handles.length) {
</span><span class="cx"> case 8:
</span><del>- $($handles[4]).css({ left: w / 2 });
- $($handles[5]).css({ left: w, top: h / 2 });
- $($handles[6]).css({ left: w / 2, top: h });
- $($handles[7]).css({ top: h / 2 });
</del><ins>+ $($handles[4]).css({ left: w >> 1 });
+ $($handles[5]).css({ left: w, top: h >> 1 });
+ $($handles[6]).css({ left: w >> 1, top: h });
+ $($handles[7]).css({ top: h >> 1 });
</ins><span class="cx"> case 4:
</span><span class="cx"> $handles.slice(1,3).css({ left: w });
</span><span class="cx"> $handles.slice(2,4).css({ top: h });
</span><span class="lines">@@ -221,13 +237,13 @@
</span><span class="cx"> resize = '';
</span><span class="cx">
</span><span class="cx"> if (options.resizable) {
</span><del>- if (y <= resizeMargin)
</del><ins>+ if (y <= options.resizeMargin)
</ins><span class="cx"> resize = 'n';
</span><del>- else if (y >= selection.height - resizeMargin)
</del><ins>+ else if (y >= selection.height - options.resizeMargin)
</ins><span class="cx"> resize = 's';
</span><del>- if (x <= resizeMargin)
</del><ins>+ if (x <= options.resizeMargin)
</ins><span class="cx"> resize += 'w';
</span><del>- else if (x >= selection.width - resizeMargin)
</del><ins>+ else if (x >= selection.width - options.resizeMargin)
</ins><span class="cx"> resize += 'e';
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -239,14 +255,13 @@
</span><span class="cx">
</span><span class="cx"> function docMouseUp(event) {
</span><span class="cx"> $('body').css('cursor', '');
</span><del>-
</del><span class="cx"> if (options.autoHide || selection.width * selection.height == 0)
</span><span class="cx"> hide($box.add($outer), function () { $(this).hide(); });
</span><span class="cx">
</span><del>- options.onSelectEnd(img, getSelection());
-
</del><span class="cx"> $(document).unbind('mousemove', selectingMouseMove);
</span><span class="cx"> $box.mousemove(areaMouseMove);
</span><ins>+
+ options.onSelectEnd(img, getSelection());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> function areaMouseDown(event) {
</span><span class="lines">@@ -284,59 +299,60 @@
</span><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- function aspectRatioXY() {
- x2 = max(left, min(left + imgWidth,
- x1 + abs(y2 - y1) * aspectRatio * (x2 > x1 || -1)));
</del><ins>+ function fixAspectRatio(xFirst) {
+ if (aspectRatio)
+ if (xFirst) {
+ x2 = max(left, min(left + imgWidth,
+ x1 + abs(y2 - y1) * aspectRatio * (x2 > x1 || -1)));
</ins><span class="cx">
</span><del>- y2 = round(max(top, min(top + imgHeight,
- y1 + abs(x2 - x1) / aspectRatio * (y2 > y1 || -1))));
- x2 = round(x2);
</del><ins>+ y2 = round(max(top, min(top + imgHeight,
+ y1 + abs(x2 - x1) / aspectRatio * (y2 > y1 || -1))));
+ x2 = round(x2);
+ }
+ else {
+ y2 = max(top, min(top + imgHeight,
+ y1 + abs(x2 - x1) / aspectRatio * (y2 > y1 || -1)));
+ x2 = round(max(left, min(left + imgWidth,
+ x1 + abs(y2 - y1) * aspectRatio * (x2 > x1 || -1))));
+ y2 = round(y2);
+ }
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- function aspectRatioYX() {
- y2 = max(top, min(top + imgHeight,
- y1 + abs(x2 - x1) / aspectRatio * (y2 > y1 || -1)));
- x2 = round(max(left, min(left + imgWidth,
- x1 + abs(y2 - y1) * aspectRatio * (x2 > x1 || -1))));
- y2 = round(y2);
- }
-
</del><span class="cx"> function doResize() {
</span><del>- if (abs(x2 - x1) < options.minWidth) {
- x2 = x1 - options.minWidth * (x2 < x1 || -1);
</del><ins>+ x1 = min(x1, left + imgWidth);
+ y1 = min(y1, top + imgHeight);
</ins><span class="cx">
</span><ins>+ if (abs(x2 - x1) < minWidth) {
+ x2 = x1 - minWidth * (x2 < x1 || -1);
+
</ins><span class="cx"> if (x2 < left)
</span><del>- x1 = left + options.minWidth;
</del><ins>+ x1 = left + minWidth;
</ins><span class="cx"> else if (x2 > left + imgWidth)
</span><del>- x1 = left + imgWidth - options.minWidth;
</del><ins>+ x1 = left + imgWidth - minWidth;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- if (abs(y2 - y1) < options.minHeight) {
- y2 = y1 - options.minHeight * (y2 < y1 || -1);
</del><ins>+ if (abs(y2 - y1) < minHeight) {
+ y2 = y1 - minHeight * (y2 < y1 || -1);
</ins><span class="cx">
</span><span class="cx"> if (y2 < top)
</span><del>- y1 = top + options.minHeight;
</del><ins>+ y1 = top + minHeight;
</ins><span class="cx"> else if (y2 > top + imgHeight)
</span><del>- y1 = top + imgHeight - options.minHeight;
</del><ins>+ y1 = top + imgHeight - minHeight;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> x2 = max(left, min(x2, left + imgWidth));
</span><span class="cx"> y2 = max(top, min(y2, top + imgHeight));
</span><span class="cx">
</span><del>- if (aspectRatio)
- if (abs(x2 - x1) / aspectRatio > abs(y2 - y1))
- aspectRatioYX();
- else
- aspectRatioXY();
</del><ins>+ fixAspectRatio(abs(x2 - x1) < abs(y2 - y1) * aspectRatio);
</ins><span class="cx">
</span><del>- if (abs(x2 - x1) > options.maxWidth) {
- x2 = x1 - options.maxWidth * (x2 < x1 || -1);
- if (aspectRatio) aspectRatioYX();
</del><ins>+ if (abs(x2 - x1) > maxWidth) {
+ x2 = x1 - maxWidth * (x2 < x1 || -1);
+ fixAspectRatio();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- if (abs(y2 - y1) > options.maxHeight) {
- y2 = y1 - options.maxHeight * (y2 < y1 || -1);
- if (aspectRatio) aspectRatioXY();
</del><ins>+ if (abs(y2 - y1) > maxHeight) {
+ y2 = y1 - maxHeight * (y2 < y1 || -1);
+ fixAspectRatio(true);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> selection = { x1: selX(min(x1, x2)), x2: selX(max(x1, x2)),
</span><span class="lines">@@ -362,8 +378,8 @@
</span><span class="cx"> x2 = (x1 = newX1) + selection.width;
</span><span class="cx"> y2 = (y1 = newY1) + selection.height;
</span><span class="cx">
</span><del>- selection = $.extend(selection, { x1: selX(x1), y1: selY(y1),
- x2: selX(x2), y2: selY(y2) });
</del><ins>+ $.extend(selection, { x1: selX(x1), y1: selY(y1), x2: selX(x2),
+ y2: selY(y2) });
</ins><span class="cx">
</span><span class="cx"> update();
</span><span class="cx">
</span><span class="lines">@@ -382,6 +398,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> function startSelection() {
</span><ins>+ $(document).unbind('mousemove', startSelection);
</ins><span class="cx"> adjust();
</span><span class="cx">
</span><span class="cx"> x2 = x1;
</span><span class="lines">@@ -404,11 +421,11 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> function cancelSelection() {
</span><del>- $(document).unbind('mousemove', startSelection);
</del><ins>+ $(document).unbind('mousemove', startSelection)
+ .unbind('mouseup', cancelSelection);
</ins><span class="cx"> hide($box.add($outer));
</span><span class="cx">
</span><del>- selection = { x1: selX(x1), y1: selY(y1), x2: selX(x1), y2: selY(y1),
- width: 0, height: 0 };
</del><ins>+ setSelection(selX(x1), selY(y1), selX(x1), selY(y1));
</ins><span class="cx">
</span><span class="cx"> options.onSelectChange(img, getSelection());
</span><span class="cx"> options.onSelectEnd(img, getSelection());
</span><span class="lines">@@ -421,13 +438,12 @@
</span><span class="cx"> startX = x1 = evX(event);
</span><span class="cx"> startY = y1 = evY(event);
</span><span class="cx">
</span><del>- $(document).one('mousemove', startSelection)
- .one('mouseup', cancelSelection);
</del><ins>+ $(document).mousemove(startSelection).mouseup(cancelSelection);
</ins><span class="cx">
</span><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- function parentScroll() {
</del><ins>+ function windowResize() {
</ins><span class="cx"> doUpdate(false);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -437,8 +453,9 @@
</span><span class="cx"> setOptions(options = $.extend({
</span><span class="cx"> classPrefix: 'imgareaselect',
</span><span class="cx"> movable: true,
</span><ins>+ parent: 'body',
</ins><span class="cx"> resizable: true,
</span><del>- parent: 'body',
</del><ins>+ resizeMargin: 10,
</ins><span class="cx"> onInit: function () {},
</span><span class="cx"> onSelectStart: function () {},
</span><span class="cx"> onSelectChange: function () {},
</span><span class="lines">@@ -458,7 +475,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> var docKeyPress = function(event) {
</span><del>- var k = options.keys, d, t, key = event.keyCode || event.which;
</del><ins>+ var k = options.keys, d, t, key = event.keyCode;
</ins><span class="cx">
</span><span class="cx"> d = !isNaN(k.alt) && (event.altKey || event.originalEvent.altKey) ? k.alt :
</span><span class="cx"> !isNaN(k.ctrl) && event.ctrlKey ? k.ctrl :
</span><span class="lines">@@ -476,7 +493,7 @@
</span><span class="cx"> t = max(x1, x2);
</span><span class="cx"> x1 = min(x1, x2);
</span><span class="cx"> x2 = max(t + d, x1);
</span><del>- if (aspectRatio) aspectRatioYX();
</del><ins>+ fixAspectRatio();
</ins><span class="cx"> break;
</span><span class="cx"> case 38:
</span><span class="cx"> d = -d;
</span><span class="lines">@@ -484,7 +501,7 @@
</span><span class="cx"> t = max(y1, y2);
</span><span class="cx"> y1 = min(y1, y2);
</span><span class="cx"> y2 = max(t + d, y1);
</span><del>- if (aspectRatio) aspectRatioXY();
</del><ins>+ fixAspectRatio(true);
</ins><span class="cx"> break;
</span><span class="cx"> default:
</span><span class="cx"> return;
</span><span class="lines">@@ -527,7 +544,7 @@
</span><span class="cx"> if (newOptions.parent)
</span><span class="cx"> ($parent = $(newOptions.parent)).append($box.add($outer));
</span><span class="cx">
</span><del>- options = $.extend(options, newOptions);
</del><ins>+ $.extend(options, newOptions);
</ins><span class="cx">
</span><span class="cx"> adjust();
</span><span class="cx">
</span><span class="lines">@@ -546,7 +563,7 @@
</span><span class="cx"> zIndex: zIndex + 1 || 1
</span><span class="cx"> });
</span><span class="cx">
</span><del>- if (!parseInt($handles.css('width')))
</del><ins>+ if (!parseInt($handles.css('width')) >= 0)
</ins><span class="cx"> $handles.width(5).height(5);
</span><span class="cx">
</span><span class="cx"> if (o = options.borderWidth)
</span><span class="lines">@@ -562,7 +579,7 @@
</span><span class="cx">
</span><span class="cx"> if (newOptions.x1 != null) {
</span><span class="cx"> setSelection(newOptions.x1, newOptions.y1, newOptions.x2,
</span><del>- newOptions.y2);
</del><ins>+ newOptions.y2);
</ins><span class="cx"> newOptions.show = !newOptions.hide;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -586,7 +603,7 @@
</span><span class="cx"> if (o = options.borderColor2)
</span><span class="cx"> $($border[1]).css({ borderStyle: 'dashed', borderColor: o });
</span><span class="cx">
</span><del>- $box.append($area.add($border).add($handles).add($areaOpera));
</del><ins>+ $box.append($area.add($border).add($areaOpera).add($handles));
</ins><span class="cx">
</span><span class="cx"> if ($.browser.msie) {
</span><span class="cx"> if (o = $outer.css('filter').match(/opacity=([0-9]+)/))
</span><span class="lines">@@ -605,25 +622,32 @@
</span><span class="cx">
</span><span class="cx"> aspectRatio = (d = (options.aspectRatio || '').split(/:/))[0] / d[1];
</span><span class="cx">
</span><ins>+ $img.add($outer).unbind('mousedown', imgMouseDown);
+
</ins><span class="cx"> if (options.disable || options.enable === false) {
</span><span class="cx"> $box.unbind('mousemove', areaMouseMove).unbind('mousedown', areaMouseDown);
</span><del>- $img.add($outer).unbind('mousedown', imgMouseDown);
- $(window).unbind('resize', parentScroll);
- $img.add($img.parents()).unbind('scroll', parentScroll);
</del><ins>+ $(window).unbind('resize', windowResize);
</ins><span class="cx"> }
</span><del>- else if (options.enable || options.disable === false) {
- if (options.resizable || options.movable)
- $box.mousemove(areaMouseMove).mousedown(areaMouseDown);
</del><ins>+ else {
+ if (options.enable || options.disable === false) {
+ if (options.resizable || options.movable)
+ $box.mousemove(areaMouseMove).mousedown(areaMouseDown);
</ins><span class="cx">
</span><ins>+ $(window).resize(windowResize);
+ }
+
</ins><span class="cx"> if (!options.persistent)
</span><span class="cx"> $img.add($outer).mousedown(imgMouseDown);
</span><del>- $(window).resize(parentScroll);
- $img.add($img.parents()).scroll(parentScroll);
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> options.enable = options.disable = undefined;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ this.remove = function () {
+ setOptions({ disable: true });
+ $box.add($outer).remove();
+ };
+
</ins><span class="cx"> this.getOptions = function () { return options; };
</span><span class="cx">
</span><span class="cx"> this.setOptions = setOptions;
</span><span class="lines">@@ -636,17 +660,16 @@
</span><span class="cx">
</span><span class="cx"> $p = $img;
</span><span class="cx">
</span><del>- while ($p.length && !$p.is('body')) {
- if (!isNaN($p.css('z-index')) && $p.css('z-index') > zIndex)
- zIndex = $p.css('z-index');
</del><ins>+ while ($p.length) {
+ zIndex = max(zIndex,
+ !isNaN($p.css('z-index')) ? $p.css('z-index') : zIndex);
</ins><span class="cx"> if ($p.css('position') == 'fixed')
</span><span class="cx"> position = 'fixed';
</span><span class="cx">
</span><del>- $p = $p.parent();
</del><ins>+ $p = $p.parent(':not(body)');
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- if (!isNaN(options.zIndex))
- zIndex = options.zIndex;
</del><ins>+ zIndex = options.zIndex || zIndex;
</ins><span class="cx">
</span><span class="cx"> if ($.browser.msie)
</span><span class="cx"> $img.attr('unselectable', 'on');
</span><span class="lines">@@ -661,20 +684,28 @@
</span><span class="cx"> $box.add($outer).css({ visibility: 'hidden', position: position,
</span><span class="cx"> overflow: 'hidden', zIndex: zIndex || '0' });
</span><span class="cx"> $box.css({ zIndex: zIndex + 2 || 2 });
</span><del>- $area.add($border).css({ position: 'absolute' });
</del><ins>+ $area.add($border).css({ position: 'absolute', fontSize: 0 });
</ins><span class="cx">
</span><span class="cx"> img.complete || img.readyState == 'complete' || !$img.is('img') ?
</span><span class="cx"> imgLoad() : $img.one('load', imgLoad);
</span><span class="cx">
</span><ins>+ if ($.browser.msie && $.browser.version >= 9)
+ img.src = img.src;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> $.fn.imgAreaSelect = function (options) {
</span><span class="cx"> options = options || {};
</span><span class="cx">
</span><span class="cx"> this.each(function () {
</span><del>- if ($(this).data('imgAreaSelect'))
- $(this).data('imgAreaSelect').setOptions(options);
- else {
</del><ins>+ if ($(this).data('imgAreaSelect')) {
+ if (options.remove) {
+ $(this).data('imgAreaSelect').remove();
+ $(this).removeData('imgAreaSelect');
+ }
+ else
+ $(this).data('imgAreaSelect').setOptions(options);
+ }
+ else if (!options.remove) {
</ins><span class="cx"> if (options.enable === undefined && options.disable === undefined)
</span><span class="cx"> options.enable = true;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkwpincludesjsimgareaselectjqueryimgareaselectjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/imgareaselect/jquery.imgareaselect.js (17933 => 17934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/imgareaselect/jquery.imgareaselect.js        2011-05-15 08:54:32 UTC (rev 17933)
+++ trunk/wp-includes/js/imgareaselect/jquery.imgareaselect.js        2011-05-15 18:03:51 UTC (rev 17934)
</span><span class="lines">@@ -1 +1 @@
</span><del>-(function(e){var b=Math.abs,a=Math.max,d=Math.min,c=Math.round;function f(){return e("<div/>")}e.imgAreaSelect=function(q,S){var aw=e(q),U,ar=f(),af=f(),H=f().add(f()).add(f()).add(f()),Y=f().add(f()).add(f()).add(f()),L=e([]),R,n,p,az,N,j,A,M,B=0,ad="absolute",Q,P,aa,Z,V=10,I,T,K,y,aA,x,ay,v={x1:0,y1:0,x2:0,y2:0,width:0,height:0},l,aq,am,ag,ac,an,u;function G(h){return h+az.left-M.left}function F(h){return h+az.top-M.top}function E(h){return h-az.left+M.left}function z(h){return h-az.top+M.top}function ak(h){return h.pageX-M.left}function ai(h){return h.pageY-M.top}function D(h){var o=h||aa,i=h||Z;return{x1:c(v.x1*o),y1:c(v.y1*i),x2:c(v.x2*o),y2:c(v.y2*i),width:c(v.x2*o)-c(v.x1*o),height:c(v.y2*i)-c(v.y1*i)}}function ae(i,w,h,o,aB){var aD=aB||aa,aC=aB||Z;v={x1:c(i/aD),y1:c(w/aC),x2:c(h/aD),y2:c(o/aC)};v.width=(h=G(v.x2))-(i=G(v.x1));v.height=(o=G(v.y2))-(w=G(v.y1))}function ao(){if(!aw.width()){return}az={left:c(aw.offset().left),top:c(
aw.offset().top)};N=aw.width();j=aw.height();if(e().jquery=="1.3.2"&&e.browser.safari&&ad=="fixed"){az.top+=a(document.documentElement.scrollTop,e("body").scrollTop());az.left+=a(document.documentElement.scrollLeft,e("body").scrollLeft())}M=e.inArray(A.css("position"),["absolute","relative"])+1?{left:c(A.offset().left)-A.scrollLeft(),top:c(A.offset().top)-A.scrollTop()}:ad=="fixed"?{left:e(document).scrollLeft(),top:e(document).scrollTop()}:{left:0,top:0};n=G(0);p=F(0)}function X(h){if(!K){return}ar.css({left:G(v.x1),top:F(v.y1)}).add(af).width(ac=v.width).height(an=v.height);af.add(H).add(L).css({left:0,top:0});H.width(a(ac-H.outerWidth()+H.innerWidth(),0)).height(a(an-H.outerHeight()+H.innerHeight(),0));e(Y[0]).css({left:n,top:p,width:v.x1,height:j});e(Y[1]).css({left:n+v.x1,top:p,width:ac,height:v.y1});e(Y[2]).css({left:n+v.x2,top:p,width:N-v.x2,height:j});e(Y[3]).css({left:n+v
.x1,top:p+v.y2,width:ac,height:j-v.y2});ac-=L.outerWidth();an-=L.outerHeight();switch(L.length){case 8:e(L[4]).css({left:ac/2});e(L[5]).css({left:ac,top:an/2});e(L[6]).css({left:ac/2,top:an});e(L[7]).css({top:an/2});case 4:L.slice(1,3).css({left:ac});L.slice(2,4).css({top:an})}if(h!==false){if(e.imgAreaSelect.keyPress!=at){e(document).unbind(e.imgAreaSelect.keyPress,e.imgAreaSelect.onKeyPress)}if(S.keys){e(document)[e.imgAreaSelect.keyPress](e.imgAreaSelect.onKeyPress=at)}}if(e.browser.msie&&H.outerWidth()-H.innerWidth()==2){H.css("margin",0);setTimeout(function(){H.css("margin","auto")},0)}}function t(h){ao();X(h);y=G(v.x1);aA=F(v.y1);x=G(v.x2);ay=F(v.y2)}function ah(h,i){S.fadeSpeed?h.fadeOut(S.fadeSpeed,i):h.hide()}function C(i){var h=E(ak(i))-v.x1,o=z(ai(i))-v.y1;if(!u){ao();u=true;ar.one("mouseout",function(){u=false})}I="";if(S.resizable){if(o<=V){I="n"}else{if(o>=v.height-V){I="s"}}if(
h<=V){I+="w"}else{if(h>=v.width-V){I+="e"}}}ar.css("cursor",I?I+"-resize":S.movable?"move":"");if(R){R.toggle()}}function aj(h){e("body").css("cursor","");if(S.autoHide||v.width*v.height==0){ah(ar.add(Y),function(){e(this).hide()})}S.onSelectEnd(q,D());e(document).unbind("mousemove",ab);ar.mousemove(C)}function s(h){if(h.which!=1){return false}ao();if(I){e("body").css("cursor",I+"-resize");y=G(v[/w/.test(I)?"x2":"x1"]);aA=F(v[/n/.test(I)?"y2":"y1"]);e(document).mousemove(ab).one("mouseup",aj);ar.unbind("mousemove",C)}else{if(S.movable){Q=n+v.x1-ak(h);P=p+v.y1-ai(h);ar.unbind("mousemove",C);e(document).mousemove(g).one("mouseup",function(){S.onSelectEnd(q,D());e(document).unbind("mousemove",g);ar.mousemove(C)})}else{aw.mousedown(h)}}return false}function
r(){x=a(n,d(n+N,y+b(ay-aA)*T*(x>y||-1)));ay=c(a(p,d(p+j,aA+b(x-y)/T*(ay>aA||-1))));x=c(x)}function al(){ay=a(p,d(p+j,aA+b(x-y)/T*(ay>aA||-1)));x=c(a(n,d(n+N,y+b(ay-aA)*T*(x>y||-1))));ay=c(ay)}function av(){if(b(x-y)<S.minWidth){x=y-S.minWidth*(x<y||-1);if(x<n){y=n+S.minWidth}else{if(x>n+N){y=n+N-S.minWidth}}}if(b(ay-aA)<S.minHeight){ay=aA-S.minHeight*(ay<aA||-1);if(ay<p){aA=p+S.minHeight}else{if(ay>p+j){aA=p+j-S.minHeight}}}x=a(n,d(x,n+N));ay=a(p,d(ay,p+j));if(T){if(b(x-y)/T>b(ay-aA)){al()}else{r()}}if(b(x-y)>S.maxWidth){x=y-S.maxWidth*(x<y||-1);if(T){al()}}if(b(ay-aA)>S.maxHeight){ay=aA-S.maxHeight*(ay<aA||-1);if(T){r()}}v={x1:E(d(y,x)),x2:E(a(y,x)),y1:z(d(aA,ay)),y2:z(a(aA,ay)),width:b(x-y),height:b(ay-aA)};X();S.onSelectChange(q,D())}function ab(h){x=I==""||/w|e/.test(I)||T?ak(h):G(v.x2);ay=I==""||/n|s/.test(I)||T?ai(h):F(v.y2);av();return false}function O(h,i){x=(y=h)+v.width;ay=(aA=i)+v.height;v=e.e
xtend(v,{x1:E(y),y1:z(aA),x2:E(x),y2:z(ay)});X();S.onSelectChange(q,D())}function g(h){y=a(n,d(Q+ak(h),n+N-v.width));aA=a(p,d(P+ai(h),p+j-v.height));O(y,aA);h.preventDefault();return false}function ax(){ao();x=y;ay=aA;av();I="";if(Y.is(":not(:visible)")){ar.add(Y).hide().fadeIn(S.fadeSpeed||0)}K=true;e(document).unbind("mouseup",ap).mousemove(ab).one("mouseup",aj);ar.unbind("mousemove",C);S.onSelectStart(q,D())}function ap(){e(document).unbind("mousemove",ax);ah(ar.add(Y));v={x1:E(y),y1:z(aA),x2:E(y),y2:z(aA),width:0,height:0};S.onSelectChange(q,D());S.onSelectEnd(q,D())}function m(h){if(h.which!=1||Y.is(":animated")){return false}ao();Q=y=ak(h);P=aA=ai(h);e(document).one("mousemove",ax).one("mouseup",ap);return false}function W(){t(false)}function au(){U=true;J(S=e.extend({classPrefix:"imgareaselect",movable:true,resizable:true,parent:"body",onInit:function(){},onSe
lectStart:function(){},onSelectChange:function(){},onSelectEnd:function(){}},S));ar.add(Y).css({visibility:""});if(S.show){K=true;ao();X();ar.add(Y).hide().fadeIn(S.fadeSpeed||0)}setTimeout(function(){S.onInit(q,D())},0)}var at=function(w){var h=S.keys,aB,o,i=w.keyCode||w.which;aB=!isNaN(h.alt)&&(w.altKey||w.originalEvent.altKey)?h.alt:!isNaN(h.ctrl)&&w.ctrlKey?h.ctrl:!isNaN(h.shift)&&w.shiftKey?h.shift:!isNaN(h.arrows)?h.arrows:10;if(h.arrows=="resize"||(h.shift=="resize"&&w.shiftKey)||(h.ctrl=="resize"&&w.ctrlKey)||(h.alt=="resize"&&(w.altKey||w.originalEvent.altKey))){switch(i){case 37:aB=-aB;case 39:o=a(y,x);y=d(y,x);x=a(o+aB,y);if(T){al()}break;case 38:aB=-aB;case 40:o=a(aA,ay);aA=d(aA,ay);ay=a(o+aB,aA);if(T){r()}break;default:return}av()}else{y=d(y,x);aA=d(aA,ay);switch(i){case 37:O(a(y-aB,n),aA);break;case 38:O(y,a(aA-aB,p));break;case 39:O(y+d(aB,N-E(x)),aA);break;case 4
0:O(y,aA+d(aB,j-z(ay)));break;default:return}}return false};function k(h,i){for(option in i){if(S[option]!==undefined){h.css(i[option],S[option])}}}function J(h){if(h.parent){(A=e(h.parent)).append(ar.add(Y))}S=e.extend(S,h);ao();if(h.handles!=null){L.remove();L=e([]);am=h.handles?h.handles=="corners"?4:8:0;while(am--){L=L.add(f())}L.addClass(S.classPrefix+"-handle").css({position:"absolute",fontSize:0,zIndex:B+1||1});if(!parseInt(L.css("width"))){L.width(5).height(5)}if(ag=S.borderWidth){L.css({borderWidth:ag,borderStyle:"solid"})}k(L,{borderColor1:"border-color",borderColor2:"background-color",borderOpacity:"opacity"})}aa=S.imageWidth/N||1;Z=S.imageHeight/j||1;if(h.x1!=null){ae(h.x1,h.y1,h.x2,h.y2);h.show=!h.hide}if(h.keys){S.keys=e.extend({shift:1,ctrl:"resize"},h.keys)}Y.addClass(S.classPrefix+"-outer");af.addClass(S.classPrefix+"-selection");for(am=0;am++<4;)
{e(H[am-1]).addClass(S.classPrefix+"-border"+am)}k(af,{selectionColor:"background-color",selectionOpacity:"opacity"});k(H,{borderOpacity:"opacity",borderWidth:"border-width"});k(Y,{outerColor:"background-color",outerOpacity:"opacity"});if(ag=S.borderColor1){e(H[0]).css({borderStyle:"solid",borderColor:ag})}if(ag=S.borderColor2){e(H[1]).css({borderStyle:"dashed",borderColor:ag})}ar.append(af.add(H).add(L).add(R));if(e.browser.msie){if(ag=Y.css("filter").match(/opacity=([0-9]+)/)){Y.css("opacity",ag[1]/100)}if(ag=H.css("filter").match(/opacity=([0-9]+)/)){H.css("opacity",ag[1]/100)}}if(h.hide){ah(ar.add(Y))}else{if(h.show&&U){K=true;ar.add(Y).fadeIn(S.fadeSpeed||0);t()}}T=(aq=(S.aspectRatio||"").split(/:/))[0]/aq[1];if(S.disable||S.enable===false){ar.unbind("mousemove",C).unbind("mousedown",s);aw.add(Y).unbind(&
quot;mousedown",m);e(window).unbind("resize",W);aw.add(aw.parents()).unbind("scroll",W)}else{if(S.enable||S.disable===false){if(S.resizable||S.movable){ar.mousemove(C).mousedown(s)}if(!S.persistent){aw.add(Y).mousedown(m)}e(window).resize(W);aw.add(aw.parents()).scroll(W)}}S.enable=S.disable=undefined}this.getOptions=function(){return S};this.setOptions=J;this.getSelection=D;this.setSelection=ae;this.update=t;l=aw;while(l.length&&!l.is("body")){if(!isNaN(l.css("z-index"))&&l.css("z-index")>B){B=l.css("z-index")}if(l.css("position")=="fixed"){ad="fixed"}l=l.parent()}if(!isNaN(S.zIndex)){B=S.zIndex}if(e.browser.msie){aw.attr("unselectable","on")}e.imgAreaSelect.keyPress=e.browser.msie||e.browser.safari?"keydown":"keypress";if(e.browser.opera){R=f().css({width:"100%",height:"100%",position:"absolute&qu
ot;,zIndex:B+2||2})}ar.add(Y).css({visibility:"hidden",position:ad,overflow:"hidden",zIndex:B||"0"});ar.css({zIndex:B+2||2});af.add(H).css({position:"absolute"});q.complete||q.readyState=="complete"||!aw.is("img")?au():aw.one("load",au)};e.fn.imgAreaSelect=function(g){g=g||{};this.each(function(){if(e(this).data("imgAreaSelect")){e(this).data("imgAreaSelect").setOptions(g)}else{if(g.enable===undefined&&g.disable===undefined){g.enable=true}e(this).data("imgAreaSelect",new e.imgAreaSelect(this,g))}});if(g.instance){return e(this).data("imgAreaSelect")}return this}})(jQuery);
</del><span class="cx">\ No newline at end of file
</span><ins>+(function(e){var b=Math.abs,a=Math.max,d=Math.min,c=Math.round;function f(){return e("<div/>")}e.imgAreaSelect=function(Q,ad){var M=e(Q),u,B=f(),E=f(),ap=f().add(f()).add(f()).add(f()),v=f().add(f()).add(f()).add(f()),ax=e([]),aj,T,ao,ay={left:0,top:0},S,aA,p,V={left:0,top:0},g=0,ak="absolute",an,am,ab,aa,az=10,t,q,al,k,x,aE,ah,D,n,C,l,aC={x1:0,y1:0,x2:0,y2:0,width:0,height:0},F=document.documentElement,Z,R,O,N,K,P,I;function Y(h){return h+ay.left-V.left}function X(h){return h+ay.top-V.top}function au(h){return h-ay.left+V.left}function at(h){return h-ay.top+V.top}function A(h){return h.pageX-V.left}function z(h){return h.pageY-V.top}function ar(h){var o=h||ab,i=h||aa;return{x1:c(aC.x1*o),y1:c(aC.y1*i),x2:c(aC.x2*o),y2:c(aC.y2*i),width:c(aC.x2*o)-c(aC.x1*o),height:c(aC.y2*i)-c(aC.y1*i)}}function aq(i,w,h,o,aF){var aH=aF||ab,aG=aF||aa;aC={x1:c(i/aH||0),y1:c(w/aG||0),x2:c(h/aH||0),y2:c(o/aG||0)};aC.width=aC.x2-aC.x1;aC.height=aC.y2-aC.y1}f
unction m(){if(!M.width()){return}ay={left:c(M.offset().left),top:c(M.offset().top)};S=M.innerWidth();aA=M.innerHeight();ay.top+=(M.outerHeight()-aA)>>1;ay.left+=(M.outerWidth()-S)>>1;q=ad.minWidth||0;al=ad.minHeight||0;k=d(ad.maxWidth||1<<24,S);x=d(ad.maxHeight||1<<24,aA);if(e().jquery=="1.3.2"&&ak=="fixed"&&!F.getBoundingClientRect){ay.top+=a(document.body.scrollTop,F.scrollTop);ay.left+=a(document.body.scrollLeft,F.scrollLeft)}V=e.inArray(p.css("position"),["absolute","relative"])+1?{left:c(p.offset().left)-p.scrollLeft(),top:c(p.offset().top)-p.scrollTop()}:ak=="fixed"?{left:e(document).scrollLeft(),top:e(document).scrollTop()}:{left:0,top:0};T=Y(0);ao=X(0);if(aC.x2>S||aC.y2>aA){aB()}}function J(h){if(!ah){return}B.css({left:Y(aC.x1),top:X(aC.y1)}).add(E).width(K=aC.width).height(P=aC.height);E.add(ap).add(ax).css({left:0,top:0});ap.width(a(K-ap.outerWidth()+ap.inner
Width(),0)).height(a(P-ap.outerHeight()+ap.innerHeight(),0));e(v[0]).css({left:T,top:ao,width:aC.x1,height:aA});e(v[1]).css({left:T+aC.x1,top:ao,width:K,height:aC.y1});e(v[2]).css({left:T+aC.x2,top:ao,width:S-aC.x2,height:aA});e(v[3]).css({left:T+aC.x1,top:ao+aC.y2,width:K,height:aA-aC.y2});K-=ax.outerWidth();P-=ax.outerHeight();switch(ax.length){case 8:e(ax[4]).css({left:K>>1});e(ax[5]).css({left:K,top:P>>1});e(ax[6]).css({left:K>>1,top:P});e(ax[7]).css({top:P>>1});case 4:ax.slice(1,3).css({left:K});ax.slice(2,4).css({top:P})}if(h!==false){if(e.imgAreaSelect.keyPress!=av){e(document).unbind(e.imgAreaSelect.keyPress,e.imgAreaSelect.onKeyPress)}if(ad.keys){e(document)[e.imgAreaSelect.keyPress](e.imgAreaSelect.onKeyPress=av)}}if(e.browser.msie&&ap.outerWidth()-ap.innerWidth()==2){ap.css("margin",0);setTimeout(function(){ap.css("margin","auto")},0)}}function y(h){m();J(h);D=Y(aC.x1);n=X(aC.y1);C=Y(aC.x2);l=X(aC.y2)}f
unction ag(h,i){ad.fadeSpeed?h.fadeOut(ad.fadeSpeed,i):h.hide()}function H(i){var h=au(A(i))-aC.x1,o=at(z(i))-aC.y1;if(!I){m();I=true;B.one("mouseout",function(){I=false})}t="";if(ad.resizable){if(o<=ad.resizeMargin){t="n"}else{if(o>=aC.height-ad.resizeMargin){t="s"}}if(h<=ad.resizeMargin){t+="w"}else{if(h>=aC.width-ad.resizeMargin){t+="e"}}}B.css("cursor",t?t+"-resize":ad.movable?"move":"");if(aj){aj.toggle()}}function j(h){e("body").css("cursor","");if(ad.autoHide||aC.width*aC.height==0){ag(B.add(v),function(){e(this).hide()})}e(document).unbind("mousemove",ae);B.mousemove(H);ad.onSelectEnd(Q,ar())}function aw(h){if(h.which!=1){return false}m();if(t){e("body").css("cursor",t+"-resize");D=Y(aC[/w/.test(t)?"x2":"x1"]);n=X(aC[/n/.test(t)?"y2":"y1"]);e(docume
nt).mousemove(ae).one("mouseup",j);B.unbind("mousemove",H)}else{if(ad.movable){an=T+aC.x1-A(h);am=ao+aC.y1-z(h);B.unbind("mousemove",H);e(document).mousemove(ac).one("mouseup",function(){ad.onSelectEnd(Q,ar());e(document).unbind("mousemove",ac);B.mousemove(H)})}else{M.mousedown(h)}}return false}function L(h){if(aE){if(h){C=a(T,d(T+S,D+b(l-n)*aE*(C>D||-1)));l=c(a(ao,d(ao+aA,n+b(C-D)/aE*(l>n||-1))));C=c(C)}else{l=a(ao,d(ao+aA,n+b(C-D)/aE*(l>n||-1)));C=c(a(T,d(T+S,D+b(l-n)*aE*(C>D||-1))));l=c(l)}}}function aB(){D=d(D,T+S);n=d(n,ao+aA);if(b(C-D)<q){C=D-q*(C<D||-1);if(C<T){D=T+q}else{if(C>T+S){D=T+S-q}}}if(b(l-n)<al){l=n-al*(l<n||-1);if(l<ao){n=ao+al}else{if(l>ao+aA){n=ao+aA-al}}}C=a(T,d(C,T+S));l=a(ao,d(l,ao+aA));L(b(C-D)<b(l-n)*aE);if(b(C-D)>k){C=D-k*(C<D||-1);L()}if(b(l-n)>x){l=n-x*(l<n||-1);L(true)}aC={x1:au(d(D,C)),x2:au(a(D,C)),y1:at(d(n,l)),y2:at(a(n,l)),width:b(C-D),height
:b(l-n)};J();ad.onSelectChange(Q,ar())}function ae(h){C=t==""||/w|e/.test(t)||aE?A(h):Y(aC.x2);l=t==""||/n|s/.test(t)||aE?z(h):X(aC.y2);aB();return false}function U(h,i){C=(D=h)+aC.width;l=(n=i)+aC.height;e.extend(aC,{x1:au(D),y1:at(n),x2:au(C),y2:at(l)});J();ad.onSelectChange(Q,ar())}function ac(h){D=a(T,d(an+A(h),T+S-aC.width));n=a(ao,d(am+z(h),ao+aA-aC.height));U(D,n);h.preventDefault();return false}function r(){e(document).unbind("mousemove",r);m();C=D;l=n;aB();t="";if(v.is(":not(:visible)")){B.add(v).hide().fadeIn(ad.fadeSpeed||0)}ah=true;e(document).unbind("mouseup",W).mousemove(ae).one("mouseup",j);B.unbind("mousemove",H);ad.onSelectStart(Q,ar())}function W(){e(document).unbind("mousemove",r).unbind("mouseup",W);ag(B.add(v));aq(au(D),at(n),au(D),at(n));ad.onSelectChange(Q,ar());ad.onSelectEnd(Q,ar())}function aD(h){if(h.which!=1||v.is(":animated")){return fals
e}m();an=D=A(h);am=n=z(h);e(document).mousemove(r).mouseup(W);return false}function ai(){y(false)}function s(){u=true;af(ad=e.extend({classPrefix:"imgareaselect",movable:true,parent:"body",resizable:true,resizeMargin:10,onInit:function(){},onSelectStart:function(){},onSelectChange:function(){},onSelectEnd:function(){}},ad));B.add(v).css({visibility:""});if(ad.show){ah=true;m();J();B.add(v).hide().fadeIn(ad.fadeSpeed||0)}setTimeout(function(){ad.onInit(Q,ar())},0)}var av=function(w){var h=ad.keys,aF,o,i=w.keyCode;aF=!isNaN(h.alt)&&(w.altKey||w.originalEvent.altKey)?h.alt:!isNaN(h.ctrl)&&w.ctrlKey?h.ctrl:!isNaN(h.shift)&&w.shiftKey?h.shift:!isNaN(h.arrows)?h.arrows:10;if(h.arrows=="resize"||(h.shift=="resize"&&w.shiftKey)||(h.ctrl=="resize"&&w.ctrlKey)||(h.alt=="resize"&&(w.altKey||w.originalEvent.altKey))){switch(i){case 37:aF=-aF;case 39:o=a(D,C);D=d(D,C);C=a
(o+aF,D);L();break;case 38:aF=-aF;case 40:o=a(n,l);n=d(n,l);l=a(o+aF,n);L(true);break;default:return}aB()}else{D=d(D,C);n=d(n,l);switch(i){case 37:U(a(D-aF,T),n);break;case 38:U(D,a(n-aF,ao));break;case 39:U(D+d(aF,S-au(C)),n);break;case 40:U(D,n+d(aF,aA-at(l)));break;default:return}}return false};function G(h,i){for(option in i){if(ad[option]!==undefined){h.css(i[option],ad[option])}}}function af(h){if(h.parent){(p=e(h.parent)).append(B.add(v))}e.extend(ad,h);m();if(h.handles!=null){ax.remove();ax=e([]);O=h.handles?h.handles=="corners"?4:8:0;while(O--){ax=ax.add(f())}ax.addClass(ad.classPrefix+"-handle").css({position:"absolute",fontSize:0,zIndex:g+1||1});if(!parseInt(ax.css("width"))>=0){ax.width(5).height(5)}if(N=ad.borderWidth){ax.css({borderWidth:N,borderStyle:"solid"})}G(ax,{borderColor1:"border-color",borderColor2:"background-color",borderOpacity:"opacity"})}ab=ad.imageWidth/S||1;aa=ad.
imageHeight/aA||1;if(h.x1!=null){aq(h.x1,h.y1,h.x2,h.y2);h.show=!h.hide}if(h.keys){ad.keys=e.extend({shift:1,ctrl:"resize"},h.keys)}v.addClass(ad.classPrefix+"-outer");E.addClass(ad.classPrefix+"-selection");for(O=0;O++<4;){e(ap[O-1]).addClass(ad.classPrefix+"-border"+O)}G(E,{selectionColor:"background-color",selectionOpacity:"opacity"});G(ap,{borderOpacity:"opacity",borderWidth:"border-width"});G(v,{outerColor:"background-color",outerOpacity:"opacity"});if(N=ad.borderColor1){e(ap[0]).css({borderStyle:"solid",borderColor:N})}if(N=ad.borderColor2){e(ap[1]).css({borderStyle:"dashed",borderColor:N})}B.append(E.add(ap).add(aj).add(ax));if(e.browser.msie){if(N=v.css("filter").match(/opacity=([0-9]+)/)){v.css("opacity",N[1]/100)}if(N=ap.css("filter").match(/opacity=([0-9]+)/)){ap.css("opacity",N[1]/100)}}if(h.hide){ag(B.
add(v))}else{if(h.show&&u){ah=true;B.add(v).fadeIn(ad.fadeSpeed||0);y()}}aE=(R=(ad.aspectRatio||"").split(/:/))[0]/R[1];M.add(v).unbind("mousedown",aD);if(ad.disable||ad.enable===false){B.unbind("mousemove",H).unbind("mousedown",aw);e(window).unbind("resize",ai)}else{if(ad.enable||ad.disable===false){if(ad.resizable||ad.movable){B.mousemove(H).mousedown(aw)}e(window).resize(ai)}if(!ad.persistent){M.add(v).mousedown(aD)}}ad.enable=ad.disable=undefined}this.remove=function(){af({disable:true});B.add(v).remove()};this.getOptions=function(){return ad};this.setOptions=af;this.getSelection=ar;this.setSelection=aq;this.update=y;Z=M;while(Z.length){g=a(g,!isNaN(Z.css("z-index"))?Z.css("z-index"):g);if(Z.css("position")=="fixed"){ak="fixed"}Z=Z.parent(":not(body)")}g=ad.zIndex||g;if(e.browser.msie){M.attr("unselectable","on")}e.imgAreaSelect.keyPre
ss=e.browser.msie||e.browser.safari?"keydown":"keypress";if(e.browser.opera){aj=f().css({width:"100%",height:"100%",position:"absolute",zIndex:g+2||2})}B.add(v).css({visibility:"hidden",position:ak,overflow:"hidden",zIndex:g||"0"});B.css({zIndex:g+2||2});E.add(ap).css({position:"absolute",fontSize:0});Q.complete||Q.readyState=="complete"||!M.is("img")?s():M.one("load",s);if(e.browser.msie&&e.browser.version>=9){Q.src=Q.src}};e.fn.imgAreaSelect=function(g){g=g||{};this.each(function(){if(e(this).data("imgAreaSelect")){if(g.remove){e(this).data("imgAreaSelect").remove();e(this).removeData("imgAreaSelect")}else{e(this).data("imgAreaSelect").setOptions(g)}}else{if(!g.remove){if(g.enable===undefined&&g.disable===undefined){g.enable=true}e(this).data("imgAreaSelect",new e.imgAreaSelect(this,g))}
}});if(g.instance){return e(this).data("imgAreaSelect")}return this}})(jQuery);
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpincludesscriptloaderphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/script-loader.php (17933 => 17934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/script-loader.php        2011-05-15 08:54:32 UTC (rev 17933)
+++ trunk/wp-includes/script-loader.php        2011-05-15 18:03:51 UTC (rev 17934)
</span><span class="lines">@@ -250,7 +250,7 @@
</span><span class="cx">
</span><span class="cx">         $scripts->add( 'json2', "/wp-includes/js/json2$suffix.js", false, '2011-02-23');
</span><span class="cx">
</span><del>-        $scripts->add( 'imgareaselect', "/wp-includes/js/imgareaselect/jquery.imgareaselect$suffix.js", array('jquery'), '0.9.1-20110113' );
</del><ins>+        $scripts->add( 'imgareaselect', "/wp-includes/js/imgareaselect/jquery.imgareaselect$suffix.js", array('jquery'), '0.9.6-20110515' );
</ins><span class="cx">         $scripts->add_data( 'imgareaselect', 'group', 1 );
</span><span class="cx">
</span><span class="cx">         $scripts->add( 'password-strength-meter', "/wp-admin/js/password-strength-meter$suffix.js", array('jquery'), '20101027' );
</span></span></pre>
</div>
</div>
</body>
</html>