Last active
November 9, 2019 16:21
-
-
Save DesertEagleDerek/04a6187c42fafce42fa22f2d376e0c5f to your computer and use it in GitHub Desktop.
This file contains 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 TweetDeck tweaks | |
// @namespace https://gist.githubusercontent.com/DesertEagleDerek/04a6187c42fafce42fa22f2d376e0c5f/raw/TweetDeck_Tweaks.user.js | |
// @updateURL https://gist.githubusercontent.com/DesertEagleDerek/04a6187c42fafce42fa22f2d376e0c5f/raw/TweetDeck_Tweaks.user.js | |
// @downloadURL https://gist.githubusercontent.com/DesertEagleDerek/04a6187c42fafce42fa22f2d376e0c5f/raw/TweetDeck_Tweaks.user.js | |
// @version 0.3 | |
// @author DesertEagleDerek | |
// @description Column width override, custom dialog size, uncircle avatars | |
// @homepage http://www.deserteaglederek.com/ | |
// @match https://tweetdeck.twitter.com/* | |
// @run-at document-start | |
// @grant none | |
// ==/UserScript== | |
function addGlobalStyle(css) { | |
var head, style; | |
head = document.getElementsByTagName('head')[0]; | |
if (!head) { return; } | |
style = document.createElement('style'); | |
style.type = 'text/css'; | |
style.innerHTML = css; | |
head.appendChild(style); | |
} | |
function addStyleCSS(values) { | |
var finalCSS = ""; | |
for(var i = 0; i < values.length; i++) { | |
for(var j = 0; j < values[i].length; j++) { | |
if(j > 0) { | |
finalCSS += values[i][j] + " !important;"; | |
} else { | |
finalCSS += values[i][j] + " { "; | |
} | |
} | |
finalCSS += " } \n"; | |
} | |
addGlobalStyle(finalCSS); | |
} | |
(function() { | |
'use strict'; | |
// ---------------------------------------------------------------------- | |
// width of all columns as a percentage (1 - 100) | |
var column_width = 50; | |
// how much bigger you want the dialogs in pixels | |
var dialog_width = 300; | |
var dialog_height = 200; | |
// set this to false to disable the bottom scroll bar | |
var dialog_scroll = true; | |
// how much taller you want the dialog images in pixels | |
var image_link_height = 200; | |
// ---------------------------------------------------------------------- | |
// DON'T EDIT ANYTHING BELOW HERE! | |
// ---------------------------------------------------------------------- | |
var cssArray = []; | |
// wider columns | |
cssArray.push([".column", "width: " + column_width + "%"]); | |
// uncircle avatars | |
cssArray.push([".avatar", "border-radius: 5px"]); | |
// dialog popup | |
var dialog_width_total = 643 + dialog_width; | |
var dialog_height_total = 630 + dialog_height; | |
var dialog_width_panel = 350 + dialog_width; | |
cssArray.push(["#open-modal .s-tall-fixed", "width: " + dialog_width_total + "px"]); | |
cssArray.push(["#open-modal .s-tall-fixed", "height: " + dialog_height_total + "px"]); | |
cssArray.push([".prf", "height: auto"]); | |
cssArray.push([".mdl-column-rhs", "width: " + dialog_width_panel + "px"]); | |
cssArray.push([".prf-header-inner-overlay", "width: auto"]); | |
cssArray.push([".prf-header", "width: auto"]); | |
if(!dialog_scroll) { | |
cssArray.push([".js-right-column", "overflow-y: visible"]); | |
} | |
var image_link_height_total = 153 + image_link_height; | |
cssArray.push([".media-size-medium", "height: " + image_link_height_total + "px"]); | |
// add style to page | |
addStyleCSS(cssArray); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment