Created
June 18, 2015 11:49
-
-
Save alketii/2728a4ecf487b93095d1 to your computer and use it in GitHub Desktop.
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
// Copyright [email protected] CC0 Universal | |
// ==UserScript== | |
// @name QupZilla Github Fix | |
// @namespace qupzilla_github_fix | |
// @include https://github.com/* | |
// @version 0.1 | |
// @require https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js | |
// ==/UserScript== | |
var html_list = ""; | |
var item_title = ""; | |
var item_href = ""; | |
GM_addStyle(".select-menu-filters {max-height:400px;overflow-y:scroll;}#qpf-list li { list-style-type:none;} #qpf-list li a {display:block;padding:6px;text-decoration:none;color:#666;} #qpf-list a:hover {background:#4078C0;color:#fff;}#qpf-list .selected{font-weight:bold;color:#4078C0;} .qpf-span {padding:6px;font-weight:bold;color:#000;}"); | |
$(document).ready(function() { | |
html_list += '<span class="qpf-span">Branches</span><ul id="qpf-list">'; | |
$('*[data-tab-filter="branches"] a').each(function( index ) { | |
item_title = $(this).text(); | |
item_title = item_title.replace(/\s/g, ''); | |
item_href = $(this).attr("href"); | |
if ( $( this ).hasClass("selected")) { | |
html_list += '<li><a class="selected" href="'+item_href+'">'+item_title+'</a></li>'; | |
} else { | |
html_list += '<li><a href="'+item_href+'">'+item_title+'</a></li>'; | |
} | |
}); | |
html_list += "</ul>"; | |
html_list += '<span class="qpf-span">Tags</span><ul id="qpf-list">'; | |
$('*[data-tab-filter="tags"] a').each(function( index ) { | |
item_title = $(this).text(); | |
item_title = item_title.replace(/\s/g, ''); | |
item_href = $(this).attr("href"); | |
if ( $( this ).parent().hasClass("selected")) { | |
html_list += '<li><a class="selected" href="'+item_href+'">'+item_title+'</a></li>'; | |
} else { | |
html_list += '<li><a href="'+item_href+'">'+item_title+'</a></li>'; | |
} | |
}); | |
html_list += "</ul>"; | |
$('.select-menu-filters').html(html_list); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This script is incorrect, you shouldn't use
$(document).ready(function()
instead you should set@run-at document-end
(http://wiki.greasespot.net/Metadata_Block#.40run-at).