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 var AddLanguageOverlay = options.AddLanguageOverlay; | 5 var AddLanguageOverlay = options.AddLanguageOverlay; |
6 var AddStartupPageOverlay = options.AddStartupPageOverlay; | 6 var AddStartupPageOverlay = options.AddStartupPageOverlay; |
7 var AdvancedOptions = options.AdvancedOptions; | 7 var AdvancedOptions = options.AdvancedOptions; |
8 var AlertOverlay = options.AlertOverlay; | 8 var AlertOverlay = options.AlertOverlay; |
9 var AutoFillEditAddressOverlay = options.AutoFillEditAddressOverlay; | 9 var AutoFillEditAddressOverlay = options.AutoFillEditAddressOverlay; |
10 var AutoFillEditCreditCardOverlay = options.AutoFillEditCreditCardOverlay; | 10 var AutoFillEditCreditCardOverlay = options.AutoFillEditCreditCardOverlay; |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 'languageCustomizeModifierKeysOverlay') | 154 'languageCustomizeModifierKeysOverlay') |
155 OptionsPage.registerOverlay(languageModifierKeysOverlay, | 155 OptionsPage.registerOverlay(languageModifierKeysOverlay, |
156 SystemOptions.getInstance(), | 156 SystemOptions.getInstance(), |
157 [$('modifier-keys-button')]); | 157 [$('modifier-keys-button')]); |
158 } | 158 } |
159 | 159 |
160 Preferences.getInstance().initialize(); | 160 Preferences.getInstance().initialize(); |
161 OptionsPage.initialize(); | 161 OptionsPage.initialize(); |
162 | 162 |
163 var path = document.location.pathname; | 163 var path = document.location.pathname; |
164 // TODO(estade): remove this explicit hash handling. Pages should check for | |
165 // location.hash in didShowPage. | |
166 var hash = document.location.hash; | |
167 | 164 |
168 if (path.length > 1) { | 165 if (path.length > 1) { |
169 var pageName = path.slice(1); | 166 var pageName = path.slice(1); |
170 // Show page, but don't update history (there's already an entry for it). | 167 // Show page, but don't update history (there's already an entry for it). |
171 OptionsPage.showPageByName(pageName, false); | 168 OptionsPage.showPageByName(pageName, false); |
172 if (hash.length > 1) | |
173 OptionsPage.handleHashForPage(pageName, hash.slice(1)); | |
174 } else { | 169 } else { |
175 OptionsPage.showDefaultPage(); | 170 OptionsPage.showDefaultPage(); |
176 } | 171 } |
177 | 172 |
178 var subpagesNavTabs = document.querySelectorAll('.subpages-nav-tabs'); | 173 var subpagesNavTabs = document.querySelectorAll('.subpages-nav-tabs'); |
179 for(var i = 0; i < subpagesNavTabs.length; i++) { | 174 for(var i = 0; i < subpagesNavTabs.length; i++) { |
180 subpagesNavTabs[i].onclick = function(event) { | 175 subpagesNavTabs[i].onclick = function(event) { |
181 OptionsPage.showTab(event.srcElement); | 176 OptionsPage.showTab(event.srcElement); |
182 } | 177 } |
183 } | 178 } |
(...skipping 16 matching lines...) Expand all Loading... |
200 $('settings-title').onclick = function() { | 195 $('settings-title').onclick = function() { |
201 OptionsPage.navigateToPage(BrowserOptions.getInstance().name); | 196 OptionsPage.navigateToPage(BrowserOptions.getInstance().name); |
202 }; | 197 }; |
203 } | 198 } |
204 | 199 |
205 document.addEventListener('DOMContentLoaded', load); | 200 document.addEventListener('DOMContentLoaded', load); |
206 | 201 |
207 window.onpopstate = function(e) { | 202 window.onpopstate = function(e) { |
208 options.OptionsPage.setState(e.state); | 203 options.OptionsPage.setState(e.state); |
209 }; | 204 }; |
OLD | NEW |