Skip to content

Commit

Permalink
fixed notification bug
Browse files Browse the repository at this point in the history
  • Loading branch information
quitschibo committed Jul 3, 2013
1 parent 924f1a5 commit c54f9d8
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 19 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Expand Up @@ -11,7 +11,7 @@
"default_popup": "popup.html"
},
"background": {
"pages": ["background.html"]
"page": "background.html"
},
"options_page":"options.html",
"permissions": [
Expand Down
20 changes: 2 additions & 18 deletions notification.html
Expand Up @@ -10,25 +10,9 @@
</style>
<script src="core.js"></script>
<script src="json2.js"></script>
<script>
function SetupNotification() {
var link = JSON.parse(localStorage['HN.Link0']);
var storyLink = document.getElementById("StoryLink");
storyLink.href = link.Link;
storyLink.innerText = link.Title;
storyLink.addEventListener("click", openLinkFront);

var commentsLink = document.getElementById("CommentsLink");
commentsLink.href = link.CommentsLink;
commentsLink.addEventListener("click", openLinkFront);

setTimeout(function() {
window.close();
}, 10000);
}
</script>
<script src="notification.js"></script>
</head>
<body onLoad="SetupNotification()">
<body>
<div id="header">
<img src="icon18.gif"/>
<span>Hacker News Top Story</span>
Expand Down
19 changes: 19 additions & 0 deletions notification.js
@@ -0,0 +1,19 @@
function SetupNotification() {
var link = JSON.parse(localStorage['HN.Link0']);
var storyLink = document.getElementById("StoryLink");
storyLink.href = link.Link;
storyLink.innerText = link.Title;
storyLink.addEventListener("click", openLinkFront);

var commentsLink = document.getElementById("CommentsLink");
commentsLink.href = link.CommentsLink;
commentsLink.addEventListener("click", openLinkFront);

setTimeout(function() {
window.close();
}, 10000);
}

document.addEventListener('DOMContentLoaded', function () {
SetupNotification();
});

0 comments on commit c54f9d8

Please sign in to comment.