Permalink
Browse files

css tweaks

  • Loading branch information...
1 parent 8467383 commit b4e5a2c74fdcda5fc387eced857352367d7145b1 @joshblum committed Sep 5, 2013
Showing with 30 additions and 23 deletions.
  1. +10 −2 css/ratings.css
  2. +2 −2 html/dvdPopup.html
  3. +1 −1 html/queuePopup.html
  4. +4 −4 html/searchDVDPage.html
  5. +2 −2 html/searchWiPage.html
  6. +11 −12 js/ratings.js
View
@@ -23,7 +23,7 @@
margin-top: 5px;
}
-.icon-pull {
+.queue-icon {
margin-left: -10px;
}
@@ -34,6 +34,14 @@
background: transparent url('../img/tomatoSprite.png') no-repeat -312px -160px;
}
+.search-rt-icon {
+ margin-left: 12px !important;
+}
+
+.dvd-rt-icon {
+ margin-left: 10px !important;
+}
+
.tomato-icon.med.rotten {
background-position: -96px -129px;
}
@@ -80,7 +88,7 @@
.dvd-popup {
margin-bottom: -15px;
margin-top: -29px;
- margin-left: 74px;
+ margin-left: 45px;
}
.dvd-search-page {
View
@@ -21,9 +21,9 @@
</a>
<a class="rating-link" target="_blank" href="http://www.rottentomatoes.com/search/?search=The Untouchables">
<span class="tomato tomato-wrapper">
- <span class="rt-icon tomato-icon med fresh" title="Rotten Tomato Rating"></span>
+ <span class="rt-icon dvd-rt-icon tomato-icon med fresh" title="Rotten Tomato Rating"></span>
<span class="rt-score tomato-score">89%</span>
- <span class="rt-icon audience-icon med rotten" title="Rotten Tomato Rating"></span>
+ <span class="rt-icon dvd-rt-icon audience-icon med rotten" title="Rotten Tomato Rating"></span>
<span class="rt-score audience-score">55%</span>
</span>
</a>
View
@@ -76,7 +76,7 @@
The mission of rescuing a kidnapped CIA agent from a lethal terrorist cell falls to an elite squad of Navy SEALs in this covert-action thriller.
<a class="rating-link" target="_blank" href="http://www.imdb.com/title/tt0094226">
- <div class="imdb imdb-icon icon-pull star-box-giga-star" title="IMDB Rating">8.9</div>
+ <div class="imdb imdb-icon queue-icon star-box-giga-star" title="IMDB Rating">8.9</div>
</a>
<a class="rating-link" target="_blank" href="http://www.rottentomatoes.com/search/?search=The Untouchables">
<span class="tomato tomato-wrapper">
View
@@ -117,9 +117,9 @@ <h2 class="primaryResultsHeader">
</a>
<a class="rating-link" target="_blank" href="http://www.rottentomatoes.com/search/?search=The Untouchables">
<span class="tomato tomato-wrapper">
- <span class="rt-icon tomato-icon med fresh" title="Rotten Tomato Rating"></span>
+ <span class="rt-icon search-rt-icon tomato-icon med fresh" title="Rotten Tomato Rating"></span>
<span class="rt-score tomato-score">89%</span>
- <span class="rt-icon audience-icon med rotten" title="Rotten Tomato Rating"></span>
+ <span class="rt-icon search-rt-icon audience-icon med rotten" title="Rotten Tomato Rating"></span>
<span class="rt-score audience-score">55%</span>
</span>
</a>
@@ -144,9 +144,9 @@ <h2 class="primaryResultsHeader">
</a>
<a class="rating-link" target="_blank" href="http://www.rottentomatoes.com/search/?search=The Untouchables">
<span class="tomato tomato-wrapper">
- <span class="rt-icon tomato-icon med fresh" title="Rotten Tomato Rating"></span>
+ <span class="rt-icon search-rt-icon tomato-icon med fresh" title="Rotten Tomato Rating"></span>
<span class="rt-score tomato-score">89%</span>
- <span class="rt-icon audience-icon med rotten" title="Rotten Tomato Rating"></span>
+ <span class="rt-icon search-rt-icon audience-icon med rotten" title="Rotten Tomato Rating"></span>
<span class="rt-score audience-score">55%</span>
</span>
</a>
View
@@ -1270,9 +1270,9 @@ <h1 class="page-title">Other Results for ‘a’</h1>
</a>
<a class="rating-link" target="_blank" href="http://www.rottentomatoes.com/search/?search=The Untouchables">
<span class="tomato tomato-wrapper">
- <span class="rt-icon tomato-icon med fresh" title="Rotten Tomato Rating"></span>
+ <span class="rt-icon search-rt-icon tomato-icon med fresh" title="Rotten Tomato Rating"></span>
<span class="rt-score tomato-score">89%</span>
- <span class="rt-icon audience-icon med rotten" title="Rotten Tomato Rating"></span>
+ <span class="rt-icon search-rt-icon audience-icon med rotten" title="Rotten Tomato Rating"></span>
<span class="rt-score audience-score">55%</span>
</span>
</a>
View
@@ -107,7 +107,7 @@ function checkCache(title) {
var cachedVal = JSON.parse(CACHE[title]);
var inCache = false;
- if (cachedVal !== undefined && cachedVal.tomato !== undefined && cachedVal.year !== null){
+ if (cachedVal !== undefined && cachedVal.tomatoMeter !== undefined && cachedVal.year !== null){
var now = new Date().getTime();
var lifetime = now - cachedVal.date;
if(lifetime <= CACHE_LIFE) {
@@ -381,7 +381,7 @@ function displaySearch(args){
/////////// HTML BUILDERS ////////////
function getIMDBHtml(score, imdbID, title, klass) {
var html = $('<a class="rating-link" target="_blank" href="' + escapeHTML(getIMDBLink(imdbID)) + '"><div class="imdb imdb-icon star-box-giga-star" title="IMDB Rating"></div></a>');
- if (score === null) {
+ if (!score) {
html.css('visibility', 'hidden');
} else {
html.find('.imdb').addClass(klass).append(score.toFixed(1));
@@ -391,18 +391,17 @@ function getIMDBHtml(score, imdbID, title, klass) {
function getTomatoHtml(tomatoMeter, tomatoUserMeter, title, klass) {
var html = $('<a class="rating-link" target="_blank" href="' + escapeHTML(getTomatoLink(title)) + '"><span class="tomato tomato-wrapper" title="Rotten Tomato Rating"><span class="rt-icon tomato-icon med"></span><span class="rt-score tomato-score"></span><span class="rt-icon audience-icon med"></span><span class="rt-score audience-score"></span></span></a>');
- if (tomatoMeter === null || tomatoUserMeter === null) {
+ if (!tomatoMeter || !tomatoUserMeter) {
html.css('visibility', 'hidden');
return html
}
- html.find('.tomato-icon').addClass(getTomatoClass(tomatoMeter));
+ html.find('.tomato-icon').addClass(getTomatoClass(tomatoMeter)).addClass(klass);
html.find('.tomato-score').append(tomatoMeter + '%');
- html.find('.audience-icon').addClass(getTomatoClass(tomatoUserMeter));
+ html.find('.audience-icon').addClass(getTomatoClass(tomatoUserMeter)).addClass(klass);
html.find('.audience-score').append(tomatoUserMeter + '%');
-
- html.addClass(klass); //add custom class
+
return html
}
@@ -423,23 +422,23 @@ function escapeHTML(str) {
///////// INIT /////////////
$(document).ready(function() {
//common select objects
- var dvdSelObj = selectObj('.bobMovieRatings', 'append', 800, 'dvd-popup');
- var WiObj = selectObj('.midBob', 'append', 700);
+ var dvdSelObj = selectObj('.bobMovieRatings', 'append', 800, 'dvd-popup', 'dvd-rt-icon');
+ var WiObj = selectObj('.midBob', 'append', 800);
//poup select types
POPUP_INS_SEL = {
'movies.netflix.com' : {
'Wi': WiObj, // main page selector
- 'Queue' : selectObj('.info', 'before', 800, '.icon-pull'), // queue page selector
+ 'Queue' : selectObj('.info', 'before', 800, 'queue-icon'), // queue page selector
},
'dvd.netflix.com' : dvdSelObj, // dvdqueue page selector
};
//search select types
SEARCH_SEL = {
//search page selectors
- 'Search' : selectObj('.bluray', 'append', -1, 'dvd-search-page'),
- 'WiSearch' : selectObj('.actions', 'append', -1, 'wi-search-page'),
+ 'Search' : selectObj('.bluray', 'append', -1, 'dvd-search-page', 'search-rt-icon'),
+ 'WiSearch' : selectObj('.actions', 'append', -1, 'wi-search-page', 'search-rt-icon'),
};
addStyle(); //add ratings.css to the page

0 comments on commit b4e5a2c

Please sign in to comment.