Commit c54910f6 authored by Carsten Schoenert's avatar Carsten Schoenert
Browse files

Update upstream source from tag 'upstream/91.3.2'

Update to upstream version '91.3.2'
with Debian dir dd2b75f2efbe145ee3453f8902ae2fa751ff54df
parents 55c0c71e 7fd56f0e
......@@ -1113,8 +1113,8 @@
const colBox = col.column.findChunkForOccurrence(item);
const headerBox = col.header.findBoxForItem(item);
if (colBox && colBox.eventbox) {
setFlashingAttribute(colBox.eventbox);
if (colBox) {
setFlashingAttribute(colBox);
}
if (headerBox) {
setFlashingAttribute(headerBox);
......
......@@ -11,10 +11,10 @@
/* import-globals-from ../../../../toolkit/components/printing/content/print.js */
const { cal } = ChromeUtils.import("resource:///modules/calendar/calUtils.jsm");
// In a block to avoid polluting the global scope.
{
const { cal } = ChromeUtils.import("resource:///modules/calendar/calUtils.jsm");
let ownerWindow = window.browsingContext.topChromeWindow;
let ownerDocument = ownerWindow.document;
......@@ -25,6 +25,11 @@
ownerDocument.getElementById("calendarPrintForm").content.firstElementChild,
true
);
if (AppConstants.platform != "win") {
// Move the Next button to the end if this isn't Windows.
let nextButton = form.querySelector("#next-button");
nextButton.parentElement.append(nextButton);
}
form.addEventListener("submit", event => {
event.preventDefault();
form.hidden = true;
......@@ -32,15 +37,39 @@
});
otherForm.parentNode.insertBefore(form, otherForm);
let backButton = form.querySelector("#back-button");
backButton.addEventListener("click", () => {
otherForm.hidden = true;
form.hidden = false;
});
let cancelButton = otherForm.querySelector("#cancel-button");
cancelButton.parentNode.replaceChild(backButton, cancelButton);
let eventsCheckbox = form.querySelector("input#events");
let tasksCheckbox = form.querySelector("input#tasks");
let tasksNotDueCheckbox = form.querySelector("input#tasks-with-no-due-date");
let tasksCompletedCheckbox = form.querySelector("input#completed-tasks");
let layout = form.querySelector("select#layout");
let fromMinimonth = form.querySelector("calendar-minimonth#from-minimonth");
let fromMonth = form.querySelector("select#from-month");
let fromYear = form.querySelector("input#from-year");
let fromDate = form.querySelector("select#from-date");
let toMinimonth = form.querySelector("calendar-minimonth#to-minimonth");
let toMonth = form.querySelector("select#to-month");
let toYear = form.querySelector("input#to-year");
let toDate = form.querySelector("select#to-date");
for (let i = 0; i < 12; i++) {
let option = document.createElement("option");
option.value = i;
option.label = cal.l10n.formatMonth(i + 1, "calendar", "monthInYear");
fromMonth.appendChild(option.cloneNode(false));
toMonth.appendChild(option);
}
eventsCheckbox.addEventListener("change", updatePreview);
tasksCheckbox.addEventListener("change", function() {
tasksNotDueCheckbox.disabled = !this.checked;
......@@ -51,6 +80,47 @@
tasksCompletedCheckbox.addEventListener("change", updatePreview);
layout.addEventListener("change", onLayoutChange);
fromMinimonth.addEventListener("change", function() {
if (toMinimonth.value < fromMinimonth.value) {
toMinimonth.value = fromMinimonth.value;
}
updatePreview();
});
toMinimonth.addEventListener("change", updatePreview);
fromMonth.addEventListener("keydown", function(event) {
if (event.key == "ArrowDown" && fromMonth.selectedIndex == 11) {
fromMonth.selectedIndex = 0;
fromYear.value++;
onMonthChange();
event.preventDefault();
} else if (event.key == "ArrowUp" && fromMonth.selectedIndex == 0) {
fromMonth.selectedIndex = 11;
fromYear.value--;
onMonthChange();
event.preventDefault();
}
});
fromMonth.addEventListener("change", onMonthChange);
fromYear.addEventListener("change", onMonthChange);
toMonth.addEventListener("keydown", function(event) {
if (event.key == "ArrowDown" && toMonth.selectedIndex == 11) {
toMonth.selectedIndex = 0;
toYear.value++;
onMonthChange();
event.preventDefault();
} else if (event.key == "ArrowUp" && toMonth.selectedIndex == 0) {
toMonth.selectedIndex = 11;
toYear.value--;
onMonthChange();
event.preventDefault();
}
});
toMonth.addEventListener("change", onMonthChange);
toYear.addEventListener("change", onMonthChange);
fromDate.addEventListener("change", function() {
let fromValue = parseInt(fromDate.value, 10);
for (let option of toDate.options) {
......@@ -85,17 +155,29 @@
* which actually fits better for some print layouts.
*/
function onLayoutChange() {
while (fromDate.lastChild) {
fromDate.lastChild.remove();
}
while (toDate.lastChild) {
toDate.lastChild.remove();
}
if (layout.value == "list") {
fromMinimonth.hidden = toMinimonth.hidden = false;
fromMonth.hidden = fromYear.hidden = toMonth.hidden = toYear.hidden = true;
fromDate.hidden = toDate.hidden = true;
} else if (layout.value == "monthGrid") {
let today = new Date();
fromMonth.value = toMonth.value = today.getMonth();
fromYear.value = toYear.value = today.getFullYear();
if (layout.value == "weekPlanner") {
const FIRST_WEEK = -6;
fromMinimonth.hidden = toMinimonth.hidden = true;
fromMonth.hidden = fromYear.hidden = toMonth.hidden = toYear.hidden = false;
fromDate.hidden = toDate.hidden = true;
} else {
const FIRST_WEEK = -53;
const LAST_WEEK = 53;
while (fromDate.lastChild) {
fromDate.lastChild.remove();
}
while (toDate.lastChild) {
toDate.lastChild.remove();
}
// Always use Monday - Sunday week, regardless of prefs, because the layout requires it.
let monday = cal.dtz.now();
monday.isDate = true;
......@@ -115,31 +197,24 @@
monday.day += 7;
}
} else {
const FIRST_MONTH = -3;
const LAST_MONTH = 12;
let first = cal.dtz.now();
first.isDate = true;
first.day = 1;
first.month += FIRST_MONTH;
for (let i = FIRST_MONTH; i < LAST_MONTH; i++) {
let option = document.createElement("option");
option.value = i;
let monthName = cal.l10n.formatMonth(first.month + 1, "calendar", "monthInYear");
option.label = cal.l10n.getCalString("monthInYear", [monthName, first.year]);
fromDate.appendChild(option.cloneNode(false));
option.hidden = i < 0;
toDate.appendChild(option);
fromDate.value = toDate.value = 0;
first.month++;
}
fromMinimonth.hidden = toMinimonth.hidden = true;
fromMonth.hidden = fromYear.hidden = toMonth.hidden = toYear.hidden = true;
fromDate.hidden = toDate.hidden = false;
}
fromDate.value = toDate.value = 0;
updatePreview();
}
function onMonthChange() {
if (parseInt(toYear.value, 10) < fromYear.value) {
toYear.value = fromYear.value;
toMonth.value = fromMonth.value;
} else if (toYear.value == fromYear.value && parseInt(toMonth.value, 10) < fromMonth.value) {
toMonth.value = fromMonth.value;
}
updatePreview();
}
......@@ -152,16 +227,48 @@
let endDate = cal.dtz.now();
endDate.isDate = true;
if (layout.value == "weekPlanner") {
if (layout.value == "list") {
let fromValue = fromMinimonth.value;
let toValue = toMinimonth.value;
startDate.resetTo(
fromValue.getFullYear(),
fromValue.getMonth(),
fromValue.getDate(),
0,
0,
0,
cal.dtz.floating
);
startDate.isDate = true;
if (toValue > fromValue) {
endDate.resetTo(
toValue.getFullYear(),
toValue.getMonth(),
toValue.getDate(),
0,
0,
0,
cal.dtz.floating
);
endDate.isDate = true;
} else {
endDate = startDate.clone();
}
endDate.day++;
} else if (layout.value == "monthGrid") {
startDate.day = 1;
startDate.month = parseInt(fromMonth.value, 10);
startDate.year = parseInt(fromYear.value, 10);
endDate.day = 1;
endDate.month = parseInt(toMonth.value, 10);
endDate.year = parseInt(toYear.value, 10);
endDate.month++;
} else {
startDate.day = startDate.day - startDate.weekday + 1;
startDate.day += parseInt(fromDate.value, 10) * 7;
endDate.day = endDate.day - endDate.weekday + 1;
endDate.day += parseInt(toDate.value, 10) * 7 + 7;
} else {
startDate.day = 1;
startDate.month += parseInt(fromDate.value, 10);
endDate.day = 1;
endDate.month += parseInt(toDate.value, 10) + 1;
}
let filter = 0;
......
......@@ -678,35 +678,45 @@
</label>
</section>
<!-- It would be nice to use HTML date inputs here but the browser this form is loaded
into won't allow it. Instead use lists of the most likely values, which actually fits
better for some print layouts. -->
<section class="section-block">
<label class="block-label" data-l10n-id="calendar-print-range-from"></label>
<fieldset class="section-block">
<legend class="block-label" data-l10n-id="calendar-print-range-from"></legend>
<xul:calendar-minimonth id="from-minimonth"></xul:calendar-minimonth>
<select id="from-month"></select>
<input id="from-year" type="number" size="1"/>
<select id="from-date"></select>
</section>
<section class="section-block">
<label class="block-label" data-l10n-id="calendar-print-range-to"></label>
</fieldset>
<fieldset class="section-block">
<legend class="block-label" data-l10n-id="calendar-print-range-to"></legend>
<xul:calendar-minimonth id="to-minimonth"></xul:calendar-minimonth>
<select id="to-month"></select>
<input id="to-year" type="number" size="1"/>
<select id="to-date"></select>
</section>
</fieldset>
</section>
<hr />
<footer class="footer-container" id="print-footer" role="none">
<section id="button-container" class="section-block">
<button id="next-button"
class="primary"
type="submit"
showfocus=""
autocomplete="off"
data-l10n-id="calendar-print-next-button"></button>
<button is="cancel-button"
type="button"
data-l10n-id="printui-cancel-button"
data-close-l10n-id="printui-close-button"
data-cancel-l10n-id="printui-cancel-button"></button>
<button class="primary"
type="submit"
showfocus=""
autocomplete="off"
data-l10n-id="calendar-print-next-button"></button>
</section>
</footer>
<!-- This button will replace the original cancel button. -->
<button id="back-button"
type="button"
autocomplete="off"
data-l10n-id="calendar-print-back-button"></button>
</form>
</template>
</vbox>
......@@ -143,10 +143,21 @@ async function setUpItemSummaries() {
let items = [...gModel.itemsToImport];
let itemsContainer = document.getElementById("calendar-ics-file-dialog-items-container");
// Sort the items, chronologically first, then alphabetically.
// Sort the items, chronologically first, tasks without a date to the end,
// then alphabetically.
let collator = new Intl.Collator(undefined, { numeric: true });
items.sort(([, a], [, b]) => {
return a.startDate.nativeTime - b.startDate.nativeTime || collator.compare(a.title, b.title);
let aStartDate =
a.startDate?.nativeTime ||
a.entryDate?.nativeTime ||
a.dueDate?.nativeTime ||
Number.MAX_SAFE_INTEGER;
let bStartDate =
b.startDate?.nativeTime ||
b.entryDate?.nativeTime ||
b.dueDate?.nativeTime ||
Number.MAX_SAFE_INTEGER;
return aStartDate - bStartDate || collator.compare(a.title, b.title);
});
let [eventButtonText, taskButtonText] = await document.l10n.formatValues([
......
......@@ -71,26 +71,21 @@
<hbox class="minimonth-header minimonth-month-box" align="center">
<toolbarbutton class="months-back-button minimonth-nav-btns"
dir="-1"
oncommand="this.kMinimonth.advanceMonth(parseInt(this.getAttribute('dir'), 10))"
tooltiptext="&onemonthbackward.tooltip;"></toolbarbutton>
<label class="minimonth-month-name" tabindex="-1"/>
<toolbarbutton class="months-forward-button minimonth-nav-btns"
dir="1"
oncommand="this.kMinimonth.advanceMonth(parseInt(this.getAttribute('dir'), 10))"
tooltiptext="&onemonthforward.tooltip;"></toolbarbutton>
<toolbarbutton class="years-back-button minimonth-nav-btns"
dir="-1"
oncommand="this.kMinimonth.advanceYear(parseInt(this.getAttribute('dir'), 10))"
tooltiptext="&oneyearbackward.tooltip;"></toolbarbutton>
<label class="yearcell minimonth-year-name" tabindex="-1"></label>
<toolbarbutton class="years-forward-button minimonth-nav-btns"
dir="1"
oncommand="this.kMinimonth.advanceYear(parseInt(this.getAttribute('dir'), 10))"
tooltiptext="&oneyearforward.tooltip;"></toolbarbutton>
<spacer flex="1"></spacer>
<toolbarbutton class="today-button minimonth-nav-btns"
dir="0"
oncommand="this.kMinimonth.value = new Date();"
tooltiptext="&showToday.tooltip;"></toolbarbutton>
</hbox>
`;
......@@ -139,12 +134,21 @@
this.setAttribute("orient", "vertical");
// Set up header buttons.
const kMinimonth = this.closest("calendar-minimonth");
this.querySelector(".months-back-button").kMinimonth = kMinimonth;
this.querySelector(".months-forward-button").kMinimonth = kMinimonth;
this.querySelector(".years-back-button").kMinimonth = kMinimonth;
this.querySelector(".years-forward-button").kMinimonth = kMinimonth;
this.querySelector(".today-button").kMinimonth = kMinimonth;
this.querySelector(".months-back-button").addEventListener("command", () =>
this.advanceMonth(-1)
);
this.querySelector(".months-forward-button").addEventListener("command", () =>
this.advanceMonth(1)
);
this.querySelector(".years-back-button").addEventListener("command", () =>
this.advanceYear(-1)
);
this.querySelector(".years-forward-button").addEventListener("command", () =>
this.advanceYear(1)
);
this.querySelector(".today-button").addEventListener("command", () => {
this.value = new Date();
});
this.mDayMap = null;
this.mValue = null;
......
......@@ -314,17 +314,8 @@ let listView = {
}
// Set the page title.
let startMonth = cal.l10n.formatMonth(startDate.month + 1, "calendar", "monthInYear");
let startMonthTitle = cal.l10n.getCalString("monthInYear", [startMonth, startDate.year]);
endDate.day--;
let endMonth = cal.l10n.formatMonth(endDate.month + 1, "calendar", "monthInYear");
let endMonthTitle = cal.l10n.getCalString("monthInYear", [endMonth, endDate.year]);
if (startMonthTitle == endMonthTitle) {
document.title = startMonthTitle;
} else {
document.title = `${startMonthTitle} – ${endMonthTitle}`;
}
document.title = cal.dtz.formatter.formatInterval(startDate, endDate);
},
};
......@@ -616,6 +607,10 @@ Services.obs.addObserver(
return;
}
Services.scriptloader.loadSubScript(
"chrome://calendar/content/widgets/calendar-minimonth.js",
subDialogWindow
);
Services.scriptloader.loadSubScript(
"chrome://calendar/content/calendar-print.js",
subDialogWindow
......
......@@ -2,11 +2,32 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, you can obtain one at http://mozilla.org/MPL/2.0/. */
@import url("chrome://calendar/skin/shared/widgets/minimonth.css");
#calendar-print {
flex: 1;
display: flex;
flex-direction: column;
font: menu;
overflow: auto;
}
#calendar-print fieldset.section-block {
border: none;
padding: 0;
display: flex;
}
#calendar-print select#from-month,
#calendar-print select#to-month {
flex: 1;
}
#calendar-print input#from-year,
#calendar-print input#to-year {
flex: 1;
margin-block: 0;
margin-inline: 3px 0;
}
#calendar-print select {
......@@ -17,3 +38,8 @@
padding-inline-start: 1.5em;
box-sizing: border-box;
}
calendar-minimonth {
padding: 0;
width: 100%;
}
......@@ -16,4 +16,5 @@ calendar-print-filter-taskswithnoduedate = Tasks with no due date
calendar-print-range-from = From
calendar-print-range-to = To
calendar-print-back-button = Back
calendar-print-next-button = Next
......@@ -66,7 +66,12 @@ async function handleWizard(wizardWindow, { username, url, password, expectedCal
// Select calendars.
let list = wizardDocument.getElementById("network-calendar-list");
await TestUtils.waitForCondition(() => BrowserTestUtils.is_visible(list));
await TestUtils.waitForCondition(
() => BrowserTestUtils.is_visible(list),
"waiting for calendar list to appear",
200,
100
);
Assert.equal(list.childElementCount, expectedCalendars.length);
for (let i = 0; i < expectedCalendars.length; i++) {
......
......@@ -82,10 +82,14 @@
return false;
}
let showHTMLTooltip = false;
// Reset tooltip.
let largeTooltip = this.querySelector(".largeTooltip");
largeTooltip.hidden = false;
this.removeAttribute("label");
let htmlTooltip = this.querySelector(".htmlTooltip");
htmlTooltip.hidden = true;
// We have a few cases that have special behavior. These are richlistitems
// and have tooltip="<myid>".
......@@ -176,11 +180,27 @@
// we are pointing at carries a title set by the prpl,
// that title won't be overridden.
node.setAttribute("title", text);
showHTMLTooltip = true;
break;
}
// Use the default content tooltip.
largeTooltip.hidden = true;
// Show the title in the tooltip
if (showHTMLTooltip) {
let content = this.triggerNode.getAttribute("title");
if (!content) {
let closestTitle = this.triggerNode.closest("[title]");
if (closestTitle) {
content = closestTitle.getAttribute("title");
}
}
if (!content) {
return false;
}
htmlTooltip.textContent = content;
htmlTooltip.hidden = false;
return true;
}
return false;
}
......@@ -207,6 +227,7 @@
<html:table class="tooltipTable">
</html:table>
</vbox>
<html:div class="htmlTooltip" hidden="hidden"></html:div>
`)
);
this.initializeAttributeInheritance();
......
......@@ -70,6 +70,10 @@
<key>org.mozilla.updater</key>
<string>identifier "org.mozilla.updater" and ((anchor apple generic and certificate leaf[field.1.2.840.113635.100.6.1.9]) or (anchor apple generic and certificate 1[field.1.2.840.113635.100.6.2.6] and certificate leaf[field.1.2.840.113635.100.6.1.13] and certificate leaf[subject.OU] = "43AQ936H96"))</string>
</dict>
<key>MozillaDeveloperRepoPath</key>
<string>@MOZ_DEVELOPER_REPO_PATH@</string>
<key>MozillaDeveloperObjPath</key>
<string>@MOZ_DEVELOPER_OBJ_PATH@</string>
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
......
......@@ -778,7 +778,6 @@ pref("chat.otr.default.allowMsgLog", true);
// BigFiles
pref("mail.cloud_files.enabled", true);
pref("mail.cloud_files.inserted_urls.footer.link", "https://www.thunderbird.net");
pref("mail.cloud_files.learn_more_url", "https://support.thunderbird.net/kb/filelink-large-attachments");
// Ignore threads
......
......@@ -6,7 +6,7 @@
--in-content-categories-background: #ebebef;
}
@media (prefers-color-scheme: dark) {
@media (-moz-toolbar-prefers-color-scheme: dark) {
:root {
--in-content-categories-background: rgba(249, 249, 250, 0.1);
--in-content-primary-button-background: #45a1ff !important;
......
......@@ -28,6 +28,18 @@ XPCOMUtils.defineLazyPreferenceGetter(
(async function() {
window.MozXULElement.insertFTLIfNeeded("messenger/aboutAddonsExtra.ftl");
// Consume clicks on a-tags and let openTrustedLinkIn() decide how to open them.
window.addEventListener("click", event => {
if (event.target.matches("a[href]") && event.target.href) {
let uri = Services.io.newURI(event.target.href);
if (uri.scheme == "http" || uri.scheme == "https") {
event.preventDefault();
event.stopPropagation();
windowRoot.ownerGlobal.openTrustedLinkIn(event