Opened 18 years ago
Closed 18 years ago
#2869 closed enhancement (fixed)
[patch] Enable admin to get javascript from absolute urls
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | contrib.admin | Version: | |
Severity: | normal | Keywords: | |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Enable admin to get javascript from another domain
If admin js contains http:// ADMIN_MEDIA_PREFIX should not be prepended.
This is esp important to make wyswiyg editors work correctly since they need js not to be on a different domain than the pagre you are currently on
jsurl = 'http://%s/js/' % Site.objects.get_current().domain class Side(models.Model): overskrift = models.CharField(maxlength=255) innhold = TextField() site = models.ForeignKey(Site, default=settings.SITE_ID) manager = CurrentSiteManager() class Admin: manager = CurrentSiteManager() js = [jsurl+'tinymce/jscripts/tiny_mce/tiny_mce.js',jsurl+'tmce.js']
Attachments (2)
Change History (6)
by , 18 years ago
Attachment: | admin_js_httpprefix.diff added |
---|
comment:1 by , 18 years ago
Summary: | Enable admin to get javascript from another domain → [patch] Enable admin to get javascript from another domain |
---|
Marked as patch
comment:2 by , 18 years ago
Summary: | [patch] Enable admin to get javascript from another domain → [patch] Enable admin to get javascript from absolute urls |
---|
I created this similar patch before checking for an existing ticket. My version checks for absolute urls (anything starting with '/'
or containing '://'
).
Also, the patch contains a small addition to documentation to clarify this.
by , 18 years ago
Attachment: | admin_js.patch added |
---|
comment:3 by , 18 years ago
Triage Stage: | Unreviewed → Ready for checkin |
---|
Good idea, since we're all serving static content from outside our Django servers, right? :)
comment:4 by , 18 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Patch