Skip to content

Commit 40518b7

Browse files
committed
Support config note type
1 parent 7efcdfa commit 40518b7

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

sources/anki.popclipext/Config.plist

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,21 @@
5252
<key>Option Description</key>
5353
<string></string>
5454
</dict>
55+
<dict>
56+
<key>Option Identifier</key>
57+
<string>note_type</string>
58+
<key>Option Label</key>
59+
<dict>
60+
<key>en</key>
61+
<string>Note Type</string>
62+
</dict>
63+
<key>Option Type</key>
64+
<string>string</string>
65+
<key>Option Default Value</key>
66+
<string>Basic</string>
67+
<key>Option Description</key>
68+
<string></string>
69+
</dict>
5570
</array>
5671
<key>Extension Description</key>
5772
<string>Create a new Anki Note with selected word.</string>

sources/anki.popclipext/anki.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ entry=$POPCLIP_TEXT
1111
safe_entry=$POPCLIP_URLENCODED_TEXT
1212
dict_svc=$POPCLIP_OPTION_DICT_SVC
1313
target_deck=$POPCLIP_OPTION_TARGET_DECK
14+
note_type=$POPCLIP_OPTION_NOTE_TYPE
1415
tag="PopClip"
1516
app_tag=${POPCLIP_APP_NAME// /_} # replace spaces with underscore
1617

@@ -83,7 +84,7 @@ gen_post_data()
8384
"Front": "$entry",
8485
"Back": "$(look_up)"
8586
},
86-
"modelName": "Basic",
87+
"modelName": "$note_type",
8788
"deckName": "$target_deck",
8889
"tags": [
8990
"$tag",

0 commit comments

Comments
 (0)