Index: trunk/phase3/js2/mwEmbed/libAddMedia/mvFirefogg.js |
— | — | @@ -10,7 +10,7 @@ |
11 | 11 | "fogg-installed" : "Firefogg is Installed", |
12 | 12 | "fogg-for_improved_uplods" : "For Improved uploads: ", |
13 | 13 | "fogg-please_install" : "<a href=\"$1\">Install Firefogg</a>. More <a href=\"http://commons.wikimedia.org/wiki/Commons:Firefogg\">about firefogg</a>", |
14 | | - "fogg-use_latest_fox" : "Please first install <a href=\"http://www.mozilla.com/en-US/firefox/upgrade.html?from=firefogg\">Firefox 3.5</a>. <i>then revisit this page to install the <b>firefogg</b> extention</i>", |
| 14 | + "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> extention</i>", |
15 | 15 | "fogg-passthrough_mode" : "Your selected file is already ogg or not a video file", |
16 | 16 | "fogg-transcoding" : "Encoding Video to Ogg", |
17 | 17 | "fogg-encoding-done" : "Encoding Done" |
— | — | @@ -196,7 +196,7 @@ |
197 | 197 | _this.selectFogg(); |
198 | 198 | }); |
199 | 199 | //also setup the text file display on Click to select file: |
200 | | - $j( this.target_input_file_name ).unbind().attr('readonly', 'readonly').click(function(){ |
| 200 | + $j(this.target_input_file_name).unbind().attr('readonly', 'readonly').click(function(){ |
201 | 201 | _this.selectFogg(); |
202 | 202 | }) |
203 | 203 | |
— | — | @@ -212,7 +212,7 @@ |
213 | 213 | } |
214 | 214 | return ; |
215 | 215 | } |
216 | | - //if they have the right version of mozilla provide install link: |
| 216 | + //they have the right version of mozilla provide install link: |
217 | 217 | var os_link = false; |
218 | 218 | if(navigator.oscpu){ |
219 | 219 | if(navigator.oscpu.search('Linux') >= 0) |
— | — | @@ -224,7 +224,7 @@ |
225 | 225 | } |
226 | 226 | //if rewriting form use upload msg text |
227 | 227 | var upMsg = (_this.form_rewrite) ? gM('fogg-for_improved_uplods') : ''; |
228 | | - $j( _this.target_please_install ).html( upMsg + gM('fogg-please_install',os_link )).css('padding', '10px').show(); |
| 228 | + $j(_this.target_please_install).html( upMsg + gM('fogg-please_install',os_link )).css('padding', '10px').show(); |
229 | 229 | } |
230 | 230 | //setup the target save local file bindins: |
231 | 231 | $j( _this.target_btn_save_local_file ).unbind().click(function(){ |
— | — | @@ -243,7 +243,7 @@ |
244 | 244 | //assume input target |
245 | 245 | setupForm: function(){ |
246 | 246 | js_log('firefogg::setupForm::'); |
247 | | - //to parent form setup if we want http updates |
| 247 | + //to parent form setup if we want http updates |
248 | 248 | if( this.form_rewrite ){ |
249 | 249 | //do parent form setup: |
250 | 250 | this.pe_setupForm(); |
— | — | @@ -279,7 +279,7 @@ |
280 | 280 | inTag+= '/><span id="' + $j(this.selector).attr('name') + '_fogg-control"></span>'; |
281 | 281 | |
282 | 282 | js_log('set input: ' + inTag); |
283 | | - $j( this.selector ).replaceWith( inTag ); |
| 283 | + $j(this.selector).replaceWith(inTag); |
284 | 284 | |
285 | 285 | this.target_input_file_name = 'input[name=' + $j(this.selector).attr('name') + ']'; |
286 | 286 | //update the selector to the control target: |
— | — | @@ -292,9 +292,6 @@ |
293 | 293 | this.doControlBindings(); |
294 | 294 | }, |
295 | 295 | getEditForm:function(){ |
296 | | - if( this.target_edit_from ){ |
297 | | - return this.pe_getEditForm(); |
298 | | - } |
299 | 296 | js_log('get form: action=' + $j(this.selector).parents().find("form").attr('action')); |
300 | 297 | return $j(this.selector).parents().find("form").get(0); |
301 | 298 | }, |
— | — | @@ -407,7 +404,7 @@ |
408 | 405 | getProgressTitle:function(){ |
409 | 406 | js_log("fogg:getProgressTitle f:" + this.fogg_enabled + ' rw:' + this.form_rewrite); |
410 | 407 | //return the parent if we don't have fogg turned on: |
411 | | - if(! this.fogg_enabled ) |
| 408 | + if(! this.fogg_enabled || !this.firefogg_form_action ) |
412 | 409 | return this.pe_getProgressTitle(); |
413 | 410 | if( !this.form_rewrite ) |
414 | 411 | return gM('fogg-transcoding'); |
— | — | @@ -416,12 +413,12 @@ |
417 | 414 | }, |
418 | 415 | doUploadSwitch:function(){ |
419 | 416 | var _this = this; |
420 | | - js_log( "firefogg: doUploadSwitch:: " + this.fogg_enabled ); |
| 417 | + js_log("firefogg: doUploadSwitch:: " + this.fogg_enabled); |
421 | 418 | //make sure firefogg is enabled otherwise do parent UploadSwich: |
422 | 419 | if( !this.fogg_enabled || !this.firefogg_form_action ) |
423 | 420 | return _this.pe_doUploadSwitch(); |
424 | 421 | |
425 | | - //check what mode to use firefogg in: |
| 422 | + //check what mode to use firefogg in: |
426 | 423 | if( _this.upload_mode == 'post' ){ |
427 | 424 | _this.doEncode(); |
428 | 425 | }else if( _this.upload_mode == 'api' && _this.chunks_supported){ //if api mode and chunks supported do chunkUpload |
— | — | @@ -431,7 +428,7 @@ |
432 | 429 | } |
433 | 430 | }, |
434 | 431 | //doChunkUpload does both uploading and encoding at the same time and uploads one meg chunks as they are ready |
435 | | - doChunkUpload : function(){ |
| 432 | + doChunkUpload : function(){ |
436 | 433 | var _this = this; |
437 | 434 | _this.action_done = false; |
438 | 435 | |
— | — | @@ -458,18 +455,17 @@ |
459 | 456 | 'comment' : _this.formData['wpUploadDescription'], |
460 | 457 | 'enablechunks': true |
461 | 458 | }; |
462 | | - |
463 | 459 | //check for editToken: |
464 | | - if( !this.etoken ) |
| 460 | + if(!this.etoken) |
465 | 461 | this.etoken = _this.formData['wpEditToken']; |
466 | 462 | |
467 | | - if( this.etoken ) |
| 463 | + if(this.etoken) |
468 | 464 | aReq['token'] = this.etoken; |
469 | 465 | |
470 | 466 | if( _this.formData['wpWatchthis'] ) |
471 | 467 | aReq['watch'] = _this.formData['wpWatchthis']; |
472 | 468 | |
473 | | - if( _this.formData['wpIgnoreWarning'] ) |
| 469 | + if( _this.formData['wpIgnoreWarning'] ) |
474 | 470 | aReq['ignorewarnings'] = _this.formData['wpIgnoreWarning']; |
475 | 471 | |
476 | 472 | js_log('do fogg upload/encode call: '+ _this.api_url + ' :: ' + JSON.stringify( aReq ) ); |
— | — | @@ -481,7 +477,6 @@ |
482 | 478 | }, |
483 | 479 | //doEncode and monitor progress: |
484 | 480 | doEncode : function(){ |
485 | | - js_log('firefogg:doEncode'); |
486 | 481 | var _this = this; |
487 | 482 | _this.action_done = false; |
488 | 483 | _this.dispProgressOverlay(); |
— | — | @@ -602,7 +597,7 @@ |
603 | 598 | _this.updateProgressWin( gM('successfulupload'), gM( 'mv_upload_done', _this.fogg.resultUrl),buttons); |
604 | 599 | }else{ |
605 | 600 | //done state with error? ..not really possible given how firefogg works |
606 | | - js_log(" upload done, in chunks mode, but no resultUrl::" + response_text); |
| 601 | + js_log(" upload done, in chunks mode, but no resultUrl!"); |
607 | 602 | } |
608 | 603 | } |
609 | 604 | }else{ |
Index: trunk/phase3/js2/mwEmbed/libAddMedia/remoteSearchDriver.js |
— | — | @@ -93,7 +93,7 @@ |
94 | 94 | * sets the default display item: |
95 | 95 | * can be any content_providers key or 'all' |
96 | 96 | */ |
97 | | - disp_item : 'wiki_commons', |
| 97 | + disp_item : 'this_wiki', |
98 | 98 | /** the default content providers list. |
99 | 99 | * |
100 | 100 | * (should be note that special tabs like "upload" and "combined" don't go into the content proviers list: |
— | — | @@ -1131,7 +1131,7 @@ |
1132 | 1132 | }); |
1133 | 1133 | } |
1134 | 1134 | }, |
1135 | | - checkRepoLocal:function( cp ){ |
| 1135 | + checkRepoLocal:function( cp ){ |
1136 | 1136 | if( cp.local ){ |
1137 | 1137 | return true; |
1138 | 1138 | }else{ |
— | — | @@ -1145,8 +1145,7 @@ |
1146 | 1146 | } |
1147 | 1147 | } |
1148 | 1148 | return false; |
1149 | | - } |
1150 | | - |
| 1149 | + } |
1151 | 1150 | }, |
1152 | 1151 | checkImportResource:function( rObj, cir_callback){ |
1153 | 1152 | //@@todo get the localized File/Image namespace name or do a general {NS}:Title |
Index: trunk/phase3/js2/mwEmbed/mv_embed.js |
— | — | @@ -73,7 +73,8 @@ |
74 | 74 | |
75 | 75 | //init the global Msg if not already |
76 | 76 | if(!gMsg){var gMsg={};} |
77 | | -//laguage loader: |
| 77 | + |
| 78 | +//laguage msg loader: |
78 | 79 | function loadGM( msgSet ){ |
79 | 80 | for(var i in msgSet){ |
80 | 81 | gMsg[ i ] = msgSet[i]; |
— | — | @@ -98,7 +99,7 @@ |
99 | 100 | * @path the path to the file (or set of files) with ending slash |
100 | 101 | * @gClasses the set of classes |
101 | 102 | * if an array $j.className become jquery.className.js |
102 | | - * if an asssociative objec then key => value paris are used |
| 103 | + * if an asssociative object then key => value paris are used |
103 | 104 | */ |
104 | 105 | if(typeof mvClassPaths == 'undefined') |
105 | 106 | mvClassPaths = {}; |
— | — | @@ -112,7 +113,7 @@ |
113 | 114 | path = ''; |
114 | 115 | if(gClasses.length){ |
115 | 116 | //do array loop: |
116 | | - for(var i=0; i<gClasses.length; i++){ |
| 117 | + for(var i=0; i < gClasses.length; i++){ |
117 | 118 | if(typeof gClasses[i] != 'undefined'){ |
118 | 119 | //setup normal replacement of j with jquery |
119 | 120 | var jsName = ( gClasses[i].substr(0,3) == '$j.' ) ? opt['j_replace'] + gClasses[i].substr(3) : gClasses[i]; |
— | — | @@ -125,8 +126,7 @@ |
126 | 127 | //assume object with key:path: |
127 | 128 | mvClassPaths[i] = path + gClasses[ i ]; |
128 | 129 | } |
129 | | - } |
130 | | - var cat = mvClassPaths; |
| 130 | + } |
131 | 131 | } |
132 | 132 | function mvGetClassPath(k){ |
133 | 133 | if( mvClassPaths[k] ){ |
— | — | @@ -757,8 +757,7 @@ |
758 | 758 | */ |
759 | 759 | function mv_jqueryBindings(){ |
760 | 760 | js_log('mv_jqueryBindings'); |
761 | | - (function($) { |
762 | | - |
| 761 | + (function($) { |
763 | 762 | $.fn.addMediaWiz = function( iObj, callback ){ |
764 | 763 | //first set the cursor for the button to "loading" |
765 | 764 | $j(this.selector).css('cursor','wait').attr('title', gM('loading_title')); |
Index: trunk/phase3/js2/mwEmbed/libEmbedVideo/embedVideo.js |
— | — | @@ -114,15 +114,17 @@ |
115 | 115 | mvEmbed.init( swap_done_callback, force_id ); |
116 | 116 | } |
117 | 117 | mvEmbed = { |
| 118 | + //flist stores the set of functions to run after the video has been swaped in. |
118 | 119 | flist:new Array(), |
119 | 120 | init:function( swap_done_callback, force_id ){ |
| 121 | + |
120 | 122 | if(swap_done_callback) |
121 | 123 | mvEmbed.flist.push( swap_done_callback ); |
| 124 | + |
122 | 125 | //get mv_embed location if it has not been set |
123 | 126 | js_log('mv_embed ' + MV_EMBED_VERSION); |
124 | 127 | |
125 | | - var loadPlaylistLib=false; |
126 | | - //set up the jQuery selector: |
| 128 | + var loadPlaylistLib=false; |
127 | 129 | |
128 | 130 | var eAction = function(this_elm){ |
129 | 131 | js_log( "Do SWAP: " + $j(this_elm).attr("id") + ' tag: '+ this_elm.tagName.toLowerCase() ); |
— | — | @@ -276,7 +278,7 @@ |
277 | 279 | getControls:function( embedObj ){ |
278 | 280 | js_log('f:controlsBuilder:: opt:' + this.options); |
279 | 281 | this.id = (embedObj.pc)?embedObj.pc.pp.id:embedObj.id; |
280 | | - this.avaliable_width=embedObj.playerPixelWidth(); |
| 282 | + this.available_width = embedObj.playerPixelWidth(); |
281 | 283 | //make pointer to the embedObj |
282 | 284 | this.embedObj =embedObj; |
283 | 285 | var _this = this; |
— | — | @@ -297,14 +299,14 @@ |
298 | 300 | var o=''; |
299 | 301 | for( var i in this.components ){ |
300 | 302 | if( this.supports[i] ){ |
301 | | - if( this.avaliable_width > this.components[i].w ){ |
| 303 | + if( this.available_width > this.components[i].w ){ |
302 | 304 | //special case with playhead don't add unless we have 60px |
303 | | - if( i=='play_head' && ctrlBuilder.avaliable_width < 60 ) |
| 305 | + if( i == 'play_head' && ctrlBuilder.available_width < 60 ) |
304 | 306 | continue; |
305 | 307 | o+=this.components[i].o(); |
306 | | - this.avaliable_width -= this.components[i].w; |
| 308 | + this.available_width -= this.components[i].w; |
307 | 309 | }else{ |
308 | | - js_log('not enough space for control component:'+i); |
| 310 | + js_log('not enough space for control component:' + i); |
309 | 311 | } |
310 | 312 | } |
311 | 313 | } |
— | — | @@ -581,7 +583,7 @@ |
582 | 584 | 'play_head':{ |
583 | 585 | 'w':0, //special case (takes up remaining space) |
584 | 586 | 'o':function(){ |
585 | | - return '<div class="play_head" id="mv_play_head_'+ctrlBuilder.id+'" style="width: ' + (ctrlBuilder.avaliable_width - 30) + 'px;"></div>'; |
| 587 | + return '<div class="play_head" id="mv_play_head_' + ctrlBuilder.id + '" style="width: ' + ( ctrlBuilder.available_width - 30 ) + 'px;"></div>'; |
586 | 588 | } |
587 | 589 | } |
588 | 590 | } |
Index: trunk/phase3/js2/mwEmbed/README |
— | — | @@ -2,7 +2,8 @@ |
3 | 3 | * |
4 | 4 | * mwEmbed version 1.2 |
5 | 5 | * for details see: http://www.mediawiki.org/wiki/MwEmbed |
6 | | -* and this README |
| 6 | +* For an overview of all mwEmbed files see: |
| 7 | +* http://www.mediawiki.org/wiki/MwEmbed |
7 | 8 | * |
8 | 9 | * All Metavid Wiki code is Released under the GPL2 |
9 | 10 | * for more info visit http:/metavid.ucsc.edu/code |
Index: branches/new-upload/phase3/js2/mwEmbed/libTimedText/mvTextInterface.js |
— | — | @@ -1,12 +1,11 @@ |
2 | 2 | |
3 | 3 | loadGM({ |
4 | | - |
5 | 4 | "select_transcript_set" : "Select Layers", |
6 | 5 | "auto_scroll" : "auto scroll", |
7 | 6 | "close" : "close", |
8 | | - "improve_transcript" : "Improve" |
9 | | - |
| 7 | + "improve_transcript" : "Improve", |
10 | 8 | }) |
| 9 | + |
11 | 10 | // text interface object (for inline display captions) |
12 | 11 | var mvTextInterface = function( parentEmbed ){ |
13 | 12 | return this.init( parentEmbed ); |
— | — | @@ -181,7 +180,7 @@ |
182 | 181 | _this.pe.highlightPlaySection( { |
183 | 182 | 'start' : $j(this).parent().attr("start"), |
184 | 183 | 'end' : $j(this).parent().attr("end") |
185 | | - }); |
| 184 | + }); |
186 | 185 | }, |
187 | 186 | out:function () { |
188 | 187 | js_log('mvttseek: out'); |
— | — | @@ -288,12 +287,8 @@ |
289 | 288 | $j('#mmbody_'+this.pe.id +' .tt_scroll_highlight').removeClass('tt_scroll_highlight'); |
290 | 289 | } |
291 | 290 | }; |
292 | | - /*js_log('search_for_range:'+search_for_range + ' for: '+ cur_time);*/ |
293 | | - if( search_for_range ){ |
294 | | - //search for current time: add tt_scroll_highlight to clip |
295 | | - // optimize: |
296 | | - // should do binnary search not iterative |
297 | | - // avoid jquery function calls do native loops |
| 291 | + if(search_for_range){ |
| 292 | + //search for current time: flash red border trascript |
298 | 293 | $j('#mmbody_'+this.pe.id +' .mvtt').each(function(){ |
299 | 294 | if(npt2seconds($j(this).attr('start') ) < cur_time && |
300 | 295 | npt2seconds($j(this).attr('end') ) > cur_time){ |
— | — | @@ -302,7 +297,7 @@ |
303 | 298 | scrollTop: $j(this).get(0).offsetTop |
304 | 299 | }, 'slow'); |
305 | 300 | $j(this).addClass('tt_scroll_highlight'); |
306 | | - //js_log('should add class to: ' + $j(this).attr('id')); |
| 301 | + js_log('should add class to: ' + $j(this).attr('id')); |
307 | 302 | //done with loop |
308 | 303 | return false; |
309 | 304 | } |
— | — | @@ -517,4 +512,4 @@ |
518 | 513 | } |
519 | 514 | } |
520 | 515 | } |
521 | | -}; |
| 516 | +}; |
\ No newline at end of file |