Changeset 2451
- Timestamp:
- 02/28/06 21:21:51 (3 years ago)
- Files:
-
- django/branches/magic-removal/django/contrib/admin/media/js/admin/RelatedObjectLookups.js (modified) (2 diffs)
- django/branches/magic-removal/django/contrib/admin/media/js/calendar.js (modified) (3 diffs)
- django/branches/magic-removal/django/contrib/admin/media/js/core.js (modified) (3 diffs)
- django/branches/magic-removal/django/contrib/admin/media/js/dateparse.js (modified) (1 diff)
- django/branches/magic-removal/django/db/backends/mysql/base.py (modified) (1 diff)
- django/branches/magic-removal/django/views/debug.py (modified) (3 diffs)
- django/branches/magic-removal/ez_setup.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/branches/magic-removal/django/contrib/admin/media/js/admin/RelatedObjectLookups.js
r2421 r2451 4 4 function showRelatedObjectLookupPopup(triggeringLink) { 5 5 var name = triggeringLink.id.replace(/^lookup_/, ''); 6 var href 6 var href; 7 7 if (triggeringLink.href.search(/\?/) >= 0) { 8 8 href = triggeringLink.href + '&pop=1'; 9 9 } else { 10 href = triggeringLink.href + '?pop=1' 10 href = triggeringLink.href + '?pop=1'; 11 11 } 12 12 var win = window.open(href, name, 'height=500,width=740,resizable=yes,scrollbars=yes'); … … 34 34 35 35 function dismissAddAnotherPopup(win, newId, newRepr) { 36 var name = win.name.replace(/___/g, '.') 36 var name = win.name.replace(/___/g, '.'); 37 37 var elem = document.getElementById(name); 38 38 if (elem) { 39 39 if (elem.nodeName == 'SELECT') { 40 40 var o = new Option(newRepr, newId); 41 elem.options[elem.options.length] = o 41 elem.options[elem.options.length] = o; 42 42 elem.selectedIndex = elem.length - 1; 43 43 } else if (elem.nodeName == 'INPUT') { django/branches/magic-removal/django/contrib/admin/media/js/calendar.js
r1539 r2451 103 103 this.currentMonth = this.today.getMonth() + 1; 104 104 this.currentYear = this.today.getFullYear(); 105 this.drawCurrent = function() { 105 } 106 Calendar.prototype = { 107 drawCurrent: function() { 106 108 CalendarNamespace.draw(this.currentMonth, this.currentYear, this.div_id, this.callback); 107 } 108 this.drawDate =function(month, year) {109 }, 110 drawDate: function(month, year) { 109 111 this.currentMonth = month; 110 112 this.currentYear = year; 111 113 this.drawCurrent(); 112 } 113 this.drawPreviousMonth =function() {114 }, 115 drawPreviousMonth: function() { 114 116 if (this.currentMonth == 1) { 115 117 this.currentMonth = 12; … … 120 122 } 121 123 this.drawCurrent(); 122 } 123 this.drawNextMonth =function() {124 }, 125 drawNextMonth: function() { 124 126 if (this.currentMonth == 12) { 125 127 this.currentMonth = 1; … … 130 132 } 131 133 this.drawCurrent(); 132 } 133 this.drawPreviousYear =function() {134 }, 135 drawPreviousYear: function() { 134 136 this.currentYear--; 135 137 this.drawCurrent(); 136 } 137 this.drawNextYear =function() {138 }, 139 drawNextYear: function() { 138 140 this.currentYear++; 139 141 this.drawCurrent(); django/branches/magic-removal/django/contrib/admin/media/js/core.js
r453 r2451 71 71 if (obj.offsetParent) { 72 72 while (obj.offsetParent) { 73 curleft += obj.offsetLeft 73 curleft += obj.offsetLeft; 74 74 obj = obj.offsetParent; 75 75 } … … 84 84 if (obj.offsetParent) { 85 85 while (obj.offsetParent) { 86 curtop += obj.offsetTop 86 curtop += obj.offsetTop; 87 87 obj = obj.offsetParent; 88 88 } … … 131 131 // ---------------------------------------------------------------------------- 132 132 String.prototype.pad_left = function(pad_length, pad_string) { 133 new_string = this;133 var new_string = this; 134 134 for (var i = 0; new_string.length < pad_length; i++) { 135 135 new_string = pad_string + new_string; django/branches/magic-removal/django/contrib/admin/media/js/dateparse.js
r1559 r2451 5 5 6 6 /* Finds the index of the first occurence of item in the array, or -1 if not found */ 7 Array.prototype.indexOf = function(item) { 8 for (var i = 0; i < this.length; i++) { 9 if (this[i] == item) { 10 return i; 11 } 12 } 13 return -1; 14 }; 7 if (typeof Array.prototype.indexOf == 'undefined') { 8 Array.prototype.indexOf = function(item) { 9 var len = this.length; 10 for (var i = 0; i < len; i++) { 11 if (this[i] == item) { 12 return i; 13 } 14 } 15 return -1; 16 }; 17 } 15 18 /* Returns an array of items judged 'true' by the passed in test function */ 16 Array.prototype.filter = function(test) { 17 var matches = []; 18 for (var i = 0; i < this.length; i++) { 19 if (test(this[i])) { 20 matches[matches.length] = this[i]; 21 } 22 } 23 return matches; 24 }; 19 if (typeof Array.prototype.filter == 'undefined') { 20 Array.prototype.filter = function(test) { 21 var matches = []; 22 var len = this.length; 23 for (var i = 0; i < len; i++) { 24 if (test(this[i])) { 25 matches[matches.length] = this[i]; 26 } 27 } 28 return matches; 29 }; 30 } 25 31 26 32 var monthNames = gettext("January February March April May June July August September October November December").split(" "); django/branches/magic-removal/django/db/backends/mysql/base.py
r2422 r2451 112 112 # MySQL doesn't support DATE_TRUNC, so we fake it by subtracting intervals. 113 113 # If you know of a better way to do this, please file a Django ticket. 114 # Note that we can't use DATE_FORMAT directly because that causes the output 115 # to be a string rather than a datetime object, and we need MySQL to return 116 # a date so that it's typecasted properly into a Python datetime object. 114 117 subtractions = ["interval (DATE_FORMAT(%s, '%%%%s')) second - interval (DATE_FORMAT(%s, '%%%%i')) minute - interval (DATE_FORMAT(%s, '%%%%H')) hour" % (field_name, field_name, field_name)] 115 118 if lookup_type in ('year', 'month'): django/branches/magic-removal/django/views/debug.py
r2421 r2451 256 256 hideAll(getElementsByClassName(document, 'ol', 'pre-context')); 257 257 hideAll(getElementsByClassName(document, 'ol', 'post-context')); 258 hideAll(getElementsByClassName(document, 'div', 'pastebin')); 258 259 } 259 260 function toggle() { … … 272 273 var darr = String.fromCharCode(0x25bc); 273 274 s.innerHTML = s.innerHTML == uarr ? darr : uarr; 275 return false; 276 } 277 function switchPastebinFriendly(link) { 278 s1 = "Switch to copy-and-paste view"; 279 s2 = "Switch back to interactive view"; 280 link.innerHTML = link.innerHTML == s1 ? s2 : s1; 281 toggle('browserTraceback', 'pastebinTraceback'); 274 282 return false; 275 283 } … … 342 350 <div id="traceback"> 343 351 <h2>Traceback <span>(innermost last)</span></h2> 344 <ul class="traceback"> 345 {% for frame in frames %} 346 <li class="frame"> 347 <code>{{ frame.filename }}</code> in <code>{{ frame.function }}</code> 348 349 {% if frame.context_line %} 350 <div class="context" id="c{{ frame.id }}"> 351 {% if frame.pre_context %} 352 <ol start="{{ frame.pre_context_lineno|add:"1" }}" class="pre-context" id="pre{{ frame.id }}">{% for line in frame.pre_context %}<li onclick="toggle('pre{{ frame.id }}', 'post{{ frame.id }}')">{{ line|escape }}</li>{% endfor %}</ol> 353 {% endif %} 354 <ol start="{{ frame.lineno|add:"1" }}" class="context-line"><li onclick="toggle('pre{{ frame.id }}', 'post{{ frame.id }}')">{{ frame.context_line|escape }} <span>...</span></li></ol> 355 {% if frame.post_context %} 356 <ol start='{{ frame.lineno|add:"2" }}' class="post-context" id="post{{ frame.id }}">{% for line in frame.post_context %}<li onclick="toggle('pre{{ frame.id }}', 'post{{ frame.id }}')">{{ line|escape }}</li>{% endfor %}</ol> 357 {% endif %} 358 </div> 359 {% endif %} 360 361 {% if frame.vars %} 362 <div class="commands"> 363 <a href="#" onclick="return varToggle(this, '{{ frame.id }}')"><span>▶</span> Local vars</a> 364 </div> 365 <table class="vars" id="v{{ frame.id }}"> 366 <thead> 367 <tr> 368 <th>Variable</th> 369 <th>Value</th> 370 </tr> 371 </thead> 372 <tbody> 373 {% for var in frame.vars|dictsort:"0" %} 352 <div class="commands"><a href="#" onclick="return switchPastebinFriendly(this);">Switch to copy-and-paste view</a></div> 353 <br/> 354 <div id="browserTraceback"> 355 <ul class="traceback"> 356 {% for frame in frames %} 357 <li class="frame"> 358 <code>{{ frame.filename }}</code> in <code>{{ frame.function }}</code> 359 360 {% if frame.context_line %} 361 <div class="context" id="c{{ frame.id }}"> 362 {% if frame.pre_context %} 363 <ol start="{{ frame.pre_context_lineno|add:"1" }}" class="pre-context" id="pre{{ frame.id }}">{% for line in frame.pre_context %}<li onclick="toggle('pre{{ frame.id }}', 'post{{ frame.id }}')">{{ line|escape }}</li>{% endfor %}</ol> 364 {% endif %} 365 <ol start="{{ frame.lineno|add:"1" }}" class="context-line"><li onclick="toggle('pre{{ frame.id }}', 'post{{ frame.id }}')">{{ frame.context_line|escape }} <span>...</span></li></ol> 366 {% if frame.post_context %} 367 <ol start='{{ frame.lineno|add:"2" }}' class="post-context" id="post{{ frame.id }}">{% for line in frame.post_context %}<li onclick="toggle('pre{{ frame.id }}', 'post{{ frame.id }}')">{{ line|escape }}</li>{% endfor %}</ol> 368 {% endif %} 369 </div> 370 {% endif %} 371 372 {% if frame.vars %} 373 <div class="commands"> 374 <a href="#" onclick="return varToggle(this, '{{ frame.id }}')"><span>▶</span> Local vars</a> 375 </div> 376 <table class="vars" id="v{{ frame.id }}"> 377 <thead> 374 378 <tr> 375 <t d>{{ var.0 }}</td>376 <t d class="code"><div>{{ var.1|pprint|escape }}</div></td>379 <th>Variable</th> 380 <th>Value</th> 377 381 </tr> 378 {% endfor %} 379 </tbody> 380 </table> 381 {% endif %} 382 </li> 383 {% endfor %} 384 </ul> 382 </thead> 383 <tbody> 384 {% for var in frame.vars|dictsort:"0" %} 385 <tr> 386 <td>{{ var.0 }}</td> 387 <td class="code"><div>{{ var.1|pprint|escape }}</div></td> 388 </tr> 389 {% endfor %} 390 </tbody> 391 </table> 392 {% endif %} 393 </li> 394 {% endfor %} 395 </ul> 396 </div> 397 <div id="pastebinTraceback" class="pastebin"> 398 <table> 399 <tbody> 400 <tr> 401 <td> 402 <code> 403 Traceback (most recent call last):<br/> 404 {% for frame in frames %} 405 File "{{ frame.filename }}" in {{ frame.function }}<br/> 406 {% if frame.context_line %} 407 {{ frame.lineno|add:"1" }}. {{ frame.context_line|escape }}<br/> 408 {% endif %} 409 {% endfor %}<br/> 410 {{ exception_type }} at {{ request.path }}<br/> 411 {{ exception_value|escape }}</code> 412 </td> 413 </tr> 414 </tbody> 415 </table> 416 </div> 385 417 </div> 386 418 django/branches/magic-removal/ez_setup.py
r1961 r2451 15 15 """ 16 16 import sys 17 DEFAULT_VERSION = "0.6a 9"17 DEFAULT_VERSION = "0.6a10" 18 18 DEFAULT_URL = "http://cheeseshop.python.org/packages/%s/s/setuptools/" % sys.version[:3] 19 19 … … 23 23 'setuptools-0.6a1-py2.3.egg': 'ee819a13b924d9696b0d6ca6d1c5833d', 24 24 'setuptools-0.6a1-py2.4.egg': '8256b5f1cd9e348ea6877b5ddd56257d', 25 'setuptools-0.6a10-py2.3.egg': '162d8357f1aff2b0349c6c247ee62987', 26 'setuptools-0.6a10-py2.4.egg': '803a2d8db501c1ac3b5b6fb4e907f788', 27 'setuptools-0.6a10dev_r42346-py2.3.egg': 'a7899272cfceb6aa60094ae8928b8077', 28 'setuptools-0.6a10dev_r42346-py2.4.egg': '5d42a64adca9aedb409f83ecf22156a5', 25 29 'setuptools-0.6a2-py2.3.egg': 'b98da449da411267c37a738f0ab625ba', 26 30 'setuptools-0.6a2-py2.4.egg': 'be5b88bc30aed63fdefd2683be135c3b', … … 124 128 you may need to enable firewall access for this script first. 125 129 I will start the download in %d seconds. 130 131 (Note: if this machine does not have network access, please obtain the file 132 133 %s 134 135 and place it in this directory before rerunning this script.) 126 136 ---------------------------------------------------------------------------""", 127 version, download_base, delay 137 version, download_base, delay, url 128 138 ); from time import sleep; sleep(delay) 129 139 log.warn("Downloading %s", url)
