2,021 bytes added ,  11:46, 21 August 2010
no edit summary
Line 1: Line 1:  
/* Any JavaScript here will be loaded for all users on every page load. */
 
/* Any JavaScript here will be loaded for all users on every page load. */
 +
 +
/**** Special:Upload enhancements ******
 +
* moved to [[MediaWiki:Upload.js]]
 +
*
 +
*  Maintainer: [[User:Lupo]]
 +
****/
 +
JSconfig.registerKey('UploadForm_loadform', true,
 +
{
 +
  'bg': 'Използване на логиката на новия формуляр за качвания',
 +
  'en': 'Use new upload form logic', // default
 +
  'mk': 'Искористете ја логиката на новиот образец за подигнување',
 +
  'ru': 'Использовать новую логику формы загрузки'
 +
}, 3);
 +
JSconfig.registerKey('UploadForm_newlayout', true,
 +
{
 +
  'bg': 'Използване на облика на новия формуляр за качвания',
 +
  'en': 'Use new upload form layout', // default
 +
  'mk': 'Искористете го рувото на новиот образец за подигнување',
 +
  'ru': 'Использовать новый интерфейс формы загрузки'
 +
}, 3);
 +
 +
function enableNewUploadForm ()
 +
{
 +
  var match = navigator.userAgent.match(/AppleWebKit\/(\d+)/);
 +
  if (match) {
 +
    var webKitVersion = parseInt(match[1]);
 +
    if (webKitVersion < 420) return; // Safari 2 crashes hard with the new upload form...
 +
  }
 +
 +
  // honor JSConfig user settings
 +
  if( !JSconfig.keys['UploadForm_loadform'] ) return;
 +
 +
  importScript( 'MediaWiki:UploadForm.js' );
 +
}
 +
 +
if (wgPageName == 'Special:Upload')
 +
{
 +
importScript( 'MediaWiki:Upload.js' );
 +
// Uncomment the following line (the call to enableNewUploadForm) to globally enable the
 +
// new upload form. Leave the line *above* (the include of MediaWiki:Upload.js) untouched;
 +
// that script provides useful default behavior if the new upload form is disabled or
 +
// redirects to the old form in case an error occurs.
 +
enableNewUploadForm ();
 +
}
 +
 +
// We may be running MediaWiki:UploadForm.js on this site. The following script changes the
 +
// "reupload" links on image pages to go to the basic form.
 +
if (wgNamespaceNumber == 6) importScript ('MediaWiki:UploadFormLinkFixer.js');
    
//Fix "Upload file" link when using the secure proxy
 
//Fix "Upload file" link when using the secure proxy