okoun
CSS
#novydiv {
font-size: 90%;
overflow: hidden;
}
#novydiv .item {
margin-bottom: 0;
}
.hdn {
display: none;
}
#bodytype {
float: left;
}
#bodytype input {
margin-right: 5px;
}
label {
cursor: pointer;
}
#adwrapper-lb {
display: none !important;
}
div.info {
display: none !important;
}
JavaScript
var $el = $(".main > .yui-g > .yui-u").first();
if ($el.length === 0) {
$el = $(".main > .yui-gc > .yui-u").first();
}
$el.html("<h3>S novými</h3> <div id='novydiv'></div>");
$('select[name ="bodyType"]').val("html");
var rpl = "<div id='bodytype'>";
rpl = rpl + "<label><input type='radio' name='bodyType' value='plain' checked>Text</label>  ";
rpl = rpl + "<label><input type='radio' name='bodyType' value='html'>HTML</label>";
rpl = rpl + "</div>";
$('select[name ="bodyType"]').replaceWith( rpl);
var $novy = $("#novydiv");
$("#novydiv").height($(".listing").height() + "px");
xload();
setInterval(
function(){
xload();
}, 10000);
var mesice = "ledna,února,března,dubna,května,června,července,srpna,září,října,listopadu,prosince";
var mesice_arr = mesice.split(",");
function xload() {
$novy.load( "https://www.okoun.cz/favourites.jsp?new=1&k="+Math.random()+" .item", function() {
var $pole = $novy.find( ".item" );
$pole.each(function() {
var str_dt = $(this).find("span.date").html();
var arr = str_dt.split(" ");
var arr2 = arr[0].split(".");
var den = arr2[0];
var mesic = mesice_arr.indexOf(arr2[1]);
var out = arr[1];
if (mesic<10) {out = out + "0";}
out = out + mesic;
if (den<10) {out = out + "0";}
out = out + den;
if (arr[2].length<8) {out = out + "0";}
out = out + arr[2];
var nazev = $(this).find("a.name").html();
var href = $(this).find("a.name").attr('href');
var novych = $(this).find("b").html();
$(this).html("<span class='hdn'>" + out + "</span><a href='" + href + "'>" + nazev + "</a> - " + novych);
});
$("#novydiv .item").sort(descending_sort).appendTo('#novydiv');
});
}
function descending_sort(a, b) {
return ($(b).text().toUpperCase()) > ($(a).text().toUpperCase()) ? 1 : -1;
}