Toggle Docs Comments

toggle comments in google doc. You get a small button on the left bottom of your screen.

  1. // ==UserScript==
  2. // @name Toggle Docs Comments
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description toggle comments in google doc. You get a small button on the left bottom of your screen.
  6. // @include https://*docs.google.*/document/*
  7. // @author andreask
  8. // @match https://*docs.google.*/document/*
  9. // @require http://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js
  10. // @grant GM_addStyle
  11.  
  12. // ==/UserScript==
  13. /* globals jQuery, $, waitForKeyElements */
  14. 'use strict';
  15. var link = window.document.createElement('link');
  16. link.rel = 'stylesheet';
  17. link.type = 'text/css';
  18. link.href = 'https://fonts.googleapis.com/icon?family=Material+Icons';
  19. document.getElementsByTagName("HEAD")[0].appendChild(link);
  20.  
  21. $("body").append (''
  22. + '<div class="gmPersistentButton" style="position:fixed;bottom:1em;left:2em;z-index:6666;">'
  23. + '<button class="material-icons" id="gmContinueBtn" title="toggle comments">toggle_on</button>'
  24. + '</div>'
  25. );
  26.  
  27. //--- Activate the button.
  28. $("#gmContinueBtn").click ( function () {
  29. var btnValue = this.textContent;
  30. if (btnValue == "toggle_on") {
  31. $(".kix-discussion-plugin").hide();
  32. this.textContent = "toggle_off"
  33. }
  34. else {
  35. $(".kix-discussion-plugin").show();
  36. this.textContent = "toggle_on"
  37. }
  38. } );
  39.  
  40.  
  41. // $(".kix-discussion-plugin").hide();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址