import v1.1.0_beta1 | 2009-08-21
This commit is contained in:
@ -1,8 +1,8 @@
|
||||
/*
|
||||
Copyright (c) 2008, Yahoo! Inc. All rights reserved.
|
||||
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
|
||||
Code licensed under the BSD License:
|
||||
http://developer.yahoo.net/yui/license.txt
|
||||
version: 2.6.0
|
||||
version: 2.7.0
|
||||
*/
|
||||
.yui-resize {
|
||||
position: relative;
|
||||
|
@ -1,12 +1,13 @@
|
||||
/*
|
||||
Copyright (c) 2008, Yahoo! Inc. All rights reserved.
|
||||
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
|
||||
Code licensed under the BSD License:
|
||||
http://developer.yahoo.net/yui/license.txt
|
||||
version: 2.6.0
|
||||
version: 2.7.0
|
||||
*/
|
||||
/* Give the handle a background color */
|
||||
.yui-skin-sam .yui-resize .yui-resize-handle {
|
||||
background-color: #F2F2F2;
|
||||
zoom: 1;
|
||||
}
|
||||
/* Give the active handle a different color */
|
||||
.yui-skin-sam .yui-resize .yui-resize-handle-active {
|
||||
@ -18,6 +19,7 @@ version: 2.6.0
|
||||
.yui-skin-sam .yui-resize .yui-resize-handle-l-active,
|
||||
.yui-skin-sam .yui-resize .yui-resize-handle-r-active {
|
||||
height: 100%;
|
||||
zoom: 1;
|
||||
}
|
||||
/* Give a border to the 8-way knob style handles */
|
||||
.yui-skin-sam .yui-resize-knob .yui-resize-handle {
|
||||
@ -127,3 +129,14 @@ version: 2.6.0
|
||||
height: 6px;
|
||||
width: 6px;
|
||||
}
|
||||
|
||||
.yui-skin-sam .yui-resize-textarea .yui-resize-handle-r {
|
||||
right: -8px;
|
||||
}
|
||||
.yui-skin-sam .yui-resize-textarea .yui-resize-handle-b {
|
||||
bottom: -8px;
|
||||
}
|
||||
.yui-skin-sam .yui-resize-textarea .yui-resize-handle-br {
|
||||
right: -8px;
|
||||
bottom: -8px;
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
77
webdir/javascript/yui/resize/resize-debug.js
vendored
77
webdir/javascript/yui/resize/resize-debug.js
vendored
@ -1,8 +1,8 @@
|
||||
/*
|
||||
Copyright (c) 2008, Yahoo! Inc. All rights reserved.
|
||||
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
|
||||
Code licensed under the BSD License:
|
||||
http://developer.yahoo.net/yui/license.txt
|
||||
version: 2.6.0
|
||||
version: 2.7.0
|
||||
*/
|
||||
/**
|
||||
* @description <p>Makes an element resizable</p>
|
||||
@ -10,7 +10,6 @@ version: 2.6.0
|
||||
* @requires yahoo, dom, dragdrop, element, event
|
||||
* @optional animation
|
||||
* @module resize
|
||||
* @beta
|
||||
*/
|
||||
(function() {
|
||||
var D = YAHOO.util.Dom,
|
||||
@ -254,21 +253,26 @@ var D = YAHOO.util.Dom,
|
||||
YAHOO.log('Create the wrap element', 'info', 'Resize');
|
||||
this._positioned = false;
|
||||
//Force wrap for elements that can't have children
|
||||
switch (this.get('element').tagName.toLowerCase()) {
|
||||
case 'img':
|
||||
case 'textarea':
|
||||
case 'input':
|
||||
case 'iframe':
|
||||
case 'select':
|
||||
this.set('wrap', true);
|
||||
YAHOO.log('Auto-wrapping the element (' + this.get('element').tagName.toLowerCase() + ')', 'warn', 'Resize');
|
||||
break;
|
||||
if (this.get('wrap') === false) {
|
||||
switch (this.get('element').tagName.toLowerCase()) {
|
||||
case 'img':
|
||||
case 'textarea':
|
||||
case 'input':
|
||||
case 'iframe':
|
||||
case 'select':
|
||||
YAHOO.log('Auto-wrapping the element (' + this.get('element').tagName.toLowerCase() + ')', 'warn', 'Resize');
|
||||
this.set('wrap', true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (this.get('wrap') === true) {
|
||||
YAHOO.log('Creating the wrap element', 'info', 'Resize');
|
||||
this._wrap = document.createElement('div');
|
||||
this._wrap.id = this.get('element').id + '_wrap';
|
||||
this._wrap.className = this.CSS_WRAP;
|
||||
if (this.get('element').tagName.toLowerCase() == 'textarea') {
|
||||
D.addClass(this._wrap, 'yui-resize-textarea');
|
||||
}
|
||||
D.setStyle(this._wrap, 'width', this.get('width') + 'px');
|
||||
D.setStyle(this._wrap, 'height', this.get('height') + 'px');
|
||||
D.setStyle(this._wrap, 'z-index', this.getStyle('z-index'));
|
||||
@ -417,8 +421,8 @@ var D = YAHOO.util.Dom,
|
||||
YAHOO.log('Resize Locked', 'info', 'Resize');
|
||||
return false;
|
||||
}
|
||||
//Internet Explorer needs this
|
||||
D.removeClass(this._wrap, this.CSS_RESIZE);
|
||||
|
||||
if (this.get('hover')) {
|
||||
D.removeClass(this._wrap, this.CSS_HOVER);
|
||||
}
|
||||
@ -438,7 +442,6 @@ var D = YAHOO.util.Dom,
|
||||
}
|
||||
}
|
||||
|
||||
//Internet Explorer needs this
|
||||
D.addClass(this._wrap, this.CSS_RESIZE);
|
||||
},
|
||||
/**
|
||||
@ -448,7 +451,6 @@ var D = YAHOO.util.Dom,
|
||||
* @description Removes CSS class names to the handles
|
||||
*/
|
||||
_handleMouseOut: function(ev) {
|
||||
//Internet Explorer needs this
|
||||
D.removeClass(this._wrap, this.CSS_RESIZE);
|
||||
if (this.get('hover') && !this._active) {
|
||||
D.addClass(this._wrap, this.CSS_HOVER);
|
||||
@ -468,7 +470,6 @@ var D = YAHOO.util.Dom,
|
||||
}
|
||||
}
|
||||
}
|
||||
//Internet Explorer needs this
|
||||
D.addClass(this._wrap, this.CSS_RESIZE);
|
||||
},
|
||||
/**
|
||||
@ -719,10 +720,6 @@ var D = YAHOO.util.Dom,
|
||||
_updateStatus: function(h, w, t, l) {
|
||||
if (this._resizeEvent && (!Lang.isString(this._resizeEvent))) {
|
||||
YAHOO.log('Updating Status Box', 'info', 'Resize');
|
||||
if (this.get('status')) {
|
||||
YAHOO.log('Showing Status Box', 'info', 'Resize');
|
||||
D.setStyle(this._status, 'display', 'inline');
|
||||
}
|
||||
h = ((h === 0) ? this._cache.start.height : h);
|
||||
w = ((w === 0) ? this._cache.start.width : w);
|
||||
var h1 = parseInt(this.get('height'), 10),
|
||||
@ -738,8 +735,13 @@ var D = YAHOO.util.Dom,
|
||||
var diffW = (parseInt(w, 10) - w1);
|
||||
this._cache.offsetHeight = diffH;
|
||||
this._cache.offsetWidth = diffW;
|
||||
this._status.innerHTML = '<strong>' + parseInt(h, 10) + ' x ' + parseInt(w, 10) + '</strong><em>' + ((diffH > 0) ? '+' : '') + diffH + ' x ' + ((diffW > 0) ? '+' : '') + diffW + '</em>';
|
||||
D.setXY(this._status, [Event.getPageX(this._resizeEvent) + 12, Event.getPageY(this._resizeEvent) + 12]);
|
||||
if (this.get('status')) {
|
||||
YAHOO.log('Showing Status Box', 'info', 'Resize');
|
||||
D.setStyle(this._status, 'display', 'inline');
|
||||
//This will cause IE8 to crash if the status box is hidden..
|
||||
this._status.innerHTML = '<strong>' + parseInt(h, 10) + ' x ' + parseInt(w, 10) + '</strong><em>' + ((diffH > 0) ? '+' : '') + diffH + ' x ' + ((diffW > 0) ? '+' : '') + diffW + '</em>';
|
||||
D.setXY(this._status, [Event.getPageX(this._resizeEvent) + 12, Event.getPageY(this._resizeEvent) + 12]);
|
||||
}
|
||||
}
|
||||
},
|
||||
/**
|
||||
@ -820,13 +822,14 @@ var D = YAHOO.util.Dom,
|
||||
l = this._cache.left - l;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
var ratio = this._setRatio(h, w, t, l);
|
||||
h = parseInt(ratio[0], 10);
|
||||
w = parseInt(ratio[1], 10);
|
||||
t = parseInt(ratio[2], 10);
|
||||
l = parseInt(ratio[3], 10);
|
||||
|
||||
|
||||
if (t == 0) {
|
||||
//No Offset, get from cache
|
||||
t = D.getY(el);
|
||||
@ -889,6 +892,7 @@ var D = YAHOO.util.Dom,
|
||||
|
||||
this._updateStatus(h, w, t, l);
|
||||
|
||||
|
||||
if (this._positioned) {
|
||||
if (this._proxy && force) {
|
||||
//Do nothing
|
||||
@ -912,11 +916,6 @@ var D = YAHOO.util.Dom,
|
||||
}
|
||||
}
|
||||
if (set) {
|
||||
if (this.browser.ie > 6) {
|
||||
if (h === this._cache.height) {
|
||||
h = h + 1;
|
||||
}
|
||||
}
|
||||
el.style.height = h + 'px';
|
||||
}
|
||||
if ((this._proxy && force) || !this._proxy) {
|
||||
@ -1006,7 +1005,7 @@ var D = YAHOO.util.Dom,
|
||||
YAHOO.log('Handle BR', 'info', 'Resize');
|
||||
var newW = this._setWidth(args.e);
|
||||
var newH = this._setHeight(args.e);
|
||||
this.resize(args.e, (newH + 1), newW, 0, 0);
|
||||
this.resize(args.e, newH, newW, 0, 0);
|
||||
},
|
||||
/**
|
||||
* @private
|
||||
@ -1117,7 +1116,7 @@ var D = YAHOO.util.Dom,
|
||||
nw = (xy - x) + parseInt(this.get('width'), 10);
|
||||
}
|
||||
|
||||
nw = this._snapTick(nw, this.get('yTicks'));
|
||||
nw = this._snapTick(nw, this.get('xTicks'));
|
||||
nw = this._checkWidth(nw);
|
||||
return nw;
|
||||
},
|
||||
@ -1185,7 +1184,7 @@ var D = YAHOO.util.Dom,
|
||||
if (flip) {
|
||||
nh = (xy - y) + parseInt(this.get('height'), 10);
|
||||
}
|
||||
nh = this._snapTick(nh, this.get('xTicks'));
|
||||
nh = this._snapTick(nh, this.get('yTicks'));
|
||||
nh = this._checkHeight(nh);
|
||||
|
||||
return nh;
|
||||
@ -1244,9 +1243,19 @@ var D = YAHOO.util.Dom,
|
||||
|
||||
if (p_oAttributes.height) {
|
||||
this.set('height', parseInt(p_oAttributes.height, 10));
|
||||
} else {
|
||||
var h = this.getStyle('height');
|
||||
if (h == 'auto') {
|
||||
this.set('height', parseInt(this.get('element').offsetHeight, 10));
|
||||
}
|
||||
}
|
||||
if (p_oAttributes.width) {
|
||||
this.set('width', parseInt(p_oAttributes.width, 10));
|
||||
} else {
|
||||
var w = this.getStyle('width');
|
||||
if (w == 'auto') {
|
||||
this.set('width', parseInt(this.get('element').offsetWidth, 10));
|
||||
}
|
||||
}
|
||||
|
||||
var id = p_oElement;
|
||||
@ -1313,7 +1322,7 @@ var D = YAHOO.util.Dom,
|
||||
Resize.superclass.initAttributes.call(this, attr);
|
||||
|
||||
/**
|
||||
* @attribute useShime
|
||||
* @attribute useShim
|
||||
* @description This setting will be passed to the DragDrop instances on the resize handles and for the draggable property.
|
||||
* This property should be used if you want the resize handles to work over iframe and other elements.
|
||||
* @type Boolean
|
||||
@ -1737,4 +1746,4 @@ var D = YAHOO.util.Dom,
|
||||
|
||||
})();
|
||||
|
||||
YAHOO.register("resize", YAHOO.util.Resize, {version: "2.6.0", build: "1321"});
|
||||
YAHOO.register("resize", YAHOO.util.Resize, {version: "2.7.0", build: "1799"});
|
||||
|
12
webdir/javascript/yui/resize/resize-min.js
vendored
12
webdir/javascript/yui/resize/resize-min.js
vendored
File diff suppressed because one or more lines are too long
73
webdir/javascript/yui/resize/resize.js
vendored
73
webdir/javascript/yui/resize/resize.js
vendored
@ -1,8 +1,8 @@
|
||||
/*
|
||||
Copyright (c) 2008, Yahoo! Inc. All rights reserved.
|
||||
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
|
||||
Code licensed under the BSD License:
|
||||
http://developer.yahoo.net/yui/license.txt
|
||||
version: 2.6.0
|
||||
version: 2.7.0
|
||||
*/
|
||||
/**
|
||||
* @description <p>Makes an element resizable</p>
|
||||
@ -10,7 +10,6 @@ version: 2.6.0
|
||||
* @requires yahoo, dom, dragdrop, element, event
|
||||
* @optional animation
|
||||
* @module resize
|
||||
* @beta
|
||||
*/
|
||||
(function() {
|
||||
var D = YAHOO.util.Dom,
|
||||
@ -249,19 +248,24 @@ var D = YAHOO.util.Dom,
|
||||
_createWrap: function() {
|
||||
this._positioned = false;
|
||||
//Force wrap for elements that can't have children
|
||||
switch (this.get('element').tagName.toLowerCase()) {
|
||||
case 'img':
|
||||
case 'textarea':
|
||||
case 'input':
|
||||
case 'iframe':
|
||||
case 'select':
|
||||
this.set('wrap', true);
|
||||
break;
|
||||
if (this.get('wrap') === false) {
|
||||
switch (this.get('element').tagName.toLowerCase()) {
|
||||
case 'img':
|
||||
case 'textarea':
|
||||
case 'input':
|
||||
case 'iframe':
|
||||
case 'select':
|
||||
this.set('wrap', true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (this.get('wrap') === true) {
|
||||
this._wrap = document.createElement('div');
|
||||
this._wrap.id = this.get('element').id + '_wrap';
|
||||
this._wrap.className = this.CSS_WRAP;
|
||||
if (this.get('element').tagName.toLowerCase() == 'textarea') {
|
||||
D.addClass(this._wrap, 'yui-resize-textarea');
|
||||
}
|
||||
D.setStyle(this._wrap, 'width', this.get('width') + 'px');
|
||||
D.setStyle(this._wrap, 'height', this.get('height') + 'px');
|
||||
D.setStyle(this._wrap, 'z-index', this.getStyle('z-index'));
|
||||
@ -400,8 +404,8 @@ var D = YAHOO.util.Dom,
|
||||
if (this._locked) {
|
||||
return false;
|
||||
}
|
||||
//Internet Explorer needs this
|
||||
D.removeClass(this._wrap, this.CSS_RESIZE);
|
||||
|
||||
if (this.get('hover')) {
|
||||
D.removeClass(this._wrap, this.CSS_HOVER);
|
||||
}
|
||||
@ -421,7 +425,6 @@ var D = YAHOO.util.Dom,
|
||||
}
|
||||
}
|
||||
|
||||
//Internet Explorer needs this
|
||||
D.addClass(this._wrap, this.CSS_RESIZE);
|
||||
},
|
||||
/**
|
||||
@ -431,7 +434,6 @@ var D = YAHOO.util.Dom,
|
||||
* @description Removes CSS class names to the handles
|
||||
*/
|
||||
_handleMouseOut: function(ev) {
|
||||
//Internet Explorer needs this
|
||||
D.removeClass(this._wrap, this.CSS_RESIZE);
|
||||
if (this.get('hover') && !this._active) {
|
||||
D.addClass(this._wrap, this.CSS_HOVER);
|
||||
@ -451,7 +453,6 @@ var D = YAHOO.util.Dom,
|
||||
}
|
||||
}
|
||||
}
|
||||
//Internet Explorer needs this
|
||||
D.addClass(this._wrap, this.CSS_RESIZE);
|
||||
},
|
||||
/**
|
||||
@ -687,9 +688,6 @@ var D = YAHOO.util.Dom,
|
||||
*/
|
||||
_updateStatus: function(h, w, t, l) {
|
||||
if (this._resizeEvent && (!Lang.isString(this._resizeEvent))) {
|
||||
if (this.get('status')) {
|
||||
D.setStyle(this._status, 'display', 'inline');
|
||||
}
|
||||
h = ((h === 0) ? this._cache.start.height : h);
|
||||
w = ((w === 0) ? this._cache.start.width : w);
|
||||
var h1 = parseInt(this.get('height'), 10),
|
||||
@ -705,8 +703,12 @@ var D = YAHOO.util.Dom,
|
||||
var diffW = (parseInt(w, 10) - w1);
|
||||
this._cache.offsetHeight = diffH;
|
||||
this._cache.offsetWidth = diffW;
|
||||
this._status.innerHTML = '<strong>' + parseInt(h, 10) + ' x ' + parseInt(w, 10) + '</strong><em>' + ((diffH > 0) ? '+' : '') + diffH + ' x ' + ((diffW > 0) ? '+' : '') + diffW + '</em>';
|
||||
D.setXY(this._status, [Event.getPageX(this._resizeEvent) + 12, Event.getPageY(this._resizeEvent) + 12]);
|
||||
if (this.get('status')) {
|
||||
D.setStyle(this._status, 'display', 'inline');
|
||||
//This will cause IE8 to crash if the status box is hidden..
|
||||
this._status.innerHTML = '<strong>' + parseInt(h, 10) + ' x ' + parseInt(w, 10) + '</strong><em>' + ((diffH > 0) ? '+' : '') + diffH + ' x ' + ((diffW > 0) ? '+' : '') + diffW + '</em>';
|
||||
D.setXY(this._status, [Event.getPageX(this._resizeEvent) + 12, Event.getPageY(this._resizeEvent) + 12]);
|
||||
}
|
||||
}
|
||||
},
|
||||
/**
|
||||
@ -784,13 +786,14 @@ var D = YAHOO.util.Dom,
|
||||
l = this._cache.left - l;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
var ratio = this._setRatio(h, w, t, l);
|
||||
h = parseInt(ratio[0], 10);
|
||||
w = parseInt(ratio[1], 10);
|
||||
t = parseInt(ratio[2], 10);
|
||||
l = parseInt(ratio[3], 10);
|
||||
|
||||
|
||||
if (t == 0) {
|
||||
//No Offset, get from cache
|
||||
t = D.getY(el);
|
||||
@ -851,6 +854,7 @@ var D = YAHOO.util.Dom,
|
||||
|
||||
this._updateStatus(h, w, t, l);
|
||||
|
||||
|
||||
if (this._positioned) {
|
||||
if (this._proxy && force) {
|
||||
//Do nothing
|
||||
@ -874,11 +878,6 @@ var D = YAHOO.util.Dom,
|
||||
}
|
||||
}
|
||||
if (set) {
|
||||
if (this.browser.ie > 6) {
|
||||
if (h === this._cache.height) {
|
||||
h = h + 1;
|
||||
}
|
||||
}
|
||||
el.style.height = h + 'px';
|
||||
}
|
||||
if ((this._proxy && force) || !this._proxy) {
|
||||
@ -964,7 +963,7 @@ var D = YAHOO.util.Dom,
|
||||
_handle_for_br: function(args) {
|
||||
var newW = this._setWidth(args.e);
|
||||
var newH = this._setHeight(args.e);
|
||||
this.resize(args.e, (newH + 1), newW, 0, 0);
|
||||
this.resize(args.e, newH, newW, 0, 0);
|
||||
},
|
||||
/**
|
||||
* @private
|
||||
@ -1067,7 +1066,7 @@ var D = YAHOO.util.Dom,
|
||||
nw = (xy - x) + parseInt(this.get('width'), 10);
|
||||
}
|
||||
|
||||
nw = this._snapTick(nw, this.get('yTicks'));
|
||||
nw = this._snapTick(nw, this.get('xTicks'));
|
||||
nw = this._checkWidth(nw);
|
||||
return nw;
|
||||
},
|
||||
@ -1128,7 +1127,7 @@ var D = YAHOO.util.Dom,
|
||||
if (flip) {
|
||||
nh = (xy - y) + parseInt(this.get('height'), 10);
|
||||
}
|
||||
nh = this._snapTick(nh, this.get('xTicks'));
|
||||
nh = this._snapTick(nh, this.get('yTicks'));
|
||||
nh = this._checkHeight(nh);
|
||||
|
||||
return nh;
|
||||
@ -1185,9 +1184,19 @@ var D = YAHOO.util.Dom,
|
||||
|
||||
if (p_oAttributes.height) {
|
||||
this.set('height', parseInt(p_oAttributes.height, 10));
|
||||
} else {
|
||||
var h = this.getStyle('height');
|
||||
if (h == 'auto') {
|
||||
this.set('height', parseInt(this.get('element').offsetHeight, 10));
|
||||
}
|
||||
}
|
||||
if (p_oAttributes.width) {
|
||||
this.set('width', parseInt(p_oAttributes.width, 10));
|
||||
} else {
|
||||
var w = this.getStyle('width');
|
||||
if (w == 'auto') {
|
||||
this.set('width', parseInt(this.get('element').offsetWidth, 10));
|
||||
}
|
||||
}
|
||||
|
||||
var id = p_oElement;
|
||||
@ -1254,7 +1263,7 @@ var D = YAHOO.util.Dom,
|
||||
Resize.superclass.initAttributes.call(this, attr);
|
||||
|
||||
/**
|
||||
* @attribute useShime
|
||||
* @attribute useShim
|
||||
* @description This setting will be passed to the DragDrop instances on the resize handles and for the draggable property.
|
||||
* This property should be used if you want the resize handles to work over iframe and other elements.
|
||||
* @type Boolean
|
||||
@ -1677,4 +1686,4 @@ var D = YAHOO.util.Dom,
|
||||
|
||||
})();
|
||||
|
||||
YAHOO.register("resize", YAHOO.util.Resize, {version: "2.6.0", build: "1321"});
|
||||
YAHOO.register("resize", YAHOO.util.Resize, {version: "2.7.0", build: "1799"});
|
||||
|
Reference in New Issue
Block a user