腾讯微云-笔记字数统计脚本

try to take over the world!

目前为 2019-06-15 提交的版本。查看 最新版本

// ==UserScript==
// @name         腾讯微云-笔记字数统计脚本
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @include      *://*.www.weiyun.com/disk/note/*
// @require      http://cdn.bootcss.com/jquery/1.12.4/jquery.min.js
// @match        https://www.weiyun.com/disk/note
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Your code here...
    window.onload = function(){
        document.querySelector('.layout-body-inner').style.paddingLeft = 0;
        document.querySelector('.layout-aside').style.display = 'none';
        var editor = document.querySelector('#editor');
        document.querySelector('.mod-action-wrap-menu').innerHTML += '<div class="action-item" id="chensuiyi-text-total"><div class="action-item-con">总字数:<span class="act-txt"></span></div></div>';
        var total = document.querySelector('#chensuiyi-text-total .act-txt')
        total.innerText = editor.textContent.length;//__quill.getText().length
        editor.__quill.on('text-change', function(delta, oldDelta, source) {
            total.innerText = editor.textContent.length;
        });
    }
})();

QingJ © 2025

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