From 1ad2832a6b291e961b3dfc26c80ebb2af64440d1 Mon Sep 17 00:00:00 2001 From: volatile static Date: Sun, 15 Jan 2023 08:43:44 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E2=9C=A8=20add=20simple=20snippets?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/toolkit.code-snippets | 48 +++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .vscode/toolkit.code-snippets diff --git a/.vscode/toolkit.code-snippets b/.vscode/toolkit.code-snippets new file mode 100644 index 0000000..74a8941 --- /dev/null +++ b/.vscode/toolkit.code-snippets @@ -0,0 +1,48 @@ +{ + "createElementsFromJSON - full": { + "scope": "javascript,typescript", + "prefix": [ + "createElementsFromJSON" + ], + "body": [ + "createElementsFromJSON(${0:document}, {", + "\ttag: '${1:div}',", + "}, ${16:true});" + ], + "description": "tools/ui/creatElementsFromJSON" + }, + "createElementsFromJSON - minimum": { + "scope": "javascript,typescript", + "prefix": [ + "createElementsFromJSON" + ], + "body": "createElementsFromJSON(document, { tag: '$0' });" + }, + "appendElement - full": { + "scope": "javascript,typescript", + "prefix": "appendElement", + "body": [ + "appendElement({", + "\ttag: '${1:div}',", + "\tid: '${2:id}',", + "\tnamespace: '${3:html}',", + "\tclassList: ['${4:class}'],", + "\tstyles: {${5:style}: '$6'},", + "\tproperties: {},", + "\tattributes: {},", + "\t[{ '${7:onload}', (e: Event) => $8, ${9:false} }],", + "\tcheckExistanceParent: ${10:HTMLElement},", + "\tignoreIfExists: ${11:true},", + "\tskipIfExists: ${12:true},", + "\tremoveIfExists: ${13:true},", + "\tcustomCheck: (doc: Document, options: ElementOptions) => ${14:true},", + "\tchildren: [$15]", + "}, ${16:container});" + ] + }, + "appendElement - minimum": { + "scope": "javascript,typescript", + "prefix": "appendElement", + "body": "appendElement({ tag: '$1' }, $2);" + } +} From a0b33a2211301c86982785868faff174b7647877 Mon Sep 17 00:00:00 2001 From: volatile-static <1043064987@qq.com> Date: Sun, 15 Jan 2023 08:47:26 +0800 Subject: [PATCH 2/3] Update toolkit.code-snippets --- .vscode/toolkit.code-snippets | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/.vscode/toolkit.code-snippets b/.vscode/toolkit.code-snippets index 74a8941..6cbe9e6 100644 --- a/.vscode/toolkit.code-snippets +++ b/.vscode/toolkit.code-snippets @@ -1,23 +1,4 @@ { - "createElementsFromJSON - full": { - "scope": "javascript,typescript", - "prefix": [ - "createElementsFromJSON" - ], - "body": [ - "createElementsFromJSON(${0:document}, {", - "\ttag: '${1:div}',", - "}, ${16:true});" - ], - "description": "tools/ui/creatElementsFromJSON" - }, - "createElementsFromJSON - minimum": { - "scope": "javascript,typescript", - "prefix": [ - "createElementsFromJSON" - ], - "body": "createElementsFromJSON(document, { tag: '$0' });" - }, "appendElement - full": { "scope": "javascript,typescript", "prefix": "appendElement", From 18e77880da621fd5e364a23882810c92ffed1da5 Mon Sep 17 00:00:00 2001 From: volatile-static Date: Mon, 16 Jan 2023 07:57:15 +0800 Subject: [PATCH 3/3] Update toolkit.code-snippets --- .vscode/toolkit.code-snippets | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.vscode/toolkit.code-snippets b/.vscode/toolkit.code-snippets index 6cbe9e6..ab0b6da 100644 --- a/.vscode/toolkit.code-snippets +++ b/.vscode/toolkit.code-snippets @@ -25,5 +25,21 @@ "scope": "javascript,typescript", "prefix": "appendElement", "body": "appendElement({ tag: '$1' }, $2);" + }, + "register Notifier": { + "scope": "javascript,typescript", + "prefix": "registerObserver", + "body": [ + "registerObserver({", + "\t notify: (", + "\t\tevent: _ZoteroTypes.Notifier.Event,", + "\t\ttype: _ZoteroTypes.Notifier.Type,", + "\t\tids: string[],", + "\t\textraData: _ZoteroTypes.anyObj", + "\t) => {", + "\t\t$0", + "\t}", + "});" + ] } }