You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
347 lines
9.5 KiB
347 lines
9.5 KiB
function GE(a) { return document.getElementById(a) } |
|
|
|
function GES(a) { return document.getElementsByName(a) } |
|
|
|
function GetValue(b) { |
|
var a = ""; |
|
var c = GE(b); |
|
if (c != null) { |
|
if (c.type.indexOf("select") >= 0) { |
|
a = c.options[c.selectedIndex].value |
|
} else { a = c.value } |
|
} else { |
|
alert(b + " Error") |
|
} |
|
return a |
|
} |
|
|
|
function SetValue(a, c) { |
|
var d = GE(a); |
|
if (d != null) { |
|
if (d.type.indexOf("select") >= 0) { |
|
for (var b = 0; b < d.options.length; b++) { |
|
if (d.options[b].value == c) { d.selectedIndex = b; break } |
|
} |
|
} else { |
|
d.value = c |
|
} |
|
} else { alert(a + " Error") } |
|
} |
|
|
|
function Ctrl_Text(a, l, e, c, g, d, h, j, b, f, k, i) { |
|
this.type = "text"; |
|
this.active = !(b == true); |
|
this.id = a; |
|
this.value = c; |
|
this.setcmd = g; |
|
this.checker = d; |
|
this.html = CreateTextHtml(a, l, e, c, h, j, f, k, i); |
|
this.GV = function () { return GetValue(this.id) }; |
|
this.SV = function (m) { SetValue(this.id, m) } |
|
} |
|
|
|
function CreateTextHtml(a, k, b, i, f, g, d, j, e) { |
|
var h = "text"; |
|
if (f) { h = "password"; } else { if (k == "0") { h = "hidden"; } } |
|
var c = ""; |
|
c += "<input name='" + a + "' id='" + a + "' type='" + h + |
|
"' size='" + k + "' maxlength='" + b + "' value='" + i + "'"; |
|
if (g != null) { c += "onChange='" + g + "' ";} |
|
if (d != null) { |
|
c += "onKeyup='" + d + "' "; |
|
//c += "onkeyup = \"this.value=this.value.replace(/[^\w_]/g,'');\""; |
|
} |
|
if (j != null) { |
|
c += "onKeyPress='" + j + "' "; |
|
} |
|
if (e != null) { c += e;} c += ">"; |
|
return c; |
|
} |
|
|
|
function Ctrl_Check(f, e, d, c, a, b) { |
|
this.type = "check"; |
|
this.active = !(b == true); |
|
this.id = f; |
|
this.value = e; |
|
this.setcmd = d; |
|
this.checker = a; |
|
this.onClickFunc = c; |
|
this.GetHtml = function () { |
|
var g = ""; |
|
g += '<input type="checkbox" id="' + this.id + '" name="' + |
|
this.id + '" '; |
|
if (this.value == 1) { |
|
g += "checked " |
|
} |
|
if (this.onClickFunc != null) { |
|
g += "onClick='" + this.onClickFunc + "'" |
|
} |
|
g += " >"; |
|
return g |
|
}; |
|
this.html = this.GetHtml(); |
|
this.GV = function () { return Bool2Int(IsChecked(this.id)) }; |
|
this.SV = function (g) { SetChecked(this.id, (g == 1)) } |
|
} |
|
|
|
function IsChecked(b) { |
|
var c = GE(b); |
|
var a = false; |
|
if (c != null) { |
|
a = c.checked |
|
} |
|
return a |
|
} |
|
|
|
function SetChecked(a, b) { |
|
var c = GE(a); |
|
if (c != null) { |
|
c.checked = b |
|
} |
|
} |
|
|
|
function Bool2Int(a) { return (a) ? 1 : 0 } |
|
|
|
function Ctrl_Radio(f, e, d, c, a, b) { |
|
this.type = "radio"; |
|
this.active = !(b == true); |
|
this.id = f; |
|
this.value = e; |
|
this.setcmd = d; |
|
this.checker = a; |
|
this.onClickFunc = c; |
|
this.GetHtml = function (h) { |
|
var g = "<input type='radio' name='" + this.id + "' id='" + |
|
this.id + "' value='" + h + "' "; |
|
if (this.value == h) { g += "checked " } |
|
if (this.onClickFunc != null) { |
|
g += "onClick='" + this.onClickFunc + "'" |
|
} |
|
g += " >"; |
|
return g |
|
}; |
|
this.GV = function () { return GetRadioValue(this.id) }; |
|
this.SV = function (g) { SetRadioValue(this.id, g) } |
|
} |
|
|
|
function GetRadioValue(a) { |
|
var d = 0; |
|
var c; |
|
var b = GES(a); |
|
if (b != null) { |
|
for (c = 0; c < b.length; c++) { |
|
if (b[c].checked == true) { d = b[c].value; break } |
|
} |
|
} |
|
return d |
|
} |
|
|
|
function SetRadioValue(a, d) { |
|
var c; |
|
var b = GES(a); |
|
if (b != null) { |
|
for (c = 0; c < b.length; c++) { |
|
if (b[c].value == d) { |
|
b[c].checked = true; |
|
break |
|
} |
|
} |
|
} |
|
} |
|
|
|
function Ctrl_Select(g, d, f, e, c, a, b) { |
|
this.type = "select"; |
|
this.active = !(b == true); |
|
this.id = g; |
|
this.list = d; |
|
this.value = f; |
|
this.setcmd = e; |
|
this.checker = a; |
|
this.html = SelectObjectNoWrite(g, d, this.value, c); |
|
this.GV = function () { return GetValue(this.id) }; |
|
this.SV = function (h) { SetValue(this.id, h) } |
|
} |
|
|
|
function SelectObjectNoWrite(d, c, e, a) { |
|
var f = ""; |
|
f += '<SELECT NAME="' + d + '" id="' + d + '" '; |
|
if (a == null) { |
|
f += ">" |
|
} else { f += ' onChange="' + a + '" >' } aryOption = c.split(";"); |
|
for (var b = 0; b < aryOption.length; b++) { |
|
if (b == e) { |
|
f += "<OPTION selected value=" + b + ">" + aryOption[b] |
|
} else { |
|
f += "<OPTION value=" + b + ">" + aryOption[b] |
|
} |
|
} |
|
f += "</SELECT>"; |
|
return f |
|
} |
|
|
|
function Ctrl_Select_Hidden(g, d, f, e, c, a, b) { |
|
this.type = "select"; |
|
this.active = !(b == true); |
|
this.id = g; |
|
this.list = d; |
|
this.value = f; |
|
this.setcmd = e; |
|
this.checker = a; |
|
this.html = SelectObjectNoWrite_Hidden(g, d, this.value, c); |
|
this.GV = function () { return GetValue(this.id) }; |
|
this.SV = function (h) { SetValue(this.id, h) } |
|
} |
|
|
|
function SelectObjectNoWrite_Hidden(d, c, e, a) { |
|
var f = ""; |
|
f += '<SELECT style="visibility:hidden;" NAME="' + d + '" id="' + d + '" '; |
|
if (a == null) { |
|
f += ">" |
|
} else { f += ' onChange="' + a + '" >' } aryOption = c.split(";"); |
|
for (var b = 0; b < aryOption.length; b++) { |
|
if (b == e) { |
|
f += "<OPTION selected value=" + b + ">" + aryOption[b] |
|
} else { |
|
f += "<OPTION value=" + b + ">" + aryOption[b] |
|
} |
|
} |
|
f += "</SELECT>"; |
|
return f |
|
} |
|
|
|
function Ctrl_SelectNum(a, h, b, k, e, g, j, i, f, d, c) { |
|
this.type = "selectNum"; |
|
this.active = !(c == true); |
|
this.id = a; |
|
this.value = e; |
|
this.setcmd = g; |
|
this.checker = d; |
|
this.html = GetSelectNumberHtml(a, h, b, k, this.value, j, i, f); |
|
this.rehtml = function (l, m) { |
|
return GetSelectNumberHtml(a, l, m, k, this.value, j, i |
|
, f) |
|
}; |
|
this.GV = function () { return GetValue(this.id) }; |
|
this.SV = function (l) { |
|
this.value = l; |
|
SetValue(this.id, l) |
|
} |
|
} |
|
|
|
function GetSelectNumberHtml(a, b, d, j, l, h, k, e) { |
|
var c = ""; |
|
c += '<select id="' + a + '" name="' + a + '" '; |
|
if (h != null) { |
|
c += ' onchange="' + h + '"' |
|
} |
|
if (k != null) { |
|
c += ' onfocus="' + k + '"' |
|
} |
|
c += ">"; |
|
var f = 0; |
|
for (f = b; f <= d; f += j) { |
|
var g = f; |
|
if (e != null) { g = FixNum(f, e) } |
|
if (f == l) { c += "<option selected value=" + f + ">" + g } else { |
|
c += "<option value=" + f + ">" + g |
|
} |
|
} |
|
c += "</select>"; |
|
return c |
|
} |
|
|
|
function Ctrl_SelectEx(g, d, f, e, c, a, b) { |
|
this.type = "select"; |
|
this.active = !(b == true); |
|
this.id = g; |
|
this.list = d; |
|
this.value = f; |
|
this.setcmd = e; |
|
this.onChangeFunc = c; |
|
this.checker = a; |
|
this.html = SelectObjectNoWriteEx(this.id, this.list, this.value |
|
, this.onChangeFunc); |
|
this.GV = function () { return GetValue(this.id) }; |
|
this.SV = function (h) { SetValue(this.id, h) }; |
|
this.rehtml = function (h, i) { |
|
return SelectObjectNoWriteEx(this.id, h, (i != null) ? i : |
|
this.value, this.onChangeFunc) |
|
} |
|
} |
|
|
|
function SelectObjectNoWriteEx(d, c, e, a) { |
|
var f = ""; |
|
f += '<SELECT NAME="' + d + '" id="' + d + '" '; |
|
if (a == null) { |
|
f += ">" |
|
} else { f += ' onChange="' + a + '" >' } aryOption = c.split(";"); |
|
for (var b = 0; b < aryOption.length; b++) { |
|
if (aryOption[b] == e) { |
|
f += '<OPTION selected value="' + aryOption[b] + '">' + |
|
aryOption[b] |
|
} else { |
|
f += '<OPTION value="' + aryOption[b] + '">' + aryOption[ |
|
b] |
|
} |
|
} |
|
f += "</SELECT>"; |
|
return f |
|
} |
|
|
|
function Ctrl_Select2List(h, a, g, f, e, d, b, c) { |
|
this.type = "select"; |
|
this.active = !(c == true); |
|
this.id = h; |
|
this.list1 = a; |
|
this.list2 = g; |
|
this.value = f; |
|
this.setcmd = e; |
|
this.onChangeFunc = d; |
|
this.checker = b; |
|
this.html = SelectObjectNoWrite2List(this.id, this.list1, this.list2 |
|
, this.value, this.onChangeFunc); |
|
this.GV = function () { return GetValue(this.id) }; |
|
this.SV = function (i) { SetValue(this.id, i) } |
|
} |
|
|
|
function SelectObjectNoWrite2List(d, g, c, e, a) { |
|
var f = ""; |
|
f += '<SELECT NAME="' + d + '" id="' + d + '" '; |
|
if (a == null) { |
|
f += ">" |
|
} else { f += ' onChange="' + a + '" >' } aryOption = c.split(";"); |
|
aryValue = g.split(";"); |
|
for (var b = 0; b < aryOption.length; b++) { |
|
if (aryValue[b] == e) { |
|
f += '<OPTION selected value="' + aryValue[b] + '">' + |
|
aryOption[b] |
|
} else { |
|
f += '<OPTION value="' + aryValue[b] + '">' + aryOption[b] |
|
} |
|
} |
|
f += "</SELECT>"; |
|
return f |
|
} |
|
|
|
function DisableObjs(c, b) { |
|
for (var a = 0; a < c.length; a++) { |
|
DisableObject(c[a], b) |
|
} |
|
} |
|
|
|
function DisableObject(a, c) { |
|
var f = GE(a); |
|
if (f != null) { |
|
f.disabled = c |
|
} |
|
try { SetCIA(a, !c) } catch (d) {} |
|
var g = GES(a); |
|
if (g != null) { |
|
for (var b = 0; b < g.length; b++) { |
|
g[b].disabled = c |
|
} |
|
} |
|
} |
|
|
|
function SetCIA(b, a) { CTRLARY[b].active = (a == true) }; |
|
var abab1=[11,99,33];
|
|
|