⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 edittable.php

📁 类似youtube的视频分享网站源码。有后台管理系统及模板
💻 PHP
📖 第 1 页 / 共 2 页
字号:
<?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']['edittable']; ?></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_one {
	position : absolute; 
	width:420;
	top: 24px; 
	left: 4px;
	height: 300px; 
	text-align: center; 
	font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
	font-size : xx-small; 
	background: threedface; 
	border-bottom: 2px THREEDDARKSHADOW solid;
	border-right: 2px THREEDDARKSHADOW solid;
	border-left: 2px THREEDHIGHLIGHT solid;
}
#tab_two {
	display: block; 
	width:420;
	position : absolute; 
	top: 24px; 
	left: 4px;	
	height: 300px; 
	text-align: center; 
	visibility: hidden; 
	font-family : Verdana, Geneva, Arial, Helvetica, sans-serif; 
	font-size : xx-small;	
	background: threedface; 
	border-bottom: 2px THREEDDARKSHADOW solid;
	border-right: 2px THREEDDARKSHADOW solid;
	border-left: 2px THREEDHIGHLIGHT solid;
}
#tab_three {
	width:420;
	position : absolute; 
	top: 24px; 
	left: 4px;
	height: 300px; 
	text-align: center;
	visibility: hidden; 
	font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
	font-size : xx-small; 
	background: threedface; 
	border-bottom: 2px THREEDDARKSHADOW solid;
	border-right: 2px THREEDDARKSHADOW solid;
	border-left: 2px THREEDHIGHLIGHT solid;
}
-->
</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 type="text/javascript">
<!--//
function on_enter_cell() {
	document.getElementById('tab_one').style.visibility = "visible"
	document.getElementById('tab_two').style.visibility = "hidden"
	document.getElementById('tab_three').style.visibility = "hidden"
		
	document.getElementById('tbar1').className = "tbuttonUpLeft"
	document.getElementById('tbar2').className = "tbuttonRight"
	document.getElementById('tbar3').className = "tbuttonDown"
}

function on_enter_row() {
	document.getElementById('tab_one').style.visibility = "hidden"
	document.getElementById('tab_two').style.visibility = "visible"
	document.getElementById('tab_three').style.visibility = "hidden"
 
	document.getElementById('tbar1').className = "tbuttonLeft"
	document.getElementById('tbar2').className = "tbuttonUp"
	document.getElementById('tbar3').className = "tbuttonRight"
}

function on_enter_table() {
	document.getElementById('tab_one').style.visibility = "hidden"
	document.getElementById('tab_two').style.visibility = "hidden"
	document.getElementById('tab_three').style.visibility = "visible"
 
 	document.getElementById('tbar1').className = "tbuttonDown"
 	document.getElementById('tbar2').className = "tbuttonLeft"
	document.getElementById('tbar3').className = "tbuttonUpRight"
}
function wp_create_image_html(obj,img) {
	if (image_action == 'cell') {
		document.getElementById('cellBackground').value = img;
	} else if (image_action == 'table') {
		document.getElementById('tableBackground').value = img;
	}
	updateStyle();
}
var image_action = null
function open_image_window(action) {
	image_action = action
	szURL= '<?php echo WP_WEB_DIRECTORY; ?>dialog_frame.php?window=' + parentWindow.wp_directory + obj.imagewindow + "&instance_img_dir="+obj.instance_img_dir+"&lang="+obj.instance_lang; 
	imgwin = wp_openDialog(szURL,'modal',730,466);
}
function wp_docolor(obj,Action,color) {
	if (color != null) {
		if (Action == 1) {
			document.getElementById('table_bordercolor').value = color;
			document.getElementById('tableborderchosencolor').style.backgroundColor = color;
			updateStyle();
			}
		if (Action == 2) {
			document.getElementById('table_bgcolor').value = color;
			document.getElementById('tablebgchosencolor').style.backgroundColor = color;
			updateStyle();
			}
		if (Action == 3) {
			document.getElementById('tr_bgcolor').value = color;
			document.getElementById('trbgchosencolor').style.backgroundColor = color;
			updateStyle();
			}
		if (Action == 4) {
			document.getElementById('td_bgcolor').value = color;
			document.getElementById('tdbgchosencolor').style.backgroundColor = color;
			updateStyle();
		}
	}
}
var currentBorder;
//this function detects the properties of the table and initialises the form's values
function initiate() {
		thisCell = parentWindow.wp_thisCell;
		thisRow = parentWindow.wp_thisRow;
		thisTable = parentWindow.wp_thisTable;
		if (thisTable.style.borderCollapse) {
			if (thisTable.style.borderCollapse == "collapse") {
				document.getElementById('collapse').checked = true;
			}
		}
		//init current values
		// Table
		document.getElementById('table_border').value = thisTable.getAttribute("BORDER");
		currentBorder = thisTable.getAttribute("BORDER");
		document.getElementById('table_cellpadding').value = thisTable.getAttribute("CELLPADDING");
		document.getElementById('table_cellspacing').value = thisTable.getAttribute("CELLSPACING");
		if (thisTable.getAttribute("WIDTH") != "") {
			document.getElementById('table_width').value = thisTable.getAttribute("WIDTH");
		}
		if (thisTable.style.width != "") {
			document.getElementById('table_width').value = thisTable.style.width;
		}
		if (thisTable.getAttribute("HEIGHT") != "") {
			document.getElementById('table_height').value = thisTable.getAttribute("HEIGHT");
		}
		if (thisTable.style.height != "") {
			document.getElementById('table_height').value = thisTable.style.height;
		}
		document.getElementById('table_align').value = thisTable.getAttribute("ALIGN");
		document.getElementById('tablebgchosencolor').style.backgroundColor = thisTable.getAttribute("BGCOLOR");
		document.getElementById('table_bgcolor').value = thisTable.getAttribute("BGCOLOR");
		document.getElementById('tableborderchosencolor').style.backgroundColor = thisTable.getAttribute("BORDERCOLOR");
		document.getElementById('table_bordercolor').value = thisTable.getAttribute("BORDERCOLOR");
		document.getElementById('tableBackground').value = thisTable.getAttribute("BACKGROUND");
		// Cell
		document.getElementById('td_width').value = thisCell.getAttribute("WIDTH");
		document.getElementById('td_height').value = thisCell.getAttribute("HEIGHT");
		document.getElementById('td_align').value = thisCell.getAttribute("ALIGN");
		document.getElementById('td_valign').value = thisCell.getAttribute("VALIGN");
		document.getElementById('cellBackground').value = thisCell.getAttribute("BACKGROUND");
		document.getElementById('tdbgchosencolor').style.backgroundColor = thisCell.getAttribute("BGCOLOR");
		document.getElementById('td_bgcolor').value = thisCell.getAttribute("BGCOLOR");
		// Row
		document.getElementById('tr_align').value = thisRow.getAttribute("ALIGN");
		document.getElementById('tr_valign').value = thisRow.getAttribute("VALIGN");
		document.getElementById('trbgchosencolor').style.backgroundColor = thisRow.getAttribute("BGCOLOR");
		document.getElementById('tr_bgcolor').value = thisRow.getAttribute("BGCOLOR");
		
		updateStyle();
}

function apply() {
	
	if (document.getElementById('collapse').checked == true) {
		thisTable.style.borderCollapse = "collapse";
	} else {
		thisTable.style.borderCollapse = "separate";
	}
	//  Cell 
	thisCell.setAttribute("BGCOLOR", document.getElementById('td_bgcolor').value, 0);
	thisCell.setAttribute("VALIGN", document.getElementById('td_valign').value, 0);
	thisCell.setAttribute("ALIGN", document.getElementById('td_align').value, 0);
	thisCell.setAttribute("WIDTH", document.getElementById('td_width').value,0);
	
	thisCell.setAttribute("HEIGHT", document.getElementById('td_height').value,0);
	thisCell.setAttribute('BACKGROUND', document.getElementById('cellBackground').value,0);
	// Row 
	thisRow.setAttribute("BGCOLOR", document.getElementById('tr_bgcolor').value, 0);
	thisRow.setAttribute("VALIGN", document.getElementById('tr_valign').value, 0);
	thisRow.setAttribute("ALIGN", document.getElementById('tr_align').value, 0);
	//  Table 
	thisTable.setAttribute("BGCOLOR", document.getElementById('table_bgcolor').value, 0);
	thisTable.setAttribute("BORDER", document.getElementById('table_border').value, 0);
	thisTable.setAttribute("CELLSPACING", document.getElementById('table_cellspacing').value, 0);
	thisTable.setAttribute("CELLPADDING", document.getElementById('table_cellpadding').value, 0);
	
	thisTable.setAttribute("WIDTH", document.getElementById('table_width').value, 0);
	
	if (thisTable.style.width)
	thisTable.style.width=document.getElementById('table_width').value;
	
	thisTable.setAttribute("HEIGHT", document.getElementById('table_height').value, 0);
	if (thisTable.style.height)
		thisTable.style.height=document.getElementById('table_height').value;
	
	thisTable.setAttribute("ALIGN", document.getElementById('table_align').value, 0);
	thisTable.setAttribute("BORDERCOLOR", document.getElementById('table_bordercolor').value, 0);
	thisTable.setAttribute("BACKGROUND", document.getElementById('tableBackground').value, 0);
	
	// column
	var cellidx = thisCell.cellIndex
	var rows = thisTable.getElementsByTagName('TR')
	var n=rows.length
	for (var i = 0; i < n; i++) {
		if (rows[i].childNodes[cellidx]) {
			if (rows[i].childNodes[cellidx] != thisCell) {
				if (rows[i].childNodes[cellidx].width) {
					if (rows[i].childNodes[cellidx].rowSpan == thisCell.rowSpan) {
						rows[i].childNodes[cellidx].setAttribute("WIDTH", document.getElementById('td_width').value,0);
					}
				}
			}	
		}
	}
	// row
	var cells = thisRow.getElementsByTagName('TD')
	var n=cells.length
	for (var i = 0; i < n; i++) {
		if (cells[i] != thisCell) {
			if (cells[i].height) {
				if (cells[i].colSpan == thisCell.colSpan) {
					cells[i].setAttribute("HEIGHT", document.getElementById('td_height').value,0);
				}
			}
		}	
	}
	
	parentWindow.wp_current_obj.edit_object.focus();
	if (document.getElementById('table_border').value == '0') {
		parentWindow.wp_show_borders(parentWindow.wp_current_obj);
	} else if ((parentWindow.wp_current_obj.border_visible == true) && (currentBorder == 0) && (document.getElementById('table_border').value != currentBorder)) {
		parentWindow.wp_hide_borders(parentWindow.wp_current_obj);
		parentWindow.wp_show_borders(parentWindow.wp_current_obj);
	}
	window.close();
	return false;
}
//creates the table style preview
function updateStyle() {
	// table
	document.getElementById('tbl').borderColor = document.getElementById('table_bordercolor').value;
	if (document.getElementById('collapse').checked == true) {
		document.getElementById('tbl').style.borderCollapse = "collapse";
	} else {
		document.getElementById('tbl').style.borderCollapse = "separate";
	}
	document.getElementById('tbl').setAttribute("border",document.getElementById('table_border').value);
	document.getElementById('tbl').cellPadding = document.getElementById('table_cellpadding').value; 
	document.getElementById('tbl').cellSpacing = document.getElementById('table_cellspacing').value;
	document.getElementById('tbl').style.backgroundColor = document.getElementById('table_bgcolor').value;
	document.getElementById('tbl').setAttribute("align",document.getElementById('table_align').value);
	document.getElementById('tbl').setAttribute('background', document.getElementById('tableBackground').value);
	//row
	document.getElementById('tbl_tr').setAttribute("vAlign",document.getElementById('tr_valign').value);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -