mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-23 04:15:26 +00:00
Indentation
This commit is contained in:
@@ -22,9 +22,9 @@ ContactsUI_OBJC_FILES = \
|
||||
UIxListEditor.m \
|
||||
UIxContactsListActions.m \
|
||||
UIxContactFoldersView.m \
|
||||
UIxContactFolderActions.m \
|
||||
UIxContactFolderProperties.m
|
||||
|
||||
UIxContactFolderActions.m \
|
||||
UIxContactFolderProperties.m
|
||||
|
||||
ContactsUI_RESOURCE_FILES += \
|
||||
product.plist \
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* UIxContactFolderProperties.h - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2008-2014 Inverse inc.
|
||||
* Copyright (C) 2014 Inverse inc.
|
||||
*
|
||||
* This file is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* UIxContactFolderProperties.m - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2008-2014 Inverse inc.
|
||||
* Copyright (C) 2014 Inverse inc.
|
||||
*
|
||||
* This file is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -75,14 +75,14 @@
|
||||
NSString *davURL;
|
||||
|
||||
if (!basePublicCardDAVURL)
|
||||
{
|
||||
davURL = [[addressBook publicDavURL] absoluteString];
|
||||
if ([davURL hasSuffix: @"/"])
|
||||
basePublicCardDAVURL = [davURL substringToIndex: [davURL length] - 1];
|
||||
else
|
||||
basePublicCardDAVURL = davURL;
|
||||
[basePublicCardDAVURL retain];
|
||||
}
|
||||
{
|
||||
davURL = [[addressBook publicDavURL] absoluteString];
|
||||
if ([davURL hasSuffix: @"/"])
|
||||
basePublicCardDAVURL = [davURL substringToIndex: [davURL length] - 1];
|
||||
else
|
||||
basePublicCardDAVURL = davURL;
|
||||
[basePublicCardDAVURL retain];
|
||||
}
|
||||
|
||||
return basePublicCardDAVURL;
|
||||
}
|
||||
@@ -96,7 +96,7 @@
|
||||
{
|
||||
// NOTE: This method is the same found in Common/UIxAclEditor.m
|
||||
return [[SOGoSystemDefaults sharedSystemDefaults]
|
||||
enablePublicAccess];
|
||||
enablePublicAccess];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -1,63 +1,63 @@
|
||||
<?xml version='1.0' standalone='yes'?>
|
||||
<!DOCTYPE var:component>
|
||||
<var:component xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:var="http://www.skyrix.com/od/binding"
|
||||
xmlns:const="http://www.skyrix.com/od/constant"
|
||||
xmlns:uix="OGo:uix"
|
||||
xmlns:rsrc="OGo:url"
|
||||
xmlns:label="OGo:label"
|
||||
className="UIxPageFrame"
|
||||
const:toolbar="none"
|
||||
const:popup="YES"
|
||||
title="title">
|
||||
|
||||
xmlns:var="http://www.skyrix.com/od/binding"
|
||||
xmlns:const="http://www.skyrix.com/od/constant"
|
||||
xmlns:uix="OGo:uix"
|
||||
xmlns:rsrc="OGo:url"
|
||||
xmlns:label="OGo:label"
|
||||
className="UIxPageFrame"
|
||||
const:toolbar="none"
|
||||
const:popup="YES"
|
||||
title="title">
|
||||
|
||||
<div class="tabsContainer" id="propertiesTabs">
|
||||
<ul>
|
||||
<li target="properties">
|
||||
<span><var:string label:value="Properties" /></span></li>
|
||||
<li target="LinksView">
|
||||
<span><var:string label:value="Links to this Address Book" /></span></li>
|
||||
</ul>
|
||||
|
||||
<div class="tabs">
|
||||
<!-- First Tab -->
|
||||
<div id="properties" class="tab">
|
||||
<fieldset>
|
||||
<legend><var:string label:value="Properties"/></legend>
|
||||
<ul>
|
||||
<li target="properties">
|
||||
<span><var:string label:value="Properties" /></span></li>
|
||||
<li target="LinksView">
|
||||
<span><var:string label:value="Links to this Address Book" /></span></li>
|
||||
</ul>
|
||||
|
||||
<div class="tabs">
|
||||
<!-- First Tab -->
|
||||
<div id="properties" class="tab">
|
||||
<fieldset>
|
||||
<legend><var:string label:value="Properties"/></legend>
|
||||
<div>
|
||||
<var:string label:value="Address Book Name:" />
|
||||
<input type="text" name="addressBookName" id="addressBookName" class="textField" var:value="addressBookName" />
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<!-- Second Tab -->
|
||||
<div id="LinksView" class="tab">
|
||||
<fieldset id="authenticatedLinks">
|
||||
<legend><var:string label:value="Authenticated User Access"/></legend>
|
||||
<div>
|
||||
<var:string label:value="CardDAV URL: "/>
|
||||
<var:string value="cardDavURL" />
|
||||
</div>
|
||||
</fieldset>
|
||||
<var:if condition="isPublicAccessEnabled">
|
||||
<fieldset id="publicLinks">
|
||||
<legend><var:string label:value="Public Access"/></legend>
|
||||
<div>
|
||||
<var:string label:value="Address Book Name:" />
|
||||
<input type="text" name="addressBookName" id="addressBookName" class="textField" var:value="addressBookName" />
|
||||
<var:string label:value="CardDAV URL: "/>
|
||||
<var:string value="publicCardDavURL" />
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<!-- Second Tab -->
|
||||
<div id="LinksView" class="tab">
|
||||
<fieldset id="authenticatedLinks">
|
||||
<legend><var:string label:value="Authenticated User Access"/></legend>
|
||||
<div>
|
||||
<var:string label:value="CardDAV URL: "/>
|
||||
<var:string value="cardDavURL" />
|
||||
</div>
|
||||
</fieldset>
|
||||
<var:if condition="isPublicAccessEnabled">
|
||||
<fieldset id="publicLinks">
|
||||
<legend><var:string label:value="Public Access"/></legend>
|
||||
<div>
|
||||
<var:string label:value="CardDAV URL: "/>
|
||||
<var:string value="publicCardDavURL" />
|
||||
</div>
|
||||
</fieldset>
|
||||
</var:if>
|
||||
</div>
|
||||
|
||||
<!-- Buttons -->
|
||||
<div id="buttons">
|
||||
<a href="#" class="button actionButton" id="okButton" name="okButton">
|
||||
<span><var:string label:value="OK"/></span></a>
|
||||
<a href="#" class="button" id="cancelButton" name="cancelButton">
|
||||
<span><var:string label:value="Cancel"/></span></a>
|
||||
</div>
|
||||
</var:if>
|
||||
</div>
|
||||
|
||||
<!-- Buttons -->
|
||||
<div id="buttons">
|
||||
<a href="#" class="button actionButton" id="okButton" name="okButton">
|
||||
<span><var:string label:value="OK"/></span></a>
|
||||
<a href="#" class="button" id="cancelButton" name="cancelButton">
|
||||
<span><var:string label:value="Cancel"/></span></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</var:component>
|
||||
|
||||
@@ -266,7 +266,7 @@ function _onContactMenuAction(folderItem, action, refresh) {
|
||||
var selectedFolders = $("contactFolders").getSelectedNodes();
|
||||
var folderId = $(folderItem).readAttribute("folderId");
|
||||
if (folderId)
|
||||
folderId = folderId.substring(1);
|
||||
folderId = folderId.substring(1);
|
||||
if (Object.isArray(document.menuTarget) && selectedFolders.length > 0) {
|
||||
var selectedFolderId = $(selectedFolders[0]).readAttribute("id");
|
||||
var contactIds = $(document.menuTarget).collect(function(row) {
|
||||
@@ -313,7 +313,7 @@ function onMenuExportContact (event) {
|
||||
return row.readAttribute("id");
|
||||
});
|
||||
var url = ApplicationBaseURL + "/" + selectedFolderId + "/export"
|
||||
+ "?uid=" + contactIds.join("&uid=");
|
||||
+ "?uid=" + contactIds.join("&uid=");
|
||||
window.location.href = url;
|
||||
}
|
||||
}
|
||||
@@ -528,7 +528,7 @@ function onToolbarDeleteSelectedContactsConfirm(dialogId) {
|
||||
('ids=' + rowIds.collect(function (s) {
|
||||
return encodeURIComponent(s.unescapeHTML());
|
||||
}).join(",")),
|
||||
{ "Content-type": "application/x-www-form-urlencoded" });
|
||||
{ "Content-type": "application/x-www-form-urlencoded" });
|
||||
}
|
||||
|
||||
function onContactDeleteEventCallback(http) {
|
||||
@@ -616,9 +616,9 @@ function newList(sender) {
|
||||
var li = $(Contact.currentAddressBook);
|
||||
var listEditing = li.getAttribute("list-editing");
|
||||
if (listEditing && listEditing == "available")
|
||||
openContactWindow(URLForFolderID(Contact.currentAddressBook) + "/newlist");
|
||||
openContactWindow(URLForFolderID(Contact.currentAddressBook) + "/newlist");
|
||||
else
|
||||
showAlertDialog(_("You cannot create a list in a shared address book."));
|
||||
showAlertDialog(_("You cannot create a list in a shared address book."));
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -670,9 +670,9 @@ function onConfirmContactSelection(event) {
|
||||
addListToOpener(tag, Contact.currentAddressBook, currentAddressBookName, cid);
|
||||
}
|
||||
else {
|
||||
var cname = '' + rows[i].readAttribute("contactname");
|
||||
var email = '' + rows[i].cells[1].innerHTML;
|
||||
addContact(tag, currentAddressBookName + '/' + cname, cid, cname, email);
|
||||
var cname = '' + rows[i].readAttribute("contactname");
|
||||
var email = '' + rows[i].cells[1].innerHTML;
|
||||
addContact(tag, currentAddressBookName + '/' + cname, cid, cname, email);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -685,10 +685,10 @@ function onConfirmContactSelection(event) {
|
||||
function addListToOpener (tag, aBookId, aBookName, listId) {
|
||||
var url = UserFolderURL + "Contacts/" + aBookId + "/" + listId + "/properties";
|
||||
triggerAjaxRequest (url, addListToOpenerCallback, {
|
||||
"aBookId": aBookId,
|
||||
"aBookName": aBookName,
|
||||
"tag": tag
|
||||
});
|
||||
"aBookId": aBookId,
|
||||
"aBookName": aBookName,
|
||||
"tag": tag
|
||||
});
|
||||
}
|
||||
|
||||
function addListToOpenerCallback (http) {
|
||||
@@ -827,11 +827,11 @@ function hideImportResults () {
|
||||
function validateUploadForm () {
|
||||
rc = false;
|
||||
if ($("contactsFile").value.length) {
|
||||
var btn = jQuery('#uploadSubmit');
|
||||
jQuery('#uploadCancel').fadeOut('fast');
|
||||
btn.addClass("disabled");
|
||||
btn.children('span').text(_('Uploading'));
|
||||
rc = true;
|
||||
var btn = jQuery('#uploadSubmit');
|
||||
jQuery('#uploadCancel').fadeOut('fast');
|
||||
btn.addClass("disabled");
|
||||
btn.children('span').text(_('Uploading'));
|
||||
rc = true;
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
@@ -1062,18 +1062,18 @@ function updateAddressBooksMenus() {
|
||||
}
|
||||
|
||||
function onAddressBookModify(event) {
|
||||
var folders = $("contactFolders");
|
||||
var selected = folders.getSelectedNodes()[0];
|
||||
var addressBookID = selected.getAttribute("id");
|
||||
var url = ApplicationBaseURL + addressBookID + "/properties";
|
||||
var windowID = sanitizeWindowName(addressBookID + " properties");
|
||||
var width = 410;
|
||||
var height = 410;
|
||||
var folders = $("contactFolders");
|
||||
var selected = folders.getSelectedNodes()[0];
|
||||
var addressBookID = selected.getAttribute("id");
|
||||
var url = ApplicationBaseURL + addressBookID + "/properties";
|
||||
var windowID = sanitizeWindowName(addressBookID + " properties");
|
||||
var width = 410;
|
||||
var height = 410;
|
||||
|
||||
$(function() {
|
||||
var properties = window.open(url, windowID, "width="+width+",height="+height+",resizable=0");
|
||||
properties.focus();
|
||||
}).delay(0.1);
|
||||
$(function() {
|
||||
var properties = window.open(url, windowID, "width="+width+",height="+height+",resizable=0");
|
||||
properties.focus();
|
||||
}).delay(0.1);
|
||||
|
||||
}
|
||||
|
||||
@@ -1263,15 +1263,15 @@ getMenus = function() {
|
||||
return menus;
|
||||
}
|
||||
|
||||
function configureSelectionButtons() {
|
||||
var container = $("contactSelectionButtons");
|
||||
if (container) {
|
||||
var buttons = container.select("A.button");
|
||||
for (var i = 0; i < buttons.length; i++) {
|
||||
$(buttons[i]).observe("click", onConfirmContactSelection);
|
||||
function configureSelectionButtons() {
|
||||
var container = $("contactSelectionButtons");
|
||||
if (container) {
|
||||
var buttons = container.select("A.button");
|
||||
for (var i = 0; i < buttons.length; i++) {
|
||||
$(buttons[i]).observe("click", onConfirmContactSelection);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function onDocumentKeydown(event) {
|
||||
var target = Event.element(event);
|
||||
@@ -1329,12 +1329,12 @@ function onDocumentKeydown(event) {
|
||||
}
|
||||
|
||||
/*function fixSearchFieldPosition () {
|
||||
var panel = $("filterPanel");
|
||||
if (panel) {
|
||||
panel.style.position = "relative";
|
||||
panel.style.top = "7px";
|
||||
}
|
||||
}*/
|
||||
var panel = $("filterPanel");
|
||||
if (panel) {
|
||||
panel.style.position = "relative";
|
||||
panel.style.top = "7px";
|
||||
}
|
||||
}*/
|
||||
|
||||
function initContacts(event) {
|
||||
if ($(document.body).hasClassName("popup")) {
|
||||
@@ -1393,36 +1393,36 @@ onContactsWindowResize = function (event) {
|
||||
handle.adjust();
|
||||
}
|
||||
|
||||
function resetCategoriesMenu() {
|
||||
var menu = $("categoriesMenu");
|
||||
if (menu) {
|
||||
menu.parentNode.removeChild(menu);
|
||||
}
|
||||
function resetCategoriesMenu() {
|
||||
var menu = $("categoriesMenu");
|
||||
if (menu) {
|
||||
menu.parentNode.removeChild(menu);
|
||||
}
|
||||
|
||||
menu = createElement("div", "categoriesMenu", "menu");
|
||||
var menuUL = createElement("ul", null, "choiceMenu");
|
||||
menu.appendChild(menuUL);
|
||||
if (UserDefaults && UserDefaults["SOGoContactsCategories"]) {
|
||||
for (var i = 0;
|
||||
i < UserDefaults["SOGoContactsCategories"].length;
|
||||
i++) {
|
||||
var catName = UserDefaults["SOGoContactsCategories"][i];
|
||||
if (catName.length > 0) {
|
||||
var menuLI = createElement("li");
|
||||
menuLI.observe("mousedown", onCategoriesMenuItemClick);
|
||||
menuLI.category = catName;
|
||||
menuLI.appendChild(document.createTextNode(catName));
|
||||
menuUL.appendChild(menuLI);
|
||||
menu = createElement("div", "categoriesMenu", "menu");
|
||||
var menuUL = createElement("ul", null, "choiceMenu");
|
||||
menu.appendChild(menuUL);
|
||||
if (UserDefaults && UserDefaults["SOGoContactsCategories"]) {
|
||||
for (var i = 0;
|
||||
i < UserDefaults["SOGoContactsCategories"].length;
|
||||
i++) {
|
||||
var catName = UserDefaults["SOGoContactsCategories"][i];
|
||||
if (catName.length > 0) {
|
||||
var menuLI = createElement("li");
|
||||
menuLI.observe("mousedown", onCategoriesMenuItemClick);
|
||||
menuLI.category = catName;
|
||||
menuLI.appendChild(document.createTextNode(catName));
|
||||
menuUL.appendChild(menuLI);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
menu.prepareVisibility = onCategoriesMenuPrepareVisibility;
|
||||
|
||||
var pageContent = $("pageContent");
|
||||
pageContent.appendChild(menu);
|
||||
}
|
||||
|
||||
menu.prepareVisibility = onCategoriesMenuPrepareVisibility;
|
||||
|
||||
var pageContent = $("pageContent");
|
||||
pageContent.appendChild(menu);
|
||||
}
|
||||
|
||||
function onCategoriesMenuPrepareVisibility() {
|
||||
var contactsList = $("contactsList");
|
||||
if (contactsList) {
|
||||
@@ -1514,16 +1514,16 @@ function configureDraggables() {
|
||||
var rows = jQuery("tr.vcard");
|
||||
try { rows.draggable("destroy"); } catch (e) {}
|
||||
rows.draggable({
|
||||
helper: function (event) { return '<div id="dragDropVisual"></div>'; },
|
||||
start: startDragging,
|
||||
drag: whileDragging,
|
||||
stop: stopDragging,
|
||||
appendTo: 'body',
|
||||
cursorAt: { right: 25 },
|
||||
scroll: false,
|
||||
distance: 4,
|
||||
zIndex: 20
|
||||
});
|
||||
helper: function (event) { return '<div id="dragDropVisual"></div>'; },
|
||||
start: startDragging,
|
||||
drag: whileDragging,
|
||||
stop: stopDragging,
|
||||
appendTo: 'body',
|
||||
cursorAt: { right: 25 },
|
||||
scroll: false,
|
||||
distance: 4,
|
||||
zIndex: 20
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1557,7 +1557,7 @@ function startDragging(event, ui) {
|
||||
handle.html(count);
|
||||
|
||||
if (event.shiftKey || currentFolderIsRemote()) {
|
||||
handle.addClass("copy");
|
||||
handle.addClass("copy");
|
||||
}
|
||||
handle.show();
|
||||
}
|
||||
@@ -1607,8 +1607,8 @@ function dropSelectedContacts(action, toId) {
|
||||
return encodeURIComponent(s.unescapeHTML());
|
||||
}).join('&uid=');
|
||||
triggerAjaxRequest(url, actionContactCallback, fromId,
|
||||
('folder='+ toId + '&uid=' + uids),
|
||||
{ "Content-type": "application/x-www-form-urlencoded" });
|
||||
('folder='+ toId + '&uid=' + uids),
|
||||
{ "Content-type": "application/x-www-form-urlencoded" });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,57 +15,55 @@ function onLoadContactFolderProperties() {
|
||||
}
|
||||
|
||||
function onOKClick(event) {
|
||||
var AddressBookName = $("addressBookName");
|
||||
var folders = parent$("contactFolders");
|
||||
var selected = folders.getSelectedNodes()[0];
|
||||
var AddressBookName = $("addressBookName");
|
||||
var folders = parent$("contactFolders");
|
||||
var selected = folders.getSelectedNodes()[0];
|
||||
|
||||
if (!AddressBookName.value.blank()) {
|
||||
var newName = AddressBookName.value;
|
||||
var currentName = AddressBookName.defaultValue;
|
||||
if (newName && newName.length > 0 && newName != currentName) {
|
||||
if (selected.getAttribute("owner") != "nobody") {
|
||||
var url = (URLForFolderID(selected.getAttribute("id")) + "/renameFolder?name=" + escape(newName.utf8encode()));
|
||||
triggerAjaxRequest(url, folderRenameCallback, {node: selected, name: newName});
|
||||
if (!AddressBookName.value.blank()) {
|
||||
var newName = AddressBookName.value;
|
||||
var currentName = AddressBookName.defaultValue;
|
||||
if (newName && newName.length > 0 && newName != currentName) {
|
||||
if (selected.getAttribute("owner") != "nobody") {
|
||||
var url = (URLForFolderID(selected.getAttribute("id")) + "/renameFolder?name=" + escape(newName.utf8encode()));
|
||||
triggerAjaxRequest(url, folderRenameCallback, {node: selected, name: newName});
|
||||
|
||||
}
|
||||
else {
|
||||
alert_("You do not own this address book");
|
||||
}
|
||||
}
|
||||
else {
|
||||
alert_("You do not own this address book");
|
||||
}
|
||||
}
|
||||
else
|
||||
window.close();
|
||||
}
|
||||
else
|
||||
window.close();
|
||||
}
|
||||
else
|
||||
alert(_("Please specify an address book name."));
|
||||
alert(_("Please specify an address book name."));
|
||||
Event.stop(event);
|
||||
}
|
||||
|
||||
function folderRenameCallback(http) {
|
||||
if (http.readyState == 4) {
|
||||
if (isHttpStatus204(http.status)) {
|
||||
var dict = http.callbackData;
|
||||
dict["node"].innerHTML = dict["name"];
|
||||
window.close();
|
||||
if (http.readyState == 4) {
|
||||
if (isHttpStatus204(http.status)) {
|
||||
var dict = http.callbackData;
|
||||
dict["node"].innerHTML = dict["name"];
|
||||
window.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function onCancelClick(event) {
|
||||
window.close();
|
||||
window.close();
|
||||
}
|
||||
|
||||
function onDocumentKeydown(event) {
|
||||
var target = Event.element(event);
|
||||
if (target.tagName == "INPUT" || target.tagName == "SELECT") {
|
||||
if (event.keyCode == Event.KEY_RETURN) {
|
||||
onOKClick(event);
|
||||
var target = Event.element(event);
|
||||
if (target.tagName == "INPUT" || target.tagName == "SELECT") {
|
||||
if (event.keyCode == Event.KEY_RETURN) {
|
||||
onOKClick(event);
|
||||
}
|
||||
}
|
||||
if (event.keyCode == Event.KEY_ESC) {
|
||||
onCancelClick();
|
||||
}
|
||||
}
|
||||
if (event.keyCode == Event.KEY_ESC) {
|
||||
onCancelClick();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
document.observe("dom:loaded", onLoadContactFolderProperties);
|
||||
|
||||
Reference in New Issue
Block a user