Skip to content

Instantly share code, notes, and snippets.

@jayme-github
Last active December 1, 2015 10:32
Show Gist options
  • Save jayme-github/65fa98d25f29062f5861 to your computer and use it in GitHub Desktop.
Save jayme-github/65fa98d25f29062f5861 to your computer and use it in GitHub Desktop.
Some small improvements for posteo.de webmailer (use calendar event color as background instead of border only, remove elements that waste screen space)
// ==UserScript==
// @name Posteo
// @author jayme-github
// @copyright 2015+, jayme-github
// @namespace https://github.com/jayme-github/
// @downloadURL https://gist.github.com/jayme-github/65fa98d25f29062f5861/raw/Posteo.user.js
// @version 0.1
// @description Some small improvements for posteo.de webmailer
// @match https://posteo.de/webmail*
// @match https://posteo.de/hilfe*
// @match https://posteo.de/konto
// @match https://posteo.de/notes
// @grant none
// ==/UserScript==
/* jshint -W097 */
'use strict';
$(document).ready(function() {
$("#topline").remove();
$(".p_topline").remove();
$("#messagetoolbar").css('height', '35px');
if (document.URL.toLowerCase().indexOf("plugin.calendar") >= 0) {
(function ($) {
/**
* @function
* @property {object} jQuery plugin which runs handler function once specified element is inserted into the DOM
* @param {function} handler A function to execute at the time when the element is inserted
* @param {bool} shouldRunHandlerOnce Optional: if true, handler is unbound after its first invocation
* @example $(selector).waitUntilExists(function);
*/
$.fn.waitUntilExists = function (handler, shouldRunHandlerOnce, isChild) {
var found = 'found';
var $this = $(this.selector);
var $elements = $this.not(function () { return $(this).data(found); }).each(handler).data(found, true);
if (!isChild)
{
(window.waitUntilExists_Intervals = window.waitUntilExists_Intervals || {})[this.selector] =
window.setInterval(function () { $this.waitUntilExists(handler, shouldRunHandlerOnce, true); }, 500)
;
}
else if (shouldRunHandlerOnce && $elements.length)
{
window.clearInterval(window.waitUntilExists_Intervals[this.selector]);
}
return $this;
}
}(jQuery));
$("#messagetoolbar").css('top', '28px');
$("#calquicksearchbar").css('top', '50px');
$("#mainscreen").css('top', '90px');
$("#calendar-header").css('top', '90px');
$("a.fc-event").waitUntilExists(function(){
$(this).css('background-color', $(this).css('border-color'));
});
} else {
$("#mainscreen").css('top', '50px');
$("#mailboxcontainer").css('top', '40px');
$("#mailview-top").css('top', '40px');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment