Skip to content

Commit

Permalink
Update Prototype JS to version 1.7.1
Browse files Browse the repository at this point in the history
.. and fixed namespace conflict in dtree.js (Node => dtreeNode)
  • Loading branch information
cgx committed Nov 13, 2012
1 parent 33bd07a commit 8c96f71
Show file tree
Hide file tree
Showing 7 changed files with 2,555 additions and 1,601 deletions.
8 changes: 4 additions & 4 deletions UI/WebServerResources/AdministrationUI.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion UI/WebServerResources/HTMLElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
3 changes: 1 addition & 2 deletions UI/WebServerResources/MailerUI.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;';
}
Expand Down Expand Up @@ -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) {
Expand Down
15 changes: 8 additions & 7 deletions UI/WebServerResources/SOGoResizableTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions UI/WebServerResources/UIxContactsUserFolders.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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));
}
Expand Down
8 changes: 4 additions & 4 deletions UI/WebServerResources/dtree.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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);
},
Expand Down

0 comments on commit 8c96f71

Please sign in to comment.