From 6f098bcd2b733471500109f22106d7271cc1c785 Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Sat, 7 Nov 2009 13:38:59 +0000 Subject: [PATCH] * winks at Michael Dale and mumbles something about Title Case * * remove trailing whitespace --- js2/mwEmbed/libAddMedia/dragDropFile.js | 60 ++++++++++----------- js2/mwEmbed/libTimedText/mvTextInterface.js | 22 ++++---- js2/mwEmbed/php/languages/mwEmbed.i18n.php | 4 +- 3 files changed, 42 insertions(+), 44 deletions(-) diff --git a/js2/mwEmbed/libAddMedia/dragDropFile.js b/js2/mwEmbed/libAddMedia/dragDropFile.js index f4250876ef..a19ea3e475 100644 --- a/js2/mwEmbed/libAddMedia/dragDropFile.js +++ b/js2/mwEmbed/libAddMedia/dragDropFile.js @@ -1,8 +1,8 @@ -/* firefox 3.6 drag-drop uploading +/* firefox 3.6 drag-drop uploading */ loadGM({ "mwe-upload-multi" : "Upload {{PLURAL:$1|file|files}}", - "mwe-review-upload": "Review File {{PLURAL:$1|Upload|Uploads}}" + "mwe-review-upload": "Review file {{PLURAL:$1|upload|uploads}}" }); (function($){ @@ -10,53 +10,53 @@ loadGM({ js_log("drag drop: " + this.selector); //setup drag binding and highlight var dC = $j( this.selector ).get(0); - dC.addEventListener("dragenter", + dC.addEventListener("dragenter", function(event){ $j(dC).css('border', 'solid red'); event.stopPropagation(); event.preventDefault(); }, false); - dC.addEventListener("dragleave", + dC.addEventListener("dragleave", function(event){ //default textbox css (should be an easy way to do this) $j(dC).css('border', ''); - event.stopPropagation(); + event.stopPropagation(); event.preventDefault(); }, false); - dC.addEventListener("dragover", - function(event){ - event.stopPropagation(); + dC.addEventListener("dragover", + function(event){ + event.stopPropagation(); event.preventDefault(); }, false); - dC.addEventListener("drop", - function( event ){ + dC.addEventListener("drop", + function( event ){ doDrop( event ); - //handle the drop loader and call event + //handle the drop loader and call event }, false); function doDrop(event){ var dt = event.dataTransfer, - files = dt.files, + files = dt.files, fileCount = files.length; - + event.stopPropagation(); event.preventDefault(); - + $j('#multiple_file_input').remove(); - + $j('body').append('
'+ + 'id="multiple_file_input">'+ '
'); - - - var cBtn = {}; + + + var cBtn = {}; cBtn[ gM('mwe-cancel') ] = function(){ $j(this).dialog('close'); } cBtn[ gM('mwe-upload-multi', fileCount) ] = function(){ alert('do multiple file upload'); } - //open up the dialog + //open up the dialog $j('#multiple_file_input').dialog({ bgiframe: true, autoOpen: true, @@ -69,32 +69,30 @@ loadGM({ $j(window).resize(function(){ $j('#multiple_file_input').dialogFitWindow(); }); - //add the inital table / title: + //add the inital table / title: $j('#multiple_file_input').html('

' + gM('mwe-review-upload') + '

'+ '
'); - $j.each(files, function(i, file){ - if(file.fileSize < 64048576) { + $j.each(files, function(i, file){ + if(file.fileSize < 64048576) { $j('#multiple_file_input .table_list').append( '' + '' +''+ - '' + + '' + 'File Name:
'+ - 'File Desc:
'+ + 'File Desc:
'+ ''+ '' - ); + ); /*$j.addDialog( "upload this image", '' + '
name: ' + files[i].name + '
' + '
size: ' + files[i].fileSize + '
' + '
mime: ' + files[i].mediaType + '
'); */ - //do the add-media-wizard with the upload tab + //do the add-media-wizard with the upload tab } else { alert("file is too big, needs to be below 64mb"); - } - }); + } + }); } } })(jQuery); - - diff --git a/js2/mwEmbed/libTimedText/mvTextInterface.js b/js2/mwEmbed/libTimedText/mvTextInterface.js index 9843e66071..e566f2544f 100644 --- a/js2/mwEmbed/libTimedText/mvTextInterface.js +++ b/js2/mwEmbed/libTimedText/mvTextInterface.js @@ -5,7 +5,7 @@ loadGM({ "mwe-close" : "close", "mwe-improve_transcript" : "Improve", "mwe-no_text_tracks_found" : "No text tracks were found", - "mwe-subtitles" : "$1 Subtitles" + "mwe-subtitles" : "$1 subtitles" }) // text interface object (for inline display captions) var mvTextInterface = function( parentEmbed ){ @@ -36,7 +36,7 @@ mvTextInterface.prototype = { if(this.pe.roe || _this.pe.wikiTitleKey ){ if(!this.pe.media_element.addedROEData){ js_log("load roe data!"); - $j('#mv_txt_load_'+_this.pe.id).show(); //show the loading icon + $j('#mv_txt_load_'+_this.pe.id).show(); //show the loading icon if(_this.pe.roe){ do_request( _this.pe.roe, function(data) { @@ -44,16 +44,16 @@ mvTextInterface.prototype = { _this.pe.media_element.addROE(data); _this.getParseTimedText_rowReady(); }); - }else if( _this.pe.wikiTitleKey ){ - do_api_req({ - 'url': apiUrl, + }else if( _this.pe.wikiTitleKey ){ + do_api_req({ + 'url': apiUrl, 'data': { 'list' : 'allpages', 'apprefix' : 'TimedText:' + _this.pe.wikiTitleKey } }, function( subData ) { do_api_req({ - 'url': apiUrl, + 'url': apiUrl, 'data': { 'meta' : 'siteinfo', 'siprop' : 'languages' @@ -64,12 +64,12 @@ mvTextInterface.prototype = { for(var j in lagRaw){ langData[ lagRaw[j].code ] = lagRaw[j]['*']; } - for(var i in subData.query.allpages){ + for(var i in subData.query.allpages){ var subPage = subData.query.allpages[i]; langKey = subPage.title.split('.'); langKey = langKey[ langKey.length-2 ]; if( !langData[ langKey] ){ - js_log('Error: langkey:'+ langKey + ' not found'); + js_log('Error: langkey:'+ langKey + ' not found'); }else{ var textElm = document.createElement('text'); $j(textElm).attr({ @@ -77,13 +77,13 @@ mvTextInterface.prototype = { 'lang' : langKey, 'type' : "text/x-srt", 'title' : gM('mwe-subtitles', langData[ langKey]), - 'src' : wgServer + wgScript + '?title=' + subPage.title + '&action=raw' - }); + 'src' : wgServer + wgScript + '?title=' + subPage.title + '&action=raw' + }); _this.pe.media_element.tryAddSource( textElm ); _this.getParseTimedText_rowReady(); } } - }); //do_api_req({ + }); //do_api_req({ }); //function( subData ) { } }else{ diff --git a/js2/mwEmbed/php/languages/mwEmbed.i18n.php b/js2/mwEmbed/php/languages/mwEmbed.i18n.php index b10819b2a9..beaf71647d 100644 --- a/js2/mwEmbed/php/languages/mwEmbed.i18n.php +++ b/js2/mwEmbed/php/languages/mwEmbed.i18n.php @@ -48,7 +48,7 @@ $messages['en'] = array( 'mwe-close' => 'close', 'mwe-improve_transcript' => 'Improve', 'mwe-no_text_tracks_found' => 'No text tracks were found', - 'mwe-subtitles' => '$1 Subtitles', + 'mwe-subtitles' => '$1 subtitles', /* * js file: /libSequencer/mvTimedEffectsEdit.js @@ -312,7 +312,7 @@ $messages['en'] = array( * js file: /libAddMedia/dragDropFile.js */ 'mwe-upload-multi' => 'Upload {{PLURAL:$1|file|files}}', - 'mwe-review-upload' => 'Review File {{PLURAL:$1|Upload|Uploads}}', + 'mwe-review-upload' => 'Review file {{PLURAL:$1|upload|uploads}}', /* * js file: /libEmbedVideo/embedVideo.js -- 2.20.1