Bitcoin Forum

Bitcoin => Bitcoin Discussion => Topic started by: AltPluzF4 on May 31, 2011, 10:45:25 PM



Title: Bitcoin Monitor - Full Screen
Post by: AltPluzF4 on May 31, 2011, 10:45:25 PM
I was bored, so I made a very simple UserScript to throw bitcoin monitor into full screen.
If you care to try it, I've thrown it up at my google page.

http://j.mp/altpluzf4

It just adds a link to the bottom right corner of the page to toggle on/off.
I personally use this when I want more "detail" in a large cluster of transactions.

Any opinions, thoughts, suggestions, etc are welcome.
Thanks for your time.


Title: Re: Bitcoin Monitor - Full Screen
Post by: Beremat on June 01, 2011, 03:31:27 AM
Very nifty!

I've gone through the code, looks clean. Thanks for this! :D


Title: Re: Bitcoin Monitor - Full Screen
Post by: AltPluzF4 on June 01, 2011, 10:54:47 AM
Very nifty!

I've gone through the code, looks clean. Thanks for this! :D

Thanks.

Yeah, it's clean... but uh, sort of "weak." I made it for personal usage out of boredom.

Anyway, to save anyone time, here's the source of it... I'm sure anyone could greatly improve it.

Code:
// ==UserScript==
// @name           Bitcoin Monitor Full Screen
// @namespace      none
// @description    Adds a full screen button to bottom right corner.
// @include        http://bitcoinmonitor.com/
// @include        http://bitcoinmonitor.com/#
// @include        http://www.bitcoinmonitor.com/
// @include        http://www.bitcoinmonitor.com/#
// ==/UserScript==

var bFS = false;
var scale = 0.95;

var container = document.getElementById('content');
var graph = document.getElementById('placeholder');
var slider = document.getElementById('slider_box');
var elems = document.getElementsByTagName('*');
var toggleBtn = document.createElement('a');

var defaults = Array();
var bDefaultsSet = false;

function showExcess(bShow) {
    var disp = bShow ? '' : 'none';
   
    for (var i = 0; i < elems.length; i++) {
        var e = elems[i];
        if (e.tagName == 'HEADER' || e.tagName == 'FOOTER') {
            e.style.display = disp;
        }
        if (e.hasAttribute('class')) {
            var cls = e.getAttribute('class');
            if (cls.indexOf('wrapper') != -1 || cls.indexOf('body3') != -1) {
                e.style.display = disp;
            }
        }
    }
}

function doResize() {
    if (bFS) {
        var scaleWidth = window.innerWidth * scale;
        var scaleHeight = window.innerHeight * scale;
        container.style.width = parseInt(scaleWidth) + 'px';
        container.style.height = parseInt(scaleHeight) + 'px';
        container.style.left = parseInt((window.innerWidth / 2) - (scaleWidth / 2)) + 'px';
        container.style.top = parseInt((window.innerHeight / 2) - (scaleHeight / 2)) + 'px';
    }
    unsafeWindow.refresh_viewport();
}

function toggleFS() {
    if (!bDefaultsSet) {
        defaults['gw'] = graph.style.width;
        defaults['gh'] = graph.style.height;
        defaults['cw'] = container.style.width;
        defaults['ch'] = container.style.height;
        defaults['ct'] = container.style.top;
        defaults['cl'] = container.style.left;
        defaults['cp'] = container.style.position;
        defaults['bg'] = document.body.style.background;
        bDefaultsSet = true;
    }
   
    showExcess(bFS);
    bFS = !bFS;
    if (bFS) {
        toggleBtn.textContent = 'Full Screen [on ]';
        document.body.style.background = '#FFFFFF';
        container.style.position = 'fixed';
        container.style.top = '0px';
        container.style.left = '0px';
        graph.style.width = '100%';
        graph.style.height = '100%';
        window.addEventListener('resize', doResize, false);
    } else {
        window.removeEventListener('resize', doResize, false);
        document.body.style.background = defaults['bg'];
        container.style.position = defaults['cp'];
        container.style.top = defaults['ct'];
        container.style.left = defaults['cl'];
        container.style.width = defaults['cw'];
        container.style.height = defaults['ch'];
        graph.style.width = defaults['gw'];
        graph.style.height = defaults['gh'];
        toggleBtn.textContent = 'Full Screen [off]';
    }
    doResize();
}

toggleBtn.href = '#';
toggleBtn.textContent = 'Full Screen [off]';
toggleBtn.style.position = 'fixed';
toggleBtn.style.bottom = '0px';
toggleBtn.style.right = '0px';
toggleBtn.style.zIndex = 9;
toggleBtn.style.fontFamily = 'monospace';
document.body.insertBefore(toggleBtn, document.body.lastChild);
toggleBtn.addEventListener('click', toggleFS, false);

I don't expect it to be used much, but I figured it would be better to share just in case someone wants to use it :-/

Thanks for your time, and for your comment Beremat.


Title: Re: Bitcoin Monitor - Full Screen
Post by: Alex Beckenham on July 16, 2011, 04:29:16 PM
I was bored, so I made a very simple UserScript to throw bitcoin monitor into full screen.
If you care to try it, I've thrown it up at my google page.

http://j.mp/altpluzf4

404


I was just playing with Bitcoin Monitor via Chrome's document inspector, deleting out width constraints, etc to make it display it 2500px wide.

Would be nice if there was an easier way to stretch it in the browser window.


Title: Re: Bitcoin Monitor - Full Screen
Post by: spruce on July 16, 2011, 04:33:24 PM

I was just playing with Bitcoin Monitor via Chrome's document inspector, deleting out width constraints, etc to make it display it 2500px wide.

Would be nice if there was an easier way to stretch it in the browser window.

I use Opera. Just drag the slider in the bottom right to get up to 5x zoom of the whole window. Works a treat with Bitcoin Monitor (I just did it).


Title: Re: Bitcoin Monitor - Full Screen
Post by: Alex Beckenham on July 16, 2011, 04:38:09 PM

I was just playing with Bitcoin Monitor via Chrome's document inspector, deleting out width constraints, etc to make it display it 2500px wide.

Would be nice if there was an easier way to stretch it in the browser window.

I use Opera. Just drag the slider in the bottom right to get up to 5x zoom of the whole window. Works a treat with Bitcoin Monitor (I just did it).

Thanks, but that's a whole different thing :)

That's like spending huge $ on a 30" monitor just so that your icons look bigger.

I prefer to use the extra space for more information, and keep my icons microscopic.


Title: Re: Bitcoin Monitor - Full Screen
Post by: evoorhees on July 16, 2011, 05:38:51 PM
Getting "Site not found" error


Title: Re: Bitcoin Monitor - Full Screen
Post by: Yankee (BitInstant) on July 16, 2011, 05:55:12 PM
site not found