r71335 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r71334‎ | r71335 | r71336 >
Date:07:24, 20 August 2010
Author:dale
Status:deferred
Tags:
Comment:
improved sequencer remote
moved apiProxyPage / remote into apiProxy module
moved addMedia page / remote into addMedia module
Modified paths:
  • /branches/MwEmbedStandAlone/modules/ApiProxy/ApiProxyPage.js (added) (history)
  • /branches/MwEmbedStandAlone/modules/ApiProxy/loader.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/EmbedPlayer/loader.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/Sequencer/remotes/mw.MediaWikiRemoteSequencer.js (modified) (history)
  • /branches/MwEmbedStandAlone/remotes/apiProxyPage.js (deleted) (history)
  • /branches/MwEmbedStandAlone/remotes/mediaWiki.js (modified) (history)
  • /branches/MwEmbedStandAlone/skins/common/images/player_big_play_button.png (added) (history)
  • /branches/MwEmbedStandAlone/skins/common/mw.style.mwCommon.css (modified) (history)

Diff [purge]

Index: branches/MwEmbedStandAlone/skins/common/mw.style.mwCommon.css
@@ -179,3 +179,18 @@
180180 float: right;
181181 margin-right: 10px;
182182 }
 183+
 184+/**
 185+* Special Video player play-btn
 186+* Lets us use root common style sheets with jquery based skins
 187+* ( without additional assets in the embedPlayer skins folder )
 188+*/
 189+.mv-player .play-btn-large {
 190+ width : 130px;
 191+ height : 96px;
 192+ background : url(images/player_big_play_button.png) !important;
 193+ position : absolute;
 194+ cursor : pointer;
 195+ border : none !important;
 196+ z-index : 1;
 197+}
\ No newline at end of file
Index: branches/MwEmbedStandAlone/skins/common/images/player_big_play_button.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/MwEmbedStandAlone/skins/common/images/player_big_play_button.png
___________________________________________________________________
Added: svn:executable
183198 + *
Added: svn:mime-type
184199 + application/octet-stream
Index: branches/MwEmbedStandAlone/modules/EmbedPlayer/loader.js
@@ -111,6 +111,12 @@
112112 * mwEmbed player is setup before any other mw.ready calls
113113 */
114114 mw.addSetupHook( function( callback ) {
 115+ mw.rewritePagePlayerTags();
 116+ // Run the setupFlag to continue setup
 117+ callback();
 118+ });
 119+
 120+ mw.rewritePagePlayerTags = function() {
115121 mw.log( 'EmbedPlayer:: Document::' + mw.documentHasPlayerTags() );
116122 if( mw.documentHasPlayerTags() ) {
117123 var rewriteElementCount = 0;
@@ -137,9 +143,7 @@
138144 $j( mw.getConfig( 'EmbedPlayer.RewriteTags' ) ).embedPlayer();
139145 })
140146 }
141 - // Run the setupFlag to continue setup
142 - callback();
143 - });
 147+ }
144148
145149 /**
146150 * Add the module loader function:
Index: branches/MwEmbedStandAlone/modules/Sequencer/remotes/mw.MediaWikiRemoteSequencer.js
@@ -126,8 +126,9 @@
127127 .attr({
128128 'poster' : imageinfo.thumburl,
129129 'durationHint' : duration,
130 - 'apiTitleKey' : page.title
 130+ 'apiTitleKey' : page.title.replace('File:',''),
131131 })
 132+ .addClass('kskin')
132133 .css({
133134 'width': imageinfo.thumbwidth,
134135 'height' : imageinfo.thumbheight
@@ -152,16 +153,19 @@
153154 .addClass( 'sequencer-player')
154155 .css( {
155156 'float' : 'left',
156 - 'width' : '69%'
 157+ 'width' : '420px'
157158 })
158 - .append( $embedPlayer )
 159+ .append(
 160+ $embedPlayer,
 161+ $j('<div />').css({'clear': 'both'})
 162+ )
159163 ,
160164
161165 // Embed player
162166 $j('<div />')
163167 .addClass( 'sequencer-embed-helper')
164168 .css({
165 - 'margin-left': '70%'
 169+ 'margin-left': '420px'
166170 })
167171
168172 // Text embed code
@@ -185,6 +189,9 @@
186190 )
187191 )
188192 )
 193+ mw.load('EmbedPlayer', function(){
 194+ $j( _this.target ).find('video').embedPlayer();
 195+ })
189196 },
190197 getSequenceEmbedCode: function(){
191198 return 'embed code here';
Index: branches/MwEmbedStandAlone/modules/ApiProxy/loader.js
@@ -4,8 +4,7 @@
55 ( function( mw ) {
66 mw.addResourcePaths( {
77 "mw.ApiProxy" : "mw.ApiProxy.js"
8 - } );
9 -
 8+ } );
109 mw.addModuleLoader( 'ApiProxy', [
1110 'JSON',
1211 'mw.ApiProxy'
Index: branches/MwEmbedStandAlone/modules/ApiProxy/ApiProxyPage.js
@@ -0,0 +1,45 @@
 2+/**
 3+* mwProxy js2 page system.
 4+*
 5+* Invokes the apiProxy system
 6+*/
 7+
 8+/*
 9+ * Since this is proxy server set a pre-append debug flag to know which debug msgs are coming from where
 10+ */
 11+
 12+mw.setConfig( 'pre-append-log', 'Proxy:');
 13+
 14+if ( !mwApiProxyConfig ){
 15+ var mwApiProxyConfig = { };
 16+}
 17+
 18+// The default mwApiProxyConfig config
 19+// xxx todo whitelist all inter-wiki actions
 20+var mwApiProxyDefaultConfig = {
 21+ 'master_whitelist' : [
 22+ 'en.wikipedia.org',
 23+ 'commons.wikimedia.org',
 24+ 'usability.wikimedia.org',
 25+ 'prototype.wikimedia.org',
 26+ 'localhost',
 27+ '127.1.1.100'
 28+ ],
 29+ 'master_blacklist' : []
 30+};
 31+
 32+// User white_list should also be checked and configured at runtime.
 33+mw.ready( function() {
 34+ // Build our configuration from the default and mwApiProxyConfig vars
 35+ mwApiProxyConfig = $j.extend( true, mwApiProxyDefaultConfig, mwApiProxyConfig );
 36+ mw.setConfig( 'apiProxyConfig', mwApiProxyConfig);
 37+
 38+ // Do a setTimeout to 0 to call after other zero delay async events
 39+ // ( once everyone is doing buildout within mwsetup prior to .ready this won't be needed. )
 40+ mw.log( 'load ApiProxy' );
 41+ mw.load( 'ApiProxy', function() {
 42+ //Clear out the page content ( not needed for iframe proxy )
 43+ $j( 'body' ).html( '' );
 44+ mw.ApiProxy.server();
 45+ } );
 46+} );
Property changes on: branches/MwEmbedStandAlone/modules/ApiProxy/ApiProxyPage.js
___________________________________________________________________
Added: svn:executable
147 + *
Index: branches/MwEmbedStandAlone/remotes/apiProxyPage.js
@@ -1,45 +0,0 @@
2 -/**
3 -* mwProxy js2 page system.
4 -*
5 -* Invokes the apiProxy system
6 -*/
7 -
8 -/*
9 - * Since this is proxy server set a pre-append debug flag to know which debug msgs are coming from where
10 - */
11 -
12 -mw.setConfig( 'pre-append-log', 'Proxy:');
13 -
14 -if ( !mwApiProxyConfig ){
15 - var mwApiProxyConfig = { };
16 -}
17 -
18 -// The default mwApiProxyConfig config
19 -// xxx todo whitelist all inter-wiki actions
20 -var mwApiProxyDefaultConfig = {
21 - 'master_whitelist' : [
22 - 'en.wikipedia.org',
23 - 'commons.wikimedia.org',
24 - 'usability.wikimedia.org',
25 - 'prototype.wikimedia.org',
26 - 'localhost',
27 - '127.1.1.100'
28 - ],
29 - 'master_blacklist' : []
30 -};
31 -
32 -// User white_list should also be checked and configured at runtime.
33 -mw.ready( function() {
34 - // Build our configuration from the default and mwApiProxyConfig vars
35 - mwApiProxyConfig = $j.extend( true, mwApiProxyDefaultConfig, mwApiProxyConfig );
36 - mw.setConfig( 'apiProxyConfig', mwApiProxyConfig);
37 -
38 - // Do a setTimeout to 0 to call after other zero delay async events
39 - // ( once everyone is doing buildout within mwsetup prior to .ready this won't be needed. )
40 - mw.log( 'load ApiProxy' );
41 - mw.load( 'ApiProxy', function() {
42 - //Clear out the page content ( not needed for iframe proxy )
43 - $j( 'body' ).html( '' );
44 - mw.ApiProxy.server();
45 - } );
46 -} );
Index: branches/MwEmbedStandAlone/remotes/mediaWiki.js
@@ -162,7 +162,7 @@
163163 if ( wgPageName == 'MediaWiki:ApiProxy' ) {
164164 var wgEnableIframeApiProxy = true;
165165 loadMwEmbed( [ 'mw.ApiProxy' ], function() {
166 - mw.load( mwEmbedHostPath + '/remotes/apiProxyPage.js?' + mwGetReqArgs() );
 166+ mw.load( mwEmbedHostPath + '/modules/ApiProxy/ApiProxyPage.js?' + mwGetReqArgs() );
167167 } );
168168 return ;
169169 }

Status & tagging log