ColorBrowser.jsp
4.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ include file="/systeminfo/init_wev8.jsp" %>
<%@ page import="weaver.general.Util" %>
<%@ page import="java.lang.Integer" %>
<%
response.setHeader("Expires", "-1") ; // '将当前页面置为唯一活动的页面,必须关闭这个页面以后,其他的页面才能被激活
%>
<HTML>
<HEAD>
<LINK href="/css/Weaver_wev8.css" type=text/css rel=STYLESHEET>
<TITLE>Color</TITLE>
</HEAD>
<SCRIPT LANGUAGE="JavaScript">
function getEvent() {
if (window.ActiveXObject) {
return window.event;// 如果是ie
}
func = getEvent.caller;
while (func != null) {
var arg0 = func.arguments[0];
if (arg0) {
if ((arg0.constructor == Event || arg0.constructor == MouseEvent)
|| (typeof (arg0) == "object" && arg0.preventDefault && arg0.stopPropagation)) {
return arg0;
}
}
func = func.caller;
}
return null;
}
function Cancel_onclick(){
window.parent.parent.close();
}
function ColorTable_onclick(){
var e = getEvent().srcElement ? getEvent().srcElement:getEvent().target;
if (e.tagName == "TD"){
window.parent.parent.returnValue = Color.innerHTML;
window.parent.parent.close();
}
}
function ColorTable_onmouseover(){
var el = getEvent().srcElement ? getEvent().srcElement:getEvent().target;
if (el.tagName == "TD"){
var clr = "0000" + el.id;
jQuery("#Info")[0].bgColor = clr.substr(clr.length-6);
jQuery("#Color").html(clr.substr(clr.length-6));
jQuery("#Text").html("#" + clr.substr(clr.length-6));
el.borderColor = "black";
}
}
function ColorTable_onmouseout(){
var el = getEvent().srcElement ? getEvent().srcElement:getEvent().target;
if (el.tagName == "TD"){
el.borderColor = "white";
}
}
function Clear_onclick(){
window.parent.parent.returnValue = "";
window.parent.parent.close();
}
jQuery(document).ready(function(){
jQuery("#ColorTable").find("td").bind("click",ColorTable_onclick)
jQuery("#ColorTable").find("td").bind("mouseover",ColorTable_onmouseover)
jQuery("#ColorTable").find("td").bind("mouseout",ColorTable_onmouseout)
});
</SCRIPT>
<BODY>
<TABLE ID="ColorTable" STYLE="table-layout:fixed; cursor:pointer;" BORDER=3 BORDERCOLOR=white width="100%">
<%
//Dim i, s, v
int iR=0;
int iG=0;
int iB=0;
int lColor=0;
String sColor="";
int iCol = 1;
int iBF=0;
int iBT=0;
int iBStep=0;
for(iG = 0;iG<= 2;iG++){
if (iG == 1) {
for(iR=5;iR>=0;iR--){
%>
<tr>
<%
for(iB=0;iB<=5;iB++){
String t1 = "00"+Integer.toHexString(iR*51);
t1 = t1.substring(t1.length()-2,t1.length());
String t2 = "00"+Integer.toHexString((iG*2)*51);
t2 = t2.substring(t2.length()-2,t2.length());
String t3 = "00"+Integer.toHexString(iB*51);
t3 = t3.substring(t3.length()-2,t3.length());
sColor=t1+t2+t3;
%>
<td bgcolor="#<%=sColor%>" id=<%=sColor%>><span style="font-size:8pt"> </span></td>
<%
}
for(iB=5;iB>=0;iB--){
String t1 = "00"+Integer.toHexString(iR*51);
t1 = t1.substring(t1.length()-2,t1.length());
String t2 = "00"+Integer.toHexString(((iG*2)+1)*51);
t2 = t2.substring(t2.length()-2,t2.length());
String t3 = "00"+Integer.toHexString(iB*51);
t3 = t3.substring(t3.length()-2,t3.length());
sColor=t1+t2+t3;
%>
<td bgcolor="#<%=sColor%>" id=<%=sColor%>><span style="font-size:8pt"> </span></td>
<%
}
%>
</tr>
<%
}
%>
<%
}
else{
for(iR=0;iR<=5;iR++){
%>
<tr>
<%
for(iB=0;iB<=5;iB++){
String t1 = "00"+Integer.toHexString(iR*51);
t1 = t1.substring(t1.length()-2,t1.length());
String t2 = "00"+Integer.toHexString((iG*2)*51);
t2 = t2.substring(t2.length()-2,t2.length());
String t3 = "00"+Integer.toHexString(iB*51);
t3 = t3.substring(t3.length()-2,t3.length());
sColor=t1+t2+t3;
%>
<td bgcolor="#<%=sColor%>" id=<%=sColor%>><span style="font-size:8pt"> </span></td>
<%
}
for(iB=5;iB>=0;iB--){
String t1 = "00"+Integer.toHexString(iR*51);
t1 = t1.substring(t1.length()-2,t1.length());
String t2 = "00"+Integer.toHexString(((iG*2)+1)*51);
t2 = t2.substring(t2.length()-2,t2.length());
String t3 = "00"+Integer.toHexString(iB*51);
t3 = t3.substring(t3.length()-2,t3.length());
sColor=t1+t2+t3;
%>
<td bgcolor="#<%=sColor%>" id=<%=sColor%>><span style="font-size:8pt"> </span></td>
<%
}
%>
</tr>
<%
}
%>
<%
}
}
%>
</TABLE>
<TABLE>
<TR>
<TD><%=SystemEnv.getHtmlLabelName(495, user.getLanguage())%>: </TD><TD id="Info" width=50px> </TD><TD id="Text"></TD>
</TR>
</TABLE>
<DIV CLASS=BtnBar>
<BUTTON CLASS=btn ID="Clear" type="button" onclick="Clear_onclick()"> <%=SystemEnv.getHtmlLabelName(311, user.getLanguage())%> </BUTTON>
<BUTTON CLASS=btn ID="Cancel" type="button" onclick="Cancel_onclick()"> <%=SystemEnv.getHtmlLabelName(201, user.getLanguage())%> </BUTTON><SPAN id=Color style="visibility: hidden"></SPAN>
</DIV>
</BODY>
</HTML>