Created
April 19, 2022 01:26
-
-
Save JulianWebb/c6f38947952e5f2f578b35480122d31b to your computer and use it in GitHub Desktop.
Comic Control Standardized Publish Time
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Comic Control Standardized Publish Time | |
// @namespace https://gist.github.com/JulianWebb | |
// @version 0.1 | |
// @author Pongles | |
// @description Sets the Publish Time on new Comic Posts to specified time | |
// !! CHANGE BELOW FROM 'localhost' TO YOUR DOMAIN !! | |
// @match *://localhost/* | |
// @grant none | |
// ==/UserScript== | |
// Note: this is for the ComicControl CMS | |
(function() { | |
'use strict'; | |
// 0-23, no leading digit | |
let hour = "6"; | |
// 0-59, no leading digit | |
let minute = "0"; | |
// 0-59, no leading digit | |
let second = "0"; | |
// the module you want to use it with (I think 'comic' is default) | |
let module = "comic"; | |
window.addEventListener("load", () => { | |
if (window.location.pathname.endsWith(module + "/add-post")) { | |
document.querySelector(`select[name='hour'] > option[value='${hour}']`).selected = true; | |
document.querySelector(`select[name='minute'] > option[value='${minute}']`).selected = true; | |
document.querySelector(`select[name='second'] > option[value='${second}']`).selected = true; | |
} | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use with a Userscript manager such as Greasemonkey or tampermonkey.