mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-05-18 03:06:53 +00:00
Separate mobile and desktop ads
This commit is contained in:
@@ -12,5 +12,8 @@
|
|||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js"></script>
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js"></script>
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.map"></script>
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.map"></script>
|
||||||
|
|
||||||
|
<!--Mobile and tablet detection-->
|
||||||
|
<script type='text/javascript' src="//wurfl.io/wurfl.js"></script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,6 +1,17 @@
|
|||||||
<% if Rails.env.production? %>
|
<% if Rails.env.production? %>
|
||||||
<div class="ad">
|
<div class="ad">
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
if(WURFL.is_mobile){
|
||||||
|
//Mobile and tablet ad
|
||||||
|
(function(){
|
||||||
|
CHITIKA = window.CHITIKA ? window.CHITIKA : {'units' : []};
|
||||||
|
CHITIKA.publisher = 'cwimer';
|
||||||
|
var s = document.createElement('script');
|
||||||
|
s.src = '//cdn.chitika.net/getads.js';
|
||||||
|
try { document.getElementsByTagName('head')[0].appendChild(s); } catch(e) { document.write(s.outerHTML);}
|
||||||
|
}())
|
||||||
|
} else {
|
||||||
|
//Desktop ad
|
||||||
(function (){
|
(function (){
|
||||||
if(window.CHITIKA===undefined) {window.CHITIKA = {'units' :[]};};
|
if(window.CHITIKA===undefined) {window.CHITIKA = {'units' :[]};};
|
||||||
var unit = {"calltype":"async[2]","publisher":"cwimer","width":120,"height":600,"sid":"Chitika Default"};
|
var unit = {"calltype":"async[2]","publisher":"cwimer","width":120,"height":600,"sid":"Chitika Default"};
|
||||||
@@ -8,6 +19,7 @@
|
|||||||
window.CHITIKA.units.push(unit);
|
window.CHITIKA.units.push(unit);
|
||||||
document.write('<div id="chitikaAdBlock-' + placement_id + '"></div>');
|
document.write('<div id="chitikaAdBlock-' + placement_id + '"></div>');
|
||||||
}());
|
}());
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<script type="text/javascript" src="//cdn.chitika.net/getads.js" async></script>
|
<script type="text/javascript" src="//cdn.chitika.net/getads.js" async></script>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user