jQuery(function($) {
var history = JSON.parse( $.cookie( WPBH_COOKIE_NAME_HISTORY ) );
if ( history == null || history["version"] != WPBH_COOKIE_VERSION ) {
$("div.wp-browsing-history").attr("style", "display:none;");
return;
}
if ( parseInt(history["length"]) > 0 ) {
var html = "";
if ( WPBH_ENABLE_HEADING ) {
html += '
';
}
html += '';
var list = "";
for ( var i = 0; i < parseInt(history["length"]); i++ ) {
var hist = history["list"][i];
list += '- ';
// list += '';
// list += '[' + (i+1) + ']';
// list += '';
list += '';
list += '';
list += hist["title"];
list += '';
list += '';
if ( WPBH_ENABLE_DATE_BR ) {
list += '
';
}
if ( WPBH_ENABLE_DATE ) {
list += '';
if ( WPBH_ENABLE_DATE_PARENTHESIS ) {
list += '(' + new Date( hist["time"] * 1000 ).toLocaleString() + ')';
} else {
list += new Date( hist["time"] * 1000 ).toLocaleString();
}
list += '';
}
list += ' ';
}
html += list;
html += "
";
if ( WPBH_SHOW_PLUGIN_LINK ) {
html += 'powered by WP Browsing History Plugin
';
}
if ( 0 < $(".wp-browsing-history").size() ) {
$(".wp-browsing-history").append( html );
}
}
});