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 4
  4. // @grant none
  5. // @match http*://*/*
  6. // @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!
  7. // @namespace https://greasyfork.org/users/212682
  8. // ==/UserScript==
  9.  
  10. // Holder
  11. var cBox = document.createElement('div');
  12. 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;`;
  13. document.body.appendChild(cBox);
  14. var cBut = document.createElement('div');
  15. 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;`;
  16. cBut.innerHTML = 'C';
  17. document.body.appendChild(cBut);
  18. cBut.onclick=(evt)=>
  19. {
  20. if(cBox.style.display!='none')
  21. cBox.style.display='none';
  22. else { cBox.style.display='block';
  23. if(cBox.children.length!=0) return false;
  24. // htmlcommentbox
  25. cBox.innerHTML = `
  26. <div id="HCB_comment_box"><a href="http://www.htmlcommentbox.com">HTML Comment Box</a> is loading comments...</div>
  27. <link rel="stylesheet" type="text/css" href="//www.htmlcommentbox.com/static/skins/simple/skin.css" />
  28. `;
  29. 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);})();
  30. }
  31. };