diff -Nru thunderbird-trunk-37.0~a1~hg20141215r17212.219503/build/win32/mozconfig.vs2013-win64 thunderbird-trunk-37.0~a1~hg20150106r17307.222089/build/win32/mozconfig.vs2013-win64 --- thunderbird-trunk-37.0~a1~hg20141215r17212.219503/build/win32/mozconfig.vs2013-win64 1970-01-01 00:00:00.000000000 +0000 +++ thunderbird-trunk-37.0~a1~hg20150106r17307.222089/build/win32/mozconfig.vs2013-win64 2015-01-06 13:13:43.000000000 +0000 @@ -0,0 +1,28 @@ +_VSPATH="/c/tools/vs2013" +export WIN32_REDIST_DIR=${_VSPATH}/VC/redist/x86/Microsoft.VC120.CRT + +## moz tools location for 64-bit builders ## +export MOZ_TOOLS=C:/mozilla-build/moztools + +## includes: win8.1 sdk includes, winrt headers for metro, msvc std library, directx sdk for d3d9 ## +export INCLUDE=/c/Program\ Files\ \(x86\)/Windows\ Kits/8.1/include/shared:/c/Program\ Files\ \(x86\)/Windows\ Kits/8.1/include/um:/c/Program\ Files\ \(x86\)/Windows\ Kits/8.1/include/winrt:/c/Program\ Files\ \(x86\)/Windows\ Kits/8.1/include/winrt/wrl:/c/Program\ Files\ \(x86\)/Windows\ Kits/8.1/include/winrt/wrl/wrappers:${_VSPATH}/vc/include:${_VSPATH}/vc/atlmfc/include:/c/tools/sdks/dx10/include + +## libs: win8.1 sdk x86 (32-bit) libs, msvc (32-bit) std library, msvc atl libs, directx sdk (32-bit) for d3d9 ## +export LIBPATH=/c/Program\ Files\ \(x86\)/Windows\ Kits/8.1/Lib/winv6.3/um/x86:${_VSPATH}/vc/lib:${_VSPATH}/vc/atlmfc/lib:/c/tools/sdks/dx10/lib +export LIB=/c/Program\ Files\ \(x86\)/Windows\ Kits/8.1/Lib/winv6.3/um/x86:${_VSPATH}/vc/lib:${_VSPATH}/vc/atlmfc/lib:/c/tools/sdks/dx10/lib + +## paths: win8.1 sdk x86 (32-bit) tools, msvc (64-bit compiling 32-bit) build toolchain, moz tools ## +export PATH="/c/Program Files (x86)/Windows Kits/8.1/bin/x86:${_VSPATH}/Common7/IDE:${_VSPATH}/VC/BIN/amd64_x86:${_VSPATH}/VC/BIN/amd64:${_VSPATH}/Common7/Tools:${_VSPATH}/VC/VCPackages:/c/mozilla-build/moztools:${PATH}" + +## WindowsSDKDir ## +export WINDOWSSDKDIR="/c/Program Files (x86)/Windows Kits/8.1/" + +. $topsrcdir/build/mozconfig.vs-common + +mk_export_correct_style LIB +mk_export_correct_style LIBPATH +mk_export_correct_style PATH +mk_export_correct_style INCLUDE +mk_export_correct_style WIN32_REDIST_DIR + +mk_add_options "export MOZ_TOOLS=$MOZ_TOOLS" diff -Nru thunderbird-trunk-37.0~a1~hg20141215r17212.219503/build/win64/mozconfig.vs2013 thunderbird-trunk-37.0~a1~hg20150106r17307.222089/build/win64/mozconfig.vs2013 --- thunderbird-trunk-37.0~a1~hg20141215r17212.219503/build/win64/mozconfig.vs2013 1970-01-01 00:00:00.000000000 +0000 +++ thunderbird-trunk-37.0~a1~hg20150106r17307.222089/build/win64/mozconfig.vs2013 2015-01-06 13:13:43.000000000 +0000 @@ -0,0 +1,23 @@ +_VSPATH="/c/tools/vs2013" +export WIN32_REDIST_DIR=${_VSPATH}/VC/redist/x64/Microsoft.VC120.CRT + +## includes: win8.1 sdk includes, winrt headers for metro, msvc std library, directx sdk for d3d9 ## +export INCLUDE=/c/Program\ Files\ \(x86\)/Windows\ Kits/8.1/include/shared:/c/Program\ Files\ \(x86\)/Windows\ Kits/8.1/include/um:/c/Program\ Files\ \(x86\)/Windows\ Kits/8.1/include/winrt:/c/Program\ Files\ \(x86\)/Windows\ Kits/8.1/include/winrt/wrl:/c/Program\ Files\ \(x86\)/Windows\ Kits/8.1/include/winrt/wrl/wrappers:${_VSPATH}/vc/include:${_VSPATH}/vc/atlmfc/include:/c/tools/sdks/dx10/include + +## libs: win8.1 sdk x64 (64-bit) libs, msvc (64-bit) std library, msvc atl libs, directx sdk (64-bit) for d3d9 ## +export LIBPATH=/c/Program\ Files\ \(x86\)/Windows\ Kits/8.1/Lib/winv6.3/um/x64:${_VSPATH}/vc/lib/amd64:${_VSPATH}/vc/atlmfc/lib/amd64:/c/tools/sdks/dx10/lib/x64 +export LIB=/c/Program\ Files\ \(x86\)/Windows\ Kits/8.1/Lib/winv6.3/um/x64:${_VSPATH}/vc/lib/amd64:${_VSPATH}/vc/atlmfc/lib/amd64:/c/tools/sdks/dx10/lib/x64 + +## paths: win8.1 sdk x64 (64-bit) tools, msvc (64-bit) build toolchain, moz tools ## +export PATH="/c/Program Files (x86)/Windows Kits/8.1/bin/x64:${_VSPATH}/Common7/IDE:${_VSPATH}/VC/BIN/amd64:${_VSPATH}/VC/BIN/x86_amd64:${_VSPATH}/VC/BIN:${_VSPATH}/Common7/Tools:${_VSPATH}/VC/VCPackages:${PATH}" + +## WindowsSDKDir ## +export WINDOWSSDKDIR="/c/Program Files (x86)/Windows Kits/8.1/" + +. $topsrcdir/build/mozconfig.vs-common + +mk_export_correct_style LIB +mk_export_correct_style LIBPATH +mk_export_correct_style PATH +mk_export_correct_style INCLUDE +mk_export_correct_style WIN32_REDIST_DIR diff -Nru thunderbird-trunk-37.0~a1~hg20141215r17212.219503/calendar/base/backend/icaljs/calDateTime.js thunderbird-trunk-37.0~a1~hg20150106r17307.222089/calendar/base/backend/icaljs/calDateTime.js --- thunderbird-trunk-37.0~a1~hg20141215r17212.219503/calendar/base/backend/icaljs/calDateTime.js 2014-12-15 12:28:31.000000000 +0000 +++ thunderbird-trunk-37.0~a1~hg20150106r17307.222089/calendar/base/backend/icaljs/calDateTime.js 2015-01-06 13:13:43.000000000 +0000 @@ -90,13 +90,22 @@ }), compare: unwrap(ICAL.Time, function(val) { - if (this.innerObject.isDate != val.isDate) { + let a = this.innerObject; + let b = val; + + // If either this or aOther is floating, both objects are treated + // as floating for the comparison. + if (a.zone == ICAL.Timezone.localTimezone || b.zone == ICAL.Timezone.localTimezone) { + a = a.convertToZone(ICAL.Timezone.localTimezone); + b = b.convertToZone(ICAL.Timezone.localTimezone); + } + + if (a.isDate || b.isDate) { // Lightning expects 20120101 and 20120101T010101 to be equal - tz = (this.innerObject.isDate ? val.zone : this.innerObject.zone); - return this.innerObject.compareDateOnlyTz(val, tz); + return a.compareDateOnlyTz(b, a.zone); } else { // If both are dates or date-times, then just do the normal compare - return this.innerObject.compare(val); + return a.compare(b); } }), diff -Nru thunderbird-trunk-37.0~a1~hg20141215r17212.219503/calendar/base/backend/icaljs/calICSService.js thunderbird-trunk-37.0~a1~hg20150106r17307.222089/calendar/base/backend/icaljs/calICSService.js --- thunderbird-trunk-37.0~a1~hg20141215r17212.219503/calendar/base/backend/icaljs/calICSService.js 2014-12-15 12:28:31.000000000 +0000 +++ thunderbird-trunk-37.0~a1~hg20150106r17307.222089/calendar/base/backend/icaljs/calICSService.js 2015-01-06 13:13:43.000000000 +0000 @@ -30,10 +30,22 @@ get parent() this.innerObject.parent, toString: function() this.innerObject.toICAL(), - get value() this.innerObject.getValues().join(","), + get value() { + // Unescaped value for properties of TEXT or X- type, escaped otherwise. + // In both cases, innerObject.type is "text". + if (this.innerObject.type == "text") { + return this.innerObject.getValues().join(",") + } + return this.valueAsIcalString; + }, set value(val) { - this.innerObject.setValue(val); - return val; + // Unescaped value for properties of TEXT or X- type, escaped otherwise. + // In both cases, innerObject.type is "text". + if (this.innerObject.type == "text") { + this.innerObject.setValue(val); + return val; + } + return this.valueAsIcalString = val; }, get valueAsIcalString() { diff -Nru thunderbird-trunk-37.0~a1~hg20141215r17212.219503/calendar/base/content/calendar-chrome-startup.js thunderbird-trunk-37.0~a1~hg20150106r17307.222089/calendar/base/content/calendar-chrome-startup.js --- thunderbird-trunk-37.0~a1~hg20141215r17212.219503/calendar/base/content/calendar-chrome-startup.js 2014-12-15 12:28:31.000000000 +0000 +++ thunderbird-trunk-37.0~a1~hg20150106r17307.222089/calendar/base/content/calendar-chrome-startup.js 2015-01-06 13:13:43.000000000 +0000 @@ -127,7 +127,7 @@ switch (aData) { case "calendar.view.useSystemColors": { let attributeValue = Preferences.get("calendar.view.useSystemColors", false) && "true"; - for each (let win in fixIterator(Services.ww.getWindowEnumerator())) { + for (let win in fixIterator(Services.ww.getWindowEnumerator())) { setElementValue(win.document.documentElement, attributeValue , "systemcolors"); } break; diff -Nru thunderbird-trunk-37.0~a1~hg20141215r17212.219503/calendar/base/content/dialogs/calendar-event-dialog-recurrence.js thunderbird-trunk-37.0~a1~hg20150106r17307.222089/calendar/base/content/dialogs/calendar-event-dialog-recurrence.js --- thunderbird-trunk-37.0~a1~hg20141215r17212.219503/calendar/base/content/dialogs/calendar-event-dialog-recurrence.js 2014-12-15 12:28:31.000000000 +0000 +++ thunderbird-trunk-37.0~a1~hg20150106r17307.222089/calendar/base/content/dialogs/calendar-event-dialog-recurrence.js 2015-01-06 13:13:43.000000000 +0000 @@ -80,7 +80,30 @@ weekday: Math.abs(aByDayRuleComponent % 8) }; } - + + function setControlsForByMonthDay_YearlyRule(aDate, aByMonthDay) { + if (aByMonthDay == -1) { + // The last day of the month. + document.getElementById("yearly-group").selectedIndex = 1; + setElementValue("yearly-ordinal", -1); + setElementValue("yearly-weekday", -1); + } else { + if (aByMonthDay < -1) { + // The UI doesn't manage negative days apart from -1 but we can + // display in the controls the day from the start of the month. + aByMonthDay += aDate.endOfMonth.day + 1; + } + document.getElementById("yearly-group").selectedIndex = 0; + setElementValue("yearly-days", aByMonthDay); + } + } + + function everyWeekDay(aByDay) { + // Checks if aByDay contains only values from 1 to 7 with any order. + let mask = aByDay.reduce(function(v, c) v | (1 << c), 1); + return aByDay.length == 7 && mask == Math.pow(2, 8) - 1; + } + switch (rule.type) { case "DAILY": document.getElementById("period-list").selectedIndex = 0; @@ -137,56 +160,60 @@ setElementValue("monthly-ordinal", day); setElementValue("monthly-weekday", startDate.weekday + 1); } else { - if (byDayRuleComponent.length > 0) { + if (everyWeekDay(byDayRuleComponent)) { + // Every day of the month. + document.getElementById("monthly-group").selectedIndex = 0; + setElementValue("monthly-ordinal", 0); + setElementValue("monthly-weekday", -1); + } else if (byDayRuleComponent.length > 0) { + // One of the first five days or weekdays of the month. document.getElementById("monthly-group").selectedIndex = 0; var ruleInfo = getOrdinalAndWeekdayOfRule(byDayRuleComponent[0]); setElementValue("monthly-ordinal", ruleInfo.ordinal); setElementValue("monthly-weekday", ruleInfo.weekday); + } else if (byMonthDayRuleComponent.length == 1 && byMonthDayRuleComponent[0] == -1) { + // The last day of the month. + document.getElementById("monthly-group").selectedIndex = 0; + setElementValue("monthly-ordinal", byMonthDayRuleComponent[0]); + setElementValue("monthly-weekday", byMonthDayRuleComponent[0]); } else if (byMonthDayRuleComponent.length > 0) { - if (byMonthDayRuleComponent.length == 31 && - byMonthDayRuleComponent.every(function (element, index, array) { - for (let i = 0; i < array.length; i++) { - if ((index + 1) == array[i]) { - return true; - } - } - return false; - })) { - setElementValue("monthly-ordinal", 0); - setElementValue("monthly-weekday", -1); - } else if (byMonthDayRuleComponent.length == 1 && byMonthDayRuleComponent[0] == -1) { - document.getElementById("monthly-group").selectedIndex = 0; - setElementValue("monthly-ordinal", byMonthDayRuleComponent[0]); - setElementValue("monthly-weekday", byMonthDayRuleComponent[0]); - } else { - document.getElementById("monthly-group").selectedIndex = 1; - document.getElementById("monthly-days").days = byMonthDayRuleComponent; - } + document.getElementById("monthly-group").selectedIndex = 1; + document.getElementById("monthly-days").days = byMonthDayRuleComponent; } } // "YEARLY" ruletype if (byMonthRuleComponent.length == 0 || rule.type != "YEARLY") { - setElementValue("yearly-days", startDate.day); - setElementValue("yearly-month-ordinal", startDate.month + 1); - var day = Math.floor((startDate.day - 1) / 7) + 1; - setElementValue("yearly-ordinal", day); - setElementValue("yearly-weekday", startDate.weekday + 1); setElementValue("yearly-month-rule", startDate.month + 1); + setElementValue("yearly-month-ordinal", startDate.month + 1); + if (byMonthDayRuleComponent.length > 0) { + setControlsForByMonthDay_YearlyRule(startDate, byMonthDayRuleComponent[0]); + } else { + setElementValue("yearly-days", startDate.day); + let day = Math.floor((startDate.day - 1) / 7) + 1; + setElementValue("yearly-ordinal", day); + setElementValue("yearly-weekday", startDate.weekday + 1); + } } else { + setElementValue("yearly-month-rule", byMonthRuleComponent[0]); + setElementValue("yearly-month-ordinal", byMonthRuleComponent[0]); if (byMonthDayRuleComponent.length > 0) { - document.getElementById("yearly-group").selectedIndex = 0; - setElementValue("yearly-month-ordinal", byMonthRuleComponent[0]); - setElementValue("yearly-days", byMonthDayRuleComponent[0]); + let date = startDate.clone(); + date.month = byMonthRuleComponent[0] - 1; + setControlsForByMonthDay_YearlyRule(date, byMonthDayRuleComponent[0]); } else if (byDayRuleComponent.length > 0) { document.getElementById("yearly-group").selectedIndex = 1; - var ruleInfo = getOrdinalAndWeekdayOfRule(byDayRuleComponent[0]); - setElementValue("yearly-ordinal", ruleInfo.ordinal); - setElementValue("yearly-weekday", ruleInfo.weekday); - setElementValue("yearly-month-rule", byMonthRuleComponent[0]); + if (everyWeekDay(byDayRuleComponent)) { + // Every day of the month. + setElementValue("yearly-ordinal", 0); + setElementValue("yearly-weekday", -1); + } else { + let ruleInfo = getOrdinalAndWeekdayOfRule(byDayRuleComponent[0]); + setElementValue("yearly-ordinal", ruleInfo.ordinal); + setElementValue("yearly-weekday", ruleInfo.weekday); + } } else if (byMonthRuleComponent.length > 0) { document.getElementById("yearly-group").selectedIndex = 0; - setElementValue("yearly-month-ordinal", byMonthRuleComponent[0]); setElementValue("yearly-days", startDate.day); } } @@ -253,6 +280,7 @@ } var recRule = createRecurrenceRule(); + const ALL_WEEKDAYS = [2,3,4,5,6,7,1]; // The sequence MO,TU,WE,TH,FR,SA,SU. switch (deckNumber) { case 0: recRule.type = "DAILY"; @@ -285,13 +313,10 @@ var day_of_week = Number(getElementValue("monthly-weekday")); if (day_of_week < 0) { if (ordinal == 0) { - // monthly rule "every day of the month" - let onDays = []; - for (let i = 0; i < 31; i++) { - onDays[i] = i + 1; - } - recRule.setComponent("BYMONTHDAY", onDays.length, onDays); + // Monthly rule "Every day of the month". + recRule.setComponent("BYDAY", 7, ALL_WEEKDAYS); } else { + // One of the first five days or the last day of the month. recRule.setComponent("BYMONTHDAY", 1, [ ordinal ]); } } else { @@ -321,9 +346,19 @@ recRule.setComponent("BYMONTH", yearlyByMonth.length, yearlyByMonth); var ordinal = Number(getElementValue("yearly-ordinal")); var day_of_week = Number(getElementValue("yearly-weekday")); - var sign = ordinal < 0 ? -1 : 1; - var onDays = [ (Math.abs(ordinal) * 8 + day_of_week) * sign ]; - recRule.setComponent("BYDAY", onDays.length, onDays); + if (day_of_week < 0) { + if (ordinal == 0) { + // Yearly rule "Every day of a month". + recRule.setComponent("BYDAY", 7, ALL_WEEKDAYS); + } else { + // One of the first five days or the last of a month. + recRule.setComponent("BYMONTHDAY", 1, [ ordinal ]); + } + } else { + let sign = ordinal < 0 ? -1 : 1; + let onDays = [ (Math.abs(ordinal) * 8 + day_of_week) * sign ]; + recRule.setComponent("BYDAY", onDays.length, onDays); + } } break; } @@ -644,7 +679,7 @@ case 0: var dailyGroup = document.getElementById("daily-group"); var dailyDays = document.getElementById("daily-days"); - dailyDays.removeAttribute("disabled", "true"); + dailyDays.removeAttribute("disabled"); if (dailyGroup.selectedIndex == 1) { dailyDays.setAttribute("disabled", "true"); } @@ -658,9 +693,9 @@ var monthlyOrdinal = document.getElementById("monthly-ordinal"); var monthlyWeekday = document.getElementById("monthly-weekday"); var monthlyDays = document.getElementById("monthly-days"); - monthlyOrdinal.removeAttribute("disabled", "true"); - monthlyWeekday.removeAttribute("disabled", "true"); - monthlyDays.removeAttribute("disabled", "true"); + monthlyOrdinal.removeAttribute("disabled"); + monthlyWeekday.removeAttribute("disabled"); + monthlyDays.removeAttribute("disabled"); if (monthlyGroup.selectedIndex == 0) { monthlyDays.setAttribute("disabled", "true"); } else { @@ -673,21 +708,27 @@ var yearlyGroup = document.getElementById("yearly-group"); var yearlyDays = document.getElementById("yearly-days"); var yearlyMonthOrdinal = document.getElementById("yearly-month-ordinal"); + var yearlyPeriodOfMonthLabel = document.getElementById("yearly-period-of-month-label"); var yearlyOrdinal = document.getElementById("yearly-ordinal"); var yearlyWeekday = document.getElementById("yearly-weekday"); var yearlyMonthRule = document.getElementById("yearly-month-rule"); - yearlyDays.removeAttribute("disabled", "true"); - yearlyMonthOrdinal.removeAttribute("disabled", "true"); - yearlyOrdinal.removeAttribute("disabled", "true"); - yearlyWeekday.removeAttribute("disabled", "true"); - yearlyMonthRule.removeAttribute("disabled", "true"); + var yearlyPeriodOfLabel = document.getElementById("yearly-period-of-label"); + yearlyDays.removeAttribute("disabled"); + yearlyMonthOrdinal.removeAttribute("disabled"); + yearlyOrdinal.removeAttribute("disabled"); + yearlyWeekday.removeAttribute("disabled"); + yearlyMonthRule.removeAttribute("disabled"); + yearlyPeriodOfLabel.removeAttribute("disabled"); + yearlyPeriodOfMonthLabel.removeAttribute("disabled"); if (yearlyGroup.selectedIndex == 0) { yearlyOrdinal.setAttribute("disabled", "true"); yearlyWeekday.setAttribute("disabled", "true"); yearlyMonthRule.setAttribute("disabled", "true"); + yearlyPeriodOfLabel.setAttribute("disabled", "true"); } else { yearlyDays.setAttribute("disabled", "true"); yearlyMonthOrdinal.setAttribute("disabled", "true"); + yearlyPeriodOfMonthLabel.setAttribute("disabled", "true"); } break; } diff -Nru thunderbird-trunk-37.0~a1~hg20141215r17212.219503/calendar/base/content/dialogs/calendar-event-dialog-recurrence.xul thunderbird-trunk-37.0~a1~hg20150106r17307.222089/calendar/base/content/dialogs/calendar-event-dialog-recurrence.xul --- thunderbird-trunk-37.0~a1~hg20141215r17212.219503/calendar/base/content/dialogs/calendar-event-dialog-recurrence.xul 2014-12-15 12:28:31.000000000 +0000 +++ thunderbird-trunk-37.0~a1~hg20150106r17307.222089/calendar/base/content/dialogs/calendar-event-dialog-recurrence.xul 2015-01-06 13:13:43.000000000 +0000 @@ -122,7 +122,7 @@ disable-on-readonly="true" disable-on-occurrence="true"/> - +