Greasy Fork

GravityTales

Script to change the "skin" of the web page to create a mobile and large screen "reader".

目前为 2018-06-08 提交的版本。查看 最新版本

// ==UserScript==
// @name     GravityTales
// @description Script to change the "skin" of the web page to create a mobile and large screen "reader".
// @version  2.2
// @include http://gravitytales.com/novel/*/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js
// @require https://greasyfork.org/scripts/368324-lightnovels/code/LightNovels.js
// @grant    GM.getValue
// @grant    GM.setValue
// @namespace https://greasyfork.org/users/186987
// ==/UserScript==

var c = $("#chapterContent");
if(c.length){
  var t = $("#contentElement>div>h3").text();
  var st = $("#chapterContent>p:first").text();
  if(st === "Teaser below") {
    $("#chapterContent>p:first").remove();
    $("#chapterContent>hr:first").remove();
    st = $("#chapterContent>p:first").text() + " (Teaser)";
  }
  c.append($("#chapterNotes"));
  c.find("[style]").removeAttr('style');
  c.find("p:first").remove();
  c.find("p:first").remove();
  var p = $("div.chapter-navigation>a:first-child").attr("href");
  var toc = $("div.chapter-navigation>a:nth-child(2)").attr("href");
  var n = $("div.chapter-navigation>a:last-child").attr("href");

  createBody();
  setTitle(t);
  setSubTitle(st);
  setContent(c.html());
  setPrev(p);
  setTOC(toc);
  setNext(n);
}