From fe48b0bd1d36038952f84151a36b1ff1fa76a6c3 Mon Sep 17 00:00:00 2001 From: "mikep%oeone.com" Date: Thu, 11 Apr 2002 16:49:34 +0000 Subject: [PATCH] Adding in pref for snooze time. --- calendar/resources/content/alertDialog.js | 2 ++ calendar/resources/content/calendar.js | 2 +- .../resources/content/calendarEventAlertDialog.js | 2 ++ calendar/resources/content/pref/calendarPref.xul | 11 +++++++++-- calendar/resources/content/pref/rootCalendarPref.js | 3 +++ 5 files changed, 17 insertions(+), 3 deletions(-) diff --git a/calendar/resources/content/alertDialog.js b/calendar/resources/content/alertDialog.js index 894991e878eb..3713ad9cecc7 100644 --- a/calendar/resources/content/alertDialog.js +++ b/calendar/resources/content/alertDialog.js @@ -134,6 +134,8 @@ function createAlarmBox( Event ) OuterBox.getElementsByAttribute( "name", "SnoozeButton" )[0].setAttribute( "onclick", "snoozeAlarm( this.event );removeAlarmBox( this.event );" ); + OuterBox.getElementsByAttribute( "name", "alarm-length-field" )[0].value = opener.gCalendarWindow.calendarPreferences.getPref( "defaultsnoozelength" ); + kungFooDeathGripOnEventBoxes.push( OuterBox.getElementsByAttribute( "name", "SnoozeButton" )[0] ); /* diff --git a/calendar/resources/content/calendar.js b/calendar/resources/content/calendar.js index 2f973f42026a..9a9a38ac7ac1 100644 --- a/calendar/resources/content/calendar.js +++ b/calendar/resources/content/calendar.js @@ -78,7 +78,7 @@ */ //the next line needs XX-DATE-XY but last X instead of Y -var gDateMade = XX-DATE-XX; +var gDateMade = 20020411; // turn on debuging diff --git a/calendar/resources/content/calendarEventAlertDialog.js b/calendar/resources/content/calendarEventAlertDialog.js index 894991e878eb..3713ad9cecc7 100644 --- a/calendar/resources/content/calendarEventAlertDialog.js +++ b/calendar/resources/content/calendarEventAlertDialog.js @@ -134,6 +134,8 @@ function createAlarmBox( Event ) OuterBox.getElementsByAttribute( "name", "SnoozeButton" )[0].setAttribute( "onclick", "snoozeAlarm( this.event );removeAlarmBox( this.event );" ); + OuterBox.getElementsByAttribute( "name", "alarm-length-field" )[0].value = opener.gCalendarWindow.calendarPreferences.getPref( "defaultsnoozelength" ); + kungFooDeathGripOnEventBoxes.push( OuterBox.getElementsByAttribute( "name", "SnoozeButton" )[0] ); /* diff --git a/calendar/resources/content/pref/calendarPref.xul b/calendar/resources/content/pref/calendarPref.xul index f6c12100504f..5106c185abc8 100644 --- a/calendar/resources/content/pref/calendarPref.xul +++ b/calendar/resources/content/pref/calendarPref.xul @@ -53,7 +53,7 @@ @@ -91,9 +91,16 @@ + Default Event Length: - + + + + + Default Snooze Length: + diff --git a/calendar/resources/content/pref/rootCalendarPref.js b/calendar/resources/content/pref/rootCalendarPref.js index dd4c131870b7..29308c997e18 100644 --- a/calendar/resources/content/pref/rootCalendarPref.js +++ b/calendar/resources/content/pref/rootCalendarPref.js @@ -70,6 +70,7 @@ function calendarPreferences( CalendarWindow ) this.calendarPref.setIntPref( "date.format", 0 ); this.calendarPref.setIntPref( "week.start", 0 ); this.calendarPref.setIntPref( "event.defaultlength", 60 ); + this.calendarPref.setIntPref( "alarms.defaultsnoozelength", 10 ); this.loadPreferences(); } @@ -87,6 +88,8 @@ calendarPreferences.prototype.loadPreferences = function() this.arrayOfPrefs.weekstart = this.calendarPref.getIntPref( "week.start" ); this.arrayOfPrefs.defaulteventlength = this.calendarPref.getIntPref( "event.defaultlength" ); + + this.arrayOfPrefs.defaultsnoozelength = this.calendarPref.getIntPref( "alarms.defaultsnoozelength" ); } calendarPreferences.prototype.getPref = function( Preference )