Permalink
Browse files

Add a live image

  • Loading branch information...
1 parent daf22ac commit cf109ead23e47d486ff202abc3cdf8b14f488868 Michael Sofaer committed Aug 21, 2012
Showing with 10 additions and 3 deletions.
  1. +3 −0 cloudflare.json
  2. BIN public/images/counter.png
  3. +7 −3 public/javascripts/countersback.js
View
@@ -19,6 +19,9 @@
},
"detail_page" : [
"./public/images/example.png"
+ ],
+ "images" : [
+ "./public/images/counter.png"
]
},
"interface": [
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -4,17 +4,21 @@ CloudFlare.define("countersback",
{
function addBadge(count){
var cdnPath = "//ajax.cloudflare.com/cdn-cgi/nexp/apps/countersback/";
+ var div = $("<div>")
$("<img>",{
- src: cdnPath + "images/badge.png",
+ src: cdnPath + "images/counter.png",
"class": "countersback"
- }).appendTo("body");
+ }).appendTo(div);
+ $("<span>", {"style": "position:relative; top:-20px; left:-50px;")
+ .text(count).appendTo(div)
+ div.appendTo("body")
}
$.getJSON(
"http://countersback.herokuapp.com/hit?callback=?",
{domain_id: config && config.domain_id},
function(data){
if (this.data.count){
- addBadge(this.data.count);
+ addBadge(this.data.count)
}
}
)

0 comments on commit cf109ea

Please sign in to comment.