OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 this._disableJSCheckbox = disableJSElement.getElementsByTagName("input")[0]; | 278 this._disableJSCheckbox = disableJSElement.getElementsByTagName("input")[0]; |
279 this._updateScriptDisabledCheckbox(); | 279 this._updateScriptDisabledCheckbox(); |
280 | 280 |
281 p = this._appendSection(WebInspector.UIString("Appearance")); | 281 p = this._appendSection(WebInspector.UIString("Appearance")); |
282 p.appendChild(WebInspector.SettingsUI.createSettingCheckbox(WebInspector.UIS
tring("Show 'Emulation' view in console drawer."), WebInspector.settings.showEmu
lationViewInDrawer)); | 282 p.appendChild(WebInspector.SettingsUI.createSettingCheckbox(WebInspector.UIS
tring("Show 'Emulation' view in console drawer."), WebInspector.settings.showEmu
lationViewInDrawer)); |
283 this._appendDrawerNote(p.lastElementChild); | 283 this._appendDrawerNote(p.lastElementChild); |
284 p.appendChild(WebInspector.SettingsUI.createSettingCheckbox(WebInspector.UIS
tring("Show 'Rendering' view in console drawer."), WebInspector.settings.showRen
deringViewInDrawer)); | 284 p.appendChild(WebInspector.SettingsUI.createSettingCheckbox(WebInspector.UIS
tring("Show 'Rendering' view in console drawer."), WebInspector.settings.showRen
deringViewInDrawer)); |
285 this._appendDrawerNote(p.lastElementChild); | 285 this._appendDrawerNote(p.lastElementChild); |
286 var splitVerticallyTitle = WebInspector.UIString("Split panels vertically wh
en docked to %s", WebInspector.experimentsSettings.dockToLeft.isEnabled() ? "lef
t or right" : "right"); | 286 var splitVerticallyTitle = WebInspector.UIString("Split panels vertically wh
en docked to %s", WebInspector.experimentsSettings.dockToLeft.isEnabled() ? "lef
t or right" : "right"); |
287 p.appendChild(WebInspector.SettingsUI.createSettingCheckbox(splitVerticallyT
itle, WebInspector.settings.splitVerticallyWhenDockedToRight)); | 287 p.appendChild(WebInspector.SettingsUI.createSettingCheckbox(splitVerticallyT
itle, WebInspector.settings.splitVerticallyWhenDockedToRight)); |
| 288 var panelShortcutTitle = WebInspector.UIString("Enable %s + 1-9 shortcut to
switch panels", WebInspector.isMac() ? "Cmd" : "Ctrl"); |
| 289 p.appendChild(WebInspector.SettingsUI.createSettingCheckbox(panelShortcutTit
le, WebInspector.settings.shortcutPanelSwitch)); |
288 | 290 |
289 p = this._appendSection(WebInspector.UIString("Elements")); | 291 p = this._appendSection(WebInspector.UIString("Elements")); |
290 var colorFormatElement = this._createSelectSetting(WebInspector.UIString("Co
lor format"), [ | 292 var colorFormatElement = this._createSelectSetting(WebInspector.UIString("Co
lor format"), [ |
291 [ WebInspector.UIString("As authored"), WebInspector.Color.Format.Or
iginal ], | 293 [ WebInspector.UIString("As authored"), WebInspector.Color.Format.Or
iginal ], |
292 [ "HEX: #DAC0DE", WebInspector.Color.Format.HEX ], | 294 [ "HEX: #DAC0DE", WebInspector.Color.Format.HEX ], |
293 [ "RGB: rgb(128, 255, 255)", WebInspector.Color.Format.RGB ], | 295 [ "RGB: rgb(128, 255, 255)", WebInspector.Color.Format.RGB ], |
294 [ "HSL: hsl(300, 80%, 90%)", WebInspector.Color.Format.HSL ] | 296 [ "HSL: hsl(300, 80%, 90%)", WebInspector.Color.Format.HSL ] |
295 ], WebInspector.settings.colorFormat); | 297 ], WebInspector.settings.colorFormat); |
296 p.appendChild(colorFormatElement); | 298 p.appendChild(colorFormatElement); |
297 p.appendChild(WebInspector.SettingsUI.createSettingCheckbox(WebInspector.UIS
tring("Show user agent styles"), WebInspector.settings.showUserAgentStyles)); | 299 p.appendChild(WebInspector.SettingsUI.createSettingCheckbox(WebInspector.UIS
tring("Show user agent styles"), WebInspector.settings.showUserAgentStyles)); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 p.appendChild(WebInspector.SettingsUI.createSettingCheckbox(WebInspector.UIS
tring("Log XMLHttpRequests"), WebInspector.settings.monitoringXHREnabled)); | 341 p.appendChild(WebInspector.SettingsUI.createSettingCheckbox(WebInspector.UIS
tring("Log XMLHttpRequests"), WebInspector.settings.monitoringXHREnabled)); |
340 p.appendChild(WebInspector.SettingsUI.createSettingCheckbox(WebInspector.UIS
tring("Preserve log upon navigation"), WebInspector.settings.preserveConsoleLog)
); | 342 p.appendChild(WebInspector.SettingsUI.createSettingCheckbox(WebInspector.UIS
tring("Preserve log upon navigation"), WebInspector.settings.preserveConsoleLog)
); |
341 | 343 |
342 if (WebInspector.openAnchorLocationRegistry.handlerNames.length > 0) { | 344 if (WebInspector.openAnchorLocationRegistry.handlerNames.length > 0) { |
343 var handlerSelector = new WebInspector.HandlerSelector(WebInspector.open
AnchorLocationRegistry); | 345 var handlerSelector = new WebInspector.HandlerSelector(WebInspector.open
AnchorLocationRegistry); |
344 p = this._appendSection(WebInspector.UIString("Extensions")); | 346 p = this._appendSection(WebInspector.UIString("Extensions")); |
345 p.appendChild(this._createCustomSetting(WebInspector.UIString("Open link
s in"), handlerSelector.element)); | 347 p.appendChild(this._createCustomSetting(WebInspector.UIString("Open link
s in"), handlerSelector.element)); |
346 } | 348 } |
347 | 349 |
348 p = this._appendSection(); | 350 p = this._appendSection(); |
349 var panelShortcutTitle = WebInspector.UIString("Enable %s + 1-9 shortcut to
switch panels", WebInspector.isMac() ? "Cmd" : "Ctrl"); | 351 |
350 p.appendChild(WebInspector.SettingsUI.createSettingCheckbox(panelShortcutTit
le, WebInspector.settings.shortcutPanelSwitch)); | 352 var restoreDefaults = p.createChild("input", "settings-tab-text-button"); |
| 353 restoreDefaults.type = "button"; |
| 354 restoreDefaults.value = WebInspector.UIString("Restore defaults and reload")
; |
| 355 restoreDefaults.addEventListener("click", restoreAndReload); |
| 356 |
| 357 function restoreAndReload() |
| 358 { |
| 359 if (window.localStorage) |
| 360 window.localStorage.clear(); |
| 361 WebInspector.reload(); |
| 362 } |
351 } | 363 } |
352 | 364 |
353 WebInspector.GenericSettingsTab.prototype = { | 365 WebInspector.GenericSettingsTab.prototype = { |
354 _updateScriptDisabledCheckbox: function() | 366 _updateScriptDisabledCheckbox: function() |
355 { | 367 { |
356 /** | 368 /** |
357 * @param {?Protocol.Error} error | 369 * @param {?Protocol.Error} error |
358 * @param {string} status | 370 * @param {string} status |
359 * @this {WebInspector.GenericSettingsTab} | 371 * @this {WebInspector.GenericSettingsTab} |
360 */ | 372 */ |
(...skipping 740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1101 var inputElement = this._addInputElements[columnId]; | 1113 var inputElement = this._addInputElements[columnId]; |
1102 inputElement.value = ""; | 1114 inputElement.value = ""; |
1103 } | 1115 } |
1104 }, | 1116 }, |
1105 | 1117 |
1106 __proto__: WebInspector.SettingsList.prototype | 1118 __proto__: WebInspector.SettingsList.prototype |
1107 } | 1119 } |
1108 | 1120 |
1109 /** @type {!WebInspector.SettingsController} */ | 1121 /** @type {!WebInspector.SettingsController} */ |
1110 WebInspector.settingsController; | 1122 WebInspector.settingsController; |
OLD | NEW |