読者です 読者をやめる 読者になる 読者になる

GoogleReaderでLightBox的なプレビューをするGreasemonkeyスクリプト

最近ちょっとJSを触る機会があったので勉強がてらやってみた。
Shift-Vでプレビュ表示、ESCで閉じる的な何か。

JSはほぼ素人なのでうんこなコードだと思いますが、一応貼付けときますね。。。
そうそうiframeつかっててiframeにアクティブが移ったときにkeyイベントって拾えないのかな?そこがうまく実装できなかったorz

// Google Reader Light Box Preview 
// version 0.1
// 
// Copyright (c) 2009, Kazuki YAMAMOTO
// Released under Apache License 2.0
// http://www.apache.org/licenses/LICENSE-2.0
//
// --------------------------------------------------------------------
// ==UserScript==
// @name            Google Reader Light Box Preview 
// @namespace       http://yamkazu.org/
// @description     Google Reader Light Box Preview 
// @include         http://reader.google.tld/reader/*
// @include         https://reader.google.tld/reader/*
// @include         http://www.google.tld/reader/*
// @include         https://www.google.tld/reader/*
// ==/UserScript==
//

function getFirstElementMatchingClassName(root, tag, class) {
    var elements = root.getElementsByTagName(tag);
    var i = 0;
    while (elements[i] && !elements[i].className.match(class)) {
        i++;
    }
    return ((!elements[i]) ? null : (elements[i]));
}

function previewShortcut() {
    preview(document.getElementById('current-entry'));
}

function preview(entry) {
    if (document.getElementById('preview_background') == null) {
        createPreviewBackground();
        createPreviewWindow(entry);
    } else {
        document.getElementById('preview_frame').src = getFirstElementMatchingClassName(
                entry, 'a', 'entry-title-link');
        document.getElementById('preview_background').style.display = 'block';
        document.getElementById('loding_area').style.display = 'block';
    }
}

function createPreviewBackground() {
    var previewWindowBackground = document.createElement('div');
    previewWindowBackground.id = 'preview_background';
    previewWindowBackground.style.position = 'absolute';
    previewWindowBackground.style.top = '0%';
    previewWindowBackground.style.left = '0%';
    previewWindowBackground.style.width = '100%';
    previewWindowBackground.style.height = '100%';
    previewWindowBackground.style.display = 'block';
    previewWindowBackground.style.zIndex = '1001';
    previewWindowBackground.style.backgroundColor = '#000000';
    previewWindowBackground.style.opacity = '0.7';
    previewWindowBackground.style.MozOpacity = '0.7';
    previewWindowBackground.style.filter = 'alpha(opacity=70)';
    document.body.appendChild(previewWindowBackground);

    var loding_img_area = document.createElement('div');
    loding_img_area.id = 'loding_area';
    loding_img_area.style.position = 'absolute';
    loding_img_area.style.top = '50%';
    loding_img_area.style.left = '50%';
    loding_img_area.style.display = 'block';
    previewWindowBackground.appendChild(loding_img_area);

    var img = document.createElement("img");
    img.setAttribute("src", loding_img);
    img.style.border = '0';
    loding_img_area.appendChild(img);
}

function createPreviewWindow(entry) {
    var previewWindow = document.createElement('div');
    previewWindow.id = 'preview_window';
    previewWindow.style.position = 'absolute';
    previewWindow.style.top = '50px';
    previewWindow.style.left = '5%';
    previewWindow.style.width = '90%';
    previewWindow.style.height = '85%';
    previewWindow.style.display = 'none';
    previewWindow.style.zIndex = '1002';
    previewWindow.style.backgroundColor = '';
    document.body.appendChild(previewWindow);

    var closeButton = document.createElement('div');
    closeButton.style.position = 'absolute';
    closeButton.style.top = '-19px';
    closeButton.style.left = '100%';
    closeButton.style.zIndex = '1003';
    closeButton.style.display = 'block';
    previewWindow.appendChild(closeButton);

    var anchor = document.createElement('a');
    anchor.href = '#';
    anchor.addEventListener('click', function() {
        document.getElementById('preview_background').style.display = 'none';
        document.getElementById('preview_window').style.display = 'none';
    }, false);
    closeButton.appendChild(anchor);

    var img = document.createElement("img");
    img.setAttribute("src", close_img);
    img.style.border = '0';
    anchor.appendChild(img);

    var previewContent = document.createElement('div');
    previewContent.style.position = 'absolute';
    previewContent.style.width = "100%";
    previewContent.style.height = "100%";
    previewContent.style.top = '0%';
    previewContent.style.left = '0%';
    previewWindow.appendChild(previewContent);

    previewContent.appendChild(createIFrame(entry));
}

function createIFrame(entry) {
    var iframeElement = document.createElement("iframe");
    iframeElement.id = 'preview_frame';
    iframeElement.setAttribute("frameBorder", "0");
    iframeElement.setAttribute("scrolling", "yes");
    iframeElement.style.width = "100%";
    iframeElement.style.height = "100%";
    iframeElement.style.border = '3px solid #000000';
    iframeElement.src = getFirstElementMatchingClassName(entry, 'a',
            'entry-title-link');
    iframeElement.addEventListener('load', function() {
        document.getElementById('preview_window').style.display = 'block';
        document.getElementById('loding_area').style.display = 'none';
    }, false);
    return iframeElement;
}

function handleKeypress(e) {
    // Handle a Shift-V keypress
    if (e.target.nodeName.toLowerCase() != 'input' && e.shiftKey
            && e.keyCode == 86) {
        previewShortcut();
        e.preventDefault();
    }
    // Handle a ESC keypress
    if (e.keyCode == 27) {
        document.getElementById('preview_background').style.display = 'none';
        document.getElementById('preview_window').style.display = 'none';
        e.preventDefault();
    }
}

var close_img = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAALqSURBVHjavFY9TGJBEF5AIGKHNKLkoljBVUCDfwUFDQWtzRlzFoZIZUJhc8VpAoaOxMLijMmVmqCFFBchsaIQsTmxPn+IuQalQSU4N/Puvc2uvAdeYm6SLyyzM9/s7uzOPBMAMAOxIT4ioogQwodwq3N1RA1RQfxA/EQ867JQAB2EEN8Qd9Bf7lTbkB6X6dUOrIhPiC+ID6S4ublhZ2dn7PLyUhmTvcfjYT6fjwWDQTY6Oqr5/kJ8RXxHtPV2YEGkEI+0LCSDzc1NmJycBKvVSquQQDqaIxuyVeVR5bBovGKAz4gWWVWrVZibm+siNQLZ4i61IC2VSwoQRNRplgy9Xu+byTWQDy1MlbrKqQSwqUmC6+trmJmZkRwnJiZgeHhY94jm5+cB88B109PT4nERp40CBBC/SZPJZCSSWCwG5+fnUCgUwOVycb3FYoGtrS24v7+HUqkEfr+fz1FOVCHOAAVY05JKSRMDkLMmR0dHMDQ0pOi3t7e5vtVqQTwe5z7EIexijQLs0+jw8BAGBgakAIlEAhqNBic7Pj6Gvb09/r/dbiu7ttvt3Ic4Dg4ONJN9CnBBo3Q63XXOZrMZlpeXpSAieTab7VoUgbhUuaAAincymTS8IalUCp6enqQAu7u7hvYrKyuaWcMsPjg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