mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 09:00:12 +01:00
🎨 Find replace supports selecting element types https://github.com/siyuan-note/siyuan/issues/9895
This commit is contained in:
parent
ef6598eaf8
commit
af53d6a73a
8 changed files with 151 additions and 26 deletions
|
|
@ -1,4 +1,29 @@
|
||||||
{
|
{
|
||||||
|
"replaceTypes": {
|
||||||
|
"text": "Normal text",
|
||||||
|
"imgText": "Image alt text",
|
||||||
|
"imgTitle": "Image title",
|
||||||
|
"imgSrc": "Image link",
|
||||||
|
"aText": "Link anchor text",
|
||||||
|
"aTitle": "Link title",
|
||||||
|
"aHref": "Link link",
|
||||||
|
"code": "inline code",
|
||||||
|
"em": "Italic",
|
||||||
|
"strong": "Bold",
|
||||||
|
"inlineMath": "Inline formula",
|
||||||
|
"inlineMemo": "Inline memo",
|
||||||
|
"kbd": "Keyboard",
|
||||||
|
"mark": "Mark",
|
||||||
|
"s": "Strikethrough",
|
||||||
|
"sub": "Subscript",
|
||||||
|
"sup": "Superscript",
|
||||||
|
"tag": "Tag",
|
||||||
|
"u": "Underline",
|
||||||
|
"docTitle": "Document title",
|
||||||
|
"codeBlock": "Code block",
|
||||||
|
"mathBlock": "Formula block",
|
||||||
|
"htmlBlock": "HTML block"
|
||||||
|
},
|
||||||
"selected": "Selected",
|
"selected": "Selected",
|
||||||
"loadMore": "Load more",
|
"loadMore": "Load more",
|
||||||
"tempUnlock": "Temporarily unlock",
|
"tempUnlock": "Temporarily unlock",
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,29 @@
|
||||||
{
|
{
|
||||||
|
"replaceTypes": {
|
||||||
|
"text": "Texto normal",
|
||||||
|
"imgText": "Texto alternativo de la imagen",
|
||||||
|
"imgTitle": "Título de la imagen",
|
||||||
|
"imgSrc": "Enlace de imagen",
|
||||||
|
"aText": "Texto ancla del enlace",
|
||||||
|
"aTitle": "Título del enlace",
|
||||||
|
"aHref": "Enlace enlace",
|
||||||
|
"code": "código en línea",
|
||||||
|
"em": "Cursiva",
|
||||||
|
"strong": "negrita",
|
||||||
|
"inlineMath": "Fórmula en línea",
|
||||||
|
"inlineMemo": "Nota en línea",
|
||||||
|
"kbd": "Teclado",
|
||||||
|
"mark": "Marca",
|
||||||
|
"s": "Tachado",
|
||||||
|
"sub": "Subíndice",
|
||||||
|
"sup": "Superíndice",
|
||||||
|
"tag": "Etiqueta",
|
||||||
|
"u": "Subrayado",
|
||||||
|
"docTitle": "Título del documento",
|
||||||
|
"codeBlock": "Bloque de código",
|
||||||
|
"mathBlock": "Bloque de fórmulas",
|
||||||
|
"htmlBlock": "bloque HTML"
|
||||||
|
},
|
||||||
"selected": "Seleccionado",
|
"selected": "Seleccionado",
|
||||||
"loadMore": "Cargar más",
|
"loadMore": "Cargar más",
|
||||||
"tempUnlock": "Desbloquear temporalmente",
|
"tempUnlock": "Desbloquear temporalmente",
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,29 @@
|
||||||
{
|
{
|
||||||
|
"replaceTypes": {
|
||||||
|
"text": "Texte normal",
|
||||||
|
"imgText": "Texte alternatif de l'image",
|
||||||
|
"imgTitle": "Titre de l'image",
|
||||||
|
"imgSrc": "Lien image",
|
||||||
|
"aText": "Texte d'ancrage du lien",
|
||||||
|
"aTitle": "Titre du lien",
|
||||||
|
"aHref": "Lien lien",
|
||||||
|
"code": "code en ligne",
|
||||||
|
"em": "Italique",
|
||||||
|
"strong": "Audacieux",
|
||||||
|
"inlineMath": "Formule en ligne",
|
||||||
|
"inlineMemo": "Mémo en ligne",
|
||||||
|
"kbd": "Clavier",
|
||||||
|
"mark": "Marquer",
|
||||||
|
"s": "Barré",
|
||||||
|
"sub": "Indice",
|
||||||
|
"sup": "Exposant",
|
||||||
|
"tag": "balise",
|
||||||
|
"u": "Souligner",
|
||||||
|
"docTitle": "Titre du document",
|
||||||
|
"codeBlock": "Bloc de code",
|
||||||
|
"mathBlock": "Bloc de formule",
|
||||||
|
"htmlBlock": "Bloc HTML"
|
||||||
|
},
|
||||||
"selected": "Sélectionné",
|
"selected": "Sélectionné",
|
||||||
"loadMore": "Charger plus",
|
"loadMore": "Charger plus",
|
||||||
"tempUnlock": "Déverrouiller temporairement",
|
"tempUnlock": "Déverrouiller temporairement",
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,29 @@
|
||||||
{
|
{
|
||||||
|
"replaceTypes": {
|
||||||
|
"text": "普通文字",
|
||||||
|
"imgText": "圖片提示文字",
|
||||||
|
"imgTitle": "圖片標題",
|
||||||
|
"imgSrc": "圖片連結",
|
||||||
|
"aText": "連結錨文本",
|
||||||
|
"aTitle": "連結標題",
|
||||||
|
"aHref": "連結位址",
|
||||||
|
"code": "行級代碼",
|
||||||
|
"em": "斜體",
|
||||||
|
"strong": "粗體",
|
||||||
|
"inlineMath": "行級公式",
|
||||||
|
"inlineMemo": "行級備註",
|
||||||
|
"kbd": "鍵盤",
|
||||||
|
"mark": "高亮",
|
||||||
|
"s": "刪除",
|
||||||
|
"sub": "下標",
|
||||||
|
"sup": "上標",
|
||||||
|
"tag": "標籤",
|
||||||
|
"u": "底線",
|
||||||
|
"docTitle": "文檔標題",
|
||||||
|
"codeBlock": "程式碼區塊",
|
||||||
|
"mathBlock": "公式區塊",
|
||||||
|
"htmlBlock": "HTML 區塊"
|
||||||
|
},
|
||||||
"selected": "已選擇",
|
"selected": "已選擇",
|
||||||
"loadMore": "載入更多",
|
"loadMore": "載入更多",
|
||||||
"tempUnlock": "暫時解鎖",
|
"tempUnlock": "暫時解鎖",
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,29 @@
|
||||||
{
|
{
|
||||||
|
"replaceTypes": {
|
||||||
|
"text": "普通文本",
|
||||||
|
"imgText": "图片提示文本",
|
||||||
|
"imgTitle": "图片标题",
|
||||||
|
"imgSrc": "图片链接",
|
||||||
|
"aText": "链接锚文本",
|
||||||
|
"aTitle": "链接标题",
|
||||||
|
"aHref": "链接地址",
|
||||||
|
"code": "行级代码",
|
||||||
|
"em": "斜体",
|
||||||
|
"strong": "粗体",
|
||||||
|
"inlineMath": "行级公式",
|
||||||
|
"inlineMemo": "行级备注",
|
||||||
|
"kbd": "键盘",
|
||||||
|
"mark": "高亮",
|
||||||
|
"s": "删除",
|
||||||
|
"sub": "下标",
|
||||||
|
"sup": "上标",
|
||||||
|
"tag": "标签",
|
||||||
|
"u": "下划线",
|
||||||
|
"docTitle": "文档标题",
|
||||||
|
"codeBlock": "代码块",
|
||||||
|
"mathBlock": "公式块",
|
||||||
|
"htmlBlock": "HTML 块"
|
||||||
|
},
|
||||||
"selected": "已选中",
|
"selected": "已选中",
|
||||||
"loadMore": "加载更多",
|
"loadMore": "加载更多",
|
||||||
"tempUnlock": "临时解锁",
|
"tempUnlock": "临时解锁",
|
||||||
|
|
|
||||||
|
|
@ -521,17 +521,17 @@ export abstract class Constants {
|
||||||
[key: string]: boolean;
|
[key: string]: boolean;
|
||||||
} = {
|
} = {
|
||||||
"text": true,
|
"text": true,
|
||||||
"img-text": true,
|
"imgText": true,
|
||||||
"img-title": true,
|
"imgTitle": true,
|
||||||
"img-src": false,
|
"imgSrc": false,
|
||||||
"a-text": true,
|
"aText": true,
|
||||||
"a-title": true,
|
"aTitle": true,
|
||||||
"a-href": false,
|
"aHref": false,
|
||||||
"code": false,
|
"code": false,
|
||||||
"em": true,
|
"em": true,
|
||||||
"strong": true,
|
"strong": true,
|
||||||
"inline-math": false,
|
"inlineMath": false,
|
||||||
"inline-memo": true,
|
"inlineMemo": true,
|
||||||
"kbd": true,
|
"kbd": true,
|
||||||
"mark": true,
|
"mark": true,
|
||||||
"s": true,
|
"s": true,
|
||||||
|
|
@ -539,11 +539,11 @@ export abstract class Constants {
|
||||||
"sup": true,
|
"sup": true,
|
||||||
"tag": true,
|
"tag": true,
|
||||||
"u": true,
|
"u": true,
|
||||||
"doc-title": true,
|
"docTitle": true,
|
||||||
"code-block": false,
|
"codeBlock": false,
|
||||||
"math-block": false,
|
"mathBlock": false,
|
||||||
"html-block": false
|
"htmlBlock": false
|
||||||
};
|
}
|
||||||
|
|
||||||
// image
|
// image
|
||||||
public static readonly SIYUAN_IMAGE_VIP: string = `<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
|
public static readonly SIYUAN_IMAGE_VIP: string = `<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
|
||||||
|
|
|
||||||
|
|
@ -157,7 +157,7 @@ export const replaceFilterMenu = (config: ISearchOption) => {
|
||||||
html += `<label class="fn__flex b3-label">
|
html += `<label class="fn__flex b3-label">
|
||||||
<span class="fn__space"></span>
|
<span class="fn__space"></span>
|
||||||
<div class="fn__flex-1 fn__flex-center">
|
<div class="fn__flex-1 fn__flex-center">
|
||||||
${window.siyuan.languages[key]}
|
${window.siyuan.languages.replaceTypes[key]}
|
||||||
</div>
|
</div>
|
||||||
<span class="fn__space"></span>
|
<span class="fn__space"></span>
|
||||||
<input class="b3-switch fn__flex-center" data-type="${key}" type="checkbox"${config.replaceTypes[key] ? " checked" : ""}>
|
<input class="b3-switch fn__flex-center" data-type="${key}" type="checkbox"${config.replaceTypes[key] ? " checked" : ""}>
|
||||||
|
|
|
||||||
|
|
@ -190,17 +190,17 @@ type CriterionTypes struct {
|
||||||
|
|
||||||
type CriterionReplaceTypes struct {
|
type CriterionReplaceTypes struct {
|
||||||
Text bool `json:"text"`
|
Text bool `json:"text"`
|
||||||
ImgText bool `json:"img-text"`
|
ImgText bool `json:"imgText"`
|
||||||
ImgTitle bool `json:"img-title"`
|
ImgTitle bool `json:"imgTitle"`
|
||||||
ImgSrc bool `json:"img-src"`
|
ImgSrc bool `json:"imgSrc"`
|
||||||
AText bool `json:"a-text"`
|
AText bool `json:"aText"`
|
||||||
ATitle bool `json:"a-title"`
|
ATitle bool `json:"aTitle"`
|
||||||
AHref bool `json:"a-href"`
|
AHref bool `json:"aHref"`
|
||||||
Code bool `json:"code"`
|
Code bool `json:"code"`
|
||||||
Em bool `json:"em"`
|
Em bool `json:"em"`
|
||||||
Strong bool `json:"strong"`
|
Strong bool `json:"strong"`
|
||||||
InlineMath bool `json:"inline-math"`
|
InlineMath bool `json:"inlineMath"`
|
||||||
InlineMemo bool `json:"inline-memo"`
|
InlineMemo bool `json:"inlineMemo"`
|
||||||
Kbd bool `json:"kbd"`
|
Kbd bool `json:"kbd"`
|
||||||
Mark bool `json:"mark"`
|
Mark bool `json:"mark"`
|
||||||
S bool `json:"s"`
|
S bool `json:"s"`
|
||||||
|
|
@ -208,10 +208,10 @@ type CriterionReplaceTypes struct {
|
||||||
Sup bool `json:"sup"`
|
Sup bool `json:"sup"`
|
||||||
Tag bool `json:"tag"`
|
Tag bool `json:"tag"`
|
||||||
U bool `json:"u"`
|
U bool `json:"u"`
|
||||||
DocTitle bool `json:"doc-title"`
|
DocTitle bool `json:"docTitle"`
|
||||||
CodeBlock bool `json:"code-block"`
|
CodeBlock bool `json:"codeBlock"`
|
||||||
MathBlock bool `json:"math-block"`
|
MathBlock bool `json:"mathBlock"`
|
||||||
HtmlBlock bool `json:"html-block"`
|
HtmlBlock bool `json:"htmlBlock"`
|
||||||
}
|
}
|
||||||
|
|
||||||
var criteriaLock = sync.Mutex{}
|
var criteriaLock = sync.Mutex{}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue