* rename some message keys, to avoid duplicates in mwEmbed.i18n.php with other MediaWiki message keys (not yet done)
* fix link errors and unwanted changes introduced in r55296 where ":" was replaced by " : " also in messages
* update mwEmbed.i18n.php with updated keys
* this base uploader is optionally extended by firefogg
*/
loadGM({
- "upload-transcode-in-progress" : "Transcode and upload in progress (do not close this window)",
- "upload-in-progress" : "Upload in progress (do not close this window)",
- "upload-transcoded-status" : "Transcoded",
- "uploaded-status" : "Uploaded",
- "wgfogg_wrong_version" : "You have Firefogg installed but it is outdated. <a href=\"http : \/\/firefogg.org\">Please upgrade<\/a>.",
- "upload-stats-fileprogres" : "$1 of $2",
- "mv_upload_completed" : "Your upload is complete",
- "mv_upload_done" : "<a href=\"$1\">Your upload <i>should be<\/i> accessible<\/a>.",
- "upload-unknown-size" : "Unknown size",
- "mv-cancel-confim" : "Are you sure you want to cancel?",
- "successfulupload" : "Upload successful",
- "uploaderror" : "Upload error",
- "uploadwarning" : "Upload warning",
- "unknown-error" : "Unknown error : ",
- "return-to-form" : "Return to form",
- "file-exists-duplicate" : "This file is a duplicate of the following file : ",
- "fileexists" : "A file with this name exists already. Please check <b><tt>$1<\/tt><\/b> if you are not sure if you want to change it.",
- "fileexists-thumb" : "<center><b>Existing file<\/b><\/center>",
- "ignorewarning" : "Ignore warning and save file anyway",
- "file-thumbnail-no" : "The filename begins with <b><tt>$1<\/tt><\/b>",
- "go-to-resource" : "Go to resource page",
- "upload-misc-error" : "Unknown upload error",
- "wgfogg_waring_bad_extension" : "You have selected a file with an unsuported extension (<a href=\"http : \/\/commons.wikimedia.org\/wiki\/Commons : Firefogg#Supported_File_Types\">more information<\/a>).",
- "cancel-button" : "Cancel",
- "ok-button" : "OK"
+ "mwe-upload-transcode-in-progress" : "Transcode and upload in progress (do not close this window)",
+ "mwe-upload-in-progress" : "Upload in progress (do not close this window)",
+ "mwe-upload-transcoded-status" : "Transcoded",
+ "mwe-uploaded-status" : "Uploaded",
+ "mwe-upload-stats-fileprogres" : "$1 of $2",
+ "mwe-upload_completed" : "Your upload is complete",
+ "mwe-upload_done" : "<a href=\"$1\">Your upload <i>should be<\/i> accessible<\/a>.",
+ "mwe-upload-unknown-size" : "Unknown size",
+ "mwe-cancel-confim" : "Are you sure you want to cancel?",
+ "mwe-successfulupload" : "Upload successful",
+ "mwe-uploaderror" : "Upload error",
+ "mwe-uploadwarning" : "Upload warning",
+ "mwe-unknown-error" : "Unknown error:",
+ "mwe-return-to-form" : "Return to form",
+ "mwe-file-exists-duplicate" : "This file is a duplicate of the following file:",
+ "mwe-fileexists" : "A file with this name exists already. Please check <b><tt>$1<\/tt><\/b> if you are not sure if you want to change it.",
+ "mwe-fileexists-thumb" : "<center><b>Existing file<\/b><\/center>",
+ "mwe-ignorewarning" : "Ignore warning and save file anyway",
+ "mwe-file-thumbnail-no" : "The filename begins with <b><tt>$1<\/tt><\/b>",
+ "mwe-go-to-resource" : "Go to resource page",
+ "mwe-upload-misc-error" : "Unknown upload error",
+ "mwe-wgfogg_warning_bad_extension" : "You have selected a file with an unsuported extension (<a href=\"http:\/\/commons.wikimedia.org\/wiki\/Commons:Firefogg#Supported_File_Types\">more information<\/a>).",
+ "mwe-cancel-button" : "Cancel",
+ "mwe-ok-button" : "OK"
});
//update the status to 100% progress bar (no status in iframe submit)
$j('#up-progressbar' ).progressbar('value', parseInt( 100 ) );
- $j('#up-status-container').html( gM('upload-in-progress') );
+ $j('#up-status-container').html( gM('mwe-upload-in-progress') );
js_log('do iframe form submit to: ' + $j(_this.editForm).attr('target'));
_this.updateProgress( perc );
//special case update the file progress where we have data size:
$j('#up-status-container').html(
- gM('upload-stats-fileprogres', [
+ gM('mwe-upload-stats-fileprogres', [
formatSize( data.upload['loaded'] ),
formatSize( data.upload['content_length'] )
]
js_log('just have loaded (no cotent length: ' + data.upload['loaded']);
//for lack of content-length requests:
$j('#up-status-container').html(
- gM('upload-stats-fileprogres', [
+ gM('mwe-upload-stats-fileprogres', [
formatSize( data.upload['loaded'] ),
- gM('upload-unknown-size')
+ gM('mwe-upload-unknown-size')
]
)
);
if( apiRes.error || ( apiRes.upload && apiRes.upload.result == "Failure" ) ){
//gennerate the error button:
var bObj = {};
- bObj[ gM('return-to-form') ] = function(){
+ bObj[ gM('mwe-return-to-form') ] = function(){
_this.form_post_override = false;
$j(this).dialog('close');
};
if( apiRes.upload.error == 'internal-error'){
errorKey = apiRes.upload.details[0];
gMsgLoadRemote(errorKey, function(){
- _this.updateProgressWin( gM( 'uploaderror' ), gM( errorKey ), bObj );
+ _this.updateProgressWin( gM( 'mwe-uploaderror' ), gM( errorKey ), bObj );
});
return false;
}
- _this.updateProgressWin( gM('uploaderror'), gM('unknown-error') + '<br>' + error_msg, bObj );
+ _this.updateProgressWin( gM('mwe-uploaderror'), gM('mwe-unknown-error') + '<br>' + error_msg, bObj );
return false;
}else{
if(apiRes.error && apiRes.error.info ){
- _this.updateProgressWin( gM('uploaderror'), apiRes.error.info ,bObj);
+ _this.updateProgressWin( gM('mwe-uploaderror'), apiRes.error.info ,bObj);
return false;
}else{
if(typeof error_code == 'number' && typeof error_msg_key[error_code] == 'undefined' ){
if(apiRes.upload.code.finalExt){
- _this.updateProgressWin( gM('uploaderror'), gM('wgfogg_waring_bad_extension', apiRes.upload.code.finalExt) , bObj);
+ _this.updateProgressWin( gM('mwe-uploaderror'), gM('mwe-wgfogg_warning_bad_extension', apiRes.upload.code.finalExt) , bObj);
}else{
- _this.updateProgressWin( gM('uploaderror'), gM('unknown-error') + ' : ' + error_code, bObj);
+ _this.updateProgressWin( gM('mwe-uploaderror'), gM('mwe-unknown-error') + ' : ' + error_code, bObj);
}
}else{
js_log('get key: ' + error_msg_key[ error_code ])
gMsgLoadRemote( error_msg_key[ error_code ], function(){
- _this.updateProgressWin( gM('uploaderror'), gM( error_msg_key[ error_code ], errorReplaceArg ), bObj);
+ _this.updateProgressWin( gM('mwe-uploaderror'), gM( error_msg_key[ error_code ], errorReplaceArg ), bObj);
});
- js_log("api.erorr");
+ js_log("api.error");
}
return false;
}
//check for upload.error type erros.
if( apiRes.upload && apiRes.upload.error){
js_log(' apiRes.upload.error: ' + apiRes.upload.error );
- _this.updateProgressWin( gM('uploaderror'), gM('unknown-error') + '<br>', bObj);
+ _this.updateProgressWin( gM('mwe-uploaderror'), gM('mwe-unknown-error') + '<br>', bObj);
return false;
}
//check for known warnings:
case 'duplicate':
case 'exists':
if(winfo[1] && winfo[1].title && winfo[1].title.mTextform){
- wmsg += gM('file-exists-duplicate') +' '+
+ wmsg += gM('mwe-file-exists-duplicate') +' '+
'<b>' + winfo[1].title.mTextform + '</b>';
}else{
//misc error (weird that winfo[1] not present
- wmsg += gM('upload-misc-error') + ' ' + wtype;
+ wmsg += gM('mwe-upload-misc-error') + ' ' + wtype;
}
break;
case 'file-thumbnail-no':
- wmsg += gM('file-thumbnail-no', winfo);
+ wmsg += gM('mwe-file-thumbnail-no', winfo);
break;
default:
- wmsg += gM('upload-misc-error') + ' ' + wtype;
+ wmsg += gM('mwe-upload-misc-error') + ' ' + wtype;
break;
}
wmsg+='</li>';
if( apiRes.upload.warnings.sessionkey)
_this.warnings_sessionkey = apiRes.upload.warnings.sessionkey;
var bObj = {};
- bObj[ gM('ignorewarning') ] = function() {
+ bObj[ gM('mwe-ignorewarning') ] = function() {
//re-inciate the upload proccess
$j('#wpIgnoreWarning').attr('checked', true);
$j( '#mw-upload-form' ).submit();
};
- bObj[ gM('return-to-form') ] = function(){
+ bObj[ gM('mwe-return-to-form') ] = function(){
$j(this).dialog('close');
_this.form_post_override = false;
}
- _this.updateProgressWin( gM('uploadwarning'), '<h3>' + gM('uploadwarning') + '</h3>' +wmsg + '<p>',bObj);
+ _this.updateProgressWin( gM('mwe-uploadwarning'), '<h3>' + gM('mwe-uploadwarning') + '</h3>' +wmsg + '<p>',bObj);
return false;
}
//should be "OK"
_this.done_upload_cb( url );
}else{
var bObj = {};
- bObj[ gM('return-to-form')] = function(){
+ bObj[ gM('mwe-return-to-form')] = function(){
$j(this).dialog('close');
_this.form_post_override = false;
}
- bObj[ gM('go-to-resource') ] = function(){
+ bObj[ gM('mwe-go-to-resource') ] = function(){
window.location = url;
};
_this.action_done = true;
- _this.updateProgressWin( gM('successfulupload'), gM( 'mv_upload_done', url), bObj);
+ _this.updateProgressWin( gM('mwe-successfulupload'), gM( 'mwe-upload_done', url), bObj);
js_log('apiRes.upload.imageinfo::'+url);
}
return ;
}else{
//@@todo should convice the jquery ui people to not use object keys as user msg's
var bObj = {};
- bObj[ gM('ok-button') ] = function(){
+ bObj[ gM('mwe-ok-button') ] = function(){
$j(this).dialog('close');
};
$j('#upProgressDialog').dialog('option','buttons', bObj);
}
},
getProgressTitle:function(){
- return gM('upload-in-progress');
+ return gM('mwe-upload-in-progress');
},
getEditForm:function(){
if( this.target_edit_from && $j( this.target_edit_from ).length != 0){
'<div id="up-progressbar" style="height:15px;"></div>' +
'<div id="up-status-container">'+
'<span id="up-pstatus">0% - </span> ' +
- '<span id="up-status-state">' + gM('uploaded-status') + '</span> ' +
+ '<span id="up-status-state">' + gM('mwe-uploaded-status') + '</span> ' +
'</div>'+
'</div>'
)
cancel_button:function(){
var _this = this;
var cancelBtn = new Array();
- cancelBtn[ gM('cancel-button') ] = function(){
+ cancelBtn[ gM('mwe-cancel-button') ] = function(){
return _this.cancel_action(this)
};
return cancelBtn;
},
cancel_action : function( dlElm ){
//confirm:
- if( confirm( gM('mv-cancel-confim') )){
+ if( confirm( gM('mwe-cancel-confim') )){
//@@todo (cancel the encode / upload)
$j(this).dialog('close');
return false;
"fogg-save_local_file" : "Save Ogg",
"fogg-check_for_fogg" : "Checking for Firefogg <blink>...<\/blink>",
"fogg-installed" : "Firefogg is installed",
- "fogg-for_improved_uplods" : "For improved uploads : ",
- "fogg-please_install" : "<a href=\"$1\">Install Firefogg<\/a>. More <a href=\"http : \/\/commons.wikimedia.org\/wiki\/Commons : Firefogg\">about Firefogg<\/a>",
- "fogg-use_latest_fox" : "Please first install <a href=\"http : \/\/www.mozilla.com\/en-US\/firefox\/upgrade.html?from=firefogg\">Firefox 3.5<\/a> (or later). <i>Then revisit this page to install the <b>Firefogg<\/b> extension.<\/i>",
+ "fogg-for_improved_uplods" : "For improved uploads:",
+ "fogg-please_install" : "<a href=\"$1\">Install Firefogg<\/a>. More <a href=\"http:\/\/commons.wikimedia.org\/wiki\/Commons:Firefogg\">about Firefogg<\/a>",
+ "fogg-use_latest_fox" : "Please first install <a href=\"http:\/\/www.mozilla.com\/en-US\/firefox\/upgrade.html?from=firefogg\">Firefox 3.5<\/a> (or later). <i>Then revisit this page to install the <b>Firefogg<\/b> extension.<\/i>",
"fogg-passthrough_mode" : "Your selected file is already Ogg or not a video file",
"fogg-transcoding" : "Encoding video to Ogg",
"fogg-encoding-done" : "Encoding complete",
if( !this.form_rewrite )
return gM('fogg-transcoding');
//else return our upload+transcode msg:
- return gM('upload-transcode-in-progress');
+ return gM('mwe-upload-transcode-in-progress');
},
doUploadSwitch:function(){
var _this = this;
//show transcode status:
- $j('#up-status-state').html( gM('upload-transcoded-status') );
+ $j('#up-status-state').html( gM('mwe-upload-transcoded-status') );
//setup a local function for timed callback:
var encodingStatus = function() {
},
doUploadStatus:function() {
var _this = this;
- $j( '#up-status-state' ).html( gM('uploaded-status') );
+ $j( '#up-status-state' ).html( gM('mwe-uploaded-status') );
_this.oldResponseText = '';
//setup a local function for timed callback:
if( _this.upload_mode == 'api' ){
if( apiResult.resultUrl ){
var buttons ={};
- buttons[gM('go-to-resource')] = function(){
+ buttons[gM('mwe-go-to-resource')] = function(){
window.location = apiResult.resultUrl;
}
- var go_to_url_txt = gM('go-to-resource');
+ var go_to_url_txt = gM('mwe-go-to-resource');
if( typeof _this.done_upload_cb == 'function' ){
//if done action return 'true'
if( _this.done_upload_cb() ){
//update status
- _this.updateProgressWin( gM('successfulupload'), gM( 'mv_upload_done', apiResult.resultUrl),buttons);
+ _this.updateProgressWin( gM('mwe-successfulupload'), gM( 'mwe-upload_done', apiResult.resultUrl),buttons);
}else{
//if done action returns 'false' //close progress window
this.action_done = true;
}
}else{
//update status (without done_upload_cb)
- _this.updateProgressWin( gM('successfulupload'), gM( 'mv_upload_done', apiResult.resultUrl),buttons);
+ _this.updateProgressWin( gM('mwe-successfulupload'), gM( 'mwe-upload_done', apiResult.resultUrl),buttons);
}
}else{
//done state with error? ..not really possible given how firefogg works
- js_log(" upload done, in chunks mode, but no resultUrl!");
+ js_log(" Upload done in chunks mode, but no resultUrl!");
}
}else if( _this.upload_mode == 'post' && _this.api_url ) {
_this.procPageResponse( response_text );
return this.pe_cancel_action();
}
js_log('firefogg:cancel')
- if( confirm( gM('mv-cancel-confim') )){
+ if( confirm( gM('mwe-cancel-confim') )){
if(navigator.oscpu && navigator.oscpu.search('Win') >= 0){
alert( 'sorry we do not yet support cancel on windows' );
}else{
var sstring = 'var wgTitle = "' + this.formData['wpDestFile'].replace('_',' ');
if(wgArticlePath){
- var result_txt = gM('mv_upload_done', wgArticlePath.replace(/\$1/, 'File:' + _this.formData['wpDestFile'] ) );
+ var result_txt = gM('mwe-upload_done', wgArticlePath.replace(/\$1/, 'File:' + _this.formData['wpDestFile'] ) );
}else{
- result_txt = 'File has uploaded but api "done" url was provided. Check the log for result page output';
+ result_txt = 'File has uploaded but api "done" URL was provided. Check the log for result page output';
}
//set the error text in case we dont' get far along in processing the response
- _this.updateProgressWin( gM('mv_upload_completed'), result_txt );
+ _this.updateProgressWin( gM('mwe-upload_completed'), result_txt );
if( result_page && result_page.toLowerCase().indexOf( sstring.toLowerCase() ) != -1){
js_log( 'upload done got redirect found: ' + sstring + ' r:' + _this.done_upload_cb );
"mv_custom_title" : "Custom title",
"mv_edit_properties" : "Edit properties",
"mv_other_properties" : "Other properties",
- "mv_resource_page" : "Resource page : ",
+ "mv_resource_page" : "Resource page:",
"mv_set_in_out_points" : "Set in-out points",
"mv_start_time" : "Start time",
"mv_end_time" : "End time",
'<h3>Edit tools</h3>' +
'<div class="mv_edit_button mv_crop_button_base" id="mv_crop_button" alt="crop" title="'+gM('mv_crop')+'"/>'+
'<a href="#" class="mv_crop_msg">' + gM('mv_crop') + '</a> '+
- '<span style="display:none" class="mv_crop_msg_load">' + gM('loading_txt') + '</span> '+
+ '<span style="display:none" class="mv_crop_msg_load">' + gM('mwe-loading_txt') + '</span> '+
'<a href="#" style="display:none" class="mv_apply_crop">' + gM('mv_apply_crop') + '</a> '+
'<a href="#" style="display:none" class="mv_rest_crop">' + gM('mv_reset_crop') + '</a> '+
'<hr style="clear:both"/><br>'+
"loading_plugin" : "loading plugin <blink>...<\/blink>",
"select_playback" : "Set playback preference",
"link_back" : "Link back",
- "error_load_lib" : "Error : mv_embed was unable to load required JavaScript libraries.\nInsert script via DOM has failed. Please try reloading this page.",
- "error_swap_vid" : "Error : mv_embed was unable to swap the video tag for the mv_embed interface",
+ "error_load_lib" : "Error: mv_embed was unable to load required JavaScript libraries.\nInsert script via DOM has failed. Please try reloading this page.",
+ "error_swap_vid" : "Error: mv_embed was unable to swap the video tag for the mv_embed interface",
"add_to_end_of_sequence" : "Add to end of sequence",
"missing_video_stream" : "The video file for this stream is missing",
"play_clip" : "Play clip",
"prev_clip_msg" : "Play previous clip",
"current_clip_msg" : "Continue playing this clip",
"seek_to" : "Seek to",
- "download_segment" : "Download selection : ",
- "download_full" : "Download full video file : ",
+ "download_segment" : "Download selection:",
+ "download_full" : "Download full video file:",
"download_right_click" : "To download, right click and select <i>Save target as...<\/i>",
"download_clip" : "Download video",
- "download_text" : "Download text (<a style=\"color : white\" title=\"cmml\" href=\"http : \/\/wiki.xiph.org\/index.php\/CMML\">CMML<\/a> xml) : ",
+ "download_text" : "Download text (<a style=\"color:white\" title=\"cmml\" href=\"http:\/\/wiki.xiph.org\/index.php\/CMML\">CMML<\/a> xml):",
"download" : "Download",
"share" : "Share",
"credits" : "Credits",
"mv_ogg-player-flowplayer" : "Flowplayer",
"mv_ogg-player-selected" : " (selected)",
"mv_ogg-player-omtkplayer" : "OMTK Flash Vorbis",
- "mv_generic_missing_plugin" : "You browser does not appear to support the following playback type : <b>$1<\/b><br \/>Visit the <a href=\"http : \/\/commons.wikimedia.org\/wiki\/Commons : Media_help\">Playback Methods<\/a> page to download a player.<br \/>",
- "mv_for_best_experience" : "For a better video playback experience we recommend : <br \/><b><a href=\"http : \/\/www.mozilla.com\/en-US\/firefox\/upgrade.html?from=mwEmbed\">Firefox 3.5<\/a>.<\/b>",
+ "mv_generic_missing_plugin" : "You browser does not appear to support the following playback type: <b>$1<\/b><br \/>Visit the <a href=\"http:\/\/commons.wikimedia.org\/wiki\/Commons:Media_help\">Playback Methods<\/a> page to download a player.<br \/>",
+ "mv_for_best_experience" : "For a better video playback experience we recommend:<br \/><b><a href=\"http:\/\/www.mozilla.com\/en-US\/firefox\/upgrade.html?from=mwEmbed\">Firefox 3.5<\/a>.<\/b>",
"mv_do_not_warn_again" : "Dissmiss for now.",
"playerselect" : "Players"
});
function(){
//animation done.. add "loading" to div if empty
if($j('#liks_info_'+_this.id).html()==''){
- $j('#liks_info_'+_this.id).html(gM('loading_txt'));
+ $j('#liks_info_'+_this.id).html(gM('mwe-loading_txt'));
}
}
)
doLinkBack:function(){
if(this.roe && this.media_element.addedROEData==false){
var _this = this;
- this.displayHTML(gM('loading_txt'));
+ this.displayHTML(gM('mwe-loading_txt'));
do_request(this.roe, function(data)
{
_this.media_element.addROE(data);
'height:'+ parseInt( this.height )+'px;width:400px;' +
'display:none;" ' +
'id="metaBox_' + this.id + '">'+
- gM('loading_txt') +
+ gM('mwe-loading_txt') +
'</div>');
}
//fade in the text display
//js_log('f:showVideoDownload '+ this.roe + ' ' + this.media_element.addedROEData);
if(this.roe && this.media_element.addedROEData == false){
var _this = this;
- this.displayHTML(gM('loading_txt'));
+ this.displayHTML(gM('mwe-loading_txt'));
do_request(this.roe, function(data)
{
_this.media_element.addROE(data);
"mv_advanced_editor_desc" : "advanced editor (Final Cut style)",
"mv_other_options" : "Other options",
"mv_contextmenu_opt" : "Enable context menus",
- "mv_sequencer_credit_line" : "Developed by <a href=\"http : \/\/kaltura.com\">Kaltura, Inc.<\/a> in partnership with the <a href=\"http : \/\/wikimediafoundation.org\/wiki\/Home\">Wikimedia Foundation<\/a> (<a href=\"#\">more information<\/a>)."
+ "mv_sequencer_credit_line" : "Developed by <a href=\"http:\/\/kaltura.com\">Kaltura, Inc.<\/a> in partnership with the <a href=\"http:\/\/wikimediafoundation.org\/wiki\/Home\">Wikimedia Foundation<\/a> (<a href=\"#\">more information<\/a>)."
});
//used to set default values and validate the passed init object
var sequencerDefaultValues = {
},
'cliplib':{
'd':0,
- 'html': gM('loading_txt'),
+ 'html': gM('mwe-loading_txt'),
'js':function( this_seq ){
//load the search interface with sequence tool targets
mvJsLoader.doLoad( [
'right:0px;bottom:0px;' +
'height:'+(this.pe.height-30)+
'px;overflow:auto;"><span style="display:none;" id="mv_txt_load_' + this.pe.id + '">'+
- gM('loading_txt')+'</span>' +
+ gM('mwe-loading_txt')+'</span>' +
'</div>';
},
getTsSelect:function(){
//all default msg in [English] should be overwritten by the CMS language msg system.
loadGM({
- "loading_txt" : "loading <blink>...<\/blink>",
- "loading_title" : "Loading...",
- "size-gigabytes" : "$1 GB",
- "size-megabytes" : "$1 MB",
- "size-kilobytes" : "$1 K",
- "size-bytes" : "$1 B"
+ "mwe-loading_txt" : "loading <blink>...<\/blink>",
+ "mwe-loading_title" : "Loading...",
+ "mwe-size-gigabytes" : "$1 GB",
+ "mwe-size-megabytes" : "$1 MB",
+ "mwe-size-kilobytes" : "$1 K",
+ "mwe-size-bytes" : "$1 B"
});
/**
round = 2;
if( size > 1024 ) {
size = size / 1024;
- msg = 'size-gigabytes';
+ msg = 'mwe-size-gigabytes';
} else {
- msg = 'size-megabytes';
+ msg = 'mwe-size-megabytes';
}
} else {
- msg = 'size-kilobytes';
+ msg = 'mwe-size-kilobytes';
}
} else {
- msg = 'size-bytes';
+ msg = 'mwe-size-bytes';
}
//javascript does not let you do precession points in rounding
var p = Math.pow(10,round);
//make sure we have jQuery
_this.jQueryCheck(function(){
- $j('.videonojs').html( gM('loading_txt') );
+ $j('.videonojs').html( gM('mwe-loading_txt') );
var depReq = [
[
'$j.ui',
(function($) {
$.fn.addMediaWiz = function( iObj, callback ){
//first set the cursor for the button to "loading"
- $j(this.selector).css('cursor','wait').attr('title', gM('loading_title'));
+ $j(this.selector).css('cursor','wait').attr('title', gM('mwe-loading_title'));
iObj['target_invocation'] = this.selector;
/*
* js file: /libAddMedia/mvBaseUploadInterface.js
*/
- 'upload-transcode-in-progress' => 'Transcode and upload in progress (do not close this window)',
- 'upload-in-progress' => 'Upload in progress (do not close this window)',
- 'upload-transcoded-status' => 'Transcoded',
- 'uploaded-status' => 'Uploaded',
- 'wgfogg_wrong_version' => 'You have Firefogg installed but it is outdated. <a href="http://firefogg.org">Please upgrade</a>.',
- 'upload-stats-fileprogres' => '$1 of $2',
- 'mv_upload_completed' => 'Your upload is complete',
- 'mv_upload_done' => '<a href="$1">Your upload <i>should be</i> accessible</a>.',
- 'upload-unknown-size' => 'Unknown size',
- 'mv-cancel-confim' => 'Are you sure you want to cancel?',
- 'successfulupload' => 'Upload successful',
- 'uploaderror' => 'Upload error',
- 'uploadwarning' => 'Upload warning',
- 'unknown-error' => 'Unknown error:',
- 'return-to-form' => 'Return to form',
- 'file-exists-duplicate' => 'This file is a duplicate of the following file:',
- 'fileexists' => 'A file with this name exists already. Please check <b><tt>$1</tt></b> if you are not sure if you want to change it.',
- 'fileexists-thumb' => '<center><b>Existing file</b></center>',
- 'ignorewarning' => 'Ignore warning and save file anyway',
- 'file-thumbnail-no' => 'The filename begins with <b><tt>$1</tt></b>',
- 'go-to-resource' => 'Go to resource page',
- 'upload-misc-error' => 'Unknown upload error',
- 'wgfogg_waring_bad_extension' => 'You have selected a file with an unsuported extension (<a href="http://commons.wikimedia.org/wiki/Commons:Firefogg#Supported_File_Types">more information</a>).',
- 'cancel-button' => 'Cancel',
- 'ok-button' => 'OK',
+ 'mwe-upload-transcode-in-progress' => 'Transcode and upload in progress (do not close this window)',
+ 'mwe-upload-in-progress' => 'Upload in progress (do not close this window)',
+ 'mwe-upload-transcoded-status' => 'Transcoded',
+ 'mwe-uploaded-status' => 'Uploaded',
+ 'mwe-upload-stats-fileprogres' => '$1 of $2',
+ 'mwe-upload_completed' => 'Your upload is complete',
+ 'mwe-upload_done' => '<a href="$1">Your upload <i>should be</i> accessible</a>.',
+ 'mwe-upload-unknown-size' => 'Unknown size',
+ 'mwe-cancel-confim' => 'Are you sure you want to cancel?',
+ 'mwe-successfulupload' => 'Upload successful',
+ 'mwe-uploaderror' => 'Upload error',
+ 'mwe-uploadwarning' => 'Upload warning',
+ 'mwe-unknown-error' => 'Unknown error:',
+ 'mwe-return-to-form' => 'Return to form',
+ 'mwe-file-exists-duplicate' => 'This file is a duplicate of the following file:',
+ 'mwe-fileexists' => 'A file with this name exists already. Please check <b><tt>$1</tt></b> if you are not sure if you want to change it.',
+ 'mwe-fileexists-thumb' => '<center><b>Existing file</b></center>',
+ 'mwe-ignorewarning' => 'Ignore warning and save file anyway',
+ 'mwe-file-thumbnail-no' => 'The filename begins with <b><tt>$1</tt></b>',
+ 'mwe-go-to-resource' => 'Go to resource page',
+ 'mwe-upload-misc-error' => 'Unknown upload error',
+ 'mwe-wgfogg_warning_bad_extension' => 'You have selected a file with an unsuported extension (<a href="http://commons.wikimedia.org/wiki/Commons:Firefogg#Supported_File_Types">more information</a>).',
+ 'mwe-cancel-button' => 'Cancel',
+ 'mwe-ok-button' => 'OK',
/*
* js file: /libAddMedia/mvAdvFirefogg.js
'mv_generic_missing_plugin' => 'You browser does not appear to support the following playback type: <b>$1</b><br />Visit the <a href="http://commons.wikimedia.org/wiki/Commons:Media_help">Playback Methods</a> page to download a player.<br />',
'mv_for_best_experience' => 'For a better video playback experience we recommend:<br /><b><a href="http://www.mozilla.com/en-US/firefox/upgrade.html?from=mwEmbed">Firefox 3.5</a>.</b>',
'mv_do_not_warn_again' => 'Dissmiss for now.',
- 'players' => 'Players',
+ 'playerselect' => 'Players',
/*
* js file: /libClipEdit/mvClipEdit.js
/*
* js file: /mv_embed.js
*/
- 'loading_txt' => 'loading <blink>...</blink>',
- 'loading_title' => 'Loading...',
- 'size-gigabytes' => '$1 GB',
- 'size-megabytes' => '$1 MB',
- 'size-kilobytes' => '$1 K',
- 'size-bytes' => '$1 B',
+ 'mwe-loading_txt' => 'loading <blink>...</blink>',
+ 'mwe-loading_title' => 'Loading...',
+ 'mwe-size-gigabytes' => '$1 GB',
+ 'mwe-size-megabytes' => '$1 MB',
+ 'mwe-size-kilobytes' => '$1 K',
+ 'mwe-size-bytes' => '$1 B',
);
/*
* uploadPage.js to be run on specialUpload page.
- * controls the invocation of the mvUploader class based on local config.
- */
+ * controls the invocation of the mvUploader class based on local config.
+ */
js2AddOnloadHook( function(){
- mwUploadHelper.init();
+ mwUploadHelper.init();
});
var mwUploadFormTarget = '#mw-upload-form';
//set up the upoload form bindings once all dom manipluation is done
firefogg_installed:false,
init:function(){
var _this = this;
- //if not boolean false set to true:
+ //if not boolean false set to true:
if(typeof wgEnableFirefogg == 'undefined')
wgEnableFirefogg = true;
-
+
if( wgEnableFirefogg ){
- //setup the upload handler to firefogg (supports our upload proccess) (should work with the http uploads too)
- $j('#wpUploadFile').firefogg({
+ //setup the upload handler to firefogg (supports our upload proccess) (should work with the http uploads too)
+ $j('#wpUploadFile').firefogg({
//an api url (we won't submit directly to action of the form)
'api_url' : wgServer + wgScriptPath + '/api.php',
- 'form_rewrite': true,
- 'target_edit_from' : mwUploadFormTarget,
- 'new_source_cb' : function( orgFilename, oggName ){
+ 'form_rewrite': true,
+ 'target_edit_from' : mwUploadFormTarget,
+ 'new_source_cb' : function( orgFilename, oggName ){
if($j('#wpDestFile').val() == "")
$j('#wpDestFile').val( oggName );
mwUploadHelper.doDestCheck();
_this.firefogg_installed=false;
}
}
- });
-
- }else{
- //Add basic upload profile support ( http status monitoring, progress box for browsers that support it etc.)
+ });
+
+ }else{
+ //Add basic upload profile support ( http status monitoring, progress box for browsers that support it etc.)
if($j('#wpUploadFileURL').length != 0){
- $j('#wpUploadFileURL').baseUploadInterface({
+ $j('#wpUploadFileURL').baseUploadInterface({
'api_url' : wgServer + wgScriptPath + '/api.php',
'target_edit_from' : mwUploadFormTarget
- });
+ });
}
}
-
+
if( wgAjaxUploadDestCheck ){
- //do destination check:
+ //do destination check:
$j('#wpDestFile').change( mwUploadHelper.doDestCheck );
}
-
+
//check if we have http enabled & setup enable/disable toggle:
- if($j('#wpUploadFileURL').length != 0){
- //set the initial toggleUpType
- _this.toggleUpType(true);
-
- $j("input[name='wpSourceType']").click(function(){
+ if($j('#wpUploadFileURL').length != 0){
+ //set the initial toggleUpType
+ _this.toggleUpType(true);
+
+ $j("input[name='wpSourceType']").click(function(){
_this.toggleUpType( this.id == 'wpSourceTypeFile' );
- });
- }
- $j('#wpUploadFile,#wpUploadFileURL').focus(function(){
- _this.toggleUpType( this.id == 'wpUploadFile' );
- }).change(function(){ //also setup the onChange event binding:
+ });
+ }
+ $j('#wpUploadFile,#wpUploadFileURL').focus(function(){
+ _this.toggleUpType( this.id == 'wpUploadFile' );
+ }).change(function(){ //also setup the onChange event binding:
if ( wgUploadAutoFill ) {
- mwUploadHelper.doDestinationFill( this );
- }
- });
+ mwUploadHelper.doDestinationFill( this );
+ }
+ });
},
/**
* toggleUpType sets the upload radio buttons
- *
- * boolean set
- */
+ *
+ * boolean set
+ */
toggleUpType:function( set ){
$j('#wpSourceTypeFile').attr('checked', set);
$j('#wpUploadFile').attr('disabled', !set);
-
+
$j('#wpSourceTypeURL').attr('checked', !set);
$j('#wpUploadFileURL').attr('disabled', set);
-
- //if firefogg is enbaled: toggle action per form select of http upload vs firefogg upload
+
+ //if firefogg is enbaled: toggle action per form select of http upload vs firefogg upload
if( wgEnableFirefogg ){
$j('#wpUploadFile').firefogg({
'firefogg_form_action': $j('#wpSourceTypeFile').attr('checked')
});
}
- },
+ },
/**
* doDestCheck checks the destination
*/
- doDestCheck:function(){
+ doDestCheck:function(){
var _this = this;
$j('#wpDestFile-warning').empty();
//show loading
$j('#wpDestFile').after('<img id = "mw-spinner-wpDestFile" src ="'+ stylepath + '/common/images/spinner.gif" />');
- //try and get a thumb of the current file (check its destination)
+ //try and get a thumb of the current file (check its destination)
do_api_req({
- 'data':{
+ 'data':{
'titles': 'File:' + $j('#wpDestFile').val(),//@@todo we may need a more clever way to get a the filename
'prop': 'imageinfo',
'iiprop':'url|mime|size',
- 'iiurlwidth': 150
+ 'iiurlwidth': 150
},
'url': _this.api_url
},function(data){
//remove spinner:
- $j('#mw-spinner-wpDestFile').remove();
+ $j('#mw-spinner-wpDestFile').remove();
if(data && data.query && data.query.pages){
if( data.query.pages[-1] ){
//all good no file there
var ntitle = data.query.normalized[0].to;
}else{
var ntitle = data.query.pages[ page_id ].title;
- }
- var img = data.query.pages[ page_id ].imageinfo[0];
+ }
+ var img = data.query.pages[ page_id ].imageinfo[0];
$j('#wpDestFile-warning').html(
'<ul>' +
'<li>'+
- gM('fileexists', ntitle) +
+ gM('mwe-fileexists', ntitle) +
'</li>'+
'<div class="thumb tright">' +
'<div style="width: ' + ( parseInt(img.thumbwidth)+2 ) + 'px;" class="thumbinner">' +
'src="' + stylepath + "/common/images/magnify-clip.png\" />" +
'</a>'+
'</div>'+
- gM('fileexists-thumb') +
+ gM('mwe-fileexists-thumb') +
'</div>' +
'</div>'+
'</div>' +
}
}
}
- });
+ });
},
/**
- * doDestinationFill fills in a destination file-name based on a source asset name.
+ * doDestinationFill fills in a destination file-name based on a source asset name.
*/
doDestinationFill:function( targetElm ){
js_log("doDestinationFill")
//remove any previously flagged errors
- $j('#mw-upload-permitted,#mw-upload-prohibited').hide();
-
+ $j('#mw-upload-permitted,#mw-upload-prohibited').hide();
+
var path = $j(targetElm).val();
// Find trailing part
var slash = path.lastIndexOf('/');
fname = path.substring(slash+1, 10000);
} else {
fname = path.substring(backslash+1, 10000);
- }
+ }
//urls are less likely to have a usefull extension don't include them in the extention check
- if( wgFileExtensions && $j(targetElm).attr('id') != 'wpUploadFileURL' ){
- var found = false;
- if( fname.lastIndexOf('.')!=-1 ){
- var ext = fname.substr( fname.lastIndexOf('.')+1 );
- for(var i=0; i < wgFileExtensions.length; i++){
+ if( wgFileExtensions && $j(targetElm).attr('id') != 'wpUploadFileURL' ){
+ var found = false;
+ if( fname.lastIndexOf('.')!=-1 ){
+ var ext = fname.substr( fname.lastIndexOf('.')+1 );
+ for(var i=0; i < wgFileExtensions.length; i++){
if( wgFileExtensions[i].toLowerCase() == ext.toLowerCase() )
found = true;
}
if(!found){
//clear the upload set mw-upload-permitted to error
$j(targetElm).val('');
- $j('#mw-upload-permitted,#mw-upload-prohibited').show().addClass('error');
- //clear the wpDestFile as well:
- $j('#wpDestFile').val('');
+ $j('#mw-upload-permitted,#mw-upload-prohibited').show().addClass('error');
+ //clear the wpDestFile as well:
+ $j('#wpDestFile').val('');
return false;
- }
- }
+ }
+ }
// Capitalise first letter and replace spaces by underscores
- fname = fname.charAt(0).toUpperCase().concat(fname.substring(1,10000)).replace(/ /g, '_');
+ fname = fname.charAt(0).toUpperCase().concat(fname.substring(1,10000)).replace(/ /g, '_');
// Output result
$j('#wpDestFile').val( fname );
-
- //do a destination check
+
+ //do a destination check
this.doDestCheck();
}
}
-
+