Mark Read Creepypasta.com

Mark stories as read on Creepypasta.com, makes styling more readable but still creepy

目前為 2014-10-10 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Mark Read Creepypasta.com
// @namespace    http://herbalcell.com
// @version      0.1
// @description  Mark stories as read on Creepypasta.com, makes styling more readable but still creepy
// @match        http://www.creepypasta.com/*
// @require      http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.js
// @require      https://greasyfork.org/scripts/2199-waitforkeyelements/code/waitForKeyElements.js?version=6349
// ==/UserScript==


$('body').wrapInner('<div id="herbalcell-container"></div>');
$('#herbalcell-container').fadeTo(0, 0, function() {
    var storedHiddenTitles = JSON.parse(localStorage.storedHiddenTitles || '{}');
    $('head').append(
        "<link href='http://fonts.googleapis.com/css?family=Special+Elite|Droid+Serif' rel='stylesheet' type='text/css'>" +
        '<style>' +
            '#herbalcell-container {' +
                'background: url("http://fc04.deviantart.net/fs71/f/2010/177/5/7/Spooky_trees_by_Betuwefotograaf.jpg") no-repeat top left fixed;' +
                '-webkit-background-size: cover;' +
                '-moz-background-size: cover;' +
                '-o-background-size: cover;' +
                'background-size: cover;' +
            '}' +
            '.wide {margin-top: 0; border-radius: 10px; border: none;}' +
            '#main, #header, #footer {background: transparent;}' +
            '.wide {background: #FFF7F4; color: #2E1E17;}' +
            '#poop ul {list-style-type: none;}' +
            '.children {margin-left: 40px;}' +
            '.comment {background: rgba(0,0,0,0.1); margin: 20px; padding: 10px; border-radius: 10px;}' +
            'cite {color: #666;}' +
            '.gdthumbtext {color: #888; margin-left: 10px;}' +
            '.comment span {font-size: 1.25em; color: #FB7405; display: block;}' +
            'a {color:#952E00;}' +
            'a:hover {color:#D66735;}' +
            'a:visited {color:#702300;}' +
            '.hidden-and-read, .hidden-and-read a {font-style:italic; text-decoration:line-through; color:#888}' +
            '#content table tbody tr:hover {background: #eee7e4;}' +
            '#secondnav {background: #BAADA7;}' +
        '</style>'
    );

    waitForKeyElements ('#header', function() {
        $('#header img, .wpfp-span, #text-27').remove();
        $('*').css({'font-family':'Droid Serif', 'font-size':'1em'});
        $('h1').css({'font-size':'2em'});
        $('#header, #header a, .title, .title a, .secondnav').css({'font-family':'Special Elite'});
        $('#header a').css({'color':'#952E00'});
    });

    waitForKeyElements ('#disqus_thread', function() {
        $('#disqus_thread').attr('id', 'poop');
    });

    waitForKeyElements ('#content table:first', doAllTheHidin);

    function doAllTheHidin() {

        var hideColumnHeader = $('#content table thead tr td.rating').last();
        hideColumnHeader.html('<a style="cursor:pointer;cursor:hand;">Show</a>');
        hideColumnHeader.click(function(e) {
            $('#content table tbody tr:hidden').show();
        });
        $('#content table tbody tr').each(function() {
            var currentRow = $(this);
            var currentTitle = currentRow.find('td.title').text();
            var hideColumn = currentRow.find('td.rating').last();
            hideColumn.html('<a style="cursor:pointer;cursor:hand;">x</a>');
            hideColumn.attr('class','hide-link');
            hideColumn.click(function(e) {
                storedHiddenTitles[currentTitle] = true;
                localStorage.storedHiddenTitles = JSON.stringify(storedHiddenTitles);
                currentRow.hide();
                currentRow.addClass('hidden-and-read');
            });
            if (storedHiddenTitles[currentTitle] !== undefined) {
                currentRow.hide();
                currentRow.addClass('hidden-and-read');
            }
        });
    }
}).fadeTo(3000, 1);