From 9c4979074551d5362d0bfe883ea1764d5449cba1 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Wed, 25 Aug 2021 08:41:59 +0200 Subject: [PATCH] add 'Inline' button and dropdown --- .../config/ShortcutInfo/ShortcutInfo.multids | 1 + .../musicsheets/config/inline-shortcut.tid | 3 ++ .../musicsheets/config/tune-body-shortcut.tid | 2 +- plugins/musicsheets/images/inline.tid | 3 ++ plugins/musicsheets/plugin.info | 2 +- .../editor-button-inline-dropdown.tid | 35 +++++++++++++++++++ .../ui/Buttons/editor-button-inline.tid | 9 +++++ .../musicsheets/ui/Symbols/TuneBody/macro.tid | 4 +-- .../ui/Symbols/TuneBody/remark.tid | 4 +-- .../TuneHeader/default-note-length.tid | 4 +-- .../{information.tid => instruction.tid} | 8 ++--- .../musicsheets/ui/Symbols/TuneHeader/key.tid | 2 +- .../ui/Symbols/TuneHeader/meter.tid | 4 +-- .../ui/Symbols/TuneHeader/notes.tid | 4 +-- .../ui/Symbols/TuneHeader/parts.tid | 4 +-- .../ui/Symbols/TuneHeader/rhythm.tid | 4 +-- .../ui/Symbols/TuneHeader/tempo.tid | 4 +-- .../ui/Symbols/TuneHeader/user-defined.tid | 4 +-- .../ui/Symbols/TuneHeader/voices.tid | 4 +-- 19 files changed, 78 insertions(+), 27 deletions(-) create mode 100644 plugins/musicsheets/config/inline-shortcut.tid create mode 100644 plugins/musicsheets/images/inline.tid create mode 100644 plugins/musicsheets/ui/Buttons/Dropdowns/editor-button-inline-dropdown.tid create mode 100644 plugins/musicsheets/ui/Buttons/editor-button-inline.tid rename plugins/musicsheets/ui/Symbols/TuneHeader/{information.tid => instruction.tid} (58%) diff --git a/plugins/musicsheets/config/ShortcutInfo/ShortcutInfo.multids b/plugins/musicsheets/config/ShortcutInfo/ShortcutInfo.multids index 2254587..ddd2d7b 100644 --- a/plugins/musicsheets/config/ShortcutInfo/ShortcutInfo.multids +++ b/plugins/musicsheets/config/ShortcutInfo/ShortcutInfo.multids @@ -9,6 +9,7 @@ musicsheets-f: Show the F notes musicsheets-g: Show the G notes musicsheets-clefs: Show the clefs musicsheets-decorations: Show the musical decorations +musicsheets-inline: Show the inline dropdown musicsheets-note-heads: Show the note heads musicsheets-note-values: Show the note values (lengths) musicsheets-rests: Insert a rest diff --git a/plugins/musicsheets/config/inline-shortcut.tid b/plugins/musicsheets/config/inline-shortcut.tid new file mode 100644 index 0000000..7044c76 --- /dev/null +++ b/plugins/musicsheets/config/inline-shortcut.tid @@ -0,0 +1,3 @@ +title: $:/config/shortcuts/musicsheets-inline + +alt-shift-M \ No newline at end of file diff --git a/plugins/musicsheets/config/tune-body-shortcut.tid b/plugins/musicsheets/config/tune-body-shortcut.tid index 48f21d5..5c55ce7 100644 --- a/plugins/musicsheets/config/tune-body-shortcut.tid +++ b/plugins/musicsheets/config/tune-body-shortcut.tid @@ -1,3 +1,3 @@ title: $:/config/shortcuts/musicsheets-tune-body -alt-shift-B \ No newline at end of file +alt-shift-L \ No newline at end of file diff --git a/plugins/musicsheets/images/inline.tid b/plugins/musicsheets/images/inline.tid new file mode 100644 index 0000000..9e3df37 --- /dev/null +++ b/plugins/musicsheets/images/inline.tid @@ -0,0 +1,3 @@ +title: $:/plugins/BTC/musicsheets/images/inline + +Inline \ No newline at end of file diff --git a/plugins/musicsheets/plugin.info b/plugins/musicsheets/plugin.info index ccb0478..0d68489 100644 --- a/plugins/musicsheets/plugin.info +++ b/plugins/musicsheets/plugin.info @@ -2,6 +2,6 @@ "title": "$:/plugins/BTC/musicsheets", "description": "Music scores in abc notation for TiddlyWiki5", "author": "Simon Huber", - "version": "0.0.17", + "version": "0.0.18", "list": "readme usage license" } diff --git a/plugins/musicsheets/ui/Buttons/Dropdowns/editor-button-inline-dropdown.tid b/plugins/musicsheets/ui/Buttons/Dropdowns/editor-button-inline-dropdown.tid new file mode 100644 index 0000000..facd5f8 --- /dev/null +++ b/plugins/musicsheets/ui/Buttons/Dropdowns/editor-button-inline-dropdown.tid @@ -0,0 +1,35 @@ +title: $:/plugins/BTC/musicsheets/ui/EditorToolbar/dropdown/inline + +<$list filter="[all[shadows+tiddlers]tag[$:/tags/MusicSheets/Inline]!is[draft]each[category]]"> + +
+<$text text={{!!category}}/> +
+ +<$macrocall $name="list-tagged-draggable" tag="$:/tags/MusicSheets/Inline" subFilter="!is[draft]category{!!category}" itemTemplate="$:/plugins/BTC/musicsheets/ui/Templates/toolbar-item-template-symbols"/> + + + +---- + +<$button tag="a"> + +<$action-sendmessage + $message="tm-new-tiddler" + tags="$:/tags/MusicSheets/Inline" + caption="this is shown in the menu" + text="this is inserted when clicking the button" + category="'Inline' or a category you like" +/> + +<$action-deletetiddler + $tiddler=<> +/> + + + +<$text text="new entry"/> + + + + \ No newline at end of file diff --git a/plugins/musicsheets/ui/Buttons/editor-button-inline.tid b/plugins/musicsheets/ui/Buttons/editor-button-inline.tid new file mode 100644 index 0000000..a6d0332 --- /dev/null +++ b/plugins/musicsheets/ui/Buttons/editor-button-inline.tid @@ -0,0 +1,9 @@ +title: $:/plugins/BTC/musicsheets/ui/EditorToolbar/inline +tags: $:/tags/EditorToolbar +icon: $:/plugins/BTC/musicsheets/images/inline +condition: [type[]] [get[type]match[text/vnd.tiddlywiki]] +[first[]] +dropdown: $:/plugins/BTC/musicsheets/ui/EditorToolbar/dropdown/inline +description: inline +shortcuts: ((musicsheets-inline)) +caption: Inline +button-classes: tc-musicsheets-toolbar-button \ No newline at end of file diff --git a/plugins/musicsheets/ui/Symbols/TuneBody/macro.tid b/plugins/musicsheets/ui/Symbols/TuneBody/macro.tid index 53b7f7f..489992e 100644 --- a/plugins/musicsheets/ui/Symbols/TuneBody/macro.tid +++ b/plugins/musicsheets/ui/Symbols/TuneBody/macro.tid @@ -1,7 +1,7 @@ title: $:/plugins/BTC/musicsheets/ui/Symbols/macro -tags: $:/tags/MusicSheets/TuneHeader $:/tags/MusicSheets/TuneBody +tags: $:/tags/MusicSheets/TuneHeader $:/tags/MusicSheets/TuneBody $:/tags/MusicSheets/Inline caption: m: Macro -category: Tune Header and Body +category: Tune Header, Body and Inline description: use m: (macro) to create your own macros m: \ No newline at end of file diff --git a/plugins/musicsheets/ui/Symbols/TuneBody/remark.tid b/plugins/musicsheets/ui/Symbols/TuneBody/remark.tid index 12fe7c4..946f807 100644 --- a/plugins/musicsheets/ui/Symbols/TuneBody/remark.tid +++ b/plugins/musicsheets/ui/Symbols/TuneBody/remark.tid @@ -1,7 +1,7 @@ title: $:/plugins/BTC/musicsheets/ui/Symbols/remark -tags: $:/tags/MusicSheets/TuneBody +tags: $:/tags/MusicSheets/TuneBody $:/tags/MusicSheets/Inline caption: [r: remark] - (wrap selection) -category: Tune Body +category: Tune Body and Inline wrap-selection: true description: you can use the syntax [r:remark] to write a remark in the middle of a line of music. prefix: [r: diff --git a/plugins/musicsheets/ui/Symbols/TuneHeader/default-note-length.tid b/plugins/musicsheets/ui/Symbols/TuneHeader/default-note-length.tid index ff915c8..3b79732 100644 --- a/plugins/musicsheets/ui/Symbols/TuneHeader/default-note-length.tid +++ b/plugins/musicsheets/ui/Symbols/TuneHeader/default-note-length.tid @@ -1,7 +1,7 @@ title: $:/plugins/BTC/musicsheets/ui/Symbols/NoteLength -tags: $:/tags/MusicSheets/TuneHeader $:/tags/MusicSheets/TuneBody +tags: $:/tags/MusicSheets/TuneHeader $:/tags/MusicSheets/TuneBody $:/tags/MusicSheets/Inline caption: L: (Default) Note Length -category: Tune Header and Body +category: Tune Header, Body and Inline description: The L: field specifies the unit note length - the length of a note as represented by a single letter in abc L: \ No newline at end of file diff --git a/plugins/musicsheets/ui/Symbols/TuneHeader/information.tid b/plugins/musicsheets/ui/Symbols/TuneHeader/instruction.tid similarity index 58% rename from plugins/musicsheets/ui/Symbols/TuneHeader/information.tid rename to plugins/musicsheets/ui/Symbols/TuneHeader/instruction.tid index 3a9c853..f4474b4 100644 --- a/plugins/musicsheets/ui/Symbols/TuneHeader/information.tid +++ b/plugins/musicsheets/ui/Symbols/TuneHeader/instruction.tid @@ -1,7 +1,7 @@ -title: $:/plugins/BTC/musicsheets/ui/Symbols/Information -tags: $:/tags/MusicSheets/TuneHeader $:/tags/MusicSheets/TuneBody -caption: I: Information -category: Tune Header and Body +title: $:/plugins/BTC/musicsheets/ui/Symbols/Instruction +tags: $:/tags/MusicSheets/TuneHeader $:/tags/MusicSheets/TuneBody $:/tags/MusicSheets/Inline +caption: I: Instruction +category: Tune Header, Body and Inline description: The I:(instruction) field is used for an extended set of instruction directives concerned with how the abc code is to be interpreted. I: \ No newline at end of file diff --git a/plugins/musicsheets/ui/Symbols/TuneHeader/key.tid b/plugins/musicsheets/ui/Symbols/TuneHeader/key.tid index 8eec0e0..f404b0f 100644 --- a/plugins/musicsheets/ui/Symbols/TuneHeader/key.tid +++ b/plugins/musicsheets/ui/Symbols/TuneHeader/key.tid @@ -1,7 +1,7 @@ title: $:/plugins/BTC/musicsheets/ui/Symbols/Key tags: $:/tags/MusicSheets/TuneHeader $:/tags/MusicSheets/TuneBody caption: K: Key -category: Tune Header and Body +category: Tune Header, Body and Inline description: Note that the first occurrence of the K: field, which must appear in every tune, finishes the tune header. All following lines are considered to be part of the tune body. The key signature should be specified with a capital letter (A-G) which may be followed by a # or b for sharp or flat respectively. In addition the mode should be specified (when no mode is indicated, major is assumed). K: \ No newline at end of file diff --git a/plugins/musicsheets/ui/Symbols/TuneHeader/meter.tid b/plugins/musicsheets/ui/Symbols/TuneHeader/meter.tid index ee3bf1b..34ca329 100644 --- a/plugins/musicsheets/ui/Symbols/TuneHeader/meter.tid +++ b/plugins/musicsheets/ui/Symbols/TuneHeader/meter.tid @@ -1,7 +1,7 @@ title: $:/plugins/BTC/musicsheets/ui/Symbols/Meter -tags: $:/tags/MusicSheets/TuneHeader $:/tags/MusicSheets/TuneBody +tags: $:/tags/MusicSheets/TuneHeader $:/tags/MusicSheets/TuneBody $:/tags/MusicSheets/Inline caption: M: Meter -category: Tune Header and Body +category: Tune Header, Body and Inline description: The M: field indicates the meter. Apart from standard meters, e.g. M:6/8 or M:4/4, the symbols M:C and M:C| give common time (4/4) and cut time (2/2) respectively. The symbol M:none omits the meter entirely (free meter). It is also possible to specify a complex meter, e.g. M:(2+3+2)/8, to make explicit which beats should be accented. The parentheses around the numerator are optional. M: \ No newline at end of file diff --git a/plugins/musicsheets/ui/Symbols/TuneHeader/notes.tid b/plugins/musicsheets/ui/Symbols/TuneHeader/notes.tid index 36f0b88..2aca293 100644 --- a/plugins/musicsheets/ui/Symbols/TuneHeader/notes.tid +++ b/plugins/musicsheets/ui/Symbols/TuneHeader/notes.tid @@ -1,7 +1,7 @@ title: $:/plugins/BTC/musicsheets/ui/Symbols/Notes -tags: $:/tags/MusicSheets/TuneHeader $:/tags/MusicSheets/TuneBody +tags: $:/tags/MusicSheets/TuneHeader $:/tags/MusicSheets/TuneBody $:/tags/MusicSheets/Inline caption: N: Notes -category: Tune Header and Body +category: Tune Header, Body and Inline description: Contains general annotations, such as references to other tunes which are similar, details on how the original notation of the tune was converted to abc, etc. N: \ No newline at end of file diff --git a/plugins/musicsheets/ui/Symbols/TuneHeader/parts.tid b/plugins/musicsheets/ui/Symbols/TuneHeader/parts.tid index c739230..8858853 100644 --- a/plugins/musicsheets/ui/Symbols/TuneHeader/parts.tid +++ b/plugins/musicsheets/ui/Symbols/TuneHeader/parts.tid @@ -1,7 +1,7 @@ title: $:/plugins/BTC/musicsheets/ui/Symbols/Parts -tags: $:/tags/MusicSheets/TuneHeader $:/tags/MusicSheets/TuneBody +tags: $:/tags/MusicSheets/TuneHeader $:/tags/MusicSheets/TuneBody $:/tags/MusicSheets/Inline caption: P: Parts -category: Tune Header and Body +category: Tune Header, Body and Inline description: The P: field can be used in the tune header to state the order in which the tune parts are played, i.e. P:ABABCDCD, and then inside the tune body to mark each part, i.e. P:A or P:B. (In this context part refers to a section of the tune, rather than a voice in multi-voice music.) P: \ No newline at end of file diff --git a/plugins/musicsheets/ui/Symbols/TuneHeader/rhythm.tid b/plugins/musicsheets/ui/Symbols/TuneHeader/rhythm.tid index 2467422..33abeaa 100644 --- a/plugins/musicsheets/ui/Symbols/TuneHeader/rhythm.tid +++ b/plugins/musicsheets/ui/Symbols/TuneHeader/rhythm.tid @@ -1,7 +1,7 @@ title: $:/plugins/BTC/musicsheets/ui/Symbols/Rhythm -tags: $:/tags/MusicSheets/TuneHeader $:/tags/MusicSheets/TuneBody +tags: $:/tags/MusicSheets/TuneHeader $:/tags/MusicSheets/TuneBody $:/tags/MusicSheets/Inline caption: R: Rhythm -category: Tune Header and Body +category: Tune Header, Body and Inline description: Contains an indication of the type of tune (e.g. hornpipe, double jig, single jig, 48-bar polka, etc). This gives the musician some indication of how a tune should be interpreted as well as being useful for database applications. R: \ No newline at end of file diff --git a/plugins/musicsheets/ui/Symbols/TuneHeader/tempo.tid b/plugins/musicsheets/ui/Symbols/TuneHeader/tempo.tid index e81c2dc..24dd9d9 100644 --- a/plugins/musicsheets/ui/Symbols/TuneHeader/tempo.tid +++ b/plugins/musicsheets/ui/Symbols/TuneHeader/tempo.tid @@ -1,7 +1,7 @@ title: $:/plugins/BTC/musicsheets/ui/Symbols/Tempo -tags: $:/tags/MusicSheets/TuneHeader $:/tags/MusicSheets/TuneBody +tags: $:/tags/MusicSheets/TuneHeader $:/tags/MusicSheets/TuneBody $:/tags/MusicSheets/Inline caption: Q: Tempo -category: Tune Header and Body +category: Tune Header, Body and Inline description: The Q: field defines the tempo in terms of a number of beats per minute, e.g. Q:1/2=120 means 120 half-note beats per minute. Q: \ No newline at end of file diff --git a/plugins/musicsheets/ui/Symbols/TuneHeader/user-defined.tid b/plugins/musicsheets/ui/Symbols/TuneHeader/user-defined.tid index 850e717..38b64a4 100644 --- a/plugins/musicsheets/ui/Symbols/TuneHeader/user-defined.tid +++ b/plugins/musicsheets/ui/Symbols/TuneHeader/user-defined.tid @@ -1,7 +1,7 @@ title: $:/plugins/BTC/musicsheets/ui/Symbols/UserDefined -tags: $:/tags/MusicSheets/TuneHeader $:/tags/MusicSheets/TuneBody +tags: $:/tags/MusicSheets/TuneHeader $:/tags/MusicSheets/TuneBody $:/tags/MusicSheets/Inline caption: U: User defined -category: Tune Header and Body +category: Tune Header, Body and Inline description: As a short cut to writing symbols which avoids the !symbol! syntax, the letters H-W and h-w and the symbol ~ can be assigned with the U: field. U: \ No newline at end of file diff --git a/plugins/musicsheets/ui/Symbols/TuneHeader/voices.tid b/plugins/musicsheets/ui/Symbols/TuneHeader/voices.tid index 77707a0..436f134 100644 --- a/plugins/musicsheets/ui/Symbols/TuneHeader/voices.tid +++ b/plugins/musicsheets/ui/Symbols/TuneHeader/voices.tid @@ -1,7 +1,7 @@ title: $:/plugins/BTC/musicsheets/ui/Symbols/Voices -tags: $:/tags/MusicSheets/TuneHeader $:/tags/MusicSheets/TuneBody +tags: $:/tags/MusicSheets/TuneHeader $:/tags/MusicSheets/TuneBody $:/tags/MusicSheets/Inline caption: V: Voices -category: Tune Header and Body +category: Tune Header, Body and Inline description: The V: field allows the writing of multi-voice music. In multi-voice abc tunes, the tune body is divided into several voices, each beginning with a V: field. All the notes following such a V: field, up to the next V: field or the end of the tune body, belong to the voice. V: \ No newline at end of file