JavaScript code to display JSON outlines.
It reads a JSON file that looks like this and renders it as an expandable outline, like this.
-
It's a JSON object that contains a text value, any number of other scalar values, and an array named subs.
-
Each object in subs conforms to rule 1.
I use this code in two places:
-
To render outlines for reading in liveblog.co. (Example)
-
To render outlines in rivers, to view outlines included in news items. (Example)
Here's a link to the demo app on my server so you can see what outlinebrowserdemo.html looks like.
Saving and restoring expansion state. Two new routines, getExpansionState and applyExpansionState. The demo has been updated to support the feature. Here's the writeup on Scripting News.
-
jQuery
-
Font Awesome
-
Bootstrap Toolkit