grimboy
11-08-2006, 05:35 PM
Hey I'm not a user of this, just a busybody whose seen it implemented on djangobook.com. Your block commenting system is pretty awesome. However it loads too slowly on http://www.djangobook.com/en/beta/chapter04/, this is unfortunate as I believe that this is a system that works best when used on long texts. I'm sure you already have an idea of how to fix it but I'm going to put forward my ridiculous suggestion anyway.
Have a function on a timer that sets a global named stop. Then, have the loop doing the bulk of the initialisation check said stop variable once every loop. Then, if it's true, it should save information about the current status to a global* and start another timer to recall the initialisation function which should start by checking if it has run before. If it has run before then it should resume from the point stated by the global. Then at the end of the initialisation clear all of the timer events and globals. There's probably a better way (and you being the expert in js probably know it) but those are my immediate thoughts on it. This is easier said than done obviously (especially in a language like javascript).
Anyway, just an idea for if you have time/care.
*I think it might be possible to get the timer that calls the initialisation function for the second time to pass the state of initialisation in. So that would be a cleaner alternative.
EDIT: I just read this through and it seems pretty stupid looking back but hey.
Have a function on a timer that sets a global named stop. Then, have the loop doing the bulk of the initialisation check said stop variable once every loop. Then, if it's true, it should save information about the current status to a global* and start another timer to recall the initialisation function which should start by checking if it has run before. If it has run before then it should resume from the point stated by the global. Then at the end of the initialisation clear all of the timer events and globals. There's probably a better way (and you being the expert in js probably know it) but those are my immediate thoughts on it. This is easier said than done obviously (especially in a language like javascript).
Anyway, just an idea for if you have time/care.
*I think it might be possible to get the timer that calls the initialisation function for the second time to pass the state of initialisation in. So that would be a cleaner alternative.
EDIT: I just read this through and it seems pretty stupid looking back but hey.