291e52bd19
This patch is based on Kevin Cernekee's <cernekee@gmail.com> patch series entitled "gitweb: introduce localtime feature". While Kevin's patch changed the server side output so that the timezone was output from gitweb itself, this has a number of drawbacks, in particular with respect to gitweb-caching. This patch takes the same basic goal, display the appropriate times in a given common timezone, and implements it in JavaScript. This requires adding / using a new class, "datetime", to be able to find elements to be adjusted from JavaScript. Appropriate dates are wrapped in a span with this class. Timezone to be used can be retrieved from "gitweb_tz" cookie, though currently there is no way to set / manipulate this cookie from gitweb; this is left for later commit. Valid timezones, currently, are: "utc", "local" (which means that timezone is taken from browser), and "+/-ZZZZ" numeric timezone as in RFC-2822. Default timezone is "local" (currently not configurable, left for later commit). Fallback (should JavaScript not be enabled) is to treat dates as they have been and display them, only, in UTC. Pages affected: * 'summary' view, "last change" field (commit time from latest change) * 'log' view, author time * 'commit' and 'commitdiff' views, author/committer time * 'tag' view, tagger time Based-on-code-from: Kevin Cernekee <cernekee@gmail.com> Signed-off-by: John 'Warthog9' Hawley <warthog9@eaglescrag.net> 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.