r63807 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r63806‎ | r63807 | r63808 >
Date:08:20, 16 March 2010
Author:dale
Status:deferred
Tags:
Comment:
fixed regression with apiTitleKey usage of titleKey
Modified paths:
  • /branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/mw.RemoteSearchDriver.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/searchLibs/baseRemoteSearch.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/searchLibs/mediaWikiSearch.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/remotes/mediaWiki.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/tests/Player_Themable.html (modified) (history)

Diff [purge]

Index: branches/js2-work/phase3/js/mwEmbed/tests/Player_Themable.html
@@ -11,13 +11,17 @@
1212 <link rel="stylesheet" href="../skins/kskin/EmbedPlayer.css" type="text/css" media="screen" />
1313 <script type="text/javascript" src="../mwEmbed.js?debug=true"></script>
1414
15 - -->
 15+ -->
 16+ <script type="text/javascript" src="http://cdn.jquerytools.org/1.1.2/full/jquery.tools.min.js"></script>
1617 <script type="text/javascript" src="../jsScriptLoader.php?debug=true&class=mwEmbed"></script>
1718
1819 </head>
1920 <script type="text/javascript">
2021 </script>
2122 <body>
 23+<video width="480" height="360" controls="controls" autobuffer="autobuffer" >
 24+ <source src="http://upload.wikimedia.org/wikipedia/commons/0/03/JohnWatts_2010-03-07_Q24-Pir.ogg" type="video/theora">
 25+</video>
2226 <h3> Sample Themable Player:</h3>
2327 To play with dynamic Themes install <a href="http://jqueryui.com/themeroller/developertool/">Themeroller</a><p><p>
2428
Index: branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/searchLibs/mediaWikiSearch.js
@@ -200,8 +200,7 @@
201201
202202 // Get the url safe titleKey from the descriptionurl
203203 var titleKey = page.imageinfo[0].descriptionurl.split( '/' );
204 - titleKey = unescape( titleKey[ titleKey.length - 1 ] );
205 - titleKey = titleKey.replace( /File:|Image:/, '' );
 204+ titleKey = unescape( titleKey[ titleKey.length - 1 ] );
206205
207206 var resource = {
208207 'id' : page_id,
@@ -314,7 +313,7 @@
315314 // Set the width:
316315 if ( size.width ) {
317316 request['iiurlwidth'] = size.width;
318 - }
 317+ }
319318
320319 mw.getJSON( this.provider.apiUrl, request, function( data ) {
321320 var imObj = { };
Index: branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/searchLibs/baseRemoteSearch.js
@@ -258,7 +258,8 @@
259259
260260 // Add the api title key if available:
261261 if( resource.titleKey ) {
262 - ahtml+= 'apiTitleKey="' + mw.escapeQuotesHTML( resource.titleKey ) + '" ';
 262+ ahtml+= 'apiTitleKey="' +
 263+ mw.escapeQuotesHTML( resource.titleKey.replace('File:', '') ) + '" ';
263264 }
264265
265266 // Add the commons apiProvider if the resource is from commons
Index: branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/mw.RemoteSearchDriver.js
@@ -2228,8 +2228,7 @@
22292229 }
22302230 var embedHtml = resource.pSobj.getEmbedHTML( resource,
22312231 {
2232 - 'id' : 'embed_vid',
2233 - 'apiTitleKey' : resource.title
 2232+ 'id' : 'embed_vid'
22342233 }
22352234 );
22362235 mw.log( 'append html: ' + embedHtml );
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 = 'r110';
 8+var mwRemoteVersion = 'r111';
99
1010 // Log the mwRemote version ( will determine what version of js we get )
1111 if( window.console ){

Status & tagging log