From 9557fa74e6f5440cb20f828d38bb6a9ce11a1b24 Mon Sep 17 00:00:00 2001 From: "Seraphim R. Pardee" Date: Thu, 17 Oct 2024 13:24:30 -0400 Subject: [PATCH] Add fix-orthodox-history-layout/fix_orthodox_history_layout.user.js --- .../fix_orthodox_history_layout.user.js | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 fix-orthodox-history-layout/fix_orthodox_history_layout.user.js diff --git a/fix-orthodox-history-layout/fix_orthodox_history_layout.user.js b/fix-orthodox-history-layout/fix_orthodox_history_layout.user.js new file mode 100644 index 0000000..fb4856b --- /dev/null +++ b/fix-orthodox-history-layout/fix_orthodox_history_layout.user.js @@ -0,0 +1,37 @@ +// ==UserScript== +// @name Fix Orthodox History Layout +// @version 2024-10-17 +// @description Get rid of their dumb ad sidebar and make the content width normal again. +// @author Rdr. Seraphim Pardee +// @namespace https://git.hl.srp.life/srp/userscripts +// @homepageURL https://git.hl.srp.life/srp/userscripts +// @supportURL https://git.hl.srp.life/srp/userscripts/issues +// @downloadURL https://git.hl.srp.life/srp/userscripts/raw/branch/main/fix-orthodox-history-layout/fix_orthodox_history_layout.user.js +// @updateURL https://git.hl.srp.life/srp/userscripts/raw/branch/main/fix-orthodox-history-layout/fix_orthodox_history_layout.meta.js +// @match https://orthodoxhistory.org/* +// @icon data:image/svg+xml,☦️ +// @grant none +// ==/UserScript== + +(function() { + 'use strict'; + + + // Fixing homepage. + let originElem = document.getElementById("content"); + if (originElem) { + let firstColumn = originElem.getElementsByClassName("col-sm-3")[0]; + firstColumn.remove(); + + let contentColumn = originElem.getElementsByClassName("col-sm-6")[0]; + contentColumn.className = "col-sm-9"; + } + + // Prevent scummy ad redirecting. + window.onbeforeunload = function(e) { + if (!window.location.href.startsWith("https://orthodoxhistory.org")) { + e.preventDefault(); + e.returnValue = "You are being directed outside of Orthodox History. Do you wish to continue?"; + } +}; +})(); \ No newline at end of file