r102182 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r102181‎ | r102182 | r102183 >
Date:15:38, 6 November 2011
Author:nikerabbit
Status:ok (Comments)
Tags:
Comment:
Hopefully fix JS issues in 1.17
Modified paths:
  • /trunk/extensions/Translate/README (modified) (history)
  • /trunk/extensions/Translate/Translate.php (modified) (history)
  • /trunk/extensions/Translate/resources/ext.translate.messagetable.js (modified) (history)
  • /trunk/extensions/Translate/resources/ext.translate.special.importtranslations.js (modified) (history)
  • /trunk/extensions/Translate/resources/ext.translate.special.translate.js (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/Translate.php
@@ -212,7 +212,9 @@
213213
214214 $wgResourceModules['ext.translate.special.importtranslations'] = array(
215215 'scripts' => 'resources/ext.translate.special.importtranslations.js',
216 - 'dependencies' => array( 'jquery.ui.autocomplete' ),
 216+ 'dependencies' => array(
 217+ 'jquery.ui.autocomplete',
 218+ ),
217219 ) + $resourcePaths;
218220
219221 $wgResourceModules['ext.translate.selecttoinput'] = array(
Index: trunk/extensions/Translate/resources/ext.translate.special.importtranslations.js
@@ -1,4 +1,11 @@
22 jQuery( function( $ ) {
 3+ // BC for MW < 1.18
 4+ if ( !mw.util.wikiScript ) {
 5+ mw.util.wikiScript = function( str ) {
 6+ return mw.config.get( 'wgScriptPath' ) + '/' + ( str || 'index' ) + mw.config.get( 'wgScriptExtension' );
 7+ }
 8+ }
 9+
310 $(".mw-translate-import-inputs").change( function() {
411 var id = $(this).attr( "id" ).replace( /-input/, "" );
512 $( "input[name=upload-type]:checked" ).attr( "checked", false );
Index: trunk/extensions/Translate/resources/ext.translate.messagetable.js
@@ -1,4 +1,11 @@
22 jQuery( function( $ ) {
 3+ // BC for MW < 1.18
 4+ if ( !mw.util.wikiScript ) {
 5+ mw.util.wikiScript = function( str ) {
 6+ return mw.config.get( 'wgScriptPath' ) + '/' + ( str || 'index' ) + mw.config.get( 'wgScriptExtension' );
 7+ }
 8+ }
 9+
310 $( ".mw-translate-messagereviewbutton" ).click( function() {
411 var $b = $(this);
512
Index: trunk/extensions/Translate/resources/ext.translate.special.translate.js
@@ -1,4 +1,11 @@
2 -jQuery( document ).ready( function( $ ) {
 2+jQuery( function( $ ) {
 3+ // BC for MW < 1.18
 4+ if ( !mw.util.wikiScript ) {
 5+ mw.util.wikiScript = function( str ) {
 6+ return mw.config.get( 'wgScriptPath' ) + '/' + ( str || 'index' ) + mw.config.get( 'wgScriptExtension' );
 7+ }
 8+ }
 9+
310 var $submit = $( "input#mw-translate-workflowset" );
411 var $select = $( "#mw-sp-translate-workflow select" );
512 $select.find( "option[value=]" ).attr( "disabled", "disabled" );
Index: trunk/extensions/Translate/README
@@ -29,6 +29,8 @@
3030 http://translatewiki.net/docs/Translate/html/
3131
3232 == Change log ==
 33+* 2011-11-06
 34+- Fixed compatibility with MW 1.17 in JavaScript
3335 * 2011-11-04
3436 - fuzzy.php can now take optional namespace prefix for each message
3537 * 2011-10-30

Follow-up revisions

RevisionCommit summaryAuthorDate
r105524Followup r102182 - account for old jquerynikerabbit09:13, 8 December 2011

Comments

#Comment by Amire80 (talk | contribs)   19:20, 5 December 2011

I tried to test it with a clean install of 1.17.1 and other functions didn't work because of an old jQuery version ("$b.prop is not a function").

Status & tagging log