test

    @@ -3,7 +3,6 @@ * @description test supplementary bookmark * @include http://b.hatena.ne.jp/* * @license MIT License - * @private */ (function(){ var d=document, id=d.getElementById("bookmarked_user")||d.getElementById("page-content"), nd=[],i, el, cl, link; @@ -12,14 +11,16 @@ for(i=0; i<el.length; i++){ cl = el[i].className; if( cl == "entry-link" ){ - link = el[i].getAttribute("href"); - nd[i] = document.createElement("input"); - nd[i].type = "text"; - nd[i].value = "[" + link + ":title:bookmark]"; - nd[i].setAttribute("readonly", "true"); - nd[i].setAttribute("onclick", "this.select();"); - el[i].parentNode.appendChild(nd[i]); + link = el[i].getAttribute("href"); + nd[i] = document.createElement("input"); + nd[i].type = "text"; + nd[i].value = "[" + link + ":title:bookmark]"; + nd[i].setAttribute("readonly", "true"); + nd[i].setAttribute("onclick", "this.select();"); + if(el[i].parentNode.lastChild.type !="text" ){ + el[i].parentNode.appendChild(nd[i]); + } } } } -})(); +})();
  • /*
     * @title test
     * @description test supplementary bookmark
     * @include http://b.hatena.ne.jp/*
     * @license MIT License
     */
    (function(){
      var d=document, id=d.getElementById("bookmarked_user")||d.getElementById("page-content"), nd=[],i, el, cl, link;
      if(id){
        el = id.getElementsByTagName("a");
          for(i=0; i<el.length; i++){
             cl = el[i].className;         
              if( cl == "entry-link" ){
                link = el[i].getAttribute("href"); 
                nd[i] = document.createElement("input");
                nd[i].type = "text";
                nd[i].value = "[" + link + ":title:bookmark]";
                nd[i].setAttribute("readonly", "true");
                nd[i].setAttribute("onclick", "this.select();");
                if(el[i].parentNode.lastChild.type !="text" ){
                  el[i].parentNode.appendChild(nd[i]);
                }
              }
          }
      }
    })();
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。

History

  1. 2013/04/18 11:42:55 - 2013-04-18
  2. 2013/04/08 15:38:00 - 2013-04-08
  3. 2013/04/08 13:09:38 - 2013-04-08