מדיה ויקי:Gadget-HotCat.js: הבדלים בין גרסאות בדף
Insert the category line *above* the "Watch this" box |
Fix for recent changes in upload form on the server side |
||
| שורה 77: | שורה 77: | ||
catline.appendChild ( np ) ; | catline.appendChild ( np ) ; | ||
ntd.appendChild ( catline ) ; | ntd.appendChild ( catline ) ; | ||
ntde.className = 'mw-label'; | |||
ntr.appendChild ( ntde ) ; | ntr.appendChild ( ntde ) ; | ||
ntr.appendChild ( ntd ) ; | ntr.appendChild ( ntd ) ; | ||
// Add handler for submit (changed by Lupo, 2008-01-18) | // Add handler for submit (changed by Lupo, 2008-01-18) | ||
var form = document.getElementById ('upload'); | var form = document.getElementById ('upload'); | ||
hotcat_old_onsubmit = form.onsubmit; | // Grrr... they changed the upload form! | ||
// http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/includes/SpecialUpload.php?r1=32033&r2=32190 | |||
if (!form) form = document.getElementById ('mw-upload-form'); | |||
if (form) { | |||
hotcat_old_onsubmit = form.onsubmit; | |||
form.onsubmit = hotcat_on_upload; | |||
tr.parentNode.insertBefore ( ntr , tr ) ; // Insert *above* "Watch this" box | |||
} | |||
} | } | ||