portalgraphics HTML5 Drawing Procedure

Replaces Flash-based portalgraphics drawing procedure display with a video tag

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name        portalgraphics HTML5 Drawing Procedure
// @namespace   DoomTay
// @description Replaces Flash-based portalgraphics drawing procedure display with a video tag
// @include     http://*.archive.org/web/*/http://www.portalgraphics.net/pg/illust/?image_id=*
// @include     http://*.archive.org/web/*/http://portalgraphics.net/pg/illust/?image_id=*
// @include     https://*.archive.org/web/*/http://www.portalgraphics.net/pg/illust/?image_id=*
// @include     https://*.archive.org/web/*/http://portalgraphics.net/pg/illust/?image_id=*
// @version     1.0.0
// @grant       none
// ==/UserScript==

var picID = window.location.href.substring(window.location.href.indexOf("=") + 1);
var IDRounded = picID >= 1000 ? Math.floor(picID/1000)*1000 : "0000";
var flashVid = document.querySelector("#ill-de-illust-m > div > object");
var timestamp = /web\/(\d{1,14})/.exec(window.location.href)[1];

if(flashVid)
{
	var eventVid = document.createElement("video");
	eventVid.width = flashVid.width;
	eventVid.height = flashVid.height;
	eventVid.controls = "true";
	eventVid.src = "/web/" + timestamp + "/http://www.portalgraphics.net/data/movie/" + IDRounded + "/" + picID + ".mp4";
	eventVid.poster = "/web/" + timestamp + "/http://www.portalgraphics.net/data/image/resize/" + IDRounded + "/" + picID + ".jpg";
	flashVid.parentNode.replaceChild(eventVid,flashVid);
}