[ Index ]

PHP Cross Reference of MediaWiki-1.24.0

title

Body

[close]

/resources/src/mediawiki.special/ -> mediawiki.special.upload.js (summary)

JavaScript for Special:Upload

File Size: 565 lines (16 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 9 functions

  hasFileAPI()
  fileIsPreviewable()
  showPreview()
  fetchPreview()
  prettySize()
  clearPreview()
  checkMaxUploadSize()
  getMaxUploadSize()
  createHandler()

Functions
Functions that are not part of a class:

hasFileAPI()   X-Ref
Is the FileAPI available with sufficient functionality?


fileIsPreviewable( file )   X-Ref
Check if this is a recognizable image type...
Also excludes files over 10M to avoid going insane on memory usage.

TODO: Is there a way we can ask the browser what's supported in `<img>`s?

TODO: Put SVG back after working around Firefox 7 bug <https://bugzilla.wikimedia.org/show_bug.cgi?id=31643>

param: {File} file
return: boolean

showPreview( file )   X-Ref
Show a thumbnail preview of PNG, JPEG, GIF, and SVG files prior to upload
in browsers supporting HTML5 FileAPI.

As of this writing, known good:

- Firefox 3.6+
- Chrome 7.something

TODO: Check file size limits and warn of likely failures

param: {File} file

fetchPreview( file, callback, callbackBinary )   X-Ref
Start loading a file into memory; when complete, pass it as a
data URL to the callback function. If the callbackBinary is set it will
first be read as binary and afterwards as data URL. Useful if you want
to do preprocessing on the binary data first.

param: {File} file
param: {Function} callback
param: {Function} callbackBinary

prettySize( s )   X-Ref
Format a file size attractively.

TODO: Match numeric formatting

param: {number} s
return: {string}

clearPreview()   X-Ref
Clear the file upload preview area.


checkMaxUploadSize( file )   X-Ref
Check if the file does not exceed the maximum size


getMaxUploadSize( type )   X-Ref
No description

createHandler( $currentRow )   X-Ref

param: {jQuery} $currentRow
return: {Function} Handler
return: {jQuery.Event} return.e



Generated: Fri Nov 28 14:03:12 2014 Cross-referenced by PHPXref 0.7.1