Skip to content

Instantly share code, notes, and snippets.

@gseitz
Forked from harshithjvmi/github-code-view-expander.js
Last active December 22, 2015 17:28
Show Gist options
  • Select an option

  • Save gseitz/6506403 to your computer and use it in GitHub Desktop.

Select an option

Save gseitz/6506403 to your computer and use it in GitHub Desktop.

Revisions

  1. gseitz revised this gist Sep 10, 2013. 1 changed file with 28 additions and 1 deletion.
    29 changes: 28 additions & 1 deletion github-code-view-expander.js
    Original file line number Diff line number Diff line change
    @@ -1 +1,28 @@
    $("#js-repo-pjax-container, .frames > .frame-center").width($(document.body).width()-20);
    // ==UserScript==
    // @author Gerolf Seitz
    // @name Github Wide Diff.
    // @description Make the diff view as wide as the browser window.
    // @include https://github.com/*
    // ==/UserScript==

    (function () {

    function addJQuery(callback) {
    var script = document.createElement("script");
    script.setAttribute("src", "//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js");
    script.addEventListener('load', function() {
    var script = document.createElement("script");
    script.textContent = "window.jQ=jQuery.noConflict(true);(" + callback.toString() + ")();";
    document.body.appendChild(script);
    }, false);
    document.body.appendChild(script);
    }

    // the guts of this userscript
    function main() {
    $("#js-repo-pjax-container, .frames > .frame-center").width($(document.body).width()-50);
    }

    // load jQuery and execute the main function
    addJQuery(main);
    })();
  2. @harshithjvmi harshithjvmi created this gist Oct 17, 2012.
    1 change: 1 addition & 0 deletions github-code-view-expander.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    $("#js-repo-pjax-container, .frames > .frame-center").width($(document.body).width()-20);