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;
|
|
|
|
}
|
|
|
|
}
|
2007-09-16 04:23:10 +02:00
|
|
|
|
|
|
|
StatusMessage = {
|
|
|
|
initialize: function() {
|
|
|
|
this.statusMessage = StatusMessage.statusMessage.bind(this);
|
2007-09-16 04:25:07 +02:00
|
|
|
window.frameElement.statusMessage = window.top.statusMessage;
|
2007-09-16 04:23:10 +02:00
|
|
|
var s1 = $('statusMessage');
|
|
|
|
var s2 = window.top.document.getElementById('statusMessage');
|
|
|
|
s1.showMessage = s2.showMessage;
|
|
|
|
s1.clearMessage = s2.clearMessage;
|
|
|
|
s1.fade = s2.fade;
|
|
|
|
s1.afterFade = s2.afterFade;
|
2007-09-16 04:25:07 +02:00
|
|
|
this.statusMessageContainer = s1;
|
2007-09-16 04:23:10 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
statusMessage: function(msg, type, clearManually) {
|
2007-09-16 04:25:07 +02:00
|
|
|
window.frameElement.statusMessage(msg, type, clearManually,this.statusMessageContainer);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Event.observe(window,'load',function(e) {statusMessageWrapper = new StatusMessage.initialize();});
|