|
@@ -6,21 +6,21 @@ Namespace.register("U.UF.UI")
|
|
|
|
|
|
|
|
|
|
|
|
-* new new U.UF.UI.form(
|
|
|
-* "测试内容",
|
|
|
-* "中间内容",
|
|
|
-* { "style": { "width": "570px", "height": "80%", "maxHeight": "700px"} },
|
|
|
-* );
|
|
|
-* @param string 头部标题 必填
|
|
|
-* @param string|element 中间区域的内容 必填
|
|
|
-* @param object 窗体的属性 {id :"1", style:{"width":"100px", "height":"100px"}} 选填 有默认的属性,原函数有注释
|
|
|
-* @param object 窗体功能的属性 { istop: true, isdrag: true, isstretching:true,isenlarge:true,isnarrow:true,isclose:true } 选填
|
|
|
-* @param object 头部的属性 {style:{"width":"100px"}} 选填 有默认的属性,原函数有注释
|
|
|
-* @param object 内容的属性 { style:{"height":"100px"}} 选填 有默认属性,原函数有注释
|
|
|
-* @param object 关闭、放大、缩小按钮区域的属性设置 { "style":{"left":"100px"}} 选填,有默认属性,原函数有注释
|
|
|
-* @param element 窗体追加到制定的元素 选填 有默认的属性,原函数有注释
|
|
|
-*/
|
|
|
-U.UF.UI.form = function (title, content, formattr, formfun, headattr, contentattr, headbottomattr, parentel) {
|
|
|
+ * new new U.UF.UI.form(
|
|
|
+ * "测试内容",
|
|
|
+ * "中间内容",
|
|
|
+ * { "style": { "width": "570px", "height": "80%", "maxHeight": "700px"} },
|
|
|
+ * );
|
|
|
+ * @param string 头部标题 必填
|
|
|
+ * @param string|element 中间区域的内容 必填
|
|
|
+ * @param object 窗体的属性 {id :"1", style:{"width":"100px", "height":"100px"}} 选填 有默认的属性,原函数有注释
|
|
|
+ * @param object 窗体功能的属性 { istop: true, isdrag: true, isstretching:true,isenlarge:true,isnarrow:true,isclose:true } 选填
|
|
|
+ * @param object 头部的属性 {style:{"width":"100px"}} 选填 有默认的属性,原函数有注释
|
|
|
+ * @param object 内容的属性 { style:{"height":"100px"}} 选填 有默认属性,原函数有注释
|
|
|
+ * @param object 关闭、放大、缩小按钮区域的属性设置 { "style":{"left":"100px"}} 选填,有默认属性,原函数有注释
|
|
|
+ * @param element 窗体追加到制定的元素 选填 有默认的属性,原函数有注释
|
|
|
+ */
|
|
|
+U.UF.UI.form = function(title, content, formattr, formfun, headattr, contentattr, headbottomattr, parentel) {
|
|
|
var _this = this;
|
|
|
|
|
|
if (formattr && U.UF.UI.form.allForm[formattr.id]) {
|
|
@@ -48,7 +48,7 @@ U.UF.UI.form = function (title, content, formattr, formfun, headattr, contentatt
|
|
|
formfun = {};
|
|
|
}
|
|
|
_this.istop = null;
|
|
|
- if (formfun.istop != null) {
|
|
|
+ if (formfun.istop != null) {
|
|
|
_this.istop = formfun.istop;
|
|
|
}
|
|
|
|
|
@@ -57,7 +57,7 @@ U.UF.UI.form = function (title, content, formattr, formfun, headattr, contentatt
|
|
|
_this.isdrag = formfun.isdrag;
|
|
|
}
|
|
|
_this.isstretching = true;
|
|
|
- if (formfun.isstretching != null) {
|
|
|
+ if (formfun.isstretching != null) {
|
|
|
_this.isstretching = formfun.isstretching;
|
|
|
}
|
|
|
|
|
@@ -67,13 +67,13 @@ U.UF.UI.form = function (title, content, formattr, formfun, headattr, contentatt
|
|
|
}
|
|
|
|
|
|
_this.isnarrow = true;
|
|
|
- if (formfun.isnarrow != null) {
|
|
|
+ if (formfun.isnarrow != null) {
|
|
|
_this.isnarrow = formfun.isnarrow;
|
|
|
}
|
|
|
|
|
|
_this.isclose = true;
|
|
|
_this.closecallback = formfun.closecallback;
|
|
|
- if (formfun.isclose != null) {
|
|
|
+ if (formfun.isclose != null) {
|
|
|
_this.isclose = formfun.isclose;
|
|
|
}
|
|
|
|
|
@@ -88,8 +88,8 @@ U.UF.UI.form.allForm = {};
|
|
|
|
|
|
U.UF.UI.form.prototype = {
|
|
|
|
|
|
- */
|
|
|
- create: function () {
|
|
|
+ */
|
|
|
+ create: function() {
|
|
|
var i,
|
|
|
_resizefun,
|
|
|
_formel,
|
|
@@ -110,13 +110,12 @@ U.UF.UI.form.prototype = {
|
|
|
if (_formattr.style) {
|
|
|
_formattr.style.cssText = _formattr.style.cssText || "";
|
|
|
_formattr.style.cssText = "width: 70%; position: fixed; border: 1px solid #444; background-color: #fff; z-index: 10; border-radius: 1px; overflow: hidden; -moz-box-shadow:0 0 30px 5px #555; -webkit-box-shadow:0 0 30px 5px #555; box-shadow:0 0 30px 5px #555; -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius:5px;" + _formattr.style.cssText;
|
|
|
- }
|
|
|
- else {
|
|
|
+ } else {
|
|
|
_formattr.style = {
|
|
|
cssText: "width: 70%; position: fixed; border: 1px solid #444; background-color: #fff; z-index: 10; border-radius: 1px; overflow: hidden; -moz-box-shadow:0 0 30px 5px #555; -webkit-box-shadow:0 0 30px 5px #555; box-shadow:0 0 30px 5px #555; -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius:5px;"
|
|
|
};
|
|
|
}
|
|
|
- _formattr.close = U.UF.C.apply(this, function () {
|
|
|
+ _formattr.close = U.UF.C.apply(this, function() {
|
|
|
U.UF.F.closeWindow(this.form);
|
|
|
});
|
|
|
_formattr.usform = "true";
|
|
@@ -125,13 +124,13 @@ U.UF.UI.form.prototype = {
|
|
|
if (_formattr.onresize) {
|
|
|
_resizefun = _formattr.onresize;
|
|
|
_mousedown = _formattr.onmousedown;
|
|
|
- _formattr.onresize = U.UF.C.apply(this, function () {
|
|
|
+ _formattr.onresize = U.UF.C.apply(this, function() {
|
|
|
this.size();
|
|
|
if (_resizefun) {
|
|
|
_resizefun();
|
|
|
}
|
|
|
});
|
|
|
- _formattr.onmousedown = U.UF.C.apply(this, function () {
|
|
|
+ _formattr.onmousedown = U.UF.C.apply(this, function() {
|
|
|
|
|
|
if (this.istop !== false) {
|
|
|
this.top();
|
|
@@ -140,9 +139,8 @@ U.UF.UI.form.prototype = {
|
|
|
_mousedown();
|
|
|
}
|
|
|
});
|
|
|
- }
|
|
|
- else if (_formattr.onresize !== false) {
|
|
|
- _formattr.onresize = U.UF.C.apply(this, function () {
|
|
|
+ } else if (_formattr.onresize !== false) {
|
|
|
+ _formattr.onresize = U.UF.C.apply(this, function() {
|
|
|
this.size();
|
|
|
});
|
|
|
}
|
|
@@ -152,8 +150,7 @@ U.UF.UI.form.prototype = {
|
|
|
if (this.istop === true) {
|
|
|
_formel.style.zIndex = "9999";
|
|
|
_formel["__top__"] = "false";
|
|
|
- }
|
|
|
- else if (this.istop === false) {
|
|
|
+ } else if (this.istop === false) {
|
|
|
_formel["__top__"] = "false";
|
|
|
}
|
|
|
this.form = _formel;
|
|
@@ -163,15 +160,14 @@ U.UF.UI.form.prototype = {
|
|
|
if (_headattr.style) {
|
|
|
_headattr.style.cssText = _headattr.style.cssText || "";
|
|
|
_headattr.style.cssText = "text-indent: 10px; color: White; line-height: inherit; font-size: 14px; height: 30px; line-height: 30px; background-color: #2967A7; overflow: hidden; color: White; font-size: 14px; overflow: hidden; " + _headattr.style.cssText;
|
|
|
- }
|
|
|
- else {
|
|
|
+ } else {
|
|
|
_headattr.style = {
|
|
|
cssText: "text-indent: 10px; color: White; line-height: inherit; font-size: 14px; height: 30px; line-height: 30px; background-color: #2967A7; overflow: hidden; color: White; font-size: 14px; overflow: hidden; "
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (this.isdrag) {
|
|
|
- _headattr.onmousedown = function () {
|
|
|
+ _headattr.onmousedown = function() {
|
|
|
U.UF.F.drag(_formel);
|
|
|
};
|
|
|
}
|
|
@@ -188,7 +184,7 @@ U.UF.UI.form.prototype = {
|
|
|
this.header = _headel;
|
|
|
}
|
|
|
|
|
|
- _contentel = $$("div", { "style": { "cssText": "width: 100%; height:100%; position: relative;"} }, _formel);
|
|
|
+ _contentel = $$("div", { "style": { "cssText": "width: 100%; height:100%; position: relative;" } }, _formel);
|
|
|
|
|
|
_contentattr.usbody = "true";
|
|
|
|
|
@@ -196,8 +192,7 @@ U.UF.UI.form.prototype = {
|
|
|
_contentattr.style.cssText = _contentattr.style.cssText || "";
|
|
|
|
|
|
_contentattr.style.cssText = "text-align: left; overflow: hidden;" + _contentattr.style.cssText;
|
|
|
- }
|
|
|
- else {
|
|
|
+ } else {
|
|
|
_contentattr.style = {
|
|
|
cssText: "text-align: left; overflow: auto;"
|
|
|
};
|
|
@@ -215,32 +210,32 @@ U.UF.UI.form.prototype = {
|
|
|
this.middle = _contentchildel;
|
|
|
|
|
|
if (this.title === false && this.isdrag) {
|
|
|
- _contentel.onmousedown = function () {
|
|
|
+ _contentel.onmousedown = function() {
|
|
|
U.UF.F.drag(_formel);
|
|
|
};
|
|
|
}
|
|
|
|
|
|
if (this.isstretching !== false) {
|
|
|
|
|
|
- _stretchingel = $$("div", { style: { "cssText": "display: block;"} }, _formel);
|
|
|
+ _stretchingel = $$("div", { style: { "cssText": "display: block;" } }, _formel);
|
|
|
|
|
|
_stretchinginfo = {
|
|
|
- "top": "cursor: n-resize; left: 0px; top: 0px; width: 100%; height: 5px;",
|
|
|
- "rightTop": "cursor: ne-resize; right: -2px; top: -2px; width: 12px; height: 12px;",
|
|
|
- "leftTop": "cursor: nw-resize; top: 0px; left: 0px; width: 12px; height: 12px;",
|
|
|
- "left": "cursor: w-resize; left: 0px; top: 0px; width: 5px; height: 100%;",
|
|
|
- "right": "cursor: e-resize; right: 0px; top: 0px; width: 5px; height: 100%;",
|
|
|
- "bottom": "cursor: s-resize; left: 0px; bottom: 0px; width: 100%; height: 5px;",
|
|
|
- "leftBottom": "cursor: sw-resize; left: -2px; bottom: -2px; width: 12px; height: 12px;",
|
|
|
- "rightBottom": "cursor: se-resize; right: -2px; bottom: -2px; width: 12px; height: 12px;"
|
|
|
- }
|
|
|
-
|
|
|
+ "top": "cursor: n-resize; left: 0px; top: 0px; width: 100%; height: 5px;",
|
|
|
+ "rightTop": "cursor: ne-resize; right: -2px; top: -2px; width: 12px; height: 12px;",
|
|
|
+ "leftTop": "cursor: nw-resize; top: 0px; left: 0px; width: 12px; height: 12px;",
|
|
|
+ "left": "cursor: w-resize; left: 0px; top: 0px; width: 5px; height: 100%;",
|
|
|
+ "right": "cursor: e-resize; right: 0px; top: 0px; width: 5px; height: 100%;",
|
|
|
+ "bottom": "cursor: s-resize; left: 0px; bottom: 0px; width: 100%; height: 5px;",
|
|
|
+ "leftBottom": "cursor: sw-resize; left: -2px; bottom: -2px; width: 12px; height: 12px;",
|
|
|
+ "rightBottom": "cursor: se-resize; right: -2px; bottom: -2px; width: 12px; height: 12px;"
|
|
|
+ }
|
|
|
+
|
|
|
for (i in _stretchinginfo) {
|
|
|
$$("div", {
|
|
|
"style": {
|
|
|
"cssText": "position: absolute; overflow: hidden; display: block; z-index: 10;" + _stretchinginfo[i]
|
|
|
},
|
|
|
- "onmousedown": U.UF.C.closure(function (scope, typename) {
|
|
|
+ "onmousedown": U.UF.C.closure(function(scope, typename) {
|
|
|
|
|
|
U.UF.F.stretching(_formel, typename, U.UF.C.apply(scope, scope.size));
|
|
|
}, [this, i])
|
|
@@ -258,11 +253,11 @@ U.UF.UI.form.prototype = {
|
|
|
|
|
|
$$("div", {
|
|
|
"style": {
|
|
|
- "cssText": "background-image:url(/img/close.png); _background-image:url(/img/close.png);width: 20px; height: 20px; background-position: -120px -61px; background-size: 100%; float: right; margin-right: 3px; cursor: pointer;"
|
|
|
+ "cssText": "background-image:url(../../../img/close.png); _background-image:url(/img/close.png);width: 20px; height: 20px; background-position: -120px -61px; background-size: 100%; float: right; margin-right: 3px; cursor: pointer;"
|
|
|
},
|
|
|
"title": "点击关闭",
|
|
|
"onmousedown": U.UF.EV.stopBubble,
|
|
|
- "onclick": U.UF.C.apply(this, function () {
|
|
|
+ "onclick": U.UF.C.apply(this, function() {
|
|
|
U.UF.F.closeWindow(this.form);
|
|
|
try {
|
|
|
|
|
@@ -270,9 +265,7 @@ U.UF.UI.form.prototype = {
|
|
|
U.MD.D.T.taskbar.close({ "forms": _formel });
|
|
|
U.MD.N.urlWrite("", "可可乐博信息化桌面");
|
|
|
}
|
|
|
- }
|
|
|
- catch (e) {
|
|
|
- }
|
|
|
+ } catch (e) {}
|
|
|
|
|
|
if (U.UF.C.isFunction(this.closecallback)) {
|
|
|
this.closecallback();
|
|
@@ -286,12 +279,12 @@ U.UF.UI.form.prototype = {
|
|
|
|
|
|
_enlargeel = $$("div", {
|
|
|
"style": {
|
|
|
- "cssText": "background-image:url(/img/max.png); _background-image:url(/img/max.png);background-position: -598px -240px; background-size: 100%; float: right; margin-right: 7px; width: 20px; height: 20px; cursor: pointer;"
|
|
|
+ "cssText": "background-image:url(../../../img/max.png); _background-image:url(/img/max.png);background-position: -598px -240px; background-size: 100%; float: right; margin-right: 7px; width: 20px; height: 20px; cursor: pointer;"
|
|
|
},
|
|
|
"title": "最大化",
|
|
|
"onmousedown": U.UF.EV.stopBubble,
|
|
|
|
|
|
- "onclick": function () {
|
|
|
+ "onclick": function() {
|
|
|
U.UF.F.windowZooming(_formel);
|
|
|
}
|
|
|
}, _headbottom);
|
|
@@ -299,7 +292,7 @@ U.UF.UI.form.prototype = {
|
|
|
|
|
|
if (_headel) {
|
|
|
|
|
|
- _headel.ondblclick = U.UF.C.apply(_headel, function () {
|
|
|
+ _headel.ondblclick = U.UF.C.apply(_headel, function() {
|
|
|
|
|
|
if (event.srcElement == this || U.UF.EL.isChild(this, event.srcElement)) {
|
|
|
_enlargeel.onclick();
|
|
@@ -313,11 +306,11 @@ U.UF.UI.form.prototype = {
|
|
|
|
|
|
$$("div", {
|
|
|
"style": {
|
|
|
- "cssText": "background-image:url(/img/min.png); _background-image:url(/img/min.png);background-position: -617px -240px; background-size: 100%; float: right; margin-right: 10px; width: 20px; height: 20px; cursor: pointer;"
|
|
|
+ "cssText": "background-image:url(../../../img/min.png); _background-image:url(/img/min.png);background-position: -617px -240px; background-size: 100%; float: right; margin-right: 10px; width: 20px; height: 20px; cursor: pointer;"
|
|
|
},
|
|
|
"title": "最小化",
|
|
|
"onmousedown": U.UF.EV.stopBubble,
|
|
|
- "onclick": function () {
|
|
|
+ "onclick": function() {
|
|
|
U.UF.F.windowMinimize(_formel);
|
|
|
}
|
|
|
}, _headbottom);
|
|
@@ -344,13 +337,13 @@ U.UF.UI.form.prototype = {
|
|
|
this.size();
|
|
|
},
|
|
|
|
|
|
- */
|
|
|
- top: function () {
|
|
|
+ */
|
|
|
+ top: function() {
|
|
|
U.UF.F.topWindow(this.form);
|
|
|
},
|
|
|
|
|
|
- */
|
|
|
- size: function () {
|
|
|
+ */
|
|
|
+ size: function() {
|
|
|
var _headheight = 0;
|
|
|
|
|
|
if (this.header) {
|
|
@@ -366,8 +359,8 @@ U.UF.UI.form.prototype = {
|
|
|
}
|
|
|
|
|
|
|
|
|
-*/
|
|
|
-U.UF.UI.form.windowResize = function () {
|
|
|
+ */
|
|
|
+U.UF.UI.form.windowResize = function() {
|
|
|
var i,
|
|
|
_style,
|
|
|
_bodywidth = US.width,
|
|
@@ -377,7 +370,7 @@ U.UF.UI.form.windowResize = function () {
|
|
|
_height,
|
|
|
_formel,
|
|
|
_forms = U.UF.UI.form.allForm
|
|
|
- ;
|
|
|
+ ;
|
|
|
|
|
|
for (i in _forms) {
|
|
|
_formel = _forms[i].form;
|
|
@@ -405,8 +398,8 @@ U.UF.UI.form.windowResize = function () {
|
|
|
}
|
|
|
|
|
|
|
|
|
-*/
|
|
|
-U.UF.UI.form.closeWindows = function () {
|
|
|
+ */
|
|
|
+U.UF.UI.form.closeWindows = function() {
|
|
|
var i;
|
|
|
for (i in U.UF.UI.form.allForm) {
|
|
|
if (U.UF.UI.form.allForm[i].isclose) {
|