r68586 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r68585‎ | r68586 | r68587 >
Date:20:58, 25 June 2010
Author:dale
Status:deferred
Tags:
Comment:
added language support to firefogg "make"
Modified paths:
  • /branches/MwEmbedStandAlone/modules/AddMedia/AddMedia.i18n.php (modified) (history)
  • /branches/MwEmbedStandAlone/modules/AddMedia/mw.FirefoggGUI.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/AddMedia/tests/Firefogg_GUI.html (modified) (history)

Diff [purge]

Index: branches/MwEmbedStandAlone/modules/AddMedia/tests/Firefogg_GUI.html
@@ -2,8 +2,35 @@
33 <html><head>
44 <meta http-equiv="content-type" content="text/html; charset=UTF-8">
55 <title>Firefogg - Make Ogg/Webm Video in your Browser</title>
6 - <!--<script type="text/javascript" src="../../../ResourceLoader.php?class=window.jQuery,mwEmbed"></script> -->
7 - <script type="text/javascript" src="../../../mwEmbed.js?debug=true"></script>
 6+ <script type="text/javascript">
 7+ // list of language with high percentage of messages translated:
 8+ var langSupported = ['en','mk','dsb','gsw','ru','be-tarask','hsb','es','gl','fr','ia','de','nl','pt','ja','hu','tr'];
 9+ function getUrlParam( name ){
 10+ name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
 11+ var regexS = "[\\?&]"+name+"=([^&#]*)";
 12+ var regex = new RegExp( regexS );
 13+ var results = regex.exec( window.location.href );
 14+ if( results == null )
 15+ return "";
 16+ else
 17+ return results[1];
 18+ }
 19+ var langKey = ( getUrlParam( 'uselang' ) == '' ) ? 'en' : getUrlParam( 'uselang' );
 20+
 21+ var keyOky = false;
 22+ for(var i in langSupported){
 23+ if( langKey == langSupported[i]){
 24+ keyOky = true;
 25+ break;
 26+ }
 27+ }
 28+ if( !keyOky ){
 29+ langKey = 'en';
 30+ }
 31+
 32+ document.write( '<script type="text/javascript" src="../../../ResourceLoader.php?class=window.jQuery,mwEmbed,mw.style.mwCommon&uselang=' + langKey + '"><\/script>' );
 33+ </script>
 34+ <!-- <script type="text/javascript" src="../../../mwEmbed.js?debug=true"></script> -->
835 <style type="text/css" media="all">
936 body {
1037 margin: 0;
@@ -73,7 +100,26 @@
74101 'encoder_interface' : true,
75102 'encode_local' : true
76103 });
77 - });
 104+ $j( '#fogg-status' ).append(
 105+ gM('fogg-wont-upload-to-server' ),
 106+ $j('<br />' )
 107+ );
 108+
 109+ for( var i = 0; i < langSupported.length; i++ ){
 110+ var urlParts = mw.parseUri( document.URL );
 111+ $j( '#fogg-status' ).append(
 112+ $j('<a />').text(
 113+ mw.Language.names[ langSupported[i] ]
 114+ )
 115+ .attr( {
 116+ 'href': urlParts.protocol + '://' + urlParts.host +
 117+ urlParts.path + '?uselang=' + langSupported[i]
 118+ } ),
 119+ $j('<span />').text( ' | ' )
 120+ )
 121+ }
 122+ });
 123+
78124 });
79125 </script>
80126 </head><body>
@@ -84,8 +130,8 @@
85131 </a><br>
86132 Make Ogg/Webm Video</h1>
87133 <br>
88 -<div style="margin-right:auto;margin-left:auto;width:500px;">
89 -Note: Your video file will be locally encoded and not upload to any server
 134+<div id="fogg-status" style="margin-right:auto;margin-left:auto;width:500px;">
 135+
90136 </div>
91137 <br>
92138
Index: branches/MwEmbedStandAlone/modules/AddMedia/mw.FirefoggGUI.js
@@ -3,6 +3,7 @@
44 */
55
66 mw.addMessages({
 7+ "fogg-wont-upload-to-server" : "Note: Your video file will be locally encoded and not upload to any server",
78 "fogg-save_local_file" : "Encode to File",
89 "fogg-help-sticky" : "Help (click to stick)",
910 "fogg-cg-preset" : "Preset: <strong>$1<\/strong>",
Index: branches/MwEmbedStandAlone/modules/AddMedia/AddMedia.i18n.php
@@ -31,6 +31,7 @@
3232 'mwe-filesource' => 'Source:',
3333 'mwe-filestatus' => 'Copyright status:',
3434 'mwe-loading-add-media-wiz' => 'Loading add media wizard',
 35+ 'fogg-wont-upload-to-server' => 'Note: Your video file will be locally encoded and not upload to any server',
3536 'fogg-save_local_file' => 'Encode to File',
3637 'fogg-help-sticky' => 'Help (click to stick)',
3738 'fogg-cg-preset' => 'Preset: <strong>$1</strong>',

Status & tagging log