Skip to content

Commit

Permalink
[#2618] Add IE conditionals via config
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes committed Aug 15, 2012
1 parent 3daacbe commit 861c24a
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions ckan/html_resources/__init__.py
Expand Up @@ -281,9 +281,9 @@ def create_resource(path, lib_name, count):
kw['dont_bundle'] = True
kw['custom_order'] = count
# FIXME needs resource.config options enabled
if False:
other_browsers = False
condition = ''
if path in IE_conditionals:
other_browsers = ('others' in IE_conditionals[path])
condition = IE_conditionals[path][0]
kw['renderer'] = IEConditionalRenderer(
condition=condition,
renderer=renderer,
Expand All @@ -299,6 +299,7 @@ def create_resource(path, lib_name, count):
dont_bundle = []
depends = {}
groups = {}
IE_conditionals = {}

# parse the resource.config file if it exists
resource_path = os.path.dirname(__file__)
Expand All @@ -317,6 +318,14 @@ def create_resource(path, lib_name, count):
if config.has_section('groups'):
items = config.items('groups')
groups = dict((n, v.split()) for (n, v) in items)
if config.has_section('IE conditional'):
items = config.items('IE conditional')
for (n, v) in items:
files = v.split()
for f in files:
if f not in IE_conditionals:
IE_conditionals[f] = []
IE_conditionals[f].append(n)

library = Library(name, path)
module = sys.modules[__name__]
Expand Down

0 comments on commit 861c24a

Please sign in to comment.