Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: common/notification.js

Issue 8493027: Acquired Opera AdBlock code (Closed)
Patch Set: Created Oct. 8, 2012, 5:58 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « common/header.js ('k') | config.xml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 var notifyParent = document.getElementById('notification');
2 notifyParent.setAttribute('onClick', 'notifyHide()');
3
4 function notify(title, text) {
5 var back = document.createElement('div');
6 notifyParent.appendChild(back);
7
8 var popup = document.createElement('div');
9 var titleElement = document.createElement('h2');
10 titleElement.appendChild(document.createTextNode(title));
11 popup.appendChild(titleElement);
12
13 var textElement = document.createElement('p');
14 textElement.appendChild(document.createTextNode(text));
15 popup.appendChild(textElement);
16 notifyParent.appendChild(popup);
17
18 window.setTimeout("notifyParent.setAttribute('onClick', 'notifyHide()'); ", 800); //Avoid accidentally closing the popup
19 }
20 function notifyHide() {
21 notifyParent.setAttribute('onClick', ''); //Avoid accidentally closing t he popup
22
23 var elements = notifyParent.getElementsByTagName('div');
24 elements[0].setAttribute('style', 'animation: notify_back_animate_out 1. 2s ease-in;');
25 elements[1].setAttribute('style', 'animation: notify_popup_animate_out 1 .2s ease-in;');
26 window.setTimeout("notifyParent.innerHTML = ''", 620);
27 }
OLDNEW
« no previous file with comments | « common/header.js ('k') | config.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld