OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 cr.define('options', function() { | 5 cr.define('options', function() { |
6 const OptionsPage = options.OptionsPage; | 6 const OptionsPage = options.OptionsPage; |
7 | 7 |
8 // Variable to track if a captcha challenge was issued. If this gets set to | 8 // Variable to track if a captcha challenge was issued. If this gets set to |
9 // true, it stays that way until we are told about successful login from | 9 // true, it stays that way until we are told about successful login from |
10 // the browser. This means subsequent errors (like invalid password) are | 10 // the browser. This means subsequent errors (like invalid password) are |
(...skipping 24 matching lines...) Expand all Loading... |
35 /** | 35 /** |
36 * Initializes the page. | 36 * Initializes the page. |
37 */ | 37 */ |
38 initializePage: function() { | 38 initializePage: function() { |
39 OptionsPage.prototype.initializePage.call(this); | 39 OptionsPage.prototype.initializePage.call(this); |
40 | 40 |
41 var acct_text = $('gaia-account-text'); | 41 var acct_text = $('gaia-account-text'); |
42 var translated_text = acct_text.textContent; | 42 var translated_text = acct_text.textContent; |
43 var posGoogle = translated_text.indexOf('Google'); | 43 var posGoogle = translated_text.indexOf('Google'); |
44 if (posGoogle != -1) { | 44 if (posGoogle != -1) { |
45 var ltr = templateData['textdirection'] == 'ltr'; | |
46 var googleIsAtEndOfSentence = posGoogle != 0; | 45 var googleIsAtEndOfSentence = posGoogle != 0; |
47 if (googleIsAtEndOfSentence == ltr) { | 46 |
48 // We're in ltr and in the translation the word 'Google' is AFTER the | 47 if (googleIsAtEndOfSentence) { |
49 // word 'Account' OR we're in rtl and 'Google' is BEFORE 'Account'. | |
50 var logo_td = $('gaia-logo'); | 48 var logo_td = $('gaia-logo'); |
51 logo_td.parentNode.appendChild(logo_td); | 49 logo_td.parentNode.appendChild(logo_td); |
52 } | 50 } |
53 acct_text.textContent = translated_text.replace('Google',''); | 51 acct_text.textContent = translated_text.replace('Google',''); |
54 } | 52 } |
55 | 53 |
56 var self = this; | 54 var self = this; |
57 $('gaia-login-form').onsubmit = function() { | 55 $('gaia-login-form').onsubmit = function() { |
58 self.sendCredentialsAndClose_(); | 56 self.sendCredentialsAndClose_(); |
59 return false; | 57 return false; |
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
810 | 808 |
811 SyncSetupOverlay.showStopSyncingUI = function() { | 809 SyncSetupOverlay.showStopSyncingUI = function() { |
812 SyncSetupOverlay.getInstance().showStopSyncingUI_(); | 810 SyncSetupOverlay.getInstance().showStopSyncingUI_(); |
813 }; | 811 }; |
814 | 812 |
815 // Export | 813 // Export |
816 return { | 814 return { |
817 SyncSetupOverlay: SyncSetupOverlay | 815 SyncSetupOverlay: SyncSetupOverlay |
818 }; | 816 }; |
819 }); | 817 }); |
OLD | NEW |