Commit 2a9b3de1 authored by Thomas Rientjes's avatar Thomas Rientjes
Browse files

Refactor the settings panel logic

parent a1e1d6a0
......@@ -90,9 +90,23 @@ a {
.slider-legend-item {
color: #999;
text-align: center;
width: 85px;
}
.slider-legend-item:first-child {
text-align: left;
}
.slider-legend-item:last-child {
text-align: right;
}
.enumeration {
font-size: 12.5px;
padding-left: 20px;
}
.text-left {
text-align: left;
}
......
......@@ -33,9 +33,9 @@
<input class="slider-input" type="range" max="2" value="0" data-setting-id="security_level">
<div class="slider-legend">
<div class="slider-legend-item text-left" data-active-if="security_level:0" data-l10n-id="standard_label"></div>
<div class="slider-legend-item text-center" data-active-if="security_level:1" data-l10n-id="safer_label"></div>
<div class="slider-legend-item text-right" data-active-if="security_level:2" data-l10n-id="safest_label"></div>
<div class="slider-legend-item" data-active-if="security_level:0" data-l10n-id="standard_label"></div>
<div class="slider-legend-item" data-active-if="security_level:1" data-l10n-id="safer_label"></div>
<div class="slider-legend-item" data-active-if="security_level:2" data-l10n-id="safest_label"></div>
</div>
</div>
......@@ -43,7 +43,7 @@
<div class="settings-item notice" data-visible-if="security_level:0">
<div class="notice-body">
<div data-l10n-id="standard_description"></div>
<span data-l10n-id="standard_description"></span>
</div>
</div>
......@@ -52,13 +52,13 @@
<div class="notice-body">
<div data-l10n-id="safer_description"></div>
<span data-l10n-id="safer_description"></span>
<span data-l10n-id="safer_list_label"></span>&#58;
<ul style="padding-left: 20px; font-size: 12.5px;">
<li>JavaScript is disabled on non-HTTPS sites.</li>
<li>Audio and video (HTML5 media) are tap-to-play.</li>
<li>Some fonts and math symbols are disabled.</li>
<ul class="enumeration">
<li data-l10n-id="js_on_https_sites_only"></li>
<li data-l10n-id="tap_to_play_media"></li>
<li data-l10n-id="limit_typography"></li>
</ul>
</div>
......@@ -69,13 +69,13 @@
<div class="notice-body">
<div data-l10n-id="safest_description"></div>
<span data-l10n-id="safest_description"></span>
<span data-l10n-id="safest_list_label"></span>&#58;
<ul style="padding-left: 20px; font-size: 12.5px;">
<li>JavaScript is disabled by default on all sites.</li>
<li>Audio and video (HTML5 media) are tap-to-play.</li>
<li>Some fonts, icons, math symbols and images are disabled.</li>
<ul class="enumeration">
<li data-l10n-id="js_disabled"></li>
<li data-l10n-id="tap_to_play_media"></li>
<li data-l10n-id="limit_graphics_and_typography"></li>
</ul>
</div>
......
......@@ -9,3 +9,8 @@ safest_label = Safest
safest_description = Only allows website features required for static and basic services. These changes affect images, media, and scripts.
safest_list_label = At the safest setting
learn_more_label = Learn More
js_on_https_sites_only = JavaScript is disabled on non-HTTP sites.
js_disabled = JavaScript is disabled by default on all sites.
limit_typography = Some fonts and math symbols are disabled.
limit_graphics_and_typography = Some fonts, icons, math symbols and images are disabled.
tap_to_play_media = Audio and video (HTML5 media) are tap-to-play.
......@@ -94,7 +94,12 @@ function startListening (worker) {
safest_label: _('safest_label'),
safest_description: _('safest_description'),
safest_list_label: _('safest_list_label'),
learn_more_label: _('learn_more_label')
learn_more_label: _('learn_more_label'),
js_on_https_sites_only: _('js_on_https_sites_only'),
js_disabled: _('js_disabled'),
limit_typography: _('limit_typography'),
limit_graphics_and_typography: _('limit_graphics_and_typography'),
tap_to_play_media: _('tap_to_play_media')
},
settings: {
security_level: new Setting('security_level', settings['security_level'])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment