summaryrefslogtreecommitdiffstats
path: root/mandaye/dispatcher.py
diff options
context:
space:
mode:
Diffstat (limited to 'mandaye/dispatcher.py')
-rw-r--r--mandaye/dispatcher.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/mandaye/dispatcher.py b/mandaye/dispatcher.py
index ed59ac8..3adb812 100644
--- a/mandaye/dispatcher.py
+++ b/mandaye/dispatcher.py
@@ -6,6 +6,7 @@ from urlparse import urlparse
from importlib import import_module
from mandaye import config
+from mandaye.filters.default import MandayeFilter
from mandaye.http import HTTPRequest, HTTPResponse
from mandaye.log import logger
from mandaye.mappers import default
@@ -66,6 +67,14 @@ class Dispatcher(object):
"""
if not mapper.has_key('method') or \
mapper['method'] == self.env['REQUEST_METHOD']:
+ if mapper.has_key('scripts'):
+ req_mapping["on_response"].append(
+ {
+ 'filter': MandayeFilter.add_js_header,
+ 'values': {'scripts': mapper['scripts']},
+ 'content-types': ['text/html']
+ }
+ )
for hookname in req_mapping:
if mapper.has_key(hookname):
if isinstance(req_mapping[hookname], list):