| | Stumble It! | Add to Mixx! | | diigo it | | Slashdot |

Thursday, January 29, 2009

Gmail Optimized for 7 Inch EeePC

A few days ago I posted an article about how I "cleaned" up the Google Reader web page so that it would better fit the 7 inch screen on my EeePC. This is something of a follow-up to that except now it's for Gmail!

I have the Terminal theme on my Gmail account and I've further modified it using GreaseMonkey and a script that I've cobbled together.

Here's what it looks like before:And here's what it looks like after:
Clicking on the green bars on the top and side will make the panels pop out for use should you need them:
Top bar opened
Side bar opened
Both bars opened

And if you'd like to use it also, here's the script:
// ==UserScript==
// @name My Gmail
// @namespace Google Mail
// @description format Gmail for a 7 inch EeePC screen
// @include http*://mail.google.com/*
// ==/UserScript==

function topTog()
{
if (topBar.style.display == "none") { topBar.style.display = ""; }
else { topBar.style.display = "none"; }
}

function leftTog()
{
if (leftBar.style.display == "none") { leftBar.style.display = ""; }
else { leftBar.style.display = "none"; }
}

function onLoadHandler()
{
if(window.parent!=null &&
window.parent.parent!=null &&
window.parent.parent.document.getElementById("canvas_frame")!=null)
{
var oTopTog = window.parent.parent.document.createElement("DIV");
oTopTog.id = "topTog";
oTopTog.innerHTML = " ";
oTopTog.style.cursor = "default";
oTopTog.style.background = "lime";
oTopTog.style.position = "absolute";
oTopTog.style.top = "0px";
oTopTog.style.left = (window.outerWidth / 3) + "px";
oTopTog.style.height = "10px";
oTopTog.style.width = (window.outerWidth / 3) + "px";
oTopTog.addEventListener('click', topTog, true);
window.parent.parent.document.body.appendChild(oTopTog);

var oLeftTog = window.parent.parent.document.createElement("DIV");
oLeftTog.id = "leftTog";
oLeftTog.innerHTML = " ";
oLeftTog.style.cursor = "default";
oLeftTog.style.background = "lime";
oLeftTog.style.position = "absolute";
oLeftTog.style.left = "0px";
oLeftTog.style.top = (window.outerHeight / 4) + "px";
oLeftTog.style.height = (window.outerHeight / 3) + "px";
oLeftTog.addEventListener('click', leftTog, true);
window.parent.parent.document.body.appendChild(oLeftTog);

frmDoc = window.parent.parent.document.getElementById("canvas_frame").contentDocument;
frmDoc = frmDoc.childNodes[1].childNodes[1].childNodes[0].childNodes[1].childNodes[0];
leftBar = frmDoc.childNodes[1].childNodes[0].childNodes[1];
leftBar.style.position = "absolute";
leftBar.style.left = "10px";
leftBar.style.top = "5px";
leftBar.style.zIndex = "100";
leftBar.style.display = "none"
leftBar.style.background = "black";
leftBar.style.opacity = ".75";
leftBar.style.filter = "alpha(opacity=75)";
topBar = frmDoc.childNodes[0];
topBar.style.display = "none";
leftBar.nextSibling.style.width = (window.outerWidth - 30) + "px";
leftBar.nextSibling.style.top = "13px";
}
}
window.addEventListener('load',onLoadHandler,true);

0 comments: