Index: trunk/extensions/MetavidWiki/skins/mv_search.js |
— | — | @@ -81,7 +81,7 @@ |
82 | 82 | 'size="9" type="text" name="f['+inx+'][v]" value="" >'); |
83 | 83 | break; |
84 | 84 | case 'date_range': |
85 | | - $j('#mvs_'+inx+'_tc').html(global_loading_txt); |
| 85 | + $j('#mvs_'+inx+'_tc').html( getMsg('loading_txt') ); |
86 | 86 | var load_js_set = { 'Date.fromString':'jquery/plugins/date.js', |
87 | 87 | '$j.fn.datePicker':'jquery/plugins/jquery.datePicker.js'}; |
88 | 88 | if(embedTypes.msie6){ |
Index: trunk/extensions/MetavidWiki/skins/external_media_wizard.js |
— | — | @@ -14,11 +14,16 @@ |
15 | 15 | if(wgAction=='edit'){ |
16 | 16 | //add onPage ready request: |
17 | 17 | addOnloadHook( function(){ |
18 | | - var toolbar = document.getElementById("toolbar"); |
19 | | - toolbar.innerHTML = toolbar.innerHTML + ''+ |
20 | | - '<img src="http://upload.wikimedia.org/wikipedia/commons/8/86/Button_add_media.png" '+ |
21 | | - 'style="cursor:pointer;" ' + |
22 | | - 'onClick="mv_do_load_wiz()" />'; |
| 18 | + var toolbar = document.getElementById("toolbar"); |
| 19 | + var imE = document.createElement('img'); |
| 20 | + imE.style.cursor = 'pointer'; |
| 21 | + imE.src = 'http://upload.wikimedia.org/wikipedia/commons/8/86/Button_add_media.png'; |
| 22 | + toolbar.appendChild(imE); |
| 23 | + imE.setAttribute('onClick', 'mv_do_load_wiz()'); |
| 24 | + //addHandler only works once |
| 25 | + /*addHandler( imE, 'click', function() { |
| 26 | + mv_do_load_wiz(); |
| 27 | + });*/ |
23 | 28 | }); |
24 | 29 | } |
25 | 30 | var caret_pos={}; |
— | — | @@ -27,20 +32,25 @@ |
28 | 33 | var txtarea = document.editform.wpTextbox1; |
29 | 34 | caret_pos.s = getTextCusorStartPos( txtarea ); |
30 | 35 | caret_pos.e = getTextCusorEndPos( txtarea ); |
31 | | - caret_pos.text = txtarea.value; |
32 | | - |
| 36 | + caret_pos.text = txtarea.value; |
33 | 37 | //show the loading screen: |
34 | | - var body_elm = document.getElementsByTagName("body")[0]; |
35 | | - body_elm.innerHTML = body_elm.innerHTML + ''+ |
36 | | - '<div id="modalbox" style="background:#DDD;border:3px solid #666666;font-size:115%;'+ |
37 | | - 'top:30px;left:20px;right:20px;bottom:30px;position:fixed;z-index:100;">'+ |
38 | | - |
39 | | - 'loading external media wizard<blink>...</blink>'+ |
40 | | - |
41 | | - '</div>'+ |
42 | | - '<div id="mv_overlay" style="background:#000;cursor:wait;height:100%;left:0;position:fixed;'+ |
43 | | - 'top:0;width:100%;z-index:5;filter:alpha(opacity=60);-moz-opacity: 0.6;'+ |
44 | | - 'opacity: 0.6;"/>'; |
| 38 | + var elm = document.getElementById('modalbox') |
| 39 | + if(elm){ |
| 40 | + //use jquery to re-display the search |
| 41 | + if( typeof $j != 'undefined'){ |
| 42 | + $j('#modalbox,#mv_overlay').show(); |
| 43 | + } |
| 44 | + }else{ |
| 45 | + var body_elm = document.getElementsByTagName("body")[0]; |
| 46 | + body_elm.innerHTML = body_elm.innerHTML + ''+ |
| 47 | + '<div id="modalbox" style="background:#DDD;border:3px solid #666666;font-size:115%;'+ |
| 48 | + 'top:30px;left:20px;right:20px;bottom:30px;position:fixed;z-index:100;">'+ |
| 49 | + 'loading external media wizard<blink>...</blink>'+ |
| 50 | + '</div>'+ |
| 51 | + '<div id="mv_overlay" style="background:#000;cursor:wait;height:100%;left:0;position:fixed;'+ |
| 52 | + 'top:0;width:100%;z-index:5;filter:alpha(opacity=60);-moz-opacity: 0.6;'+ |
| 53 | + 'opacity: 0.6;"/>'; |
| 54 | + } |
45 | 55 | |
46 | 56 | //get mv_embed path from _this_ file location: |
47 | 57 | if(!mv_embed_url) |
— | — | @@ -70,7 +80,7 @@ |
71 | 81 | 'target_id':'modalbox', |
72 | 82 | 'profile':'mediawiki_edit', |
73 | 83 | 'target_textbox': 'wpTextbox1', |
74 | | - 'caret_pos':caret_pos, |
| 84 | + 'caret_pos': caret_pos, |
75 | 85 | //note selections in the textbox will take over the default query |
76 | 86 | 'default_query': wgTitle, |
77 | 87 | 'target_title':wgPageName, |
— | — | @@ -80,7 +90,7 @@ |
81 | 91 | } |
82 | 92 | } |
83 | 93 | function getMvEmbedUrl(){ |
84 | | - for(var i in document.getElementsByTagName('script')){ |
| 94 | + for(var i=0; i < document.getElementsByTagName('script').length; i++){ |
85 | 95 | var s = document.getElementsByTagName('script')[i]; |
86 | 96 | if( s.src.indexOf('external_media_wizard.js') != -1 ){ |
87 | 97 | //use the path: |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libSequencer/mv_clipedit.js |
— | — | @@ -178,6 +178,14 @@ |
179 | 179 | //update video related keys |
180 | 180 | this.rObj['start_time'] = $j('#mv_start_hr_rsd').val(); |
181 | 181 | this.rObj['end_time'] = $j('#mv_end_hr_rsd').val(); |
| 182 | + //select the ogg stream |
| 183 | + if( this.rObj.pSobj.cp.stream_import_key && this.rObj.roe_url){ |
| 184 | + var source = $j('#embed_vid').get(0).media_element.getSourceById( this.rObj.pSobj.cp.stream_import_key ); |
| 185 | + this.rObj['src'] = source.getURI(); |
| 186 | + js_log("g src_key: " + this.rObj.pSobj.cp.stream_import_key + ' src:' + this.rObj['src']) ; |
| 187 | + } |
| 188 | + //update the title: |
| 189 | + this.rObj['title'] = ' updated title'; |
182 | 190 | }, |
183 | 191 | applyCrop:function(){ |
184 | 192 | var _this = this; |
— | — | @@ -215,7 +223,7 @@ |
216 | 224 | }); |
217 | 225 | } |
218 | 226 | } |
219 | | -// mv_lock_vid_updates defeined in mv_stream.js (we need further refactoring) |
| 227 | +// mv_lock_vid_updates defined in mv_stream.js (we need further refactoring ) |
220 | 228 | if(typeof mv_lock_vid_updates == 'undefined') |
221 | 229 | mv_lock_vid_updates= false; |
222 | 230 | |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/styles.css |
— | — | @@ -552,11 +552,22 @@ |
553 | 553 | overflow:hidden; |
554 | 554 | } |
555 | 555 | .mv_clip_box_result_over{ |
556 | | - border: thin solid #F99; |
| 556 | + border: thin solid #F99; |
557 | 557 | } |
558 | 558 | .mv_clip_list_result{ |
559 | 559 | padding:10px; |
| 560 | + border: thin solid #BBB; |
| 561 | + clear:both; |
560 | 562 | } |
| 563 | +.mv_clip_list_result_over{ |
| 564 | + padding:10px; |
| 565 | + border: thin solid #F99; |
| 566 | + clear:both; |
| 567 | +} |
| 568 | +.rsd_res_item{ |
| 569 | + cursor:pointer; |
| 570 | + display:block; |
| 571 | +} |
561 | 572 | #rds_results_bar{ |
562 | 573 | margin:4px; |
563 | 574 | background:#DEF; |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/mv_embed.js |
— | — | @@ -1264,10 +1264,10 @@ |
1265 | 1265 | else |
1266 | 1266 | this.mime_type = this.detectType(this.src); |
1267 | 1267 | |
1268 | | - //set the title if unset: |
1269 | | - if( !this.title ){ |
| 1268 | + //set the title if unset: |
| 1269 | + if( !this.title ) |
1270 | 1270 | this.title = this.mime_type; |
1271 | | - } |
| 1271 | + |
1272 | 1272 | this.parseURLDuration(); |
1273 | 1273 | }, |
1274 | 1274 | updateSource:function(element){ |
— | — | @@ -1484,10 +1484,25 @@ |
1485 | 1485 | /** Returns the array of mediaSources of this element. |
1486 | 1486 | \returns {Array} Array of mediaSource elements. |
1487 | 1487 | */ |
1488 | | - getSources:function() |
| 1488 | + getSources:function( mime_filter ) |
1489 | 1489 | { |
1490 | | - return this.sources; |
| 1490 | + if(!mime_filter) |
| 1491 | + return this.sources; |
| 1492 | + //apply mime filter: |
| 1493 | + var source_set = new Array(); |
| 1494 | + for(var i=0; i < this.sources; i++){ |
| 1495 | + if( this.sources[i].mime_type.indexOf( mime_filter ) != -1 ) |
| 1496 | + source_set.push( this.sources[i] ); |
| 1497 | + } |
| 1498 | + return source_set; |
1491 | 1499 | }, |
| 1500 | + getSourceById:function( source_id ){ |
| 1501 | + for(var i=0; i < this.sources; i++){ |
| 1502 | + if( this.sources[i].id == source_id) |
| 1503 | + return this.sources[i]; |
| 1504 | + } |
| 1505 | + return null; |
| 1506 | + }, |
1492 | 1507 | /** Selects a particular source for playback. |
1493 | 1508 | */ |
1494 | 1509 | selectSource:function(index) |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libRemoteMediaSearch/mv_remote_media_search.js |
— | — | @@ -11,7 +11,10 @@ |
12 | 12 | gMsg['mv_media_search'] = 'Media Search'; |
13 | 13 | gMsg['rsd_box_layout'] = 'Box layout'; |
14 | 14 | gMsg['rsd_list_layout'] = 'List Layout'; |
15 | | -gMsg['rsd_results_desc']= 'Results <b>$0</b> of <b>$1</b>'; |
| 15 | +gMsg['rsd_results_desc']= 'Results '; |
| 16 | +gMsg['rsd_results_next'] = ' next '; |
| 17 | +gMsg['rsd_results_prev'] = ' previus '; |
| 18 | + |
16 | 19 | gMsg['rsd_layout'] = 'Layout:'; |
17 | 20 | gMsg['rsd_resource_edit']='Edit Resource:'; |
18 | 21 | |
— | — | @@ -81,9 +84,13 @@ |
82 | 85 | 'lib' :'mediaWiki', |
83 | 86 | 'resource_prefix': 'WC_', //prefix on imported resources (not applicable if the repository is local) |
84 | 87 | |
| 88 | + //list all the domains where commons is local? or set this some other way |
85 | 89 | 'local_domains': ['wikimedia','wikipedia','wikibooks'], |
86 | 90 | //specific to wiki commons config: |
87 | | - 'search_title':false //disable title search |
| 91 | + 'search_title':false, //disable title search |
| 92 | + //set up default range limit |
| 93 | + 'offset' : 0, |
| 94 | + 'limit' : 30 |
88 | 95 | }, |
89 | 96 | 'metavid':{ |
90 | 97 | 'enabled':1, |
— | — | @@ -100,6 +107,9 @@ |
101 | 108 | 'local_domains': ['metavid'], // if the domain name contains metavid |
102 | 109 | // no need to import metavid content to metavid sites |
103 | 110 | |
| 111 | + 'stream_import_key': 'mv_ogg_low_quality', // which stream to import, could be mv_ogg_high_quality |
| 112 | + //or flash stream, see ROE xml for keys |
| 113 | + |
104 | 114 | 'remote_embed_ext': false //if running the remoteEmbed extension no need to copy local |
105 | 115 | //syntax will be [remoteEmbed:roe_url link title] |
106 | 116 | }, |
— | — | @@ -120,7 +130,7 @@ |
121 | 131 | image_edit_width : 600, |
122 | 132 | video_edit_width : 400, |
123 | 133 | insert_text_pos : 0, //insert at the start (will be overwiten by the user cursor pos) |
124 | | - result_display_mode : 'box', //box or list or preview |
| 134 | + result_display_mode : 'box', //box or list or preview |
125 | 135 | |
126 | 136 | init:function( initObj ){ |
127 | 137 | js_log('remoteSearchDriver:init'); |
— | — | @@ -242,20 +252,31 @@ |
243 | 253 | '</div>'); |
244 | 254 | //get a remote search object for each search provider and run the search |
245 | 255 | for(var cp_id in this.content_providers){ |
246 | | - cp = this.content_providers[ cp_id ]; |
| 256 | + var cp = this.content_providers[ cp_id ]; |
| 257 | + |
247 | 258 | //only run the search for default item (unless combined is selected) |
248 | 259 | if( !cp.d || this.disp_item == 'combined' ) |
249 | 260 | continue; |
| 261 | + |
| 262 | + //set display if unset |
| 263 | + if(!this.disp_item) |
| 264 | + this.disp_item = cp_id; |
| 265 | + |
250 | 266 | //check if we need to update: |
251 | 267 | if(typeof cp.sObj != 'undefined'){ |
252 | | - if(cp.sObj.last_query == $j('#rsd_q').val()) |
| 268 | + if(cp.sObj.last_query == $j('#rsd_q').val() && cp.sObj.last_offset == cp.offset) |
253 | 269 | continue; |
254 | 270 | } |
255 | 271 | //else we need to run the search: |
256 | 272 | var iObj = {'cp':cp, 'rsd':this}; |
257 | 273 | eval('cp.sObj = new '+cp.lib+'Search(iObj);'); |
258 | 274 | if(!cp.sObj) |
259 | | - js_log('Error: could not find search lib for ' + cp_id); |
| 275 | + js_log('Error: could not find search lib for ' + cp_id); |
| 276 | + |
| 277 | + //inherit defaults if not set: |
| 278 | + cp.limit = (cp.limit) ? cp.limit : cp.sObj.limit; |
| 279 | + cp.offset = (cp.offset) ? cp.offset : cp.sObj.offset; |
| 280 | + |
260 | 281 | //do search: |
261 | 282 | cp.sObj.getSearchResults(); |
262 | 283 | } |
— | — | @@ -338,8 +359,8 @@ |
339 | 360 | o+='<img title="'+rItem.title+'" class="rsd_res_item" id="res_' + rInx +'" style="width:' + _this.thumb_width + 'px;" src="' + rItem.poster + '">'; |
340 | 361 | o+='</div>'; |
341 | 362 | }else if(_this.result_display_mode == 'list'){ |
342 | | - o+='<div id="mv_result_' + rInx + '" class="mv_clip_list_result res_' + rInx +'" style="' + disp + 'width:90%">'; |
343 | | - o+='<img class="rsd_res_item" id="res_' + cp_id +'" style="float:left;width:' + _this.thumb_width + 'px; padding:5px;" src="' + rItem.poster + '">'; |
| 363 | + o+='<div id="mv_result_' + rInx + '" class="mv_clip_list_result" style="' + disp + 'width:90%">'; |
| 364 | + o+='<img title="'+rItem.title+'" class="rsd_res_item" id="res_' + rInx +'" style="float:left;width:' + _this.thumb_width + 'px; padding:5px;" src="' + rItem.poster + '">'; |
344 | 365 | o+= rItem.desc ; |
345 | 366 | o+='</div>'; |
346 | 367 | o+='<div style="clear:both" />'; |
— | — | @@ -355,13 +376,13 @@ |
356 | 377 | }, |
357 | 378 | addResultBindings:function(){ |
358 | 379 | var _this = this; |
359 | | - $j('.mv_clip_box_result').hover(function(){ |
360 | | - $j(this).addClass('mv_clip_box_result_over'); |
| 380 | + $j('.mv_clip_'+_this.result_display_mode+'_result').hover(function(){ |
| 381 | + $j(this).addClass('mv_clip_'+_this.result_display_mode+'_result_over'); |
361 | 382 | },function(){ |
362 | | - $j(this).removeClass('mv_clip_box_result_over'); |
363 | | - }); |
| 383 | + $j(this).removeClass('mv_clip_'+_this.result_display_mode+'_result_over'); |
| 384 | + }); |
364 | 385 | //resource click action: (bring up the resource editor) |
365 | | - $j('.rsd_res_item').click(function(){ |
| 386 | + $j('.rsd_res_item').click(function(){ |
366 | 387 | //get the resource obj: |
367 | 388 | var rObj = _this.getResourceFromId( this.id ); |
368 | 389 | //remove any existing resource edit interface: |
— | — | @@ -381,7 +402,7 @@ |
382 | 403 | //append to the top level of model window: |
383 | 404 | $j( '#'+ _this.target_id ).append('<div id="rsd_resource_edit" '+ |
384 | 405 | 'style="position:absolute;top:0px;left:0px;width:100%;height:100%;background-color:#FFF;">' + |
385 | | - '<h3 style="margin:4px;">' + getMsg('rsd_resource_edit') + ' ' + rObj.title +'</h3>'+ |
| 406 | + '<h3 id="rsd_resource_title" style="margin:4px;">' + getMsg('rsd_resource_edit') + ' ' + rObj.title +'</h3>'+ |
386 | 407 | '<div id="clip_edit_disp" style="position:absolute;'+overflow_style+'top:30px;left:0px;bottom:0px;'+ |
387 | 408 | 'width:' + (maxWidth + 30) + 'px;" >' + |
388 | 409 | mv_get_loading_img('position:absolute;top:30px;left:30px', 'mv_img_loader') + |
— | — | @@ -727,8 +748,7 @@ |
728 | 749 | '</div>'); |
729 | 750 | //update the preview_wtext |
730 | 751 | _this.updatePreviewText( rObj ); |
731 | | - |
732 | | - |
| 752 | + |
733 | 753 | _this.getParsedWikiText(_this.preview_wtext, _this.target_title, |
734 | 754 | function(phtml){ |
735 | 755 | $j('#rsd_preview_display').html( phtml ); |
— | — | @@ -761,10 +781,13 @@ |
762 | 782 | callback( data.parse.text['*'] ); |
763 | 783 | }); |
764 | 784 | }, |
765 | | - insertResource:function( rObj){ |
766 | | - this.updatePreviewText( rObj ); |
767 | | - $j('#'+this.target_textbox).val( this.preview_wtext ); |
768 | | - this.closeAll(); |
| 785 | + insertResource:function( rObj){ |
| 786 | + var _this = this |
| 787 | + this.checkImportResource( rObj, function(){ |
| 788 | + _this.updatePreviewText( rObj ); |
| 789 | + $j('#'+_this.target_textbox).val( _this.preview_wtext ); |
| 790 | + _this.closeAll(); |
| 791 | + }); |
769 | 792 | }, |
770 | 793 | closeAll:function( rObj ){ |
771 | 794 | $j('#modalbox').fadeOut("normal",function(){ |
— | — | @@ -792,9 +815,11 @@ |
793 | 816 | 'title = "' + getMsg('rsd_list_layout') + '" '+ |
794 | 817 | 'src = "' + ( (_this.result_display_mode=='list')?list_dark_url:list_light_url ) + '" '+ |
795 | 818 | 'style="width:20px;height:20px;cursor:pointer;">'+ |
796 | | - '<span style="position:absolute;right:5px;">'+ getMsg('rsd_results_desc', new Array('1 - 20', '420'))+'</span>'+ |
| 819 | + '<span id="rsd_paging_ctrl" style="position:absolute;right:5px;"></span>'+ |
797 | 820 | '</div>' |
798 | 821 | ); |
| 822 | + //get paging with bindings: |
| 823 | + this.getPaging('#rsd_paging_ctrl'); |
799 | 824 | |
800 | 825 | $j('#msc_box_layout').hover(function(){ |
801 | 826 | $j(this).attr("src", box_dark_url ); |
— | — | @@ -816,9 +841,44 @@ |
817 | 842 | _this.setDispMode('list'); |
818 | 843 | }); |
819 | 844 | }, |
| 845 | + getPaging:function(target){ |
| 846 | + var _this = this; |
| 847 | + //if more than one repository displayed (disable paging) |
| 848 | + if(this.disp_item == 'combined'){ |
| 849 | + $j(target).html('no paging for combined results'); |
| 850 | + return ; |
| 851 | + } |
| 852 | + for(var cp_id in this.content_providers){ |
| 853 | + var cp = this.content_providers[ cp_id ]; |
| 854 | + if(this.disp_item == cp_id){ |
| 855 | + js_log('getPaging:'+ cp_id); |
| 856 | + var out = getMsg('rsd_results_desc') + (cp.offset+1) + ' to ' + (cp.offset + cp.limit); |
| 857 | + //check if we have more results (next prev link) |
| 858 | + if( cp.offset >= cp.limit ) |
| 859 | + out+=' <a href="#" id="rsd_pprev">' + getMsg('rsd_results_prev') + cp.limit + '</a>'; |
| 860 | + if( cp.sObj.more_results ) |
| 861 | + out+=' <a href="#" id="rsd_pnext">' + getMsg('rsd_results_next') + cp.limit + '</a>'; |
| 862 | + $j(target).html(out); |
| 863 | + //set bindings |
| 864 | + $j('#rsd_pnext').click(function(){ |
| 865 | + cp.offset += cp.limit; |
| 866 | + _this.runSearch(); |
| 867 | + }); |
| 868 | + $j('#rsd_pprev').click(function(){ |
| 869 | + cp.offset -= cp.limit; |
| 870 | + if(cp.offset<0) |
| 871 | + cp.offset=0; |
| 872 | + _this.runSearch(); |
| 873 | + }); |
| 874 | + |
| 875 | + return; |
| 876 | + } |
| 877 | + } |
| 878 | + |
| 879 | + }, |
820 | 880 | selectTab:function( selected_cp_id ){ |
821 | 881 | js_log('select tab: ' + selected_cp_id); |
822 | | - this.disp_item =selected_cp_id; |
| 882 | + this.disp_item = selected_cp_id; |
823 | 883 | //set display to unselected: |
824 | 884 | for(var cp_id in this.content_providers){ |
825 | 885 | cp = this.content_providers[ cp_id ]; |
— | — | @@ -857,7 +917,14 @@ |
858 | 918 | completed_req:0, |
859 | 919 | num_req:0, |
860 | 920 | |
861 | | - resultsObj:{}, |
| 921 | + resultsObj:{}, |
| 922 | + |
| 923 | + //default search result values for paging: |
| 924 | + offset :0, |
| 925 | + limit :20, |
| 926 | + more_results :false, |
| 927 | + num_results :null, |
| 928 | + |
862 | 929 | //init the object: |
863 | 930 | init:function( initObj ){ |
864 | 931 | js_log('mvBaseRemoteSearch:init'); |
— | — | @@ -921,7 +988,8 @@ |
922 | 989 | } |
923 | 990 | //force a mime type for now.. in the future generalize for other RSS feeds |
924 | 991 | rObj['mime'] = 'video/ogg'; |
925 | | - //add pointer to parent search obj: |
| 992 | + //add pointer to parent search obj:( this.cp.limit )? this.cp.limit : this.limit, |
| 993 | + |
926 | 994 | rObj['pSobj'] = _this; |
927 | 995 | //add the result to the result set: |
928 | 996 | _this.resultsObj[inx] = rObj; |
— | — | @@ -986,18 +1054,25 @@ |
987 | 1055 | } |
988 | 1056 | //do basic query: |
989 | 1057 | this.last_query = $j('#rsd_q').val(); |
| 1058 | + this.last_offset = cp.offset; |
990 | 1059 | url += '&f[0][t]=match&f[0][v]=' + $j('#rsd_q').val(); |
| 1060 | + //add offset limit: |
| 1061 | + url+='&limit=' + this.cp.limit; |
| 1062 | + url+='&offset=' + this.cp.offset; |
| 1063 | + |
991 | 1064 | do_request(url, function(data){ |
992 | 1065 | //should have an xml rss data object: |
993 | 1066 | _this.addRSSData( data , url ); |
994 | | - //do some metavid specific pos proccessing on the rObj data: |
| 1067 | + //do some metavid specific pos processing on the rObj data: |
995 | 1068 | for(var i in _this.resultsObj){ |
996 | 1069 | var rObj = _this.resultsObj[i]; |
997 | 1070 | var proe = parseUri( rObj['roe_url'] ); |
998 | 1071 | rObj['start_time'] = proe.queryKey['t'].split('/')[0]; |
999 | 1072 | rObj['end_time'] = proe.queryKey['t'].split('/')[1]; |
| 1073 | + rObj['stream_name'] = proe.queryKey['stream_name']; |
1000 | 1074 | //transform the title into a wiki_safe title: |
1001 | | - rObj['titleKey'] = proe.queryKey['stream_name'] + '_' + rObj['start_time'].replace(/:/g,'.') + '_' + rObj['end_time'].replace(/:/g,'.') + '.ogg'; |
| 1075 | + //rObj['titleKey'] = proe.queryKey['stream_name'] + '_' + rObj['start_time'].replace(/:/g,'.') + '_' + rObj['end_time'].replace(/:/g,'.') + '.ogg'; |
| 1076 | + rObj['titleKey'] = proe.queryKey['stream_name'] + '/' + rObj['start_time'] + '/' + rObj['end_time'] + '__.ogg'; |
1002 | 1077 | } |
1003 | 1078 | //done loading: |
1004 | 1079 | _this.loading=0; |
— | — | @@ -1006,10 +1081,8 @@ |
1007 | 1082 | getEmbedWikiText:function(rObj, options){ |
1008 | 1083 | //if we are using a local copy do the standard b: |
1009 | 1084 | if( this.cp.local_copy == true) |
1010 | | - return this.parent_getEmbedWikiText(rObj, options); |
1011 | | - |
1012 | | - //if local_copy is false and embed metavid extension is enabled: |
1013 | | - |
| 1085 | + return this.parent_getEmbedWikiText(rObj, options); |
| 1086 | + //if local_copy is false and embed metavid extension is enabled: |
1014 | 1087 | return |
1015 | 1088 | }, |
1016 | 1089 | getEmbedHTML:function( rObj , options ){ |
— | — | @@ -1043,10 +1116,10 @@ |
1044 | 1117 | var year_full = (dParts[3].length==2)?'20'+dParts[3].toString():dParts[3]; |
1045 | 1118 | d.setFullYear(year_full, dParts[1]-1, dParts[2]); |
1046 | 1119 | rObj['date'] = d.toDateString(); |
1047 | | - rObj['licence_template_tag']='PD-USGov'; |
1048 | | - |
1049 | | - js_log('url is: '+rObj.url); |
1050 | | - |
| 1120 | + rObj['licence_template_tag']='PD-USGov'; |
| 1121 | + //update based on new start time: |
| 1122 | + js_log('url is: ' + rObj.src + ' ns: ' + rObj.start_time + ' ne:' + rObj.end_time); |
| 1123 | + |
1051 | 1124 | return rObj; |
1052 | 1125 | } |
1053 | 1126 | } |
— | — | @@ -1065,6 +1138,7 @@ |
1066 | 1139 | this['parent_'+i] = baseSearch[i]; |
1067 | 1140 | } |
1068 | 1141 | } |
| 1142 | + //inherit the cp settings for |
1069 | 1143 | }, |
1070 | 1144 | getSearchResults:function(){ |
1071 | 1145 | var _this = this; |
— | — | @@ -1072,7 +1146,8 @@ |
1073 | 1147 | js_log('f:getSearchResults for:' + $j('#'+this.target_input).val() ); |
1074 | 1148 | //empty out the current results: |
1075 | 1149 | this.resultsObj={}; |
1076 | | - //do two queries against the Image / File / MVD namespace: |
| 1150 | + //do two queries against the Image / File / MVD namespace: |
| 1151 | + |
1077 | 1152 | //build the image request object: |
1078 | 1153 | var reqObj = { |
1079 | 1154 | 'action':'query', |
— | — | @@ -1080,7 +1155,8 @@ |
1081 | 1156 | 'gsrsearch': encodeURIComponent( $j('#rsd_q').val() ), |
1082 | 1157 | 'gsrnamespace':6, //(only search the "file" namespace (audio, video, images) |
1083 | 1158 | 'gsrwhat':'title', |
1084 | | - 'gsrlimit':30, |
| 1159 | + 'gsrlimit': this.cp.limit, |
| 1160 | + 'gsroffset': this.cp.offset, |
1085 | 1161 | 'prop':'imageinfo|revisions|categories', |
1086 | 1162 | 'iiprop':'url|mime', |
1087 | 1163 | 'iiurlwidth': parseInt( this.rsd.thumb_width ), |
— | — | @@ -1107,7 +1183,10 @@ |
1108 | 1184 | }, |
1109 | 1185 | addResults:function( data ){ |
1110 | 1186 | var _this = this |
1111 | | - //make sure we have pages to idoerate: |
| 1187 | + //check if we have |
| 1188 | + if( typeof data['query-continue'].search != 'undefined') |
| 1189 | + this.more_results = true; |
| 1190 | + //make sure we have pages to iderate: |
1112 | 1191 | if(data.query && data.query.pages){ |
1113 | 1192 | for(var page_id in data.query.pages){ |
1114 | 1193 | var page = data.query.pages[ page_id ]; |