Read Wattpad full screen

read wattpad full screen. remove all but text. distraction free.

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

// ==UserScript==
// @name       Read Wattpad full screen
// @version    0.6
// @match      http://www.wattpad.com/*
// @require http://code.jquery.com/jquery-latest.js
// @description read wattpad full screen. remove all but text. distraction free.
// @namespace https://greasyfork.org/users/5241
// ==/UserScript==

$(document).ready(function() {
 
        //alert("ok");
    //debugger;
 
    var text = $('#storyText');
    if (!text.length) return;
 
    $(window).unbind();
    text.attr("style","padding:15%;margin-right:10%;");
    
    var body = $('body');
    var pagingButtons=$('#pagingButtons');
    var nextChapter=$('#nextChapter');
    var action_bar=$('#action_bar');
 
    action_bar.find("#library_manage").remove();
    action_bar.find("#share_story").remove();
    action_bar.find("#big_vote_button").append("Vote");
    var style='color:#808080; text-decoration:none; padding:20px;';
    action_bar.attr('style',style).find('a').attr('style',style);
    
    nextChapter.css("margin-right","20%");
    nextChapter.find('a').attr('style','font-weight: bold;color: #808080;text-decoration: none;');
    
    
    pagingButtons
        .css('margin-right','inherit')
        .find(".paging_input")
                .css({
                border: "none",
                "font-size": "19px",
                "text-align": "right",
                "font-family": "Verdana, Helvetica, Arial, sans-serif",
                background: "#FFF",
                color: "#000"
            });
 
    pagingButtons
        .find(".prev_page")
                .css({
                "padding-right": "3px",
                "position": "absolute",
                "margin-left": "-20px",
                "margin-top": "3px"
            });
    
    body.html('<div id=wrapper></div>');
    
    //alert('ok');
    document.open();
    document.write(body.html());
    document.close();
    $.cache = {};
   
    $('#wrapper')
        .css('width',"110%")
        .css('overflow-y',"scroll")
            .css('height',"100%")
        .css('margin-right',"20%")
        .css('height',2*screen.height) //required for chrome on MBA OSX
        .append(text)
        .append(pagingButtons)
        .append(nextChapter)
        .append('<a href=/library style="float:right; text-decoration:none; color:gray; margin-right:inherit">Library</a>')
        .append(action_bar)
 
    
    body = $('body');
    body.css({
        "overflow": "hidden",
                "line-height": "150%",
                "word-break": "break-word",
                "text-align": "justify",
                "font-family": "Verdana, Helvetica, Arial, sans-serif",
        "font-size": "larger",
        "height":screen.height
    });
 
    
    $('#pagingButtons')
       .find("a").attr('onclick','body.animate({scrollTop:0},1000);return nextPageClick();');
 
    //pgi.replaceWith(pgi.val());
    
    
});