42ab5d40de
If there is a possibility that your logic could take longer to execute than the interval time, it is recommended that you recursively call a named function using window.setTimeout rather than window.setInterval. Therefore instead of using setInterval as an alternate way of invoking handleResponse (because some web browsers call onreadystatechange only once per each distinct state, and not for each server flush), use setTimeout and reset it from handleResponse. As a bonus this allows us to get rid of timer if it turns out that web browser calls onreadystatechange on each server flush. While at it get rid of `xhr' global variable, creating it instead as local variable in startBlame and passing it as parameter, and of `pollTimer' global variable, passing it as member of xhr object (xhr.pollTimer). Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com> |
||
---|---|---|
.. | ||
lib | ||
adjust-timezone.js | ||
blame_incremental.js | ||
javascript-detection.js | ||
README |
GIT web interface (gitweb) - JavaScript ======================================= This directory holds JavaScript code used by gitweb (GIT web interface). Scripts from there would be concatenated together in the order specified by gitweb/Makefile into gitweb/static/gitweb.js, during building of gitweb/gitweb.cgi (during gitweb building). The resulting file (or its minification) would then be installed / deployed together with gitweb. Scripts in 'lib/' subdirectory compose generic JavaScript library, providing features required by gitweb but in no way limited to gitweb only. In the future those scripts could be replaced by some JavaScript library / framework, like e.g. jQuery, YUI, Prototype, MooTools, Dojo, ExtJS, Script.aculo.us or SproutCore. All scripts that manipulate gitweb output should be put outside 'lib/', directly in this directory ('gitweb/static/js/'). Those scripts would have to be rewritten if gitweb moves to using some JavaScript library. See also comments in gitweb/Makefile.