GM_addStyle(
'a.ujhozzaszolas,span.ismeretlen { font-size: smaller; margin-left: 5px; }'+
'a.ujhozzaszolas { color: black; font-weight: bold; }'+
'span.ismeretlen { color: gray; }'
)
var elevules=3*30.5*24*60*60*1000
if (document.location.pathname=='/') {
var lista=document.querySelectorAll('div#block-forum-0 ul a, div#block-forum-1 ul a')
for (var i=0,l=lista.length;i<l;i++) {
if (!lista[i].title) continue
var szal=lista[i].href.replace(/.*\/forumok\/temak\//,'')
var ertek=GM_getValue('szal_'+szal)
if (ertek==undefined) {
var span=document.createElement('span')
lista[i].parentNode.appendChild(span)
span.className='ismeretlen'
span.innerHTML='(?)'
continue
}
var [szam,datum]=ertek.split(' ')
var most=lista[i].title.replace(/\D/g,'')
if (most==szam) continue
var a=document.createElement('a')
lista[i].parentNode.appendChild(a)
a.className='ujhozzaszolas'
a.href=lista[i].href.substring(location.href.length-1)+'#new'
a.title=new Date(parseInt(datum,10))+' óta'
a.innerHTML='('+(most-szam)+' új)'
}
lista=document.querySelectorAll('div#block-blogmark-0 ul a.comment-count')
for (var i=0,l=lista.length;i<l;i++) {
if (lista[i].textContent=='(0)') continue
var mark=lista[i].href.replace(/.*\/blogmarkok\//,'')
var ertek=GM_getValue('mark_'+mark)
if (ertek==undefined) {
var span=document.createElement('span')
lista[i].parentNode.appendChild(span)
span.className='ismeretlen'
span.innerHTML='(?)'
continue
}
var [szam,datum]=ertek.split(' ')
var most=lista[i].textContent.replace(/\D/g,'')
if (most==szam) continue
var a=document.createElement('a')
lista[i].parentNode.appendChild(a)
a.className='ujhozzaszolas'
a.href=lista[i].href.substring(location.href.length-1)+'#new'
a.title=new Date(parseInt(datum,10))+' óta'
a.innerHTML='('+(most-szam)+' új)'
}
} else if (document.location.pathname.substring(0,15)=='/forumok/temak/') {
var szal=document.location.pathname.substring(15)
var szam=document.querySelectorAll('div.commentnum').length
var most=new Date().getTime()
GM_setValue('szal_'+szal,szam+' '+most)
} else if (document.location.pathname.substring(0,12)=='/blogmarkok/') {
var szal=document.location.pathname.substring(12)
var szam=document.querySelectorAll('div.commentnum').length
var most=new Date().getTime()
GM_setValue('mark_'+szal,szam+' '+most)
}
var most=new Date().getTime()
var torles=GM_getValue('torles')
if (torles!=undefined && most-torles<24*60*60*1000) return
torles=parseInt(torles,10)
var lista=GM_listValues()
for (var i=0,l=lista.length;i<l;i++) {
if (lista[i].substring(0,5)!='szal_' && lista[i].substring(0,5)!='mark_') continue
var ertek=GM_getValue(lista[i])
var datum=ertek.replace(/.* /,'')
if (most-datum<elevules) continue
GM_deleteValue(lista[i])
}
GM_setValue('torles',''+most)