Index: branches/MwEmbedStandAlone/mwEmbed.js |
— | — | @@ -2363,12 +2363,14 @@ |
2364 | 2364 | $btn.addClass( options['class'] ) |
2365 | 2365 | } |
2366 | 2366 | |
2367 | | - $btn.append( |
2368 | | - $j('<span />').addClass( 'ui-icon ui-icon-' + options.icon_id ), |
2369 | | - $j('<span />').addClass( 'btnText' ) |
2370 | | - .text( options.text ) |
2371 | | - ); |
2372 | | - return $btn; |
| 2367 | + |
| 2368 | + // return the button: |
| 2369 | + return $btn.append( |
| 2370 | + $j('<span />').addClass( 'ui-icon ui-icon-' + options.icon_id ), |
| 2371 | + $j('<span />').addClass( 'btnText' ) |
| 2372 | + .text( options.text ) |
| 2373 | + ) |
| 2374 | + .buttonHover(); // add buttonHover binding; |
2373 | 2375 | }; |
2374 | 2376 | |
2375 | 2377 | // Shortcut to bind hover state |
Index: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilLayout.js |
— | — | @@ -114,6 +114,7 @@ |
115 | 115 | }, |
116 | 116 | |
117 | 117 | drawElementThumb: function( $target, $node, relativeTime ){ |
| 118 | + mw.log('SmilLayout::drawElementThumb: ' + relativeTime ); |
118 | 119 | // parse the time incase it came in as human input |
119 | 120 | relativeTime = this.smil.parseTime( relativeTime ); |
120 | 121 | switch ( this.smil.getRefType( $node )){ |
Index: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilBuffer.js |
— | — | @@ -296,7 +296,7 @@ |
297 | 297 | * Clip ready for grabbing a frame such as a canvas thumb |
298 | 298 | */ |
299 | 299 | bufferedSeek: function( smilElement, relativeTime, callback ){ |
300 | | - //mw.log("SmilBuffer::bufferedSeek:" + this.smil.getAssetId( smilElement ) + ' time:' + relativeTime ); |
| 300 | + mw.log("SmilBuffer::bufferedSeek:" + this.smil.getAssetId( smilElement ) + ' time:' + relativeTime ); |
301 | 301 | |
302 | 302 | var absoluteTime = relativeTime; |
303 | 303 | if( $j( smilElement ).attr('clipBegin') ){ |
— | — | @@ -421,7 +421,6 @@ |
422 | 422 | _this.videoSeekListeners[ assetId ].listen = true; |
423 | 423 | _this.registerVideoSeekListener( assetId ); |
424 | 424 | } |
425 | | - |
426 | 425 | // Update the current context callback |
427 | 426 | _this.videoSeekListeners[ assetId ].callback = function(){ |
428 | 427 | // Seek has completed open up seek Listeners for future seeks |
— | — | @@ -430,9 +429,11 @@ |
431 | 430 | // Set this asset to ready ( asset ready set ) |
432 | 431 | _this.assetReady( assetId ); |
433 | 432 | |
434 | | - // Run the callback |
| 433 | + // Run the callback |
435 | 434 | if( callback ){ |
436 | 435 | callback(); |
| 436 | + // set the callback to null in case seeked is fired twice. |
| 437 | + callback = null; |
437 | 438 | } |
438 | 439 | } |
439 | 440 | |
Index: branches/MwEmbedStandAlone/modules/TimedText/mw.TimedTextEdit.js |
— | — | @@ -207,29 +207,28 @@ |
208 | 208 | $target.append( |
209 | 209 | //Get a little helper input filed to update the language |
210 | 210 | $j('<input />') |
211 | | - .attr( { |
212 | | - 'id' : "timed-text-langKey-input", |
213 | | - 'type' : "text", |
214 | | - 'maxlength' : "10", |
215 | | - 'size' :"3" |
216 | | - } ) |
217 | | - .change(function() { |
218 | | - var langKey = $j(this).val(); |
219 | | - if( mw.languages[ langKey ] ) { |
220 | | - $buttonTarget.find('.btnText').text( |
221 | | - unescape( mw.languages[ langKey ] ) |
222 | | - ); |
223 | | - } |
224 | | - }), |
| 211 | + .attr( { |
| 212 | + 'id' : "timed-text-langKey-input", |
| 213 | + 'type' : "text", |
| 214 | + 'maxlength' : "10", |
| 215 | + 'size' :"3" |
| 216 | + } ) |
| 217 | + .change(function() { |
| 218 | + var langKey = $j(this).val(); |
| 219 | + if( mw.languages[ langKey ] ) { |
| 220 | + $buttonTarget.find('.btnText').text( |
| 221 | + unescape( mw.languages[ langKey ] ) |
| 222 | + ); |
| 223 | + } |
| 224 | + }), |
225 | 225 | // Get a jQuery button object with language menu: |
226 | 226 | $j.button( { |
227 | 227 | 'style': { 'float' : 'left' }, |
228 | 228 | 'class': 'language-select-btn', |
229 | 229 | 'text': gM('mwe-timedtext-select-language'), |
230 | 230 | 'icon_id': 'triangle-1-e' |
231 | | - } ).attr('id', 'language-select') |
232 | | - .unbind() |
233 | | - .buttonHover() |
| 231 | + } ) |
| 232 | + .attr('id', 'language-select') |
234 | 233 | ) |
235 | 234 | |
236 | 235 | |
— | — | @@ -301,8 +300,6 @@ |
302 | 301 | 'text': gM('mwe-timedtext-upload-text'), |
303 | 302 | 'icon_id': 'disk' |
304 | 303 | } ) |
305 | | - .unbind() |
306 | | - .buttonHover() |
307 | 304 | .click( function() { |
308 | 305 | _this.uploadTextFile(); |
309 | 306 | }) |
Index: branches/MwEmbedStandAlone/modules/AddMedia/mw.RemoteSearchDriver.js |
— | — | @@ -74,7 +74,7 @@ |
75 | 75 | "rsd-wiki_commons-title": "Wikimedia Commons", |
76 | 76 | "rsd-wiki_commons": "Wikimedia Commons, an archive of freely-licensed educational media content (images, sound and video clips)", |
77 | 77 | |
78 | | - "rsd-kaltura-title" : "All sources", |
| 78 | + "rsd-kaltura-title" : "Kaltura search ( all sources )", |
79 | 79 | "rsd-kaltura" : "Kaltura aggregated search for free-licensed media across multiple search providers", |
80 | 80 | |
81 | 81 | "rsd-this_wiki-title" : "This wiki", |
— | — | @@ -104,7 +104,15 @@ |
105 | 105 | // The target button or link that will invoke the search interface |
106 | 106 | 'target_invoke_button': null, |
107 | 107 | |
| 108 | + // Default id for search target input |
| 109 | + 'target_search_input' : '#rsd_q', |
| 110 | + |
108 | 111 | /** |
| 112 | + * Callback functions: |
| 113 | + */ |
| 114 | + 'resourceSelectionCallback' : null, |
| 115 | + |
| 116 | + /** |
109 | 117 | * import_url_mode |
110 | 118 | * Can be 'api', 'autodetect', 'remote_link' |
111 | 119 | * api: uses the mediawiki api to insert the media asset |
— | — | @@ -146,8 +154,11 @@ |
147 | 155 | // 'nc' ( non-commercial ), 'all' ( all found licenses are "ok") |
148 | 156 | 'enabled_licenses' : ['pd', 'by', 'sa' ], |
149 | 157 | |
| 158 | + // If the input text should be displayed |
| 159 | + 'displaySearchInput' : true, |
| 160 | + |
150 | 161 | // If we should display resource icons |
151 | | - 'displayResourceInfoIcons' : true, |
| 162 | + 'displayResourceInfoIcons' : true, |
152 | 163 | |
153 | 164 | // If we should display the result format button. |
154 | 165 | 'displayResultFormatButton': true, |
— | — | @@ -166,7 +177,6 @@ |
167 | 178 | |
168 | 179 | $.fn.addMediaWizard = function( options, callback ) { |
169 | 180 | options['target_invoke_button'] = this.selector; |
170 | | - options['instance_name'] = 'rsdMVRS'; |
171 | 181 | window['rsdMVRS'] = new mw.RemoteSearchDriver( options ); |
172 | 182 | if( callback ) { |
173 | 183 | callback( window['rsdMVRS'] ); |
— | — | @@ -442,7 +452,7 @@ |
443 | 453 | */ |
444 | 454 | init: function( options ) { |
445 | 455 | var _this = this; |
446 | | - mw.log( 'remoteSearchDriver:init' ); |
| 456 | + mw.log( 'RemoteSearchDriver:init' ); |
447 | 457 | |
448 | 458 | // Add in a local "id" reference to each provider |
449 | 459 | for ( var provider_id in this.content_providers ) { |
— | — | @@ -730,11 +740,11 @@ |
731 | 741 | var query = _this.getDefaultQuery(); |
732 | 742 | |
733 | 743 | // Refresh the container if "upload" or "changed query" |
734 | | - if ( query != $j( '#rsd_q' ).val() |
| 744 | + if ( query != $j( this.target_search_input ).val() |
735 | 745 | || |
736 | 746 | this.current_provider == 'upload' ) |
737 | 747 | { |
738 | | - $j( '#rsd_q' ).val( query ); |
| 748 | + $j( this.target_search_input ).val( query ); |
739 | 749 | _this.updateResults(); |
740 | 750 | } |
741 | 751 | // $j(_this.target_container).dialog("open"); |
— | — | @@ -872,12 +882,16 @@ |
873 | 883 | |
874 | 884 | var $mainContainer = $j( this.target_container ); |
875 | 885 | |
876 | | - var $controlContainer = this.createControlContainer(); |
| 886 | + // Add the provider seleciton |
| 887 | + $mainContainer.append( this.createProviderSelection() ); |
877 | 888 | |
878 | | - $mainContainer.append( $controlContainer ); |
| 889 | + // Add the searchInput control if it should be displayed: |
| 890 | + if( this.displaySearchInput ){ |
| 891 | + $mainContainer.append( this.createSearchInput() ); |
| 892 | + }; |
879 | 893 | |
880 | 894 | this.$resultsContainer = $j('<div />').attr({ |
881 | | - id: "rsd_results_container" |
| 895 | + id : "rsd_results_container" |
882 | 896 | }); |
883 | 897 | |
884 | 898 | $mainContainer.append( this.$filtersContainer ); |
— | — | @@ -885,7 +899,7 @@ |
886 | 900 | |
887 | 901 | // Run the default search: |
888 | 902 | if ( this.getDefaultQuery() ){ |
889 | | - this.updateResults(); |
| 903 | + _this.updateResults(); |
890 | 904 | } |
891 | 905 | |
892 | 906 | // Add bindings |
— | — | @@ -920,12 +934,47 @@ |
921 | 935 | // Setup base cancel button binding |
922 | 936 | this.onCancelResourceEdit(); |
923 | 937 | }, |
924 | | - |
| 938 | + |
| 939 | + createProviderSelection: function(){ |
| 940 | + var _this = this; |
| 941 | + var $providerSelection = $j( '<ul />' ) |
| 942 | + .addClass( "ui-provider-selection" ); |
| 943 | + // Add enabled search providers. |
| 944 | + for ( var providerName in this.content_providers ) { |
| 945 | + var content_providers = this.content_providers; |
| 946 | + var provider = content_providers[ providerName ]; |
| 947 | + if ( provider.enabled && provider.apiUrl ) { |
| 948 | + var $anchor = $j( '<div />' ) |
| 949 | + .text( gM( 'rsd-' + providerName + '-title' ) ) |
| 950 | + .attr({ |
| 951 | + name: providerName |
| 952 | + }); |
| 953 | + if ( this.current_provider == providerName) { |
| 954 | + $anchor.addClass( 'ui-selected' ); |
| 955 | + } |
| 956 | + |
| 957 | + $anchor.click( function() { |
| 958 | + $j( this ).parent().parent().find( '.ui-selected' ) |
| 959 | + .removeClass( 'ui-selected' ); |
| 960 | + $j( this ).addClass( 'ui-selected' ); |
| 961 | + _this.current_provider = $j( this ).attr( "name" ); |
| 962 | + // Update the search results on provider selection |
| 963 | + _this.updateResults( _this.current_provider, true ); |
| 964 | + return false; |
| 965 | + }); |
| 966 | + |
| 967 | + var $listItem = $j( '<li />' ); |
| 968 | + $listItem.append( $anchor ); |
| 969 | + $providerSelection.append( $listItem ); |
| 970 | + } |
| 971 | + } |
| 972 | + return $providerSelection; |
| 973 | + }, |
925 | 974 | /** |
926 | 975 | * Creates the search control (i.e. Search textbox, search button, provider filter). |
927 | 976 | * @return A jQuery-generated HTML element ready to be injected in the main container. |
928 | 977 | */ |
929 | | - createControlContainer: function() { |
| 978 | + createSearchInput: function() { |
930 | 979 | var _this = this; |
931 | 980 | var $controlContainer = $j( '<div />' ) |
932 | 981 | .addClass( "rsd_control_container" ); |
— | — | @@ -935,22 +984,20 @@ |
936 | 985 | action : "javascript:return false" |
937 | 986 | }); |
938 | 987 | |
939 | | - var $providerSelection = $j( '<ul />' ) |
940 | | - .addClass( "ui-provider-selection" ); |
941 | | - |
942 | | - var $searchButton = $j.button({ |
943 | | - icon_id: 'search', |
944 | | - text: gM( 'mwe-media_search' ) }) |
945 | | - .addClass( 'rsd_search_button' ) |
946 | | - .buttonHover() |
947 | | - .click(function () { |
948 | | - if( _this.current_provider == 'upload' ){ |
949 | | - _this.current_provider = _this.previus_provider; |
950 | | - } |
951 | | - _this.updateResults( _this.current_provider, true ); |
952 | | - return false; |
953 | | - }); |
954 | 988 | |
| 989 | + var $searchButton = $j.button({ |
| 990 | + icon_id: 'search', |
| 991 | + text: gM( 'mwe-media_search' ) |
| 992 | + }) |
| 993 | + .addClass( 'rsd_search_button' ) |
| 994 | + .click(function () { |
| 995 | + if( _this.current_provider == 'upload' ){ |
| 996 | + _this.current_provider = _this.previus_provider; |
| 997 | + } |
| 998 | + _this.updateResults( _this.current_provider, true ); |
| 999 | + return false; |
| 1000 | + }); |
| 1001 | + |
955 | 1002 | var $searchBox = $j( '<input />' ) |
956 | 1003 | .addClass( 'ui-corner-all' ) |
957 | 1004 | .attr({ |
— | — | @@ -972,40 +1019,10 @@ |
973 | 1020 | $searchButton.removeClass("ui-button-disabled"); |
974 | 1021 | } |
975 | 1022 | }); |
976 | | - |
977 | | - // Add enabled search providers. |
978 | | - for ( var providerName in this.content_providers ) { |
979 | | - var content_providers = this.content_providers; |
980 | | - var provider = content_providers[ providerName ]; |
981 | | - if ( provider.enabled && provider.apiUrl ) { |
982 | | - var $anchor = $j( '<div />' ) |
983 | | - .text( gM( 'rsd-' + providerName + '-title' ) ) |
984 | | - .attr({ |
985 | | - name: providerName |
986 | | - }); |
987 | | - if ( this.current_provider == providerName) { |
988 | | - $anchor.addClass( 'ui-selected' ); |
989 | | - } |
990 | | - |
991 | | - $anchor.click( function() { |
992 | | - $j( this ).parent().parent().find( '.ui-selected' ) |
993 | | - .removeClass( 'ui-selected' ); |
994 | | - $j( this ).addClass( 'ui-selected' ); |
995 | | - _this.current_provider = $j( this ).attr( "name" ); |
996 | | - // Update the search results on provider selection |
997 | | - _this.updateResults( _this.current_provider, true ); |
998 | | - return false; |
999 | | - }); |
1000 | | - |
1001 | | - var $listItem = $j( '<li />' ); |
1002 | | - $listItem.append( $anchor ); |
1003 | | - $providerSelection.append( $listItem ); |
1004 | | - } |
1005 | | - } |
1006 | | - |
1007 | | - $searchForm.append( $providerSelection ); |
| 1023 | + |
1008 | 1024 | $searchForm.append( $searchBox ); |
1009 | 1025 | $searchForm.append( $searchButton ); |
| 1026 | + |
1010 | 1027 | // Add optional upload buttons. |
1011 | 1028 | if ( this.content_providers['upload'].enabled) { |
1012 | 1029 | $uploadButton = $j.button( { icon_id: 'disk', text: gM( 'mwe-upload_tab' ) }) |
— | — | @@ -1323,11 +1340,11 @@ |
1324 | 1341 | |
1325 | 1342 | // Check if we need to update: |
1326 | 1343 | if ( typeof provider.sObj != 'undefined' ) { |
1327 | | - if ( provider.sObj.last_query == $j( '#rsd_q' ).val() |
| 1344 | + if ( provider.sObj.last_query == $j( this.target_search_input ).val() |
1328 | 1345 | && provider.sObj.last_offset == provider.offset ) { |
1329 | 1346 | |
1330 | 1347 | mw.log( 'last query is: ' + provider.sObj.last_query + |
1331 | | - ' matches: ' + $j( '#rsd_q' ).val() + ' no search needed'); |
| 1348 | + ' matches: ' + $j( this.target_search_input ).val() + ' no search needed'); |
1332 | 1349 | |
1333 | 1350 | // Show search results directly |
1334 | 1351 | this.showResults( ); |
— | — | @@ -1344,7 +1361,7 @@ |
1345 | 1362 | } |
1346 | 1363 | } |
1347 | 1364 | |
1348 | | - if ( $j ( '#rsd_q' ).val().length == 0 ) { |
| 1365 | + if ( $j ( this.target_search_input ).val().length == 0 ) { |
1349 | 1366 | this.$resultsContainer.empty(); |
1350 | 1367 | this.$resultsContainer.text( 'Please insert a search string above.' ); |
1351 | 1368 | return; |
— | — | @@ -1525,7 +1542,7 @@ |
1526 | 1543 | var context = _this.storeContext( d.getTime() ); |
1527 | 1544 | _this.currentRequest = context(); |
1528 | 1545 | mw.log( "ProviderCallBack Generated " + context() ) |
1529 | | - provider.sObj.getSearchResults( $j( '#rsd_q' ).val() , |
| 1546 | + provider.sObj.getSearchResults( $j( _this.target_search_input ).val() , |
1530 | 1547 | function( resultStatus ) { |
1531 | 1548 | mw.log( "ProviderCallBack Received " + context() ); |
1532 | 1549 | if( _this.currentRequest != context() ) { |
— | — | @@ -1706,7 +1723,7 @@ |
1707 | 1724 | $resultsContainer.append( _this.createResultsFooter() ); |
1708 | 1725 | } |
1709 | 1726 | |
1710 | | - mw.log( 'did numResults :: ' + numResults + ' append: ' + $j( '#rsd_q' ).val() ); |
| 1727 | + mw.log( 'did numResults :: ' + numResults + ' append: ' + $j( this.target_search_input ).val() ); |
1711 | 1728 | |
1712 | 1729 | // Add "no search results" text |
1713 | 1730 | $j( '#rsd_no_search_res' ).remove(); |
— | — | @@ -1718,7 +1735,7 @@ |
1719 | 1736 | ); |
1720 | 1737 | } else { |
1721 | 1738 | $resultsContainer.append( |
1722 | | - gM( 'rsd_no_results', $j( '#rsd_q' ).val() ) |
| 1739 | + gM( 'rsd_no_results', $j( this.target_search_input ).val() ) |
1723 | 1740 | ) ; |
1724 | 1741 | } |
1725 | 1742 | } |
— | — | @@ -1890,7 +1907,15 @@ |
1891 | 1908 | // Resource click action: (bring up the resource editor) |
1892 | 1909 | $j( '.rsd_res_item' ).unbind().click( function() { |
1893 | 1910 | var resource = _this.getResourceFromId( $j( this ).attr( "id" ) ); |
1894 | | - _this.showResourceEditor( resource ); |
| 1911 | + |
| 1912 | + // xxx These hooks should really be managed via bindings not options like this: |
| 1913 | + var showResourceEditor = true; |
| 1914 | + if( typeof _this.resourceSelectionCallback == 'function' ){ |
| 1915 | + showResourceEditor = _this.resourceSelectionCallback( resource ); |
| 1916 | + } |
| 1917 | + if( showResourceEditor ){ |
| 1918 | + _this.showResourceEditor( resource ); |
| 1919 | + } |
1895 | 1920 | return false; |
1896 | 1921 | } ) |
1897 | 1922 | // Add a "bind" class |
Index: branches/MwEmbedStandAlone/modules/AddMedia/AddMedia.i18n.php |
— | — | @@ -182,7 +182,7 @@ |
183 | 183 | 'mwe-ftype-unk' => 'Unknown file format', |
184 | 184 | 'rsd-wiki_commons-title' => 'Wikimedia Commons', |
185 | 185 | 'rsd-wiki_commons' => 'Wikimedia Commons, an archive of freely-licensed educational media content (images, sound and video clips)', |
186 | | - 'rsd-kaltura-title' => 'All sources', |
| 186 | + 'rsd-kaltura-title' => 'Kaltura search( all sources )', |
187 | 187 | 'rsd-kaltura' => 'Kaltura aggregated search for free-licensed media across multiple search providers', |
188 | 188 | 'rsd-this_wiki-title' => 'This wiki', |
189 | 189 | 'rsd-this_wiki-desc' => 'The local wiki', |
Index: branches/MwEmbedStandAlone/modules/Sequencer/loader.js |
— | — | @@ -11,11 +11,11 @@ |
12 | 12 | "mw.Sequencer" : "mw.Sequencer.js", |
13 | 13 | "mw.style.Sequencer" : "mw.style.Sequencer.css", |
14 | 14 | |
| 15 | + "mw.SequencerAddMedia" : "mw.SequencerAddMedia.js", |
15 | 16 | "mw.SequencerPlayer" : "mw.SequencerPlayer.js", |
16 | 17 | "mw.SequencerTimeline" : "mw.SequencerTimeline.js", |
17 | 18 | "mw.SequencerKeyBindings" : "mw.SequencerKeyBindings.js", |
18 | | - "mw.SequencerTools" : "mw.SequencerTools.js", |
19 | | - |
| 19 | + "mw.SequencerTools" : "mw.SequencerTools.js", |
20 | 20 | "mw.SequencerMenu" : "mw.SequencerMenu.js", |
21 | 21 | |
22 | 22 | "mw.SequencerActionsSequence" : "mw.SequencerActionsSequence.js", |
— | — | @@ -27,8 +27,7 @@ |
28 | 28 | "mw.FirefoggRender" : "mw.FirefoggRender.js", |
29 | 29 | "$j.fn.layout" : "ui.layout/ui.layout-1.2.0.js", |
30 | 30 | |
31 | | - "mw.RemoteSequencer" : "mw.RemoteSequencer.js", |
32 | | - |
| 31 | + "mw.RemoteSequencer" : "mw.RemoteSequencer.js", |
33 | 32 | "mw.style.Sequencer" : "css/mw.style.Sequencer.css", |
34 | 33 | |
35 | 34 | "playlistEmbed" : "playlistEmbed.js" |
— | — | @@ -64,7 +63,8 @@ |
65 | 64 | ], |
66 | 65 | [ |
67 | 66 | '$j.contextMenu', |
68 | | - |
| 67 | + |
| 68 | + 'mw.SequencerAddMedia', |
69 | 69 | 'mw.SequencerPlayer', |
70 | 70 | 'mw.SequencerRender', |
71 | 71 | |
Index: branches/MwEmbedStandAlone/modules/Sequencer/mw.Sequencer.js |
— | — | @@ -198,7 +198,12 @@ |
199 | 199 | } |
200 | 200 | return this.editTools; |
201 | 201 | }, |
202 | | - |
| 202 | + getAddMedia: function(){ |
| 203 | + if( ! this.addMedia ){ |
| 204 | + this.addMedia = new mw.SequencerAddMedia( this ); |
| 205 | + } |
| 206 | + return this.addMedia; |
| 207 | + }, |
203 | 208 | getKeyBindings:function(){ |
204 | 209 | if( ! this.keyBindings ){ |
205 | 210 | this.keyBindings = new mw.SequencerKeyBindings( this ); |
— | — | @@ -253,7 +258,7 @@ |
254 | 259 | .addClass('resizableLayout') |
255 | 260 | .css({ |
256 | 261 | 'position':'absolute', |
257 | | - 'top': '25px', |
| 262 | + 'top': '27px', |
258 | 263 | 'left': '0px', |
259 | 264 | 'right': '0px', |
260 | 265 | 'bottom':'0px' |
Index: branches/MwEmbedStandAlone/modules/Sequencer/css/mw.style.Sequencer.css |
— | — | @@ -74,10 +74,17 @@ |
75 | 75 | } |
76 | 76 | |
77 | 77 | .sequencer-menu .disabled a { |
78 | | - cursor:default; |
| 78 | + cursor: default; |
79 | 79 | } |
80 | 80 | .sequencer-menu .disabled a span{ |
81 | | - cursor:default; |
| 81 | + cursor: default; |
82 | 82 | opacity: .5; |
83 | 83 | } |
84 | 84 | |
| 85 | +.mwe-sequencer input.searchMedia{ |
| 86 | + font-size: 11px; |
| 87 | + width: 125px; |
| 88 | + margin:0 0 0 10px; |
| 89 | + padding-left: 5px; |
| 90 | + padding-right: 5px; |
| 91 | +} |
Index: branches/MwEmbedStandAlone/modules/Sequencer/Sequencer.i18n.php |
— | — | @@ -51,6 +51,9 @@ |
52 | 52 | 'mwe-sequencer-menu-view-history' => 'Revision history', |
53 | 53 | 'mwe-sequencer-menu-view-smilxml' => 'Sequence SMIL XML', |
54 | 54 | |
| 55 | + 'mwe-sequencer-url-or-search' => 'URL or search term', |
| 56 | + 'mwe-sequencer-get-media' => 'Get media', |
| 57 | + 'mwe-sequencer-insert-resource' => 'Insert resource into sequence', |
55 | 58 | |
56 | 59 | 'mwe-sequencer-transition_in' => 'Transition in', |
57 | 60 | 'mwe-sequencer-transition_out' => 'Transition out', |
Index: branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerAddMedia.js |
— | — | @@ -0,0 +1,110 @@ |
| 2 | +/** |
| 3 | +* Sequencer add media support ( ties into mwEmbed AddMedia Module ) |
| 4 | +*/ |
| 5 | + |
| 6 | +//Wrap in mw closure |
| 7 | +( function( mw ) { |
| 8 | + |
| 9 | +mw.SequencerAddMedia = function( sequencer ) { |
| 10 | + return this.init( sequencer ); |
| 11 | +}; |
| 12 | + |
| 13 | +// Set up the mvSequencer object |
| 14 | +mw.SequencerAddMedia.prototype = { |
| 15 | + init: function( sequencer ){ |
| 16 | + this.sequencer = sequencer; |
| 17 | + }, |
| 18 | + // Get the menu widget that drives the search and upload tab selection |
| 19 | + getMenuWidget: function(){ |
| 20 | + var _this = this; |
| 21 | + var widgetFocus = false; |
| 22 | + return $j('<span />') |
| 23 | + .append( |
| 24 | + $j('<form />').append( |
| 25 | + $j('<input />') |
| 26 | + .addClass( 'searchMedia') |
| 27 | + .val( |
| 28 | + gM( 'mwe-sequencer-url-or-search') |
| 29 | + ) |
| 30 | + .css('color', '#888') |
| 31 | + .focus( function(){ |
| 32 | + // on the first focus clear the input and update the color |
| 33 | + if( !widgetFocus ){ |
| 34 | + $j(this) |
| 35 | + .css('color', '#000') |
| 36 | + .val(''); |
| 37 | + } |
| 38 | + widgetFocus = true; |
| 39 | + }) |
| 40 | + // add the sequencer input binding |
| 41 | + .sequencerInput( _this.sequencer ) |
| 42 | + ) |
| 43 | + .css({ |
| 44 | + 'width': '125px', |
| 45 | + 'display': 'inline' |
| 46 | + }) |
| 47 | + .submit(function(){ |
| 48 | + _this.proccessRequest(); |
| 49 | + return false; |
| 50 | + }), |
| 51 | + |
| 52 | + //input button |
| 53 | + $j.button({ |
| 54 | + // The text of the button link |
| 55 | + 'text' : gM('mwe-sequencer-get-media'), |
| 56 | + // The icon id that precedes the button link: |
| 57 | + 'icon_id' : 'plus' |
| 58 | + }) |
| 59 | + .click(function(){ |
| 60 | + _this.proccessRequest(); |
| 61 | + }) |
| 62 | + ) |
| 63 | + }, |
| 64 | + proccessRequest: function(){ |
| 65 | + var _this = this; |
| 66 | + // get the input text |
| 67 | + var inputValue = this.sequencer.getMenuTarget().find('input.searchMedia').val(); |
| 68 | + |
| 69 | + this.sequencer.getEditToolTarget() |
| 70 | + .empty() |
| 71 | + .loadingSpinner(); |
| 72 | + |
| 73 | + if( ! this.remoteSearchDriver ){ |
| 74 | + // set the tool target to loading |
| 75 | + mw.load( 'AddMedia.addMediaWizard', function(){ |
| 76 | + this.remoteSearchDriver = new mw.RemoteSearchDriver({ |
| 77 | + 'target_container' : _this.sequencer.getEditToolTarget(), |
| 78 | + 'target_search_input' : _this.sequencer.getMenuTarget().find('input.searchMedia'), |
| 79 | + 'displaySearchInput': false, |
| 80 | + 'default_query' : inputValue, |
| 81 | + 'displayResourceInfoIcons' : false, |
| 82 | + 'resourceSelectionCallback' : function( resource ){ |
| 83 | + _this.insertResourceDialog( resource ) |
| 84 | + return false; |
| 85 | + } |
| 86 | + }) |
| 87 | + .createUI() |
| 88 | + }); |
| 89 | + } else { |
| 90 | + this.remoteSearchDriver.createUI() |
| 91 | + } |
| 92 | + }, |
| 93 | + |
| 94 | + /** |
| 95 | + * Create an insert resource dialog, expose basic in-out points or / duration |
| 96 | + * |
| 97 | + * buttons include insert at end or insert after current |
| 98 | + */ |
| 99 | + insertResourceDialog: function( resource ){ |
| 100 | + mw.addDialog({ |
| 101 | + 'title' : gM('mwe-sequencer-insert-resource'), |
| 102 | + 'dragable' : true, |
| 103 | + 'height' : 480, |
| 104 | + 'width' : 640, |
| 105 | + 'resizable' : true, |
| 106 | + 'content' : $j('<div />').text('import interface here') |
| 107 | + }); |
| 108 | + } |
| 109 | +} |
| 110 | + |
| 111 | +} )( window.mw ); |
\ No newline at end of file |
Index: branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerTools.js |
— | — | @@ -174,13 +174,12 @@ |
175 | 175 | min: 0, |
176 | 176 | max: 1000, |
177 | 177 | values: sliderValues, |
178 | | - slide: function(event, ui) { |
179 | | - mw.log( 'slider1: ' + ui.values[0] + ' - sldier two' + ui.values[1] + ' t: ' + sliderToTime( ui.values[0] ) + ' t2: ' + sliderToTime( ui.values[1]) ); |
| 178 | + slide: function(event, ui) { |
180 | 179 | $j('#editTool_trim_clipBegin').val( |
181 | 180 | mw.seconds2npt( sliderToTime( ui.values[0] ), true ) |
182 | 181 | ); |
183 | 182 | $j('#editTool_trim_dur').val( |
184 | | - mw.seconds2npt( sliderToTime( ui.values[1] ), true ) |
| 183 | + mw.seconds2npt( sliderToTime( ui.values[1] - ui.values[0] ), true ) |
185 | 184 | ); |
186 | 185 | }, |
187 | 186 | change: function( event, ui ) { |
— | — | @@ -300,7 +299,6 @@ |
301 | 300 | 'float': 'left', |
302 | 301 | 'margin': '5px' |
303 | 302 | }) |
304 | | - .buttonHover() |
305 | 303 | .click( function(){ |
306 | 304 | editAction.action( _this, smilClip, toolId ); |
307 | 305 | }) |
Index: branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerMenu.js |
— | — | @@ -83,12 +83,18 @@ |
84 | 84 | }, |
85 | 85 | 'history': { |
86 | 86 | 'icon' : 'clock', |
| 87 | + 'disabled': true, |
87 | 88 | 'action':function( _this ){ |
88 | 89 | mw.log("SequencerMenu::history"); |
89 | 90 | } |
90 | 91 | } |
91 | 92 | } |
92 | 93 | }, |
| 94 | + menuWidgets: { |
| 95 | + 'addmedia' : function( _this ){ |
| 96 | + return _this.sequencer.getAddMedia().getMenuWidget(); |
| 97 | + } |
| 98 | + }, |
93 | 99 | /** |
94 | 100 | * Draw the sequence menu |
95 | 101 | */ |
— | — | @@ -97,7 +103,7 @@ |
98 | 104 | var $menuTarget = this.sequencer.getMenuTarget(); |
99 | 105 | $menuTarget.empty(); |
100 | 106 | |
101 | | - for( var menuKey in this.menuConfig ){ |
| 107 | + for( var menuKey in this.menuConfig ){ |
102 | 108 | // Create a function to preserve menuKey binding scope |
103 | 109 | function drawTopMenu( menuKey ){ |
104 | 110 | // Add the menu target |
— | — | @@ -125,6 +131,12 @@ |
126 | 132 | } |
127 | 133 | drawTopMenu( menuKey ); |
128 | 134 | } |
| 135 | + // Add any menuWidgets |
| 136 | + for( var widgetKey in this.menuWidgets ){ |
| 137 | + $menuTarget.append( |
| 138 | + this.menuWidgets[widgetKey]( this ) |
| 139 | + ); |
| 140 | + } |
129 | 141 | |
130 | 142 | // Check if we should include kaltura credits |
131 | 143 | if( mw.getConfig( 'Sequencer.KalturaAttribution' ) ){ |
Index: branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerTimeline.js |
— | — | @@ -461,8 +461,8 @@ |
462 | 462 | } |
463 | 463 | }, 5000); |
464 | 464 | } |
465 | | - // Buffer the asset then render it into the layout target: |
466 | | - smil.getBuffer().bufferedSeek( $node, relativeTime, function(){ |
| 465 | + // Buffer the asset then render it into the layout target: |
| 466 | + smil.getBuffer().bufferedSeek( $node, relativeTime, function(){ |
467 | 467 | // Add the seek, add to canvas and draw thumb request |
468 | 468 | smil.getLayout().drawElementThumb( $thumbTarget, $node, relativeTime ); |
469 | 469 | |
Index: branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerActionsEdit.js |
— | — | @@ -27,7 +27,7 @@ |
28 | 28 | }, |
29 | 29 | |
30 | 30 | selectAll: function(){ |
31 | | - //Select all the items in the timeline |
| 31 | + // Select all the items in the timeline |
32 | 32 | $target = this.sequencer.getTimeline().getTimelineContainer(); |
33 | 33 | $target.find( '.timelineClip' ).addClass( 'selectedClip' ); |
34 | 34 | }, |
Index: branches/MwEmbedStandAlone/remotes/mediaWiki.js |
— | — | @@ -603,7 +603,6 @@ |
604 | 604 | .css({ |
605 | 605 | 'font-size': '90%' |
606 | 606 | }) |
607 | | - .buttonHover() |
608 | 607 | .click(function (){ |
609 | 608 | if( !wgUserName ){ |
610 | 609 | $j( this ) |