Skip to content

Instantly share code, notes, and snippets.

@smeevil
Last active August 29, 2015 14:15
Show Gist options
  • Save smeevil/a9ba307332dcf4110375 to your computer and use it in GitHub Desktop.
Save smeevil/a9ba307332dcf4110375 to your computer and use it in GitHub Desktop.
Toggle irccloud cruft
// ==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);
@smeevil
Copy link
Author

smeevil commented Feb 24, 2015

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 :

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment