Skip to content

Instantly share code, notes, and snippets.

@zbee
Last active August 29, 2015 14:26
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 zbee/ca7286c8f69dc4cd0388 to your computer and use it in GitHub Desktop.
Save zbee/ca7286c8f69dc4cd0388 to your computer and use it in GitHub Desktop.
Click the code preview of Gists to view the full gist
// ==UserScript==
// @name Click Gist code to view
// @namespace Gist-click-to-view
// @description Click the code preview of Gists to view the full gist
// @version 1
// @grant none
// @include https://gist.github.com/*
// @require https://code.jquery.com/jquery-2.1.4.min.js
// ==/UserScript==
$(".gist-snippet").each(function(index, value) {
var url = $(this).find("strong").parent().attr("href")
$(this).attr("link", url)
})
$(".gist-snippet > div:nth-child(2)").css("cursor", "pointer").click(function() {
window.location = $(this).parent().attr("link")
})
//This was useful when GitHub thought it'd be cool to disable this feature; now I guess this is useless.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment