Last active
October 14, 2022 03:23
-
-
Save matthewelmer/34b01bb3ce12e7df29aa37dd1393b725 to your computer and use it in GitHub Desktop.
Makes the calendar actually visible instead of horrendously zoomed in.
This file contains hidden or 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
// MIT License | |
// | |
// Copyright (c) 2022 Matthew Elmer | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: | |
// | |
// The above copyright notice and this permission notice shall be included in all | |
// copies or substantial portions of the Software. | |
// | |
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | |
// SOFTWARE. | |
// ==UserScript== | |
// @name mailbox.org calendar resizer | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description make the calendar not so godawfully bloated | |
// @author Matthew Elmer | |
// @match https://office.mailbox.org/appsuite/ | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=mailbox.org | |
// @run-at context-menu | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
// NOTES: | |
// - Getting elements by class name isn't ideal, since they could add a class, | |
// but it works for now. I'll update it if it breaks. | |
var i = 0; // Gross, but I guess this is how js works... | |
// Resize rows | |
var newHeight = "80rem"; | |
var days = document.getElementsByClassName('day'); | |
var today = document.getElementsByClassName('day today'); | |
var timeLabels = document.getElementsByClassName('week-container-label'); | |
for (i = 0; i < days.length; i++) { | |
days[i].style.height = newHeight; | |
} | |
for (i = 0; i < today.length; i++) { | |
today[i].style.height = newHeight; | |
} | |
for (i = 0; i < timeLabels.length; i++) { | |
timeLabels[i].style.height = newHeight; | |
} | |
// Remove top bar. | |
document.getElementById("io-ox-appcontrol").remove(); | |
document.getElementById("io-ox-core").className = document.getElementById("io-ox-core").className.replace(/(?:^|\s)abs(?!\S)/g, ''); | |
document.getElementById("io-ox-screens").className = document.getElementById("io-ox-screens").className.replace(/(?:^|\s)abs(?!\S)/g, ''); | |
// Remove bottom bar. Mini-calendar should be hidden before this is done. | |
var bottomBar = document.getElementsByClassName('generic-toolbar calendar bottom visual-focus'); | |
for (i = 0; i < bottomBar.length; i++) { | |
bottomBar[i].remove(); | |
} | |
var contentWindow = document.getElementsByClassName('abs window-content'); | |
for (i = 0; i < contentWindow.length; i++) { | |
contentWindow[i].className = contentWindow[i].className.replace(/(?:^|\s)abs(?!\S)/g, ''); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment