add banners
This commit is contained in:
BIN
contrib/static/banners/banner_0.jpg
Normal file
BIN
contrib/static/banners/banner_0.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
BIN
contrib/static/banners/banner_1.jpg
Normal file
BIN
contrib/static/banners/banner_1.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.8 KiB |
BIN
contrib/static/banners/banner_2.jpg
Normal file
BIN
contrib/static/banners/banner_2.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 66 KiB |
@@ -12,3 +12,15 @@ function nntpchan_backlink(shorthash)
|
||||
elem.value += ">>" + shorthash.substr(0,10) + "\n";
|
||||
}
|
||||
}
|
||||
|
||||
var banner_count = 3;
|
||||
|
||||
// inject a banner into an element
|
||||
function nntpchan_inject_banners(elem, prefix) {
|
||||
var n = Math.floor(Math.random() * banner_count);
|
||||
var banner = prefix + "static/banner_"+n+".jpg";
|
||||
var e = document.createElement("img");
|
||||
e.src = banner;
|
||||
e.setAttribute("class", "nntpchan_banner");
|
||||
elem.appendChild(e);
|
||||
}
|
||||
|
Reference in New Issue
Block a user