MediaWiki:Resources/landingpage.js: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
No edit summary |
No edit summary |
||
Line 14: | Line 14: | ||
function getQuerystring( key ) { |
function getQuerystring( key ) { |
||
key = key.replace( /[\[]/, '\\\[' ).replace( /[\]]/, '\\\]' ); |
key = key.replace( /[\[]/, '\\\[' ).replace( /[\]]/, '\\\]' ); |
||
var regex = new RegExp( '[\\?&]' + key + '=([a-zA-Z0-9\_\-]*)' ); |
var regex = new RegExp( '[\\?&]' + key + '=([a-zA-Z0-9\.\_\-]*)' ); |
||
var qs = regex.exec( window.location.search ); |
var qs = regex.exec( window.location.search ); |
||
return qs == null ? '' : qs[1]; |
return qs == null ? '' : qs[1]; |
||
Line 92: | Line 92: | ||
} |
} |
||
} |
} |
||
}); |
|||
$(document).ready(function(){ |
|||
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> |
</script> |