Monotone-Parent: d31a045aea36312935ee1173ab031b085b099751
Monotone-Revision: 6cfba12fb94b5901b149e029c710bdc53dd3d3f1 Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2007-05-09T21:27:55 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
parent
9ade9e87a8
commit
634e3429eb
|
@ -1,3 +1,51 @@
|
||||||
|
if (navigator.vendor == "Apple Computer, Inc." || navigator.vendor == "KDE") { // WebCore/KHTML
|
||||||
|
/*
|
||||||
|
Crossbrowser HTMLElement Prototyping
|
||||||
|
Copyright (C) 2005 Jason Davis, http://www.browserland.org
|
||||||
|
Additional thanks to Brothercake, http://www.brothercake.com
|
||||||
|
|
||||||
|
This code is licensed under the LGPL:
|
||||||
|
http://www.gnu.org/licenses/lgpl.html
|
||||||
|
*/
|
||||||
|
|
||||||
|
(function(c) {
|
||||||
|
for (var i in c)
|
||||||
|
window["HTML" + i + "Element"] = document.createElement(c[ i ]).constructor;
|
||||||
|
})({
|
||||||
|
Html: "html", Head: "head", Link: "link", Title: "title", Meta: "meta",
|
||||||
|
Base: "base", IsIndex: "isindex", Style: "style", Body: "body", Form: "form",
|
||||||
|
Select: "select", OptGroup: "optgroup", Option: "option", Input: "input",
|
||||||
|
TextArea: "textarea", Button: "button", Label: "label", FieldSet: "fieldset",
|
||||||
|
Legend: "legend", UList: "ul", OList: "ol", DList: "dl", Directory: "dir",
|
||||||
|
Menu: "menu", LI: "li", Div: "div", Paragraph: "p", Heading: "h1", Quote: "q",
|
||||||
|
Pre: "pre", BR: "br", BaseFont: "basefont", Font: "font", HR: "hr", Mod: "ins",
|
||||||
|
Anchor: "a", Image: "img", Object: "object", Param: "param", Applet: "applet",
|
||||||
|
Map: "map", Area: "area", Script: "script", Table: "table", TableCaption: "caption",
|
||||||
|
TableCol: "col", TableSection: "tbody", TableRow: "tr", TableCell: "td",
|
||||||
|
FrameSet: "frameset", Frame: "frame", IFrame: "iframe"
|
||||||
|
});
|
||||||
|
|
||||||
|
function HTMLElement() {}
|
||||||
|
//HTMLElement.prototype = HTMLHtmlElement.__proto__.__proto__;
|
||||||
|
var HTMLDocument = document.constructor;
|
||||||
|
var HTMLCollection = document.links.constructor;
|
||||||
|
var HTMLOptionsCollection = document.createElement("select").options.constructor;
|
||||||
|
var Text = document.createTextNode("").constructor;
|
||||||
|
//var Node = Text;
|
||||||
|
|
||||||
|
// More efficient for Safari 2
|
||||||
|
function Document() {}
|
||||||
|
function Event() {}
|
||||||
|
function HTMLCollection() {}
|
||||||
|
function HTMLElement() {}
|
||||||
|
function Node() {}
|
||||||
|
Document.prototype = window["[[DOMDocument]]"];
|
||||||
|
Event.prototype = window["[[DOMEvent]]"];
|
||||||
|
HTMLCollection.prototype = window["[[HTMLCollection.prototype]]"];
|
||||||
|
HTMLElement.prototype = window["[[DOMElement.prototype]]"];
|
||||||
|
Node.prototype = window["[[DOMNode.prototype]]"];
|
||||||
|
}
|
||||||
|
|
||||||
/* custom extensions to the DOM api */
|
/* custom extensions to the DOM api */
|
||||||
HTMLElement.prototype.addInterface = function(objectInterface) {
|
HTMLElement.prototype.addInterface = function(objectInterface) {
|
||||||
Object.extend(this, objectInterface);
|
Object.extend(this, objectInterface);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
HTMLInputElement.prototype._replicate = function() {
|
HTMLInputElement.prototype._replicate = function() {
|
||||||
if (this.replica) {
|
if (this.replica) {
|
||||||
this.replica.value = this.value;
|
this.replica.value = this.value;
|
||||||
var onReplicaChangeEvent = document.createEvent("Event");
|
var onReplicaChangeEvent = document.createEvent("UIEvents");
|
||||||
onReplicaChangeEvent.initEvent("change", true, true);
|
onReplicaChangeEvent.initEvent("change", true, true);
|
||||||
this.replica.dispatchEvent(onReplicaChangeEvent);
|
this.replica.dispatchEvent(onReplicaChangeEvent);
|
||||||
}
|
}
|
||||||
|
@ -56,7 +56,7 @@ HTMLInputElement.prototype.valueAsShortDateString = function() {
|
||||||
HTMLSelectElement.prototype._replicate = function() {
|
HTMLSelectElement.prototype._replicate = function() {
|
||||||
if (this.replica) {
|
if (this.replica) {
|
||||||
this.replica.value = this.value;
|
this.replica.value = this.value;
|
||||||
var onReplicaChangeEvent = document.createEvent("Event");
|
var onReplicaChangeEvent = document.createEvent("UIEvents");
|
||||||
onReplicaChangeEvent.initEvent("change", true, true);
|
onReplicaChangeEvent.initEvent("change", true, true);
|
||||||
this.replica.dispatchEvent(onReplicaChangeEvent);
|
this.replica.dispatchEvent(onReplicaChangeEvent);
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,7 @@ var SOGoDragHandlesInterface = {
|
||||||
lowerBlock: null,
|
lowerBlock: null,
|
||||||
bind: function () {
|
bind: function () {
|
||||||
this.addEventListener("mousedown", this.startHandleDragging, false);
|
this.addEventListener("mousedown", this.startHandleDragging, false);
|
||||||
|
this.onmousedown = function() { return false }
|
||||||
},
|
},
|
||||||
_determineType: function () {
|
_determineType: function () {
|
||||||
if (this.leftBlock && this.rightBlock)
|
if (this.leftBlock && this.rightBlock)
|
||||||
|
@ -23,7 +24,14 @@ var SOGoDragHandlesInterface = {
|
||||||
startHandleDragging: function (event) {
|
startHandleDragging: function (event) {
|
||||||
if (!this.dhType)
|
if (!this.dhType)
|
||||||
this._determineType();
|
this._determineType();
|
||||||
if (event.button == 0) {
|
var targ;
|
||||||
|
if (!event)
|
||||||
|
var event = window.event;
|
||||||
|
if (event.target)
|
||||||
|
targ = event.target
|
||||||
|
else if (event.srcElement)
|
||||||
|
targ = event.srcElement
|
||||||
|
if (targ.nodeType == 1) {
|
||||||
if (this.dhType == 'horizontal') {
|
if (this.dhType == 'horizontal') {
|
||||||
this.origX = this.offsetLeft;
|
this.origX = this.offsetLeft;
|
||||||
this.origLeft = this.leftBlock.offsetWidth;
|
this.origLeft = this.leftBlock.offsetWidth;
|
||||||
|
@ -38,8 +46,13 @@ var SOGoDragHandlesInterface = {
|
||||||
document.body.style.cursor = "n-resize";
|
document.body.style.cursor = "n-resize";
|
||||||
}
|
}
|
||||||
document._currentDragHandle = this;
|
document._currentDragHandle = this;
|
||||||
|
if (document.addEventListener) {
|
||||||
document.addEventListener("mouseup", this.documentStopHandleDragging, true);
|
document.addEventListener("mouseup", this.documentStopHandleDragging, true);
|
||||||
document.addEventListener("mousemove", this.documentMove, true);
|
document.addEventListener("mousemove", this.documentMove, true);
|
||||||
|
} else if (window.addEventListener) {
|
||||||
|
window.addEventListener("mouseup", this.documentStopHandleDragging, true);
|
||||||
|
window.addEventListener("mousemove", this.documentMove, true);
|
||||||
|
}
|
||||||
this.move(event);
|
this.move(event);
|
||||||
event.cancelBubble = true;
|
event.cancelBubble = true;
|
||||||
}
|
}
|
||||||
|
@ -52,6 +65,7 @@ var SOGoDragHandlesInterface = {
|
||||||
},
|
},
|
||||||
documentMove: function (event) {
|
documentMove: function (event) {
|
||||||
var handle = document._currentDragHandle;
|
var handle = document._currentDragHandle;
|
||||||
|
if (!handle) return false;
|
||||||
return handle.move(event);
|
return handle.move(event);
|
||||||
},
|
},
|
||||||
stopHandleDragging: function (event) {
|
stopHandleDragging: function (event) {
|
||||||
|
@ -60,17 +74,22 @@ var SOGoDragHandlesInterface = {
|
||||||
if (this.dhType == 'horizontal') {
|
if (this.dhType == 'horizontal') {
|
||||||
var deltaX
|
var deltaX
|
||||||
= Math.floor(event.clientX - this.origX - (this.offsetWidth / 2));
|
= Math.floor(event.clientX - this.origX - (this.offsetWidth / 2));
|
||||||
this.rightBlock.style.left = (this.origRight + deltaX) + 'px;';
|
this.rightBlock.style.left = (this.origRight + deltaX) + 'px';
|
||||||
this.leftBlock.style.width = (this.origLeft + deltaX) + 'px;';
|
this.leftBlock.style.width = (this.origLeft + deltaX) + 'px';
|
||||||
} else if (this.dhType == 'vertical') {
|
} else if (this.dhType == 'vertical') {
|
||||||
var deltaY
|
var deltaY
|
||||||
= Math.floor(event.clientY - this.origY - (this.offsetHeight / 2));
|
= Math.floor(event.clientY - this.origY - (this.offsetHeight / 2));
|
||||||
this.lowerBlock.style.top = (this.origLower + deltaY - delta) + 'px;';
|
this.lowerBlock.style.top = (this.origLower + deltaY - delta) + 'px';
|
||||||
this.upperBlock.style.height = (this.origUpper + deltaY - delta) + 'px;';
|
this.upperBlock.style.height = (this.origUpper + deltaY - delta) + 'px';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (window.addEventListener) {
|
||||||
|
window.removeEventListener("mouseup", this.documentStopHandleDragging, true);
|
||||||
|
window.removeEventListener("mousemove", this.documentMove, true);
|
||||||
|
} else if (document.addEventListener) {
|
||||||
document.removeEventListener("mouseup", this.documentStopHandleDragging, true);
|
document.removeEventListener("mouseup", this.documentStopHandleDragging, true);
|
||||||
document.removeEventListener("mousemove", this.documentMove, true);
|
document.removeEventListener("mousemove", this.documentMove, true);
|
||||||
|
}
|
||||||
document.body.setAttribute('style', '');
|
document.body.setAttribute('style', '');
|
||||||
|
|
||||||
this.move(event);
|
this.move(event);
|
||||||
|
@ -87,7 +106,7 @@ var SOGoDragHandlesInterface = {
|
||||||
var hX = event.clientX;
|
var hX = event.clientX;
|
||||||
if (hX > -1) {
|
if (hX > -1) {
|
||||||
var newLeft = Math.floor(hX - (width / 2));
|
var newLeft = Math.floor(hX - (width / 2));
|
||||||
this.style.left = newLeft + 'px;';
|
this.style.left = newLeft + 'px';
|
||||||
event.cancelBubble = true;
|
event.cancelBubble = true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@ -97,7 +116,7 @@ var SOGoDragHandlesInterface = {
|
||||||
var hY = event.clientY;
|
var hY = event.clientY;
|
||||||
if (hY > -1) {
|
if (hY > -1) {
|
||||||
var newTop = Math.floor(hY - (height / 2)) - delta;
|
var newTop = Math.floor(hY - (height / 2)) - delta;
|
||||||
this.style.top = newTop + 'px;';
|
this.style.top = newTop + 'px';
|
||||||
event.cancelBubble = true;
|
event.cancelBubble = true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@ -113,9 +132,9 @@ var SOGoDragHandlesInterface = {
|
||||||
if (this.offsetLeft > lLeft) {
|
if (this.offsetLeft > lLeft) {
|
||||||
var leftdelta = this.rightBlock.offsetLeft - this.offsetLeft;
|
var leftdelta = this.rightBlock.offsetLeft - this.offsetLeft;
|
||||||
|
|
||||||
this.style.left = lLeft + 'px;';
|
this.style.left = lLeft + 'px';
|
||||||
this.leftBlock.style.width = '0px';
|
this.leftBlock.style.width = '0px';
|
||||||
this.rightBlock.style.left = (lLeft + leftdelta) + 'px;';
|
this.rightBlock.style.left = (lLeft + leftdelta) + 'px';
|
||||||
}
|
}
|
||||||
} else if (this.dhType == 'vertical') {
|
} else if (this.dhType == 'vertical') {
|
||||||
var uTop = this.upperBlock.offsetTop;
|
var uTop = this.upperBlock.offsetTop;
|
||||||
|
@ -123,9 +142,9 @@ var SOGoDragHandlesInterface = {
|
||||||
if (this.offsetTop > uTop) {
|
if (this.offsetTop > uTop) {
|
||||||
var topdelta = this.lowerBlock.offsetTop - this.offsetTop;
|
var topdelta = this.lowerBlock.offsetTop - this.offsetTop;
|
||||||
|
|
||||||
this.style.top = uTop + 'px;';
|
this.style.top = uTop + 'px';
|
||||||
this.upperBlock.style.width = '0px';
|
this.upperBlock.style.width = '0px';
|
||||||
this.lowerBlock.style.top = (uTop + topdelta) + 'px;';
|
this.lowerBlock.style.top = (uTop + topdelta) + 'px';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -239,13 +239,11 @@ A.toolbarButton
|
||||||
|
|
||||||
SPAN.toolbarButton, SPAN.disabledToolbarButton
|
SPAN.toolbarButton, SPAN.disabledToolbarButton
|
||||||
{ cursor: default;
|
{ cursor: default;
|
||||||
display: block;
|
display: inline;
|
||||||
float: left;
|
float: left;
|
||||||
height: 80%;
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
-moz-box-align: center;
|
-moz-box-align: center;
|
||||||
-moz-box-pack: center;
|
-moz-box-pack: center;
|
||||||
margin: 0px;
|
|
||||||
border-left: 1px solid transparent;
|
border-left: 1px solid transparent;
|
||||||
border-top: 1px solid transparent;
|
border-top: 1px solid transparent;
|
||||||
border-right: 1px solid transparent;
|
border-right: 1px solid transparent;
|
||||||
|
@ -278,8 +276,7 @@ SPAN.toolbarButton:active
|
||||||
margin: auto; }
|
margin: auto; }
|
||||||
|
|
||||||
.toolbarButton .buttonLabel
|
.toolbarButton .buttonLabel
|
||||||
{ width: 100%;
|
{ margin: auto; }
|
||||||
margin: auto; }
|
|
||||||
|
|
||||||
/* popups */
|
/* popups */
|
||||||
.menu
|
.menu
|
||||||
|
|
|
@ -411,7 +411,7 @@ function onRowClick(event) {
|
||||||
var parentNode = node.parentNode;
|
var parentNode = node.parentNode;
|
||||||
if (parentNode instanceof HTMLTableSectionElement)
|
if (parentNode instanceof HTMLTableSectionElement)
|
||||||
parentNode = parentNode.parentNode;
|
parentNode = parentNode.parentNode;
|
||||||
var onSelectionChangeEvent = document.createEvent("Event");
|
var onSelectionChangeEvent = document.createEvent("UIEvents");
|
||||||
onSelectionChangeEvent.initEvent("selectionchange", true, true);
|
onSelectionChangeEvent.initEvent("selectionchange", true, true);
|
||||||
parentNode.dispatchEvent(onSelectionChangeEvent);
|
parentNode.dispatchEvent(onSelectionChangeEvent);
|
||||||
}
|
}
|
||||||
|
@ -509,7 +509,7 @@ function hideMenu(event, menuNode) {
|
||||||
menuNode.parentMenu = null;
|
menuNode.parentMenu = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
var onhideEvent = document.createEvent("Event");
|
var onhideEvent = document.createEvent("UIEvents");
|
||||||
onhideEvent.initEvent("hideMenu", false, true);
|
onhideEvent.initEvent("hideMenu", false, true);
|
||||||
menuNode.dispatchEvent(onhideEvent);
|
menuNode.dispatchEvent(onhideEvent);
|
||||||
}
|
}
|
||||||
|
@ -893,18 +893,18 @@ function initTabs() {
|
||||||
for (var i = 0; i < nodes.length; i++) {
|
for (var i = 0; i < nodes.length; i++) {
|
||||||
if (nodes[i] instanceof HTMLLIElement) {
|
if (nodes[i] instanceof HTMLLIElement) {
|
||||||
if (!firstTab) {
|
if (!firstTab) {
|
||||||
firstTab = nodes[i];
|
firstTab = i;
|
||||||
}
|
}
|
||||||
nodes[i].addEventListener("mousedown", onTabMouseDown, true);
|
nodes[i].addEventListener("mousedown", onTabMouseDown, true);
|
||||||
nodes[i].addEventListener("click", onTabClick, true);
|
nodes[i].addEventListener("click", onTabClick, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
firstTab.addClassName("first");
|
nodes[firstTab].addClassName("first");
|
||||||
firstTab.addClassName("active");
|
nodes[firstTab].addClassName("active");
|
||||||
container.activeTab = firstTab;
|
container.activeTab = nodes[firstTab];
|
||||||
|
|
||||||
var target = $(firstTab.getAttribute("target"));
|
var target = $(nodes[firstTab].getAttribute("target"));
|
||||||
target.addClassName("active");
|
target.addClassName("active");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1065,8 +1065,7 @@ function indexColor(number) {
|
||||||
return color;
|
return color;
|
||||||
}
|
}
|
||||||
|
|
||||||
var onLoadHandler = {
|
var onLoadHandler = function (event) {
|
||||||
handleEvent: function (event) {
|
|
||||||
queryParameters = parseQueryParameters('' + window.location);
|
queryParameters = parseQueryParameters('' + window.location);
|
||||||
if (!document.body.hasClassName("popup")) {
|
if (!document.body.hasClassName("popup")) {
|
||||||
initLogConsole();
|
initLogConsole();
|
||||||
|
@ -1081,7 +1080,6 @@ var onLoadHandler = {
|
||||||
if (progressImage)
|
if (progressImage)
|
||||||
progressImage.parentNode.removeChild(progressImage);
|
progressImage.parentNode.removeChild(progressImage);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
function configureSortableTableHeaders() {
|
function configureSortableTableHeaders() {
|
||||||
var headers = document.getElementsByClassName("sortableTableHeader");
|
var headers = document.getElementsByClassName("sortableTableHeader");
|
||||||
|
@ -1114,7 +1112,11 @@ function configureLinkBanner() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
window.addEventListener("load", onLoadHandler, false);
|
if (window.addEventListener) {
|
||||||
|
window.addEventListener('load', onLoadHandler, false);
|
||||||
|
} else if (document.addEventListener) {
|
||||||
|
document.addEventListener('load', onLoadHandler, false);
|
||||||
|
}
|
||||||
|
|
||||||
/* stubs */
|
/* stubs */
|
||||||
function configureDragHandles() {
|
function configureDragHandles() {
|
||||||
|
|
Loading…
Reference in a new issue