Index: trunk/extensions/MetavidWiki/includes/MV_Settings.php |
— | — | @@ -6,7 +6,7 @@ |
7 | 7 | /* |
8 | 8 | * your settings overrides here: |
9 | 9 | */ |
10 | | -$mvExternalImages = false; |
| 10 | +$mvExternalImages = true; |
11 | 11 | $mvExternalImgServerPath = 'http://metavid.ucsc.edu/wiki/index.php'; |
12 | 12 | |
13 | 13 | ?> |
\ No newline at end of file |
Index: trunk/extensions/MetavidWiki/includes/specials/MV_SpecialExport.php |
— | — | @@ -248,7 +248,7 @@ |
249 | 249 | if(!$inline)header('Content-Type: text/xml'); |
250 | 250 | //print the header: |
251 | 251 | if(!$inline)print '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'."\n"; |
252 | | - if(!$inline)print '<!DOCTYPE cmml SYSTEM "cmml.dtd">'."\n"; |
| 252 | + //if(!$inline)print '<!DOCTYPE cmml SYSTEM "http://svn.annodex.net/standards/cmml_2_0.dtd">'."\n"; |
253 | 253 | $tracks=array(); |
254 | 254 | if(count($dbr->numRows($mvd_res))!=0){ |
255 | 255 | global $wgOut; |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/mv_embed.js |
— | — | @@ -727,8 +727,7 @@ |
728 | 728 | this.getParseCMML(); |
729 | 729 | } |
730 | 730 | //start the autoscroll timer: |
731 | | - this.setAutoScroll(true); |
732 | | - |
| 731 | + this.setAutoScroll(true); |
733 | 732 | }, |
734 | 733 | //@@todo seperate out data loader & data display |
735 | 734 | getParseCMML:function(){ |
— | — | @@ -778,12 +777,15 @@ |
779 | 778 | url+='t='+seconds2ntp(req_time[0])+'/'+seconds2ntp(req_time[1])+'&'; |
780 | 779 | } |
781 | 780 | } |
782 | | - js_log('do request on url:' + url); |
783 | | - $j('#mv_loading_icon').css('display','inline'); |
| 781 | + //js_log('do request on url:' + url); |
| 782 | + //$j('#mv_loading_icon').css('display','inline'); |
784 | 783 | do_request(url, function(data){ |
| 784 | + //js_log('wtf' + data.xml); |
| 785 | + //js_log("load track data: "+ data.toString() ); |
785 | 786 | //hide loading icon: |
786 | 787 | $j('#mv_loading_icon').css('display','none'); |
787 | 788 | $j.each(data.getElementsByTagName('clip'), function(inx, n){ |
| 789 | + js_log('on clip '+ n.getAttribute('id')); |
788 | 790 | var text_clip = { |
789 | 791 | start:n.getAttribute('start').replace('ntp:', ''), |
790 | 792 | end:n.getAttribute('end').replace('ntp:', ''), |
— | — | @@ -791,10 +793,15 @@ |
792 | 794 | id:n.getAttribute('id') |
793 | 795 | } |
794 | 796 | $j.each(n.getElementsByTagName('body'), function(binx, bn){ |
795 | | - text_clip.body = bn.textContent; |
796 | | - }); |
| 797 | + if(bn.textContent){ |
| 798 | + text_clip.body = bn.textContent; |
| 799 | + }else if(bn.text){ |
| 800 | + text_clip.body = bn.text; |
| 801 | + } |
| 802 | + }); |
797 | 803 | _this.add_merge_text_clip(text_clip); |
798 | 804 | }); |
| 805 | + //js_log('done with merge insert text clips'); |
799 | 806 | //done loading update availableTracks |
800 | 807 | _this.availableTracks[track_id].loaded=true; |
801 | 808 | _this.availableTracks[track_id].display=true; |
— | — | @@ -813,14 +820,23 @@ |
814 | 821 | '</div>'+ |
815 | 822 | text_clip.body + |
816 | 823 | '</div>'; |
| 824 | + |
| 825 | + if($j('#mmbody_'+this.pe.id).length==0)this.show(); |
| 826 | + |
817 | 827 | $j('#mmbody_'+this.pe.id +' .mvtt').each(function(){ |
| 828 | + js_log('searching for insert point..'); |
818 | 829 | if(!inserted){ |
| 830 | + js_log( ntp2seconds($j(this).attr('start')) + ' > ' + text_clip_start_time); |
819 | 831 | if( ntp2seconds($j(this).attr('start')) > text_clip_start_time){ |
820 | 832 | inserted=true; |
| 833 | + |
821 | 834 | $j(this).before(insertHTML); |
822 | 835 | } |
| 836 | + }else{ |
| 837 | + js_log('already inserted') |
823 | 838 | } |
824 | 839 | }); |
| 840 | + //js_log('should just append: '+insertHTML); |
825 | 841 | if(!inserted){ |
826 | 842 | $j('#mmbody_'+this.pe.id ).append(insertHTML); |
827 | 843 | } |
— | — | @@ -834,21 +850,22 @@ |
835 | 851 | if($j('#metaBox_'+this.pe.id).length==0){ |
836 | 852 | //append it to body relative to offset of this.pe |
837 | 853 | var loc = $j(this.pe).position(); |
| 854 | + js_log('got loc'); |
838 | 855 | js_log('top ' +loc.top + ' left:'+loc.left ); |
839 | 856 | var append ='<div style="position:absolute;z-index: 5001;' + |
840 | | - 'top:'+(loc.top-4)+'px;' + |
841 | | - 'left:'+(parseInt(loc.left)+parseInt(this.pe.width))+'px;' + |
| 857 | + 'top:'+(loc.top)+'px;' + |
| 858 | + 'left:'+(parseInt(loc.left)+parseInt(this.pe.width)+10)+'px;' + |
842 | 859 | 'height:'+this.pe.height+'px;width:400px;' + |
843 | 860 | 'background:white;border:solid black;" ' + |
844 | 861 | 'id="metaBox_'+this.pe.id+'">' + |
845 | 862 | this.getMenu() + |
846 | 863 | this.getBody() + |
847 | 864 | '</div>'; |
848 | | - $j(this.pe).after(append); |
| 865 | + $j(this.pe).after(append); |
849 | 866 | //$j('body').append(); |
850 | 867 | }else{ |
851 | 868 | $j('#metaBox_'+this.pe.id).fadeIn("fast"); |
852 | | - } |
| 869 | + } |
853 | 870 | }, |
854 | 871 | close:function(){ |
855 | 872 | //the meta box: |
— | — | @@ -857,7 +874,7 @@ |
858 | 875 | $j('#metaText_'+this.pe.id).fadeIn('fast'); |
859 | 876 | }, |
860 | 877 | getBody:function(){ |
861 | | - return '<div id="mmbody_'+this.pe.id+'" style="position:absolute;top:20px;left:0px;right:0px;bottom:0px;overflow:auto;"/>'; |
| 878 | + return '<div id="mmbody_'+this.pe.id+'" style="position:absolute;top:20px;left:0px;right:0px;bottom:0px;height:'+(this.pe.height-20)+'px;overflow:auto;"/>'; |
862 | 879 | }, |
863 | 880 | getTsSelect:function(){ |
864 | 881 | js_log('getTsSelect'); |
— | — | @@ -902,7 +919,7 @@ |
903 | 920 | }, |
904 | 921 | monitor:function(){ |
905 | 922 | //grab the time from the video object |
906 | | - var cur_time = parseInt(this.pe.currentTime()); |
| 923 | + var cur_time = parseInt( this.pe.currentTime() ); |
907 | 924 | if(cur_time!=0 && this.prevTimeScroll!=cur_time){ |
908 | 925 | //search for current time: flash red border trascript |
909 | 926 | _this = this; |
— | — | @@ -922,7 +939,9 @@ |
923 | 940 | this.scrollTimerId = setInterval('document.getElementById(\''+this.pe.id+'\').textInterface.monitor()', 500); |
924 | 941 | } |
925 | 942 | //jump to the current position: |
926 | | - var cur_time = parseInt(this.pe.currentTime()); |
| 943 | + var cur_time = parseInt (this.pe.currentTime()); |
| 944 | + js_log('cur time: '+ cur_time); |
| 945 | + |
927 | 946 | _this = this; |
928 | 947 | $j('#mmbody_'+this.pe.id +' .mvtt').each(function(){ |
929 | 948 | if(cur_time > ntp2seconds($j(this).attr('start')) ){ |
— | — | @@ -939,16 +958,18 @@ |
940 | 959 | getMenu:function(){ |
941 | 960 | var out=''; |
942 | 961 | //add in loading icon: |
| 962 | + /* |
943 | 963 | out+= '<div class="mv_loading_icon" style="background:url(\''+mv_embed_path+'images/indicator.gif\');display:'; |
944 | 964 | out+= (this.roe_data)? 'none':'inline'; |
945 | 965 | out+='"/>'; |
| 966 | + */ |
946 | 967 | var as_checked = (this.autoscroll)?'checked':''; |
947 | 968 | out+= '<div id="mmenu_'+this.pe.id+'" style="background:#AAF;font-size:small;position:absolute;top:0;height:20px;left:0px;right:0px;">' + |
948 | 969 | '<a style="font-color:#000;" title="'+getMsg('close')+'" href="#" onClick="document.getElementById(\''+this.pe.id+'\').closeTextInterface();return false;">'+ |
949 | 970 | '<img border="0" width="16" height="16" src="'+mv_embed_path + 'images/cancel.png"></a> ' + |
950 | 971 | '<a style="font-color:#000;" title="'+getMsg('select_transcript_set')+'" href="#" onClick="document.getElementById(\''+this.pe.id+'\').textInterface.getTsSelect();return false;">'+ |
951 | 972 | getMsg('select_transcript_set')+'</a> | ' + |
952 | | - '<input onClick="document.getElementById(\''+this.pe.id+'\').textInterface.setAutoScroll(this.checked)" ' + |
| 973 | + '<input onClick="document.getElementById(\''+this.pe.id+'\').textInterface.setAutoScroll(this.checked);return false;" ' + |
953 | 974 | 'type="checkbox" '+as_checked +'>'+getMsg('auto_scroll'); |
954 | 975 | if(this.pe.linkback){ |
955 | 976 | out+=' | <a style="font-color:#000;" title="'+getMsg('improve_transcript')+'" href="'+this.pe.linkback+'">'+ |
— | — | @@ -1394,6 +1415,7 @@ |
1395 | 1416 | } |
1396 | 1417 | //show interface |
1397 | 1418 | this.textInterface.show(); |
| 1419 | + //js_log('text interface should be show'); |
1398 | 1420 | }, |
1399 | 1421 | closeTextInterface:function(){ |
1400 | 1422 | js_log('closeTextInterface '+ typeof this.textInterface); |
— | — | @@ -1772,7 +1794,7 @@ |
1773 | 1795 | function mv_addLoadEvent(func) { |
1774 | 1796 | mvEmbed.addLoadEvent(func); |
1775 | 1797 | } |
1776 | | - function do_request(req_url,callback,mv_json_response){ |
| 1798 | + function do_request(req_url, callback, mv_json_response){ |
1777 | 1799 | js_log('do request: ' + req_url); |
1778 | 1800 | if( parseUri(document.URL).host == parseUri(req_url).host){ |
1779 | 1801 | //no proxy at all do a direct request: |
— | — | @@ -1786,12 +1808,14 @@ |
1787 | 1809 | }else{ |
1788 | 1810 | //check if MV_embed path matches document.URL then we can use the local proxy: |
1789 | 1811 | if(parseUri(document.URL).host == parseUri(mv_embed_path).host ){ |
1790 | | - js_log('use mv_embed_proxy : ' + parseUri(document.URL).host + ' != '+ parseUri(req_url).host); |
| 1812 | + js_log('use mv_embed_proxy : ' + parseUri(document.URL).host + ' != '+ parseUri(req_url).host); |
| 1813 | + js_log("do ajax req:" +req_url); |
1791 | 1814 | $j.ajax({ |
1792 | 1815 | type: "POST", |
1793 | 1816 | url:mv_embed_path + 'mv_data_proxy.php', |
1794 | 1817 | data:{url:req_url}, |
1795 | | - success:function(data){ |
| 1818 | + success:function(data){ |
| 1819 | + js_log("did ajax req:"+ typeof data); |
1796 | 1820 | callback(data); |
1797 | 1821 | } |
1798 | 1822 | }); |
— | — | @@ -1834,7 +1858,7 @@ |
1835 | 1859 | } |
1836 | 1860 | global_req_cb[response['cb_inx']](response['pay_load']); |
1837 | 1861 | } |
1838 | | -//load external via dom injection |
| 1862 | +//load external js via dom injection |
1839 | 1863 | function loadExternalJs(url){ |
1840 | 1864 | js_log('load js: '+ url); |
1841 | 1865 | var e = document.createElement("script"); |
— | — | @@ -1889,7 +1913,26 @@ |
1890 | 1914 | js_log('already absolute'); |
1891 | 1915 | } |
1892 | 1916 | } |
| 1917 | +if (typeof DOMParser == "undefined") { |
| 1918 | + DOMParser = function () {} |
1893 | 1919 | |
| 1920 | + DOMParser.prototype.parseFromString = function (str, contentType) { |
| 1921 | + if (typeof ActiveXObject != "undefined") { |
| 1922 | + var d = new ActiveXObject("MSXML.DomDocument"); |
| 1923 | + d.loadXML(str); |
| 1924 | + return d; |
| 1925 | + } else if (typeof XMLHttpRequest != "undefined") { |
| 1926 | + var req = new XMLHttpRequest; |
| 1927 | + req.open("GET", "data:" + (contentType || "application/xml") + |
| 1928 | + ";charset=utf-8," + encodeURIComponent(str), false); |
| 1929 | + if (req.overrideMimeType) { |
| 1930 | + req.overrideMimeType(contentType); |
| 1931 | + } |
| 1932 | + req.send(null); |
| 1933 | + return req.responseXML; |
| 1934 | + } |
| 1935 | + } |
| 1936 | +} |
1894 | 1937 | /* |
1895 | 1938 | * utility functions: |
1896 | 1939 | */ |
— | — | @@ -1901,14 +1944,14 @@ |
1902 | 1945 | /* |
1903 | 1946 | * IE and non-firebug debug: |
1904 | 1947 | */ |
1905 | | - /*var log_elm = document.getElementById('mv_js_log'); |
| 1948 | + var log_elm = document.getElementById('mv_js_log'); |
1906 | 1949 | if(!log_elm){ |
1907 | 1950 | document.write('<div style="position:absolute;z-index:50;top:0px;left:0px;right:0px;height:150px;"><textarea id="mv_js_log" cols="80" rows="6"></textarea></div>'); |
1908 | 1951 | var log_elm = document.getElementById('mv_js_log'); |
1909 | 1952 | } |
1910 | 1953 | if(log_elm){ |
1911 | 1954 | log_elm.value+=string+"\n"; |
1912 | | - }*/ |
| 1955 | + } |
1913 | 1956 | } |
1914 | 1957 | } |
1915 | 1958 | //} |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/mv_vlcEmbed.js |
— | — | @@ -273,7 +273,7 @@ |
274 | 274 | return this.vlc.input.time/1000; |
275 | 275 | } |
276 | 276 | } |
277 | | - return 0; |
| 277 | + return '0'; |
278 | 278 | }, |
279 | 279 | // get the embed vlc object |
280 | 280 | getVLC : function getVLC(){ |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/sample_page.php |
— | — | @@ -36,10 +36,9 @@ |
37 | 37 | //$sample_embed[1]['desc'] = '<b>RSS</b> a podcast like dynamic feed for "peace"<br />'. |
38 | 38 | // '<iframe width="500" height="200" src="'.$plurl.'">rss feed here</iframe>'; |
39 | 39 | |
40 | | -$sample_embed[1]['tag'] = '<video roe="http://localhost/mvWiki/index.php?title=Special:MvExportStream&feed_format=roe&stream_name=Senate_proceeding_08-01-07&t=0:00:00/0:05:00">'; |
41 | | -$sample_embed[1]['desc'] = 'Demo of json ROE attribute'; |
| 40 | +//$sample_embed[1]['tag'] = '<video roe="http://192.168.0.104/mvWiki/index.php?title=Special:MvExportStream&feed_format=roe&stream_name=Senate_proceeding_08-01-07&t=0:00:00/0:05:00">'; |
| 41 | +//$sample_embed[1]['desc'] = 'Demo of json ROE attribute'; |
42 | 42 | |
43 | | - |
44 | 43 | $sample_embed[2]['tag'] = '<video roe="http://metavid.ucsc.edu/wiki/index.php?title=Special:MvExportStream&feed_format=roe&stream_name=Senate_proceeding_08-01-07&t=0:06:00/0:07:00">'; |
45 | 44 | $sample_embed[2]['desc'] = 'Demo2 of json ROE attribute'; |
46 | 45 | |