Frenzyboard PM Size Fixer

By Hans van de Bruggen Last update Mar 23, 2006 — Installed 346 times. Daily Installs: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
// ==UserScript==// @name            Frenzyboard PM Size Fixer
// @version         0.5// @namespace       pintong@gmail.com// @description	    Fixes a bug with the size of the PM rows to render them more like IE.// @include         http://*frenzyboard.com/*?action=inbox
//
//  New in 0.5:
//  //  Script based off of Platypus by Scott R. Turner//  http://platypus.mozdev.org
//  Available under Creative Commons Attribution-NonCommercial-ShareAlike 2.0//  
// Because the problematic "width=1%" happens at different locations of 
// clean.php and index.php, we run two scripts - one for each version of 
// the page. It's less than elegant, but it doesn't break anything.
//
// TODO:
// Only run the script needed (run clean_mode_script for clean.php and regular_mode_script for index.php)
// 
// ==/UserScript==
// Fix for index.php version of the inboxfunction regular_mode_script() {do_modify_html_it(window.document,document.evaluate('/HTML[1]/BODY[1]/TABLE[2]/TBODY[1]/TR[1]/TD[3]/TABLE[1]/TBODY[1]/TR[1]/TD[2]/TABLE[1]/TBODY[1]/TR[1]/TD[1]/TABLE[1]', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue,/ width="1%"/,'',null);}; // Ends regular_mode_script

// Fix for clean.php version of the inbox
function clean_mode_script() {
do_modify_html_it(window.document,document.evaluate('/HTML[1]/BODY[1]/TABLE[1]/TBODY[1]/TR[1]/TD[1]/TABLE[1]/TBODY[1]/TR[1]/TD[2]/TABLE[1]/TBODY[1]/TR[1]/TD[1]/TABLE[1]', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue,/ width="1%"/,'',null);
}; // Ends clean_mode_script

// Needed by both scripts
function do_modify_html_it(doc, element, match_re, replace_string) {
    match_re = new RegExp(match_re);
    if (element.innerHTML) {
element.innerHTML = element.innerHTML.replace(match_re, replace_string);
    };
};

// Runs the scripts when the page is loaded.window.addEventListener("load", function() { regular_mode_script() }, false);
window.addEventListener("load", function() { clean_mode_script() }, false);
//.user.js