Index: trunk/extensions/LiveTranslate/includes/ext.livetranslate.js |
— | — | @@ -31,11 +31,7 @@ |
32 | 32 | } |
33 | 33 | } |
34 | 34 | |
35 | | - $('#ltrevertbutton').click(function() { |
36 | | - $( '#bodyContent' ).html( originalHtml ); |
37 | | - }); |
38 | | - |
39 | | - $('#livetranslatebutton').click(function() { |
| 35 | + initiateTranslating = function() { |
40 | 36 | if ( originalHtml === false ) { |
41 | 37 | originalHtml = $( '#bodyContent' ).html(); |
42 | 38 | } |
— | — | @@ -66,8 +62,18 @@ |
67 | 63 | } |
68 | 64 | ); |
69 | 65 | } |
70 | | - }); |
| 66 | + } |
71 | 67 | |
| 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 | + |
72 | 78 | function getSpecialWords() { |
73 | 79 | var words = []; |
74 | 80 | |