// Minimum body width extender // greasemonkey script // ---------------------------------------------------------------- // // ==UserScript== // @name Body width extender // @namespace body_width_extender // @description extends the minimum body width on talk.maemo.org to 1050 pixels // @include http://talk.maemo.org/* // ==/UserScript== var originalMinWidth = document.body.style.minWidth; var desiredMinWidth = GM_getValue("minWidth",-1); if(desiredMinWidth == -1) { GM_setValue("minWidth","1050"); desiredMinWidth = 1050; GM_setValue("applyInLandscapeMode", true); GM_setValue("applyInPortraitMode", false); } checkMinWidthForCurrentWindow(); window.addEventListener('resize', checkMinWidthForCurrentWindow, false); function checkMinWidthForCurrentWindow() { if((isInLandscape() && GM_getValue("applyInLandscapeMode")) || (!isInLandscape() && GM_getValue("applyInPortraitMode"))) { document.body.style.minWidth=desiredMinWidth+"px"; } else { document.body.style.minWidth=originalMinWidth; } } function isInLandscape() { if(screen.width==480) return false else return true; }