Ubuntu Pastebin

Paste from knome at Thu, 22 Jan 2015 21:49:26 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// ==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 style="display: inline !important; margin-left: 10px;">' ).attr( 'href', link_href ).html( 'Go &rsaquo;' );
    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 #toplevel, #volunteer_wizard #responses { display: none !important; } ";

  var style_elem = jQuery( '<style>' ).text( css );
  style_elem.appendTo( jQuery( 'head' ) );
} );
Download as text