mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-10 17:24:29 +00:00
bug #367110 Missing Thunderbird integration for copy/paste r1=lilmatt,r2=mvl
This commit is contained in:
parent
bac4e07c9a
commit
a228a849a6
@ -42,6 +42,56 @@
|
|||||||
*
|
*
|
||||||
* ***** END LICENSE BLOCK ***** */
|
* ***** END LICENSE BLOCK ***** */
|
||||||
|
|
||||||
|
var CalendarController =
|
||||||
|
{
|
||||||
|
supportsCommand: function ccSC(command) {
|
||||||
|
switch (command) {
|
||||||
|
case "cmd_cut":
|
||||||
|
case "cmd_copy":
|
||||||
|
case "cmd_paste":
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
|
||||||
|
isCommandEnabled: function ccICE(command) {
|
||||||
|
switch (command) {
|
||||||
|
case "cmd_cut":
|
||||||
|
case "cmd_copy":
|
||||||
|
return currentView().getSelectedItems({}).length != 0;
|
||||||
|
case "cmd_paste":
|
||||||
|
return canPaste();
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
|
||||||
|
doCommand: function ccDC(command) {
|
||||||
|
// if the user invoked a key short cut then it is possible that we got
|
||||||
|
// here for a command which is really disabled. kick out if the
|
||||||
|
// command should be disabled.
|
||||||
|
if (!this.isCommandEnabled(command)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch ( command )
|
||||||
|
{
|
||||||
|
case "cmd_cut":
|
||||||
|
cutToClipboard();
|
||||||
|
break;
|
||||||
|
case "cmd_copy":
|
||||||
|
copyToClipboard();
|
||||||
|
break;
|
||||||
|
case "cmd_paste":
|
||||||
|
pasteFromClipboard();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
onEvent: function ccOE(event) {
|
||||||
|
// do nothing here...
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
function ltnSidebarCalendarSelected(tree)
|
function ltnSidebarCalendarSelected(tree)
|
||||||
{
|
{
|
||||||
getCompositeCalendar().defaultCalendar = ltnSelectedCalendar();
|
getCompositeCalendar().defaultCalendar = ltnSelectedCalendar();
|
||||||
@ -196,6 +246,8 @@ function ltnOnLoad(event)
|
|||||||
null);
|
null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
top.controllers.insertControllerAt(0, CalendarController);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,6 +75,7 @@
|
|||||||
<script type="application/x-javascript" src="chrome://lightning/content/messenger-overlay-sidebar.js"/>
|
<script type="application/x-javascript" src="chrome://lightning/content/messenger-overlay-sidebar.js"/>
|
||||||
<script type="application/x-javascript" src="chrome://calendar/content/calendar-views.js"/>
|
<script type="application/x-javascript" src="chrome://calendar/content/calendar-views.js"/>
|
||||||
<script type="application/x-javascript" src="chrome://lightning/content/imip-bar.js"/>
|
<script type="application/x-javascript" src="chrome://lightning/content/imip-bar.js"/>
|
||||||
|
<script type="application/x-javascript" src="chrome://calendar/content/clipboard.js"/>
|
||||||
<window id="messengerWindow">
|
<window id="messengerWindow">
|
||||||
<commandset id="calendar_commands">
|
<commandset id="calendar_commands">
|
||||||
<command id="publish_calendar" oncommand="ltnPublishCalendar()"/>
|
<command id="publish_calendar" oncommand="ltnPublishCalendar()"/>
|
||||||
|
@ -46,6 +46,7 @@ calendar.jar:
|
|||||||
content/calendar/publish.js (/calendar/resources/content/publish.js)
|
content/calendar/publish.js (/calendar/resources/content/publish.js)
|
||||||
content/calendar/publishDialog.js (/calendar/resources/content/publishDialog.js)
|
content/calendar/publishDialog.js (/calendar/resources/content/publishDialog.js)
|
||||||
content/calendar/publishDialog.xul (/calendar/resources/content/publishDialog.xul)
|
content/calendar/publishDialog.xul (/calendar/resources/content/publishDialog.xul)
|
||||||
|
content/calendar/clipboard.js (/calendar/resources/content/clipboard.js)
|
||||||
content/calendar/sun-calendar-event-dialog.css (/calendar/prototypes/wcap/sun-calendar-event-dialog.css)
|
content/calendar/sun-calendar-event-dialog.css (/calendar/prototypes/wcap/sun-calendar-event-dialog.css)
|
||||||
content/calendar/sun-calendar-event-dialog.js (/calendar/prototypes/wcap/sun-calendar-event-dialog.js)
|
content/calendar/sun-calendar-event-dialog.js (/calendar/prototypes/wcap/sun-calendar-event-dialog.js)
|
||||||
content/calendar/sun-calendar-event-dialog.xul (/calendar/prototypes/wcap/sun-calendar-event-dialog.xul)
|
content/calendar/sun-calendar-event-dialog.xul (/calendar/prototypes/wcap/sun-calendar-event-dialog.xul)
|
||||||
|
@ -264,38 +264,6 @@ function getSelectedCalendarOrNull()
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* This is called from the unifinder's delete command
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
function deleteItems( SelectedItems, DoNotConfirm )
|
|
||||||
{
|
|
||||||
if (!SelectedItems)
|
|
||||||
return;
|
|
||||||
|
|
||||||
startBatchTransaction();
|
|
||||||
for (i in SelectedItems) {
|
|
||||||
var aOccurrence = SelectedItems[i];
|
|
||||||
if (aOccurrence.parentItem != aOccurrence) {
|
|
||||||
var event = aOccurrence.parentItem.clone();
|
|
||||||
event.recurrenceInfo.removeOccurrenceAt(aOccurrence.recurrenceId);
|
|
||||||
doTransaction('modify', event, event.calendar, aOccurrence.parentItem, null);
|
|
||||||
} else {
|
|
||||||
doTransaction('delete', aOccurrence, aOccurrence.calendar, null, null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
endBatchTransaction();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Delete the current selected items with focus from the unifinder list
|
|
||||||
*/
|
|
||||||
function deleteEventCommand( DoNotConfirm )
|
|
||||||
{
|
|
||||||
var SelectedItems = currentView().getSelectedItems({});
|
|
||||||
deleteItems( SelectedItems, DoNotConfirm );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -251,8 +251,9 @@ function pasteFromClipboard()
|
|||||||
if (!earliestDate || date.compare(earliestDate) < 0)
|
if (!earliestDate || date.compare(earliestDate) < 0)
|
||||||
earliestDate = date;
|
earliestDate = date;
|
||||||
}
|
}
|
||||||
var destCal = getDefaultCalendar();
|
var destCal = ("ltnSelectedCalendar" in window) ?
|
||||||
var firstDate = document.getElementById("view-deck").selectedPanel.selectedDay;
|
ltnSelectedCalendar() : getDefaultCalendar();
|
||||||
|
var firstDate = currentView().selectedDay;
|
||||||
if (!firstDate.isMutable) {
|
if (!firstDate.isMutable) {
|
||||||
firstDate = firstDate.clone();
|
firstDate = firstDate.clone();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user