はて☆すた

  • /*
     * @title はて☆すた
     * @description はて☆すた をロードします
     * @include http://*
     * @license MIT License
     * @require jQuery
     * @require http://rails2u.com/javascripts/swfobject.js
     */
    
    var contentName = '__hatesta__container__';
    if (document.getElementById(contentName)) return;
    
    var w = $(window);
    var content = document.createElement('div');
    content.id = contentName;
    document.body.appendChild(content);
    
    var so = new SWFObject("http://rails2u.com/misc/Hatesuta.swf?" + (new Date()).getTime(), "hatestaswf", "100%", "100%", '9', '#FFFFFF');
    so.addParam("wmode", "transparent");
    so.addParam("allowScriptAccess", "always");
    so.write(contentName);
    
    var swf = document.getElementById(so.getAttribute('id'));
    swf.style.position = 'absolute';
    swf.style.width = w.width();
    swf.style.height = w.height();
    var setStyle = function() {
        swf.style.top = '' + w.scrollTop() + 'px';
        swf.style.left =  '' + w.scrollLeft() + 'px';
    }
    setStyle();
    w.scroll(setStyle);
    
    
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。

History

  1. 2010/05/15 19:06:10 - 2010-05-15
  2. 2010/05/15 19:05:23 - 2010-05-15
  3. 2010/05/15 18:58:59 - 2010-05-15