Better Literorica

This scripts aims to give you more information about the story you are reading.

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name        Better Literorica
// @namespace   betterliterotica.dekart25.com
// @version     0.4
// @description This scripts aims to give you more information about the story you are reading.
// @include     http*://www.literotica.com/s*/*
// @copyright   2015+, dekart25
// @grant        none
// ==/UserScript==

$(document).ready(function() {
    var title = $(".b-story-header h1").text();
    var userUrl = $(".b-story-header a").attr("href");
    var url = location.href;

    if(url.indexOf("url=") != -1) {
        location.href = url.replace("tories/showstory.php?url=","/");
    }

    if(url.indexOf("http:") != -1) {
        location.href = url.replace("http:","https:");
    }

    //Remover a margin do W
    $("#w").width("100%");
    $("#root").css("margin-right", "500px");

    var minusheight = -1 * ( $(".b-story-body-x").height() + $(".b-story-header").height() + $(".b-breadcrumbs").height() + $(".b-story-stats-block").height() + 60 );
    $("#content .b-sidebar").css("margin-top",minusheight).css("margin-right","-650px").width("600px");

    var pages = $(".b-pager-caption-t").text();

    var box = $(".b-box")[0];
    $(box).find(".b-box-header h3").text("Serie");

    $.get(userUrl, function(data) {
        var rating = $(data).find("a[href=" + url + "]").parent().parent();
        if(rating.size() !== 0)
        {
            $(box).find(".b-box-body").html(rating.html());
        }
        else {
            $(box).find(".b-box-body").html("(x.xx)");
        }
        $(box).find(".b-box-body").append(pages);
        
        var hasNew = $(data).find("img[alt=\"New\"]");
        if(hasNew.length > 0) {
            $(box).find(".b-box-body").append('<img src="https://www.literotica.com/stories/images/memberpage/ico_n.gif" alt="New" width="10" height="11" border="0">'); 
        }
    });

    var lastpage = $("[name=page] option").last().text();
    if(lastpage !== "")
    {
        $.get(url + "?page=" + lastpage, function(data) {
            var serie = $(data).find("#b-series")[0];
            $("#content .b-sidebar").append(serie);

            var tags = $(data).find(".b-s-story-tag-list").parent().parent();
            $("#content .b-sidebar").append(tags);
        });
    }
});