Skip to content

Instantly share code, notes, and snippets.

@knomepasi
Last active August 29, 2015 14:13
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 knomepasi/08d651fa7f666c445f89 to your computer and use it in GitHub Desktop.
Save knomepasi/08d651fa7f666c445f89 to your computer and use it in GitHub Desktop.
Ubuntu Find-a-Task: Show the full task index
// ==UserScript==
// @name Show the full Find-a-Task index
// @namespace knome-ubuntu
// @include http://community.ubuntu.com/contribute/find-a-task/*
// @version 1
// @grant none
// @require https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js
// ==/UserScript==
jQuery.noConflict( );
jQuery( function ( ) {
jQuery( '#toplevel ul.choices li' ).each( function ( e ) {
var group_id = "#" + jQuery( this ).attr( 'next-group' );
var title = jQuery( this ).children( 'h3' ).text( );
var group_title = jQuery( '<h2>' ).text( title );
group_title.prependTo( jQuery( group_id ) );
} );
jQuery( '.group li' ).each( function ( e ) {
var link_href = jQuery( this ).attr( 'target' );
var link = jQuery( '<a>' ).attr( 'href', link_href ).html( 'Go &rsaquo;' ).addClass( 'go-link' );
link.appendTo( jQuery( this ).children( 'p.extra' ) );
} );
var css = "\
#volunteer_wizard .group, #volunteer_wizard li, #volunteer_wizard p { display: block !important; } \n\
#volunteer_wizard p.question { margin-left: -0.5em; } \n\
#volunteer_wizard li { margin-left: 2em; } \n\
#volunteer_wizard h3 { margin-bottom: 0.5em; } \n\
#volunteer_wizard a.go-link { display: inline !important; margin-left: 10px; } \n\
#volunteer_wizard #toplevel, #volunteer_wizard #responses { display: none !important; } ";
var style_elem = jQuery( '<style>' ).text( css );
style_elem.appendTo( jQuery( 'head' ) );
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment