Toggle Docs Comments

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

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Toggle Docs Comments
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  toggle comments in google doc. You get a small button on the left bottom of your screen.
// @include      https://*docs.google.*/document/*
// @author       andreask
// @match        https://*docs.google.*/document/*
// @require      http://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js
// @grant        GM_addStyle

// ==/UserScript==
/* globals jQuery, $, waitForKeyElements */
'use strict';
var link = window.document.createElement('link');
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = 'https://fonts.googleapis.com/icon?family=Material+Icons';
document.getElementsByTagName("HEAD")[0].appendChild(link);

$("body").append (''
    + '<div class="gmPersistentButton" style="position:fixed;bottom:1em;left:2em;z-index:6666;">'
    + '<button class="material-icons" id="gmContinueBtn" title="toggle comments">toggle_on</button>'
    + '</div>'
);

//--- Activate the button.
 $("#gmContinueBtn").click ( function () {
    var btnValue = this.textContent;
    if (btnValue == "toggle_on") {
        $(".kix-discussion-plugin").hide();
        this.textContent = "toggle_off"
    }
    else {
        $(".kix-discussion-plugin").show();
        this.textContent = "toggle_on"
    }
} );


// $(".kix-discussion-plugin").hide();