Fotolife HTML tag

  • /*
     * @title Fotolife HTML tag
     * @description fotolifeで貼付けコードのようなもの
     * @include http://f.hatena.ne.jp/*
     * @license MIT License
     * @require 
     */
    (function(){
    var f,im,s,w,h,t,itm,tN;
    f=document.getElementById('foto-body');
    im=f.getElementsByTagName("img")[0];
     s=im.src;
     w=im.width;
     h=im.height;
    t=document.createElement('textarea');
    t.setAttribute('rows','8');
    t.setAttribute('cols','50');
    itm='<img src="'+s+'" '+'width="'+w+'" height="'+h+'" \/>';
    tN=document.createTextNode('<a href="'+s+'">'+itm+'<\/a>');
    t.appendChild(tN);
    f.appendChild(t);
    })()
    
    
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。

History

  1. 2010/12/08 20:56:48 - 2010-12-08
  2. 2010/12/08 20:56:23 - 2010-12-08