123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218 |
-
- Namespace.register("U.D");
- U.D.Masklayer = function () {
- return $$("div", { "style": { "cssText": "width:100%;height:100%;position:absolute;top:0;left:0;"} }, document.body);
- }
- U.D.foundVirtualBox = function (UDOD, UE) {
- UDOD = $(UDOD);
- UE = UE || UDOD.GetElementInfo();
- return $$("div", { "style": { "cssText": "pointer-events:none;border:2px solid Gray;position:absolute;top:" + (UE["OT"] - 2) + "px;left:" + (UE["OL"] - 2) + "px;width:" + (UE["OW"]) + "px;height:" + (UE["OH"]) + "px;z-index:" + (US.ZV + 10)} }, UDOD.Parent());
- }
- U.D.AddOM = function (UDOD, UCB) {
- if (!$(".UD_W_WT", UDOD)[0]) {
- var i,
- _UTE = U.D.RCDG(UDOD, null, UCB),
- _UTP = "UD_W_WT",
- _UDE = [["H", "up"], ["MR", "right"], ["B", "down"], ["ML", "left"], ["HL", "topright"], ["BR", "bottomright"], ["BL", "bottomleft"], ["HR", "topleft"]],
- _UDTD = $$("div", { "className": "UD_W_WT" });
- for (i = 0; i < _UDE.length; i++) {
- $$("div", { "className": _UTP + "_" + _UDE[i][0], "onmousedown": U.M.apply(_UTE, [[_UTE.set, [_UDE[i][1]]]]) }, _UDTD);
- }
- UDOD.appendChild(_UDTD);
- }
- }
- U.D.RCDG = function (UDOD, UTF, UCB) {
- return new U.D.RCDG.init(UDOD, UTF, UCB);
- }
- U.D.RCDG.init = function (UDOD, UTF, UCB) {
-
- U.Ut.AddObj(this, { UCB: UCB, UDOD: UDOD });
- (UTF) && (this.set(UTF));
- }
- U.D.RCDG.init.prototype = {
-
- set: function (UTF) {
- var i, _UDMD,
- _UDOD = this.UDOD,
- _UE = U.M.GetElementAllInfo(_UDOD),
- _UDE = [["move", UTF], ["up", "mup"]];
- if (UTF && event.button != 2 && (_UE["OH"] != US.Height || _UE["OW"] != US.Width)) {
-
- U.Ut.AddObj(this, {
- UMD: (_UDMD = U.D.Masklayer()),
- UTF: UTF,
- UTOD: U.D.foundVirtualBox(_UDOD),
- E: _UE,
- H: _UE.H,
- W: _UE.W,
- T: _UE.OT,
- L: _UE.OL
- });
- this.UTOD.setCapture();
-
- U.D.SetDTop(this.UTOD);
- U.D.SetDTop(_UDMD);
-
- for (i = 0; i < _UDE.length; i++) {
- document["onmouse" + _UDE[i][0]] = U.M.apply(this, [[this[_UDE[i][1].toLocaleLowerCase()]]]);
- }
-
- return this;
- }
- },
-
- up: function () {
- var _UE = U.M.GetMousep(),
- _UT = Math.min(Math.max(_UE["Y"], 0), this.T + this.H - 4),
- _UH = this.H + (this.T - _UT);
- $(this.UTOD).addAttrArray({ "style": { "cssText": "top:" + (_UT - 2) + "px;height:" + (_UH) + "px"} });
- },
-
- down: function () {
- var _UE = U.M.GetMousep();
- _UE["Y"] = Math.max(Math.min(_UE["Y"], US.Height), this.T);
- this.UTOD.style.height = (_UE["Y"] - this.T) + "px";
- },
-
- left: function () {
- var _UE = U.M.GetMousep(),
- _UL = Math.min(Math.max(_UE["X"], 0), this.L + this.W - 4),
- _UW = this.W + this.L - _UL;
- $(this.UTOD).addAttrArray({ "style": { "cssText": "left:" + (_UL - 2) + "px;width:" + (_UW) + "px"} });
- },
-
- right: function () {
- var _UE = U.M.GetMousep();
- _UE["X"] = Math.max(Math.min(_UE["X"], US.Width), this.L);
- this.UTOD.style.width = (_UE["X"] - this.L) + "px";
- },
-
- topleft: function () {
- this.up();
- this.left();
- },
-
- topright: function () {
- this.up();
- this.right();
- },
-
- bottomleft: function () {
- this.down();
- this.left();
- },
-
- bottomright: function () {
- this.down();
- this.right();
- },
-
- mup: function () {
- var i, _UPE = this.E.PD,
- _UBE = this.E.BD,
- _UDTD = $(this.UTOD),
- _UCE = U.M.GetElementAllInfo(this.UTOD),
- _UDE = [_UCE["W"], _UCE["H"]];
-
- for (i = 0; i < _UPE.length; i++) {
- _UDE[(i + 1) % 2] -= (_UPE[i] + _UBE[i]);
- }
-
- $(this.UDOD).addAttrArray({ "style": { "cssText": "left:" + (_UCE["OL"] + 2) + "px;top:" + (_UCE["OT"] + 2) + "px;width:" + _UDE[0] + "px;height:" + _UDE[1] + "px"} });
-
- $(_UDTD).remove();
- _UDTD[0].releaseCapture();
- document.onmousemove = document.onmouseup = null;
- $(this.UMD).remove();
-
- U.D.withf(this.UCB, _UDE);
- }
- }
- U.D.withf = function (UAE, UDE) {
- if (UAE) {
- var i, j, k, _UCE, _UDOD,
- _UKE = {};
- for (i in UAE) {
- if (UAE.hasOwnProperty(i)) {
-
- if (i == "with") {
- for (j = 0; j < UAE[i].length; j++) {
- _UCE = UAE[i][j];
- _UDOD = _UCE["Element"];
- for (k in _UCE) {
- if (_UCE.hasOwnProperty(k) && k != "Element") {
- _UKE[k] = _UCE[k] + UDE[k == "width" ? 0 : 1];
- }
- }
- $(_UDOD).addAttrArray({ style: _UKE });
- }
- }
-
- else { U.M.apply(null, UAE[i])(UDE); }
- }
- }
- }
- }
|