Fix: pull out makeLink
This commit is contained in:
parent
d7f0e3c176
commit
b61b058824
|
@ -1,4 +1,4 @@
|
|||
/* global semverCompare */
|
||||
/* global semverCompare makeLink */
|
||||
|
||||
'use strict';
|
||||
|
||||
|
@ -99,8 +99,8 @@ function initInstallPage({style, dup}, sourceLoader) {
|
|||
$element({tag: 'button', className: 'install', textContent: installButtonLabel()})
|
||||
]}),
|
||||
$element({className: 'external', appendChild: [
|
||||
externalLink('externalHomepage', style.url),
|
||||
externalLink('externalSupport', style.support)
|
||||
style.url && makeLink(style.url, t('externalHomepage')),
|
||||
style.support && makeLink(style.support, t('externalSupport'))
|
||||
]})
|
||||
]}),
|
||||
$element({className: 'main', appendChild: [
|
||||
|
@ -109,16 +109,6 @@ function initInstallPage({style, dup}, sourceLoader) {
|
|||
]});
|
||||
}
|
||||
|
||||
function externalLink(name, url) {
|
||||
return $element({
|
||||
tag: 'a',
|
||||
href: url,
|
||||
target: '_blank',
|
||||
textContent: t(name),
|
||||
rel: 'noopener'
|
||||
});
|
||||
}
|
||||
|
||||
function installButtonLabel() {
|
||||
return t(!dup ? 'installButton' :
|
||||
versionTest > 0 ? 'installButtonUpdate' : 'installButtonReinstall');
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
/* global CodeMirror messageBox */
|
||||
/* global editors makeSectionVisible showCodeMirrorPopup showHelp */
|
||||
/* global loadScript require CSSLint stylelint */
|
||||
/* global makeLink */
|
||||
'use strict';
|
||||
|
||||
onDOMready().then(loadLinterAssets);
|
||||
|
@ -357,12 +358,6 @@ function toggleLintReport() {
|
|||
}
|
||||
|
||||
function showLintHelp() {
|
||||
const makeLink = (href, textContent) => $element({
|
||||
tag: 'a',
|
||||
target: '_blank',
|
||||
href,
|
||||
textContent,
|
||||
});
|
||||
const linter = prefs.get('editor.linter');
|
||||
const baseUrl = linter === 'stylelint'
|
||||
? 'https://stylelint.io/user-guide/rules/'
|
||||
|
|
Loading…
Reference in New Issue
Block a user