Permalink
Browse files

New deals are highlighted

  • Loading branch information...
1 parent 7948aa1 commit e6b2bff36e41b978357a4ac2a41997b0e1c59a77 @jonathonloo jonathonloo committed Jan 12, 2012
Showing with 26 additions and 1 deletion.
  1. +21 −0 background.html
  2. +4 −1 css/style.css
  3. +1 −0 popup.html
View
@@ -6,6 +6,7 @@
// Global settings
var settings = null;
var deal_to_link = [];
+ var new_deals = [];
// TODO: Probably should make a func out of this
var city_feed_objs = [
@@ -97,6 +98,21 @@
link.appendChild(text);
li.appendChild(link);
ul.appendChild(li);
+
+ var is_new = false;
+ for(index in new_deals){
+ if(new_deals[index] == title){
+ is_new = true;
+ break;
+ }
+ }
+
+ if(is_new){
+ link.setAttribute('class', 'newdeal');
+ }
+ else{
+ link.setAttribute('class', 'olddeal');
+ }
}
element.appendChild(ul);
}
@@ -144,13 +160,18 @@
// If the deal doesn't exist, update the browser icon.
if (deal_titles.indexOf(title) == -1) {
chrome.browserAction.setIcon({"path" : "images/dealios22.png"});
+ new_deals.push(title);
}
current_deal_titles.push(title);
deal_to_link[title] = link;
}
window.localStorage.setItem(deal_source, JSON.stringify(current_deal_titles));
};
+
+ function clear_new(){
+ new_deals = [];
+ };
</script>
</head>
<body>
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -44,6 +44,7 @@ <h1 id="deal_title">Dealios</h1>
var deals_el = document.getElementById('deals');
bkg.add_deals_to_element(deals_el);
chrome.browserAction.setIcon({"path" : "images/dealios22gray.png"});
+ bkg.clear_new();
</script>
</head>
</html>

0 comments on commit e6b2bff

Please sign in to comment.