Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Side by Side Diff: chrome/browser/resources/new_new_tab.js

Issue 202052: NNTP: Fix undo link color... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/resources/new_new_tab.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 // Helpers 2 // Helpers
3 3
4 function $(id) { 4 function $(id) {
5 return document.getElementById(id); 5 return document.getElementById(id);
6 } 6 }
7 7
8 // TODO(arv): Remove these when classList is available in HTML5. 8 // TODO(arv): Remove these when classList is available in HTML5.
9 // https://bugs.webkit.org/show_bug.cgi?id=20709 9 // https://bugs.webkit.org/show_bug.cgi?id=20709
10 function hasClass(el, name) { 10 function hasClass(el, name) {
(...skipping 886 matching lines...) Expand 10 before | Expand all | Expand 10 after
897 } 897 }
898 898
899 function doAction() { 899 function doAction() {
900 f(); 900 f();
901 hideNotification(); 901 hideNotification();
902 } 902 }
903 903
904 // Remove any possible first-run trails. 904 // Remove any possible first-run trails.
905 removeClass(notification, 'first-run'); 905 removeClass(notification, 'first-run');
906 906
907 var actionLink = notificationElement.querySelector('.link'); 907 var actionLink = notificationElement.querySelector('.link-color');
908 notificationElement.firstElementChild.textContent = text; 908 notificationElement.firstElementChild.textContent = text;
909 actionLink.textContent = actionText; 909 actionLink.textContent = actionText;
910 910
911 actionLink.onclick = doAction; 911 actionLink.onclick = doAction;
912 actionLink.onkeydown = handleIfEnterKey(doAction); 912 actionLink.onkeydown = handleIfEnterKey(doAction);
913 notificationElement.onmouseover = show; 913 notificationElement.onmouseover = show;
914 notificationElement.onmouseout = delayedHide; 914 notificationElement.onmouseout = delayedHide;
915 actionLink.onfocus = show; 915 actionLink.onfocus = show;
916 actionLink.onblur = delayedHide; 916 actionLink.onblur = delayedHide;
917 // Enable tabbing to the link now that it is shown. 917 // Enable tabbing to the link now that it is shown.
918 actionLink.tabIndex = 0; 918 actionLink.tabIndex = 0;
919 919
920 show(); 920 show();
921 delayedHide(); 921 delayedHide();
922 } 922 }
923 923
924 function hideNotification() { 924 function hideNotification() {
925 var notificationElement = $('notification'); 925 var notificationElement = $('notification');
926 removeClass(notificationElement, 'show'); 926 removeClass(notificationElement, 'show');
927 var actionLink = notificationElement.querySelector('.link'); 927 var actionLink = notificationElement.querySelector('.link-color');
928 // Prevent tabbing to the hidden link. 928 // Prevent tabbing to the hidden link.
929 actionLink.tabIndex = -1; 929 actionLink.tabIndex = -1;
930 } 930 }
931 931
932 function showFirstRunNotification() { 932 function showFirstRunNotification() {
933 showNotification(localStrings.getString('firstrunnotification'), 933 showNotification(localStrings.getString('firstrunnotification'),
934 localStrings.getString('closefirstrunnotification'), 934 localStrings.getString('closefirstrunnotification'),
935 null, 30000); 935 null, 30000);
936 var notificationElement = $('notification'); 936 var notificationElement = $('notification');
937 addClass(notification, 'first-run'); 937 addClass(notification, 'first-run');
(...skipping 743 matching lines...) Expand 10 before | Expand all | Expand 10 after
1681 function fixLinkUnderline(el) { 1681 function fixLinkUnderline(el) {
1682 var span = document.createElement('span'); 1682 var span = document.createElement('span');
1683 span.className = 'link-color'; 1683 span.className = 'link-color';
1684 while (el.hasChildNodes()) { 1684 while (el.hasChildNodes()) {
1685 span.appendChild(el.firstChild); 1685 span.appendChild(el.firstChild);
1686 } 1686 }
1687 el.appendChild(span); 1687 el.appendChild(span);
1688 } 1688 }
1689 1689
1690 updateAttribution(); 1690 updateAttribution();
OLDNEW
« no previous file with comments | « chrome/browser/resources/new_new_tab.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698