Hi Mat, > > >> Secondly: If we move the reveal for the popup in *$:/core/ui/* >> *EditTemplate/body/editor*, inside of the closing </$edit> tag, it would >> allow editor toolbar commands to work when included in the popup. Nice >> bonus. >> > > </$edit ToHere?> huh? Is that some super trick or is it an established > practice? >
Toolbar buttons use the tm-edit-text-operation message, which is handled by the edit-text widget. Just like most of the messages like tm-navigate etc are handled by a surrounding navigator widget. So wherever the tm-edit-text-operation message is sent from, there needs to be an edit widget around it to catch the message and manipulate the text. This is why if you look at *$:/core/ui/EditTemplate/body/editor*, all the editor toolbar buttons are between <$edit> and </$edit> The downside to moving the popup reveal inside the edit widget is that the buttons inside popup will only work with the toolbar version of the editor (called the framed editor), if we are using the tm-edit-text-operation message. However, its easy to get a framed editor that doesn't have a visible toolbar and therefore looks just like the simple non-toolbar editor. So I don't see this as a problem. For example in streams whether you choose to have a toolbar or not, it is always the framed toolbar, just sometimes with the toolbar hidden via CSS. We could also extend tm-edit-text to support "replace at caret position" to >> make the insertion of completed strings easier. >> > > Yes, very reasonable. I take it that the already existing > "replace-selection" thus requires a selection of length>0. > > It works without a selection but wouldn't do what you need. It replaces the selected text with a given text. If Hel is selected it can be replaced with HelloThere. With no selection, it would replace nothing with HelloThere and you would get HelHelloThere. So we would need to extend it to replace the non-selected trigger value, just preceding the caret position, with the complete string. It's a nice improvement and would make writing the rest of the functionality with wikitext easier. > > @Mat: https://saqimtiaz.github.io/sq-tw/editormagic-popup.html > > > You've done a fantastic job... in fact, so much so that I'm a bit at loss > of what to do next so I'd better ask before going in the wrong direction: > Does it already now make sense that I modify the EditorMagic/_Popup to > split out the specific title picking functionality to make the > EditorMagic/_Popup tiddler general and to make the other popup content > functionality tiddlers? > My suggestion is to first test this demo robustly. Try different lengths of tiddler, editing at the beginning, end and middle. Identify any bugs or quirks, there will be some. Those will be easier to fix now before we add more complexity. After that your proposed path sounds good, to split out the title functionality and try to make the popup tiddler more general purpose. Cheers, Saq -- You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywikidev/e4246075-1412-43d8-8c77-1796d96d9710o%40googlegroups.com.
