Announcement

Collapse
No announcement yet.

GW for Widescreen and High Res.

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    GW for Widescreen and High Res.

    Note
    The following things work for Opera and Firefox with Greasemonkey. I don't know how to do it for IE, nor do I care to find out how it should be done in IE.

    The Problem
    I'm sure I'm not the only one who's annoyed at the fixed width of GW which leaves a LOT of useless whitespace on widescreen and high-res screens. The following pieces of code will solve this problem, and, in addition, I'll give you a piece of code that will also allow you to change the background colour of GW if you dislike the current one.

    How to install
    Pretty simple, for Opera copy it into a file named gw.js and place it in the user javascript folder, and for FF add it to greasemonkey.

    The Code
    // ==UserScript==
    // @name Gateworld Widescreen
    // @namespace http://forum.gateworld.net/
    // @include http://forum.gateworld.net/*
    // ==/UserScript==

    window.bytes_new_width = function()
    {
    // define new size
    var new_size = "100%";
    var color = "#000000";

    // get the main table and reset its width
    var tbl = document.getElementsByTagName('TABLE')[0];

    if (tbl.getAttribute("WIDTH") == 772)
    {
    tbl.setAttribute("WIDTH", new_size);
    document.body.style.backgroundColor = color;
    document.body.style.backgroundImage = "url()";
    }

    }

    window.addEventListener("load", window.bytes_new_width, false);
    Last edited by Gregorius; 11 August 2009, 02:14 PM. Reason: Small change to the code.
    Signed,

    Gregorius
    Gateworld Forum Troublemaker Extraordinaire.


    sigpic

    Support the (r)Evolution: Gregorius for Moderator.
    Gregorius, because clowning about is his raison d'être.

    #2
    This is not my area of expertise so correct me if I am wrong. Wouldn't such a proposal take longer to load a page. For you or me with high speed Internet thats no big deal but what about dial up people.
    Originally posted by aretood2
    Jelgate is right

    Comment


      #3
      Originally posted by jelgate View Post
      This is not my area of expertise so correct me if I am wrong. Wouldn't such a proposal take longer to load a page. For you or me with high speed Internet thats no big deal but what about dial up people.
      This doesn't have anything to do with connection speed. It's a script that's stored on your computer and is run when certain criteria - in this case the fixed width of GW with its annoying background image - are met.

      What happens is this:
      - Browser requests a page from the GW forum and downloads it.
      - Browser runs the local script on the page.
      - If the criteria are met, then the width, the background color, and the background image of the forum are changed.

      It's not a perfect solution, but it gives a lot less useless whitespace than the default forum settings.

      A better solution would be for Darren to create a copy of this skin where the line
      <TABLE WIDTH="772" BORDER="0" CELLPADDING="0" CELLSPACING="0" BGCOLOR="#213f67">
      is changed to

      <TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" BGCOLOR="#213f67">
      Or any other percentage so the forum stretches to a certain percentage of the browser width.

      Best case scenario would be if Darren defined the entire lay-out in the stylesheet instead of the page itself since that would make modifying it way easier. It would also allow for a competition where people could design the stylesheets for GW instead of Darren.
      Signed,

      Gregorius
      Gateworld Forum Troublemaker Extraordinaire.


      sigpic

      Support the (r)Evolution: Gregorius for Moderator.
      Gregorius, because clowning about is his raison d'être.

      Comment

      Working...
      X