->*img-link

    @@ -10,7 +10,7 @@ */ // for twitter.com -// http://let.hatelabo.jp/noromanba/let/hLHUyPL1pLND +// http://let.hatelabo.jp/noromanba/let/hJmcyb717pBx (function () { var container = document.createDocumentFragment().appendChild(document.createElement('div'));
  • /*
     * @title ->*img-link
     * @description simple image viewer; open all image-link in new tab/window
     * @include http://*
     * @include https://*
     * @contributor os0x        http://let.hatelabo.jp/os0x/let/gYC-xpO93uu1BA (Fork of)
     * @author      noromanba   http://let.hatelabo.jp/noromanba/let/hLHX5oTN2bUh
     * @license     MIT License http://opensource.org/licenses/MIT
     * @javascript_url
     */
    
    // for twitter.com
    // http://let.hatelabo.jp/noromanba/let/hJmcyb717pBx
    
    (function () {
        var container = document.createDocumentFragment().appendChild(document.createElement('div'));
    
        var style = container.style;
        style.marginLeft = 'auto';
        style.marginRight = 'auto';
        style.textAlign = 'center';
    
        // TBD immediately append w/ interval, omit fragment
        var index = 0;
        Array.from(document.links).forEach(function (link) {
            if (!/\.(jpe?g|png|gif)(\?|$)/i.test(link)) return;
    
            var img = document.createElement('img');
            img.src = link;
            img.alt = link; // TODO handle broken img e.g. HTTP 404
            img.title = (index += 1);
            img.tabIndex = 0;
            img.style.maxWidth = '100%';
    
            container.appendChild(img);
            container.appendChild(document.createElement('br'));
        });
        if (container.children.length < 1) return;
    
        // TBD 'total' merge into 'img.title'
        var total = document.createElement('div');
        total.style.color = '#EEE';
        total.textContent = container.querySelectorAll('img').length + ' | ';
        var src = total.appendChild(document.createElement('a'));
        src.href = location.href;
        src.textContent = location.href;
        src.style.color = '#EEE';
    
        container.insertBefore(total, container.firstChild);
    
        var page = window.open('about:blank', '_blank');
        page.document.title = document.title;
        page.document.body.style.backgroundColor = 'black';
    
        page.document.body.appendChild(container);
    })();
    
    
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。

History

  1. 2016/01/22 04:57:56 - 2016-01-22
  2. 2016/01/16 07:08:28 - 2016-01-16
  3. 2013/06/24 01:45:18 - 2013-06-24
  4. 2013/06/13 05:28:12 - 2013-06-13
  5. 2013/06/13 05:12:53 - 2013-06-13
  6. 2013/06/13 05:11:13 - 2013-06-13
  7. 2013/06/11 18:54:26 - 2013-06-11
  8. 2013/06/11 18:31:11 - 2013-06-11
  9. 2013/06/11 07:59:03 - 2013-06-11
  10. 2013/06/11 07:51:44 - 2013-06-11