Permalink
Browse files

Added: promo image

Update: more spacing around vote buttons
Update: hover style on subtext buttons
Fixed: issue with stories on scribd breaking titles
  • Loading branch information...
1 parent 82251e8 commit 64c57b2a67910196e26e8eb54cb3d0b17fadf590 @tommoor committed Apr 25, 2012
Showing with 41 additions and 12 deletions.
  1. +29 −2 hn.css
  2. BIN images/promo.png
  3. +12 −10 js/hn.js
View
31 hn.css
@@ -99,6 +99,11 @@ td.title a {
color: #2279B2;
}
+td.title a:hover {
+ color: #2991D6;
+}
+
+
td.title a:visited {
color: #87C1E8;
}
@@ -114,6 +119,25 @@ td.title:first-child {
min-width: 33px;
}
+td.subtext a:hover {
+ color: #444;
+}
+
+
+/*********** Vote Arrows ****************/
+
+tr>td>center>a {
+ padding: 4px;
+ vertical-align: bottom;
+ opacity: 0.8;
+ position: relative;
+ top: 3px;
+}
+
+tr>td>center>a:hover {
+ opacity: 1;
+}
+
/*********** Story Share Menu ***********/
@@ -140,22 +164,25 @@ td.title:first-child {
td.title .filter-menu {
position: absolute;
top: 8px;
- right: 10px;
+ right: 0;
}
td.title .filter-menu span {
display: block;
width: 30px;
height: 30px;
font-size: 18px;
- color: #fff;
+ color: rgba(255,255,255,0);
text-align: center;
line-height: 30px;
+ padding-right: 10px;
+ cursor: pointer;
-webkit-transition: all 0.2s ease-in-out;
}
td.title:hover .filter-menu span {
color: #999;
+ background: #fff;
}
td.title .filter-menu ul {
View
BIN images/promo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
22 js/hn.js
@@ -9,7 +9,7 @@ var hn = {
init: function(){
- hn.getPage();
+ hn.setPage();
hn.styleElements();
hn.createProfileBubble();
hn.createQuickReply();
@@ -18,7 +18,7 @@ var hn = {
hn.bindEvents();
},
- getPage: function(){
+ setPage: function(){
switch(window.location.pathname) {
case '/item':
@@ -151,12 +151,13 @@ var hn = {
// load next page
$temp.load(url, function(){
+
+ // find the first news title and jump up two levels to get news table body
+ $temp = $temp.find('td.title:first-child').parent().parent().html();
// add extra options to stories before appending to DOM
hn.augmentStories($temp);
-
- // find the first news title and jump up two levels to get news table body
- $morerow.after($temp.find('td.title:first-child').parent().parent().html());
+ $morerow.after($temp);
$morerow.remove();
hn.endless_loading = false;
@@ -353,9 +354,9 @@ var hn = {
var $context = $('body');
}
- $('td.title a', $context).each(function(){
+ $('td.title', $context).each(function(){
- var $link = $(this);
+ var $link = $('a', this);
var $title = $link.parent();
var $details = $title.parent().next().find('td.subtext');
@@ -364,15 +365,16 @@ var hn = {
var username = $('a', $details).first().text();
// add filtering options
- $(this).before('<div class="filter-menu"><span>&#215;</span> <div class="quick-filter"><em></em> <ul>'+
+ $link.before('<div class="filter-menu"><span>&#215;</span> <div class="quick-filter"><em></em> <ul>'+
'<li><a data-filter="user:'+ username +'" class="add-filter">Filter user \''+ username +'\'</a></li>'+
'<li><a data-filter="site:'+ domain +'" class="add-filter">Filter&nbsp;'+ domain +'</a></li>'+
'</ul></div></div>');
// add sharing options
- $details.append(' | <a class="share-story">share</a>');
+ $details.append(' | <a class="share-story" href="#">share</a>');
- $('.share-story', $details).click(function(){
+ $('.share-story', $details).click(function(ev){
+ ev.preventDefault();
hn.shareStory(this, $link.attr('href'), $link.text());
});
});

0 comments on commit 64c57b2

Please sign in to comment.