Ticket #5704: 5704trunk.diff

File 5704trunk.diff, 1.9 KB (added by mb0@…, 7 years ago)

patched with minimal valid xhml structure, javascript elem.nodeName happens to be lowercase

  • django/contrib/admin/media/js/admin/RelatedObjectLookups.js

     
    5959    var name = win.name.replace(/___/g, '.');
    6060    var elem = document.getElementById(name);
    6161    if (elem) {
    62         if (elem.nodeName == 'SELECT') {
     62        var elemName = elem.nodeName.toUpperCase();
     63        if (elemName == 'SELECT') {
    6364            var o = new Option(newRepr, newId);
    6465            elem.options[elem.options.length] = o;
    6566            o.selected = true;
    66         } else if (elem.nodeName == 'INPUT') {
     67        } else if (elemName == 'INPUT') {
    6768            elem.value = newId;
    6869        }
    6970    } else {
  • django/contrib/admin/views/main.py

     
    273273                    post_url_continue += "?_popup=1"
    274274                return HttpResponseRedirect(post_url_continue % pk_value)
    275275            if "_popup" in request.POST:
    276                 return HttpResponse('<script type="text/javascript">opener.dismissAddAnotherPopup(window, "%s", "%s");</script>' % \
     276                return HttpResponse('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'
     277                    '<html xmlns="http://www.w3.org/1999/xhtml"><head><title></title></head><body>'
     278                    '<script type="text/javascript">opener.dismissAddAnotherPopup(window, "%s", "%s");</script></body></html>' % \
    277279                    # escape() calls force_unicode.
    278280                    (escape(pk_value), escape(new_object)))
    279281            elif "_addanother" in request.POST:
Back to Top