[★+]

    @@ -1,33 +1,48 @@ /* - * @title 勝手にスター - * @description 勝手に はてなスターを置きます + * @title selfishly Hatena Star + * @description Hatena Star on the whole world * @include http://* * @include https://* - * @license MIT License + * @contributor a-kuma3 http://let.hatelabo.jp/a-kuma3/let/hLHWypmkorgp + * @license MIT License http://opensource.org/licenses/MIT * @javascript_url */ + +// - fix syntax errors lost ";", when use in Bookmarklet from link +// - some beatify + +// e.g. +// http://jshint.com/ + // inspired by http://let.hatelabo.jp/noromanba/let/gYC-xcvQ3PTQew (() => { - const d_ = document + const d_ = document; if (! d_.querySelector('script[src*="s.hatena.ne.jp/js/HatenaStar.js"]')) { d_.head.appendChild(Object.assign(d_.createElement("script"), { type: "text/javascript", src: "//s.hatena.ne.jp/js/HatenaStar.js", - onload: function() { - let e = d_.querySelector("h1,h2,h3,h4,h5,h6") + onload: () => { + const e = d_.querySelector("h1, h2, h3, h4, h5, h6"); + const Hatena = window.Hatena; Hatena.Star.SiteConfig = { entryNodes: {} - } - Hatena.Star.SiteConfig.entryNodes[ e.tagName ] = { + }; + Hatena.Star.SiteConfig.entryNodes[e.tagName] = { uri: "document.location", title: "document.title", container: "parent", - } - new Hatena.Star.EntryLoader(); + }; + Hatena.Star.EntryLoader(); }, - })) + })); } else { - console.log("already Hatena.Star exists !") + console.log("already Hatena.Star exists !"); } -})() +})(); + +// similar scripts c.f. +// http://let.hatelabo.jp/yuta25/let/hJmdxKny-Mt7 +// http://let.hatelabo.jp/yuta25/let/hLHVyMC71a1v +// https://github.com/wakaba/chrome-hatena-star-everywhere +// https://chrome.google.com/webstore/detail/hatena-star-everywhere/nbjckkhoenllbokoppppjagcckgaaaab
  • /*
     * @title selfishly Hatena Star
     * @description Hatena Star on the whole world
     * @include http://*
     * @include https://*
     * @contributor a-kuma3 http://let.hatelabo.jp/a-kuma3/let/hLHWypmkorgp
     * @license MIT License http://opensource.org/licenses/MIT
     * @javascript_url
     */
    
    // - fix syntax errors lost ";", when use in Bookmarklet from link
    // - some beatify
    
    // e.g.
    // http://jshint.com/
    
    // inspired by http://let.hatelabo.jp/noromanba/let/gYC-xcvQ3PTQew
    (() => {
        const d_ = document;
        if (! d_.querySelector('script[src*="s.hatena.ne.jp/js/HatenaStar.js"]')) {
            d_.head.appendChild(Object.assign(d_.createElement("script"), {
                type: "text/javascript",
                src: "//s.hatena.ne.jp/js/HatenaStar.js",
                onload: () => {
                    const e = d_.querySelector("h1, h2, h3, h4, h5, h6");
                    const Hatena = window.Hatena;
                    Hatena.Star.SiteConfig = {
                        entryNodes: {}
                    };
                    Hatena.Star.SiteConfig.entryNodes[e.tagName] = {
                        uri: "document.location",
                        title: "document.title",
                        container: "parent",
                    };
                    Hatena.Star.EntryLoader();
                },
            }));
        } else {
            console.log("already Hatena.Star exists !");
        }
    })();
    
    // similar scripts c.f.
    // http://let.hatelabo.jp/yuta25/let/hJmdxKny-Mt7
    // http://let.hatelabo.jp/yuta25/let/hLHVyMC71a1v
    // https://github.com/wakaba/chrome-hatena-star-everywhere
    //  https://chrome.google.com/webstore/detail/hatena-star-everywhere/nbjckkhoenllbokoppppjagcckgaaaab
    
    
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。

History

  1. 2017/02/19 17:49:19 - 2017-02-19
  2. 2017/02/19 08:28:08 - 2017-02-19
  3. 2017/02/19 04:18:14 - 2017-02-19
  4. 2017/02/19 04:16:36 - 2017-02-19