first commit

This commit is contained in:
CHIEFSOFT\ameye
2024-09-30 18:11:26 -04:00
commit e592ca6823
27270 changed files with 5002257 additions and 0 deletions
@@ -0,0 +1,251 @@
YUI.add('dd-proxy', function (Y, NAME) {
/**
* Plugin for dd-drag for creating a proxy drag node, instead of dragging the original node.
* @module dd
* @submodule dd-proxy
*/
/**
* Plugin for dd-drag for creating a proxy drag node, instead of dragging the original node.
* @class DDProxy
* @extends Base
* @constructor
* @namespace Plugin
*/
var DDM = Y.DD.DDM,
NODE = 'node',
DRAG_NODE = 'dragNode',
HOST = 'host',
TRUE = true, proto,
P = function() {
P.superclass.constructor.apply(this, arguments);
};
P.NAME = 'DDProxy';
/**
* The Proxy instance will be placed on the Drag instance under the proxy namespace.
* @property NS
* @default con
* @readonly
* @protected
* @static
* @type {String}
*/
P.NS = 'proxy';
P.ATTRS = {
host: {
},
/**
* Move the original node at the end of the drag. Default: true
* @attribute moveOnEnd
* @type Boolean
*/
moveOnEnd: {
value: TRUE
},
/**
* Hide the drag node at the end of the drag. Default: true
* @attribute hideOnEnd
* @type Boolean
*/
hideOnEnd: {
value: TRUE
},
/**
* Make the Proxy node assume the size of the original node. Default: true
* @attribute resizeFrame
* @type Boolean
*/
resizeFrame: {
value: TRUE
},
/**
* Make the Proxy node appear in the same place as the original node. Default: true
* @attribute positionProxy
* @type Boolean
*/
positionProxy: {
value: TRUE
},
/**
* The default border style for the border of the proxy. Default: 1px solid #808080
* @attribute borderStyle
* @type Boolean
*/
borderStyle: {
value: '1px solid #808080'
},
/**
* Should the node be cloned into the proxy for you. Default: false
* @attribute cloneNode
* @type Boolean
*/
cloneNode: {
value: false
}
};
proto = {
/**
* Holds the event handles for setting the proxy
* @private
* @property _hands
*/
_hands: null,
/**
* Handler for the proxy config attribute
* @private
* @method _init
*/
_init: function() {
if (!DDM._proxy) {
DDM._createFrame();
Y.on('domready', Y.bind(this._init, this));
return;
}
if (!this._hands) {
this._hands = [];
}
var h, h1, host = this.get(HOST), dnode = host.get(DRAG_NODE);
if (dnode.compareTo(host.get(NODE))) {
if (DDM._proxy) {
host.set(DRAG_NODE, DDM._proxy);
}
}
Y.Array.each(this._hands, function(v) {
v.detach();
});
h = DDM.on('ddm:start', Y.bind(function() {
if (DDM.activeDrag === host) {
DDM._setFrame(host);
}
}, this));
h1 = DDM.on('ddm:end', Y.bind(function() {
if (host.get('dragging')) {
if (this.get('moveOnEnd')) {
host.get(NODE).setXY(host.lastXY);
}
if (this.get('hideOnEnd')) {
host.get(DRAG_NODE).setStyle('display', 'none');
}
if (this.get('cloneNode')) {
host.get(DRAG_NODE).remove();
host.set(DRAG_NODE, DDM._proxy);
}
}
}, this));
this._hands = [h, h1];
},
initializer: function() {
this._init();
},
destructor: function() {
var host = this.get(HOST);
Y.Array.each(this._hands, function(v) {
v.detach();
});
host.set(DRAG_NODE, host.get(NODE));
},
clone: function() {
var host = this.get(HOST),
n = host.get(NODE),
c = n.cloneNode(true);
c.all('input[type="radio"]').removeAttribute('name');
delete c._yuid;
c.setAttribute('id', Y.guid());
c.setStyle('position', 'absolute');
n.get('parentNode').appendChild(c);
host.set(DRAG_NODE, c);
return c;
}
};
Y.namespace('Plugin');
Y.extend(P, Y.Base, proto);
Y.Plugin.DDProxy = P;
//Add a couple of methods to the DDM
Y.mix(DDM, {
/**
* Create the proxy element if it doesn't already exist and set the DD.DDM._proxy value
* @private
* @for DDM
* @namespace DD
* @method _createFrame
*/
_createFrame: function() {
if (!DDM._proxy) {
DDM._proxy = TRUE;
var p = Y.Node.create('<div></div>'),
b = Y.one('body');
p.setStyles({
position: 'absolute',
display: 'none',
zIndex: '999',
top: '-999px',
left: '-999px'
});
b.prepend(p);
p.set('id', Y.guid());
p.addClass(DDM.CSS_PREFIX + '-proxy');
DDM._proxy = p;
}
},
/**
* If resizeProxy is set to true (default) it will resize the proxy element to match the size of the Drag Element.
* If positionProxy is set to true (default) it will position the proxy element in the same location as the Drag Element.
* @private
* @for DDM
* @namespace DD
* @method _setFrame
*/
_setFrame: function(drag) {
var n = drag.get(NODE), d = drag.get(DRAG_NODE), ah, cur = 'auto';
ah = DDM.activeDrag.get('activeHandle');
if (ah) {
cur = ah.getStyle('cursor');
}
if (cur === 'auto') {
cur = DDM.get('dragCursor');
}
d.setStyles({
visibility: 'hidden',
display: 'block',
cursor: cur,
border: drag.proxy.get('borderStyle')
});
if (drag.proxy.get('cloneNode')) {
d = drag.proxy.clone();
}
if (drag.proxy.get('resizeFrame')) {
d.setStyles({
height: n.get('offsetHeight') + 'px',
width: n.get('offsetWidth') + 'px'
});
}
if (drag.proxy.get('positionProxy')) {
d.setXY(drag.nodeXY);
}
d.setStyle('visibility', 'visible');
}
});
//Create the frame when DOM is ready
//Y.on('domready', Y.bind(DDM._createFrame, DDM));
}, '3.18.1', {"requires": ["dd-drag"]});
+1
View File
@@ -0,0 +1 @@
YUI.add("dd-proxy",function(e,t){var n=e.DD.DDM,r="node",i="dragNode",s="host",o=!0,u,a=function(){a.superclass.constructor.apply(this,arguments)};a.NAME="DDProxy",a.NS="proxy",a.ATTRS={host:{},moveOnEnd:{value:o},hideOnEnd:{value:o},resizeFrame:{value:o},positionProxy:{value:o},borderStyle:{value:"1px solid #808080"},cloneNode:{value:!1}},u={_hands:null,_init:function(){if(!n._proxy){n._createFrame(),e.on("domready",e.bind(this._init,this));return}this._hands||(this._hands=[]);var t,o,u=this.get(s),a=u.get(i);a.compareTo(u.get(r))&&n._proxy&&u.set(i,n._proxy),e.Array.each(this._hands,function(e){e.detach()}),t=n.on("ddm:start",e.bind(function(){n.activeDrag===u&&n._setFrame(u)},this)),o=n.on("ddm:end",e.bind(function(){u.get("dragging")&&(this.get("moveOnEnd")&&u.get(r).setXY(u.lastXY),this.get("hideOnEnd")&&u.get(i).setStyle("display","none"),this.get("cloneNode")&&(u.get(i).remove(),u.set(i,n._proxy)))},this)),this._hands=[t,o]},initializer:function(){this._init()},destructor:function(){var t=this.get(s);e.Array.each(this._hands,function(e){e.detach()}),t.set(i,t.get(r))},clone:function(){var t=this.get(s),n=t.get(r),o=n.cloneNode(!0);return o.all('input[type="radio"]').removeAttribute("name"),delete o._yuid,o.setAttribute("id",e.guid()),o.setStyle("position","absolute"),n.get("parentNode").appendChild(o),t.set(i,o),o}},e.namespace("Plugin"),e.extend(a,e.Base,u),e.Plugin.DDProxy=a,e.mix(n,{_createFrame:function(){if(!n._proxy){n._proxy=o;var t=e.Node.create("<div></div>"),r=e.one("body");t.setStyles({position:"absolute",display:"none",zIndex:"999",top:"-999px",left:"-999px"}),r.prepend(t),t.set("id",e.guid()),t.addClass(n.CSS_PREFIX+"-proxy"),n._proxy=t}},_setFrame:function(e){var t=e.get(r),s=e.get(i),o,u="auto";o=n.activeDrag.get("activeHandle"),o&&(u=o.getStyle("cursor")),u==="auto"&&(u=n.get("dragCursor")),s.setStyles({visibility:"hidden",display:"block",cursor:u,border:e.proxy.get("borderStyle")}),e.proxy.get("cloneNode")&&(s=e.proxy.clone()),e.proxy.get("resizeFrame")&&s.setStyles({height:t.get("offsetHeight")+"px",width:t.get("offsetWidth")+"px"}),e.proxy.get("positionProxy")&&s.setXY(e.nodeXY),s.setStyle("visibility","visible")}})},"3.18.1",{requires:["dd-drag"]});
+251
View File
@@ -0,0 +1,251 @@
YUI.add('dd-proxy', function (Y, NAME) {
/**
* Plugin for dd-drag for creating a proxy drag node, instead of dragging the original node.
* @module dd
* @submodule dd-proxy
*/
/**
* Plugin for dd-drag for creating a proxy drag node, instead of dragging the original node.
* @class DDProxy
* @extends Base
* @constructor
* @namespace Plugin
*/
var DDM = Y.DD.DDM,
NODE = 'node',
DRAG_NODE = 'dragNode',
HOST = 'host',
TRUE = true, proto,
P = function() {
P.superclass.constructor.apply(this, arguments);
};
P.NAME = 'DDProxy';
/**
* The Proxy instance will be placed on the Drag instance under the proxy namespace.
* @property NS
* @default con
* @readonly
* @protected
* @static
* @type {String}
*/
P.NS = 'proxy';
P.ATTRS = {
host: {
},
/**
* Move the original node at the end of the drag. Default: true
* @attribute moveOnEnd
* @type Boolean
*/
moveOnEnd: {
value: TRUE
},
/**
* Hide the drag node at the end of the drag. Default: true
* @attribute hideOnEnd
* @type Boolean
*/
hideOnEnd: {
value: TRUE
},
/**
* Make the Proxy node assume the size of the original node. Default: true
* @attribute resizeFrame
* @type Boolean
*/
resizeFrame: {
value: TRUE
},
/**
* Make the Proxy node appear in the same place as the original node. Default: true
* @attribute positionProxy
* @type Boolean
*/
positionProxy: {
value: TRUE
},
/**
* The default border style for the border of the proxy. Default: 1px solid #808080
* @attribute borderStyle
* @type Boolean
*/
borderStyle: {
value: '1px solid #808080'
},
/**
* Should the node be cloned into the proxy for you. Default: false
* @attribute cloneNode
* @type Boolean
*/
cloneNode: {
value: false
}
};
proto = {
/**
* Holds the event handles for setting the proxy
* @private
* @property _hands
*/
_hands: null,
/**
* Handler for the proxy config attribute
* @private
* @method _init
*/
_init: function() {
if (!DDM._proxy) {
DDM._createFrame();
Y.on('domready', Y.bind(this._init, this));
return;
}
if (!this._hands) {
this._hands = [];
}
var h, h1, host = this.get(HOST), dnode = host.get(DRAG_NODE);
if (dnode.compareTo(host.get(NODE))) {
if (DDM._proxy) {
host.set(DRAG_NODE, DDM._proxy);
}
}
Y.Array.each(this._hands, function(v) {
v.detach();
});
h = DDM.on('ddm:start', Y.bind(function() {
if (DDM.activeDrag === host) {
DDM._setFrame(host);
}
}, this));
h1 = DDM.on('ddm:end', Y.bind(function() {
if (host.get('dragging')) {
if (this.get('moveOnEnd')) {
host.get(NODE).setXY(host.lastXY);
}
if (this.get('hideOnEnd')) {
host.get(DRAG_NODE).setStyle('display', 'none');
}
if (this.get('cloneNode')) {
host.get(DRAG_NODE).remove();
host.set(DRAG_NODE, DDM._proxy);
}
}
}, this));
this._hands = [h, h1];
},
initializer: function() {
this._init();
},
destructor: function() {
var host = this.get(HOST);
Y.Array.each(this._hands, function(v) {
v.detach();
});
host.set(DRAG_NODE, host.get(NODE));
},
clone: function() {
var host = this.get(HOST),
n = host.get(NODE),
c = n.cloneNode(true);
c.all('input[type="radio"]').removeAttribute('name');
delete c._yuid;
c.setAttribute('id', Y.guid());
c.setStyle('position', 'absolute');
n.get('parentNode').appendChild(c);
host.set(DRAG_NODE, c);
return c;
}
};
Y.namespace('Plugin');
Y.extend(P, Y.Base, proto);
Y.Plugin.DDProxy = P;
//Add a couple of methods to the DDM
Y.mix(DDM, {
/**
* Create the proxy element if it doesn't already exist and set the DD.DDM._proxy value
* @private
* @for DDM
* @namespace DD
* @method _createFrame
*/
_createFrame: function() {
if (!DDM._proxy) {
DDM._proxy = TRUE;
var p = Y.Node.create('<div></div>'),
b = Y.one('body');
p.setStyles({
position: 'absolute',
display: 'none',
zIndex: '999',
top: '-999px',
left: '-999px'
});
b.prepend(p);
p.set('id', Y.guid());
p.addClass(DDM.CSS_PREFIX + '-proxy');
DDM._proxy = p;
}
},
/**
* If resizeProxy is set to true (default) it will resize the proxy element to match the size of the Drag Element.
* If positionProxy is set to true (default) it will position the proxy element in the same location as the Drag Element.
* @private
* @for DDM
* @namespace DD
* @method _setFrame
*/
_setFrame: function(drag) {
var n = drag.get(NODE), d = drag.get(DRAG_NODE), ah, cur = 'auto';
ah = DDM.activeDrag.get('activeHandle');
if (ah) {
cur = ah.getStyle('cursor');
}
if (cur === 'auto') {
cur = DDM.get('dragCursor');
}
d.setStyles({
visibility: 'hidden',
display: 'block',
cursor: cur,
border: drag.proxy.get('borderStyle')
});
if (drag.proxy.get('cloneNode')) {
d = drag.proxy.clone();
}
if (drag.proxy.get('resizeFrame')) {
d.setStyles({
height: n.get('offsetHeight') + 'px',
width: n.get('offsetWidth') + 'px'
});
}
if (drag.proxy.get('positionProxy')) {
d.setXY(drag.nodeXY);
}
d.setStyle('visibility', 'visible');
}
});
//Create the frame when DOM is ready
//Y.on('domready', Y.bind(DDM._createFrame, DDM));
}, '3.18.1', {"requires": ["dd-drag"]});