mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-07-08 09:55:09 +00:00
merge of '6ce902c8df1995a79c1ab0e0d78013b688e25dbd'
and 'b2d0da06fffc88971705a5c6cf4b5a85fd76e93d' Monotone-Parent: 6ce902c8df1995a79c1ab0e0d78013b688e25dbd Monotone-Parent: b2d0da06fffc88971705a5c6cf4b5a85fd76e93d Monotone-Revision: 6705a0eaf721b2addcf26cc8ef50da0979eb563d Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-05-17T23:13:45 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -17,12 +17,17 @@ DIV.acls LABEL
|
||||
DIV#userSelectorHeader
|
||||
{ margin: 1em; }
|
||||
|
||||
INPUT#defaultRolesBtn
|
||||
{ position: absolute;
|
||||
top: 5em;
|
||||
left: 1em; }
|
||||
|
||||
DIV#userRoles
|
||||
{ position: absolute;
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
left: 1em;
|
||||
top: 5em;
|
||||
top: 7em;
|
||||
right: 1em;
|
||||
bottom: 0px; }
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/* test */
|
||||
|
||||
var contactSelectorAction = 'acls-contacts';
|
||||
var defaultUserID = '';
|
||||
|
||||
function addUser(userName, userID) {
|
||||
if (!$(userID)) {
|
||||
@@ -17,12 +18,17 @@ function addUser(userName, userID) {
|
||||
function addUserCallback(http) {
|
||||
}
|
||||
|
||||
function setEventsOnUserNode(node) {
|
||||
Event.observe(node, "mousedown", listRowMouseDownHandler);
|
||||
Event.observe(node, "dblclick", onOpenUserRights);
|
||||
Event.observe(node, "click", onRowClick);
|
||||
}
|
||||
|
||||
function nodeForUser(userName, userId) {
|
||||
var node = document.createElement("li");
|
||||
node.setAttribute("id", userId);
|
||||
node.setAttribute("class", "");
|
||||
node.addEventListener("mousedown", listRowMouseDownHandler, true);
|
||||
node.addEventListener("click", onRowClick, true);
|
||||
setEventsOnUserNode(node);
|
||||
|
||||
var image = document.createElement("img");
|
||||
image.setAttribute("src", ResourcesURL + "/abcard.gif");
|
||||
@@ -81,44 +87,50 @@ function subscribeToFolder(refreshCallback, refreshCallbackData) {
|
||||
refreshCallbackData["folder"]);
|
||||
}
|
||||
|
||||
function openRightsForUserID(userID) {
|
||||
var url = window.location.href;
|
||||
var elements = url.split("/");
|
||||
elements[elements.length-1] = "userRights?uid=" + userID;
|
||||
|
||||
window.open(elements.join("/"), "",
|
||||
"width=" + this.userRightsWidth
|
||||
+ ",height=" + this.userRightsHeight
|
||||
+ ",resizable=0,scrollbars=0,toolbar=0,"
|
||||
+ "location=0,directories=0,status=0,menubar=0,copyhistory=0");
|
||||
}
|
||||
|
||||
function openRightsForUser(button) {
|
||||
var nodes = $("userList").getSelectedRows();
|
||||
if (nodes.length > 0) {
|
||||
var url = window.location.href;
|
||||
var elements = url.split("/");
|
||||
elements[elements.length-1] = ("userRights?uid="
|
||||
+ nodes[0].getAttribute("id"));
|
||||
|
||||
window.open(elements.join("/"), "",
|
||||
"width=" + this.userRightsWidth
|
||||
+ ",height=" + this.userRightsHeight
|
||||
+ ",resizable=0,scrollbars=0,toolbar=0,"
|
||||
+ "location=0,directories=0,status=0,menubar=0,copyhistory=0");
|
||||
}
|
||||
if (nodes.length > 0)
|
||||
openRightsForUserID(nodes[0].getAttribute("id"));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function openRightsForDefaultUser(event) {
|
||||
openRightsForUserID(defaultUserID);
|
||||
event.preventDefault();
|
||||
}
|
||||
|
||||
function onOpenUserRights(event) {
|
||||
openRightsForUser();
|
||||
event.preventDefault();
|
||||
}
|
||||
|
||||
function onAclLoadHandler() {
|
||||
var ul = $("userList");
|
||||
var lis = ul.childNodesWithTag("li");
|
||||
for (var i = 0; i < lis.length; i++) {
|
||||
lis[i].addEventListener("mousedown", listRowMouseDownHandler, false);
|
||||
lis[i].addEventListener("dblclick", onOpenUserRights, false);
|
||||
lis[i].addEventListener("click", onRowClick, false);
|
||||
}
|
||||
defaultUserID = $("defaultUserID").value;
|
||||
Event.observe($("defaultRolesBtn"), "click", openRightsForDefaultUser);
|
||||
var ul = $("userList");
|
||||
var lis = ul.childNodesWithTag("li");
|
||||
for (var i = 0; i < lis.length; i++)
|
||||
setEventsOnUserNode(lis[i]);
|
||||
|
||||
var buttons = $("userSelectorButtons").childNodesWithTag("a");
|
||||
buttons[0].addEventListener("click", onUserAdd, false);
|
||||
buttons[1].addEventListener("click", onUserRemove, false);
|
||||
var buttons = $("userSelectorButtons").childNodesWithTag("a");
|
||||
Event.observe(buttons[0], "click", onUserAdd);
|
||||
Event.observe(buttons[1], "click", onUserRemove);
|
||||
|
||||
this.userRightsHeight = window.opener.getUsersRightsWindowHeight();
|
||||
this.userRightsWidth = window.opener.getUsersRightsWindowWidth();
|
||||
this.userRightsHeight = window.opener.getUsersRightsWindowHeight();
|
||||
this.userRightsWidth = window.opener.getUsersRightsWindowWidth();
|
||||
}
|
||||
|
||||
window.addEventListener("load", onAclLoadHandler, false);
|
||||
Event.observe(window, "load", onAclLoadHandler);
|
||||
|
||||
@@ -941,7 +941,7 @@ function openExternalLink(anchor) {
|
||||
|
||||
function openAclWindow(url) {
|
||||
var w = window.open(url, "aclWindow",
|
||||
"width=300,height=300,resizable=1,scrollbars=1,toolbar=0,"
|
||||
"width=420,height=300,resizable=1,scrollbars=1,toolbar=0,"
|
||||
+ "location=0,directories=0,status=0,menubar=0"
|
||||
+ ",copyhistory=0");
|
||||
w.opener = window;
|
||||
|
||||
Reference in New Issue
Block a user