Removed unnecessary code from admin_media/js/admin/add_calendars.js

git-svn-id: http://code.djangoproject.com/svn/django/trunk@448 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2005-08-10 00:37:56 +00:00
parent 991832d0c4
commit e2426e68e6
1 changed files with 36 additions and 99 deletions

View File

@ -1,52 +1,5 @@
// Finds all <input type="text" class="vDateField"> and inserts a calendar after them // Finds all <input type="text" class="vDateField"> and inserts a calendar after them
// quickElement(tagType, parentReference, textInChildNode, [, attribute, attributeValue ...]);
function quickElement() {
var obj = document.createElement(arguments[0]);
if (arguments[2] != '' && arguments[2] != null) {
var textNode = document.createTextNode(arguments[2]);
obj.appendChild(textNode);
}
for (var i = 3; i < arguments.length; i += 2) {
obj.setAttribute(arguments[i], arguments[i+1]);
}
arguments[1].appendChild(obj);
return obj;
}
// findPosX / findPosY: see http://www.quirksmode.org/js/findpos.html
function findPosX(obj)
{
var curleft = 0;
if (obj.offsetParent)
{
while (obj.offsetParent)
{
curleft += obj.offsetLeft
obj = obj.offsetParent;
}
}
else if (obj.x)
curleft += obj.x;
return curleft;
}
function findPosY(obj)
{
var curtop = 0;
if (obj.offsetParent)
{
while (obj.offsetParent)
{
curtop += obj.offsetTop
obj = obj.offsetParent;
}
}
else if (obj.y)
curtop += obj.y;
return curtop;
}
var AddCal = { var AddCal = {
cals: [], cals: [],
inps: [], inps: [],
@ -122,22 +75,6 @@ var AddCal = {
toggle: function(num) { toggle: function(num) {
var box = document.getElementById(AddCal.divname1+num); var box = document.getElementById(AddCal.divname1+num);
box.style.display = (box.style.display == 'none') ? 'block' : 'none'; box.style.display = (box.style.display == 'none') ? 'block' : 'none';
/*
if (box.style.display = 'block') {
var x = 0;
var y = 0;
if (!e) var e = window.event;
if (e.pageX || e.pageY) {
x = e.pageX;
y = e.pageY;
} else if (e.clientX || e.clientY) {
x = e.clientX + document.body.scrollLeft;
y = e.clientY + document.body.scrollTop;
}
box.style.left = x;
box.style.top = y;
}
*/
}, },
drawPrev: function(num) { drawPrev: function(num) {
AddCal.cals[num].drawPreviousMonth(); AddCal.cals[num].drawPreviousMonth();