-
-
Save shabda/1466082 to your computer and use it in GitHub Desktop.
Hiding stuff, go directly to "My active tickets" in unfuddle
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
// Reusable extension for jQuery so that we can hide jQuery objects | |
// and hide them. We will show an arrow at the top-right corner which | |
// will toggle the display of these. | |
// Examples: | |
// | |
// For github.com.js: | |
// $("#header").toggleStuff(); | |
// | |
// Some random site: | |
// $("#report_attachment").parent().next().toggleStuff() | |
$.fn.toggleStuff = -> | |
$this = $(this) | |
anchorCss = | |
position: 'fixed' | |
top: '30px' | |
right: '10px' | |
'z-index': '999' | |
'font-size': '30px' | |
'font-weight': 'bold' | |
'text-decoration': 'none' | |
anchor = $("<a>").text('▼').css(anchorCss).addClass("dotjsToggler").prependTo("body") | |
upUp = -> | |
$this slideUp | |
anchor.text '▲' | |
downDown = -> | |
$this slideDown | |
anchor.text '▼' | |
anchor.toggle(upUp, downDown).click(); |
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
jQuery(function (){ | |
var hash = document.location.hash; | |
function setHash(s) { | |
hash = document.location.hash = s; | |
} | |
if (hash.search('/projects/1') === -1) { | |
// hash may vary | |
setHash('#/projects/1'); | |
} | |
if (hash === '#/projects/1') { | |
// hash may vary | |
setHash('#/projects/1/ticket_reports/10'); | |
} | |
// Unfuddle fetches content through Ajax. You may want to | |
// increase the timeout if your connection is slower. | |
setTimeout(function () { | |
$("#header").toggleStuff(); | |
}, 1000); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment