Ticket #11967: admin_media.diff
File admin_media.diff, 2.3 KB (added by , 15 years ago) |
---|
-
django/contrib/admin/media/js/admin/DateTimeShortcuts.js
13 13 clockLinkName: 'clocklink', // name of the link that is used to toggle 14 14 admin_media_prefix: '', 15 15 init: function() { 16 // Deduce admin_media_prefix by looking at the <script>s in the 16 // admin_media_prefix should have been set as a global variable in the 17 // template, but if not deduce it by looking at the <script>s in the 17 18 // current document and finding the URL of *this* module. 18 var scripts = document.getElementsByTagName('script'); 19 for (var i=0; i<scripts.length; i++) { 20 if (scripts[i].src.match(/DateTimeShortcuts/)) { 21 var idx = scripts[i].src.indexOf('js/admin/DateTimeShortcuts'); 22 DateTimeShortcuts.admin_media_prefix = scripts[i].src.substring(0, idx); 23 break; 19 if (window.admin_media_prefix == undefined) { 20 var scripts = document.getElementsByTagName('script'); 21 for (var i=0; i<scripts.length; i++) { 22 if (scripts[i].src.match(/DateTimeShortcuts/)) { 23 var idx = scripts[i].src.indexOf('js/admin/DateTimeShortcuts'); 24 DateTimeShortcuts.admin_media_prefix = scripts[i].src.substring(0, idx); 25 break; 26 } 24 27 } 28 } 29 else { 30 DateTimeShortcuts.admin_media_prefix = window.admin_media_prefix; 25 31 } 26 32 27 33 var inputs = document.getElementsByTagName('input'); -
django/contrib/admin/templates/admin/change_form.html
2 2 {% load i18n admin_modify adminmedia %} 3 3 4 4 {% block extrahead %}{{ block.super }} 5 <script type="text/javascript">var admin_media_prefix = "{{ admin_media_prefix }}"</script> 5 6 <script type="text/javascript" src="../../../jsi18n/"></script> 6 7 {{ media }} 7 8 {% endblock %}