<!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' &amp;&amp; $.browser.safari &amp;&amp; position == 'fixed') {
-            imgOfs.top += max(document.documentElement.scrollTop, $('body').scrollTop());
</del><ins>+        imgOfs.top += ($img.outerHeight() - imgHeight) &gt;&gt; 1;
+        imgOfs.left += ($img.outerWidth() - imgWidth) &gt;&gt; 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&lt;&lt;24, imgWidth);
+        maxHeight = min(options.maxHeight || 1&lt;&lt;24, imgHeight);
+
+        if ($().jquery == '1.3.2' &amp;&amp; position == 'fixed' &amp;&amp;
+            !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 &gt; imgWidth || selection.y2 &gt; 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 &gt;&gt; 1 });
+            $($handles[5]).css({ left: w, top: h &gt;&gt; 1 });
+            $($handles[6]).css({ left: w &gt;&gt; 1, top: h });
+            $($handles[7]).css({ top: h &gt;&gt; 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 &lt;= resizeMargin)
</del><ins>+            if (y &lt;= options.resizeMargin)
</ins><span class="cx">                 resize = 'n';
</span><del>-            else if (y &gt;= selection.height - resizeMargin)
</del><ins>+            else if (y &gt;= selection.height - options.resizeMargin)
</ins><span class="cx">                 resize = 's';
</span><del>-            if (x &lt;= resizeMargin)
</del><ins>+            if (x &lt;= options.resizeMargin)
</ins><span class="cx">                 resize += 'w';
</span><del>-            else if (x &gt;= selection.width - resizeMargin)
</del><ins>+            else if (x &gt;= 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 &gt; x1 || -1)));
</del><ins>+    function fixAspectRatio(xFirst) {
+        if (aspectRatio)
+            if (xFirst) {
+                x2 = max(left, min(left + imgWidth,
+                    x1 + abs(y2 - y1) * aspectRatio * (x2 &gt; x1 || -1)));
</ins><span class="cx"> 
</span><del>-        y2 = round(max(top, min(top + imgHeight,
-            y1 + abs(x2 - x1) / aspectRatio * (y2 &gt; y1 || -1))));
-        x2 = round(x2);
</del><ins>+                y2 = round(max(top, min(top + imgHeight,
+                    y1 + abs(x2 - x1) / aspectRatio * (y2 &gt; y1 || -1))));
+                x2 = round(x2);
+            }
+            else {
+                y2 = max(top, min(top + imgHeight,
+                    y1 + abs(x2 - x1) / aspectRatio * (y2 &gt; y1 || -1)));
+                x2 = round(max(left, min(left + imgWidth,
+                    x1 + abs(y2 - y1) * aspectRatio * (x2 &gt; 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 &gt; y1 || -1)));
-        x2 = round(max(left, min(left + imgWidth,
-            x1 + abs(y2 - y1) * aspectRatio * (x2 &gt; x1 || -1))));
-        y2 = round(y2);
-    }
-
</del><span class="cx">     function doResize() {
</span><del>-        if (abs(x2 - x1) &lt; options.minWidth) {
-            x2 = x1 - options.minWidth * (x2 &lt; x1 || -1);
</del><ins>+        x1 = min(x1, left + imgWidth);
+        y1 = min(y1, top + imgHeight);
</ins><span class="cx"> 
</span><ins>+        if (abs(x2 - x1) &lt; minWidth) {
+            x2 = x1 - minWidth * (x2 &lt; x1 || -1);
+
</ins><span class="cx">             if (x2 &lt; left)
</span><del>-                x1 = left + options.minWidth;
</del><ins>+                x1 = left + minWidth;
</ins><span class="cx">             else if (x2 &gt; 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) &lt; options.minHeight) {
-            y2 = y1 - options.minHeight * (y2 &lt; y1 || -1);
</del><ins>+        if (abs(y2 - y1) &lt; minHeight) {
+            y2 = y1 - minHeight * (y2 &lt; y1 || -1);
</ins><span class="cx"> 
</span><span class="cx">             if (y2 &lt; top)
</span><del>-                y1 = top + options.minHeight;
</del><ins>+                y1 = top + minHeight;
</ins><span class="cx">             else if (y2 &gt; 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 &gt; abs(y2 - y1))
-                aspectRatioYX();
-            else
-                aspectRatioXY();
</del><ins>+        fixAspectRatio(abs(x2 - x1) &lt; abs(y2 - y1) * aspectRatio);
</ins><span class="cx"> 
</span><del>-        if (abs(x2 - x1) &gt; options.maxWidth) {
-            x2 = x1 - options.maxWidth * (x2 &lt; x1 || -1);
-            if (aspectRatio) aspectRatioYX();
</del><ins>+        if (abs(x2 - x1) &gt; maxWidth) {
+            x2 = x1 - maxWidth * (x2 &lt; x1 || -1);
+            fixAspectRatio();
</ins><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if (abs(y2 - y1) &gt; options.maxHeight) {
-            y2 = y1 - options.maxHeight * (y2 &lt; y1 || -1);
-            if (aspectRatio) aspectRatioXY();
</del><ins>+        if (abs(y2 - y1) &gt; maxHeight) {
+            y2 = y1 - maxHeight * (y2 &lt; 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) &amp;&amp; (event.altKey || event.originalEvent.altKey) ? k.alt :
</span><span class="cx">             !isNaN(k.ctrl) &amp;&amp; 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')) &gt;= 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 &amp;&amp; !$p.is('body')) {
-        if (!isNaN($p.css('z-index')) &amp;&amp; $p.css('z-index') &gt; 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 &amp;&amp; $.browser.version &gt;= 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 &amp;&amp; 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(&quot;&lt;div/&gt;&quot;)}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=&quot;absolute&quot;,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==&quot;1.3.2&quot;&amp;&amp;e.browser.safari&amp;&amp;ad==&quot;fixed&quot;){az.top+=a(document.documentElement.scrollTop,e(&quot;body&quot;).scrollTop());az.left+=a(document.documentElement.scrollLeft,e(&quot;body&quot;).scrollLeft())}M=e.inArray(A.css(&quot;position&quot;),[&quot;absolute&quot;,&quot;relative&quot;])+1?{left:c(A.offset().left)-A.scrollLeft(),top:c(A.offset().top)-A.scrollTop()}:ad==&quot;fixed&quot;?{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&amp;&amp;H.outerWidth()-H.innerWidth()==2){H.css(&quot;margin&quot;,0);setTimeout(function(){H.css(&quot;margin&quot;,&quot;auto&quot;)},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(&quot;mouseout&quot;,function(){u=false})}I=&quot;&quot;;if(S.resizable){if(o&lt;=V){I=&quot;n&quot;}else{if(o&gt;=v.height-V){I=&quot;s&quot;}}if(
 h&lt;=V){I+=&quot;w&quot;}else{if(h&gt;=v.width-V){I+=&quot;e&quot;}}}ar.css(&quot;cursor&quot;,I?I+&quot;-resize&quot;:S.movable?&quot;move&quot;:&quot;&quot;);if(R){R.toggle()}}function aj(h){e(&quot;body&quot;).css(&quot;cursor&quot;,&quot;&quot;);if(S.autoHide||v.width*v.height==0){ah(ar.add(Y),function(){e(this).hide()})}S.onSelectEnd(q,D());e(document).unbind(&quot;mousemove&quot;,ab);ar.mousemove(C)}function s(h){if(h.which!=1){return false}ao();if(I){e(&quot;body&quot;).css(&quot;cursor&quot;,I+&quot;-resize&quot;);y=G(v[/w/.test(I)?&quot;x2&quot;:&quot;x1&quot;]);aA=F(v[/n/.test(I)?&quot;y2&quot;:&quot;y1&quot;]);e(document).mousemove(ab).one(&quot;mouseup&quot;,aj);ar.unbind(&quot;mousemove&quot;,C)}else{if(S.movable){Q=n+v.x1-ak(h);P=p+v.y1-ai(h);ar.unbind(&quot;mousemove&quot;,C);e(document).mousemove(g).one(&quot;mouseup&quot;,function(){S.onSelectEnd(q,D());e(document).unbind(&quot;mousemove&quot;,g);ar.mousemove(C)})}else{aw.mousedown(h)}}return false}function
  r(){x=a(n,d(n+N,y+b(ay-aA)*T*(x&gt;y||-1)));ay=c(a(p,d(p+j,aA+b(x-y)/T*(ay&gt;aA||-1))));x=c(x)}function al(){ay=a(p,d(p+j,aA+b(x-y)/T*(ay&gt;aA||-1)));x=c(a(n,d(n+N,y+b(ay-aA)*T*(x&gt;y||-1))));ay=c(ay)}function av(){if(b(x-y)&lt;S.minWidth){x=y-S.minWidth*(x&lt;y||-1);if(x&lt;n){y=n+S.minWidth}else{if(x&gt;n+N){y=n+N-S.minWidth}}}if(b(ay-aA)&lt;S.minHeight){ay=aA-S.minHeight*(ay&lt;aA||-1);if(ay&lt;p){aA=p+S.minHeight}else{if(ay&gt;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&gt;b(ay-aA)){al()}else{r()}}if(b(x-y)&gt;S.maxWidth){x=y-S.maxWidth*(x&lt;y||-1);if(T){al()}}if(b(ay-aA)&gt;S.maxHeight){ay=aA-S.maxHeight*(ay&lt;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==&quot;&quot;||/w|e/.test(I)||T?ak(h):G(v.x2);ay=I==&quot;&quot;||/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=&quot;&quot;;if(Y.is(&quot;:not(:visible)&quot;)){ar.add(Y).hide().fadeIn(S.fadeSpeed||0)}K=true;e(document).unbind(&quot;mouseup&quot;,ap).mousemove(ab).one(&quot;mouseup&quot;,aj);ar.unbind(&quot;mousemove&quot;,C);S.onSelectStart(q,D())}function ap(){e(document).unbind(&quot;mousemove&quot;,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(&quot;:animated&quot;)){return false}ao();Q=y=ak(h);P=aA=ai(h);e(document).one(&quot;mousemove&quot;,ax).one(&quot;mouseup&quot;,ap);return false}function W(){t(false)}function au(){U=true;J(S=e.extend({classPrefix:&quot;imgareaselect&quot;,movable:true,resizable:true,parent:&quot;body&quot;,onInit:function(){},onSe
 lectStart:function(){},onSelectChange:function(){},onSelectEnd:function(){}},S));ar.add(Y).css({visibility:&quot;&quot;});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)&amp;&amp;(w.altKey||w.originalEvent.altKey)?h.alt:!isNaN(h.ctrl)&amp;&amp;w.ctrlKey?h.ctrl:!isNaN(h.shift)&amp;&amp;w.shiftKey?h.shift:!isNaN(h.arrows)?h.arrows:10;if(h.arrows==&quot;resize&quot;||(h.shift==&quot;resize&quot;&amp;&amp;w.shiftKey)||(h.ctrl==&quot;resize&quot;&amp;&amp;w.ctrlKey)||(h.alt==&quot;resize&quot;&amp;&amp;(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==&quot;corners&quot;?4:8:0;while(am--){L=L.add(f())}L.addClass(S.classPrefix+&quot;-handle&quot;).css({position:&quot;absolute&quot;,fontSize:0,zIndex:B+1||1});if(!parseInt(L.css(&quot;width&quot;))){L.width(5).height(5)}if(ag=S.borderWidth){L.css({borderWidth:ag,borderStyle:&quot;solid&quot;})}k(L,{borderColor1:&quot;border-color&quot;,borderColor2:&quot;background-color&quot;,borderOpacity:&quot;opacity&quot;})}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:&quot;resize&quot;},h.keys)}Y.addClass(S.classPrefix+&quot;-outer&quot;);af.addClass(S.classPrefix+&quot;-selection&quot;);for(am=0;am++&lt;4;)
 {e(H[am-1]).addClass(S.classPrefix+&quot;-border&quot;+am)}k(af,{selectionColor:&quot;background-color&quot;,selectionOpacity:&quot;opacity&quot;});k(H,{borderOpacity:&quot;opacity&quot;,borderWidth:&quot;border-width&quot;});k(Y,{outerColor:&quot;background-color&quot;,outerOpacity:&quot;opacity&quot;});if(ag=S.borderColor1){e(H[0]).css({borderStyle:&quot;solid&quot;,borderColor:ag})}if(ag=S.borderColor2){e(H[1]).css({borderStyle:&quot;dashed&quot;,borderColor:ag})}ar.append(af.add(H).add(L).add(R));if(e.browser.msie){if(ag=Y.css(&quot;filter&quot;).match(/opacity=([0-9]+)/)){Y.css(&quot;opacity&quot;,ag[1]/100)}if(ag=H.css(&quot;filter&quot;).match(/opacity=([0-9]+)/)){H.css(&quot;opacity&quot;,ag[1]/100)}}if(h.hide){ah(ar.add(Y))}else{if(h.show&amp;&amp;U){K=true;ar.add(Y).fadeIn(S.fadeSpeed||0);t()}}T=(aq=(S.aspectRatio||&quot;&quot;).split(/:/))[0]/aq[1];if(S.disable||S.enable===false){ar.unbind(&quot;mousemove&quot;,C).unbind(&quot;mousedown&quot;,s);aw.add(Y).unbind(&
 quot;mousedown&quot;,m);e(window).unbind(&quot;resize&quot;,W);aw.add(aw.parents()).unbind(&quot;scroll&quot;,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&amp;&amp;!l.is(&quot;body&quot;)){if(!isNaN(l.css(&quot;z-index&quot;))&amp;&amp;l.css(&quot;z-index&quot;)&gt;B){B=l.css(&quot;z-index&quot;)}if(l.css(&quot;position&quot;)==&quot;fixed&quot;){ad=&quot;fixed&quot;}l=l.parent()}if(!isNaN(S.zIndex)){B=S.zIndex}if(e.browser.msie){aw.attr(&quot;unselectable&quot;,&quot;on&quot;)}e.imgAreaSelect.keyPress=e.browser.msie||e.browser.safari?&quot;keydown&quot;:&quot;keypress&quot;;if(e.browser.opera){R=f().css({width:&quot;100%&quot;,height:&quot;100%&quot;,position:&quot;absolute&qu
 ot;,zIndex:B+2||2})}ar.add(Y).css({visibility:&quot;hidden&quot;,position:ad,overflow:&quot;hidden&quot;,zIndex:B||&quot;0&quot;});ar.css({zIndex:B+2||2});af.add(H).css({position:&quot;absolute&quot;});q.complete||q.readyState==&quot;complete&quot;||!aw.is(&quot;img&quot;)?au():aw.one(&quot;load&quot;,au)};e.fn.imgAreaSelect=function(g){g=g||{};this.each(function(){if(e(this).data(&quot;imgAreaSelect&quot;)){e(this).data(&quot;imgAreaSelect&quot;).setOptions(g)}else{if(g.enable===undefined&amp;&amp;g.disable===undefined){g.enable=true}e(this).data(&quot;imgAreaSelect&quot;,new e.imgAreaSelect(this,g))}});if(g.instance){return e(this).data(&quot;imgAreaSelect&quot;)}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(&quot;&lt;div/&gt;&quot;)}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=&quot;absolute&quot;,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)&gt;&gt;1;ay.left+=(M.outerWidth()-S)&gt;&gt;1;q=ad.minWidth||0;al=ad.minHeight||0;k=d(ad.maxWidth||1&lt;&lt;24,S);x=d(ad.maxHeight||1&lt;&lt;24,aA);if(e().jquery==&quot;1.3.2&quot;&amp;&amp;ak==&quot;fixed&quot;&amp;&amp;!F.getBoundingClientRect){ay.top+=a(document.body.scrollTop,F.scrollTop);ay.left+=a(document.body.scrollLeft,F.scrollLeft)}V=e.inArray(p.css(&quot;position&quot;),[&quot;absolute&quot;,&quot;relative&quot;])+1?{left:c(p.offset().left)-p.scrollLeft(),top:c(p.offset().top)-p.scrollTop()}:ak==&quot;fixed&quot;?{left:e(document).scrollLeft(),top:e(document).scrollTop()}:{left:0,top:0};T=Y(0);ao=X(0);if(aC.x2&gt;S||aC.y2&gt;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&gt;&gt;1});e(ax[5]).css({left:K,top:P&gt;&gt;1});e(ax[6]).css({left:K&gt;&gt;1,top:P});e(ax[7]).css({top:P&gt;&gt;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&amp;&amp;ap.outerWidth()-ap.innerWidth()==2){ap.css(&quot;margin&quot;,0);setTimeout(function(){ap.css(&quot;margin&quot;,&quot;auto&quot;)},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(&quot;mouseout&quot;,function(){I=false})}t=&quot;&quot;;if(ad.resizable){if(o&lt;=ad.resizeMargin){t=&quot;n&quot;}else{if(o&gt;=aC.height-ad.resizeMargin){t=&quot;s&quot;}}if(h&lt;=ad.resizeMargin){t+=&quot;w&quot;}else{if(h&gt;=aC.width-ad.resizeMargin){t+=&quot;e&quot;}}}B.css(&quot;cursor&quot;,t?t+&quot;-resize&quot;:ad.movable?&quot;move&quot;:&quot;&quot;);if(aj){aj.toggle()}}function j(h){e(&quot;body&quot;).css(&quot;cursor&quot;,&quot;&quot;);if(ad.autoHide||aC.width*aC.height==0){ag(B.add(v),function(){e(this).hide()})}e(document).unbind(&quot;mousemove&quot;,ae);B.mousemove(H);ad.onSelectEnd(Q,ar())}function aw(h){if(h.which!=1){return false}m();if(t){e(&quot;body&quot;).css(&quot;cursor&quot;,t+&quot;-resize&quot;);D=Y(aC[/w/.test(t)?&quot;x2&quot;:&quot;x1&quot;]);n=X(aC[/n/.test(t)?&quot;y2&quot;:&quot;y1&quot;]);e(docume
 nt).mousemove(ae).one(&quot;mouseup&quot;,j);B.unbind(&quot;mousemove&quot;,H)}else{if(ad.movable){an=T+aC.x1-A(h);am=ao+aC.y1-z(h);B.unbind(&quot;mousemove&quot;,H);e(document).mousemove(ac).one(&quot;mouseup&quot;,function(){ad.onSelectEnd(Q,ar());e(document).unbind(&quot;mousemove&quot;,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&gt;D||-1)));l=c(a(ao,d(ao+aA,n+b(C-D)/aE*(l&gt;n||-1))));C=c(C)}else{l=a(ao,d(ao+aA,n+b(C-D)/aE*(l&gt;n||-1)));C=c(a(T,d(T+S,D+b(l-n)*aE*(C&gt;D||-1))));l=c(l)}}}function aB(){D=d(D,T+S);n=d(n,ao+aA);if(b(C-D)&lt;q){C=D-q*(C&lt;D||-1);if(C&lt;T){D=T+q}else{if(C&gt;T+S){D=T+S-q}}}if(b(l-n)&lt;al){l=n-al*(l&lt;n||-1);if(l&lt;ao){n=ao+al}else{if(l&gt;ao+aA){n=ao+aA-al}}}C=a(T,d(C,T+S));l=a(ao,d(l,ao+aA));L(b(C-D)&lt;b(l-n)*aE);if(b(C-D)&gt;k){C=D-k*(C&lt;D||-1);L()}if(b(l-n)&gt;x){l=n-x*(l&lt;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==&quot;&quot;||/w|e/.test(t)||aE?A(h):Y(aC.x2);l=t==&quot;&quot;||/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(&quot;mousemove&quot;,r);m();C=D;l=n;aB();t=&quot;&quot;;if(v.is(&quot;:not(:visible)&quot;)){B.add(v).hide().fadeIn(ad.fadeSpeed||0)}ah=true;e(document).unbind(&quot;mouseup&quot;,W).mousemove(ae).one(&quot;mouseup&quot;,j);B.unbind(&quot;mousemove&quot;,H);ad.onSelectStart(Q,ar())}function W(){e(document).unbind(&quot;mousemove&quot;,r).unbind(&quot;mouseup&quot;,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(&quot;:animated&quot;)){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:&quot;imgareaselect&quot;,movable:true,parent:&quot;body&quot;,resizable:true,resizeMargin:10,onInit:function(){},onSelectStart:function(){},onSelectChange:function(){},onSelectEnd:function(){}},ad));B.add(v).css({visibility:&quot;&quot;});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)&amp;&amp;(w.altKey||w.originalEvent.altKey)?h.alt:!isNaN(h.ctrl)&amp;&amp;w.ctrlKey?h.ctrl:!isNaN(h.shift)&amp;&amp;w.shiftKey?h.shift:!isNaN(h.arrows)?h.arrows:10;if(h.arrows==&quot;resize&quot;||(h.shift==&quot;resize&quot;&amp;&amp;w.shiftKey)||(h.ctrl==&quot;resize&quot;&amp;&amp;w.ctrlKey)||(h.alt==&quot;resize&quot;&amp;&amp;(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==&quot;corners&quot;?4:8:0;while(O--){ax=ax.add(f())}ax.addClass(ad.classPrefix+&quot;-handle&quot;).css({position:&quot;absolute&quot;,fontSize:0,zIndex:g+1||1});if(!parseInt(ax.css(&quot;width&quot;))&gt;=0){ax.width(5).height(5)}if(N=ad.borderWidth){ax.css({borderWidth:N,borderStyle:&quot;solid&quot;})}G(ax,{borderColor1:&quot;border-color&quot;,borderColor2:&quot;background-color&quot;,borderOpacity:&quot;opacity&quot;})}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:&quot;resize&quot;},h.keys)}v.addClass(ad.classPrefix+&quot;-outer&quot;);E.addClass(ad.classPrefix+&quot;-selection&quot;);for(O=0;O++&lt;4;){e(ap[O-1]).addClass(ad.classPrefix+&quot;-border&quot;+O)}G(E,{selectionColor:&quot;background-color&quot;,selectionOpacity:&quot;opacity&quot;});G(ap,{borderOpacity:&quot;opacity&quot;,borderWidth:&quot;border-width&quot;});G(v,{outerColor:&quot;background-color&quot;,outerOpacity:&quot;opacity&quot;});if(N=ad.borderColor1){e(ap[0]).css({borderStyle:&quot;solid&quot;,borderColor:N})}if(N=ad.borderColor2){e(ap[1]).css({borderStyle:&quot;dashed&quot;,borderColor:N})}B.append(E.add(ap).add(aj).add(ax));if(e.browser.msie){if(N=v.css(&quot;filter&quot;).match(/opacity=([0-9]+)/)){v.css(&quot;opacity&quot;,N[1]/100)}if(N=ap.css(&quot;filter&quot;).match(/opacity=([0-9]+)/)){ap.css(&quot;opacity&quot;,N[1]/100)}}if(h.hide){ag(B.
 add(v))}else{if(h.show&amp;&amp;u){ah=true;B.add(v).fadeIn(ad.fadeSpeed||0);y()}}aE=(R=(ad.aspectRatio||&quot;&quot;).split(/:/))[0]/R[1];M.add(v).unbind(&quot;mousedown&quot;,aD);if(ad.disable||ad.enable===false){B.unbind(&quot;mousemove&quot;,H).unbind(&quot;mousedown&quot;,aw);e(window).unbind(&quot;resize&quot;,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(&quot;z-index&quot;))?Z.css(&quot;z-index&quot;):g);if(Z.css(&quot;position&quot;)==&quot;fixed&quot;){ak=&quot;fixed&quot;}Z=Z.parent(&quot;:not(body)&quot;)}g=ad.zIndex||g;if(e.browser.msie){M.attr(&quot;unselectable&quot;,&quot;on&quot;)}e.imgAreaSelect.keyPre
 ss=e.browser.msie||e.browser.safari?&quot;keydown&quot;:&quot;keypress&quot;;if(e.browser.opera){aj=f().css({width:&quot;100%&quot;,height:&quot;100%&quot;,position:&quot;absolute&quot;,zIndex:g+2||2})}B.add(v).css({visibility:&quot;hidden&quot;,position:ak,overflow:&quot;hidden&quot;,zIndex:g||&quot;0&quot;});B.css({zIndex:g+2||2});E.add(ap).css({position:&quot;absolute&quot;,fontSize:0});Q.complete||Q.readyState==&quot;complete&quot;||!M.is(&quot;img&quot;)?s():M.one(&quot;load&quot;,s);if(e.browser.msie&amp;&amp;e.browser.version&gt;=9){Q.src=Q.src}};e.fn.imgAreaSelect=function(g){g=g||{};this.each(function(){if(e(this).data(&quot;imgAreaSelect&quot;)){if(g.remove){e(this).data(&quot;imgAreaSelect&quot;).remove();e(this).removeData(&quot;imgAreaSelect&quot;)}else{e(this).data(&quot;imgAreaSelect&quot;).setOptions(g)}}else{if(!g.remove){if(g.enable===undefined&amp;&amp;g.disable===undefined){g.enable=true}e(this).data(&quot;imgAreaSelect&quot;,new e.imgAreaSelect(this,g))}
 }});if(g.instance){return e(this).data(&quot;imgAreaSelect&quot;)}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-&gt;add( 'json2', &quot;/wp-includes/js/json2$suffix.js&quot;, false, '2011-02-23');
</span><span class="cx"> 
</span><del>-        $scripts-&gt;add( 'imgareaselect', &quot;/wp-includes/js/imgareaselect/jquery.imgareaselect$suffix.js&quot;, array('jquery'), '0.9.1-20110113' );
</del><ins>+        $scripts-&gt;add( 'imgareaselect', &quot;/wp-includes/js/imgareaselect/jquery.imgareaselect$suffix.js&quot;, array('jquery'), '0.9.6-20110515' );
</ins><span class="cx">         $scripts-&gt;add_data( 'imgareaselect', 'group', 1 );
</span><span class="cx"> 
</span><span class="cx">         $scripts-&gt;add( 'password-strength-meter', &quot;/wp-admin/js/password-strength-meter$suffix.js&quot;, array('jquery'), '20101027' );
</span></span></pre>
</div>
</div>

</body>
</html>