Skip to content

Instantly share code, notes, and snippets.

@sabueso
Created April 10, 2017 00:29
Show Gist options
  • Save sabueso/c67bd436152e5e34a8b9acee3220e81d to your computer and use it in GitHub Desktop.
Save sabueso/c67bd436152e5e34a8b9acee3220e81d to your computer and use it in GitHub Desktop.
Collapse external accounts in Zimbra (with Greasemonkey)
// ==UserScript==
// @name CollapseZimbraAccounts
// @namespace CollapseZimbraAccounts
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// @include https://puthereyourzimbraURL/*
// @version 1
// @grant none
// @run-at document-end
// ==/UserScript==
// What's going to happen?
// After 1 second collapse is going to be executed
// How to use it?
// 1) Replace https://puthereyourzimbraURL/* with your Zimbra url
// 2) Inspect desired account and replace DWT37 with your account id...
setTimeout(function() {
$('#DWT37').attr("aria-expanded","false");
$("[aria-labelledby='DWT37_div']").attr("aria-hidden","true");
$("[aria-labelledby='DWT37_div']").attr("aria-expanded","false");
$("[aria-labelledby='DWT37_div']").css("display", "none");
$("#DWT37_nodeCell").closest("td").find("div").addClass('ImgNodeCollapsed').removeClass('ImgNodeExpanded');
}, 1e3);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment