# HG changeset patch # User Florent Cayré # Date 1304592621 -7200 # Node ID 22403d5c3da4e1895347a6985d482cfb8c7df15b # Parent 66fa1b7ac784c84fa370ebea1fe74ba102568c1b fix ajax loading of concatenated js/ css + prefix concat cache files to ease cache clearing diff -r 66fa1b7ac784 -r 22403d5c3da4 etwist/server.py --- a/etwist/server.py Wed May 04 12:25:50 2011 +0200 +++ b/etwist/server.py Thu May 05 12:50:21 2011 +0200 @@ -171,7 +171,7 @@ def __init__(self, config, paths): _, ext = osp.splitext(paths[0]) # create a unique / predictable filename - fname = hashlib.md5(';'.join(paths)).hexdigest() + ext + fname = 'cache_concat_' + hashlib.md5(';'.join(paths)).hexdigest() + ext filepath = osp.join(config.appdatahome, 'uicache', fname) LongTimeExpiringFile.__init__(self, config, filepath) self._concat_cached_filepath(filepath, paths) diff -r 66fa1b7ac784 -r 22403d5c3da4 web/data/cubicweb.ajax.js --- a/web/data/cubicweb.ajax.js Wed May 04 12:25:50 2011 +0200 +++ b/web/data/cubicweb.ajax.js Thu May 05 12:50:21 2011 +0200 @@ -95,7 +95,7 @@ if (!base.endswith('/')) { base += '/'; } - var modconcat_rgx = new RegExp('(' + base + 'data/([a-z0-9]+/))?\\?\\?(.+)'); + var modconcat_rgx = new RegExp('(' + base + 'data/([a-z0-9]+/)?)\\?\\?(.+)'); return modconcat_rgx.exec(url); } @@ -112,7 +112,7 @@ if (groups == null) { resources.push(src); } else { - var dataurl = groups[0]; + var dataurl = groups[1]; $.each(cw.utils.lastOf(groups).split(','), function() { resources.push(dataurl + this); @@ -150,12 +150,10 @@ // server-response event, since we loose control on when the // script is loaded (jQuery load it immediatly). loaded.push(resource); - jQuery(srcnode).appendTo($head); } }); - } else { - jQuery(srcnode).appendTo($head); } + jQuery(srcnode).appendTo($head); }); $node.find(jqtagfilter).remove(); }