mirror of https://github.com/gorhill/uBlock.git
Minor code review
This commit is contained in:
parent
90be78d7a2
commit
d364eb9668
|
@ -52,7 +52,7 @@ hr {
|
||||||
top: 0;
|
top: 0;
|
||||||
z-index: 100;
|
z-index: 100;
|
||||||
}
|
}
|
||||||
#basicTools {
|
#stickyTools {
|
||||||
align-items: stretch;
|
align-items: stretch;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
|
|
@ -41,26 +41,22 @@ CodeMirror.defineMode('raw-settings', function() {
|
||||||
return {
|
return {
|
||||||
token: function(stream) {
|
token: function(stream) {
|
||||||
if ( stream.sol() ) {
|
if ( stream.sol() ) {
|
||||||
const match = stream.match(/\s*\S+/);
|
stream.eatSpace();
|
||||||
if ( match !== null ) {
|
const match = stream.match(/\S+/);
|
||||||
lastSetting = match[0].trim();
|
if ( match !== null && defaultSettings.has(match[0]) ) {
|
||||||
if ( defaultSettings.has(lastSetting) ) {
|
lastSetting = match[0];
|
||||||
return 'keyword';
|
return 'keyword';
|
||||||
}
|
}
|
||||||
}
|
|
||||||
lastSetting = '';
|
|
||||||
stream.skipToEnd();
|
stream.skipToEnd();
|
||||||
return 'error';
|
return 'line-cm-error';
|
||||||
}
|
}
|
||||||
if ( lastSetting !== '' ) {
|
|
||||||
stream.eatSpace();
|
stream.eatSpace();
|
||||||
const match = stream.match(/\S+.*$/);
|
const match = stream.match(/.*$/);
|
||||||
if ( match !== null ) {
|
if (
|
||||||
if ( match[0] !== defaultSettings.get(lastSetting) ) {
|
match !== null &&
|
||||||
return 'strong';
|
match[0].trim() !== defaultSettings.get(lastSetting)
|
||||||
}
|
) {
|
||||||
}
|
return 'line-cm-strong';
|
||||||
lastSetting = '';
|
|
||||||
}
|
}
|
||||||
stream.skipToEnd();
|
stream.skipToEnd();
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
<body class="loading">
|
<body class="loading">
|
||||||
<div id="panes">
|
<div id="panes">
|
||||||
<div id="sticky">
|
<div id="sticky">
|
||||||
<div id="basicTools">
|
<div id="stickyTools">
|
||||||
<div class="rulesetTools">
|
<div class="rulesetTools">
|
||||||
<span id="saveRules" class="fa-icon" data-i18n-title="popupTipSaveRules">lock</span>
|
<span id="saveRules" class="fa-icon" data-i18n-title="popupTipSaveRules">lock</span>
|
||||||
<span id="revertRules" class="fa-icon" data-i18n-title="popupTipRevertRules">eraser</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>
|
<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>
|
</div>
|
||||||
<hr>
|
<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="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>
|
<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>
|
<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>
|
||||||
|
|
Loading…
Reference in New Issue