|
285 | 285 | getToolbar = function () { |
286 | 286 | var row = []; |
287 | 287 | if (options.showTodayButton) { |
288 | | - row.push($('<td>').append($('<a>').attr({'data-action':'today', 'title':'Go to today'}).append($('<span>').addClass(options.icons.today)))); |
| 288 | + row.push($('<td>').append($('<a>').attr({'data-action':'today', 'title': options.tooltips.today}).append($('<span>').addClass(options.icons.today)))); |
289 | 289 | } |
290 | 290 | if (!options.sideBySide && hasDate() && hasTime()) { |
291 | 291 | row.push($('<td>').append($('<a>').attr({'data-action':'togglePicker', 'title':'Select Time'}).append($('<span>').addClass(options.icons.time)))); |
292 | 292 | } |
293 | 293 | if (options.showClear) { |
294 | | - row.push($('<td>').append($('<a>').attr({'data-action':'clear', 'title':'Clear selection'}).append($('<span>').addClass(options.icons.clear)))); |
| 294 | + row.push($('<td>').append($('<a>').attr({'data-action':'clear', 'title': options.tooltips.clear}).append($('<span>').addClass(options.icons.clear)))); |
295 | 295 | } |
296 | 296 | if (options.showClose) { |
297 | | - row.push($('<td>').append($('<a>').attr({'data-action':'close', 'title':'Close the picker'}).append($('<span>').addClass(options.icons.close)))); |
| 297 | + row.push($('<td>').append($('<a>').attr({'data-action':'close', 'title': options.tooltips.close}).append($('<span>').addClass(options.icons.close)))); |
298 | 298 | } |
299 | 299 | return $('<table>').addClass('table-condensed').append($('<tbody>').append($('<tr>').append(row))); |
300 | 300 | }, |
|
558 | 558 | monthsViewHeader = monthsView.find('th'), |
559 | 559 | months = monthsView.find('tbody').find('span'); |
560 | 560 |
|
561 | | - monthsViewHeader.eq(0).find('span').attr('title', 'Previous Year'); |
562 | | - monthsViewHeader.eq(1).attr('title', 'Select Year'); |
563 | | - monthsViewHeader.eq(2).find('span').attr('title', 'Next Year'); |
| 561 | + monthsViewHeader.eq(0).find('span').attr('title', options.tooltips.prevYear); |
| 562 | + monthsViewHeader.eq(1).attr('title', options.tooltips.selectYear); |
| 563 | + monthsViewHeader.eq(2).find('span').attr('title', options.tooltips.nextYear); |
564 | 564 |
|
565 | 565 | monthsView.find('.disabled').removeClass('disabled'); |
566 | 566 |
|
|
593 | 593 | endYear = viewDate.clone().add(6, 'y'), |
594 | 594 | html = ''; |
595 | 595 |
|
596 | | - yearsViewHeader.eq(0).find('span').attr('title', 'Previous Decade'); |
597 | | - yearsViewHeader.eq(1).attr('title', 'Select Decade'); |
598 | | - yearsViewHeader.eq(2).find('span').attr('title', 'Next Decade'); |
| 596 | + yearsViewHeader.eq(0).find('span').attr('title', options.tooltips.nextDecade); |
| 597 | + yearsViewHeader.eq(1).attr('title', options.tooltips.selectDecade); |
| 598 | + yearsViewHeader.eq(2).find('span').attr('title', options.tooltips.prevDecade); |
599 | 599 |
|
600 | 600 | yearsView.find('.disabled').removeClass('disabled'); |
601 | 601 |
|
|
624 | 624 | endDecade = startDecade.clone().add(100, 'y'), |
625 | 625 | html = ''; |
626 | 626 |
|
627 | | - decadesViewHeader.eq(0).find('span').attr('title', 'Previous Century'); |
628 | | - decadesViewHeader.eq(2).find('span').attr('title', 'Next Century'); |
| 627 | + decadesViewHeader.eq(0).find('span').attr('title', options.tooltips.prevCentury); |
| 628 | + decadesViewHeader.eq(2).find('span').attr('title', options.tooltips.nextCentury); |
629 | 629 |
|
630 | 630 | decadesView.find('.disabled').removeClass('disabled'); |
631 | 631 |
|
|
662 | 662 | return; |
663 | 663 | } |
664 | 664 |
|
665 | | - daysViewHeader.eq(0).find('span').attr('title', 'Previous Month'); |
666 | | - daysViewHeader.eq(1).attr('title', 'Select Month'); |
667 | | - daysViewHeader.eq(2).find('span').attr('title', 'Next Month'); |
| 665 | + daysViewHeader.eq(0).find('span').attr('title', options.tooltips.prevMonth); |
| 666 | + daysViewHeader.eq(1).attr('title', options.tooltips.selectMonth); |
| 667 | + daysViewHeader.eq(2).find('span').attr('title', options.tooltips.nextMonth); |
668 | 668 |
|
669 | 669 | daysView.find('.disabled').removeClass('disabled'); |
670 | 670 | daysViewHeader.eq(1).text(viewDate.format(options.dayViewHeaderFormat)); |
|
1807 | 1807 | return picker; |
1808 | 1808 | }; |
1809 | 1809 |
|
| 1810 | + picker.tooltips = function (tooltips) { |
| 1811 | + if (arguments.length === 0) { |
| 1812 | + return $.extend({}, options.tooltips); |
| 1813 | + } |
| 1814 | + |
| 1815 | + if (!(tooltips instanceof Object)) { |
| 1816 | + throw new TypeError('tooltips() expects parameter to be an Object'); |
| 1817 | + } |
| 1818 | + $.extend(options.tooltips, tooltips); |
| 1819 | + if (widget) { |
| 1820 | + hide(); |
| 1821 | + show(); |
| 1822 | + } |
| 1823 | + return picker; |
| 1824 | + }; |
| 1825 | + |
1810 | 1826 | picker.useStrict = function (useStrict) { |
1811 | 1827 | if (arguments.length === 0) { |
1812 | 1828 | return options.useStrict; |
|
2319 | 2335 | clear: 'glyphicon glyphicon-trash', |
2320 | 2336 | close: 'glyphicon glyphicon-remove' |
2321 | 2337 | }, |
| 2338 | + tooltips: { |
| 2339 | + today: 'Go to today', |
| 2340 | + clear: 'Clear selection', |
| 2341 | + close: 'Close the picker', |
| 2342 | + selectMonth: 'Select Month', |
| 2343 | + prevMonth: 'Previous Month', |
| 2344 | + nextMonth: 'Next Month', |
| 2345 | + selectYear: 'Select Year', |
| 2346 | + prevYear: 'Previous Year', |
| 2347 | + nextYear: 'Next Year', |
| 2348 | + selectDecade: 'Select Decade', |
| 2349 | + prevDecade: 'Previous Decade', |
| 2350 | + nextDecade: 'Next Decade', |
| 2351 | + prevCentury: 'Previous Century', |
| 2352 | + nextCentury: 'Next Century' |
| 2353 | + }, |
2322 | 2354 | useStrict: false, |
2323 | 2355 | sideBySide: false, |
2324 | 2356 | daysOfWeekDisabled: false, |
|
0 commit comments