Skip to content

Instantly share code, notes, and snippets.

@JulianWebb
Created April 19, 2022 01:26
Show Gist options
  • Save JulianWebb/c6f38947952e5f2f578b35480122d31b to your computer and use it in GitHub Desktop.
Save JulianWebb/c6f38947952e5f2f578b35480122d31b to your computer and use it in GitHub Desktop.
Comic Control Standardized Publish Time
// ==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;
}
});
})();
@JulianWebb
Copy link
Author

Use with a Userscript manager such as Greasemonkey or tampermonkey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment