myqdhi
2017-09-20 13:10
采纳率: 100%
浏览 1.6k

js解密 求大神帮忙 一个加密压缩的js文件

解密文件地址 https://pan.baidu.com/s/1sla5KmT 下面是开头部分代码

eval(function (p, a, c, k, e, d) { e = function (c) { return (c < a ? "" : e(parseInt(c / a))) + ((c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36)) }; if (!''.replace(/^/, String)) { while (c--) d[e(c)] = k[c] || e(c); k = [function (e) { return d[e] }]; e = function () { return '\w+' }; c = 1; }; while (c--) if (k[c]) p = p.replace(new RegExp('\b' + e(c) + '\b', 'g'), k[c]); return p; }('2y 1y$=["","\L\u\A\C\h\1a\o\k","\B\A\r\x\Z\D\u\A\Z\r\l\h","\k\r\17

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • 已采纳

    记得采纳

    http://www.css-js.cn/,可以用这个先解密2次后,最后一次自己log得到源码,下面贴出来的

     console.log(a19)//2次 解密后加这句,放浏览器执行得源代码
        return a19;
    
    
     var MEdit = function(setting) {
        var _self = this;
        _self.setting = {
            meditid:"",
            "default":{
                skin:"default",
                updir:"/upload/images/",
                upurl:"/up/asp.net/UpHandler.ashx",
                html:'<ul><li><span><img src="skin/{skinname}/img/编辑器_插文字.png" />插文字</span><span><img src="skin/{skinname}/img/编辑器_插图片.png" />插图片</span><span><img src="skin/{skinname}/img/编辑器_删除前.png" />删除前</span></li><li><span><img src="skin/{skinname}/img/编辑器_插视频.png" />插视频</span><span><img src="skin/{skinname}/img/编辑器_插广告.png" />插广告</span><span><img src="skin/{skinname}/img/编辑器_删除后.png" />删除后</span></li><li><span><img src="skin/{skinname}/img/编辑器_插音乐.png" />插音乐</span><span><img src="skin/{skinname}/img/编辑器_改文字-.png" />改文字</span><span><img src="skin/{skinname}/img/编辑器_删除.png" />删<i>你</i>除</span></li><li><span><img src="skin/{skinname}/img/编辑器_取消.png" />取消</span></li></ul>',
                edithtml:'<ul class="tedit"><li><span><img src="skin/{skinname}/img/txt/1.png" /></span><span><img src="skin/{skinname}/img/txt/2.png" /><i class="xiahuaxian"></i></span><span><img src="skin/{skinname}/img/txt/3.png" /></span><span><img class="h16" src="skin/{skinname}/img/txt/4.png" /></span><span><img class="h16" src="skin/{skinname}/img/txt/5.png" /></span><span><img class="h16" src="skin/{skinname}/img/txt/6.png" /></span><span><img class="h16" src="skin/{skinname}/img/txt/7.png" /></span><a href="javascript:;" class="right">清空</a></li><li class="content"><textarea placeholder="请输入文字"></textarea></li><li><a href="javascript:;">取消</a><a href="javascript:;" class="hover">提交</a></li></ul><ul class="fedit"><li><span>文字颜色</span><a href="javascript:;" class="right">取消</a></li><li class="content"><span class="one1" data-color="#000"></span><span class="one2" data-color="#0f3efe"></span><span class="one3" data-color="#a97a46"></span><span class="one4" data-color="#03fcfe"></span><span class="one5" data-color="#00f72c"></span><span class="one6" data-color="#ff4cfd"></span><span class="one7" data-color="#fc951e"></span><span class="one8" data-color="#932890"></span><span class="one9" data-color="#ff2a1a"></span><span class="one10" data-color="#fdf935"></span><span class="one11" data-color="#FFF"></span></li><li><a>标准颜色</a></li></ul><ul class="sedit"><li><span>字体大小</span><a href="javascript:;" class="right">取消</a></li><li class="content"><span>10px</span><span>12px</span><span>14px</span><span>16px</span><span>18px</span><span>28px</span></li></ul>',
                videohtml:'<div class="main"><div class="tit">请粘贴视频地址到下面的输入框:</div><div class="body"><input type="text" value="" placeholder="仅支持腾讯,优酷视频地址(优酷不支持微信中播放)" id="MEditVideoUrl" class="inp"></div><button type="button" class="btn btn_yes">插入</button><button type="button" class="btn btn_no">取消</button></div>',
                adhtml:'<ul><li data-type="word">文字广告</li><li data-type="image">图片广告</li><li class="lastli">取消</li></ul>',
                adfonthtml:'<div class="main"><div class="tit">文字广告:</div><div class="body"><input type="text" value="" placeholder="请输入广告标题" id="MEditadTitle" class="inp"></div><div class="body"><input type="text" value="" placeholder="请输入广告URL地址" id="MEditadTitleUrl" class="inp"></div><button type="button" class="btn btn_yes">插入</button><button type="button" class="btn btn_no">取消</button></div>',
                adimghtml:'<div class="main"><div class="tit">图片广告:</div><div class="body"><input type="file" value="" accept="image/*" id="MEditadImg" class="inp"></div><div class="body"><input type="text" value="" placeholder="请输入广告URL地址" id="MEditadImgUrl" class="inp"></div><button type="button" class="btn btn_yes">插入</button><button type="button" class="btn btn_no">取消</button></div>',
                loadhtml:'<div class="spinner-container container1"><div class="circle1"></div><div class="circle2"></div><div class="circle3"></div><div class="circle4"></div></div><div class="spinner-container container2"><div class="circle1"></div><div class="circle2"></div><div class="circle3"></div><div class="circle4"></div></div><div class="spinner-container container3"><div class="circle1"></div><div class="circle2"></div><div class="circle3"></div><div class="circle4"></div></div>',
                musichtml:'<div class="main"><div class="tit">插入音乐(如未找到,请认真填写,多试几次):</div><div class="body"><input type="text" value="" placeholder="请输入音乐名称" id="MEditadMusic" class="inp"></div><div class="body"><input type="text" value="" placeholder="请输入音乐作者" id="MEditadMusicAuther" class="inp"></div><button type="button" class="btn btn_yes">插入</button><button type="button" class="btn btn_no">取消</button></div>',
                loadname:"MEdit_load",
                musicname:"MEdit_music",
                adname:"MEdit_ad",
                adfontname:"MEdit_ad_font",
                adimgname:"MEdit_ad_img",
                videoname:"MEdit_video",
                name:"MEdit",
                txtname:"MEdit_txt",
                timenum:-245,
                isShow:false,
                imgupname:"MEdit_imgup"
            },
            model:{
                obj:null,
                edit:false
            }
        };
        _self.plus = {
            ajax:function(date, url, callback) {
                var xmlhttp = null;
                _self.loading(true);
                var createXHttpRequest = function() {
                    if (window.ActiveXObject) {
                        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
                    } else if (window.XMLHttpRequest) {
                        xmlhttp = new XMLHttpRequest();
                    } else {
                        return;
                    }
                };
                var starRequest = function(date) {
                    createXHttpRequest();
                    xmlhttp.onreadystatechange = function() {
                        if (xmlhttp.readyState == 4) {
                            if (xmlhttp.status == 200) {
                                _self.loading(false);
                                callback(xmlhttp.responseText);
                            }
                        }
                    };
                    xmlhttp.open("POST", url, true);
                    xmlhttp.send(date);
                };
                starRequest(date);
            },
            insertAfter:function(newElement, targetElement) {
                var parent = targetElement.parentNode;
                if (parent.lastChild == targetElement) {
                    parent.a(newElement);
                } else {
                    parent.insertBefore(newElement, targetElement.nextSibling);
                }
            }
        };
        _self.LoadSetting = function() {
            _self.setting.meditid = setting.meditid;
        };
        _self.LoadSkin = function() {
            var skinmodel = document.createElement("link");
            skinmodel.href = "skin/" + _self.setting.default.skin + "/default.css?" + new Date();
            skinmodel.rel = "stylesheet";
            document.head.appendChild(skinmodel);
            var meditmodel = document.createElement("div");
            meditmodel.className = _self.setting.default.name;
            meditmodel.id = _self.setting.default.name;
            meditmodel.innerHTML = _self.setting.default.html.replace(/{skinname}/g, _self.setting.default.skin);
            document.body.appendChild(meditmodel);
        };
        _self.BindBtnClick = function() {
            var LoadMeditDW = function() {
                if (_self.setting.default.isShow) {
                    document.getElementById(_self.setting.meditid).style.marginBottom = "275px";
                } else {
                    document.getElementById(_self.setting.meditid).style.marginBottom = "0";
                }
            };
            var LoadMEdit = function(show) {
                var _m = document.getElementById(_self.setting.default.name);
                if (show) {
                    _self.setting.default.isShow = true;
                    _m.setAttribute("class", _self.setting.default.name + " on");
                    LoadMeditDW();
                } else {
                    _self.setting.default.isShow = false;
                    _m.setAttribute("class", _self.setting.default.name);
                    LoadMeditDW();
                }
            };
            var BindPclick = function() {
                document.getElementById(_self.setting.meditid).onclick = function(event) {
                    if (this == event.target) {
                        return false;
                    }
                    if (!!_self.setting.model.obj) {
                        _self.setting.model.obj.removeAttribute("class");
                    }
                    event.target.setAttribute("class", "MEditSelect");
                    _self.setting.model.obj = event.target;
                    if (!_self.setting.default.isShow) {
                        LoadMEdit(true);
                    }
                    return false;
                };
            };
            var loadedit = function(show, name, html, callback) {
                if (show && !document.getElementById(name)) {
                    var admodel = document.createElement("div");
                    admodel.className = name;
                    admodel.id = name;
                    admodel.innerHTML = html;
                    document.body.appendChild(admodel);
                    var qpmodel = document.createElement("div");
                    qpmodel.id = name + "_qp";
                    qpmodel.setAttribute("style", "background-color: #000;opacity: 0.3;width: 100%;height: 100%;position: fixed;top: 0;left: 0;");
                    document.body.appendChild(qpmodel);
                    callback();
                }
                if (show) {
                    LoadMEdit(false);
                    document.getElementById(name).setAttribute("class", name + " on");
                    document.getElementById(name + "_qp").style.display = "block";
                } else {
                    if (!!document.getElementById(name)) {
                        document.getElementById(name).setAttribute("class", name);
                        document.getElementById(name + "_qp").style.display = "none";
                    }
                }
            };
            _self.loading = function(show) {
                if (show && !document.getElementById(_self.setting.default.loadname)) {
                    var admodel = document.createElement("div");
                    admodel.className = _self.setting.default.loadname;
                    admodel.id = _self.setting.default.loadname;
                    admodel.innerHTML = _self.setting.default.loadhtml;
                    document.body.appendChild(admodel);
                    var qpmodel = document.createElement("div");
                    qpmodel.id = _self.setting.default.loadname + "_qp";
                    qpmodel.setAttribute("style", "background-color: #000;opacity: 0.3;width: 100%;height: 100%;position: fixed;top: 0;left: 0;z-index:99999999999");
                    document.body.appendChild(qpmodel);
                }
                if (show) {
                    document.getElementById(_self.setting.default.loadname).style.display = "block";
                    document.getElementById(_self.setting.default.loadname + "_qp").style.display = "block";
                } else {
                    if (!!document.getElementById(_self.setting.default.loadname)) {
                        document.getElementById(_self.setting.default.loadname).style.display = "none";
                        document.getElementById(_self.setting.default.loadname + "_qp").style.display = "none";
                    }
                }
            };
            var loadmusicedit = function(show) {
                loadedit(show, _self.setting.default.musicname, _self.setting.default.musichtml, function() {
                    var _button = document.getElementById(_self.setting.default.musicname).getElementsByTagName("button");
                    _button[0].onclick = function() {
                        var _music = document.getElementById("MEditadMusic").value;
                        var _musicauther = document.getElementById("MEditadMusicAuther").value;
                        if (_music == "") {
                            alert("请输入音乐名称");
                            return;
                        }
                        if (_musicauther == "") {
                            alert("请输入音乐作者");
                            return;
                        }
                        var myForm = new FormData();
                        myForm.append("action", "getmusicurl");
                        myForm.append("musicname", _music);
                        myForm.append("musicauther", _musicauther);
                        _self.plus.ajax(myForm, _self.setting.default.upurl, function(data) {
                            if (!!data) {
                                if (!!_self.setting.model.obj) {
                                    var kjid = "sound_" + Math.ceil(Math.random() * 1e5);
                                    var pmodel = document.createElement("p");
                                    pmodel.innerHTML = '<audio controls="controls" loop="loop" id="' + kjid + '" autoplay="autoplay" style="width: 100%;"><source src="' + data + '"></audio><script>var sound = document.getElementById("' + kjid + '"); sound.play();</script>';
                                    _self.plus.insertAfter(pmodel, _self.setting.model.obj);
                                    loadmusicedit(false);
                                    loadadedit(false);
                                    if (!!_self.setting.model.obj) {
                                        _self.setting.model.obj.removeAttribute("class");
                                    }
                                }
                            } else {
                                alert("抱歉未找到音乐");
                            }
                        });
                    };
                    _button[1].onclick = function() {
                        loadmusicedit(false);
                    };
                });
            };
            var loadimgedit = function(show) {
                loadedit(show, _self.setting.default.adimgname, _self.setting.default.adimghtml, function() {
                    var _button = document.getElementById(_self.setting.default.adimgname).getElementsByTagName("button");
                    _button[0].onclick = function() {
                        var _img = document.getElementById("MEditadImg");
                        var _url = document.getElementById("MEditadImgUrl").value;
                        if (_img.value == "") {
                            alert("请选择广告图片");
                            return;
                        }
                        if (_url == "") {
                            alert("请输入广告地址");
                            return;
                        }
                        var myForm = new FormData();
                        myForm.append("action", "upimg");
                        myForm.append("updir", _self.setting.default.updir);
                        myForm.append("filename", _img.files[0]);
                        _self.plus.ajax(myForm, _self.setting.default.upurl, function(data) {
                            if (!!data) {
                                if (!!_self.setting.model.obj) {
                                    var imgmodel = document.createElement("img");
                                    imgmodel.src = _self.setting.default.updir + data;
                                    imgmodel.style.maxWidth = "100%";
                                    var amodel = document.createElement("a");
                                    amodel.href = _url;
                                    amodel.appendChild(imgmodel);
                                    _self.plus.insertAfter(amodel, _self.setting.model.obj);
                                    loadimgedit(false);
                                    loadadedit(false);
                                    if (!!_self.setting.model.obj) {
                                        _self.setting.model.obj.removeAttribute("class");
                                    }
                                }
                            }
                        });
                    };
                    _button[1].onclick = function() {
                        loadimgedit(false);
                    };
                });
            };
            var loadfontadedit = function(show) {
                loadedit(show, _self.setting.default.adfontname, _self.setting.default.adfonthtml, function() {
                    var _button = document.getElementById(_self.setting.default.adfontname).getElementsByTagName("button");
                    _button[0].onclick = function() {
                        var _title = document.getElementById("MEditadTitle").value;
                        var _url = document.getElementById("MEditadTitleUrl").value;
                        if (_title == "") {
                            alert("请输入广告标题");
                            return;
                        }
                        if (_url == "") {
                            alert("请输入广告地址");
                            return;
                        }
                        var amodel = document.createElement("a");
                        amodel.innerText = _title;
                        amodel.href = _url;
                        _self.plus.insertAfter(amodel, _self.setting.model.obj);
                        loadfontadedit(false);
                        loadadedit(false);
                        if (!!_self.setting.model.obj) {
                            _self.setting.model.obj.removeAttribute("class");
                        }
                    };
                    _button[1].onclick = function() {
                        loadfontadedit(false);
                    };
                });
            };
            var loadadedit = function(show) {
                loadedit(show, _self.setting.default.adname, _self.setting.default.adhtml, function() {
                    var _li = document.getElementById(_self.setting.default.adname).getElementsByTagName("li");
                    _li[0].onclick = function() {
                        loadfontadedit(true);
                    };
                    _li[1].onclick = function() {
                        loadimgedit(true);
                    };
                    _li[2].onclick = function() {
                        loadadedit(false);
                    };
                });
            };
            var loadvideoedit = function(show) {
                loadedit(show, _self.setting.default.videoname, _self.setting.default.videohtml, function() {
                    var _button = document.getElementById(_self.setting.default.videoname).getElementsByTagName("button");
                    _button[0].onclick = function() {
                        var spurl = document.getElementById("MEditVideoUrl");
                        if (spurl.value.length < 10) {
                            alert("抱歉,视频地址输入错误");
                            return;
                        }
                        var myForm = new FormData();
                        myForm.append("action", "getvideourl");
                        myForm.append("spurl", spurl.value);
                        _self.plus.ajax(myForm, _self.setting.default.upurl, function(data) {
                            if (!!data) {
                                if (!!_self.setting.model.obj) {
                                    spurl.value = "";
                                    var pmodel = document.createElement("p");
                                    pmodel.innerHTML = data;
                                    _self.plus.insertAfter(pmodel, _self.setting.model.obj);
                                    loadvideoedit(false);
                                }
                            } else {
                                alert("抱歉,未找到您要插入的视频");
                            }
                        });
                    };
                    _button[1].onclick = function() {
                        loadvideoedit(false);
                    };
                });
            };
            var loadtxtedit = function(edit) {
                _self.setting.model.edit = edit;
                if (!document.getElementById(_self.setting.default.txtname)) {
                    var meditmodel = document.createElement("div");
                    meditmodel.className = _self.setting.default.txtname;
                    meditmodel.id = _self.setting.default.txtname;
                    meditmodel.innerHTML = _self.setting.default.edithtml.replace(/{skinname}/g, _self.setting.default.skin);
                    document.body.appendChild(meditmodel);
                    var qpmodel = document.createElement("div");
                    qpmodel.id = _self.setting.default.txtname + "_qp";
                    qpmodel.setAttribute("style", "background-color: #000;opacity: 0.3;width: 100%;height: 100%;position: fixed;top: 0;left: 0;");
                    document.body.appendChild(qpmodel);
                    var _txtedit = document.getElementById(_self.setting.default.txtname);
                    var _txtedit_ul = _txtedit.getElementsByTagName("ul");
                    var _content = _txtedit.getElementsByTagName("textarea")[0];
                    var _a = _txtedit.getElementsByTagName("a");
                    var _span = _txtedit.getElementsByTagName("li")[0].getElementsByTagName("span");
                    _txtedit_ul[1].getElementsByTagName("li")[0].getElementsByTagName("a")[0].onclick = function() {
                        _txtedit_ul[0].style.display = "block";
                        _txtedit_ul[1].style.display = "none";
                    };
                    _txtedit_ul[2].getElementsByTagName("li")[0].getElementsByTagName("a")[0].onclick = function() {
                        _txtedit_ul[0].style.display = "block";
                        _txtedit_ul[2].style.display = "none";
                    };
                    var oldfontcur_color = "", oldbgcur_color = "", show = 0;
                    var _color_m = _txtedit_ul[1].getElementsByTagName("li")[1].getElementsByTagName("span");
                    for (var j = 0; j < _color_m.length; j++) {
                        _color_m[j].onclick = function() {
                            _txtedit_ul[0].style.display = "block";
                            _txtedit_ul[1].style.display = "none";
                            if (show == 0) {
                                var _css = "color: " + this.getAttribute("data-color") + ";";
                                oldfontcur_color = _css;
                                _txtedit_ul[0].getElementsByTagName("li")[0].getElementsByTagName("span")[1].getElementsByTagName("i")[0].style.background = this.getAttribute("data-color");
                                var ystyle = _content.getAttribute("style") == null ? "" :_content.getAttribute("style");
                                _span[1].removeAttribute("class");
                                ystyle = ystyle.replace(oldfontcur_color, "");
                                _content.setAttribute("style", ystyle);
                                editcss(_css, _span[1]);
                            } else if (show == 1) {
                                var _css = "background-color: " + this.getAttribute("data-color") + ";";
                                oldbgcur_color = _css;
                                var ystyle = _content.getAttribute("style") == null ? "" :_content.getAttribute("style");
                                _span[2].removeAttribute("class");
                                ystyle = ystyle.replace(oldbgcur_color, "");
                                _content.setAttribute("style", ystyle);
                                editcss(_css, _span[2]);
                            }
                        };
                    }
                    var oldfont = "";
                    var _fontsize_m = _txtedit_ul[2].getElementsByTagName("li")[1].getElementsByTagName("span");
                    for (var k = 0; k < _fontsize_m.length; k++) {
                        _fontsize_m[k].onclick = function() {
                            var _css = "font-size: " + this.innerText + ";";
                            oldfont = _css;
                            var ystyle = _content.getAttribute("style") == null ? "" :_content.getAttribute("style");
                            _span[3].removeAttribute("class");
                            ystyle = ystyle.replace(oldfont, "");
                            _content.setAttribute("style", ystyle);
                            editcss(_css, _span[3]);
                            _txtedit_ul[0].style.display = "block";
                            _txtedit_ul[2].style.display = "none";
                        };
                    }
                    var editcss = function(_css, _obj) {
                        var ystyle = _content.getAttribute("style") == null ? "" :_content.getAttribute("style");
                        if (_obj.getAttribute("class") == null) {
                            _content.setAttribute("style", ystyle + _css);
                            _obj.setAttribute("class", "hover");
                        } else {
                            ystyle = ystyle.replace(_css, "");
                            _content.setAttribute("style", ystyle);
                            _obj.removeAttribute("class");
                        }
                    };
                    var cleardq = function(index) {
                        var ystyle = _content.getAttribute("style") == null ? "" :_content.getAttribute("style");
                        if (index != 0) {
                            _span[4].removeAttribute("class");
                            ystyle = ystyle.replace("text-align: left;", "");
                        }
                        if (index != 1) {
                            _span[5].removeAttribute("class");
                            ystyle = ystyle.replace("text-align: center;", "");
                        }
                        if (index != 2) {
                            _span[6].removeAttribute("class");
                            ystyle = ystyle.replace("text-align: right;", "");
                        }
                        _content.setAttribute("style", ystyle);
                    };
                    _a[0].onclick = function() {
                        for (var i = 0; i < _span.length; i++) {
                            _span[i].removeAttribute("class");
                        }
                        _content.removeAttribute("style");
                        _txtedit_ul[0].getElementsByTagName("li")[0].getElementsByTagName("span")[1].getElementsByTagName("i")[0].style.background = "#000";
                    };
                    _a[1].onclick = function() {
                        this.parentNode.parentNode.parentNode.style.display = "none";
                        document.getElementById(_self.setting.default.txtname + "_qp").style.display = "none";
                        _a[0].click();
                    };
                    _a[2].onclick = function() {
                        if (_content.value == "") {
                            alert("请输入内容");
                            return;
                        }
                        if (!_self.setting.model.edit) {
                            var _pmodel = document.createElement("p");
                            _pmodel.setAttribute("style", _content.getAttribute("style"));
                            _pmodel.innerText = _content.value;
                            _self.plus.insertAfter(_pmodel, _self.setting.model.obj);
                        } else {
                            _self.setting.model.obj.setAttribute("style", _content.getAttribute("style"));
                            _self.setting.model.obj.innerText = _content.value;
                        }
                        if (!!_self.setting.model.obj) {
                            _self.setting.model.obj.removeAttribute("class");
                        }
                        _a[1].click();
                    };
                    _span[0].onclick = function() {
                        var _css = "font-weight: 700;";
                        editcss(_css, this);
                    };
                    _span[1].onclick = function() {
                        show = 0;
                        _txtedit_ul[0].style.display = "none";
                        _txtedit_ul[1].getElementsByTagName("li")[0].getElementsByTagName("span")[0].innerText = "文字颜色";
                        _txtedit_ul[1].style.display = "block";
                    };
                    _span[2].onclick = function() {
                        show = 1;
                        _txtedit_ul[0].style.display = "none";
                        _txtedit_ul[1].getElementsByTagName("li")[0].getElementsByTagName("span")[0].innerText = "背景颜色";
                        _txtedit_ul[1].style.display = "block";
                    };
                    _span[3].onclick = function() {
                        _txtedit_ul[0].style.display = "none";
                        _txtedit_ul[2].style.display = "block";
                    };
                    _span[4].onclick = function() {
                        cleardq(0);
                        var _css = "text-align: left;";
                        editcss(_css, this);
                    };
                    _span[5].onclick = function() {
                        cleardq(1);
                        var _css = "text-align: center;";
                        editcss(_css, this);
                    };
                    _span[6].onclick = function() {
                        cleardq(2);
                        var _css = "text-align: right;";
                        editcss(_css, this);
                    };
                }
                var _tedit = document.getElementById(_self.setting.default.txtname);
                if (!edit) {
                    _tedit.getElementsByTagName("textarea")[0].value = "";
                } else {
                    if (_self.setting.model.obj.getAttribute("style") != null) {
                        _tedit.getElementsByTagName("textarea")[0].setAttribute("style", _self.setting.model.obj.getAttribute("style"));
                    }
                    _tedit.getElementsByTagName("textarea")[0].value = _self.setting.model.obj.innerText;
                }
                _tedit.style.display = "block";
                document.getElementById(_self.setting.default.txtname + "_qp").style.display = "block";
            };
            var BindSpanClick = function() {
                var spanlist = document.getElementById(_self.setting.default.name).getElementsByTagName("span");
                spanlist[0].onclick = function() {
                    loadtxtedit(false);
                    LoadMEdit(false);
                };
                spanlist[1].onclick = function() {
                    if (!document.getElementById(_self.setting.default.imgupname)) {
                        var imgup = document.createElement("input");
                        imgup.type = "file";
                        imgup.accept = "image/*";
                        imgup.id = _self.setting.default.imgupname;
                        imgup.name = _self.setting.default.imgupname;
                        imgup.onchange = function() {
                            var myForm = new FormData();
                            myForm.append("action", "upimg");
                            myForm.append("updir", _self.setting.default.updir);
                            myForm.append("filename", this.files[0]);
                            _self.plus.ajax(myForm, _self.setting.default.upurl, function(data) {
                                if (!!data) {
                                    if (!!_self.setting.model.obj) {
                                        var imgmodel = document.createElement("img");
                                        imgmodel.src = _self.setting.default.updir + data;
                                        imgmodel.style.maxWidth = "100%";
                                        _self.plus.insertAfter(imgmodel, _self.setting.model.obj);
                                        LoadMEdit(false);
                                    }
                                }
                            });
                        };
                        document.getElementById(_self.setting.default.name).appendChild(imgup);
                    }
                    document.getElementById(_self.setting.default.imgupname).click();
                };
                spanlist[2].onclick = function() {
                    if (!!_self.setting.model.obj) {
                        var upmodel = _self.setting.model.obj.previousSibling;
                        while (!!upmodel && upmodel.nodeType != 1) {
                            upmodel = upmodel.previousSibling;
                        }
                        if (!!upmodel) {
                            _self.setting.model.obj.parentNode.removeChild(upmodel);
                        }
                    }
                };
                spanlist[3].onclick = function() {
                    loadvideoedit(true);
                };
                spanlist[4].onclick = function() {
                    loadadedit(true);
                };
                spanlist[5].onclick = function() {
                    if (!!_self.setting.model.obj) {
                        var nextmodel = _self.setting.model.obj.nextSibling;
                        while (!!nextmodel && nextmodel.nodeType != 1) {
                            nextmodel = nextmodel.nextSibling;
                        }
                        if (!!nextmodel) {
                            _self.setting.model.obj.parentNode.removeChild(nextmodel);
                        }
                    }
                };
                spanlist[6].onclick = function() {
                    loadmusicedit(true);
                };
                spanlist[7].onclick = function() {
                    loadtxtedit(true);
                    LoadMEdit(false);
                };
                spanlist[8].onclick = function() {
                    if (!!_self.setting.model.obj) {
                        _self.setting.model.obj.parentNode.removeChild(_self.setting.model.obj);
                        _self.setting.model.obj = null;
                        LoadMEdit(false);
                    }
                };
                spanlist[9].onclick = function() {
                    LoadMEdit(false);
                };
            };
            BindPclick();
            BindSpanClick();
        };
        _self.Load = function() {
            _self.LoadSetting();
            _self.LoadSkin();
            _self.BindBtnClick();
        };
        _self.Load();
    };
    
    点赞 评论

相关推荐 更多相似问题