Skip to content

Instantly share code, notes, and snippets.

@cpsubrian
Last active October 28, 2016 15:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cpsubrian/f9cd249f981c0870305421fb4d3a410c to your computer and use it in GitHub Desktop.
Save cpsubrian/f9cd249f981c0870305421fb4d3a410c to your computer and use it in GitHub Desktop.
Styler - Meldium Launchpad

Styler Injector for Meldium Launchpad

Pasted the following into the styler JS area:

var gistUrl = 'https://gist.githubusercontent.com/cpsubrian/f9cd249f981c0870305421fb4d3a410c/raw';
$.get(gistUrl + '/styles.css?v=' + Date.now(), function (result) {
  $('#stylerStyle').after('<style>' + result + '</style>'); 
});
$.get(gistUrl + '/script.js?v=' + Date.now(), function (result) {
  eval(result); 
});
// Taggify on an interval.
setInterval(taggify, 200);
function taggify () {
$('ul.users li span.ellipsis.bold, .appname').each(function () {
var $title = $(this);
var matches = $title.text().match(/^\[[^\]]*\]/);
if (matches) {
var org = matches[0];
$title.text($title.text().replace(org, ''));
var $org = $('<em class="org">' + org.replace(/\[|\]/gi, '') + '</em>');
var color = intToRGB(hashCode(org))
$org.css('backgroundColor', '#' + color);
if ($title.hasClass('appname')) {
$title.parents('.tile').append($org);
} else {
$title.prepend($org);
}
}
})
}
function hashCode(str) { // java String#hashCode
var hash = 0;
for (var i = 0; i < str.length; i++) {
hash = str.charCodeAt(i) + ((hash << 5) - hash);
}
return hash;
}
function intToRGB(i){
var c = (i & 0x00FFFFFF)
.toString(16)
.toUpperCase();
return "00000".substring(0, 6 - c.length) + c;
}
/* Header */
div.jiffiheader {
margin-left: 180px;
width: calc(100% - 180px);
}
/* Content */
body.menuopen #top-box,
body.menuopen div#mainCont {
left: 180px;
}
/* Left Nav */
div#leftnav {
width: 180px;
}
div#leftnav .logo {
display: none;
}
/* Tiles (Launchpad) */
div.tile {
position: relative;
height: 75px
}
div.tile > .inner {
overflow: visible;
margin-top: 13px;
}
div.tile .org {
display: block;
position: absolute;
top: 0;
left: 0;
right: 0;
padding: 0 5px;
height: 16px;
line-height: 16px;
color: #fff;
text-shadow: 1px 1px rgba(0, 0, 0, 0.1);
font-size: 11px;
z-index: 999;
opacity: 0.75;
}
div.tile .inner .appname {
font-size: 13px;
}
div.tile .inner .appuser {
font-size: 11px;
}
/* Tiles ListView (Launchpad) */
div.listview div.tile > .inner {
display: flex;
justify-content: flex-end;
align-items: center;
padding-left: 140px;
}
div.listview div.tile > .inner > * {
position: static;
flex: 0 0 auto;
top: auto;
left: auto;
right: auto;
bottom: auto;
order: 3;
}
div.listview div.tile > .inner > .logo {
order: 2;
opacity: 0.4;
}
div.listview div.tile > .inner > .logo img {
width: 20px;
height: 20px;
line-height: 20px;
font-size: 12px;
}
div.listview div.tile > .inner > .logo.text {
display: none;
}
div.listview div.tile > .inner > .appname {
flex: 0 0 auto;
width: auto !important;
padding-left: 20px;
padding-right: 10px;
order: 1;
}
div.listview div.tile > .inner > .appuser {
margin-left: auto;
}
div.listview div.tile .org {
right: auto;
width: 120px;
height: 36px;
line-height: 36px;
text-align: center;
}
/* Accounts List */
.organizationaccountsctrl ul.users li {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
font-size: 10px;
color: #888;
border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.organizationaccountsctrl ul.users li span.ellipsis {
flex: 0 0 auto;
width: auto;
padding-left: 20px;
order: 3;
}
.organizationaccountsctrl ul.users li .logo {
position: static !important;
left: auto !important;
top: auto !important;
margin: 0 auto 0 10px;
width: 16px;
height: 16px;
opacity: 0.6;
font-size: 11px;
line-height: 16px;
order: 2;
}
.organizationaccountsctrl ul.users li .logo.text {
display: none;
}
.organizationaccountsctrl ul.users li .logo img.s26 {
width: 16px;
height: 16px;
opacity: 0.6;
}
.organizationaccountsctrl ul.users li.h span.ellipsis:first-child {
margin-right: auto;
}
.organizationaccountsctrl ul.users li.h span.ellipsis:first-child,
.organizationaccountsctrl ul.users li span.ellipsis.bold {
padding-left: 0;
font-size: 15px;
color: #333;
order: 1;
}
.organizationaccountsctrl ul.users li span.ellipsis em.org {
display: inline-block;
margin: 0 5px 0 0;
padding: 0 4px;
height: 18px;
line-height: 18px;
font-size: 12px;
font-style: normal;
font-weight: 600;
color: #fff;
text-shadow: 1px 1px rgba(0, 0, 0, 0.2);
border-radius: 5px;
}
/* Support Overlay */
.bcFloat {
display: none !important;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment