I am trying to create a tiddler which has different content depending on whether on mobile or not. This will be used to alter configuration options.
I noticed that from the console I can view the user agent in navigator.userAgent. Is there any way I can access this information from a macro or widget?
I have created this snippet which I intended to use for the body of $:/config/EditorTypeMappings/text/vnd.tiddlywiki
<$reveal type="match" state="$:/info/browser/is/android" text="yes">
text
</$reveal>
<$reveal type="nomatch" state="$:/info/browser/is/android" text="yes">
codemirror
</$reveal>
Unfortunately this does not work. The value of the tiddler is exactly correct when you view it normally, but it seems when it is used to actually determine which editor to use it does not actually render the contents first. (I guess the $view widget doesn’t do that by default). Is there another way to accomplish this? I feel like it’s really close, just missing some trick I don’t know about.
Thank you.
--
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+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/4ad52134-1d86-4f59-afe7-148b06dd0265%40googlegroups.com.