* UI/WebServerResources/SchedulerUI.js (onMenuRawEvent, onMenuRawTask):
New callback to show the event/task content from the menu * UI/Scheduler/UIxComponentEditor.m (rawAction): New method that returns the object's raw content in a WOResponse. * UI/Templates/SchedulerUI/UIxCal{Day,Month,Main,Week}View.wox: New contextual menu item: Show Raw Source * UI/WebServerResources/ContactsUI.js (onMenuRawContact): Rework to use calendar/ics/raw * UI/Contacts/UIxContactFolderActions.m (rawAction): Removed / moved to UI/Contacts/UIxContactActions.m * UI/Contacts/UIxContactActions.m (rawAction): New method that returns the object's raw content in a WOResponse. * UI/Templates/ContactsUI/UIxContactFoldersView.wox: Show vCard content -> Show Raw Source Monotone-Parent: e853157abbabf35bc95273da8bc10b2d3b142627 Monotone-Revision: 4e287287380938e20234ac951c09158c324b84b4 Monotone-Author: jraby@inverse.ca Monotone-Date: 2012-07-09T14:17:07maint-2.0.2
parent
c4d11cd916
commit
71121914cf
24
ChangeLog
24
ChangeLog
|
@ -1,3 +1,27 @@
|
||||||
|
2012-07-09 Jean Raby <jraby@inverse.ca>
|
||||||
|
|
||||||
|
* UI/WebServerResources/SchedulerUI.js (onMenuRawEvent, onMenuRawTask):
|
||||||
|
New callback to show the event/task content from the menu
|
||||||
|
|
||||||
|
* UI/Scheduler/UIxComponentEditor.m (rawAction):
|
||||||
|
New method that returns the object's raw content in a WOResponse.
|
||||||
|
|
||||||
|
* UI/Templates/SchedulerUI/UIxCal{Day,Month,Main,Week}View.wox:
|
||||||
|
New contextual menu item: Show Raw Source
|
||||||
|
|
||||||
|
* UI/WebServerResources/ContactsUI.js (onMenuRawContact):
|
||||||
|
Rework to use calendar/ics/raw
|
||||||
|
|
||||||
|
* UI/Contacts/UIxContactFolderActions.m (rawAction):
|
||||||
|
Removed / moved to UI/Contacts/UIxContactActions.m
|
||||||
|
|
||||||
|
* UI/Contacts/UIxContactActions.m (rawAction):
|
||||||
|
New method that returns the object's raw content in a WOResponse.
|
||||||
|
|
||||||
|
* UI/Templates/ContactsUI/UIxContactFoldersView.wox:
|
||||||
|
Show vCard content -> Show Raw Source
|
||||||
|
|
||||||
|
|
||||||
2012-07-05 Jean Raby <jraby@inverse.ca>
|
2012-07-05 Jean Raby <jraby@inverse.ca>
|
||||||
|
|
||||||
* UI/WebServerResources/generic.js (openGenericWindow):
|
* UI/WebServerResources/generic.js (openGenericWindow):
|
||||||
|
|
2
NEWS
2
NEWS
|
@ -1,7 +1,7 @@
|
||||||
1.3.17 (2012-MM-DD)
|
1.3.17 (2012-MM-DD)
|
||||||
-------------------
|
-------------------
|
||||||
New Features
|
New Features
|
||||||
-
|
- New contextual menu to view the raw content of events, tasks and contacts
|
||||||
|
|
||||||
Enhancements
|
Enhancements
|
||||||
- updated Czech translation
|
- updated Czech translation
|
||||||
|
|
|
@ -195,7 +195,7 @@
|
||||||
"Lists can't be moved or copied." = "Lists can't be moved or copied.";
|
"Lists can't be moved or copied." = "Lists can't be moved or copied.";
|
||||||
"Export" = "Export";
|
"Export" = "Export";
|
||||||
"Export Address Book..." = "Export Address Book...";
|
"Export Address Book..." = "Export Address Book...";
|
||||||
"Show vCard content" = "Show vCard content";
|
"View Raw Source" = "View Raw Source";
|
||||||
"Import Cards" = "Import Cards";
|
"Import Cards" = "Import Cards";
|
||||||
"Select a vCard or LDIF file." = "Select a vCard or LDIF file.";
|
"Select a vCard or LDIF file." = "Select a vCard or LDIF file.";
|
||||||
"Upload" = "Upload";
|
"Upload" = "Upload";
|
||||||
|
|
|
@ -195,7 +195,6 @@
|
||||||
"Lists can't be moved or copied." = "Les listes ne peuvent pas être déplacées ou copiées.";
|
"Lists can't be moved or copied." = "Les listes ne peuvent pas être déplacées ou copiées.";
|
||||||
"Export" = "Exporter";
|
"Export" = "Exporter";
|
||||||
"Export Address Book..." = "Exporter le carnet d'adresses...";
|
"Export Address Book..." = "Exporter le carnet d'adresses...";
|
||||||
"Show vCard content" = "Afficher le contenu vCard";
|
|
||||||
"Import Cards" = "Importer des contacts";
|
"Import Cards" = "Importer des contacts";
|
||||||
"Select a vCard or LDIF file." = "Sélectionner un fichier. LDIF ou vCard.";
|
"Select a vCard or LDIF file." = "Sélectionner un fichier. LDIF ou vCard.";
|
||||||
"Upload" = "Ajouter";
|
"Upload" = "Ajouter";
|
||||||
|
|
|
@ -130,4 +130,21 @@
|
||||||
return [self _setOrUnsetCategoryAction: NO];
|
return [self _setOrUnsetCategoryAction: NO];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// returns the raw content of the object
|
||||||
|
- (WOResponse *) rawAction
|
||||||
|
{
|
||||||
|
NSMutableString *content;
|
||||||
|
WOResponse *response;
|
||||||
|
|
||||||
|
content = [NSMutableString string];
|
||||||
|
response = [context response];
|
||||||
|
|
||||||
|
[content appendFormat: [[self clientObject] contentAsString]];
|
||||||
|
[response setHeader: @"text/plain; charset=utf-8"
|
||||||
|
forKey: @"content-type"];
|
||||||
|
[response appendContentString: content];
|
||||||
|
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -287,51 +287,4 @@
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id <WOActionResults>) rawAction
|
|
||||||
{
|
|
||||||
WORequest *request;
|
|
||||||
WOResponse *response;
|
|
||||||
NSArray *contactsId;
|
|
||||||
NSEnumerator *uids;
|
|
||||||
NSString *uid;
|
|
||||||
id currentChild;
|
|
||||||
SOGoContactGCSFolder *sourceFolder;
|
|
||||||
NSMutableString *content;
|
|
||||||
|
|
||||||
content = [NSMutableString string];
|
|
||||||
request = [context request];
|
|
||||||
response = [context response];
|
|
||||||
sourceFolder = [self clientObject];
|
|
||||||
contactsId = [request formValuesForKey: @"uid"];
|
|
||||||
|
|
||||||
if ((uids = [contactsId objectEnumerator]))
|
|
||||||
{
|
|
||||||
while ((uid = [uids nextObject]))
|
|
||||||
{
|
|
||||||
currentChild = [sourceFolder lookupName: uid
|
|
||||||
inContext: [self context]
|
|
||||||
acquire: NO];
|
|
||||||
if([currentChild isKindOfClass: [NSException class]])
|
|
||||||
continue;
|
|
||||||
[content appendFormat: [currentChild contentAsString]];
|
|
||||||
[content appendString: @"\n"];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (![content length])
|
|
||||||
{
|
|
||||||
response = [self responseWithStatus: 404
|
|
||||||
andString: @"Contact does not exist"];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
[response setHeader: @"text/plain; charset=utf-8"
|
|
||||||
forKey: @"content-type"];
|
|
||||||
[response appendContentString: content];
|
|
||||||
}
|
|
||||||
|
|
||||||
return response;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@end /* UIxContactsListView */
|
@end /* UIxContactsListView */
|
||||||
|
|
|
@ -99,11 +99,6 @@
|
||||||
actionClass = "UIxContactFolderActions";
|
actionClass = "UIxContactFolderActions";
|
||||||
actionName = "export";
|
actionName = "export";
|
||||||
};
|
};
|
||||||
raw = {
|
|
||||||
protectedBy = "View";
|
|
||||||
actionClass = "UIxContactFolderActions";
|
|
||||||
actionName = "raw";
|
|
||||||
};
|
|
||||||
exportFolder = {
|
exportFolder = {
|
||||||
protectedBy = "View";
|
protectedBy = "View";
|
||||||
actionClass = "UIxContactFolderActions";
|
actionClass = "UIxContactFolderActions";
|
||||||
|
@ -206,6 +201,11 @@
|
||||||
actionClass = "UIxContactActions";
|
actionClass = "UIxContactActions";
|
||||||
actionName = "unsetCategory";
|
actionName = "unsetCategory";
|
||||||
};
|
};
|
||||||
|
raw = {
|
||||||
|
protectedBy = "View";
|
||||||
|
actionClass = "UIxContactActions";
|
||||||
|
actionName = "raw";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -238,6 +238,11 @@
|
||||||
pageName = "UIxListEditor";
|
pageName = "UIxListEditor";
|
||||||
actionName = "save";
|
actionName = "save";
|
||||||
};
|
};
|
||||||
|
raw = {
|
||||||
|
protectedBy = "View";
|
||||||
|
actionClass = "UIxContactActions";
|
||||||
|
actionName = "raw";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -565,6 +565,7 @@ vtodo_class2 = "(Confidential task)";
|
||||||
"Delete Task" = "Delete Task";
|
"Delete Task" = "Delete Task";
|
||||||
"Delete Event" = "Delete Event";
|
"Delete Event" = "Delete Event";
|
||||||
"Copy event to my calendar" = "Copy event to my calendar";
|
"Copy event to my calendar" = "Copy event to my calendar";
|
||||||
|
"View Raw Source" = "View Raw Source";
|
||||||
|
|
||||||
"Subscribe to a web calendar..." = "Subscribe to a web calendar...";
|
"Subscribe to a web calendar..." = "Subscribe to a web calendar...";
|
||||||
"URL of the Calendar" = "URL of the Calendar";
|
"URL of the Calendar" = "URL of the Calendar";
|
||||||
|
|
|
@ -2526,4 +2526,21 @@ RANGE(2);
|
||||||
return [[self clientObject] ownerInContext: context];
|
return [[self clientObject] ownerInContext: context];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// returns the raw content of the object
|
||||||
|
- (WOResponse *) rawAction
|
||||||
|
{
|
||||||
|
NSMutableString *content;
|
||||||
|
WOResponse *response;
|
||||||
|
|
||||||
|
content = [NSMutableString string];
|
||||||
|
response = [context response];
|
||||||
|
|
||||||
|
[content appendFormat: [[self clientObject] contentAsString]];
|
||||||
|
[response setHeader: @"text/plain; charset=utf-8"
|
||||||
|
forKey: @"content-type"];
|
||||||
|
[response appendContentString: content];
|
||||||
|
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -235,6 +235,11 @@
|
||||||
actionClass = "UIxAppointmentActions";
|
actionClass = "UIxAppointmentActions";
|
||||||
actionName = "copy";
|
actionName = "copy";
|
||||||
};
|
};
|
||||||
|
raw = {
|
||||||
|
protectedBy = "ViewAllComponent";
|
||||||
|
actionClass = "UIxComponentEditor";
|
||||||
|
actionName = "raw";
|
||||||
|
};
|
||||||
accept = {
|
accept = {
|
||||||
protectedBy = "RespondToComponent";
|
protectedBy = "RespondToComponent";
|
||||||
pageName = "UIxAppointmentEditor";
|
pageName = "UIxAppointmentEditor";
|
||||||
|
@ -304,6 +309,11 @@
|
||||||
pageName = "UIxTaskEditor";
|
pageName = "UIxTaskEditor";
|
||||||
actionName = "changeStatus";
|
actionName = "changeStatus";
|
||||||
};
|
};
|
||||||
|
raw = {
|
||||||
|
protectedBy = "ViewAllComponent";
|
||||||
|
pageName = "UIxComponentEditor";
|
||||||
|
actionName = "raw";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -84,7 +84,7 @@
|
||||||
<li><var:string label:value="Move To" /></li>
|
<li><var:string label:value="Move To" /></li>
|
||||||
<li><var:string label:value="Copy To" /></li>
|
<li><var:string label:value="Copy To" /></li>
|
||||||
<li><var:string label:value="Export" /></li>
|
<li><var:string label:value="Export" /></li>
|
||||||
<li><var:string label:value="Show vCard content" /></li>
|
<li><var:string label:value="View Raw Source" /></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
<li><!-- separator --></li>
|
<li><!-- separator --></li>
|
||||||
<li><var:string label:value="Delete Event"/></li>
|
<li><var:string label:value="Delete Event"/></li>
|
||||||
<li><var:string label:value="Copy event to my calendar"/></li>
|
<li><var:string label:value="Copy event to my calendar"/></li>
|
||||||
|
<li><var:string label:value="View Raw Source"/></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<a href="#"
|
<a href="#"
|
||||||
|
|
|
@ -72,6 +72,8 @@
|
||||||
<li><!-- separator --></li>
|
<li><!-- separator --></li>
|
||||||
<li><var:string label:value="Mark Completed"/></li>
|
<li><var:string label:value="Mark Completed"/></li>
|
||||||
<li><var:string label:value="Delete Task"/></li>
|
<li><var:string label:value="Delete Task"/></li>
|
||||||
|
<li><!-- separator --></li>
|
||||||
|
<li><var:string label:value="View Raw Source"/></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
<li><!-- separator --></li>
|
<li><!-- separator --></li>
|
||||||
<li><var:string label:value="Delete Event"/></li>
|
<li><var:string label:value="Delete Event"/></li>
|
||||||
<li><var:string label:value="Copy event to my calendar"/></li>
|
<li><var:string label:value="Copy event to my calendar"/></li>
|
||||||
|
<li><var:string label:value="View Raw Source"/></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<a href="#"
|
<a href="#"
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
<li><!-- separator --></li>
|
<li><!-- separator --></li>
|
||||||
<li><var:string label:value="Delete Event"/></li>
|
<li><var:string label:value="Delete Event"/></li>
|
||||||
<li><var:string label:value="Copy event to my calendar"/></li>
|
<li><var:string label:value="Copy event to my calendar"/></li>
|
||||||
|
<li><var:string label:value="View Raw Source"/></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<a href="#"
|
<a href="#"
|
||||||
|
|
|
@ -291,17 +291,12 @@ function onMenuExportContact (event) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function onMenuRawContact (event) {
|
function onMenuRawContact (event) {
|
||||||
var selectedFolders = $("contactFolders").getSelectedNodes();
|
var cname = document.menuTarget.collect(function(row) {
|
||||||
var canExport = (selectedFolders[0].getAttribute("owner") != "nobody");
|
return row.readAttribute("id");
|
||||||
if (canExport) {
|
});
|
||||||
var selectedFolderId = $(selectedFolders[0]).readAttribute("id");
|
|
||||||
var contactIds = document.menuTarget.collect(function(row) {
|
openGenericWindow(URLForFolderID(Contact.currentAddressBook)
|
||||||
return row.readAttribute("id");
|
+ "/" + cname + "/raw");
|
||||||
});
|
|
||||||
var url = ApplicationBaseURL + selectedFolderId + "/raw"
|
|
||||||
+ "?uid=" + contactIds.join("&uid=");
|
|
||||||
openGenericWindow(url);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function actionContactCallback(http) {
|
function actionContactCallback(http) {
|
||||||
|
|
|
@ -414,6 +414,18 @@ function copyEventCallback(http) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onMenuRawEvent(event) {
|
||||||
|
if (selectedCalendarCell.length != 1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var calendar = selectedCalendarCell[0].calendar;
|
||||||
|
var cname = selectedCalendarCell[0].cname;
|
||||||
|
|
||||||
|
var url = ApplicationBaseURL + calendar + "/" + cname + "/raw"
|
||||||
|
openGenericWindow(url);
|
||||||
|
}
|
||||||
|
|
||||||
function modifyEvent(sender, modification, parameters) {
|
function modifyEvent(sender, modification, parameters) {
|
||||||
var currentLocation = '' + window.location;
|
var currentLocation = '' + window.location;
|
||||||
var arr = currentLocation.split("/");
|
var arr = currentLocation.split("/");
|
||||||
|
@ -1898,7 +1910,9 @@ function calendarDisplayCallback(http) {
|
||||||
loadNextView,
|
loadNextView,
|
||||||
"-",
|
"-",
|
||||||
deleteEvent,
|
deleteEvent,
|
||||||
copyEventToPersonalCalendar);
|
copyEventToPersonalCalendar,
|
||||||
|
onMenuRawEvent
|
||||||
|
);
|
||||||
var observer;
|
var observer;
|
||||||
if (currentView == 'dayview') {
|
if (currentView == 'dayview') {
|
||||||
observer = $("daysView");
|
observer = $("daysView");
|
||||||
|
@ -2539,9 +2553,11 @@ function onMenuCurrentViewPrepareVisibility() {
|
||||||
var options = $(this).down("ul");
|
var options = $(this).down("ul");
|
||||||
var deleteOption = options.down("li", 6);
|
var deleteOption = options.down("li", 6);
|
||||||
var copyOption = options.down("li", 7);
|
var copyOption = options.down("li", 7);
|
||||||
|
var rawOption = options.down("li", 8);
|
||||||
if (!selectedCalendarCell) {
|
if (!selectedCalendarCell) {
|
||||||
deleteOption.addClassName("disabled");
|
deleteOption.addClassName("disabled");
|
||||||
copyOption.addClassName("disabled");
|
copyOption.addClassName("disabled");
|
||||||
|
rawOption.addClassName("disabled");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
deleteOption.removeClassName("disabled");
|
deleteOption.removeClassName("disabled");
|
||||||
|
@ -2550,11 +2566,29 @@ function onMenuCurrentViewPrepareVisibility() {
|
||||||
copyOption.addClassName("disabled");
|
copyOption.addClassName("disabled");
|
||||||
else
|
else
|
||||||
copyOption.removeClassName("disabled");
|
copyOption.removeClassName("disabled");
|
||||||
|
if (selectedCalendarCell.length == 1) {
|
||||||
|
// show raw content is only allowed for single event
|
||||||
|
rawOption.removeClassName("disabled");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
rawOption.addClassName("disabled");
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onTasksListMenuPrepareVisibility() {
|
||||||
|
var options = $(this).down("ul");
|
||||||
|
var rawOption = options.down("li", 6);
|
||||||
|
|
||||||
|
var selectedTasks = $$("UL#tasksList LI._selected");
|
||||||
|
if (selectedTasks.length == 1)
|
||||||
|
rawOption.removeClassName("disabled");
|
||||||
|
else
|
||||||
|
rawOption.addClassName("disabled");
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
function getMenus() {
|
function getMenus() {
|
||||||
var menus = {};
|
var menus = {};
|
||||||
|
|
||||||
|
@ -2581,12 +2615,17 @@ function getMenus() {
|
||||||
menus["searchMenu"] = new Array(setSearchCriteria);
|
menus["searchMenu"] = new Array(setSearchCriteria);
|
||||||
|
|
||||||
menus["tasksListMenu"] = new Array (editEvent, newTask, "-",
|
menus["tasksListMenu"] = new Array (editEvent, newTask, "-",
|
||||||
marksTasksAsCompleted, deleteEvent);
|
marksTasksAsCompleted, deleteEvent, "-",
|
||||||
|
onMenuRawTask);
|
||||||
|
|
||||||
var calendarsMenu = $("calendarsMenu");
|
var calendarsMenu = $("calendarsMenu");
|
||||||
if (calendarsMenu)
|
if (calendarsMenu)
|
||||||
calendarsMenu.prepareVisibility = onCalendarsMenuPrepareVisibility;
|
calendarsMenu.prepareVisibility = onCalendarsMenuPrepareVisibility;
|
||||||
|
|
||||||
|
var tasksListMenu = $("tasksListMenu");
|
||||||
|
if (tasksListMenu)
|
||||||
|
tasksListMenu.prepareVisibility = onTasksListMenuPrepareVisibility;
|
||||||
|
|
||||||
return menus;
|
return menus;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2612,6 +2651,17 @@ function _updateTaskCompletion (task, value) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onMenuRawTask(event) {
|
||||||
|
var selectedTasks = $$("UL#tasksList LI._selected");
|
||||||
|
if (selectedTasks.length != 1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var url = ApplicationBaseURL + selectedTasks[0].calendar + "/" + selectedTasks[0].cname + "/raw"
|
||||||
|
openGenericWindow(url);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function onMenuSharing(event) {
|
function onMenuSharing(event) {
|
||||||
if ($(this).hasClassName("disabled"))
|
if ($(this).hasClassName("disabled"))
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue