User:Dominic/monobook.js

function uploadbatch { if((document.title.indexOf('Upload file - ') == 0)&&(queryString('wpUploadFile'))) { try { netscape.security.PrivilegeManager.enablePrivilege('UniversalFileRead'); } catch($err) { var $privileges = false; alert('Error: Unable to perform file upload. App was denied elevated privileges to do so.'); return; }   if((queryString('wpUploadFile'))&&(document.getElementById('wpUploadFile').value == '')) document.getElementById('wpUploadFile').value = decodeURIComponent(queryString('wpUploadFile')).replace(/\+/g,' ') if((queryString('wpDestFile'))&&(document.getElementById('wpDestFile').value == '')) document.getElementById('wpDestFile').value = decodeURIComponent(queryString('wpDestFile')).replace(/\+/g,' ') if((queryString('wpUploadDescription'))&&(document.getElementById('wpUploadDescription').value == '')) document.getElementById('wpUploadDescription').value = decodeURIComponent(queryString('wpUploadDescription')).replace(/\+/g,' ') if(queryString('wpUpload') == 'submit') document.forms[0].wpUpload.click } } addOnloadHook(uploadbatch);

function queryString(p) { var re = RegExp('[&?]' + p + '=([^&]*)'); var matches; if (matches = re.exec(document.location)) { try { return decodeURI(matches[1]); } catch (e) { } }  return null; }