Index: trunk/phase3/js2/mwEmbed/libTimedText/mvTextInterface.js |
— | — | @@ -1,9 +1,10 @@ |
2 | 2 | |
3 | 3 | loadGM({ |
4 | | - "select_transcript_set" : "Select layers", |
5 | | - "auto_scroll" : "auto scroll", |
6 | | - "close" : "close", |
7 | | - "improve_transcript" : "Improve" |
| 4 | + "mwe-select_transcript_set" : "Select layers", |
| 5 | + "mwe-auto_scroll" : "auto scroll", |
| 6 | + "mwe-close" : "close", |
| 7 | + "mwe-improve_transcript" : "Improve", |
| 8 | + "mwe-no_text_tracks_found" : "No text tracks were found" |
8 | 9 | }) |
9 | 10 | // text interface object (for inline display captions) |
10 | 11 | var mvTextInterface = function( parentEmbed ){ |
— | — | @@ -94,7 +95,7 @@ |
95 | 96 | |
96 | 97 | //if nothing found anywhere update the loading icon to say no tracks found |
97 | 98 | if(!default_found) |
98 | | - $j('#mv_txt_load_'+_this.pe.id).html( gM('no_text_tracks_found') ); |
| 99 | + $j('#mv_txt_load_'+_this.pe.id).html( gM('mwe-no_text_tracks_found') ); |
99 | 100 | |
100 | 101 | |
101 | 102 | }, |
— | — | @@ -229,7 +230,7 @@ |
230 | 231 | var _this = this; |
231 | 232 | js_log('getTsSelect'); |
232 | 233 | var selHTML = '<div id="mvtsel_' + this.pe.id + '" style="position:absolute;background:#FFF;top:30px;left:0px;right:0px;bottom:0px;overflow:auto;">'; |
233 | | - selHTML+='<b>' + gM('select_transcript_set') + '</b><ul>'; |
| 234 | + selHTML+='<b>' + gM('mwe-select_transcript_set') + '</b><ul>'; |
234 | 235 | //debugger; |
235 | 236 | for(var i in _this.availableTracks){ //for in loop ok on object |
236 | 237 | var checked = ( _this.availableTracks[i].display ) ? 'checked' : ''; |
— | — | @@ -237,7 +238,7 @@ |
238 | 239 | _this.availableTracks[i].getTitle() + '</li>'; |
239 | 240 | } |
240 | 241 | selHTML+='</ul>' + |
241 | | - '<a href="#" onClick="document.getElementById(\'' + this.pe.id + '\').textInterface.applyTsSelect();return false;">'+gM('close')+'</a>'+ |
| 242 | + '<a href="#" onClick="document.getElementById(\'' + this.pe.id + '\').textInterface.applyTsSelect();return false;">'+gM('mwe-close')+'</a>'+ |
242 | 243 | '</div>'; |
243 | 244 | $j('#metaBox_'+_this.pe.id).append( selHTML ); |
244 | 245 | }, |
— | — | @@ -342,13 +343,13 @@ |
343 | 344 | //add in loading icon: |
344 | 345 | var as_checked = (this.autoscroll)?'checked':''; |
345 | 346 | out+= '<div id="tt_mmenu_'+this.pe.id+'" class="ui-widget-header" style="font-size:.6em;position:absolute;top:0;height:30px;left:0px;right:0px;">' + |
346 | | - $j.btnHtml(gM('select_transcript_set'), 'tt-select', 'shuffle'); |
| 347 | + $j.btnHtml(gM('mwe-select_transcript_set'), 'tt-select', 'shuffle'); |
347 | 348 | if(this.pe.media_element.linkback){ |
348 | | - out+=' ' + $j.btnHtml(gM('improve_transcript'), 'tt-improve', 'document', {href:this.pe.media_element.linkback, target:'_new'}); |
| 349 | + out+=' ' + $j.btnHtml(gM('mwe-improve_transcript'), 'tt-improve', 'document', {href:this.pe.media_element.linkback, target:'_new'}); |
349 | 350 | } |
350 | 351 | out+='<input onClick="document.getElementById(\''+this.pe.id+'\').textInterface.setAutoScroll(this.checked);return false;" ' + |
351 | | - 'type="checkbox" '+as_checked +'>'+gM('auto_scroll') + ' ' + |
352 | | - $j.btnHtml(gM('close'), 'tt-close', 'circle-close'); |
| 352 | + 'type="checkbox" '+as_checked +'>'+gM('mwe-auto_scroll') + ' ' + |
| 353 | + $j.btnHtml(gM('mwe-close'), 'tt-close', 'circle-close'); |
353 | 354 | out+='</div>'; |
354 | 355 | return out; |
355 | 356 | }, |
Index: trunk/phase3/js2/mwEmbed/libAddMedia/simpleUploadForm.js |
— | — | @@ -5,14 +5,14 @@ |
6 | 6 | */ |
7 | 7 | |
8 | 8 | loadGM({ |
9 | | - "select_file" : "Select file", |
10 | | - "more_licence_options" : "For more licence options, view the <a href=\"$1\">normal upload page<\/a>", |
11 | | - "select_ownwork" : "I am uploading entirely my own work, and licencing it under : ", |
12 | | - "licence_cc-by-sa" : "Creative Commons Share Alike (3.0)", |
13 | | - "upload" : "Upload file", |
14 | | - "destfilename" : "Destination filename : ", |
15 | | - "summary" : "Summary", |
16 | | - "error_not_loggedin" : "You do not appear to be logged in or do not have upload privlages." |
| 9 | + "mwe-select_file" : "Select file", |
| 10 | + "mwe-more_licence_options" : "For more licence options, view the <a href=\"$1\">normal upload page<\/a>", |
| 11 | + "mwe-select_ownwork" : "I am uploading entirely my own work, and licencing it under:", |
| 12 | + "mwe-licence_cc-by-sa" : "Creative Commons Share Alike (3.0)", |
| 13 | + "mwe-upload" : "Upload file", |
| 14 | + "mwe-destfilename" : "Destination filename:", |
| 15 | + "mwe-summary" : "Summary", |
| 16 | + "mwe-error_not_loggedin" : "You do not appear to be logged in or do not have upload privileges." |
17 | 17 | }); |
18 | 18 | |
19 | 19 | var default_form_options = { |
— | — | @@ -41,7 +41,7 @@ |
42 | 42 | //much todo to improved this web form |
43 | 43 | get_mw_token('File:MyRandomFileTokenCheck', opt.api_target, function(eToken){ |
44 | 44 | if( !eToken || eToken == '+\\' ){ |
45 | | - $(this.selector).html( gM('error_not_loggedin') ); |
| 45 | + $(this.selector).html( gM('mwe-error_not_loggedin') ); |
46 | 46 | return false; |
47 | 47 | } |
48 | 48 | |
— | — | @@ -54,22 +54,22 @@ |
55 | 55 | '<input type="hidden" name="token" value="'+ eToken +'">' + |
56 | 56 | |
57 | 57 | //form name set: |
58 | | - '<label for="wpUploadFile">' + gM('select_file') + '</label><br>'+ |
| 58 | + '<label for="wpUploadFile">' + gM('mwe-select_file') + '</label><br>'+ |
59 | 59 | '<input type="file" style="display: inline;" name="wpUploadFile" size="15"/><br>' + |
60 | 60 | |
61 | | - '<label for="wpDestFile">' +gM('destfilename') + '</label><br>'+ |
62 | | - '<input type="text" name="wpDestFile" size="30" /><br>'+ |
| 61 | + '<label for="wpDestFile">' +gM('mwe-destfilename') + '</label><br>'+ |
| 62 | + '<input type="text" name="wpDestFile" size="30" /><br>'+ |
63 | 63 | |
64 | | - '<label for="wpUploadDescription">' + gM('summary') + ':</label><br>' + |
| 64 | + '<label for="wpUploadDescription">' + gM('mwe-summary') + ':</label><br>' + |
65 | 65 | '<textarea cols="30" rows="3" name="wpUploadDescription" tabindex="3"/><br>'+ |
66 | | - |
| 66 | + |
67 | 67 | '<div id="wpDestFile-warning"></div>' + |
68 | 68 | '<div style="clear:both;"></div>' + |
69 | | - |
70 | | - gM('select_ownwork') + '<br>' + |
71 | | - '<input type="checkbox" id="wpLicence" name="wpLicence" value="cc-by-sa">' + gM('licence_cc-by-sa') + '<br>' + |
72 | 69 | |
73 | | - '<input type="submit" accesskey="s" value="' + gM('upload') + '" name="wpUploadBtn" id="wpUploadBtn" tabindex="9"/>' + |
| 70 | + gM('mwe-select_ownwork') + '<br>' + |
| 71 | + '<input type="checkbox" id="wpLicence" name="wpLicence" value="cc-by-sa">' + gM('mwe-licence_cc-by-sa') + '<br>' + |
| 72 | + |
| 73 | + '<input type="submit" accesskey="s" value="' + gM('mwe-upload') + '" name="wpUploadBtn" id="wpUploadBtn" tabindex="9"/>' + |
74 | 74 | //close the form and div |
75 | 75 | '</form>'; |
76 | 76 | |
— | — | @@ -109,15 +109,15 @@ |
110 | 110 | 'warn_target':'#wpDestFile-warning' |
111 | 111 | }); |
112 | 112 | }); |
113 | | - |
114 | | - |
| 113 | + |
| 114 | + |
115 | 115 | //do destination check: |
116 | | - $j("[name='wpDestFile']").change(function(){ |
| 116 | + $j("[name='wpDestFile']").change(function(){ |
117 | 117 | $j(this).doDestCheck({ |
118 | 118 | 'warn_target':'#wpDestFile-warning' |
119 | 119 | }); |
120 | 120 | }); |
121 | | - |
| 121 | + |
122 | 122 | if(typeof opt.ondone_cb == 'undefined') |
123 | 123 | opt.ondone_cb = false; |
124 | 124 | |
— | — | @@ -129,13 +129,13 @@ |
130 | 130 | 'form_rewrite': true, |
131 | 131 | 'target_edit_from' : '#suf-upload', |
132 | 132 | 'new_source_cb' : function( orgFilename, oggName ){ |
133 | | - $j("#suf-upload [name='wpDestFile']").val( oggName ).doDestCheck({ |
134 | | - warn_target: "#wpDestFile-warning" |
135 | | - }); |
| 133 | + $j("#suf-upload [name='wpDestFile']").val( oggName ).doDestCheck({ |
| 134 | + warn_target: "#wpDestFile-warning" |
| 135 | + }); |
136 | 136 | }, |
137 | 137 | 'done_upload_cb' : opt.ondone_cb |
138 | 138 | }); |
139 | 139 | } |
140 | 140 | }); |
141 | 141 | } |
142 | | -})(jQuery); |
\ No newline at end of file |
| 142 | +})(jQuery); |
Index: trunk/phase3/js2/mwEmbed/libAddMedia/mvBaseUploadInterface.js |
— | — | @@ -1,7 +1,9 @@ |
2 | 2 | /** |
3 | 3 | * the base Upload Interface for uploading. |
4 | 4 | * |
5 | | - * this base uploader is optionally extended by firefogg |
| 5 | + * this base uploader is optionally extended by Firefogg |
| 6 | + * |
| 7 | + * @@todo: checkme: gM 'thumbnail-more' is used; only defined in MediaWiki core. Will that work properly? |
6 | 8 | */ |
7 | 9 | loadGM({ |
8 | 10 | "mwe-upload-transcode-in-progress" : "Transcode and upload in progress (do not close this window)", |
— | — | @@ -670,7 +672,7 @@ |
671 | 673 | ) |
672 | 674 | //just display an empty progress window |
673 | 675 | $j('#upProgressDialog').dialog('open'); |
674 | | - |
| 676 | + |
675 | 677 | //setup progress bar: |
676 | 678 | $j('#up-progressbar').progressbar({ |
677 | 679 | value:0 |
— | — | @@ -703,15 +705,15 @@ |
704 | 706 | * doDestCheck checks the destination |
705 | 707 | */ |
706 | 708 | $.fn.doDestCheck = function( opt ){ |
707 | | - var _this = this; |
708 | | - var destFile = this.selector; |
709 | | - //set up option defaults; |
| 709 | + var _this = this; |
| 710 | + var destFile = this.selector; |
| 711 | + //set up option defaults; |
710 | 712 | if(!opt.warn_target) |
711 | 713 | opt.warn_target = '#wpDestFile-warning'; |
712 | | - |
713 | | - //empty target warn: |
| 714 | + |
| 715 | + //empty target warn: |
714 | 716 | $j(opt.warn_target).empty(); |
715 | | - |
| 717 | + |
716 | 718 | //show loading |
717 | 719 | $j(destFile).after('<img id = "mw-spinner-wpDestFile" src ="'+ stylepath + '/common/images/spinner.gif" />'); |
718 | 720 | //try and get a thumb of the current file (check its destination) |
— | — | @@ -730,7 +732,7 @@ |
731 | 733 | //all good no file there |
732 | 734 | }else{ |
733 | 735 | for(var page_id in data.query.pages){ |
734 | | - var ntitle = ( data.query.normalized)? data.query.normalized[0].to : data.query.pages[ page_id ].title |
| 736 | + var ntitle = ( data.query.normalized)? data.query.normalized[0].to : data.query.pages[ page_id ].title |
735 | 737 | var img = data.query.pages[ page_id ].imageinfo[0]; |
736 | 738 | $j('#wpDestFile-warning').html( |
737 | 739 | '<ul>' + |
— | — | @@ -761,6 +763,5 @@ |
762 | 764 | } |
763 | 765 | } |
764 | 766 | }); |
765 | | - } |
| 767 | + } |
766 | 768 | })(jQuery); |
767 | | - |
Index: trunk/phase3/js2/mwEmbed/libAddMedia/searchLibs/baseRemoteSearch.js |
— | — | @@ -1,7 +1,7 @@ |
2 | 2 | //base remote search obj |
3 | 3 | |
4 | 4 | loadGM({ |
5 | | - "imported_from" : "$1 imported from [$2 $3]. See the original [$4 resource page] for more information." |
| 5 | + "mwe-imported_from" : "$1 imported from [$2 $3]. See the original [$4 resource page] for more information." |
6 | 6 | }) |
7 | 7 | // @key is name of rObj variable |
8 | 8 | // @value is where to find the value in the item xml |
— | — | @@ -171,7 +171,7 @@ |
172 | 172 | |
173 | 173 | }, |
174 | 174 | getImportResourceDescWiki:function(rObj){ |
175 | | - return gM('imported_from', [rObj.title, this.cp.homepage, this.cp.title, rObj.link]); |
| 175 | + return gM('mwe-imported_from', [rObj.title, this.cp.homepage, this.cp.title, rObj.link]); |
176 | 176 | }, |
177 | 177 | //for thigns like categories and the like |
178 | 178 | getExtraResourceDescWiki:function( rObj ){ |
Index: trunk/phase3/js2/mwEmbed/libAddMedia/searchLibs/metavidSearch.js |
— | — | @@ -1,8 +1,8 @@ |
2 | 2 | /* |
3 | | -* api modes (implementations should call these objects which inherit the mvBaseRemoteSearch |
| 3 | +* API modes (implementations should call these objects which inherit the mvBaseRemoteSearch |
4 | 4 | */ |
5 | 5 | loadGM({ |
6 | | - "mv_stream_title" : "$1 $2 to $3" |
| 6 | + "mwe-stream_title" : "$1 $2 to $3" |
7 | 7 | }); |
8 | 8 | var metavidSearch = function(iObj) { |
9 | 9 | return this.init(iObj); |
— | — | @@ -10,10 +10,10 @@ |
11 | 11 | metavidSearch.prototype = { |
12 | 12 | reqObj:{ //set up the default request paramaters |
13 | 13 | 'order':'recent', |
14 | | - 'feed_format':'rss' |
| 14 | + 'feed_format':'rss' |
15 | 15 | }, |
16 | 16 | init:function( iObj ){ |
17 | | - //init base class and inherit: |
| 17 | + //init base class and inherit: |
18 | 18 | var baseSearch = new baseRemoteSearch( iObj ); |
19 | 19 | for(var i in baseSearch){ |
20 | 20 | if(typeof this[i] =='undefined'){ |
— | — | @@ -22,11 +22,11 @@ |
23 | 23 | this['parent_'+i] = baseSearch[i]; |
24 | 24 | } |
25 | 25 | } |
26 | | - }, |
| 26 | + }, |
27 | 27 | getSearchResults:function(){ |
28 | | - //call parent: |
| 28 | + //call parent: |
29 | 29 | this.parent_getSearchResults(); |
30 | | - |
| 30 | + |
31 | 31 | var _this = this; |
32 | 32 | //start loading: |
33 | 33 | _this.loading= 1; |
— | — | @@ -36,127 +36,127 @@ |
37 | 37 | //add on the req_param |
38 | 38 | for(var i in this.reqObj){ |
39 | 39 | url += '&' + i + '=' + this.reqObj[i]; |
40 | | - } |
| 40 | + } |
41 | 41 | url += '&f[0][t]=match&f[0][v]=' + $j('#rsd_q').val(); |
42 | | - //add offset limit: |
| 42 | + //add offset limit: |
43 | 43 | url+='&limit=' + this.cp.limit; |
44 | | - url+='&offset=' + this.cp.offset; |
45 | | - |
| 44 | + url+='&offset=' + this.cp.offset; |
| 45 | + |
46 | 46 | do_request(url, function(data){ |
47 | | - |
48 | | - js_log('mvSearch: got data response'); |
| 47 | + |
| 48 | + js_log('mvSearch: got data response'); |
49 | 49 | //should have an xml rss data object: |
50 | 50 | _this.addRSSData( data , url ); |
51 | | - |
| 51 | + |
52 | 52 | //do some metavid specific pos processing on the rObj data: |
53 | | - for(var i in _this.resultsObj){ |
54 | | - var rObj = _this.resultsObj[i]; |
55 | | - var proe = parseUri( rObj['roe_url'] ); |
| 53 | + for(var i in _this.resultsObj){ |
| 54 | + var rObj = _this.resultsObj[i]; |
| 55 | + var proe = parseUri( rObj['roe_url'] ); |
56 | 56 | rObj['start_time'] = proe.queryKey['t'].split('/')[0]; |
57 | | - rObj['end_time'] = proe.queryKey['t'].split('/')[1]; |
| 57 | + rObj['end_time'] = proe.queryKey['t'].split('/')[1]; |
58 | 58 | rObj['stream_name'] = proe.queryKey['stream_name']; |
59 | | - |
60 | | - //all metavid content is public domain: |
| 59 | + |
| 60 | + //all metavid content is public domain: |
61 | 61 | rObj['license'] = _this.rsd.getLicenceFromKey( 'pd' ); |
62 | | - |
63 | | - //transform the title into a wiki_safe title: |
| 62 | + |
| 63 | + //transform the title into a wiki_safe title: |
64 | 64 | //rObj['titleKey'] = proe.queryKey['stream_name'] + '_' + rObj['start_time'].replace(/:/g,'.') + '_' + rObj['end_time'].replace(/:/g,'.') + '.ogg'; |
65 | 65 | rObj['titleKey'] = _this.getTitleKey( rObj ); |
66 | | - |
67 | | - //default width of metavid clips: |
68 | | - rObj['target_width'] = 400; |
69 | | - } |
70 | | - //done loading: |
| 66 | + |
| 67 | + //default width of metavid clips: |
| 68 | + rObj['target_width'] = 400; |
| 69 | + } |
| 70 | + //done loading: |
71 | 71 | _this.loading=0; |
72 | 72 | }); |
73 | 73 | }, |
74 | 74 | getTitleKey:function( rObj ){ |
75 | | - return rObj['stream_name'] + '_start-' + rObj['start_time'].replace(/:/g,'.') + '_end-' + rObj['end_time'].replace(/:/g,'.') + '.ogg'; |
76 | | - }, |
| 75 | + return rObj['stream_name'] + '_start-' + rObj['start_time'].replace(/:/g,'.') + '_end-' + rObj['end_time'].replace(/:/g,'.') + '.ogg'; |
| 76 | + }, |
77 | 77 | getTitle:function( rObj ){ |
78 | 78 | var sn = rObj['stream_name'].replace(/_/g, ' '); |
79 | | - sn = sn.charAt(0).toUpperCase() + sn.substr(1); |
80 | | - return gM('mv_stream_title', [ sn, rObj.start_time, rObj.end_time ]); |
81 | | - }, |
82 | | - //metavid descption tied to public domain license key (government produced content) |
| 79 | + sn = sn.charAt(0).toUpperCase() + sn.substr(1); |
| 80 | + return gM('mwe-stream_title', [ sn, rObj.start_time, rObj.end_time ]); |
| 81 | + }, |
| 82 | + //metavid descption tied to public domain license key (government produced content) |
83 | 83 | getPermissionWikiTag:function( rObj ){ |
84 | 84 | return '{{PD-USGov}}'; |
85 | | - }, |
| 85 | + }, |
86 | 86 | getExtraResourceDescWiki:function( rObj ){ |
87 | 87 | var o = "\n"; |
88 | | - //check for person |
| 88 | + //check for person |
89 | 89 | if( rObj.person && rObj.person['label']) |
90 | 90 | o += '* featuring [[' + rObj.person['label'] + ']]' + "\n"; |
91 | | - |
| 91 | + |
92 | 92 | if( rObj.parent_clip ) |
93 | 93 | o += '* part of longer [' + rObj.parent_clip + ' video clip]'+ "\n"; |
94 | | - |
| 94 | + |
95 | 95 | if( rObj.person && rObj.person['url'] && rObj.person['label'] ) |
96 | 96 | o += '* also see speeches by [' + $j.trim( rObj.person.url ) + ' ' + rObj.person['label'] + ']'+ "\n"; |
97 | | - |
| 97 | + |
98 | 98 | //check for bill: |
99 | 99 | if( rObj.bill && rObj.bill['label'] && rObj.bill['url']) |
100 | | - o += '* related to bill: [[' + rObj.bill['label'] + ']] more bill [' + rObj.bill['url'] + ' video clips]'+ "\n"; |
| 100 | + o += '* related to bill: [[' + rObj.bill['label'] + ']] more bill [' + rObj.bill['url'] + ' video clips]'+ "\n"; |
101 | 101 | return o; |
102 | | - }, |
| 102 | + }, |
103 | 103 | //format is "quote" followed by [[name of person]] |
104 | | - getInlineDescWiki:function( rObj ){ |
105 | | - var o = this.parent_getInlineDescWiki( rObj ); |
| 104 | + getInlineDescWiki:function( rObj ){ |
| 105 | + var o = this.parent_getInlineDescWiki( rObj ); |
106 | 106 | //add in person if found |
107 | 107 | if( rObj.person && rObj.person['label'] ){ |
108 | 108 | o = $j.trim( o.replace(rObj.person['label'], '') ); |
109 | | - //trim leading : |
| 109 | + //trim leading : |
110 | 110 | if(o.substr(0,1)==':') |
111 | | - o = o.substr(1); |
112 | | - //add quotes and person at the end: |
| 111 | + o = o.substr(1); |
| 112 | + //add quotes and person at the end: |
113 | 113 | var d = this.getDateFromLink( rObj.link ); |
114 | 114 | o ='"' + o + '" [[' + rObj.person['label'] + ']] on ' + d.toDateString(); |
115 | | - } |
116 | | - //could do ref or direct link: |
117 | | - o += ' \'\'[' + $j.trim( rObj.link ) + ' source clip]\'\' '; |
118 | | - |
| 115 | + } |
| 116 | + //could do ref or direct link: |
| 117 | + o += ' \'\'[' + $j.trim( rObj.link ) + ' source clip]\'\' '; |
| 118 | + |
119 | 119 | //var o= '"' + o + '" by [[' + rObj.person['label'] + ']] '+ |
120 | | - // '<ref>[' + rObj.link + ' Metavid Source Page] for ' + rObj.title +'</ref>'; |
121 | | - return o; |
| 120 | + // '<ref>[' + rObj.link + ' Metavid Source Page] for ' + rObj.title +'</ref>'; |
| 121 | + return o; |
122 | 122 | }, |
123 | 123 | //give an updated start and end time updates the title and url |
124 | 124 | applyVideoAdj: function( rObj ){ |
125 | | - js_log('mv ApplyVideoAdj::'); |
126 | | - //update the titleKey: |
127 | | - rObj['titleKey'] = this.getTitleKey( rObj ); |
128 | | - |
129 | | - //update the title: |
130 | | - rObj['title'] = this.getTitle( rObj ); |
131 | | - |
132 | | - //update the interface: |
| 125 | + js_log('mv ApplyVideoAdj::'); |
| 126 | + //update the titleKey: |
| 127 | + rObj['titleKey'] = this.getTitleKey( rObj ); |
| 128 | + |
| 129 | + //update the title: |
| 130 | + rObj['title'] = this.getTitle( rObj ); |
| 131 | + |
| 132 | + //update the interface: |
133 | 133 | js_log('update title to: ' + rObj['title']); |
134 | 134 | $j('#rsd_resource_title').html( gM('rsd_resource_edit', rObj['title'] ) ); |
135 | | - |
136 | | - //if the video is "roe" based select the ogg stream |
137 | | - if( rObj.roe_url && rObj.pSobj.cp.stream_import_key){ |
| 135 | + |
| 136 | + //if the video is "roe" based select the ogg stream |
| 137 | + if( rObj.roe_url && rObj.pSobj.cp.stream_import_key){ |
138 | 138 | var source = $j('#embed_vid').get(0).media_element.getSourceById( rObj.pSobj.cp.stream_import_key ); |
139 | 139 | if(!source){ |
140 | | - js_error('Error::could not find source: ' + rObj.pSobj.cp.stream_import_key); |
| 140 | + js_error('Error::could not find source: ' + rObj.pSobj.cp.stream_import_key); |
141 | 141 | }else{ |
142 | 142 | rObj['src'] = source.getURI(); |
143 | 143 | js_log("g src_key: " + rObj.pSobj.cp.stream_import_key + ' src:' + rObj['src']) ; |
144 | 144 | return true; |
145 | 145 | } |
146 | | - } |
| 146 | + } |
147 | 147 | }, |
148 | 148 | getEmbedHTML:function( rObj , options ){ |
149 | 149 | if(!options) |
150 | 150 | options={}; |
151 | 151 | var id_attr = (options['id'])?' id = "' + options['id'] +'" ': ''; |
152 | | - var style_attr = (options['max_width'])?' style="width:'+options['max_width']+'px;"':''; |
153 | | - //@@maybe check type here ? |
| 152 | + var style_attr = (options['max_width'])?' style="width:'+options['max_width']+'px;"':''; |
| 153 | + //@@maybe check type here ? |
154 | 154 | if(options['only_poster']){ |
155 | | - return '<img ' + id_attr + ' src="' + rObj['poster']+'" ' + style_attr + '>'; |
| 155 | + return '<img ' + id_attr + ' src="' + rObj['poster']+'" ' + style_attr + '>'; |
156 | 156 | }else{ |
157 | 157 | return '<video ' + id_attr + ' roe="' + rObj['roe_url'] + '"></video>'; |
158 | 158 | } |
159 | | - }, |
160 | | - getImageTransform:function( rObj, opt ){ |
| 159 | + }, |
| 160 | + getImageTransform:function( rObj, opt ){ |
161 | 161 | if( opt.width <= 80 ){ |
162 | 162 | return getURLParamReplace( rObj.poster, { 'size' : "icon" } ) |
163 | 163 | }else if( opt.width <= 160 ){ |
— | — | @@ -167,38 +167,38 @@ |
168 | 168 | return getURLParamReplace( rObj.poster, { 'size' : 'large' } ) |
169 | 169 | }else{ |
170 | 170 | return getURLParamReplace( rObj.poster, { 'size' : 'full' } ) |
171 | | - } |
| 171 | + } |
172 | 172 | }, |
173 | 173 | getEmbedObjParsedInfo:function(rObj, eb_id){ |
174 | 174 | var sources = $j('#'+eb_id).get(0).media_element.getSources(); |
175 | 175 | rObj.other_versions ='*[' + rObj['roe_url'] + ' XML of all Video Formats and Timed Text]'+"\n"; |
176 | 176 | for(var i in sources){ |
177 | 177 | var cur_source = sources[i]; |
178 | | - //rObj.other_versions += '*['+cur_source.getURI() +' ' + cur_source.title +']' + "\n"; |
| 178 | + //rObj.other_versions += '*['+cur_source.getURI() +' ' + cur_source.title +']' + "\n"; |
179 | 179 | if( cur_source.id == this.cp.target_source_id) |
180 | 180 | rObj['url'] = cur_source.getURI(); |
181 | 181 | } |
182 | 182 | //js_log('set url to: ' + rObj['url']); |
183 | | - return rObj; |
| 183 | + return rObj; |
184 | 184 | }, |
185 | 185 | //update rObj for import: |
186 | 186 | updateDataForImport:function( rObj ){ |
187 | 187 | rObj['author']='US Government'; |
188 | 188 | //convert data to UTC type date: |
189 | 189 | var d = this.getDateFromLink( rObj.link ); |
190 | | - rObj['date'] = d.toDateString(); |
191 | | - rObj['license_template_tag']='PD-USGov'; |
192 | | - //update based on new start time: |
193 | | - js_log('url is: ' + rObj.src + ' ns: ' + rObj.start_time + ' ne:' + rObj.end_time); |
194 | | - |
| 190 | + rObj['date'] = d.toDateString(); |
| 191 | + rObj['license_template_tag']='PD-USGov'; |
| 192 | + //update based on new start time: |
| 193 | + js_log('url is: ' + rObj.src + ' ns: ' + rObj.start_time + ' ne:' + rObj.end_time); |
| 194 | + |
195 | 195 | return rObj; |
196 | 196 | }, |
197 | 197 | getDateFromLink:function( link ){ |
198 | | - var dateExp = new RegExp(/_([0-9]+)\-([0-9]+)\-([0-9]+)/); |
| 198 | + var dateExp = new RegExp(/_([0-9]+)\-([0-9]+)\-([0-9]+)/); |
199 | 199 | var dParts = link.match (dateExp); |
200 | 200 | var d = new Date(); |
201 | 201 | var year_full = (dParts[3].length==2)?'20'+dParts[3].toString():dParts[3]; |
202 | | - d.setFullYear(year_full, dParts[1]-1, dParts[2]); |
| 202 | + d.setFullYear(year_full, dParts[1]-1, dParts[2]); |
203 | 203 | return d; |
204 | 204 | } |
205 | | -} |
\ No newline at end of file |
| 205 | +} |
Index: trunk/phase3/js2/mwEmbed/libAddMedia/mvAdvFirefogg.js |
— | — | @@ -5,7 +5,7 @@ |
6 | 6 | //@@todo put all msg text into loadGM json |
7 | 7 | |
8 | 8 | loadGM({ |
9 | | - "help-sticky" : "Help (click to stick)", |
| 9 | + "fogg-help-sticky" : "Help (click to stick)", |
10 | 10 | "fogg-cg-preset" : "Preset : <strong>$1<\/strong>", |
11 | 11 | "fogg-cg-quality" : "Basic quality and resolution control", |
12 | 12 | "fogg-cg-meta" : "Metadata for the clip", |
— | — | @@ -37,48 +37,48 @@ |
38 | 38 | config_groups : [ 'preset', 'range', 'quality', 'meta', 'advVideo', 'advAudio'], |
39 | 39 | //list of pre-sets: |
40 | 40 | //local instance encoder config: |
41 | | - default_local_settings:{ |
42 | | - 'd' : 'webvideo', |
43 | | - 'type' : 'select', |
44 | | - 'selectVal': ['webvideo'], |
45 | | - 'group' : "preset", |
46 | | - 'pSet' : { |
47 | | - 'custom':{ |
48 | | - 'descKey': 'fogg-preset-custom', |
49 | | - 'conf': {} |
50 | | - }, |
51 | | - 'webvideo': { |
52 | | - 'desc': "Web Video Theora, Vorbis 400kbs & 400px max width", |
53 | | - 'conf': { |
54 | | - 'maxSize' : 400, |
55 | | - 'videoBitrate' : 544, |
56 | | - 'audioBitrate' : 96, |
57 | | - 'noUpscaling' : true, |
58 | | - } |
59 | | - }, |
60 | | - 'savebandwith': { |
61 | | - 'desc': "Low Bandwith Theora, Vorbis 164kbs & 200px max size", |
62 | | - 'conf': { |
63 | | - 'maxSize' : 200, |
64 | | - 'videoBitrate' : 164, |
65 | | - 'audioBitrate' : 32, |
66 | | - 'samplerate' : 22050, |
67 | | - 'framerate' : 15, |
68 | | - 'channels' : 1, |
69 | | - 'noUpscaling' : true |
70 | | - } |
71 | | - }, |
72 | | - 'hqstream':{ |
73 | | - 'desc': "High Quality Theora, Vorbis 1080px max width", |
74 | | - 'conf': { |
75 | | - 'maxSize' : 1080, |
76 | | - 'videoQuality' : 6, |
77 | | - 'audioQuality' : 3, |
78 | | - 'noUpscaling' : true, |
79 | | - } |
80 | | - }, |
81 | | - } |
82 | | - }, |
| 41 | +default_local_settings:{ |
| 42 | + 'd' : 'webvideo', |
| 43 | + 'type' : 'select', |
| 44 | + 'selectVal': ['webvideo'], |
| 45 | + 'group' : "preset", |
| 46 | + 'pSet' : { |
| 47 | + 'custom':{ |
| 48 | + 'descKey': 'fogg-preset-custom', |
| 49 | + 'conf': {} |
| 50 | + }, |
| 51 | + 'webvideo': { |
| 52 | + 'desc': "Web Video Theora, Vorbis 400kbs & 400px max width", |
| 53 | + 'conf': { |
| 54 | + 'maxSize' : 400, |
| 55 | + 'videoBitrate' : 544, |
| 56 | + 'audioBitrate' : 96, |
| 57 | + 'noUpscaling' : true, |
| 58 | + } |
| 59 | + }, |
| 60 | + 'savebandwith': { |
| 61 | + 'desc': "Low Bandwith Theora, Vorbis 164kbs & 200px max size", |
| 62 | + 'conf': { |
| 63 | + 'maxSize' : 200, |
| 64 | + 'videoBitrate' : 164, |
| 65 | + 'audioBitrate' : 32, |
| 66 | + 'samplerate' : 22050, |
| 67 | + 'framerate' : 15, |
| 68 | + 'channels' : 1, |
| 69 | + 'noUpscaling' : true |
| 70 | + } |
| 71 | + }, |
| 72 | + 'hqstream':{ |
| 73 | + 'desc': "High Quality Theora, Vorbis 1080px max width", |
| 74 | + 'conf': { |
| 75 | + 'maxSize' : 1080, |
| 76 | + 'videoQuality' : 6, |
| 77 | + 'audioQuality' : 3, |
| 78 | + 'noUpscaling' : true, |
| 79 | + } |
| 80 | + }, |
| 81 | + } |
| 82 | +}, |
83 | 83 | local_settings: {}, |
84 | 84 | |
85 | 85 | //core firefogg default encoder configuration |
— | — | @@ -86,18 +86,18 @@ |
87 | 87 | default_encoder_config : { |
88 | 88 | //base quality settings: |
89 | 89 | 'videoQuality': { |
90 | | - 'd' : 5, |
91 | | - 't' : 'Video Quality', |
92 | | - 'range' : {'min':0,'max':10}, |
93 | | - 'type' : 'slider', |
94 | | - 'group' : 'quality', |
95 | | - 'help' : "Used to set the <i>Visual Quality</i> of the encoded video. (not used if you set bitrate in advanced controls below)" |
| 90 | + 'd' : 5, |
| 91 | + 't' : 'Video Quality', |
| 92 | + 'range' : {'min':0,'max':10}, |
| 93 | + 'type' : 'slider', |
| 94 | + 'group' : 'quality', |
| 95 | + 'help' : "Used to set the <i>Visual Quality</i> of the encoded video. (not used if you set bitrate in advanced controls below)" |
96 | 96 | }, |
97 | 97 | 'twopass':{ |
98 | | - 't' : "Two Pass Encoding", |
99 | | - 'type' : "boolean", |
100 | | - 'group' : "quality", |
101 | | - 'help' : "Two Pass Encoding enables more consitant quality by making two passes over the video file" |
| 98 | + 't' : "Two Pass Encoding", |
| 99 | + 'type' : "boolean", |
| 100 | + 'group' : "quality", |
| 101 | + 'help' : "Two Pass Encoding enables more consitant quality by making two passes over the video file" |
102 | 102 | }, |
103 | 103 | 'starttime':{ |
104 | 104 | 't' : "Start Second", |
— | — | @@ -210,8 +210,8 @@ |
211 | 211 | 'type' : 'select', |
212 | 212 | 'selectVal' : [{'22050':'22 kHz'}, {'44100':'44 khz'}, {'48000':'48 khz'}], |
213 | 213 | 'formatSelect' : function(val){ |
214 | | - return (Math.round(val/100)*10) + ' Hz'; |
215 | | - }, |
| 214 | + return (Math.round(val/100)*10) + ' Hz'; |
| 215 | + }, |
216 | 216 | 'help' : "set output samplerate (in Hz)." |
217 | 217 | }, |
218 | 218 | 'noaudio':{ |
— | — | @@ -393,7 +393,7 @@ |
394 | 394 | out+='<tr><td valign="top">'+ |
395 | 395 | '<label for="_' + cK + '">' + |
396 | 396 | cConf.t + ':' + |
397 | | - '<span title="' + gM('help-sticky') + '" class="help_'+ cK + ' ui-icon ui-icon-info" style="float:left"></span>'+ |
| 397 | + '<span title="' + gM('fogg-help-sticky') + '" class="help_'+ cK + ' ui-icon ui-icon-info" style="float:left"></span>'+ |
398 | 398 | '</label></td><td valign="top">'; |
399 | 399 | //if we don't value for this: |
400 | 400 | var dv = ( this.default_encoder_config[cK].d ) ? this.default_encoder_config[cK].d : ''; |
Index: trunk/phase3/js2/mwEmbed/libAddMedia/seqRemoteSearchDriver.js |
— | — | @@ -10,15 +10,15 @@ |
11 | 11 | init:function( this_seq ){ |
12 | 12 | var _this = this; |
13 | 13 | js_log("init:seqRemoteSearchDriver"); |
14 | | - //setup remote search driver with a seq parent: |
| 14 | + //setup remote search driver with a seq parent: |
15 | 15 | this.pSeq = this_seq; |
16 | | - var iObj = { |
| 16 | + var iObj = { |
17 | 17 | 'target_container' : '#cliplib_ic', |
18 | | - 'local_wiki_api_url': this_seq.getLocalApiUrl(), |
19 | | - 'instance_name' : this_seq.instance_name + '.mySearch', |
20 | | - 'default_query' : this.pSeq.plObj.title |
21 | | - } |
22 | | - //inherit the remoteSearchDriver properties:n |
| 18 | + 'local_wiki_api_url': this_seq.getLocalApiUrl(), |
| 19 | + 'instance_name' : this_seq.instance_name + '.mySearch', |
| 20 | + 'default_query' : this.pSeq.plObj.title |
| 21 | + } |
| 22 | + //inherit the remoteSearchDriver properties:n |
23 | 23 | var tmpRSD = new remoteSearchDriver( iObj ); |
24 | 24 | for(var i in tmpRSD){ |
25 | 25 | if(this[i]){ |
— | — | @@ -34,100 +34,100 @@ |
35 | 35 | js_log("seqRemoteSearchDriver::" + _this.pSeq.disp_menu_item); |
36 | 36 | //call the parent |
37 | 37 | _this.pSeq.parent_do_refresh_timeline(); |
38 | | - //add our local bindings |
39 | | - _this.addResultBindings(); |
| 38 | + //add our local bindings |
| 39 | + _this.addResultBindings(); |
40 | 40 | return true; |
41 | 41 | } |
42 | 42 | } |
43 | | - }, |
| 43 | + }, |
44 | 44 | resourceEdit:function(){ |
45 | | - var _this = this; |
46 | | - |
47 | | - }, |
| 45 | + var _this = this; |
| 46 | + |
| 47 | + }, |
48 | 48 | addResultBindings:function(){ |
49 | | - //set up seq: |
| 49 | + //set up seq: |
50 | 50 | var _this = this; |
51 | 51 | //setup parent bindings: |
52 | 52 | this.parent_addResultBindings(); |
53 | | - |
| 53 | + |
54 | 54 | //add an aditional click binding |
55 | 55 | $j('.rsd_res_item').click(function(){ |
56 | 56 | js_log('SeqRemoteSearch: rsd_res_item: click (remove sequence_add_target)'); |
57 | 57 | _this.sequence_add_target =false; |
58 | 58 | }); |
59 | | - |
60 | | - //add an additional drag binding |
| 59 | + |
| 60 | + //add an additional drag binding |
61 | 61 | $j( '.rsd_res_item' ).draggable('destroy').draggable({ |
62 | 62 | helper:function(){ |
63 | 63 | return $j( this ).clone().appendTo('body').css({'z-index':9999}).get(0); |
64 | | - }, |
65 | | - revert:'invalid', |
| 64 | + }, |
| 65 | + revert:'invalid', |
66 | 66 | start:function(){ |
67 | 67 | js_log('start drag'); |
68 | | - } |
69 | | - }); |
| 68 | + } |
| 69 | + }); |
70 | 70 | $j(".mv_clip_drag").droppable( 'destroy' ).droppable({ |
71 | 71 | accept: '.rsd_res_item', |
72 | 72 | over:function(event, ui){ |
73 | 73 | //js_log("over : mv_clip_drag: " + $j(this).attr('id') ); |
74 | | - $j(this).css('border-right', 'solid thick red'); |
| 74 | + $j(this).css('border-right', 'solid thick red'); |
75 | 75 | }, |
76 | 76 | out:function(event, ui){ |
77 | | - $j(this).css('border-right', 'solid thin white'); |
| 77 | + $j(this).css('border-right', 'solid thin white'); |
78 | 78 | }, |
79 | 79 | drop: function(event, ui) { |
80 | 80 | $j(this).css('border-right', 'solid thin white'); |
81 | 81 | js_log("Droped: "+ $j(ui.draggable).attr('id') +' on ' + $j(this).attr('id') ); |
82 | 82 | _this.sequence_add_target = $j(this).attr('id'); |
83 | 83 | //load the orginal draged item |
84 | | - var rObj = _this.getResourceFromId( $j(ui.draggable).attr('id') ); |
85 | | - _this.resourceEdit(rObj, ui.draggable); |
| 84 | + var rObj = _this.getResourceFromId( $j(ui.draggable).attr('id') ); |
| 85 | + _this.resourceEdit(rObj, ui.draggable); |
86 | 86 | } |
87 | | - }); |
88 | | - |
| 87 | + }); |
| 88 | + |
89 | 89 | }, |
90 | 90 | insertResource:function(rObj){ |
91 | 91 | var _this = this; |
92 | 92 | js_log("SEQ insert resource after:" + _this.sequence_add_target + ' of type: ' + rObj.mime); |
93 | 93 | if(_this.sequence_add_target ){ |
94 | | - var tClip = _this.pSeq.getClipFromSeqID( _this.sequence_add_target ); |
| 94 | + var tClip = _this.pSeq.getClipFromSeqID( _this.sequence_add_target ); |
95 | 95 | var target_order = false; |
96 | 96 | if(tClip) |
97 | 97 | var target_order = tClip.order; |
98 | | - } |
99 | | - //@@todo show watting of sorts. |
100 | | - |
| 98 | + } |
| 99 | + //@@todo show watting of sorts. |
| 100 | + |
101 | 101 | //get target order: |
102 | | - var cat = rObj; |
| 102 | + var cat = rObj; |
103 | 103 | //check for target insert path |
104 | | - this.checkImportResource( rObj, function(){ |
105 | | - |
106 | | - var clipConfig = { |
| 104 | + this.checkImportResource( rObj, function(){ |
| 105 | + |
| 106 | + var clipConfig = { |
107 | 107 | 'type' : rObj.mime, |
108 | | - 'uri' : _this.cFileNS + ':' + rObj.target_resource_title, |
109 | | - 'title' : rObj.title |
110 | | - }; |
111 | | - //set via local properites if avaliable |
| 108 | + 'uri' : _this.cFileNS + ':' + rObj.target_resource_title, |
| 109 | + 'title' : rObj.title |
| 110 | + }; |
| 111 | + //set via local properites if avaliable |
112 | 112 | clipConfig['src'] = (rObj.local_src) ? rObj.local_src : rObj.src; |
113 | 113 | clipConfig['poster'] = ( rObj.local_poster ) ? rObj.local_poster : rObj.poster; |
114 | | - |
| 114 | + |
115 | 115 | if(rObj.start_time && rObj.end_time){ |
116 | 116 | clipConfig['dur'] = npt2seconds( rObj.end_time ) - npt2seconds( rObj.start_time ); |
117 | 117 | }else{ |
118 | | - //provide a default duration if none set |
| 118 | + //provide a default duration if none set |
119 | 119 | clipConfig['dur'] = 4; |
120 | | - } |
121 | | - |
122 | | - //create the media element (target order+1 (since we insert (after) |
123 | | - _this.pSeq.plObj.tryAddMediaObj( clipConfig, (parseInt(target_order) + 1) ); |
124 | | - //refresh the timeline: |
| 120 | + } |
| 121 | + |
| 122 | + //create the media element (target order+1 (since we insert (after) |
| 123 | + _this.pSeq.plObj.tryAddMediaObj( clipConfig, (parseInt(target_order) + 1) ); |
| 124 | + //refresh the timeline: |
125 | 125 | _this.pSeq.do_refresh_timeline(); |
126 | | - js_log("run close all: "); |
| 126 | + js_log("run close all: "); |
127 | 127 | _this.closeAll(); |
128 | 128 | }); |
129 | 129 | }, |
130 | 130 | getClipEditControlActions:function(){ |
131 | | - var _this = this; |
| 131 | + var _this = this; |
132 | 132 | return { |
133 | 133 | 'insert_seq':function(rObj){ |
134 | 134 | _this.insertResource( rObj ) |
— | — | @@ -139,26 +139,26 @@ |
140 | 140 | }, |
141 | 141 | resourceEdit:function(rObj, rsdElement){ |
142 | 142 | var _this = this; |
143 | | - //don't resize to default (full screen behavior) |
| 143 | + //don't resize to default (full screen behavior) |
144 | 144 | _this.dmodalCss = {}; |
145 | | - //open up a new target_contaienr: |
| 145 | + //open up a new target_contaienr: |
146 | 146 | if($j('#seq_resource_import').length == 0) |
147 | 147 | $j('body').append('<div id="seq_resource_import" style="position:relative"></div>'); |
148 | | - |
| 148 | + |
149 | 149 | $j('#seq_resource_import').dialog('destroy').dialog({ |
150 | 150 | bgiframe: true, |
151 | 151 | width:750, |
152 | 152 | height:480, |
153 | 153 | modal: true, |
154 | | - buttons: { |
155 | | - "Cancel": function() { |
156 | | - $j(this).dialog("close"); |
157 | | - } |
| 154 | + buttons: { |
| 155 | + "Cancel": function() { |
| 156 | + $j(this).dialog("close"); |
| 157 | + } |
158 | 158 | } |
159 | 159 | }); |
160 | | - _this.target_container = '#seq_resource_import'; |
| 160 | + _this.target_container = '#seq_resource_import'; |
161 | 161 | //do parent resource edit (with updated target) |
162 | | - this.parent_resourceEdit(rObj, rsdElement); |
| 162 | + this.parent_resourceEdit(rObj, rsdElement); |
163 | 163 | }, |
164 | 164 | closeAll:function(){ |
165 | 165 | js_log( 'should close: seq_resource_import'); |
— | — | @@ -174,6 +174,6 @@ |
175 | 175 | }, |
176 | 176 | cancelClipEditCB:function(){ |
177 | 177 | js_log('seqRSD:cancelClipEditCB'); |
178 | | - $j('#seq_resource_import').dialog('close').dialog('destroy').remove(); |
| 178 | + $j('#seq_resource_import').dialog('close').dialog('destroy').remove(); |
179 | 179 | } |
180 | | -}; |
\ No newline at end of file |
| 180 | +}; |
Index: trunk/phase3/js2/mwEmbed/libAddMedia/mvFirefogg.js |
— | — | @@ -723,7 +723,7 @@ |
724 | 724 | form_txt = res.form_txt; |
725 | 725 | } |
726 | 726 | js_log( 'error text is: ' + result_txt ); |
727 | | - $j( '#dlbox-centered' ).html( '<h3>' + gM('mv_upload_completed') + '</h3>' + result_txt + '<br>' + form_txt); |
| 727 | + $j( '#dlbox-centered' ).html( '<h3>' + gM('mwe-upload_completed') + '</h3>' + result_txt + '<br>' + form_txt); |
728 | 728 | } |
729 | 729 | } |
730 | 730 | }; |
Index: trunk/phase3/js2/mwEmbed/libAddMedia/remoteSearchDriver.js |
— | — | @@ -8,45 +8,44 @@ |
9 | 9 | and archive.org |
10 | 10 | */ |
11 | 11 | loadGM({ |
12 | | - "add_media_wizard" : "Add media wizard", |
13 | | - "mv_media_search" : "Media search", |
| 12 | + "mwe-add_media_wizard" : "Add media wizard", |
| 13 | + "mwe-media_search" : "Media search", |
14 | 14 | "rsd_box_layout" : "Box layout", |
15 | 15 | "rsd_list_layout" : "List layout", |
16 | 16 | "rsd_results_desc" : "Results", |
17 | 17 | "rsd_results_next" : "next", |
18 | 18 | "rsd_results_prev" : "previous", |
19 | 19 | "rsd_no_results" : "No search results for <b>$1<\/b>", |
20 | | - "upload_tab" : "Upload", |
| 20 | + "mwe-upload_tab" : "Upload", |
21 | 21 | "rsd_layout" : "Layout : ", |
22 | 22 | "rsd_resource_edit" : "Edit resource : $1", |
23 | | - "resource_description_page" : "Resource description page", |
| 23 | + "mwe-resource_description_page" : "Resource description page", |
24 | 24 | "rsd_local_resource_title" : "Local resource title", |
25 | 25 | "rsd_do_insert" : "Do insert", |
26 | | - "cc_title" : "Creative Commons", |
27 | | - "cc_by_title" : "Attribution", |
28 | | - "cc_nc_title" : "Noncommercial", |
29 | | - "cc_nd_title" : "No Derivative Works", |
30 | | - "cc_sa_title" : "Share Alike", |
31 | | - "cc_pd_title" : "Public Domain", |
32 | | - "unknown_license" : "Unknown license", |
33 | | - "no_import_by_url" : "This user or wiki <b>can not<\/b> import assets from remote URLs.<\/p><p>Do you need to login?<\/p><p>If permissions are set, you may have to enable $wgAllowCopyUploads (<a href=\"http : \/\/www.mediawiki.org\/wiki\/Manual : $wgAllowCopyUploads\">more information<\/a>).<\/p>", |
34 | | - "results_from" : "Results from <a href=\"$1\" target=\"_new\" >$2<\/a>", |
35 | | - "missing_desc_see_soruce" : "This asset is missing a description. Please see the [$1 orginal source] and help describe it.", |
| 26 | + "mwe-cc_title" : "Creative Commons", |
| 27 | + "mwe-cc_by_title" : "Attribution", |
| 28 | + "mwe-cc_nc_title" : "Noncommercial", |
| 29 | + "mwe-cc_nd_title" : "No Derivative Works", |
| 30 | + "mwe-cc_sa_title" : "Share Alike", |
| 31 | + "mwe-cc_pd_title" : "Public Domain", |
| 32 | + "mwe-unknown_license" : "Unknown license", |
| 33 | + "mwe-no_import_by_url" : "This user or wiki <b>can not<\/b> import assets from remote URLs.<\/p><p>Do you need to login?<\/p><p>If permissions are set, you may have to enable $wgAllowCopyUploads (<a href=\"http : \/\/www.mediawiki.org\/wiki\/Manual : $wgAllowCopyUploads\">more information<\/a>).<\/p>", |
| 34 | + "mwe-results_from" : "Results from <a href=\"$1\" target=\"_new\" >$2<\/a>", |
| 35 | + "mwe-missing_desc_see_source" : "This asset is missing a description. Please see the [$1 orginal source] and help describe it.", |
36 | 36 | "rsd_config_error" : "Add media wizard configuration error : $1", |
37 | | - "uploaded_itmes" : "Uploaded Items:", |
38 | | - |
39 | | - "your_recent_uploads" : "Your Recent Uploads", |
40 | | - "upload_a_file": "Upload a New File", |
41 | | - |
42 | | - "resource_page_desc":"Resource Page Description:", |
43 | | - "edit_resource_desc": "Edit WikiText Resource Description:", |
44 | | - "local_resource_title": "Local Resource Title:", |
45 | | - "watch_this_page": "Watch this page", |
46 | | - "do_import_resource": "Do Import Resource", |
47 | | - "update_preview": "Update Preview", |
48 | | - "cancel_import": "Cancel Import", |
49 | | - "importing_asset" : "Importing Asset", |
50 | | - "preview_insert_resource": "Preview Insert of Resource: $1" |
| 37 | + |
| 38 | + "mwe-your_recent_uploads" : "Your recent uploads", |
| 39 | + "mwe-upload_a_file": "Upload a new file", |
| 40 | + |
| 41 | + "mwe-resource_page_desc":"Resource page description:", |
| 42 | + "mwe-edit_resource_desc": "Edit wiki text resource description:", |
| 43 | + "mwe-local_resource_title": "Local resource title:", |
| 44 | + "mwe-watch_this_page": "Watch this page", |
| 45 | + "mwe-do_import_resource": "Import resource", |
| 46 | + "mwe-update_preview": "Update preview", |
| 47 | + "mwe-cancel_import": "Cancel import", |
| 48 | + "mwe-importing_asset" : "Importing asset", |
| 49 | + "mwe-preview_insert_resource": "Preview insert of resource: $1" |
51 | 50 | }); |
52 | 51 | var default_remote_search_options = { |
53 | 52 | 'profile':'mediawiki_edit', |
— | — | @@ -111,7 +110,7 @@ |
112 | 111 | * |
113 | 112 | * (should be note that special tabs like "upload" and "combined" don't go into the content proviers list: |
114 | 113 | * @note do not use double underscore in content providers names (used for id lookup) |
115 | | - * |
| 114 | + * |
116 | 115 | * @@todo we will want to load more per user-preference and per category lookup |
117 | 116 | */ |
118 | 117 | content_providers:{ |
— | — | @@ -147,7 +146,7 @@ |
148 | 147 | 'lib' : 'mediaWiki', |
149 | 148 | 'local' : true, |
150 | 149 | 'tab_img': false |
151 | | - }, |
| 150 | + }, |
152 | 151 | 'wiki_commons':{ |
153 | 152 | 'enabled': 1, |
154 | 153 | 'checked': 1, |
— | — | @@ -271,12 +270,12 @@ |
272 | 271 | return js_error('could not find:' + license_key); |
273 | 272 | //set the current license pointer: |
274 | 273 | var cl = this.licenses.cc; |
275 | | - var title = gM('cc_title'); |
| 274 | + var title = gM('mwe-cc_title'); |
276 | 275 | var imgs = ''; |
277 | 276 | var license_set = license_key.split('-'); |
278 | 277 | for(var i=0;i < license_set.length; i++){ |
279 | 278 | lkey = license_set[i]; |
280 | | - title += ' ' + gM( 'cc_' + lkey + '_title'); |
| 279 | + title += ' ' + gM( 'mwe-cc_' + lkey + '_title'); |
281 | 280 | imgs +='<img class="license_desc" width="20" src="' + cl.base_img_url + |
282 | 281 | cl.license_img[ lkey ].im + '">'; |
283 | 282 | } |
— | — | @@ -302,10 +301,10 @@ |
303 | 302 | return this.getLicenceFromKey( i , license_url); |
304 | 303 | } |
305 | 304 | } |
306 | | - //could not find it return unknown_license |
| 305 | + //could not find it return mwe-unknown_license |
307 | 306 | return { |
308 | | - 'title' : gM('unknown_license'), |
309 | | - 'img_html' : '<span>' + gM('unknown_license') + '</span>', |
| 307 | + 'title' : gM('mwe-unknown_license'), |
| 308 | + 'img_html' : '<span>' + gM('mwe-unknown_license') + '</span>', |
310 | 309 | 'lurl' : license_url |
311 | 310 | }; |
312 | 311 | }, |
— | — | @@ -372,7 +371,7 @@ |
373 | 372 | js_log("RemoteSearchDriver:: no target invocation provided (will have to run your own doInitDisplay() )"); |
374 | 373 | }else{ |
375 | 374 | if(this.target_invocation){ |
376 | | - $j(this.target_invocation).css('cursor','pointer').attr('title', gM('add_media_wizard')).click(function(){ |
| 375 | + $j(this.target_invocation).css('cursor','pointer').attr('title', gM('mwe-add_media_wizard')).click(function(){ |
377 | 376 | _this.doInitDisplay(); |
378 | 377 | }); |
379 | 378 | } |
— | — | @@ -443,7 +442,7 @@ |
444 | 443 | var _this = this; |
445 | 444 | //add the parent target_container if not provided or missing |
446 | 445 | if(!_this.target_container || $j(_this.target_container).length==0){ |
447 | | - $j('body').append('<div id="rsd_modal_target" style="position:absolute;top:30px;left:0px;bottom:45px;right:0px;" title="' + gM('add_media_wizard') + '" ></div>'); |
| 446 | + $j('body').append('<div id="rsd_modal_target" style="position:absolute;top:30px;left:0px;bottom:45px;right:0px;" title="' + gM('mwe-add_media_wizard') + '" ></div>'); |
448 | 447 | _this.target_container = '#rsd_modal_target'; |
449 | 448 | //js_log('appended: #rsd_modal_target' + $j(_this.target_container).attr('id')); |
450 | 449 | //js_log('added target id:' + $j(_this.target_container).attr('id')); |
— | — | @@ -521,7 +520,7 @@ |
522 | 521 | '<form id="rsd_form" action="javascript:return false;" method="GET">'+ |
523 | 522 | '<input class="ui-widget-content ui-corner-all" type="text" tabindex="1" value="' + dq + '" maxlength="512" id="rsd_q" name="rsd_q" '+ |
524 | 523 | 'size="20" autocomplete="off"/> '+ |
525 | | - $j.btnHtml( gM('mv_media_search'), 'rms_search_button', 'search') + |
| 524 | + $j.btnHtml( gM('mwe-media_search'), 'rms_search_button', 'search') + |
526 | 525 | '</form>'; |
527 | 526 | //close up the control container: |
528 | 527 | o+='</div>'; |
— | — | @@ -574,7 +573,7 @@ |
575 | 574 | //set it to loading: |
576 | 575 | mv_set_loading('#tab-upload'); |
577 | 576 | //do things async to keep interface snapy |
578 | | - setTimeout(function(){ |
| 577 | + setTimeout(function(){ |
579 | 578 | //do config variable reality checks: |
580 | 579 | if( _this.upload_api_target == 'local' ){ |
581 | 580 | if( ! _this.local_wiki_api_url ){ |
— | — | @@ -593,46 +592,46 @@ |
594 | 593 | //set the form action based on domain: |
595 | 594 | if( parseUri( document.URL ).host == parseUri( _this.upload_api_target ).host ){ |
596 | 595 | mvJsLoader.doLoad(['$j.fn.simpleUploadForm'],function(){ |
597 | | - |
| 596 | + |
598 | 597 | //get extened info about the file |
599 | 598 | var cp = _this.content_providers['this_wiki']; |
600 | 599 | //check for "this_wiki" enabled |
601 | 600 | if(!cp.enabled){ |
602 | 601 | $j('#tab-upload').html('error this_wiki not enabled (can\'t get uploaded file info)'); |
603 | 602 | return false; |
604 | | - } |
605 | | - |
| 603 | + } |
| 604 | + |
606 | 605 | //load this_wiki search system to grab the rObj |
607 | 606 | _this.loadSearchLib(cp, function(){ |
608 | 607 | //do basic layout form on left upload "bin" on right |
609 | 608 | $j('#tab-upload').html('<table cellspacing="10">' + |
610 | 609 | '<tr>' + |
611 | 610 | '<td valign="top" style="width:350px;">' + |
612 | | - '<h4>' + gM('upload_a_file') + '</h4>' + |
613 | | - '<div id="upload_form">' + |
| 611 | + '<h4>' + gM('mwe-upload_a_file') + '</h4>' + |
| 612 | + '<div id="upload_form">' + |
614 | 613 | mv_get_loading_img() + |
615 | 614 | '</div>' + |
616 | 615 | '</td>' + |
617 | 616 | '<td valign="top" id="upload_bin_cnt">' + |
618 | | - '<h4>' + gM('your_recent_uploads') + '</h4>' + |
| 617 | + '<h4>' + gM('mwe-your_recent_uploads') + '</h4>' + |
619 | 618 | '<div id="upload_bin">' + |
620 | 619 | mv_get_loading_img() + |
621 | 620 | '</div>'+ |
622 | 621 | '</td>' + |
623 | 622 | '</tr>' + |
624 | 623 | '</table>'); |
625 | | - |
626 | | - |
| 624 | + |
| 625 | + |
627 | 626 | //fill in the user page: |
628 | 627 | if(typeof wgUserName != 'undefined' && wgUserName){ |
629 | | - //load the upload bin with anything the current user has uploaded |
| 628 | + //load the upload bin with anything the current user has uploaded |
630 | 629 | cp.sObj.getUserRecentUploads( wgUserName, function(){ |
631 | 630 | _this.drawOutputResults(); |
632 | | - }); |
633 | | - }else{ |
634 | | - $j('#upload_bin_cnt').empty(); |
635 | | - } |
636 | | - |
| 631 | + }); |
| 632 | + }else{ |
| 633 | + $j('#upload_bin_cnt').empty(); |
| 634 | + } |
| 635 | + |
637 | 636 | //deal with the api form upload form directly: |
638 | 637 | $j('#upload_form').simpleUploadForm({ |
639 | 638 | "api_target" : _this.upload_api_target , |
— | — | @@ -642,14 +641,14 @@ |
643 | 642 | $j( _this.target_container ).append('<div id="temp_edit_loader" '+ |
644 | 643 | 'style="position:absolute;top:0px;left:0px;bottom:5px;right:4px;background-color:#FFF;">' + |
645 | 644 | mv_get_loading_img('position:absolute;top:30px;left:30px') + |
646 | | - '</div>'); |
| 645 | + '</div>'); |
647 | 646 | cp.sObj.addByTitle( wTitle, function( rObj ){ |
648 | 647 | $j( _this.target_container ).find('#temp_edit_loader').remove(); |
649 | | - //redraw (with added result if new) |
650 | | - _this.drawOutputResults(); |
651 | | - //pull up recource editor: |
| 648 | + //redraw (with added result if new) |
| 649 | + _this.drawOutputResults(); |
| 650 | + //pull up recource editor: |
652 | 651 | _this.resourceEdit( rObj, $j('#res_upload_' + rObj.id).get(0) ); |
653 | | - }); |
| 652 | + }); |
654 | 653 | //return false to close progress window: |
655 | 654 | return false; |
656 | 655 | } |
— | — | @@ -807,18 +806,18 @@ |
808 | 807 | //combined results are harder to error handle just ignore that repo |
809 | 808 | cp.sObj.loading = false; |
810 | 809 | }else{ |
811 | | - $j('#tab-' + this.disp_item).html( '<div style="padding:10px">'+ gM('no_import_by_url') +'</div>'); |
| 810 | + $j('#tab-' + this.disp_item).html( '<div style="padding:10px">'+ gM('mwe-no_import_by_url') +'</div>'); |
812 | 811 | } |
813 | 812 | return false; |
814 | | - } |
| 813 | + } |
815 | 814 | _this.loadSearchLib(cp, function(){ |
816 | 815 | //do search |
817 | 816 | cp.sObj.getSearchResults(); |
818 | 817 | _this.checkResultsDone(); |
819 | | - }); |
| 818 | + }); |
820 | 819 | }, |
821 | 820 | loadSearchLib:function(cp, callback){ |
822 | | - var _this = this; |
| 821 | + var _this = this; |
823 | 822 | //set up the library req: |
824 | 823 | mvJsLoader.doLoad( [ |
825 | 824 | 'baseRemoteSearch', |
— | — | @@ -891,7 +890,7 @@ |
892 | 891 | } |
893 | 892 | //do an upload tab if enabled: |
894 | 893 | if( this.enable_upload_tab ){ |
895 | | - o+='<li class="rsd_cp_tab" ><a id="rsd_tab_upload" href="#tab-upload">' + gM('upload_tab') + '</a></li>'; |
| 894 | + o+='<li class="rsd_cp_tab" ><a id="rsd_tab_upload" href="#tab-upload">' + gM('mwe-upload_tab') + '</a></li>'; |
896 | 895 | tabc+='<div id="tab-upload" />'; |
897 | 896 | if(this.disp_item == 'upload') |
898 | 897 | selected_tab = inx++; |
— | — | @@ -945,20 +944,20 @@ |
946 | 945 | //@@todo we could load the id with the content provider id to find the object faster... |
947 | 946 | getResourceFromId:function( rid ){ |
948 | 947 | js_log('getResourceFromId:' + rid ); |
949 | | - //strip out /res/ if preset: |
| 948 | + //strip out /res/ if preset: |
950 | 949 | rid = rid.replace(/res_/, ''); |
951 | 950 | //js_log("looking at: " + rid); |
952 | | - p = rid.split('__'); |
| 951 | + p = rid.split('__'); |
953 | 952 | var cp_id = p[0]; |
954 | | - var rid = p[1]; |
955 | | - |
| 953 | + var rid = p[1]; |
| 954 | + |
956 | 955 | if(cp_id == 'upload') |
957 | 956 | cp_id = 'this_wiki'; |
958 | | - |
| 957 | + |
959 | 958 | var cp = this.content_providers[cp_id]; |
960 | 959 | if(cp && cp['sObj'] && cp.sObj.resultsObj[rid]){ |
961 | 960 | return cp.sObj.resultsObj[rid]; |
962 | | - } |
| 961 | + } |
963 | 962 | js_log("ERROR: could not find " + rid); |
964 | 963 | return false; |
965 | 964 | }, |
— | — | @@ -966,15 +965,15 @@ |
967 | 966 | js_log('f:drawOutputResults::' + this.disp_item); |
968 | 967 | var _this = this; |
969 | 968 | var o=''; |
970 | | - |
| 969 | + |
971 | 970 | var cp_id = this.disp_item; |
972 | 971 | var tab_target = ''; |
973 | 972 | if(this.disp_item == 'upload'){ |
974 | 973 | tab_target = '#upload_bin'; |
975 | 974 | var cp = this.content_providers['this_wiki']; |
976 | | - }else{ |
| 975 | + }else{ |
977 | 976 | var cp = this.content_providers[this.disp_item]; |
978 | | - tab_target = '#tab-' + cp_id; |
| 977 | + tab_target = '#tab-' + cp_id; |
979 | 978 | } |
980 | 979 | //empty the existing results: |
981 | 980 | $j(tab_target).empty(); |
— | — | @@ -1002,7 +1001,7 @@ |
1003 | 1002 | //add a linkback to resource page in upper right: |
1004 | 1003 | if( rItem.link ) |
1005 | 1004 | o+='<a target="_new" style="position:absolute;top:0px;right:0px" title="' + |
1006 | | - gM('resource_description_page') + |
| 1005 | + gM('mwe-resource_description_page') + |
1007 | 1006 | '" href="' + rItem.link + '"><img src="http://upload.wikimedia.org/wikipedia/commons/6/6b/Magnify-clip.png"></a>'; |
1008 | 1007 | //add license icons if present |
1009 | 1008 | if( rItem.license ) |
— | — | @@ -1064,10 +1063,10 @@ |
1065 | 1064 | addResourceEditLoader:function(maxWidth, overflow_style){ |
1066 | 1065 | var _this = this; |
1067 | 1066 | if(!maxWidth)maxWidth=400; |
1068 | | - if(!overflow_style)overflow_style='overflow:auto;'; |
1069 | | - //remove any old instance: |
| 1067 | + if(!overflow_style)overflow_style='overflow:auto;'; |
| 1068 | + //remove any old instance: |
1070 | 1069 | $j( _this.target_container ).find('#rsd_resource_edit').remove(); |
1071 | | - //add the edit layout window with loading place holders |
| 1070 | + //add the edit layout window with loading place holders |
1072 | 1071 | $j( _this.target_container ).append('<div id="rsd_resource_edit" '+ |
1073 | 1072 | 'style="position:absolute;top:0px;left:0px;bottom:5px;right:4px;background-color:#FFF;">' + |
1074 | 1073 | '<div id="clip_edit_disp" style="position:absolute;' + overflow_style + 'width:100%;height:100%;padding:5px;'+ |
— | — | @@ -1103,7 +1102,7 @@ |
1104 | 1103 | //append to the top level of model window: |
1105 | 1104 | _this.addResourceEditLoader(maxWidth, overflow_style); |
1106 | 1105 | //update add media wizard title: |
1107 | | - $j( _this.target_container ).dialog( 'option', 'title', gM('add_media_wizard')+': '+ gM('rsd_resource_edit', rObj.title ) ); |
| 1106 | + $j( _this.target_container ).dialog( 'option', 'title', gM('mwe-add_media_wizard')+': '+ gM('rsd_resource_edit', rObj.title ) ); |
1108 | 1107 | js_log('did append to: '+ _this.target_container ); |
1109 | 1108 | |
1110 | 1109 | $j('#rsd_resource_edit').css('opacity',0); |
— | — | @@ -1133,8 +1132,8 @@ |
1134 | 1133 | 'left':'5px', |
1135 | 1134 | 'width': maxWidth + 'px', |
1136 | 1135 | 'height': parseInt( tRatio * maxWidth) + 'px' |
1137 | | - }, "slow"); // do it slow to give it a chance to finish loading the HQ version |
1138 | | - |
| 1136 | + }, "slow"); // do it slow to give it a chance to finish loading the HQ version |
| 1137 | + |
1139 | 1138 | if( mediaType == 'image' ){ |
1140 | 1139 | _this.loadHQImg(rObj, {'width':maxWidth}, 'rsd_edit_img', function(){ |
1141 | 1140 | $j('.mv_loading_img').remove(); |
— | — | @@ -1160,7 +1159,7 @@ |
1161 | 1160 | rObj['width'] = imObj.width; |
1162 | 1161 | rObj['height'] = imObj.height; |
1163 | 1162 | |
1164 | | - //see if we need to animate some transition |
| 1163 | + //see if we need to animate some transition |
1165 | 1164 | if( size.width != imObj.width ){ |
1166 | 1165 | js_log('loadHQImg:size mismatch: ' + size.width + ' != ' + imObj.width ); |
1167 | 1166 | //set the target id to the new size: |
— | — | @@ -1188,10 +1187,10 @@ |
1189 | 1188 | var _this = this; |
1190 | 1189 | var b_target = _this.target_container + '~ .ui-dialog-buttonpane'; |
1191 | 1190 | $j('#rsd_resource_edit').remove(); |
1192 | | - //restore the resource container: |
| 1191 | + //restore the resource container: |
1193 | 1192 | $j('#rsd_results_container').show(); |
1194 | 1193 | //restore the title: |
1195 | | - $j( _this.target_container ).dialog( 'option', 'title', gM('add_media_wizard')); |
| 1194 | + $j( _this.target_container ).dialog( 'option', 'title', gM('mwe-add_media_wizard')); |
1196 | 1195 | js_log("should update: " + b_target + ' with: cancel'); |
1197 | 1196 | //restore the buttons: |
1198 | 1197 | $j(b_target).html( $j.btnHtml( 'Cancel' , 'mv_cancel_rsd', 'close')) |
— | — | @@ -1346,7 +1345,7 @@ |
1347 | 1346 | if( rObj.desc ){ |
1348 | 1347 | wt += '|Description= ' + rObj.desc + "\n"; |
1349 | 1348 | }else{ |
1350 | | - wt += '|Description= ' + gM('missing_desc_see_soruce', rObj.link ) + "\n"; |
| 1349 | + wt += '|Description= ' + gM('mwe-missing_desc_see_source', rObj.link ) + "\n"; |
1351 | 1350 | } |
1352 | 1351 | |
1353 | 1352 | //output search specific info |
— | — | @@ -1365,13 +1364,13 @@ |
1366 | 1365 | wt+='|other_versions=' + rObj.other_versions + "\n"; |
1367 | 1366 | |
1368 | 1367 | wt+='}}'; |
1369 | | - |
| 1368 | + |
1370 | 1369 | //get any extra categories or helpful links |
1371 | 1370 | wt+= rObj.pSobj.getExtraResourceDescWiki( rObj ); |
1372 | 1371 | |
1373 | 1372 | |
1374 | 1373 | $j('#rsd_resource_import').remove();//remove any old resource imports |
1375 | | - |
| 1374 | + |
1376 | 1375 | //@@ show user dialog to import the resource |
1377 | 1376 | $j( _this.target_container ).append('<div id="rsd_resource_import" '+ |
1378 | 1377 | 'class="ui-state-highlight ui-widget-content ui-state-error" ' + |
— | — | @@ -1380,27 +1379,27 @@ |
1381 | 1380 | '<div id="rsd_preview_import_container" style="position:absolute;width:50%;bottom:0px;left:0px;overflow:auto;top:30px;">' + |
1382 | 1381 | rObj.pSobj.getEmbedHTML( rObj, {'id': _this.target_container + '_rsd_pv_vid', 'max_height':'200','only_poster':true} )+ //get embedHTML with small thumb: |
1383 | 1382 | '<br style="clear both">'+ |
1384 | | - '<strong>'+gM('resource_page_desc') +'</strong>'+ |
| 1383 | + '<strong>'+gM('mwe-resource_page_desc') +'</strong>'+ |
1385 | 1384 | '<div id="rsd_import_desc" syle="display:inline;">'+ |
1386 | 1385 | mv_get_loading_img('position:absolute;top:5px;left:5px') + |
1387 | 1386 | '</div>'+ |
1388 | 1387 | '</div>'+ |
1389 | 1388 | '<div id="rds_edit_import_container" style="position:absolute;left:50%;' + |
1390 | 1389 | 'bottom:0px;top:30px;right:0px;overflow:auto;">'+ |
1391 | | - '<strong>' + gM('local_resource_title') + '</strong><br>'+ |
| 1390 | + '<strong>' + gM('mwe-local_resource_title') + '</strong><br>'+ |
1392 | 1391 | '<input type="text" size="30" value="' + rObj.target_resource_title + '" readonly="true"><br>'+ |
1393 | | - '<strong>' + gM('edit_resource_desc') + '</strong>' + |
| 1392 | + '<strong>' + gM('mwe-edit_resource_desc') + '</strong>' + |
1394 | 1393 | '<textarea id="rsd_import_ta" id="mv_img_desc" style="width:90%;" rows="8" cols="50">' + |
1395 | 1394 | wt + |
1396 | 1395 | '</textarea><br>' + |
1397 | 1396 | '<input type="checkbox" value="true" id="wpWatchthis" name="wpWatchthis" tabindex="7"/>' + |
1398 | | - '<label for="wpWatchthis">'+gM('watch_this_page')+'</label><br><br><br>' + |
| 1397 | + '<label for="wpWatchthis">'+gM('mwe-watch_this_page')+'</label><br><br><br>' + |
1399 | 1398 | |
1400 | | - $j.btnHtml(gM('do_import_resource'), 'rsd_import_doimport', 'check' ) + ' ' + |
| 1399 | + $j.btnHtml(gM('mwe-do_import_resource'), 'rsd_import_doimport', 'check' ) + ' ' + |
1401 | 1400 | |
1402 | | - $j.btnHtml(gM('update_preview'), 'rsd_import_apreview', 'refresh' ) + '<div style="clear:both;height:20px;"/>' + |
| 1401 | + $j.btnHtml(gM('mwe-update_preview'), 'rsd_import_apreview', 'refresh' ) + '<div style="clear:both;height:20px;"/>' + |
1403 | 1402 | |
1404 | | - $j.btnHtml(gM('cancel_import'), 'rsd_import_acancel', 'close' ) + ' ' + |
| 1403 | + $j.btnHtml(gM('mwe-cancel_import'), 'rsd_import_acancel', 'close' ) + ' ' + |
1405 | 1404 | |
1406 | 1405 | '</div>'+ |
1407 | 1406 | //output the rendered and non-renderd version of description for easy swiching: |
— | — | @@ -1536,7 +1535,7 @@ |
1537 | 1536 | 'style="position:absolute;top:0px;'+ |
1538 | 1537 | 'left:0px;width:100%;height:100%;'+ |
1539 | 1538 | 'z-index:5;background:#FFF;overflow:auto;">'+ |
1540 | | - '<div style="position:absolute;left:30%;right:30%"><h3>'+gM('importing_asset')+'</h3><br>' + |
| 1539 | + '<div style="position:absolute;left:30%;right:30%"><h3>'+gM('mwe-importing_asset')+'</h3><br>' + |
1541 | 1540 | mv_get_loading_img('','mv_loading_bar_img') + |
1542 | 1541 | '</div>'+ |
1543 | 1542 | '</div>' |
— | — | @@ -1568,7 +1567,7 @@ |
1569 | 1568 | js_log( 'error text is: ' + error_txt ); |
1570 | 1569 | $j( '#rsd_resource_import' ).html( '<h3>Error</h3>' + error_txt + '<br>' + form_txt + |
1571 | 1570 | '<br>'+ |
1572 | | - '<a href="#" id="rsd_import_error" >' + gM('cancel_import') + '</a>' |
| 1571 | + '<a href="#" id="rsd_import_error" >' + gM('mwe-cancel_import') + '</a>' |
1573 | 1572 | ); |
1574 | 1573 | //set up cancel action: |
1575 | 1574 | $j('#rsd_import_error').click(function(){ |
— | — | @@ -1591,12 +1590,12 @@ |
1592 | 1591 | 'style="position:absolute;overflow:hidden;z-index:4;top:0px;bottom:75px;right:0px;left:0px;background-color:#FFF;">' + |
1593 | 1592 | mv_get_loading_img('top:30px;left:30px') + |
1594 | 1593 | '</div>'); |
1595 | | - |
| 1594 | + |
1596 | 1595 | var bPlaneTarget = _this.target_container +'~ .ui-dialog-buttonpane'; |
1597 | 1596 | var pTitle = $j( _this.target_container ).dialog('option', 'title'); |
1598 | 1597 | |
1599 | 1598 | //update title: |
1600 | | - $j( _this.target_container ).dialog('option', 'title', gM('preview_insert_resource', rObj.title) ); |
| 1599 | + $j( _this.target_container ).dialog('option', 'title', gM('mwe-preview_insert_resource', rObj.title) ); |
1601 | 1600 | |
1602 | 1601 | //update buttons preview: |
1603 | 1602 | $j(bPlaneTarget).html( $j.btnHtml( gM('rsd_do_insert'), 'preview_do_insert', 'check') + ' ' ) |
— | — | @@ -1675,7 +1674,7 @@ |
1676 | 1675 | //update if its video or audio: |
1677 | 1676 | if( rObj.mime.indexOf('audio')!=-1 || |
1678 | 1677 | rObj.mime.indexOf('video')!=-1 || |
1679 | | - rObj.mime.indexOf('/ogg') !=-1){ |
| 1678 | + rObj.mime.indexOf('/ogg') !=-1){ |
1680 | 1679 | mvJsLoader.embedVideoCheck(function(){ |
1681 | 1680 | mv_video_embed(); |
1682 | 1681 | }); |
— | — | @@ -1701,7 +1700,7 @@ |
1702 | 1701 | if( this.content_providers[this.disp_item] ){ |
1703 | 1702 | var cp = this.content_providers[this.disp_item]; |
1704 | 1703 | about_desc ='<span style="position:relative;top:0px;font-style:italic;">' + |
1705 | | - '<i>' + gM('results_from', [cp.homepage, cp.title]) + '</i></span>'; |
| 1704 | + '<i>' + gM('mwe-results_from', [cp.homepage, cp.title]) + '</i></span>'; |
1706 | 1705 | $j('#tab-'+this.disp_item).append( '<div id="rds_results_bar">'+ |
1707 | 1706 | '<span style="float:left;top:0px;font-style:italic;">'+ |
1708 | 1707 | gM('rsd_layout')+' '+ |
Index: trunk/phase3/js2/mwEmbed/libSequencer/mvTimedEffectsEdit.js |
— | — | @@ -7,15 +7,14 @@ |
8 | 8 | |
9 | 9 | //add our local msgs |
10 | 10 | loadGM({ |
11 | | - "transition_in" : "Transition in", |
12 | | - "transition_out" : "Transition out", |
13 | | - "effects" : "Effects stack", |
14 | | - "remove_transition" : "Remove transition", |
15 | | - "edit_transin" : "Edit transition into clip", |
16 | | - "edit_transout" : "Edit transition out of clip" |
| 11 | + "mwe-transition_in" : "Transition in", |
| 12 | + "mwe-transition_out" : "Transition out", |
| 13 | + "mwe-effects" : "Effects stack", |
| 14 | + "mwe-remove_transition" : "Remove transition", |
| 15 | + "mwe-edit_transin" : "Edit transition into clip", |
| 16 | + "mwe-edit_transout" : "Edit transition out of clip" |
17 | 17 | }); |
18 | 18 | |
19 | | - |
20 | 19 | var default_timed_effect_values = { |
21 | 20 | 'rObj': null, // the resource object |
22 | 21 | 'clip_disp_ct':null, //target clip disp |
— | — | @@ -35,21 +34,21 @@ |
36 | 35 | //the menu_items Object contains: default html, js setup/loader functions |
37 | 36 | menu_items : { |
38 | 37 | 'transin':{ |
39 | | - 'title':gM('transition_in'), |
| 38 | + 'title':gM('mwe-transition_in'), |
40 | 39 | 'clip_attr':'transIn', |
41 | 40 | 'doEdit':function(_this){ |
42 | 41 | _this.doTransitionDisplayEdit('transin'); |
43 | 42 | } |
44 | 43 | }, |
45 | 44 | 'transout':{ |
46 | | - 'title':gM('transition_out'), |
| 45 | + 'title':gM('mwe-transition_out'), |
47 | 46 | 'clip_attr':'transOut', |
48 | 47 | 'doEdit':function(_this){ |
49 | 48 | _this.doTransitionDisplayEdit('transout'); |
50 | 49 | } |
51 | 50 | }, |
52 | 51 | 'effects':{ |
53 | | - 'title':gM('effects'), |
| 52 | + 'title':gM('mwe-effects'), |
54 | 53 | 'clip_attr':'Effects', |
55 | 54 | 'doEdit':function(_this){ |
56 | 55 | //display |
— | — | @@ -126,7 +125,7 @@ |
127 | 126 | var _this = this; |
128 | 127 | var appendTarget = '#te_effects'; |
129 | 128 | js_log('type:' + _this.rObj['type']); |
130 | | - $j(appendTarget).html(gM('loading_txt')); |
| 129 | + $j(appendTarget).html(gM('mwe-loading_txt')); |
131 | 130 | //@@todo integrate into core and loading system: |
132 | 131 | loadExternalJs(mv_embed_path + 'libClipEdit/pixastic-editor/editor.js?' + getMvUniqueReqId() ); |
133 | 132 | loadExternalJs(mv_embed_path + 'libClipEdit/pixastic-editor/pixastic.all.js?' + getMvUniqueReqId() ); |
— | — | @@ -159,7 +158,7 @@ |
160 | 159 | return ; |
161 | 160 | } |
162 | 161 | var cTran = this.rObj[ this.menu_items[ target_item ].clip_attr ]; |
163 | | - var o='<h3>' + gM('edit_'+target_item ) + '</h3>'; |
| 162 | + var o='<h3>' + gM('mwe-edit_'+target_item ) + '</h3>'; |
164 | 163 | o+='Type: ' + |
165 | 164 | '<select class="te_select_type">'; |
166 | 165 | for(var typeKey in mvTransLib.type){ |
— | — | @@ -180,7 +179,7 @@ |
181 | 180 | _this.getSubTypeControl( target_item, cTran.type, apendTarget + ' .te_subtype_container' ); |
182 | 181 | |
183 | 182 | //add remove transition button: |
184 | | - $j(apendTarget).append( '<br><br>' + $j.btnHtml(gM('remove_transition'), 'te_remove_transition', 'close' ) ) |
| 183 | + $j(apendTarget).append( '<br><br>' + $j.btnHtml(gM('mwe-remove_transition'), 'te_remove_transition', 'close' ) ) |
185 | 184 | .children('.te_remove_transition') |
186 | 185 | .click(function(){ |
187 | 186 | //remove the transtion from the playlist |
Index: trunk/phase3/js2/mwEmbed/libSequencer/mvSequencer.js |
— | — | @@ -19,40 +19,40 @@ |
20 | 20 | */ |
21 | 21 | |
22 | 22 | loadGM({ |
23 | | - "menu_clipedit" : "Edit media", |
24 | | - "menu_transition" : "Transitions and effects", |
25 | | - "menu_cliplib" : "Add media", |
26 | | - "menu_resource_overview" : "Resource overview", |
27 | | - "menu_options" : "Options", |
28 | | - "loading_timeline" : "Loading timeline <blink>...<\/blink>", |
29 | | - "loading_user_rights" : "Loading user rights <blink>...<\/blink>", |
30 | | - "no_edit_permissions" : "You do not have permissions to save changes to this sequence", |
31 | | - "edit_clip" : "Edit clip", |
32 | | - "edit_save" : "Save sequence changes", |
33 | | - "saving_wait" : "Save in progress (please wait)", |
34 | | - "save_done" : "Save complete", |
35 | | - "edit_cancel" : "Cancel sequence edit", |
36 | | - "edit_cancel_confirm" : "Are you sure you want to cancel your edit? Changes will be lost.", |
37 | | - "zoom_in" : "Zoom in", |
38 | | - "zoom_out" : "Zoom out", |
39 | | - "cut_clip" : "Cut clips", |
40 | | - "expand_track" : "Expand track", |
41 | | - "colapse_track" : "Collapse track", |
42 | | - "play_from_position" : "Play from playline position", |
43 | | - "pixle2sec" : "pixles to seconds", |
44 | | - "rmclip" : "Remove clip", |
45 | | - "clip_in" : "clip in", |
46 | | - "clip_out" : "clip out", |
47 | | - "mv_welcome_to_sequencer" : "<h3>Welcome to the sequencer demo<\/h3> Very <b>limited<\/b> functionality right now. Not much documentation yet either.", |
48 | | - "no_selected_resource" : "<h3>No resource selected<\/h3> Select a clip to enable editing.", |
49 | | - "error_edit_multiple" : "<h3>Multiple resources selected<\/h3> Select a single clip to edit it.", |
50 | | - "mv_editor_options" : "Editor options", |
51 | | - "mv_editor_mode" : "Editor mode", |
52 | | - "mv_simple_editor_desc" : "simple editor (iMovie style)", |
53 | | - "mv_advanced_editor_desc" : "advanced editor (Final Cut style)", |
54 | | - "mv_other_options" : "Other options", |
55 | | - "mv_contextmenu_opt" : "Enable context menus", |
56 | | - "mv_sequencer_credit_line" : "Developed by <a href=\"http:\/\/kaltura.com\">Kaltura, Inc.<\/a> in partnership with the <a href=\"http:\/\/wikimediafoundation.org\/wiki\/Home\">Wikimedia Foundation<\/a> (<a href=\"#\">more information<\/a>)." |
| 23 | + "mwe-menu_clipedit" : "Edit media", |
| 24 | + "mwe-menu_transition" : "Transitions and effects", |
| 25 | + "mwe-menu_cliplib" : "Add media", |
| 26 | + "mwe-menu_resource_overview" : "Resource overview", |
| 27 | + "mwe-menu_options" : "Options", |
| 28 | + "mwe-loading_timeline" : "Loading timeline <blink>...<\/blink>", |
| 29 | + "mwe-loading_user_rights" : "Loading user rights <blink>...<\/blink>", |
| 30 | + "mwe-no_edit_permissions" : "You do not have permissions to save changes to this sequence", |
| 31 | + "mwe-edit_clip" : "Edit clip", |
| 32 | + "mwe-edit_save" : "Save sequence changes", |
| 33 | + "mwe-saving_wait" : "Save in progress (please wait)", |
| 34 | + "mwe-save_done" : "Save complete", |
| 35 | + "mwe-edit_cancel" : "Cancel sequence edit", |
| 36 | + "mwe-edit_cancel_confirm" : "Are you sure you want to cancel your edit? Changes will be lost.", |
| 37 | + "mwe-zoom_in" : "Zoom in", |
| 38 | + "mwe-zoom_out" : "Zoom out", |
| 39 | + "mwe-cut_clip" : "Cut clips", |
| 40 | + "mwe-expand_track" : "Expand track", |
| 41 | + "mwe-collapse_track" : "Collapse track", |
| 42 | + "mwe-play_from_position" : "Play from playline position", |
| 43 | + "mwe-pixle2sec" : "pixels to seconds", |
| 44 | + "mwe-rmclip" : "Remove clip", |
| 45 | + "mwe-clip_in" : "clip in", |
| 46 | + "mwe-clip_out" : "clip out", |
| 47 | + "mwe-welcome_to_sequencer" : "<h3>Welcome to the sequencer demo<\/h3> Very <b>limited<\/b> functionality right now. Not much documentation yet either.", |
| 48 | + "mwe-no_selected_resource" : "<h3>No resource selected<\/h3> Select a clip to enable editing.", |
| 49 | + "mwe-error_edit_multiple" : "<h3>Multiple resources selected<\/h3> Select a single clip to edit it.", |
| 50 | + "mwe-editor_options" : "Editor options", |
| 51 | + "mwe-editor_mode" : "Editor mode", |
| 52 | + "mwe-simple_editor_desc" : "simple editor (iMovie style)", |
| 53 | + "mwe-advanced_editor_desc" : "advanced editor (Final Cut style)", |
| 54 | + "mwe-other_options" : "Other options", |
| 55 | + "mwe-contextmenu_opt" : "Enable context menus", |
| 56 | + "mwe-sequencer_credit_line" : "Developed by <a href=\"http:\/\/kaltura.com\">Kaltura, Inc.<\/a> in partnership with the <a href=\"http:\/\/wikimediafoundation.org\/wiki\/Home\">Wikimedia Foundation<\/a> (<a href=\"#\">more information<\/a>)." |
57 | 57 | }); |
58 | 58 | //used to set default values and validate the passed init object |
59 | 59 | var sequencerDefaultValues = { |
— | — | @@ -131,7 +131,7 @@ |
132 | 132 | }, |
133 | 133 | 'transition':{ |
134 | 134 | 'd':0, |
135 | | - 'html' : '<h3>' + gM('menu_transition') + '</h3>', |
| 135 | + 'html' : '<h3>' + gM('mwe-menu_transition') + '</h3>', |
136 | 136 | 'js':function(this_seq){ |
137 | 137 | this_seq.doEditTransitionSelectedClip(); |
138 | 138 | }, |
— | — | @@ -156,15 +156,15 @@ |
157 | 157 | }, |
158 | 158 | 'options':{ |
159 | 159 | 'd':0, |
160 | | - 'html' : '<h3>' + gM('menu_options') + '</h3>' + |
161 | | - gM('mv_editor_mode') + '<br> ' + |
| 160 | + 'html' : '<h3>' + gM('mwe-menu_options') + '</h3>' + |
| 161 | + gM('mwe-editor_mode') + '<br> ' + |
162 | 162 | '<blockquote><input type="radio" value="simple_editor" name="opt_editor">' + |
163 | | - gM('mv_simple_editor_desc') + ' </blockquote>' + |
| 163 | + gM('mwe-simple_editor_desc') + ' </blockquote>' + |
164 | 164 | '<blockquote><input type="radio" value="advanced_editor" name="opt_editor">' + |
165 | | - gM('mv_advanced_editor_desc') + ' </blockquote>'+ |
166 | | - gM('mv_other_options') + '<br>' + |
| 165 | + gM('mwe-advanced_editor_desc') + ' </blockquote>'+ |
| 166 | + gM('mwe-other_options') + '<br>' + |
167 | 167 | '<blockquote><input type="checkbox" value="contextmenu_opt" name="contextmenu_opt">' + |
168 | | - gM('mv_contextmenu_opt') + ' </blockquote>', |
| 168 | + gM('mwe-contextmenu_opt') + ' </blockquote>', |
169 | 169 | 'js':function(this_seq){ |
170 | 170 | $j('#options_ic input[value=\'simple_editor\']').attr({ |
171 | 171 | 'checked':(this_seq.timeline_mode=='storyboard')?true:false |
— | — | @@ -216,14 +216,14 @@ |
217 | 217 | 'width:' + this.video_width + 'px;height:'+this.video_height+'px;border:solid thin blue;background:#FFF;font-color:black;"/>'+ |
218 | 218 | '<div id="' + this.timeline_id + '" class="ui-widget ui-widget-content ui-corner-all" style="position:absolute;' + |
219 | 219 | 'left:0px;right:0px;top:'+(this.video_height+34)+'px;bottom:35px;overflow:auto;">'+ |
220 | | - gM('loading_timeline')+ '</div>'+ |
| 220 | + gM('mwe-loading_timeline')+ '</div>'+ |
221 | 221 | '<div class="seq_status" style="position:absolute;left:0px;width:300px;"></div>'+ |
222 | 222 | '<div class="seq_save_cancel" style="position:absolute;'+ |
223 | 223 | 'left:5px;bottom:0px;height:25px;">'+ |
224 | | - gM('loading_user_rights') + |
| 224 | + gM('mwe-loading_user_rights') + |
225 | 225 | '</div>'+ |
226 | 226 | '<div class="about_editor" style="position:absolute;right:5px;bottom:7px;">' + |
227 | | - gM('mv_sequencer_credit_line') + |
| 227 | + gM('mwe-sequencer_credit_line') + |
228 | 228 | '</div>'+ |
229 | 229 | '<div id="'+this.sequence_tools_id+'" style="position:absolute;' + |
230 | 230 | 'left:0px;right:'+(this.video_width+15)+'px;top:0px;height:'+(this.video_height+23)+'px;"/>' |
— | — | @@ -266,15 +266,15 @@ |
267 | 267 | var _this = this; |
268 | 268 | if( this.sequenceEditToken ){ |
269 | 269 | $j(this.target_sequence_container+' .seq_save_cancel').html( |
270 | | - $j.btnHtml( gM('edit_save'), 'seq_edit_save', 'close') + ' ' + |
271 | | - $j.btnHtml( gM('edit_cancel'), 'seq_edit_cancel', 'close') |
| 270 | + $j.btnHtml( gM('mwe-edit_save'), 'seq_edit_save', 'close') + ' ' + |
| 271 | + $j.btnHtml( gM('mwe-edit_cancel'), 'seq_edit_cancel', 'close') |
272 | 272 | ); |
273 | 273 | }else{ |
274 | | - $j(this.target_sequence_container+' .seq_save_cancel').html( cancel_button + gM('no_edit_permissions') ); |
| 274 | + $j(this.target_sequence_container+' .seq_save_cancel').html( cancel_button + gM('mwe-no_edit_permissions') ); |
275 | 275 | } |
276 | 276 | //assing bindings |
277 | 277 | $j(this.target_sequence_container +' .seq_edit_cancel').unbind().click(function(){ |
278 | | - var x = window.confirm( gM('edit_cancel_confirm') ); |
| 278 | + var x = window.confirm( gM('mwe-edit_cancel_confirm') ); |
279 | 279 | if( x ){ |
280 | 280 | _this.closeModEditor(); |
281 | 281 | }else{ |
— | — | @@ -285,7 +285,7 @@ |
286 | 286 | //pop up progress dialog ~requesting edit line summary~ |
287 | 287 | //remove any other save dialog |
288 | 288 | $j('#seq_save_dialog').remove(); |
289 | | - $j('body').append('<div id="seq_save_dialog" title="'+ gM('edit_save') +'">' + |
| 289 | + $j('body').append('<div id="seq_save_dialog" title="'+ gM('mwe-edit_save') +'">' + |
290 | 290 | '<span class="mw-summary">'+ |
291 | 291 | '<label for="seq_save_summary">Edit summary: </label>' + |
292 | 292 | '</span>'+ |
— | — | @@ -309,7 +309,7 @@ |
310 | 310 | }; |
311 | 311 | //change to progress bar and save: |
312 | 312 | $j('#seq_save_dialog').html('<div class="progress" /><br>' + |
313 | | - gM('saving_wait') |
| 313 | + gM('mwe-saving_wait') |
314 | 314 | ) |
315 | 315 | $j('#seq_save_dialog .progress').progressbar({ |
316 | 316 | value: 100 |
— | — | @@ -319,7 +319,7 @@ |
320 | 320 | 'data': saveReq, |
321 | 321 | 'url' : _this.getLocalApiUrl() |
322 | 322 | },function(data){ |
323 | | - $j('#seq_save_dialog').html( gM('save_done') ); |
| 323 | + $j('#seq_save_dialog').html( gM('mwe-save_done') ); |
324 | 324 | $j('#seq_save_dialog').dialog('option', |
325 | 325 | 'buttons', { |
326 | 326 | "Done":function(){ |
— | — | @@ -373,16 +373,16 @@ |
374 | 374 | $j('#'+this.timeline_id).html(''+ |
375 | 375 | '<div id="'+this.timeline_id+'_left_cnt" class="mv_tl_left_cnt">'+ |
376 | 376 | '<div id="'+this.timeline_id+'_head_control" style="position:absolute;top:0px;left:0px;right:0px;height:30px;">' + |
377 | | - '<a title="'+gM('play_from_position')+'" href="javascript:'+this.instance_name+'.play_jt()">'+ |
| 377 | + '<a title="'+gM('mwe-play_from_position')+'" href="javascript:'+this.instance_name+'.play_jt()">'+ |
378 | 378 | '<img style="width:16px;height:16px;border:0" src="' + mv_embed_path + 'images/control_play_blue.png">'+ |
379 | 379 | '</a>'+ |
380 | | - '<a title="'+gM('zoom_in')+'" href="javascript:'+this.instance_name+'.zoom_in()">'+ |
| 380 | + '<a title="'+gM('mwe-zoom_in')+'" href="javascript:'+this.instance_name+'.zoom_in()">'+ |
381 | 381 | '<img style="width:16px;height:16px;border:0" src="' + mv_embed_path + 'images/zoom_in.png">'+ |
382 | 382 | '</a>'+ |
383 | | - '<a title="'+gM('zoom_out')+'" href="javascript:'+this.instance_name+'.zoom_out()">'+ |
| 383 | + '<a title="'+gM('mwe-zoom_out')+'" href="javascript:'+this.instance_name+'.zoom_out()">'+ |
384 | 384 | '<img style="width:16px;height:16px;border:0" src="' + mv_embed_path + 'images/zoom_out.png">'+ |
385 | 385 | '</a>'+ |
386 | | - '<a title="'+gM('cut_clip')+'" href="javascript:'+this.instance_name+'.cut_mode()">'+ |
| 386 | + '<a title="'+gM('mwe-cut_clip')+'" href="javascript:'+this.instance_name+'.cut_mode()">'+ |
387 | 387 | '<img style="width:16px;height:16px;border:0" src="' + mv_embed_path + 'images/cut.png">'+ |
388 | 388 | '</a>'+ |
389 | 389 | '</div>' + |
— | — | @@ -406,13 +406,13 @@ |
407 | 407 | var track_height=60; |
408 | 408 | var exc_img = 'opened'; |
409 | 409 | var exc_action='close'; |
410 | | - var exc_msg = gM('colapse_track'); |
| 410 | + var exc_msg = gM('mwe-collapse_track'); |
411 | 411 | break; |
412 | 412 | case 'text': |
413 | 413 | var track_height=20; |
414 | 414 | var exc_img = 'closed'; |
415 | 415 | var exc_action='open'; |
416 | | - var exc_msg = gM('expand_track'); |
| 416 | + var exc_msg = gM('mwe-expand_track'); |
417 | 417 | break; |
418 | 418 | } |
419 | 419 | //add track name: |
— | — | @@ -555,11 +555,11 @@ |
556 | 556 | } |
557 | 557 | |
558 | 558 | o+='<li>' + |
559 | | - '<a id="mv_menu_item_'+tab_id+'" href="#' + tab_id + '_ic">'+gM('menu_' + tab_id ) + '</a>' + |
| 559 | + '<a id="mv_menu_item_'+tab_id+'" href="#' + tab_id + '_ic">'+gM('mwe-menu_' + tab_id ) + '</a>' + |
560 | 560 | '</li>'; |
561 | 561 | |
562 | 562 | tabc += '<div id="' + tab_id + '_ic" style="overflow:auto;height:268px;" >'; |
563 | | - tabc += (menu_item.html) ? menu_item.html : '<h3>' + gM('menu_'+tab_id) + '</h3>'; |
| 563 | + tabc += (menu_item.html) ? menu_item.html : '<h3>' + gM('mwe-menu_'+tab_id) + '</h3>'; |
564 | 564 | tabc +='</div>'; |
565 | 565 | inx++; |
566 | 566 | }; |
— | — | @@ -714,10 +714,10 @@ |
715 | 715 | _this.doEditTransition( _this.getClipFromSeqID( $j('.mv_selected_clip').parent().attr('id') ) ); |
716 | 716 | }else if( $j('.mv_selected_clip').length === 0){ |
717 | 717 | //no clip selected warning: |
718 | | - $j('#transition_ic').html( gM('no_selected_resource') ); |
| 718 | + $j('#transition_ic').html( gM('mwe-no_selected_resource') ); |
719 | 719 | }else{ |
720 | 720 | //multiple clip selected warning: |
721 | | - $j('#transition_ic').html( gM('error_edit_multiple') ); |
| 721 | + $j('#transition_ic').html( gM('mwe-error_edit_multiple') ); |
722 | 722 | } |
723 | 723 | }, |
724 | 724 | doEditSelectedClip:function(){ |
— | — | @@ -727,10 +727,10 @@ |
728 | 728 | this.doEditClip( this.getClipFromSeqID( $j('.mv_selected_clip').parent().attr('id') ) ); |
729 | 729 | }else if( $j('.mv_selected_clip').length === 0){ |
730 | 730 | //no clip selected warning: |
731 | | - $j('#clipedit_ic').html( gM('no_selected_resource') ); |
| 731 | + $j('#clipedit_ic').html( gM('mwe-no_selected_resource') ); |
732 | 732 | }else{ |
733 | 733 | //multiple clip selected warning: |
734 | | - $j('#clipedit_ic').html( gM('error_edit_multiple') ); |
| 734 | + $j('#clipedit_ic').html( gM('mwe-error_edit_multiple') ); |
735 | 735 | } |
736 | 736 | }, |
737 | 737 | doEditTransition:function( cObj ){ |
— | — | @@ -1075,9 +1075,9 @@ |
1076 | 1076 | '" class="mv_time_clip_text mv_clip_drag">'+clip.title; |
1077 | 1077 | } |
1078 | 1078 | //add in per clip controls |
1079 | | - track_html+='<div title="'+gM('clip_in')+' '+clip.embed.start_ntp+'" class="ui-resizable-w ui-resizable-handle" style="width: 16px; height: 16px; left: 0px; top: 2px;background:url(\''+mv_embed_path+'images/application_side_contract.png\');" ></div>'+"\n"; |
1080 | | - track_html+='<div title="'+gM('clip_out')+' '+clip.embed.end_ntp+'" class="ui-resizable-e ui-resizable-handle" style="width: 16px; height: 16px; right: 0px; top: 2px;background:url(\''+mv_embed_path+'images/application_side_expand.png\');" ></div>'+"\n"; |
1081 | | - track_html+='<div title="'+gM('rmclip')+'" onClick="'+this.instance_name + '.removeClips(new Array([' + track_id + ',' + j + ']))" style="position:absolute;cursor:pointer;width: 16px; height: 16px; left: 0px; bottom:2px;background:url(\''+mv_embed_path+'images/delete.png\');"></div>'+"\n"; |
| 1079 | + track_html+='<div title="'+gM('mwe-clip_in')+' '+clip.embed.start_ntp+'" class="ui-resizable-w ui-resizable-handle" style="width: 16px; height: 16px; left: 0px; top: 2px;background:url(\''+mv_embed_path+'images/application_side_contract.png\');" ></div>'+"\n"; |
| 1080 | + track_html+='<div title="'+gM('mwe-clip_out')+' '+clip.embed.end_ntp+'" class="ui-resizable-e ui-resizable-handle" style="width: 16px; height: 16px; right: 0px; top: 2px;background:url(\''+mv_embed_path+'images/application_side_expand.png\');" ></div>'+"\n"; |
| 1081 | + track_html+='<div title="'+gM('mwe-rmclip')+'" onClick="'+this.instance_name + '.removeClips(new Array([' + track_id + ',' + j + ']))" style="position:absolute;cursor:pointer;width: 16px; height: 16px; left: 0px; bottom:2px;background:url(\''+mv_embed_path+'images/delete.png\');"></div>'+"\n"; |
1082 | 1082 | track_html+='<span style="display:none;" class="mv_clip_stats"></span>'; |
1083 | 1083 | |
1084 | 1084 | track_html+='</span>'; |
Index: trunk/phase3/js2/mwEmbed/libClipEdit/mvClipEdit.js |
— | — | @@ -7,27 +7,27 @@ |
8 | 8 | */ |
9 | 9 | //set gMsg object: |
10 | 10 | loadGM({ |
11 | | - "mv_crop" : "Crop image", |
12 | | - "mv_apply_crop" : "Apply crop to image", |
13 | | - "mv_reset_crop" : "Reset crop", |
14 | | - "mv_insert_image_page" : "Insert into page", |
15 | | - "mv_insert_into_sequence" : "Insert into sequence", |
16 | | - "mv_preview_insert" : "Preview insert", |
17 | | - "mv_cancel_image_insert" : "Cancel insert", |
18 | | - "sc_fileopts" : "Clip detail edit", |
19 | | - "sc_inoutpoints" : "Set in-out points", |
20 | | - "sc_overlays" : "Overlays", |
21 | | - "sc_audio" : "Audio control", |
22 | | - "sc_duration" : "Duration", |
23 | | - "mv_template_properties" : "Template properties", |
24 | | - "mv_custom_title" : "Custom title", |
25 | | - "mv_edit_properties" : "Edit properties", |
26 | | - "mv_other_properties" : "Other properties", |
27 | | - "mv_resource_page" : "Resource page:", |
28 | | - "mv_set_in_out_points" : "Set in-out points", |
29 | | - "mv_start_time" : "Start time", |
30 | | - "mv_end_time" : "End time", |
31 | | - "mv_preview_inout" : "Preview\/play in-out points" |
| 11 | + "mwe-crop" : "Crop image", |
| 12 | + "mwe-apply_crop" : "Apply crop to image", |
| 13 | + "mwe-reset_crop" : "Reset crop", |
| 14 | + "mwe-insert_image_page" : "Insert into page", |
| 15 | + "mwe-insert_into_sequence" : "Insert into sequence", |
| 16 | + "mwe-preview_insert" : "Preview insert", |
| 17 | + "mwe-cancel_image_insert" : "Cancel insert", |
| 18 | + "mwe-sc_fileopts" : "Clip detail edit", |
| 19 | + "mwe-sc_inoutpoints" : "Set in-out points", |
| 20 | + "mwe-sc_overlays" : "Overlays", |
| 21 | + "mwe-sc_audio" : "Audio control", |
| 22 | + "mwe-sc_duration" : "Duration", |
| 23 | + "mwe-template_properties" : "Template properties", |
| 24 | + "mwe-custom_title" : "Custom title", |
| 25 | + "mwe-edit_properties" : "Edit properties", |
| 26 | + "mwe-other_properties" : "Other properties", |
| 27 | + "mwe-resource_page" : "Resource page:", |
| 28 | + "mwe-set_in_out_points" : "Set in-out points", |
| 29 | + "mwe-start_time" : "Start time", |
| 30 | + "mwe-end_time" : "End time", |
| 31 | + "mwe-preview_inout" : "Preview\/play in-out points" |
32 | 32 | }); |
33 | 33 | |
34 | 34 | var default_clipedit_values = { |
— | — | @@ -218,11 +218,11 @@ |
219 | 219 | //add html for rObj resource: |
220 | 220 | var o= '<table>' + |
221 | 221 | '<tr>' + |
222 | | - '<td colspan="2"><b>'+gM('mv_edit_properties')+'</b></td>'+ |
| 222 | + '<td colspan="2"><b>'+gM('mwe-edit_properties')+'</b></td>'+ |
223 | 223 | '</tr>'+ |
224 | 224 | '<tr>'+ |
225 | 225 | '<td>' + |
226 | | - gM('mv_custom_title') + |
| 226 | + gM('mwe-custom_title') + |
227 | 227 | '</td>'+ |
228 | 228 | '<td><input type="text" size="15" maxwidth="255" value="'; |
229 | 229 | if(_this.rObj.title != null) |
— | — | @@ -235,7 +235,7 @@ |
236 | 236 | var testing_a = _this.rObj.tVars; |
237 | 237 | //debugger; |
238 | 238 | o+= '<tr>'+ |
239 | | - '<td colspan="2"><b>' + gM('mv_template_properties') + '</b></td>'+ |
| 239 | + '<td colspan="2"><b>' + gM('mwe-template_properties') + '</b></td>'+ |
240 | 240 | '</tr>'; |
241 | 241 | for(var i =0; i < _this.rObj.tVars.length ; i++){ |
242 | 242 | o+='<tr>'+ |
— | — | @@ -260,11 +260,11 @@ |
261 | 261 | var res_title = parseUri(_this.rObj.src).file; |
262 | 262 | } |
263 | 263 | o+= '<tr>'+ |
264 | | - '<td colspan="2"><b>'+gM('mv_other_properties')+'</b></td>'+ |
| 264 | + '<td colspan="2"><b>'+gM('mwe-other_properties')+'</b></td>'+ |
265 | 265 | '</tr>'+ |
266 | 266 | '<tr>'+ |
267 | 267 | '<td>' + |
268 | | - gM('mv_resource_page') + |
| 268 | + gM('mwe-resource_page') + |
269 | 269 | '</td>' + |
270 | 270 | '<td><a href="' + res_src +'" '+ |
271 | 271 | ' target="new">'+ |
— | — | @@ -331,7 +331,7 @@ |
332 | 332 | } |
333 | 333 | if(include){ |
334 | 334 | o+= '<li>'+ |
335 | | - '<a id="mv_smi_'+sInx+'" href="#sc_' + sInx + '">' + gM('sc_' + sInx ) + '</a>'+ |
| 335 | + '<a id="mv_smi_'+sInx+'" href="#sc_' + sInx + '">' + gM('mwe-sc_' + sInx ) + '</a>'+ |
336 | 336 | '</li>'; |
337 | 337 | tabc += '<div id="sc_' + sInx + '" style="overflow:auto;" ></div>'; |
338 | 338 | } |
— | — | @@ -429,23 +429,23 @@ |
430 | 430 | |
431 | 431 | }, |
432 | 432 | getSetInOutHtml:function( setInt ){ |
433 | | - return '<strong>' + gM('mv_set_in_out_points') + '</strong>'+ |
| 433 | + return '<strong>' + gM('mwe-set_in_out_points') + '</strong>'+ |
434 | 434 | '<table border="0" style="background: transparent; width:94%;height:50px;">'+ |
435 | 435 | '<tr>' + |
436 | 436 | '<td style="width:55px">'+ |
437 | | - gM('mv_start_time') + |
| 437 | + gM('mwe-start_time') + |
438 | 438 | '<input class="ui-widget-content ui-corner-all startInOut" size="9" value="' + setInt.start_ntp +'">'+ |
439 | 439 | '</td>' + |
440 | 440 | '<td>' + |
441 | 441 | '<div class="inOutSlider"></div>'+ |
442 | 442 | '</td>' + |
443 | 443 | '<td style="width:55px">'+ |
444 | | - gM('mv_end_time') + |
| 444 | + gM('mwe-end_time') + |
445 | 445 | '<input class="ui-widget-content ui-corner-all endInOut" size="9" value="'+ setInt.end_ntp +'">'+ |
446 | 446 | '</td>' + |
447 | 447 | '</tr>' + |
448 | 448 | '</table>'+ |
449 | | - '<a href="#" class="ui-state-default ui-corner-all ui-icon_link inOutPreviewClip"><span class="ui-icon ui-icon-video"></span>'+ gM('mv_preview_inout') +'</a>'; |
| 449 | + '<a href="#" class="ui-state-default ui-corner-all ui-icon_link inOutPreviewClip"><span class="ui-icon ui-icon-video"></span>'+ gM('mwe-preview_inout') +'</a>'; |
450 | 450 | }, |
451 | 451 | getInsertDescHtml:function(){ |
452 | 452 | var o= '<h3>Inline Description</h3>'+ |
— | — | @@ -466,7 +466,7 @@ |
467 | 467 | for( var cbType in _this.controlActionsCb ){ |
468 | 468 | switch(cbType){ |
469 | 469 | case 'insert_seq': |
470 | | - $j(b_target).append( $j.btnHtml(gM('mv_insert_into_sequence'), 'mv_insert_sequence', 'check' ) + ' ' ) |
| 470 | + $j(b_target).append( $j.btnHtml(gM('mwe-insert_into_sequence'), 'mv_insert_sequence', 'check' ) + ' ' ) |
471 | 471 | .children('.mv_insert_sequence') |
472 | 472 | .btnBind() |
473 | 473 | .click(function(){ |
— | — | @@ -475,7 +475,7 @@ |
476 | 476 | }); |
477 | 477 | break; |
478 | 478 | case 'insert': |
479 | | - $j(b_target).append( $j.btnHtml(gM('mv_insert_image_page'), 'mv_insert_image_page', 'check' ) + ' ' ) |
| 479 | + $j(b_target).append( $j.btnHtml(gM('mwe-insert_image_page'), 'mv_insert_image_page', 'check' ) + ' ' ) |
480 | 480 | .children('.mv_insert_image_page') |
481 | 481 | .btnBind() |
482 | 482 | .click(function(){ |
— | — | @@ -484,7 +484,7 @@ |
485 | 485 | }).show('slow'); |
486 | 486 | break; |
487 | 487 | case 'preview': |
488 | | - $j(b_target).append( $j.btnHtml( gM('mv_preview_insert'), 'mv_preview_insert', 'refresh') + ' ' ) |
| 488 | + $j(b_target).append( $j.btnHtml( gM('mwe-preview_insert'), 'mv_preview_insert', 'refresh') + ' ' ) |
489 | 489 | .children('.mv_preview_insert') |
490 | 490 | .btnBind() |
491 | 491 | .click(function(){ |
— | — | @@ -493,7 +493,7 @@ |
494 | 494 | }).show('slow'); |
495 | 495 | break; |
496 | 496 | case 'cancel': |
497 | | - $j(b_target).append( $j.btnHtml( gM('mv_cancel_image_insert'), 'mv_cancel_img_edit', 'close') + ' ') |
| 497 | + $j(b_target).append( $j.btnHtml( gM('mwe-cancel_image_insert'), 'mv_cancel_img_edit', 'close') + ' ') |
498 | 498 | .children('.mv_cancel_img_edit') |
499 | 499 | .btnBind() |
500 | 500 | .click(function(){ |
— | — | @@ -520,15 +520,15 @@ |
521 | 521 | //by default apply Crop tool |
522 | 522 | $j('#'+this.control_ct).html( |
523 | 523 | '<h3>Edit tools</h3>' + |
524 | | - '<div class="mv_edit_button mv_crop_button_base" id="mv_crop_button" alt="crop" title="'+gM('mv_crop')+'"/>'+ |
525 | | - '<a href="#" class="mv_crop_msg">' + gM('mv_crop') + '</a> '+ |
| 524 | + '<div class="mv_edit_button mv_crop_button_base" id="mv_crop_button" alt="crop" title="'+gM('mwe-crop')+'"/>'+ |
| 525 | + '<a href="#" class="mv_crop_msg">' + gM('mwe-crop') + '</a> '+ |
526 | 526 | '<span style="display:none" class="mv_crop_msg_load">' + gM('mwe-loading_txt') + '</span> '+ |
527 | | - '<a href="#" style="display:none" class="mv_apply_crop">' + gM('mv_apply_crop') + '</a> '+ |
528 | | - '<a href="#" style="display:none" class="mv_reset_crop">' + gM('mv_reset_crop') + '</a> '+ |
| 527 | + '<a href="#" style="display:none" class="mv_apply_crop">' + gM('mwe-apply_crop') + '</a> '+ |
| 528 | + '<a href="#" style="display:none" class="mv_reset_crop">' + gM('mwe-reset_crop') + '</a> '+ |
529 | 529 | '<hr style="clear:both"/><br>'+ |
530 | 530 | '<span style="float:left;">Layout:</span>' + |
531 | | - '<input type="radio" name="mv_layout" id="mv_layout_left" style="float:left"><div id="mv_layout_left_img" title="'+gM('mv_layout_left')+'"/>'+ |
532 | | - '<input type="radio" name="mv_layout" id="mv_layout_right" style="float:left"><div id="mv_layout_right_img" title="'+gM('mv_layout_left')+'"/>'+ |
| 531 | + '<input type="radio" name="mv_layout" id="mv_layout_left" style="float:left"><div id="mv_layout_left_img" title="'+gM('mwe-layout_left')+'"/>'+ |
| 532 | + '<input type="radio" name="mv_layout" id="mv_layout_right" style="float:left"><div id="mv_layout_right_img" title="'+gM('mwe-layout_left')+'"/>'+ |
533 | 533 | '<hr style="clear:both" /><br>' + |
534 | 534 | _this.getInsertDescHtml() |
535 | 535 | ); |
— | — | @@ -536,10 +536,10 @@ |
537 | 537 | _this.updateInsertControlActions() |
538 | 538 | |
539 | 539 | /*scale: |
540 | | - '<div class="mv_edit_button mv_scale_button_base" id="mv_scale_button" alt="crop" title="'+gM('mv_scale')+'"></div>'+ |
541 | | - '<a href="#" class="mv_scale_msg">' + gM('mv_scale') + '</a><br>'+ |
542 | | - '<a href="#" style="display:none" class="mv_apply_scale">' + gM('mv_apply_scale') + '</a> '+ |
543 | | - '<a href="#" style="display:none" class="mv_reset_scale">' + gM('mv_reset_scale') + '</a><br> '+ |
| 540 | + '<div class="mv_edit_button mv_scale_button_base" id="mv_scale_button" alt="crop" title="'+gM('mwe-scale')+'"></div>'+ |
| 541 | + '<a href="#" class="mv_scale_msg">' + gM('mwe-scale') + '</a><br>'+ |
| 542 | + '<a href="#" style="display:none" class="mv_apply_scale">' + gM('mwe-apply_scale') + '</a> '+ |
| 543 | + '<a href="#" style="display:none" class="mv_reset_scale">' + gM('mwe-reset_scale') + '</a><br> '+ |
544 | 544 | |
545 | 545 | */ |
546 | 546 | //add bindings: |
— | — | @@ -573,7 +573,7 @@ |
574 | 574 | $j('.mv_reset_crop').click(function(){ |
575 | 575 | $j('.mv_apply_crop,.mv_reset_crop').hide(); |
576 | 576 | $j('.mv_crop_msg').show(); |
577 | | - $j('#mv_crop_button').removeClass('mv_crop_button_selected').addClass('mv_crop_button_base').attr('title',gM('mv_crop')); |
| 577 | + $j('#mv_crop_button').removeClass('mv_crop_button_selected').addClass('mv_crop_button_base').attr('title',gM('mwe-crop')); |
578 | 578 | _this.rObj.crop=null; |
579 | 579 | $j('#' + _this.clip_disp_ct ).empty().html( |
580 | 580 | '<img src="' + _this.rObj.edit_url + '" id="rsd_edit_img">' |
— | — | @@ -600,7 +600,7 @@ |
601 | 601 | var _this = this; |
602 | 602 | $j('.mv_apply_crop').hide(); |
603 | 603 | $j('.mv_crop_msg').show(); |
604 | | - $j('#mv_crop_button').removeClass('mv_crop_button_selected').addClass('mv_crop_button_base').attr('title',gM('mv_crop')); |
| 604 | + $j('#mv_crop_button').removeClass('mv_crop_button_selected').addClass('mv_crop_button_base').attr('title',gM('mwe-crop')); |
605 | 605 | js_log( 'click:turn off' ); |
606 | 606 | var cat = _this.rObj; |
607 | 607 | if(_this.rObj.crop){ |
— | — | @@ -628,7 +628,7 @@ |
629 | 629 | var doEnableCrop = function(){ |
630 | 630 | $j('.mv_crop_msg_load').hide(); |
631 | 631 | $j('.mv_reset_crop,.mv_apply_crop').show(); |
632 | | - $j('#mv_crop_button').removeClass('mv_crop_button_base').addClass('mv_crop_button_selected').attr('title',gM('mv_crop_done')); |
| 632 | + $j('#mv_crop_button').removeClass('mv_crop_button_base').addClass('mv_crop_button_selected').attr('title',gM('mwe-crop_done')); |
633 | 633 | $j('#' + _this.clip_disp_ct + ' img').Jcrop({ |
634 | 634 | onSelect: function(c){ |
635 | 635 | js_log('on select:' + c.x +','+ c.y+','+ c.x2+','+ c.y2+','+ c.w+','+ c.h); |
Index: trunk/phase3/js2/mwEmbed/mv_embed.js |
— | — | @@ -218,7 +218,7 @@ |
219 | 219 | //depencency mapping for css files for self contained included plugins: |
220 | 220 | lcCssPath({ |
221 | 221 | '$j.Jcrop' : 'libClipEdit/Jcrop/css/jquery.Jcrop.css', |
222 | | - '$j.fn.ColorPicker' : 'libClipEdit/colorpicker/css/colorpicker.css' |
| 222 | + '$j.fn.ColorPicker' : 'libClipEdit/colorpicker/css/colorpicker.css' |
223 | 223 | }) |
224 | 224 | |
225 | 225 | /** |
— | — | @@ -415,7 +415,7 @@ |
416 | 416 | } |
417 | 417 | if( this.checkLoading() ){ |
418 | 418 | if( this.load_time++ > 2000){ //time out after ~80seconds |
419 | | - js_error( gM('error_load_lib') + this.missing_path ); |
| 419 | + js_error( gM('mwe-error_load_lib') + this.missing_path ); |
420 | 420 | this.load_error = true; |
421 | 421 | }else{ |
422 | 422 | setTimeout( 'mvJsLoader.doLoad()', 20 ); |
— | — | @@ -624,13 +624,13 @@ |
625 | 625 | mvJsLoader.runQuededFunctions(); |
626 | 626 | } |
627 | 627 | } |
628 | | -//a quick function that sets the intial text of swapable elements to "loading" |
629 | | -// (jquery might not be ready) |
630 | | -//(does not destroy inner elements) |
| 628 | +//a quick function that sets the intial text of swapable elements to "loading" |
| 629 | +// (jquery might not be ready) |
| 630 | +//(does not destroy inner elements) |
631 | 631 | function setSwapableToLoading(e){ |
632 | 632 | //for(var i =0) |
633 | | - //for(var j = 0; i < j.length; j++){ |
634 | | - //} |
| 633 | + //for(var j = 0; i < j.length; j++){ |
| 634 | + //} |
635 | 635 | } |
636 | 636 | //js2AddOnloadHook: ensure jQuery and the DOM are ready: |
637 | 637 | function js2AddOnloadHook( func ) { |
Index: trunk/phase3/js2/mwEmbed/libEmbedVideo/embedVideo.js |
— | — | @@ -3,53 +3,53 @@ |
4 | 4 | */ |
5 | 5 | |
6 | 6 | loadGM({ |
7 | | - "loading_plugin" : "loading plugin <blink>...<\/blink>", |
8 | | - "select_playback" : "Set playback preference", |
9 | | - "link_back" : "Link back", |
10 | | - "error_load_lib" : "Error: mv_embed was unable to load required JavaScript libraries.\nInsert script via DOM has failed. Please try reloading this page.", |
11 | | - "error_swap_vid" : "Error: mv_embed was unable to swap the video tag for the mv_embed interface", |
12 | | - "add_to_end_of_sequence" : "Add to end of sequence", |
13 | | - "missing_video_stream" : "The video file for this stream is missing", |
14 | | - "play_clip" : "Play clip", |
15 | | - "pause_clip" : "Pause clip", |
16 | | - "volume_control" : "Volume control", |
17 | | - "player_options" : "Player options", |
18 | | - "closed_captions" : "Close captions", |
19 | | - "player_fullscreen" : "Fullscreen", |
20 | | - "next_clip_msg" : "Play next clip", |
21 | | - "prev_clip_msg" : "Play previous clip", |
22 | | - "current_clip_msg" : "Continue playing this clip", |
23 | | - "seek_to" : "Seek to", |
24 | | - "download_segment" : "Download selection:", |
25 | | - "download_full" : "Download full video file:", |
26 | | - "download_right_click" : "To download, right click and select <i>Save target as...<\/i>", |
27 | | - "download_clip" : "Download video", |
28 | | - "download_text" : "Download text (<a style=\"color:white\" title=\"cmml\" href=\"http:\/\/wiki.xiph.org\/index.php\/CMML\">CMML<\/a> xml):", |
29 | | - "download" : "Download", |
30 | | - "share" : "Share", |
31 | | - "credits" : "Credits", |
32 | | - "clip_linkback" : "Clip source page", |
33 | | - "chose_player" : "Choose Video Player", |
34 | | - "share_this_video" : "Share this video", |
35 | | - "video_credits" : "Video credits", |
36 | | - "menu_btn" : "Menu", |
37 | | - "close_btn" : "Close", |
38 | | - "mv_ogg-player-vlc-mozilla" : "VLC plugin", |
39 | | - "mv_ogg-player-videoElement" : "Native Ogg video support", |
40 | | - "mv_ogg-player-vlc-activex" : "VLC ActiveX", |
41 | | - "mv_ogg-player-oggPlugin" : "Generic Ogg plugin", |
42 | | - "mv_ogg-player-quicktime-mozilla" : "Quicktime plugin", |
43 | | - "mv_ogg-player-quicktime-activex" : "Quicktime ActiveX", |
44 | | - "mv_ogg-player-cortado" : "Java Cortado", |
45 | | - "mv_ogg-player-flowplayer" : "Flowplayer", |
46 | | - "mv_ogg-player-selected" : " (selected)", |
47 | | - "mv_ogg-player-omtkplayer" : "OMTK Flash Vorbis", |
48 | | - "mv_generic_missing_plugin" : "You browser does not appear to support the following playback type: <b>$1<\/b><br \/>Visit the <a href=\"http:\/\/commons.wikimedia.org\/wiki\/Commons:Media_help\">Playback Methods<\/a> page to download a player.<br \/>", |
49 | | - "mv_for_best_experience" : "For a better video playback experience we recommend:<br \/><b><a href=\"http:\/\/www.mozilla.com\/en-US\/firefox\/upgrade.html?from=mwEmbed\">Firefox 3.5<\/a>.<\/b>", |
50 | | - "mv_do_not_warn_again" : "Dissmiss for now.", |
51 | | - "playerselect" : "Players", |
52 | | - "read_before_embed": 'Please <a href="http://mediawiki.org/wiki/Security_Notes_on_Remote_Embedding" target="_new">Read This</a> before embeding!', |
53 | | - "embed_site_or_blog": "Embed on your site or blog" |
| 7 | + "mwe-loading_plugin" : "loading plugin <blink>...<\/blink>", |
| 8 | + "mwe-select_playback" : "Set playback preference", |
| 9 | + "mwe-link_back" : "Link back", |
| 10 | + "mwe-error_load_lib" : "Error: mv_embed was unable to load required JavaScript libraries.\nInsert script via DOM has failed. Please try reloading this page.", |
| 11 | + "mwe-error_swap_vid" : "Error: mv_embed was unable to swap the video tag for the mv_embed interface", |
| 12 | + "mwe-add_to_end_of_sequence" : "Add to end of sequence", |
| 13 | + "mwe-missing_video_stream" : "The video file for this stream is missing", |
| 14 | + "mwe-play_clip" : "Play clip", |
| 15 | + "mwe-pause_clip" : "Pause clip", |
| 16 | + "mwe-volume_control" : "Volume control", |
| 17 | + "mwe-player_options" : "Player options", |
| 18 | + "mwe-closed_captions" : "Close captions", |
| 19 | + "mwe-player_fullscreen" : "Fullscreen", |
| 20 | + "mwe-next_clip_msg" : "Play next clip", |
| 21 | + "mwe-prev_clip_msg" : "Play previous clip", |
| 22 | + "mwe-current_clip_msg" : "Continue playing this clip", |
| 23 | + "mwe-seek_to" : "Seek to", |
| 24 | + "mwe-download_segment" : "Download selection:", |
| 25 | + "mwe-download_full" : "Download full video file:", |
| 26 | + "mwe-download_right_click" : "To download, right click and select <i>Save target as...<\/i>", |
| 27 | + "mwe-download_clip" : "Download video", |
| 28 | + "mwe-download_text" : "Download text (<a style=\"color:white\" title=\"cmml\" href=\"http:\/\/wiki.xiph.org\/index.php\/CMML\">CMML<\/a> xml):", |
| 29 | + "mwe-download" : "Download", |
| 30 | + "mwe-share" : "Share", |
| 31 | + "mwe-credits" : "Credits", |
| 32 | + "mwe-clip_linkback" : "Clip source page", |
| 33 | + "mwe-chose_player" : "Choose Video Player", |
| 34 | + "mwe-share_this_video" : "Share this video", |
| 35 | + "mwe-video_credits" : "Video credits", |
| 36 | + "mwe-menu_btn" : "Menu", |
| 37 | + "mwe-close_btn" : "Close", |
| 38 | + "mwe-ogg-player-vlc-mozilla" : "VLC plugin", |
| 39 | + "mwe-ogg-player-videoElement" : "Native Ogg video support", |
| 40 | + "mwe-ogg-player-vlc-activex" : "VLC ActiveX", |
| 41 | + "mwe-ogg-player-oggPlugin" : "Generic Ogg plugin", |
| 42 | + "mwe-ogg-player-quicktime-mozilla" : "Quicktime plugin", |
| 43 | + "mwe-ogg-player-quicktime-activex" : "Quicktime ActiveX", |
| 44 | + "mwe-ogg-player-cortado" : "Java Cortado", |
| 45 | + "mwe-ogg-player-flowplayer" : "Flowplayer", |
| 46 | + "mwe-ogg-player-selected" : " (selected)", |
| 47 | + "mwe-ogg-player-omtkplayer" : "OMTK Flash Vorbis", |
| 48 | + "mwe-generic_missing_plugin" : "You browser does not appear to support the following playback type: <b>$1<\/b><br \/>Visit the <a href=\"http:\/\/commons.wikimedia.org\/wiki\/Commons:Media_help\">Playback Methods<\/a> page to download a player.<br \/>", |
| 49 | + "mwe-for_best_experience" : "For a better video playback experience we recommend:<br \/><b><a href=\"http:\/\/www.mozilla.com\/en-US\/firefox\/upgrade.html?from=mwEmbed\">Firefox 3.5<\/a>.<\/b>", |
| 50 | + "mwe-do_not_warn_again" : "Dissmiss for now.", |
| 51 | + "mwe-playerselect" : "Players", |
| 52 | + "mwe-read_before_embed": 'Please <a href="http://mediawiki.org/wiki/Security_Notes_on_Remote_Embedding" target="_new">Read This</a> before embeding!', |
| 53 | + "mwe-embed_site_or_blog": "Embed on your site or blog" |
54 | 54 | }); |
55 | 55 | |
56 | 56 | var default_video_attributes = { |
— | — | @@ -68,7 +68,7 @@ |
69 | 69 | "end":null, |
70 | 70 | "controls":true, |
71 | 71 | "muted":false, |
72 | | - |
| 72 | + |
73 | 73 | //roe url (for xml based metadata) |
74 | 74 | "roe":null, |
75 | 75 | //if roe includes metadata tracks we can expose a link to metadata |
— | — | @@ -82,15 +82,15 @@ |
83 | 83 | "duration":null, //media duration (read from file or the temporal url) |
84 | 84 | "networkState":0, |
85 | 85 | |
86 | | - "startOffset":null, //if serving an ogg_chop segment use this to offset the presentation time |
| 86 | + "startOffset":null, //if serving an ogg_chop segment use this to offset the presentation time |
87 | 87 | |
88 | 88 | //custom attributes for mv_embed: |
89 | | - "play_button":true, |
| 89 | + "play_button":true, |
90 | 90 | "thumbnail":null, |
91 | 91 | "linkback":null, |
92 | 92 | "embed_link":true, |
93 | 93 | "download_link":true, |
94 | | - "type":null //the content type of the media |
| 94 | + "type":null //the content type of the media |
95 | 95 | }; |
96 | 96 | /* |
97 | 97 | * the base source attibute checks |
— | — | @@ -103,11 +103,11 @@ |
104 | 104 | 'startOffset', |
105 | 105 | 'durationHint', |
106 | 106 | 'start', |
107 | | - 'end', |
| 107 | + 'end', |
108 | 108 | 'default', |
109 | 109 | 'lang' |
110 | 110 | ); |
111 | | -//set the dismissNativeWarn flag: |
| 111 | +//set the dismissNativeWarn flag: |
112 | 112 | _global['dismissNativeWarn'] = false; |
113 | 113 | /* |
114 | 114 | * Converts all occurrences of <video> tag into video object |
— | — | @@ -115,79 +115,79 @@ |
116 | 116 | function mv_video_embed(swap_done_callback, force_id){ |
117 | 117 | mvEmbed.init( swap_done_callback, force_id ); |
118 | 118 | } |
119 | | -mvEmbed = { |
120 | | - //flist stores the set of functions to run after the video has been swaped in. |
| 119 | +mvEmbed = { |
| 120 | + //flist stores the set of functions to run after the video has been swaped in. |
121 | 121 | flist:new Array(), |
122 | 122 | init:function( swap_done_callback, force_id ){ |
123 | | - |
| 123 | + |
124 | 124 | if(swap_done_callback) |
125 | 125 | mvEmbed.flist.push( swap_done_callback ); |
126 | | - |
| 126 | + |
127 | 127 | //get mv_embed location if it has not been set |
128 | | - js_log('mv_embed ' + MV_EMBED_VERSION); |
129 | | - |
130 | | - var loadPlaylistLib=false; |
131 | | - |
| 128 | + js_log('mv_embed ' + MV_EMBED_VERSION); |
| 129 | + |
| 130 | + var loadPlaylistLib=false; |
| 131 | + |
132 | 132 | var eAction = function(this_elm){ |
133 | 133 | js_log( "Do SWAP: " + $j(this_elm).attr("id") + ' tag: '+ this_elm.tagName.toLowerCase() ); |
134 | | - |
| 134 | + |
135 | 135 | if( $j(this_elm).attr("id") == '' ){ |
136 | 136 | $j(this_elm).attr("id", 'v'+ global_player_list.length); |
137 | | - } |
138 | | - //stre a global reference to the id |
| 137 | + } |
| 138 | + //stre a global reference to the id |
139 | 139 | global_player_list.push( $j(this_elm).attr("id") ); |
140 | 140 | //if video doSwap |
141 | 141 | switch( this_elm.tagName.toLowerCase()){ |
142 | 142 | case 'video': |
143 | | - var videoInterface = new embedVideo(this_elm); |
| 143 | + var videoInterface = new embedVideo(this_elm); |
144 | 144 | mvEmbed.swapEmbedVideoElement( this_elm, videoInterface ); |
145 | 145 | break; |
146 | 146 | case 'audio': |
147 | | - var videoInterface = new embedVideo(this_elm); |
| 147 | + var videoInterface = new embedVideo(this_elm); |
148 | 148 | videoInterface.type ='audio'; |
149 | 149 | mvEmbed.swapEmbedVideoElement( this_elm, videoInterface ); |
150 | 150 | break; |
151 | 151 | case 'playlist': |
152 | 152 | loadPlaylistLib=true; |
153 | 153 | break; |
154 | | - } |
| 154 | + } |
155 | 155 | } |
156 | | - |
| 156 | + |
157 | 157 | if( force_id == null && force_id != '' ){ |
158 | | - var j_selector = 'video,audio,playlist'; |
| 158 | + var j_selector = 'video,audio,playlist'; |
159 | 159 | }else{ |
160 | 160 | var j_selector = '#' + force_id; |
161 | 161 | } |
162 | | - //process selected elements: |
163 | | - //ie8 does not play well with the jQuery video,audio,playlist selector use native: |
| 162 | + //process selected elements: |
| 163 | + //ie8 does not play well with the jQuery video,audio,playlist selector use native: |
164 | 164 | if($j.browser.msie && $j.browser.version >= 8){ |
165 | | - jtags = j_selector.split(','); |
166 | | - for( var i=0; i < jtags.length; i++){ |
| 165 | + jtags = j_selector.split(','); |
| 166 | + for( var i=0; i < jtags.length; i++){ |
167 | 167 | $j( document.getElementsByTagName( jtags[i] )).each(function(){ |
168 | 168 | eAction(this); |
169 | 169 | }); |
170 | | - } |
171 | | - }else{ |
| 170 | + } |
| 171 | + }else{ |
172 | 172 | $j( j_selector ).each(function(){ |
173 | 173 | eAction(this); |
174 | | - }); |
175 | | - } |
176 | | - if(loadPlaylistLib){ |
177 | | - mvJsLoader.doLoad([ |
| 174 | + }); |
| 175 | + } |
| 176 | + if(loadPlaylistLib){ |
| 177 | + mvJsLoader.doLoad([ |
178 | 178 | 'mvPlayList', |
179 | 179 | '$j.ui', //include dialog for pop-ing up thigns |
180 | | - '$j.ui.dialog' |
| 180 | + '$j.ui.dialog' |
181 | 181 | ], function(){ |
182 | | - $j('playlist').each(function(){ |
| 182 | + $j('playlist').each(function(){ |
183 | 183 | //create new playlist interface: |
184 | 184 | var plObj = new mvPlayList( this ); |
185 | 185 | mvEmbed.swapEmbedVideoElement(this, plObj); |
186 | 186 | var added_height = plObj.pl_layout.title_bar_height + plObj.pl_layout.control_height; |
187 | | - //move into a blocking display container with height + controls + title height: |
188 | | - $j('#'+plObj.id).wrap('<div style="display:block;height:' + (plObj.height + added_height) + 'px;"></div>'); |
| 187 | + //move into a blocking display container with height + controls + title height: |
| 188 | + $j('#'+plObj.id).wrap('<div style="display:block;height:' + (plObj.height + added_height) + 'px;"></div>'); |
189 | 189 | }); |
190 | 190 | }); |
191 | | - } |
| 191 | + } |
192 | 192 | this.checkClipsReady(); |
193 | 193 | }, |
194 | 194 | /* |
— | — | @@ -199,13 +199,13 @@ |
200 | 200 | js_log('do swap ' + videoInterface.id + ' for ' + video_element); |
201 | 201 | embed_video = document.createElement('div'); |
202 | 202 | //make sure our div has a hight/width set: |
203 | | - |
| 203 | + |
204 | 204 | $j(embed_video).css({ |
205 | 205 | 'width':videoInterface.width, |
206 | 206 | 'height':videoInterface.height |
207 | | - }).html( mv_get_loading_img() ); |
| 207 | + }).html( mv_get_loading_img() ); |
208 | 208 | //inherit the video interface |
209 | | - for(var method in videoInterface){ //for in loop oky in Element context |
| 209 | + for(var method in videoInterface){ //for in loop oky in Element context |
210 | 210 | if(method!='readyState'){ //readyState crashes IE |
211 | 211 | if(method=='style'){ |
212 | 212 | embed_video.setAttribute('style', videoInterface[method]); |
— | — | @@ -222,32 +222,32 @@ |
223 | 223 | //string -> boolean: |
224 | 224 | if(embed_video[method]=="false")embed_video[method]=false; |
225 | 225 | if(embed_video[method]=="true")embed_video[method]=true; |
226 | | - } |
227 | | - ///js_log('did vI style'); |
228 | | - //now swap out the video element for the embed_video obj: |
229 | | - $j(video_element).after(embed_video).remove(); |
230 | | - //js_log('did swap'); |
231 | | - $j('#'+embed_video.id).get(0).on_dom_swap(); |
232 | | - |
| 226 | + } |
| 227 | + ///js_log('did vI style'); |
| 228 | + //now swap out the video element for the embed_video obj: |
| 229 | + $j(video_element).after(embed_video).remove(); |
| 230 | + //js_log('did swap'); |
| 231 | + $j('#'+embed_video.id).get(0).on_dom_swap(); |
| 232 | + |
233 | 233 | // now that "embed_video" is stable, do more initialization (if we are ready) |
234 | | - if($j('#'+embed_video.id).get(0).loading_external_data == false && |
| 234 | + if($j('#'+embed_video.id).get(0).loading_external_data == false && |
235 | 235 | $j('#'+embed_video.id).get(0).init_with_sources_loadedDone == false){ |
236 | | - //load and set ready state since source are available: |
| 236 | + //load and set ready state since source are available: |
237 | 237 | $j('#'+embed_video.id).get(0).init_with_sources_loaded(); |
238 | 238 | } |
239 | | - |
| 239 | + |
240 | 240 | js_log('done with child: ' + embed_video.id + ' len:' + global_player_list.length); |
241 | 241 | return true; |
242 | 242 | }, |
243 | 243 | //this should not be needed. |
244 | 244 | checkClipsReady : function(){ |
245 | 245 | //js_log('checkClipsReady'); |
246 | | - var is_ready=true; |
| 246 | + var is_ready=true; |
247 | 247 | for(var i=0; i < global_player_list.length; i++){ |
248 | 248 | if( $j('#'+global_player_list[i]).length !=0){ |
249 | | - var cur_vid = $j('#'+global_player_list[i]).get(0); |
| 249 | + var cur_vid = $j('#'+global_player_list[i]).get(0); |
250 | 250 | is_ready = ( cur_vid.ready_to_play ) ? is_ready : false; |
251 | | - if( !is_ready && cur_vid.load_error ){ |
| 251 | + if( !is_ready && cur_vid.load_error ){ |
252 | 252 | is_ready=true; |
253 | 253 | $j(cur_vid).html( cur_vid.load_error ); |
254 | 254 | } |
— | — | @@ -255,15 +255,15 @@ |
256 | 256 | } |
257 | 257 | if( is_ready ){ |
258 | 258 | mvEmbed.allClipsReady = true; |
259 | | - // run queued functions |
| 259 | + // run queued functions |
260 | 260 | //js_log('run queded functions:' + mvEmbed.flist[0]); |
261 | 261 | mvEmbed.runFlist(); |
262 | | - }else{ |
| 262 | + }else{ |
263 | 263 | setTimeout( 'mvEmbed.checkClipsReady()', 25 ); |
264 | | - } |
| 264 | + } |
265 | 265 | }, |
266 | 266 | runFlist:function(){ |
267 | | - while (this.flist.length){ |
| 267 | + while (this.flist.length){ |
268 | 268 | this.flist.shift()(); |
269 | 269 | } |
270 | 270 | } |
— | — | @@ -306,37 +306,37 @@ |
307 | 307 | |
308 | 308 | init : function(element) |
309 | 309 | { |
310 | | - //js_log('adding mediaSource: ' + element); |
| 310 | + //js_log('adding mediaSource: ' + element); |
311 | 311 | this.src = $j(element).attr('src'); |
312 | 312 | this.marked_default = false; |
313 | 313 | if ( element.tagName.toLowerCase() == 'video') |
314 | | - this.marked_default = true; |
315 | | - |
| 314 | + this.marked_default = true; |
| 315 | + |
316 | 316 | //set default URLTimeEncoding if we have a time url: |
317 | | - //not ideal way to discover if content is on an oggz_chop server. |
318 | | - //should check some other way. |
| 317 | + //not ideal way to discover if content is on an oggz_chop server. |
| 318 | + //should check some other way. |
319 | 319 | var pUrl = parseUri ( this.src ); |
320 | 320 | if(typeof pUrl['queryKey']['t'] != 'undefined'){ |
321 | | - this['URLTimeEncoding']=true; |
322 | | - } |
| 321 | + this['URLTimeEncoding']=true; |
| 322 | + } |
323 | 323 | for(var i=0; i < mv_default_source_attr.length; i++){ //array loop: |
324 | | - var attr = mv_default_source_attr[ i ]; |
| 324 | + var attr = mv_default_source_attr[ i ]; |
325 | 325 | if( $j(element).attr( attr ) ) { |
326 | 326 | this[ attr ] = $j(element).attr( attr ); |
327 | 327 | } |
328 | | - } |
329 | | - //update duration from hit if present: |
| 328 | + } |
| 329 | + //update duration from hit if present: |
330 | 330 | if(this.durationHint) |
331 | | - this.duration = this.durationHint; |
332 | | - |
333 | | - |
| 331 | + this.duration = this.durationHint; |
| 332 | + |
| 333 | + |
334 | 334 | if ( $j(element).attr('type')) |
335 | 335 | this.mime_type = $j(element).attr('type'); |
336 | 336 | else if ($j(element).attr('content-type')) |
337 | 337 | this.mime_type = $j(element).attr('content-type'); |
338 | | - else |
| 338 | + else |
339 | 339 | this.mime_type = this.detectType(this.src); |
340 | | - |
| 340 | + |
341 | 341 | //set the title if unset: |
342 | 342 | if( !this.title ) |
343 | 343 | this.title = this.mime_type; |
— | — | @@ -344,9 +344,9 @@ |
345 | 345 | this.parseURLDuration(); |
346 | 346 | }, |
347 | 347 | updateSource:function(element){ |
348 | | - //for now just update the title: |
| 348 | + //for now just update the title: |
349 | 349 | if ($j(element).attr("title")) |
350 | | - this.title = $j(element).attr("title"); |
| 350 | + this.title = $j(element).attr("title"); |
351 | 351 | }, |
352 | 352 | /** updates the src time and start & end |
353 | 353 | * @param {String} start_time in NTP format |
— | — | @@ -357,18 +357,18 @@ |
358 | 358 | //js_log("pre uri:" + this.src); |
359 | 359 | //if we have time we can use: |
360 | 360 | if( this.URLTimeEncoding ){ |
361 | | - //make sure its a valid start time / end time (else set default) |
362 | | - if( !npt2seconds(start_ntp) ) |
| 361 | + //make sure its a valid start time / end time (else set default) |
| 362 | + if( !npt2seconds(start_ntp) ) |
363 | 363 | start_ntp = this.start_ntp; |
364 | | - |
| 364 | + |
365 | 365 | if( !npt2seconds(end_ntp) ) |
366 | 366 | end_ntp = this.end_ntp; |
367 | | - |
368 | | - this.src = getURLParamReplace(this.src, { 't': start_ntp +'/'+ end_ntp } ); |
369 | | - |
| 367 | + |
| 368 | + this.src = getURLParamReplace(this.src, { 't': start_ntp +'/'+ end_ntp } ); |
| 369 | + |
370 | 370 | //update the duration |
371 | 371 | this.parseURLDuration(); |
372 | | - } |
| 372 | + } |
373 | 373 | }, |
374 | 374 | setDuration:function (duration) |
375 | 375 | { |
— | — | @@ -386,20 +386,20 @@ |
387 | 387 | return this.mime_type; |
388 | 388 | }, |
389 | 389 | /** URI accessor function. |
390 | | - * @param int seek_time_sec (used to adjust the URI for url based seeks) |
| 390 | + * @param int seek_time_sec (used to adjust the URI for url based seeks) |
391 | 391 | @return the URI of the source. |
392 | 392 | @type String |
393 | 393 | */ |
394 | 394 | getURI : function( seek_time_sec ) |
395 | | - { |
396 | | - if( !seek_time_sec || !this.URLTimeEncoding ){ |
397 | | - return this.src; |
398 | | - } |
| 395 | + { |
| 396 | + if( !seek_time_sec || !this.URLTimeEncoding ){ |
| 397 | + return this.src; |
| 398 | + } |
399 | 399 | if(!this.end_ntp){ |
400 | 400 | var endvar = ''; |
401 | 401 | }else{ |
402 | 402 | var endvar = '/'+ this.end_ntp; |
403 | | - } |
| 403 | + } |
404 | 404 | return getURLParamReplace(this.src, { 't': seconds2npt( seek_time_sec )+endvar } ); ; |
405 | 405 | }, |
406 | 406 | /** Title accessor function. |
— | — | @@ -423,9 +423,9 @@ |
424 | 424 | * special case derive duration from request url |
425 | 425 | * supports media_url?t=ntp_start/ntp_end url request format |
426 | 426 | */ |
427 | | - parseURLDuration : function(){ |
428 | | - //check if we have a URLTimeEncoding: |
429 | | - if( this.URLTimeEncoding ){ |
| 427 | + parseURLDuration : function(){ |
| 428 | + //check if we have a URLTimeEncoding: |
| 429 | + if( this.URLTimeEncoding ){ |
430 | 430 | var annoURL = parseUri( this.src ); |
431 | 431 | if( annoURL.queryKey['t'] ){ |
432 | 432 | var times = annoURL.queryKey['t'].split('/'); |
— | — | @@ -437,15 +437,15 @@ |
438 | 438 | //look for this info as attributes |
439 | 439 | if(this.startOffset){ |
440 | 440 | this.start_offset = this.startOffset; |
441 | | - this.start_ntp = seconds2npt( this.startOffset); |
442 | | - } |
| 441 | + this.start_ntp = seconds2npt( this.startOffset); |
| 442 | + } |
443 | 443 | if(this.duration){ |
444 | 444 | this.end_ntp = seconds2npt( parseInt(this.duration) + parseInt(this.start_offset) ); |
445 | | - } |
446 | | - } |
| 445 | + } |
| 446 | + } |
447 | 447 | } |
448 | 448 | //else nothing to parse just keep whatever info we already have |
449 | | - |
| 449 | + |
450 | 450 | //js_log('f:parseURLDuration() for:' + this.src + ' d:' + this.duration); |
451 | 451 | }, |
452 | 452 | /** Attempts to detect the type of a media file based on the URI. |
— | — | @@ -485,12 +485,12 @@ |
486 | 486 | mediaElement.prototype = |
487 | 487 | { |
488 | 488 | /** The array of mediaSource elements. */ |
489 | | - sources:null, |
490 | | - addedROEData:false, |
| 489 | + sources:null, |
| 490 | + addedROEData:false, |
491 | 491 | /** Selected mediaSource element. */ |
492 | 492 | selected_source:null, |
493 | 493 | thumbnail:null, |
494 | | - linkback:null, |
| 494 | + linkback:null, |
495 | 495 | |
496 | 496 | /** @private */ |
497 | 497 | init:function( video_element ) |
— | — | @@ -501,20 +501,20 @@ |
502 | 502 | this.thumbnail = mv_default_thumb_url; |
503 | 503 | // Process the source element: |
504 | 504 | if($j(video_element).attr("src")) |
505 | | - this.tryAddSource(video_element); |
506 | | - |
| 505 | + this.tryAddSource(video_element); |
| 506 | + |
507 | 507 | if($j(video_element).attr('thumbnail')) |
508 | 508 | this.thumbnail = $j(video_element).attr('thumbnail'); |
509 | | - |
| 509 | + |
510 | 510 | if($j(video_element).attr('poster')) |
511 | 511 | this.thumbnail = $j(video_element).attr('poster'); |
512 | | - |
513 | | - // Process all inner <source> elements |
| 512 | + |
| 513 | + // Process all inner <source> elements |
514 | 514 | //js_log("inner source count: " + video_element.getElementsByTagName('source').length ); |
515 | | - |
516 | | - $j(video_element).find('source,text').each(function(inx, inner_source){ |
| 515 | + |
| 516 | + $j(video_element).find('source,text').each(function(inx, inner_source){ |
517 | 517 | _this.tryAddSource( inner_source ); |
518 | | - }); |
| 518 | + }); |
519 | 519 | }, |
520 | 520 | /** Updates the time request for all sources that have a standard time request argument (ie &t=start_time/end_time) |
521 | 521 | */ |
— | — | @@ -526,10 +526,10 @@ |
527 | 527 | }, |
528 | 528 | /*timed Text check*/ |
529 | 529 | timedTextSources:function(){ |
530 | | - for(var i=0; i < this.sources.length; i++){ |
| 530 | + for(var i=0; i < this.sources.length; i++){ |
531 | 531 | if( this.sources[i].mime_type == 'text/cmml' || |
532 | 532 | this.sources[i].mime_type == 'text/x-srt') |
533 | | - return true; |
| 533 | + return true; |
534 | 534 | }; |
535 | 535 | return false; |
536 | 536 | }, |
— | — | @@ -540,7 +540,7 @@ |
541 | 541 | { |
542 | 542 | if(!mime_filter) |
543 | 543 | return this.sources; |
544 | | - //apply mime filter: |
| 544 | + //apply mime filter: |
545 | 545 | var source_set = new Array(); |
546 | 546 | for(var i=0; i < this.sources.length ; i++){ |
547 | 547 | if( this.sources[i].mime_type.indexOf( mime_filter ) != -1 ) |
— | — | @@ -548,7 +548,7 @@ |
549 | 549 | } |
550 | 550 | return source_set; |
551 | 551 | }, |
552 | | - getSourceById:function( source_id ){ |
| 552 | + getSourceById:function( source_id ){ |
553 | 553 | for(var i=0; i < this.sources.length ; i++){ |
554 | 554 | if( this.sources[i].id == source_id) |
555 | 555 | return this.sources[i]; |
— | — | @@ -564,70 +564,70 @@ |
565 | 565 | for(var i=0; i < playable_sources.length; i++){ |
566 | 566 | if( i==index ){ |
567 | 567 | this.selected_source = playable_sources[i]; |
568 | | - //update the user selected format: |
| 568 | + //update the user selected format: |
569 | 569 | embedTypes.players.userSelectFormat( playable_sources[i].mime_type ); |
570 | 570 | break; |
571 | 571 | } |
572 | | - } |
| 572 | + } |
573 | 573 | }, |
574 | 574 | /** selects the default source via cookie preference, default marked, or by id order |
575 | 575 | * */ |
576 | | - autoSelectSource:function(){ |
577 | | - js_log('f:autoSelectSource:'); |
578 | | - //@@todo read user preference for source |
| 576 | + autoSelectSource:function(){ |
| 577 | + js_log('f:autoSelectSource:'); |
| 578 | + //@@todo read user preference for source |
579 | 579 | // Select the default source |
580 | | - var playable_sources = this.getPlayableSources(); |
581 | | - var flash_flag=ogg_flag=false; |
| 580 | + var playable_sources = this.getPlayableSources(); |
| 581 | + var flash_flag=ogg_flag=false; |
582 | 582 | //debugger; |
583 | 583 | for(var source=0; source < playable_sources.length; source++){ |
584 | 584 | var mime_type =playable_sources[source].mime_type; |
585 | 585 | if( playable_sources[source].marked_default ){ |
586 | 586 | js_log('set via marked default: ' + playable_sources[source].marked_default); |
587 | | - this.selected_source = playable_sources[source]; |
| 587 | + this.selected_source = playable_sources[source]; |
588 | 588 | return true; |
589 | 589 | } |
590 | 590 | //set via user-preference |
591 | 591 | if(embedTypes.players.preference['format_prefrence'] == mime_type){ |
592 | 592 | js_log('set via preference: '+playable_sources[source].mime_type); |
593 | 593 | this.selected_source = playable_sources[source]; |
594 | | - return true; |
595 | | - } |
596 | | - } |
597 | | - //set Ogg via player support |
| 594 | + return true; |
| 595 | + } |
| 596 | + } |
| 597 | + //set Ogg via player support |
598 | 598 | for(var source=0; source < playable_sources.length; source++){ |
599 | 599 | js_log('f:autoSelectSource:' + playable_sources[source].mime_type); |
600 | | - var mime_type =playable_sources[source].mime_type; |
601 | | - //set source via player |
602 | | - if(mime_type=='video/ogg' || mime_type=='ogg/video' || mime_type=='video/annodex' || mime_type=='application/ogg'){ |
| 600 | + var mime_type =playable_sources[source].mime_type; |
| 601 | + //set source via player |
| 602 | + if(mime_type=='video/ogg' || mime_type=='ogg/video' || mime_type=='video/annodex' || mime_type=='application/ogg'){ |
603 | 603 | for(var i=0; i < embedTypes.players.players.length; i++){ //for in loop on object oky |
604 | | - var player = embedTypes.players.players[i]; |
| 604 | + var player = embedTypes.players.players[i]; |
605 | 605 | if(player.library=='vlc' || player.library=='native'){ |
606 | | - js_log('set via ogg via order'); |
607 | | - this.selected_source = playable_sources[source]; |
| 606 | + js_log('set via ogg via order'); |
| 607 | + this.selected_source = playable_sources[source]; |
608 | 608 | return true; |
609 | | - } |
| 609 | + } |
610 | 610 | } |
611 | 611 | } |
612 | 612 | } |
613 | 613 | //set basic flash |
614 | | - for(var source=0; source < playable_sources.length; source++){ |
615 | | - var mime_type =playable_sources[source].mime_type; |
| 614 | + for(var source=0; source < playable_sources.length; source++){ |
| 615 | + var mime_type =playable_sources[source].mime_type; |
616 | 616 | if( mime_type=='video/x-flv' ){ |
617 | 617 | js_log('set via by player preference normal flash') |
618 | 618 | this.selected_source = playable_sources[source]; |
619 | 619 | return true; |
620 | | - } |
| 620 | + } |
621 | 621 | } |
622 | | - //set h264 flash |
623 | | - for(var source=0; source < playable_sources.length; source++){ |
624 | | - var mime_type =playable_sources[source].mime_type; |
| 622 | + //set h264 flash |
| 623 | + for(var source=0; source < playable_sources.length; source++){ |
| 624 | + var mime_type =playable_sources[source].mime_type; |
625 | 625 | if( mime_type=='video/h264' ){ |
626 | 626 | js_log('set via playable_sources preference h264 flash') |
627 | 627 | this.selected_source = playable_sources[source]; |
628 | 628 | return true; |
629 | | - } |
630 | | - } |
631 | | - //select first source |
| 629 | + } |
| 630 | + } |
| 631 | + //select first source |
632 | 632 | if (!this.selected_source) |
633 | 633 | { |
634 | 634 | js_log('set via first source:' + playable_sources[0]); |
— | — | @@ -666,48 +666,48 @@ |
667 | 667 | //return mime_type=='video/ogg' || mime_type=='ogg/video' || mime_type=='video/annodex' || mime_type=='video/x-flv'; |
668 | 668 | }, |
669 | 669 | /** Adds a single mediaSource using the provided element if |
670 | | - the element has a 'src' attribute. |
| 670 | + the element has a 'src' attribute. |
671 | 671 | @param element {element} <video>, <source> or <mediaSource> element. |
672 | 672 | */ |
673 | 673 | tryAddSource:function(element) |
674 | 674 | { |
675 | | - js_log('f:tryAddSource:'+ $j(element).attr("src")); |
| 675 | + js_log('f:tryAddSource:'+ $j(element).attr("src")); |
676 | 676 | if (! $j(element).attr("src")){ |
677 | 677 | //js_log("element has no src"); |
678 | 678 | return false; |
679 | 679 | } |
680 | 680 | var new_src = $j(element).attr('src'); |
681 | | - //make sure an existing element with the same src does not already exist: |
682 | | - for( var i=0; i < this.sources.length; i++ ){ |
| 681 | + //make sure an existing element with the same src does not already exist: |
| 682 | + for( var i=0; i < this.sources.length; i++ ){ |
683 | 683 | if(this.sources[i].src == new_src){ |
684 | | - //js_log('checking existing: '+this.sources[i].getURI() + ' != '+ new_src); |
685 | | - //can't add it all but try to update any additional attr: |
| 684 | + //js_log('checking existing: '+this.sources[i].getURI() + ' != '+ new_src); |
| 685 | + //can't add it all but try to update any additional attr: |
686 | 686 | this.sources[i].updateSource(element); |
687 | 687 | return false; |
688 | 688 | } |
689 | 689 | } |
690 | | - var source = new mediaSource( element ); |
691 | | - this.sources.push(source); |
| 690 | + var source = new mediaSource( element ); |
| 691 | + this.sources.push(source); |
692 | 692 | //alert('pushed source to stack'+ source + 'sl:'+this.sources.length); |
693 | 693 | }, |
694 | | - getPlayableSources: function(){ |
| 694 | + getPlayableSources: function(){ |
695 | 695 | var playable_sources= new Array(); |
696 | | - for(var i=0; i < this.sources.length; i++){ |
697 | | - if( this.isPlayableType( this.sources[i].mime_type ) ){ |
| 696 | + for(var i=0; i < this.sources.length; i++){ |
| 697 | + if( this.isPlayableType( this.sources[i].mime_type ) ){ |
698 | 698 | playable_sources.push( this.sources[i] ); |
699 | 699 | }else{ |
700 | 700 | js_log("type "+ this.sources[i].mime_type + 'is not playable'); |
701 | 701 | } |
702 | | - }; |
| 702 | + }; |
703 | 703 | return playable_sources; |
704 | 704 | }, |
705 | 705 | /* Imports media sources from ROE data. |
706 | 706 | * @param roe_data ROE data. |
707 | 707 | */ |
708 | | - addROE:function(roe_data){ |
| 708 | + addROE:function(roe_data){ |
709 | 709 | js_log('f:addROE'); |
710 | 710 | this.addedROEData=true; |
711 | | - var _this = this; |
| 711 | + var _this = this; |
712 | 712 | if( typeof roe_data == 'string' ) |
713 | 713 | { |
714 | 714 | var parser=new DOMParser(); |
— | — | @@ -734,7 +734,7 @@ |
735 | 735 | }); |
736 | 736 | }else{ |
737 | 737 | js_log('ROE data empty.'); |
738 | | - } |
| 738 | + } |
739 | 739 | } |
740 | 740 | }; |
741 | 741 | |
— | — | @@ -750,7 +750,7 @@ |
751 | 751 | embedVideo.prototype = { |
752 | 752 | /** The mediaElement object containing all mediaSource objects */ |
753 | 753 | media_element:null, |
754 | | - preview_mode:false, |
| 754 | + preview_mode:false, |
755 | 755 | ready_to_play:false, //should use html5 ready state |
756 | 756 | load_error:false, //used to set error in case of error |
757 | 757 | loading_external_data:false, |
— | — | @@ -758,19 +758,19 @@ |
759 | 759 | thumbnail_disp:true, |
760 | 760 | init_with_sources_loadedDone:false, |
761 | 761 | inDOM:false, |
762 | | - //for onClip done stuff: |
| 762 | + //for onClip done stuff: |
763 | 763 | anno_data_cache:null, |
764 | 764 | seek_time_sec:0, |
765 | 765 | base_seeker_slider_offset:null, |
766 | 766 | onClipDone_disp:false, |
767 | | - supports:{}, |
| 767 | + supports:{}, |
768 | 768 | //for seek thumb updates: |
769 | 769 | cur_thumb_seek_time:0, |
770 | 770 | thumb_seek_interval:null, |
771 | | - |
| 771 | + |
772 | 772 | seeking:false, |
773 | | - //set the buffered percent: |
774 | | - bufferedPercent:0, |
| 773 | + //set the buffered percent: |
| 774 | + bufferedPercent:0, |
775 | 775 | //utility functions for property values: |
776 | 776 | hx : function ( s ) { |
777 | 777 | if ( typeof s != 'String' ) { |
— | — | @@ -799,7 +799,7 @@ |
800 | 800 | else |
801 | 801 | return parseInt(this.height); |
802 | 802 | }, |
803 | | - init: function(element){ |
| 803 | + init: function(element){ |
804 | 804 | //this.element_pointer = element; |
805 | 805 | |
806 | 806 | //inherit all the default video_attributes |
— | — | @@ -812,16 +812,16 @@ |
813 | 813 | //js_log('attr:' + attr + ' val: ' + video_attributes[attr] +" "+ 'elm_val:' + element.getAttribute(attr) + "\n (set by attr)"); |
814 | 814 | } |
815 | 815 | } |
816 | | - //make sure startOffset is cast as an int |
| 816 | + //make sure startOffset is cast as an int |
817 | 817 | if( this.startOffset && this.startOffset.split(':').length >= 2) |
818 | 818 | this.startOffset = npt2seconds(this.startOffset); |
819 | | - //make sure offset is in float: |
| 819 | + //make sure offset is in float: |
820 | 820 | this.startOffset = parseFloat(this.startOffset); |
821 | | - |
| 821 | + |
822 | 822 | if( this.duration && this.duration.split(':').length >= 2) |
823 | | - this.duration = npt2seconds( this.duration ); |
824 | | - //make sure duration is in float: |
825 | | - this.duration = parseFloat(this.duration); |
| 823 | + this.duration = npt2seconds( this.duration ); |
| 824 | + //make sure duration is in float: |
| 825 | + this.duration = parseFloat(this.duration); |
826 | 826 | js_log("duration is: " + this.duration); |
827 | 827 | //if style is set override width and height |
828 | 828 | var dwh = mwConfig['video_size'].split('x'); |
— | — | @@ -835,114 +835,114 @@ |
836 | 836 | if(element.innerHTML!='' && element.getElementsByTagName('source').length==0){ |
837 | 837 | js_log('innerHTML: ' + element.innerHTML); |
838 | 838 | this.user_missing_plugin_html=element.innerHTML; |
839 | | - } |
| 839 | + } |
840 | 840 | // load all of the specified sources |
841 | | - this.media_element = new mediaElement(element); |
| 841 | + this.media_element = new mediaElement(element); |
842 | 842 | }, |
843 | 843 | on_dom_swap: function(){ |
844 | | - js_log('f:on_dom_swap'); |
| 844 | + js_log('f:on_dom_swap'); |
845 | 845 | // Process the provided ROE file... if we don't yet have sources |
846 | 846 | if(this.roe && this.media_element.sources.length==0 ){ |
847 | 847 | js_log('loading external data'); |
848 | 848 | this.loading_external_data=true; |
849 | | - var _this = this; |
| 849 | + var _this = this; |
850 | 850 | do_request(this.roe, function(data) |
851 | | - { |
852 | | - //continue |
853 | | - _this.media_element.addROE( data ); |
854 | | - js_log('added_roe::' + _this.media_element.sources.length); |
855 | | - |
856 | | - js_log('set loading_external_data=false'); |
857 | | - _this.loading_external_data=false; |
858 | | - |
859 | | - _this.init_with_sources_loaded(); |
| 851 | + { |
| 852 | + //continue |
| 853 | + _this.media_element.addROE( data ); |
| 854 | + js_log('added_roe::' + _this.media_element.sources.length); |
| 855 | + |
| 856 | + js_log('set loading_external_data=false'); |
| 857 | + _this.loading_external_data=false; |
| 858 | + |
| 859 | + _this.init_with_sources_loaded(); |
860 | 860 | }); |
861 | 861 | } |
862 | 862 | }, |
863 | 863 | init_with_sources_loaded : function() |
864 | | - { |
| 864 | + { |
865 | 865 | js_log('f:init_with_sources_loaded'); |
866 | 866 | //set flag that we have run this function: |
867 | | - this.init_with_sources_loadedDone=true; |
| 867 | + this.init_with_sources_loadedDone=true; |
868 | 868 | //autoseletct the source |
869 | | - this.media_element.autoSelectSource(); |
| 869 | + this.media_element.autoSelectSource(); |
870 | 870 | //auto select player based on prefrence or default order |
871 | 871 | if( !this.media_element.selected_source ) |
872 | 872 | { |
873 | | - //check for parent clip: |
874 | | - if( typeof this.pc != 'undefined' ){ |
875 | | - js_log('no sources, type:' +this.type + ' check for html'); |
876 | | - //debugger; |
877 | | - //do load player if just displaying innerHTML: |
| 873 | + //check for parent clip: |
| 874 | + if( typeof this.pc != 'undefined' ){ |
| 875 | + js_log('no sources, type:' +this.type + ' check for html'); |
| 876 | + //debugger; |
| 877 | + //do load player if just displaying innerHTML: |
878 | 878 | if( this.pc.type == 'text/html' ){ |
879 | 879 | this.selected_player = embedTypes.players.defaultPlayer( 'text/html' ); |
880 | | - js_log('set selected player:'+ this.selected_player.mime_type); |
| 880 | + js_log('set selected player:'+ this.selected_player.mime_type); |
881 | 881 | } |
882 | 882 | } |
883 | | - }else{ |
| 883 | + }else{ |
884 | 884 | this.selected_player = embedTypes.players.defaultPlayer( this.media_element.selected_source.mime_type ); |
885 | | - } |
| 885 | + } |
886 | 886 | if( this.selected_player ){ |
887 | 887 | js_log('selected ' + this.selected_player.getName()); |
888 | 888 | js_log("PLAYBACK TYPE: "+this.selected_player.library); |
889 | | - this.thumbnail_disp = true; |
890 | | - this.inheritEmbedObj(); |
891 | | - }else{ |
| 889 | + this.thumbnail_disp = true; |
| 890 | + this.inheritEmbedObj(); |
| 891 | + }else{ |
892 | 892 | //no source's playable |
893 | 893 | var missing_type =''; |
894 | | - var or =''; |
| 894 | + var or =''; |
895 | 895 | for( var i=0; i < this.media_element.sources.length; i++){ |
896 | 896 | missing_type+= or + this.media_element.sources[i].mime_type; |
897 | 897 | or=' or '; |
898 | | - } |
| 898 | + } |
899 | 899 | if( this.pc ) |
900 | | - var missing_type = this.pc.type; |
| 900 | + var missing_type = this.pc.type; |
901 | 901 | js_log('no player found for given source type ' + missing_type); |
902 | | - this.load_error= this.getPluginMissingHTML(missing_type); |
903 | | - } |
| 902 | + this.load_error= this.getPluginMissingHTML(missing_type); |
| 903 | + } |
904 | 904 | }, |
905 | | - inheritEmbedObj:function(){ |
906 | | - js_log("inheritEmbedObj:duration is: " + this.duration); |
| 905 | + inheritEmbedObj:function(){ |
| 906 | + js_log("inheritEmbedObj:duration is: " + this.duration); |
907 | 907 | //@@note: tricky cuz direct overwrite is not so ideal.. since the extended object is already tied to the dom |
908 | 908 | //clear out any non-base embedObj stuff: |
909 | 909 | if(this.instanceOf){ |
910 | 910 | eval('tmpObj = '+this.instanceOf); |
911 | | - for(var i in tmpObj){ //for in loop oky for object |
| 911 | + for(var i in tmpObj){ //for in loop oky for object |
912 | 912 | if(this['parent_'+i]){ |
913 | 913 | this[i]=this['parent_'+i]; |
914 | 914 | }else{ |
915 | 915 | this[i]=null; |
916 | 916 | } |
917 | 917 | } |
918 | | - } |
| 918 | + } |
919 | 919 | //set up the new embedObj |
920 | 920 | js_log('f: inheritEmbedObj: embedding with ' + this.selected_player.library); |
921 | | - var _this = this; |
| 921 | + var _this = this; |
922 | 922 | this.selected_player.load( function() |
923 | 923 | { |
924 | | - js_log("selected_player::load:duration is: " + _this.duration); |
| 924 | + js_log("selected_player::load:duration is: " + _this.duration); |
925 | 925 | //js_log('inheriting '+_this.selected_player.library +'Embed to ' + _this.id + ' ' + $j('#'+_this.id).length); |
926 | 926 | //var _this = $j('#'+_this.id).get(0); |
927 | 927 | //js_log( 'type of ' + _this.selected_player.library +'Embed + ' + |
928 | | - // eval('typeof '+_this.selected_player.library +'Embed')); |
| 928 | + // eval('typeof '+_this.selected_player.library +'Embed')); |
929 | 929 | eval('embedObj = ' +_this.selected_player.library +'Embed;'); |
930 | | - for(var method in embedObj){ //for in loop oky for object |
| 930 | + for(var method in embedObj){ //for in loop oky for object |
931 | 931 | //parent method preservation for local overwritten methods |
932 | 932 | if(_this[method]) |
933 | 933 | _this['parent_' + method] = _this[method]; |
934 | 934 | _this[method]=embedObj[method]; |
935 | 935 | } |
936 | 936 | js_log('TYPEOF_ppause: ' + typeof _this['parent_pause']); |
937 | | - |
| 937 | + |
938 | 938 | if(_this.inheritEmbedOverride){ |
939 | 939 | _this.inheritEmbedOverride(); |
940 | 940 | } |
941 | 941 | //update controls if possible |
942 | 942 | if(!_this.loading_external_data) |
943 | | - _this.refreshControlsHTML(); |
944 | | - |
945 | | - //js_log("READY TO PLAY:"+_this.id); |
946 | | - _this.ready_to_play=true; |
| 943 | + _this.refreshControlsHTML(); |
| 944 | + |
| 945 | + //js_log("READY TO PLAY:"+_this.id); |
| 946 | + _this.ready_to_play=true; |
947 | 947 | _this.getDuration(); |
948 | 948 | _this.getHTML(); |
949 | 949 | }); |
— | — | @@ -953,61 +953,61 @@ |
954 | 954 | if(this.selected_player.id != player.id){ |
955 | 955 | this.selected_player = player; |
956 | 956 | this.inheritEmbedObj(); |
957 | | - } |
| 957 | + } |
958 | 958 | }, |
959 | | - doNativeWarningCheck:function(){ |
| 959 | + doNativeWarningCheck:function(){ |
960 | 960 | if( $j.cookie('dismissNativeWarn') && $j.cookie('dismissNativeWarn')===true){ |
961 | 961 | return false; |
962 | | - }else{ |
963 | | - //see if we have native support for ogg: |
964 | | - var supporting_players = embedTypes.players.getMIMETypePlayers( 'video/ogg' ); |
| 962 | + }else{ |
| 963 | + //see if we have native support for ogg: |
| 964 | + var supporting_players = embedTypes.players.getMIMETypePlayers( 'video/ogg' ); |
965 | 965 | for(var i=0; i < supporting_players.length; i++){ |
966 | 966 | if(supporting_players[i].id == 'videoElement'){ |
967 | 967 | return false; |
968 | | - } |
969 | | - } |
970 | | - //see if we are using mv_embed without a ogg source in which case no point in promoting firefox :P |
| 968 | + } |
| 969 | + } |
| 970 | + //see if we are using mv_embed without a ogg source in which case no point in promoting firefox :P |
971 | 971 | if(this.media_element && this.media_element.sources){ |
972 | 972 | var foundOgg = false; |
973 | 973 | var playable_sources = this.media_element.getPlayableSources(); |
974 | | - for(var sInx=0; sInx < playable_sources.length; sInx++){ |
| 974 | + for(var sInx=0; sInx < playable_sources.length; sInx++){ |
975 | 975 | var mime_type = playable_sources[sInx].mime_type; |
976 | 976 | if( mime_type=='video/ogg' ){ |
977 | | - //they have flash / h.264 fallback no need to push firefox :( |
| 977 | + //they have flash / h.264 fallback no need to push firefox :( |
978 | 978 | foundOgg = true; |
979 | 979 | } |
980 | 980 | } |
981 | 981 | //no ogg no point in download firefox |
982 | 982 | if(!foundOgg) |
983 | 983 | return false; |
984 | | - |
| 984 | + |
985 | 985 | } |
986 | 986 | } |
987 | | - return true; |
| 987 | + return true; |
988 | 988 | }, |
989 | 989 | getTimeReq:function(){ |
990 | 990 | var default_time_req = '0:00:00/' + seconds2npt(this.getDuration()); |
991 | 991 | if(!this.media_element) |
992 | 992 | return default_time_req; |
993 | 993 | if(!this.media_element.selected_source) |
994 | | - return default_time_req; |
| 994 | + return default_time_req; |
995 | 995 | if(!this.media_element.selected_source.end_ntp) |
996 | | - return default_time_req; |
| 996 | + return default_time_req; |
997 | 997 | return this.media_element.selected_source.start_ntp+'/'+this.media_element.selected_source.end_ntp; |
998 | | - }, |
999 | | - getDuration:function(){ |
1000 | | - //update some local pointers for the selected source: |
1001 | | - if(this.media_element && this.media_element.selected_source && this.media_element.selected_source.duration){ |
1002 | | - this.duration = this.media_element.selected_source.duration; |
| 998 | + }, |
| 999 | + getDuration:function(){ |
| 1000 | + //update some local pointers for the selected source: |
| 1001 | + if(this.media_element && this.media_element.selected_source && this.media_element.selected_source.duration){ |
| 1002 | + this.duration = this.media_element.selected_source.duration; |
1003 | 1003 | this.start_offset = this.media_element.selected_source.start_offset; |
1004 | 1004 | this.start_ntp = this.media_element.selected_source.start_ntp; |
1005 | | - this.end_ntp = this.media_element.selected_source.end_ntp; |
| 1005 | + this.end_ntp = this.media_element.selected_source.end_ntp; |
1006 | 1006 | } |
1007 | | - //update start end_ntp if duration !=0 (set from plugin) |
| 1007 | + //update start end_ntp if duration !=0 (set from plugin) |
1008 | 1008 | if(!this.start_ntp) |
1009 | 1009 | this.start_ntp = '0:0:0'; |
1010 | 1010 | if(!this.end_ntp && this.duration) |
1011 | | - this.end_ntp = seconds2npt( this.duration ); |
| 1011 | + this.end_ntp = seconds2npt( this.duration ); |
1012 | 1012 | //return the duration |
1013 | 1013 | return this.duration; |
1014 | 1014 | }, |
— | — | @@ -1015,48 +1015,48 @@ |
1016 | 1016 | * wrapEmebedContainer |
1017 | 1017 | * wraps the embed code into a container to better support playlist function |
1018 | 1018 | * (where embed element is swapped for next clip |
1019 | | - * (where plugin method does not support playlsits) |
| 1019 | + * (where plugin method does not support playlsits) |
1020 | 1020 | */ |
1021 | 1021 | wrapEmebedContainer:function(embed_code){ |
1022 | 1022 | //check if parent clip is set( ie we are in a playlist so name the embed container by playlistID) |
1023 | 1023 | var id = (this.pc!=null)?this.pc.pp.id:this.id; |
1024 | | - return '<div id="mv_ebct_'+id+'" style="width:'+this.width+'px;height:'+this.height+'px;">' + |
1025 | | - embed_code + |
| 1024 | + return '<div id="mv_ebct_'+id+'" style="width:'+this.width+'px;height:'+this.height+'px;">' + |
| 1025 | + embed_code + |
1026 | 1026 | '</div>'; |
1027 | | - }, |
| 1027 | + }, |
1028 | 1028 | getEmbedHTML : function(){ |
1029 | 1029 | //return this.wrapEmebedContainer( this.getEmbedObj() ); |
1030 | 1030 | return 'function getEmbedHTML should be overitten by embedLib '; |
1031 | 1031 | }, |
1032 | 1032 | //do seek function (should be overwritten by implementing embedLibs) |
1033 | | - // first check if seek can be done on locally downloaded content. |
1034 | | - doSeek : function( perc ){ |
1035 | | - if( this.supportsURLTimeEncoding() ){ |
| 1033 | + // first check if seek can be done on locally downloaded content. |
| 1034 | + doSeek : function( perc ){ |
| 1035 | + if( this.supportsURLTimeEncoding() ){ |
1036 | 1036 | //make sure this.seek_time_sec is up-to-date: |
1037 | 1037 | this.seek_time_sec = npt2seconds( this.start_ntp ) + parseFloat( perc * this.getDuration() ); |
1038 | 1038 | js_log('updated seek_time_sec: ' + seconds2npt ( this.seek_time_sec) ); |
1039 | | - this.stop(); |
| 1039 | + this.stop(); |
1040 | 1040 | this.didSeekJump=true; |
1041 | 1041 | //update the slider |
1042 | | - this.setSliderValue( perc ); |
1043 | | - } |
1044 | | - //do play in 100ms (give things time to clear) |
| 1042 | + this.setSliderValue( perc ); |
| 1043 | + } |
| 1044 | + //do play in 100ms (give things time to clear) |
1045 | 1045 | setTimeout('$j(\'#' + this.id + '\').get(0).play()',100); |
1046 | 1046 | }, |
1047 | 1047 | /* |
1048 | | - * seeks to the requested time and issues a callback when ready |
| 1048 | + * seeks to the requested time and issues a callback when ready |
1049 | 1049 | * (should be overwitten by client that supports frame serving) |
1050 | | - */ |
| 1050 | + */ |
1051 | 1051 | setCurrentTime:function( time, callback){ |
1052 | 1052 | js_log('error: base embed setCurrentTime can not frame serve (overide via plugin)'); |
1053 | 1053 | }, |
1054 | 1054 | addPresTimeOffset:function(){ |
1055 | | - //add in the offset: |
| 1055 | + //add in the offset: |
1056 | 1056 | if(this.seek_time_sec && this.seek_time_sec!=0){ |
1057 | 1057 | this.currentTime+=this.seek_time_sec; |
1058 | | - }else if(this.start_offset && this.start_offset!=0){ |
1059 | | - this.currentTime = parseFloat(this.currentTime) + parseFloat(this.start_offset); |
1060 | | - } |
| 1058 | + }else if(this.start_offset && this.start_offset!=0){ |
| 1059 | + this.currentTime = parseFloat(this.currentTime) + parseFloat(this.start_offset); |
| 1060 | + } |
1061 | 1061 | }, |
1062 | 1062 | doEmbedHTML:function() |
1063 | 1063 | { |
— | — | @@ -1066,90 +1066,90 @@ |
1067 | 1067 | this.closeDisplayedHTML(); |
1068 | 1068 | |
1069 | 1069 | // if(!this.selected_player){ |
1070 | | -// return this.getPluginMissingHTML(); |
| 1070 | +// return this.getPluginMissingHTML(); |
1071 | 1071 | //Set "loading" here |
1072 | 1072 | $j('#mv_embedded_player_'+_this.id).html(''+ |
1073 | | - '<div style="color:black;width:'+this.width+'px;height:'+this.height+'px;">' + |
1074 | | - gM('loading_plugin') + |
1075 | | - '</div>' |
| 1073 | + '<div style="color:black;width:'+this.width+'px;height:'+this.height+'px;">' + |
| 1074 | + gM('mwe-loading_plugin') + |
| 1075 | + '</div>' |
1076 | 1076 | ); |
1077 | 1077 | // schedule embedding |
1078 | 1078 | this.selected_player.load(function() |
1079 | 1079 | { |
1080 | | - js_log('performing embed for ' + _this.id); |
1081 | | - var embed_code = _this.getEmbedHTML(); |
| 1080 | + js_log('performing embed for ' + _this.id); |
| 1081 | + var embed_code = _this.getEmbedHTML(); |
1082 | 1082 | //js_log('shopuld embed:' + embed_code); |
1083 | | - $j('#mv_embedded_player_'+_this.id).html(embed_code); |
| 1083 | + $j('#mv_embedded_player_'+_this.id).html(embed_code); |
1084 | 1084 | }); |
1085 | 1085 | }, |
1086 | 1086 | onClipDone:function(){ |
1087 | 1087 | js_log('base:onClipDone'); |
1088 | | - //stop the clip (load the thumbnail etc) |
| 1088 | + //stop the clip (load the thumbnail etc) |
1089 | 1089 | this.stop(); |
1090 | 1090 | this.seek_time_sec = 0; |
1091 | 1091 | this.setSliderValue(0); |
1092 | 1092 | var _this = this; |
1093 | | - |
1094 | | - //if the clip resolution is < 320 don't do fancy onClipDone stuff |
| 1093 | + |
| 1094 | + //if the clip resolution is < 320 don't do fancy onClipDone stuff |
1095 | 1095 | if(this.width < 300){ |
1096 | 1096 | return ; |
1097 | 1097 | } |
1098 | 1098 | this.onClipDone_disp=true; |
1099 | 1099 | this.thumbnail_disp=true; |
1100 | | - //make sure we are not in preview mode( no end clip actions in preview mode) |
| 1100 | + //make sure we are not in preview mode( no end clip actions in preview mode) |
1101 | 1101 | if( this.preview_mode ) |
1102 | 1102 | return ; |
1103 | | - |
| 1103 | + |
1104 | 1104 | $j('#img_thumb_'+this.id).css('zindex',1); |
1105 | 1105 | $j('#big_play_link_'+this.id).hide(); |
1106 | | - //add the liks_info_div black back |
| 1106 | + //add the liks_info_div black back |
1107 | 1107 | $j('#dc_'+this.id).append('<div id="liks_info_'+this.id+'" ' + |
1108 | | - 'style="width:' +parseInt(parseInt(this.width)/2)+'px;'+ |
| 1108 | + 'style="width:' +parseInt(parseInt(this.width)/2)+'px;'+ |
1109 | 1109 | 'height:'+ parseInt(parseInt(this.height)) +'px;'+ |
1110 | | - 'position:absolute;top:10px;overflow:auto'+ |
| 1110 | + 'position:absolute;top:10px;overflow:auto'+ |
1111 | 1111 | 'width: '+parseInt( ((parseInt(this.width)/2)-15) ) + 'px;'+ |
1112 | | - 'left:'+ parseInt( ((parseInt(this.width)/2)+15) ) +'px;">'+ |
| 1112 | + 'left:'+ parseInt( ((parseInt(this.width)/2)+15) ) +'px;">'+ |
1113 | 1113 | '</div>' + |
1114 | 1114 | '<div id="black_back_'+this.id+'" ' + |
1115 | 1115 | 'style="z-index:-2;position:absolute;background:#000;' + |
1116 | 1116 | 'top:0px;left:0px;width:'+parseInt(this.width)+'px;' + |
1117 | 1117 | 'height:'+parseInt(this.height)+'px;">' + |
1118 | 1118 | '</div>' |
1119 | | - ); |
1120 | | - |
1121 | | - //start animation (make thumb small in upper left add in div for "loading" |
1122 | | - $j('#img_thumb_'+this.id).animate({ |
| 1119 | + ); |
| 1120 | + |
| 1121 | + //start animation (make thumb small in upper left add in div for "loading" |
| 1122 | + $j('#img_thumb_'+this.id).animate({ |
1123 | 1123 | width:parseInt(parseInt(_this.width)/2), |
1124 | 1124 | height:parseInt(parseInt(_this.height)/2), |
1125 | 1125 | top:20, |
1126 | 1126 | left:10 |
1127 | 1127 | }, |
1128 | | - 1000, |
| 1128 | + 1000, |
1129 | 1129 | function(){ |
1130 | | - //animation done.. add "loading" to div if empty |
| 1130 | + //animation done.. add "loading" to div if empty |
1131 | 1131 | if($j('#liks_info_'+_this.id).html()==''){ |
1132 | | - $j('#liks_info_'+_this.id).html(gM('loading_txt')); |
1133 | | - } |
| 1132 | + $j('#liks_info_'+_this.id).html(gM('mwe-loading_txt')); |
| 1133 | + } |
1134 | 1134 | } |
1135 | | - ) |
| 1135 | + ) |
1136 | 1136 | //now load roe if run the showNextPrevLinks |
1137 | 1137 | if(this.roe && this.media_element.addedROEData==false){ |
1138 | 1138 | do_request(this.roe, function(data) |
1139 | | - { |
| 1139 | + { |
1140 | 1140 | _this.media_element.addROE(data); |
1141 | 1141 | _this.getNextPrevLinks(); |
1142 | | - }); |
| 1142 | + }); |
1143 | 1143 | }else{ |
1144 | 1144 | this.getNextPrevLinks(); |
1145 | 1145 | } |
1146 | 1146 | }, |
1147 | | - //@@todo we should merge getNextPrevLinks with textInterface .. there is repeated code between them. |
| 1147 | + //@@todo we should merge getNextPrevLinks with textInterface .. there is repeated code between them. |
1148 | 1148 | getNextPrevLinks:function(){ |
1149 | 1149 | js_log('f:getNextPrevLinks'); |
1150 | 1150 | var anno_track_url = null; |
1151 | | - var _this = this; |
| 1151 | + var _this = this; |
1152 | 1152 | //check for annoative track |
1153 | | - $j.each(this.media_element.sources, function(inx, n){ |
| 1153 | + $j.each(this.media_element.sources, function(inx, n){ |
1154 | 1154 | if(n.mime_type=='text/cmml'){ |
1155 | 1155 | if( n.id == 'Anno_en'){ |
1156 | 1156 | anno_track_url = n.src; |
— | — | @@ -1161,28 +1161,28 @@ |
1162 | 1162 | //zero out seconds (should improve cache hit rate and generally expands metadata search) |
1163 | 1163 | //@@todo this could be repalced with a regExp |
1164 | 1164 | var annoURL = parseUri(anno_track_url); |
1165 | | - var times = annoURL.queryKey['t'].split('/'); |
1166 | | - var stime_parts = times[0].split(':'); |
1167 | | - var etime_parts = times[1].split(':'); |
| 1165 | + var times = annoURL.queryKey['t'].split('/'); |
| 1166 | + var stime_parts = times[0].split(':'); |
| 1167 | + var etime_parts = times[1].split(':'); |
1168 | 1168 | //zero out the hour: |
1169 | 1169 | var new_start = stime_parts[0]+':'+'0:0'; |
1170 | 1170 | //zero out the end sec |
1171 | 1171 | var new_end = (etime_parts[0]== stime_parts[0])? (etime_parts[0]+1)+':0:0' :etime_parts[0]+':0:0'; |
1172 | | - |
| 1172 | + |
1173 | 1173 | var etime_parts = times[1].split(':'); |
1174 | | - |
| 1174 | + |
1175 | 1175 | var new_anno_track_url = annoURL.protocol +'://'+ annoURL.host + annoURL.path +'?'; |
1176 | 1176 | $j.each(annoURL.queryKey, function(i, val){ |
1177 | 1177 | new_anno_track_url +=(i=='t')?'t='+new_start+'/'+new_end +'&' : |
1178 | 1178 | i+'='+ val+'&'; |
1179 | 1179 | }); |
1180 | 1180 | var request_key = new_start+'/'+new_end; |
1181 | | - //check the anno_data cache: |
1182 | | - //@@todo search cache see if current is in range. |
| 1181 | + //check the anno_data cache: |
| 1182 | + //@@todo search cache see if current is in range. |
1183 | 1183 | if(this.anno_data_cache){ |
1184 | 1184 | js_log('anno data found in cache: '+request_key); |
1185 | 1185 | this.showNextPrevLinks(); |
1186 | | - }else{ |
| 1186 | + }else{ |
1187 | 1187 | do_request(new_anno_track_url, function(cmml_data){ |
1188 | 1188 | js_log('raw response: '+ cmml_data); |
1189 | 1189 | if(typeof cmml_data == 'string') |
— | — | @@ -1193,8 +1193,8 @@ |
1194 | 1194 | } |
1195 | 1195 | //init anno_data_cache |
1196 | 1196 | if(!_this.anno_data_cache) |
1197 | | - _this.anno_data_cache={}; |
1198 | | - //grab all metadata and put it into the anno_data_cache: |
| 1197 | + _this.anno_data_cache={}; |
| 1198 | + //grab all metadata and put it into the anno_data_cache: |
1199 | 1199 | $j.each(cmml_data.getElementsByTagName('clip'), function(inx, clip){ |
1200 | 1200 | _this.anno_data_cache[ $j(clip).attr("id") ]={ |
1201 | 1201 | 'start_time_sec':npt2seconds($j(clip).attr("start").replace('npt:','')), |
— | — | @@ -1203,32 +1203,32 @@ |
1204 | 1204 | }; |
1205 | 1205 | //grab all its meta |
1206 | 1206 | _this.anno_data_cache[ $j(clip).attr("id") ]['meta']={}; |
1207 | | - $j.each(clip.getElementsByTagName('meta'),function(imx, meta){ |
| 1207 | + $j.each(clip.getElementsByTagName('meta'),function(imx, meta){ |
1208 | 1208 | //js_log('adding meta: '+ $j(meta).attr("name")+ ' = '+ $j(meta).attr("content")); |
1209 | 1209 | _this.anno_data_cache[$j(clip).attr("id")]['meta'][$j(meta).attr("name")]=$j(meta).attr("content"); |
1210 | 1210 | }); |
1211 | 1211 | }); |
1212 | | - _this.showNextPrevLinks(); |
| 1212 | + _this.showNextPrevLinks(); |
1213 | 1213 | }); |
1214 | 1214 | } |
1215 | 1215 | }else{ |
1216 | 1216 | js_log('no annotative track found'); |
1217 | 1217 | $j('#liks_info_'+this.id).html('no metadata found for related links'); |
1218 | 1218 | } |
1219 | | - //query current request time +|- 60s to get prev next speech links. |
| 1219 | + //query current request time +|- 60s to get prev next speech links. |
1220 | 1220 | }, |
1221 | 1221 | showNextPrevLinks:function(){ |
1222 | 1222 | //js_log('f:showNextPrevLinks'); |
1223 | | - //int requested links: |
| 1223 | + //int requested links: |
1224 | 1224 | var link = { |
1225 | 1225 | 'prev':'', |
1226 | 1226 | 'current':'', |
1227 | 1227 | 'next':'' |
1228 | | - } |
| 1228 | + } |
1229 | 1229 | var curTime = this.getTimeReq().split('/'); |
1230 | | - |
| 1230 | + |
1231 | 1231 | var s_sec = npt2seconds(curTime[0]); |
1232 | | - var e_sec = npt2seconds(curTime[1]); |
| 1232 | + var e_sec = npt2seconds(curTime[1]); |
1233 | 1233 | js_log('showNextPrevLinks: req time: '+ s_sec + ' to ' + e_sec); |
1234 | 1234 | //now we have all the data in anno_data_cache |
1235 | 1235 | var current_done=false; |
— | — | @@ -1240,52 +1240,52 @@ |
1241 | 1241 | link.prev = clip_id; |
1242 | 1242 | js_log('showNextPrevLinks: ' + s_sec + ' < ' + clip.end_time_sec + ' set prev'); |
1243 | 1243 | } |
1244 | | - |
| 1244 | + |
1245 | 1245 | if(e_sec==clip.end_time_sec && s_sec== clip.start_time_sec) |
1246 | 1246 | current_done = true; |
1247 | 1247 | //current clip is not done: |
1248 | 1248 | if( e_sec < clip.end_time_sec && link.current=='' && !current_done){ |
1249 | 1249 | link.current = clip_id; |
1250 | | - js_log('showNextPrevLinks: ' + e_sec + ' < ' + clip.end_time_sec + ' set current'); |
| 1250 | + js_log('showNextPrevLinks: ' + e_sec + ' < ' + clip.end_time_sec + ' set current'); |
1251 | 1251 | } |
1252 | | - |
| 1252 | + |
1253 | 1253 | //set end clip (first clip where start time is > end_time of req |
1254 | 1254 | if( e_sec < clip.start_time_sec && link.next==''){ |
1255 | 1255 | link.next = clip_id; |
1256 | 1256 | js_log('showNextPrevLinks: '+ e_sec + ' < '+ clip.start_time_sec + ' && ' + link.next ); |
1257 | 1257 | } |
1258 | | - } |
1259 | | - var html=''; |
| 1258 | + } |
| 1259 | + var html=''; |
1260 | 1260 | if(link.prev=='' && link.current=='' && link.next==''){ |
1261 | 1261 | html='<p><a href="'+this.media_element.linkbackgetMsg+'">clip page</a>'; |
1262 | | - }else{ |
| 1262 | + }else{ |
1263 | 1263 | for(var link_type in link){ |
1264 | | - var link_id = link[link_type]; |
| 1264 | + var link_id = link[link_type]; |
1265 | 1265 | if(link_id!=''){ |
1266 | | - var clip = this.anno_data_cache[link_id]; |
| 1266 | + var clip = this.anno_data_cache[link_id]; |
1267 | 1267 | var title_msg=''; |
1268 | 1268 | for(var j in clip['meta']){ |
1269 | 1269 | title_msg+=j.replace(/_/g,' ') +': ' +clip['meta'][j].replace(/_/g,' ') +" <br>"; |
1270 | | - } |
| 1270 | + } |
1271 | 1271 | var time_req = clip.time_req; |
1272 | | - if(link_type=='current') //if current start from end of current clip play to end of current meta: |
| 1272 | + if(link_type=='current') //if current start from end of current clip play to end of current meta: |
1273 | 1273 | time_req = curTime[1]+ '/' + seconds2npt( clip.end_time_sec ); |
1274 | | - |
1275 | | - //do special linkbacks for metavid content: |
1276 | | - var regTimeCheck = new RegExp(/[0-9]+:[0-9]+:[0-9]+\/[0-9]+:[0-9]+:[0-9]+/); |
| 1274 | + |
| 1275 | + //do special linkbacks for metavid content: |
| 1276 | + var regTimeCheck = new RegExp(/[0-9]+:[0-9]+:[0-9]+\/[0-9]+:[0-9]+:[0-9]+/); |
1277 | 1277 | html+='<p><a '; |
1278 | 1278 | if( regTimeCheck.test( this.media_element.linkback ) ){ |
1279 | | - html+=' href="'+ this.media_element.linkback.replace(regTimeCheck,time_req) +'" '; |
| 1279 | + html+=' href="'+ this.media_element.linkback.replace(regTimeCheck,time_req) +'" '; |
1280 | 1280 | }else{ |
1281 | | - html+=' href="#" onClick="$j(\'#'+this.id+'\').get(0).playByTimeReq(\''+ |
1282 | | - time_req + '\'); return false; "'; |
| 1281 | + html+=' href="#" onClick="$j(\'#'+this.id+'\').get(0).playByTimeReq(\''+ |
| 1282 | + time_req + '\'); return false; "'; |
1283 | 1283 | } |
1284 | | - html+=' title="' + title_msg + '">' + |
1285 | | - gM(link_type+'_clip_msg') + |
| 1284 | + html+=' title="' + title_msg + '">' + |
| 1285 | + gM('mwe-'+link_type+'_clip_msg') + |
1286 | 1286 | '</a><br><span style="font-size:small">'+ title_msg +'<span></p>'; |
1287 | | - } |
| 1287 | + } |
1288 | 1288 | } |
1289 | | - } |
| 1289 | + } |
1290 | 1290 | //js_og("should set html:"+ html); |
1291 | 1291 | $j('#liks_info_'+this.id).html(html); |
1292 | 1292 | }, |
— | — | @@ -1293,15 +1293,15 @@ |
1294 | 1294 | js_log('f:playByTimeReq: '+time_req ); |
1295 | 1295 | this.stop(); |
1296 | 1296 | this.updateVideoTimeReq(time_req); |
1297 | | - this.play(); |
| 1297 | + this.play(); |
1298 | 1298 | }, |
1299 | 1299 | doThumbnailHTML:function() |
1300 | | - { |
| 1300 | + { |
1301 | 1301 | var _this = this; |
1302 | | - js_log('f:doThumbnailHTML'+ this.thumbnail_disp); |
1303 | | - this.closeDisplayedHTML(); |
| 1302 | + js_log('f:doThumbnailHTML'+ this.thumbnail_disp); |
| 1303 | + this.closeDisplayedHTML(); |
1304 | 1304 | $j( '#mv_embedded_player_' + this.id ).html( this.getThumbnailHTML() ); |
1305 | | - this.paused = true; |
| 1305 | + this.paused = true; |
1306 | 1306 | this.thumbnail_disp = true; |
1307 | 1307 | }, |
1308 | 1308 | refreshControlsHTML:function(){ |
— | — | @@ -1312,40 +1312,40 @@ |
1313 | 1313 | return; |
1314 | 1314 | }else{ |
1315 | 1315 | $j('#mv_embedded_controls_'+this.id).html( this.getControlsHTML() ); |
1316 | | - ctrlBuilder.addControlHooks(this); |
1317 | | - } |
1318 | | - }, |
| 1316 | + ctrlBuilder.addControlHooks(this); |
| 1317 | + } |
| 1318 | + }, |
1319 | 1319 | getControlsHTML:function() |
1320 | | - { |
| 1320 | + { |
1321 | 1321 | return ctrlBuilder.getControls( this ); |
1322 | | - }, |
1323 | | - getHTML : function (){ |
1324 | | - //@@todo check if we have sources avaliable |
1325 | | - js_log('embedVideo:getHTML : ' + this.id + ' resource type: ' + this.type); |
1326 | | - var _this = this; |
1327 | | - var html_code = ''; |
1328 | | - html_code = '<div id="videoPlayer_'+this.id+'" style="width:'+this.width+'px;position:relative;" class="videoPlayer">'; |
| 1322 | + }, |
| 1323 | + getHTML : function (){ |
| 1324 | + //@@todo check if we have sources avaliable |
| 1325 | + js_log('embedVideo:getHTML : ' + this.id + ' resource type: ' + this.type); |
| 1326 | + var _this = this; |
| 1327 | + var html_code = ''; |
| 1328 | + html_code = '<div id="videoPlayer_'+this.id+'" style="width:'+this.width+'px;position:relative;" class="videoPlayer">'; |
1329 | 1329 | html_code += '<div style="width:'+parseInt(this.width)+'px;height:'+parseInt(this.height)+'px;" id="mv_embedded_player_'+this.id+'">' + |
1330 | | - this.getThumbnailHTML() + |
1331 | | - '</div>'; |
1332 | | - //js_log("mvEmbed:controls "+ typeof this.controls); |
| 1330 | + this.getThumbnailHTML() + |
| 1331 | + '</div>'; |
| 1332 | + //js_log("mvEmbed:controls "+ typeof this.controls); |
1333 | 1333 | if( this.controls ) |
1334 | 1334 | { |
1335 | 1335 | js_log("f:getHTML:AddControls"); |
1336 | 1336 | html_code +='<div id="mv_embedded_controls_' + this.id + '" class="ui-widget ui-corner-bottom ui-state-default controls" >'; |
1337 | | - html_code += this.getControlsHTML(); |
1338 | | - html_code +='</div>'; |
1339 | | - //block out some space by encapulating the top level div |
| 1337 | + html_code += this.getControlsHTML(); |
| 1338 | + html_code +='</div>'; |
| 1339 | + //block out some space by encapulating the top level div |
1340 | 1340 | $j(this).wrap('<div style="width:'+parseInt(this.width)+'px;height:' |
1341 | | - +(parseInt(this.height)+ctrlBuilder.height)+'px"></div>'); |
| 1341 | + +(parseInt(this.height)+ctrlBuilder.height)+'px"></div>'); |
1342 | 1342 | } |
1343 | | - html_code += '</div>'; //videoPlayer div close |
| 1343 | + html_code += '</div>'; //videoPlayer div close |
1344 | 1344 | //js_log('should set: '+this.id); |
1345 | | - $j(this).html( html_code ); |
| 1345 | + $j(this).html( html_code ); |
1346 | 1346 | //add hooks once Controls are in DOM |
1347 | | - ctrlBuilder.addControlHooks(this); |
1348 | | - |
1349 | | - //js_log('set this to: ' + $j(this).html() ); |
| 1347 | + ctrlBuilder.addControlHooks(this); |
| 1348 | + |
| 1349 | + //js_log('set this to: ' + $j(this).html() ); |
1350 | 1350 | //alert('stop'); |
1351 | 1351 | //if auto play==true directly embed the plugin |
1352 | 1352 | if(this.autoplay) |
— | — | @@ -1365,7 +1365,7 @@ |
1366 | 1366 | }else{ |
1367 | 1367 | if(!missing_type) |
1368 | 1368 | missing_type=''; |
1369 | | - out+= gM('mv_generic_missing_plugin', missing_type) + ' or <a title="'+gM('download_clip')+'" href="'+this.src +'">'+gM('download_clip')+'</a>'; |
| 1369 | + out+= gM('mwe-generic_missing_plugin', missing_type) + ' or <a title="'+gM('mwe-download_clip')+'" href="'+this.src +'">'+gM('mwe-download_clip')+'</a>'; |
1370 | 1370 | } |
1371 | 1371 | return out + '</div>'; |
1372 | 1372 | }, |
— | — | @@ -1375,7 +1375,7 @@ |
1376 | 1376 | this.updateVideoTime(time_parts[0], time_parts[1]); |
1377 | 1377 | }, |
1378 | 1378 | //update video time |
1379 | | - updateVideoTime:function(start_ntp, end_ntp){ |
| 1379 | + updateVideoTime:function(start_ntp, end_ntp){ |
1380 | 1380 | //update media |
1381 | 1381 | this.media_element.updateSourceTimes( start_ntp, end_ntp ); |
1382 | 1382 | //update mv_time |
— | — | @@ -1387,11 +1387,11 @@ |
1388 | 1388 | this.seek_time_sec=0; |
1389 | 1389 | else |
1390 | 1390 | this.seek_time_sec=npt2seconds(start_ntp); |
1391 | | - }, |
1392 | | - //@@todo overwite by embed library if we can render frames natavily |
| 1391 | + }, |
| 1392 | + //@@todo overwite by embed library if we can render frames natavily |
1393 | 1393 | renderTimelineThumbnail:function( options ){ |
1394 | 1394 | var my_thumb_src = this.media_element.getThumbnailURL(); |
1395 | | - //check if our thumbnail has a time attribute: |
| 1395 | + //check if our thumbnail has a time attribute: |
1396 | 1396 | if( my_thumb_src.indexOf('t=') !== -1){ |
1397 | 1397 | var time_ntp = seconds2npt ( options.time + parseInt(this.start_offset) ); |
1398 | 1398 | my_thumb_src = getURLParamReplace( my_thumb_src, { 't':time_ntp, 'size': options.size } ); |
— | — | @@ -1399,7 +1399,7 @@ |
1400 | 1400 | var thumb_class = (typeof options['thumb_class'] != 'undefined' ) ? options['thumb_class'] : ''; |
1401 | 1401 | return '<div class="ui-corner-all ' + thumb_class + '" src="' + my_thumb_src + '" '+ |
1402 | 1402 | 'style="height:' + options.height + 'px;' + |
1403 | | - 'width:' + options.width + 'px" >' + |
| 1403 | + 'width:' + options.width + 'px" >' + |
1404 | 1404 | '<img src="' + my_thumb_src +'" '+ |
1405 | 1405 | 'style="height:' + options.height + 'px;' + |
1406 | 1406 | 'width:' + options.width + 'px">' + |
— | — | @@ -1410,58 +1410,58 @@ |
1411 | 1411 | }, |
1412 | 1412 | updateThumbTime:function( float_sec ){ |
1413 | 1413 | //js_log('updateThumbTime:'+float_sec); |
1414 | | - var _this = this; |
1415 | | - if( typeof this.org_thum_src=='undefined' ){ |
| 1414 | + var _this = this; |
| 1415 | + if( typeof this.org_thum_src=='undefined' ){ |
1416 | 1416 | this.org_thum_src = this.media_element.getThumbnailURL(); |
1417 | | - } |
| 1417 | + } |
1418 | 1418 | if( this.org_thum_src.indexOf('t=') !== -1){ |
1419 | | - this.last_thumb_url = getURLParamReplace(this.org_thum_src, |
1420 | | - { 't' : seconds2npt( float_sec + parseInt(this.start_offset)) } ); |
1421 | | - if(!this.thumbnail_updating){ |
| 1419 | + this.last_thumb_url = getURLParamReplace(this.org_thum_src, |
| 1420 | + { 't' : seconds2npt( float_sec + parseInt(this.start_offset)) } ); |
| 1421 | + if(!this.thumbnail_updating){ |
1422 | 1422 | this.updateThumbnail(this.last_thumb_url ,false); |
1423 | 1423 | this.last_thumb_url =null; |
1424 | 1424 | } |
1425 | 1425 | } |
1426 | 1426 | }, |
1427 | 1427 | //for now provide a src url .. but need to figure out how to copy frames from video for plug-in based thumbs |
1428 | | - updateThumbPerc:function( perc ){ |
| 1428 | + updateThumbPerc:function( perc ){ |
1429 | 1429 | return this.updateThumbTime( (this.getDuration() * perc) ); |
1430 | 1430 | }, |
1431 | 1431 | //updates the thumbnail if the thumbnail is being displayed |
1432 | | - updateThumbnail : function(src, quick_switch){ |
1433 | | - //make sure we don't go to the same url if we are not already updating: |
| 1432 | + updateThumbnail : function(src, quick_switch){ |
| 1433 | + //make sure we don't go to the same url if we are not already updating: |
1434 | 1434 | if( !this.thumbnail_updating && $j('#img_thumb_'+this.id).attr('src')== src ) |
1435 | 1435 | return false; |
1436 | | - //if we are already updating don't issue a new update: |
| 1436 | + //if we are already updating don't issue a new update: |
1437 | 1437 | if( this.thumbnail_updating && $j('#new_img_thumb_'+this.id).attr('src')== src ) |
1438 | 1438 | return false; |
1439 | | - |
| 1439 | + |
1440 | 1440 | js_log('update thumb: ' + src); |
1441 | | - |
| 1441 | + |
1442 | 1442 | if(quick_switch){ |
1443 | 1443 | $j('#img_thumb_'+this.id).attr('src', src); |
1444 | 1444 | }else{ |
1445 | | - var _this = this; |
| 1445 | + var _this = this; |
1446 | 1446 | //if still animating remove new_img_thumb_ |
1447 | 1447 | if(this.thumbnail_updating==true) |
1448 | | - $j('#new_img_thumb_'+this.id).stop().remove(); |
1449 | | - |
| 1448 | + $j('#new_img_thumb_'+this.id).stop().remove(); |
| 1449 | + |
1450 | 1450 | if(this.thumbnail_disp){ |
1451 | 1451 | js_log('set to thumb:'+ src); |
1452 | 1452 | this.thumbnail_updating=true; |
1453 | 1453 | $j('#dc_'+this.id).append('<img src="'+src+'" ' + |
1454 | 1454 | 'style="display:none;position:absolute;zindex:2;top:0px;left:0px;" ' + |
1455 | 1455 | 'width="'+this.width+'" height="'+this.height+'" '+ |
1456 | | - 'id = "new_img_thumb_'+this.id+'" />'); |
1457 | | - //js_log('appended: new_img_thumb_'); |
1458 | | - $j('#new_img_thumb_'+this.id).fadeIn("slow", function(){ |
| 1456 | + 'id = "new_img_thumb_'+this.id+'" />'); |
| 1457 | + //js_log('appended: new_img_thumb_'); |
| 1458 | + $j('#new_img_thumb_'+this.id).fadeIn("slow", function(){ |
1459 | 1459 | //once faded in remove org and rename new: |
1460 | 1460 | $j('#img_thumb_'+_this.id).remove(); |
1461 | 1461 | $j('#new_img_thumb_'+_this.id).attr('id', 'img_thumb_'+_this.id); |
1462 | 1462 | $j('#img_thumb_'+_this.id).css('zindex','1'); |
1463 | | - _this.thumbnail_updating=false; |
| 1463 | + _this.thumbnail_updating=false; |
1464 | 1464 | //js_log("done fadding in "+ $j('#img_thumb_'+_this.id).attr("src")); |
1465 | | - |
| 1465 | + |
1466 | 1466 | //if we have a thumb queued update to that |
1467 | 1467 | if(_this.last_thumb_url){ |
1468 | 1468 | var src_url =_this.last_thumb_url; |
— | — | @@ -1478,7 +1478,7 @@ |
1479 | 1479 | download, and embed code. |
1480 | 1480 | */ |
1481 | 1481 | getThumbnailHTML : function () |
1482 | | - { |
| 1482 | + { |
1483 | 1483 | js_log('embedVideo:getThumbnailHTML::' + this.id); |
1484 | 1484 | var thumb_html = ''; |
1485 | 1485 | var class_atr=''; |
— | — | @@ -1493,10 +1493,10 @@ |
1494 | 1494 | ' overflow:hidden; top:0px; left:0px; width:'+this.playerPixelWidth()+'px; height:'+this.playerPixelHeight()+'px; z-index:0;">'+ |
1495 | 1495 | '<img width="'+this.playerPixelWidth()+'" height="'+this.playerPixelHeight()+'" style="position:relative;width:'+this.playerPixelWidth()+';height:'+this.playerPixelHeight()+'"' + |
1496 | 1496 | ' id="img_thumb_'+this.id+'" src="' + this.thumbnail + '">'; |
1497 | | - |
| 1497 | + |
1498 | 1498 | if(this.play_button == true && this.controls == true) |
1499 | 1499 | thumb_html+=this.getPlayButton(); |
1500 | | - |
| 1500 | + |
1501 | 1501 | thumb_html+='</div>'; |
1502 | 1502 | return thumb_html; |
1503 | 1503 | }, |
— | — | @@ -1538,7 +1538,7 @@ |
1539 | 1539 | }, |
1540 | 1540 | getPlayButton:function(id){ |
1541 | 1541 | if(!id)id=this.id; |
1542 | | - return '<div title="' + gM('play_clip') + '" id="big_play_link_'+id+'" class="large_play_button" '+ |
| 1542 | + return '<div title="' + gM('mwe-play_clip') + '" id="big_play_link_'+id+'" class="large_play_button" '+ |
1543 | 1543 | 'style="left:'+((this.playerPixelWidth()-130)/2)+'px;'+ |
1544 | 1544 | 'top:' + ((this.playerPixelHeight()-96)/2) + 'px;">'+ |
1545 | 1545 | '<img src="' + mv_skin_img_path + 'player_big_play_button.png">'+ |
— | — | @@ -1547,19 +1547,19 @@ |
1548 | 1548 | doLinkBack:function(){ |
1549 | 1549 | if(this.roe && this.media_element.addedROEData==false){ |
1550 | 1550 | var _this = this; |
1551 | | - this.displayHTML(gM('loading_txt')); |
| 1551 | + this.displayHTML(gM('mwe-loading_txt')); |
1552 | 1552 | do_request(this.roe, function(data) |
1553 | 1553 | { |
1554 | | - _this.media_element.addROE(data); |
| 1554 | + _this.media_element.addROE(data); |
1555 | 1555 | _this.doLinkBack(); |
1556 | | - }); |
| 1556 | + }); |
1557 | 1557 | }else{ |
1558 | | - if(this.media_element.linkback){ |
| 1558 | + if(this.media_element.linkback){ |
1559 | 1559 | window.location = this.media_element.linkback; |
1560 | 1560 | }else{ |
1561 | | - this.displayHTML(gM('could_not_find_linkback')); |
| 1561 | + this.displayHTML(gM('mwe-could_not_find_linkback')); |
1562 | 1562 | } |
1563 | | - } |
| 1563 | + } |
1564 | 1564 | }, |
1565 | 1565 | //display the code to remotely embed this video: |
1566 | 1566 | showEmbedCode : function(embed_code){ |
— | — | @@ -1584,42 +1584,42 @@ |
1585 | 1585 | this.displayHTML(o); |
1586 | 1586 | }, |
1587 | 1587 | copyText:function(){ |
1588 | | - $j('#embedding_user_html_'+this.id).focus().select(); |
1589 | | - if(document.selection){ |
1590 | | - CopiedTxt = document.selection.createRange(); |
| 1588 | + $j('#embedding_user_html_'+this.id).focus().select(); |
| 1589 | + if(document.selection){ |
| 1590 | + CopiedTxt = document.selection.createRange(); |
1591 | 1591 | CopiedTxt.execCommand("Copy"); |
1592 | 1592 | } |
1593 | 1593 | }, |
1594 | | - showTextInterface:function(){ |
| 1594 | + showTextInterface:function(){ |
1595 | 1595 | var _this = this; |
1596 | | - //display the text container with loading text: |
| 1596 | + //display the text container with loading text: |
1597 | 1597 | //@@todo support position config |
1598 | | - var loc = $j(this).position(); |
| 1598 | + var loc = $j(this).position(); |
1599 | 1599 | if($j('#metaBox_'+this.id).length==0){ |
1600 | 1600 | $j(this).after('<div class="ui-widget ui-widget-content ui-corner-all" style="position:absolute;z-index:10;'+ |
1601 | 1601 | 'top:' + (loc.top) + 'px;' + |
1602 | 1602 | 'left:' + (parseInt( loc.left ) + parseInt(this.width) + 10 )+'px;' + |
1603 | | - 'height:'+ parseInt( this.height )+'px;width:400px;' + |
| 1603 | + 'height:'+ parseInt( this.height )+'px;width:400px;' + |
1604 | 1604 | 'display:none;" ' + |
1605 | 1605 | 'id="metaBox_' + this.id + '">'+ |
1606 | | - gM('loading_txt') + |
1607 | | - '</div>'); |
| 1606 | + gM('mwe-loading_txt') + |
| 1607 | + '</div>'); |
1608 | 1608 | } |
1609 | 1609 | //fade in the text display |
1610 | | - $j('#metaBox_'+this.id).fadeIn("fast"); |
| 1610 | + $j('#metaBox_'+this.id).fadeIn("fast"); |
1611 | 1611 | //check if textObj present: |
1612 | 1612 | if(typeof this.textInterface == 'undefined' ){ |
1613 | 1613 | //load the default text interface: |
1614 | 1614 | mvJsLoader.doLoad([ |
1615 | | - 'mvTextInterface', |
| 1615 | + 'mvTextInterface', |
1616 | 1616 | '$j.fn.hoverIntent' |
1617 | | - ], function(){ |
1618 | | - _this.textInterface = new mvTextInterface( _this ); |
| 1617 | + ], function(){ |
| 1618 | + _this.textInterface = new mvTextInterface( _this ); |
1619 | 1619 | //show interface |
1620 | 1620 | _this.textInterface.show(); |
1621 | 1621 | js_log("NEW TEXT INTERFACE"); |
1622 | 1622 | for(var i in _this.textInterface.availableTracks){ |
1623 | | - js_log("tracks in new interface: "+_this.id+ ' tid:' + i); |
| 1623 | + js_log("tracks in new interface: "+_this.id+ ' tid:' + i); |
1624 | 1624 | } |
1625 | 1625 | } |
1626 | 1626 | ); |
— | — | @@ -1636,26 +1636,26 @@ |
1637 | 1637 | }, |
1638 | 1638 | /** Generic function to display custom HTML inside the mv_embed element. |
1639 | 1639 | The code should call the closeDisplayedHTML function to close the |
1640 | | - display of the custom HTML and restore the regular mv_embed display. |
| 1640 | + display of the custom HTML and restore the regular mv_embed display. |
1641 | 1641 | @param {String} HTML code for the selection list. |
1642 | 1642 | */ |
1643 | 1643 | displayHTML:function(html_code) |
1644 | 1644 | { |
1645 | 1645 | var sel_id = (this.pc!=null)?this.pc.pp.id:this.id; |
1646 | | - |
| 1646 | + |
1647 | 1647 | if(!this.supports['overlays']) |
1648 | 1648 | this.stop(); |
1649 | | - |
| 1649 | + |
1650 | 1650 | //put select list on-top |
1651 | 1651 | //make sure the parent is relatively positioned: |
1652 | 1652 | $j('#'+sel_id).css('position', 'relative'); |
1653 | 1653 | //set height width (check for playlist container) |
1654 | 1654 | var width = (this.pc)?this.pc.pp.width:this.playerPixelWidth(); |
1655 | 1655 | var height = (this.pc)?this.pc.pp.height:this.playerPixelHeight(); |
1656 | | - |
| 1656 | + |
1657 | 1657 | if(this.pc) |
1658 | 1658 | height+=(this.pc.pp.pl_layout.title_bar_height + this.pc.pp.pl_layout.control_height); |
1659 | | - |
| 1659 | + |
1660 | 1660 | var fade_in = true; |
1661 | 1661 | if($j('#blackbg_'+sel_id).length!=0) |
1662 | 1662 | { |
— | — | @@ -1667,11 +1667,11 @@ |
1668 | 1668 | 'style="height:'+parseInt(height)+'px;width:'+parseInt(width)+'px;">'+ |
1669 | 1669 | '<div class="videoOptionsComplete">'+ |
1670 | 1670 | //@@TODO: this style should go to .css |
1671 | | - '<span style="float:right;margin-right:10px">' + |
| 1671 | + '<span style="float:right;margin-right:10px">' + |
1672 | 1672 | '<a href="#" style="color:white;" onClick="$j(\'#'+sel_id+'\').get(0).closeDisplayedHTML();return false;">close</a>' + |
1673 | 1673 | '</span>'+ |
1674 | 1674 | '<div id="mv_disp_inner_'+sel_id+'" style="padding-top:10px;">'+ |
1675 | | - html_code |
| 1675 | + html_code |
1676 | 1676 | +'</div>'+ |
1677 | 1677 | '</div></div>'; |
1678 | 1678 | $j('#'+sel_id).prepend(div_code); |
— | — | @@ -1691,43 +1691,43 @@ |
1692 | 1692 | }); |
1693 | 1693 | return false; //onclick action return false |
1694 | 1694 | }, |
1695 | | - selectPlaybackMethod:function(){ |
| 1695 | + selectPlaybackMethod:function(){ |
1696 | 1696 | //get id (in case where we have a parent container) |
1697 | 1697 | var this_id = (this.pc!=null)?this.pc.pp.id:this.id; |
1698 | | - |
1699 | | - var _this=this; |
| 1698 | + |
| 1699 | + var _this=this; |
1700 | 1700 | var out= '<span style="color:#FFF;background-color:black;"><blockquote style="background-color:black;">'; |
1701 | 1701 | var _this=this; |
1702 | 1702 | //js_log('selected src'+ _this.media_element.selected_source.url); |
1703 | | - $j.each( this.media_element.getPlayableSources(), function(source_id, source){ |
1704 | | - var default_player = embedTypes.players.defaultPlayer( source.getMIMEType() ); |
1705 | | - |
| 1703 | + $j.each( this.media_element.getPlayableSources(), function(source_id, source){ |
| 1704 | + var default_player = embedTypes.players.defaultPlayer( source.getMIMEType() ); |
| 1705 | + |
1706 | 1706 | var is_selected = (source == _this.media_element.selected_source); |
1707 | 1707 | var image_src = mv_skin_img_path ; |
1708 | | - |
1709 | | - //set the Playable source type: |
| 1708 | + |
| 1709 | + //set the Playable source type: |
1710 | 1710 | if( source.mime_type == 'video/x-flv' ){ |
1711 | 1711 | image_src += 'flash_icon_'; |
1712 | 1712 | }else if( source.mime_type == 'video/h264'){ |
1713 | | - //for now all mp4 content is pulled from archive.org (so use archive.org icon) |
| 1713 | + //for now all mp4 content is pulled from archive.org (so use archive.org icon) |
1714 | 1714 | image_src += 'archive_org_'; |
1715 | 1715 | }else{ |
1716 | 1716 | image_src += 'fish_xiph_org_'; |
1717 | 1717 | } |
1718 | 1718 | image_src += is_selected ? 'color':'bw'; |
1719 | | - image_src += '.png'; |
1720 | | - |
| 1719 | + image_src += '.png'; |
| 1720 | + |
1721 | 1721 | if (default_player) |
1722 | 1722 | { |
1723 | 1723 | out += '<img src="'+image_src+'"/>'; |
1724 | 1724 | if( ! is_selected ) |
1725 | 1725 | out+='<a href="#" class="sel_source" id="sc_' + source_id + '_' + default_player.id +'">'; |
1726 | 1726 | out += source.getTitle()+ (is_selected?'</a>':'') + ' '; |
1727 | | - |
1728 | | - //output the player select code: |
1729 | | - var supporting_players = embedTypes.players.getMIMETypePlayers( source.getMIMEType() ); |
| 1727 | + |
| 1728 | + //output the player select code: |
| 1729 | + var supporting_players = embedTypes.players.getMIMETypePlayers( source.getMIMEType() ); |
1730 | 1730 | out+='<div id="player_select_list_' + source_id + '" class="player_select_list"><ul>'; |
1731 | | - for(var i=0; i < supporting_players.length ; i++){ |
| 1731 | + for(var i=0; i < supporting_players.length ; i++){ |
1732 | 1732 | if( _this.selected_player.id == supporting_players[i].id && is_selected ){ |
1733 | 1733 | out+='<li style="border-style:dashed;margin-left:20px;">'+ |
1734 | 1734 | '<img border="0" width="16" height="16" src="' + mv_skin_img_path + 'plugin.png">' + |
— | — | @@ -1743,60 +1743,60 @@ |
1744 | 1744 | '</li>'; |
1745 | 1745 | } |
1746 | 1746 | } |
1747 | | - out+='</ul></div>'; |
| 1747 | + out+='</ul></div>'; |
1748 | 1748 | }else |
1749 | 1749 | out+= source.getTitle() + ' - no player available'; |
1750 | 1750 | }); |
1751 | 1751 | out+='</blockquote></span>'; |
1752 | 1752 | this.displayHTML(out); |
1753 | | - |
| 1753 | + |
1754 | 1754 | //set up the click bindings: |
1755 | 1755 | $j('.sel_source').each(function(){ |
1756 | 1756 | $j(this).click(function(){ |
1757 | 1757 | var iparts = $j(this).attr( 'id' ).replace(/sc_/,'').split('_'); |
1758 | 1758 | var source_id = iparts[0]; |
1759 | 1759 | var default_player_id = iparts[1]; |
1760 | | - js_log('source id: ' + source_id + ' player id: ' + default_player_id); |
1761 | | - |
1762 | | - $j('#' + this_id ).get(0).closeDisplayedHTML(); |
| 1760 | + js_log('source id: ' + source_id + ' player id: ' + default_player_id); |
| 1761 | + |
| 1762 | + $j('#' + this_id ).get(0).closeDisplayedHTML(); |
1763 | 1763 | $j('#' + _this.id ).get(0).media_element.selectSource( source_id ); |
1764 | | - |
| 1764 | + |
1765 | 1765 | embedTypes.players.userSelectPlayer( default_player_id, |
1766 | 1766 | _this.media_element.sources[ source_id ].getMIMEType() ); |
1767 | | - |
| 1767 | + |
1768 | 1768 | //be sure to issue a stop |
1769 | 1769 | $j('#' + this_id ).get(0).stop(); |
1770 | | - |
| 1770 | + |
1771 | 1771 | //don't follow the empty # link: |
1772 | 1772 | return false; |
1773 | 1773 | }); |
1774 | 1774 | }); |
1775 | | - }, |
1776 | | - showVideoDownload:function(){ |
| 1775 | + }, |
| 1776 | + showVideoDownload:function(){ |
1777 | 1777 | //load the roe if available (to populate out download options: |
1778 | 1778 | //js_log('f:showVideoDownload '+ this.roe + ' ' + this.media_element.addedROEData); |
1779 | 1779 | if(this.roe && this.media_element.addedROEData == false){ |
1780 | 1780 | var _this = this; |
1781 | | - this.displayHTML(gM('loading_txt')); |
| 1781 | + this.displayHTML(gM('mwe-loading_txt')); |
1782 | 1782 | do_request(this.roe, function(data) |
1783 | 1783 | { |
1784 | | - _this.media_element.addROE(data); |
| 1784 | + _this.media_element.addROE(data); |
1785 | 1785 | $j('#mv_disp_inner_'+_this.id).html( _this.getShowVideoDownload() ); |
1786 | | - }); |
| 1786 | + }); |
1787 | 1787 | }else{ |
1788 | 1788 | this.displayHTML( this.getShowVideoDownload() ); |
1789 | | - } |
| 1789 | + } |
1790 | 1790 | }, |
1791 | | - getShowVideoDownload:function(){ |
| 1791 | + getShowVideoDownload:function(){ |
1792 | 1792 | var out='<div style="color:white">' + |
1793 | | - '<b style="color:white;">'+gM('download_segment')+'</b><br>'; |
| 1793 | + '<b style="color:white;">'+gM('mwe-download_segment')+'</b><br>'; |
1794 | 1794 | out+='<blockquote style="background:#000">'+ |
1795 | | - gM('download_right_click') + '</blockquote><br>'; |
| 1795 | + gM('mwe-download_right_click') + '</blockquote><br>'; |
1796 | 1796 | var dl_list=''; |
1797 | | - var dl_txt_list=''; |
| 1797 | + var dl_txt_list=''; |
1798 | 1798 | $j.each(this.media_element.getSources(), function(index, source){ |
1799 | 1799 | var dl_line = '<li>' + '<a style="color:white" href="' + source.getURI() +'"> ' |
1800 | | - + source.getTitle()+'</a> '+ '</li>'+"\n"; |
| 1800 | + + source.getTitle()+'</a> '+ '</li>'+"\n"; |
1801 | 1801 | if( source.getURI().indexOf('?t=')!==-1){ |
1802 | 1802 | out+=dl_line; |
1803 | 1803 | }else if( this.getMIMEType()=="text/cmml" || this.getMIMEType()=="text/x-srt" ){ |
— | — | @@ -1804,12 +1804,12 @@ |
1805 | 1805 | }else{ |
1806 | 1806 | dl_list+=dl_line; |
1807 | 1807 | } |
1808 | | - }); |
1809 | | - |
| 1808 | + }); |
| 1809 | + |
1810 | 1810 | if(dl_list!='') |
1811 | | - out+=gM('download_full') + '<blockquote style="background:#000">' + dl_list + '</blockquote>'; |
| 1811 | + out+=gM('mwe-download_full') + '<blockquote style="background:#000">' + dl_list + '</blockquote>'; |
1812 | 1812 | if(dl_txt_list!='') |
1813 | | - out+=gM('download_text')+'<blockquote style="background:#000">' + dl_txt_list +'</blockquote>'; |
| 1813 | + out+=gM('mwe-download_text')+'<blockquote style="background:#000">' + dl_txt_list +'</blockquote>'; |
1814 | 1814 | out+='</div>'; |
1815 | 1815 | return out; |
1816 | 1816 | }, |
— | — | @@ -1819,11 +1819,11 @@ |
1820 | 1820 | */ |
1821 | 1821 | play:function(){ |
1822 | 1822 | var this_id = (this.pc!=null)?this.pc.pp.id:this.id; |
1823 | | - |
1824 | | - //js_log( "mv_embed play:" + this.id); |
| 1823 | + |
| 1824 | + //js_log( "mv_embed play:" + this.id); |
1825 | 1825 | //js_log('thum disp:'+this.thumbnail_disp); |
1826 | 1826 | //check if thumbnail is being displayed and embed html |
1827 | | - if( this.thumbnail_disp ){ |
| 1827 | + if( this.thumbnail_disp ){ |
1828 | 1828 | if( !this.selected_player ){ |
1829 | 1829 | js_log('no selected_player'); |
1830 | 1830 | //this.innerHTML = this.getPluginMissingHTML(); |
— | — | @@ -1831,21 +1831,21 @@ |
1832 | 1832 | $j('#'+this.id).html( this.getPluginMissingHTML() ); |
1833 | 1833 | }else{ |
1834 | 1834 | this.doEmbedHTML(); |
1835 | | - this.onClipDone_disp=false; |
1836 | | - this.paused=false; |
1837 | | - this.thumbnail_disp=false; |
| 1835 | + this.onClipDone_disp=false; |
| 1836 | + this.paused=false; |
| 1837 | + this.thumbnail_disp=false; |
1838 | 1838 | } |
1839 | 1839 | }else{ |
1840 | | - //the plugin is already being displayed |
| 1840 | + //the plugin is already being displayed |
1841 | 1841 | this.paused=false; //make sure we are not "paused" |
1842 | 1842 | this.seeking=false; |
1843 | | - } |
1844 | | - |
1845 | | - $j("#mv_play_pause_button_" + this_id + ' span').removeClass('ui-icon-play').addClass('ui-icon-pause'); |
1846 | | - $j("#mv_play_pause_button_" + this_id).unbind().btnBind().click(function(){ |
| 1843 | + } |
| 1844 | + |
| 1845 | + $j("#mv_play_pause_button_" + this_id + ' span').removeClass('ui-icon-play').addClass('ui-icon-pause'); |
| 1846 | + $j("#mv_play_pause_button_" + this_id).unbind().btnBind().click(function(){ |
1847 | 1847 | $j('#' + this_id ).get(0).pause(); |
1848 | | - }).attr('title', gM('pause_clip')); |
1849 | | - |
| 1848 | + }).attr('title', gM('mwe-pause_clip')); |
| 1849 | + |
1850 | 1850 | }, |
1851 | 1851 | load:function(){ |
1852 | 1852 | //should be done by child (no base way to load assets) |
— | — | @@ -1853,41 +1853,41 @@ |
1854 | 1854 | }, |
1855 | 1855 | getSrc:function(){ |
1856 | 1856 | return this.media_element.selected_source.getURI( this.seek_time_sec ); |
1857 | | - }, |
| 1857 | + }, |
1858 | 1858 | /* |
1859 | 1859 | * base embed pause |
1860 | 1860 | * there is no general way to pause the video |
1861 | 1861 | * must be overwritten by embed object to support this functionality. |
1862 | 1862 | */ |
1863 | 1863 | pause: function(){ |
1864 | | - var this_id = (this.pc!=null)?this.pc.pp.id:this.id; |
1865 | | - //js_log('mv_embed:do pause'); |
1866 | | - //(playing) do pause |
1867 | | - this.paused = true; |
1868 | | - //update the ctrl "paused state" |
| 1864 | + var this_id = (this.pc!=null)?this.pc.pp.id:this.id; |
| 1865 | + //js_log('mv_embed:do pause'); |
| 1866 | + //(playing) do pause |
| 1867 | + this.paused = true; |
| 1868 | + //update the ctrl "paused state" |
1869 | 1869 | $j("#mv_play_pause_button_" + this_id + ' span').removeClass('ui-icon-pause').addClass('ui-icon-play'); |
1870 | | - $j("#mv_play_pause_button_" + this_id).unbind().btnBind().click(function(){ |
| 1870 | + $j("#mv_play_pause_button_" + this_id).unbind().btnBind().click(function(){ |
1871 | 1871 | $j('#'+this_id).get(0).play(); |
1872 | | - }).attr('title', gM('play_clip')); |
1873 | | - }, |
| 1872 | + }).attr('title', gM('mwe-play_clip')); |
| 1873 | + }, |
1874 | 1874 | /* |
1875 | 1875 | * base embed stop (can be overwritten by the plugin) |
1876 | 1876 | */ |
1877 | 1877 | stop: function(){ |
1878 | 1878 | var _this = this; |
1879 | 1879 | js_log('mvEmbed:stop:'+this.id); |
1880 | | - |
| 1880 | + |
1881 | 1881 | //no longer seeking: |
1882 | 1882 | this.didSeekJump=false; |
1883 | | - |
1884 | | - //first issue pause to update interface (only call the parent) |
| 1883 | + |
| 1884 | + //first issue pause to update interface (only call the parent) |
1885 | 1885 | if(this['parent_pause']){ |
1886 | 1886 | this.parent_pause(); |
1887 | 1887 | }else{ |
1888 | 1888 | this.pause(); |
1889 | | - } |
1890 | | - |
1891 | | - //reset the currentTime: |
| 1889 | + } |
| 1890 | + |
| 1891 | + //reset the currentTime: |
1892 | 1892 | this.currentTime=0; |
1893 | 1893 | //check if thumbnail is being displayed in which case do nothing |
1894 | 1894 | if( this.thumbnail_disp ){ |
— | — | @@ -1900,12 +1900,12 @@ |
1901 | 1901 | this.setSliderValue(0); |
1902 | 1902 | this.setStatus( this.getTimeReq() ); |
1903 | 1903 | } |
1904 | | - |
1905 | | - //make sure the big playbutton is has click action: |
| 1904 | + |
| 1905 | + //make sure the big playbutton is has click action: |
1906 | 1906 | $j('#big_play_link_' + _this.id).unbind('click').click(function(){ |
1907 | 1907 | $j('#' +_this.id).get(0).play(); |
1908 | 1908 | }); |
1909 | | - |
| 1909 | + |
1910 | 1910 | if(this.update_interval) |
1911 | 1911 | { |
1912 | 1912 | clearInterval(this.update_interval); |
— | — | @@ -1913,19 +1913,19 @@ |
1914 | 1914 | } |
1915 | 1915 | }, |
1916 | 1916 | toggleMute:function(){ |
1917 | | - var this_id = (this.pc!=null)?this.pc.pp.id:this.id; |
| 1917 | + var this_id = (this.pc!=null)?this.pc.pp.id:this.id; |
1918 | 1918 | if(this.muted){ |
1919 | 1919 | this.muted=false; |
1920 | 1920 | $j('#volume_control_'+this_id + ' span').removeClass('ui-icon-volume-off').addClass('ui-icon-volume-on'); |
1921 | | - $j('#volume_bar_'+this_id).slider('value', 100); |
| 1921 | + $j('#volume_bar_'+this_id).slider('value', 100); |
1922 | 1922 | this.updateVolumen(1); |
1923 | 1923 | }else{ |
1924 | 1924 | this.muted=true; |
1925 | 1925 | $j('#volume_control_'+this_id + ' span').removeClass('ui-icon-volume-on').addClass('ui-icon-volume-off'); |
1926 | 1926 | $j('#volume_bar_'+this_id).slider('value', 0); |
1927 | | - this.updateVolumen(0); |
| 1927 | + this.updateVolumen(0); |
1928 | 1928 | } |
1929 | | - js_log('f:toggleMute::' + this.muted); |
| 1929 | + js_log('f:toggleMute::' + this.muted); |
1930 | 1930 | }, |
1931 | 1931 | updateVolumen:function(perc){ |
1932 | 1932 | js_log('update volume not supported with current playback type'); |
— | — | @@ -1959,19 +1959,19 @@ |
1960 | 1960 | postEmbedJS:function(){ |
1961 | 1961 | return ''; |
1962 | 1962 | }, |
1963 | | - //do common monitor code like update the playhead and play status |
| 1963 | + //do common monitor code like update the playhead and play status |
1964 | 1964 | //plugin objects are responsible for updating currentTime |
1965 | 1965 | monitor:function(){ |
1966 | 1966 | if( this.currentTime && this.currentTime > 0 && this.duration){ |
1967 | 1967 | if( !this.userSlide ){ |
1968 | | - if( this.start_offset ){ |
1969 | | - //if start offset include that calculation |
1970 | | - this.setSliderValue( ( this.currentTime - this.start_offset ) / this.duration ); |
1971 | | - this.setStatus( seconds2npt(this.currentTime) + '/'+ seconds2npt(parseFloat(this.start_offset)+parseFloat(this.duration) )); |
| 1968 | + if( this.start_offset ){ |
| 1969 | + //if start offset include that calculation |
| 1970 | + this.setSliderValue( ( this.currentTime - this.start_offset ) / this.duration ); |
| 1971 | + this.setStatus( seconds2npt(this.currentTime) + '/'+ seconds2npt(parseFloat(this.start_offset)+parseFloat(this.duration) )); |
1972 | 1972 | }else{ |
1973 | 1973 | this.setSliderValue( this.currentTime / this.duration ); |
1974 | 1974 | this.setStatus( seconds2npt(this.currentTime) + '/' + seconds2npt(this.duration )); |
1975 | | - } |
| 1975 | + } |
1976 | 1976 | } |
1977 | 1977 | }else{ |
1978 | 1978 | //js_log(' ct:' + this.currentTime + ' dur: ' + this.duration); |
— | — | @@ -1980,25 +1980,25 @@ |
1981 | 1981 | }else if( this.isPaused() ){ |
1982 | 1982 | this.setStatus( "paused" ); |
1983 | 1983 | }else if( this.isPlaying() ){ |
1984 | | - if( this.currentTime && ! this.duration ) |
| 1984 | + if( this.currentTime && ! this.duration ) |
1985 | 1985 | this.setStatus( seconds2npt( this.currentTime ) + ' /' ); |
1986 | | - else |
| 1986 | + else |
1987 | 1987 | this.setStatus(" - - - "); |
1988 | 1988 | }else{ |
1989 | 1989 | this.setStatus( this.getTimeReq() ); |
1990 | | - } |
| 1990 | + } |
1991 | 1991 | } |
1992 | | - //update buffer information |
| 1992 | + //update buffer information |
1993 | 1993 | this.updateBufferStatus(); |
1994 | | - |
| 1994 | + |
1995 | 1995 | //update monitorTimerId to call child monitor |
1996 | 1996 | if( ! this.monitorTimerId ){ |
1997 | | - //make sure an instance of this.id exists: |
| 1997 | + //make sure an instance of this.id exists: |
1998 | 1998 | if( document.getElementById(this.id) ){ |
1999 | 1999 | this.monitorTimerId = setInterval('$j(\'#'+this.id+'\').get(0).monitor()', 250); |
2000 | 2000 | } |
2001 | 2001 | } |
2002 | | - }, |
| 2002 | + }, |
2003 | 2003 | stopMonitor:function(){ |
2004 | 2004 | if( this.monitorTimerId != 0 ) |
2005 | 2005 | { |
— | — | @@ -2007,18 +2007,18 @@ |
2008 | 2008 | } |
2009 | 2009 | }, |
2010 | 2010 | updateBufferStatus: function(){ |
2011 | | - |
2012 | | - //build the buffer targeet based for playlist vs clip |
2013 | | - var buffer_select = (this.pc) ? |
2014 | | - '#cl_status_' + this.id + ' .mv_buffer': |
| 2011 | + |
| 2012 | + //build the buffer targeet based for playlist vs clip |
| 2013 | + var buffer_select = (this.pc) ? |
| 2014 | + '#cl_status_' + this.id + ' .mv_buffer': |
2015 | 2015 | '#mv_play_head_' + this.id + ' .mv_buffer'; |
2016 | | - |
| 2016 | + |
2017 | 2017 | //update the buffer progress bar (if available ) |
2018 | 2018 | if( this.bufferedPercent != 0 ){ |
2019 | | - //js_log('bufferedPercent: ' + this.bufferedPercent); |
| 2019 | + //js_log('bufferedPercent: ' + this.bufferedPercent); |
2020 | 2020 | if(this.bufferedPercent > 1) |
2021 | | - this.bufferedPercent=1; |
2022 | | - |
| 2021 | + this.bufferedPercent=1; |
| 2022 | + |
2023 | 2023 | $j(buffer_select).css("width", (this.bufferedPercent*100) +'%' ); |
2024 | 2024 | }else{ |
2025 | 2025 | $j(buffer_select).css("width", '0px' ); |
— | — | @@ -2028,7 +2028,7 @@ |
2029 | 2029 | if(!this.start_offset) |
2030 | 2030 | this.start_offset =0; |
2031 | 2031 | var rt = this.currentTime - this.start_offset; |
2032 | | - if( rt < 0 ) //should not happen but does. |
| 2032 | + if( rt < 0 ) //should not happen but does. |
2033 | 2033 | return 0; |
2034 | 2034 | return rt; |
2035 | 2035 | }, |
— | — | @@ -2044,7 +2044,7 @@ |
2045 | 2045 | } |
2046 | 2046 | return null; |
2047 | 2047 | }, |
2048 | | - //HELPER Functions for selected source |
| 2048 | + //HELPER Functions for selected source |
2049 | 2049 | /* |
2050 | 2050 | * returns the selected source url for players to play |
2051 | 2051 | */ |
— | — | @@ -2055,12 +2055,12 @@ |
2056 | 2056 | //do head request if on the same domain |
2057 | 2057 | return this.media_element.selected_source.URLTimeEncoding; |
2058 | 2058 | }, |
2059 | | - setSliderValue: function(perc, hide_progress){ |
2060 | | - if(this.controls){ |
| 2059 | + setSliderValue: function(perc, hide_progress){ |
| 2060 | + if(this.controls){ |
2061 | 2061 | var this_id = (this.pc)?this.pc.pp.id:this.id; |
2062 | | - var val = parseInt( perc*1000 ); |
| 2062 | + var val = parseInt( perc*1000 ); |
2063 | 2063 | $j('#mv_play_head_'+this_id).slider('value', val); |
2064 | | - |
| 2064 | + |
2065 | 2065 | //js_log("embed video set: " + '#mv_play_head_'+this_id + ' to ' + val); |
2066 | 2066 | } |
2067 | 2067 | //js_log('set#mv_seeker_slider_'+this_id + ' perc in: ' + perc + ' * ' + $j('#mv_seeker_'+this_id).width() + ' = set to: '+ val + ' - '+ Math.round(this.mv_seeker_width*perc) ); |
— | — | @@ -2070,44 +2070,44 @@ |
2071 | 2071 | js_log('highlightPlaySection'); |
2072 | 2072 | var this_id = (this.pc)?this.pc.pp.id:this.id; |
2073 | 2073 | var dur = this.getDuration(); |
2074 | | - var hide_progress = true; |
2075 | | - //set the left percet and update the slider: |
| 2074 | + var hide_progress = true; |
| 2075 | + //set the left percet and update the slider: |
2076 | 2076 | rel_start_sec = npt2seconds( options['start']); |
2077 | | - //remove the start_offset if relevent: |
| 2077 | + //remove the start_offset if relevent: |
2078 | 2078 | if(this.start_offset) |
2079 | 2079 | rel_start_sec = rel_start_sec - this.start_offset |
2080 | | - |
| 2080 | + |
2081 | 2081 | var slider_perc=0; |
2082 | 2082 | if( rel_start_sec <= 0 ){ |
2083 | | - left_perc =0; |
| 2083 | + left_perc =0; |
2084 | 2084 | options['start'] = seconds2npt( this.start_offset ); |
2085 | | - rel_start_sec=0; |
| 2085 | + rel_start_sec=0; |
2086 | 2086 | this.setSliderValue( 0 , hide_progress); |
2087 | 2087 | }else{ |
2088 | | - left_perc = parseInt( (rel_start_sec / dur)*100 ) ; |
| 2088 | + left_perc = parseInt( (rel_start_sec / dur)*100 ) ; |
2089 | 2089 | slider_perc = (left_perc / 100); |
2090 | | - } |
2091 | | - js_log("slider perc:" + slider_perc); |
| 2090 | + } |
| 2091 | + js_log("slider perc:" + slider_perc); |
2092 | 2092 | if( ! this.isPlaying() ){ |
2093 | | - this.setSliderValue( slider_perc , hide_progress); |
| 2093 | + this.setSliderValue( slider_perc , hide_progress); |
2094 | 2094 | } |
2095 | | - |
2096 | | - width_perc = parseInt( (( npt2seconds( options['end'] ) - npt2seconds( options['start'] ) ) / dur)*100 ) ; |
| 2095 | + |
| 2096 | + width_perc = parseInt( (( npt2seconds( options['end'] ) - npt2seconds( options['start'] ) ) / dur)*100 ) ; |
2097 | 2097 | if( (width_perc + left_perc) > 100 ){ |
2098 | | - width_perc = 100 - left_perc; |
2099 | | - } |
2100 | | - //js_log('should hl: '+rel_start_sec+ '/' + dur + ' re:' + rel_end_sec+' lp:' + left_perc + ' width: ' + width_perc); |
| 2098 | + width_perc = 100 - left_perc; |
| 2099 | + } |
| 2100 | + //js_log('should hl: '+rel_start_sec+ '/' + dur + ' re:' + rel_end_sec+' lp:' + left_perc + ' width: ' + width_perc); |
2101 | 2101 | $j('#mv_seeker_' + this_id + ' .mv_highlight').css({ |
2102 | 2102 | 'left':left_perc+'%', |
2103 | | - 'width':width_perc+'%' |
2104 | | - }).show(); |
2105 | | - |
| 2103 | + 'width':width_perc+'%' |
| 2104 | + }).show(); |
| 2105 | + |
2106 | 2106 | this.jump_time = options['start']; |
2107 | 2107 | this.seek_time_sec = npt2seconds( options['start']); |
2108 | | - //trim output to |
2109 | | - this.setStatus( gM('seek_to')+' '+ seconds2npt( this.seek_time_sec ) ); |
| 2108 | + //trim output to |
| 2109 | + this.setStatus( gM('mwe-seek_to')+' '+ seconds2npt( this.seek_time_sec ) ); |
2110 | 2110 | js_log('DO update: ' + this.jump_time); |
2111 | | - this.updateThumbTime( rel_start_sec ); |
| 2111 | + this.updateThumbTime( rel_start_sec ); |
2112 | 2112 | }, |
2113 | 2113 | hideHighlight:function(){ |
2114 | 2114 | var this_id = (this.pc)?this.pc.pp.id:this.id; |
— | — | @@ -2119,7 +2119,7 @@ |
2120 | 2120 | var id = (this.pc)?this.pc.pp.id:this.id; |
2121 | 2121 | //update status: |
2122 | 2122 | $j('#mv_time_'+id).html(value); |
2123 | | - } |
| 2123 | + } |
2124 | 2124 | } |
2125 | 2125 | |
2126 | 2126 | |
— | — | @@ -2146,9 +2146,9 @@ |
2147 | 2147 | supported_types:null, |
2148 | 2148 | library:null, |
2149 | 2149 | loaded:false, |
2150 | | - loading_callbacks:null, |
| 2150 | + loading_callbacks:null, |
2151 | 2151 | supportsMIMEType : function(type) |
2152 | | - { |
| 2152 | + { |
2153 | 2153 | for (var i=0; i < this.supported_types.length; i++) |
2154 | 2154 | if(this.supported_types[i] == type) |
2155 | 2155 | return true; |
— | — | @@ -2156,7 +2156,7 @@ |
2157 | 2157 | }, |
2158 | 2158 | getName : function() |
2159 | 2159 | { |
2160 | | - return gM('mv_ogg-player-' + this.id); |
| 2160 | + return gM('mwe-ogg-player-' + this.id); |
2161 | 2161 | }, |
2162 | 2162 | load : function(callback){ |
2163 | 2163 | var libName = this.library+'Embed'; |
— | — | @@ -2164,17 +2164,17 @@ |
2165 | 2165 | js_log('plugin loaded, do callback:'); |
2166 | 2166 | callback(); |
2167 | 2167 | }else{ |
2168 | | - var _this = this; |
2169 | | - //jQuery based get script does not work so well. |
2170 | | - mvJsLoader.doLoad([ |
| 2168 | + var _this = this; |
| 2169 | + //jQuery based get script does not work so well. |
| 2170 | + mvJsLoader.doLoad([ |
2171 | 2171 | libName |
2172 | 2172 | ],function(){ |
2173 | | - callback(); |
| 2173 | + callback(); |
2174 | 2174 | }); |
2175 | 2175 | } |
2176 | | - } |
| 2176 | + } |
2177 | 2177 | } |
2178 | | -/* players and supported mime types |
| 2178 | +/* players and supported mime types |
2179 | 2179 | @@todo ideally we query the plugin to get what mime types it supports in practice not always reliable/avaliable |
2180 | 2180 | */ |
2181 | 2181 | var flowPlayer = new mediaPlayer('flowplayer',['video/x-flv', 'video/h264'],'flash'); |
— | — | @@ -2191,7 +2191,7 @@ |
2192 | 2192 | //add generic |
2193 | 2193 | var oggPluginPlayer = new mediaPlayer('oggPlugin',['video/ogg'],'generic'); |
2194 | 2194 | |
2195 | | -//depricate quicktime in favor of safari native |
| 2195 | +//depricate quicktime in favor of safari native |
2196 | 2196 | //var quicktimeMozillaPlayer = new mediaPlayer('quicktime-mozilla',['video/ogg'],'quicktime'); |
2197 | 2197 | //var quicktimeActiveXPlayer = new mediaPlayer('quicktime-activex',['video/ogg'],'quicktime'); |
2198 | 2198 | |
— | — | @@ -2216,24 +2216,24 @@ |
2217 | 2217 | { |
2218 | 2218 | this.players = new Array(); |
2219 | 2219 | this.loadPreferences(); |
2220 | | - |
2221 | | - //set up default players order for each library type |
| 2220 | + |
| 2221 | + //set up default players order for each library type |
2222 | 2222 | this.default_players['video/x-flv'] = ['flash','vlc']; |
2223 | 2223 | this.default_players['video/h264'] = ['flash', 'vlc']; |
2224 | | - |
2225 | | - this.default_players['video/ogg'] = ['native','vlc','java', 'generic']; |
2226 | | - this.default_players['application/ogg'] = ['native','vlc','java', 'generic']; |
2227 | | - this.default_players['audio/ogg'] = ['native','vlc', 'java', 'omtk' ]; |
| 2224 | + |
| 2225 | + this.default_players['video/ogg'] = ['native','vlc','java', 'generic']; |
| 2226 | + this.default_players['application/ogg'] = ['native','vlc','java', 'generic']; |
| 2227 | + this.default_players['audio/ogg'] = ['native','vlc', 'java', 'omtk' ]; |
2228 | 2228 | this.default_players['video/mp4'] = ['vlc']; |
2229 | | - |
| 2229 | + |
2230 | 2230 | this.default_players['text/html'] = ['html']; |
2231 | 2231 | this.default_players['image/jpeg'] = ['html']; |
2232 | 2232 | this.default_players['image/png'] = ['html']; |
2233 | 2233 | this.default_players['image/svg'] = ['html']; |
2234 | | - |
| 2234 | + |
2235 | 2235 | }, |
2236 | 2236 | addPlayer : function(player, mime_type) |
2237 | | - { |
| 2237 | + { |
2238 | 2238 | //js_log('Adding ' + player.id + ' with mime_type ' + mime_type); |
2239 | 2239 | for (var i =0; i < this.players.length; i++){ |
2240 | 2240 | if (this.players[i].id == player.id) |
— | — | @@ -2241,52 +2241,52 @@ |
2242 | 2242 | if(mime_type!=null) |
2243 | 2243 | { |
2244 | 2244 | //make sure the mime_type is not already there: |
2245 | | - var add_mime = true; |
| 2245 | + var add_mime = true; |
2246 | 2246 | for(var j=0; j < this.players[i].supported_types.length; j++ ){ |
2247 | 2247 | if( this.players[i].supported_types[j]== mime_type) |
2248 | 2248 | add_mime=false; |
2249 | | - } |
| 2249 | + } |
2250 | 2250 | if(add_mime) |
2251 | 2251 | this.players[i].supported_types.push(mime_type); |
2252 | 2252 | } |
2253 | 2253 | return; |
2254 | 2254 | } |
2255 | 2255 | } |
2256 | | - //player not found: |
| 2256 | + //player not found: |
2257 | 2257 | if(mime_type!=null) |
2258 | | - player.supported_types.push(mime_type); |
2259 | | - |
| 2258 | + player.supported_types.push(mime_type); |
| 2259 | + |
2260 | 2260 | this.players.push( player ); |
2261 | 2261 | }, |
2262 | 2262 | getMIMETypePlayers : function(mime_type) |
2263 | | - { |
| 2263 | + { |
2264 | 2264 | var mime_players = new Array(); |
2265 | 2265 | var _this = this; |
2266 | 2266 | var inx = 0; |
2267 | | - if( this.default_players[mime_type] ){ |
2268 | | - $j.each( this.default_players[mime_type], function(d, lib){ |
2269 | | - var library = _this.default_players[mime_type][d]; |
2270 | | - for ( var i=0; i < _this.players.length; i++ ){ |
| 2267 | + if( this.default_players[mime_type] ){ |
| 2268 | + $j.each( this.default_players[mime_type], function(d, lib){ |
| 2269 | + var library = _this.default_players[mime_type][d]; |
| 2270 | + for ( var i=0; i < _this.players.length; i++ ){ |
2271 | 2271 | if ( _this.players[i].library == library && _this.players[i].supportsMIMEType(mime_type) ){ |
2272 | | - mime_players[ inx ] = _this.players[i]; |
| 2272 | + mime_players[ inx ] = _this.players[i]; |
2273 | 2273 | inx++; |
2274 | 2274 | } |
2275 | 2275 | } |
2276 | 2276 | }); |
2277 | | - } |
| 2277 | + } |
2278 | 2278 | return mime_players; |
2279 | 2279 | }, |
2280 | 2280 | defaultPlayer : function(mime_type) |
2281 | | - { |
2282 | | - js_log("get defaultPlayer for " + mime_type); |
2283 | | - var mime_players = this.getMIMETypePlayers(mime_type); |
| 2281 | + { |
| 2282 | + js_log("get defaultPlayer for " + mime_type); |
| 2283 | + var mime_players = this.getMIMETypePlayers(mime_type); |
2284 | 2284 | if( mime_players.length > 0) |
2285 | 2285 | { |
2286 | 2286 | // check for prior preference for this mime type |
2287 | 2287 | for( var i=0; i < mime_players.length; i++ ){ |
2288 | 2288 | if( mime_players[i].id==this.preference[mime_type] ) |
2289 | 2289 | return mime_players[i]; |
2290 | | - } |
| 2290 | + } |
2291 | 2291 | // otherwise just return the first compatible player |
2292 | 2292 | // (it will be chosen according to the default_players list |
2293 | 2293 | return mime_players[0]; |
— | — | @@ -2326,7 +2326,7 @@ |
2327 | 2327 | }, |
2328 | 2328 | loadPreferences : function() |
2329 | 2329 | { |
2330 | | - this.preference = new Object(); |
| 2330 | + this.preference = new Object(); |
2331 | 2331 | // see if we have a cookie set to a clientSupported type: |
2332 | 2332 | var cookieVal = $j.cookie( 'ogg_player_exp' ); |
2333 | 2333 | if (cookieVal) |
— | — | @@ -2342,11 +2342,11 @@ |
2343 | 2343 | }, |
2344 | 2344 | savePreferences : function() |
2345 | 2345 | { |
2346 | | - var cookieVal = ''; |
| 2346 | + var cookieVal = ''; |
2347 | 2347 | for(var i in this.preference) |
2348 | 2348 | cookieVal+= i + '='+ this.preference[i] + '&'; |
2349 | | - |
2350 | | - cookieVal=cookieVal.substr(0, cookieVal.length-1); |
| 2349 | + |
| 2350 | + cookieVal=cookieVal.substr(0, cookieVal.length-1); |
2351 | 2351 | var week = 7*86400*1000; |
2352 | 2352 | $j.cookie( 'ogg_player_exp', cookieVal, { 'expires':week } ); |
2353 | 2353 | } |
— | — | @@ -2360,7 +2360,7 @@ |
2361 | 2361 | var embedTypes = { |
2362 | 2362 | // List of players |
2363 | 2363 | players: null, |
2364 | | - detect_done:false, |
| 2364 | + detect_done:false, |
2365 | 2365 | init: function(){ |
2366 | 2366 | //detect supported types |
2367 | 2367 | this.detect(); |
— | — | @@ -2380,7 +2380,7 @@ |
2381 | 2381 | js_log("running detect"); |
2382 | 2382 | this.players = new mediaPlayers(); |
2383 | 2383 | //every browser supports html rendering: |
2384 | | - this.players.addPlayer( htmlPlayer ); |
| 2384 | + this.players.addPlayer( htmlPlayer ); |
2385 | 2385 | // In Mozilla, navigator.javaEnabled() only tells us about preferences, we need to |
2386 | 2386 | // search navigator.mimeTypes to see if it's installed |
2387 | 2387 | var javaEnabled = navigator.javaEnabled(); |
— | — | @@ -2392,28 +2392,28 @@ |
2393 | 2393 | // And it doesn't register an application/x-java-applet mime type like Mozilla does. |
2394 | 2394 | if ( invisibleJava && javaEnabled ) |
2395 | 2395 | this.players.addPlayer( cortadoPlayer ); |
2396 | | - |
| 2396 | + |
2397 | 2397 | // ActiveX plugins |
2398 | 2398 | if($j.browser.msie){ |
2399 | | - // check for flash |
2400 | | - if ( this.testActiveX( 'ShockwaveFlash.ShockwaveFlash')){ |
2401 | | - //try to get the flash version for omtk include: |
| 2399 | + // check for flash |
| 2400 | + if ( this.testActiveX( 'ShockwaveFlash.ShockwaveFlash')){ |
| 2401 | + //try to get the flash version for omtk include: |
2402 | 2402 | try { |
2403 | 2403 | a = new ActiveXObject(SHOCKWAVE_FLASH_AX + ".7"); |
2404 | 2404 | d = a.GetVariable("$version"); // Will crash fp6.0.21/23/29 |
2405 | 2405 | if (d) { |
2406 | | - d = d.split(" ")[1].split(","); |
| 2406 | + d = d.split(" ")[1].split(","); |
2407 | 2407 | //we need flash version 10 or greater: |
2408 | 2408 | if(parseInt( d[0]) >=10){ |
2409 | 2409 | this.players.addPlayer( omtkPlayer ); |
2410 | 2410 | } |
2411 | | - |
2412 | | - } |
2413 | | - }catch(e) {} |
2414 | | - |
2415 | | - //flowplayer has pretty good compatiablity |
| 2411 | + |
| 2412 | + } |
| 2413 | + }catch(e) {} |
| 2414 | + |
| 2415 | + //flowplayer has pretty good compatiablity |
2416 | 2416 | // (but if we wanted to be fancy we would check for version of flash and update the mp4/h.264 support |
2417 | | - this.players.addPlayer( flowPlayer ); |
| 2417 | + this.players.addPlayer( flowPlayer ); |
2418 | 2418 | } |
2419 | 2419 | // VLC |
2420 | 2420 | if ( this.testActiveX( 'VideoLAN.VLCPlugin.2' ) ) |
— | — | @@ -2423,14 +2423,14 @@ |
2424 | 2424 | this.players.addPlayer(cortadoPlayer); |
2425 | 2425 | // quicktime |
2426 | 2426 | //if ( this.testActiveX( 'QuickTimeCheckObject.QuickTimeCheck.1' ) ) |
2427 | | - // this.players.addPlayer(quicktimeActiveXPlayer); |
2428 | | - } |
| 2427 | + // this.players.addPlayer(quicktimeActiveXPlayer); |
| 2428 | + } |
2429 | 2429 | // <video> element |
2430 | 2430 | if ( typeof HTMLVideoElement == 'object' // Firefox, Safari |
2431 | 2431 | || typeof HTMLVideoElement == 'function' ) // Opera |
2432 | 2432 | { |
2433 | | - //do another test for safari: |
2434 | | - if( $j.browser.safari ){ |
| 2433 | + //do another test for safari: |
| 2434 | + if( $j.browser.safari ){ |
2435 | 2435 | try{ |
2436 | 2436 | var dummyvid = document.createElement("video"); |
2437 | 2437 | if (dummyvid.canPlayType && dummyvid.canPlayType("video/ogg;codecs=\"theora,vorbis\"") == "probably") |
— | — | @@ -2441,7 +2441,7 @@ |
2442 | 2442 | but xiph qt registers mimetype via quicktime plugin */ |
2443 | 2443 | this.players.addPlayer( videoElementPlayer ); |
2444 | 2444 | } else { |
2445 | | - //@@todo add some user nagging to install the xiph qt |
| 2445 | + //@@todo add some user nagging to install the xiph qt |
2446 | 2446 | } |
2447 | 2447 | }catch(e){ |
2448 | 2448 | js_log('could not run canPlayType in safari'); |
— | — | @@ -2449,8 +2449,8 @@ |
2450 | 2450 | }else{ |
2451 | 2451 | this.players.addPlayer( videoElementPlayer ); |
2452 | 2452 | } |
2453 | | - } |
2454 | | - |
| 2453 | + } |
| 2454 | + |
2455 | 2455 | // Mozilla plugins |
2456 | 2456 | if( navigator.mimeTypes && navigator.mimeTypes.length > 0) { |
2457 | 2457 | for ( var i = 0; i < navigator.mimeTypes.length; i++ ) { |
— | — | @@ -2464,17 +2464,17 @@ |
2465 | 2465 | if ( !pluginName ) { |
2466 | 2466 | // In case it is null or undefined |
2467 | 2467 | pluginName = ''; |
2468 | | - } |
| 2468 | + } |
2469 | 2469 | if ( pluginName.toLowerCase() == 'vlc multimedia plugin' || pluginName.toLowerCase() == 'vlc multimedia plug-in' ) { |
2470 | 2470 | this.players.addPlayer(vlcMozillaPlayer, type); |
2471 | 2471 | continue; |
2472 | 2472 | } |
2473 | | - |
| 2473 | + |
2474 | 2474 | if ( javaEnabled && type == 'application/x-java-applet' ) { |
2475 | 2475 | this.players.addPlayer(cortadoPlayer); |
2476 | 2476 | continue; |
2477 | | - } |
2478 | | - |
| 2477 | + } |
| 2478 | + |
2479 | 2479 | if ( type == 'application/ogg' ) { |
2480 | 2480 | if ( pluginName.toLowerCase() == 'vlc multimedia plugin' ){ |
2481 | 2481 | this.players.addPlayer(vlcMozillaPlayer, type); |
— | — | @@ -2493,14 +2493,14 @@ |
2494 | 2494 | continue; |
2495 | 2495 | } |
2496 | 2496 | } |
2497 | | - |
| 2497 | + |
2498 | 2498 | /*if ( type == 'video/quicktime' ) { |
2499 | 2499 | this.players.addPlayer(vlcMozillaPlayer, type); |
2500 | 2500 | continue; |
2501 | 2501 | }*/ |
2502 | 2502 | if(type=='application/x-shockwave-flash'){ |
2503 | 2503 | this.players.addPlayer( flowPlayer ); |
2504 | | - |
| 2504 | + |
2505 | 2505 | //check version to add omtk: |
2506 | 2506 | var flashDescription = navigator.plugins["Shockwave Flash"].description; |
2507 | 2507 | var descArray = flashDescription.split(" "); |
— | — | @@ -2509,7 +2509,7 @@ |
2510 | 2510 | //js_log("version of flash: " + versionMajor); |
2511 | 2511 | if(versionMajor >= 10){ |
2512 | 2512 | this.players.addPlayer( omtkPlayer ); |
2513 | | - } |
| 2513 | + } |
2514 | 2514 | continue; |
2515 | 2515 | } |
2516 | 2516 | } |
— | — | @@ -2528,5 +2528,5 @@ |
2529 | 2529 | hasObj = false; |
2530 | 2530 | } |
2531 | 2531 | return hasObj; |
2532 | | - } |
| 2532 | + } |
2533 | 2533 | }; |