HtmlArea/popups/select_color.html
(开头部分) 25KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
<!-- note: this version of the color picker is optimized for IE 5.5+ only -->
<html STYLE="width: 238px; height: 187px"><head><title>Select Color</title>
<script language="javascript">
function _CloseOnEsc() {
if (event.keyCode == 27) { window.close(); return; }
}
function Init() { // run on page load
document.body.onkeypress = _CloseOnEsc;
color = window.dialogArguments;
color = ValidateColor(color) || '000000';
View(color); // set default color
}
function View(color) { // preview color
document.all.ColorPreview.style.backgroundColor = '#' + color;
document.all.ColorHex.value = '#' + color;
}
function Set(string) { // select color
color = ValidateColor(string);
if (color == null) { alert("Invalid color code: " + string); } // invalid color
else { // valid color
View(color); // show selected color
window.returnValue = color; // set return value
window.close(); // close dialog
}
}
function ValidateColor(string) { // return valid color code
string = string || '';
string = string + "";
string = string.toUpperCase();
chars = '0123456789ABCDEF';
out = '';
for (i=0; i<string.length; i++) { // remove invalid color chars
schar = string.charAt(i);
if (chars.indexOf(schar) != -1) { out += schar; }
}
if (out.length != 6) { return null; } // check length
return out;
}
</script>
</head>
<body bgcolor="#000000" topmargin=0 leftmargin=0 onload="Init()">
<form method=get onSubmit="Set(document.all.ColorHex.value); return false;">
<table border=0 cellspacing=0 cellpadding=4 width=100%>
<tr>
<td bgcolor="buttonface" valign=center><div style="background-color: #000000; padding: 1; height: 21px; width: 50px"><div id="ColorPreview" style="height: 100%; width: 100%"></div></div></td>
<td bgcolor="buttonface" valign=center><input type="text" name="ColorHex" value="" size=15 style="font-size: 12px"></td>
<td bgcolor="buttonface" width=100%></td>
</tr>
后面还有 283 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
