diff options
author | Filip785 <fdjuricic98@gmail.com> | 2020-07-09 17:12:43 +0200 |
---|---|---|
committer | Filip785 <fdjuricic98@gmail.com> | 2020-07-09 17:12:43 +0200 |
commit | 10a946cab3d40a30b2f9efc9d38a6a043eb25480 (patch) | |
tree | edd3ab6b1b0ca38c46c20df0429add8b53b80fed | |
parent | abdbd50f5edb03917fc0cd770ad1f9f44f5b8980 (diff) | |
parent | 20f9bde88f52ce875be4d0dc4bd5dd346dfe6b84 (diff) |
Merge remote-tracking branch 'upstream/master' into cake-day
-rw-r--r-- | ui/assets/css/main.css | 7 | ||||
-rw-r--r-- | ui/src/components/comment-form.tsx | 18 | ||||
-rw-r--r-- | ui/src/components/comment-node.tsx | 14 | ||||
-rw-r--r-- | ui/src/components/main.tsx | 10 | ||||
-rw-r--r-- | ui/src/i18next.ts | 6 | ||||
-rw-r--r-- | ui/src/utils.ts | 12 | ||||
-rw-r--r-- | ui/translations/en.json | 2 | ||||
-rw-r--r-- | ui/translations/ga.json | 1 | ||||
-rw-r--r-- | ui/translations/km.json | 1 | ||||
-rw-r--r-- | ui/translations/sr_Latn.json | 1 |
10 files changed, 61 insertions, 11 deletions
diff --git a/ui/assets/css/main.css b/ui/assets/css/main.css index fd65148c..9f744fb1 100644 --- a/ui/assets/css/main.css +++ b/ui/assets/css/main.css @@ -264,3 +264,10 @@ pre { width: 0px !important; padding: 0 !important; } + +br.big { + display: block; + content: ""; + margin-top: 1rem; +} + diff --git a/ui/src/components/comment-form.tsx b/ui/src/components/comment-form.tsx index 770c127c..32bc3786 100644 --- a/ui/src/components/comment-form.tsx +++ b/ui/src/components/comment-form.tsx @@ -98,7 +98,7 @@ export class CommentForm extends Component<CommentFormProps, CommentFormState> { } componentDidMount() { - var textarea: any = document.getElementById(this.id); + let textarea: any = document.getElementById(this.id); autosize(textarea); this.tribute.attach(textarea); textarea.addEventListener('tribute-replaced', () => { @@ -106,6 +106,22 @@ export class CommentForm extends Component<CommentFormProps, CommentFormState> { this.setState(this.state); autosize.update(textarea); }); + + // Quoting of selected text + let selectedText = window.getSelection().toString(); + if (selectedText) { + let quotedText = + selectedText + .split('\n') + .map(t => `> ${t}`) + .join('\n') + '\n\n'; + this.state.commentForm.content = quotedText; + this.setState(this.state); + // Not sure why this needs a delay + setTimeout(() => autosize.update(textarea), 10); + } + + textarea.focus(); } componentDidUpdate() { diff --git a/ui/src/components/comment-node.tsx b/ui/src/components/comment-node.tsx index 2d1426b0..0e2d1d94 100644 --- a/ui/src/components/comment-node.tsx +++ b/ui/src/components/comment-node.tsx @@ -196,8 +196,8 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> { </Link> </> )} - <div - className="mr-lg-4 flex-grow-1 flex-lg-grow-0 unselectable pointer mx-2" + <button + class="btn btn-sm text-muted" onClick={linkEvent(this, this.handleCommentCollapse)} > {this.state.collapsed ? ( @@ -209,9 +209,11 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> { <use xlinkHref="#icon-minus-square"></use> </svg> )} - </div> - <span - className={`unselectable pointer ${this.scoreColor}`} + </button> + {/* This is an expanding spacer for mobile */} + <div className="mr-lg-4 flex-grow-1 flex-lg-grow-0 unselectable pointer mx-2"></div> + <button + className={`btn btn-sm p-0 unselectable pointer ${this.scoreColor}`} onClick={linkEvent(node, this.handleCommentUpvote)} data-tippy-content={this.pointsTippy} > @@ -219,7 +221,7 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> { <use xlinkHref="#icon-zap"></use> </svg> <span class="mr-1">{this.state.score}</span> - </span> + </button> <span className="mr-1">•</span> <span> <MomentTime data={node.comment} /> diff --git a/ui/src/components/main.tsx b/ui/src/components/main.tsx index 20735049..9e9027d6 100644 --- a/ui/src/components/main.tsx +++ b/ui/src/components/main.tsx @@ -373,17 +373,21 @@ export class Main extends Component<any, MainState> { # </a> <a href="https://en.wikipedia.org/wiki/Fediverse">#</a> - <br></br> + <br class="big"></br> <code>#</code> <br></br> <b>#</b> - <br></br> + <br class="big"></br> <a href={repoUrl}>#</a> - <br></br> + <br class="big"></br> <a href="https://www.rust-lang.org">#</a> <a href="https://actix.rs/">#</a> <a href="https://infernojs.org">#</a> <a href="https://www.typescriptlang.org/">#</a> + <br class="big"></br> + <a href="https://github.com/LemmyNet/lemmy/graphs/contributors?type=a"> + # + </a> </T> </p> </div> diff --git a/ui/src/i18next.ts b/ui/src/i18next.ts index 7a341cea..3657da33 100644 --- a/ui/src/i18next.ts +++ b/ui/src/i18next.ts @@ -25,6 +25,9 @@ import { tr } from './translations/tr'; import { hu } from './translations/hu'; import { uk } from './translations/uk'; import { sq } from './translations/sq'; +import { km } from './translations/km'; +import { ga } from './translations/ga'; +import { sr_Latn } from './translations/sr_Latn'; // https://github.com/nimbusec-oss/inferno-i18next/blob/master/tests/T.test.js#L66 const resources = { @@ -53,6 +56,9 @@ const resources = { hu, uk, sq, + km, + ga, + sr_Latn, }; function format(value: any, format: any, lng: any): any { diff --git a/ui/src/utils.ts b/ui/src/utils.ts index 3ccaae12..a418c569 100644 --- a/ui/src/utils.ts +++ b/ui/src/utils.ts @@ -22,6 +22,9 @@ import 'moment/locale/tr'; import 'moment/locale/hu'; import 'moment/locale/uk'; import 'moment/locale/sq'; +import 'moment/locale/km'; +import 'moment/locale/ga'; +import 'moment/locale/sr'; import { UserOperation, @@ -73,9 +76,11 @@ export const languages = [ { code: 'eo', name: 'Esperanto' }, { code: 'es', name: 'Español' }, { code: 'de', name: 'Deutsch' }, + { code: 'ga', name: 'Gaeilge' }, { code: 'gl', name: 'Galego' }, { code: 'hu', name: 'Magyar Nyelv' }, { code: 'ka', name: 'ქართული ენა' }, + { code: 'km', name: 'ភាសាខ្មែរ' }, { code: 'hi', name: 'मानक हिन्दी' }, { code: 'fa', name: 'فارسی' }, { code: 'ja', name: '日本語' }, @@ -86,6 +91,7 @@ export const languages = [ { code: 'fr', name: 'Français' }, { code: 'sv', name: 'Svenska' }, { code: 'sq', name: 'Shqip' }, + { code: 'sr_Latn', name: 'srpski' }, { code: 'tr', name: 'Türkçe' }, { code: 'uk', name: 'Українська Mова' }, { code: 'ru', name: 'Русский' }, @@ -419,6 +425,12 @@ export function getMomentLanguage(): string { lang = 'uk'; } else if (lang.startsWith('sq')) { lang = 'sq'; + } else if (lang.startsWith('km')) { + lang = 'km'; + } else if (lang.startsWith('ga')) { + lang = 'ga'; + } else if (lang.startsWith('sr')) { + lang = 'sr'; } else { lang = 'en'; } diff --git a/ui/translations/en.json b/ui/translations/en.json index 3dda5948..56e6e28a 100644 --- a/ui/translations/en.json +++ b/ui/translations/en.json @@ -217,7 +217,7 @@ "no": "no", "powered_by": "Powered by", "landing_0": - "Lemmy is a <1>link aggregator</1> / reddit alternative, intended to work in the <2>fediverse</2>.<3></3>It's self-hostable, has live-updating comment threads, and is tiny (<4>~80kB</4>). Federation into the ActivityPub network is on the roadmap. <5></5>This is a <6>very early beta version</6>, and a lot of features are currently broken or missing. <7></7>Suggest new features or report bugs <8>here.</8><9></9>Made with <10>Rust</10>, <11>Actix</11>, <12>Inferno</12>, <13>Typescript</13>.", + "Lemmy is a <1>link aggregator</1> / reddit alternative, intended to work in the <2>fediverse</2>.<3></3>It's self-hostable, has live-updating comment threads, and is tiny (<4>~80kB</4>). Federation into the ActivityPub network is on the roadmap. <5></5>This is a <6>very early beta version</6>, and a lot of features are currently broken or missing. <7></7>Suggest new features or report bugs <8>here.</8><9></9>Made with <10>Rust</10>, <11>Actix</11>, <12>Inferno</12>, <13>Typescript</13>. <14></14> <15>Thank you to our contributors: </15> dessalines, Nutomic, asonix, zacanger, and iav.", "not_logged_in": "Not logged in.", "logged_in": "Logged in.", "site_saved": "Site Saved.", diff --git a/ui/translations/ga.json b/ui/translations/ga.json new file mode 100644 index 00000000..0967ef42 --- /dev/null +++ b/ui/translations/ga.json @@ -0,0 +1 @@ +{} diff --git a/ui/translations/km.json b/ui/translations/km.json new file mode 100644 index 00000000..0967ef42 --- /dev/null +++ b/ui/translations/km.json @@ -0,0 +1 @@ +{} diff --git a/ui/translations/sr_Latn.json b/ui/translations/sr_Latn.json new file mode 100644 index 00000000..0967ef42 --- /dev/null +++ b/ui/translations/sr_Latn.json @@ -0,0 +1 @@ +{} |