{debug:{ active:true} }<$edit tiddler="JSONTIDDLER" index="debug.active"/>Thanks in advance.--
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/2c99fc8c-ac73-4027-8df7-5d96affb97e4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I was fearing that answer...I started building a middle ware layer to handle the conversion from wikitext to the various configurations that I have to handle, but I'm not very pleased about it.Maybe I can do something better. Taking a look at the editor widget, I think all that I have to do is write an editor for type application/json. Am I right? Is there any similar editor that I can use as reference?
I don't know why, but I though that someone found some workaround...Thanks and regards.
--
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/3e26a336-7f95-448f-8c06-79b9e18ab95b%40googlegroups.com.
function plainToNestedObject(plain){ var result = {}; $tw.utils.each(plain, function(value,key){ createChilds(result,key.split('.'),value) }); return result; function createChilds(ob,keys,value){ keys = keys.slice(); // no side effects please var lastKey = keys.pop(); //pop is handy but mutates the array var lastChild = keys.reduce( function(ob,k){ ob[k] = ob[k] || {}; return ob[k]; } ,ob); lastChild[lastKey] = value; return ob; }}I think the ultimate implementation would involve firstly updating the text reference format to understand a syntax for identifying properties within the object, and then updating the places that use text references (such as the editor widget) to use the new code.
Writing an editor for type application/json would be the route to go if you were writing a generic JSON editor, one that edits an entire file, rather than an individual property.
As far as the text reference is able to understand the JSON dot notation, there is no need to modify anything else, or I am missing something? I have to admit that I get lost easily with the code of the editor widget.
To be honest, I don't find that so interesting. There is no much difference between editing a JSON tiddler as text if you are editing the whole file. What is useful is to be able to edit an individual property, no matter how nested . That way creating user interfaces for editing complex configurations would be a breeze.
--
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/76b096f1-fb46-46e3-8dc9-6788caea2db5%40googlegroups.com.