Index: branches/MwEmbedStandAlone/tests/Firefogg_GUI.html |
— | — | @@ -2,8 +2,8 @@ |
3 | 3 | <html><head> |
4 | 4 | <meta http-equiv="content-type" content="text/html; charset=UTF-8"> |
5 | 5 | <title>Firefogg - Make Ogg Video in your Browser</title> |
6 | | - <script type="text/javascript" src="../jsScriptLoader.php?class=window.jQuery,mwEmbed"></script> |
7 | | - <!-- <script type="text/javascript" src="../mwEmbed.js?debug=true"></script> --> |
| 6 | + <script type="text/javascript" src="../jsScriptLoader.php?class=window.jQuery,mwEmbed"></script> |
| 7 | + <!--<script type="text/javascript" src="../mwEmbed.js?debug=true"></script> --> |
8 | 8 | <style type="text/css" media="all"> |
9 | 9 | body { |
10 | 10 | margin: 0; |
Index: branches/MwEmbedStandAlone/modules/TimedText/mw.TimedTextEdit.js |
— | — | @@ -426,7 +426,7 @@ |
427 | 427 | |
428 | 428 | // Build cancel button |
429 | 429 | var cancelButton = {}; |
430 | | - var cancelText = gM( 'mwe-timedtext-cancel' ); |
| 430 | + var cancelText = gM( 'mwe-cancel' ); |
431 | 431 | cancelButton[ cancelText ] = function() { |
432 | 432 | _this.onCancelClipEdit(); |
433 | 433 | }; |
Index: branches/MwEmbedStandAlone/modules/AddMedia/mw.FirefoggGUI.js |
— | — | @@ -487,7 +487,7 @@ |
488 | 488 | 'maxlength="' + maxDigits + '" ' + |
489 | 489 | 'size="' + maxDigits + '" ' + |
490 | 490 | 'class="_' + configKey + ' text ui-widget-content ui-corner-all" ' + |
491 | | - 'style="display:inline;border:0; color:#f6931f; font-weight:bold;" ' + |
| 491 | + 'style="display:inline; color:#f6931f; padding: 2px; font-weight:bold;" ' + |
492 | 492 | 'value="' + defaultValue + '" >' + |
493 | 493 | '<div class="slider_' + configKey + '"></div>'; |
494 | 494 | break; |
— | — | @@ -574,7 +574,7 @@ |
575 | 575 | $j( this.target_input_file_name ).width( 250 ); |
576 | 576 | |
577 | 577 | // Special preset action |
578 | | - $j( this.selector + ' ._preset_select' ).change( function() { |
| 578 | + $j( this.selector + ' ._preset_select' ).change( function() { |
579 | 579 | _this.updatePresetSelection( $j( this ).val() ); |
580 | 580 | }); |
581 | 581 | |
— | — | @@ -634,7 +634,7 @@ |
635 | 635 | $j( this.selector + ' ._' + configKey) |
636 | 636 | .click( function() { |
637 | 637 | _this.updateLocalValue( _this.getClassId( this ), |
638 | | - $j( this ).is( ":checked" ) ); |
| 638 | + $j( this ).is( ":checked" ) ); |
639 | 639 | _this.updatePresetSelection( 'custom' ); |
640 | 640 | }); |
641 | 641 | break; |
— | — | @@ -643,10 +643,11 @@ |
644 | 644 | case 'int': |
645 | 645 | case 'float': |
646 | 646 | // Check if we have a validate function on the string |
647 | | - $j( this.selector + ' ._' + configKey ).change( function() { |
| 647 | + $j( this.selector + ' ._' + configKey ).change( function() { |
648 | 648 | $j( this ).val( _this.updateLocalValue( |
649 | 649 | _this.getClassId( this ), |
650 | | - $j( this ).val() ) ); |
| 650 | + $j( this ).val() ) |
| 651 | + ); |
651 | 652 | _this.updatePresetSelection( 'custom' ); |
652 | 653 | }) |
653 | 654 | break; |
— | — | @@ -660,8 +661,30 @@ |
661 | 662 | } |
662 | 663 | }); |
663 | 664 | break; |
664 | | - case 'slider': |
665 | | - //var sliderId = _this.getClassId( this, 'slider_' ); |
| 665 | + case 'slider': |
| 666 | + /** |
| 667 | + * Return true or false of out of range and update the related value |
| 668 | + */ |
| 669 | + var keepAspectRatio = function( sliderId, value ){ |
| 670 | + // Maintain source video aspect ratio |
| 671 | + if ( sliderId == 'width' ) { |
| 672 | + var sourceHeight = _this.sourceFileInfo.video[0]['height']; |
| 673 | + var sourceWidth = _this.sourceFileInfo.video[0]['width']; |
| 674 | + var newHeight = parseInt( sourceHeight / sourceWidth * value ); |
| 675 | + // Reject the update if the new height is above the maximum |
| 676 | + if ( newHeight > _this.updateInterfaceValue( 'height', newHeight ) ) |
| 677 | + return false; |
| 678 | + } |
| 679 | + if ( sliderId == 'height' ) { |
| 680 | + var sourceHeight = _this.sourceFileInfo.video[0]['height']; |
| 681 | + var sourceWidth = _this.sourceFileInfo.video[0]['width']; |
| 682 | + var newWidth = parseInt( sourceWidth / sourceHeight * value ); |
| 683 | + // Reject the update if the new width is above the maximum |
| 684 | + if ( newWidth > _this.updateInterfaceValue( 'width', newWidth ) ) |
| 685 | + return false; |
| 686 | + } |
| 687 | + }; |
| 688 | + |
666 | 689 | $j( this.selector + ' .slider_' + configKey ).slider({ |
667 | 690 | range: "min", |
668 | 691 | animate: true, |
— | — | @@ -670,27 +693,13 @@ |
671 | 694 | min: this.default_encoder_config[ configKey ].range.min, |
672 | 695 | max: this.default_encoder_config[ configKey ].range.max, |
673 | 696 | slide: function( event, ui ) { |
| 697 | + var sliderId = _this.getClassId( this, 'slider_' ); |
674 | 698 | $j( _this.selector + ' ._' + sliderId ).val( ui.value ); |
675 | 699 | |
676 | | - // Maintain source video aspect ratio |
677 | | - if ( sliderId == 'width' ) { |
678 | | - var sourceHeight = _this.sourceFileInfo.video[0]['height']; |
679 | | - var sourceWidth = _this.sourceFileInfo.video[0]['width']; |
680 | | - var newHeight = parseInt( sourceHeight / sourceWidth * ui.value ); |
681 | | - // Reject the update if the new height is above the maximum |
682 | | - if ( newHeight > _this.updateInterfaceValue( 'height', newHeight ) ) |
683 | | - return false; |
684 | | - } |
685 | | - if ( sliderId == 'height' ) { |
686 | | - var sourceHeight = _this.sourceFileInfo.video[0]['height']; |
687 | | - var sourceWidth = _this.sourceFileInfo.video[0]['width']; |
688 | | - var newWidth = parseInt( sourceWidth / sourceHeight * ui.value ); |
689 | | - // Reject the update if the new width is above the maximum |
690 | | - if ( newWidth > _this.updateInterfaceValue( 'width', wv ) ) |
691 | | - return false; |
692 | | - } |
| 700 | + keepAspectRatio( sliderId, ui.value ); |
693 | 701 | }, |
694 | 702 | change: function( event, ui ) { |
| 703 | + var sliderId = _this.getClassId( this, 'slider_' ); |
695 | 704 | _this.updateLocalValue( sliderId, ui.value ); |
696 | 705 | _this.updatePresetSelection( 'custom' ); |
697 | 706 | } |
— | — | @@ -698,15 +707,18 @@ |
699 | 708 | |
700 | 709 | $j( this.selector + ' ._' + configKey ).change( function() { |
701 | 710 | var classId = _this.getClassId( this ); |
702 | | - var validValue = _this.updateLocalValue( classId.substr( 1 ), |
703 | | - $j( this ).val() ); |
| 711 | + var validValue = _this.updateLocalValue( classId, |
| 712 | + $j( this ).val() |
| 713 | + ); |
704 | 714 | _this.updatePresetSelection( 'custom' ); |
705 | 715 | // Change it to the validated value |
706 | 716 | $j( this ).val( validValue ); |
707 | 717 | // update the slider |
708 | | - mw.log( "update: " + _this.selector + ' .slider' + classId ); |
709 | | - $j( _this.selector + ' .slider' + classId ) |
710 | | - .slider( 'option', 'value', validValue ); |
| 718 | + //mw.log( "update: " + _this.selector + ' .slider' + classId ); |
| 719 | + $j( _this.selector + ' .slider_' + classId ) |
| 720 | + .slider('value', validValue ); |
| 721 | + // Keep aspect ratio: |
| 722 | + keepAspectRatio( classId, validValue ); |
711 | 723 | }); |
712 | 724 | break; |
713 | 725 | } |
— | — | @@ -729,7 +741,7 @@ |
730 | 742 | updatePresetSelection: function( presetKey ) { |
731 | 743 | // Update the local configuration |
732 | 744 | this.local_settings['default'] = presetKey; |
733 | | - // mw.log( 'update preset desc: ' + presetKey ); |
| 745 | + mw.log( 'update preset desc: ' + presetKey ); |
734 | 746 | var presetDesc = ''; |
735 | 747 | if ( this.local_settings.presets[presetKey].desc ) { |
736 | 748 | presetDesc = this.local_settings.presets[presetKey].desc; |
— | — | @@ -778,8 +790,8 @@ |
779 | 791 | * range if required. Update the configuration with the validated value and |
780 | 792 | * return it. |
781 | 793 | */ |
782 | | - updateLocalValue: function( confKey, value ) { |
783 | | - if ( typeof this.default_encoder_config[confKey] == 'undefined' ) { |
| 794 | + updateLocalValue: function( confKey, value ) { |
| 795 | + if ( typeof this.default_encoder_config[confKey] == 'undefined' ) { |
784 | 796 | mw.log( "Error: could not update conf key: " + confKey ) |
785 | 797 | return value; |
786 | 798 | } |
— | — | @@ -824,14 +836,14 @@ |
825 | 837 | * If no prefix is given, "_" is assumed. |
826 | 838 | */ |
827 | 839 | getClassId: function( element, prefix ) { |
828 | | - var eltClass = $j( element ).attr( "class" ).split( ' ' ).slice( 0, 1 ).toString(); |
829 | | - |
| 840 | + |
| 841 | + var eltClass = $j( element ).attr( "class" ).split( ' ' ).slice( 0, 1 ).toString(); |
830 | 842 | if ( !prefix ) { |
831 | 843 | prefix = '_'; |
832 | 844 | } |
833 | 845 | if ( eltClass.substr( 0, prefix.length ) == prefix ) { |
834 | 846 | eltClass = eltClass.substr( prefix.length ); |
835 | | - } |
| 847 | + } |
836 | 848 | return eltClass; |
837 | 849 | }, |
838 | 850 | |
— | — | @@ -985,7 +997,7 @@ |
986 | 998 | var pKey = this.local_settings[ 'default' ]; |
987 | 999 | this.updatePresetSelection( pKey ); |
988 | 1000 | |
989 | | - // set the actual HTML & widgets based on any local settings values: |
| 1001 | + // Set the actual HTML & widgets based on any local settings values: |
990 | 1002 | $j.each( _this.local_settings.presets['custom']['conf'], function( inx, val ) { |
991 | 1003 | if ( $j( _this.selector + ' ._' + inx ).length != 0 ) { |
992 | 1004 | $j( _this.selector + ' ._' + inx ).val( val ); |
Index: branches/MwEmbedStandAlone/modules/ApiProxy/loader.js |
— | — | @@ -1,7 +1,7 @@ |
2 | 2 | /* apiProxy Loader */ |
3 | 3 | |
4 | 4 | mw.addClassFilePaths( { |
5 | | - "mw.ApiProxy" : "mw.ApiProxy.js", |
| 5 | + "mw.ApiProxy" : "mw.ApiProxy.js" |
6 | 6 | } ); |
7 | 7 | |
8 | 8 | mw.addModuleLoader( 'ApiProxy', function( callback ) { |
Index: branches/MwEmbedStandAlone/modules/ApiProxy/mw.ApiProxy.js |
— | — | @@ -17,18 +17,21 @@ |
18 | 18 | * having a separate class for "server" and "client" api usage |
19 | 19 | * |
20 | 20 | */ |
21 | | - |
| 21 | +/* |
22 | 22 | mw.addMessages( { |
23 | | - "mwe-setting-up-proxy" : "Setting up proxy...", |
24 | | - "mwe-re-try" : "Retry API request", |
25 | | - "mwe-re-trying" : "Retrying API request...", |
26 | | - "mwe-proxy-not-ready" : "Proxy is not configured", |
27 | | - "mwe-please-login" : "The request failed. Are you logged in on $1 ? Please $2 and try again", |
28 | | - "mwe-log-in-link" : "log in", |
29 | | - "mwe-remember-loging" : "General security reminder: Only login to web sites when your address bar displays that site's address." |
| 23 | + "mwe-apiproxy-setting-up-proxy" : "Setting up proxy...", |
| 24 | + "mwe-apiproxy-re-try" : "Retry API request", |
| 25 | + "mwe-apiproxy-re-trying" : "Retrying API request...", |
| 26 | + "mwe-apiproxy-proxy-not-ready" : "Proxy is not configured", |
| 27 | + "mwe-apiproxy-please-login" : "The request failed. Are you logged in on $1 ? Please $2 and try again", |
| 28 | + "mwe-apiproxy-log-in-link" : "log in", |
| 29 | + "mwe-apiproxy-remember-loging" : "General security reminder: Only login to web sites when your address bar displays that site's address." |
30 | 30 | } ); |
| 31 | +*/ |
31 | 32 | |
| 33 | +mw.includeAllModuleMsgs(); |
32 | 34 | |
| 35 | + |
33 | 36 | /** |
34 | 37 | * apiProxy jQuery binding |
35 | 38 | * |
— | — | @@ -556,12 +559,12 @@ |
557 | 560 | } |
558 | 561 | |
559 | 562 | var buttons = { }; |
560 | | - buttons[ gM( 'mwe-re-try' ) ] = function() { |
561 | | - mw.addLoaderDialog( gM( 'mwe-re-trying' ) ); |
| 563 | + buttons[ gM( 'mwe-apiproxy-re-try' ) ] = function() { |
| 564 | + mw.addLoaderDialog( gM( 'mwe-apiproxy-re-trying' ) ); |
562 | 565 | // Re try the same context request: |
563 | 566 | doFrameProxy( context ); |
564 | 567 | } |
565 | | - buttons[ gM( 'mwe-cancel' ) ] = function() { |
| 568 | + buttons[ gM( 'mwe-apiproxy-cancel' ) ] = function() { |
566 | 569 | mw.closeLoaderDialog ( ); |
567 | 570 | } |
568 | 571 | |
— | — | @@ -572,7 +575,7 @@ |
573 | 576 | |
574 | 577 | var $dialogMsg = $j('<p />'); |
575 | 578 | $dialogMsg.append( |
576 | | - gM( 'mwe-please-login', |
| 579 | + gM( 'mwe-apiproxy-please-login', |
577 | 580 | pUri.host, |
578 | 581 | |
579 | 582 | // Add log-in link: |
— | — | @@ -581,17 +584,17 @@ |
582 | 585 | 'href' : login_url, |
583 | 586 | 'target' : '_new' |
584 | 587 | } ) |
585 | | - .text( gM('mwe-log-in-link') ) |
| 588 | + .text( gM('mwe-apiproxy-log-in-link') ) |
586 | 589 | ) |
587 | 590 | ) |
588 | 591 | // Add the security note as well: |
589 | 592 | $dialogMsg.append( |
590 | 593 | $j('<br />'), |
591 | | - gM( 'mwe-remember-loging' ) |
| 594 | + gM( 'mwe-apiproxy-remember-loging' ) |
592 | 595 | ) |
593 | 596 | |
594 | 597 | mw.addDialog( |
595 | | - gM( 'mwe-proxy-not-ready' ), |
| 598 | + gM( 'mwe-apiproxy-proxy-not-ready' ), |
596 | 599 | $dialogMsg, |
597 | 600 | buttons |
598 | 601 | ) |