Ticket #5704: 5704nfa.diff

File 5704nfa.diff, 1.8 KB (added by mb0@…, 17 years ago)

same for newforms-admin

  • 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/options.py

     
    381381                post_url_continue += "?_popup=1"
    382382            return HttpResponseRedirect(post_url_continue % pk_value)
    383383        if request.POST.has_key("_popup"):
    384             return HttpResponse('<script type="text/javascript">opener.dismissAddAnotherPopup(window, "%s", "%s");</script>' % \
     384            return HttpResponse('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'
     385                '<html xmlns="http://www.w3.org/1999/xhtml"><head><title></title></head><body>'
     386                '<script type="text/javascript">opener.dismissAddAnotherPopup(window, "%s", "%s");</script></body></html>' % \
    385387                # escape() calls force_unicode.
    386388                (escape(pk_value), escape(new_object)))
    387389        elif request.POST.has_key("_addanother"):
Back to Top