2007-09-15 03:08:25 +02:00
|
|
|
/**
|
|
|
|
* @author Mateusz
|
|
|
|
*/
|
|
|
|
Point = {
|
|
|
|
initialize: function(x,y) {
|
|
|
|
this.x = x;
|
|
|
|
this.y = y;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
EventStack = {
|
2007-09-15 03:19:43 +02:00
|
|
|
lastEventElement: null,
|
|
|
|
getLastEventElement: function(){
|
|
|
|
return EventStack.lastEventElement;
|
2007-09-15 03:08:25 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
addEvent: function(event) {
|
2007-09-15 03:19:43 +02:00
|
|
|
EventStack.lastEventElement = Event.element(event);
|
2007-09-15 03:08:25 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
clearStack: function() {
|
2007-09-15 03:19:43 +02:00
|
|
|
this.lastEventElement = null;
|
2007-09-15 03:08:25 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Positioning = {
|
|
|
|
addBehaviour: function(element) {
|
|
|
|
this.element = element;
|
|
|
|
this.element.getTop = Positioning.getTop.bind(this);
|
|
|
|
this.element.getLeft = Positioning.getLeft.bind(this);
|
|
|
|
this.element.getWidth = Positioning.getWidth.bind(this);
|
|
|
|
this.element.getHeight = Positioning.getHeight.bind(this);
|
|
|
|
this.element.getParentLeft = Positioning.getParentLeft.bind(this);
|
|
|
|
this.element.getParentTop = Positioning.getParentTop.bind(this);
|
|
|
|
this.element.getParentHeight = Positioning.getParentHeight.bind(this);
|
|
|
|
this.element.getParentWidth = Positioning.getParentWidth.bind(this);
|
2007-09-15 22:53:26 +02:00
|
|
|
return this.element;
|
2007-09-15 03:08:25 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
getTop: function() {
|
|
|
|
return Position.positionedOffset(this.element)[1];
|
|
|
|
},
|
|
|
|
|
|
|
|
getLeft: function() {
|
2007-09-16 03:30:43 +02:00
|
|
|
return parseInt(this.element.style.left);
|
2007-09-15 03:08:25 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
getWidth: function() {
|
|
|
|
return Element.getDimensions(this.element).width;
|
|
|
|
},
|
|
|
|
|
|
|
|
getHeight: function() {
|
|
|
|
return Element.getDimensions(this.element).height;
|
|
|
|
},
|
|
|
|
|
|
|
|
getParentLeft: function() {
|
|
|
|
parentLeft = Position.cumulativeOffset(Position.offsetParent(this.element))[0];
|
|
|
|
return parentLeft;
|
|
|
|
},
|
|
|
|
|
|
|
|
getParentTop: function() {
|
|
|
|
parentTop = Position.cumulativeOffset(Position.offsetParent(this.element))[1];
|
|
|
|
return parentTop;
|
|
|
|
},
|
|
|
|
|
|
|
|
getParentHeight: function() {
|
|
|
|
return Element.getDimensions(Position.offsetParent(this.element)).height;
|
|
|
|
},
|
|
|
|
|
|
|
|
getParentWidth: function() {
|
|
|
|
return Element.getDimensions(Position.offsetParent(this.element)).width
|
|
|
|
}
|
2007-09-15 03:19:43 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
Random = {
|
|
|
|
string: function(length) {
|
|
|
|
chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
|
|
string = "";
|
|
|
|
for(x=0;x<length;x++) {
|
|
|
|
i = Math.floor(Math.random() * 57);
|
|
|
|
string += chars.charAt(i);
|
|
|
|
}
|
|
|
|
return string;
|
|
|
|
}
|
|
|
|
}
|