# HG changeset patch # User Adrien Di Mascio # Date 1299755017 -3600 # Node ID 8bf2337a6f3bcec3ca39e35a397cb92e521e5c2b # Parent 90ddf608fe2b85071774fb4445ffbc6bad8ed3a2 [views] #1499661 get rid of base tag diff -r 90ddf608fe2b -r 8bf2337a6f3b web/data/cubicweb.htmlhelpers.js --- a/web/data/cubicweb.htmlhelpers.js Thu Mar 10 11:58:57 2011 +0100 +++ b/web/data/cubicweb.htmlhelpers.js Thu Mar 10 12:03:37 2011 +0100 @@ -16,11 +16,15 @@ * available and inspects the tag manually otherwise.) */ function baseuri() { - var uri = document.baseURI; - if (uri) { // some browsers don't define baseURI - return uri.toLowerCase(); + if (typeof BASE_URL === 'undefined') { + // backward compatibility, BASE_URL might be undefined + var uri = document.baseURI; + if (uri) { // some browsers don't define baseURI + return uri.toLowerCase(); + } + return jQuery('base').attr('href').toLowerCase(); } - return jQuery('base').attr('href').toLowerCase(); + return BASE_URL; } /** diff -r 90ddf608fe2b -r 8bf2337a6f3b web/views/basetemplates.py --- a/web/views/basetemplates.py Thu Mar 10 11:58:57 2011 +0100 +++ b/web/views/basetemplates.py Thu Mar 10 12:03:37 2011 +0100 @@ -156,7 +156,7 @@ lang = self._cw.lang self.write_doctype() # explictly close the tag to avoid IE 6 bugs while browsing DOM - w(u'' % xml_escape(self._cw.base_url())) + self._cw.html_headers.define_var('BASE_URL', self._cw.base_url()) w(u'\n' % (content_type, self._cw.encoding)) w(u'\n'.join(additional_headers) + u'\n')