Sorry for my very late reply, but currently I'm very busy. Thank you all for all the detailed feedback. This motivates me a lot!
@Mario The default built in regexp handler, works very well with öä. But may be > the used libraries don't. > The used AtWho libraries doesn't support diacritics out of the box, but I fixed this in the current release without using any 3rd party libraries. @Yakov Not sure what do you mean here by "doesn't support". I've tried to type > tiddler names starting from cyrillics ([[До) and got the proper > suggestions; I've even created a tiddler which name starts from ASCII > letters and contain cyrillics (New Tiddler Ъ) and if I type [[Ъ or even > [[ъ (not capital letter), I get the right suggestion listed. What exactly > didn't work for you? > You see, I'm totally new to RegExp :) The default AtWho matcher[1] matches only "A-Za-z0-9" but no diacritic[2] characters like äöü?é etc. I've added a small RegExp hack in the current release ("\x7f-\xff"), so now it works. I should also modify the highlighter function[3] in a next version. By the way, I've noticed that I have to click the "autosuggest off" button > twice to make it switch to "on", this is a small bug, I'd say. Not sure > what's the cause. > Hmm, this is strange as it works for me as expected. Does this bug still occur in the current release (0.2.4)? Also, I'd either omit the hideReadOnly param (to keep the code clean) or > set it to true (no reason for a guest to get the suggestions for editing as > he or she won't be any editing anyway). > FIXED By the way, in TiddlySpace, the "view instead of edit" mode for guests > doesn't allow to type any letters, so this doesn't work as demo. If you'd > like to show some demo directly in the space, you have to manually create a > tiddler with some <html>...</html> containing a textarea where a guest can > type and (s)he gets the suggestions. > I wasn't aware of it. I've added a small example tiddler for guests just to show them how it works (tiddler suggestion only). Well, the easiest RegExp the matches [[some text| would probably be > /\[\[[^\|\]]+?\|/, but I'm not sure how this should be passed to .. is it > .atwho method that sets the autoSuggestions? Well, this is more tricky for a novice like me. I tried several RegExps but without luck. I don't have enough time at the moment to get into it, but it is indeed the most important feature to make this plugin (more) usable. I have to take more time to dive deeper into RegExp stuff. Hope to fix this soon (#1 on my wishlist). If you like to help, you could read the documentation about custom callbacks[4] of ".atwho" method. These callbacks can be passed to ".atwho" with the "callbacks" property. You can see my custom callback for the matcher function ("cbMatcher") in the source code of AutoSuggestPlugin. Hope that helps a bit. I'll add a couple of ideas just see some perspectives. One this is > replacing html-entities (special symbols) with actual symbols like this: > * let's imagine I'd like to add a left-to-right arrow (→) > * I start to type &r > * I get a "→" suggestion -- *not* "→" > * I chose it and get much clearer wiki-code, without that unreadable > "→" stuff > Though, I don't know if there's an interface to get a list of all these > "abbriviations" (rarr, larr, uarr, darr, harr, times, bull, > .......................) and an interface to get there unicode equivalent. > Also, "--" -> &nash;/— could be processed in this manner. > A similar thing can be used with MathJax plugin to turn \rho to ρ etc. > (though, just autoreplacing can be done instead of autosuggesting > replacement, but autosuggesting seems to be more flexible) > Very nice ideas Yakov. I think that those suggestion patterns shouldn't be implemented by default as every AtWho listener affects the overall editing performance (especially on mobile devices). Recently I thought about user defined suggestion patterns which are defined in a separate config tiddler. Maybe this could meet your need? Another possible application is to combine this with CodeMirror for > TiddlyWiki (see [1] for the latest release and discussion). This can be > another huge step in turning TW into a dev environment. Fortunately, Mario > is here and probably can comment this somehow. > I had the same idea as I started writing this plugin, but this is probably beyond my skills :) I also use CodeMirror with TW a lot and would love to see this combination. @Mario, what do you think? Finally, autoSuggestions can be used in the tags line which seems to be > more beatiful and faster than Udo's interface [2] (although, Udo's solution > implements some smart algorithm for ranging suggestions). > FIXED in 0.2.2 I also thougt about an additional suggestion pattern (maybe ##* or the like) which uses smart tag suggestions like "tiddlers that uses these tags also use ...". I have to study Udo's algorithm ;) in the current snapshot (0.2.2) there's > > config.options.chkAutoSuggestGlobal > > option that is defined in your code, but which is not used anyhow; > at the same time there's > > chkAutoSuggestScope > > option which is used but is not defined. Looks like it was the same option > and you renamed it in some parts of the code, but forgot to do so in others > (or some other mistake took place). > FIXED You're right, I renamed "chkAutoSuggestScope" to "chkAutoSuggestGlobal" and forgot to do this in some parts. BTW, this option will be used in future for switching between cookie-based (globally) and per-tiddler -based (locally in custom field) saving of autosuggest status (on/off) like Mario proposed before. By the way, the tag suggestion feature works nicely! First, I've suspected > that it can interact poorly with transclusions when one wants to transclude > a section: > <<tiddler [[some tiddler## > or with second level of numbered lists > ## list item > but tests showed that the workflow is quite reasonable: in the first case > there's no suggestion at all, and also if one uses AutoSuggestion to get > the tiddler, (s)he will get > <<tiddler [[some tiddler]] > first and then go add the section part. And in the second case when a > space is added after ##, the suggestions are hidden. > This behaviour wasn't intended by me, as I left the regexp matcher of AtWho at the default value (except for the diacritics hack mentioned above). But good to know that it works well in most cases :) These made me think, though.. > * one more idea: autosuggestions of sections/slices can be added! below > are some use-cases, "l" represents the cursor: > <<tiddler [[some tiddler##l > <<tiddler [[some tiddler::l > <<tiddler [[some tiddler##l]] > <<tiddler [[some tiddler::l]] > * there's one more case where tag suggestions are useful: filters there > are two cases: > ** tag filter. Examples of use-cases (obviously, there's no need for the > ## addition in this cases): > <<list filter '[tag[l > <<list filter '... [tag[l > <<list filter '[tag[l]]'>> > <<list filter '[tag[l]] ...'>> > <<list filter '... [tag[l]]'>> > as you can see, these can be described as /\[tag\[([^\]]*)($|\])/m if > I'm not mistaking > ** other filters that can "eat" tags: > <<list filter '[filterName[##| > (and versions with or without smth before/after as well) > In these two cases, of'course, instead of [[tagName]], either tagName]]or > tagName should be inserted. > Very usefull ideas! I've put it on my feature wishlist. As you can see I've implemented several experimental suggestions for sections, slices and fields in 0.2.4, but they only work with the current tiddler. It is just a test and serves more as a basis for further implementations. By the way, the results of testing with CodeMirror. in CodeMirror editor, > the suggestions are shown without any changes of AutoSuggestPlugin (!), and > if I click a suggesion with the cursor, it is inserted as expected. > However, the behaviour of up/down arrows and enter key is not what is > expected: when I press enter (after, say, I've typed [[To and the first > suggestion is ToolbarCommands), I get *both *linebreak and the suggestion > inserted, resulting in > [[To > olbarCommands > A similar thing happens with arrows: when I press "down" to select another > suggestion, the cursor goes down as well, making the suggestion dropdown > disappear. > Thank you for testing! And nice that it works more or less out of the box. Obviously this behaviour should be related to a conflict with CodeMirrors handling of keyboard events, but actually I don't know how to fix this. > I'll report when I test this with the View Mode/Inline Editing plugins [1] > (presumably it's enough to add the autoSuggest command to the ViewToolbar > slice..) Thank you Yakov, hope it works without any conflicts. @Leo This is really nifty! I'm gonna keep an eye on this as it develops. Would > it be possible for it to also auto suggest sections and slices? > > I mean, if I type [[TiddlerName## could it be made to also auto suggest > the possible sections/headers from within that tiddler? How about for > slices? > Thank you Leo, nice to hear that you like it. I've implemented a temporary solution for section, slice and field suggestion, but currently it only supports suggestions for the current tiddler only. If I have more time soon I will fix this in the next release. Stay tuned ... Best regards, Albert [1] https://github.com/ichord/At.js/blob/master/dist/js/jquery.atwho.js#L640 [2] http://en.wikipedia.org/wiki/Diacritic [3] https://github.com/ichord/At.js/blob/master/dist/js/jquery.atwho.js#L694 [4] https://github.com/ichord/At.js/wiki/Callbacks -- You received this message because you are subscribed to the Google Groups "TiddlyWiki" group. To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+unsubscr...@googlegroups.com. To post to this group, send email to tiddlywiki@googlegroups.com. Visit this group at http://groups.google.com/group/tiddlywiki. For more options, visit https://groups.google.com/d/optout.