H::B yamabiko

  • /*
     * @title H::B yamabiko
     * @description markup by "yamobiko" to comment only for quotation 
     * @include http://b.hatena.ne.jp/entry/*
     * @contributor vzvu3k6k    http://let.hatelabo.jp/vzvu3k6k/let/hLHX6vr2uIQ_
     * @contributor noromanba   http://let.hatelabo.jp/noromanba/let/gYC-x-uCuN3LVQ
     * @license Public Domain   https://creativecommons.org/licenses/publicdomain/
     */
    
    Array.prototype.slice.call(document.querySelectorAll("[id^=bookmark-user-]:not(.nocomment)")).
        forEach(function (bookmark) {
            var comment = bookmark.querySelector(".comment");
            if (!comment) return;
    
            var isOwn = comment.textContent.
                replace(/".+"/g, "").replace(/「.+」/g, "").replace(/[|\/,\s]/g, "").length;
            if (!isOwn) {
                bookmark.classList.add("yamabiko");
            }
    });
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。

History

  1. 2013/06/19 01:39:57 - 2013-06-19
  2. 2013/06/19 01:38:44 - 2013-06-19