Index: trunk/extensions/MetavidWiki/skins/add_media_wizard.js |
— | — | @@ -6,40 +6,45 @@ |
7 | 7 | |
8 | 8 | var wg_local_wiki_api_url = wgServer + wgScriptPath + '/api.php'; |
9 | 9 | |
10 | | -//if mv_embed is hosted somewhere other than near by the external_media_wizzard you can define it here: |
11 | | -var mv_embed_url = null; |
| 10 | +//if mv_embed is hosted somewhere other than near by the add_media_wizard you can define it here: |
| 11 | +var mv_add_media_wizard_path = 'http://mvbox2.cse.ucsc.edu/w/extensions/MetavidWiki/skins/'; |
12 | 12 | |
13 | 13 | //*code should not have to modify anything below*/ |
14 | 14 | //check if we are on a edit page: |
15 | 15 | if(wgAction=='edit'){ |
16 | 16 | //add onPage ready request: |
17 | | - addOnloadHook( function(){ |
18 | | - var toolbar = document.getElementById("toolbar"); |
| 17 | + addOnloadHook( function(){ |
19 | 18 | var imE = document.createElement('img'); |
20 | 19 | imE.style.cursor = 'pointer'; |
21 | | - imE.id = 'mv-add_media'; |
22 | | - imE.src = 'http://upload.wikimedia.org/wikipedia/commons/8/86/Button_add_media.png'; |
23 | | - toolbar.appendChild(imE); |
24 | | - //imE.setAttribute('onClick', 'mv_do_load_wiz()'); |
25 | | - //addHandler only works once cuz of dom manipluations |
| 20 | + imE.id = 'mv-add_media'; |
| 21 | + imE.src = wgScriptPath + '/extensions/MetavidWiki/skins/mv_embed/images/Button_add_media.png'; |
| 22 | + |
| 23 | + var toolbar = document.getElementById("toolbar"); |
| 24 | + toolbar.appendChild(imE); |
| 25 | + |
26 | 26 | addHandler( imE, 'click', function() { |
27 | 27 | mv_do_load_wiz(); |
28 | 28 | }); |
29 | 29 | }); |
30 | 30 | } |
31 | 31 | //add firefog support to Special Upload page: |
32 | | -if(wgPageName== "Special:Upload"){ |
33 | | - addOnloadHook( function(){ |
| 32 | +if(wgPageName== "Special:Upload"){ |
| 33 | + addOnloadHook( function(){ |
| 34 | + js_log("!!upload hook"); |
34 | 35 | load_mv_embed( function(){ |
| 36 | + js_log('!!loaded mv_embed'); |
35 | 37 | //load jQuery and what not (we need to refactor the loading system for mv_embed) |
36 | 38 | mvEmbed.load_libs(function(){ |
| 39 | + js_log('!!loaded load libs'); |
37 | 40 | mvJsLoader.doLoad({'mvUploader' : 'libAddMedia/mv_upload.js'},function(){ |
| 41 | + js_log("!!make uploaer"); |
38 | 42 | mvUp = new mvUploader(); |
39 | 43 | }); |
40 | 44 | }); |
41 | 45 | }); |
42 | 46 | }); |
43 | 47 | } |
| 48 | + |
44 | 49 | var caret_pos={}; |
45 | 50 | function mv_do_load_wiz(){ |
46 | 51 | caret_pos={}; |
— | — | @@ -109,38 +114,48 @@ |
110 | 115 | }); |
111 | 116 | return false; |
112 | 117 | } |
113 | | -function load_mv_embed( callback ){ |
114 | | - //get mv_embed path from _this_ file location: |
115 | | - if(!mv_embed_url) |
116 | | - mv_embed_url = getMvEmbedUrl(); |
117 | | - |
118 | | - //inject mv_embed |
119 | | - if( typeof MV_EMBED_VERSION == 'undefined'){ |
| 118 | +function load_mv_embed( callback ){ |
| 119 | + //inject mv_embed if needed: |
| 120 | + if( typeof mvEmbed == 'undefined'){ |
| 121 | + //get mv_embed path from _this_ file location: |
| 122 | + var mv_embed_url = getAddMediaPath( 'mv_embed/mv_embed.js' ); |
| 123 | + //make sure its not already there: |
| 124 | + for(var i=0; i < document.getElementsByTagName('script').length; i++){ |
| 125 | + var s = document.getElementsByTagName('script')[i]; |
| 126 | + if(s.src == mv_embed_url){ |
| 127 | + check_for_mv_embed( callback ); |
| 128 | + return ; |
| 129 | + } |
| 130 | + } |
120 | 131 | var e = document.createElement("script"); |
121 | 132 | e.setAttribute('src', mv_embed_url); |
122 | 133 | e.setAttribute('type',"text/javascript"); |
123 | 134 | document.getElementsByTagName("head")[0].appendChild(e); |
124 | | - setTimeout('check_for_mv_embed();', 25); |
125 | | - }else{ |
| 135 | + setTimeout('check_for_mv_embed(callback);', 25); |
| 136 | + }else{ |
126 | 137 | check_for_mv_embed( callback ); |
127 | 138 | } |
128 | 139 | } |
129 | 140 | |
130 | 141 | function check_for_mv_embed( callback ){ |
131 | | - if( typeof MV_EMBED_VERSION == 'undefined'){ |
132 | | - setTimeout('check_for_mv_embed();', 25); |
| 142 | + js_log('check_for_mv_embed'); |
| 143 | + if( typeof mvEmbed == 'undefined'){ |
| 144 | + setTimeout('check_for_mv_embed( callback );', 25); |
133 | 145 | }else{ |
134 | 146 | callback(); |
135 | 147 | } |
136 | 148 | } |
137 | | -function getMvEmbedUrl(){ |
| 149 | +function getAddMediaPath( replace_str ){ |
| 150 | + if(!replace_str) |
| 151 | + replace_str = ''; |
138 | 152 | for(var i=0; i < document.getElementsByTagName('script').length; i++){ |
139 | 153 | var s = document.getElementsByTagName('script')[i]; |
140 | 154 | if( s.src.indexOf('add_media_wizard.js') != -1 ){ |
141 | 155 | //use the external_media_wizard path: |
142 | | - return s.src= s.src.replace('add_media_wizard.js', '') + 'mv_embed/mv_embed.js'; |
| 156 | + return s.src.replace('add_media_wizard.js', replace_str); |
143 | 157 | } |
144 | 158 | } |
145 | | - alert('Error: could not find mv_embed path'); |
| 159 | + js_log('Error: could not find add media path force config:'); |
| 160 | + return mv_add_media_wizard_path + replace_str; |
146 | 161 | } |
147 | 162 | |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libAddMedia/firefogg.js |
— | — | @@ -50,7 +50,7 @@ |
51 | 51 | } |
52 | 52 | |
53 | 53 | var default_firefogg_options = { |
54 | | - 'add_done_action':'redirect', |
| 54 | + 'upload_done_action':'redirect', |
55 | 55 | 'enabled':false |
56 | 56 | } |
57 | 57 | var upFirefogg = function(iObj){ |
— | — | @@ -187,13 +187,13 @@ |
188 | 188 | } |
189 | 189 | //upload sucsefull, state can also be 'upload failed' |
190 | 190 | else if(_this.ogg.state == 'upload done') { |
191 | | - js_log('upload done'); |
| 191 | + //js_log('upload done: ' + JSON.parse(_this.ogg.uploadstatus()).responseText); |
192 | 192 | //@@todo handle errors same problem as #695 in mv_remote_media_search.js |
193 | 193 | //we need to add image uploading to the api rather than parse the HTML output of the pages |
194 | 194 | var result_page = JSON.parse(_this.ogg.uploadstatus()).responseText; |
195 | 195 | var sstring = 'var wgTitle = "' + data['wpDestFile'].replace('_',' '); |
196 | 196 | if( result_page.toLowerCase().indexOf( sstring.toLowerCase() ) != -1){ |
197 | | - js_log('upload done got redirect found: ' +sstring); |
| 197 | + js_log('upload done got redirect found: ' +sstring + ' r:' + _this.upload_done_action); |
198 | 198 | if(_this.upload_done_action == 'redirect'){ |
199 | 199 | window.location = wgArticlePath.replace(/\$1/, 'File:' + data['wpDestFile'] ); |
200 | 200 | }else{ |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libAddMedia/mv_remote_media_search.js |
— | — | @@ -56,29 +56,38 @@ |
57 | 57 | content_providers:{ |
58 | 58 | /*content_providers documentation: |
59 | 59 | @enabled: whether the search provider can be selected |
60 | | - @checked: whether the search provideer will show up as seletable tab (todo: user prefrence) |
61 | | - @d: if the current cp should be displayed (only one should be the default) |
| 60 | + @checked: whether the search provider will show up as seleatable tab (todo: user prefrence) |
| 61 | + @d: default: if the current cp should be displayed (only one should be the default) |
62 | 62 | @title: the title of the search provider |
63 | 63 | @desc: can use html... todo: need to localize |
64 | 64 | @api_url: the url to query against given the library type: |
65 | 65 | @lib: the search library to use corresponding to the |
66 | 66 | search object ie: 'mediaWiki' = new mediaWikiSearchSearch() |
67 | | - @local : if the content provider assets need to be imported or not. |
68 | | - */ |
| 67 | + @tab_img: the tab image (if set to false use title text) |
| 68 | + if === "ture" use standard location skin/images/{cp_id}_tab.png |
| 69 | + if === string use as url for image |
| 70 | + |
| 71 | + @linkback_icon default is: /wiki/skins/common/images/magnify-clip.png |
| 72 | + |
| 73 | + //domain insert: two modes: simple config or domain list: |
| 74 | + @local : if the content provider assets need to be imported or not. |
| 75 | + @local_domains : sets of domains for which the content is local |
| 76 | + */ |
69 | 77 | 'this_wiki':{ |
70 | | - 'enabled':0, |
71 | | - 'checked':0, |
72 | | - 'd' :0, |
73 | | - 'title' :'The Current Wiki', |
74 | | - 'desc' : '(should be updated with the proper text)', |
75 | | - 'api_url': wgScriptPath + '/api.php', |
76 | | - 'lib' :'mediaWiki', |
77 | | - 'local' :true |
| 78 | + 'enabled':1, |
| 79 | + 'checked':1, |
| 80 | + 'd' :1, |
| 81 | + 'title' :'This Wiki', |
| 82 | + 'desc' : '(should be updated with the proper text) maybe import from some config value', |
| 83 | + 'api_url': wgServer + wgScriptPath + '/api.php', |
| 84 | + 'lib' :'mediaWiki', |
| 85 | + 'local' :true, |
| 86 | + 'tab_img':false |
78 | 87 | }, |
79 | 88 | 'wiki_commons':{ |
80 | 89 | 'enabled':1, |
81 | 90 | 'checked':1, |
82 | | - 'd' :1, |
| 91 | + 'd' :0, |
83 | 92 | 'title' :'Wikipedia Commons', |
84 | 93 | 'desc' : 'Wikimedia Commons is a media file repository making available public domain '+ |
85 | 94 | 'and freely-licensed educational media content (images, sound and video clips) to all.', |
— | — | @@ -87,13 +96,15 @@ |
88 | 97 | 'lib' :'mediaWiki', |
89 | 98 | 'resource_prefix': 'WC_', //prefix on imported resources (not applicable if the repository is local) |
90 | 99 | |
91 | | - //list all the domains where commons is local? or set this some other way |
| 100 | + //list all the domains where commons is local? or set this some other way by doing an api query |
| 101 | + //or by seeding this config when calling the remote search |
92 | 102 | 'local_domains': ['wikimedia','wikipedia','wikibooks'], |
93 | 103 | //specific to wiki commons config: |
94 | 104 | 'search_title':false, //disable title search |
95 | 105 | //set up default range limit |
96 | 106 | 'offset' : 0, |
97 | | - 'limit' : 30 |
| 107 | + 'limit' : 30, |
| 108 | + 'tab_img':true |
98 | 109 | }, |
99 | 110 | 'metavid':{ |
100 | 111 | 'enabled':1, |
— | — | @@ -113,8 +124,9 @@ |
114 | 125 | 'stream_import_key': 'mv_ogg_low_quality', // which stream to import, could be mv_ogg_high_quality |
115 | 126 | //or flash stream, see ROE xml for keys |
116 | 127 | |
117 | | - 'remote_embed_ext': false //if running the remoteEmbed extension no need to copy local |
118 | | - //syntax will be [remoteEmbed:roe_url link title] |
| 128 | + 'remote_embed_ext': false, //if running the remoteEmbed extension no need to copy local |
| 129 | + //syntax will be [remoteEmbed:roe_url link title] |
| 130 | + 'tab_img':true |
119 | 131 | }, |
120 | 132 | 'archive_org':{ |
121 | 133 | 'enabled':0, |
— | — | @@ -125,17 +137,18 @@ |
126 | 138 | 'homepage':'http://archive.org', |
127 | 139 | 'lib' : 'archive', |
128 | 140 | 'local' : false, |
129 | | - 'resource_prefix': 'AO_' |
| 141 | + 'resource_prefix': 'AO_', |
| 142 | + 'tab_img':false |
130 | 143 | } |
131 | 144 | }, |
132 | 145 | //some default layout values: |
133 | 146 | thumb_width : 80, |
134 | 147 | image_edit_width : 600, |
135 | 148 | video_edit_width : 400, |
136 | | - insert_text_pos : 0, //insert at the start (will be overwiten by the user cursor pos) |
137 | | - result_display_mode : 'box', //box or list or preview |
| 149 | + insert_text_pos : 0, //insert at the start (will be overwitten by the user cursor pos) |
| 150 | + result_display_mode : 'box', //box or list |
138 | 151 | |
139 | | - cUpLoader : null, |
| 152 | + cUpLoader : null, |
140 | 153 | cEdit : null, |
141 | 154 | |
142 | 155 | init:function( initObj ){ |
— | — | @@ -209,7 +222,7 @@ |
210 | 223 | ' style="float:left;cursor:pointer;">'+ |
211 | 224 | '<input class="mv_cps_input" type="checkbox" name="mv_cps" '+ checked_attr+'>'; |
212 | 225 | |
213 | | - out+= '<img alt="'+cp.title+'" src="' + mv_embed_path + 'skins/' + mv_skin_name + '/remote_search/' + cp_id + '_tab.png">'; |
| 226 | + out+= '<img alt="'+cp.title+'" src="' + mv_embed_path + 'skins/' + mv_skin_name + '/images/remote_cp/' + cp_id + '_tab.png">'; |
214 | 227 | out+='</div>'; |
215 | 228 | } |
216 | 229 | out+='<div style="clear:both"/><a id="mso_selprovider_close" href="#">'+getMsg('close')+'</a></div>'; |
— | — | @@ -228,7 +241,7 @@ |
229 | 242 | }, |
230 | 243 | add_interface_bindings:function(){ |
231 | 244 | var _this = this; |
232 | | - js_log("add_interface_bindings:"); |
| 245 | + js_log("f:add_interface_bindings:"); |
233 | 246 | //setup for this.main_search_options: |
234 | 247 | $j('#mso_cancel').click(function(){ |
235 | 248 | _this.closeAll(); |
— | — | @@ -335,12 +348,19 @@ |
336 | 349 | //add the tabs to the rsd_results container: |
337 | 350 | var o='<div class="rsd_tabs_container" style="position:absolute;top:49px;width:100%;left:12px;height:25px;">'; |
338 | 351 | o+= '<ul class="rsd_cp_tabs" style="margin: 0 0 0 0;position:absolute;top:0px;padding:0;">'; //no idea why margin does not overwrite from the css |
339 | | - o+='<li id="rsd_tab_combined" ><img src="' + mv_embed_path + 'skins/'+mv_skin_name+ '/remote_search/combined_tab.png"></li>'; |
| 352 | + o+='<li id="rsd_tab_combined" ><img src="' + mv_embed_path + 'skins/'+mv_skin_name+ '/images/remote_cp/combined_tab.png"></li>'; |
340 | 353 | for(var cp_id in this.content_providers){ |
341 | 354 | var cp = this.content_providers[cp_id]; |
342 | 355 | if( cp.enabled && cp.checked){ |
343 | 356 | var class_attr = (cp.d)?'class="rsd_selected"':''; |
344 | | - o+='<li id="rsd_tab_'+cp_id+'" ' + class_attr + '><img src="' + mv_embed_path + 'skins/' + mv_skin_name + '/remote_search/' + cp_id + '_tab.png"></li>'; |
| 357 | + o+='<li id="rsd_tab_'+cp_id+'" ' + class_attr + '>'; |
| 358 | + if(cp.tab_img === true){ |
| 359 | + o+='<img alt="' + cp.title +'" src="' + mv_embed_path + 'skins/' + mv_skin_name + '/images/remote_cp/' + cp_id + '_tab.png"></li>'; |
| 360 | + }else if(typeof cp.tab_img=='string'){ |
| 361 | + o+='<img alt="' + cp.title +'" src="' + cp.tab_img + '"></li>'; |
| 362 | + }else if(cp.tab_img === false){ |
| 363 | + o+= cp.title; |
| 364 | + } |
345 | 365 | } |
346 | 366 | } |
347 | 367 | //do an upload tab if enabled: |
— | — | @@ -404,8 +424,11 @@ |
405 | 425 | var disp = ( cp.d ) ? '' : 'display:none;'; |
406 | 426 | if( _this.result_display_mode == 'box' ){ |
407 | 427 | o+='<div id="mv_result_' + rInx + '" class="mv_clip_box_result" style="' + disp + 'width:' + |
408 | | - _this.thumb_width + 'px;height:'+ (_this.thumb_width-20) +'px">'; |
| 428 | + _this.thumb_width + 'px;height:'+ (_this.thumb_width-20) +'px;position:relative;">'; |
409 | 429 | o+='<img title="'+rItem.title+'" class="rsd_res_item" id="res_' + rInx +'" style="width:' + _this.thumb_width + 'px;" src="' + rItem.poster + '">'; |
| 430 | + //add a linkback to resource page in lower left: |
| 431 | + if(rItem.link) |
| 432 | + o+='<a target="_new" style="position:absolute;top:0px;right:0px" title="' + getMsg('Resource Description Page') + '" href="' + rItem.link + '"><img src="' + wgScriptPath + '/skins/common/images/magnify-clip.png"></a>'; |
410 | 433 | o+='</div>'; |
411 | 434 | }else if(_this.result_display_mode == 'list'){ |
412 | 435 | o+='<div id="mv_result_' + rInx + '" class="mv_clip_list_result" style="' + disp + 'width:90%">'; |
— | — | @@ -431,15 +454,17 @@ |
432 | 455 | $j(this).removeClass('mv_clip_'+_this.result_display_mode+'_result_over'); |
433 | 456 | }); |
434 | 457 | //resource click action: (bring up the resource editor) |
435 | | - $j('.rsd_res_item').click(function(){ |
| 458 | + $j('.rsd_res_item').click(function(){ |
436 | 459 | //get the resource obj: |
437 | 460 | var rObj = _this.getResourceFromId( this.id ); |
438 | | - _this.resourceEdit( rObj ); |
| 461 | + _this.resourceEdit( rObj, this ); |
439 | 462 | }); |
440 | 463 | }, |
441 | | - resourceEdit:function( rObj ){ |
| 464 | + resourceEdit:function( rObj, rsdElement){ |
| 465 | + js_log('f:resourceEdit'); |
| 466 | + var _this = this; |
442 | 467 | //remove any existing resource edit interface: |
443 | | - $j('#rsd_resource_edit').remove(); |
| 468 | + $j('#rsd_resource_edit').remove(); |
444 | 469 | //set the media type: |
445 | 470 | if(rObj.mime.indexOf('image')!=-1){ |
446 | 471 | //set width to default image_edit_width |
— | — | @@ -465,12 +490,15 @@ |
466 | 491 | mv_get_loading_img() + |
467 | 492 | '</div>'+ |
468 | 493 | '</div>'); |
| 494 | + |
| 495 | + js_log('did append to: '+ _this.target_id ); |
| 496 | + |
469 | 497 | $j('#rsd_resource_edit').css('opacity',0); |
470 | 498 | |
471 | 499 | $j('#rsd_edit_img').remove();//remove any existing rsd_edit_img |
472 | 500 | |
473 | 501 | //left side holds the image right size the controls / |
474 | | - $j(this).clone().attr('id', 'rsd_edit_img').appendTo('#clip_edit_disp').css({ |
| 502 | + $j(rsdElement).clone().attr('id', 'rsd_edit_img').appendTo('#clip_edit_disp').css({ |
475 | 503 | 'position':'absolute', |
476 | 504 | 'top':'40%', |
477 | 505 | 'left':'20%', |
— | — | @@ -478,7 +506,7 @@ |
479 | 507 | }); |
480 | 508 | |
481 | 509 | //assume we keep aspect ratio for the thumbnail that we clicked: |
482 | | - var tRatio = $j(this).height() / $j(this).width(); |
| 510 | + var tRatio = $j(rsdElement).height() / $j(rsdElement).width(); |
483 | 511 | if( ! tRatio ) |
484 | 512 | var tRatio = 1; //set ratio to 1 if the width of the thumbnail can't be found for some reason |
485 | 513 | |
— | — | @@ -501,6 +529,8 @@ |
502 | 530 | 'background-color':'#FFF', |
503 | 531 | 'z-index':99 |
504 | 532 | }); |
| 533 | + js_log('do load the media editor:'); |
| 534 | + //do load the media Editor |
505 | 535 | _this.doMediaEdit( rObj , mediaType ); |
506 | 536 | }, |
507 | 537 | loadHQImg:function(rObj, size, target_img_id, callback){ |
— | — | @@ -586,18 +616,23 @@ |
587 | 617 | var cp = rObj.pSobj.cp; |
588 | 618 | var _this = this; |
589 | 619 | rObj.target_resource_title = rObj.titleKey.replace(/File:|Image:/,''); |
590 | | - |
591 | | - //check if we can embed the content locally per a domain name check: |
592 | | - var local_embed_ref=false; |
593 | | - var local_host = parseUri(this.local_wiki_api_url).host; |
594 | | - if( rObj.pSobj.cp.local_domains ) { |
595 | | - for(var i=0;i < rObj.pSobj.cp.local_domains.length; i++){ |
596 | | - var ld = rObj.pSobj.cp.local_domains[i]; |
597 | | - if( local_host.indexOf( ld ) != -1) |
598 | | - local_embed_ref=true; |
599 | | - } |
600 | | - } |
601 | | - //locally embeddalbe jump to callback: |
| 620 | + |
| 621 | + //first do the simple check |
| 622 | + if( rObj.pSobj.cp.local ){ |
| 623 | + local_embed_ref=true; |
| 624 | + }else{ |
| 625 | + //check if we can embed the content locally per a domain name check: |
| 626 | + var local_embed_ref=false; |
| 627 | + var local_host = parseUri(this.local_wiki_api_url).host; |
| 628 | + if( rObj.pSobj.cp.local_domains ) { |
| 629 | + for(var i=0;i < rObj.pSobj.cp.local_domains.length; i++){ |
| 630 | + var ld = rObj.pSobj.cp.local_domains[i]; |
| 631 | + if( local_host.indexOf( ld ) != -1) |
| 632 | + local_embed_ref=true; |
| 633 | + } |
| 634 | + } |
| 635 | + } |
| 636 | + //locally embed jump to callback: |
602 | 637 | if( local_embed_ref ){ |
603 | 638 | cir_callback( rObj ); |
604 | 639 | }else{ |
— | — | @@ -903,11 +938,14 @@ |
904 | 939 | $j(target).html('no paging for combined results'); |
905 | 940 | return ; |
906 | 941 | } |
907 | | - for(var cp_id in this.content_providers){ |
908 | | - var cp = this.content_providers[ cp_id ]; |
909 | | - if(this.disp_item == cp_id){ |
910 | | - js_log('getPaging:'+ cp_id); |
911 | | - var out = getMsg('rsd_results_desc') + (cp.offset+1) + ' to ' + (cp.offset + cp.limit); |
| 942 | + for(var cp_id in this.content_providers){ |
| 943 | + if(this.disp_item == cp_id){ |
| 944 | + var cp = this.content_providers[ cp_id ]; |
| 945 | + //js_log('getPaging:'+ cp_id + ' len: ' + cp.sObj.num_results); |
| 946 | + var to_num = ( cp.limit > cp.sObj.num_results )? |
| 947 | + (cp.offset + cp.sObj.num_results): |
| 948 | + (cp.offset + cp.limit); |
| 949 | + var out = getMsg('rsd_results_desc') + (cp.offset+1) + ' to ' + to_num; |
912 | 950 | //check if we have more results (next prev link) |
913 | 951 | if( cp.offset >= cp.limit ) |
914 | 952 | out+=' <a href="#" id="rsd_pprev">' + getMsg('rsd_results_prev') + cp.limit + '</a>'; |
— | — | @@ -983,7 +1021,7 @@ |
984 | 1022 | offset :0, |
985 | 1023 | limit :20, |
986 | 1024 | more_results :false, |
987 | | - num_results :null, |
| 1025 | + num_results :0, |
988 | 1026 | |
989 | 1027 | //init the object: |
990 | 1028 | init:function( initObj ){ |
— | — | @@ -1052,8 +1090,9 @@ |
1053 | 1091 | |
1054 | 1092 | rObj['pSobj'] = _this; |
1055 | 1093 | //add the result to the result set: |
1056 | | - _this.resultsObj[inx] = rObj; |
1057 | | - }); |
| 1094 | + _this.resultsObj[inx] = rObj; |
| 1095 | + _this.num_results++; |
| 1096 | + }); |
1058 | 1097 | }, |
1059 | 1098 | //by default just return the existing image: |
1060 | 1099 | getImageObj:function( rObj, size, callback){ |
— | — | @@ -1203,7 +1242,7 @@ |
1204 | 1243 | getSearchResults:function(){ |
1205 | 1244 | var _this = this; |
1206 | 1245 | this.loading=true; |
1207 | | - js_log('f:getSearchResults for:' + $j('#'+this.target_input).val() ); |
| 1246 | + js_log('f:getSearchResults for:' + $j('#rsd_q').val() ); |
1208 | 1247 | //empty out the current results: |
1209 | 1248 | this.resultsObj={}; |
1210 | 1249 | //do two queries against the Image / File / MVD namespace: |
— | — | @@ -1242,11 +1281,15 @@ |
1243 | 1282 | }); |
1244 | 1283 | }, |
1245 | 1284 | addResults:function( data ){ |
1246 | | - var _this = this |
| 1285 | + js_log("f:addResults"); |
| 1286 | + var _this = this |
1247 | 1287 | //check if we have |
1248 | | - if( typeof data['query-continue'].search != 'undefined') |
1249 | | - this.more_results = true; |
| 1288 | + if( typeof data['query-continue'] != 'undefined'){ |
| 1289 | + if( typeof data['query-continue'].search != 'undefined') |
| 1290 | + this.more_results = true; |
| 1291 | + } |
1250 | 1292 | //make sure we have pages to iderate: |
| 1293 | + |
1251 | 1294 | if(data.query && data.query.pages){ |
1252 | 1295 | for(var page_id in data.query.pages){ |
1253 | 1296 | var page = data.query.pages[ page_id ]; |
— | — | @@ -1257,23 +1300,24 @@ |
1258 | 1301 | } |
1259 | 1302 | |
1260 | 1303 | this.resultsObj[page_id]={ |
1261 | | - 'titleKey':page.title, |
1262 | | - 'link':page.imageinfo[0].descriptionurl, |
1263 | | - 'title':page.title.replace(/File:|.jpg|.png|.svg|.ogg|.ogv/ig, ''), |
1264 | | - 'poster':page.imageinfo[0].thumburl, |
| 1304 | + 'titleKey' : page.title, |
| 1305 | + 'link' :page.imageinfo[0].descriptionurl, |
| 1306 | + 'title' :page.title.replace(/File:|.jpg|.png|.svg|.ogg|.ogv/ig, ''), |
| 1307 | + 'poster' :page.imageinfo[0].thumburl, |
1265 | 1308 | 'thumbwidth':page.imageinfo[0].thumbwidth, |
1266 | 1309 | 'thumbheight':page.imageinfo[0].thumbheight, |
1267 | | - 'mime':page.imageinfo[0].mime, |
1268 | | - 'src':page.imageinfo[0].url, |
1269 | | - 'desc':page.revisions[0]['*'], |
1270 | | - //add pointer to parent serach obj: |
1271 | | - 'pSobj':_this, |
| 1310 | + 'mime' :page.imageinfo[0].mime, |
| 1311 | + 'src' :page.imageinfo[0].url, |
| 1312 | + 'desc' :page.revisions[0]['*'], |
| 1313 | + //add pointer to parent search obj: |
| 1314 | + 'pSobj' :_this, |
1272 | 1315 | 'meta':{ |
1273 | 1316 | 'categories':page.categories |
1274 | 1317 | } |
1275 | 1318 | } |
| 1319 | + this.num_results++; |
1276 | 1320 | //for(var i in this.resultsObj[page_id]){ |
1277 | | - // js_log('added '+ i +' '+ this.resultsObj[page_id][i]); |
| 1321 | + // js_log('added: '+ i +' '+ this.resultsObj[page_id][i]); |
1278 | 1322 | //} |
1279 | 1323 | } |
1280 | 1324 | }else{ |
— | — | @@ -1348,7 +1392,7 @@ |
1349 | 1393 | return '<video ' + id_attr + |
1350 | 1394 | ' src="' + rObj.src + '" ' + |
1351 | 1395 | style_attr + |
1352 | | - ' poster="'+ outOpt.url + '" '+ |
| 1396 | + ' poster="'+ rObj.poster + '" '+ |
1353 | 1397 | ' ></video>'; |
1354 | 1398 | } |
1355 | 1399 | js_log('ERROR:unsupored mime type: ' + rObj.mime); |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/images/Button_add_media.png |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes on: trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/images/Button_add_media.png |
___________________________________________________________________ |
Name: svn:mime-type |
1356 | 1400 | + application/octet-stream |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/images/remote_cp/cc-flickr.png |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes on: trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/images/remote_cp/cc-flickr.png |
___________________________________________________________________ |
Name: svn:mime-type |
1357 | 1401 | + application/octet-stream |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/images/remote_cp/archive_org_logo_17.png |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes on: trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/images/remote_cp/archive_org_logo_17.png |
___________________________________________________________________ |
Name: svn:mime-type |
1358 | 1402 | + application/octet-stream |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/images/remote_cp/archive_org_logo_80.png |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes on: trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/images/remote_cp/archive_org_logo_80.png |
___________________________________________________________________ |
Name: svn:mime-type |
1359 | 1403 | + application/octet-stream |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/images/remote_cp/metavid_tab.png |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes on: trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/images/remote_cp/metavid_tab.png |
___________________________________________________________________ |
Name: svn:mime-type |
1360 | 1404 | + application/octet-stream |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/images/remote_cp/metavid_logo_17.png |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes on: trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/images/remote_cp/metavid_logo_17.png |
___________________________________________________________________ |
Name: svn:mime-type |
1361 | 1405 | + application/octet-stream |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/images/remote_cp/this_wiki_tab.png |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes on: trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/images/remote_cp/this_wiki_tab.png |
___________________________________________________________________ |
Name: svn:mime-type |
1362 | 1406 | + application/octet-stream |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/images/remote_cp/this_wiki_logo_17.png |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes on: trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/images/remote_cp/this_wiki_logo_17.png |
___________________________________________________________________ |
Name: svn:mime-type |
1363 | 1407 | + application/octet-stream |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/images/remote_cp/wiki_commons_tab.png |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes on: trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/images/remote_cp/wiki_commons_tab.png |
___________________________________________________________________ |
Name: svn:mime-type |
1364 | 1408 | + application/octet-stream |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/images/remote_cp/wiki_commons_logo_17.png |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes on: trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/images/remote_cp/wiki_commons_logo_17.png |
___________________________________________________________________ |
Name: svn:mime-type |
1365 | 1409 | + application/octet-stream |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/images/remote_cp/wiki_commons_logo_80.png |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes on: trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/images/remote_cp/wiki_commons_logo_80.png |
___________________________________________________________________ |
Name: svn:mime-type |
1366 | 1410 | + application/octet-stream |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/images/remote_cp/combined_tab.png |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes on: trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/images/remote_cp/combined_tab.png |
___________________________________________________________________ |
Name: svn:mime-type |
1367 | 1411 | + application/octet-stream |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/images/tab-bg.png |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes on: trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/images/tab-bg.png |
___________________________________________________________________ |
Name: svn:mime-type |
1368 | 1412 | + application/octet-stream |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/images/archive_org_tab.png |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes on: trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/images/archive_org_tab.png |
___________________________________________________________________ |
Name: svn:mime-type |
1369 | 1413 | + application/octet-stream |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/mv_embed.js |
— | — | @@ -1520,7 +1520,7 @@ |
1521 | 1521 | for(var i=0; i < playable_sources.length; i++){ |
1522 | 1522 | if( i==index ){ |
1523 | 1523 | this.selected_source = playable_sources[i]; |
1524 | | - //update the user prefrance: |
| 1524 | + //update the user selected format: |
1525 | 1525 | embedTypes.players.userSelectFormat( playable_sources[i].mime_type); |
1526 | 1526 | break; |
1527 | 1527 | } |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/images/Button_add_media.png |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes on: trunk/extensions/MetavidWiki/skins/mv_embed/images/Button_add_media.png |
___________________________________________________________________ |
Name: svn:mime-type |
1528 | 1528 | + application/octet-stream |