js_log('mvUPload:doUploadSwitch():' + _this.upload_mode);
//issue a normal post request
if( _this.upload_mode == 'api' && ! _this.http_copy_upload ){
-
+ //get the token from the page:
+ _this.etoken = $j("#wpEditToken").val();
+
//@@TODO check for sendAsBinnary to support firefox/html5 progress on upload
//set the form target to iframe target:
},
//do firefogg specific additions:
dispProgressOverlay:function(){
- this.pe_dispProgressOverlay();
-
+ this.pe_dispProgressOverlay();
//if we are uploading video (not in passthrough mode show preview button)
- if( ! this.encoder_settings['passthrough'] && ! this.http_copy_upload ){
+ if( this.fogg_enabled && ! this.encoder_settings['passthrough'] && ! this.http_copy_upload ){
this.doPreviewControl();
}
},
//modify the content provider config based on options:
for(var i in this.content_providers){
if( _this.enabled_cps == 'all' && !this.disp_item ){
- this.disp_item = i;
+ this.disp_item = i;
+ //end the for loop (no need to idorate if enabled_cps == 'all'
+ break;
}else{
if( $j.inArray(i, _this.enabled_cps) != -1 ){
//if no default display set to first enabled cp:
}
// Firefogg integration
- if( wgPageName == "Special:Upload" ){
+ if( wgPageName == "Special:Upload" ){
load_mv_embed( function() {
loadExternalJs( mwEmbedHostPath + '/uploadPage.js' + reqAguments );
} );
}
}
-function load_mv_embed( callback ) {
- if(console.log)
- console.log( 'load_mv_embed');
+function load_mv_embed( callback ) {
// Inject mv_embed if needed
- if( typeof mvEmbed == 'undefined' ) {
- importScriptURI( mwEmbedHostPath + '/mwEmbed/mv_embed.js' + reqAguments );
- check_for_mv_embed( callback );
- } else {
- check_for_mv_embed( callback );
+ if( typeof $mw == 'undefined' ) {
+ var mvurl = mwEmbedHostPath + '/mwEmbed/mv_embed.js' + reqAguments ;
+ importScriptURI( mvurl );
}
+ check_for_mv_embed( callback );
}
function check_for_mv_embed( callback ) {
- if( typeof MV_EMBED_VERSION == 'undefined' ) {
+ if( typeof $mw == 'undefined' ) {
setTimeout( function(){
check_for_mv_embed( callback );
}, 25 );