r78755 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r78754‎ | r78755 | r78756 >
Date:21:39, 21 December 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Re-bind events after replacing the page html with the original
Modified paths:
  • /trunk/extensions/LiveTranslate/includes/ext.livetranslate.js (modified) (history)

Diff [purge]

Index: trunk/extensions/LiveTranslate/includes/ext.livetranslate.js
@@ -31,11 +31,7 @@
3232 }
3333 }
3434
35 - $('#ltrevertbutton').click(function() {
36 - $( '#bodyContent' ).html( originalHtml );
37 - });
38 -
39 - $('#livetranslatebutton').click(function() {
 35+ initiateTranslating = function() {
4036 if ( originalHtml === false ) {
4137 originalHtml = $( '#bodyContent' ).html();
4238 }
@@ -66,8 +62,18 @@
6763 }
6864 );
6965 }
70 - });
 66+ }
7167
 68+ showOriginal = function() {
 69+ currentLang = window.sourceLang;
 70+ $( '#bodyContent' ).html( originalHtml );
 71+ $('#livetranslatebutton').click( initiateTranslating );
 72+ $('#ltrevertbutton').click( showOriginal );
 73+ }
 74+
 75+ $('#livetranslatebutton').click( initiateTranslating );
 76+ $('#ltrevertbutton').click( showOriginal );
 77+
7278 function getSpecialWords() {
7379 var words = [];
7480

Status & tagging log