MediaWiki:Resources/landingpage.js: Difference between revisions

Jump to navigation Jump to search
Content deleted Content added
No edit summary
No edit summary
Line 1: Line 1:
<html>
<script>
function getQuerystring( key ) {
function getQuerystring( key ) {
key = key.replace( /[\[]/, '\\\[' ).replace( /[\]]/, '\\\]' );
key = key.replace( /[\[]/, '\\\[' ).replace( /[\]]/, '\\\]' );
Line 48: Line 46:
$("#p-logo a").attr("href", "#");
$("#p-logo a").attr("href", "#");
$("#p-logo a").attr("title", "");
$("#p-logo a").attr("title", "");

// prefill other amount box if param provided
var otherVal = getQuerystring( 'otherVal' );
if( otherVal == '' || isNaN( parseFloat( otherVal ) ) ){
return;
}
otherVal = parseFloat( otherVal );
$("#input_amount_other").attr( 'checked', true );
$("#input_amount_other_box").val( otherVal );


// Highest previous contribution adjustments (for emails)
// Highest previous contribution adjustments (for emails)
Line 98: Line 87:
100 : [75, 100, 150],
100 : [75, 100, 150],
150 : [75, 100, 200],
150 : [75, 100, 200],
200 : [100, 200, 300]
200 : [100, 200, 300]
}
}
};
};
Line 160: Line 149:
}
}
var considerAmountString = "";
var considerAmountString = "";
for( var j = 0; j < appealask.length; j++ ) {
for( var k = 0; k < appealask.length; k++ ) {
considerAmountString += symbol + appealask[j] + ', ';
considerAmountString += symbol + appealask[k] + ', ';
}
}
considerAmountString = considerAmountString.trim();
considerAmountString = considerAmountString.trim();
$('.consider-amounts').html(considerAmountString);
$('.consider-amounts').html(considerAmountString);
}
}

// prefill other amount box if param provided
var otherVal = getQuerystring( 'otherVal' );
if( otherVal == '' || isNaN( parseFloat( otherVal ) ) ){
return;
}
otherVal = parseFloat( otherVal );
$("#input_amount_other").attr( 'checked', true );
$("#input_amount_other_box").val( otherVal );
});
});
</script>
</html>