Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.