forked from GithubBackups/vichan
Call on ready, dont pollute window namespace with vars
This commit is contained in:
parent
98209fc806
commit
4208c16f61
@ -1,4 +1,6 @@
|
|||||||
$.hash = function(str) {
|
if (active_page == 'thread' || active_page == 'index') {
|
||||||
|
$(document).ready(function(){
|
||||||
|
$.hash = function(str) {
|
||||||
var i, j, msg = 0;
|
var i, j, msg = 0;
|
||||||
|
|
||||||
for (i = 0, j = str.length; i < j; ++i) {
|
for (i = 0, j = str.length; i < j; ++i) {
|
||||||
@ -6,9 +8,9 @@ $.hash = function(str) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return msg;
|
return msg;
|
||||||
};
|
};
|
||||||
|
|
||||||
function stringToRGB(str){
|
function stringToRGB(str){
|
||||||
var rgb, hash;
|
var rgb, hash;
|
||||||
|
|
||||||
rgb = [];
|
rgb = [];
|
||||||
@ -19,9 +21,9 @@ function stringToRGB(str){
|
|||||||
rgb[2] = (hash >> 8) & 0xFF;
|
rgb[2] = (hash >> 8) & 0xFF;
|
||||||
|
|
||||||
return rgb;
|
return rgb;
|
||||||
}
|
}
|
||||||
|
|
||||||
$(".poster_id").each(function(){
|
$(".poster_id").each(function(){
|
||||||
var rgb = stringToRGB($(this).text());
|
var rgb = stringToRGB($(this).text());
|
||||||
|
|
||||||
$(this).css({
|
$(this).css({
|
||||||
@ -30,5 +32,6 @@ $(".poster_id").each(function(){
|
|||||||
"border-radius": "8px",
|
"border-radius": "8px",
|
||||||
"color": "white"
|
"color": "white"
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user