r97125 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97124‎ | r97125 | r97126 >
Date:00:18, 15 September 2011
Author:jeroendedauw
Status:ok
Tags:
Comment:
1.2.2
Modified paths:
  • /trunk/extensions/LiveTranslate/LiveTranslate.php (modified) (history)
  • /trunk/extensions/LiveTranslate/RELEASE-NOTES (modified) (history)
  • /trunk/extensions/LiveTranslate/includes/jquery.liveTranslate.js (modified) (history)
  • /trunk/extensions/LiveTranslate/includes/jquery.replaceText.js (modified) (history)

Diff [purge]

Index: trunk/extensions/LiveTranslate/LiveTranslate.php
@@ -24,7 +24,7 @@
2525 die( 'Not an entry point.' );
2626 }
2727
28 -define( 'LiveTranslate_VERSION', '1.2.1' );
 28+define( 'LiveTranslate_VERSION', '1.2.2' );
2929
3030 $wgExtensionCredits['other'][] = array(
3131 'path' => __FILE__,
@@ -92,16 +92,16 @@
9393 if ( defined( 'MW_SUPPORTS_RESOURCE_MODULES' ) ) {
9494 $moduleTemplate = array(
9595 'localBasePath' => dirname( __FILE__ ),
96 - 'remoteBasePath' => $egLiveTranslateScriptPath,
 96+ 'remoteExtPath' => 'LiveTranslate',
9797 'group' => 'ext.livetranslate'
9898 );
9999
100100 $wgResourceModules['ext.livetranslate'] = $moduleTemplate + array(
101101 'scripts' => array(
 102+ 'includes/jquery.replaceText.js',
102103 'includes/ext.livetranslate.js',
 104+ 'includes/jquery.liveTranslate.js',
103105 'includes/ext.lt.tm.js',
104 - 'includes/jquery.replaceText.js',
105 - 'includes/jquery.liveTranslate.js'
106106 ),
107107 'dependencies' => array( 'jquery'/*, 'jquery.ui.button'*/ ),
108108 'messages' => $egLTJSMessages
Index: trunk/extensions/LiveTranslate/RELEASE-NOTES
@@ -4,6 +4,11 @@
55 Latest version of the release notes: http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/LiveTranslate/RELEASE-NOTES?view=co
66
77
 8+=== Version 1.2.2 ===
 9+2011-09-15
 10+
 11+* Fixed script loading issue occuring when resource loader debugging is off.
 12+
813 === Version 1.2.1 ===
914 2011-09-12
1015
Index: trunk/extensions/LiveTranslate/includes/jquery.liveTranslate.js
@@ -8,6 +8,18 @@
99
1010 ( function ( $, lt ) { $.fn.liveTranslate = function( options ) {
1111
 12+ /**
 13+ * Regex text escaping function.
 14+ * Borrowed from http://simonwillison.net/2006/Jan/20/escape/
 15+ */
 16+ RegExp.escape = function( text ) {
 17+ if ( !arguments.callee.sRE ) {
 18+ var specials = [ '/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\' ];
 19+ arguments.callee.sRE = new RegExp( '(\\' + specials.join('|\\') + ')', 'g' );
 20+ }
 21+ return text.replace(arguments.callee.sRE, '\\$1');
 22+ }
 23+
1224 var _this = this;
1325
1426 /**
@@ -241,4 +253,4 @@
242254
243255 return this;
244256
245 -}; } )( jQuery, window.liveTranslate );
\ No newline at end of file
 257+}; } )( window.jQuery, window.liveTranslate );
\ No newline at end of file
Index: trunk/extensions/LiveTranslate/includes/jquery.replaceText.js
@@ -8,16 +8,4 @@
99 */
1010 ( function ( $ ) {
1111 $.fn.replaceText=function(b,a,c){return this.each(function(){var f=this.firstChild,g,e,d=[];if(f){do{if(f.nodeType===3){g=f.nodeValue;e=g.replace(b,a);if(e!==g){if(!c&&/</.test(e)){$(f).before(e);d.push(f)}else{f.nodeValue=e}}}}while(f=f.nextSibling)}d.length&&$(d).remove()})};
12 -} )( jQuery );
13 -
14 -/**
15 - * Regex text escaping function.
16 - * Borrowed from http://simonwillison.net/2006/Jan/20/escape/
17 - */
18 -RegExp.escape = function( text ) {
19 - if ( !arguments.callee.sRE ) {
20 - var specials = [ '/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\' ];
21 - arguments.callee.sRE = new RegExp( '(\\' + specials.join('|\\') + ')', 'g' );
22 - }
23 - return text.replace(arguments.callee.sRE, '\\$1');
24 -}
\ No newline at end of file
 12+} )( window.jQuery );

Status & tagging log