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