記号挿入器で使用するjsコード
4355 ワード
/** * @author ティナ555 */ 機能 setHTML(html { ConttentEdit.value = html名 e WebEditor.document.designMode="On" e WebEditor.document.open() e WebEditor.document.write(); e WebEditor.document.body.co ntEditable="true" e WebEditor.document.execCommand(「2 D-Position」、true、true); eWebEditor.document.execCommand(「MultiplleSelection」) true、 true; eWebEditor.document.execCommand(「LiveResize」、 true、 true; e WebEditor.document.close() eWebEditor.document.body.onpaste = onPaste ; //eWebEditor.document.body.onhelp = オンヘルプ ; //eWebEditor.document.body.ondraged = new Function("return" ドラゴンズ();"); e WebEditor.document.onkeydown = new Function("return" onKeyDown(eWebEditor.event); //eWebEditor.document.oncontextmenu=new Function("return" showConteext Menu(eWebEditor.event); //eWebEditor.document.onmousedown = new Function("return" onmouse Down();"); //eWebEditor.document.onmouseup = new Function("return" onMouseUp();“);”機能 getHTML() { var html名 html = eWebEditor.document.body.inners HTML; if ((httml.toLowerCase()=「]*)([^>]*)/gi "<$1$3') ; html = httml.replace(/\\w[]*) style=「(^"*)」([^]*)/gi、 "<$1$3') ; html = httml.replace(/\\w[]*) ラング=(^^) |>]*)([^>]*)/gi "<$1$3') ; html = httml.replace(/\\???\????\?)xml[]*/gi "") ; html = httml.replace(/\/??\w+:[^]*/gi、 "") ; html = httml.replace(/ /) " " ); insertHTML( html ) ; } 機能 onPaste() { var sHTML = Get Clip boardHTML() ; var re = /<\w[>*] クラス=「MsoNormal"?/gi ; if ( re.test(sHTML){ if ( confirm(「貼り付けたい内容はWordから拷問されたようです。Word形式をクリアしてから貼り付けますか?」) ){ cleanAndPaste( sHTML ) ; return false ; } } }
」p>""""(html.toLowerCase()="
")"){ html = ""; } return html[名]機能 insertHTML() { eWebEditor.focus() if (e WebEditor.document.selection.type.to LowerCase() != "none"){ eWebEditor.document.selection.clear() ; } eWebEditor.document.selection.reat Range().pasteHTML() ; } 機能 apendHTML() { if (e WebEditor.document.selection.type.to LowerCase() != "none"){ eWebEditor.document.selection.clear() ; } eWebEditor.document.body.inners HTML += html[名]機能 ドラゴエンド(){ var セレクション = eWebEditor.document.selection.creat Range() var sRangeType = eWebEditor.document.selection.type; if (sRangeType == "コントローラ") { var oControl = oSelection.item(0) if (o Control.tagName == "IMG"){ o Control.src = FulPath 2 SetPath(oControl.src) } } if (sRangeType == "Text") { var els = eWebEditor.document.body.getElements ByTagName(「IMG」); var oRngTemp = eWebEditor.document.body.create TextRange() for(var) i=0;i