![]() |
|
首页 │ Apache │ Linux│ Java│ MySQL│ 注册│帮助 | |||
相关问题
那是关于图片的插入: 。
| "; } string=string+" |
"
content=WBTB_Composition.document.body.innerHTML;
content=content+string;
WBTB_Composition.document.body.innerHTML=content;
}
else WBTB_Composition.focus();
}
function WBTB_forwmv()
{
var arr = showModalDialog("wbTextBox/wmv.htm", "", "dialogWidth:15.5em; dialogHeight:14em; status:0; help:0");
if (arr != null){
var ss;
ss=arr.split("*")
path=ss[0];
width=ss[1];
height=ss[2];
var string;
//string="";
string="";
content=WBTB_Composition.document.body.innerHTML;
content=content+string;
WBTB_Composition.document.body.innerHTML=content;
}
else WBTB_Composition.focus();
}
function WBTB_forrm()
{
var arr = showModalDialog("wbTextBox/rm.htm", "", "dialogWidth:15.5em; dialogHeight:14em; status:0; help:0");
if (arr != null)
{
var ss;
ss=arr.split("*")
path=ss[0];
row=ss[1];
col=ss[2];
var string;
string="
"; content=WBTB_Composition.document.body.innerHTML; content=content+string; WBTB_Composition.document.body.innerHTML=content; } else WBTB_Composition.focus(); } function WBTB_InsertRow() { editor = WBTB_Composition; objReference=WBTB_GetRangeReference(editor); objReference=WBTB_CheckTag(objReference,'/^(TABLE)|^(TR)|^(TD)|^(TBODY)/'); switch(objReference.tagName) { case 'TABLE' : var newTable=objReference.cloneNode(true); var newRow= newTable.insertRow(); for(x=0; x=parentTable.rows.length)
{
rowIndex=parentTable.rows.length-1;
}
if (rowIndex>=0)
{
var r = editor.document.body.createTextRange();
r.moveToElementText(parentTable.rows[rowIndex].cells[cellIndex]);
r.moveStart('character',r.text.length);
r.select();
}
else
{
parentTable.removeNode(true);
}
break;
default :return;
}
}
function WBTB_InsertColumn()
{
editor = WBTB_Composition;
objReference= WBTB_GetRangeReference(editor);
objReference=WBTB_CheckTag(objReference,'/^(TABLE)|^(TR)|^(TD)|^(TBODY)/');
switch(objReference.tagName)
{
case 'TABLE' :// IF a table is selected, it adds a new column on the right hand side of the table.
var newTable=objReference.cloneNode(true);
for(x=0; x=newTable.rows[0].cells.length)
{
cellIndex=newTable.rows[0].cells.length-1;
}
if (cellIndex>=0) newTable.rows[rowIndex].cells[cellIndex].id='ura';
parentTable.outerHTML=newTable.outerHTML;
if (cellIndex>=0){
var r = editor.document.body.createTextRange();
var item=editor.document.getElementById('ura');
item.id='';
r.moveToElementText(item);
r.moveStart('character',r.text.length);
r.select();
}
break;
default :return;
}
}
function WBTB_GetRangeReference(editor)
{
editor.focus();
var objReference = null;
var RangeType = editor.document.selection.type;
var selectedRange = editor.document.selection.createRange();
switch(RangeType)
{
case 'Control' :
if (selectedRange.length > 0 )
{
objReference = selectedRange.item(0);
}
break;
case 'None' :
objReference = selectedRange.parentElement();
break;
case 'Text' :
objReference = selectedRange.parentElement();
break;
}
return objReference
}
function WBTB_CheckTag(item,tagName)
{
if (item.tagName.search(tagName)!=-1)
{
return item;
}
if (item.tagName=='BODY')
{
return false;
}
item=item.parentElement;
return WBTB_CheckTag(item,tagName);
}
function WBTB_code()
{
WBTB_specialtype(" <\/o:p>/gi, "");
html = html.replace(/o:/gi, "");
//html = html.replace(/]*>/gi, "");
// Final clean up of empty tags
html = html.replace(/]*>\s*<\/font>/gi, "");
html = html.replace(/\s*<\/span>/gi, "");
editor.document.body.innerHTML = html;
}
function WBTB_FilterScript(content)
{
content = WBTB_rCode(content, 'javascript:', 'javascript :');
//var RegExp = /
"; content=WBTB_Composition.document.body.innerHTML; content=content+string; WBTB_Composition.document.body.innerHTML=content; } else WBTB_Composition.focus(); } function WBTB_InsertRow() { editor = WBTB_Composition; objReference=WBTB_GetRangeReference(editor); objReference=WBTB_CheckTag(objReference,'/^(TABLE)|^(TR)|^(TD)|^(TBODY)/'); switch(objReference.tagName) { case 'TABLE' : var newTable=objReference.cloneNode(true); var newRow= newTable.insertRow(); for(x=0; x
","
");
}
function WBTB_replace()
{
var arr = showModalDialog("wbTextBox/replace.html", "", "dialogWidth:16.5em; dialogHeight:13em; status:0; help:0");
if (arr != null){
var ss;
ss=arr.split("*")
a=ss[0];
b=ss[1];
i=ss[2];
con=WBTB_Composition.document.body.innerHTML;
if (i==1)
{
con=WBTB_rCode(con,a,b,true);
}else{
con=WBTB_rCode(con,a,b);
}
WBTB_Composition.document.body.innerHTML=con;
}
else WBTB_Composition.focus();
}
function WBTB_CleanCode() {
editor=WBTB_Composition;
editor.focus();
// 0bject based cleaning
var body = editor.document.body;
for (var index = 0; index < body.all.length; index++) {
tag = body.all[index];
//if (tag.Attribute["className"].indexOf("mso") > -1)
tag.removeAttribute("className","",0);
tag.removeAttribute("style","",0);
}
// Regex based cleaning
var html = editor.document.body.innerHTML;
html = html.replace(/答复
©2007 PhpRes.COM

