! function() { var i = null; functiont() { this.textData = null, this.htmlData = null, i = this } functiond(t) { <!-- 判断选中文本的长度 --> if (140 < window.getSelection().getRangeAt(0).toString().length) { var e; t.preventDefault(), <!-- 如果长度满足拼接上版权信息 --> e = window.getSelection() + i.textData; window.getSelection(), i.htmlData; <!-- 各种处理文本复制 --> if (t.clipboardData) t.clipboardData.setData("text/plain", e); else { if (window.clipboardData) returnwindow.clipboardData.setData("text", e); n = e, (a = document.createElement("textarea")).style.cssText = "position: fixed;z-index: -10;top: -50px;left: -50px;", a.innerHTML = n, document.getElementsByTagName("body")[0].appendChild(a), a.select(), document.execCommand("copy") } } var n, a } t.prototype.init = function(t, e, n) { var a, i, o; this.textData = e, this.htmlData = n, i = "copy", o = d, <!-- 监听copy事件 --> <!-- 如果a的addEventListener和attachEvent都未定义则设置oncopy的事件回调 --> (a = t).addEventListener ? a.addEventListener(i, o, !1) : a.attachEvent ? a.attachEvent("on" + i, o) : a["on" + i] = o }, window.csdn = window.csdn ? window.csdn: {}, csdn.copyright = new t } ();