mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-26 10:16:10 +01:00
🎨 状态栏显示选中内容的字数 https://github.com/siyuan-note/siyuan/issues/4932
This commit is contained in:
parent
2686538641
commit
992475327d
5 changed files with 10 additions and 2 deletions
|
|
@ -243,6 +243,8 @@
|
|||
"blockWordCount": "Block words",
|
||||
"docRuneCount": "Document characters",
|
||||
"blockRuneCount": "Block characters",
|
||||
"wordCount": "Words",
|
||||
"runeCount": "Characters",
|
||||
"kbd": "Keyboard",
|
||||
"errorStyle": "Error Style",
|
||||
"successStyle": "Success Style",
|
||||
|
|
|
|||
|
|
@ -243,6 +243,8 @@
|
|||
"blockWordCount": "Mots de bloc",
|
||||
"docRuneCount": "Caractères des documents",
|
||||
"blockRuneCount": "Caractères de bloc",
|
||||
"wordCount": "Mots",
|
||||
"runeCount": "Caractères",
|
||||
"kbd": "Clavier",
|
||||
"errorStyle": "Style d'Erreur",
|
||||
"successStyle": "Style de Réussite",
|
||||
|
|
|
|||
|
|
@ -243,6 +243,8 @@
|
|||
"blockWordCount": " 塊詞數",
|
||||
"docRuneCount": "文檔字數",
|
||||
"blockRuneCount": " 塊字數",
|
||||
"wordCount": "詞數",
|
||||
"runeCount": "字數",
|
||||
"kbd": "鍵盤",
|
||||
"errorStyle": "錯誤樣式",
|
||||
"successStyle": "成功樣式",
|
||||
|
|
|
|||
|
|
@ -243,6 +243,8 @@
|
|||
"blockWordCount": " 块词数",
|
||||
"docRuneCount": "文档字数",
|
||||
"blockRuneCount": " 块字数",
|
||||
"wordCount": "词数",
|
||||
"runeCount": "字数",
|
||||
"kbd": "键盘",
|
||||
"errorStyle": "错误样式",
|
||||
"successStyle": "成功样式",
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ export const countSelectWord = (range: Range) => {
|
|||
const selectText = range.toString();
|
||||
if (selectText) {
|
||||
fetchPost("/api/block/getContentWordCount", {"content": range.toString()}, (response) => {
|
||||
document.querySelector("#status .status__counter").innerHTML = `<span class="ft__on-surface">${window.siyuan.languages.blockRuneCount}</span> ${response.data.runeCount}<span class="ft__on-surface">${window.siyuan.languages.blockWordCount}</span> ${response.data.wordCount}`;
|
||||
document.querySelector("#status .status__counter").innerHTML = `<span class="ft__on-surface">${window.siyuan.languages.runeCount}</span> ${response.data.runeCount}<span class="fn__space"></span><span class="ft__on-surface">${window.siyuan.languages.wordCount}</span> ${response.data.wordCount}`;
|
||||
});
|
||||
} else {
|
||||
document.querySelector("#status .status__counter").innerHTML = "";
|
||||
|
|
@ -146,7 +146,7 @@ export const countBlockWord = (ids: string[]) => {
|
|||
}
|
||||
if (ids.length > 0) {
|
||||
fetchPost("/api/block/getBlocksWordCount", {ids}, (response) => {
|
||||
document.querySelector("#status .status__counter").innerHTML = `<span class="ft__on-surface">${window.siyuan.languages.blockRuneCount}</span> ${response.data.runeCount}<span class="ft__on-surface">${window.siyuan.languages.blockWordCount}</span> ${response.data.wordCount}`;
|
||||
document.querySelector("#status .status__counter").innerHTML = `<span class="ft__on-surface">${window.siyuan.languages.runeCount}</span> ${response.data.runeCount}<span class="fn__space"></span><span class="ft__on-surface">${window.siyuan.languages.wordCount}</span> ${response.data.wordCount}`;
|
||||
});
|
||||
} else {
|
||||
document.querySelector("#status .status__counter").innerHTML = "";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue