r70379 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r70378‎ | r70379 | r70380 >
Date:05:20, 3 August 2010
Author:dale
Status:deferred
Tags:
Comment:
* stubs for add media integration with sequencer ( mw.SequencerAddMedia )
** added 'menu widget' support / stubs
* moved buttonHover to default $j.button buildout
* fixed double 'seeked' callback in videoBufferSeek
Modified paths:
  • /branches/MwEmbedStandAlone/modules/AddMedia/AddMedia.i18n.php (modified) (history)
  • /branches/MwEmbedStandAlone/modules/AddMedia/mw.RemoteSearchDriver.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/Sequencer/Sequencer.i18n.php (modified) (history)
  • /branches/MwEmbedStandAlone/modules/Sequencer/css/mw.style.Sequencer.css (modified) (history)
  • /branches/MwEmbedStandAlone/modules/Sequencer/loader.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/Sequencer/mw.Sequencer.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerActionsEdit.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerAddMedia.js (added) (history)
  • /branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerMenu.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerTimeline.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerTools.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilBuffer.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilLayout.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/TimedText/mw.TimedTextEdit.js (modified) (history)
  • /branches/MwEmbedStandAlone/mwEmbed.js (modified) (history)
  • /branches/MwEmbedStandAlone/remotes/mediaWiki.js (modified) (history)

Diff [purge]

Index: branches/MwEmbedStandAlone/mwEmbed.js
@@ -2363,12 +2363,14 @@
23642364 $btn.addClass( options['class'] )
23652365 }
23662366
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;
23732375 };
23742376
23752377 // Shortcut to bind hover state
Index: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilLayout.js
@@ -114,6 +114,7 @@
115115 },
116116
117117 drawElementThumb: function( $target, $node, relativeTime ){
 118+ mw.log('SmilLayout::drawElementThumb: ' + relativeTime );
118119 // parse the time incase it came in as human input
119120 relativeTime = this.smil.parseTime( relativeTime );
120121 switch ( this.smil.getRefType( $node )){
Index: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilBuffer.js
@@ -296,7 +296,7 @@
297297 * Clip ready for grabbing a frame such as a canvas thumb
298298 */
299299 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 );
301301
302302 var absoluteTime = relativeTime;
303303 if( $j( smilElement ).attr('clipBegin') ){
@@ -421,7 +421,6 @@
422422 _this.videoSeekListeners[ assetId ].listen = true;
423423 _this.registerVideoSeekListener( assetId );
424424 }
425 -
426425 // Update the current context callback
427426 _this.videoSeekListeners[ assetId ].callback = function(){
428427 // Seek has completed open up seek Listeners for future seeks
@@ -430,9 +429,11 @@
431430 // Set this asset to ready ( asset ready set )
432431 _this.assetReady( assetId );
433432
434 - // Run the callback
 433+ // Run the callback
435434 if( callback ){
436435 callback();
 436+ // set the callback to null in case seeked is fired twice.
 437+ callback = null;
437438 }
438439 }
439440
Index: branches/MwEmbedStandAlone/modules/TimedText/mw.TimedTextEdit.js
@@ -207,29 +207,28 @@
208208 $target.append(
209209 //Get a little helper input filed to update the language
210210 $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+ }),
225225 // Get a jQuery button object with language menu:
226226 $j.button( {
227227 'style': { 'float' : 'left' },
228228 'class': 'language-select-btn',
229229 'text': gM('mwe-timedtext-select-language'),
230230 'icon_id': 'triangle-1-e'
231 - } ).attr('id', 'language-select')
232 - .unbind()
233 - .buttonHover()
 231+ } )
 232+ .attr('id', 'language-select')
234233 )
235234
236235
@@ -301,8 +300,6 @@
302301 'text': gM('mwe-timedtext-upload-text'),
303302 'icon_id': 'disk'
304303 } )
305 - .unbind()
306 - .buttonHover()
307304 .click( function() {
308305 _this.uploadTextFile();
309306 })
Index: branches/MwEmbedStandAlone/modules/AddMedia/mw.RemoteSearchDriver.js
@@ -74,7 +74,7 @@
7575 "rsd-wiki_commons-title": "Wikimedia Commons",
7676 "rsd-wiki_commons": "Wikimedia Commons, an archive of freely-licensed educational media content (images, sound and video clips)",
7777
78 - "rsd-kaltura-title" : "All sources",
 78+ "rsd-kaltura-title" : "Kaltura search ( all sources )",
7979 "rsd-kaltura" : "Kaltura aggregated search for free-licensed media across multiple search providers",
8080
8181 "rsd-this_wiki-title" : "This wiki",
@@ -104,7 +104,15 @@
105105 // The target button or link that will invoke the search interface
106106 'target_invoke_button': null,
107107
 108+ // Default id for search target input
 109+ 'target_search_input' : '#rsd_q',
 110+
108111 /**
 112+ * Callback functions:
 113+ */
 114+ 'resourceSelectionCallback' : null,
 115+
 116+ /**
109117 * import_url_mode
110118 * Can be 'api', 'autodetect', 'remote_link'
111119 * api: uses the mediawiki api to insert the media asset
@@ -146,8 +154,11 @@
147155 // 'nc' ( non-commercial ), 'all' ( all found licenses are "ok")
148156 'enabled_licenses' : ['pd', 'by', 'sa' ],
149157
 158+ // If the input text should be displayed
 159+ 'displaySearchInput' : true,
 160+
150161 // If we should display resource icons
151 - 'displayResourceInfoIcons' : true,
 162+ 'displayResourceInfoIcons' : true,
152163
153164 // If we should display the result format button.
154165 'displayResultFormatButton': true,
@@ -166,7 +177,6 @@
167178
168179 $.fn.addMediaWizard = function( options, callback ) {
169180 options['target_invoke_button'] = this.selector;
170 - options['instance_name'] = 'rsdMVRS';
171181 window['rsdMVRS'] = new mw.RemoteSearchDriver( options );
172182 if( callback ) {
173183 callback( window['rsdMVRS'] );
@@ -442,7 +452,7 @@
443453 */
444454 init: function( options ) {
445455 var _this = this;
446 - mw.log( 'remoteSearchDriver:init' );
 456+ mw.log( 'RemoteSearchDriver:init' );
447457
448458 // Add in a local "id" reference to each provider
449459 for ( var provider_id in this.content_providers ) {
@@ -730,11 +740,11 @@
731741 var query = _this.getDefaultQuery();
732742
733743 // Refresh the container if "upload" or "changed query"
734 - if ( query != $j( '#rsd_q' ).val()
 744+ if ( query != $j( this.target_search_input ).val()
735745 ||
736746 this.current_provider == 'upload' )
737747 {
738 - $j( '#rsd_q' ).val( query );
 748+ $j( this.target_search_input ).val( query );
739749 _this.updateResults();
740750 }
741751 // $j(_this.target_container).dialog("open");
@@ -872,12 +882,16 @@
873883
874884 var $mainContainer = $j( this.target_container );
875885
876 - var $controlContainer = this.createControlContainer();
 886+ // Add the provider seleciton
 887+ $mainContainer.append( this.createProviderSelection() );
877888
878 - $mainContainer.append( $controlContainer );
 889+ // Add the searchInput control if it should be displayed:
 890+ if( this.displaySearchInput ){
 891+ $mainContainer.append( this.createSearchInput() );
 892+ };
879893
880894 this.$resultsContainer = $j('<div />').attr({
881 - id: "rsd_results_container"
 895+ id : "rsd_results_container"
882896 });
883897
884898 $mainContainer.append( this.$filtersContainer );
@@ -885,7 +899,7 @@
886900
887901 // Run the default search:
888902 if ( this.getDefaultQuery() ){
889 - this.updateResults();
 903+ _this.updateResults();
890904 }
891905
892906 // Add bindings
@@ -920,12 +934,47 @@
921935 // Setup base cancel button binding
922936 this.onCancelResourceEdit();
923937 },
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+ },
925974 /**
926975 * Creates the search control (i.e. Search textbox, search button, provider filter).
927976 * @return A jQuery-generated HTML element ready to be injected in the main container.
928977 */
929 - createControlContainer: function() {
 978+ createSearchInput: function() {
930979 var _this = this;
931980 var $controlContainer = $j( '<div />' )
932981 .addClass( "rsd_control_container" );
@@ -935,22 +984,20 @@
936985 action : "javascript:return false"
937986 });
938987
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 - });
954988
 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+
9551002 var $searchBox = $j( '<input />' )
9561003 .addClass( 'ui-corner-all' )
9571004 .attr({
@@ -972,40 +1019,10 @@
9731020 $searchButton.removeClass("ui-button-disabled");
9741021 }
9751022 });
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+
10081024 $searchForm.append( $searchBox );
10091025 $searchForm.append( $searchButton );
 1026+
10101027 // Add optional upload buttons.
10111028 if ( this.content_providers['upload'].enabled) {
10121029 $uploadButton = $j.button( { icon_id: 'disk', text: gM( 'mwe-upload_tab' ) })
@@ -1323,11 +1340,11 @@
13241341
13251342 // Check if we need to update:
13261343 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()
13281345 && provider.sObj.last_offset == provider.offset ) {
13291346
13301347 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');
13321349
13331350 // Show search results directly
13341351 this.showResults( );
@@ -1344,7 +1361,7 @@
13451362 }
13461363 }
13471364
1348 - if ( $j ( '#rsd_q' ).val().length == 0 ) {
 1365+ if ( $j ( this.target_search_input ).val().length == 0 ) {
13491366 this.$resultsContainer.empty();
13501367 this.$resultsContainer.text( 'Please insert a search string above.' );
13511368 return;
@@ -1525,7 +1542,7 @@
15261543 var context = _this.storeContext( d.getTime() );
15271544 _this.currentRequest = context();
15281545 mw.log( "ProviderCallBack Generated " + context() )
1529 - provider.sObj.getSearchResults( $j( '#rsd_q' ).val() ,
 1546+ provider.sObj.getSearchResults( $j( _this.target_search_input ).val() ,
15301547 function( resultStatus ) {
15311548 mw.log( "ProviderCallBack Received " + context() );
15321549 if( _this.currentRequest != context() ) {
@@ -1706,7 +1723,7 @@
17071724 $resultsContainer.append( _this.createResultsFooter() );
17081725 }
17091726
1710 - mw.log( 'did numResults :: ' + numResults + ' append: ' + $j( '#rsd_q' ).val() );
 1727+ mw.log( 'did numResults :: ' + numResults + ' append: ' + $j( this.target_search_input ).val() );
17111728
17121729 // Add "no search results" text
17131730 $j( '#rsd_no_search_res' ).remove();
@@ -1718,7 +1735,7 @@
17191736 );
17201737 } else {
17211738 $resultsContainer.append(
1722 - gM( 'rsd_no_results', $j( '#rsd_q' ).val() )
 1739+ gM( 'rsd_no_results', $j( this.target_search_input ).val() )
17231740 ) ;
17241741 }
17251742 }
@@ -1890,7 +1907,15 @@
18911908 // Resource click action: (bring up the resource editor)
18921909 $j( '.rsd_res_item' ).unbind().click( function() {
18931910 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+ }
18951920 return false;
18961921 } )
18971922 // Add a "bind" class
Index: branches/MwEmbedStandAlone/modules/AddMedia/AddMedia.i18n.php
@@ -182,7 +182,7 @@
183183 'mwe-ftype-unk' => 'Unknown file format',
184184 'rsd-wiki_commons-title' => 'Wikimedia Commons',
185185 '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 )',
187187 'rsd-kaltura' => 'Kaltura aggregated search for free-licensed media across multiple search providers',
188188 'rsd-this_wiki-title' => 'This wiki',
189189 'rsd-this_wiki-desc' => 'The local wiki',
Index: branches/MwEmbedStandAlone/modules/Sequencer/loader.js
@@ -11,11 +11,11 @@
1212 "mw.Sequencer" : "mw.Sequencer.js",
1313 "mw.style.Sequencer" : "mw.style.Sequencer.css",
1414
 15+ "mw.SequencerAddMedia" : "mw.SequencerAddMedia.js",
1516 "mw.SequencerPlayer" : "mw.SequencerPlayer.js",
1617 "mw.SequencerTimeline" : "mw.SequencerTimeline.js",
1718 "mw.SequencerKeyBindings" : "mw.SequencerKeyBindings.js",
18 - "mw.SequencerTools" : "mw.SequencerTools.js",
19 -
 19+ "mw.SequencerTools" : "mw.SequencerTools.js",
2020 "mw.SequencerMenu" : "mw.SequencerMenu.js",
2121
2222 "mw.SequencerActionsSequence" : "mw.SequencerActionsSequence.js",
@@ -27,8 +27,7 @@
2828 "mw.FirefoggRender" : "mw.FirefoggRender.js",
2929 "$j.fn.layout" : "ui.layout/ui.layout-1.2.0.js",
3030
31 - "mw.RemoteSequencer" : "mw.RemoteSequencer.js",
32 -
 31+ "mw.RemoteSequencer" : "mw.RemoteSequencer.js",
3332 "mw.style.Sequencer" : "css/mw.style.Sequencer.css",
3433
3534 "playlistEmbed" : "playlistEmbed.js"
@@ -64,7 +63,8 @@
6564 ],
6665 [
6766 '$j.contextMenu',
68 -
 67+
 68+ 'mw.SequencerAddMedia',
6969 'mw.SequencerPlayer',
7070 'mw.SequencerRender',
7171
Index: branches/MwEmbedStandAlone/modules/Sequencer/mw.Sequencer.js
@@ -198,7 +198,12 @@
199199 }
200200 return this.editTools;
201201 },
202 -
 202+ getAddMedia: function(){
 203+ if( ! this.addMedia ){
 204+ this.addMedia = new mw.SequencerAddMedia( this );
 205+ }
 206+ return this.addMedia;
 207+ },
203208 getKeyBindings:function(){
204209 if( ! this.keyBindings ){
205210 this.keyBindings = new mw.SequencerKeyBindings( this );
@@ -253,7 +258,7 @@
254259 .addClass('resizableLayout')
255260 .css({
256261 'position':'absolute',
257 - 'top': '25px',
 262+ 'top': '27px',
258263 'left': '0px',
259264 'right': '0px',
260265 'bottom':'0px'
Index: branches/MwEmbedStandAlone/modules/Sequencer/css/mw.style.Sequencer.css
@@ -74,10 +74,17 @@
7575 }
7676
7777 .sequencer-menu .disabled a {
78 - cursor:default;
 78+ cursor: default;
7979 }
8080 .sequencer-menu .disabled a span{
81 - cursor:default;
 81+ cursor: default;
8282 opacity: .5;
8383 }
8484
 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 @@
5252 'mwe-sequencer-menu-view-history' => 'Revision history',
5353 'mwe-sequencer-menu-view-smilxml' => 'Sequence SMIL XML',
5454
 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',
5558
5659 'mwe-sequencer-transition_in' => 'Transition in',
5760 '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 @@
175175 min: 0,
176176 max: 1000,
177177 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) {
180179 $j('#editTool_trim_clipBegin').val(
181180 mw.seconds2npt( sliderToTime( ui.values[0] ), true )
182181 );
183182 $j('#editTool_trim_dur').val(
184 - mw.seconds2npt( sliderToTime( ui.values[1] ), true )
 183+ mw.seconds2npt( sliderToTime( ui.values[1] - ui.values[0] ), true )
185184 );
186185 },
187186 change: function( event, ui ) {
@@ -300,7 +299,6 @@
301300 'float': 'left',
302301 'margin': '5px'
303302 })
304 - .buttonHover()
305303 .click( function(){
306304 editAction.action( _this, smilClip, toolId );
307305 })
Index: branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerMenu.js
@@ -83,12 +83,18 @@
8484 },
8585 'history': {
8686 'icon' : 'clock',
 87+ 'disabled': true,
8788 'action':function( _this ){
8889 mw.log("SequencerMenu::history");
8990 }
9091 }
9192 }
9293 },
 94+ menuWidgets: {
 95+ 'addmedia' : function( _this ){
 96+ return _this.sequencer.getAddMedia().getMenuWidget();
 97+ }
 98+ },
9399 /**
94100 * Draw the sequence menu
95101 */
@@ -97,7 +103,7 @@
98104 var $menuTarget = this.sequencer.getMenuTarget();
99105 $menuTarget.empty();
100106
101 - for( var menuKey in this.menuConfig ){
 107+ for( var menuKey in this.menuConfig ){
102108 // Create a function to preserve menuKey binding scope
103109 function drawTopMenu( menuKey ){
104110 // Add the menu target
@@ -125,6 +131,12 @@
126132 }
127133 drawTopMenu( menuKey );
128134 }
 135+ // Add any menuWidgets
 136+ for( var widgetKey in this.menuWidgets ){
 137+ $menuTarget.append(
 138+ this.menuWidgets[widgetKey]( this )
 139+ );
 140+ }
129141
130142 // Check if we should include kaltura credits
131143 if( mw.getConfig( 'Sequencer.KalturaAttribution' ) ){
Index: branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerTimeline.js
@@ -461,8 +461,8 @@
462462 }
463463 }, 5000);
464464 }
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(){
467467 // Add the seek, add to canvas and draw thumb request
468468 smil.getLayout().drawElementThumb( $thumbTarget, $node, relativeTime );
469469
Index: branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerActionsEdit.js
@@ -27,7 +27,7 @@
2828 },
2929
3030 selectAll: function(){
31 - //Select all the items in the timeline
 31+ // Select all the items in the timeline
3232 $target = this.sequencer.getTimeline().getTimelineContainer();
3333 $target.find( '.timelineClip' ).addClass( 'selectedClip' );
3434 },
Index: branches/MwEmbedStandAlone/remotes/mediaWiki.js
@@ -603,7 +603,6 @@
604604 .css({
605605 'font-size': '90%'
606606 })
607 - .buttonHover()
608607 .click(function (){
609608 if( !wgUserName ){
610609 $j( this )

Status & tagging log