Skip to content

Commit

Permalink
Config field names
Browse files Browse the repository at this point in the history
  • Loading branch information
cdpath committed Sep 21, 2018
1 parent 40518b7 commit 18c3b32
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 3 deletions.
45 changes: 45 additions & 0 deletions sources/anki.popclipext/Config.plist
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,51 @@
<key>Option Description</key>
<string></string>
</dict>
<dict>
<key>Option Identifier</key>
<string>front_field</string>
<key>Option Label</key>
<dict>
<key>en</key>
<string>Front Field</string>
</dict>
<key>Option Type</key>
<string>string</string>
<key>Option Default Value</key>
<string>Front</string>
<key>Option Description</key>
<string></string>
</dict>
<dict>
<key>Option Identifier</key>
<string>back_field</string>
<key>Option Label</key>
<dict>
<key>en</key>
<string>Back Field</string>
</dict>
<key>Option Type</key>
<string>string</string>
<key>Option Default Value</key>
<string>Back</string>
<key>Option Description</key>
<string></string>
</dict>
<dict>
<key>Option Identifier</key>
<string>tag</string>
<key>Option Label</key>
<dict>
<key>en</key>
<string>Tag</string>
</dict>
<key>Option Type</key>
<string>string</string>
<key>Option Default Value</key>
<string>PopClip</string>
<key>Option Description</key>
<string></string>
</dict>
</array>
<key>Extension Description</key>
<string>Create a new Anki Note with selected word.</string>
Expand Down
8 changes: 5 additions & 3 deletions sources/anki.popclipext/anki.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ safe_entry=$POPCLIP_URLENCODED_TEXT
dict_svc=$POPCLIP_OPTION_DICT_SVC
target_deck=$POPCLIP_OPTION_TARGET_DECK
note_type=$POPCLIP_OPTION_NOTE_TYPE
tag="PopClip"
front_field=$POPCLIP_OPTION_FRONT_FIELD
back_field=$POPCLIP_OPTION_BACK_FIELD
tag=$POPCLIP_OPTION_TAG
app_tag=${POPCLIP_APP_NAME// /_} # replace spaces with underscore


Expand Down Expand Up @@ -81,8 +83,8 @@ gen_post_data()
"params": {
"note": {
"fields": {
"Front": "$entry",
"Back": "$(look_up)"
"$front_field": "$entry",
"$back_field": "$(look_up)"
},
"modelName": "$note_type",
"deckName": "$target_deck",
Expand Down

0 comments on commit 18c3b32

Please sign in to comment.