treport 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/connect.rb +1 -0
- data/app/models/db.rb +1 -1
- data/app/models/map.rb +1 -0
- data/app/models/map_requirement.rb +1 -0
- data/app/models/report.rb +17 -9
- data/app/models/requirement.rb +1 -0
- data/public/treport/plugins/datePicker/My97DatePicker.htm +48 -48
- data/public/treport/plugins/datePicker/WdatePicker.js +52 -52
- data/public/treport/plugins/datePicker/calendar.js +4 -4
- data/public/treport/plugins/datePicker/config.js +16 -16
- data/public/treport/plugins/datePicker/lang/en.js +13 -13
- data/public/treport/plugins/datePicker/lang/zh-cn.js +13 -13
- data/public/treport/plugins/datePicker/lang/zh-tw.js +13 -13
- data/public/treport/plugins/datePicker/skin/WdatePicker.css +9 -9
- data/public/treport/plugins/datePicker/skin/areo/datepicker.css +301 -301
- data/public/treport/plugins/datePicker/skin/armyGreen/datepicker.css +301 -301
- data/public/treport/plugins/datePicker/skin/blue/datepicker.css +114 -114
- data/public/treport/plugins/datePicker/skin/blueGreen/datepicker.css +301 -301
- data/public/treport/plugins/datePicker/skin/darkBlue/datepicker.css +308 -308
- data/public/treport/plugins/datePicker/skin/darkYellow/datepicker.css +114 -114
- data/public/treport/plugins/datePicker/skin/deepBlue/datepicker.css +300 -300
- data/public/treport/plugins/datePicker/skin/default/datepicker.css +245 -245
- data/public/treport/plugins/datePicker/skin/green/datepicker.css +114 -114
- data/public/treport/plugins/datePicker/skin/lightBlue/datepicker.css +114 -114
- data/public/treport/plugins/datePicker/skin/modernBlue/datepicker.css +301 -301
- data/public/treport/plugins/datePicker/skin/orange/datepicker.css +114 -114
- data/public/treport/plugins/datePicker/skin/red/datepicker.css +114 -114
- data/public/treport/plugins/datePicker/skin/whyGreen/datepicker.css +255 -255
- data/public/treport/plugins/datePicker/skin/yellowGreen/datepicker.css +114 -114
- data/public/treport/plugins/validationEngine/jquery.validationEngine-zh_CN.js +181 -181
- data/public/treport/plugins/validationEngine/jquery.validationEngine.js +2160 -2160
- data/public/treport/plugins/validationEngine/template.css +124 -124
- data/public/treport/plugins/validationEngine/validationEngine.jquery.css +182 -182
- data/public/treport/plugins/zDialog/dialog.js +1312 -1312
- data/public/treport/plugins/zDialog/drag.js +91 -91
- data/public/treport/plugins/zDialog/skins/blue/dir.txt +24 -24
- data/public/treport/plugins/zDialog/skins/darkBlue/dir.txt +24 -24
- data/public/treport/plugins/zDialog/skins/darkYellow/dir.txt +24 -24
- data/public/treport/plugins/zDialog/skins/green/dir.txt +24 -24
- data/public/treport/plugins/zDialog/skins/lightBlue/dir.txt +24 -24
- data/public/treport/plugins/zDialog/skins/red/dir.txt +24 -24
- data/public/treport/plugins/zDialog/skins/yellowGreen/dir.txt +24 -24
- data/public/treport/plugins/zDialog/zDialog.js +763 -763
- metadata +2 -2
@@ -1,1313 +1,1313 @@
|
|
1
|
-
var mainprePath = "/admin/";
|
2
|
-
var themeColor = "blue";
|
3
|
-
var IMAGESPATH = mainprePath + "plugins/zDialog/skins/blue/";
|
4
|
-
if ($("#skin").attr("themeColor") != null) {
|
5
|
-
themeColor = $("#skin").attr("themeColor");
|
6
|
-
IMAGESPATH = mainprePath + "plugins/zDialog/skins/" + themeColor + "/"
|
7
|
-
}
|
8
|
-
var HideScrollbar = true;
|
9
|
-
var agt = window.navigator.userAgent;
|
10
|
-
var isIE = agt.toLowerCase().indexOf("msie") != -1;
|
11
|
-
var isGecko = agt.toLowerCase().indexOf("gecko") != -1;
|
12
|
-
var ieVer = isIE ? parseInt(agt.split(";")[1].replace(/(^\s*)|(\s*$)/g, "").split(" ")[1]) : 0;
|
13
|
-
var isIE8 = !! window.XDomainRequest && !! document.documentMode;
|
14
|
-
var isIE7 = ieVer == 7 && !isIE8;
|
15
|
-
var ielt7 = isIE && ieVer < 7;
|
16
|
-
var isQuirks = document.compatMode == "BackCompat";
|
17
|
-
var maxIndex = 900;
|
18
|
-
var instance;
|
19
|
-
var $id = function (a) {
|
20
|
-
return typeof a == "string" ? document.getElementById(a) : a
|
21
|
-
};
|
22
|
-
|
23
|
-
function stopEvent(a) {
|
24
|
-
a = window.event || a;
|
25
|
-
if (!a) {
|
26
|
-
return
|
27
|
-
}
|
28
|
-
if (isGecko) {
|
29
|
-
a.preventDefault();
|
30
|
-
a.stopPropagation()
|
31
|
-
}
|
32
|
-
a.cancelBubble = true;
|
33
|
-
a.returnValue = false
|
34
|
-
}
|
35
|
-
|
36
|
-
function removeWinArray(d, c, b) {
|
37
|
-
if (b) {
|
38
|
-
var f = [];
|
39
|
-
for (var a = 0; a < d.length; a++) {
|
40
|
-
if (c == d[a]) {
|
41
|
-
f.push(d.splice(a, 1)[0])
|
42
|
-
}
|
43
|
-
}
|
44
|
-
return f
|
45
|
-
}
|
46
|
-
for (var a = 0; a < d.length; a++) {
|
47
|
-
if (c == d[a]) {
|
48
|
-
d.splice(a, 1)
|
49
|
-
}
|
50
|
-
}
|
51
|
-
return d
|
52
|
-
}
|
53
|
-
if (!isIE && HTMLElement) {
|
54
|
-
if (!HTMLElement.prototype.attachEvent) {
|
55
|
-
window.attachEvent = document.attachEvent = HTMLElement.prototype.attachEvent = function (b, a) {
|
56
|
-
b = b.substring(2);
|
57
|
-
this.addEventListener(b, a, false)
|
58
|
-
};
|
59
|
-
window.detachEvent = document.detachEvent = HTMLElement.prototype.detachEvent = function (b, a) {
|
60
|
-
b = b.substring(2);
|
61
|
-
this.removeEventListener(b, a, false)
|
62
|
-
}
|
63
|
-
}
|
64
|
-
} else {
|
65
|
-
if (isIE && ieVer < 8) {
|
66
|
-
try {
|
67
|
-
document.execCommand("BackgroundImageCache", false, true)
|
68
|
-
} catch (e) {}
|
69
|
-
}
|
70
|
-
}
|
71
|
-
var $topWindow = function () {
|
72
|
-
var a = window;
|
73
|
-
return a
|
74
|
-
};
|
75
|
-
var $bodyDimensions = function (i) {
|
76
|
-
i = i || window;
|
77
|
-
var h = i.document;
|
78
|
-
var c = h.compatMode == "BackCompat" ? h.body.clientWidth : h.documentElement.clientWidth;
|
79
|
-
var g = h.compatMode == "BackCompat" ? h.body.clientHeight : h.documentElement.clientHeight;
|
80
|
-
var b = Math.max(h.documentElement.scrollLeft, h.body.scrollLeft);
|
81
|
-
var d = Math.max(h.documentElement.scrollTop, h.body.scrollTop);
|
82
|
-
var a = Math.max(h.documentElement.scrollWidth, h.body.scrollWidth);
|
83
|
-
var f = Math.max(h.documentElement.scrollHeight, h.body.scrollHeight);
|
84
|
-
if (f < g) {
|
85
|
-
f = g
|
86
|
-
}
|
87
|
-
return {
|
88
|
-
clientWidth: c,
|
89
|
-
clientHeight: g,
|
90
|
-
scrollLeft: b,
|
91
|
-
scrollTop: d,
|
92
|
-
scrollWidth: a,
|
93
|
-
scrollHeight: f
|
94
|
-
}
|
95
|
-
};
|
96
|
-
var fadeEffect = function (b, f, a, c, d) {
|
97
|
-
if (!b.effect) {
|
98
|
-
b.effect = {
|
99
|
-
fade: 0,
|
100
|
-
move: 0,
|
101
|
-
size: 0
|
102
|
-
}
|
103
|
-
}
|
104
|
-
clearInterval(b.effect.fade);
|
105
|
-
var c = c || 20;
|
106
|
-
b.effect.fade = setInterval(function () {
|
107
|
-
f = f < a ? Math.min(f + c, a) : Math.max(f - c, a);
|
108
|
-
b.style.opacity = f / 100;
|
109
|
-
b.style.filter = "alpha(opacity=" + f + ")";
|
110
|
-
if (f == a) {
|
111
|
-
clearInterval(b.effect.fade);
|
112
|
-
if (d) {
|
113
|
-
d.call(b)
|
114
|
-
}
|
115
|
-
}
|
116
|
-
}, 20)
|
117
|
-
};
|
118
|
-
var topWin = $topWindow();
|
119
|
-
var topDoc = topWin.document;
|
120
|
-
var Dialog = function () {
|
121
|
-
this.ID = null;
|
122
|
-
this.Width = 550;
|
123
|
-
this.Height = 380;
|
124
|
-
this.URL = null;
|
125
|
-
this.OnLoad = null;
|
126
|
-
this.InnerHtml = "";
|
127
|
-
this.InvokeElementId = "";
|
128
|
-
this.Top = "50%";
|
129
|
-
this.Left = "50%";
|
130
|
-
this.Title = " ";
|
131
|
-
this.OkButtonText = " 确 定 ";
|
132
|
-
this.CancelButtonText = " 取 消 ";
|
133
|
-
this.OKEvent = null;
|
134
|
-
this.CancelEvent = null;
|
135
|
-
this.MaxEvent = null;
|
136
|
-
this.DecreaseEvent = null;
|
137
|
-
this.MinEvent = null;
|
138
|
-
this.ShowButtonRow = false;
|
139
|
-
this.ShowOkButton = true;
|
140
|
-
this.ShowCancelButton = true;
|
141
|
-
this.MessageIcon = "window.gif";
|
142
|
-
this.MessageTitle = "";
|
143
|
-
this.Message = "";
|
144
|
-
this.ShowMessageRow = false;
|
145
|
-
this.Modal = true;
|
146
|
-
this.Drag = true;
|
147
|
-
this.AutoClose = null;
|
148
|
-
this.ShowCloseButton = true;
|
149
|
-
this.ShowMaxButton = false;
|
150
|
-
this.ShowMinButton = false;
|
151
|
-
this.Animator = !ielt7;
|
152
|
-
this.MsgForESC = "";
|
153
|
-
this.InnerFrameName = null;
|
154
|
-
this.Style = "normal";
|
155
|
-
this.ButtonAlign = "right";
|
156
|
-
this.DecreaseResetPosition = false;
|
157
|
-
this.ResizeResetPosition = true;
|
158
|
-
this.Alpha = 40;
|
159
|
-
this.Bgcolor = "#333333";
|
160
|
-
this.CloseHideScroller = false;
|
161
|
-
this.AllowChangeIndex = true;
|
162
|
-
this.MinToTask = false;
|
163
|
-
this.IconClass = "dialog_icon_default";
|
164
|
-
this.IconSrc = "";
|
165
|
-
this.ParamsObj = null;
|
166
|
-
this.dialogDiv = null;
|
167
|
-
this.bgDiv = null;
|
168
|
-
this.openerWindow = null;
|
169
|
-
this.openerDialog = null;
|
170
|
-
this.innerFrame = null;
|
171
|
-
this.innerWin = null;
|
172
|
-
this.innerDoc = null;
|
173
|
-
this.zindex = 900;
|
174
|
-
this.cancelButton = null;
|
175
|
-
this.okButton = null;
|
176
|
-
this.maxButton = null;
|
177
|
-
this.minButton = null;
|
178
|
-
this.unauthorized = false;
|
179
|
-
this.maxFlag = false;
|
180
|
-
this.minFlag = false;
|
181
|
-
if (arguments.length > 0 && typeof (arguments[0]) == "string") {
|
182
|
-
this.ID = arguments[0]
|
183
|
-
} else {
|
184
|
-
if (arguments.length > 0 && typeof (arguments[0]) == "object") {
|
185
|
-
Dialog.setOptions(this, arguments[0])
|
186
|
-
}
|
187
|
-
} if (!this.ID) {
|
188
|
-
this.ID = topWin.Dialog._dialogArray.length + ""
|
189
|
-
}
|
190
|
-
instance = this
|
191
|
-
};
|
192
|
-
Dialog._dialogArray = [];
|
193
|
-
Dialog._childDialogArray = [];
|
194
|
-
Dialog._taskArray = [];
|
195
|
-
Dialog.bgDiv = null;
|
196
|
-
Dialog.setOptions = function (c, b) {
|
197
|
-
if (!b) {
|
198
|
-
return
|
199
|
-
}
|
200
|
-
for (var a in b) {
|
201
|
-
c[a] = b[a]
|
202
|
-
}
|
203
|
-
};
|
204
|
-
Dialog.attachBehaviors = function () {
|
205
|
-
document.attachEvent("onkeydown", Dialog.onKeyDown);
|
206
|
-
window.attachEvent("onresize", function () {
|
207
|
-
Dialog.setBgDivSize();
|
208
|
-
for (var c = 0, b = topWin.Dialog._dialogArray.length; c < b; c++) {
|
209
|
-
var a = topWin.Dialog._dialogArray[c];
|
210
|
-
if (a.ResizeResetPosition) {
|
211
|
-
a.setPosition()
|
212
|
-
}
|
213
|
-
}
|
214
|
-
});
|
215
|
-
if (!HideScrollbar && ielt7) {
|
216
|
-
window.attachEvent("onscroll", Dialog.resetPosition)
|
217
|
-
}
|
218
|
-
};
|
219
|
-
Dialog.prototype.attachBehaviors = function () {
|
220
|
-
var c = this;
|
221
|
-
if (this.Drag && topWin.Drag) {
|
222
|
-
var a = topWin.$id("_Draghandle_" + this.ID),
|
223
|
-
b = topWin.$id("_DialogDiv_" + this.ID);
|
224
|
-
topWin.Drag.init(a, b);
|
225
|
-
b.onDragStart = function (h, g, f, d) {
|
226
|
-
if (!isIE && c.URL) {
|
227
|
-
topWin.$id("_Covering_" + c.ID).style.display = ""
|
228
|
-
}
|
229
|
-
};
|
230
|
-
b.onDragEnd = function (i, h, f, d) {
|
231
|
-
if (!isIE && c.URL) {
|
232
|
-
topWin.$id("_Covering_" + c.ID).style.display = "none"
|
233
|
-
}
|
234
|
-
var g = $bodyDimensions(topWin);
|
235
|
-
if (i < 0) {
|
236
|
-
this.style.left = "0px"
|
237
|
-
}
|
238
|
-
if (i + this.clientWidth > g.clientWidth) {
|
239
|
-
this.style.left = g.clientWidth - this.clientWidth + "px"
|
240
|
-
}
|
241
|
-
if (c.fixedPosition) {
|
242
|
-
if (h < 0) {
|
243
|
-
this.style.top = "0px"
|
244
|
-
}
|
245
|
-
if (h + 33 > g.clientHeight) {
|
246
|
-
this.style.top = g.clientHeight - 33 + "px"
|
247
|
-
}
|
248
|
-
} else {
|
249
|
-
if (h < g.scrollTop) {
|
250
|
-
this.style.top = g.scrollTop + "px"
|
251
|
-
}
|
252
|
-
if (h + 33 > g.scrollTop + g.clientHeight) {
|
253
|
-
this.style.top = g.scrollTop + g.clientHeight - 33 + "px"
|
254
|
-
}
|
255
|
-
}
|
256
|
-
}
|
257
|
-
}
|
258
|
-
};
|
259
|
-
Dialog.prototype.displacePath = function () {
|
260
|
-
if (this.URL.substr(0, 7) == "http://" || this.URL.substr(0, 1) == "/" || this.URL.substr(0, 11) == "javascript:") {
|
261
|
-
return this.URL
|
262
|
-
} else {
|
263
|
-
var a = this.URL;
|
264
|
-
var b = window.location.href;
|
265
|
-
b = b.substring(0, b.lastIndexOf("/"));
|
266
|
-
while (a.indexOf("../") >= 0) {
|
267
|
-
a = a.substring(3);
|
268
|
-
b = b.substring(0, b.lastIndexOf("/"))
|
269
|
-
}
|
270
|
-
return b + "/" + a
|
271
|
-
}
|
272
|
-
};
|
273
|
-
Dialog.prototype.setPosition = function () {
|
274
|
-
var d = $bodyDimensions(topWin);
|
275
|
-
var g = this.Top,
|
276
|
-
b = this.Left,
|
277
|
-
c = this.getDialogDiv();
|
278
|
-
if (typeof this.Top == "string" && this.Top.indexOf("%") != -1) {
|
279
|
-
var f = parseFloat(this.Top) * 0.01;
|
280
|
-
g = this.fixedPosition ? d.clientHeight * f - c.scrollHeight * f : d.clientHeight * f - c.scrollHeight * f + d.scrollTop
|
281
|
-
}
|
282
|
-
if (typeof this.Left == "string" && this.Left.indexOf("%") != -1) {
|
283
|
-
var a = parseFloat(this.Left) * 0.01;
|
284
|
-
b = ielt7 ? d.clientWidth * a - c.scrollWidth * a + d.scrollLeft : d.clientWidth * a - c.scrollWidth * a
|
285
|
-
}
|
286
|
-
if (c) {
|
287
|
-
c.style.top = Math.round(g) + "px";
|
288
|
-
c.style.left = Math.round(b) + "px"
|
289
|
-
}
|
290
|
-
};
|
291
|
-
Dialog.setBgDivSize = function () {
|
292
|
-
var a = $bodyDimensions(topWin);
|
293
|
-
if (Dialog.bgDiv) {
|
294
|
-
if (ielt7) {
|
295
|
-
Dialog.bgDiv.style.height = a.clientHeight + "px";
|
296
|
-
Dialog.bgDiv.style.top = a.scrollTop + "px";
|
297
|
-
Dialog.bgDiv.childNodes[0].style.display = "none";
|
298
|
-
Dialog.bgDiv.childNodes[0].style.display = ""
|
299
|
-
} else {
|
300
|
-
Dialog.bgDiv.style.height = a.scrollHeight + "px"
|
301
|
-
}
|
302
|
-
}
|
303
|
-
};
|
304
|
-
Dialog.resetPosition = function () {
|
305
|
-
Dialog.setBgDivSize();
|
306
|
-
for (var b = 0, a = topWin.Dialog._dialogArray.length; b < a; b++) {
|
307
|
-
topWin.Dialog._dialogArray[b].setPosition()
|
308
|
-
}
|
309
|
-
};
|
310
|
-
Dialog.prototype.create = function () {
|
311
|
-
var g = $bodyDimensions(topWin);
|
312
|
-
if (typeof (this.OKEvent) == "function") {
|
313
|
-
this.ShowButtonRow = true
|
314
|
-
}
|
315
|
-
if (!this.Width) {
|
316
|
-
this.Width = Math.round(g.clientWidth * 4 / 10)
|
317
|
-
}
|
318
|
-
if (!this.Height) {
|
319
|
-
this.Height = Math.round(this.Width / 2)
|
320
|
-
}
|
321
|
-
if (this.MessageTitle || this.Message) {
|
322
|
-
this.ShowMessageRow = true
|
323
|
-
}
|
324
|
-
var b = this.Width + 13 + 13;
|
325
|
-
var c = this.Height + 33 + 13 + (this.ShowButtonRow ? 40 : 0) + (this.ShowMessageRow ? 50 : 0);
|
326
|
-
if (b > g.clientWidth) {
|
327
|
-
this.Width = Math.round(g.clientWidth - 26)
|
328
|
-
}
|
329
|
-
if (c > g.clientHeight) {
|
330
|
-
this.Height = Math.round(g.clientHeight - 46 - (this.ShowButtonRow ? 40 : 0) - (this.ShowMessageRow ? 50 : 0))
|
331
|
-
}
|
332
|
-
var f = "";
|
333
|
-
if (this.Style == "normal") {
|
334
|
-
f = ' <table id="_DialogTable_{thisID}" width="' + (this.Width + 26) + '" cellspacing="0" cellpadding="0" border="0" style="font-size:12px; line-height:1.4;border-collapse: collapse;"> <tr id="_Draghandle_{thisID}" onselectstart="return false;" style="-moz-user-select: -moz-none; ' + (this.Drag ? "cursor: move;" : "") + '"> <td class="dialog_lt dialog_borderWidth"><div class="dialog_borderWidth"></div></td> <td class="dialog_ct" ><div class="dialog_title"><span id="_Title_{thisID}" class="' + (this.IconClass != "" ? this.IconClass : "") + '" style="float:left;' + (this.IconSrc != "" ? "background-repeat: no-repeat;background-position: 0 40%;padding-left:18px;display:inline-block;background-image:url(" + this.IconSrc + ")" : "") + '">' + this.Title + '</span><input type="button" class="dialog_trans_icon"/></div> <div id="_ButtonClose_{thisID}" onclick="fixProgress();Dialog.getInstance(\'{thisID}\').cancelButton.onclick.apply(Dialog.getInstance(\'{thisID}\').cancelButton,[]);" title="关闭" class="dialog_closebtn" onmouseout="this.className=\'dialog_closebtn\'" onmouseover="this.className=\'dialog_closebtn_over\'" style=" ' + (this.ShowCloseButton ? "" : "display:none;") + '"></div><div id="_ButtonMax_{thisID}" onclick="Dialog.getInstance(\'{thisID}\').max()" title="最大化" class="dialog_maxbtn" style="' + (this.ShowMaxButton ? "" : "display:none;") + '"></div><div id="_ButtonMin_{thisID}" onclick="Dialog.getInstance(\'{thisID}\').minHandler()" title="最小化" class="dialog_minbtn" style="' + (this.ShowMinButton ? "" : "display:none;") + '"></div></td> <td class="dialog_rt dialog_borderWidth"><div class="dialog_borderWidth"><a id="_forTab_{thisID}" href="#;"></a></div></td> </tr> <tr valign="top"> <td class="dialog_mlm dialog_borderWidth"></td> <td align="center"><table width="100%" cellspacing="0" cellpadding="0" border="0" bgcolor="#ffffff" style="background-color: #ffffff !important;"> <tr id="_MessageRow_{thisID}" style="' + (this.ShowMessageRow ? "" : "display:none") + '"> <td valign="top" height="50"><table width="100%" cellspacing="0" cellpadding="0" border="0" class="dialog_bg" id="_MessageTable_{thisID}" style="background-color: #ffffff !important;"> <tr> <td width="50" height="50" align="center"><input type="button" class="dialog_messageIcon" id="_MessageIcon_{thisID}"/></td> <td align="left" style="line-height: 16px;"><div id="_MessageTitle_{thisID}" style="font-weight:bold">' + this.MessageTitle + '</div> <div id="_Message_{thisID}">' + this.Message + '</div></td> </tr> </table></td> </tr> <tr> <td valign="top"><div id="_Container_{thisID}" style="text-align:left;position: relative; width: ' + this.Width + "px; height: " + this.Height + 'px;"> <div style="position: absolute; height: 100%; width: 100%; display: none; background-color:#fff; opacity: 0.5;" id="_Covering_{thisID}"> </div> ' + (function (k) {
|
335
|
-
if (k.InnerHtml) {
|
336
|
-
return k.InnerHtml
|
337
|
-
}
|
338
|
-
if (k.URL) {
|
339
|
-
return '<iframe width="100%" height="100%" frameborder="0" style="background-color:#ffffff;border:none 0;" id="_DialogFrame_' + k.ID + '" ' + (k.InnerFrameName ? 'name="' + k.InnerFrameName + '"' : "") + ' src="' + k.displacePath() + '"></iframe>'
|
340
|
-
}
|
341
|
-
return ""
|
342
|
-
})(this) + ' </div></td> </tr> <tr id="_ButtonRow_{thisID}" style="' + (this.ShowButtonRow ? "" : "display:none") + '"> <td height="36"><div id="_DialogButtons_{thisID}" style="text-align:' + this.ButtonAlign + '; border-top: 1px solid #DADEE5; padding: 8px 20px;background-color:#f6f6f6;"> <input type="button" style="' + (this.ShowOkButton ? "" : "display:none") + '" value="' + this.OkButtonText + '" id="_ButtonOK_{thisID}"/> <input type="button" style="' + (this.ShowCancelButton ? "" : "display:none") + '" value="' + this.CancelButtonText + '" onclick="Dialog.getInstance(\'{thisID}\').close();" id="_ButtonCancel_{thisID}"/> </div></td> </tr> </table></td> <td class="dialog_mrm dialog_borderWidth"></td> </tr> <tr> <td class="dialog_lb dialog_borderWidth"></td> <td class="dialog_cb"></td> <td class="dialog_rb dialog_borderWidth"><a onfocus=\'$id("_forTab_{thisID}").focus();\' href="#;"></a></td> </tr> </table></div>'
|
343
|
-
} else {
|
344
|
-
if (this.Style == "simple") {
|
345
|
-
f = ' <table id="_DialogTable_{thisID}" width="' + (this.Width + 26) + '" cellspacing="0" cellpadding="0" border="0" style="font-size:12px; line-height:1.4;border-collapse: collapse;"> <tr id="_Draghandle_{thisID}" onselectstart="return false;" style="-moz-user-select: -moz-none; ' + (this.Drag ? "cursor: move;" : "") + '"> <td ><div class="dialog_sample_top"><div style="padding: 9px 0 0 4px; float: left; "><span id="_Title_{thisID}">' + this.Title + '</span></div> <div id="_ButtonClose_{thisID}" onclick="fixProgress();Dialog.getInstance(\'{thisID}\').cancelButton.onclick.apply(Dialog.getInstance(\'{thisID}\').cancelButton,[]);" class="dialog__simple_closebtn" style=" ' + (ielt7 ? "margin-top: 3px;" : "") + (this.ShowCloseButton ? "" : "display:none;") + '"></div></div></td> </tr> <tr valign="top"> <td align="center"><div class="dialog_sample_middle"><table width="100%" cellspacing="0" cellpadding="0" border="0" bgcolor="#ffffff" style="background-color: #ffffff !important;"> <tr id="_MessageRow_{thisID}" style="' + (this.ShowMessageRow ? "" : "display:none") + '"> <td valign="top" height="50"><table width="100%" cellspacing="0" cellpadding="0" border="0" class="dialog_bg" id="_MessageTable_{thisID}"> <tr> <td width="50" height="50" align="center"><input type="button" class="dialog_messageIcon" id="_MessageIcon_{thisID}"/></td> <td align="left" style="line-height: 16px;"><div id="_MessageTitle_{thisID}" style="font-weight:bold">' + this.MessageTitle + '</div> <div id="_Message_{thisID}">' + this.Message + '</div></td> </tr> </table></td> </tr> <tr> <td valign="top"><div id="_Container_{thisID}" style="text-align:left;position: relative; width: ' + this.Width + "px; height: " + this.Height + 'px;"> <div style="position: absolute; height: 100%; width: 100%; display: none; background-color:#fff; opacity: 0.5;" id="_Covering_{thisID}"> </div> ' + (function (k) {
|
346
|
-
if (k.InnerHtml) {
|
347
|
-
return k.InnerHtml
|
348
|
-
}
|
349
|
-
if (k.URL) {
|
350
|
-
return '<iframe width="100%" height="100%" frameborder="0" style="background-color:#ffffff;border:none 0;" id="_DialogFrame_' + k.ID + '" ' + (k.InnerFrameName ? 'name="' + k.InnerFrameName + '"' : "") + ' src="' + k.displacePath() + '"></iframe>'
|
351
|
-
}
|
352
|
-
return ""
|
353
|
-
})(this) + ' </div></td> </tr> <tr id="_ButtonRow_{thisID}" style="' + (this.ShowButtonRow ? "" : "display:none") + '"> <td height="36"><div id="_DialogButtons_{thisID}" style="border-top: 1px solid #DADEE5; padding: 8px 20px; text-align: right; background-color:#f6f6f6;"> <input type="button" style="' + (this.ShowOkButton ? "" : "display:none") + '" value="' + this.OkButtonText + '" id="_ButtonOK_{thisID}"/> <input type="button" style="' + (this.ShowCancelButton ? "" : "display:none") + '" value="' + this.CancelButtonText + '" onclick="Dialog.getInstance(\'{thisID}\').close();" id="_ButtonCancel_{thisID}"/> </div></td> </tr> </table></div></td> </tr> </table></div>'
|
354
|
-
} else {
|
355
|
-
if (this.Style == "simpleTip") {
|
356
|
-
f = ' <table id="_DialogTable_{thisID}" width="' + (this.Width + 26) + '" cellspacing="0" cellpadding="0" border="0" style="font-size:12px; line-height:1.4;border-collapse: collapse;"> <tr id="_Draghandle_{thisID}" onselectstart="return false;" style="-moz-user-select: -moz-none; ' + (this.Drag ? "cursor: move;" : "") + '"> <td ><div class="dialog_sample_top"><div style="padding: 9px 0 0 4px; float: left; "><span id="_Title_{thisID}">' + this.Title + '</span></div> <div id="_ButtonClose_{thisID}" onclick="fixProgress();Dialog.getInstance(\'{thisID}\').cancelButton.onclick.apply(Dialog.getInstance(\'{thisID}\').cancelButton,[]);" class="dialog__simple_closebtn" style=" ' + (ielt7 ? "margin-top: 3px;" : "") + (this.ShowCloseButton ? "" : "display:none;") + '"></div></div></td> </tr> <tr valign="top"> <td align="center"><div class="dialog_tip_middle"><table width="100%" cellspacing="0" cellpadding="0" border="0" bgcolor="#ffffff" style="background-color: #ffffff !important;"> <tr id="_MessageRow_{thisID}" style="' + (this.ShowMessageRow ? "" : "display:none") + '"> <td valign="top" height="50"><table width="100%" cellspacing="0" cellpadding="0" border="0" class="dialog_bg" id="_MessageTable_{thisID}"> <tr> <td width="50" height="50" align="center"><input type="button" class="dialog_messageIcon" id="_MessageIcon_{thisID}"/></td> <td align="left" style="line-height: 16px;"><div id="_MessageTitle_{thisID}" style="font-weight:bold">' + this.MessageTitle + '</div> <div id="_Message_{thisID}">' + this.Message + '</div></td> </tr> </table></td> </tr> <tr> <td valign="top"><div id="_Container_{thisID}" style="text-align:left;position: relative; width: ' + this.Width + "px; height: " + this.Height + 'px;"> <div style="position: absolute; height: 100%; width: 100%; display: none; background-color:#fff; opacity: 0.5;" id="_Covering_{thisID}"> </div> ' + (function (k) {
|
357
|
-
if (k.InnerHtml) {
|
358
|
-
return k.InnerHtml
|
359
|
-
}
|
360
|
-
if (k.URL) {
|
361
|
-
return '<iframe width="100%" height="100%" frameborder="0" style="background-color:#ffffff;border:none 0;" id="_DialogFrame_' + k.ID + '" ' + (k.InnerFrameName ? 'name="' + k.InnerFrameName + '"' : "") + ' src="' + k.displacePath() + '"></iframe>'
|
362
|
-
}
|
363
|
-
return ""
|
364
|
-
})(this) + ' </div></td> </tr> <tr id="_ButtonRow_{thisID}" style="' + (this.ShowButtonRow ? "" : "display:none") + '"> <td height="36"><div id="_DialogButtons_{thisID}" style="border-top: 1px solid #DADEE5; padding: 8px 20px; text-align: right; background-color:#f6f6f6;"> <input type="button" style="' + (this.ShowOkButton ? "" : "display:none") + '" value="' + this.OkButtonText + '" id="_ButtonOK_{thisID}"/> <input type="button" style="' + (this.ShowCancelButton ? "" : "display:none") + '" value="' + this.CancelButtonText + '" onclick="Dialog.getInstance(\'{thisID}\').close();" id="_ButtonCancel_{thisID}"/> </div></td> </tr> </table></div></td> </tr> <tr> <td><div class="dialog_tip_bottom"><div class="dialog_tip_bottomArr"></div></div></td> </tr> </table></div>'
|
365
|
-
} else {
|
366
|
-
if (this.Style == "shadowTip") {
|
367
|
-
var i = this.Height + 95;
|
368
|
-
f = ' <table><tr><td><div class="dialog_shadow_content"><table id="_DialogTable_{thisID}" width="' + (this.Width) + '" cellspacing="0" cellpadding="0" border="0" style="font-size:12px; line-height:1.4;border-collapse: collapse;background-color: #ffffff !important;"> <tr id="_Draghandle_{thisID}" onselectstart="return false;" style="-moz-user-select: -moz-none; ' + (this.Drag ? "cursor: move;" : "") + '"> <td><div class="dialog_shadow_content_top"><div style="padding: 9px 0 0 4px; float: left; "><span id="_Title_{thisID}">' + this.Title + '</span></div> <div id="_ButtonClose_{thisID}" onclick="fixProgress();Dialog.getInstance(\'{thisID}\').cancelButton.onclick.apply(Dialog.getInstance(\'{thisID}\').cancelButton,[]);" class="dialog__simple_closebtn" style=" ' + (ielt7 ? "margin-top: 3px;" : "") + (this.ShowCloseButton ? "" : "display:none;") + '"></div></div></td> </tr> <tr valign="top"> <td align="center"><table width="100%" cellspacing="0" cellpadding="0" border="0" bgcolor="#ffffff" style="background-color: #ffffff !important;"> <tr id="_MessageRow_{thisID}" style="' + (this.ShowMessageRow ? "" : "display:none") + '"> <td valign="top" height="50"><table width="100%" cellspacing="0" cellpadding="0" border="0" class="dialog_bg" id="_MessageTable_{thisID}"> <tr> <td width="50" height="50" align="center"><input type="button" class="dialog_messageIcon" id="_MessageIcon_{thisID}"/></td> <td align="left" style="line-height: 16px;"><div id="_MessageTitle_{thisID}" style="font-weight:bold">' + this.MessageTitle + '</div> <div id="_Message_{thisID}">' + this.Message + '</div></td> </tr> </table></td> </tr> <tr> <td valign="top"><div id="_Container_{thisID}" style="text-align:left;position: relative; width: ' + (this.Width) + "px; height: " + this.Height + 'px;background:#ffffff"> <div style="position: absolute; height: 100%; width: 100%; display: none; background-color:#fff; opacity: 0.5;" id="_Covering_{thisID}"> </div> ' + (function (k) {
|
369
|
-
if (k.InnerHtml) {
|
370
|
-
return k.InnerHtml
|
371
|
-
}
|
372
|
-
if (k.URL) {
|
373
|
-
return '<iframe width="100%" height="100%" frameborder="0" style="background-color:#ffffff;border:none 0;" id="_DialogFrame_' + k.ID + '" ' + (k.InnerFrameName ? 'name="' + k.InnerFrameName + '"' : "") + ' src="' + k.displacePath() + '"></iframe>'
|
374
|
-
}
|
375
|
-
return ""
|
376
|
-
})(this) + ' </div></td> </tr> <tr id="_ButtonRow_{thisID}" style="' + (this.ShowButtonRow ? "" : "display:none") + '"> <td height="36"><div id="_DialogButtons_{thisID}" style="border-top: 1px solid #DADEE5; padding: 8px 20px; text-align: right; background-color:#f6f6f6;"> <input type="button" style="' + (this.ShowOkButton ? "" : "display:none") + '" value="' + this.OkButtonText + '" id="_ButtonOK_{thisID}"/> <input type="button" style="' + (this.ShowCancelButton ? "" : "display:none") + '" value="' + this.CancelButtonText + '" onclick="Dialog.getInstance(\'{thisID}\').close();" id="_ButtonCancel_{thisID}"/> </div></td> </tr> </table></td> </tr> </table> </div><div><table cellpadding="0" cellspacing="0" width="' + (this.Width + 120) + '" height="' + i + '"><tr><td class="dialog_shadow_lt"> </td><td class="dialog_shadow_ct"> </td><td class="dialog_shadow_rt"> </td></tr> <tr><td class="dialog_shadow_lm" height="' + (this.Height + 95 - 39 - 130) + '"> </td><td class="dialog_shadow_cm"> </td><td class="dialog_shadow_rm"> </td></tr> <tr><td class="dialog_shadow_lb"> </td><td class="dialog_shadow_cb"> </td><td class="dialog_shadow_rb"> </td></tr></table> </div></td></tr></table></div>'
|
377
|
-
} else {
|
378
|
-
if (this.Style == "custom") {
|
379
|
-
f = ' <table id="_DialogTable_{thisID}" width="' + (this.Width + 26) + '" cellspacing="0" cellpadding="0" border="0" style="font-size:12px; line-height:1.4;border-collapse: collapse;""> <tr id="_Draghandle_{thisID}" style="display:none;" onselectstart="return false;" style="-moz-user-select: -moz-none; ' + (this.Drag ? "cursor: move;" : "") + '"> </tr> <tr> <td valign="top"><div id="_Container_{thisID}" style="text-align:left;position: relative; width: ' + this.Width + "px; height: " + this.Height + 'px;background: #ffffff"> <div style="position: absolute; height: 100%; width: 100%; display: none; background-color:#fff; opacity: 0.5;" id="_Covering_{thisID}"> </div> ' + (function (k) {
|
380
|
-
if (k.InnerHtml) {
|
381
|
-
return k.InnerHtml
|
382
|
-
}
|
383
|
-
if (k.URL) {
|
384
|
-
return '<iframe width="100%" height="100%" frameborder="0" style="border:none 0;" id="_DialogFrame_' + k.ID + '" ' + (k.InnerFrameName ? 'name="' + k.InnerFrameName + '"' : "") + ' src="' + k.displacePath() + '"></iframe>'
|
385
|
-
}
|
386
|
-
return ""
|
387
|
-
})(this) + ' </div></td> </tr> <tr id="_ButtonRow_{thisID}" style="display:none;" > <td height="36"><div id="_DialogButtons_{thisID}" style="border-top: 1px solid #DADEE5; padding: 8px 20px; text-align: right; background-color:#f6f6f6;"> <input type="button" style="' + (this.ShowOkButton ? "" : "display:none") + '" value="' + this.OkButtonText + '" id="_ButtonOK_{thisID}"/> <input type="button" style="' + (this.ShowCancelButton ? "" : "display:none") + '" value="' + this.CancelButtonText + '" onclick="Dialog.getInstance(\'{thisID}\').close();" id="_ButtonCancel_{thisID}"/> </div></td> </tr> </table></div></td> </tr> </table></div>'
|
388
|
-
}
|
389
|
-
}
|
390
|
-
}
|
391
|
-
}
|
392
|
-
}
|
393
|
-
f = f.replace(/\{IMAGESPATH\}/gm, IMAGESPATH).replace(/\{thisID\}/gm, this.ID);
|
394
|
-
var a = topWin.$id("_DialogDiv_" + this.ID);
|
395
|
-
if (!a) {
|
396
|
-
a = topDoc.createElement("div");
|
397
|
-
a.id = "_DialogDiv_" + this.ID;
|
398
|
-
topDoc.getElementsByTagName("BODY")[0].appendChild(a)
|
399
|
-
}
|
400
|
-
if (isIE && topDoc.compatMode == "BackCompat" || ielt7) {
|
401
|
-
a.style.position = "absolute";
|
402
|
-
this.fixedPosition = false
|
403
|
-
} else {
|
404
|
-
a.style.position = "fixed";
|
405
|
-
this.fixedPosition = true
|
406
|
-
}
|
407
|
-
a.style.left = "-9999px";
|
408
|
-
a.style.top = "-9999px";
|
409
|
-
a.innerHTML = f;
|
410
|
-
$(a).attr("AllowChangeIndex", this.AllowChangeIndex);
|
411
|
-
$(a).attr("MinToTask", this.MinToTask);
|
412
|
-
$(a).attr("taskId", "task_" + this.ID);
|
413
|
-
$(a).bind("click", function () {
|
414
|
-
if ($(this).attr("AllowChangeIndex") == true || $(this).attr("AllowChangeIndex") == "true") {
|
415
|
-
maxIndex = maxIndex + topWin.Dialog._dialogArray.length + 2;
|
416
|
-
$(this)[0].style.zIndex = maxIndex;
|
417
|
-
if ($(this).attr("MinToTask") == true || $(this).attr("MinToTask") == "true") {
|
418
|
-
var l = topWin.Dialog._taskArray;
|
419
|
-
var k = getArrayPosition($(this).attr("taskId"), l);
|
420
|
-
if (k != -1) {
|
421
|
-
l.splice(k, 1);
|
422
|
-
l.push($(this).attr("taskId"))
|
423
|
-
}
|
424
|
-
var n = getTaskTarget();
|
425
|
-
if (n != "") {
|
426
|
-
var m = $("#" + n);
|
427
|
-
setTaskCurrent(m, l)
|
428
|
-
}
|
429
|
-
}
|
430
|
-
}
|
431
|
-
});
|
432
|
-
if (this.InvokeElementId) {
|
433
|
-
var d = $id(this.InvokeElementId);
|
434
|
-
d.style.position = "";
|
435
|
-
d.style.display = "";
|
436
|
-
if (isIE) {
|
437
|
-
var h = topDoc.createElement("div");
|
438
|
-
h.innerHTML = d.outerHTML;
|
439
|
-
d.outerHTML = "";
|
440
|
-
topWin.$id("_Covering_" + this.ID).parentNode.appendChild(h)
|
441
|
-
} else {
|
442
|
-
topWin.$id("_Covering_" + this.ID).parentNode.appendChild(d)
|
443
|
-
}
|
444
|
-
}
|
445
|
-
this.openerWindow = window;
|
446
|
-
if (window.ownerDialog) {
|
447
|
-
this.openerDialog = window.ownerDialog
|
448
|
-
}
|
449
|
-
if (this.URL) {
|
450
|
-
if (topWin.$id("_DialogFrame_" + this.ID)) {
|
451
|
-
this.innerFrame = topWin.$id("_DialogFrame_" + this.ID)
|
452
|
-
}
|
453
|
-
var j = this;
|
454
|
-
this.innerFrameOnload = function () {
|
455
|
-
j.innerWin = j.innerFrame.contentWindow;
|
456
|
-
try {
|
457
|
-
j.innerWin.ownerDialog = j;
|
458
|
-
j.innerDoc = j.innerWin.document;
|
459
|
-
if (j.Title == " " && j.innerDoc && j.innerDoc.title) {
|
460
|
-
if (j.innerDoc.title) {
|
461
|
-
topWin.$id("_Title_" + j.ID).innerHTML = j.innerDoc.title
|
462
|
-
}
|
463
|
-
}
|
464
|
-
} catch (k) {
|
465
|
-
if (window.console && window.console.log) {
|
466
|
-
console.log("可能存在访问限制,不能获取到浮动窗口中的文档对象。")
|
467
|
-
}
|
468
|
-
j.unauthorized = true
|
469
|
-
}
|
470
|
-
if (typeof (j.OnLoad) == "function") {
|
471
|
-
j.OnLoad()
|
472
|
-
}
|
473
|
-
};
|
474
|
-
if (!isGecko) {
|
475
|
-
this.innerFrame.attachEvent("onreadystatechange", function () {
|
476
|
-
if ((/loaded|complete/).test(j.innerFrame.readyState)) {
|
477
|
-
j.innerFrameOnload()
|
478
|
-
}
|
479
|
-
})
|
480
|
-
} else {
|
481
|
-
this.innerFrame.onload = j.innerFrameOnload
|
482
|
-
}
|
483
|
-
}
|
484
|
-
topWin.$id("_DialogDiv_" + this.ID).dialogId = this.ID;
|
485
|
-
topWin.$id("_DialogDiv_" + this.ID).dialogInstance = this;
|
486
|
-
this.attachBehaviors();
|
487
|
-
this.okButton = topWin.$id("_ButtonOK_" + this.ID);
|
488
|
-
this.cancelButton = topWin.$id("_ButtonCancel_" + this.ID);
|
489
|
-
this.maxButton = topWin.$id("_ButtonMax_" + this.ID);
|
490
|
-
this.minButton = topWin.$id("_ButtonMin_" + this.ID);
|
491
|
-
$(a).find("input[type='button']").each(function () {
|
492
|
-
if (!$(this).attr("class")) {
|
493
|
-
$(this).addClass("button");
|
494
|
-
$(this).hover(function () {
|
495
|
-
$(this).addClass("button_hover")
|
496
|
-
}, function () {
|
497
|
-
$(this).removeClass("button_hover")
|
498
|
-
})
|
499
|
-
}
|
500
|
-
});
|
501
|
-
if ($(a).find(".progressBar").length == 0) {
|
502
|
-
if ($(a).find(".button").parents("tr")[0].style.display == "none") {
|
503
|
-
$(a).find(".icon_dialog").eq(0).focus()
|
504
|
-
} else {
|
505
|
-
$(a).find(".button").eq(0).focus()
|
506
|
-
}
|
507
|
-
}
|
508
|
-
a = null
|
509
|
-
};
|
510
|
-
Dialog.prototype.setSize = function (a, b) {
|
511
|
-
if (a && +a > 20) {
|
512
|
-
this.Width = +a;
|
513
|
-
topWin.$id("_DialogTable_" + this.ID).width = this.Width + 26;
|
514
|
-
topWin.$id("_Container_" + this.ID).style.width = this.Width + "px"
|
515
|
-
}
|
516
|
-
if (b && +b > 10) {
|
517
|
-
this.Height = +b;
|
518
|
-
topWin.$id("_Container_" + this.ID).style.height = this.Height + "px"
|
519
|
-
}
|
520
|
-
this.setPosition()
|
521
|
-
};
|
522
|
-
Dialog.prototype.max = function () {
|
523
|
-
var d = $("#_DialogDiv_" + this.ID);
|
524
|
-
var c = $("#_DialogTable_" + this.ID).find(">tbody").find(">tr").eq(1);
|
525
|
-
if (c[0].style.display == "none") {
|
526
|
-
c.show();
|
527
|
-
$("#_Draghandle_" + this.ID).find(".dialog_minbtn").removeClass("dialog_decreasebtn");
|
528
|
-
$("#_Draghandle_" + this.ID).find(".dialog_minbtn").attr("title", "最小化")
|
529
|
-
}
|
530
|
-
if (this.maxFlag == true) {
|
531
|
-
topWin.$id("_DialogTable_" + this.ID).style.width = this.Width + 26;
|
532
|
-
topWin.$id("_Container_" + this.ID).style.width = this.Width + "px";
|
533
|
-
topWin.$id("_Container_" + this.ID).style.height = this.Height + "px";
|
534
|
-
$("#_Draghandle_" + this.ID).find(".dialog_maxbtn").removeClass("dialog_decreasebtn");
|
535
|
-
$("#_Draghandle_" + this.ID).find(".dialog_maxbtn").attr("title", "最大化");
|
536
|
-
this.maxFlag = false;
|
537
|
-
if (this.DecreaseResetPosition) {
|
538
|
-
this.setPosition()
|
539
|
-
} else {
|
540
|
-
d[0].style.left = d.attr("oldleft");
|
541
|
-
d[0].style.top = d.attr("oldtop")
|
542
|
-
}
|
543
|
-
} else {
|
544
|
-
d.attr("oldleft", d[0].style.left);
|
545
|
-
d.attr("oldtop", d[0].style.top);
|
546
|
-
var b = window.document.documentElement.clientHeight;
|
547
|
-
var a = window.document.documentElement.clientWidth;
|
548
|
-
topWin.$id("_DialogTable_" + this.ID).style.width = a;
|
549
|
-
topWin.$id("_Container_" + this.ID).style.width = a - 26 + "px";
|
550
|
-
if ($("#_ButtonRow_" + this.ID)[0].style.display == "none") {
|
551
|
-
topWin.$id("_Container_" + this.ID).style.height = b - 46 + "px"
|
552
|
-
} else {
|
553
|
-
topWin.$id("_Container_" + this.ID).style.height = b - 46 - $("#_ButtonRow_" + this.ID).height() + "px"
|
554
|
-
}
|
555
|
-
$("#_Draghandle_" + this.ID).find(".dialog_maxbtn").addClass("dialog_decreasebtn");
|
556
|
-
$("#_Draghandle_" + this.ID).find(".dialog_maxbtn").attr("title", "还原");
|
557
|
-
if (this.MinToTask == true || this.MinToTask == "true") {
|
558
|
-
this.Left = 0;
|
559
|
-
this.Top = 0
|
560
|
-
}
|
561
|
-
this.maxFlag = true;
|
562
|
-
this.setPosition()
|
563
|
-
}
|
564
|
-
};
|
565
|
-
Dialog.prototype.minHandler = function () {
|
566
|
-
if (this.MinToTask == true || this.MinToTask == "true") {
|
567
|
-
this.minToTask()
|
568
|
-
} else {
|
569
|
-
this.min()
|
570
|
-
}
|
571
|
-
};
|
572
|
-
Dialog.prototype.min = function () {
|
573
|
-
var a = $("#_DialogTable_" + this.ID).find(">tbody").find(">tr").eq(1);
|
574
|
-
if (a[0].style.display == "none") {
|
575
|
-
topWin.$id("_DialogTable_" + this.ID).width = this.Width + 26;
|
576
|
-
topWin.$id("_Container_" + this.ID).style.width = this.Width + "px";
|
577
|
-
topWin.$id("_Container_" + this.ID).style.height = this.Height + "px";
|
578
|
-
$("#_Draghandle_" + this.ID).find(".dialog_minbtn").removeClass("dialog_decreasebtn");
|
579
|
-
$("#_Draghandle_" + this.ID).find(".dialog_minbtn").attr("title", "最小化");
|
580
|
-
a.show();
|
581
|
-
if (this.DecreaseResetPosition) {
|
582
|
-
this.setPosition()
|
583
|
-
}
|
584
|
-
this.minFlag = false
|
585
|
-
} else {
|
586
|
-
topWin.$id("_DialogTable_" + this.ID).style.width = 200 + 26 + "px";
|
587
|
-
topWin.$id("_Container_" + this.ID).style.width = 200 + "px";
|
588
|
-
$("#_Draghandle_" + this.ID).find(".dialog_minbtn").addClass("dialog_decreasebtn");
|
589
|
-
$("#_Draghandle_" + this.ID).find(".dialog_minbtn").attr("title", "还原");
|
590
|
-
a.hide();
|
591
|
-
this.minFlag = true
|
592
|
-
}
|
593
|
-
this.maxFlag = false
|
594
|
-
};
|
595
|
-
Dialog.prototype.minToTask = function () {
|
596
|
-
var c = $("#_DialogDiv_" + this.ID);
|
597
|
-
var i = getTaskTarget();
|
598
|
-
var g = this.ID;
|
599
|
-
if (i != "") {
|
600
|
-
var f = $("#" + i);
|
601
|
-
var j = c[0].style.left;
|
602
|
-
var b = c[0].style.top;
|
603
|
-
var d = c.width();
|
604
|
-
var h = c.height();
|
605
|
-
var a = $('<div class="dialogMinEffect"/>');
|
606
|
-
a.css({
|
607
|
-
width: d,
|
608
|
-
height: h,
|
609
|
-
left: j,
|
610
|
-
top: b
|
611
|
-
}).animate({
|
612
|
-
width: 0,
|
613
|
-
height: 0,
|
614
|
-
left: f.find("#task_" + this.ID).offset().left + "px",
|
615
|
-
top: top.window.document.documentElement.clientHeight + "px",
|
616
|
-
opacity: 0
|
617
|
-
}, 200, function () {
|
618
|
-
a.remove();
|
619
|
-
var l = topWin.Dialog._taskArray;
|
620
|
-
var k = getArrayPosition("task_" + g, l);
|
621
|
-
if (k != -1) {
|
622
|
-
l.splice(k, 1)
|
623
|
-
}
|
624
|
-
setTaskCurrent(f, l)
|
625
|
-
})
|
626
|
-
}
|
627
|
-
c.hide();
|
628
|
-
$("body").append(a)
|
629
|
-
};
|
630
|
-
Dialog.prototype.show = function () {
|
631
|
-
var j = topWin.$id("_DialogDiv_" + this.ID);
|
632
|
-
if (j) {
|
633
|
-
maxIndex = maxIndex + topWin.Dialog._dialogArray.length + 2;
|
634
|
-
$(j)[0].style.zIndex = maxIndex;
|
635
|
-
if (this.MinToTask == true || this.MinToTask == "true") {
|
636
|
-
var f = topWin.Dialog._taskArray;
|
637
|
-
var u = $(j)[0].style.left;
|
638
|
-
var d = $(j)[0].style.top;
|
639
|
-
var i = $(j).width();
|
640
|
-
var t = $(j).height();
|
641
|
-
var s = $('<div class="dialogMinEffect"/>');
|
642
|
-
var c = getArrayPosition("task_" + this.ID, f);
|
643
|
-
if (c != -1) {
|
644
|
-
f.splice(c, 1);
|
645
|
-
f.push("task_" + this.ID)
|
646
|
-
} else {
|
647
|
-
f.push("task_" + this.ID)
|
648
|
-
}
|
649
|
-
var o = getTaskTarget();
|
650
|
-
var p;
|
651
|
-
if (o != "") {
|
652
|
-
p = $("#" + o);
|
653
|
-
setTaskCurrent(p, f)
|
654
|
-
}
|
655
|
-
if ($(j)[0].style.display == "none") {
|
656
|
-
s.css({
|
657
|
-
width: 0,
|
658
|
-
height: 0,
|
659
|
-
left: p.find("#task_" + this.ID).offset().left + "px",
|
660
|
-
top: top.window.document.documentElement.clientHeight + "px"
|
661
|
-
}).animate({
|
662
|
-
width: i,
|
663
|
-
height: t,
|
664
|
-
left: u,
|
665
|
-
top: d
|
666
|
-
}, 200, function () {
|
667
|
-
$(j).show();
|
668
|
-
s.remove()
|
669
|
-
});
|
670
|
-
$("body").append(s)
|
671
|
-
} else {
|
672
|
-
if (this.ID != f[f.length - 1]) {}
|
673
|
-
}
|
674
|
-
}
|
675
|
-
return
|
676
|
-
}
|
677
|
-
this.create();
|
678
|
-
var g = this.getBgdiv(),
|
679
|
-
r = this.getDialogDiv();
|
680
|
-
r.style.zIndex = this.zindex = parseInt(Dialog.bgDiv.style.zIndex) + 1;
|
681
|
-
if (topWin.Dialog._dialogArray.length > 0) {
|
682
|
-
maxIndex = maxIndex + topWin.Dialog._dialogArray.length + 2;
|
683
|
-
r.style.zIndex = maxIndex
|
684
|
-
} else {
|
685
|
-
g.style.display = "none";
|
686
|
-
if (HideScrollbar) {
|
687
|
-
var k = topDoc.getElementsByTagName(topDoc.compatMode == "BackCompat" ? "BODY" : "HTML")[0];
|
688
|
-
k.styleOverflow = k.style.overflow;
|
689
|
-
if (window.navigator.userAgent.indexOf("Firefox/3.6") != -1) {
|
690
|
-
var v = k.scrollTop;
|
691
|
-
k.style.overflow = "hidden";
|
692
|
-
k.scrollTop = v
|
693
|
-
} else {
|
694
|
-
k.style.overflow = "hidden"
|
695
|
-
}
|
696
|
-
}
|
697
|
-
}
|
698
|
-
topWin.Dialog._dialogArray.push(this);
|
699
|
-
Dialog._childDialogArray.push(this);
|
700
|
-
if (Dialog._childDialogArray.length == 1) {
|
701
|
-
if (window.ownerDialog) {
|
702
|
-
ownerDialog.hiddenCloseButton()
|
703
|
-
}
|
704
|
-
}
|
705
|
-
if (this.CancelEvent) {
|
706
|
-
this.cancelButton.onclick = this.CancelEvent
|
707
|
-
}
|
708
|
-
var q = this;
|
709
|
-
if (this.OKEvent) {
|
710
|
-
this.okButton.onclick = this.OKEvent
|
711
|
-
}
|
712
|
-
if (this.maxButton) {
|
713
|
-
this.maxButton.onclick = function () {
|
714
|
-
if (q.maxFlag) {
|
715
|
-
if (q.DecreaseEvent) {
|
716
|
-
$(q.DecreaseEvent)
|
717
|
-
}
|
718
|
-
} else {
|
719
|
-
if (q.MaxEvent) {
|
720
|
-
$(q.MaxEvent)
|
721
|
-
}
|
722
|
-
}
|
723
|
-
q.max()
|
724
|
-
}
|
725
|
-
}
|
726
|
-
if (this.minButton) {
|
727
|
-
this.minButton.onclick = function () {
|
728
|
-
if (q.minFlag) {
|
729
|
-
if (q.DecreaseEvent) {
|
730
|
-
$(q.DecreaseEvent)
|
731
|
-
}
|
732
|
-
} else {
|
733
|
-
if (q.MinEvent) {
|
734
|
-
$(q.MinEvent)
|
735
|
-
}
|
736
|
-
}
|
737
|
-
q.minHandler()
|
738
|
-
}
|
739
|
-
}
|
740
|
-
if (this.AutoClose && this.AutoClose > 0) {
|
741
|
-
this.autoClose()
|
742
|
-
}
|
743
|
-
this.opened = true;
|
744
|
-
this.setPosition();
|
745
|
-
if (this.MinToTask == true || this.MinToTask == "true") {
|
746
|
-
this.Modal = false;
|
747
|
-
this.ResizeResetPosition = false;
|
748
|
-
this.DecreaseResetPosition = false;
|
749
|
-
this.AllowChangeIndex = true;
|
750
|
-
var l = $("#_DialogDiv_" + this.ID);
|
751
|
-
var b = getTaskTarget();
|
752
|
-
if (b != "") {
|
753
|
-
var n = $("#" + b);
|
754
|
-
if (n[0]) {
|
755
|
-
if (n[0].style.display == "none") {
|
756
|
-
n.fadeIn(500);
|
757
|
-
$("body").trigger("dialogTaskShow")
|
758
|
-
}
|
759
|
-
}
|
760
|
-
var a = $('<a class="dialogTaskItem"><span keepDefaultStyle="true" class="dialogTaskItemRight"><span class="dialogTaskItemIcon"></span></span></a>');
|
761
|
-
a.attr("id", "task_" + this.ID);
|
762
|
-
var m = a.find(".dialogTaskItemIcon");
|
763
|
-
m.text(this.Title);
|
764
|
-
m.attr("title", this.Title);
|
765
|
-
if (this.IconSrc != "") {
|
766
|
-
m.css({
|
767
|
-
paddingLeft: "18px",
|
768
|
-
backgroundPositon: "0 40%",
|
769
|
-
backgroundRepeat: "no-repeat",
|
770
|
-
backgroundImage: "url(" + this.IconSrc + ")"
|
771
|
-
})
|
772
|
-
} else {
|
773
|
-
if (this.IconClass != "") {
|
774
|
-
m.addClass(this.IconClass)
|
775
|
-
}
|
776
|
-
}
|
777
|
-
n.find(".taskItemContainer").append(a);
|
778
|
-
itemTotalWidth = itemTotalWidth + a.width() + 8;
|
779
|
-
resetDialogTask();
|
780
|
-
var h = topWin.Dialog._taskArray;
|
781
|
-
if (getArrayPosition("task_" + this.ID, h) == -1) {
|
782
|
-
h.push("task_" + this.ID)
|
783
|
-
}
|
784
|
-
this.Left = l.offset().left + h.length * 20;
|
785
|
-
this.Top = l.offset().top + h.length * 20;
|
786
|
-
setTaskCurrent(n, h);
|
787
|
-
a.bind("click", function () {
|
788
|
-
var C = topWin.Dialog._taskArray;
|
789
|
-
var x = getArrayPosition($(this).attr("id"), C);
|
790
|
-
var w = l[0].style.left;
|
791
|
-
var A = l[0].style.top;
|
792
|
-
var B = l.width();
|
793
|
-
var z = l.height();
|
794
|
-
var y = $('<div class="dialogMinEffect"/>');
|
795
|
-
if (l[0].style.display == "none") {
|
796
|
-
maxIndex = maxIndex + topWin.Dialog._dialogArray.length + 2;
|
797
|
-
l[0].style.zIndex = maxIndex;
|
798
|
-
if (x == -1) {
|
799
|
-
C.push($(this).attr("id"))
|
800
|
-
} else {
|
801
|
-
C.splice(x, 1);
|
802
|
-
C.push($(this).attr("id"))
|
803
|
-
}
|
804
|
-
y.css({
|
805
|
-
width: 0,
|
806
|
-
height: 0,
|
807
|
-
left: $(this).offset().left + "px",
|
808
|
-
top: top.window.document.documentElement.clientHeight + "px"
|
809
|
-
}).animate({
|
810
|
-
width: B,
|
811
|
-
height: z,
|
812
|
-
left: w,
|
813
|
-
top: A
|
814
|
-
}, 200, function () {
|
815
|
-
l.show();
|
816
|
-
y.remove()
|
817
|
-
});
|
818
|
-
$("body").append(y);
|
819
|
-
setTaskCurrent(n, C)
|
820
|
-
} else {
|
821
|
-
if ($(this).attr("id") != C[C.length - 1]) {
|
822
|
-
maxIndex = maxIndex + topWin.Dialog._dialogArray.length + 2;
|
823
|
-
l[0].style.zIndex = maxIndex;
|
824
|
-
if (x == -1) {
|
825
|
-
C.push($(this).attr("id"))
|
826
|
-
} else {
|
827
|
-
C.splice(x, 1);
|
828
|
-
C.push($(this).attr("id"))
|
829
|
-
}
|
830
|
-
setTaskCurrent(n, C)
|
831
|
-
} else {
|
832
|
-
y.css({
|
833
|
-
width: B,
|
834
|
-
height: z,
|
835
|
-
left: w,
|
836
|
-
top: A
|
837
|
-
}).animate({
|
838
|
-
width: 0,
|
839
|
-
height: 0,
|
840
|
-
left: $(this).offset().left + "px",
|
841
|
-
top: top.window.document.documentElement.clientHeight + "px",
|
842
|
-
opacity: 0
|
843
|
-
}, 200, function () {
|
844
|
-
y.remove();
|
845
|
-
setTaskCurrent(n, C)
|
846
|
-
});
|
847
|
-
$("body").append(y);
|
848
|
-
l.hide();
|
849
|
-
C.pop($(this).attr("id"))
|
850
|
-
}
|
851
|
-
}
|
852
|
-
})
|
853
|
-
}
|
854
|
-
this.setPosition()
|
855
|
-
}
|
856
|
-
if (this.Modal) {
|
857
|
-
g.style.zIndex = r.style.zIndex - 1;
|
858
|
-
Dialog.setBgDivSize();
|
859
|
-
g.style.display = ""
|
860
|
-
}
|
861
|
-
g = null
|
862
|
-
};
|
863
|
-
Dialog.prototype.close = function () {
|
864
|
-
if (this.unauthorized == false) {
|
865
|
-
if (this.innerWin && this.innerWin.Dialog && this.innerWin.Dialog._childDialogArray.length > 0) {
|
866
|
-
return
|
867
|
-
}
|
868
|
-
}
|
869
|
-
var n = this.getDialogDiv();
|
870
|
-
if (this == topWin.Dialog._dialogArray[topWin.Dialog._dialogArray.length - 1]) {
|
871
|
-
var k = topWin.Dialog._dialogArray.pop()
|
872
|
-
} else {
|
873
|
-
removeWinArray(topWin.Dialog._dialogArray, this)
|
874
|
-
}
|
875
|
-
removeWinArray(Dialog._childDialogArray, this);
|
876
|
-
if (Dialog._childDialogArray.length == 0) {
|
877
|
-
if (window.ownerDialog) {
|
878
|
-
ownerDialog.showCloseButton()
|
879
|
-
}
|
880
|
-
}
|
881
|
-
if (this.InvokeElementId) {
|
882
|
-
var h = topWin.$id(this.InvokeElementId);
|
883
|
-
h.style.display = "none";
|
884
|
-
if (isIE) {
|
885
|
-
var j = document.createElement("div");
|
886
|
-
j.innerHTML = h.outerHTML;
|
887
|
-
h.outerHTML = "";
|
888
|
-
document.getElementsByTagName("BODY")[0].appendChild(j)
|
889
|
-
} else {
|
890
|
-
document.getElementsByTagName("BODY")[0].appendChild(h)
|
891
|
-
}
|
892
|
-
}
|
893
|
-
if (topWin.Dialog._dialogArray.length > 0) {
|
894
|
-
if (this.Modal && k) {
|
895
|
-
var i = topWin.Dialog._dialogArray.length;
|
896
|
-
var c = true;
|
897
|
-
while (i) {
|
898
|
-
--i;
|
899
|
-
if (topWin.Dialog._dialogArray[i].Modal) {
|
900
|
-
Dialog.bgDiv.style.zIndex = topWin.Dialog._dialogArray[i].zindex - 1;
|
901
|
-
c = false;
|
902
|
-
break
|
903
|
-
}
|
904
|
-
}
|
905
|
-
if (c) {
|
906
|
-
Dialog.bgDiv.style.display = "none"
|
907
|
-
}
|
908
|
-
}
|
909
|
-
} else {
|
910
|
-
Dialog.bgDiv.style.zIndex = "900";
|
911
|
-
Dialog.bgDiv.style.display = "none";
|
912
|
-
if (HideScrollbar) {
|
913
|
-
var d = topDoc.getElementsByTagName(topDoc.compatMode == "BackCompat" ? "BODY" : "HTML")[0];
|
914
|
-
if (d.styleOverflow != undefined) {
|
915
|
-
if (window.navigator.userAgent.indexOf("Firefox/3.6") != -1) {
|
916
|
-
var b = d.scrollTop;
|
917
|
-
if (this.CloseHideScroller) {
|
918
|
-
d.style.overflow = "hidden"
|
919
|
-
} else {
|
920
|
-
d.style.overflow = d.styleOverflow
|
921
|
-
}
|
922
|
-
d.scrollTop = b
|
923
|
-
} else {
|
924
|
-
if (this.CloseHideScroller) {
|
925
|
-
d.style.overflow = "hidden"
|
926
|
-
} else {
|
927
|
-
d.style.overflow = d.styleOverflow
|
928
|
-
}
|
929
|
-
}
|
930
|
-
}
|
931
|
-
}
|
932
|
-
}
|
933
|
-
this.openerWindow.focus();
|
934
|
-
if (isIE && !isIE8) {
|
935
|
-
n.dialogInstance = null;
|
936
|
-
if (this.CancelEvent) {
|
937
|
-
this.cancelButton.onclick = null
|
938
|
-
}
|
939
|
-
if (this.OKEvent) {
|
940
|
-
this.okButton.onclick = null
|
941
|
-
}
|
942
|
-
topWin.$id("_DialogDiv_" + this.ID).onDragStart = null;
|
943
|
-
topWin.$id("_DialogDiv_" + this.ID).onDragEnd = null;
|
944
|
-
topWin.$id("_Draghandle_" + this.ID).onmousedown = null;
|
945
|
-
topWin.$id("_Draghandle_" + this.ID).root = null;
|
946
|
-
n.outerHTML = "";
|
947
|
-
CollectGarbage()
|
948
|
-
} else {
|
949
|
-
var o = topWin.$id("_RycDiv");
|
950
|
-
if (!o) {
|
951
|
-
o = topDoc.createElement("div");
|
952
|
-
o.id = "_RycDiv"
|
953
|
-
}
|
954
|
-
o.appendChild(n);
|
955
|
-
o.innerHTML = "";
|
956
|
-
o = null
|
957
|
-
}
|
958
|
-
this.innerFrame = null;
|
959
|
-
this.bgDiv = null;
|
960
|
-
n = null;
|
961
|
-
this.closed = true;
|
962
|
-
if (this.MinToTask == true || this.MinToTask == "true") {
|
963
|
-
var g = topWin.Dialog._taskArray;
|
964
|
-
var m = getArrayPosition("task_" + this.ID, g);
|
965
|
-
if (m != -1) {
|
966
|
-
g.splice(m, 1)
|
967
|
-
}
|
968
|
-
var l = getTaskTarget();
|
969
|
-
if (l != "") {
|
970
|
-
var f = $("#" + l);
|
971
|
-
var a = f.find("#task_" + this.ID);
|
972
|
-
itemTotalWidth = itemTotalWidth - a.width() - 8;
|
973
|
-
resetDialogTask();
|
974
|
-
a.remove();
|
975
|
-
setTaskCurrent(f, g);
|
976
|
-
if (f.find(".taskItemContainer").html() == "") {
|
977
|
-
f.fadeOut(500);
|
978
|
-
$("body").trigger("dialogTaskHide")
|
979
|
-
}
|
980
|
-
}
|
981
|
-
}
|
982
|
-
};
|
983
|
-
Dialog.prototype.autoClose = function () {
|
984
|
-
if (this.closed) {
|
985
|
-
clearTimeout(this._closeTimeoutId);
|
986
|
-
return
|
987
|
-
}
|
988
|
-
this.AutoClose -= 1;
|
989
|
-
topWin.$id("_Title_" + this.ID).innerHTML = this.AutoClose + " 秒后自动关闭";
|
990
|
-
if (this.AutoClose <= 0) {
|
991
|
-
this.close()
|
992
|
-
} else {
|
993
|
-
var a = this;
|
994
|
-
this._closeTimeoutId = setTimeout(function () {
|
995
|
-
a.autoClose()
|
996
|
-
}, 1000)
|
997
|
-
}
|
998
|
-
};
|
999
|
-
Dialog.getInstance = function (b) {
|
1000
|
-
var a = topWin.$id("_DialogDiv_" + b);
|
1001
|
-
if (!a) {
|
1002
|
-
alert("没有取到对应ID的弹出框页面对象")
|
1003
|
-
}
|
1004
|
-
try {
|
1005
|
-
return a.dialogInstance
|
1006
|
-
} finally {
|
1007
|
-
a = null
|
1008
|
-
}
|
1009
|
-
};
|
1010
|
-
Dialog.prototype.addButton = function (f, a, d) {
|
1011
|
-
topWin.$id("_ButtonRow_" + this.ID).style.display = "";
|
1012
|
-
this.ShowButtonRow = true;
|
1013
|
-
var c = topDoc.createElement("input");
|
1014
|
-
c.id = "_Button_" + this.ID + "_" + f;
|
1015
|
-
c.type = "button";
|
1016
|
-
c.style.cssText = "margin-right:5px";
|
1017
|
-
c.value = a;
|
1018
|
-
c.onclick = d;
|
1019
|
-
var b = topWin.$id("_DialogButtons_" + this.ID).getElementsByTagName("INPUT")[0];
|
1020
|
-
b.parentNode.insertBefore(c, b);
|
1021
|
-
$(c).each(function () {
|
1022
|
-
$(this).addClass("button");
|
1023
|
-
$(this).hover(function () {
|
1024
|
-
$(this).addClass("button_hover")
|
1025
|
-
}, function () {
|
1026
|
-
$(this).removeClass("button_hover")
|
1027
|
-
})
|
1028
|
-
});
|
1029
|
-
return c
|
1030
|
-
};
|
1031
|
-
Dialog.prototype.removeButton = function (b) {
|
1032
|
-
var a = topWin.$id("_DialogButtons_" + this.ID).getElementsByTagName("INPUT")[0];
|
1033
|
-
a.parentNode.removeChild(b)
|
1034
|
-
};
|
1035
|
-
Dialog.prototype.hiddenCloseButton = function (b) {
|
1036
|
-
var a = topWin.$id("_ButtonClose_" + this.ID);
|
1037
|
-
if (a) {
|
1038
|
-
a.style.display = "none"
|
1039
|
-
}
|
1040
|
-
};
|
1041
|
-
Dialog.prototype.showCloseButton = function (b) {
|
1042
|
-
var a = topWin.$id("_ButtonClose_" + this.ID);
|
1043
|
-
if (a) {
|
1044
|
-
a.style.display = ""
|
1045
|
-
}
|
1046
|
-
};
|
1047
|
-
Dialog.prototype.getBgdiv = function () {
|
1048
|
-
var h = this.Alpha;
|
1049
|
-
var g = String(this.Alpha / 100);
|
1050
|
-
if (Dialog.bgDiv) {
|
1051
|
-
if (this.Modal) {
|
1052
|
-
document.getElementById("_DialogBGMask").style.opacity = g;
|
1053
|
-
document.getElementById("_DialogBGMask").style.filter = "alpha(opacity=" + h + ")";
|
1054
|
-
document.getElementById("_DialogBGMask").style.backgroundColor = this.Bgcolor
|
1055
|
-
}
|
1056
|
-
return Dialog.bgDiv
|
1057
|
-
}
|
1058
|
-
var d = topWin.$id("_DialogBGDiv");
|
1059
|
-
if (!d) {
|
1060
|
-
d = topDoc.createElement("div");
|
1061
|
-
d.id = "_DialogBGDiv";
|
1062
|
-
d.style.cssText = "position:absolute;left:0px;top:0px;width:100%;height:100%;z-index:900";
|
1063
|
-
var a = '<div style="position:relative;width:100%;height:100%;">';
|
1064
|
-
var c = '<div id="_DialogBGMask" style="position:absolute;width:100%;height:100%;"></div>';
|
1065
|
-
var f = ielt7 ? '<iframe src="about:blank" style="filter:alpha(opacity=0);" width="100%" height="100%"></iframe>' : "";
|
1066
|
-
d.innerHTML = a + c + f + "</div>";
|
1067
|
-
topDoc.getElementsByTagName("BODY")[0].appendChild(d);
|
1068
|
-
document.getElementById("_DialogBGMask").style.opacity = g;
|
1069
|
-
document.getElementById("_DialogBGMask").style.filter = "alpha(opacity=" + h + ")";
|
1070
|
-
document.getElementById("_DialogBGMask").style.backgroundColor = this.Bgcolor;
|
1071
|
-
if (ielt7) {
|
1072
|
-
var b = d.getElementsByTagName("IFRAME")[0].contentWindow.document;
|
1073
|
-
b.open();
|
1074
|
-
b.write("<body style='background-color:#333' oncontextmenu='return false;'></body>");
|
1075
|
-
b.close();
|
1076
|
-
b = null
|
1077
|
-
}
|
1078
|
-
}
|
1079
|
-
Dialog.bgDiv = d;
|
1080
|
-
d = null;
|
1081
|
-
return Dialog.bgDiv
|
1082
|
-
};
|
1083
|
-
Dialog.prototype.getDialogDiv = function () {
|
1084
|
-
var a = topWin.$id("_DialogDiv_" + this.ID);
|
1085
|
-
try {
|
1086
|
-
return a
|
1087
|
-
} finally {
|
1088
|
-
a = null
|
1089
|
-
}
|
1090
|
-
};
|
1091
|
-
Dialog.onKeyDown = function (a) {
|
1092
|
-
var a = window.event || a;
|
1093
|
-
if ((a.shiftKey && a.keyCode == 9) || a.keyCode == 8) {
|
1094
|
-
if (topWin.Dialog._dialogArray.length > 0) {
|
1095
|
-
var c = a.srcElement || a.target;
|
1096
|
-
if (c.tagName != "INPUT" && c.tagName != "TEXTAREA") {
|
1097
|
-
stopEvent(a);
|
1098
|
-
return false
|
1099
|
-
}
|
1100
|
-
}
|
1101
|
-
}
|
1102
|
-
if (a.keyCode == 27) {
|
1103
|
-
var b = topWin.Dialog._dialogArray[topWin.Dialog._dialogArray.length - 1];
|
1104
|
-
if (b.ShowCloseButton) {
|
1105
|
-
Dialog.close()
|
1106
|
-
}
|
1107
|
-
}
|
1108
|
-
};
|
1109
|
-
Dialog.close = function (b) {
|
1110
|
-
if (topWin.Dialog._dialogArray.length > 0) {
|
1111
|
-
var a = topWin.Dialog._dialogArray[topWin.Dialog._dialogArray.length - 1];
|
1112
|
-
if (a.MsgForESC) {
|
1113
|
-
Dialog.confirm(a.MsgForESC, function () {
|
1114
|
-
a.cancelButton.onclick.apply(a.cancelButton, [])
|
1115
|
-
})
|
1116
|
-
} else {
|
1117
|
-
a.cancelButton.onclick.apply(a.cancelButton, [])
|
1118
|
-
}
|
1119
|
-
}
|
1120
|
-
};
|
1121
|
-
Dialog.alert = function (i, f, b, d, c) {
|
1122
|
-
var b = b || 300,
|
1123
|
-
d = d || 110;
|
1124
|
-
var g = new Dialog({
|
1125
|
-
Width: b,
|
1126
|
-
Height: d
|
1127
|
-
});
|
1128
|
-
g.ShowButtonRow = true;
|
1129
|
-
g.CancelEvent = function () {
|
1130
|
-
g.close();
|
1131
|
-
if (f) {
|
1132
|
-
f()
|
1133
|
-
}
|
1134
|
-
};
|
1135
|
-
if (i) {
|
1136
|
-
var a = i.split("|");
|
1137
|
-
if (a.length > 1) {
|
1138
|
-
g.Title = a[1]
|
1139
|
-
} else {
|
1140
|
-
g.Title = "系统提示"
|
1141
|
-
}
|
1142
|
-
g.InnerHtml = '<table height="100%" border="0" align="center" cellpadding="10" cellspacing="0" style="background-color: #ffffff !important;"> <tr><td align="right"><input type="button" id="Icon_' + this.ID + '" class="icon_alert" align="absmiddle"></td> <td align="left" id="Message_' + this.ID + '" style="font-size:9pt">' + a[0] + "</td></tr> </table>"
|
1143
|
-
} else {
|
1144
|
-
g.Title = "系统提示";
|
1145
|
-
g.InnerHtml = '<table height="100%" border="0" align="center" cellpadding="10" cellspacing="0" style="background-color: #ffffff !important;"> <tr><td align="right"><input type="button" id="Icon_' + this.ID + '" class="icon_alert" align="absmiddle"></td> <td align="left" id="Message_' + this.ID + '" style="font-size:9pt"></td></tr> </table>'
|
1146
|
-
}
|
1147
|
-
g.show();
|
1148
|
-
g.okButton.parentNode.style.textAlign = "center";
|
1149
|
-
g.okButton.style.display = "none";
|
1150
|
-
g.cancelButton.value = g.OkButtonText;
|
1151
|
-
setTimeout(function () {
|
1152
|
-
g.cancelButton.focus()
|
1153
|
-
}, 200);
|
1154
|
-
if (c && c > 0) {
|
1155
|
-
topWin.$id("_Title_" + g.ID).innerHTML = c + "秒后自动关闭";
|
1156
|
-
setTimeout(function () {
|
1157
|
-
g.close()
|
1158
|
-
}, c * 1000)
|
1159
|
-
}
|
1160
|
-
};
|
1161
|
-
Dialog.confirm = function (i, d, c, b, f) {
|
1162
|
-
var b = b || 300,
|
1163
|
-
f = f || 110;
|
1164
|
-
var g = new Dialog({
|
1165
|
-
Width: b,
|
1166
|
-
Height: f
|
1167
|
-
});
|
1168
|
-
g.ShowButtonRow = true;
|
1169
|
-
var a = i.split("|");
|
1170
|
-
if (a.length > 1) {
|
1171
|
-
g.Title = a[1]
|
1172
|
-
} else {
|
1173
|
-
g.Title = "信息确认"
|
1174
|
-
}
|
1175
|
-
g.CancelEvent = function () {
|
1176
|
-
g.close();
|
1177
|
-
if (c) {
|
1178
|
-
c()
|
1179
|
-
}
|
1180
|
-
};
|
1181
|
-
g.OKEvent = function () {
|
1182
|
-
g.close();
|
1183
|
-
if (d) {
|
1184
|
-
d()
|
1185
|
-
}
|
1186
|
-
};
|
1187
|
-
g.InnerHtml = '<table height="100%" border="0" align="center" cellpadding="10" cellspacing="0" style="background-color: #ffffff !important;"> <tr><td align="right"><input type="button" id="Icon_' + this.ID + '" class="icon_query" align="absmiddle"></td> <td align="left" id="Message_' + this.ID + '" style="font-size:9pt">' + a[0] + "</td></tr> </table>";
|
1188
|
-
g.show();
|
1189
|
-
g.okButton.parentNode.style.textAlign = "center";
|
1190
|
-
setTimeout(function () {
|
1191
|
-
g.okButton.focus()
|
1192
|
-
}, 200)
|
1193
|
-
};
|
1194
|
-
Dialog.open = function (a) {
|
1195
|
-
var b = new Dialog(a);
|
1196
|
-
b.show();
|
1197
|
-
return b
|
1198
|
-
};
|
1199
|
-
window.attachEvent("onload", Dialog.attachBehaviors);
|
1200
|
-
|
1201
|
-
function fixProgress() {
|
1202
|
-
try {
|
1203
|
-
if (top.progressFlag == 1) {
|
1204
|
-
top.progressFlag = 0
|
1205
|
-
}
|
1206
|
-
} catch (a) {}
|
1207
|
-
}
|
1208
|
-
|
1209
|
-
function getArrayPosition(c, d) {
|
1210
|
-
var a = -1;
|
1211
|
-
for (var b = 0; b < d.length; b++) {
|
1212
|
-
if (c == d[b]) {
|
1213
|
-
a = b;
|
1214
|
-
break
|
1215
|
-
}
|
1216
|
-
}
|
1217
|
-
return a
|
1218
|
-
}
|
1219
|
-
|
1220
|
-
function getTaskTarget() {
|
1221
|
-
var b = "dialogTask";
|
1222
|
-
if ($("#skin").attr("splitMode") == true || $("#skin").attr("splitMode") == "true") {} else {
|
1223
|
-
var a = $(window.top.document.getElementById("theme"));
|
1224
|
-
if (a.attr("taskTarget") != null) {
|
1225
|
-
b = a.attr("taskTarget")
|
1226
|
-
}
|
1227
|
-
}
|
1228
|
-
return b
|
1229
|
-
}
|
1230
|
-
|
1231
|
-
function setTaskCurrent(b, a) {
|
1232
|
-
b.find("a").removeClass("dialogTaskItemCurrent");
|
1233
|
-
if (a.length != 0) {
|
1234
|
-
b.find("#" + a[a.length - 1]).addClass("dialogTaskItemCurrent")
|
1235
|
-
}
|
1236
|
-
}
|
1237
|
-
var timer;
|
1238
|
-
var itemContainerWidth = 0;
|
1239
|
-
var currentItemTotalWidth = 0;
|
1240
|
-
var itemTotalWidth = 0;
|
1241
|
-
$(function () {
|
1242
|
-
itemContainerWidth = window.document.documentElement.clientWidth;
|
1243
|
-
$(window).resize(function () {
|
1244
|
-
resetDialogTask()
|
1245
|
-
});
|
1246
|
-
var f = getTaskTarget();
|
1247
|
-
if (f != "") {
|
1248
|
-
var d = $("#" + f);
|
1249
|
-
var g = 2;
|
1250
|
-
var c = $('<div class="taskItemContainer"></div>');
|
1251
|
-
d.append(c);
|
1252
|
-
var a = $('<div class="taskItemButtonLeft" style="display:none;" ></div>');
|
1253
|
-
var b = $('<div class="taskItemButtonRight" style="display:none;" ></div>');
|
1254
|
-
d.append(a);
|
1255
|
-
d.append(b);
|
1256
|
-
a.bind("mousedown", function () {
|
1257
|
-
timer = setInterval(function () {
|
1258
|
-
if (g > 17) {
|
1259
|
-
g = 18;
|
1260
|
-
c.css("left", g);
|
1261
|
-
clearInterval(timer);
|
1262
|
-
return
|
1263
|
-
}
|
1264
|
-
g = g + 8;
|
1265
|
-
c.css("left", g)
|
1266
|
-
}, 30)
|
1267
|
-
});
|
1268
|
-
a.bind("mouseup", function () {
|
1269
|
-
clearInterval(timer)
|
1270
|
-
});
|
1271
|
-
b.bind("mousedown", function () {
|
1272
|
-
var h = $(this).next("ul");
|
1273
|
-
timer = setInterval(function () {
|
1274
|
-
if (g > 18) {
|
1275
|
-
g = 17;
|
1276
|
-
clearInterval(timer);
|
1277
|
-
return
|
1278
|
-
} else {
|
1279
|
-
if (g < itemContainerWidth - itemTotalWidth) {
|
1280
|
-
g = itemContainerWidth - itemTotalWidth;
|
1281
|
-
clearInterval(timer);
|
1282
|
-
return
|
1283
|
-
}
|
1284
|
-
}
|
1285
|
-
g = g - 8;
|
1286
|
-
c.css("left", g)
|
1287
|
-
}, 30)
|
1288
|
-
});
|
1289
|
-
b.bind("mouseup", function () {
|
1290
|
-
clearInterval(timer)
|
1291
|
-
})
|
1292
|
-
}
|
1293
|
-
});
|
1294
|
-
|
1295
|
-
function resetDialogTask() {
|
1296
|
-
itemContainerWidth = top.window.document.documentElement.clientWidth;
|
1297
|
-
var b = getTaskTarget();
|
1298
|
-
if (b != "") {
|
1299
|
-
var a = $("#" + b);
|
1300
|
-
if (a[0]) {
|
1301
|
-
if (a[0].style.display != "none") {
|
1302
|
-
if (itemTotalWidth > itemContainerWidth) {
|
1303
|
-
a.find(".taskItemButtonLeft").show();
|
1304
|
-
a.find(".taskItemButtonRight").show()
|
1305
|
-
} else {
|
1306
|
-
a.find(".taskItemButtonLeft").hide();
|
1307
|
-
a.find(".taskItemButtonRight").hide();
|
1308
|
-
a.find(".taskItemContainer").css("left", 18)
|
1309
|
-
}
|
1310
|
-
}
|
1311
|
-
}
|
1312
|
-
}
|
1
|
+
var mainprePath = "/admin/";
|
2
|
+
var themeColor = "blue";
|
3
|
+
var IMAGESPATH = mainprePath + "plugins/zDialog/skins/blue/";
|
4
|
+
if ($("#skin").attr("themeColor") != null) {
|
5
|
+
themeColor = $("#skin").attr("themeColor");
|
6
|
+
IMAGESPATH = mainprePath + "plugins/zDialog/skins/" + themeColor + "/"
|
7
|
+
}
|
8
|
+
var HideScrollbar = true;
|
9
|
+
var agt = window.navigator.userAgent;
|
10
|
+
var isIE = agt.toLowerCase().indexOf("msie") != -1;
|
11
|
+
var isGecko = agt.toLowerCase().indexOf("gecko") != -1;
|
12
|
+
var ieVer = isIE ? parseInt(agt.split(";")[1].replace(/(^\s*)|(\s*$)/g, "").split(" ")[1]) : 0;
|
13
|
+
var isIE8 = !! window.XDomainRequest && !! document.documentMode;
|
14
|
+
var isIE7 = ieVer == 7 && !isIE8;
|
15
|
+
var ielt7 = isIE && ieVer < 7;
|
16
|
+
var isQuirks = document.compatMode == "BackCompat";
|
17
|
+
var maxIndex = 900;
|
18
|
+
var instance;
|
19
|
+
var $id = function (a) {
|
20
|
+
return typeof a == "string" ? document.getElementById(a) : a
|
21
|
+
};
|
22
|
+
|
23
|
+
function stopEvent(a) {
|
24
|
+
a = window.event || a;
|
25
|
+
if (!a) {
|
26
|
+
return
|
27
|
+
}
|
28
|
+
if (isGecko) {
|
29
|
+
a.preventDefault();
|
30
|
+
a.stopPropagation()
|
31
|
+
}
|
32
|
+
a.cancelBubble = true;
|
33
|
+
a.returnValue = false
|
34
|
+
}
|
35
|
+
|
36
|
+
function removeWinArray(d, c, b) {
|
37
|
+
if (b) {
|
38
|
+
var f = [];
|
39
|
+
for (var a = 0; a < d.length; a++) {
|
40
|
+
if (c == d[a]) {
|
41
|
+
f.push(d.splice(a, 1)[0])
|
42
|
+
}
|
43
|
+
}
|
44
|
+
return f
|
45
|
+
}
|
46
|
+
for (var a = 0; a < d.length; a++) {
|
47
|
+
if (c == d[a]) {
|
48
|
+
d.splice(a, 1)
|
49
|
+
}
|
50
|
+
}
|
51
|
+
return d
|
52
|
+
}
|
53
|
+
if (!isIE && HTMLElement) {
|
54
|
+
if (!HTMLElement.prototype.attachEvent) {
|
55
|
+
window.attachEvent = document.attachEvent = HTMLElement.prototype.attachEvent = function (b, a) {
|
56
|
+
b = b.substring(2);
|
57
|
+
this.addEventListener(b, a, false)
|
58
|
+
};
|
59
|
+
window.detachEvent = document.detachEvent = HTMLElement.prototype.detachEvent = function (b, a) {
|
60
|
+
b = b.substring(2);
|
61
|
+
this.removeEventListener(b, a, false)
|
62
|
+
}
|
63
|
+
}
|
64
|
+
} else {
|
65
|
+
if (isIE && ieVer < 8) {
|
66
|
+
try {
|
67
|
+
document.execCommand("BackgroundImageCache", false, true)
|
68
|
+
} catch (e) {}
|
69
|
+
}
|
70
|
+
}
|
71
|
+
var $topWindow = function () {
|
72
|
+
var a = window;
|
73
|
+
return a
|
74
|
+
};
|
75
|
+
var $bodyDimensions = function (i) {
|
76
|
+
i = i || window;
|
77
|
+
var h = i.document;
|
78
|
+
var c = h.compatMode == "BackCompat" ? h.body.clientWidth : h.documentElement.clientWidth;
|
79
|
+
var g = h.compatMode == "BackCompat" ? h.body.clientHeight : h.documentElement.clientHeight;
|
80
|
+
var b = Math.max(h.documentElement.scrollLeft, h.body.scrollLeft);
|
81
|
+
var d = Math.max(h.documentElement.scrollTop, h.body.scrollTop);
|
82
|
+
var a = Math.max(h.documentElement.scrollWidth, h.body.scrollWidth);
|
83
|
+
var f = Math.max(h.documentElement.scrollHeight, h.body.scrollHeight);
|
84
|
+
if (f < g) {
|
85
|
+
f = g
|
86
|
+
}
|
87
|
+
return {
|
88
|
+
clientWidth: c,
|
89
|
+
clientHeight: g,
|
90
|
+
scrollLeft: b,
|
91
|
+
scrollTop: d,
|
92
|
+
scrollWidth: a,
|
93
|
+
scrollHeight: f
|
94
|
+
}
|
95
|
+
};
|
96
|
+
var fadeEffect = function (b, f, a, c, d) {
|
97
|
+
if (!b.effect) {
|
98
|
+
b.effect = {
|
99
|
+
fade: 0,
|
100
|
+
move: 0,
|
101
|
+
size: 0
|
102
|
+
}
|
103
|
+
}
|
104
|
+
clearInterval(b.effect.fade);
|
105
|
+
var c = c || 20;
|
106
|
+
b.effect.fade = setInterval(function () {
|
107
|
+
f = f < a ? Math.min(f + c, a) : Math.max(f - c, a);
|
108
|
+
b.style.opacity = f / 100;
|
109
|
+
b.style.filter = "alpha(opacity=" + f + ")";
|
110
|
+
if (f == a) {
|
111
|
+
clearInterval(b.effect.fade);
|
112
|
+
if (d) {
|
113
|
+
d.call(b)
|
114
|
+
}
|
115
|
+
}
|
116
|
+
}, 20)
|
117
|
+
};
|
118
|
+
var topWin = $topWindow();
|
119
|
+
var topDoc = topWin.document;
|
120
|
+
var Dialog = function () {
|
121
|
+
this.ID = null;
|
122
|
+
this.Width = 550;
|
123
|
+
this.Height = 380;
|
124
|
+
this.URL = null;
|
125
|
+
this.OnLoad = null;
|
126
|
+
this.InnerHtml = "";
|
127
|
+
this.InvokeElementId = "";
|
128
|
+
this.Top = "50%";
|
129
|
+
this.Left = "50%";
|
130
|
+
this.Title = " ";
|
131
|
+
this.OkButtonText = " 确 定 ";
|
132
|
+
this.CancelButtonText = " 取 消 ";
|
133
|
+
this.OKEvent = null;
|
134
|
+
this.CancelEvent = null;
|
135
|
+
this.MaxEvent = null;
|
136
|
+
this.DecreaseEvent = null;
|
137
|
+
this.MinEvent = null;
|
138
|
+
this.ShowButtonRow = false;
|
139
|
+
this.ShowOkButton = true;
|
140
|
+
this.ShowCancelButton = true;
|
141
|
+
this.MessageIcon = "window.gif";
|
142
|
+
this.MessageTitle = "";
|
143
|
+
this.Message = "";
|
144
|
+
this.ShowMessageRow = false;
|
145
|
+
this.Modal = true;
|
146
|
+
this.Drag = true;
|
147
|
+
this.AutoClose = null;
|
148
|
+
this.ShowCloseButton = true;
|
149
|
+
this.ShowMaxButton = false;
|
150
|
+
this.ShowMinButton = false;
|
151
|
+
this.Animator = !ielt7;
|
152
|
+
this.MsgForESC = "";
|
153
|
+
this.InnerFrameName = null;
|
154
|
+
this.Style = "normal";
|
155
|
+
this.ButtonAlign = "right";
|
156
|
+
this.DecreaseResetPosition = false;
|
157
|
+
this.ResizeResetPosition = true;
|
158
|
+
this.Alpha = 40;
|
159
|
+
this.Bgcolor = "#333333";
|
160
|
+
this.CloseHideScroller = false;
|
161
|
+
this.AllowChangeIndex = true;
|
162
|
+
this.MinToTask = false;
|
163
|
+
this.IconClass = "dialog_icon_default";
|
164
|
+
this.IconSrc = "";
|
165
|
+
this.ParamsObj = null;
|
166
|
+
this.dialogDiv = null;
|
167
|
+
this.bgDiv = null;
|
168
|
+
this.openerWindow = null;
|
169
|
+
this.openerDialog = null;
|
170
|
+
this.innerFrame = null;
|
171
|
+
this.innerWin = null;
|
172
|
+
this.innerDoc = null;
|
173
|
+
this.zindex = 900;
|
174
|
+
this.cancelButton = null;
|
175
|
+
this.okButton = null;
|
176
|
+
this.maxButton = null;
|
177
|
+
this.minButton = null;
|
178
|
+
this.unauthorized = false;
|
179
|
+
this.maxFlag = false;
|
180
|
+
this.minFlag = false;
|
181
|
+
if (arguments.length > 0 && typeof (arguments[0]) == "string") {
|
182
|
+
this.ID = arguments[0]
|
183
|
+
} else {
|
184
|
+
if (arguments.length > 0 && typeof (arguments[0]) == "object") {
|
185
|
+
Dialog.setOptions(this, arguments[0])
|
186
|
+
}
|
187
|
+
} if (!this.ID) {
|
188
|
+
this.ID = topWin.Dialog._dialogArray.length + ""
|
189
|
+
}
|
190
|
+
instance = this
|
191
|
+
};
|
192
|
+
Dialog._dialogArray = [];
|
193
|
+
Dialog._childDialogArray = [];
|
194
|
+
Dialog._taskArray = [];
|
195
|
+
Dialog.bgDiv = null;
|
196
|
+
Dialog.setOptions = function (c, b) {
|
197
|
+
if (!b) {
|
198
|
+
return
|
199
|
+
}
|
200
|
+
for (var a in b) {
|
201
|
+
c[a] = b[a]
|
202
|
+
}
|
203
|
+
};
|
204
|
+
Dialog.attachBehaviors = function () {
|
205
|
+
document.attachEvent("onkeydown", Dialog.onKeyDown);
|
206
|
+
window.attachEvent("onresize", function () {
|
207
|
+
Dialog.setBgDivSize();
|
208
|
+
for (var c = 0, b = topWin.Dialog._dialogArray.length; c < b; c++) {
|
209
|
+
var a = topWin.Dialog._dialogArray[c];
|
210
|
+
if (a.ResizeResetPosition) {
|
211
|
+
a.setPosition()
|
212
|
+
}
|
213
|
+
}
|
214
|
+
});
|
215
|
+
if (!HideScrollbar && ielt7) {
|
216
|
+
window.attachEvent("onscroll", Dialog.resetPosition)
|
217
|
+
}
|
218
|
+
};
|
219
|
+
Dialog.prototype.attachBehaviors = function () {
|
220
|
+
var c = this;
|
221
|
+
if (this.Drag && topWin.Drag) {
|
222
|
+
var a = topWin.$id("_Draghandle_" + this.ID),
|
223
|
+
b = topWin.$id("_DialogDiv_" + this.ID);
|
224
|
+
topWin.Drag.init(a, b);
|
225
|
+
b.onDragStart = function (h, g, f, d) {
|
226
|
+
if (!isIE && c.URL) {
|
227
|
+
topWin.$id("_Covering_" + c.ID).style.display = ""
|
228
|
+
}
|
229
|
+
};
|
230
|
+
b.onDragEnd = function (i, h, f, d) {
|
231
|
+
if (!isIE && c.URL) {
|
232
|
+
topWin.$id("_Covering_" + c.ID).style.display = "none"
|
233
|
+
}
|
234
|
+
var g = $bodyDimensions(topWin);
|
235
|
+
if (i < 0) {
|
236
|
+
this.style.left = "0px"
|
237
|
+
}
|
238
|
+
if (i + this.clientWidth > g.clientWidth) {
|
239
|
+
this.style.left = g.clientWidth - this.clientWidth + "px"
|
240
|
+
}
|
241
|
+
if (c.fixedPosition) {
|
242
|
+
if (h < 0) {
|
243
|
+
this.style.top = "0px"
|
244
|
+
}
|
245
|
+
if (h + 33 > g.clientHeight) {
|
246
|
+
this.style.top = g.clientHeight - 33 + "px"
|
247
|
+
}
|
248
|
+
} else {
|
249
|
+
if (h < g.scrollTop) {
|
250
|
+
this.style.top = g.scrollTop + "px"
|
251
|
+
}
|
252
|
+
if (h + 33 > g.scrollTop + g.clientHeight) {
|
253
|
+
this.style.top = g.scrollTop + g.clientHeight - 33 + "px"
|
254
|
+
}
|
255
|
+
}
|
256
|
+
}
|
257
|
+
}
|
258
|
+
};
|
259
|
+
Dialog.prototype.displacePath = function () {
|
260
|
+
if (this.URL.substr(0, 7) == "http://" || this.URL.substr(0, 1) == "/" || this.URL.substr(0, 11) == "javascript:") {
|
261
|
+
return this.URL
|
262
|
+
} else {
|
263
|
+
var a = this.URL;
|
264
|
+
var b = window.location.href;
|
265
|
+
b = b.substring(0, b.lastIndexOf("/"));
|
266
|
+
while (a.indexOf("../") >= 0) {
|
267
|
+
a = a.substring(3);
|
268
|
+
b = b.substring(0, b.lastIndexOf("/"))
|
269
|
+
}
|
270
|
+
return b + "/" + a
|
271
|
+
}
|
272
|
+
};
|
273
|
+
Dialog.prototype.setPosition = function () {
|
274
|
+
var d = $bodyDimensions(topWin);
|
275
|
+
var g = this.Top,
|
276
|
+
b = this.Left,
|
277
|
+
c = this.getDialogDiv();
|
278
|
+
if (typeof this.Top == "string" && this.Top.indexOf("%") != -1) {
|
279
|
+
var f = parseFloat(this.Top) * 0.01;
|
280
|
+
g = this.fixedPosition ? d.clientHeight * f - c.scrollHeight * f : d.clientHeight * f - c.scrollHeight * f + d.scrollTop
|
281
|
+
}
|
282
|
+
if (typeof this.Left == "string" && this.Left.indexOf("%") != -1) {
|
283
|
+
var a = parseFloat(this.Left) * 0.01;
|
284
|
+
b = ielt7 ? d.clientWidth * a - c.scrollWidth * a + d.scrollLeft : d.clientWidth * a - c.scrollWidth * a
|
285
|
+
}
|
286
|
+
if (c) {
|
287
|
+
c.style.top = Math.round(g) + "px";
|
288
|
+
c.style.left = Math.round(b) + "px"
|
289
|
+
}
|
290
|
+
};
|
291
|
+
Dialog.setBgDivSize = function () {
|
292
|
+
var a = $bodyDimensions(topWin);
|
293
|
+
if (Dialog.bgDiv) {
|
294
|
+
if (ielt7) {
|
295
|
+
Dialog.bgDiv.style.height = a.clientHeight + "px";
|
296
|
+
Dialog.bgDiv.style.top = a.scrollTop + "px";
|
297
|
+
Dialog.bgDiv.childNodes[0].style.display = "none";
|
298
|
+
Dialog.bgDiv.childNodes[0].style.display = ""
|
299
|
+
} else {
|
300
|
+
Dialog.bgDiv.style.height = a.scrollHeight + "px"
|
301
|
+
}
|
302
|
+
}
|
303
|
+
};
|
304
|
+
Dialog.resetPosition = function () {
|
305
|
+
Dialog.setBgDivSize();
|
306
|
+
for (var b = 0, a = topWin.Dialog._dialogArray.length; b < a; b++) {
|
307
|
+
topWin.Dialog._dialogArray[b].setPosition()
|
308
|
+
}
|
309
|
+
};
|
310
|
+
Dialog.prototype.create = function () {
|
311
|
+
var g = $bodyDimensions(topWin);
|
312
|
+
if (typeof (this.OKEvent) == "function") {
|
313
|
+
this.ShowButtonRow = true
|
314
|
+
}
|
315
|
+
if (!this.Width) {
|
316
|
+
this.Width = Math.round(g.clientWidth * 4 / 10)
|
317
|
+
}
|
318
|
+
if (!this.Height) {
|
319
|
+
this.Height = Math.round(this.Width / 2)
|
320
|
+
}
|
321
|
+
if (this.MessageTitle || this.Message) {
|
322
|
+
this.ShowMessageRow = true
|
323
|
+
}
|
324
|
+
var b = this.Width + 13 + 13;
|
325
|
+
var c = this.Height + 33 + 13 + (this.ShowButtonRow ? 40 : 0) + (this.ShowMessageRow ? 50 : 0);
|
326
|
+
if (b > g.clientWidth) {
|
327
|
+
this.Width = Math.round(g.clientWidth - 26)
|
328
|
+
}
|
329
|
+
if (c > g.clientHeight) {
|
330
|
+
this.Height = Math.round(g.clientHeight - 46 - (this.ShowButtonRow ? 40 : 0) - (this.ShowMessageRow ? 50 : 0))
|
331
|
+
}
|
332
|
+
var f = "";
|
333
|
+
if (this.Style == "normal") {
|
334
|
+
f = ' <table id="_DialogTable_{thisID}" width="' + (this.Width + 26) + '" cellspacing="0" cellpadding="0" border="0" style="font-size:12px; line-height:1.4;border-collapse: collapse;"> <tr id="_Draghandle_{thisID}" onselectstart="return false;" style="-moz-user-select: -moz-none; ' + (this.Drag ? "cursor: move;" : "") + '"> <td class="dialog_lt dialog_borderWidth"><div class="dialog_borderWidth"></div></td> <td class="dialog_ct" ><div class="dialog_title"><span id="_Title_{thisID}" class="' + (this.IconClass != "" ? this.IconClass : "") + '" style="float:left;' + (this.IconSrc != "" ? "background-repeat: no-repeat;background-position: 0 40%;padding-left:18px;display:inline-block;background-image:url(" + this.IconSrc + ")" : "") + '">' + this.Title + '</span><input type="button" class="dialog_trans_icon"/></div> <div id="_ButtonClose_{thisID}" onclick="fixProgress();Dialog.getInstance(\'{thisID}\').cancelButton.onclick.apply(Dialog.getInstance(\'{thisID}\').cancelButton,[]);" title="关闭" class="dialog_closebtn" onmouseout="this.className=\'dialog_closebtn\'" onmouseover="this.className=\'dialog_closebtn_over\'" style=" ' + (this.ShowCloseButton ? "" : "display:none;") + '"></div><div id="_ButtonMax_{thisID}" onclick="Dialog.getInstance(\'{thisID}\').max()" title="最大化" class="dialog_maxbtn" style="' + (this.ShowMaxButton ? "" : "display:none;") + '"></div><div id="_ButtonMin_{thisID}" onclick="Dialog.getInstance(\'{thisID}\').minHandler()" title="最小化" class="dialog_minbtn" style="' + (this.ShowMinButton ? "" : "display:none;") + '"></div></td> <td class="dialog_rt dialog_borderWidth"><div class="dialog_borderWidth"><a id="_forTab_{thisID}" href="#;"></a></div></td> </tr> <tr valign="top"> <td class="dialog_mlm dialog_borderWidth"></td> <td align="center"><table width="100%" cellspacing="0" cellpadding="0" border="0" bgcolor="#ffffff" style="background-color: #ffffff !important;"> <tr id="_MessageRow_{thisID}" style="' + (this.ShowMessageRow ? "" : "display:none") + '"> <td valign="top" height="50"><table width="100%" cellspacing="0" cellpadding="0" border="0" class="dialog_bg" id="_MessageTable_{thisID}" style="background-color: #ffffff !important;"> <tr> <td width="50" height="50" align="center"><input type="button" class="dialog_messageIcon" id="_MessageIcon_{thisID}"/></td> <td align="left" style="line-height: 16px;"><div id="_MessageTitle_{thisID}" style="font-weight:bold">' + this.MessageTitle + '</div> <div id="_Message_{thisID}">' + this.Message + '</div></td> </tr> </table></td> </tr> <tr> <td valign="top"><div id="_Container_{thisID}" style="text-align:left;position: relative; width: ' + this.Width + "px; height: " + this.Height + 'px;"> <div style="position: absolute; height: 100%; width: 100%; display: none; background-color:#fff; opacity: 0.5;" id="_Covering_{thisID}"> </div> ' + (function (k) {
|
335
|
+
if (k.InnerHtml) {
|
336
|
+
return k.InnerHtml
|
337
|
+
}
|
338
|
+
if (k.URL) {
|
339
|
+
return '<iframe width="100%" height="100%" frameborder="0" style="background-color:#ffffff;border:none 0;" id="_DialogFrame_' + k.ID + '" ' + (k.InnerFrameName ? 'name="' + k.InnerFrameName + '"' : "") + ' src="' + k.displacePath() + '"></iframe>'
|
340
|
+
}
|
341
|
+
return ""
|
342
|
+
})(this) + ' </div></td> </tr> <tr id="_ButtonRow_{thisID}" style="' + (this.ShowButtonRow ? "" : "display:none") + '"> <td height="36"><div id="_DialogButtons_{thisID}" style="text-align:' + this.ButtonAlign + '; border-top: 1px solid #DADEE5; padding: 8px 20px;background-color:#f6f6f6;"> <input type="button" style="' + (this.ShowOkButton ? "" : "display:none") + '" value="' + this.OkButtonText + '" id="_ButtonOK_{thisID}"/> <input type="button" style="' + (this.ShowCancelButton ? "" : "display:none") + '" value="' + this.CancelButtonText + '" onclick="Dialog.getInstance(\'{thisID}\').close();" id="_ButtonCancel_{thisID}"/> </div></td> </tr> </table></td> <td class="dialog_mrm dialog_borderWidth"></td> </tr> <tr> <td class="dialog_lb dialog_borderWidth"></td> <td class="dialog_cb"></td> <td class="dialog_rb dialog_borderWidth"><a onfocus=\'$id("_forTab_{thisID}").focus();\' href="#;"></a></td> </tr> </table></div>'
|
343
|
+
} else {
|
344
|
+
if (this.Style == "simple") {
|
345
|
+
f = ' <table id="_DialogTable_{thisID}" width="' + (this.Width + 26) + '" cellspacing="0" cellpadding="0" border="0" style="font-size:12px; line-height:1.4;border-collapse: collapse;"> <tr id="_Draghandle_{thisID}" onselectstart="return false;" style="-moz-user-select: -moz-none; ' + (this.Drag ? "cursor: move;" : "") + '"> <td ><div class="dialog_sample_top"><div style="padding: 9px 0 0 4px; float: left; "><span id="_Title_{thisID}">' + this.Title + '</span></div> <div id="_ButtonClose_{thisID}" onclick="fixProgress();Dialog.getInstance(\'{thisID}\').cancelButton.onclick.apply(Dialog.getInstance(\'{thisID}\').cancelButton,[]);" class="dialog__simple_closebtn" style=" ' + (ielt7 ? "margin-top: 3px;" : "") + (this.ShowCloseButton ? "" : "display:none;") + '"></div></div></td> </tr> <tr valign="top"> <td align="center"><div class="dialog_sample_middle"><table width="100%" cellspacing="0" cellpadding="0" border="0" bgcolor="#ffffff" style="background-color: #ffffff !important;"> <tr id="_MessageRow_{thisID}" style="' + (this.ShowMessageRow ? "" : "display:none") + '"> <td valign="top" height="50"><table width="100%" cellspacing="0" cellpadding="0" border="0" class="dialog_bg" id="_MessageTable_{thisID}"> <tr> <td width="50" height="50" align="center"><input type="button" class="dialog_messageIcon" id="_MessageIcon_{thisID}"/></td> <td align="left" style="line-height: 16px;"><div id="_MessageTitle_{thisID}" style="font-weight:bold">' + this.MessageTitle + '</div> <div id="_Message_{thisID}">' + this.Message + '</div></td> </tr> </table></td> </tr> <tr> <td valign="top"><div id="_Container_{thisID}" style="text-align:left;position: relative; width: ' + this.Width + "px; height: " + this.Height + 'px;"> <div style="position: absolute; height: 100%; width: 100%; display: none; background-color:#fff; opacity: 0.5;" id="_Covering_{thisID}"> </div> ' + (function (k) {
|
346
|
+
if (k.InnerHtml) {
|
347
|
+
return k.InnerHtml
|
348
|
+
}
|
349
|
+
if (k.URL) {
|
350
|
+
return '<iframe width="100%" height="100%" frameborder="0" style="background-color:#ffffff;border:none 0;" id="_DialogFrame_' + k.ID + '" ' + (k.InnerFrameName ? 'name="' + k.InnerFrameName + '"' : "") + ' src="' + k.displacePath() + '"></iframe>'
|
351
|
+
}
|
352
|
+
return ""
|
353
|
+
})(this) + ' </div></td> </tr> <tr id="_ButtonRow_{thisID}" style="' + (this.ShowButtonRow ? "" : "display:none") + '"> <td height="36"><div id="_DialogButtons_{thisID}" style="border-top: 1px solid #DADEE5; padding: 8px 20px; text-align: right; background-color:#f6f6f6;"> <input type="button" style="' + (this.ShowOkButton ? "" : "display:none") + '" value="' + this.OkButtonText + '" id="_ButtonOK_{thisID}"/> <input type="button" style="' + (this.ShowCancelButton ? "" : "display:none") + '" value="' + this.CancelButtonText + '" onclick="Dialog.getInstance(\'{thisID}\').close();" id="_ButtonCancel_{thisID}"/> </div></td> </tr> </table></div></td> </tr> </table></div>'
|
354
|
+
} else {
|
355
|
+
if (this.Style == "simpleTip") {
|
356
|
+
f = ' <table id="_DialogTable_{thisID}" width="' + (this.Width + 26) + '" cellspacing="0" cellpadding="0" border="0" style="font-size:12px; line-height:1.4;border-collapse: collapse;"> <tr id="_Draghandle_{thisID}" onselectstart="return false;" style="-moz-user-select: -moz-none; ' + (this.Drag ? "cursor: move;" : "") + '"> <td ><div class="dialog_sample_top"><div style="padding: 9px 0 0 4px; float: left; "><span id="_Title_{thisID}">' + this.Title + '</span></div> <div id="_ButtonClose_{thisID}" onclick="fixProgress();Dialog.getInstance(\'{thisID}\').cancelButton.onclick.apply(Dialog.getInstance(\'{thisID}\').cancelButton,[]);" class="dialog__simple_closebtn" style=" ' + (ielt7 ? "margin-top: 3px;" : "") + (this.ShowCloseButton ? "" : "display:none;") + '"></div></div></td> </tr> <tr valign="top"> <td align="center"><div class="dialog_tip_middle"><table width="100%" cellspacing="0" cellpadding="0" border="0" bgcolor="#ffffff" style="background-color: #ffffff !important;"> <tr id="_MessageRow_{thisID}" style="' + (this.ShowMessageRow ? "" : "display:none") + '"> <td valign="top" height="50"><table width="100%" cellspacing="0" cellpadding="0" border="0" class="dialog_bg" id="_MessageTable_{thisID}"> <tr> <td width="50" height="50" align="center"><input type="button" class="dialog_messageIcon" id="_MessageIcon_{thisID}"/></td> <td align="left" style="line-height: 16px;"><div id="_MessageTitle_{thisID}" style="font-weight:bold">' + this.MessageTitle + '</div> <div id="_Message_{thisID}">' + this.Message + '</div></td> </tr> </table></td> </tr> <tr> <td valign="top"><div id="_Container_{thisID}" style="text-align:left;position: relative; width: ' + this.Width + "px; height: " + this.Height + 'px;"> <div style="position: absolute; height: 100%; width: 100%; display: none; background-color:#fff; opacity: 0.5;" id="_Covering_{thisID}"> </div> ' + (function (k) {
|
357
|
+
if (k.InnerHtml) {
|
358
|
+
return k.InnerHtml
|
359
|
+
}
|
360
|
+
if (k.URL) {
|
361
|
+
return '<iframe width="100%" height="100%" frameborder="0" style="background-color:#ffffff;border:none 0;" id="_DialogFrame_' + k.ID + '" ' + (k.InnerFrameName ? 'name="' + k.InnerFrameName + '"' : "") + ' src="' + k.displacePath() + '"></iframe>'
|
362
|
+
}
|
363
|
+
return ""
|
364
|
+
})(this) + ' </div></td> </tr> <tr id="_ButtonRow_{thisID}" style="' + (this.ShowButtonRow ? "" : "display:none") + '"> <td height="36"><div id="_DialogButtons_{thisID}" style="border-top: 1px solid #DADEE5; padding: 8px 20px; text-align: right; background-color:#f6f6f6;"> <input type="button" style="' + (this.ShowOkButton ? "" : "display:none") + '" value="' + this.OkButtonText + '" id="_ButtonOK_{thisID}"/> <input type="button" style="' + (this.ShowCancelButton ? "" : "display:none") + '" value="' + this.CancelButtonText + '" onclick="Dialog.getInstance(\'{thisID}\').close();" id="_ButtonCancel_{thisID}"/> </div></td> </tr> </table></div></td> </tr> <tr> <td><div class="dialog_tip_bottom"><div class="dialog_tip_bottomArr"></div></div></td> </tr> </table></div>'
|
365
|
+
} else {
|
366
|
+
if (this.Style == "shadowTip") {
|
367
|
+
var i = this.Height + 95;
|
368
|
+
f = ' <table><tr><td><div class="dialog_shadow_content"><table id="_DialogTable_{thisID}" width="' + (this.Width) + '" cellspacing="0" cellpadding="0" border="0" style="font-size:12px; line-height:1.4;border-collapse: collapse;background-color: #ffffff !important;"> <tr id="_Draghandle_{thisID}" onselectstart="return false;" style="-moz-user-select: -moz-none; ' + (this.Drag ? "cursor: move;" : "") + '"> <td><div class="dialog_shadow_content_top"><div style="padding: 9px 0 0 4px; float: left; "><span id="_Title_{thisID}">' + this.Title + '</span></div> <div id="_ButtonClose_{thisID}" onclick="fixProgress();Dialog.getInstance(\'{thisID}\').cancelButton.onclick.apply(Dialog.getInstance(\'{thisID}\').cancelButton,[]);" class="dialog__simple_closebtn" style=" ' + (ielt7 ? "margin-top: 3px;" : "") + (this.ShowCloseButton ? "" : "display:none;") + '"></div></div></td> </tr> <tr valign="top"> <td align="center"><table width="100%" cellspacing="0" cellpadding="0" border="0" bgcolor="#ffffff" style="background-color: #ffffff !important;"> <tr id="_MessageRow_{thisID}" style="' + (this.ShowMessageRow ? "" : "display:none") + '"> <td valign="top" height="50"><table width="100%" cellspacing="0" cellpadding="0" border="0" class="dialog_bg" id="_MessageTable_{thisID}"> <tr> <td width="50" height="50" align="center"><input type="button" class="dialog_messageIcon" id="_MessageIcon_{thisID}"/></td> <td align="left" style="line-height: 16px;"><div id="_MessageTitle_{thisID}" style="font-weight:bold">' + this.MessageTitle + '</div> <div id="_Message_{thisID}">' + this.Message + '</div></td> </tr> </table></td> </tr> <tr> <td valign="top"><div id="_Container_{thisID}" style="text-align:left;position: relative; width: ' + (this.Width) + "px; height: " + this.Height + 'px;background:#ffffff"> <div style="position: absolute; height: 100%; width: 100%; display: none; background-color:#fff; opacity: 0.5;" id="_Covering_{thisID}"> </div> ' + (function (k) {
|
369
|
+
if (k.InnerHtml) {
|
370
|
+
return k.InnerHtml
|
371
|
+
}
|
372
|
+
if (k.URL) {
|
373
|
+
return '<iframe width="100%" height="100%" frameborder="0" style="background-color:#ffffff;border:none 0;" id="_DialogFrame_' + k.ID + '" ' + (k.InnerFrameName ? 'name="' + k.InnerFrameName + '"' : "") + ' src="' + k.displacePath() + '"></iframe>'
|
374
|
+
}
|
375
|
+
return ""
|
376
|
+
})(this) + ' </div></td> </tr> <tr id="_ButtonRow_{thisID}" style="' + (this.ShowButtonRow ? "" : "display:none") + '"> <td height="36"><div id="_DialogButtons_{thisID}" style="border-top: 1px solid #DADEE5; padding: 8px 20px; text-align: right; background-color:#f6f6f6;"> <input type="button" style="' + (this.ShowOkButton ? "" : "display:none") + '" value="' + this.OkButtonText + '" id="_ButtonOK_{thisID}"/> <input type="button" style="' + (this.ShowCancelButton ? "" : "display:none") + '" value="' + this.CancelButtonText + '" onclick="Dialog.getInstance(\'{thisID}\').close();" id="_ButtonCancel_{thisID}"/> </div></td> </tr> </table></td> </tr> </table> </div><div><table cellpadding="0" cellspacing="0" width="' + (this.Width + 120) + '" height="' + i + '"><tr><td class="dialog_shadow_lt"> </td><td class="dialog_shadow_ct"> </td><td class="dialog_shadow_rt"> </td></tr> <tr><td class="dialog_shadow_lm" height="' + (this.Height + 95 - 39 - 130) + '"> </td><td class="dialog_shadow_cm"> </td><td class="dialog_shadow_rm"> </td></tr> <tr><td class="dialog_shadow_lb"> </td><td class="dialog_shadow_cb"> </td><td class="dialog_shadow_rb"> </td></tr></table> </div></td></tr></table></div>'
|
377
|
+
} else {
|
378
|
+
if (this.Style == "custom") {
|
379
|
+
f = ' <table id="_DialogTable_{thisID}" width="' + (this.Width + 26) + '" cellspacing="0" cellpadding="0" border="0" style="font-size:12px; line-height:1.4;border-collapse: collapse;""> <tr id="_Draghandle_{thisID}" style="display:none;" onselectstart="return false;" style="-moz-user-select: -moz-none; ' + (this.Drag ? "cursor: move;" : "") + '"> </tr> <tr> <td valign="top"><div id="_Container_{thisID}" style="text-align:left;position: relative; width: ' + this.Width + "px; height: " + this.Height + 'px;background: #ffffff"> <div style="position: absolute; height: 100%; width: 100%; display: none; background-color:#fff; opacity: 0.5;" id="_Covering_{thisID}"> </div> ' + (function (k) {
|
380
|
+
if (k.InnerHtml) {
|
381
|
+
return k.InnerHtml
|
382
|
+
}
|
383
|
+
if (k.URL) {
|
384
|
+
return '<iframe width="100%" height="100%" frameborder="0" style="border:none 0;" id="_DialogFrame_' + k.ID + '" ' + (k.InnerFrameName ? 'name="' + k.InnerFrameName + '"' : "") + ' src="' + k.displacePath() + '"></iframe>'
|
385
|
+
}
|
386
|
+
return ""
|
387
|
+
})(this) + ' </div></td> </tr> <tr id="_ButtonRow_{thisID}" style="display:none;" > <td height="36"><div id="_DialogButtons_{thisID}" style="border-top: 1px solid #DADEE5; padding: 8px 20px; text-align: right; background-color:#f6f6f6;"> <input type="button" style="' + (this.ShowOkButton ? "" : "display:none") + '" value="' + this.OkButtonText + '" id="_ButtonOK_{thisID}"/> <input type="button" style="' + (this.ShowCancelButton ? "" : "display:none") + '" value="' + this.CancelButtonText + '" onclick="Dialog.getInstance(\'{thisID}\').close();" id="_ButtonCancel_{thisID}"/> </div></td> </tr> </table></div></td> </tr> </table></div>'
|
388
|
+
}
|
389
|
+
}
|
390
|
+
}
|
391
|
+
}
|
392
|
+
}
|
393
|
+
f = f.replace(/\{IMAGESPATH\}/gm, IMAGESPATH).replace(/\{thisID\}/gm, this.ID);
|
394
|
+
var a = topWin.$id("_DialogDiv_" + this.ID);
|
395
|
+
if (!a) {
|
396
|
+
a = topDoc.createElement("div");
|
397
|
+
a.id = "_DialogDiv_" + this.ID;
|
398
|
+
topDoc.getElementsByTagName("BODY")[0].appendChild(a)
|
399
|
+
}
|
400
|
+
if (isIE && topDoc.compatMode == "BackCompat" || ielt7) {
|
401
|
+
a.style.position = "absolute";
|
402
|
+
this.fixedPosition = false
|
403
|
+
} else {
|
404
|
+
a.style.position = "fixed";
|
405
|
+
this.fixedPosition = true
|
406
|
+
}
|
407
|
+
a.style.left = "-9999px";
|
408
|
+
a.style.top = "-9999px";
|
409
|
+
a.innerHTML = f;
|
410
|
+
$(a).attr("AllowChangeIndex", this.AllowChangeIndex);
|
411
|
+
$(a).attr("MinToTask", this.MinToTask);
|
412
|
+
$(a).attr("taskId", "task_" + this.ID);
|
413
|
+
$(a).bind("click", function () {
|
414
|
+
if ($(this).attr("AllowChangeIndex") == true || $(this).attr("AllowChangeIndex") == "true") {
|
415
|
+
maxIndex = maxIndex + topWin.Dialog._dialogArray.length + 2;
|
416
|
+
$(this)[0].style.zIndex = maxIndex;
|
417
|
+
if ($(this).attr("MinToTask") == true || $(this).attr("MinToTask") == "true") {
|
418
|
+
var l = topWin.Dialog._taskArray;
|
419
|
+
var k = getArrayPosition($(this).attr("taskId"), l);
|
420
|
+
if (k != -1) {
|
421
|
+
l.splice(k, 1);
|
422
|
+
l.push($(this).attr("taskId"))
|
423
|
+
}
|
424
|
+
var n = getTaskTarget();
|
425
|
+
if (n != "") {
|
426
|
+
var m = $("#" + n);
|
427
|
+
setTaskCurrent(m, l)
|
428
|
+
}
|
429
|
+
}
|
430
|
+
}
|
431
|
+
});
|
432
|
+
if (this.InvokeElementId) {
|
433
|
+
var d = $id(this.InvokeElementId);
|
434
|
+
d.style.position = "";
|
435
|
+
d.style.display = "";
|
436
|
+
if (isIE) {
|
437
|
+
var h = topDoc.createElement("div");
|
438
|
+
h.innerHTML = d.outerHTML;
|
439
|
+
d.outerHTML = "";
|
440
|
+
topWin.$id("_Covering_" + this.ID).parentNode.appendChild(h)
|
441
|
+
} else {
|
442
|
+
topWin.$id("_Covering_" + this.ID).parentNode.appendChild(d)
|
443
|
+
}
|
444
|
+
}
|
445
|
+
this.openerWindow = window;
|
446
|
+
if (window.ownerDialog) {
|
447
|
+
this.openerDialog = window.ownerDialog
|
448
|
+
}
|
449
|
+
if (this.URL) {
|
450
|
+
if (topWin.$id("_DialogFrame_" + this.ID)) {
|
451
|
+
this.innerFrame = topWin.$id("_DialogFrame_" + this.ID)
|
452
|
+
}
|
453
|
+
var j = this;
|
454
|
+
this.innerFrameOnload = function () {
|
455
|
+
j.innerWin = j.innerFrame.contentWindow;
|
456
|
+
try {
|
457
|
+
j.innerWin.ownerDialog = j;
|
458
|
+
j.innerDoc = j.innerWin.document;
|
459
|
+
if (j.Title == " " && j.innerDoc && j.innerDoc.title) {
|
460
|
+
if (j.innerDoc.title) {
|
461
|
+
topWin.$id("_Title_" + j.ID).innerHTML = j.innerDoc.title
|
462
|
+
}
|
463
|
+
}
|
464
|
+
} catch (k) {
|
465
|
+
if (window.console && window.console.log) {
|
466
|
+
console.log("可能存在访问限制,不能获取到浮动窗口中的文档对象。")
|
467
|
+
}
|
468
|
+
j.unauthorized = true
|
469
|
+
}
|
470
|
+
if (typeof (j.OnLoad) == "function") {
|
471
|
+
j.OnLoad()
|
472
|
+
}
|
473
|
+
};
|
474
|
+
if (!isGecko) {
|
475
|
+
this.innerFrame.attachEvent("onreadystatechange", function () {
|
476
|
+
if ((/loaded|complete/).test(j.innerFrame.readyState)) {
|
477
|
+
j.innerFrameOnload()
|
478
|
+
}
|
479
|
+
})
|
480
|
+
} else {
|
481
|
+
this.innerFrame.onload = j.innerFrameOnload
|
482
|
+
}
|
483
|
+
}
|
484
|
+
topWin.$id("_DialogDiv_" + this.ID).dialogId = this.ID;
|
485
|
+
topWin.$id("_DialogDiv_" + this.ID).dialogInstance = this;
|
486
|
+
this.attachBehaviors();
|
487
|
+
this.okButton = topWin.$id("_ButtonOK_" + this.ID);
|
488
|
+
this.cancelButton = topWin.$id("_ButtonCancel_" + this.ID);
|
489
|
+
this.maxButton = topWin.$id("_ButtonMax_" + this.ID);
|
490
|
+
this.minButton = topWin.$id("_ButtonMin_" + this.ID);
|
491
|
+
$(a).find("input[type='button']").each(function () {
|
492
|
+
if (!$(this).attr("class")) {
|
493
|
+
$(this).addClass("button");
|
494
|
+
$(this).hover(function () {
|
495
|
+
$(this).addClass("button_hover")
|
496
|
+
}, function () {
|
497
|
+
$(this).removeClass("button_hover")
|
498
|
+
})
|
499
|
+
}
|
500
|
+
});
|
501
|
+
if ($(a).find(".progressBar").length == 0) {
|
502
|
+
if ($(a).find(".button").parents("tr")[0].style.display == "none") {
|
503
|
+
$(a).find(".icon_dialog").eq(0).focus()
|
504
|
+
} else {
|
505
|
+
$(a).find(".button").eq(0).focus()
|
506
|
+
}
|
507
|
+
}
|
508
|
+
a = null
|
509
|
+
};
|
510
|
+
Dialog.prototype.setSize = function (a, b) {
|
511
|
+
if (a && +a > 20) {
|
512
|
+
this.Width = +a;
|
513
|
+
topWin.$id("_DialogTable_" + this.ID).width = this.Width + 26;
|
514
|
+
topWin.$id("_Container_" + this.ID).style.width = this.Width + "px"
|
515
|
+
}
|
516
|
+
if (b && +b > 10) {
|
517
|
+
this.Height = +b;
|
518
|
+
topWin.$id("_Container_" + this.ID).style.height = this.Height + "px"
|
519
|
+
}
|
520
|
+
this.setPosition()
|
521
|
+
};
|
522
|
+
Dialog.prototype.max = function () {
|
523
|
+
var d = $("#_DialogDiv_" + this.ID);
|
524
|
+
var c = $("#_DialogTable_" + this.ID).find(">tbody").find(">tr").eq(1);
|
525
|
+
if (c[0].style.display == "none") {
|
526
|
+
c.show();
|
527
|
+
$("#_Draghandle_" + this.ID).find(".dialog_minbtn").removeClass("dialog_decreasebtn");
|
528
|
+
$("#_Draghandle_" + this.ID).find(".dialog_minbtn").attr("title", "最小化")
|
529
|
+
}
|
530
|
+
if (this.maxFlag == true) {
|
531
|
+
topWin.$id("_DialogTable_" + this.ID).style.width = this.Width + 26;
|
532
|
+
topWin.$id("_Container_" + this.ID).style.width = this.Width + "px";
|
533
|
+
topWin.$id("_Container_" + this.ID).style.height = this.Height + "px";
|
534
|
+
$("#_Draghandle_" + this.ID).find(".dialog_maxbtn").removeClass("dialog_decreasebtn");
|
535
|
+
$("#_Draghandle_" + this.ID).find(".dialog_maxbtn").attr("title", "最大化");
|
536
|
+
this.maxFlag = false;
|
537
|
+
if (this.DecreaseResetPosition) {
|
538
|
+
this.setPosition()
|
539
|
+
} else {
|
540
|
+
d[0].style.left = d.attr("oldleft");
|
541
|
+
d[0].style.top = d.attr("oldtop")
|
542
|
+
}
|
543
|
+
} else {
|
544
|
+
d.attr("oldleft", d[0].style.left);
|
545
|
+
d.attr("oldtop", d[0].style.top);
|
546
|
+
var b = window.document.documentElement.clientHeight;
|
547
|
+
var a = window.document.documentElement.clientWidth;
|
548
|
+
topWin.$id("_DialogTable_" + this.ID).style.width = a;
|
549
|
+
topWin.$id("_Container_" + this.ID).style.width = a - 26 + "px";
|
550
|
+
if ($("#_ButtonRow_" + this.ID)[0].style.display == "none") {
|
551
|
+
topWin.$id("_Container_" + this.ID).style.height = b - 46 + "px"
|
552
|
+
} else {
|
553
|
+
topWin.$id("_Container_" + this.ID).style.height = b - 46 - $("#_ButtonRow_" + this.ID).height() + "px"
|
554
|
+
}
|
555
|
+
$("#_Draghandle_" + this.ID).find(".dialog_maxbtn").addClass("dialog_decreasebtn");
|
556
|
+
$("#_Draghandle_" + this.ID).find(".dialog_maxbtn").attr("title", "还原");
|
557
|
+
if (this.MinToTask == true || this.MinToTask == "true") {
|
558
|
+
this.Left = 0;
|
559
|
+
this.Top = 0
|
560
|
+
}
|
561
|
+
this.maxFlag = true;
|
562
|
+
this.setPosition()
|
563
|
+
}
|
564
|
+
};
|
565
|
+
Dialog.prototype.minHandler = function () {
|
566
|
+
if (this.MinToTask == true || this.MinToTask == "true") {
|
567
|
+
this.minToTask()
|
568
|
+
} else {
|
569
|
+
this.min()
|
570
|
+
}
|
571
|
+
};
|
572
|
+
Dialog.prototype.min = function () {
|
573
|
+
var a = $("#_DialogTable_" + this.ID).find(">tbody").find(">tr").eq(1);
|
574
|
+
if (a[0].style.display == "none") {
|
575
|
+
topWin.$id("_DialogTable_" + this.ID).width = this.Width + 26;
|
576
|
+
topWin.$id("_Container_" + this.ID).style.width = this.Width + "px";
|
577
|
+
topWin.$id("_Container_" + this.ID).style.height = this.Height + "px";
|
578
|
+
$("#_Draghandle_" + this.ID).find(".dialog_minbtn").removeClass("dialog_decreasebtn");
|
579
|
+
$("#_Draghandle_" + this.ID).find(".dialog_minbtn").attr("title", "最小化");
|
580
|
+
a.show();
|
581
|
+
if (this.DecreaseResetPosition) {
|
582
|
+
this.setPosition()
|
583
|
+
}
|
584
|
+
this.minFlag = false
|
585
|
+
} else {
|
586
|
+
topWin.$id("_DialogTable_" + this.ID).style.width = 200 + 26 + "px";
|
587
|
+
topWin.$id("_Container_" + this.ID).style.width = 200 + "px";
|
588
|
+
$("#_Draghandle_" + this.ID).find(".dialog_minbtn").addClass("dialog_decreasebtn");
|
589
|
+
$("#_Draghandle_" + this.ID).find(".dialog_minbtn").attr("title", "还原");
|
590
|
+
a.hide();
|
591
|
+
this.minFlag = true
|
592
|
+
}
|
593
|
+
this.maxFlag = false
|
594
|
+
};
|
595
|
+
Dialog.prototype.minToTask = function () {
|
596
|
+
var c = $("#_DialogDiv_" + this.ID);
|
597
|
+
var i = getTaskTarget();
|
598
|
+
var g = this.ID;
|
599
|
+
if (i != "") {
|
600
|
+
var f = $("#" + i);
|
601
|
+
var j = c[0].style.left;
|
602
|
+
var b = c[0].style.top;
|
603
|
+
var d = c.width();
|
604
|
+
var h = c.height();
|
605
|
+
var a = $('<div class="dialogMinEffect"/>');
|
606
|
+
a.css({
|
607
|
+
width: d,
|
608
|
+
height: h,
|
609
|
+
left: j,
|
610
|
+
top: b
|
611
|
+
}).animate({
|
612
|
+
width: 0,
|
613
|
+
height: 0,
|
614
|
+
left: f.find("#task_" + this.ID).offset().left + "px",
|
615
|
+
top: top.window.document.documentElement.clientHeight + "px",
|
616
|
+
opacity: 0
|
617
|
+
}, 200, function () {
|
618
|
+
a.remove();
|
619
|
+
var l = topWin.Dialog._taskArray;
|
620
|
+
var k = getArrayPosition("task_" + g, l);
|
621
|
+
if (k != -1) {
|
622
|
+
l.splice(k, 1)
|
623
|
+
}
|
624
|
+
setTaskCurrent(f, l)
|
625
|
+
})
|
626
|
+
}
|
627
|
+
c.hide();
|
628
|
+
$("body").append(a)
|
629
|
+
};
|
630
|
+
Dialog.prototype.show = function () {
|
631
|
+
var j = topWin.$id("_DialogDiv_" + this.ID);
|
632
|
+
if (j) {
|
633
|
+
maxIndex = maxIndex + topWin.Dialog._dialogArray.length + 2;
|
634
|
+
$(j)[0].style.zIndex = maxIndex;
|
635
|
+
if (this.MinToTask == true || this.MinToTask == "true") {
|
636
|
+
var f = topWin.Dialog._taskArray;
|
637
|
+
var u = $(j)[0].style.left;
|
638
|
+
var d = $(j)[0].style.top;
|
639
|
+
var i = $(j).width();
|
640
|
+
var t = $(j).height();
|
641
|
+
var s = $('<div class="dialogMinEffect"/>');
|
642
|
+
var c = getArrayPosition("task_" + this.ID, f);
|
643
|
+
if (c != -1) {
|
644
|
+
f.splice(c, 1);
|
645
|
+
f.push("task_" + this.ID)
|
646
|
+
} else {
|
647
|
+
f.push("task_" + this.ID)
|
648
|
+
}
|
649
|
+
var o = getTaskTarget();
|
650
|
+
var p;
|
651
|
+
if (o != "") {
|
652
|
+
p = $("#" + o);
|
653
|
+
setTaskCurrent(p, f)
|
654
|
+
}
|
655
|
+
if ($(j)[0].style.display == "none") {
|
656
|
+
s.css({
|
657
|
+
width: 0,
|
658
|
+
height: 0,
|
659
|
+
left: p.find("#task_" + this.ID).offset().left + "px",
|
660
|
+
top: top.window.document.documentElement.clientHeight + "px"
|
661
|
+
}).animate({
|
662
|
+
width: i,
|
663
|
+
height: t,
|
664
|
+
left: u,
|
665
|
+
top: d
|
666
|
+
}, 200, function () {
|
667
|
+
$(j).show();
|
668
|
+
s.remove()
|
669
|
+
});
|
670
|
+
$("body").append(s)
|
671
|
+
} else {
|
672
|
+
if (this.ID != f[f.length - 1]) {}
|
673
|
+
}
|
674
|
+
}
|
675
|
+
return
|
676
|
+
}
|
677
|
+
this.create();
|
678
|
+
var g = this.getBgdiv(),
|
679
|
+
r = this.getDialogDiv();
|
680
|
+
r.style.zIndex = this.zindex = parseInt(Dialog.bgDiv.style.zIndex) + 1;
|
681
|
+
if (topWin.Dialog._dialogArray.length > 0) {
|
682
|
+
maxIndex = maxIndex + topWin.Dialog._dialogArray.length + 2;
|
683
|
+
r.style.zIndex = maxIndex
|
684
|
+
} else {
|
685
|
+
g.style.display = "none";
|
686
|
+
if (HideScrollbar) {
|
687
|
+
var k = topDoc.getElementsByTagName(topDoc.compatMode == "BackCompat" ? "BODY" : "HTML")[0];
|
688
|
+
k.styleOverflow = k.style.overflow;
|
689
|
+
if (window.navigator.userAgent.indexOf("Firefox/3.6") != -1) {
|
690
|
+
var v = k.scrollTop;
|
691
|
+
k.style.overflow = "hidden";
|
692
|
+
k.scrollTop = v
|
693
|
+
} else {
|
694
|
+
k.style.overflow = "hidden"
|
695
|
+
}
|
696
|
+
}
|
697
|
+
}
|
698
|
+
topWin.Dialog._dialogArray.push(this);
|
699
|
+
Dialog._childDialogArray.push(this);
|
700
|
+
if (Dialog._childDialogArray.length == 1) {
|
701
|
+
if (window.ownerDialog) {
|
702
|
+
ownerDialog.hiddenCloseButton()
|
703
|
+
}
|
704
|
+
}
|
705
|
+
if (this.CancelEvent) {
|
706
|
+
this.cancelButton.onclick = this.CancelEvent
|
707
|
+
}
|
708
|
+
var q = this;
|
709
|
+
if (this.OKEvent) {
|
710
|
+
this.okButton.onclick = this.OKEvent
|
711
|
+
}
|
712
|
+
if (this.maxButton) {
|
713
|
+
this.maxButton.onclick = function () {
|
714
|
+
if (q.maxFlag) {
|
715
|
+
if (q.DecreaseEvent) {
|
716
|
+
$(q.DecreaseEvent)
|
717
|
+
}
|
718
|
+
} else {
|
719
|
+
if (q.MaxEvent) {
|
720
|
+
$(q.MaxEvent)
|
721
|
+
}
|
722
|
+
}
|
723
|
+
q.max()
|
724
|
+
}
|
725
|
+
}
|
726
|
+
if (this.minButton) {
|
727
|
+
this.minButton.onclick = function () {
|
728
|
+
if (q.minFlag) {
|
729
|
+
if (q.DecreaseEvent) {
|
730
|
+
$(q.DecreaseEvent)
|
731
|
+
}
|
732
|
+
} else {
|
733
|
+
if (q.MinEvent) {
|
734
|
+
$(q.MinEvent)
|
735
|
+
}
|
736
|
+
}
|
737
|
+
q.minHandler()
|
738
|
+
}
|
739
|
+
}
|
740
|
+
if (this.AutoClose && this.AutoClose > 0) {
|
741
|
+
this.autoClose()
|
742
|
+
}
|
743
|
+
this.opened = true;
|
744
|
+
this.setPosition();
|
745
|
+
if (this.MinToTask == true || this.MinToTask == "true") {
|
746
|
+
this.Modal = false;
|
747
|
+
this.ResizeResetPosition = false;
|
748
|
+
this.DecreaseResetPosition = false;
|
749
|
+
this.AllowChangeIndex = true;
|
750
|
+
var l = $("#_DialogDiv_" + this.ID);
|
751
|
+
var b = getTaskTarget();
|
752
|
+
if (b != "") {
|
753
|
+
var n = $("#" + b);
|
754
|
+
if (n[0]) {
|
755
|
+
if (n[0].style.display == "none") {
|
756
|
+
n.fadeIn(500);
|
757
|
+
$("body").trigger("dialogTaskShow")
|
758
|
+
}
|
759
|
+
}
|
760
|
+
var a = $('<a class="dialogTaskItem"><span keepDefaultStyle="true" class="dialogTaskItemRight"><span class="dialogTaskItemIcon"></span></span></a>');
|
761
|
+
a.attr("id", "task_" + this.ID);
|
762
|
+
var m = a.find(".dialogTaskItemIcon");
|
763
|
+
m.text(this.Title);
|
764
|
+
m.attr("title", this.Title);
|
765
|
+
if (this.IconSrc != "") {
|
766
|
+
m.css({
|
767
|
+
paddingLeft: "18px",
|
768
|
+
backgroundPositon: "0 40%",
|
769
|
+
backgroundRepeat: "no-repeat",
|
770
|
+
backgroundImage: "url(" + this.IconSrc + ")"
|
771
|
+
})
|
772
|
+
} else {
|
773
|
+
if (this.IconClass != "") {
|
774
|
+
m.addClass(this.IconClass)
|
775
|
+
}
|
776
|
+
}
|
777
|
+
n.find(".taskItemContainer").append(a);
|
778
|
+
itemTotalWidth = itemTotalWidth + a.width() + 8;
|
779
|
+
resetDialogTask();
|
780
|
+
var h = topWin.Dialog._taskArray;
|
781
|
+
if (getArrayPosition("task_" + this.ID, h) == -1) {
|
782
|
+
h.push("task_" + this.ID)
|
783
|
+
}
|
784
|
+
this.Left = l.offset().left + h.length * 20;
|
785
|
+
this.Top = l.offset().top + h.length * 20;
|
786
|
+
setTaskCurrent(n, h);
|
787
|
+
a.bind("click", function () {
|
788
|
+
var C = topWin.Dialog._taskArray;
|
789
|
+
var x = getArrayPosition($(this).attr("id"), C);
|
790
|
+
var w = l[0].style.left;
|
791
|
+
var A = l[0].style.top;
|
792
|
+
var B = l.width();
|
793
|
+
var z = l.height();
|
794
|
+
var y = $('<div class="dialogMinEffect"/>');
|
795
|
+
if (l[0].style.display == "none") {
|
796
|
+
maxIndex = maxIndex + topWin.Dialog._dialogArray.length + 2;
|
797
|
+
l[0].style.zIndex = maxIndex;
|
798
|
+
if (x == -1) {
|
799
|
+
C.push($(this).attr("id"))
|
800
|
+
} else {
|
801
|
+
C.splice(x, 1);
|
802
|
+
C.push($(this).attr("id"))
|
803
|
+
}
|
804
|
+
y.css({
|
805
|
+
width: 0,
|
806
|
+
height: 0,
|
807
|
+
left: $(this).offset().left + "px",
|
808
|
+
top: top.window.document.documentElement.clientHeight + "px"
|
809
|
+
}).animate({
|
810
|
+
width: B,
|
811
|
+
height: z,
|
812
|
+
left: w,
|
813
|
+
top: A
|
814
|
+
}, 200, function () {
|
815
|
+
l.show();
|
816
|
+
y.remove()
|
817
|
+
});
|
818
|
+
$("body").append(y);
|
819
|
+
setTaskCurrent(n, C)
|
820
|
+
} else {
|
821
|
+
if ($(this).attr("id") != C[C.length - 1]) {
|
822
|
+
maxIndex = maxIndex + topWin.Dialog._dialogArray.length + 2;
|
823
|
+
l[0].style.zIndex = maxIndex;
|
824
|
+
if (x == -1) {
|
825
|
+
C.push($(this).attr("id"))
|
826
|
+
} else {
|
827
|
+
C.splice(x, 1);
|
828
|
+
C.push($(this).attr("id"))
|
829
|
+
}
|
830
|
+
setTaskCurrent(n, C)
|
831
|
+
} else {
|
832
|
+
y.css({
|
833
|
+
width: B,
|
834
|
+
height: z,
|
835
|
+
left: w,
|
836
|
+
top: A
|
837
|
+
}).animate({
|
838
|
+
width: 0,
|
839
|
+
height: 0,
|
840
|
+
left: $(this).offset().left + "px",
|
841
|
+
top: top.window.document.documentElement.clientHeight + "px",
|
842
|
+
opacity: 0
|
843
|
+
}, 200, function () {
|
844
|
+
y.remove();
|
845
|
+
setTaskCurrent(n, C)
|
846
|
+
});
|
847
|
+
$("body").append(y);
|
848
|
+
l.hide();
|
849
|
+
C.pop($(this).attr("id"))
|
850
|
+
}
|
851
|
+
}
|
852
|
+
})
|
853
|
+
}
|
854
|
+
this.setPosition()
|
855
|
+
}
|
856
|
+
if (this.Modal) {
|
857
|
+
g.style.zIndex = r.style.zIndex - 1;
|
858
|
+
Dialog.setBgDivSize();
|
859
|
+
g.style.display = ""
|
860
|
+
}
|
861
|
+
g = null
|
862
|
+
};
|
863
|
+
Dialog.prototype.close = function () {
|
864
|
+
if (this.unauthorized == false) {
|
865
|
+
if (this.innerWin && this.innerWin.Dialog && this.innerWin.Dialog._childDialogArray.length > 0) {
|
866
|
+
return
|
867
|
+
}
|
868
|
+
}
|
869
|
+
var n = this.getDialogDiv();
|
870
|
+
if (this == topWin.Dialog._dialogArray[topWin.Dialog._dialogArray.length - 1]) {
|
871
|
+
var k = topWin.Dialog._dialogArray.pop()
|
872
|
+
} else {
|
873
|
+
removeWinArray(topWin.Dialog._dialogArray, this)
|
874
|
+
}
|
875
|
+
removeWinArray(Dialog._childDialogArray, this);
|
876
|
+
if (Dialog._childDialogArray.length == 0) {
|
877
|
+
if (window.ownerDialog) {
|
878
|
+
ownerDialog.showCloseButton()
|
879
|
+
}
|
880
|
+
}
|
881
|
+
if (this.InvokeElementId) {
|
882
|
+
var h = topWin.$id(this.InvokeElementId);
|
883
|
+
h.style.display = "none";
|
884
|
+
if (isIE) {
|
885
|
+
var j = document.createElement("div");
|
886
|
+
j.innerHTML = h.outerHTML;
|
887
|
+
h.outerHTML = "";
|
888
|
+
document.getElementsByTagName("BODY")[0].appendChild(j)
|
889
|
+
} else {
|
890
|
+
document.getElementsByTagName("BODY")[0].appendChild(h)
|
891
|
+
}
|
892
|
+
}
|
893
|
+
if (topWin.Dialog._dialogArray.length > 0) {
|
894
|
+
if (this.Modal && k) {
|
895
|
+
var i = topWin.Dialog._dialogArray.length;
|
896
|
+
var c = true;
|
897
|
+
while (i) {
|
898
|
+
--i;
|
899
|
+
if (topWin.Dialog._dialogArray[i].Modal) {
|
900
|
+
Dialog.bgDiv.style.zIndex = topWin.Dialog._dialogArray[i].zindex - 1;
|
901
|
+
c = false;
|
902
|
+
break
|
903
|
+
}
|
904
|
+
}
|
905
|
+
if (c) {
|
906
|
+
Dialog.bgDiv.style.display = "none"
|
907
|
+
}
|
908
|
+
}
|
909
|
+
} else {
|
910
|
+
Dialog.bgDiv.style.zIndex = "900";
|
911
|
+
Dialog.bgDiv.style.display = "none";
|
912
|
+
if (HideScrollbar) {
|
913
|
+
var d = topDoc.getElementsByTagName(topDoc.compatMode == "BackCompat" ? "BODY" : "HTML")[0];
|
914
|
+
if (d.styleOverflow != undefined) {
|
915
|
+
if (window.navigator.userAgent.indexOf("Firefox/3.6") != -1) {
|
916
|
+
var b = d.scrollTop;
|
917
|
+
if (this.CloseHideScroller) {
|
918
|
+
d.style.overflow = "hidden"
|
919
|
+
} else {
|
920
|
+
d.style.overflow = d.styleOverflow
|
921
|
+
}
|
922
|
+
d.scrollTop = b
|
923
|
+
} else {
|
924
|
+
if (this.CloseHideScroller) {
|
925
|
+
d.style.overflow = "hidden"
|
926
|
+
} else {
|
927
|
+
d.style.overflow = d.styleOverflow
|
928
|
+
}
|
929
|
+
}
|
930
|
+
}
|
931
|
+
}
|
932
|
+
}
|
933
|
+
this.openerWindow.focus();
|
934
|
+
if (isIE && !isIE8) {
|
935
|
+
n.dialogInstance = null;
|
936
|
+
if (this.CancelEvent) {
|
937
|
+
this.cancelButton.onclick = null
|
938
|
+
}
|
939
|
+
if (this.OKEvent) {
|
940
|
+
this.okButton.onclick = null
|
941
|
+
}
|
942
|
+
topWin.$id("_DialogDiv_" + this.ID).onDragStart = null;
|
943
|
+
topWin.$id("_DialogDiv_" + this.ID).onDragEnd = null;
|
944
|
+
topWin.$id("_Draghandle_" + this.ID).onmousedown = null;
|
945
|
+
topWin.$id("_Draghandle_" + this.ID).root = null;
|
946
|
+
n.outerHTML = "";
|
947
|
+
CollectGarbage()
|
948
|
+
} else {
|
949
|
+
var o = topWin.$id("_RycDiv");
|
950
|
+
if (!o) {
|
951
|
+
o = topDoc.createElement("div");
|
952
|
+
o.id = "_RycDiv"
|
953
|
+
}
|
954
|
+
o.appendChild(n);
|
955
|
+
o.innerHTML = "";
|
956
|
+
o = null
|
957
|
+
}
|
958
|
+
this.innerFrame = null;
|
959
|
+
this.bgDiv = null;
|
960
|
+
n = null;
|
961
|
+
this.closed = true;
|
962
|
+
if (this.MinToTask == true || this.MinToTask == "true") {
|
963
|
+
var g = topWin.Dialog._taskArray;
|
964
|
+
var m = getArrayPosition("task_" + this.ID, g);
|
965
|
+
if (m != -1) {
|
966
|
+
g.splice(m, 1)
|
967
|
+
}
|
968
|
+
var l = getTaskTarget();
|
969
|
+
if (l != "") {
|
970
|
+
var f = $("#" + l);
|
971
|
+
var a = f.find("#task_" + this.ID);
|
972
|
+
itemTotalWidth = itemTotalWidth - a.width() - 8;
|
973
|
+
resetDialogTask();
|
974
|
+
a.remove();
|
975
|
+
setTaskCurrent(f, g);
|
976
|
+
if (f.find(".taskItemContainer").html() == "") {
|
977
|
+
f.fadeOut(500);
|
978
|
+
$("body").trigger("dialogTaskHide")
|
979
|
+
}
|
980
|
+
}
|
981
|
+
}
|
982
|
+
};
|
983
|
+
Dialog.prototype.autoClose = function () {
|
984
|
+
if (this.closed) {
|
985
|
+
clearTimeout(this._closeTimeoutId);
|
986
|
+
return
|
987
|
+
}
|
988
|
+
this.AutoClose -= 1;
|
989
|
+
topWin.$id("_Title_" + this.ID).innerHTML = this.AutoClose + " 秒后自动关闭";
|
990
|
+
if (this.AutoClose <= 0) {
|
991
|
+
this.close()
|
992
|
+
} else {
|
993
|
+
var a = this;
|
994
|
+
this._closeTimeoutId = setTimeout(function () {
|
995
|
+
a.autoClose()
|
996
|
+
}, 1000)
|
997
|
+
}
|
998
|
+
};
|
999
|
+
Dialog.getInstance = function (b) {
|
1000
|
+
var a = topWin.$id("_DialogDiv_" + b);
|
1001
|
+
if (!a) {
|
1002
|
+
alert("没有取到对应ID的弹出框页面对象")
|
1003
|
+
}
|
1004
|
+
try {
|
1005
|
+
return a.dialogInstance
|
1006
|
+
} finally {
|
1007
|
+
a = null
|
1008
|
+
}
|
1009
|
+
};
|
1010
|
+
Dialog.prototype.addButton = function (f, a, d) {
|
1011
|
+
topWin.$id("_ButtonRow_" + this.ID).style.display = "";
|
1012
|
+
this.ShowButtonRow = true;
|
1013
|
+
var c = topDoc.createElement("input");
|
1014
|
+
c.id = "_Button_" + this.ID + "_" + f;
|
1015
|
+
c.type = "button";
|
1016
|
+
c.style.cssText = "margin-right:5px";
|
1017
|
+
c.value = a;
|
1018
|
+
c.onclick = d;
|
1019
|
+
var b = topWin.$id("_DialogButtons_" + this.ID).getElementsByTagName("INPUT")[0];
|
1020
|
+
b.parentNode.insertBefore(c, b);
|
1021
|
+
$(c).each(function () {
|
1022
|
+
$(this).addClass("button");
|
1023
|
+
$(this).hover(function () {
|
1024
|
+
$(this).addClass("button_hover")
|
1025
|
+
}, function () {
|
1026
|
+
$(this).removeClass("button_hover")
|
1027
|
+
})
|
1028
|
+
});
|
1029
|
+
return c
|
1030
|
+
};
|
1031
|
+
Dialog.prototype.removeButton = function (b) {
|
1032
|
+
var a = topWin.$id("_DialogButtons_" + this.ID).getElementsByTagName("INPUT")[0];
|
1033
|
+
a.parentNode.removeChild(b)
|
1034
|
+
};
|
1035
|
+
Dialog.prototype.hiddenCloseButton = function (b) {
|
1036
|
+
var a = topWin.$id("_ButtonClose_" + this.ID);
|
1037
|
+
if (a) {
|
1038
|
+
a.style.display = "none"
|
1039
|
+
}
|
1040
|
+
};
|
1041
|
+
Dialog.prototype.showCloseButton = function (b) {
|
1042
|
+
var a = topWin.$id("_ButtonClose_" + this.ID);
|
1043
|
+
if (a) {
|
1044
|
+
a.style.display = ""
|
1045
|
+
}
|
1046
|
+
};
|
1047
|
+
Dialog.prototype.getBgdiv = function () {
|
1048
|
+
var h = this.Alpha;
|
1049
|
+
var g = String(this.Alpha / 100);
|
1050
|
+
if (Dialog.bgDiv) {
|
1051
|
+
if (this.Modal) {
|
1052
|
+
document.getElementById("_DialogBGMask").style.opacity = g;
|
1053
|
+
document.getElementById("_DialogBGMask").style.filter = "alpha(opacity=" + h + ")";
|
1054
|
+
document.getElementById("_DialogBGMask").style.backgroundColor = this.Bgcolor
|
1055
|
+
}
|
1056
|
+
return Dialog.bgDiv
|
1057
|
+
}
|
1058
|
+
var d = topWin.$id("_DialogBGDiv");
|
1059
|
+
if (!d) {
|
1060
|
+
d = topDoc.createElement("div");
|
1061
|
+
d.id = "_DialogBGDiv";
|
1062
|
+
d.style.cssText = "position:absolute;left:0px;top:0px;width:100%;height:100%;z-index:900";
|
1063
|
+
var a = '<div style="position:relative;width:100%;height:100%;">';
|
1064
|
+
var c = '<div id="_DialogBGMask" style="position:absolute;width:100%;height:100%;"></div>';
|
1065
|
+
var f = ielt7 ? '<iframe src="about:blank" style="filter:alpha(opacity=0);" width="100%" height="100%"></iframe>' : "";
|
1066
|
+
d.innerHTML = a + c + f + "</div>";
|
1067
|
+
topDoc.getElementsByTagName("BODY")[0].appendChild(d);
|
1068
|
+
document.getElementById("_DialogBGMask").style.opacity = g;
|
1069
|
+
document.getElementById("_DialogBGMask").style.filter = "alpha(opacity=" + h + ")";
|
1070
|
+
document.getElementById("_DialogBGMask").style.backgroundColor = this.Bgcolor;
|
1071
|
+
if (ielt7) {
|
1072
|
+
var b = d.getElementsByTagName("IFRAME")[0].contentWindow.document;
|
1073
|
+
b.open();
|
1074
|
+
b.write("<body style='background-color:#333' oncontextmenu='return false;'></body>");
|
1075
|
+
b.close();
|
1076
|
+
b = null
|
1077
|
+
}
|
1078
|
+
}
|
1079
|
+
Dialog.bgDiv = d;
|
1080
|
+
d = null;
|
1081
|
+
return Dialog.bgDiv
|
1082
|
+
};
|
1083
|
+
Dialog.prototype.getDialogDiv = function () {
|
1084
|
+
var a = topWin.$id("_DialogDiv_" + this.ID);
|
1085
|
+
try {
|
1086
|
+
return a
|
1087
|
+
} finally {
|
1088
|
+
a = null
|
1089
|
+
}
|
1090
|
+
};
|
1091
|
+
Dialog.onKeyDown = function (a) {
|
1092
|
+
var a = window.event || a;
|
1093
|
+
if ((a.shiftKey && a.keyCode == 9) || a.keyCode == 8) {
|
1094
|
+
if (topWin.Dialog._dialogArray.length > 0) {
|
1095
|
+
var c = a.srcElement || a.target;
|
1096
|
+
if (c.tagName != "INPUT" && c.tagName != "TEXTAREA") {
|
1097
|
+
stopEvent(a);
|
1098
|
+
return false
|
1099
|
+
}
|
1100
|
+
}
|
1101
|
+
}
|
1102
|
+
if (a.keyCode == 27) {
|
1103
|
+
var b = topWin.Dialog._dialogArray[topWin.Dialog._dialogArray.length - 1];
|
1104
|
+
if (b.ShowCloseButton) {
|
1105
|
+
Dialog.close()
|
1106
|
+
}
|
1107
|
+
}
|
1108
|
+
};
|
1109
|
+
Dialog.close = function (b) {
|
1110
|
+
if (topWin.Dialog._dialogArray.length > 0) {
|
1111
|
+
var a = topWin.Dialog._dialogArray[topWin.Dialog._dialogArray.length - 1];
|
1112
|
+
if (a.MsgForESC) {
|
1113
|
+
Dialog.confirm(a.MsgForESC, function () {
|
1114
|
+
a.cancelButton.onclick.apply(a.cancelButton, [])
|
1115
|
+
})
|
1116
|
+
} else {
|
1117
|
+
a.cancelButton.onclick.apply(a.cancelButton, [])
|
1118
|
+
}
|
1119
|
+
}
|
1120
|
+
};
|
1121
|
+
Dialog.alert = function (i, f, b, d, c) {
|
1122
|
+
var b = b || 300,
|
1123
|
+
d = d || 110;
|
1124
|
+
var g = new Dialog({
|
1125
|
+
Width: b,
|
1126
|
+
Height: d
|
1127
|
+
});
|
1128
|
+
g.ShowButtonRow = true;
|
1129
|
+
g.CancelEvent = function () {
|
1130
|
+
g.close();
|
1131
|
+
if (f) {
|
1132
|
+
f()
|
1133
|
+
}
|
1134
|
+
};
|
1135
|
+
if (i) {
|
1136
|
+
var a = i.split("|");
|
1137
|
+
if (a.length > 1) {
|
1138
|
+
g.Title = a[1]
|
1139
|
+
} else {
|
1140
|
+
g.Title = "系统提示"
|
1141
|
+
}
|
1142
|
+
g.InnerHtml = '<table height="100%" border="0" align="center" cellpadding="10" cellspacing="0" style="background-color: #ffffff !important;"> <tr><td align="right"><input type="button" id="Icon_' + this.ID + '" class="icon_alert" align="absmiddle"></td> <td align="left" id="Message_' + this.ID + '" style="font-size:9pt">' + a[0] + "</td></tr> </table>"
|
1143
|
+
} else {
|
1144
|
+
g.Title = "系统提示";
|
1145
|
+
g.InnerHtml = '<table height="100%" border="0" align="center" cellpadding="10" cellspacing="0" style="background-color: #ffffff !important;"> <tr><td align="right"><input type="button" id="Icon_' + this.ID + '" class="icon_alert" align="absmiddle"></td> <td align="left" id="Message_' + this.ID + '" style="font-size:9pt"></td></tr> </table>'
|
1146
|
+
}
|
1147
|
+
g.show();
|
1148
|
+
g.okButton.parentNode.style.textAlign = "center";
|
1149
|
+
g.okButton.style.display = "none";
|
1150
|
+
g.cancelButton.value = g.OkButtonText;
|
1151
|
+
setTimeout(function () {
|
1152
|
+
g.cancelButton.focus()
|
1153
|
+
}, 200);
|
1154
|
+
if (c && c > 0) {
|
1155
|
+
topWin.$id("_Title_" + g.ID).innerHTML = c + "秒后自动关闭";
|
1156
|
+
setTimeout(function () {
|
1157
|
+
g.close()
|
1158
|
+
}, c * 1000)
|
1159
|
+
}
|
1160
|
+
};
|
1161
|
+
Dialog.confirm = function (i, d, c, b, f) {
|
1162
|
+
var b = b || 300,
|
1163
|
+
f = f || 110;
|
1164
|
+
var g = new Dialog({
|
1165
|
+
Width: b,
|
1166
|
+
Height: f
|
1167
|
+
});
|
1168
|
+
g.ShowButtonRow = true;
|
1169
|
+
var a = i.split("|");
|
1170
|
+
if (a.length > 1) {
|
1171
|
+
g.Title = a[1]
|
1172
|
+
} else {
|
1173
|
+
g.Title = "信息确认"
|
1174
|
+
}
|
1175
|
+
g.CancelEvent = function () {
|
1176
|
+
g.close();
|
1177
|
+
if (c) {
|
1178
|
+
c()
|
1179
|
+
}
|
1180
|
+
};
|
1181
|
+
g.OKEvent = function () {
|
1182
|
+
g.close();
|
1183
|
+
if (d) {
|
1184
|
+
d()
|
1185
|
+
}
|
1186
|
+
};
|
1187
|
+
g.InnerHtml = '<table height="100%" border="0" align="center" cellpadding="10" cellspacing="0" style="background-color: #ffffff !important;"> <tr><td align="right"><input type="button" id="Icon_' + this.ID + '" class="icon_query" align="absmiddle"></td> <td align="left" id="Message_' + this.ID + '" style="font-size:9pt">' + a[0] + "</td></tr> </table>";
|
1188
|
+
g.show();
|
1189
|
+
g.okButton.parentNode.style.textAlign = "center";
|
1190
|
+
setTimeout(function () {
|
1191
|
+
g.okButton.focus()
|
1192
|
+
}, 200)
|
1193
|
+
};
|
1194
|
+
Dialog.open = function (a) {
|
1195
|
+
var b = new Dialog(a);
|
1196
|
+
b.show();
|
1197
|
+
return b
|
1198
|
+
};
|
1199
|
+
window.attachEvent("onload", Dialog.attachBehaviors);
|
1200
|
+
|
1201
|
+
function fixProgress() {
|
1202
|
+
try {
|
1203
|
+
if (top.progressFlag == 1) {
|
1204
|
+
top.progressFlag = 0
|
1205
|
+
}
|
1206
|
+
} catch (a) {}
|
1207
|
+
}
|
1208
|
+
|
1209
|
+
function getArrayPosition(c, d) {
|
1210
|
+
var a = -1;
|
1211
|
+
for (var b = 0; b < d.length; b++) {
|
1212
|
+
if (c == d[b]) {
|
1213
|
+
a = b;
|
1214
|
+
break
|
1215
|
+
}
|
1216
|
+
}
|
1217
|
+
return a
|
1218
|
+
}
|
1219
|
+
|
1220
|
+
function getTaskTarget() {
|
1221
|
+
var b = "dialogTask";
|
1222
|
+
if ($("#skin").attr("splitMode") == true || $("#skin").attr("splitMode") == "true") {} else {
|
1223
|
+
var a = $(window.top.document.getElementById("theme"));
|
1224
|
+
if (a.attr("taskTarget") != null) {
|
1225
|
+
b = a.attr("taskTarget")
|
1226
|
+
}
|
1227
|
+
}
|
1228
|
+
return b
|
1229
|
+
}
|
1230
|
+
|
1231
|
+
function setTaskCurrent(b, a) {
|
1232
|
+
b.find("a").removeClass("dialogTaskItemCurrent");
|
1233
|
+
if (a.length != 0) {
|
1234
|
+
b.find("#" + a[a.length - 1]).addClass("dialogTaskItemCurrent")
|
1235
|
+
}
|
1236
|
+
}
|
1237
|
+
var timer;
|
1238
|
+
var itemContainerWidth = 0;
|
1239
|
+
var currentItemTotalWidth = 0;
|
1240
|
+
var itemTotalWidth = 0;
|
1241
|
+
$(function () {
|
1242
|
+
itemContainerWidth = window.document.documentElement.clientWidth;
|
1243
|
+
$(window).resize(function () {
|
1244
|
+
resetDialogTask()
|
1245
|
+
});
|
1246
|
+
var f = getTaskTarget();
|
1247
|
+
if (f != "") {
|
1248
|
+
var d = $("#" + f);
|
1249
|
+
var g = 2;
|
1250
|
+
var c = $('<div class="taskItemContainer"></div>');
|
1251
|
+
d.append(c);
|
1252
|
+
var a = $('<div class="taskItemButtonLeft" style="display:none;" ></div>');
|
1253
|
+
var b = $('<div class="taskItemButtonRight" style="display:none;" ></div>');
|
1254
|
+
d.append(a);
|
1255
|
+
d.append(b);
|
1256
|
+
a.bind("mousedown", function () {
|
1257
|
+
timer = setInterval(function () {
|
1258
|
+
if (g > 17) {
|
1259
|
+
g = 18;
|
1260
|
+
c.css("left", g);
|
1261
|
+
clearInterval(timer);
|
1262
|
+
return
|
1263
|
+
}
|
1264
|
+
g = g + 8;
|
1265
|
+
c.css("left", g)
|
1266
|
+
}, 30)
|
1267
|
+
});
|
1268
|
+
a.bind("mouseup", function () {
|
1269
|
+
clearInterval(timer)
|
1270
|
+
});
|
1271
|
+
b.bind("mousedown", function () {
|
1272
|
+
var h = $(this).next("ul");
|
1273
|
+
timer = setInterval(function () {
|
1274
|
+
if (g > 18) {
|
1275
|
+
g = 17;
|
1276
|
+
clearInterval(timer);
|
1277
|
+
return
|
1278
|
+
} else {
|
1279
|
+
if (g < itemContainerWidth - itemTotalWidth) {
|
1280
|
+
g = itemContainerWidth - itemTotalWidth;
|
1281
|
+
clearInterval(timer);
|
1282
|
+
return
|
1283
|
+
}
|
1284
|
+
}
|
1285
|
+
g = g - 8;
|
1286
|
+
c.css("left", g)
|
1287
|
+
}, 30)
|
1288
|
+
});
|
1289
|
+
b.bind("mouseup", function () {
|
1290
|
+
clearInterval(timer)
|
1291
|
+
})
|
1292
|
+
}
|
1293
|
+
});
|
1294
|
+
|
1295
|
+
function resetDialogTask() {
|
1296
|
+
itemContainerWidth = top.window.document.documentElement.clientWidth;
|
1297
|
+
var b = getTaskTarget();
|
1298
|
+
if (b != "") {
|
1299
|
+
var a = $("#" + b);
|
1300
|
+
if (a[0]) {
|
1301
|
+
if (a[0].style.display != "none") {
|
1302
|
+
if (itemTotalWidth > itemContainerWidth) {
|
1303
|
+
a.find(".taskItemButtonLeft").show();
|
1304
|
+
a.find(".taskItemButtonRight").show()
|
1305
|
+
} else {
|
1306
|
+
a.find(".taskItemButtonLeft").hide();
|
1307
|
+
a.find(".taskItemButtonRight").hide();
|
1308
|
+
a.find(".taskItemContainer").css("left", 18)
|
1309
|
+
}
|
1310
|
+
}
|
1311
|
+
}
|
1312
|
+
}
|
1313
1313
|
};
|