Rework of libAddMedia. The changes are entirely untested and there may be bugs, but...
authorTim Starling <tstarling@users.mediawiki.org>
Fri, 20 Nov 2009 07:23:08 +0000 (07:23 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Fri, 20 Nov 2009 07:23:08 +0000 (07:23 +0000)
commit251c21e84be02aabad13ab30bd56bae69fc7bdde
treedbcf47505004504dff79496f05f39d22a48e5bbb
parent934c7e34dedf10bccd112e7aa6e4aead1144449a
Rework of libAddMedia. The changes are entirely untested and there may be bugs, but at least the code is nicer to look at now. This commit message is probably incomplete.

In libAddMedia:
* Made many style changes, renamed many variables.
* Wrote a doc comment for most functions
* Renamed messages:
   * fogg-check_for_fogg -> fogg-check_for_firefogg
   * fogg-for_improved_uplods -> fogg-for_improved_uploads
   * fogg-use_latest_fox -> fogg-use_latest_firefox
   * mwe-upload-stats-fileprogres -> mwe-upload-stats-fileprogress

* Renamed functions:
   * doRemapFormToApi -> remapFormToApi
   * doUploadSwitch -> doUpload
   * proccessIframeResult -> processIframeResult
   * getEditForm -> getForm
   * dispProgressOverlay -> displayProgressOverlay
   * cancel_button -> getCancelButton
   * cancel_action -> onCancel
   * doControlHTML -> createControls
   * getTargetHtml -> getControlHtml
   * doControlBindings -> bindControls
   * getOSlink -> getFirefoggInstallUrl
   * doPreviewControl -> createPreviewControls
   * doRenderPreview -> renderPreview
   * selectFogg -> selectSourceFile
   * selectFoggActions -> updateSourceFileUI
   * saveLocalFogg -> doLocalEncodeAndSave
   * doChunkWithFormData -> doChunkUploadWithFormData
   * proccessPresetControl -> getPresetControlHtml
   * proccessCkControlHTML -> getConfigControlHtml
   * selectByUrl -> selectSourceUrl

* Promoted anonymous functions to methods:
   * onSubmit
   * onAjaxUploadStatusTimer
   * onAjaxUploadStatusResponse
   * onPreviewClick

In mvBaseUploadInterface:
* Made http_copy_upload lazy-initialised
* Made detectUploadMode() do only what it says, moved the actual upload stage to a callback.
* Refactored doUpload(), splitting out doApiCopyUpload() and doPostUpload()
* Refactored apiUpdateErrorCheck() into isApiSuccess() and showApiError()

In mvFirefogg:
* Made have_firefogg, sourceFileInfo lazy initialised
* Rearranged autoEncoderSettings() to make it the accessor getEncoderSettings()
* Rearranged firefoggCheck() to make it the accessor getFirefogg()
* Split encodeDone into the anonymous doEncode() done callbacks, and also the new function onLocalEncodeDone()

In mvAdvFirefogg:
* Refactored autoEncoderSettings() into getEncoderSetings() and updateSourceFileUI()

Elsewhere:
* Fixed spelling error UploadBase::MIN_LENGHT_PARTNAME
includes/api/ApiUpload.php
includes/upload/UploadBase.php
js2/mwEmbed/libAddMedia/mvAdvFirefogg.js
js2/mwEmbed/libAddMedia/mvBaseUploadInterface.js
js2/mwEmbed/libAddMedia/mvFirefogg.js
js2/mwEmbed/php/languages/mwEmbed.i18n.php
js2/uploadPage.js