Skip to content

Commit

Permalink
Ad placement changes, Title to WPM/speed panel
Browse files Browse the repository at this point in the history
  • Loading branch information
Putnam14 committed Jan 27, 2018
1 parent 2c7497f commit 51a2931
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 26 deletions.
3 changes: 3 additions & 0 deletions .gitignore
@@ -1,3 +1,6 @@
config.js
views/belowSpeedAd.html
views/ad.html
views/ad.html
views/aboveDescAd.html
views/ad.html
4 changes: 2 additions & 2 deletions app.js
@@ -1,6 +1,6 @@
var express = require('express');
var path = require('path');
var logger = require('morgan');
//var logger = require('morgan');
var cookieParser = require('cookie-parser');
var expressSanitizer = require('express-sanitizer');
var bodyParser = require('body-parser');
Expand All @@ -14,7 +14,7 @@ app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'jade');

//Test
app.use(logger('dev'));
//app.use(logger('dev'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.use(expressSanitizer());
Expand Down
8 changes: 1 addition & 7 deletions routes/index.js
Expand Up @@ -48,8 +48,6 @@ router.get('/book/isbn-:urlISBN/?', function(req, res, next) {
if (results == null || results.Title == null) {
res.redirect('/404');
} else {
//res.status(200).send(results); //JSON
//bookSearch.getBookPrice(ISBN, function(price) {
var WPM = config.wordsPerMinuteReading;
var estMin = (results.Wordcount / WPM);
var avgEstHr = Math.floor(estMin / 60);
Expand Down Expand Up @@ -91,7 +89,6 @@ router.get('/book/isbn-:urlISBN/?', function(req, res, next) {
ISBN: results.ISBN,
Title: results.Title,
Author: results.Author,
//MSRP: results.MSRP,
Pages: PagesC,
Wordcount: WordcountC,
Dot: dot,
Expand All @@ -106,14 +103,11 @@ router.get('/book/isbn-:urlISBN/?', function(req, res, next) {
Sim3Title: results.Sim3Title,
Image: results.Image,
Description: Description,
//Price: price,
FeaturedMonth: config.featuredBook.month,
FeaturedTitle: featured.Title,
FeaturedImage: featured.Image,
FeaturedISBN: featured.ISBN,
FeaturedWordcount: fWordcountC,
adsDiv: config.responsiveAdId,
adsSrc: config.responsiveAdSrc
FeaturedWordcount: fWordcountC
//});
});
}
Expand Down
1 change: 1 addition & 0 deletions views/ad.html
@@ -1 +1,2 @@
<script type="text/javascript">amzn_assoc_ad_type = "banner";amzn_assoc_marketplace = "amazon";amzn_assoc_region = "US";amzn_assoc_placement = "assoc_banner_placement_default";amzn_assoc_campaigns = "audible";amzn_assoc_banner_type = "category";amzn_assoc_p = "14";amzn_assoc_isresponsive = "false";amzn_assoc_banner_id = "09MTQ09QKCF2HNGHKH82";amzn_assoc_width = "160";amzn_assoc_height = "600";amzn_assoc_tracking_id = "readleng-20";amzn_assoc_linkid = "41cd645968f931ac410debf623ad483e";</script><script src="//z-na.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&Operation=GetScript&ID=OneJS&WS=1"></script>

30 changes: 13 additions & 17 deletions views/books.jade
Expand Up @@ -4,17 +4,19 @@ block content
include search
.row
.col-sm-10
div(align="center")
include aboveDescAd.html
.col-sm-5
.panel.panel-default
.panel-heading
a(href="http://www.amazon.com/dp/#{ISBN}?tag=#{ref}", style="color: inherit")
h3.panel-title.text-center #{Title}
p.panel-title.text-center #{Title}
.panel-body
.row
.col-sm-5.text-center
.col-sm-4.text-center
a(href="http://www.amazon.com/dp/#{ISBN}?tag=#{ref}", style="color: inherit")
img.img-thumbnail.img-responsive(src="#{Image}", alt="#{Title} by #{Author}")
.col-sm-7
.col-sm-8
p #{Author}
p #{ReleaseDate}
p Pages: #{Pages} pages
Expand All @@ -24,35 +26,29 @@ block content
a(href="http://www.amazon.com/dp/#{ISBN}?tag=#{ref}", style="color: inherit")
.row.text-center
.col-sm-12
-//p MSRP: #{MSRP}
-//p Current price: #{Price} (Amazon)
img.img-responsive.center-block(src="/img/shopnow.png", alt="Shop for #{Title} at Amazon")
.col-sm-7
.panel.panel-default
.panel-heading
p.panel-title.text-center How long will it take to read this?
.panel-body
p #{avgEstHr} hours and #{avgEstMin} minutes to read #{Title} on average (#{WPM} WPM).
p The average reader will spend #{avgEstHr} hours and #{avgEstMin} minutes reading #{Title} at #{WPM} WPM (words per minute).
hr
.readtime.hidden#results
p This should take you around <ins id="estHr"></ins> hours and <ins id="estMin"></ins> minutes to read!
p Read for <ins id="month"></ins> minutes each day and finish within a month!
hr
p Estimate your speed
p Find out how long it will take you to read by entering your reading speed.
.input-group
input.form-control#WPM(name="WPM", type="number", min="1", placeholder="Enter WPM")
span.input-group-btn
button.btn.btn-default#calculate(onclick="calculate();") Estimate!
-//input.form-control#pagesRead(name="pagesRead", type="number", min="0", max="#{Pages}", placeholder="How many pages have you read?")
-//button.btn.btn-default#calculate(style="margin:auto", onclick="calculate();") Estimate!
//-input.form-control#pagesRead(name="pagesRead", type="number", min="0", max="#{Pages}", placeholder="How many pages have you read?")
//-button.btn.btn-default#calculate(style="margin:auto", onclick="calculate();") Estimate!
.panel-footer
p Find #[a(href="/wpm/", target="_blank") your reading speed by taking one of these tests] or by reading this book's description, below.
div(align="center")
include belowSpeedAd.html
.col-sm-12
.panel.panel-default
.panel-heading.text-center.small Sponsored Links
.panel-body(align="center")
div(id="#{adsDiv}")
script(async, src="#{adsSrc}")
.col-sm-12(align="center")
include belowSpeedAd.html
.col-sm-12
.panel.panel-default
.panel-heading.text-center
Expand Down

0 comments on commit 51a2931

Please sign in to comment.