resources/src/mediawiki.special.upload/upload.js
File upload.js
has 393 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/**
* JavaScript for Special:Upload
*
* @private
* @class mw.special.upload
Function showPreview
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function showPreview( file ) {
var $canvas,
ctx,
meta,
previewSize = 180,
Function onload
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
img.onload = function () {
var info, width, height, x, y, dx, dy, logicalWidth, logicalHeight;
// Fit the image within the previewSizexpreviewSize box
if ( img.width > img.height ) {
Function checkNow
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
checkNow: function ( nameToCheck ) {
var $spinnerDestCheck, title, requestTitle;
if ( nameToCheck.trim() === '' ) {
return;
}
Function fetchPreview
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function fetchPreview( file, callback, callbackBinary ) {
var reader = new FileReader();
if ( callbackBinary && 'readAsBinaryString' in reader ) {
// To fetch JPEG metadata we need a binary string; start there.
// TODO