| 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 // Variable to track if a captcha challenge was issued. If this gets set to | 5 // Variable to track if a captcha challenge was issued. If this gets set to |
| 6 // true, it stays that way until we are told about successful login from | 6 // true, it stays that way until we are told about successful login from |
| 7 // the browser. This means subsequent errors (like invalid password) are | 7 // the browser. This means subsequent errors (like invalid password) are |
| 8 // rendered in the captcha state, which is basically identical except we | 8 // rendered in the captcha state, which is basically identical except we |
| 9 // don't show the top error blurb "Error Signing in" or the "Create | 9 // don't show the top error blurb "Error Signing in" or the "Create |
| 10 // account" link. | 10 // account" link. |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 function load() { | 134 function load() { |
| 135 var acct_text = document.getElementById("gaia-account-text"); | 135 var acct_text = document.getElementById("gaia-account-text"); |
| 136 var translated_text = acct_text.textContent; | 136 var translated_text = acct_text.textContent; |
| 137 var posGoogle = translated_text.indexOf('Google'); | 137 var posGoogle = translated_text.indexOf('Google'); |
| 138 if (posGoogle != -1) { | 138 if (posGoogle != -1) { |
| 139 var ltr = templateData['textdirection'] == 'ltr'; | 139 var ltr = templateData['textdirection'] == 'ltr'; |
| 140 var googleIsAtEndOfSentence = posGoogle != 0; | 140 var googleIsAtEndOfSentence = posGoogle != 0; |
| 141 if (googleIsAtEndOfSentence == ltr) { | 141 if (googleIsAtEndOfSentence == ltr) { |
| 142 // We're in ltr and in the translation the word 'Google' is AFTER the | 142 // We're in ltr and in the translation the word 'Google' is AFTER the |
| 143 // word 'Account' OR we're in rtl and 'Google' is BEFORE 'Account'. | 143 // word 'Account' OR we're in rtl and 'Google' is BEFORE 'Account'. |
| 144 var logo_td = document.getElementById('gaia-logo'); | 144 var logo_div = document.getElementById('gaia-logo'); |
| 145 logo_td.parentNode.appendChild(logo_td); | 145 logo_div.parentNode.appendChild(logo_div); |
| 146 } | 146 } |
| 147 acct_text.textContent = translated_text.replace('Google',''); | 147 acct_text.textContent = translated_text.replace('Google',''); |
| 148 } | 148 } |
| 149 | 149 |
| 150 var loginForm = document.getElementById("gaia-login-form"); | 150 var loginForm = document.getElementById("gaia-login-form"); |
| 151 loginForm.onsubmit = function() { | 151 loginForm.onsubmit = function() { |
| 152 sendCredentialsAndClose(); | 152 sendCredentialsAndClose(); |
| 153 return false; | 153 return false; |
| 154 }; | 154 }; |
| 155 | 155 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 | 243 |
| 244 function onPreLogin() { | 244 function onPreLogin() { |
| 245 if (window["onlogin"] != null) { | 245 if (window["onlogin"] != null) { |
| 246 return onlogin(); | 246 return onlogin(); |
| 247 } else { | 247 } else { |
| 248 return true; | 248 return true; |
| 249 } | 249 } |
| 250 } | 250 } |
| 251 | 251 |
| 252 document.addEventListener('DOMContentLoaded', load); | 252 document.addEventListener('DOMContentLoaded', load); |
| OLD | NEW |