Index: trunk/phase3/js2/mwEmbed/libAddMedia/mvFirefogg.js |
— | — | @@ -9,9 +9,9 @@ |
10 | 10 | "fogg-save_local_file" : "Save Ogg", |
11 | 11 | "fogg-check_for_fogg" : "Checking for Firefogg <blink>...<\/blink>", |
12 | 12 | "fogg-installed" : "Firefogg is installed", |
13 | | - "fogg-for_improved_uplods" : "For improved uploads : ", |
14 | | - "fogg-please_install" : "<a href=\"$1\">Install Firefogg<\/a>. More <a href=\"http : \/\/commons.wikimedia.org\/wiki\/Commons : Firefogg\">about Firefogg<\/a>", |
15 | | - "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>", |
| 13 | + "fogg-for_improved_uplods" : "For improved uploads:", |
| 14 | + "fogg-please_install" : "<a href=\"$1\">Install Firefogg<\/a>. More <a href=\"http:\/\/commons.wikimedia.org\/wiki\/Commons:Firefogg\">about Firefogg<\/a>", |
| 15 | + "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>", |
16 | 16 | "fogg-passthrough_mode" : "Your selected file is already Ogg or not a video file", |
17 | 17 | "fogg-transcoding" : "Encoding video to Ogg", |
18 | 18 | "fogg-encoding-done" : "Encoding complete", |
— | — | @@ -430,7 +430,7 @@ |
431 | 431 | if( !this.form_rewrite ) |
432 | 432 | return gM('fogg-transcoding'); |
433 | 433 | //else return our upload+transcode msg: |
434 | | - return gM('upload-transcode-in-progress'); |
| 434 | + return gM('mwe-upload-transcode-in-progress'); |
435 | 435 | }, |
436 | 436 | doUploadSwitch:function(){ |
437 | 437 | var _this = this; |
— | — | @@ -529,7 +529,7 @@ |
530 | 530 | |
531 | 531 | |
532 | 532 | //show transcode status: |
533 | | - $j('#up-status-state').html( gM('upload-transcoded-status') ); |
| 533 | + $j('#up-status-state').html( gM('mwe-upload-transcoded-status') ); |
534 | 534 | |
535 | 535 | //setup a local function for timed callback: |
536 | 536 | var encodingStatus = function() { |
— | — | @@ -578,7 +578,7 @@ |
579 | 579 | }, |
580 | 580 | doUploadStatus:function() { |
581 | 581 | var _this = this; |
582 | | - $j( '#up-status-state' ).html( gM('uploaded-status') ); |
| 582 | + $j( '#up-status-state' ).html( gM('mwe-uploaded-status') ); |
583 | 583 | |
584 | 584 | _this.oldResponseText = ''; |
585 | 585 | //setup a local function for timed callback: |
— | — | @@ -630,15 +630,15 @@ |
631 | 631 | if( _this.upload_mode == 'api' ){ |
632 | 632 | if( apiResult.resultUrl ){ |
633 | 633 | var buttons ={}; |
634 | | - buttons[gM('go-to-resource')] = function(){ |
| 634 | + buttons[gM('mwe-go-to-resource')] = function(){ |
635 | 635 | window.location = apiResult.resultUrl; |
636 | 636 | } |
637 | | - var go_to_url_txt = gM('go-to-resource'); |
| 637 | + var go_to_url_txt = gM('mwe-go-to-resource'); |
638 | 638 | if( typeof _this.done_upload_cb == 'function' ){ |
639 | 639 | //if done action return 'true' |
640 | 640 | if( _this.done_upload_cb() ){ |
641 | 641 | //update status |
642 | | - _this.updateProgressWin( gM('successfulupload'), gM( 'mv_upload_done', apiResult.resultUrl),buttons); |
| 642 | + _this.updateProgressWin( gM('mwe-successfulupload'), gM( 'mwe-upload_done', apiResult.resultUrl),buttons); |
643 | 643 | }else{ |
644 | 644 | //if done action returns 'false' //close progress window |
645 | 645 | this.action_done = true; |
— | — | @@ -646,11 +646,11 @@ |
647 | 647 | } |
648 | 648 | }else{ |
649 | 649 | //update status (without done_upload_cb) |
650 | | - _this.updateProgressWin( gM('successfulupload'), gM( 'mv_upload_done', apiResult.resultUrl),buttons); |
| 650 | + _this.updateProgressWin( gM('mwe-successfulupload'), gM( 'mwe-upload_done', apiResult.resultUrl),buttons); |
651 | 651 | } |
652 | 652 | }else{ |
653 | 653 | //done state with error? ..not really possible given how firefogg works |
654 | | - js_log(" upload done, in chunks mode, but no resultUrl!"); |
| 654 | + js_log(" Upload done in chunks mode, but no resultUrl!"); |
655 | 655 | } |
656 | 656 | }else if( _this.upload_mode == 'post' && _this.api_url ) { |
657 | 657 | _this.procPageResponse( response_text ); |
— | — | @@ -667,7 +667,7 @@ |
668 | 668 | return this.pe_cancel_action(); |
669 | 669 | } |
670 | 670 | js_log('firefogg:cancel') |
671 | | - if( confirm( gM('mv-cancel-confim') )){ |
| 671 | + if( confirm( gM('mwe-cancel-confim') )){ |
672 | 672 | if(navigator.oscpu && navigator.oscpu.search('Win') >= 0){ |
673 | 673 | alert( 'sorry we do not yet support cancel on windows' ); |
674 | 674 | }else{ |
— | — | @@ -689,13 +689,13 @@ |
690 | 690 | var sstring = 'var wgTitle = "' + this.formData['wpDestFile'].replace('_',' '); |
691 | 691 | |
692 | 692 | if(wgArticlePath){ |
693 | | - var result_txt = gM('mv_upload_done', wgArticlePath.replace(/\$1/, 'File:' + _this.formData['wpDestFile'] ) ); |
| 693 | + var result_txt = gM('mwe-upload_done', wgArticlePath.replace(/\$1/, 'File:' + _this.formData['wpDestFile'] ) ); |
694 | 694 | }else{ |
695 | | - result_txt = 'File has uploaded but api "done" url was provided. Check the log for result page output'; |
| 695 | + result_txt = 'File has uploaded but api "done" URL was provided. Check the log for result page output'; |
696 | 696 | } |
697 | 697 | |
698 | 698 | //set the error text in case we dont' get far along in processing the response |
699 | | - _this.updateProgressWin( gM('mv_upload_completed'), result_txt ); |
| 699 | + _this.updateProgressWin( gM('mwe-upload_completed'), result_txt ); |
700 | 700 | |
701 | 701 | if( result_page && result_page.toLowerCase().indexOf( sstring.toLowerCase() ) != -1){ |
702 | 702 | js_log( 'upload done got redirect found: ' + sstring + ' r:' + _this.done_upload_cb ); |
Index: trunk/phase3/js2/mwEmbed/libAddMedia/mvBaseUploadInterface.js |
— | — | @@ -4,31 +4,30 @@ |
5 | 5 | * this base uploader is optionally extended by firefogg |
6 | 6 | */ |
7 | 7 | loadGM({ |
8 | | - "upload-transcode-in-progress" : "Transcode and upload in progress (do not close this window)", |
9 | | - "upload-in-progress" : "Upload in progress (do not close this window)", |
10 | | - "upload-transcoded-status" : "Transcoded", |
11 | | - "uploaded-status" : "Uploaded", |
12 | | - "wgfogg_wrong_version" : "You have Firefogg installed but it is outdated. <a href=\"http : \/\/firefogg.org\">Please upgrade<\/a>.", |
13 | | - "upload-stats-fileprogres" : "$1 of $2", |
14 | | - "mv_upload_completed" : "Your upload is complete", |
15 | | - "mv_upload_done" : "<a href=\"$1\">Your upload <i>should be<\/i> accessible<\/a>.", |
16 | | - "upload-unknown-size" : "Unknown size", |
17 | | - "mv-cancel-confim" : "Are you sure you want to cancel?", |
18 | | - "successfulupload" : "Upload successful", |
19 | | - "uploaderror" : "Upload error", |
20 | | - "uploadwarning" : "Upload warning", |
21 | | - "unknown-error" : "Unknown error : ", |
22 | | - "return-to-form" : "Return to form", |
23 | | - "file-exists-duplicate" : "This file is a duplicate of the following file : ", |
24 | | - "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.", |
25 | | - "fileexists-thumb" : "<center><b>Existing file<\/b><\/center>", |
26 | | - "ignorewarning" : "Ignore warning and save file anyway", |
27 | | - "file-thumbnail-no" : "The filename begins with <b><tt>$1<\/tt><\/b>", |
28 | | - "go-to-resource" : "Go to resource page", |
29 | | - "upload-misc-error" : "Unknown upload error", |
30 | | - "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>).", |
31 | | - "cancel-button" : "Cancel", |
32 | | - "ok-button" : "OK" |
| 8 | + "mwe-upload-transcode-in-progress" : "Transcode and upload in progress (do not close this window)", |
| 9 | + "mwe-upload-in-progress" : "Upload in progress (do not close this window)", |
| 10 | + "mwe-upload-transcoded-status" : "Transcoded", |
| 11 | + "mwe-uploaded-status" : "Uploaded", |
| 12 | + "mwe-upload-stats-fileprogres" : "$1 of $2", |
| 13 | + "mwe-upload_completed" : "Your upload is complete", |
| 14 | + "mwe-upload_done" : "<a href=\"$1\">Your upload <i>should be<\/i> accessible<\/a>.", |
| 15 | + "mwe-upload-unknown-size" : "Unknown size", |
| 16 | + "mwe-cancel-confim" : "Are you sure you want to cancel?", |
| 17 | + "mwe-successfulupload" : "Upload successful", |
| 18 | + "mwe-uploaderror" : "Upload error", |
| 19 | + "mwe-uploadwarning" : "Upload warning", |
| 20 | + "mwe-unknown-error" : "Unknown error:", |
| 21 | + "mwe-return-to-form" : "Return to form", |
| 22 | + "mwe-file-exists-duplicate" : "This file is a duplicate of the following file:", |
| 23 | + "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.", |
| 24 | + "mwe-fileexists-thumb" : "<center><b>Existing file<\/b><\/center>", |
| 25 | + "mwe-ignorewarning" : "Ignore warning and save file anyway", |
| 26 | + "mwe-file-thumbnail-no" : "The filename begins with <b><tt>$1<\/tt><\/b>", |
| 27 | + "mwe-go-to-resource" : "Go to resource page", |
| 28 | + "mwe-upload-misc-error" : "Unknown upload error", |
| 29 | + "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>).", |
| 30 | + "mwe-cancel-button" : "Cancel", |
| 31 | + "mwe-ok-button" : "OK" |
33 | 32 | }); |
34 | 33 | |
35 | 34 | |
— | — | @@ -209,7 +208,7 @@ |
210 | 209 | |
211 | 210 | //update the status to 100% progress bar (no status in iframe submit) |
212 | 211 | $j('#up-progressbar' ).progressbar('value', parseInt( 100 ) ); |
213 | | - $j('#up-status-container').html( gM('upload-in-progress') ); |
| 212 | + $j('#up-status-container').html( gM('mwe-upload-in-progress') ); |
214 | 213 | |
215 | 214 | js_log('do iframe form submit to: ' + $j(_this.editForm).attr('target')); |
216 | 215 | |
— | — | @@ -381,7 +380,7 @@ |
382 | 381 | _this.updateProgress( perc ); |
383 | 382 | //special case update the file progress where we have data size: |
384 | 383 | $j('#up-status-container').html( |
385 | | - gM('upload-stats-fileprogres', [ |
| 384 | + gM('mwe-upload-stats-fileprogres', [ |
386 | 385 | formatSize( data.upload['loaded'] ), |
387 | 386 | formatSize( data.upload['content_length'] ) |
388 | 387 | ] |
— | — | @@ -392,9 +391,9 @@ |
393 | 392 | js_log('just have loaded (no cotent length: ' + data.upload['loaded']); |
394 | 393 | //for lack of content-length requests: |
395 | 394 | $j('#up-status-container').html( |
396 | | - gM('upload-stats-fileprogres', [ |
| 395 | + gM('mwe-upload-stats-fileprogres', [ |
397 | 396 | formatSize( data.upload['loaded'] ), |
398 | | - gM('upload-unknown-size') |
| 397 | + gM('mwe-upload-unknown-size') |
399 | 398 | ] |
400 | 399 | ) |
401 | 400 | ); |
— | — | @@ -410,7 +409,7 @@ |
411 | 410 | if( apiRes.error || ( apiRes.upload && apiRes.upload.result == "Failure" ) ){ |
412 | 411 | //gennerate the error button: |
413 | 412 | var bObj = {}; |
414 | | - bObj[ gM('return-to-form') ] = function(){ |
| 413 | + bObj[ gM('mwe-return-to-form') ] = function(){ |
415 | 414 | _this.form_post_override = false; |
416 | 415 | $j(this).dialog('close'); |
417 | 416 | }; |
— | — | @@ -472,31 +471,31 @@ |
473 | 472 | if( apiRes.upload.error == 'internal-error'){ |
474 | 473 | errorKey = apiRes.upload.details[0]; |
475 | 474 | gMsgLoadRemote(errorKey, function(){ |
476 | | - _this.updateProgressWin( gM( 'uploaderror' ), gM( errorKey ), bObj ); |
| 475 | + _this.updateProgressWin( gM( 'mwe-uploaderror' ), gM( errorKey ), bObj ); |
477 | 476 | |
478 | 477 | }); |
479 | 478 | return false; |
480 | 479 | } |
481 | 480 | |
482 | | - _this.updateProgressWin( gM('uploaderror'), gM('unknown-error') + '<br>' + error_msg, bObj ); |
| 481 | + _this.updateProgressWin( gM('mwe-uploaderror'), gM('mwe-unknown-error') + '<br>' + error_msg, bObj ); |
483 | 482 | return false; |
484 | 483 | }else{ |
485 | 484 | if(apiRes.error && apiRes.error.info ){ |
486 | | - _this.updateProgressWin( gM('uploaderror'), apiRes.error.info ,bObj); |
| 485 | + _this.updateProgressWin( gM('mwe-uploaderror'), apiRes.error.info ,bObj); |
487 | 486 | return false; |
488 | 487 | }else{ |
489 | 488 | if(typeof error_code == 'number' && typeof error_msg_key[error_code] == 'undefined' ){ |
490 | 489 | if(apiRes.upload.code.finalExt){ |
491 | | - _this.updateProgressWin( gM('uploaderror'), gM('wgfogg_waring_bad_extension', apiRes.upload.code.finalExt) , bObj); |
| 490 | + _this.updateProgressWin( gM('mwe-uploaderror'), gM('mwe-wgfogg_warning_bad_extension', apiRes.upload.code.finalExt) , bObj); |
492 | 491 | }else{ |
493 | | - _this.updateProgressWin( gM('uploaderror'), gM('unknown-error') + ' : ' + error_code, bObj); |
| 492 | + _this.updateProgressWin( gM('mwe-uploaderror'), gM('mwe-unknown-error') + ' : ' + error_code, bObj); |
494 | 493 | } |
495 | 494 | }else{ |
496 | 495 | js_log('get key: ' + error_msg_key[ error_code ]) |
497 | 496 | gMsgLoadRemote( error_msg_key[ error_code ], function(){ |
498 | | - _this.updateProgressWin( gM('uploaderror'), gM( error_msg_key[ error_code ], errorReplaceArg ), bObj); |
| 497 | + _this.updateProgressWin( gM('mwe-uploaderror'), gM( error_msg_key[ error_code ], errorReplaceArg ), bObj); |
499 | 498 | }); |
500 | | - js_log("api.erorr"); |
| 499 | + js_log("api.error"); |
501 | 500 | } |
502 | 501 | return false; |
503 | 502 | } |
— | — | @@ -505,7 +504,7 @@ |
506 | 505 | //check for upload.error type erros. |
507 | 506 | if( apiRes.upload && apiRes.upload.error){ |
508 | 507 | js_log(' apiRes.upload.error: ' + apiRes.upload.error ); |
509 | | - _this.updateProgressWin( gM('uploaderror'), gM('unknown-error') + '<br>', bObj); |
| 508 | + _this.updateProgressWin( gM('mwe-uploaderror'), gM('mwe-unknown-error') + '<br>', bObj); |
510 | 509 | return false; |
511 | 510 | } |
512 | 511 | //check for known warnings: |
— | — | @@ -519,18 +518,18 @@ |
520 | 519 | case 'duplicate': |
521 | 520 | case 'exists': |
522 | 521 | if(winfo[1] && winfo[1].title && winfo[1].title.mTextform){ |
523 | | - wmsg += gM('file-exists-duplicate') +' '+ |
| 522 | + wmsg += gM('mwe-file-exists-duplicate') +' '+ |
524 | 523 | '<b>' + winfo[1].title.mTextform + '</b>'; |
525 | 524 | }else{ |
526 | 525 | //misc error (weird that winfo[1] not present |
527 | | - wmsg += gM('upload-misc-error') + ' ' + wtype; |
| 526 | + wmsg += gM('mwe-upload-misc-error') + ' ' + wtype; |
528 | 527 | } |
529 | 528 | break; |
530 | 529 | case 'file-thumbnail-no': |
531 | | - wmsg += gM('file-thumbnail-no', winfo); |
| 530 | + wmsg += gM('mwe-file-thumbnail-no', winfo); |
532 | 531 | break; |
533 | 532 | default: |
534 | | - wmsg += gM('upload-misc-error') + ' ' + wtype; |
| 533 | + wmsg += gM('mwe-upload-misc-error') + ' ' + wtype; |
535 | 534 | break; |
536 | 535 | } |
537 | 536 | wmsg+='</li>'; |
— | — | @@ -539,16 +538,16 @@ |
540 | 539 | if( apiRes.upload.warnings.sessionkey) |
541 | 540 | _this.warnings_sessionkey = apiRes.upload.warnings.sessionkey; |
542 | 541 | var bObj = {}; |
543 | | - bObj[ gM('ignorewarning') ] = function() { |
| 542 | + bObj[ gM('mwe-ignorewarning') ] = function() { |
544 | 543 | //re-inciate the upload proccess |
545 | 544 | $j('#wpIgnoreWarning').attr('checked', true); |
546 | 545 | $j( '#mw-upload-form' ).submit(); |
547 | 546 | }; |
548 | | - bObj[ gM('return-to-form') ] = function(){ |
| 547 | + bObj[ gM('mwe-return-to-form') ] = function(){ |
549 | 548 | $j(this).dialog('close'); |
550 | 549 | _this.form_post_override = false; |
551 | 550 | } |
552 | | - _this.updateProgressWin( gM('uploadwarning'), '<h3>' + gM('uploadwarning') + '</h3>' +wmsg + '<p>',bObj); |
| 551 | + _this.updateProgressWin( gM('mwe-uploadwarning'), '<h3>' + gM('mwe-uploadwarning') + '</h3>' +wmsg + '<p>',bObj); |
553 | 552 | return false; |
554 | 553 | } |
555 | 554 | //should be "OK" |
— | — | @@ -584,15 +583,15 @@ |
585 | 584 | _this.done_upload_cb( url ); |
586 | 585 | }else{ |
587 | 586 | var bObj = {}; |
588 | | - bObj[ gM('return-to-form')] = function(){ |
| 587 | + bObj[ gM('mwe-return-to-form')] = function(){ |
589 | 588 | $j(this).dialog('close'); |
590 | 589 | _this.form_post_override = false; |
591 | 590 | } |
592 | | - bObj[ gM('go-to-resource') ] = function(){ |
| 591 | + bObj[ gM('mwe-go-to-resource') ] = function(){ |
593 | 592 | window.location = url; |
594 | 593 | }; |
595 | 594 | _this.action_done = true; |
596 | | - _this.updateProgressWin( gM('successfulupload'), gM( 'mv_upload_done', url), bObj); |
| 595 | + _this.updateProgressWin( gM('mwe-successfulupload'), gM( 'mwe-upload_done', url), bObj); |
597 | 596 | js_log('apiRes.upload.imageinfo::'+url); |
598 | 597 | } |
599 | 598 | return ; |
— | — | @@ -612,14 +611,14 @@ |
613 | 612 | }else{ |
614 | 613 | //@@todo should convice the jquery ui people to not use object keys as user msg's |
615 | 614 | var bObj = {}; |
616 | | - bObj[ gM('ok-button') ] = function(){ |
| 615 | + bObj[ gM('mwe-ok-button') ] = function(){ |
617 | 616 | $j(this).dialog('close'); |
618 | 617 | }; |
619 | 618 | $j('#upProgressDialog').dialog('option','buttons', bObj); |
620 | 619 | } |
621 | 620 | }, |
622 | 621 | getProgressTitle:function(){ |
623 | | - return gM('upload-in-progress'); |
| 622 | + return gM('mwe-upload-in-progress'); |
624 | 623 | }, |
625 | 624 | getEditForm:function(){ |
626 | 625 | if( this.target_edit_from && $j( this.target_edit_from ).length != 0){ |
— | — | @@ -665,7 +664,7 @@ |
666 | 665 | '<div id="up-progressbar" style="height:15px;"></div>' + |
667 | 666 | '<div id="up-status-container">'+ |
668 | 667 | '<span id="up-pstatus">0% - </span> ' + |
669 | | - '<span id="up-status-state">' + gM('uploaded-status') + '</span> ' + |
| 668 | + '<span id="up-status-state">' + gM('mwe-uploaded-status') + '</span> ' + |
670 | 669 | '</div>'+ |
671 | 670 | '</div>' |
672 | 671 | ) |
— | — | @@ -680,14 +679,14 @@ |
681 | 680 | cancel_button:function(){ |
682 | 681 | var _this = this; |
683 | 682 | var cancelBtn = new Array(); |
684 | | - cancelBtn[ gM('cancel-button') ] = function(){ |
| 683 | + cancelBtn[ gM('mwe-cancel-button') ] = function(){ |
685 | 684 | return _this.cancel_action(this) |
686 | 685 | }; |
687 | 686 | return cancelBtn; |
688 | 687 | }, |
689 | 688 | cancel_action : function( dlElm ){ |
690 | 689 | //confirm: |
691 | | - if( confirm( gM('mv-cancel-confim') )){ |
| 690 | + if( confirm( gM('mwe-cancel-confim') )){ |
692 | 691 | //@@todo (cancel the encode / upload) |
693 | 692 | $j(this).dialog('close'); |
694 | 693 | return false; |
Index: trunk/phase3/js2/mwEmbed/libSequencer/mvSequencer.js |
— | — | @@ -52,7 +52,7 @@ |
53 | 53 | "mv_advanced_editor_desc" : "advanced editor (Final Cut style)", |
54 | 54 | "mv_other_options" : "Other options", |
55 | 55 | "mv_contextmenu_opt" : "Enable context menus", |
56 | | - "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>)." |
| 56 | + "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>)." |
57 | 57 | }); |
58 | 58 | //used to set default values and validate the passed init object |
59 | 59 | var sequencerDefaultValues = { |
— | — | @@ -142,7 +142,7 @@ |
143 | 143 | }, |
144 | 144 | 'cliplib':{ |
145 | 145 | 'd':0, |
146 | | - 'html': gM('loading_txt'), |
| 146 | + 'html': gM('mwe-loading_txt'), |
147 | 147 | 'js':function( this_seq ){ |
148 | 148 | //load the search interface with sequence tool targets |
149 | 149 | mvJsLoader.doLoad( [ |
Index: trunk/phase3/js2/mwEmbed/libClipEdit/mvClipEdit.js |
— | — | @@ -23,7 +23,7 @@ |
24 | 24 | "mv_custom_title" : "Custom title", |
25 | 25 | "mv_edit_properties" : "Edit properties", |
26 | 26 | "mv_other_properties" : "Other properties", |
27 | | - "mv_resource_page" : "Resource page : ", |
| 27 | + "mv_resource_page" : "Resource page:", |
28 | 28 | "mv_set_in_out_points" : "Set in-out points", |
29 | 29 | "mv_start_time" : "Start time", |
30 | 30 | "mv_end_time" : "End time", |
— | — | @@ -522,7 +522,7 @@ |
523 | 523 | '<h3>Edit tools</h3>' + |
524 | 524 | '<div class="mv_edit_button mv_crop_button_base" id="mv_crop_button" alt="crop" title="'+gM('mv_crop')+'"/>'+ |
525 | 525 | '<a href="#" class="mv_crop_msg">' + gM('mv_crop') + '</a> '+ |
526 | | - '<span style="display:none" class="mv_crop_msg_load">' + gM('loading_txt') + '</span> '+ |
| 526 | + '<span style="display:none" class="mv_crop_msg_load">' + gM('mwe-loading_txt') + '</span> '+ |
527 | 527 | '<a href="#" style="display:none" class="mv_apply_crop">' + gM('mv_apply_crop') + '</a> '+ |
528 | 528 | '<a href="#" style="display:none" class="mv_rest_crop">' + gM('mv_reset_crop') + '</a> '+ |
529 | 529 | '<hr style="clear:both"/><br>'+ |
Index: trunk/phase3/js2/mwEmbed/php/languages/mwEmbed.i18n.php |
— | — | @@ -19,31 +19,30 @@ |
20 | 20 | /* |
21 | 21 | * js file: /libAddMedia/mvBaseUploadInterface.js |
22 | 22 | */ |
23 | | - 'upload-transcode-in-progress' => 'Transcode and upload in progress (do not close this window)', |
24 | | - 'upload-in-progress' => 'Upload in progress (do not close this window)', |
25 | | - 'upload-transcoded-status' => 'Transcoded', |
26 | | - 'uploaded-status' => 'Uploaded', |
27 | | - 'wgfogg_wrong_version' => 'You have Firefogg installed but it is outdated. <a href="http://firefogg.org">Please upgrade</a>.', |
28 | | - 'upload-stats-fileprogres' => '$1 of $2', |
29 | | - 'mv_upload_completed' => 'Your upload is complete', |
30 | | - 'mv_upload_done' => '<a href="$1">Your upload <i>should be</i> accessible</a>.', |
31 | | - 'upload-unknown-size' => 'Unknown size', |
32 | | - 'mv-cancel-confim' => 'Are you sure you want to cancel?', |
33 | | - 'successfulupload' => 'Upload successful', |
34 | | - 'uploaderror' => 'Upload error', |
35 | | - 'uploadwarning' => 'Upload warning', |
36 | | - 'unknown-error' => 'Unknown error:', |
37 | | - 'return-to-form' => 'Return to form', |
38 | | - 'file-exists-duplicate' => 'This file is a duplicate of the following file:', |
39 | | - '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.', |
40 | | - 'fileexists-thumb' => '<center><b>Existing file</b></center>', |
41 | | - 'ignorewarning' => 'Ignore warning and save file anyway', |
42 | | - 'file-thumbnail-no' => 'The filename begins with <b><tt>$1</tt></b>', |
43 | | - 'go-to-resource' => 'Go to resource page', |
44 | | - 'upload-misc-error' => 'Unknown upload error', |
45 | | - '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>).', |
46 | | - 'cancel-button' => 'Cancel', |
47 | | - 'ok-button' => 'OK', |
| 23 | + 'mwe-upload-transcode-in-progress' => 'Transcode and upload in progress (do not close this window)', |
| 24 | + 'mwe-upload-in-progress' => 'Upload in progress (do not close this window)', |
| 25 | + 'mwe-upload-transcoded-status' => 'Transcoded', |
| 26 | + 'mwe-uploaded-status' => 'Uploaded', |
| 27 | + 'mwe-upload-stats-fileprogres' => '$1 of $2', |
| 28 | + 'mwe-upload_completed' => 'Your upload is complete', |
| 29 | + 'mwe-upload_done' => '<a href="$1">Your upload <i>should be</i> accessible</a>.', |
| 30 | + 'mwe-upload-unknown-size' => 'Unknown size', |
| 31 | + 'mwe-cancel-confim' => 'Are you sure you want to cancel?', |
| 32 | + 'mwe-successfulupload' => 'Upload successful', |
| 33 | + 'mwe-uploaderror' => 'Upload error', |
| 34 | + 'mwe-uploadwarning' => 'Upload warning', |
| 35 | + 'mwe-unknown-error' => 'Unknown error:', |
| 36 | + 'mwe-return-to-form' => 'Return to form', |
| 37 | + 'mwe-file-exists-duplicate' => 'This file is a duplicate of the following file:', |
| 38 | + '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.', |
| 39 | + 'mwe-fileexists-thumb' => '<center><b>Existing file</b></center>', |
| 40 | + 'mwe-ignorewarning' => 'Ignore warning and save file anyway', |
| 41 | + 'mwe-file-thumbnail-no' => 'The filename begins with <b><tt>$1</tt></b>', |
| 42 | + 'mwe-go-to-resource' => 'Go to resource page', |
| 43 | + 'mwe-upload-misc-error' => 'Unknown upload error', |
| 44 | + '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>).', |
| 45 | + 'mwe-cancel-button' => 'Cancel', |
| 46 | + 'mwe-ok-button' => 'OK', |
48 | 47 | |
49 | 48 | /* |
50 | 49 | * js file: /libAddMedia/mvAdvFirefogg.js |
— | — | @@ -221,7 +220,7 @@ |
222 | 221 | '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 />', |
223 | 222 | '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>', |
224 | 223 | 'mv_do_not_warn_again' => 'Dissmiss for now.', |
225 | | - 'players' => 'Players', |
| 224 | + 'playerselect' => 'Players', |
226 | 225 | |
227 | 226 | /* |
228 | 227 | * js file: /libClipEdit/mvClipEdit.js |
— | — | @@ -251,10 +250,10 @@ |
252 | 251 | /* |
253 | 252 | * js file: /mv_embed.js |
254 | 253 | */ |
255 | | - 'loading_txt' => 'loading <blink>...</blink>', |
256 | | - 'loading_title' => 'Loading...', |
257 | | - 'size-gigabytes' => '$1 GB', |
258 | | - 'size-megabytes' => '$1 MB', |
259 | | - 'size-kilobytes' => '$1 K', |
260 | | - 'size-bytes' => '$1 B', |
| 254 | + 'mwe-loading_txt' => 'loading <blink>...</blink>', |
| 255 | + 'mwe-loading_title' => 'Loading...', |
| 256 | + 'mwe-size-gigabytes' => '$1 GB', |
| 257 | + 'mwe-size-megabytes' => '$1 MB', |
| 258 | + 'mwe-size-kilobytes' => '$1 K', |
| 259 | + 'mwe-size-bytes' => '$1 B', |
261 | 260 | ); |
Index: trunk/phase3/js2/mwEmbed/mv_embed.js |
— | — | @@ -79,12 +79,12 @@ |
80 | 80 | |
81 | 81 | //all default msg in [English] should be overwritten by the CMS language msg system. |
82 | 82 | loadGM({ |
83 | | - "loading_txt" : "loading <blink>...<\/blink>", |
84 | | - "loading_title" : "Loading...", |
85 | | - "size-gigabytes" : "$1 GB", |
86 | | - "size-megabytes" : "$1 MB", |
87 | | - "size-kilobytes" : "$1 K", |
88 | | - "size-bytes" : "$1 B" |
| 83 | + "mwe-loading_txt" : "loading <blink>...<\/blink>", |
| 84 | + "mwe-loading_title" : "Loading...", |
| 85 | + "mwe-size-gigabytes" : "$1 GB", |
| 86 | + "mwe-size-megabytes" : "$1 MB", |
| 87 | + "mwe-size-kilobytes" : "$1 K", |
| 88 | + "mwe-size-bytes" : "$1 B" |
89 | 89 | }); |
90 | 90 | |
91 | 91 | /** |
— | — | @@ -299,15 +299,15 @@ |
300 | 300 | round = 2; |
301 | 301 | if( size > 1024 ) { |
302 | 302 | size = size / 1024; |
303 | | - msg = 'size-gigabytes'; |
| 303 | + msg = 'mwe-size-gigabytes'; |
304 | 304 | } else { |
305 | | - msg = 'size-megabytes'; |
| 305 | + msg = 'mwe-size-megabytes'; |
306 | 306 | } |
307 | 307 | } else { |
308 | | - msg = 'size-kilobytes'; |
| 308 | + msg = 'mwe-size-kilobytes'; |
309 | 309 | } |
310 | 310 | } else { |
311 | | - msg = 'size-bytes'; |
| 311 | + msg = 'mwe-size-bytes'; |
312 | 312 | } |
313 | 313 | //javascript does not let you do precession points in rounding |
314 | 314 | var p = Math.pow(10,round); |
— | — | @@ -535,7 +535,7 @@ |
536 | 536 | |
537 | 537 | //make sure we have jQuery |
538 | 538 | _this.jQueryCheck(function(){ |
539 | | - $j('.videonojs').html( gM('loading_txt') ); |
| 539 | + $j('.videonojs').html( gM('mwe-loading_txt') ); |
540 | 540 | var depReq = [ |
541 | 541 | [ |
542 | 542 | '$j.ui', |
— | — | @@ -748,7 +748,7 @@ |
749 | 749 | (function($) { |
750 | 750 | $.fn.addMediaWiz = function( iObj, callback ){ |
751 | 751 | //first set the cursor for the button to "loading" |
752 | | - $j(this.selector).css('cursor','wait').attr('title', gM('loading_title')); |
| 752 | + $j(this.selector).css('cursor','wait').attr('title', gM('mwe-loading_title')); |
753 | 753 | |
754 | 754 | iObj['target_invocation'] = this.selector; |
755 | 755 | |
Index: trunk/phase3/js2/mwEmbed/libEmbedVideo/embedVideo.js |
— | — | @@ -6,8 +6,8 @@ |
7 | 7 | "loading_plugin" : "loading plugin <blink>...<\/blink>", |
8 | 8 | "select_playback" : "Set playback preference", |
9 | 9 | "link_back" : "Link back", |
10 | | - "error_load_lib" : "Error : mv_embed was unable to load required JavaScript libraries.\nInsert script via DOM has failed. Please try reloading this page.", |
11 | | - "error_swap_vid" : "Error : mv_embed was unable to swap the video tag for the mv_embed interface", |
| 10 | + "error_load_lib" : "Error: mv_embed was unable to load required JavaScript libraries.\nInsert script via DOM has failed. Please try reloading this page.", |
| 11 | + "error_swap_vid" : "Error: mv_embed was unable to swap the video tag for the mv_embed interface", |
12 | 12 | "add_to_end_of_sequence" : "Add to end of sequence", |
13 | 13 | "missing_video_stream" : "The video file for this stream is missing", |
14 | 14 | "play_clip" : "Play clip", |
— | — | @@ -20,11 +20,11 @@ |
21 | 21 | "prev_clip_msg" : "Play previous clip", |
22 | 22 | "current_clip_msg" : "Continue playing this clip", |
23 | 23 | "seek_to" : "Seek to", |
24 | | - "download_segment" : "Download selection : ", |
25 | | - "download_full" : "Download full video file : ", |
| 24 | + "download_segment" : "Download selection:", |
| 25 | + "download_full" : "Download full video file:", |
26 | 26 | "download_right_click" : "To download, right click and select <i>Save target as...<\/i>", |
27 | 27 | "download_clip" : "Download video", |
28 | | - "download_text" : "Download text (<a style=\"color : white\" title=\"cmml\" href=\"http : \/\/wiki.xiph.org\/index.php\/CMML\">CMML<\/a> xml) : ", |
| 28 | + "download_text" : "Download text (<a style=\"color:white\" title=\"cmml\" href=\"http:\/\/wiki.xiph.org\/index.php\/CMML\">CMML<\/a> xml):", |
29 | 29 | "download" : "Download", |
30 | 30 | "share" : "Share", |
31 | 31 | "credits" : "Credits", |
— | — | @@ -44,8 +44,8 @@ |
45 | 45 | "mv_ogg-player-flowplayer" : "Flowplayer", |
46 | 46 | "mv_ogg-player-selected" : " (selected)", |
47 | 47 | "mv_ogg-player-omtkplayer" : "OMTK Flash Vorbis", |
48 | | - "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 \/>", |
49 | | - "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>", |
| 48 | + "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 \/>", |
| 49 | + "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>", |
50 | 50 | "mv_do_not_warn_again" : "Dissmiss for now.", |
51 | 51 | "playerselect" : "Players" |
52 | 52 | }); |
— | — | @@ -1552,7 +1552,7 @@ |
1553 | 1553 | function(){ |
1554 | 1554 | //animation done.. add "loading" to div if empty |
1555 | 1555 | if($j('#liks_info_'+_this.id).html()==''){ |
1556 | | - $j('#liks_info_'+_this.id).html(gM('loading_txt')); |
| 1556 | + $j('#liks_info_'+_this.id).html(gM('mwe-loading_txt')); |
1557 | 1557 | } |
1558 | 1558 | } |
1559 | 1559 | ) |
— | — | @@ -1968,7 +1968,7 @@ |
1969 | 1969 | doLinkBack:function(){ |
1970 | 1970 | if(this.roe && this.media_element.addedROEData==false){ |
1971 | 1971 | var _this = this; |
1972 | | - this.displayHTML(gM('loading_txt')); |
| 1972 | + this.displayHTML(gM('mwe-loading_txt')); |
1973 | 1973 | do_request(this.roe, function(data) |
1974 | 1974 | { |
1975 | 1975 | _this.media_element.addROE(data); |
— | — | @@ -2023,7 +2023,7 @@ |
2024 | 2024 | 'height:'+ parseInt( this.height )+'px;width:400px;' + |
2025 | 2025 | 'display:none;" ' + |
2026 | 2026 | 'id="metaBox_' + this.id + '">'+ |
2027 | | - gM('loading_txt') + |
| 2027 | + gM('mwe-loading_txt') + |
2028 | 2028 | '</div>'); |
2029 | 2029 | } |
2030 | 2030 | //fade in the text display |
— | — | @@ -2195,7 +2195,7 @@ |
2196 | 2196 | //js_log('f:showVideoDownload '+ this.roe + ' ' + this.media_element.addedROEData); |
2197 | 2197 | if(this.roe && this.media_element.addedROEData == false){ |
2198 | 2198 | var _this = this; |
2199 | | - this.displayHTML(gM('loading_txt')); |
| 2199 | + this.displayHTML(gM('mwe-loading_txt')); |
2200 | 2200 | do_request(this.roe, function(data) |
2201 | 2201 | { |
2202 | 2202 | _this.media_element.addROE(data); |
Index: trunk/phase3/js2/mwEmbed/libTimedText/mvTextInterface.js |
— | — | @@ -222,7 +222,7 @@ |
223 | 223 | 'right:0px;bottom:0px;' + |
224 | 224 | 'height:'+(this.pe.height-30)+ |
225 | 225 | 'px;overflow:auto;"><span style="display:none;" id="mv_txt_load_' + this.pe.id + '">'+ |
226 | | - gM('loading_txt')+'</span>' + |
| 226 | + gM('mwe-loading_txt')+'</span>' + |
227 | 227 | '</div>'; |
228 | 228 | }, |
229 | 229 | getTsSelect:function(){ |
Index: trunk/phase3/js2/uploadPage.js |
— | — | @@ -1,9 +1,9 @@ |
2 | 2 | /* |
3 | 3 | * uploadPage.js to be run on specialUpload page. |
4 | | - * controls the invocation of the mvUploader class based on local config. |
5 | | - */ |
| 4 | + * controls the invocation of the mvUploader class based on local config. |
| 5 | + */ |
6 | 6 | js2AddOnloadHook( function(){ |
7 | | - mwUploadHelper.init(); |
| 7 | + mwUploadHelper.init(); |
8 | 8 | }); |
9 | 9 | var mwUploadFormTarget = '#mw-upload-form'; |
10 | 10 | //set up the upoload form bindings once all dom manipluation is done |
— | — | @@ -11,18 +11,18 @@ |
12 | 12 | firefogg_installed:false, |
13 | 13 | init:function(){ |
14 | 14 | var _this = this; |
15 | | - //if not boolean false set to true: |
| 15 | + //if not boolean false set to true: |
16 | 16 | if(typeof wgEnableFirefogg == 'undefined') |
17 | 17 | wgEnableFirefogg = true; |
18 | | - |
| 18 | + |
19 | 19 | if( wgEnableFirefogg ){ |
20 | | - //setup the upload handler to firefogg (supports our upload proccess) (should work with the http uploads too) |
21 | | - $j('#wpUploadFile').firefogg({ |
| 20 | + //setup the upload handler to firefogg (supports our upload proccess) (should work with the http uploads too) |
| 21 | + $j('#wpUploadFile').firefogg({ |
22 | 22 | //an api url (we won't submit directly to action of the form) |
23 | 23 | 'api_url' : wgServer + wgScriptPath + '/api.php', |
24 | | - 'form_rewrite': true, |
25 | | - 'target_edit_from' : mwUploadFormTarget, |
26 | | - 'new_source_cb' : function( orgFilename, oggName ){ |
| 24 | + 'form_rewrite': true, |
| 25 | + 'target_edit_from' : mwUploadFormTarget, |
| 26 | + 'new_source_cb' : function( orgFilename, oggName ){ |
27 | 27 | if($j('#wpDestFile').val() == "") |
28 | 28 | $j('#wpDestFile').val( oggName ); |
29 | 29 | mwUploadHelper.doDestCheck(); |
— | — | @@ -34,79 +34,79 @@ |
35 | 35 | _this.firefogg_installed=false; |
36 | 36 | } |
37 | 37 | } |
38 | | - }); |
39 | | - |
40 | | - }else{ |
41 | | - //Add basic upload profile support ( http status monitoring, progress box for browsers that support it etc.) |
| 38 | + }); |
| 39 | + |
| 40 | + }else{ |
| 41 | + //Add basic upload profile support ( http status monitoring, progress box for browsers that support it etc.) |
42 | 42 | if($j('#wpUploadFileURL').length != 0){ |
43 | | - $j('#wpUploadFileURL').baseUploadInterface({ |
| 43 | + $j('#wpUploadFileURL').baseUploadInterface({ |
44 | 44 | 'api_url' : wgServer + wgScriptPath + '/api.php', |
45 | 45 | 'target_edit_from' : mwUploadFormTarget |
46 | | - }); |
| 46 | + }); |
47 | 47 | } |
48 | 48 | } |
49 | | - |
| 49 | + |
50 | 50 | if( wgAjaxUploadDestCheck ){ |
51 | | - //do destination check: |
| 51 | + //do destination check: |
52 | 52 | $j('#wpDestFile').change( mwUploadHelper.doDestCheck ); |
53 | 53 | } |
54 | | - |
| 54 | + |
55 | 55 | //check if we have http enabled & setup enable/disable toggle: |
56 | | - if($j('#wpUploadFileURL').length != 0){ |
57 | | - //set the initial toggleUpType |
58 | | - _this.toggleUpType(true); |
59 | | - |
60 | | - $j("input[name='wpSourceType']").click(function(){ |
| 56 | + if($j('#wpUploadFileURL').length != 0){ |
| 57 | + //set the initial toggleUpType |
| 58 | + _this.toggleUpType(true); |
| 59 | + |
| 60 | + $j("input[name='wpSourceType']").click(function(){ |
61 | 61 | _this.toggleUpType( this.id == 'wpSourceTypeFile' ); |
62 | | - }); |
63 | | - } |
64 | | - $j('#wpUploadFile,#wpUploadFileURL').focus(function(){ |
65 | | - _this.toggleUpType( this.id == 'wpUploadFile' ); |
66 | | - }).change(function(){ //also setup the onChange event binding: |
| 62 | + }); |
| 63 | + } |
| 64 | + $j('#wpUploadFile,#wpUploadFileURL').focus(function(){ |
| 65 | + _this.toggleUpType( this.id == 'wpUploadFile' ); |
| 66 | + }).change(function(){ //also setup the onChange event binding: |
67 | 67 | if ( wgUploadAutoFill ) { |
68 | | - mwUploadHelper.doDestinationFill( this ); |
69 | | - } |
70 | | - }); |
| 68 | + mwUploadHelper.doDestinationFill( this ); |
| 69 | + } |
| 70 | + }); |
71 | 71 | }, |
72 | 72 | /** |
73 | 73 | * toggleUpType sets the upload radio buttons |
74 | | - * |
75 | | - * boolean set |
76 | | - */ |
| 74 | + * |
| 75 | + * boolean set |
| 76 | + */ |
77 | 77 | toggleUpType:function( set ){ |
78 | 78 | $j('#wpSourceTypeFile').attr('checked', set); |
79 | 79 | $j('#wpUploadFile').attr('disabled', !set); |
80 | | - |
| 80 | + |
81 | 81 | $j('#wpSourceTypeURL').attr('checked', !set); |
82 | 82 | $j('#wpUploadFileURL').attr('disabled', set); |
83 | | - |
84 | | - //if firefogg is enbaled: toggle action per form select of http upload vs firefogg upload |
| 83 | + |
| 84 | + //if firefogg is enbaled: toggle action per form select of http upload vs firefogg upload |
85 | 85 | if( wgEnableFirefogg ){ |
86 | 86 | $j('#wpUploadFile').firefogg({ |
87 | 87 | 'firefogg_form_action': $j('#wpSourceTypeFile').attr('checked') |
88 | 88 | }); |
89 | 89 | } |
90 | | - }, |
| 90 | + }, |
91 | 91 | /** |
92 | 92 | * doDestCheck checks the destination |
93 | 93 | */ |
94 | | - doDestCheck:function(){ |
| 94 | + doDestCheck:function(){ |
95 | 95 | var _this = this; |
96 | 96 | $j('#wpDestFile-warning').empty(); |
97 | 97 | //show loading |
98 | 98 | $j('#wpDestFile').after('<img id = "mw-spinner-wpDestFile" src ="'+ stylepath + '/common/images/spinner.gif" />'); |
99 | | - //try and get a thumb of the current file (check its destination) |
| 99 | + //try and get a thumb of the current file (check its destination) |
100 | 100 | do_api_req({ |
101 | | - 'data':{ |
| 101 | + 'data':{ |
102 | 102 | 'titles': 'File:' + $j('#wpDestFile').val(),//@@todo we may need a more clever way to get a the filename |
103 | 103 | 'prop': 'imageinfo', |
104 | 104 | 'iiprop':'url|mime|size', |
105 | | - 'iiurlwidth': 150 |
| 105 | + 'iiurlwidth': 150 |
106 | 106 | }, |
107 | 107 | 'url': _this.api_url |
108 | 108 | },function(data){ |
109 | 109 | //remove spinner: |
110 | | - $j('#mw-spinner-wpDestFile').remove(); |
| 110 | + $j('#mw-spinner-wpDestFile').remove(); |
111 | 111 | if(data && data.query && data.query.pages){ |
112 | 112 | if( data.query.pages[-1] ){ |
113 | 113 | //all good no file there |
— | — | @@ -116,12 +116,12 @@ |
117 | 117 | var ntitle = data.query.normalized[0].to; |
118 | 118 | }else{ |
119 | 119 | var ntitle = data.query.pages[ page_id ].title; |
120 | | - } |
121 | | - var img = data.query.pages[ page_id ].imageinfo[0]; |
| 120 | + } |
| 121 | + var img = data.query.pages[ page_id ].imageinfo[0]; |
122 | 122 | $j('#wpDestFile-warning').html( |
123 | 123 | '<ul>' + |
124 | 124 | '<li>'+ |
125 | | - gM('fileexists', ntitle) + |
| 125 | + gM('mwe-fileexists', ntitle) + |
126 | 126 | '</li>'+ |
127 | 127 | '<div class="thumb tright">' + |
128 | 128 | '<div style="width: ' + ( parseInt(img.thumbwidth)+2 ) + 'px;" class="thumbinner">' + |
— | — | @@ -137,7 +137,7 @@ |
138 | 138 | 'src="' + stylepath + "/common/images/magnify-clip.png\" />" + |
139 | 139 | '</a>'+ |
140 | 140 | '</div>'+ |
141 | | - gM('fileexists-thumb') + |
| 141 | + gM('mwe-fileexists-thumb') + |
142 | 142 | '</div>' + |
143 | 143 | '</div>'+ |
144 | 144 | '</div>' + |
— | — | @@ -146,16 +146,16 @@ |
147 | 147 | } |
148 | 148 | } |
149 | 149 | } |
150 | | - }); |
| 150 | + }); |
151 | 151 | }, |
152 | 152 | /** |
153 | | - * doDestinationFill fills in a destination file-name based on a source asset name. |
| 153 | + * doDestinationFill fills in a destination file-name based on a source asset name. |
154 | 154 | */ |
155 | 155 | doDestinationFill:function( targetElm ){ |
156 | 156 | js_log("doDestinationFill") |
157 | 157 | //remove any previously flagged errors |
158 | | - $j('#mw-upload-permitted,#mw-upload-prohibited').hide(); |
159 | | - |
| 158 | + $j('#mw-upload-permitted,#mw-upload-prohibited').hide(); |
| 159 | + |
160 | 160 | var path = $j(targetElm).val(); |
161 | 161 | // Find trailing part |
162 | 162 | var slash = path.lastIndexOf('/'); |
— | — | @@ -167,13 +167,13 @@ |
168 | 168 | fname = path.substring(slash+1, 10000); |
169 | 169 | } else { |
170 | 170 | fname = path.substring(backslash+1, 10000); |
171 | | - } |
| 171 | + } |
172 | 172 | //urls are less likely to have a usefull extension don't include them in the extention check |
173 | | - if( wgFileExtensions && $j(targetElm).attr('id') != 'wpUploadFileURL' ){ |
174 | | - var found = false; |
175 | | - if( fname.lastIndexOf('.')!=-1 ){ |
176 | | - var ext = fname.substr( fname.lastIndexOf('.')+1 ); |
177 | | - for(var i=0; i < wgFileExtensions.length; i++){ |
| 173 | + if( wgFileExtensions && $j(targetElm).attr('id') != 'wpUploadFileURL' ){ |
| 174 | + var found = false; |
| 175 | + if( fname.lastIndexOf('.')!=-1 ){ |
| 176 | + var ext = fname.substr( fname.lastIndexOf('.')+1 ); |
| 177 | + for(var i=0; i < wgFileExtensions.length; i++){ |
178 | 178 | if( wgFileExtensions[i].toLowerCase() == ext.toLowerCase() ) |
179 | 179 | found = true; |
180 | 180 | } |
— | — | @@ -181,19 +181,19 @@ |
182 | 182 | if(!found){ |
183 | 183 | //clear the upload set mw-upload-permitted to error |
184 | 184 | $j(targetElm).val(''); |
185 | | - $j('#mw-upload-permitted,#mw-upload-prohibited').show().addClass('error'); |
186 | | - //clear the wpDestFile as well: |
187 | | - $j('#wpDestFile').val(''); |
| 185 | + $j('#mw-upload-permitted,#mw-upload-prohibited').show().addClass('error'); |
| 186 | + //clear the wpDestFile as well: |
| 187 | + $j('#wpDestFile').val(''); |
188 | 188 | return false; |
189 | | - } |
190 | | - } |
| 189 | + } |
| 190 | + } |
191 | 191 | // Capitalise first letter and replace spaces by underscores |
192 | | - fname = fname.charAt(0).toUpperCase().concat(fname.substring(1,10000)).replace(/ /g, '_'); |
| 192 | + fname = fname.charAt(0).toUpperCase().concat(fname.substring(1,10000)).replace(/ /g, '_'); |
193 | 193 | // Output result |
194 | 194 | $j('#wpDestFile').val( fname ); |
195 | | - |
196 | | - //do a destination check |
| 195 | + |
| 196 | + //do a destination check |
197 | 197 | this.doDestCheck(); |
198 | 198 | } |
199 | 199 | } |
200 | | - |
| 200 | + |