<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns="http://purl.org/rss/1.0/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel rdf:about="https://let.hatelabo.jp/rikuba/rss">
    <link>https://let.hatelabo.jp/rikuba/rss</link>
    <description></description>
    <title>Bookmarklets from rikuba</title>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="https://let.hatelabo.jp/rikuba/let/hLHWhJqt_dJl"/>
        <rdf:li rdf:resource="https://let.hatelabo.jp/rikuba/let/hLHUqumWxYhG"/>
        <rdf:li rdf:resource="https://let.hatelabo.jp/rikuba/let/gYC-x-aqtIavRQ"/>
        <rdf:li rdf:resource="https://let.hatelabo.jp/rikuba/let/hLHX5fSW_9If"/>
        <rdf:li rdf:resource="https://let.hatelabo.jp/rikuba/let/gYC-y5Ca8MWVPg"/>
        <rdf:li rdf:resource="https://let.hatelabo.jp/rikuba/let/gYC-xsCCg4ezUw"/>
        <rdf:li rdf:resource="https://let.hatelabo.jp/rikuba/let/gYC-yqG0xYLkFw"/>
      </rdf:Seq>
    </items>
  </channel>
  <item rdf:about="https://let.hatelabo.jp/rikuba/let/hLHWhJqt_dJl">
    <link>https://let.hatelabo.jp/rikuba/let/hLHWhJqt_dJl</link>
    <dc:date>2019-01-06T05:32:17Z</dc:date>
    <description>RSSフィードのリンクを一覧表示する</description>
    <dc:creator>rikuba</dc:creator>
    <title>[Let] RSS feed list</title>
    <content:encoded>&lt;a href="javascript:%22https%3A%2F%2Flet.st-hatelabo.com%2Frikuba%2Flet%2FhLHWhJqt_dJl.bookmarklet.js%20%28arg%29%22.replace%28%2F%28%5CS%2B%29%5Cs%2B%28%5CS%2A%29%2F%2Cfunction%28s%2Curl%2Carg%29%7Bs%3Ddocument.createElement%28%22script%22%29%3Bs.charset%3D%22utf-8%22%3Bs.src%3Durl%2B%22%3Fs%3D%22%2BencodeURIComponent%28arg%29%3Bdocument.body.appendChild%28s%29%7D%29%3Bvoid%280%29%3B"&gt;RSS feed list&lt;/a&gt;&lt;pre&gt;/*
 * @title RSS feed list
 * @description RSSフィードのリンクを一覧表示する
 * @include http://*
 * @include https://*
 * @license Unlicense
 */

(() =&amp;gt; {
  const selectors = ['atom+xml', 'rdf+xml', 'rss+xml', 'xml'].map((type) =&amp;gt; {
    return `link[rel=&amp;quot;alternate&amp;quot;][href][type=&amp;quot;application/${type}&amp;quot;]`;
  });
  const links = [...document.querySelectorAll(selectors.join(','))];
  const feeds = links.map((link) =&amp;gt; ({
    title: link.title || 'Feed',
    href: link.href,
  }));

  const container = document.createElement('div');
  container.style.cssText = `
    z-index: 5999999;
    position: fixed;
    top: 0;
    right: 0;
    border-radius: 0 0 0 5px;
    padding: 10px 20px;
    background-color: rgba(0, 0, 0, 0.75);
    line-height: 1.5;
    text-align: left;
  `;
  const list = container.appendChild(document.createElement('ul'));
  list.style.cssText = `
    list-style: none;
    max-width: 50vw;
    margin: 0;
    padding: 0;
  `;
  if (feeds.length &amp;gt; 0) {
    for (let feed of feeds) {
      const item = list.appendChild(document.createElement('li'));
      const anchor = item.appendChild(document.createElement('a'));
      anchor.style.cssText = `
        display: block;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        color: #fff;
      `;
      anchor.target = '_blank';
      anchor.href = feed.href;
      anchor.textContent = anchor.title = feed.title;
    }
  } else {
    const item = list.appendChild(document.createElement('li'));
    item.style.cssText = `
      color: #fff;
    `;
    item.textContent = `No feeds found`;
  }

  document.body.appendChild(container);
  if (feeds.length &amp;gt; 0) {
    container.querySelector('a').focus();
  }

  document.addEventListener('click', function handleClick(e) {
    if (!container.contains(e.target)) {
      container.remove();
      document.removeEventListener('click', handleClick);
    }
  });
})();
&lt;/pre&gt;</content:encoded>
  </item>
  <item rdf:about="https://let.hatelabo.jp/rikuba/let/hLHUqumWxYhG">
    <link>https://let.hatelabo.jp/rikuba/let/hLHUqumWxYhG</link>
    <dc:date>2013-09-25T19:22:44Z</dc:date>
    <description>ページ内リンクの履歴をスキップして戻る</description>
    <dc:creator>rikuba</dc:creator>
    <title>[Let] page_back</title>
    <content:encoded>&lt;a href="javascript:%22https%3A%2F%2Flet.st-hatelabo.com%2Frikuba%2Flet%2FhLHUqumWxYhG.bookmarklet.js%20%28arg%29%22.replace%28%2F%28%5CS%2B%29%5Cs%2B%28%5CS%2A%29%2F%2Cfunction%28s%2Curl%2Carg%29%7Bs%3Ddocument.createElement%28%22script%22%29%3Bs.charset%3D%22utf-8%22%3Bs.src%3Durl%2B%22%3Fs%3D%22%2BencodeURIComponent%28arg%29%3Bdocument.body.appendChild%28s%29%7D%29%3Bvoid%280%29%3B"&gt;page_back&lt;/a&gt;&lt;pre&gt;/*
 * @title page_back
 * @description ページ内リンクの履歴をスキップして戻る
 * @include http://*
 * @license 
 */

(function () {
    window.addEventListener('hashchange', function (e) { history.back(); }, false);
    history.back();
})();
&lt;/pre&gt;</content:encoded>
  </item>
  <item rdf:about="https://let.hatelabo.jp/rikuba/let/gYC-x-aqtIavRQ">
    <link>https://let.hatelabo.jp/rikuba/let/gYC-x-aqtIavRQ</link>
    <dc:date>2013-09-25T19:22:32Z</dc:date>
    <description>記事一覧を開く</description>
    <dc:creator>rikuba</dc:creator>
    <title>[Let] archive</title>
    <content:encoded>&lt;a href="javascript:%22https%3A%2F%2Flet.st-hatelabo.com%2Frikuba%2Flet%2FgYC-x-aqtIavRQ.bookmarklet.js%20%28arg%29%22.replace%28%2F%28%5CS%2B%29%5Cs%2B%28%5CS%2A%29%2F%2Cfunction%28s%2Curl%2Carg%29%7Bs%3Ddocument.createElement%28%22script%22%29%3Bs.charset%3D%22utf-8%22%3Bs.src%3Durl%2B%22%3Fs%3D%22%2BencodeURIComponent%28arg%29%3Bdocument.body.appendChild%28s%29%7D%29%3Bvoid%280%29%3B"&gt;archive&lt;/a&gt;&lt;pre&gt;/*
 * @title archive
 * @description 記事一覧を開く
 * @include http://*
 * @license CC0 &amp;lt;http://creativecommons.org/publicdomain/zero/1.0/&amp;gt;
 */

(function (url) {
    [
        {/* はてなダイアリー・はてなグループ */
            pattern: /^http:\/\/(?:d|[-\w]+\.g)\.hatena\.ne\.jp\/[-\w]+\//,
            replace: '$&amp;amp;archive'
        },
        {/* はてなブログ */
            pattern: /^http:\/\/[-\w]+\.(?:hatena(?:blog|diary)\.(?:com|jp)|hateblo\.jp)\//,
            replace: '$&amp;amp;archive'
        },
        {/* FC2ブログ */
            pattern: /^http:\/\/[-\w]+\.blog\d*\.fc2\.com\//,
            replace: '$&amp;amp;archives.html'
        },
        {/* gooブログ */
            pattern: /^http:\/\/blog\.goo\.ne\.jp\/[-\w]+/,
            replace: '$&amp;amp;/arcv'
        },
        {/* Yahoo!ブログ */
            pattern: /^http:\/\/blogs\.yahoo\.co\.jp\/[-\w]+/,
            replace: '$&amp;amp;/MYBLOG/yblog.html?m=l'
        },
        {/* アメーバブログ */
            pattern: /^http:\/\/ameblo\.jp\/[-\w]+/,
            replace: '$&amp;amp;/entrylist.html'
        },
        {/* 楽天ブログ */
            pattern: /^http:\/\/plaza\.rakuten\.co\.jp\/[-\w]+/,
            replace: '$&amp;amp;/diaryall/'
        },
        {/* Tumblr */
            pattern: /^http:\/\/[-\w]+\.tumblr\.com\//,
            replace: '$&amp;amp;archive'
        }
    ].some(function (siteinfo) {
        var m = siteinfo.pattern.exec(url);
        if (m) {
            location.href = m[0].replace(siteinfo.pattern, siteinfo.replace);
            return true;
        }
    });
})(location.href);
&lt;/pre&gt;</content:encoded>
  </item>
  <item rdf:about="https://let.hatelabo.jp/rikuba/let/hLHX5fSW_9If">
    <link>https://let.hatelabo.jp/rikuba/let/hLHX5fSW_9If</link>
    <dc:date>2013-06-10T18:50:06Z</dc:date>
    <description>スペースキーで表示域の半分の量を滑らかにスクロール</description>
    <dc:creator>rikuba</dc:creator>
    <title>[Let] HalfScroll</title>
    <content:encoded>&lt;a href="javascript:%22https%3A%2F%2Flet.st-hatelabo.com%2Frikuba%2Flet%2FhLHX5fSW_9If.bookmarklet.js%20%28arg%29%22.replace%28%2F%28%5CS%2B%29%5Cs%2B%28%5CS%2A%29%2F%2Cfunction%28s%2Curl%2Carg%29%7Bs%3Ddocument.createElement%28%22script%22%29%3Bs.charset%3D%22utf-8%22%3Bs.src%3Durl%2B%22%3Fs%3D%22%2BencodeURIComponent%28arg%29%3Bdocument.body.appendChild%28s%29%7D%29%3Bvoid%280%29%3B"&gt;HalfScroll&lt;/a&gt;&lt;pre&gt;/*
 * @title HalfScroll
 * @description スペースキーで表示域の半分の量を滑らかにスクロール
 * @include http://*
 * @license MIT License
 */

(function () {
    var scrollTime = 300/*ms*/;

    function easing(t) {
        return t * (2 - t);
    };

    function calcScrollIncrement(win) {
        return win.innerHeight / 2;
    };


    var REQUEST, CANCEL, timeout;
    if (this.requestAnimationFrame) {
        REQUEST = 'requestAnimationFrame';
        CANCEL = 'cancelAnimationFrame';
    } else if (this.mozRequestAnimationFrame) {
        REQUEST = 'mozRequestAnimationFrame';
        CANCEL = 'mozCancelAnimationFrame';
    } else if (this.webkitRequestAnimationFrame) {
        REQUEST = 'webkitRequestAnimationFrame';
        CANCEL = 'webkitCancelAnimationFrame';
    } else {
        REQUEST = 'setTimeout';
        CANCEL = 'clearTimeout';
        timeout = 1000 / 60;
    }

    var isCSS1Compat = this.document.compatMode === 'CSS1Compat';

    var getPageYOffset = this.pageYOffset != null
        ? function (window) { return window.pageYOffset; }
        : isCSS1Compat
            ? function (w) { return w.document.documentElement.scrollTop; }
            : function (w) { return w.document.body.scrollTop; };

    var getScrollMaxY = this.scrollMaxY != null
        ? function (window) { return window.scrollMaxY; }
        : isCSS1Compat
            ? function (w) { return w.document.documentElement.scrollHeight - w.innerHeight; }
            : function (w) { return w.document.body.scrollHeight - w.innerHeight; };


    var destinationY = null;
    var requestId = null;

    function stopScroll(window) {
        if (requestId != null) {
            window[CANCEL](requestId);
            requestId = null;
        }
    }

    function startScroll(window, upward) {
        var startY = (destinationY != null ? destinationY : getPageYOffset(window)),
            scrollIncrement = calcScrollIncrement(window),
            scrollMaxY = getScrollMaxY(window),
            isAnimating = true,
            startTime;

        if (upward) {
            if (startY - scrollIncrement &amp;lt; 0) {
                scrollIncrement = -startY;
            } else {
                scrollIncrement *= -1;
            }
        } else {
            if (startY + scrollIncrement &amp;gt; scrollMaxY) {
                scrollIncrement = scrollMaxY - startY;
            }
        }
        destinationY = startY + scrollIncrement;

        startTime = Date.now();
        requestId = window[REQUEST](function tick() {
            if (!isAnimating) {
                return;
            }
            var timeRate = (Date.now() - startTime) / scrollTime;
            if (timeRate &amp;lt; 1) {
                window.scrollTo(0, startY + easing(timeRate) * scrollIncrement);
                requestId = window[REQUEST](tick, timeout);
            } else {
                window.scrollTo(0, destinationY);
                destinationY = null;
                isAnimating = false;
            }
        }, timeout);
    }

    function handleEvent(e) {
        if (e.keyCode === 32 &amp;amp;&amp;amp; !e.altKey &amp;amp;&amp;amp; !e.ctrlKey &amp;amp;&amp;amp; !e.metaKey) {
            var tagName = e.target.tagName;
            if (tagName === 'TEXTAREA' || tagName === 'INPUT' ||
                e.target.isContentEditable) { return; }

            stopScroll(e.view);
            startScroll(e.view, e.shiftKey);
            e.preventDefault();
        }
    }

    this.document.addEventListener('keydown', handleEvent, false);
}).call(this);
&lt;/pre&gt;</content:encoded>
  </item>
  <item rdf:about="https://let.hatelabo.jp/rikuba/let/gYC-y5Ca8MWVPg">
    <link>https://let.hatelabo.jp/rikuba/let/gYC-y5Ca8MWVPg</link>
    <dc:date>2013-01-28T15:04:46Z</dc:date>
    <description>toggle enable/disable links</description>
    <dc:creator>rikuba</dc:creator>
    <title>[Let] !link</title>
    <content:encoded>&lt;a href="javascript:%22https%3A%2F%2Flet.st-hatelabo.com%2Frikuba%2Flet%2FgYC-y5Ca8MWVPg.bookmarklet.js%20%28arg%29%22.replace%28%2F%28%5CS%2B%29%5Cs%2B%28%5CS%2A%29%2F%2Cfunction%28s%2Curl%2Carg%29%7Bs%3Ddocument.createElement%28%22script%22%29%3Bs.charset%3D%22utf-8%22%3Bs.src%3Durl%2B%22%3Fs%3D%22%2BencodeURIComponent%28arg%29%3Bdocument.body.appendChild%28s%29%7D%29%3Bvoid%280%29%3B"&gt;!link&lt;/a&gt;&lt;pre&gt;/*
 * @title !link
 * @description toggle enable/disable links
 * @include http://*
 * @include https://*
 * @license MIT License http://nrm.mit-license.org/2013
 * @require 
 */

(function (doc) {
    var id = '-bookmarklet-disable-link-';
    var style = doc.getElementById(id);
    if (style) {
        style.parentNode.removeChild(style);
        return;
    }
    style = doc.createElement('style');
    style.id = id;
    style.textContent = 'a[href] { pointer-events: none; }';
    doc.head.appendChild(style);
})(document);&lt;/pre&gt;</content:encoded>
  </item>
  <item rdf:about="https://let.hatelabo.jp/rikuba/let/gYC-xsCCg4ezUw">
    <link>https://let.hatelabo.jp/rikuba/let/gYC-xsCCg4ezUw</link>
    <dc:date>2010-07-23T16:26:16Z</dc:date>
    <description>タブ文字を半角空白2つに置き換える。IEでは動かない。</description>
    <dc:creator>rikuba</dc:creator>
    <title>[Let] tabToSpace</title>
    <content:encoded>&lt;a href="javascript:%22https%3A%2F%2Flet.st-hatelabo.com%2Frikuba%2Flet%2FgYC-xsCCg4ezUw.bookmarklet.js%20%28arg%29%22.replace%28%2F%28%5CS%2B%29%5Cs%2B%28%5CS%2A%29%2F%2Cfunction%28s%2Curl%2Carg%29%7Bs%3Ddocument.createElement%28%22script%22%29%3Bs.charset%3D%22utf-8%22%3Bs.src%3Durl%2B%22%3Fs%3D%22%2BencodeURIComponent%28arg%29%3Bdocument.body.appendChild%28s%29%7D%29%3Bvoid%280%29%3B"&gt;tabToSpace&lt;/a&gt;&lt;pre&gt;/*
 * @title tabToSpace
 * @description タブ文字を半角空白2つに置き換える。IEでは動かない。
 * @include http://*
 * @license MIT License
 * @require 
 */

(function (tabToSpace) {
	tabToSpace();
	Array.prototype.forEach.call(frames, function (w) {
		try { tabToSpace.call(w); } catch (e) {}
	});
})(
	function () {
		var d = this.document;
		var x =	d.evaluate('./descendant-or-self::text()[contains(., &amp;quot;\t&amp;quot;)]', d, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
		var i = x.snapshotLength;
		var t;
		while (i--) {
			t = x.snapshotItem(i);
			t.nodeValue = t.nodeValue.replace(/\t/g, '  ');
		}
	}
);&lt;/pre&gt;</content:encoded>
  </item>
  <item rdf:about="https://let.hatelabo.jp/rikuba/let/gYC-yqG0xYLkFw">
    <link>https://let.hatelabo.jp/rikuba/let/gYC-yqG0xYLkFw</link>
    <dc:date>2010-06-08T22:49:25Z</dc:date>
    <description>ページ内の見出しから目次を生成（右上）。AutoPagerize対応。最近のブラウザでないと動きません。</description>
    <dc:creator>rikuba</dc:creator>
    <title>[Let] TOC</title>
    <content:encoded>&lt;a href="javascript:%22https%3A%2F%2Flet.st-hatelabo.com%2Frikuba%2Flet%2FgYC-yqG0xYLkFw.bookmarklet.js%20%28arg%29%22.replace%28%2F%28%5CS%2B%29%5Cs%2B%28%5CS%2A%29%2F%2Cfunction%28s%2Curl%2Carg%29%7Bs%3Ddocument.createElement%28%22script%22%29%3Bs.charset%3D%22utf-8%22%3Bs.src%3Durl%2B%22%3Fs%3D%22%2BencodeURIComponent%28arg%29%3Bdocument.body.appendChild%28s%29%7D%29%3Bvoid%280%29%3B"&gt;TOC&lt;/a&gt;&lt;pre&gt;/*
 * @title TOC
 * @description ページ内の見出しから目次を生成（右上）。AutoPagerize対応。最近のブラウザでないと動きません。
 * @include http://*
 * @license MIT License
 * @require 
 */

(function () {
  init(document);
  [].forEach(frames, function (frame) {
    try { init(frame.document); } catch (e) {}
  });

  function init(doc) {
    var container, style;
    if (container = doc.getElementById('bookmarklet_TOC')) {
      container.parentNode.removeChild(container);
      return;
    }
    container = doc.createElement('div');
    container.id = 'bookmarklet_TOC';
    container.appendChild(createTOC(doc));
    doc.body.appendChild(container);
    style = doc.createElement('style');
    style.type = 'text/css';
    style.textContent = [
      '#bookmarklet_TOC { background: rgba(0,0,0,0.9); color: #fff;',
      'text-align: left; font: 90%/1.5 sans-serif;',
      'width: 30px; height: 30px; z-index: 256;',
      'max-width: 600px; max-height: 600px; overflow-y: auto;',
      'position: fixed; top: 0; right: 0; margin: 0; padding: 0;',
      '-moz-border-radius: 0 0 0 8px; border-radius: 0 0 0 8px; }',
      '#bookmarklet_TOC:hover { width: auto; height: auto;',
      'padding: 1ex 1em; }',
      '#bookmarklet_TOC ol { list-style: none; display: none;',
      'margin: 0; padding: 0; }',
      '#bookmarklet_TOC ol ol { margin-left: 1.5em; }',
      '#bookmarklet_TOC:hover ol { display: block; }',
      '#bookmarklet_TOC span:hover { cursor: pointer; ',
      'text-decoration: underline; }'].join('\n');
    doc.querySelector('head').appendChild(style);
    doc.addEventListener('AutoPagerize_DOMNodeInserted', function (e) {
      container.appendChild(createTOC(e.target));
    }, false);
  }

  function createTOC(root) {
    var doc = root.ownerDocument || root;
    var r = l = doc.createElement('ol');
    var c = [,0,0,0,0,0,0];
    var ln = 1;
    [].forEach.call(
      root.querySelectorAll('h1,h2,h3,h4,h5,h6'),
      function (h) {
        var n = h.nodeName[1];
        var d = ln - n;
        if (ln &amp;lt; n)
          while (d++)
            l = (l.hasChildNodes()
                 ? l.lastChild
                 : l.appendChild(doc.createElement('li'))
                ).appendChild(doc.createElement('ol'));
          else if (n &amp;lt; ln)
            while (d--)
              l = l.parentNode.parentNode;
        var s = l.appendChild(doc.createElement('li'))
                 .appendChild(doc.createElement('span'));
        s.appendChild(doc.createTextNode(h.textContent || ''));
        s.addEventListener('click', function () {
          h.scrollIntoView();
        }, false);
        ln = n;
      }
    );
    return r;
  }
})();&lt;/pre&gt;</content:encoded>
  </item>
</rdf:RDF>
