Monotone-Parent: ae56d5117f5b648163117349eff8696b1b010e47
Monotone-Revision: 763cdd65301c2ece5f7e7a480dc165fb25068f9a Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2008-11-24T04:10:38 Monotone-Branch: ca.inverse.sogomaint-2.0.2
parent
2262527408
commit
27f9ea0dcd
|
@ -58,6 +58,9 @@
|
||||||
"Add..." = "Toevoegen...";
|
"Add..." = "Toevoegen...";
|
||||||
"Remove" = "Verwijderen";
|
"Remove" = "Verwijderen";
|
||||||
|
|
||||||
|
"Please wait..." = "Please wait...";
|
||||||
|
"No possible subscription" = "No possible subscription";
|
||||||
|
|
||||||
"Preferred" = "Voorkeurs-";
|
"Preferred" = "Voorkeurs-";
|
||||||
"Card for %@" = "%@";
|
"Card for %@" = "%@";
|
||||||
"Display:" = "Weergavenaam:";
|
"Display:" = "Weergavenaam:";
|
||||||
|
|
|
@ -59,6 +59,9 @@
|
||||||
"Add..." = "Add...";
|
"Add..." = "Add...";
|
||||||
"Remove" = "Remove";
|
"Remove" = "Remove";
|
||||||
|
|
||||||
|
"Please wait..." = "Please wait...";
|
||||||
|
"No possible subscription" = "No possible subscription";
|
||||||
|
|
||||||
"Preferred" = "Preferred";
|
"Preferred" = "Preferred";
|
||||||
"Card for %@" = "Card for %@";
|
"Card for %@" = "Card for %@";
|
||||||
"Display Name: " = "Display Name: ";
|
"Display Name: " = "Display Name: ";
|
||||||
|
|
|
@ -66,6 +66,9 @@
|
||||||
"Add..." = "Ajouter...";
|
"Add..." = "Ajouter...";
|
||||||
"Remove" = "Enlever";
|
"Remove" = "Enlever";
|
||||||
|
|
||||||
|
"Please wait..." = "Veuillez patienter...";
|
||||||
|
"No possible subscription" = "Aucune inscription possible";
|
||||||
|
|
||||||
"Preferred" = "Préféré";
|
"Preferred" = "Préféré";
|
||||||
"Card for %@" = "Fiche pour %@";
|
"Card for %@" = "Fiche pour %@";
|
||||||
"Display:" = "Nom à afficher :";
|
"Display:" = "Nom à afficher :";
|
||||||
|
|
|
@ -58,6 +58,9 @@
|
||||||
"Add..." = "Hinzufügen...";
|
"Add..." = "Hinzufügen...";
|
||||||
"Remove" = "Löschen";
|
"Remove" = "Löschen";
|
||||||
|
|
||||||
|
"Please wait..." = "Please wait...";
|
||||||
|
"No possible subscription" = "No possible subscription";
|
||||||
|
|
||||||
"Preferred" = "Bevorzugt";
|
"Preferred" = "Bevorzugt";
|
||||||
"Card for %@" = "%@";
|
"Card for %@" = "%@";
|
||||||
"Display:" = "Anzeigename:";
|
"Display:" = "Anzeigename:";
|
||||||
|
|
|
@ -71,6 +71,9 @@
|
||||||
"Add..." = "Aggiungi...";
|
"Add..." = "Aggiungi...";
|
||||||
"Remove" = "Rimuovi";
|
"Remove" = "Rimuovi";
|
||||||
|
|
||||||
|
"Please wait..." = "Please wait...";
|
||||||
|
"No possible subscription" = "No possible subscription";
|
||||||
|
|
||||||
"Preferred" = "Predefinito";
|
"Preferred" = "Predefinito";
|
||||||
"Card for %@" = "Biglietto da visita di %@";
|
"Card for %@" = "Biglietto da visita di %@";
|
||||||
"Display:" = "Nome visualizzato:";
|
"Display:" = "Nome visualizzato:";
|
||||||
|
|
|
@ -69,6 +69,9 @@
|
||||||
"Add..." = "Añadir...";
|
"Add..." = "Añadir...";
|
||||||
"Remove" = "Borrar";
|
"Remove" = "Borrar";
|
||||||
|
|
||||||
|
"Please wait..." = "Please wait...";
|
||||||
|
"No possible subscription" = "No possible subscription";
|
||||||
|
|
||||||
"Preferred" = "Preferido";
|
"Preferred" = "Preferido";
|
||||||
"Card for %@" = "Contacto para %@";
|
"Card for %@" = "Contacto para %@";
|
||||||
|
|
||||||
|
|
|
@ -4,57 +4,46 @@ function onSearchFormSubmit() {
|
||||||
var searchValue = $("searchValue");
|
var searchValue = $("searchValue");
|
||||||
|
|
||||||
var url = (UserFolderURL
|
var url = (UserFolderURL
|
||||||
+ "foldersSearch?search=" + escape(searchValue.value)
|
+ "usersSearch?search=" + escape(searchValue.value));
|
||||||
+ "&type=" + window.opener.userFolderType);
|
|
||||||
if (document.userFoldersRequest) {
|
if (document.userFoldersRequest) {
|
||||||
document.userFoldersRequest.aborted = true;
|
document.userFoldersRequest.aborted = true;
|
||||||
document.userFoldersRequest.abort();
|
document.userFoldersRequest.abort();
|
||||||
}
|
}
|
||||||
document.userFoldersRequest
|
document.userFoldersRequest
|
||||||
= triggerAjaxRequest(url, userFoldersCallback);
|
= triggerAjaxRequest(url, usersSearchCallback);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function addLineToTree(tree, parent, line) {
|
function usersSearchCallback(http) {
|
||||||
var offset = 0;
|
document.userFoldersRequest = null;
|
||||||
|
var div = $("folders");
|
||||||
var nodes = line.split(";");
|
if (http.status == 200) {
|
||||||
if (window.opener.userFolderType == "user"
|
var response = http.responseText;
|
||||||
|| nodes.length > 1) {
|
buildUsersTree(div, http.responseText)
|
||||||
var parentNode = nodes[0];
|
}
|
||||||
var userInfos = parentNode.split(":");
|
else if (http.status == 404)
|
||||||
var email = userInfos[1] + " <" + userInfos[2] + ">";
|
div.update();
|
||||||
if (!userInfos[3].empty())
|
|
||||||
email += " (" + userInfos[3] + ")"; // extra contact info
|
|
||||||
tree.add(parent, 0, email, 0, '#', userInfos[0], 'person',
|
|
||||||
'', '',
|
|
||||||
ResourcesURL + '/abcard.gif',
|
|
||||||
ResourcesURL + '/abcard.gif');
|
|
||||||
for (var i = 1; i < nodes.length; i++) {
|
|
||||||
var folderInfos = nodes[i].split(":");
|
|
||||||
var icon = ResourcesURL + '/';
|
|
||||||
if (folderInfos[2] == 'Contact')
|
|
||||||
icon += 'tb-mail-addressbook-flat-16x16.png';
|
|
||||||
else
|
|
||||||
icon += 'calendar-folder-16x16.png';
|
|
||||||
var folderId = userInfos[0] + ":" + folderInfos[1];
|
|
||||||
var name = folderInfos[0]; // name has the format "Folername (Firstname Lastname <email>)"
|
|
||||||
var pos = name.lastIndexOf(' (')
|
|
||||||
if (pos != -1)
|
|
||||||
name = name.substring(0, pos); // strip the part with fullname and email
|
|
||||||
tree.add(parent + i, parent, name, 0, '#', folderId,
|
|
||||||
folderInfos[2] + '-folder', '', '', icon, icon);
|
|
||||||
}
|
|
||||||
offset = nodes.length - 1;
|
|
||||||
}
|
|
||||||
// else
|
|
||||||
// window.alert("nope:" + window.opener.userFolderType);
|
|
||||||
|
|
||||||
return offset;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function buildTree(response) {
|
function addUserLineToTree(tree, parent, line) {
|
||||||
|
var icon = ResourcesURL + '/busy.gif';
|
||||||
|
|
||||||
|
var userInfos = line.split(":");
|
||||||
|
var email = userInfos[1] + " <" + userInfos[2] + ">";
|
||||||
|
if (!userInfos[3].empty())
|
||||||
|
email += ", " + userInfos[3]; // extra contact info
|
||||||
|
tree.add(parent, 0, email, 0, '#', userInfos[0], 'person',
|
||||||
|
'', '',
|
||||||
|
ResourcesURL + '/abcard.gif',
|
||||||
|
ResourcesURL + '/abcard.gif');
|
||||||
|
if (window.opener.userFolderType != "user") {
|
||||||
|
tree.add(parent + 1, parent, labels["Please wait..."], 0, '#', null,
|
||||||
|
null, '', '', icon, icon);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function buildUsersTree(treeDiv, response) {
|
||||||
d = new dTree("d");
|
d = new dTree("d");
|
||||||
d.config.folderLlinks = true;
|
d.config.folderLlinks = true;
|
||||||
d.config.hideRoot = true;
|
d.config.hideRoot = true;
|
||||||
|
@ -74,19 +63,49 @@ function buildTree(response) {
|
||||||
d.icon.empty = ResourcesURL + '/empty.gif';
|
d.icon.empty = ResourcesURL + '/empty.gif';
|
||||||
d.add(0, -1, '');
|
d.add(0, -1, '');
|
||||||
|
|
||||||
var lines = response.split("\n");
|
var multiplier = ((window.opener.userFolderType == "user")
|
||||||
var offset = 0;
|
? 1 : 2);
|
||||||
for (var i = 0; i < lines.length; i++) {
|
|
||||||
if (lines[i].length > 0)
|
|
||||||
offset += addLineToTree(d, i + 1 + offset, lines[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
return d;
|
if (response.length) {
|
||||||
|
var lines = response.split("\n");
|
||||||
|
for (var i = 0; i < lines.length; i++) {
|
||||||
|
if (lines[i].length > 0)
|
||||||
|
addUserLineToTree(d, 1 + i * multiplier, lines[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
treeDiv.update(d);
|
||||||
|
treeDiv.clean = false;
|
||||||
|
|
||||||
|
if (window.opener.userFolderType != "user") {
|
||||||
|
for (var i = 0; i < lines.length - 1; i++) {
|
||||||
|
if (lines[i].length > 0) {
|
||||||
|
var toggle = $("tgd" + (1 + i * 2));
|
||||||
|
toggle.observe ("click", onUserNodeToggle);
|
||||||
|
var sd = $("sd" + (1 + i * 2));
|
||||||
|
sd.observe("click", onFolderTreeItemClick);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function onUserNodeToggle(event) {
|
||||||
|
this.stopObserving("click", onUserNodeToggle);
|
||||||
|
|
||||||
|
var person = this.parentNode.getAttribute("dataname");
|
||||||
|
var url = (UserFolderURL + "foldersSearch"
|
||||||
|
+ "?user=" + escape(person)
|
||||||
|
+ "&type=" + window.opener.userFolderType);
|
||||||
|
var nodeId = this.getAttribute("id").substr(3);
|
||||||
|
triggerAjaxRequest(url, foldersSearchCallback,
|
||||||
|
{ nodeId: nodeId, user: person });
|
||||||
}
|
}
|
||||||
|
|
||||||
function onFolderTreeItemClick(event) {
|
function onFolderTreeItemClick(event) {
|
||||||
preventDefault(event);
|
preventDefault(event);
|
||||||
|
|
||||||
|
log("click");
|
||||||
|
|
||||||
var topNode = $("d");
|
var topNode = $("d");
|
||||||
if (topNode.selectedEntry)
|
if (topNode.selectedEntry)
|
||||||
topNode.selectedEntry.deselect();
|
topNode.selectedEntry.deselect();
|
||||||
|
@ -97,23 +116,73 @@ function onFolderTreeItemClick(event) {
|
||||||
$("addButton").disabled = false;
|
$("addButton").disabled = false;
|
||||||
else {
|
else {
|
||||||
var dataname = this.parentNode.getAttribute("dataname");
|
var dataname = this.parentNode.getAttribute("dataname");
|
||||||
|
if (!dataname)
|
||||||
|
dataname = "";
|
||||||
$("addButton").disabled = (dataname.indexOf(":") == -1);
|
$("addButton").disabled = (dataname.indexOf(":") == -1);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function userFoldersCallback(http) {
|
function foldersSearchCallback(http) {
|
||||||
document.userFoldersRequest = null;
|
|
||||||
var div = $("folders");
|
|
||||||
if (http.status == 200) {
|
if (http.status == 200) {
|
||||||
var response = http.responseText;
|
var response = http.responseText;
|
||||||
div.update(buildTree(http.responseText));
|
var nodeId = parseInt(http.callbackData["nodeId"]);
|
||||||
div.clean = false;
|
|
||||||
var nodes = document.getElementsByClassName("node", $("d"));
|
var dd = $("dd" + (nodeId + 2));
|
||||||
for (i = 0; i < nodes.length; i++)
|
var indentValue = (dd ? 1 : 0);
|
||||||
$(nodes[i]).observe("click", onFolderTreeItemClick);
|
d.aIndent.push(indentValue);
|
||||||
|
|
||||||
|
var dd = $("dd" + nodeId);
|
||||||
|
if (response.length) {
|
||||||
|
var str = '';
|
||||||
|
var folders = response.split(";");
|
||||||
|
var user = http.callbackData["user"];
|
||||||
|
|
||||||
|
for (var i = 1; i < folders.length - 1; i++)
|
||||||
|
str += addFolderBranchToTree (d, user, folders[1], nodeId, 1, false);
|
||||||
|
str += addFolderBranchToTree (d, user, folders[folders.length-1], nodeId,
|
||||||
|
(folders.length - 1), true);
|
||||||
|
dd.update(str);
|
||||||
|
for (var i = 1; i < folders.length; i++) {
|
||||||
|
var sd = $("sd" + (nodeId + i));
|
||||||
|
sd.observe("click", onFolderTreeItemClick);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
dd.update(addFolderNotFoundNode (d, nodeId));
|
||||||
|
var sd = $("sd" + (nodeId + 1));
|
||||||
|
sd.observe("click", onFolderTreeItemClick);
|
||||||
|
}
|
||||||
|
|
||||||
|
d.aIndent.pop();
|
||||||
}
|
}
|
||||||
else if (http.status == 404)
|
}
|
||||||
div.update();
|
|
||||||
|
function addFolderBranchToTree(tree, user, folder, nodeId, subId, isLast) {
|
||||||
|
var folderInfos = folder.split(":");
|
||||||
|
var icon = ResourcesURL + '/';
|
||||||
|
if (folderInfos[2] == 'Contact')
|
||||||
|
icon += 'tb-mail-addressbook-flat-16x16.png';
|
||||||
|
else
|
||||||
|
icon += 'calendar-folder-16x16.png';
|
||||||
|
var folderId = user + ":" + folderInfos[1];
|
||||||
|
var name = folderInfos[0]; // name has the format "Folername (Firstname Lastname <email>)"
|
||||||
|
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);
|
||||||
|
node._ls = isLast;
|
||||||
|
var content = tree.node(node, (nodeId + subId));
|
||||||
|
|
||||||
|
return content;
|
||||||
|
}
|
||||||
|
|
||||||
|
function addFolderNotFoundNode (tree, nodeId) {
|
||||||
|
var icon = ResourcesURL + '/icon_unread.gif';
|
||||||
|
var node = new Node(1, nodeId, labels["No possible subscription"], 0, '#',
|
||||||
|
null, null, '', '', icon, icon);
|
||||||
|
node._ls = true;
|
||||||
|
return tree.node(node, (nodeId + 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
function onConfirmFolderSelection(event) {
|
function onConfirmFolderSelection(event) {
|
||||||
|
@ -149,7 +218,9 @@ function onConfirmFolderSelection(event) {
|
||||||
|
|
||||||
function onFolderSearchKeyDown(event) {
|
function onFolderSearchKeyDown(event) {
|
||||||
var div = $("folders");
|
var div = $("folders");
|
||||||
if (!div.clean) {
|
if (!div.clean
|
||||||
|
&& (event.keyCode == 8
|
||||||
|
|| event.keyCode >31)) {
|
||||||
div.update();
|
div.update();
|
||||||
div.clean = true;
|
div.clean = true;
|
||||||
$("addButton").disabled = true;
|
$("addButton").disabled = true;
|
||||||
|
|
|
@ -186,7 +186,7 @@ dTree.prototype.indent = function(node, nodeId) {
|
||||||
(node._ls) ? this.aIndent.push(0) : this.aIndent.push(1);
|
(node._ls) ? this.aIndent.push(0) : this.aIndent.push(1);
|
||||||
if (node._hc)
|
if (node._hc)
|
||||||
{
|
{
|
||||||
str += '<a href="#" onclick="return ' + this.obj + '.o(' + nodeId + ');"><img id="j' + this.obj + nodeId + '" src="';
|
str += '<a href="#" id="tg' + this.obj + nodeId + '" onclick="return ' + this.obj + '.o(' + nodeId + ');"><img id="j' + this.obj + nodeId + '" src="';
|
||||||
if (!this.config.useLines) str += (node._io) ? this.icon.nlMinus : this.icon.nlPlus;
|
if (!this.config.useLines) str += (node._io) ? this.icon.nlMinus : this.icon.nlPlus;
|
||||||
else str += ( (node._io) ? ((node._ls && this.config.useLines) ? this.icon.minusBottom : this.icon.minus) : ((node._ls && this.config.useLines) ? this.icon.plusBottom : this.icon.plus ) );
|
else str += ( (node._io) ? ((node._ls && this.config.useLines) ? this.icon.minusBottom : this.icon.minus) : ((node._ls && this.config.useLines) ? this.icon.plusBottom : this.icon.plus ) );
|
||||||
str += '" alt="" /></a>';
|
str += '" alt="" /></a>';
|
||||||
|
|
|
@ -941,13 +941,13 @@ function checkSearchValue(event) {
|
||||||
function configureSearchField() {
|
function configureSearchField() {
|
||||||
var searchValue = $("searchValue");
|
var searchValue = $("searchValue");
|
||||||
|
|
||||||
if (!searchValue) return;
|
if (searchValue) {
|
||||||
|
searchValue.observe("click", popupSearchMenu);
|
||||||
searchValue.observe("click", popupSearchMenu);
|
searchValue.observe("blur", onSearchBlur);
|
||||||
searchValue.observe("blur", onSearchBlur);
|
searchValue.observe("focus", onSearchFocus);
|
||||||
searchValue.observe("focus", onSearchFocus);
|
searchValue.observe("keydown", onSearchKeyDown);
|
||||||
searchValue.observe("keydown", onSearchKeyDown);
|
searchValue.observe("mousedown", onSearchMouseDown);
|
||||||
searchValue.observe("mousedown", onSearchMouseDown);
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function onSearchMouseDown(event) {
|
function onSearchMouseDown(event) {
|
||||||
|
@ -998,7 +998,8 @@ function onSearchKeyDown(event) {
|
||||||
onSearchFormSubmit();
|
onSearchFormSubmit();
|
||||||
preventDefault(event);
|
preventDefault(event);
|
||||||
}
|
}
|
||||||
else
|
else if (event.keyCode == 8
|
||||||
|
|| event.keyCode >31)
|
||||||
this.timer = setTimeout("onSearchFormSubmit()", 1000);
|
this.timer = setTimeout("onSearchFormSubmit()", 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue