OLD | NEW |
1 "use strict"; | 1 "use strict"; |
2 /* | 2 /* |
3 * Copyright (C) 2012 Google Inc. All rights reserved. | 3 * Copyright (C) 2012 Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 2745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2756 this.hide(); | 2756 this.hide(); |
2757 }; | 2757 }; |
2758 | 2758 |
2759 /** | 2759 /** |
2760 * @constructor | 2760 * @constructor |
2761 * @extends View | 2761 * @extends View |
2762 * @param {!number} maxWidth Maximum width in pixels. | 2762 * @param {!number} maxWidth Maximum width in pixels. |
2763 */ | 2763 */ |
2764 function MonthPopupButton(maxWidth) { | 2764 function MonthPopupButton(maxWidth) { |
2765 View.call(this, createElement("button", MonthPopupButton.ClassNameMonthPopup
Button)); | 2765 View.call(this, createElement("button", MonthPopupButton.ClassNameMonthPopup
Button)); |
| 2766 this.element.setAttribute("aria-label", global.params.axShowMonthSelector); |
2766 | 2767 |
2767 /** | 2768 /** |
2768 * @type {!Element} | 2769 * @type {!Element} |
2769 * @const | 2770 * @const |
2770 */ | 2771 */ |
2771 this.labelElement = createElement("span", MonthPopupButton.ClassNameMonthPop
upButtonLabel, "-----"); | 2772 this.labelElement = createElement("span", MonthPopupButton.ClassNameMonthPop
upButtonLabel, "-----"); |
2772 this.element.appendChild(this.labelElement); | 2773 this.element.appendChild(this.labelElement); |
2773 | 2774 |
2774 /** | 2775 /** |
2775 * @type {!Element} | 2776 * @type {!Element} |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2944 this.monthPopupButton.attachTo(titleElement); | 2945 this.monthPopupButton.attachTo(titleElement); |
2945 | 2946 |
2946 /** | 2947 /** |
2947 * @type {!CalendarNavigationButton} | 2948 * @type {!CalendarNavigationButton} |
2948 * @const | 2949 * @const |
2949 */ | 2950 */ |
2950 this._previousMonthButton = new CalendarNavigationButton(); | 2951 this._previousMonthButton = new CalendarNavigationButton(); |
2951 this._previousMonthButton.attachTo(this); | 2952 this._previousMonthButton.attachTo(this); |
2952 this._previousMonthButton.on(CalendarNavigationButton.EventTypeButtonClick,
this.onNavigationButtonClick); | 2953 this._previousMonthButton.on(CalendarNavigationButton.EventTypeButtonClick,
this.onNavigationButtonClick); |
2953 this._previousMonthButton.on(CalendarNavigationButton.EventTypeRepeatingButt
onClick, this.onNavigationButtonClick); | 2954 this._previousMonthButton.on(CalendarNavigationButton.EventTypeRepeatingButt
onClick, this.onNavigationButtonClick); |
| 2955 this._previousMonthButton.element.setAttribute("aria-label", global.params.a
xShowPreviousMonth); |
2954 | 2956 |
2955 /** | 2957 /** |
2956 * @type {!CalendarNavigationButton} | 2958 * @type {!CalendarNavigationButton} |
2957 * @const | 2959 * @const |
2958 */ | 2960 */ |
2959 this._todayButton = new CalendarNavigationButton(); | 2961 this._todayButton = new CalendarNavigationButton(); |
2960 this._todayButton.attachTo(this); | 2962 this._todayButton.attachTo(this); |
2961 this._todayButton.on(CalendarNavigationButton.EventTypeButtonClick, this.onN
avigationButtonClick); | 2963 this._todayButton.on(CalendarNavigationButton.EventTypeButtonClick, this.onN
avigationButtonClick); |
2962 this._todayButton.element.classList.add(CalendarHeaderView.ClassNameTodayBut
ton); | 2964 this._todayButton.element.classList.add(CalendarHeaderView.ClassNameTodayBut
ton); |
2963 var monthContainingToday = Month.createFromToday(); | 2965 var monthContainingToday = Month.createFromToday(); |
2964 this._todayButton.setDisabled(monthContainingToday < this.calendarPicker.min
imumMonth || monthContainingToday > this.calendarPicker.maximumMonth); | 2966 this._todayButton.setDisabled(monthContainingToday < this.calendarPicker.min
imumMonth || monthContainingToday > this.calendarPicker.maximumMonth); |
| 2967 this._todayButton.element.setAttribute("aria-label", global.params.todayLabe
l); |
2965 | 2968 |
2966 /** | 2969 /** |
2967 * @type {!CalendarNavigationButton} | 2970 * @type {!CalendarNavigationButton} |
2968 * @const | 2971 * @const |
2969 */ | 2972 */ |
2970 this._nextMonthButton = new CalendarNavigationButton(); | 2973 this._nextMonthButton = new CalendarNavigationButton(); |
2971 this._nextMonthButton.attachTo(this); | 2974 this._nextMonthButton.attachTo(this); |
2972 this._nextMonthButton.on(CalendarNavigationButton.EventTypeButtonClick, this
.onNavigationButtonClick); | 2975 this._nextMonthButton.on(CalendarNavigationButton.EventTypeButtonClick, this
.onNavigationButtonClick); |
2973 this._nextMonthButton.on(CalendarNavigationButton.EventTypeRepeatingButtonCl
ick, this.onNavigationButtonClick); | 2976 this._nextMonthButton.on(CalendarNavigationButton.EventTypeRepeatingButtonCl
ick, this.onNavigationButtonClick); |
| 2977 this._nextMonthButton.element.setAttribute("aria-label", global.params.axSho
wNextMonth); |
2974 | 2978 |
2975 if (global.params.isLocaleRTL) { | 2979 if (global.params.isLocaleRTL) { |
2976 this._nextMonthButton.element.innerHTML = CalendarHeaderView._BackwardTr
iangle; | 2980 this._nextMonthButton.element.innerHTML = CalendarHeaderView._BackwardTr
iangle; |
2977 this._previousMonthButton.element.innerHTML = CalendarHeaderView._Forwar
dTriangle; | 2981 this._previousMonthButton.element.innerHTML = CalendarHeaderView._Forwar
dTriangle; |
2978 } else { | 2982 } else { |
2979 this._nextMonthButton.element.innerHTML = CalendarHeaderView._ForwardTri
angle; | 2983 this._nextMonthButton.element.innerHTML = CalendarHeaderView._ForwardTri
angle; |
2980 this._previousMonthButton.element.innerHTML = CalendarHeaderView._Backwa
rdTriangle; | 2984 this._previousMonthButton.element.innerHTML = CalendarHeaderView._Backwa
rdTriangle; |
2981 } | 2985 } |
2982 } | 2986 } |
2983 | 2987 |
(...skipping 1078 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4062 event.stopPropagation(); | 4066 event.stopPropagation(); |
4063 event.preventDefault(); | 4067 event.preventDefault(); |
4064 } | 4068 } |
4065 }; | 4069 }; |
4066 | 4070 |
4067 if (window.dialogArguments) { | 4071 if (window.dialogArguments) { |
4068 initialize(dialogArguments); | 4072 initialize(dialogArguments); |
4069 } else { | 4073 } else { |
4070 window.addEventListener("message", handleMessage, false); | 4074 window.addEventListener("message", handleMessage, false); |
4071 } | 4075 } |
OLD | NEW |