mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-06-13 06:09:43 +00:00
* 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:07
This commit is contained in:
@@ -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) {
|
||||
var currentLocation = '' + window.location;
|
||||
var arr = currentLocation.split("/");
|
||||
@@ -1898,7 +1910,9 @@ function calendarDisplayCallback(http) {
|
||||
loadNextView,
|
||||
"-",
|
||||
deleteEvent,
|
||||
copyEventToPersonalCalendar);
|
||||
copyEventToPersonalCalendar,
|
||||
onMenuRawEvent
|
||||
);
|
||||
var observer;
|
||||
if (currentView == 'dayview') {
|
||||
observer = $("daysView");
|
||||
@@ -2539,9 +2553,11 @@ function onMenuCurrentViewPrepareVisibility() {
|
||||
var options = $(this).down("ul");
|
||||
var deleteOption = options.down("li", 6);
|
||||
var copyOption = options.down("li", 7);
|
||||
var rawOption = options.down("li", 8);
|
||||
if (!selectedCalendarCell) {
|
||||
deleteOption.addClassName("disabled");
|
||||
copyOption.addClassName("disabled");
|
||||
rawOption.addClassName("disabled");
|
||||
}
|
||||
else {
|
||||
deleteOption.removeClassName("disabled");
|
||||
@@ -2550,11 +2566,29 @@ function onMenuCurrentViewPrepareVisibility() {
|
||||
copyOption.addClassName("disabled");
|
||||
else
|
||||
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;
|
||||
}
|
||||
|
||||
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() {
|
||||
var menus = {};
|
||||
|
||||
@@ -2581,12 +2615,17 @@ function getMenus() {
|
||||
menus["searchMenu"] = new Array(setSearchCriteria);
|
||||
|
||||
menus["tasksListMenu"] = new Array (editEvent, newTask, "-",
|
||||
marksTasksAsCompleted, deleteEvent);
|
||||
marksTasksAsCompleted, deleteEvent, "-",
|
||||
onMenuRawTask);
|
||||
|
||||
var calendarsMenu = $("calendarsMenu");
|
||||
if (calendarsMenu)
|
||||
calendarsMenu.prepareVisibility = onCalendarsMenuPrepareVisibility;
|
||||
|
||||
var tasksListMenu = $("tasksListMenu");
|
||||
if (tasksListMenu)
|
||||
tasksListMenu.prepareVisibility = onTasksListMenuPrepareVisibility;
|
||||
|
||||
return menus;
|
||||
}
|
||||
|
||||
@@ -2612,6 +2651,17 @@ function _updateTaskCompletion (task, value) {
|
||||
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) {
|
||||
if ($(this).hasClassName("disabled"))
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user