Skip to content

Instantly share code, notes, and snippets.

@andreasvc
Last active August 29, 2015 14:05
Show Gist options
  • Save andreasvc/83efec98c6a31b1fb015 to your computer and use it in GitHub Desktop.
Save andreasvc/83efec98c6a31b1fb015 to your computer and use it in GitHub Desktop.
GreaseMonkey script: vertical split for Gmane 'news' interface.
// ==UserScript==
// @name Gmane vertical frames
// @namespace [email protected]
// @include http://news.gmane.org/*
// @include http://thread.gmane.org/*
// @version 1
// @grant none
// ==/UserScript==
// The default GMane 'news' view has horizontal panes which wastes lots of screen space;
// with this script the split will be vertical.
var framesets = document.getElementsByTagName('frameset');
if (framesets.length == 1) {
var frameset = framesets[0];
frameset.cols = '*';
frameset.rows = '*,28';
// add an inner frameset so that the bottom navigation bar is split horizontally
var newframeset = document.createElement('frameset')
var nav = document.getElementsByName('navigation')[0];
var threads = document.getElementsByName('threads')[0];
var article = document.getElementsByName('article')[0];
frameset.removeChild(threads);
frameset.removeChild(article);
newframeset.cols = '60%,40%';
newframeset.appendChild(threads);
newframeset.appendChild(article);
frameset.insertBefore(newframeset, nav);
}
var tags = document.getElementsByClassName('fixed');
if (tags.length > 0) {
var fixed = tags[0];
fixed.style.top = '10px';
fixed.style.left = '10px';
fixed.style.right = '';
fixed.style.height = '10%';
fixed.style.width = '40%';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment