portalgraphics HTML5 Drawing Procedure

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

You will need to install an extension such as Tampermonkey to install this script.

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==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);
}