Closed joshuafontany closed 5 years ago
Yes, the grid layout requires a compatible CSS framework as listed in the optional requirements section of https://github.com/jdorn/json-editor and I left out the CSS entirely when packaging the library as a plugin.
Ah, makes sense. Would you know of any references for integrating Bootstrap 3 into Tiddlywiki? Or should it be relatively straightforward?
Thanks again for the plugin. :D
I'm glad you like it and thanks for letting me know. Stylesheets in general are pretty straightforward in Tiddlywiki as described at http://tiddlywiki.com/#Using%20Stylesheets. I just tried those instructions with https://btheado.github.io/jsoneditor.html and the result was not pretty.
The stylesheet should now be applied and the json form becames misaligned and unreadable :-(. Not sure if it is due to some conflict the the tiddlywiki styles or if it is some other problem.
Thanks for the quick check.
I have been reading up on Boostrap3 since finding your plugin, and it looks like there is a *.js component to it as well (that I'll have to install to Tiddlywiki somehow). Maybe the Tiddlywiki group guys have some tips along the lines of the FontAwesome stuff.
To explain my use-case, I'm building a Roleplaying Game Character Database in Tiddlywiki, and needed a good way to "edit" a character JSON. The grid view will be useful for those "blocks of stats" like: Strength X (+/- Y modifier) Dexterity X (+/- Y modifier) Constitution X (+/- Y modifier)
Intelligence X (+/- Y modifier) Wisdom X (+/- Y modifier) Charisma X (+/- Y modifier)
I'll try to post back here if I can get something cool working. :)
On Tue, Nov 3, 2015 at 5:46 PM, btheado notifications@github.com wrote:
I'm glad you like it and thanks for letting me know. Stylesheets in general are pretty straightforward in Tiddlywiki as described at http://tiddlywiki.com/#Using%20Stylesheets. I just tried those instructions with https://btheado.github.io/jsoneditor.html and the result was not pretty.
- Open http://netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css in your browser and select all and copy to clipboard
- Open https://btheado.github.io/jsoneditor.html in your browser
- Create new tiddler titled "bootstrap" or whatever.
- Paste clipboard contents into the body of the tiddler
- Add the $:/tags/Stylesheet tag to the tiddler
- Save the tiddler
The stylesheet should now be applied and the json form becames misaligned and unreadable :-(. Not sure if it is due to some conflict the the tiddlywiki styles or if it is some other problem.
— Reply to this email directly or view it on GitHub https://github.com/btheado/jsoneditor/issues/1#issuecomment-153544871.
@btheado, as answered here please reopen #1:
Looking at the code of the widget, I am thinking that this function is problematic / incomplete:
JSONEditorWidget.prototype.getOptionsFromAttributes = function() { ... }
option:{{!!foo}}
not option:"!!foo"
theme: "bootstrap3" iconlib: "fontawesome4"
options = ["schema","jsonOutput","theme","iconlib"]
{}
and then overwritten with any declared attribute
As a first step, I checked in code which adds support for the the theme
option. These instructions now work to get the bootstrap theme:
$:/plugins/btheado/jsoneditor/usage
tiddler and add theme="bootstrap3"
to all the widget examples.You should now see the bootstrap theming applied to the forms.
Then add format="grid"
to one of the example shema and you should see the fields aligned side-by-side.
Swinging back through. Nice change. Closing.
Just playing around with your example wiki, very cool. Does the tiddlywiki version of JSONEditor support the "format": "grid" schema-property? Reference: https://github.com/jdorn/json-editor#objects Example(change the 'Object Layout' dropdown from normal to grid): http://jeremydorn.com/json-editor/
I've added that line to various places in the Person json-schema, to no effect so far. Thanks!