Last active
April 28, 2020 14:39
-
-
Save amityweb/637b289a2e2a62cb4ad66b6c27923f59 to your computer and use it in GitHub Desktop.
Tampermonkey Asana Improvements
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 Asana | |
// @namespace http://example.com | |
// @version 0.1 | |
// @description Forced width of Asana is very obnoxius, so this will adjust the min width. | |
// @author You | |
// @match https://app.asana.com/* | |
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js | |
// @require https://gist.github.com/raw/2625891/waitForKeyElements.js | |
// @grant none | |
// ==/UserScript== | |
//-- Click the More Projects link | |
waitForKeyElements ( | |
".SidebarTeamDetailsProjectsList-showMoreProjectsLink", | |
activateClick | |
); | |
function activateClick (jNode) { | |
var clickEvent = document.createEvent('MouseEvents'); | |
clickEvent.initEvent ("click", true, true); | |
jNode[0].dispatchEvent (clickEvent); | |
} | |
addGlobalStyle(` | |
/* Hide annoying top bar message with Premium cancel warning because it cant be closed! */ | |
.AnnouncementTopBar--warning, | |
#topbar .announcementBar--yellow | |
{ | |
display: none!important; | |
} | |
.SectionRow, | |
.TaskGroup-subgroups .TaskGroup .SectionRow | |
{ | |
margin-top: 20px;!important; | |
margin-bottom: 10px; | |
background: #efefef!important; | |
border-bottom: 0; | |
padding-top: 6px!important; | |
padding-bottom: 6px!important; | |
} | |
.dropTargetRow:first-child .SectionRow | |
{ | |
margin-top: 0px;!important; | |
} | |
.SectionRow-sectionName | |
{ | |
box-shadow: none!important; | |
} | |
.TaskGroup-subgroups .TaskGroup | |
{ | |
border-top: 2px solid red; | |
padding: 20px; | |
/*background: #efefef*/ | |
} | |
.TaskGroup-subgroups .TaskGroup .SectionRow | |
{ | |
background: #ffffff!important; | |
margin-top: 0px;!important; | |
} | |
.TimelineCanvas-weekendStripe | |
{ | |
background: rgba(237,241,242,1)!important; | |
} | |
#center_pane_container | |
{ | |
max-width: none!important; | |
} | |
.remix-topbar, | |
.asanaView-body | |
{ | |
min-width: auto!important; | |
} | |
.Topbar | |
{ | |
display: -webkit-box!important; | |
} | |
.SidebarTeamMembersList, | |
.SidebarRecentsAndFavorites | |
{ | |
display: none!important; | |
} | |
@media print | |
{ | |
#asana_main | |
{ | |
width: 100%; | |
min-width: auto; | |
} | |
.TaskRow--completed .TaskRow-taskName > textarea | |
{ | |
text-decoration: line-through; | |
} | |
.sidebar-mountNode, | |
.printer-warning, | |
#asana_sidebar | |
{ | |
display: none!important; | |
} | |
.SectionRow | |
{ | |
margin-top: 20px!important; | |
display: inline-table!important; | |
} | |
.asanaView-bodyContainer | |
{ | |
background: #ffffff!important; | |
} | |
#whole_page_container | |
{ | |
position: static!important; | |
} | |
.SectionRow, .dropTargetRow | |
{ | |
page-break-inside: avoid; | |
} | |
@page | |
{ | |
margin-left: 0px!important; | |
margin-right: 0px!important; | |
margin-top: 50px!important; | |
margin-bottom: 50px!important; | |
} | |
.lunaui-grid-center-pane-container #center_pane, | |
.lunaui-grid-center-pane-container #right_pane | |
{ | |
box-shadow: none!important; | |
{ | |
`); | |
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); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment