diff options
| author | Ben Spaulding <benjamin.spaulding@lionbridge.com> | 2015-07-12 15:37:17 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-07-13 08:18:58 -0400 |
| commit | 83f63730306fa3cbdcbe7f0dcb36b0cdcfd1ec4a (patch) | |
| tree | 0f26c5b845afd535bfe9469e92aa138d714cc181 | |
| parent | d62194a260eedd30aeea78f407032aabfde4be70 (diff) | |
Fixed #25116 -- Removed long-broken admindocs bookmarklets
These were broken back in commit 64e11a6.
| -rw-r--r-- | django/contrib/admindocs/templates/admin_doc/bookmarklets.html | 14 | ||||
| -rw-r--r-- | docs/ref/contrib/admin/admindocs.txt | 17 |
2 files changed, 5 insertions, 26 deletions
diff --git a/django/contrib/admindocs/templates/admin_doc/bookmarklets.html b/django/contrib/admindocs/templates/admin_doc/bookmarklets.html index 819beea326..937b0e2bc5 100644 --- a/django/contrib/admindocs/templates/admin_doc/bookmarklets.html +++ b/django/contrib/admindocs/templates/admin_doc/bookmarklets.html @@ -15,24 +15,12 @@ {% blocktrans %} <p class="help">To install bookmarklets, drag the link to your bookmarks toolbar, or right-click the link and add it to your bookmarks. Now you can -select the bookmarklet from any page in the site. Note that some of these -bookmarklets require you to be viewing the site from a computer designated -as "internal" (talk to your system administrator if you aren't sure if -your computer is "internal").</p> +select the bookmarklet from any page in the site.</p> {% endblocktrans %} <div id="content-main"> <h3><a href="javascript:(function(){if(typeof ActiveXObject!='undefined'){x=new ActiveXObject('Microsoft.XMLHTTP')}else if(typeof XMLHttpRequest!='undefined'){x=new XMLHttpRequest()}else{return;}x.open('HEAD',location.href,false);x.send(null);try{view=x.getResponseHeader('x-view');}catch(e){alert('No view found for this page');return;}if(view=='undefined'){alert('No view found for this page');}document.location='{{ admin_url|escapejs }}doc/views/'+view+'/';})()">{% trans "Documentation for this page" %}</a></h3> <p>{% trans "Jumps you from any page to the documentation for the view that generates that page." %}</p> - - <h3><a href="javascript:(function(){if(typeof ActiveXObject!='undefined'){x=new ActiveXObject('Microsoft.XMLHTTP')}else if(typeof XMLHttpRequest!='undefined'){x=new XMLHttpRequest()}else{return;}x.open('GET',location.href,false);x.send(null);try{type=x.getResponseHeader('x-object-type');id=x.getResponseHeader('x-object-id');}catch(e){type='(none)';id='(none)';}d=document;b=d.body;e=d.createElement('div');e.id='xxxhhh';s=e.style;s.position='absolute';s.left='10px';s.top='10px';s.font='10px monospace';s.border='1px black solid';s.padding='4px';s.backgroundColor='#eee';e.appendChild(d.createTextNode('Type: '+type));e.appendChild(d.createElement('br'));e.appendChild(d.createTextNode('ID: '+id));e.appendChild(d.createElement('br'));l=d.createElement('a');l.href='#';l.onclick=function(){b.removeChild(e);};l.appendChild(d.createTextNode('[close]'));l.style.textDecoration='none';e.appendChild(l);b.appendChild(e);})();">{% trans "Show object ID" %}</a></h3> - <p>{% trans "Shows the content-type and unique ID for pages that represent a single object." %}</p> - - <h3><a href="javascript:(function(){if(typeof ActiveXObject!='undefined'){var x=new ActiveXObject('Microsoft.XMLHTTP')}else if(typeof XMLHttpRequest!='undefined'){var x=new XMLHttpRequest()}else{return;}x.open('GET',location.href,false);x.send(null);try{var type=x.getResponseHeader('x-object-type');var id=x.getResponseHeader('x-object-id');}catch(e){return;}document.location='{{ admin_url }}'+type.split('.').join('/')+'/'+id+'/';})()">{% trans "Edit this object (current window)" %}</a></h3> - <p>{% trans "Jumps to the admin page for pages that represent a single object." %}</p> - - <h3><a href="javascript:(function(){if(typeof ActiveXObject!='undefined'){var x=new ActiveXObject('Microsoft.XMLHTTP')}else if(typeof XMLHttpRequest!='undefined'){var x=new XMLHttpRequest()}else{return;}x.open('GET',location.href,false);x.send(null);try{var type=x.getResponseHeader('x-object-type');var id=x.getResponseHeader('x-object-id');}catch(e){return;}window.open('{{ admin_url }}'+type.split('.').join('/')+'/'+id+'/');})()">{% trans "Edit this object (new window)" %}</a></h3> - <p>{% trans "As above, but opens the admin page in a new window." %}</p> </div> {% endblock %} diff --git a/docs/ref/contrib/admin/admindocs.txt b/docs/ref/contrib/admin/admindocs.txt index 040dc25fe0..76060ae28e 100644 --- a/docs/ref/contrib/admin/admindocs.txt +++ b/docs/ref/contrib/admin/admindocs.txt @@ -141,22 +141,13 @@ template is stored. Included Bookmarklets ===================== -Several useful bookmarklets are available from the ``admindocs`` page: +One bookmarklet is available from the ``admindocs`` page: Documentation for this page Jumps you from any page to the documentation for the view that generates that page. -Show object ID - Shows the content-type and unique ID for pages that represent a single - object. - -Edit this object - Jumps to the admin page for pages that represent a single object. - -Using these bookmarklets requires that you are either logged into the -:mod:`Django admin <django.contrib.admin>` as a +Using this bookmarklet requires that ``XViewMiddleware`` is installed and that +you are logged into the :mod:`Django admin <django.contrib.admin>` as a :class:`~django.contrib.auth.models.User` with -:attr:`~django.contrib.auth.models.User.is_staff` set to ``True``, or that the -``XViewMiddleware`` is installed and you are accessing the site from an IP -address listed in :setting:`INTERNAL_IPS`. +:attr:`~django.contrib.auth.models.User.is_staff` set to ``True``. |
