Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

New deals are highlighted

  • Loading branch information...
commit e6b2bff36e41b978357a4ac2a41997b0e1c59a77 1 parent 7948aa1
@jonathonloo jonathonloo authored
Showing with 26 additions and 1 deletion.
  1. +21 −0 background.html
  2. +4 −1 css/style.css
  3. +1 −0  popup.html
View
21 background.html
@@ -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,6 +160,7 @@
// 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);
@@ -151,6 +168,10 @@
}
window.localStorage.setItem(deal_source, JSON.stringify(current_deal_titles));
};
+
+ function clear_new(){
+ new_deals = [];
+ };
</script>
</head>
<body>
View
5 css/style.css
@@ -8,5 +8,8 @@ ul:before{content: ""; position: absolute; top: -13px; left: 18px; width: 18px;
#deals > h3 { font-family: "Lucida Sans", helvetica, sans-serif; text-transform: uppercase; font-size: 14px; color: #757575; font-weight: bold; margin-top: 5px; margin-bottom: 10px;text-shadow: 0px 0px 1px rgba(0,0,0,0);}
#deals li { padding: 6px 5px 6px 29px; margin: 0; border-bottom: 1px solid #ebebeb; position: relative;}
#deals li:before { content: ""; position: absolute; width: 4px; height: 4px; background-color: #3f463e; border-radius: 2px; top: 15px; left: 13px; }
-#deals li a { text-decoration: none; font-family: helvetica, sans-serif; color: #4d83a7; font-weight: bold; font-size: 13px; text-shadow: 0px 0px 1px rgba(0,0,0,0);}
+#deals li a { text-decoration: none; font-family: helvetica, sans-serif; font-weight: bold; font-size: 13px; text-shadow: 0px 0px 1px rgba(0,0,0,0);}
+
+.olddeal{color: #4d83a7;}
+.newdeal{color: #95d330;}
li:nth-child(even){background-color: #f9f9f9;}
View
1  popup.html
@@ -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>
Please sign in to comment.
Something went wrong with that request. Please try again.