mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-06-06 01:21:39 -04:00
Adjust editor config (#976)
* Adjust editor config Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de> Co-authored-by: Erik Michelson <github@erik.michelson.eu>
This commit is contained in:
parent
0180c75e55
commit
e12dc523f8
301 changed files with 4393 additions and 3741 deletions
|
@ -1,8 +1,8 @@
|
|||
/*
|
||||
SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import React from 'react'
|
||||
import { LanguagePicker } from './language-picker'
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/*
|
||||
SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { Settings } from 'luxon'
|
||||
import React, { useCallback } from 'react'
|
||||
|
@ -41,9 +41,11 @@ const languages = {
|
|||
}
|
||||
|
||||
const findLanguageCode = (wantedLanguage: string): string => {
|
||||
let foundLanguage = Object.keys(languages).find((supportedLanguage) => wantedLanguage === supportedLanguage)
|
||||
let foundLanguage = Object.keys(languages)
|
||||
.find((supportedLanguage) => wantedLanguage === supportedLanguage)
|
||||
if (!foundLanguage) {
|
||||
foundLanguage = Object.keys(languages).find((supportedLanguage) => wantedLanguage.substr(0, 2) === supportedLanguage)
|
||||
foundLanguage = Object.keys(languages)
|
||||
.find((supportedLanguage) => wantedLanguage.substr(0, 2) === supportedLanguage)
|
||||
}
|
||||
return foundLanguage || ''
|
||||
}
|
||||
|
@ -62,13 +64,14 @@ const LanguagePicker: React.FC = () => {
|
|||
as="select"
|
||||
size="sm"
|
||||
className="mb-2 mx-auto w-auto"
|
||||
value={findLanguageCode(i18n.language)}
|
||||
onChange={onChangeLang()}
|
||||
value={ findLanguageCode(i18n.language) }
|
||||
onChange={ onChangeLang() }
|
||||
>
|
||||
{
|
||||
Object.entries(languages).map(([language, languageName]) => {
|
||||
return <option key={language} value={language}>{languageName}</option>
|
||||
})
|
||||
Object.entries(languages)
|
||||
.map(([language, languageName]) => {
|
||||
return <option key={ language } value={ language }>{ languageName }</option>
|
||||
})
|
||||
}
|
||||
</Form.Control>
|
||||
)
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/*
|
||||
SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import React, { Fragment } from 'react'
|
||||
import { Trans, useTranslation } from 'react-i18next'
|
||||
|
@ -22,15 +22,15 @@ export const PoweredByLinks: React.FC = () => {
|
|||
return (
|
||||
<p>
|
||||
<Trans i18nKey="landing.footer.poweredBy">
|
||||
<ExternalLink href={links.webpage} text="HedgeDoc"/>
|
||||
<ExternalLink href={ links.webpage } text="HedgeDoc"/>
|
||||
</Trans>
|
||||
|
|
||||
<TranslatedInternalLink href='/n/release-notes' i18nKey='landing.footer.releases'/>
|
||||
{
|
||||
specialLinks.map(([i18nKey, href]) =>
|
||||
<Fragment key={i18nKey}>
|
||||
<Fragment key={ i18nKey }>
|
||||
|
|
||||
<TranslatedExternalLink href={href} i18nKey={'landing.footer.' + i18nKey}/>
|
||||
<TranslatedExternalLink href={ href } i18nKey={ 'landing.footer.' + i18nKey }/>
|
||||
</Fragment>
|
||||
)
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/*
|
||||
SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import React from 'react'
|
||||
import { Trans, useTranslation } from 'react-i18next'
|
||||
|
@ -13,13 +13,13 @@ const SocialLink: React.FC = () => {
|
|||
useTranslation()
|
||||
return (
|
||||
<p>
|
||||
<Trans i18nKey="landing.footer.followUs" components={[
|
||||
<ExternalLink href={links.githubOrg} icon='github' text="GitHub"/>,
|
||||
<ExternalLink href={links.community} icon='users' text="Discourse"/>,
|
||||
<ExternalLink href={links.chat} icon="comment" text="Matrix"/>,
|
||||
<ExternalLink href={links.mastodon} icon='mastodon' text="Mastodon"/>,
|
||||
<ExternalLink href={links.translate} icon="globe" text="POEditor"/>
|
||||
]}/>
|
||||
<Trans i18nKey="landing.footer.followUs" components={ [
|
||||
<ExternalLink href={ links.githubOrg } icon='github' text="GitHub"/>,
|
||||
<ExternalLink href={ links.community } icon='users' text="Discourse"/>,
|
||||
<ExternalLink href={ links.chat } icon="comment" text="Matrix"/>,
|
||||
<ExternalLink href={ links.mastodon } icon='mastodon' text="Mastodon"/>,
|
||||
<ExternalLink href={ links.translate } icon="globe" text="POEditor"/>
|
||||
] }/>
|
||||
</p>
|
||||
)
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/*
|
||||
SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import equal from 'fast-deep-equal'
|
||||
import React, { Fragment, useState } from 'react'
|
||||
|
@ -27,34 +27,36 @@ export const VersionInfo: React.FC = () => {
|
|||
const serverVersion = useSelector((state: ApplicationState) => state.config.version, equal)
|
||||
|
||||
const column = (title: string, version: string, sourceCodeLink: string, issueTrackerLink: string) => (
|
||||
<Col md={6} className={'flex-column'}>
|
||||
<h5>{title}</h5>
|
||||
<CopyableField content={version}/>
|
||||
<ShowIf condition={!!sourceCodeLink}>
|
||||
<TranslatedExternalLink i18nKey={'landing.versionInfo.sourceCode'} className={'btn btn-sm btn-primary d-block mb-2'} href={sourceCodeLink}/>
|
||||
<Col md={ 6 } className={ 'flex-column' }>
|
||||
<h5>{ title }</h5>
|
||||
<CopyableField content={ version }/>
|
||||
<ShowIf condition={ !!sourceCodeLink }>
|
||||
<TranslatedExternalLink i18nKey={ 'landing.versionInfo.sourceCode' }
|
||||
className={ 'btn btn-sm btn-primary d-block mb-2' } href={ sourceCodeLink }/>
|
||||
</ShowIf>
|
||||
<ShowIf condition={!!issueTrackerLink}>
|
||||
<TranslatedExternalLink i18nKey={'landing.versionInfo.issueTracker'} className={'btn btn-sm btn-primary d-block mb-2'} href={issueTrackerLink}/>
|
||||
<ShowIf condition={ !!issueTrackerLink }>
|
||||
<TranslatedExternalLink i18nKey={ 'landing.versionInfo.issueTracker' }
|
||||
className={ 'btn btn-sm btn-primary d-block mb-2' } href={ issueTrackerLink }/>
|
||||
</ShowIf>
|
||||
</Col>
|
||||
)
|
||||
|
||||
return (
|
||||
<Fragment>
|
||||
<Link id='version' to={'#'} className={'text-light'} onClick={handleShow}>
|
||||
<Trans i18nKey={'landing.versionInfo.versionInfo'}/>
|
||||
<Link id='version' to={ '#' } className={ 'text-light' } onClick={ handleShow }>
|
||||
<Trans i18nKey={ 'landing.versionInfo.versionInfo' }/>
|
||||
</Link>
|
||||
<Modal id='versionModal' show={show} onHide={handleClose} animation={true}>
|
||||
<Modal id='versionModal' show={ show } onHide={ handleClose } animation={ true }>
|
||||
<Modal.Body className="text-dark">
|
||||
<h3><Trans i18nKey={'landing.versionInfo.title'}/></h3>
|
||||
<h3><Trans i18nKey={ 'landing.versionInfo.title' }/></h3>
|
||||
<Row>
|
||||
{column(t('landing.versionInfo.serverVersion'), serverVersion.version, serverVersion.sourceCodeUrl, serverVersion.issueTrackerUrl)}
|
||||
{column(t('landing.versionInfo.clientVersion'), frontendVersion.version, frontendVersion.sourceCodeUrl, frontendVersion.issueTrackerUrl)}
|
||||
{ column(t('landing.versionInfo.serverVersion'), serverVersion.version, serverVersion.sourceCodeUrl, serverVersion.issueTrackerUrl) }
|
||||
{ column(t('landing.versionInfo.clientVersion'), frontendVersion.version, frontendVersion.sourceCodeUrl, frontendVersion.issueTrackerUrl) }
|
||||
</Row>
|
||||
</Modal.Body>
|
||||
<Modal.Footer>
|
||||
<Button variant="secondary" onClick={handleClose}>
|
||||
<Trans i18nKey={'common.close'}/>
|
||||
<Button variant="secondary" onClick={ handleClose }>
|
||||
<Trans i18nKey={ 'common.close' }/>
|
||||
</Button>
|
||||
</Modal.Footer>
|
||||
</Modal>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue