indicator reviver

  • /*
     * @title indicator reviver
     * @description revive "[saving...]" indicator on Hatena::Let
     * @include *://let.hatelabo.jp/l
     * @license MIT License https://opensource.org/licenses/MIT
     * @javascript_url
     */
    
    // UserScript
    // https://gist.github.com/noromanba/ceaf1067aea7c3855ce7b57fe5ae1887
    
    
    // inspired
    // http://let.hatelabo.jp/pacochi/let/hJmc3OPAv48G
    
    // c.f.
    // http://h.hatena.ne.jp/noromanba/227136362604995923
    (() => {
        'use strict';
    
        const indicator = document.body.querySelector([
            'img[src]#auto_save_icon'
        ]);
        if (!indicator) return;
    
        // TBD data URI
        // thx id:a-kuma3
        // http://h.hatena.ne.jp/a-kuma3/83461036272149214
        indicator.src = 'https://cdn-ak.b.st-hatena.com/images/loading.gif';
        // [1]
    
        // TBD
        // - CSSnize
        // - align by flexbox
        // original style fixes
        indicator.style.verticalAlign = 'text-top';
    
        const checkbox = document.body.querySelector([
            'input[type="checkbox"]#autosave'
        ]);
        if (!checkbox) return;
    
        checkbox.style.verticalAlign =
            // XXX see the Rendering Engine
            navigator.userAgent.includes('Chrome') ? 'middle' :
            navigator.userAgent.includes('Firefox') ? 'text-top' :
            '';
    })();
    
    
    // DEV
    //
    // [:1] throbber/spinner icons
    //
    // original
    // https://web.archive.org/web/20100511175314if_/http://r.hatena.ne.jp/images/indicator.gif
    // circle large; same as original
    // https://d.hatena.ne.jp/images/indicator.gif
    // circle small
    // https://s.hatena.ne.jp/images/load.gif
    // square dots
    // https://cdn-ak.b.st-hatena.com/images/loading.gif
    
    
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。

History

  1. 2018/05/15 08:34:14 - 2018-05-15
  2. 2018/05/15 04:27:34 - 2018-05-15
  3. 2018/05/15 03:36:12 - 2018-05-15
  4. 2018/05/12 08:47:40 - 2018-05-12