What exactly do you mean by dynamic content? With the latest changes
you should able to dynamically update the Table Of Contents and also
insert client-side generated documents (content retrieved through an
XHR.) These changes are not in an official release yet, but they are
available in the Github repository
(https://github.com/Treesaver/treesaver). If you are interested, I
could do a quick write-up on how to use it (I have to document it
anyway.)
Best regards,
Bram
I do need to dynamically update the table of contents,so it is usefull to me if you do a quick write-up on how use it.Thank you!
Sorry for the late response. I've added an example of how to use
Treesaver for dynamic content. Be aware that you will need the new (and
unreleased) version of Treesaver for this. It will not work on
treesaver-0.9.2.js. (It will most likely be in Treesaver 0.9.3.)
https://github.com/bramstein/treesaver/tree/master/examples/dynamic-toc
Have a look at the "my.js" JavaScript file, it sets up an event listener
for the LOADED event fired by the index. Once the index is loaded it
hooks up event listeners for four buttons. Each of the buttons add a new
document to the table of contents. The first three add existing
documents, while the last button dynamically inserts a new article.
For now, this only works in debug mode---I haven't exported the right
methods and events yet (minor issue.) I would love to know more about
your use case so I can decide on how much of the API to expose.
Bram
On 2011-06-01 17:09, eathon zhu wrote:
> I do need to dynamically update the table of contents,so it is usefull
> to me if you do a quick write-up on how use it.Thank you!
> 锟斤拷 2011-5-23 锟斤拷锟斤拷6:32锟斤拷"Bram Stein" <b.l....@gmail.com
> <mailto:b.l....@gmail.com>>写锟斤拷锟斤拷
2011/6/12 Pavel M <mobil...@gmail.com>:
I meant your JavaScript console/debugger (like Firebug, or Chrome
developer tools.) Is there any indication of something going wrong there?
Thanks,
Bram
The deps.js file from Google Closure is actually not required: there
is an option to switch loading it off (add `window.CLOSURE_NO_DEPS =
true;` to a script tag before loading Closure/Treesaver.)
Let me know if you run into any problems,
Bram