r63459 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r63458‎ | r63459 | r63460 >
Date:08:04, 9 March 2010
Author:dale
Status:deferred
Tags:
Comment:
* some k-player updates
* other minor clean up
Modified paths:
  • /branches/js2-work/phase3/js/apiProxyPage.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/modules/ApiProxy/mw.ApiProxy.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/kplayerEmbed.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/remotes/mediaWiki.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/skins/ctrlBuilder.js (modified) (history)

Diff [purge]

Index: branches/js2-work/phase3/js/mwEmbed/skins/ctrlBuilder.js
@@ -279,6 +279,14 @@
280280 }
281281 this.fullscreenMode = true;
282282
 283+ //Remove any old mw-fullscreen-overlay
 284+ $interface.find( '.mw-fullscreen-overlay' ).remove();
 285+
 286+ // Special hack for mediawiki monobook skin search box
 287+ if( $j( '#p-search' ).length ) {
 288+ $j( '#p-search' ).css('z-index', 1);
 289+ }
 290+
283291 // Add the css fixed fullscreen black overlay as a sibling to the video element
284292 $interface.after(
285293 $j( '<div />' )
Index: branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/kplayerEmbed.js
@@ -42,7 +42,7 @@
4343 params.quality = "best";
4444 params.wmode = "opaque";
4545 params.allowfullscreen = "true";
46 - params.allowscriptaccess = "sameDomain";
 46+ params.allowscriptaccess = "always";
4747
4848 var attributes = {};
4949 attributes.id = this.pid;
@@ -67,7 +67,7 @@
6868 attributes
6969 );
7070
71 - setTimeout(function() {
 71+ setTimeout( function() {
7272 _this.postEmbedJS();
7373 }, 250 );
7474
@@ -84,9 +84,10 @@
8585 if( this.playerElement && this.playerElement.addJsListener ) {
8686 // Add KDP listeners
8787 _this.bindPlayerFunction( 'doPause', 'onPause' );
88 - _this.bindPlayerFunction( 'doPlay', 'play' );
 88+ _this.bindPlayerFunction( 'doPlay', 'onPlay' );
8989 _this.bindPlayerFunction( 'playerPlayEnd', 'onClipDone' );
90 - _this.bindPlayerFunction( 'playerUpdatePlayhead', 'onUpdatePlayhead' );
 90+ _this.bindPlayerFunction( 'playerUpdatePlayhead', 'onUpdatePlayhead' );
 91+
9192 // Start the monitor
9293 this.monitor();
9394 }else{
@@ -106,7 +107,7 @@
107108 * @param {String} flash binding name
108109 * @param {String} function callback name
109110 */
110 - bindPlayerFunction:function( bName, fName ) {
 111+ bindPlayerFunction: function( bName, fName ) {
111112 var cbid = fName + '_cb_' + this.id.replace(' ', '_');
112113 eval( 'window[ \'' + cbid +'\' ] = function( data ) {$j(\'#' + this.id + '\').get(0).'+ fName +'( data );}' );
113114 this.playerElement.addJsListener( bName , cbid);
@@ -116,15 +117,23 @@
117118 * on Pause callback from the kaltura flash player
118119 * calls parent_pause to update the interface
119120 */
120 - onPause:function() {
 121+ onPause: function() {
121122 this.parent_pause();
122123 },
123124
124125 /**
 126+ * onPlay function callback from the kaltura flash player
 127+ * directly call the parent_play
 128+ */
 129+ onPlay: function(){
 130+ this.parent_play();
 131+ },
 132+
 133+ /**
125134 * play method
126135 * calls parent_play to update the interface
127136 */
128 - play:function() {
 137+ play: function() {
129138 if( this.playerElement && this.playerElement.sendNotification )
130139 this.playerElement.sendNotification( 'doPlay' );
131140 this.parent_play();
@@ -134,8 +143,10 @@
135144 * pause method
136145 * calls parent_pause to update the interface
137146 */
138 - pause:function() {
139 - this.playerElement.sendNotification('doPause');
 147+ pause: function() {
 148+ if( this.playerElement && this.playerElement.sendNotification ){
 149+ this.playerElement.sendNotification('doPause');
 150+ }
140151 this.parent_pause();
141152 },
142153
@@ -158,9 +169,10 @@
159170 /**
160171 * Issues a volume update to the playerElement
161172 */
162 - updateVolumen:function( percentage ) {
163 - if( this.playerElement && this.playerElement.sendNotification )
164 - this.playerElement.sendNotification('volumeChange', percentage);
 173+ updateVolumen: function( percentage ) {
 174+ if( this.playerElement && this.playerElement.sendNotification ){
 175+ this.playerElement.sendNotification('changeVolume', percentage);
 176+ }
165177 },
166178
167179 /**
Index: branches/js2-work/phase3/js/mwEmbed/modules/ApiProxy/mw.ApiProxy.js
@@ -63,7 +63,6 @@
6464 * @param {Function} [callbackTimeout] Optional Function called on api timeout
6565 */
6666 $.doRequest = function( apiUrl, requestQuery, callback , callbackTimeout ) {
67 -
6867 // Sanity check:
6968 if ( mw.isLocalDomain( apiUrl ) ) {
7069 mw.log( "Error: trying to proxy local domain? " );
@@ -417,7 +416,7 @@
418417 * @param {URL} apiUrl The url of the api server
419418 */
420419 // Include gadget js ( in case the user has not enabled the gadget on that domain )
421 - var gadgetWithJS = '?withJS=MediaWiki:Gadget-mwEmbed.js';
 420+ var gadgetWithJS = '?withJS=MediaWiki:MwEmbed.js';
422421 //var gadgetWithJS = '';
423422 function getServerFrame( context ) {
424423 if( ! context || ! context.apiUrl ){
@@ -602,9 +601,9 @@
603602 */
604603 function serverHandleRequest( ) {
605604 var clientRequest = getClientRequest();
606 - mw.log(" Handle client request :: " + JSON.stringify( clientRequest ) );
 605+ mw.log(" Handle client request :: " + JSON.stringify( clientRequest ) );
607606 // Process request type:
608 - switch( clientRequest[ 'action' ] ){
 607+ switch( clientRequest[ 'action' ] ){
609608 case 'browseFile':
610609 return serverBrowseFile();
611610 break;
@@ -788,7 +787,7 @@
789788
790789 // Api proxy does not handle descriptionText rewrite
791790 'rewriteDescriptionText' : false,
792 -
 791+
793792 // Don't show firefogg upload warning
794793 'showFoggWarningFlag' : false,
795794
@@ -938,7 +937,7 @@
939938
940939 // Special handler for src and packaged hash request:
941940 if( options.src ) {
942 - s += 'src="' + options.src;
 941+ s += 'src="' + mw.escapeQuotes( options.src );
943942 if( options.request ) {
944943
945944 // Add the contextKey to the request
Index: branches/js2-work/phase3/js/mwEmbed/remotes/mediaWiki.js
@@ -4,7 +4,7 @@
55 */
66 var urlparts = getRemoteEmbedPath();
77 var mwEmbedHostPath = urlparts[0];
8 -var mwRemoteVersion = 'r105';
 8+var mwRemoteVersion = 'r106';
99
1010 // Log the mwRemote version ( will determine what version of js we get )
1111 if( window.console ){
Index: branches/js2-work/phase3/js/apiProxyPage.js
@@ -29,6 +29,7 @@
3030
3131 // Do a setTimeout to 0 to call after other zero delay async events
3232 // ( once everyone is doing buildout withthin mwsetup priror to .ready this won't be needed. )
 33+ mw.log( 'load ApiProxy' );
3334 mw.load( 'ApiProxy', function(){
3435 //Clear out the page content ( not needed for iframe proxy )
3536 $j( 'body' ).html( '' );

Status & tagging log