OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 | 5 |
6 /** | 6 /** |
7 * @fileoverview The local InstantExtended NTP. | 7 * @fileoverview The local InstantExtended NTP. |
8 */ | 8 */ |
9 | 9 |
10 | 10 |
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 // here? We could hide the page until it arrives, to avoid flicker. | 538 // here? We could hide the page until it arrives, to avoid flicker. |
539 } | 539 } |
540 | 540 |
541 | 541 |
542 /** | 542 /** |
543 * Prepares the New Tab Page by adding listeners, the most visited pages | 543 * Prepares the New Tab Page by adding listeners, the most visited pages |
544 * section, and Google-specific elements for a Google-provided page. | 544 * section, and Google-specific elements for a Google-provided page. |
545 */ | 545 */ |
546 function init() { | 546 function init() { |
547 // Hide notifications after fade out, so we can't focus on links via keyboard. | 547 // Hide notifications after fade out, so we can't focus on links via keyboard. |
548 $(IDS.NOTIFICATION).addEventListener('webkitTransitionEnd', hideNotification); | 548 $(IDS.NOTIFICATION).addEventListener('transitionend', hideNotification); |
549 | 549 |
550 $(IDS.NOTIFICATION_MESSAGE).textContent = | 550 $(IDS.NOTIFICATION_MESSAGE).textContent = |
551 configData.translatedStrings.thumbnailRemovedNotification; | 551 configData.translatedStrings.thumbnailRemovedNotification; |
552 | 552 |
553 var undoLink = $(IDS.UNDO_LINK); | 553 var undoLink = $(IDS.UNDO_LINK); |
554 undoLink.addEventListener('click', onUndo); | 554 undoLink.addEventListener('click', onUndo); |
555 registerKeyHandler(undoLink, KEYCODE.ENTER, onUndo); | 555 registerKeyHandler(undoLink, KEYCODE.ENTER, onUndo); |
556 undoLink.textContent = configData.translatedStrings.undoThumbnailRemove; | 556 undoLink.textContent = configData.translatedStrings.undoThumbnailRemove; |
557 | 557 |
558 var restoreAllLink = $(IDS.RESTORE_ALL_LINK); | 558 var restoreAllLink = $(IDS.RESTORE_ALL_LINK); |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
673 return { | 673 return { |
674 init: init, // Exposed for testing. | 674 init: init, // Exposed for testing. |
675 listen: listen | 675 listen: listen |
676 }; | 676 }; |
677 | 677 |
678 } | 678 } |
679 | 679 |
680 if (!window.localNTPUnitTest) { | 680 if (!window.localNTPUnitTest) { |
681 LocalNTP().listen(); | 681 LocalNTP().listen(); |
682 } | 682 } |
OLD | NEW |