Skip to content

Commit a23e3b7

Browse files
committed
added support for banner ad
1 parent 8701634 commit a23e3b7

File tree

4 files changed

+53
-28
lines changed

4 files changed

+53
-28
lines changed

ads.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
scratchpad
2+
3+
-# .adunit#v1_protip{'data-dimensions'=>"320x100"}
4+
-# :javascript
5+
-# $.dfp('181068894');
6+
7+
-# %script{async: true, src: "//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"}
8+
-# %ins{"class" => "adsbygoogle", "style" => "display:inline-block;width:320px;height:100px", "data-ad-client" => "ca-pub-6075623866293464", "data-ad-slot" => "3507958237"}
9+
-# :javascript
10+
-# (adsbygoogle = window.adsbygoogle || []).push({});
11+
12+
-# :javascript{id: 'mNCC'}
13+
-# medianet_width = "300";
14+
-# medianet_height = "250";
15+
-# medianet_crid = "777595362";
16+
-# medianet_versionId = "111299";
17+
-# (function() {
18+
-# var isSSL = 'https:' == document.location.protocol;
19+
-# var mnSrc = (isSSL ? 'https:' : 'http:') + '//contextual.media.net/nmedianet.js?cid=8CU5XGBHT' + (isSSL ? '&https=1' : '');
20+
-# document.write('<scr' + 'ipt type="text/javascript" id="mNSC" src="' + mnSrc + '"></scr' + 'ipt>');
21+
-# })();

app/views/layouts/application.html.haml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@
99
= csrf_meta_tags
1010
= render 'shared/analytics'
1111
%body
12+
:javascript
13+
(function(){
14+
var bsa = document.createElement('script');
15+
bsa.type = 'text/javascript';
16+
bsa.async = true;
17+
bsa.src = '//s3.buysellads.com/ac/bsa.js';
18+
(document.getElementsByTagName('head')[0]||document.getElementsByTagName('body')[0]).appendChild(bsa);
19+
})();
1220
.flex.flex-column{:style => "min-height:100vh"}
1321
%header.border-bottom
1422
%nav.clearfix.px2

app/views/protips/index.html.haml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@
1818
%h2.mt0.black=protips_heading
1919
%p.clearfix.py1.font-lg.black=protips_description
2020
=render @protips
21-
.clearfix
22-
.btn.left= link_to_previous_page @protips, 'Previous'
23-
.btn.right= link_to_next_page @protips, 'Next'
21+
.clearfix.mt3
22+
.btn.left= link_to_previous_page @protips, 'Previous', class: 'border rounded p1 h3'
23+
.btn.right= link_to_next_page @protips, 'Next', class: 'border rounded p1 h3'
2424
25-
.md-col.md-show.md-col-4
26-
.clearfix.ml3
25+
.sm-col.sm-col.sm-col-12.md-col-4
26+
27+
.clearfix.ml3.md-show
2728
-if first_page?
2829
-categories = Category.children(params[:topic])
2930
-if categories.present?
@@ -72,7 +73,7 @@
7273
protips
7374
.mb4
7475
75-
.clearfix.ml3
76+
.clearfix.ml3.md-show
7677
.bg-white.rounded.p1
7778
%h5.mt0.mb1
7879
=icon('diamond', class: 'mr1')
@@ -83,3 +84,9 @@
8384
8485
%a.block.mt2.bold{href: jobs_path}
8586
Search all programming jobs
87+
88+
-if show_ads?
89+
.clearfix.ml3.mt3
90+
#bsap_1305410.bsarocks.bsap_74f50e679004d8f4d62fec4b0f74ccf1
91+
-if Rails.env.development?
92+
%img{src: 'http://placehold.it/350x200'}

app/views/protips/show.html.haml

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -63,25 +63,6 @@
6363
.sm-col.md-col-7.sm-col-12
6464
-if show_ads?
6565
.mt2.md-right.sm-center
66-
-# .adunit#v1_protip{'data-dimensions'=>"320x100"}
67-
-# :javascript
68-
-# $.dfp('181068894');
69-
70-
-# %script{async: true, src: "//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"}
71-
-# %ins{"class" => "adsbygoogle", "style" => "display:inline-block;width:320px;height:100px", "data-ad-client" => "ca-pub-6075623866293464", "data-ad-slot" => "3507958237"}
72-
-# :javascript
73-
-# (adsbygoogle = window.adsbygoogle || []).push({});
74-
75-
:javascript{id: 'mNCC'}
76-
medianet_width = "300";
77-
medianet_height = "250";
78-
medianet_crid = "777595362";
79-
medianet_versionId = "111299";
80-
(function() {
81-
var isSSL = 'https:' == document.location.protocol;
82-
var mnSrc = (isSSL ? 'https:' : 'http:') + '//contextual.media.net/nmedianet.js?cid=8CU5XGBHT' + (isSSL ? '&https=1' : '');
83-
document.write('<scr' + 'ipt type="text/javascript" id="mNSC" src="' + mnSrc + '"></scr' + 'ipt>');
84-
})();
8566

8667
-if signed_in?
8768
#new-comment.new-comment.mt2.mb2.px2
@@ -90,7 +71,7 @@
9071
= form_for Comment.new do |form|
9172
.border.rounded
9273
= form.hidden_field :protip_id, value: @protip.id
93-
= form.text_area :body, rows: 1, class: 'field block col-12 focus-no-border focus-pb3', placeholder: "Enter your response here. Smile and don't forget to be nice.", style: 'border: none; outline: none', value: flash[:data]
74+
= form.text_area :body, rows: 1, class: 'field block col-12 focus-no-border focus-pb3', placeholder: "Enter a response here. Smile and be nice.", style: 'border: none; outline: none', value: flash[:data]
9475
.text-area-footer.px1.py1.font-sm
9576
Markdown is totally
9677
=icon('thumbs-o-up')
@@ -107,7 +88,7 @@
10788
%h4=pluralize(@protip.comments.size, 'Response')
10889
=render @protip.comments
10990

110-
.md-col.md-show.md-col-4
91+
.sm-col.sm-col.sm-col-12.md-col-4
11192
-if @protip.related_topics.present?
11293
.clearfix.ml3.mt3.p1
11394
%h5.mt0.mb1
@@ -120,7 +101,7 @@
120101
.bold=t(topic, scope: :categories)
121102

122103
- cache ['v1', @protip, 'featured-jobs', expires_in: 1.day ] do
123-
.clearfix.ml3.mt3
104+
.clearfix.ml3.mt3.md-show
124105
.bg-white.rounded.p1
125106
%h5.mt0.mb1
126107
=icon('diamond', class: 'mr1')
@@ -132,5 +113,13 @@
132113
%a.block.mt2.bold{href: jobs_path}
133114
Search all programming jobs
134115

116+
-if show_ads?
117+
.clearfix.ml3.mt3
118+
#bsap_1305410.bsarocks.bsap_74f50e679004d8f4d62fec4b0f74ccf1
119+
-if Rails.env.development?
120+
%img{src: 'http://placehold.it/350x200'}
121+
122+
123+
135124

136125
%script{ src: "https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js" }

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy