Commits

Anonymous committed 8430793

Added source_urls configuration variable to media_compressor settings.

Comments (0)

Files changed (2)

kay/ext/media_compressor/default_settings.py

     'arguments': '--template=high',
   },
   'source_files': (),
+  'source_urls': (),
   'output_filename': None,
 }
 
     'path': '/usr/local/closure-compiler/compiler.jar', # path to compiler.jar
   },
   'source_files': (),
+  'source_urls': (),
   'output_filename': None,
 }
 

kay/ext/media_compressor/media_compiler.py

 
   css_config = get_css_config(tag_name)
   if not css_config['enabled']:
-    return [path if re.match(ur'https?://', path) else '/%s' %
-            path for path in css_config['source_files']]
+    if css_config['source_urls']:
+      return css_config['source_urls']
+    else:
+      return [path if re.match(ur'https?://', path) else '/%s' %
+              path for path in css_config['source_files']]
 
   if auto_compile:
     compile_css(tag_name)
 def get_js_urls(tag_name, auto_compile=False):
   js_config = get_js_config(tag_name)
   if not js_config['enabled']:
-    return [path if re.match(ur'https?://', path) else '/%s' %
-            path for path in js_config['source_files']]
+    if js_config['source_urls']:
+      return js_config['source_urls']
+    else:
+      return [path if re.match(ur'https?://', path) else '/%s' %
+              path for path in js_config['source_files']]
 
   if auto_compile:
     compile_js(tag_name)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.