-/* 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($){
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('<div title="' + gM('mwe-upload-multi', fileCount) + '" '+
'style="position:absolute;bottom:5em;top:3em;right:0px;left:0px" '+
- 'id="multiple_file_input">'+
+ 'id="multiple_file_input">'+
'</div>');
-
-
- 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,
$j(window).resize(function(){
$j('#multiple_file_input').dialogFitWindow();
});
- //add the inital table / title:
+ //add the inital table / title:
$j('#multiple_file_input').html('<h3>' + gM('mwe-review-upload') + '</h3>'+
'<table width="100%" border="1" class="table_list" style="border:none;"></table>');
- $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(
'<tr>' +
'<td width="300" style="padding:5px"><img width="250" src="'+ file.getAsDataURL() +'">' +'</td>'+
- '<td valign="top">' +
+ '<td valign="top">' +
'File Name: <input name="file['+i+'][title]" value="' + file.name + '"><br>'+
- 'File Desc: <textarea style="width:300px;" name="file['+i+'][desc]"></textarea><br>'+
+ 'File Desc: <textarea style="width:300px;" name="file['+i+'][desc]"></textarea><br>'+
'</td>'+
'</tr>'
- );
+ );
/*$j.addDialog( "upload this image", '<img width="300" src="' + files[i].getAsDataURL() + '">' +
'<br>name: ' + files[i].name + '</br>' +
'<br>size: ' + files[i].fileSize + '</br>' +
'<br>mime: ' + files[i].mediaType + '</br>');
*/
- //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);
-
-
"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 ){
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)
{
_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'
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({
'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{