remove cruft; silence eslint

This commit is contained in:
tophf 2017-11-23 08:18:55 +03:00
parent 479d95711b
commit 74701810b7
4 changed files with 8 additions and 16 deletions

View File

@ -235,7 +235,7 @@
</span> </span>
</div> </div>
</details> </details>
<details id="lint"> <details id="lint" class="hidden">
<summary> <summary>
<h2 i18n-text="linterIssues">: <span id="issue-count"></span><!-- EAT SPACE <h2 i18n-text="linterIssues">: <span id="issue-count"></span><!-- EAT SPACE
--><svg id="lint-help" class="svg-icon info intercepts-click"> --><svg id="lint-help" class="svg-icon info intercepts-click">

View File

@ -5,11 +5,13 @@
/* global CSSLint initLint linterConfig updateLintReport renderLintReport updateLinter */ /* global CSSLint initLint linterConfig updateLintReport renderLintReport updateLinter */
/* global mozParser createSourceEditor */ /* global mozParser createSourceEditor */
/* global closeCurrentTab regExpTester messageBox */ /* global closeCurrentTab regExpTester messageBox */
/* global initColorpicker */
'use strict'; 'use strict';
onDOMready() onDOMready()
.then(() => Promise.all([ .then(() => Promise.all([
window.initColorpicker(), initColorpicker(),
initCollapsibles(),
])) ]))
.then(init); .then(init);

View File

@ -142,11 +142,6 @@ function initLint() {
$('#linter-settings').addEventListener('click', linterConfig.openOnClick); $('#linter-settings').addEventListener('click', linterConfig.openOnClick);
window.addEventListener('resize', resizeLintReport); window.addEventListener('resize', resizeLintReport);
// touch devices don't have onHover events so the element we'll be toggled via clicking (touching)
if ('ontouchstart' in document.body) {
$('#lint h2').addEventListener('click', toggleLintReport);
}
updateLinter(); updateLinter();
linterConfig.watchStorage(); linterConfig.watchStorage();
prefs.subscribe(['editor.linter'], updateLinter); prefs.subscribe(['editor.linter'], updateLinter);
@ -164,7 +159,7 @@ function updateLinter({immediately, linter = linterConfig.getDefault()} = {}) {
loadLinterAssets(linter) loadLinterAssets(linter)
]).then(updateEditors); ]).then(updateEditors);
$('#linter-settings').style.display = !linter ? 'none' : 'inline-block'; $('#linter-settings').style.display = !linter ? 'none' : 'inline-block';
$('#lint').style.display = 'none'; $('#lint').classList.add('hidden');
function updateEditors() { function updateEditors() {
CodeMirror.defaults.lint = linterConfig.getForCodeMirror(linter); CodeMirror.defaults.lint = linterConfig.getForCodeMirror(linter);
@ -336,7 +331,7 @@ function renderLintReport(someBlockChanged) {
if (someBlockChanged || newContent.children.length !== content.children.length) { if (someBlockChanged || newContent.children.length !== content.children.length) {
$('#issue-count').textContent = issueCount; $('#issue-count').textContent = issueCount;
container.replaceChild(newContent, content); container.replaceChild(newContent, content);
container.style.display = newContent.children.length ? 'block' : 'none'; container.classList.toggle('hidden', !newContent.children.length);
resizeLintReport(); resizeLintReport();
} }
} }
@ -370,10 +365,6 @@ function gotoLintIssue(event) {
}); });
} }
function toggleLintReport() {
$('#lint').classList.toggle('collapsed');
}
function showLintHelp() { function showLintHelp() {
const linter = linterConfig.getDefault(); const linter = linterConfig.getDefault();
const baseUrl = linter === 'stylelint' const baseUrl = linter === 'stylelint'

View File

@ -1,6 +1,6 @@
/* global CodeMirror dirtyReporter initLint beautify showKeyMapHelp */ /* global CodeMirror dirtyReporter initLint beautify showKeyMapHelp */
/* global showToggleStyleHelp goBackToManage updateLintReportIfEnabled */ /* global showToggleStyleHelp goBackToManage updateLintReportIfEnabled */
/* global hotkeyRerouter setupAutocomplete setupOptionsExpand */ /* global hotkeyRerouter setupAutocomplete */
/* global editors linterConfig updateLinter regExpTester mozParser */ /* global editors linterConfig updateLinter regExpTester mozParser */
/* global makeLink createAppliesToLineWidget messageBox */ /* global makeLink createAppliesToLineWidget messageBox */
'use strict'; 'use strict';
@ -9,6 +9,7 @@ function createSourceEditor(style) {
// a flag for isTouched() // a flag for isTouched()
let hadBeenSaved = false; let hadBeenSaved = false;
document.documentElement.classList.add('usercss');
$('#sections').textContent = ''; $('#sections').textContent = '';
$('#name').disabled = true; $('#name').disabled = true;
$('#mozilla-format-heading').parentNode.remove(); $('#mozilla-format-heading').parentNode.remove();
@ -22,8 +23,6 @@ function createSourceEditor(style) {
appendChild: makeLink('https://github.com/openstyles/stylus/wiki/Usercss', t('externalUsercssDocument')) appendChild: makeLink('https://github.com/openstyles/stylus/wiki/Usercss', t('externalUsercssDocument'))
})); }));
initCollapsibles();
const dirty = dirtyReporter(); const dirty = dirtyReporter();
dirty.onChange(() => { dirty.onChange(() => {
const DIRTY = dirty.isDirty(); const DIRTY = dirty.isDirty();