Comments Everywhere

Pissed about media outlets that choose on what news you can or not comment? No more, this script will put a small "C" button on all pages footers, upon clicking on it you'll gain the ability to comment and read comments from other people on any page!

当前为 2018-09-13 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Comments Everywhere
  3. // @version 1
  4. // @grant none
  5. // @description Pissed about media outlets that choose on what news you can or not comment? No more, this script will put a small "C" button on all pages footers, upon clicking on it you'll gain the ability to comment and read comments from other people on any page!
  6. // @namespace https://greasyfork.org/users/212682
  7. // ==/UserScript==
  8.  
  9. window.onload=function(evt)
  10. {
  11. // Holder
  12. var cBox = document.createElement('div');
  13. cBox.style = `display:none; z-index:9998; position:fixed; bottom:30px; left:1%; width:98%; overflow-y:scroll; background-color:white; height:400px; box-shadow: inset 0px 0px 5px 0px rgba(0,0,0,0.75); border-radius:5px; padding: 0px 15px 0px 15px; box-sizing: border-box;`;
  14. document.body.appendChild(cBox);
  15. var cBut = document.createElement('div');
  16. cBut.style = `z-index:9999; position:fixed; bottom:5px; right:1%; cursor:pointer; background-color: #ddd; border-radius:5px; width:30px; text-align:center; border:1px solid gray; font-family: arial, sans-serif; font-size: 13px;`;
  17. cBut.innerHTML = 'C';
  18. document.body.appendChild(cBut);
  19. cBut.onclick=(evt)=>
  20. {
  21. if(cBox.style.display!='none')
  22. cBox.style.display='none';
  23. else { cBox.style.display='block';
  24. if(cBox.children.length!=0) return false;
  25. // htmlcommentbox
  26. cBox.innerHTML = `
  27. <div id="HCB_comment_box"><a href="http://www.htmlcommentbox.com">HTML Comment Box</a> is loading comments...</div>
  28. <link rel="stylesheet" type="text/css" href="//www.htmlcommentbox.com/static/skins/simple/skin.css" />
  29. `;
  30. if(!window.hcb_user){hcb_user={};} (function(){var s=document.createElement("script"), l=hcb_user.PAGE || (""+window.location).replace(/'/g,"%27"), h="//www.htmlcommentbox.com";s.setAttribute("type","text/javascript");s.setAttribute("src", h+"/jread?page="+encodeURIComponent(l).replace("+","%2B")+"&opts=16862&num=50&ts=1536839262742");if (typeof s!="undefined") document.getElementsByTagName("head")[0].appendChild(s);})();
  31. }
  32. };
  33. }