日期:2014-05-17 浏览次数:20873 次
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>快捷文章发表框</title>
<link rel="StyleSheet" href="editor/base.css">
<script type="text/javascript" src="editor/editor.js"></script>
<script type="text/javascript">
var guid = "1324481743" ;
var sState = "iframe";
var checkEdit;
function save_article(){
et.save();
if(exist('editor_body_textarea')){
setCopy($('editor_body_textarea').value);
}else if(exist('editor_body_area')){
setCopy($('editor_body_area').value);
}
}
function article_preview(){
if (check_editor()){
var editor_win = window.open('', "_blank", '');
editor_win.document.open('text/html', 'replace');
editor_win.opener = null;
editor_win.document.writeln($('editor_body_textarea').value);
editor_win.document.close();
}
}
function check_editor(){
var err_msg = '请先输入文章内容';
if ($('editor_body_textarea').value.toLowerCase() =="<div> </div>" ||$('editor_body_textarea').value ==""){
alert(err_msg);
return false;
}
else if($('editor_body_textarea').value.toLowerCase() =="<p> </p>" ||$('editor_body_textarea').value ==""){
alert(err_msg);
return false;
}
else
return true;
}
function LoadContent(ContentID){
if (typeof(EDiaryEditor.iframe)=="object"){
eval("EDiaryEditor.iframe.contentWindow.document.body.innerHTML=window.parent.document.getElementById('"+ContentID+"').value;");
eval("setInterval(\"SaveContent('"+ContentID+"')\",500)");
}else{
eval("setTimeout(\"LoadContent('"+ContentID+"')\",200)");
}
}
function SaveContent(ContentID){
if($('editor_body_textarea').value!=EDiaryEditor.iframe.contentWindow.document.body.innerHTML){
if(editor_body_textarea.style.display=="none"){
$('editor_body_textarea').value=EDiaryEditor.iframe.contentWindow.document.body.innerHTML
}else{
EDiaryEditor.iframe.contentWindow.document.body.innerHTML=$('editor_body_textarea').value
}
}
if(eval("window.parent.document.getElementById('"+ContentID+"').value!=EDiaryEditor.iframe.contentWindow.document.body.innerHTML;")){
eval("window.parent.document.getElementById('"+ContentID+"').value=EDiaryEditor.iframe.contentWindow.document.body.innerHTML;");
}
}
</script>
</head>
<body onLoad="LoadContent(Request('id'))">
<div id="editor_body"></div>
</body>
</html>
<script type="text/javascript">
// "EditerBox" 就是 textarea 的名子
var et;
//自动保存历史开关
function readCookie(name)
{
var cookieValue = "";
var search = name + "=";
if(document.cookie.length > 0)
{
offset = document.cookie.indexOf(search);
if (offset != -1)
{
offset += search.length;
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.l