edit.js

来自「网人分类信息5.0商业版。非常优秀的分类信息系统。比较少见。」· JavaScript 代码 · 共 49 行

JS
49
字号
function Editor(content){
	oEditor = document.wrEditor;
	var strHtml = '<html><hand><script>function killErrors(){return true;}window.onerror = killErrors;</script><style>body,a,table,div,span,td,th,input,select{font-size:9pt;font-family:"宋体,Verdana,Arial";Color:#000000;}body{margin:5;background-color:#FFFFFF;SCROLLBAR-BASE-COLOR:#EFEFEF}table,td{border:1px #709FCB dashed}span,div,li,ul{border:1px #FF00FF dashed}a{color:#0000FF; font-size:14px;}</style></hand><body>'+content+'</body></html>';
	oEditor.document.open();
	oEditor.document.write(strHtml);
	oEditor.document.body.innerHTML;
	oEditor.document.close();
	oEditor.document.designMode="off";
}

function iframe_s(){
Editor(document.form1.content.value)
}


function GetEditor(TextBox){
  oEditor = document.wrEditor;
  TextBox.value = oEditor.document.body.innerHTML;
}

function check(){
oLinkField.value = getContent();
} 
oLinkField.form.onsubmit=check;

//在当前位置插入文字
function InsertHTML(html){
  HtmlEdit.focus();
  rng=HtmlEdit.document.selection.createRange();
  rng.text=html;
  HtmlEdit.focus();
}

//在选取内容前后添加内容
function Insert(h,b){
  var sText=HtmlEdit.document.selection.createRange();
  InsertHTML(h + sText.text + b)
}

// 显示无模式对话框
function ShowDialog(url, width, height, optValidate) {
	if (optValidate) {
		if (!validateMode()) return;
	}
	HtmlEdit.focus();
	var arr = showModalDialog(url, window, "dialogWidth:" + width + "px;dialogHeight:" + height + "px;help:no;scroll:no;status:no");
	HtmlEdit.focus();
}

⌨️ 快捷键说明

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