mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-25 15:39:11 +00:00
Merge branch 'main' into api_edit_separation
This commit is contained in:
commit
b6a6d52a92
2
ansible/VERSION
vendored
2
ansible/VERSION
vendored
|
@ -1 +1 @@
|
||||||
v0.7.25
|
v0.7.26
|
||||||
|
|
8
ansible/templates/nginx.conf
vendored
8
ansible/templates/nginx.conf
vendored
|
@ -1,4 +1,3 @@
|
||||||
proxy_cache_path /var/cache/lemmy_frontend levels=1:2 keys_zone=lemmy_frontend_cache:10m max_size=100m use_temp_path=off;
|
|
||||||
limit_req_zone $binary_remote_addr zone=lemmy_ratelimit:10m rate=1r/s;
|
limit_req_zone $binary_remote_addr zone=lemmy_ratelimit:10m rate=1r/s;
|
||||||
|
|
||||||
server {
|
server {
|
||||||
|
@ -65,13 +64,6 @@ server {
|
||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
proxy_set_header Connection "upgrade";
|
proxy_set_header Connection "upgrade";
|
||||||
|
|
||||||
# Proxy Cache
|
|
||||||
proxy_cache lemmy_frontend_cache;
|
|
||||||
proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504;
|
|
||||||
proxy_cache_revalidate on;
|
|
||||||
proxy_cache_lock on;
|
|
||||||
proxy_cache_min_uses 5;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Redirect pictshare images to pictrs
|
# Redirect pictshare images to pictrs
|
||||||
|
|
2
docker/prod/deploy.sh
vendored
2
docker/prod/deploy.sh
vendored
|
@ -12,8 +12,6 @@ third_semver=$(echo $new_tag | cut -d "." -f 3)
|
||||||
|
|
||||||
# Setting the version on the front end
|
# Setting the version on the front end
|
||||||
cd ../../
|
cd ../../
|
||||||
echo "export const version: string = '$new_tag';" > "ui/src/version.ts"
|
|
||||||
git add "ui/src/version.ts"
|
|
||||||
# Setting the version on the backend
|
# Setting the version on the backend
|
||||||
echo "pub const VERSION: &str = \"$new_tag\";" > "server/src/version.rs"
|
echo "pub const VERSION: &str = \"$new_tag\";" > "server/src/version.rs"
|
||||||
git add "server/src/version.rs"
|
git add "server/src/version.rs"
|
||||||
|
|
2
docker/prod/docker-compose.yml
vendored
2
docker/prod/docker-compose.yml
vendored
|
@ -12,7 +12,7 @@ services:
|
||||||
restart: always
|
restart: always
|
||||||
|
|
||||||
lemmy:
|
lemmy:
|
||||||
image: dessalines/lemmy:v0.7.25
|
image: dessalines/lemmy:v0.7.26
|
||||||
ports:
|
ports:
|
||||||
- "127.0.0.1:8536:8536"
|
- "127.0.0.1:8536:8536"
|
||||||
restart: always
|
restart: always
|
||||||
|
|
2
docs/src/about_guide.md
vendored
2
docs/src/about_guide.md
vendored
|
@ -35,6 +35,8 @@ Horizontal Rule <br>\--- | Horizontal Rule<br>\*\*\* | Horizontal Rule <br><hr>
|
||||||
\`Inline code\` with backticks | |`Inline code` with backticks
|
\`Inline code\` with backticks | |`Inline code` with backticks
|
||||||
\`\`\`<br>\# code block <br>print '3 backticks or'<br>print 'indent 4 spaces' <br>\`\`\` | ····\# code block<br>····print '3 backticks or'<br>····print 'indent 4 spaces' | \# code block <br>print '3 backticks or'<br>print 'indent 4 spaces'
|
\`\`\`<br>\# code block <br>print '3 backticks or'<br>print 'indent 4 spaces' <br>\`\`\` | ····\# code block<br>····print '3 backticks or'<br>····print 'indent 4 spaces' | \# code block <br>print '3 backticks or'<br>print 'indent 4 spaces'
|
||||||
::: spoiler hidden or nsfw stuff<br>*a bunch of spoilers here*<br>::: | | <details><summary> hidden or nsfw stuff </summary><p><em>a bunch of spoilers here</em></p></details>
|
::: spoiler hidden or nsfw stuff<br>*a bunch of spoilers here*<br>::: | | <details><summary> hidden or nsfw stuff </summary><p><em>a bunch of spoilers here</em></p></details>
|
||||||
|
Some ~subscript~ text | | Some <sub>subscript</sub> text
|
||||||
|
Some ^superscript^ text | | Some <sup>superscript</sup> text
|
||||||
|
|
||||||
[CommonMark Tutorial](https://commonmark.org/help/tutorial/)
|
[CommonMark Tutorial](https://commonmark.org/help/tutorial/)
|
||||||
|
|
||||||
|
|
2
docs/src/contributing_websocket_http_api.md
vendored
2
docs/src/contributing_websocket_http_api.md
vendored
|
@ -952,6 +952,8 @@ Search types are `All, Comments, Posts, Communities, Users, Url`
|
||||||
site: Option<SiteView>,
|
site: Option<SiteView>,
|
||||||
admins: Vec<UserView>,
|
admins: Vec<UserView>,
|
||||||
banned: Vec<UserView>,
|
banned: Vec<UserView>,
|
||||||
|
online: usize, // This is currently broken
|
||||||
|
version: String,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
46
server/Cargo.lock
generated
vendored
46
server/Cargo.lock
generated
vendored
|
@ -3,7 +3,7 @@
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "activitystreams-ext"
|
name = "activitystreams-ext"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://git.asonix.dog/asonix/activitystreams-ext?branch=main#9acc466c7cb550ada31b669a1c47ea088f1c8471"
|
source = "git+https://yerbamate.dev/asonix/activitystreams-ext?branch=main#2799a4c606467a2f577e1f45f93c6828ec83cfdf"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"activitystreams-new",
|
"activitystreams-new",
|
||||||
"serde 1.0.114",
|
"serde 1.0.114",
|
||||||
|
@ -13,7 +13,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "activitystreams-new"
|
name = "activitystreams-new"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://git.asonix.dog/asonix/activitystreams-sketch?branch=main#857d5167dfa13054dd0d21d3d54f8147eea0d546"
|
source = "git+https://yerbamate.dev/asonix/activitystreams-new?branch=main#857d5167dfa13054dd0d21d3d54f8147eea0d546"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"chrono",
|
"chrono",
|
||||||
"mime",
|
"mime",
|
||||||
|
@ -783,9 +783,9 @@ checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cpuid-bool"
|
name = "cpuid-bool"
|
||||||
version = "0.1.1"
|
version = "0.1.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ec6763c20301ab0dc67051d1b6f4cc9132ad9e6eddcb1f10c6c53ea6d6ae2183"
|
checksum = "8aebca1129a03dc6dc2b127edd729435bbc4a37e1d5f4d7513165089ceb02634"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "crc32fast"
|
name = "crc32fast"
|
||||||
|
@ -798,12 +798,12 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "crossbeam-channel"
|
name = "crossbeam-channel"
|
||||||
version = "0.4.2"
|
version = "0.4.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "cced8691919c02aac3cb0a1bc2e9b73d89e832bf9a06fc579d4e71b68a2da061"
|
checksum = "09ee0cc8804d5393478d743b035099520087a5186f3b93fa58cec08fa62407b6"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"cfg-if",
|
||||||
"crossbeam-utils",
|
"crossbeam-utils",
|
||||||
"maybe-uninit",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -1336,6 +1336,15 @@ dependencies = [
|
||||||
"tracing",
|
"tracing",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "hashbrown"
|
||||||
|
version = "0.8.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "34f595585f103464d8d2f6e9864682d74c1601fed5e07d62b1c9058dba8246fb"
|
||||||
|
dependencies = [
|
||||||
|
"autocfg 1.0.0",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "heck"
|
name = "heck"
|
||||||
version = "0.3.1"
|
version = "0.3.1"
|
||||||
|
@ -1448,11 +1457,12 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "indexmap"
|
name = "indexmap"
|
||||||
version = "1.4.0"
|
version = "1.5.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c398b2b113b55809ceb9ee3e753fcbac793f1956663f3c36549c1346015c2afe"
|
checksum = "5b88cd59ee5f71fea89a62248fc8f387d44400cefe05ef548466d61ced9029a7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"autocfg 1.0.0",
|
"autocfg 1.0.0",
|
||||||
|
"hashbrown",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -1671,9 +1681,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libc"
|
name = "libc"
|
||||||
version = "0.2.72"
|
version = "0.2.73"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a9f8082297d534141b30c8d39e9b1773713ab50fdbe4ff30f750d063b3bfd701"
|
checksum = "bd7d4bd64732af4bf3a67f367c27df8520ad7e230c5817b8ff485864d80242b9"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "linked-hash-map"
|
name = "linked-hash-map"
|
||||||
|
@ -1745,12 +1755,6 @@ version = "0.1.8"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08"
|
checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "maybe-uninit"
|
|
||||||
version = "2.0.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "memchr"
|
name = "memchr"
|
||||||
version = "2.3.3"
|
version = "2.3.3"
|
||||||
|
@ -2178,9 +2182,9 @@ checksum = "eba180dafb9038b050a4c280019bbedf9f2467b61e5d892dcad585bb57aadc5a"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "proc-macro2"
|
name = "proc-macro2"
|
||||||
version = "1.0.18"
|
version = "1.0.19"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "beae6331a816b1f65d04c45b078fd8e6c93e8071771f41b8163255bbd8d7c8fa"
|
checksum = "04f5f085b5d71e2188cb8271e5da0161ad52c3f227a661a3c135fdf28e258b12"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"unicode-xid",
|
"unicode-xid",
|
||||||
]
|
]
|
||||||
|
@ -2834,9 +2838,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "syn"
|
name = "syn"
|
||||||
version = "1.0.34"
|
version = "1.0.35"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "936cae2873c940d92e697597c5eee105fb570cd5689c695806f672883653349b"
|
checksum = "fb7f4c519df8c117855e19dd8cc851e89eb746fe7a73f0157e0d95fdec5369b0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
|
|
4
server/Cargo.toml
vendored
4
server/Cargo.toml
vendored
|
@ -18,8 +18,8 @@ lemmy_db = { path = "./lemmy_db" }
|
||||||
diesel = "1.4.4"
|
diesel = "1.4.4"
|
||||||
diesel_migrations = "1.4.0"
|
diesel_migrations = "1.4.0"
|
||||||
dotenv = "0.15.0"
|
dotenv = "0.15.0"
|
||||||
activitystreams-new = { git = "https://git.asonix.dog/asonix/activitystreams-sketch", branch = "main" }
|
activitystreams-new = { git = "https://yerbamate.dev/asonix/activitystreams-new", branch = "main" }
|
||||||
activitystreams-ext = { git = "https://git.asonix.dog/asonix/activitystreams-ext", branch = "main" }
|
activitystreams-ext = { git = "https://yerbamate.dev/asonix/activitystreams-ext", branch = "main" }
|
||||||
bcrypt = "0.8.0"
|
bcrypt = "0.8.0"
|
||||||
chrono = { version = "0.4.7", features = ["serde"] }
|
chrono = { version = "0.4.7", features = ["serde"] }
|
||||||
serde_json = { version = "1.0.52", features = ["preserve_order"]}
|
serde_json = { version = "1.0.52", features = ["preserve_order"]}
|
||||||
|
|
|
@ -3,6 +3,7 @@ use crate::{
|
||||||
api::{claims::Claims, APIError, Oper, Perform},
|
api::{claims::Claims, APIError, Oper, Perform},
|
||||||
apub::fetcher::search_by_apub_id,
|
apub::fetcher::search_by_apub_id,
|
||||||
blocking,
|
blocking,
|
||||||
|
version,
|
||||||
websocket::{server::SendAllMessage, UserOperation, WebsocketInfo},
|
websocket::{server::SendAllMessage, UserOperation, WebsocketInfo},
|
||||||
DbPool,
|
DbPool,
|
||||||
LemmyError,
|
LemmyError,
|
||||||
|
@ -110,6 +111,7 @@ pub struct GetSiteResponse {
|
||||||
admins: Vec<UserView>,
|
admins: Vec<UserView>,
|
||||||
banned: Vec<UserView>,
|
banned: Vec<UserView>,
|
||||||
pub online: usize,
|
pub online: usize,
|
||||||
|
version: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
|
@ -424,6 +426,7 @@ impl Perform for Oper<GetSite> {
|
||||||
admins,
|
admins,
|
||||||
banned,
|
banned,
|
||||||
online,
|
online,
|
||||||
|
version: version::VERSION.to_string(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -666,6 +669,7 @@ impl Perform for Oper<TransferSite> {
|
||||||
admins,
|
admins,
|
||||||
banned,
|
banned,
|
||||||
online: 0,
|
online: 0,
|
||||||
|
version: version::VERSION.to_string(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
pub const VERSION: &str = "v0.7.25";
|
pub const VERSION: &str = "v0.7.26";
|
||||||
|
|
2
ui/package.json
vendored
2
ui/package.json
vendored
|
@ -37,6 +37,8 @@
|
||||||
"markdown-it": "^10.0.0",
|
"markdown-it": "^10.0.0",
|
||||||
"markdown-it-container": "^2.0.0",
|
"markdown-it-container": "^2.0.0",
|
||||||
"markdown-it-emoji": "^1.4.0",
|
"markdown-it-emoji": "^1.4.0",
|
||||||
|
"markdown-it-sub": "^1.0.0",
|
||||||
|
"markdown-it-sup": "^1.0.0",
|
||||||
"moment": "^2.24.0",
|
"moment": "^2.24.0",
|
||||||
"node-fetch": "^2.6.0",
|
"node-fetch": "^2.6.0",
|
||||||
"prettier": "^2.0.4",
|
"prettier": "^2.0.4",
|
||||||
|
|
1
ui/src/components/admin-settings.tsx
vendored
1
ui/src/components/admin-settings.tsx
vendored
|
@ -46,6 +46,7 @@ export class AdminSettings extends Component<any, AdminSettingsState> {
|
||||||
admins: [],
|
admins: [],
|
||||||
banned: [],
|
banned: [],
|
||||||
online: null,
|
online: null,
|
||||||
|
version: null,
|
||||||
},
|
},
|
||||||
siteConfigForm: {
|
siteConfigForm: {
|
||||||
config_hjson: null,
|
config_hjson: null,
|
||||||
|
|
45
ui/src/components/footer.tsx
vendored
45
ui/src/components/footer.tsx
vendored
|
@ -1,12 +1,41 @@
|
||||||
import { Component } from 'inferno';
|
import { Component } from 'inferno';
|
||||||
import { Link } from 'inferno-router';
|
import { Link } from 'inferno-router';
|
||||||
import { repoUrl } from '../utils';
|
|
||||||
import { version } from '../version';
|
|
||||||
import { i18n } from '../i18next';
|
import { i18n } from '../i18next';
|
||||||
|
import { Subscription } from 'rxjs';
|
||||||
|
import { retryWhen, delay, take } from 'rxjs/operators';
|
||||||
|
import { WebSocketService } from '../services';
|
||||||
|
import { repoUrl, wsJsonToRes } from '../utils';
|
||||||
|
import {
|
||||||
|
UserOperation,
|
||||||
|
WebSocketJsonResponse,
|
||||||
|
GetSiteResponse,
|
||||||
|
} from '../interfaces';
|
||||||
|
|
||||||
export class Footer extends Component<any, any> {
|
interface FooterState {
|
||||||
|
version: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class Footer extends Component<any, FooterState> {
|
||||||
|
private wsSub: Subscription;
|
||||||
|
emptyState: FooterState = {
|
||||||
|
version: null,
|
||||||
|
};
|
||||||
constructor(props: any, context: any) {
|
constructor(props: any, context: any) {
|
||||||
super(props, context);
|
super(props, context);
|
||||||
|
|
||||||
|
this.state = this.emptyState;
|
||||||
|
|
||||||
|
this.wsSub = WebSocketService.Instance.subject
|
||||||
|
.pipe(retryWhen(errors => errors.pipe(delay(3000), take(10))))
|
||||||
|
.subscribe(
|
||||||
|
msg => this.parseMessage(msg),
|
||||||
|
err => console.error(err),
|
||||||
|
() => console.log('complete')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
componentWillUnmount() {
|
||||||
|
this.wsSub.unsubscribe();
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
@ -15,7 +44,7 @@ export class Footer extends Component<any, any> {
|
||||||
<div className="navbar-collapse">
|
<div className="navbar-collapse">
|
||||||
<ul class="navbar-nav ml-auto">
|
<ul class="navbar-nav ml-auto">
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<span class="navbar-text">{version}</span>
|
<span class="navbar-text">{this.state.version}</span>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<Link class="nav-link" to="/modlog">
|
<Link class="nav-link" to="/modlog">
|
||||||
|
@ -42,4 +71,12 @@ export class Footer extends Component<any, any> {
|
||||||
</nav>
|
</nav>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
parseMessage(msg: WebSocketJsonResponse) {
|
||||||
|
let res = wsJsonToRes(msg);
|
||||||
|
|
||||||
|
if (res.op == UserOperation.GetSite) {
|
||||||
|
let data = res.data as GetSiteResponse;
|
||||||
|
this.setState({ version: data.version });
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
1
ui/src/components/main.tsx
vendored
1
ui/src/components/main.tsx
vendored
|
@ -107,6 +107,7 @@ export class Main extends Component<any, MainState> {
|
||||||
admins: [],
|
admins: [],
|
||||||
banned: [],
|
banned: [],
|
||||||
online: null,
|
online: null,
|
||||||
|
version: null,
|
||||||
},
|
},
|
||||||
showEditSite: false,
|
showEditSite: false,
|
||||||
loading: true,
|
loading: true,
|
||||||
|
|
28
ui/src/components/markdown-textarea.tsx
vendored
28
ui/src/components/markdown-textarea.tsx
vendored
|
@ -267,6 +267,24 @@ export class MarkdownTextArea extends Component<
|
||||||
<use xlinkHref="#icon-code"></use>
|
<use xlinkHref="#icon-code"></use>
|
||||||
</svg>
|
</svg>
|
||||||
</button>
|
</button>
|
||||||
|
<button
|
||||||
|
class="btn btn-sm text-muted"
|
||||||
|
data-tippy-content={i18n.t('subscript')}
|
||||||
|
onClick={linkEvent(this, this.handleInsertSubscript)}
|
||||||
|
>
|
||||||
|
<svg class="icon icon-inline">
|
||||||
|
<use xlinkHref="#icon-subscript"></use>
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
class="btn btn-sm text-muted"
|
||||||
|
data-tippy-content={i18n.t('superscript')}
|
||||||
|
onClick={linkEvent(this, this.handleInsertSuperscript)}
|
||||||
|
>
|
||||||
|
<svg class="icon icon-inline">
|
||||||
|
<use xlinkHref="#icon-superscript"></use>
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
<button
|
<button
|
||||||
class="btn btn-sm text-muted"
|
class="btn btn-sm text-muted"
|
||||||
data-tippy-content={i18n.t('spoiler')}
|
data-tippy-content={i18n.t('spoiler')}
|
||||||
|
@ -470,6 +488,16 @@ export class MarkdownTextArea extends Component<
|
||||||
i.simpleInsert('#');
|
i.simpleInsert('#');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handleInsertSubscript(i: MarkdownTextArea, event: any) {
|
||||||
|
event.preventDefault();
|
||||||
|
i.simpleSurround('~');
|
||||||
|
}
|
||||||
|
|
||||||
|
handleInsertSuperscript(i: MarkdownTextArea, event: any) {
|
||||||
|
event.preventDefault();
|
||||||
|
i.simpleSurround('^');
|
||||||
|
}
|
||||||
|
|
||||||
simpleInsert(chars: string) {
|
simpleInsert(chars: string) {
|
||||||
if (!this.state.content) {
|
if (!this.state.content) {
|
||||||
this.state.content = `${chars} `;
|
this.state.content = `${chars} `;
|
||||||
|
|
6
ui/src/components/navbar.tsx
vendored
6
ui/src/components/navbar.tsx
vendored
|
@ -30,7 +30,6 @@ import {
|
||||||
messageToastify,
|
messageToastify,
|
||||||
md,
|
md,
|
||||||
} from '../utils';
|
} from '../utils';
|
||||||
import { version } from '../version';
|
|
||||||
import { i18n } from '../i18next';
|
import { i18n } from '../i18next';
|
||||||
|
|
||||||
interface NavbarState {
|
interface NavbarState {
|
||||||
|
@ -41,6 +40,7 @@ interface NavbarState {
|
||||||
messages: Array<PrivateMessage>;
|
messages: Array<PrivateMessage>;
|
||||||
unreadCount: number;
|
unreadCount: number;
|
||||||
siteName: string;
|
siteName: string;
|
||||||
|
version: string;
|
||||||
admins: Array<UserView>;
|
admins: Array<UserView>;
|
||||||
searchParam: string;
|
searchParam: string;
|
||||||
toggleSearch: boolean;
|
toggleSearch: boolean;
|
||||||
|
@ -58,6 +58,7 @@ export class Navbar extends Component<any, NavbarState> {
|
||||||
messages: [],
|
messages: [],
|
||||||
expanded: false,
|
expanded: false,
|
||||||
siteName: undefined,
|
siteName: undefined,
|
||||||
|
version: undefined,
|
||||||
admins: [],
|
admins: [],
|
||||||
searchParam: '',
|
searchParam: '',
|
||||||
toggleSearch: false,
|
toggleSearch: false,
|
||||||
|
@ -150,7 +151,7 @@ export class Navbar extends Component<any, NavbarState> {
|
||||||
navbar() {
|
navbar() {
|
||||||
return (
|
return (
|
||||||
<nav class="container-fluid navbar navbar-expand-md navbar-light shadow p-0 px-3">
|
<nav class="container-fluid navbar navbar-expand-md navbar-light shadow p-0 px-3">
|
||||||
<Link title={version} class="navbar-brand" to="/">
|
<Link title={this.state.version} class="navbar-brand" to="/">
|
||||||
{this.state.siteName}
|
{this.state.siteName}
|
||||||
</Link>
|
</Link>
|
||||||
{this.state.isLoggedIn && (
|
{this.state.isLoggedIn && (
|
||||||
|
@ -395,6 +396,7 @@ export class Navbar extends Component<any, NavbarState> {
|
||||||
|
|
||||||
if (data.site && !this.state.siteName) {
|
if (data.site && !this.state.siteName) {
|
||||||
this.state.siteName = data.site.name;
|
this.state.siteName = data.site.name;
|
||||||
|
this.state.version = data.version;
|
||||||
this.state.admins = data.admins;
|
this.state.admins = data.admins;
|
||||||
this.setState(this.state);
|
this.setState(this.state);
|
||||||
}
|
}
|
||||||
|
|
1
ui/src/components/post.tsx
vendored
1
ui/src/components/post.tsx
vendored
|
@ -92,6 +92,7 @@ export class Post extends Component<any, PostState> {
|
||||||
enable_nsfw: undefined,
|
enable_nsfw: undefined,
|
||||||
},
|
},
|
||||||
online: null,
|
online: null,
|
||||||
|
version: null,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
6
ui/src/components/symbols.tsx
vendored
6
ui/src/components/symbols.tsx
vendored
File diff suppressed because one or more lines are too long
1
ui/src/interfaces.ts
vendored
1
ui/src/interfaces.ts
vendored
|
@ -813,6 +813,7 @@ export interface GetSiteResponse {
|
||||||
admins: Array<UserView>;
|
admins: Array<UserView>;
|
||||||
banned: Array<UserView>;
|
banned: Array<UserView>;
|
||||||
online: number;
|
online: number;
|
||||||
|
version: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface SiteResponse {
|
export interface SiteResponse {
|
||||||
|
|
4
ui/src/utils.ts
vendored
4
ui/src/utils.ts
vendored
|
@ -49,6 +49,8 @@ import { UserService, WebSocketService } from './services';
|
||||||
|
|
||||||
import Tribute from 'tributejs/src/Tribute.js';
|
import Tribute from 'tributejs/src/Tribute.js';
|
||||||
import markdown_it from 'markdown-it';
|
import markdown_it from 'markdown-it';
|
||||||
|
import markdown_it_sub from 'markdown-it-sub';
|
||||||
|
import markdown_it_sup from 'markdown-it-sup';
|
||||||
import markdownitEmoji from 'markdown-it-emoji/light';
|
import markdownitEmoji from 'markdown-it-emoji/light';
|
||||||
import markdown_it_container from 'markdown-it-container';
|
import markdown_it_container from 'markdown-it-container';
|
||||||
import emojiShortName from 'emoji-short-name';
|
import emojiShortName from 'emoji-short-name';
|
||||||
|
@ -148,6 +150,8 @@ export const md = new markdown_it({
|
||||||
linkify: true,
|
linkify: true,
|
||||||
typographer: true,
|
typographer: true,
|
||||||
})
|
})
|
||||||
|
.use(markdown_it_sub)
|
||||||
|
.use(markdown_it_sup)
|
||||||
.use(markdown_it_container, 'spoiler', {
|
.use(markdown_it_container, 'spoiler', {
|
||||||
validate: function (params: any) {
|
validate: function (params: any) {
|
||||||
return params.trim().match(/^spoiler\s+(.*)$/);
|
return params.trim().match(/^spoiler\s+(.*)$/);
|
||||||
|
|
1
ui/src/version.ts
vendored
1
ui/src/version.ts
vendored
|
@ -1 +0,0 @@
|
||||||
export const version: string = 'v0.7.25';
|
|
2
ui/translations/en.json
vendored
2
ui/translations/en.json
vendored
|
@ -53,6 +53,8 @@
|
||||||
"archive_link": "archive link",
|
"archive_link": "archive link",
|
||||||
"bold": "bold",
|
"bold": "bold",
|
||||||
"italic": "italic",
|
"italic": "italic",
|
||||||
|
"subscript": "subscript",
|
||||||
|
"superscript": "superscript",
|
||||||
"header": "header",
|
"header": "header",
|
||||||
"strikethrough": "strikethrough",
|
"strikethrough": "strikethrough",
|
||||||
"quote": "quote",
|
"quote": "quote",
|
||||||
|
|
3
ui/translations/fr.json
vendored
3
ui/translations/fr.json
vendored
|
@ -260,5 +260,6 @@
|
||||||
"invalid_post_title": "Titre du post invalide",
|
"invalid_post_title": "Titre du post invalide",
|
||||||
"must_login": "Vous devez vous être <1>connecté ou enregistré</1> pour commenter.",
|
"must_login": "Vous devez vous être <1>connecté ou enregistré</1> pour commenter.",
|
||||||
"no_password_reset": "Vous ne pourrez pas réinitialiser votre mot de passe sans un e-mail.",
|
"no_password_reset": "Vous ne pourrez pas réinitialiser votre mot de passe sans un e-mail.",
|
||||||
"what_is": "Combien font"
|
"what_is": "Combien font",
|
||||||
|
"cake_day_title": "Lemmyversaire :"
|
||||||
}
|
}
|
||||||
|
|
9
ui/translations/it.json
vendored
9
ui/translations/it.json
vendored
|
@ -160,7 +160,7 @@
|
||||||
"yes": "sì",
|
"yes": "sì",
|
||||||
"no": "no",
|
"no": "no",
|
||||||
"powered_by": "Offerto da",
|
"powered_by": "Offerto da",
|
||||||
"landing": "Lemmy è un <1>aggregatore di link</1> / alternativa a reddit, creato per integrarsi con il <2>fediverso</2>. <3></3>È self-hosted, i commenti sono aggiornati in tempo reale ed è molto piccolo (<4>~80kB</4>). La federazione con la rete ActivityPub sarà implementata nel futuro. <5></5>Questa versione è una <6>beta molto giovane</6> e molte funzionalità sono incomplete o mancanti. <7></7>Suggerisci nuove funzionalità o segnala errori a <8>questa pagina.</8><9></9>Sviluppato con <10>Rust</10>, <11>Actix</11>, <12>Inferno</12>, <13>Typescript</13>.",
|
"landing": "Lemmy è un <1>aggregatore di link</1> / alternativa a reddit, creato per integrarsi con il <2>fediverso</2>. <3></3>È self-hosted, i commenti sono aggiornati in tempo reale ed è molto piccolo (<4>~80kB</4>). La federazione con la rete ActivityPub sarà implementata nel futuro. <5></5>Questa versione è una <6>beta molto giovane</6> e molte funzionalità sono incomplete o mancanti. <7></7>Suggerisci nuove funzionalità o segnala errori a <8>questa pagina.</8><9></9>Sviluppato con <10>Rust</10>, <11>Actix</11>, <12>Inferno</12>, <13>Typescript</13>.<14></14> <15>Un grazie ai nostri sostenitori: </15> dessalines, Nutomic, asonix, zacanger, and iav.",
|
||||||
"not_logged_in": "Non hai effettuato l'accesso.",
|
"not_logged_in": "Non hai effettuato l'accesso.",
|
||||||
"community_ban": "Sei stato escluso da questa comunità.",
|
"community_ban": "Sei stato escluso da questa comunità.",
|
||||||
"site_ban": "Sei stato escluso dal sito",
|
"site_ban": "Sei stato escluso dal sito",
|
||||||
|
@ -257,5 +257,10 @@
|
||||||
"picture_deleted": "Foto eliminata.",
|
"picture_deleted": "Foto eliminata.",
|
||||||
"select_a_community": "Seleziona una comunità",
|
"select_a_community": "Seleziona una comunità",
|
||||||
"invalid_username": "Nome utente non valido.",
|
"invalid_username": "Nome utente non valido.",
|
||||||
"what_is": "Cos'è"
|
"what_is": "Cos'è",
|
||||||
|
"must_login": "Devi <1>effettuare l'accesso o registrarti</1> per commentare.",
|
||||||
|
"no_password_reset": "Non sarai in grado di resettare la tua password senza una email.",
|
||||||
|
"cake_day_title": "Cake day:",
|
||||||
|
"cake_day_info": "Oggi è il cake day di {{ creator_name }}!",
|
||||||
|
"invalid_post_title": "Titolo della pubblicazione non valido"
|
||||||
}
|
}
|
||||||
|
|
9
ui/translations/pt_BR.json
vendored
9
ui/translations/pt_BR.json
vendored
|
@ -192,7 +192,7 @@
|
||||||
"yes": "sim",
|
"yes": "sim",
|
||||||
"no": "não",
|
"no": "não",
|
||||||
"powered_by": "Fornecido por",
|
"powered_by": "Fornecido por",
|
||||||
"landing_0": "Lemmy é um <1>agregador de links</1> / alternativa ao reddit, com a intenção de funcionar junto ao <2>fediverso</2>.<3></3>Pode ser hospedado em servidor próprio, tem atualização de comentários em tempo real e é minúsculo (<4>~80kB</4>). A federação com a rede ActivityPub está no roteiro do projeto. <5></5>Esta é uma <6>versão beta bastante antecipada</6>, e muitas funcionalidades ainda estão quebradas ou ausentes. <7></7>Sugira novas funcionalidades ou reporte erros <8>aqui.</8><9></9>Feito com <10>Rust</10>, <11>Actix</11>, <12>Inferno</12>, <13>Typescript</13>.",
|
"landing": "Lemmy é um <1>agregador de links</1> / alternativa ao reddit, com a intenção de funcionar junto ao <2>fediverso</2>.<3></3>Pode ser hospedado em servidor próprio, tem atualização de comentários em tempo real e é minúsculo (<4>~80kB</4>). A federação com a rede ActivityPub está no roteiro do projeto. <5></5>Esta é uma <6>versão beta bastante antecipada</6>, e muitas funcionalidades ainda estão quebradas ou ausentes. <7></7>Sugira novas funcionalidades ou reporte erros <8>aqui.</8><9></9>Feito com <10>Rust</10>, <11>Actix</11>, <12>Inferno</12>, <13>Typescript</13>. <14></14> <15>Agradecemos aos nossos contribuidores: </15> dessalines, Nutomic, asonix, zacanger, e iav.",
|
||||||
"not_logged_in": "Não autenticado.",
|
"not_logged_in": "Não autenticado.",
|
||||||
"logged_in": "Autenticado.",
|
"logged_in": "Autenticado.",
|
||||||
"community_ban": "Você foi banido desta comunidade.",
|
"community_ban": "Você foi banido desta comunidade.",
|
||||||
|
@ -256,5 +256,10 @@
|
||||||
"site_saved": "Site Salvo.",
|
"site_saved": "Site Salvo.",
|
||||||
"emoji_picker": "Selecionador de Emoji",
|
"emoji_picker": "Selecionador de Emoji",
|
||||||
"select_a_community": "Selecione uma comunidade",
|
"select_a_community": "Selecione uma comunidade",
|
||||||
"invalid_username": "Nome de usuário inválido."
|
"invalid_username": "Nome de usuário inválido.",
|
||||||
|
"must_login": "Você precisa <1>entrar ou registrar-se</1> para comentar.",
|
||||||
|
"no_password_reset": "Você não conseguirá redefinir sua senha sem um e-mail.",
|
||||||
|
"invalid_post_title": "Título de publicação inválido",
|
||||||
|
"cake_day_info": "Hoje é o dia do bolo de {{ creator_name }}!",
|
||||||
|
"cake_day_title": "Dia do bolo:"
|
||||||
}
|
}
|
||||||
|
|
10
ui/yarn.lock
vendored
10
ui/yarn.lock
vendored
|
@ -4317,6 +4317,16 @@ markdown-it-emoji@^1.4.0:
|
||||||
resolved "https://registry.yarnpkg.com/markdown-it-emoji/-/markdown-it-emoji-1.4.0.tgz#9bee0e9a990a963ba96df6980c4fddb05dfb4dcc"
|
resolved "https://registry.yarnpkg.com/markdown-it-emoji/-/markdown-it-emoji-1.4.0.tgz#9bee0e9a990a963ba96df6980c4fddb05dfb4dcc"
|
||||||
integrity sha1-m+4OmpkKljupbfaYDE/dsF37Tcw=
|
integrity sha1-m+4OmpkKljupbfaYDE/dsF37Tcw=
|
||||||
|
|
||||||
|
markdown-it-sub@^1.0.0:
|
||||||
|
version "1.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/markdown-it-sub/-/markdown-it-sub-1.0.0.tgz#375fd6026eae7ddcb012497f6411195ea1e3afe8"
|
||||||
|
integrity sha1-N1/WAm6ufdywEkl/ZBEZXqHjr+g=
|
||||||
|
|
||||||
|
markdown-it-sup@^1.0.0:
|
||||||
|
version "1.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/markdown-it-sup/-/markdown-it-sup-1.0.0.tgz#cb9c9ff91a5255ac08f3fd3d63286e15df0a1fc3"
|
||||||
|
integrity sha1-y5yf+RpSVawI8/09YyhuFd8KH8M=
|
||||||
|
|
||||||
markdown-it@^10.0.0:
|
markdown-it@^10.0.0:
|
||||||
version "10.0.0"
|
version "10.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-10.0.0.tgz#abfc64f141b1722d663402044e43927f1f50a8dc"
|
resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-10.0.0.tgz#abfc64f141b1722d663402044e43927f1f50a8dc"
|
||||||
|
|
Loading…
Reference in a new issue