Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Also minify the JavaScript file for pre-populated form fields in the …

…admin.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@12967 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit c3d1267c15a77bb7bacb59e9e09eb38c32c03c2a 1 parent 1fcf747
@jezdez jezdez authored
View
5 django/contrib/admin/media/js/compress.py
@@ -21,12 +21,13 @@ def main():
compiler = os.path.expanduser(options.compiler)
if not os.path.exists(compiler):
- sys.exit("Compiler jar file %s not found. Please use the -c option to specify the path." % compiler)
+ sys.exit("Closure compiler jar file %s not found. Please use the -c option to specify the path." % compiler)
if not args:
if options.verbose:
sys.stdout.write("No filenames given; defaulting to admin scripts\n")
- args = [os.path.join(here, f) for f in ["actions.js", "collapse.js", "inlines.js"]]
+ args = [os.path.join(here, f) for f in [
+ "actions.js", "collapse.js", "inlines.js", "prepopulate.js"]]
for arg in args:
if not arg.endswith(".js"):
View
1  django/contrib/admin/media/js/prepopulate.min.js
@@ -0,0 +1 @@
+(function(b){b.fn.prepopulate=function(d,f){return this.each(function(){var a=b(this);a.data("_changed",false);a.change(function(){a.data("_changed",true)});var c=function(){if(a.data("_changed")!=true){var e=[];d.each(function(){b(this).val().length>0&&e.push(b(this).val())});a.val(URLify(e.join(" "),f))}};d.keyup(c).change(c).focus(c)})}})(django.jQuery);
View
4 django/contrib/admin/options.py
@@ -274,7 +274,7 @@ def _media(self):
js.extend(['js/jquery.min.js', 'js/jquery.init.js', 'js/actions.min.js'])
if self.prepopulated_fields:
js.append('js/urlify.js')
- js.append('js/prepopulate.js')
+ js.append('js/prepopulate.min.js')
if self.opts.get_ordered_objects():
js.extend(['js/getElementsBySelector.js', 'js/dom-drag.js' , 'js/admin/ordering.js'])
@@ -1202,7 +1202,7 @@ def _media(self):
js = ['js/jquery.min.js', 'js/jquery.init.js', 'js/inlines.min.js']
if self.prepopulated_fields:
js.append('js/urlify.js')
- js.append('js/prepopulate.js')
+ js.append('js/prepopulate.min.js')
if self.filter_vertical or self.filter_horizontal:
js.extend(['js/SelectBox.js' , 'js/SelectFilter2.js'])
return forms.Media(js=['%s%s' % (settings.ADMIN_MEDIA_PREFIX, url) for url in js])
Please sign in to comment.
Something went wrong with that request. Please try again.