Index: branches/js2-work/phase3/js/mwEmbed/tests/Player_Themable.html |
— | — | @@ -4,16 +4,14 @@ |
5 | 5 | <head> |
6 | 6 | <title> Sample Themed Player </title> |
7 | 7 | Pre-loading demo ( stuff ) likely needed for video display |
8 | | - <!-- <script type="text/javascript" src="../jsScriptLoader.php?debug=true&class=window.jQuery,mwEmbed,$j.ui,mw.EmbedPlayer,nativeEmbed,kplayerEmbed,javaEmbed,vlcEmbed,ctrlBuilder,mvpcfConfig,kskinConfig,$j.fn.menu,$j.cookie,$j.ui.slider,mw.TimedText"></script> |
| 8 | + <!-- |
| 9 | + <script type="text/javascript" src="../jsScriptLoader.php?debug=true&class=window.jQuery,mwEmbed,$j.ui,mw.EmbedPlayer,nativeEmbed,kplayerEmbed,javaEmbed,vlcEmbed,ctrlBuilder,mvpcfConfig,kskinConfig,$j.fn.menu,$j.cookie,$j.ui.slider,mw.TimedText"></script> |
9 | 10 | <script type="text/javascript" src="../jsScriptLoader.php?debug=true&class=mwEmbed"></script> |
10 | 11 | <link rel="stylesheet" href="../skins/styles.css" type="text/css" media="screen" /> |
11 | 12 | <link rel="stylesheet" href="../skins/mvpcf/EmbedPlayer.css" type="text/css" media="screen" /> |
12 | 13 | <link rel="stylesheet" href="../skins/kskin/EmbedPlayer.css" type="text/css" media="screen" /> |
13 | | - <script type="text/javascript" src="../mwEmbed.js?debug=true"></script> |
14 | | - |
15 | 14 | --> |
16 | | - <script type="text/javascript" src="http://cdn.jquerytools.org/1.1.2/full/jquery.tools.min.js"></script> |
17 | | - <script type="text/javascript" src="../jsScriptLoader.php?debug=true&class=mwEmbed"></script> |
| 15 | + <script type="text/javascript" src="../mwEmbed.js?debug=true"></script> |
18 | 16 | |
19 | 17 | </head> |
20 | 18 | <script type="text/javascript"> |
Index: branches/js2-work/phase3/js/mwEmbed/skins/kskin/kskinConfig.js |
— | — | @@ -157,37 +157,47 @@ |
158 | 158 | // Set up control bar pointer |
159 | 159 | this.$playerTarget = embedPlayer.$interface; |
160 | 160 | // Set the menu target: |
161 | | - _this.$kmenu = _this.$playerTarget.find( '.k-menu' ); |
| 161 | + |
162 | 162 | |
163 | 163 | // Options menu display: |
164 | 164 | this.$playerTarget.find( '.k-options' ) |
165 | 165 | .unbind() |
166 | 166 | .click( function() { |
167 | | - if ( _this.$playerTarget.find( '.k-menu' ).length == 0 ) { |
168 | | - // Stop the player if it does not support overlays: |
169 | | - if ( !embedPlayer.supports['overlays'] ) { |
170 | | - embedPlayer.stop(); |
171 | | - } |
172 | | - |
173 | | - // Add the menu binding |
174 | | - _this.addMeunBinding(); |
175 | | - } |
176 | | - _this.$kmenu = _this.$playerTarget.find( '.k-menu' ); |
177 | | - if ( _this.$kmenu.is( ':visible' ) ) { |
178 | | - _this.closeMenuOverlay( $j( this ) ); |
| 167 | + _this.checkMenuOverlay(); |
| 168 | + var $kmenu = _this.$playerTarget.find( '.k-menu' ); |
| 169 | + if ( $kmenu.is( ':visible' ) ) { |
| 170 | + _this.closeMenuOverlay( ); |
179 | 171 | } else { |
180 | | - _this.showMenuOverlay( $j( this ) ); |
| 172 | + _this.showMenuOverlay( ); |
181 | 173 | } |
182 | 174 | } ); |
183 | 175 | |
184 | 176 | }, |
| 177 | + /** |
| 178 | + * checks for menu overlay and runs menu bindings if unset |
| 179 | + */ |
| 180 | + checkMenuOverlay: function(){ |
| 181 | + var _this = this; |
| 182 | + var embedPlayer = this.embedPlayer; |
| 183 | + if ( _this.$playerTarget.find( '.k-menu' ).length == 0 ) { |
| 184 | + // Stop the player if it does not support overlays: |
| 185 | + if ( !embedPlayer.supports['overlays'] ) { |
| 186 | + embedPlayer.stop(); |
| 187 | + } |
| 188 | + |
| 189 | + // Add the menu binding |
| 190 | + _this.addMeunBinding(); |
| 191 | + } |
| 192 | + }, |
185 | 193 | |
186 | 194 | /** |
187 | 195 | * Close the menu overlay |
188 | 196 | */ |
189 | 197 | closeMenuOverlay: function( ) { |
| 198 | + mw.log(" close menu overlay" ); |
190 | 199 | var $optionsMenu = this.$playerTarget.find( '.k-options' ); |
191 | | - this.$kmenu.fadeOut( "fast", function() { |
| 200 | + var $kmenu = this.$playerTarget.find( '.k-menu' ); |
| 201 | + $kmenu.fadeOut( "fast", function() { |
192 | 202 | $optionsMenu.find( 'span' ) |
193 | 203 | .text ( gM( 'mwe-menu_btn' ) ); |
194 | 204 | } ); |
— | — | @@ -199,7 +209,8 @@ |
200 | 210 | */ |
201 | 211 | showMenuOverlay: function( $ktxt ) { |
202 | 212 | var $optionsMenu = this.$playerTarget.find( '.k-options' ); |
203 | | - this.$kmenu.fadeIn( "fast", function() { |
| 213 | + var $kmenu = this.$playerTarget.find( '.k-menu' ); |
| 214 | + $kmenu.fadeIn( "fast", function() { |
204 | 215 | $optionsMenu.find( 'span' ) |
205 | 216 | .text ( gM( 'mwe-close_btn' ) ); |
206 | 217 | } ); |
— | — | @@ -255,6 +266,17 @@ |
256 | 267 | }, |
257 | 268 | |
258 | 269 | /** |
| 270 | + * onClipDone action |
| 271 | + * onClipDone for k-skin (with apiTitleKey) show the "credits" screen: |
| 272 | + */ |
| 273 | + onClipDone: function(){ |
| 274 | + if( this.embedPlayer.apiTitleKey ){ |
| 275 | + this.showMenuOverlay( ); |
| 276 | + this.showMenuItem( 'credits' ); |
| 277 | + } |
| 278 | + }, |
| 279 | + |
| 280 | + /** |
259 | 281 | * Shows a selected menu_item |
260 | 282 | * |
261 | 283 | * NOTE: this should be merged with parent ctrlBuilder optionMenuItems |
Index: branches/js2-work/phase3/js/mwEmbed/skins/ctrlBuilder.js |
— | — | @@ -62,8 +62,7 @@ |
63 | 63 | if ( window[ embedPlayer.skinName + 'Config' ] ) { |
64 | 64 | |
65 | 65 | // Clone as to not override prototype with the skin config |
66 | | - var _this = $j.extend( true, { }, this, window[ embedPlayer.skinName + 'Config'] ); |
67 | | - |
| 66 | + var _this = $j.extend( true, { }, this, window[ embedPlayer.skinName + 'Config'] ); |
68 | 67 | return _this; |
69 | 68 | } |
70 | 69 | // Return the ctrlBuilder Object: |
— | — | @@ -814,7 +813,14 @@ |
815 | 814 | ); |
816 | 815 | } |
817 | 816 | return $optionsMenu; |
818 | | - }, |
| 817 | + }, |
| 818 | + |
| 819 | + /** |
| 820 | + * Allow the ctrlBuilder to do interface actions onDone |
| 821 | + */ |
| 822 | + onClipDone: function(){ |
| 823 | + // Related videos could be shown here |
| 824 | + }, |
819 | 825 | |
820 | 826 | /** |
821 | 827 | * Option menu items |
Index: branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/loader.js |
— | — | @@ -89,7 +89,7 @@ |
90 | 90 | } |
91 | 91 | } |
92 | 92 | return false; |
93 | | -} |
| 93 | +}; |
94 | 94 | |
95 | 95 | /** |
96 | 96 | * Add a DOM ready check for player tags |
Index: branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/mw.EmbedPlayer.js |
— | — | @@ -1811,104 +1811,13 @@ |
1812 | 1812 | _this.doEmbedHTML() |
1813 | 1813 | }, |
1814 | 1814 | |
1815 | | - /** |
1816 | | - * Searches for related clips from titleKey |
1817 | | - * also configuration specific ( should be in seperate file) |
1818 | | - */ |
1819 | | - getRelatedFromTitleKey: function() { |
1820 | | - var _this = this; |
1821 | | - var request = { |
1822 | | - // Normalize the File NS (ie sometimes its present in apiTitleKey other times not |
1823 | | - 'titles' : 'File:' + this.apiTitleKey.replace(/File:|Image:/,''), |
1824 | | - 'generator' : 'categories' |
1825 | | - }; |
1826 | | - mw.getJSON( mw.getApiProviderURL( 'commons' ), request, function( data ) { |
1827 | | - var req_categories = []; |
1828 | | - if ( data.query && data.query.pages ) { |
1829 | | - for ( var pageid in data.query.pages ) { |
1830 | | - if ( data.query.pages[pageid].title ) |
1831 | | - req_categories.push( data.query.pages[pageid].title ); |
1832 | | - } |
1833 | | - _this.getRelatedFromCat( req_categories ); |
1834 | | - } else { |
1835 | | - _this.showThumbnail(); |
1836 | | - } |
1837 | | - } ); |
1838 | | - }, |
1839 | 1815 | |
1840 | | - /** |
1841 | | - * Get Related Clips from a category list |
1842 | | - * Configuration specific ( should be factored into a separate module ) |
1843 | | - * @parma {Object} catlist List of categories |
1844 | | - */ |
1845 | | - getRelatedFromCat:function( catlist ) { |
1846 | | - mw.log( 'getRelatedFromCat' ); |
1847 | | - var _this = this; |
1848 | | - for ( var i = 0 ; i <= catlist.length ; i++ ) { |
1849 | | - if ( !catlist[i] ) |
1850 | | - continue; |
1851 | | - var request = { |
1852 | | - 'generator' : 'categorymembers' , |
1853 | | - 'gcmtitle' : catlist[i], |
1854 | | - 'prop' : 'imageinfo', |
1855 | | - 'iiprop' : 'url', |
1856 | | - 'iiurlwidth': '80' |
1857 | | - }; |
1858 | | - mw.getJSON( mw.commons_apiUrl, request, function( data ) { |
1859 | | - // empty the videos: |
1860 | | - $j( '#' + _this.id + ' .related_vids ul' ).html( ' ' ); |
1861 | | - |
1862 | | - for ( var j in data.query.pages ) { |
1863 | | - // Setup poster default: |
1864 | | - var local_poster = "http://upload.wikimedia.org/wikipedia/commons/7/79/Wiki-commons.png"; |
1865 | | - // Make sure it exists: |
1866 | | - var page = data.query.pages[j]; |
1867 | | - if ( j > 0 && page && page['imageinfo'] ) { |
1868 | | - if ( page['imageinfo'][0].thumburl ) { |
1869 | | - local_poster = page['imageinfo'][0].thumburl; |
1870 | | - } |
1871 | | - var descriptionurl = page['imageinfo'][0].descriptionurl; |
1872 | | - var title_str = page.title.replace( /File:|.ogv$|.oga$|.ogg$/gi, "" ); |
1873 | | - // only link to other videos: |
1874 | | - if ( descriptionurl.match( /\.ogg$|\.ogv$|\.oga$/gi ) != null) { |
1875 | | - // Add the related asset link: |
1876 | | - $j( '#' + _this.id + ' .related_vids ul' ).append( |
1877 | | - $j( '<li />') |
1878 | | - .append( |
1879 | | - // Image link: |
1880 | | - $j( '<a />' ) |
1881 | | - .attr({ |
1882 | | - 'href' : descriptionurl |
1883 | | - }) |
1884 | | - .append( |
1885 | | - $j( '<img />' ) |
1886 | | - .attr({ |
1887 | | - 'src' : local_poster |
1888 | | - }) |
1889 | | - ), |
1890 | | - |
1891 | | - // Title Link: |
1892 | | - $j( '<a />' ) |
1893 | | - .attr({ |
1894 | | - 'title' : title_str, |
1895 | | - 'target' : "_blank", |
1896 | | - 'href' : descriptionurl |
1897 | | - }) |
1898 | | - .text( title_str ) |
1899 | | - ) |
1900 | | - ); |
1901 | | - } |
1902 | | - } |
1903 | | - }; |
1904 | | - } ); // end $j.getJSON |
1905 | | - }; |
1906 | | - }, |
1907 | 1816 | |
1908 | 1817 | /** |
1909 | 1818 | * On clip done action. Called once a clip is done playing |
1910 | 1819 | */ |
1911 | 1820 | onClipDone: function() { |
1912 | | - mw.log( 'base:onClipDone' ); |
| 1821 | + mw.log( 'base:onClipDone' ); |
1913 | 1822 | |
1914 | 1823 | // Stop the clip (load the thumbnail etc) |
1915 | 1824 | this.stop(); |
— | — | @@ -1925,262 +1834,12 @@ |
1926 | 1835 | if ( this.preview_mode ) { |
1927 | 1836 | return ; |
1928 | 1837 | } |
1929 | | - |
1930 | | - // Call the ctrlBuilder end event:: |
1931 | | - |
1932 | | - // If kalturaAttribution and k-skin show the "credits" screen: |
1933 | | - if( mw.getConfig( 'kalturaAttribution' ) && this.ctrlBuilder.showCredits ) { |
1934 | | - this.ctrlBuilder.showCredits(); |
1935 | | - return ; |
1936 | | - } |
1937 | | - |
1938 | | - // Related videos: |
1939 | | - $j( '#img_thumb_' + this.id ).css( 'zindex', 1 ); |
1940 | | - this.$interface.find( '.play-btn-large' ).hide(); |
1941 | | - |
1942 | | - // Add black background |
1943 | | - $j( '#' + this.id ).append( |
1944 | | - $j( '<div />' ) |
1945 | | - .attr({ |
1946 | | - 'id' : 'black_back_' + this.id |
1947 | | - }) |
1948 | | - .css({ |
1949 | | - 'z-index' : -2, |
1950 | | - 'position' : 'absolute', |
1951 | | - 'background' : '#000', |
1952 | | - 'top' : '0px', |
1953 | | - 'left' : '0px', |
1954 | | - 'width' : '100%', |
1955 | | - 'height' : '100%' |
1956 | | - }) |
1957 | | - ); |
1958 | | - |
1959 | | - if ( this.apiTitleKey ) { |
1960 | | - $j( this ).append( |
1961 | | - $j( '<div />' ) |
1962 | | - .addClass( 'related_vids' ), |
1963 | | - |
1964 | | - $j('<h2 />' ) |
1965 | | - .text( gM( 'mwe-related_videos' ) ), |
1966 | | - |
1967 | | - $j('<ul />') |
1968 | | - ); |
1969 | | - $j( '#img_thumb_' + this.id ).fadeOut( "fast" ); |
1970 | | - $j( '#' + _this.id + ' .related_vids ul' ).html( gM( 'mwe-loading_txt' ) ); |
1971 | | - this.getRelatedFromTitleKey(); |
1972 | | - } else { |
1973 | | - this.showNearbyClips(); |
1974 | | - } |
| 1838 | + // Do the ctrlBuilder onClip done interface |
| 1839 | + this.ctrlBuilder.onClipDone(); |
1975 | 1840 | }, |
1976 | 1841 | |
1977 | | - /** |
1978 | | - * Shows nearby clips based on "roe" xml |
1979 | | - * Mostly metavid specific ( should be factored into a separate module ) |
1980 | | - */ |
1981 | | - showNearbyClips: function() { |
1982 | | - var _this = this; |
1983 | | - // add the liks_info_div black back |
1984 | | - $j( this ).append( |
1985 | | - $j( '<div />' ) |
1986 | | - .attr( { |
1987 | | - 'id' : 'liks_info_' + this.id |
1988 | | - }) |
1989 | | - .css({ |
1990 | | - 'width' : parseInt( parseInt( this.width ) / 2 ) + 'px', |
1991 | | - 'height' : parseInt( parseInt( this.height ) ) + 'px', |
1992 | | - 'position' : 'absolute', |
1993 | | - 'top' : '10px', |
1994 | | - 'overflow' : 'auto', |
1995 | | - 'width' : parseInt( ( ( parseInt( this.width ) / 2 ) -15 ) ) , |
1996 | | - 'left' : parseInt( ( ( parseInt( this.width ) / 2 ) + 15 ) ) |
1997 | | - }) |
1998 | | - ); |
1999 | | - // start animation (make thumb small in upper left add in div for "loading" |
2000 | | - $j( '#img_thumb_' + this.id ).animate( { |
2001 | | - width : parseInt( parseInt( _this.width ) / 2 ), |
2002 | | - height : parseInt( parseInt( _this.height ) / 2 ), |
2003 | | - top:20, |
2004 | | - left:10 |
2005 | | - }, |
2006 | | - 1000, |
2007 | | - function() { |
2008 | | - // animation done.. add "loading" to div if empty |
2009 | | - if ( $j( '#liks_info_' + _this.id ).html() == '' ) { |
2010 | | - $j( '#liks_info_' + _this.id ).html( gM( 'mwe-loading_txt' ) ); |
2011 | | - } |
2012 | | - } |
2013 | | - ) |
2014 | | - // now load roe if run the showNextPrevLinks |
2015 | | - if ( this.roe && this.mediaElement.addedROEData == false ) { |
2016 | | - this.getMvJsonUrl( this.roe, function( data ) { |
2017 | | - _this.mediaElement.addROE( data ); |
2018 | | - _this.getNextPrevLinks(); |
2019 | | - } ); |
2020 | | - } else { |
2021 | | - this.getNearbyClipLinks(); |
2022 | | - } |
2023 | | - }, |
2024 | 1842 | |
2025 | 1843 | /** |
2026 | | - * Get nearby Clip links |
2027 | | - * Mostly metavid specific ( should be factored into a separate module ) |
2028 | | - */ |
2029 | | - getNearbyClipLinks: function() { |
2030 | | - mw.log( 'f:getNextPrevLinks' ); |
2031 | | - var anno_track_url = null; |
2032 | | - var _this = this; |
2033 | | - // Check for annotative track |
2034 | | - $j.each( this.mediaElement.sources, function( inx, n ) { |
2035 | | - if ( n.mimeType == 'text/cmml' ) { |
2036 | | - if ( n.id == 'Anno_en' ) { |
2037 | | - anno_track_url = n.src; |
2038 | | - } |
2039 | | - } |
2040 | | - } ); |
2041 | | - |
2042 | | - if ( !anno_track_url ) { |
2043 | | - mw.log( 'no annotative track url found' ); |
2044 | | - // $j('#liks_info_'+this.id).html('no metadata found for related links'); |
2045 | | - _this.showThumbnail(); |
2046 | | - return ; |
2047 | | - } |
2048 | | - |
2049 | | - mw.log( 'We have annotative track:' + anno_track_url ); |
2050 | | - // Zero out seconds (should improve cache hit rate and generally expands metadata search) |
2051 | | - // NOTE: this could be replaced with a regExp |
2052 | | - var annoURL = mw.parseUri( anno_track_url ); |
2053 | | - var times = annoURL.queryKey['t'].split( '/' ); |
2054 | | - var stime_parts = times[0].split( ':' ); |
2055 | | - var etime_parts = times[1].split( ':' ); |
2056 | | - // zero out the hour: |
2057 | | - var new_start = stime_parts[0] + ':' + '0:0'; |
2058 | | - // zero out the end sec |
2059 | | - var new_end = ( etime_parts[0] == stime_parts[0] ) ? ( etime_parts[0] + 1 ) + ':0:0' :etime_parts[0] + ':0:0'; |
2060 | | - |
2061 | | - var etime_parts = times[1].split( ':' ); |
2062 | | - |
2063 | | - var new_anno_track_url = annoURL.protocol + '://' + annoURL.host + annoURL.path + '?'; |
2064 | | - $j.each( annoURL.queryKey, function( i, val ) { |
2065 | | - new_anno_track_url += ( i == 't' ) ? 't=' + new_start + '/' + new_end + '&' : |
2066 | | - i + '=' + val + '&'; |
2067 | | - } ); |
2068 | | - var request_key = new_start + '/' + new_end; |
2069 | | - // check the anno_data cache: |
2070 | | - // NOTE: search cache see if current is in range. |
2071 | | - if ( this.cmmlData ) { |
2072 | | - mw.log( 'anno data found in cache: ' + request_key ); |
2073 | | - this.showNextPrevLinks(); |
2074 | | - } else { |
2075 | | - this.getMvJsonUrl( new_anno_track_url, function( cmml_data ) { |
2076 | | - mw.log( 'raw response: ' + cmml_data ); |
2077 | | - // init cmmlData |
2078 | | - if ( !_this.cmmlData ) |
2079 | | - _this.cmmlData = { }; |
2080 | | - // Grab all metadata and put it into the cmmlData: |
2081 | | - $j(cmml_data).find( 'clip' ).each( function( inx, clip ) { |
2082 | | - _this.cmmlData[ $j( clip ).attr( "id" ) ] = { |
2083 | | - 'start_time_sec':mw.npt2seconds( $j( clip ).attr( "start" ).replace( 'npt:', '' ) ), |
2084 | | - 'end_time_sec':mw.npt2seconds( $j( clip ).attr( "end" ).replace( 'npt:', '' ) ), |
2085 | | - 'time_req':$j( clip ).attr( "start" ).replace( 'npt:', '' ) + '/' + $j( clip ).attr( "end" ).replace( 'npt:', '' ) |
2086 | | - }; |
2087 | | - // grab all its meta |
2088 | | - _this.cmmlData[ $j( clip ).attr( "id" ) ]['meta'] = { }; |
2089 | | - $j.each( clip.getElementsByTagName( 'meta' ), function( imx, meta ) { |
2090 | | - // mw.log('adding meta: '+ $j(meta).attr("name")+ ' = '+ $j(meta).attr("content")); |
2091 | | - _this.cmmlData[$j( clip ).attr( "id" )]['meta'][$j( meta ).attr( "name" )] = $j( meta ).attr( "content" ); |
2092 | | - } ); |
2093 | | - } ); |
2094 | | - _this.showNextPrevLinks(); |
2095 | | - } ); |
2096 | | - } |
2097 | | - // query current request time +|- 60s to get prev next speech links. |
2098 | | - }, |
2099 | | - |
2100 | | - /** |
2101 | | - * Display the nearby clip links |
2102 | | - * Mostly metavid specific ( should be factored into a separate module ) |
2103 | | - */ |
2104 | | - showNearbyClipLinks: function() { |
2105 | | - // mw.log('f:showNextPrevLinks'); |
2106 | | - // int requested links: |
2107 | | - var link = { |
2108 | | - 'prev':'', |
2109 | | - 'current':'', |
2110 | | - 'next':'' |
2111 | | - } |
2112 | | - var curTime = this.getTimeRange().split( '/' ); |
2113 | | - var s_sec = mw.npt2seconds( curTime[0] ); |
2114 | | - var e_sec = mw.npt2seconds( curTime[1] ); |
2115 | | - mw.log( 'showNextPrevLinks: req time: ' + s_sec + ' to ' + e_sec ); |
2116 | | - // now we have all the data in cmmlData |
2117 | | - var current_done = false; |
2118 | | - for ( var clip_id in this.cmmlData ) { // for in loop oky for object |
2119 | | - var clip = this.cmmlData[clip_id]; |
2120 | | - // mw.log('on clip:'+ clip_id); |
2121 | | - // set prev_link (if cur_link is still empty) |
2122 | | - if ( s_sec > clip.end_time_sec ) { |
2123 | | - link.prev = clip_id; |
2124 | | - mw.log( 'showNextPrevLinks: ' + s_sec + ' < ' + clip.end_time_sec + ' set prev' ); |
2125 | | - } |
2126 | | - |
2127 | | - if ( e_sec == clip.end_time_sec && s_sec == clip.start_time_sec ) |
2128 | | - current_done = true; |
2129 | | - // current clip is not done: |
2130 | | - if ( e_sec < clip.end_time_sec && link.current == '' && !current_done ) { |
2131 | | - link.current = clip_id; |
2132 | | - mw.log( 'showNextPrevLinks: ' + e_sec + ' < ' + clip.end_time_sec + ' set current' ); |
2133 | | - } |
2134 | | - |
2135 | | - // set end clip (first clip where start time is > end_time of req |
2136 | | - if ( e_sec < clip.start_time_sec && link.next == '' ) { |
2137 | | - link.next = clip_id; |
2138 | | - mw.log( 'showNextPrevLinks: ' + e_sec + ' < ' + clip.start_time_sec + ' && ' + link.next ); |
2139 | | - } |
2140 | | - } |
2141 | | - var html = ''; |
2142 | | - if ( link.prev == '' && link.current == '' && link.next == '' ) { |
2143 | | - html = '<p><a href="' + this.mediaElement.linkbackgetMsg + '">clip page</a>'; |
2144 | | - } else { |
2145 | | - for ( var link_type in link ) { |
2146 | | - var link_id = link[link_type]; |
2147 | | - if ( link_id != '' ) { |
2148 | | - var clip = this.cmmlData[link_id]; |
2149 | | - var title_msg = ''; |
2150 | | - for ( var j in clip['meta'] ) { |
2151 | | - title_msg += j.replace( /_/g, ' ' ) + ': ' + clip['meta'][j].replace( /_/g, ' ' ) + " <br>"; |
2152 | | - } |
2153 | | - var time_req = clip.time_req; |
2154 | | - if ( link_type == 'current' ) // if current start from end of current clip play to end of current meta: |
2155 | | - time_req = curTime[1] + '/' + mw.seconds2npt( clip.end_time_sec ); |
2156 | | - |
2157 | | - // do special linkbacks for metavid content: |
2158 | | - var regTimeCheck = new RegExp( /[0-9]+:[0-9]+:[0-9]+\/[0-9]+:[0-9]+:[0-9]+/ ); |
2159 | | - html += '<p><a '; |
2160 | | - if ( regTimeCheck.test( this.mediaElement.linkback ) ) { |
2161 | | - html += ' href="' + this.mediaElement.linkback.replace( regTimeCheck, time_req ) + '" '; |
2162 | | - } else { |
2163 | | - html += ' href="#" class="playtimerequest" '; |
2164 | | - } |
2165 | | - html += ' title="' + title_msg + '">' + |
2166 | | - gM( 'mwe-' + link_type + '_clip_msg' ) + |
2167 | | - '</a><br><span style="font-size:small">' + title_msg + '<span></p>'; |
2168 | | - } |
2169 | | - } |
2170 | | - } |
2171 | | - // mw.log("should set html:"+ html); |
2172 | | - $j( '#liks_info_' + this.id ) |
2173 | | - .html( html ) |
2174 | | - //Do bindings: |
2175 | | - .children( '.playtimerequest' ) |
2176 | | - .click( function() { |
2177 | | - _this.stop(); |
2178 | | - _this.updateVideoTimeReq( time_req ); |
2179 | | - _this.play(); |
2180 | | - } ); |
2181 | | - |
2182 | | - }, |
2183 | | - |
2184 | | - /** |
2185 | 1844 | * Shows the video Thumbnail, updates pause state |
2186 | 1845 | */ |
2187 | 1846 | showThumbnail: function() { |
Index: branches/js2-work/phase3/js/mwEmbed/jsScriptLoader.php |
— | — | @@ -69,6 +69,7 @@ |
70 | 70 | |
71 | 71 | /** |
72 | 72 | * Core scriptLoader driver: |
| 73 | + * |
73 | 74 | * get request key |
74 | 75 | * builds javascript string |
75 | 76 | * optionally gzips the output |
— | — | @@ -410,7 +411,7 @@ |
411 | 412 | |
412 | 413 | // Check for the requested classes |
413 | 414 | if ( $reqClassList ) { |
414 | | - // Clean the class list and populate jsFileList |
| 415 | + // sanitize the class list and populate jsFileList |
415 | 416 | foreach ( $reqClassList as $reqClass ) { |
416 | 417 | if ( trim( $reqClass ) != '' ) { |
417 | 418 | if ( substr( $reqClass, 0, 3 ) == 'WT:' ) { |
— | — | @@ -440,7 +441,7 @@ |
441 | 442 | $reqClass = preg_replace( "/[^A-Za-z0-9_\-\.]/", '', $reqClass ); |
442 | 443 | |
443 | 444 | $jsFilePath = self::getJsPathFromClass( $reqClass ); |
444 | | - if(!$jsFilePath){ |
| 445 | + if( !$jsFilePath ){ |
445 | 446 | $this->errorMsg .= 'Requested class: ' . htmlspecialchars( $reqClass ) . ' not found' . "\n"; |
446 | 447 | }else{ |
447 | 448 | $this->jsFileList[ $reqClass ] = $jsFilePath; |
Index: branches/js2-work/phase3/js/mwEmbed/remotes/mediaWiki.js |
— | — | @@ -4,7 +4,7 @@ |
5 | 5 | */ |
6 | 6 | var urlparts = getRemoteEmbedPath(); |
7 | 7 | var mwEmbedHostPath = urlparts[0]; |
8 | | -var mwRemoteVersion = 'r116'; |
| 8 | +var mwRemoteVersion = 'r117'; |
9 | 9 | |
10 | 10 | // Log the mwRemote version ( will determine what version of js we get ) |
11 | 11 | if( window.console ){ |