天天躁日日躁狠狠躁AV麻豆-天天躁人人躁人人躁狂躁-天天澡夜夜澡人人澡-天天影视香色欲综合网-国产成人女人在线视频观看-国产成人女人视频在线观看

一個(gè)符號(hào)插入器 中用到的js代碼

/**
 * @author tin555
 */
function setHTML(html) {
    ContentEdit.value = html;
        eWebEditor.document.designMode="On";
        eWebEditor.document.open();
        eWebEditor.document.write(html);
        eWebEditor.document.body.contentEditable="true";
        eWebEditor.document.execCommand("2D-Position",true,true);
        eWebEditor.document.execCommand("MultipleSelection", true, true);
        eWebEditor.document.execCommand("LiveResize", true, true);
        eWebEditor.document.close();
    eWebEditor.document.body.onpaste = onPaste ;
    //eWebEditor.document.body.onhelp = onHelp ;
    //eWebEditor.document.body.ondragend = new Function("return doDragEnd();");
    eWebEditor.document.onkeydown = new Function("return onKeyDown(eWebEditor.event);");
    //eWebEditor.document.oncontextmenu=new Function("return showContextMenu(eWebEditor.event);");
    //eWebEditor.document.onmousedown = new Function("return onMouseDown();");
    //eWebEditor.document.onmouseup = new Function("return onMouseUp();");
}

function getHTML() {
    var html;

        html = eWebEditor.document.body.innerHTML;


        if ((html.toLowerCase()=="<p> </p>")||(html.toLowerCase()=="<p></p>")){
            html = "";
        }

    return html;
}


function insertHTML(html) {

    eWebEditor.focus();
    if (eWebEditor.document.selection.type.toLowerCase() != "none"){
        eWebEditor.document.selection.clear() ;
    }
    eWebEditor.document.selection.createRange().pasteHTML(html) ; 
}

function appendHTML(html) {
    if (eWebEditor.document.selection.type.toLowerCase() != "none"){
        eWebEditor.document.selection.clear() ;
    }
        eWebEditor.document.body.innerHTML += html;

}


function doDragEnd(){
    var oSelection = eWebEditor.document.selection.createRange();
    var sRangeType = eWebEditor.document.selection.type;
    if (sRangeType == "Control") {
        var oControl = oSelection.item(0);
        if (oControl.tagName == "IMG"){
            oControl.src = FullPath2SetPath(oControl.src);
        }
    }
    if (sRangeType == "Text") {
        var els = eWebEditor.document.body.getElementsByTagName("IMG");
        var oRngTemp = eWebEditor.document.body.createTextRange();
        for(var i=0;i<els.length;i++){
            oRngTemp.moveToElementText(els(i));
            if (oSelection.inRange(oRngTemp)){
                els(i).src = FullPath2SetPath(els(i).src)
            }
        }
    }

    return true;
}


function onKeyDown(event){
    var n_KeyCode = event.keyCode;
        if (n_KeyCode==13){
                    return false;
        }
}

var oResizing = new Object;
function onMouseDown(){
    oResizing.El = null;
    if (eWebEditor.document.selection.type == "Control") {
        var oControlRange = eWebEditor.document.selection.createRange();
        oResizing.El = oControlRange(0);
        oResizing.W = oResizing.El.style.width;
        oResizing.H = oResizing.El.style.height;
    }

    
}

function GetClipboardHTML() {
    var oDiv = document.getElementById("eWebEditor_Temp_HTML");
    oDiv.innerHTML = "" ;
    var oTextRange = document.body.createTextRange() ;
    oTextRange.moveToElementText(oDiv) ;
    oTextRange.execCommand("Paste") ;

    var sData = oDiv.innerHTML ;
    oDiv.innerHTML = "" ;

    return sData ;
}


function cleanAndPaste( html ) {
    html = html.replace(/<//?SPAN[^>]*>/gi, "" );
    html = html.replace(/<(/w[^>]*) class=([^ |>]*)([^>]*)/gi, "<$1$3") ;
    html = html.replace(/<(/w[^>]*) style="([^"]*)"([^>]*)/gi, "<$1$3") ;
    html = html.replace(/<(/w[^>]*) lang=([^ |>]*)([^>]*)/gi, "<$1$3") ;
    html = html.replace(/<//?/?xml[^>]*>/gi, "") ;
    html = html.replace(/<//?/w+:[^>]*>/gi, "") ;
    html = html.replace(/ /, " " );

    insertHTML( html ) ;
}
function onPaste() {
        var sHTML = GetClipboardHTML() ;
            var re = /</w[^>]* class="?MsoNormal"?/gi ;
            if ( re.test(sHTML)){
                if ( confirm("你要粘貼的內(nèi)容好象是從Word中拷出來(lái)的,是否要先清除Word格式再粘貼?") ){
                    cleanAndPaste( sHTML ) ;
                    return false ;
                }
                }
}

JavaScript技術(shù)一個(gè)符號(hào)插入器 中用到的js代碼,轉(zhuǎn)載需保留來(lái)源!

鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請(qǐng)第一時(shí)間聯(lián)系我們修改或刪除,多謝。

主站蜘蛛池模板: 99福利视频| 某上海少妇3P黑人完整版BD | 快播性爱电影 | 97精品国偷拍自产在线 | 啦啦啦 中国 日本 高清 在线 | 夜色福利院在线观看免费 | 一本色道久久综合亚洲AV蜜桃 | 久久热在线视频精品店 | DASD-700美谷朱里 | 91嫩草私人成人亚洲影院 | 99re 这里只有精品 | 十分钟免费视频大全在线观看 | 嗯啊…跟校草在教室里做h 嗯 用力啊 嗯 c我 啊哈老师 | WWW国产无套内射久久 | 狠狠狠色丁香婷婷综合久久 | 色欲人妻无码AV专区 | 亚洲中文字幕日产乱码2020 | 好吊日视频在线 | 青草久久精品亚洲综合专区 | 国产午夜人成在线视频麻豆 | 国语自产偷成人精品视频 | 美女强奷到抽搐在线播放 | 人人澡人人爽人人精品 | 偷柏自拍亚洲综合在线 | 涩涩爱涩涩片影院 | GAY2022空少被体育生暴菊 | 老熟女重囗味GRANNYBBW | 2012中文字幕手机在线 | 男人j进女人j一进一出 | 国产人妻久久久精品麻豆 | 日日日夜夜在线视频 | 人人舔人人爱 | 在线日本高清日本免费 | 中文字幕久久久 | 伊人精品视频直播 | 高h辣h双处全是肉一对一 | 小雪奶水涨翁工帮吸的推荐语录 | 全黄H全肉细节文短篇 | 精品少妇爆AV无码专区 | 最近2019中文字幕MV免费看 | 久久精品一本到99热 |