/*
* @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