Skip to content

Instantly share code, notes, and snippets.

@mattandrews
Created October 1, 2013 14:23
Show Gist options
  • Save mattandrews/6779287 to your computer and use it in GitHub Desktop.
Save mattandrews/6779287 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name SigShade
// @namespace http://userstyles.org
// @description Truncates <pre> blocks in Gmail.
// @author chaplang
// @homepage http://userstyles.org/styles/93531
// @include https://mail.google.com*
// @run-at document-start
// ==/UserScript==
(function() {
//var css = ".gs pre {width: 250px;\nwhite-space: nowrap !important;\noverflow: hidden;\ntext-overflow: ellipsis}";
var css = ".gs pre { width: 250px; white-space: nowrap !important; overflow: hidden; text-overflow: ellipsis; height: 20px; border: 1px solid #CCC; border-left: 0; border-right: 0; padding: 10px 0; opacity: 0.3; } .gs pre:hover { opacity: 0.7; cursor: pointer; } .gs pre:active { opacity: 1; overflow: visible; height: auto; width: auto; white-space: pre-wrap !important; text-overflow: initial; }";
if (typeof GM_addStyle != "undefined") {
GM_addStyle(css);
} else if (typeof PRO_addStyle != "undefined") {
PRO_addStyle(css);
} else if (typeof addStyle != "undefined") {
addStyle(css);
} else {
var node = document.createElement("style");
node.type = "text/css";
node.appendChild(document.createTextNode(css));
var heads = document.getElementsByTagName("head");
if (heads.length > 0) {
heads[0].appendChild(node);
} else {
// no head yet, stick it whereever
document.documentElement.appendChild(node);
}
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment