Last active
August 29, 2015 14:15
-
-
Save smeevil/a9ba307332dcf4110375 to your computer and use it in GitHub Desktop.
Toggle irccloud cruft
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Minimal Irc Cloud | |
// @namespace http://govannon.nl/ | |
// @version 0.1 | |
// @description Add a button to toggle minimal mode for irc cloud | |
// @author Smeevil | |
// @match https://www.irccloud.com | |
// @grant none | |
// ==/UserScript== | |
setTimeout(function() { | |
var button, insertAt, mainwrapperPadding, sidebar; | |
insertAt = $('#uploadContextMenu ul.actions'); | |
li = $('<li/>') | |
link = $('<a/>').html('toggle mini').addClass('.toggle-mini-mode') | |
link.appendTo(li); | |
li.prependTo(insertAt); | |
sidebar = $('#sidebarwrapper'); | |
containerMinWidth=$('#container').css('min-width'); | |
mainwrapper=$('#mainwrapper'); | |
mainwrapperPaddingLeft = mainwrapper.css('padding-left'); | |
mainwrapperPaddingRight = mainwrapper.css('padding-right'); | |
timecontainer=$('#timeContainer'); | |
timecontainerLeft = timecontainer.css('left'); | |
return link.bind('click', (function(_this) { | |
return function() { | |
if (sidebar.is(':visible')) { | |
$('#mainwrapper').css({ | |
'padding-left': 0, | |
'padding-right': 0, | |
}); | |
$('#timeContainer').css({ | |
'left': '0px' | |
}); | |
$('#container').css({ | |
'min-width': 0 | |
}); | |
} else { | |
$('#mainwrapper').css({ | |
'padding-left': mainwrapperPaddingLeft, | |
'padding-right': mainwrapperPaddingRight | |
}); | |
$('#container').css('min-width', containerMinWidth); | |
$('#timeContainer').css({ | |
'left': timecontainerLeft | |
}); | |
} | |
sidebar.toggle(); | |
$('#headercell').toggle(); | |
$('td.statuscell').toggle(); | |
window.resizeBy(1) | |
return null; | |
}; | |
})(this)); | |
}, 5000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Updated the main one with your changes, also moved the toggle into the file upload popup at the right of the chat input bar :) Also toggling the min width property of the chat window so you can resize your window to be even smaller :D example :