Update Prototype JS to version 1.7.1

.. and fixed namespace conflict in dtree.js (Node => dtreeNode)
This commit is contained in:
Francis Lachapelle
2012-11-13 16:25:20 -05:00
parent 33bd07a53d
commit 8c96f717c0
7 changed files with 2653 additions and 1699 deletions

View File

@@ -160,8 +160,8 @@ function addFolderBranchToTree(tree, user, folder, nodeId, subId, isLast) {
var pos = name.lastIndexOf(' (');
if (pos > -1)
name = name.substring(0, pos); // strip the part with fullname and email
var node = new Node(subId, nodeId, name, 0, '#', folderId,
folderInfos[2] + '-folder', '', '', icon, icon);
var node = new dTreeNode(subId, nodeId, name, 0, '#', folderId,
folderInfos[2] + '-folder', '', '', icon, icon);
node._ls = isLast;
var content = tree.node(node, (nodeId + subId), null);
@@ -170,8 +170,8 @@ function addFolderBranchToTree(tree, user, folder, nodeId, subId, isLast) {
function addFolderNotFoundNode (tree, nodeId) {
var icon = ResourcesURL + '/icon_unread.gif';
var node = new Node(1, nodeId, _("No possible subscription"), 0, '#',
null, null, '', '', icon, icon);
var node = new dTreeNode(1, nodeId, _("No possible subscription"), 0, '#',
null, null, '', '', icon, icon);
node._ls = true;
return tree.node(node, (nodeId + 1), null);
}

View File

@@ -34,7 +34,7 @@ Element.addMethods({
if (node.nodeType == Node.TEXT_NODE) {
content += node.nodeValue;
}
else if (node.nodeType == Node.ELEMENT_NODE) {
else if (node.nodeType === Node.ELEMENT_NODE) {
content += Element.allTextContent(node);
}
}

View File

@@ -896,7 +896,6 @@ function messageListCallback(row, data, isNew) {
for (var j = 0; j < cells.length; j++) {
var cell = cells[j];
var cellType = Mailer.columnsOrder[j];
if (data[cellType]) cell.innerHTML = data[cellType];
else cell.innerHTML = '&nbsp;';
}
@@ -2718,7 +2717,7 @@ function onMarkMenuPrepareVisibility() {
isRead = !row.hasClassName("mailer_unreadmail");
}
var menuUL = this.childElements()[0];
var menuUL = this.down();
var menuLIS = menuUL.childElements();
if (isRead) {

View File

@@ -40,13 +40,14 @@ var SOGoResizableTableInterface = {
},
restore: function(relativeWidths) {
if (Prototype.Browser.IE)
while (SOGoResizableTable._stylesheet.styleSheet.rules.length)
SOGoResizableTable._stylesheet.styleSheet.removeRule(0);
else
while (SOGoResizableTable._stylesheet.firstChild)
SOGoResizableTable._stylesheet.removeChild(SOGoResizableTable._stylesheet.firstChild);
if (SOGoResizableTable._stylesheet != null)
if (Prototype.Browser.IE)
while (SOGoResizableTable._stylesheet.styleSheet.rules.length)
SOGoResizableTable._stylesheet.styleSheet.removeRule(0);
else
while (SOGoResizableTable._stylesheet.firstChild)
SOGoResizableTable._stylesheet.removeChild(SOGoResizableTable._stylesheet.firstChild);
if (relativeWidths)
this.ratios = relativeWidths;
var tableWidth = this.getWidth()/100;

View File

@@ -186,8 +186,8 @@ function addFolderBranchToTree(tree, user, folder, nodeId, subId, isLast) {
var pos = name.lastIndexOf(' (');
if (pos > -1)
name = name.substring(0, pos); // strip the part with fullname and email
var node = new Node(subId, nodeId, name, 0, '#', folderId,
folderInfos[2] + '-folder', '', '', icon, icon);
var node = new dTreeNode(subId, nodeId, name, 0, '#', folderId,
folderInfos[2] + '-folder', '', '', icon, icon);
node._ls = isLast;
var content = tree.node(node, (nodeId + subId), null);
@@ -196,8 +196,8 @@ function addFolderBranchToTree(tree, user, folder, nodeId, subId, isLast) {
function addFolderNotFoundNode (tree, nodeId) {
var icon = ResourcesURL + '/dot.png';
var node = new Node(1, nodeId, _("No possible subscription"), 0, '#',
null, null, '', '', icon, icon);
var node = new dTreeNode(1, nodeId, _("No possible subscription"), 0, '#',
null, null, '', '', icon, icon);
node._ls = true;
return tree.node(node, (nodeId + 1));
}

View File

@@ -20,8 +20,8 @@ function dTreeQuote(str) {
}
// Node object
function Node(id, pid, name, isParent, url, dataname, datatype, title, target,
icon, iconOpen, open) {
function dTreeNode(id, pid, name, isParent, url, dataname, datatype, title, target,
icon, iconOpen, open) {
this.isParent = isParent;
this.id = id;
this.pid = pid;
@@ -68,7 +68,7 @@ function dTree(objName) {
this.objects = {};
this.aNodes = [];
this.aIndent = [];
this.root = new Node(-1);
this.root = new dTreeNode(-1);
this.selectedNode = null;
this.selectedFound = false;
this.completed = false;
@@ -90,7 +90,7 @@ dTree.prototype = {
// Adds a new node to the node array
add: function(id, pid, name, isParent, url, datatype,
title, target, icon, iconOpen, open) {
this.aNodes[this.aNodes.length] = new Node(id, pid, name, isParent, url,
this.aNodes[this.aNodes.length] = new dTreeNode(id, pid, name, isParent, url,
datatype, title, target, icon,
iconOpen, open, false);
},

File diff suppressed because it is too large Load Diff