Edit File by line
/home/barbar84/www/wp-inclu.../js/imgareas...
File: jquery.imgareaselect.js
/*
[0] Fix | Delete
* imgAreaSelect jQuery plugin
[1] Fix | Delete
* version 0.9.10-wp
[2] Fix | Delete
*
[3] Fix | Delete
* Copyright (c) 2008-2013 Michal Wojciechowski (odyniec.net)
[4] Fix | Delete
*
[5] Fix | Delete
* Dual licensed under the MIT (MIT-LICENSE.txt)
[6] Fix | Delete
* and GPL (GPL-LICENSE.txt) licenses.
[7] Fix | Delete
*
[8] Fix | Delete
* https://github.com/odyniec/imgareaselect
[9] Fix | Delete
*
[10] Fix | Delete
*/
[11] Fix | Delete
[12] Fix | Delete
(function($) {
[13] Fix | Delete
[14] Fix | Delete
/*
[15] Fix | Delete
* Math functions will be used extensively, so it's convenient to make a few
[16] Fix | Delete
* shortcuts
[17] Fix | Delete
*/
[18] Fix | Delete
var abs = Math.abs,
[19] Fix | Delete
max = Math.max,
[20] Fix | Delete
min = Math.min,
[21] Fix | Delete
round = Math.round;
[22] Fix | Delete
[23] Fix | Delete
/**
[24] Fix | Delete
* Create a new HTML div element
[25] Fix | Delete
*
[26] Fix | Delete
* @return A jQuery object representing the new element
[27] Fix | Delete
*/
[28] Fix | Delete
function div() {
[29] Fix | Delete
return $('<div/>');
[30] Fix | Delete
}
[31] Fix | Delete
[32] Fix | Delete
/**
[33] Fix | Delete
* imgAreaSelect initialization
[34] Fix | Delete
*
[35] Fix | Delete
* @param img
[36] Fix | Delete
* A HTML image element to attach the plugin to
[37] Fix | Delete
* @param options
[38] Fix | Delete
* An options object
[39] Fix | Delete
*/
[40] Fix | Delete
$.imgAreaSelect = function (img, options) {
[41] Fix | Delete
var
[42] Fix | Delete
/* jQuery object representing the image */
[43] Fix | Delete
$img = $(img),
[44] Fix | Delete
[45] Fix | Delete
/* Has the image finished loading? */
[46] Fix | Delete
imgLoaded,
[47] Fix | Delete
[48] Fix | Delete
/* Plugin elements */
[49] Fix | Delete
[50] Fix | Delete
/* Container box */
[51] Fix | Delete
$box = div(),
[52] Fix | Delete
/* Selection area */
[53] Fix | Delete
$area = div(),
[54] Fix | Delete
/* Border (four divs) */
[55] Fix | Delete
$border = div().add(div()).add(div()).add(div()),
[56] Fix | Delete
/* Outer area (four divs) */
[57] Fix | Delete
$outer = div().add(div()).add(div()).add(div()),
[58] Fix | Delete
/* Handles (empty by default, initialized in setOptions()) */
[59] Fix | Delete
$handles = $([]),
[60] Fix | Delete
[61] Fix | Delete
/*
[62] Fix | Delete
* Additional element to work around a cursor problem in Opera
[63] Fix | Delete
* (explained later)
[64] Fix | Delete
*/
[65] Fix | Delete
$areaOpera,
[66] Fix | Delete
[67] Fix | Delete
/* Image position (relative to viewport) */
[68] Fix | Delete
left, top,
[69] Fix | Delete
[70] Fix | Delete
/* Image offset (as returned by .offset()) */
[71] Fix | Delete
imgOfs = { left: 0, top: 0 },
[72] Fix | Delete
[73] Fix | Delete
/* Image dimensions (as returned by .width() and .height()) */
[74] Fix | Delete
imgWidth, imgHeight,
[75] Fix | Delete
[76] Fix | Delete
/*
[77] Fix | Delete
* jQuery object representing the parent element that the plugin
[78] Fix | Delete
* elements are appended to
[79] Fix | Delete
*/
[80] Fix | Delete
$parent,
[81] Fix | Delete
[82] Fix | Delete
/* Parent element offset (as returned by .offset()) */
[83] Fix | Delete
parOfs = { left: 0, top: 0 },
[84] Fix | Delete
[85] Fix | Delete
/* Base z-index for plugin elements */
[86] Fix | Delete
zIndex = 0,
[87] Fix | Delete
[88] Fix | Delete
/* Plugin elements position */
[89] Fix | Delete
position = 'absolute',
[90] Fix | Delete
[91] Fix | Delete
/* X/Y coordinates of the starting point for move/resize operations */
[92] Fix | Delete
startX, startY,
[93] Fix | Delete
[94] Fix | Delete
/* Horizontal and vertical scaling factors */
[95] Fix | Delete
scaleX, scaleY,
[96] Fix | Delete
[97] Fix | Delete
/* Current resize mode ("nw", "se", etc.) */
[98] Fix | Delete
resize,
[99] Fix | Delete
[100] Fix | Delete
/* Selection area constraints */
[101] Fix | Delete
minWidth, minHeight, maxWidth, maxHeight,
[102] Fix | Delete
[103] Fix | Delete
/* Aspect ratio to maintain (floating point number) */
[104] Fix | Delete
aspectRatio,
[105] Fix | Delete
[106] Fix | Delete
/* Are the plugin elements currently displayed? */
[107] Fix | Delete
shown,
[108] Fix | Delete
[109] Fix | Delete
/* Current selection (relative to parent element) */
[110] Fix | Delete
x1, y1, x2, y2,
[111] Fix | Delete
[112] Fix | Delete
/* Current selection (relative to scaled image) */
[113] Fix | Delete
selection = { x1: 0, y1: 0, x2: 0, y2: 0, width: 0, height: 0 },
[114] Fix | Delete
[115] Fix | Delete
/* Document element */
[116] Fix | Delete
docElem = document.documentElement,
[117] Fix | Delete
[118] Fix | Delete
/* User agent */
[119] Fix | Delete
ua = navigator.userAgent,
[120] Fix | Delete
[121] Fix | Delete
/* Various helper variables used throughout the code */
[122] Fix | Delete
$p, d, i, o, w, h, adjusted;
[123] Fix | Delete
[124] Fix | Delete
/*
[125] Fix | Delete
* Translate selection coordinates (relative to scaled image) to viewport
[126] Fix | Delete
* coordinates (relative to parent element)
[127] Fix | Delete
*/
[128] Fix | Delete
[129] Fix | Delete
/**
[130] Fix | Delete
* Translate selection X to viewport X
[131] Fix | Delete
*
[132] Fix | Delete
* @param x
[133] Fix | Delete
* Selection X
[134] Fix | Delete
* @return Viewport X
[135] Fix | Delete
*/
[136] Fix | Delete
function viewX(x) {
[137] Fix | Delete
return x + imgOfs.left - parOfs.left;
[138] Fix | Delete
}
[139] Fix | Delete
[140] Fix | Delete
/**
[141] Fix | Delete
* Translate selection Y to viewport Y
[142] Fix | Delete
*
[143] Fix | Delete
* @param y
[144] Fix | Delete
* Selection Y
[145] Fix | Delete
* @return Viewport Y
[146] Fix | Delete
*/
[147] Fix | Delete
function viewY(y) {
[148] Fix | Delete
return y + imgOfs.top - parOfs.top;
[149] Fix | Delete
}
[150] Fix | Delete
[151] Fix | Delete
/*
[152] Fix | Delete
* Translate viewport coordinates to selection coordinates
[153] Fix | Delete
*/
[154] Fix | Delete
[155] Fix | Delete
/**
[156] Fix | Delete
* Translate viewport X to selection X
[157] Fix | Delete
*
[158] Fix | Delete
* @param x
[159] Fix | Delete
* Viewport X
[160] Fix | Delete
* @return Selection X
[161] Fix | Delete
*/
[162] Fix | Delete
function selX(x) {
[163] Fix | Delete
return x - imgOfs.left + parOfs.left;
[164] Fix | Delete
}
[165] Fix | Delete
[166] Fix | Delete
/**
[167] Fix | Delete
* Translate viewport Y to selection Y
[168] Fix | Delete
*
[169] Fix | Delete
* @param y
[170] Fix | Delete
* Viewport Y
[171] Fix | Delete
* @return Selection Y
[172] Fix | Delete
*/
[173] Fix | Delete
function selY(y) {
[174] Fix | Delete
return y - imgOfs.top + parOfs.top;
[175] Fix | Delete
}
[176] Fix | Delete
[177] Fix | Delete
/*
[178] Fix | Delete
* Translate event coordinates (relative to document) to viewport
[179] Fix | Delete
* coordinates
[180] Fix | Delete
*/
[181] Fix | Delete
[182] Fix | Delete
/**
[183] Fix | Delete
* Get event X and translate it to viewport X
[184] Fix | Delete
*
[185] Fix | Delete
* @param event
[186] Fix | Delete
* The event object
[187] Fix | Delete
* @return Viewport X
[188] Fix | Delete
*/
[189] Fix | Delete
function evX(event) {
[190] Fix | Delete
return max(event.pageX || 0, touchCoords(event).x) - parOfs.left;
[191] Fix | Delete
}
[192] Fix | Delete
[193] Fix | Delete
/**
[194] Fix | Delete
* Get event Y and translate it to viewport Y
[195] Fix | Delete
*
[196] Fix | Delete
* @param event
[197] Fix | Delete
* The event object
[198] Fix | Delete
* @return Viewport Y
[199] Fix | Delete
*/
[200] Fix | Delete
function evY(event) {
[201] Fix | Delete
return max(event.pageY || 0, touchCoords(event).y) - parOfs.top;
[202] Fix | Delete
}
[203] Fix | Delete
[204] Fix | Delete
/**
[205] Fix | Delete
* Get X and Y coordinates of a touch event
[206] Fix | Delete
*
[207] Fix | Delete
* @param event
[208] Fix | Delete
* The event object
[209] Fix | Delete
* @return Coordinates object
[210] Fix | Delete
*/
[211] Fix | Delete
function touchCoords(event) {
[212] Fix | Delete
var oev = event.originalEvent || {};
[213] Fix | Delete
[214] Fix | Delete
if (oev.touches && oev.touches.length)
[215] Fix | Delete
return { x: oev.touches[0].pageX, y: oev.touches[0].pageY };
[216] Fix | Delete
else
[217] Fix | Delete
return { x: 0, y: 0 };
[218] Fix | Delete
}
[219] Fix | Delete
[220] Fix | Delete
/**
[221] Fix | Delete
* Get the current selection
[222] Fix | Delete
*
[223] Fix | Delete
* @param noScale
[224] Fix | Delete
* If set to <code>true</code>, scaling is not applied to the
[225] Fix | Delete
* returned selection
[226] Fix | Delete
* @return Selection object
[227] Fix | Delete
*/
[228] Fix | Delete
function getSelection(noScale) {
[229] Fix | Delete
var sx = noScale || scaleX, sy = noScale || scaleY;
[230] Fix | Delete
[231] Fix | Delete
return { x1: round(selection.x1 * sx),
[232] Fix | Delete
y1: round(selection.y1 * sy),
[233] Fix | Delete
x2: round(selection.x2 * sx),
[234] Fix | Delete
y2: round(selection.y2 * sy),
[235] Fix | Delete
width: round(selection.x2 * sx) - round(selection.x1 * sx),
[236] Fix | Delete
height: round(selection.y2 * sy) - round(selection.y1 * sy) };
[237] Fix | Delete
}
[238] Fix | Delete
[239] Fix | Delete
/**
[240] Fix | Delete
* Set the current selection
[241] Fix | Delete
*
[242] Fix | Delete
* @param x1
[243] Fix | Delete
* X coordinate of the upper left corner of the selection area
[244] Fix | Delete
* @param y1
[245] Fix | Delete
* Y coordinate of the upper left corner of the selection area
[246] Fix | Delete
* @param x2
[247] Fix | Delete
* X coordinate of the lower right corner of the selection area
[248] Fix | Delete
* @param y2
[249] Fix | Delete
* Y coordinate of the lower right corner of the selection area
[250] Fix | Delete
* @param noScale
[251] Fix | Delete
* If set to <code>true</code>, scaling is not applied to the
[252] Fix | Delete
* new selection
[253] Fix | Delete
*/
[254] Fix | Delete
function setSelection(x1, y1, x2, y2, noScale) {
[255] Fix | Delete
var sx = noScale || scaleX, sy = noScale || scaleY;
[256] Fix | Delete
[257] Fix | Delete
selection = {
[258] Fix | Delete
x1: round(x1 / sx || 0),
[259] Fix | Delete
y1: round(y1 / sy || 0),
[260] Fix | Delete
x2: round(x2 / sx || 0),
[261] Fix | Delete
y2: round(y2 / sy || 0)
[262] Fix | Delete
};
[263] Fix | Delete
[264] Fix | Delete
selection.width = selection.x2 - selection.x1;
[265] Fix | Delete
selection.height = selection.y2 - selection.y1;
[266] Fix | Delete
}
[267] Fix | Delete
[268] Fix | Delete
/**
[269] Fix | Delete
* Recalculate image and parent offsets
[270] Fix | Delete
*/
[271] Fix | Delete
function adjust() {
[272] Fix | Delete
/*
[273] Fix | Delete
* Do not adjust if image has not yet loaded or if width is not a
[274] Fix | Delete
* positive number. The latter might happen when imgAreaSelect is put
[275] Fix | Delete
* on a parent element which is then hidden.
[276] Fix | Delete
*/
[277] Fix | Delete
if (!imgLoaded || !$img.width())
[278] Fix | Delete
return;
[279] Fix | Delete
[280] Fix | Delete
/*
[281] Fix | Delete
* Get image offset. The .offset() method returns float values, so they
[282] Fix | Delete
* need to be rounded.
[283] Fix | Delete
*/
[284] Fix | Delete
imgOfs = { left: round($img.offset().left), top: round($img.offset().top) };
[285] Fix | Delete
[286] Fix | Delete
/* Get image dimensions */
[287] Fix | Delete
imgWidth = $img.innerWidth();
[288] Fix | Delete
imgHeight = $img.innerHeight();
[289] Fix | Delete
[290] Fix | Delete
imgOfs.top += ($img.outerHeight() - imgHeight) >> 1;
[291] Fix | Delete
imgOfs.left += ($img.outerWidth() - imgWidth) >> 1;
[292] Fix | Delete
[293] Fix | Delete
/* Set minimum and maximum selection area dimensions */
[294] Fix | Delete
minWidth = round(options.minWidth / scaleX) || 0;
[295] Fix | Delete
minHeight = round(options.minHeight / scaleY) || 0;
[296] Fix | Delete
maxWidth = round(min(options.maxWidth / scaleX || 1<<24, imgWidth));
[297] Fix | Delete
maxHeight = round(min(options.maxHeight / scaleY || 1<<24, imgHeight));
[298] Fix | Delete
[299] Fix | Delete
/*
[300] Fix | Delete
* Workaround for jQuery 1.3.2 incorrect offset calculation, originally
[301] Fix | Delete
* observed in Safari 3. Firefox 2 is also affected.
[302] Fix | Delete
*/
[303] Fix | Delete
if ($().jquery == '1.3.2' && position == 'fixed' &&
[304] Fix | Delete
!docElem['getBoundingClientRect'])
[305] Fix | Delete
{
[306] Fix | Delete
imgOfs.top += max(document.body.scrollTop, docElem.scrollTop);
[307] Fix | Delete
imgOfs.left += max(document.body.scrollLeft, docElem.scrollLeft);
[308] Fix | Delete
}
[309] Fix | Delete
[310] Fix | Delete
/* Determine parent element offset */
[311] Fix | Delete
parOfs = /absolute|relative/.test($parent.css('position')) ?
[312] Fix | Delete
{ left: round($parent.offset().left) - $parent.scrollLeft(),
[313] Fix | Delete
top: round($parent.offset().top) - $parent.scrollTop() } :
[314] Fix | Delete
position == 'fixed' ?
[315] Fix | Delete
{ left: $(document).scrollLeft(), top: $(document).scrollTop() } :
[316] Fix | Delete
{ left: 0, top: 0 };
[317] Fix | Delete
[318] Fix | Delete
left = viewX(0);
[319] Fix | Delete
top = viewY(0);
[320] Fix | Delete
[321] Fix | Delete
/*
[322] Fix | Delete
* Check if selection area is within image boundaries, adjust if
[323] Fix | Delete
* necessary
[324] Fix | Delete
*/
[325] Fix | Delete
if (selection.x2 > imgWidth || selection.y2 > imgHeight)
[326] Fix | Delete
doResize();
[327] Fix | Delete
}
[328] Fix | Delete
[329] Fix | Delete
/**
[330] Fix | Delete
* Update plugin elements
[331] Fix | Delete
*
[332] Fix | Delete
* @param resetKeyPress
[333] Fix | Delete
* If set to <code>false</code>, this instance's keypress
[334] Fix | Delete
* event handler is not activated
[335] Fix | Delete
*/
[336] Fix | Delete
function update(resetKeyPress) {
[337] Fix | Delete
/* If plugin elements are hidden, do nothing */
[338] Fix | Delete
if (!shown) return;
[339] Fix | Delete
[340] Fix | Delete
/*
[341] Fix | Delete
* Set the position and size of the container box and the selection area
[342] Fix | Delete
* inside it
[343] Fix | Delete
*/
[344] Fix | Delete
$box.css({ left: viewX(selection.x1), top: viewY(selection.y1) })
[345] Fix | Delete
.add($area).width(w = selection.width).height(h = selection.height);
[346] Fix | Delete
[347] Fix | Delete
/*
[348] Fix | Delete
* Reset the position of selection area, borders, and handles (IE6/IE7
[349] Fix | Delete
* position them incorrectly if we don't do this)
[350] Fix | Delete
*/
[351] Fix | Delete
$area.add($border).add($handles).css({ left: 0, top: 0 });
[352] Fix | Delete
[353] Fix | Delete
/* Set border dimensions */
[354] Fix | Delete
$border
[355] Fix | Delete
.width(max(w - $border.outerWidth() + $border.innerWidth(), 0))
[356] Fix | Delete
.height(max(h - $border.outerHeight() + $border.innerHeight(), 0));
[357] Fix | Delete
[358] Fix | Delete
/* Arrange the outer area elements */
[359] Fix | Delete
$($outer[0]).css({ left: left, top: top,
[360] Fix | Delete
width: selection.x1, height: imgHeight });
[361] Fix | Delete
$($outer[1]).css({ left: left + selection.x1, top: top,
[362] Fix | Delete
width: w, height: selection.y1 });
[363] Fix | Delete
$($outer[2]).css({ left: left + selection.x2, top: top,
[364] Fix | Delete
width: imgWidth - selection.x2, height: imgHeight });
[365] Fix | Delete
$($outer[3]).css({ left: left + selection.x1, top: top + selection.y2,
[366] Fix | Delete
width: w, height: imgHeight - selection.y2 });
[367] Fix | Delete
[368] Fix | Delete
w -= $handles.outerWidth();
[369] Fix | Delete
h -= $handles.outerHeight();
[370] Fix | Delete
[371] Fix | Delete
/* Arrange handles */
[372] Fix | Delete
switch ($handles.length) {
[373] Fix | Delete
case 8:
[374] Fix | Delete
$($handles[4]).css({ left: w >> 1 });
[375] Fix | Delete
$($handles[5]).css({ left: w, top: h >> 1 });
[376] Fix | Delete
$($handles[6]).css({ left: w >> 1, top: h });
[377] Fix | Delete
$($handles[7]).css({ top: h >> 1 });
[378] Fix | Delete
case 4:
[379] Fix | Delete
$handles.slice(1,3).css({ left: w });
[380] Fix | Delete
$handles.slice(2,4).css({ top: h });
[381] Fix | Delete
}
[382] Fix | Delete
[383] Fix | Delete
if (resetKeyPress !== false) {
[384] Fix | Delete
/*
[385] Fix | Delete
* Need to reset the document keypress event handler -- unbind the
[386] Fix | Delete
* current handler
[387] Fix | Delete
*/
[388] Fix | Delete
if ($.imgAreaSelect.onKeyPress != docKeyPress)
[389] Fix | Delete
$(document).off($.imgAreaSelect.keyPress,
[390] Fix | Delete
$.imgAreaSelect.onKeyPress);
[391] Fix | Delete
[392] Fix | Delete
if (options.keys)
[393] Fix | Delete
/*
[394] Fix | Delete
* Set the document keypress event handler to this instance's
[395] Fix | Delete
* docKeyPress() function
[396] Fix | Delete
*/
[397] Fix | Delete
$(document).on( $.imgAreaSelect.keyPress, function() {
[398] Fix | Delete
$.imgAreaSelect.onKeyPress = docKeyPress;
[399] Fix | Delete
});
[400] Fix | Delete
}
[401] Fix | Delete
[402] Fix | Delete
/*
[403] Fix | Delete
* Internet Explorer displays 1px-wide dashed borders incorrectly by
[404] Fix | Delete
* filling the spaces between dashes with white. Toggling the margin
[405] Fix | Delete
* property between 0 and "auto" fixes this in IE6 and IE7 (IE8 is still
[406] Fix | Delete
* broken). This workaround is not perfect, as it requires setTimeout()
[407] Fix | Delete
* and thus causes the border to flicker a bit, but I haven't found a
[408] Fix | Delete
* better solution.
[409] Fix | Delete
*
[410] Fix | Delete
* Note: This only happens with CSS borders, set with the borderWidth,
[411] Fix | Delete
* borderOpacity, borderColor1, and borderColor2 options (which are now
[412] Fix | Delete
* deprecated). Borders created with GIF background images are fine.
[413] Fix | Delete
*/
[414] Fix | Delete
if (msie && $border.outerWidth() - $border.innerWidth() == 2) {
[415] Fix | Delete
$border.css('margin', 0);
[416] Fix | Delete
setTimeout(function () { $border.css('margin', 'auto'); }, 0);
[417] Fix | Delete
}
[418] Fix | Delete
}
[419] Fix | Delete
[420] Fix | Delete
/**
[421] Fix | Delete
* Do the complete update sequence: recalculate offsets, update the
[422] Fix | Delete
* elements, and set the correct values of x1, y1, x2, and y2.
[423] Fix | Delete
*
[424] Fix | Delete
* @param resetKeyPress
[425] Fix | Delete
* If set to <code>false</code>, this instance's keypress
[426] Fix | Delete
* event handler is not activated
[427] Fix | Delete
*/
[428] Fix | Delete
function doUpdate(resetKeyPress) {
[429] Fix | Delete
adjust();
[430] Fix | Delete
update(resetKeyPress);
[431] Fix | Delete
x1 = viewX(selection.x1); y1 = viewY(selection.y1);
[432] Fix | Delete
x2 = viewX(selection.x2); y2 = viewY(selection.y2);
[433] Fix | Delete
}
[434] Fix | Delete
[435] Fix | Delete
/**
[436] Fix | Delete
* Hide or fade out an element (or multiple elements)
[437] Fix | Delete
*
[438] Fix | Delete
* @param $elem
[439] Fix | Delete
* A jQuery object containing the element(s) to hide/fade out
[440] Fix | Delete
* @param fn
[441] Fix | Delete
* Callback function to be called when fadeOut() completes
[442] Fix | Delete
*/
[443] Fix | Delete
function hide($elem, fn) {
[444] Fix | Delete
options.fadeSpeed ? $elem.fadeOut(options.fadeSpeed, fn) : $elem.hide();
[445] Fix | Delete
}
[446] Fix | Delete
[447] Fix | Delete
/**
[448] Fix | Delete
* Selection area mousemove event handler
[449] Fix | Delete
*
[450] Fix | Delete
* @param event
[451] Fix | Delete
* The event object
[452] Fix | Delete
*/
[453] Fix | Delete
function areaMouseMove(event) {
[454] Fix | Delete
var x = selX(evX(event)) - selection.x1,
[455] Fix | Delete
y = selY(evY(event)) - selection.y1;
[456] Fix | Delete
[457] Fix | Delete
if (!adjusted) {
[458] Fix | Delete
adjust();
[459] Fix | Delete
adjusted = true;
[460] Fix | Delete
[461] Fix | Delete
$box.one('mouseout', function () { adjusted = false; });
[462] Fix | Delete
}
[463] Fix | Delete
[464] Fix | Delete
/* Clear the resize mode */
[465] Fix | Delete
resize = '';
[466] Fix | Delete
[467] Fix | Delete
if (options.resizable) {
[468] Fix | Delete
/*
[469] Fix | Delete
* Check if the mouse pointer is over the resize margin area and set
[470] Fix | Delete
* the resize mode accordingly
[471] Fix | Delete
*/
[472] Fix | Delete
if (y <= options.resizeMargin)
[473] Fix | Delete
resize = 'n';
[474] Fix | Delete
else if (y >= selection.height - options.resizeMargin)
[475] Fix | Delete
resize = 's';
[476] Fix | Delete
if (x <= options.resizeMargin)
[477] Fix | Delete
resize += 'w';
[478] Fix | Delete
else if (x >= selection.width - options.resizeMargin)
[479] Fix | Delete
resize += 'e';
[480] Fix | Delete
}
[481] Fix | Delete
[482] Fix | Delete
$box.css('cursor', resize ? resize + '-resize' :
[483] Fix | Delete
options.movable ? 'move' : '');
[484] Fix | Delete
if ($areaOpera)
[485] Fix | Delete
$areaOpera.toggle();
[486] Fix | Delete
}
[487] Fix | Delete
[488] Fix | Delete
/**
[489] Fix | Delete
* Document mouseup event handler
[490] Fix | Delete
*
[491] Fix | Delete
* @param event
[492] Fix | Delete
* The event object
[493] Fix | Delete
*/
[494] Fix | Delete
function docMouseUp(event) {
[495] Fix | Delete
/* Set back the default cursor */
[496] Fix | Delete
$('body').css('cursor', '');
[497] Fix | Delete
/*
[498] Fix | Delete
* If autoHide is enabled, or if the selection has zero width/height,
[499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function