Ticket #10327: 10327-r9969.diff

File 10327-r9969.diff, 3.1 KB (added by Joost Cassee, 16 years ago)
  • django/contrib/admin/media/js/admin/RelatedObjectLookups.js

     
    3636    } else {
    3737        href = triggeringLink.href + '?pop=1';
    3838    }
     39    if (window.location.host != document.domain) {
     40        href += '&jsdom=' + document.domain
     41    }
    3942    var win = window.open(href, name, 'height=500,width=800,resizable=yes,scrollbars=yes');
    4043    win.focus();
    4144    return false;
  • django/contrib/admin/options.py

     
    678678        context = {
    679679            'title': cl.title,
    680680            'is_popup': cl.is_popup,
     681            'js_domain': cl.js_domain,
    681682            'cl': cl,
    682683            'has_add_permission': self.has_add_permission(request),
    683684            'root_path': self.admin_site.root_path,
  • django/contrib/admin/views/main.py

     
    2727TO_FIELD_VAR = 't'
    2828IS_POPUP_VAR = 'pop'
    2929ERROR_FLAG = 'e'
     30JS_DOMAIN_VAR = 'jsdom'
    3031
    3132# Text to display within change-list table cells if the value is blank.
    3233EMPTY_CHANGELIST_VALUE = '(None)'
     
    5354            self.page_num = 0
    5455        self.show_all = ALL_VAR in request.GET
    5556        self.is_popup = IS_POPUP_VAR in request.GET
     57        self.js_domain = request.GET.get(JS_DOMAIN_VAR, '')
    5658        self.to_field = request.GET.get(TO_FIELD_VAR)
    5759        self.params = dict(request.GET.items())
    5860        if PAGE_VAR in self.params:
     
    170172    def get_query_set(self):
    171173        qs = self.root_query_set
    172174        lookup_params = self.params.copy() # a dictionary of the query string
    173         for i in (ALL_VAR, ORDER_VAR, ORDER_TYPE_VAR, SEARCH_VAR, IS_POPUP_VAR):
     175        for i in (ALL_VAR, ORDER_VAR, ORDER_TYPE_VAR, SEARCH_VAR, IS_POPUP_VAR, JS_DOMAIN_VAR):
    174176            if i in lookup_params:
    175177                del lookup_params[i]
    176178        for key, value in lookup_params.items():
  • django/contrib/admin/templates/admin/base.html

     
    88<!--[if lte IE 7]><link rel="stylesheet" type="text/css" href="{% block stylesheet_ie %}{% load adminmedia %}{% admin_media_prefix %}css/ie.css{% endblock %}" /><![endif]-->
    99{% if LANGUAGE_BIDI %}<link rel="stylesheet" type="text/css" href="{% block stylesheet_rtl %}{% admin_media_prefix %}css/rtl.css{% endblock %}" />{% endif %}
    1010<![endif]>
     11{% if js_domain %}<script type="text/javascript">document.domain = "{{ js_domain }}"</script>{% endif %}
    1112{% block extrahead %}{% endblock %}
    1213{% block blockbots %}<meta name="robots" content="NONE,NOARCHIVE" />{% endblock %}
    1314</head>
Back to Top