📄 selcolor.php
字号:
<?php
include_once ('./config.php');
include_once('./editor_functions.php');
include_once ('./includes/common.php');
include_once ('./lang/'.$lang_include);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title><?php echo $lang['titles']['selcolor']; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
@import url(<?php echo WP_WEB_DIRECTORY; ?>dialoge_theme.css);
#tab_table {
width: 286px;
margin-top: 3px;
}
#tab_container {
padding-top: 10px;
border-left: 2px solid threedhighlight;
border-right: 2px solid threeddarkshadow;
border-bottom: 2px solid threeddarkshadow;
height: 218px;
width: 286px
}
-->
</style>
<script language="JavaScript" type="text/javascript" src="<?php echo WP_WEB_DIRECTORY; ?>js/dialogEditorShared.js"></script>
<script language="JavaScript" type="text/javascript" src="<?php echo WP_WEB_DIRECTORY; ?>js/dialogShared.js"></script>
<script language="JavaScript" type="text/javascript">
<!--//
var CURRENT_HIGHLIGHT = null
function initiate() {
if (obj.color_swatches == '') {
document.getElementById('web_color_container').style.display = 'block';
} else {
var color_swatches = obj.color_swatches
var colors = color_swatches.split(',');
var colorTable = '<table id="site_colortable" height="40" border="0" cellspacing="0" cellpadding="0" class="colortable">';
var cellCount = 0
for (var i=0; i < colors.length; i++) {
if (cellCount == 0) {
colorTable += '<tr>'
}
colorTable += '<td class="colorCell" bgcolor="'+colors[i]+'"> </td>'
if (cellCount == 18) {
colorTable += '</tr>'
cellCount = 0;
} else {
cellCount ++;
}
}
if (cellCount != 0) {
colorTable += '</tr>'
}
colorTable += '<tr><td height="14" class="colorCell" bgcolor="" colspan="19" align="center"><?php echo $lang['default']; ?></td></tr></table>';
document.getElementById('site_color_container').innerHTML = colorTable ;
document.getElementById('tbar1').className = 'tbuttonUpLeft';
document.getElementById('tbar2').className = 'tbuttonRight';
document.getElementById('site_color_container').style.display = 'block';
document.getElementById('web_color_container').style.display = 'none';
}
kids = document.getElementsByTagName('TD');
for (var i=0; i < kids.length; i++) {
if (kids[i].className == "colorCell") {
kids[i].onmouseover = m_over;
kids[i].onmouseout = m_out;
kids[i].onclick = m_click;
}
}
}
function m_click() {
document.getElementById('selcolor').value = this.bgColor;
document.getElementById('chosencolor').style.backgroundColor = this.bgColor;
this.style.border = '1px solid #FFFFFF'
if (CURRENT_HIGHLIGHT) {
CURRENT_HIGHLIGHT.style.border = "1px solid #000000"
}
CURRENT_HIGHLIGHT = this
}
function m_over () {
if (CURRENT_HIGHLIGHT == this) return
document.getElementById('rgb').innerHTML = this.bgColor;
document.getElementById('colordisplay').style.backgroundColor = this.bgColor;
this.style.border = "1px dashed #FFFFFF";
}
function m_out() {
if (CURRENT_HIGHLIGHT == this) return
document.getElementById('rgb').innerText = " ";
document.getElementById('colordisplay').bgcolor="threedface";
this.style.border = "1px solid #000000"
}
function end() {
parentWindow.wp_docolor(obj,'<?php echo stripslashes($_GET['action']); ?>',document.getElementById('selcolor').value)
window.close();
return false;
}
function on_enter_site() {
if (document.getElementById('tbar1').className == 'noTab') {
return
}
document.getElementById('tbar1').className = 'tbuttonUpLeft';
document.getElementById('tbar2').className = 'tbuttonRight';
document.getElementById('site_color_container').style.display = 'block';
document.getElementById('web_color_container').style.display = 'none';
}
function on_enter_web() {
if (document.getElementById('tbar2').className == 'noTab') {
return
}
document.getElementById('tbar1').className = 'tbuttonLeft';
document.getElementById('tbar2').className = 'tbuttonUpRight';
document.getElementById('site_color_container').style.display = 'none';
document.getElementById('web_color_container').style.display = 'block';
}
// -->
</script>
</head>
<body onLoad="initiate();document.getElementById('selcolor').focus(); hideLoadMessage();">
<form name="foo" onSubmit="return end()">
<?php include('./includes/load_message.php'); ?>
<div class="dialog_content" align="center">
<table width="205" border="0" cellspacing="0" cellpadding="1">
<tr>
<td width="55" valign="top"> <div class="selcolordisplay" style="height: 40px" id="colordisplay"> </div></td>
<td align="center" width="84"> <p><span id="rgb"> </span></p></td>
<td align="right" width="55"> <div class="selcolordisplay" style="height: 20px" id="chosencolor"> </div>
<input type="text" style="width:60px" id="selcolor" name="selcolor" onChange="document.getElementById('chosencolor').style.backgroundColor = this.value"> </td>
</tr>
</table>
<table id="tab_table" border="0" cellspacing="0" cellpadding="2">
<tr>
<td id="tbar1" class="noTab" align="center" onClick="on_enter_site()"><nobr>
<?php echo $lang['site_colors']; ?> </nobr></td>
<td id="tbar2" class="noTab" align="center" onClick="on_enter_web()"><nobr>
<?php echo $lang['web_colors']; ?> </nobr></td>
<td id="tbar3" width="100%" class="noTab" align="center"> </td>
</tr>
</table>
<div id="tab_container">
<div id="site_color_container" style="display:none">
<!-- Your custom color swatches will be generated here -->
</div>
<div id="web_color_container" style="display:none">
<table id="web_colortable" width="100%" border="0" cellspacing="0" cellpadding="0" class="colortable">
<tr>
<td class="colorCell" bgcolor="#000000"> </td>
<td class="colorCell" bgcolor="#000000"> </td>
<td class="colorCell" bgcolor="#003300"> </td>
<td class="colorCell" bgcolor="#006600"> </td>
<td class="colorCell" bgcolor="#009900"> </td>
<td class="colorCell" bgcolor="#00cc00"> </td>
<td class="colorCell" bgcolor="#00ff00"> </td>
<td class="colorCell" bgcolor="#330000"> </td>
<td class="colorCell" bgcolor="#333300"> </td>
<td class="colorCell" bgcolor="#336600"> </td>
<td class="colorCell" bgcolor="#339900"> </td>
<td class="colorCell" bgcolor="#33cc00"> </td>
<td class="colorCell" bgcolor="#33ff00"> </td>
<td class="colorCell" bgcolor="#660000"> </td>
<td class="colorCell" bgcolor="#663300"> </td>
<td class="colorCell" bgcolor="#666600"> </td>
<td class="colorCell" bgcolor="#669900"> </td>
<td class="colorCell" bgcolor="#66cc00"> </td>
<td class="colorCell" bgcolor="#66ff00"> </td>
</tr>
<tr>
<td class="colorCell" bgcolor="#333333"> </td>
<td class="colorCell" bgcolor="#000033"> </td>
<td class="colorCell" bgcolor="#003333"> </td>
<td class="colorCell" bgcolor="#006633"> </td>
<td class="colorCell" bgcolor="#009933"> </td>
<td class="colorCell" bgcolor="#00cc33"> </td>
<td class="colorCell" bgcolor="#00ff33"> </td>
<td class="colorCell" bgcolor="#330033"> </td>
<td class="colorCell" bgcolor="#333333"> </td>
<td class="colorCell" bgcolor="#336633"> </td>
<td class="colorCell" bgcolor="#339933"> </td>
<td class="colorCell" bgcolor="#33cc33"> </td>
<td class="colorCell" bgcolor="#33ff33"> </td>
<td class="colorCell" bgcolor="#660033"> </td>
<td class="colorCell" bgcolor="#663333"> </td>
<td class="colorCell" bgcolor="#666633"> </td>
<td class="colorCell" bgcolor="#669933"> </td>
<td class="colorCell" bgcolor="#66cc33"> </td>
<td class="colorCell" bgcolor="#66ff33"> </td>
</tr>
<tr>
<td class="colorCell" bgcolor="#666666"> </td>
<td class="colorCell" bgcolor="#000066"> </td>
<td class="colorCell" bgcolor="#003366"> </td>
<td class="colorCell" bgcolor="#006666"> </td>
<td class="colorCell" bgcolor="#009966"> </td>
<td class="colorCell" bgcolor="#00cc66"> </td>
<td class="colorCell" bgcolor="#00ff66"> </td>
<td class="colorCell" bgcolor="#330066"> </td>
<td class="colorCell" bgcolor="#333366"> </td>
<td class="colorCell" bgcolor="#336666"> </td>
<td class="colorCell" bgcolor="#339966"> </td>
<td class="colorCell" bgcolor="#33cc66"> </td>
<td class="colorCell" bgcolor="#33ff66"> </td>
<td class="colorCell" bgcolor="#660066"> </td>
<td class="colorCell" bgcolor="#663366"> </td>
<td class="colorCell" bgcolor="#666666"> </td>
<td class="colorCell" bgcolor="#669966"> </td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -