Bug 1371849 - move source map pref checkbox into "advanced" area in options panel; r=bgrins

MozReview-Commit-ID: E76CBevu12g

--HG--
extra : rebase_source : e664b89d97818cd2d08e011de5640865cd1c769c
This commit is contained in:
Tom Tromey 2017-09-15 09:07:37 -06:00
parent 79dd91860a
commit 9410972047
3 changed files with 22 additions and 19 deletions

View File

@ -100,6 +100,8 @@ OptionsPanel.prototype = {
_addListeners: function () {
Services.prefs.addObserver("devtools.cache.disabled", this._prefChanged);
Services.prefs.addObserver("devtools.theme", this._prefChanged);
Services.prefs.addObserver("devtools.source-map.client-service.enabled",
this._prefChanged);
gDevTools.on("theme-registered", this._themeRegistered);
gDevTools.on("theme-unregistered", this._themeUnregistered);
},
@ -107,6 +109,8 @@ OptionsPanel.prototype = {
_removeListeners: function () {
Services.prefs.removeObserver("devtools.cache.disabled", this._prefChanged);
Services.prefs.removeObserver("devtools.theme", this._prefChanged);
Services.prefs.removeObserver("devtools.source-map.client-service.enabled",
this._prefChanged);
gDevTools.off("theme-registered", this._themeRegistered);
gDevTools.off("theme-unregistered", this._themeUnregistered);
},
@ -118,6 +122,8 @@ OptionsPanel.prototype = {
cbx.checked = cacheDisabled;
} else if (prefName === "devtools.theme") {
this.updateCurrentTheme();
} else if (prefName === "devtools.source-map.client-service.enabled") {
this.updateSourceMapPref();
}
},
@ -347,6 +353,7 @@ OptionsPanel.prototype = {
for (let prefDefinition of prefDefinitions) {
let parent = this.panelDoc.getElementById(prefDefinition.parentId);
parent.appendChild(createPreferenceOption(prefDefinition));
parent.removeAttribute("hidden");
}
},
@ -425,6 +432,13 @@ OptionsPanel.prototype = {
}
},
updateSourceMapPref: function () {
const prefName = "devtools.source-map.client-service.enabled";
let enabled = GetPref(prefName);
let box = this.panelDoc.querySelector(`[data-pref="${prefName}"]`);
box.checked = enabled;
},
/**
* Disables JavaScript for the currently loaded tab. We force a page refresh
* here because setting docShell.allowJavascript to true fails to block JS

View File

@ -76,23 +76,12 @@
</label>
</fieldset>
<fieldset id="debugger-options" class="options-groupbox">
<fieldset id="debugger-options" class="options-groupbox" hidden="true">
<legend>&options.debugger.label;</legend>
<label title="&options.sourceMaps.tooltip;">
<input type="checkbox"
id="debugger-sourcemaps"
data-pref="devtools.debugger.client-source-maps-enabled"/>
<span>&options.sourceMaps.label;</span>
</label>
</fieldset>
<fieldset id="styleeditor-options" class="options-groupbox">
<legend>&options.styleeditor.label;</legend>
<label title="&options.stylesheetSourceMaps.tooltip;">
<input type="checkbox"
data-pref="devtools.source-map.client-service.enabled"/>
<span>&options.stylesheetSourceMaps.label;</span>
</label>
<label title="&options.stylesheetAutocompletion.tooltip;">
<input type="checkbox"
data-pref="devtools.styleeditor.autocompletion-enabled"/>
@ -161,6 +150,11 @@
<fieldset id="context-options" class="options-groupbox">
<legend>&options.context.advancedSettings;</legend>
<label title="&options.sourceMaps.tooltip1;">
<input type="checkbox"
data-pref="devtools.source-map.client-service.enabled"/>
<span>&options.sourceMaps.label;</span>
</label>
<label title="&options.showPlatformData.tooltip;">
<input type="checkbox"
id="devtools-show-gecko-data"

View File

@ -145,20 +145,15 @@
<!ENTITY options.debugger.label "Debugger">
<!-- LOCALIZATION NOTE (options.sourceMap.label): This is the
- label for the checkbox that toggles source maps in the Debugger -->
- label for the checkbox that toggles source maps in all tools -->
<!ENTITY options.sourceMaps.label "Enable Source Maps">
<!ENTITY options.sourceMaps.tooltip "If you enable this option sources will be mapped in the Debugger and Console.">
<!ENTITY options.sourceMaps.tooltip1 "If you enable this option sources will be mapped in the tools.">
<!-- LOCALIZATION NOTE (options.styleeditor.label): This is the label for the
- heading of the group of Style Editor preferences in the options
- panel. -->
<!ENTITY options.styleeditor.label "Style Editor">
<!-- LOCALIZATION NOTE (options.stylesheetSourceMaps.label): This is the
- label for the checkbox that toggles showing original sources in the Style Editor -->
<!ENTITY options.stylesheetSourceMaps.label "Show original sources">
<!ENTITY options.stylesheetSourceMaps.tooltip "Show original sources (e.g. Sass files) in the Style Editor and Inspector">
<!-- LOCALIZATION NOTE (options.stylesheetAutocompletion.label): This is the
- label for the checkbox that toggles autocompletion of css in the Style Editor -->
<!ENTITY options.stylesheetAutocompletion.label "Autocomplete CSS">