EMLOG复制后字段自动加入版权信息并提示

把这段代码加在footr.php即可

<script type="text/javascript">  document.body.oncopy=function(){warning();}  function addCopyright() {      var Original = "本文来源:" + location.href; //修改你的网站名称      if ("function" == typeof window.getSelection) {          var c = window.getSelection();          if ("Microsoft Internet Explorer" == navigator.appName && navigator.appVersion.match(/MSIE ([d.]+)/)[1] >= 10 || "Opera" == navigator.appName) {              var g = c.getRangeAt(0),              h = document.createElement("span");              h.appendChild(g.cloneContents()),              g.insertNode(h);              var i = h.innerHTML.replace(/(?:n|rn|r)/gi, "").replace(/<s*script[^>]*>[sS]*?</script>/gim, "").replace(/<s*style[^>]*>[sS]*?</style>/gim, "").replace(/<!--.*?-->/gim, "").replace(/<!DOCTYPE.*?>/gi, "");              try {                  document.getElementsByTagName("body")[0].removeChild(h)              } catch(f) {                  h.style.display = "none",                  h.innerHTML = ""              }          } else var d = "" + c;          var e = document.getElementsByTagName("body")[0],          f = document.createElement("div");          f.style.position = "absolute",          f.style.left = "-99999px",          e.appendChild(f),          f.innerHTML = d.replace(/([^>rn]?)(rn|nr|r|n)/g, "$1<br />$2") + "<br />" + Original,          c.selectAllChildren(f),          setTimeout(function() {              e.removeChild(f)          },          0)      } else if ("object" == typeof document.selection.createRange) {          event.returnValue = !1;          var c = document.selection.createRange().text;          window.clipboardData.setData("Text", c + "n" + Original)      }  alert("陌路人温馨提示:复制成功!若要转载请务必保留原文链接,申明来源,谢谢合作!");  };  document.body.oncopy = addCopyright;     </script>

本站资源均来源于网络或网友投稿,部分资源未经测试,难免存在BUG,所有资源只限于学习研究,不得商用。如使用本站下载的资源造成任何损失或发生侵权行为,均与本站无关。如不接受本声明请勿下载!本站资源如有侵权,请联系QQ:497149677核实后立即删除!
最客资源网 » EMLOG复制后字段自动加入版权信息并提示