1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-11-07 03:12:33 +01:00

Minor code review

This commit is contained in:
Raymond Hill 2020-04-28 18:39:31 -04:00
parent 90be78d7a2
commit d364eb9668
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
3 changed files with 17 additions and 21 deletions

View File

@ -52,7 +52,7 @@ hr {
top: 0;
z-index: 100;
}
#basicTools {
#stickyTools {
align-items: stretch;
display: flex;
justify-content: space-between;

View File

@ -41,26 +41,22 @@ CodeMirror.defineMode('raw-settings', function() {
return {
token: function(stream) {
if ( stream.sol() ) {
const match = stream.match(/\s*\S+/);
if ( match !== null ) {
lastSetting = match[0].trim();
if ( defaultSettings.has(lastSetting) ) {
stream.eatSpace();
const match = stream.match(/\S+/);
if ( match !== null && defaultSettings.has(match[0]) ) {
lastSetting = match[0];
return 'keyword';
}
}
lastSetting = '';
stream.skipToEnd();
return 'error';
return 'line-cm-error';
}
if ( lastSetting !== '' ) {
stream.eatSpace();
const match = stream.match(/\S+.*$/);
if ( match !== null ) {
if ( match[0] !== defaultSettings.get(lastSetting) ) {
return 'strong';
}
}
lastSetting = '';
const match = stream.match(/.*$/);
if (
match !== null &&
match[0].trim() !== defaultSettings.get(lastSetting)
) {
return 'line-cm-strong';
}
stream.skipToEnd();
return null;

View File

@ -14,7 +14,7 @@
<body class="loading">
<div id="panes">
<div id="sticky">
<div id="basicTools">
<div id="stickyTools">
<div class="rulesetTools">
<span id="saveRules" class="fa-icon" data-i18n-title="popupTipSaveRules">lock</span>
<span id="revertRules" class="fa-icon" data-i18n-title="popupTipRevertRules">eraser</span>
@ -44,7 +44,7 @@
<span id="no-scripting" class="hnSwitch tool enabled" role="button" aria-label tabindex="0" title><span class="fa-icon fa-icon-badged">code<svg class="nope" viewBox="0 0 20 20"><path d="M1,1 19,19M1,19 19,1" /></svg></span><span class="caption" data-i18n="popupNoScripting_v2"></span></span>
</div>
<hr>
<div class="toolRibbon">
<div id="basicTools" class="toolRibbon">
<span id="gotoZap" class="fa-icon tool" data-i18n-title="popupTipZapper">bolt<span class="caption" data-i18n="popupTipZapper"></span></span>
<span id="gotoPick" class="fa-icon tool" data-i18n-title="popupTipPicker">eye-dropper<span class="caption" data-i18n="popupTipPicker"></span></span>
<a href="logger-ui.html#_" class="fa-icon tool enabled" target="uBOLogger" tabindex="0" data-i18n-title="popupTipLog">list-alt<span class="caption" data-i18n="popupTipLog"></span></a>