");
history_aux_arr.shift();
for (var i = 0; i < history_aux_arr.length; i++) {
///console.log('orig: '+history_aux_arr[i]);
history_record_aux_arr=history_aux_arr[i].split(" | ");
startPoint=String(history_record_aux_arr[1]).indexOf("");
if (startPoint!=-1) {
lengthPoint=startPoint;
history_record_aux_arr[1] = history_record_aux_arr[1].substr(0,lengthPoint);
history_record_aux_arr[1] = history_record_aux_arr[1].replace(/<\/?[^>]+(>|$)/g, "");
//alert (history_aux_arr[i]);
if (history_record_aux_arr[1]!='' && history_record_aux_arr[1]!='Empty Title' && history_record_aux_arr[1]!='ROCK RADIO - CISTI ROCK! - www.rockradio.si') {
history_temp_str=history_record_aux_arr[1].split('-');
if (history_temp_str[0]===undefined) {
history_temp_str[0]='';
}
if (history_temp_str[1]===undefined) {
history_temp_str[1]='';
}
/*console.log(history_record_aux_arr[1]);
console.log(history_record_aux_arr[0].trim()+' -- '+history_temp_str[0].trim()+' -- '+history_temp_str[1].trim());
console.log('------------------------------------------------------');*/
current_obj.title_arr.push( history_temp_str[1].trim() );
current_obj.artist_arr.push( history_temp_str[0].trim() );
current_obj.time_arr.push( history_record_aux_arr[0].trim() );
current_obj.image_arr.push( options.noImageAvailable );
}
}
}
/*current_obj.title_arr=current_obj.title_arr.slice(Math.max(current_obj.title_arr.length - options.numberOfElementsDisplayed, 1));
current_obj.artist_arr=current_obj.artist_arr.slice(Math.max(current_obj.artist_arr.length - options.numberOfElementsDisplayed, 1));
current_obj.time_arr=current_obj.time_arr.slice(Math.max(current_obj.time_arr.length - options.numberOfElementsDisplayed, 1));
current_obj.image_arr=current_obj.image_arr.slice(Math.max(current_obj.image_arr.length - options.numberOfElementsDisplayed, 1));*/
current_obj.title_arr=current_obj.title_arr.slice(0,Math.min(options.numberOfElementsDisplayed, current_obj.artist_arr.length));
current_obj.artist_arr=current_obj.artist_arr.slice(0,Math.min(options.numberOfElementsDisplayed, current_obj.artist_arr.length));
current_obj.time_arr=current_obj.time_arr.slice(0,Math.min(options.numberOfElementsDisplayed, current_obj.artist_arr.length));
current_obj.image_arr=current_obj.image_arr.slice(0,Math.min(options.numberOfElementsDisplayed, current_obj.artist_arr.length));
//current_obj.playlist_arr=history_aux_arr;
//alert (history_aux_arr+' --- '+current_obj.playlist_arr[0]);
}
} else {
/*console.log("history: "+result);
console.log('------------------------------------------------------');
console.log('------------------------------------------------------');*/
var obj_json = JSON.parse(result);
var the_k=0
var author_arr=new Array();
var temp_date;
var temp_hours;
var temp_minutes;
var temp_seconds
//console.log("aa:"+obj_json.items+' ---- '+Object.keys(obj_json.items).length+' ---- '+obj_json.items[0].title);
if (obj_json.items instanceof Array) {
while (the_k < Object.keys(obj_json.items).length) {
author_arr=obj_json.items[the_k].title.split('-');
author_arr[0]=author_arr[0].trim();
/*if (author_arr.length>2) {
author_arr[0]=author_arr[0].trim()+'-'+author_arr[1].trim();
author_arr[1]=author_arr[2].trim();
}*/
temp_date= new Date(obj_json.items[the_k].date * 1000);
// Hours part from the timestamp
temp_hours = temp_date.getHours();
// Minutes part from the timestamp
temp_minutes = "0" + temp_date.getMinutes();
// Seconds part from the timestamp
temp_seconds = "0" + temp_date.getSeconds();
if (the_k===0 & current_obj.title_arr[0]==author_arr[1] && current_obj.artist_arr[0]==author_arr[0]) {
//nothing
} else {
current_obj.title_arr.push( author_arr[1] );
current_obj.artist_arr.push( author_arr[0] );
current_obj.time_arr.push( temp_hours + ':' + temp_minutes.substr(-2) + ':' + temp_seconds.substr(-2) );
current_obj.image_arr.push( options.noImageAvailable );
}
the_k++;
}
//remove first song from history because is the same as the current song
/*current_obj.title_arr.shift();
current_obj.artist_arr.shift();
current_obj.time_arr.shift();
current_obj.image_arr.shift();*/
// limit the hsotory to numberOfElementsDisplayed
current_obj.title_arr=current_obj.title_arr.slice(0,Math.min(options.numberOfElementsDisplayed, current_obj.artist_arr.length));
current_obj.artist_arr=current_obj.artist_arr.slice(0,Math.min(options.numberOfElementsDisplayed, current_obj.artist_arr.length));
current_obj.time_arr=current_obj.time_arr.slice(0,Math.min(options.numberOfElementsDisplayed, current_obj.artist_arr.length));
current_obj.image_arr=current_obj.image_arr.slice(0,Math.min(options.numberOfElementsDisplayed, current_obj.artist_arr.length));
}
}
current_obj.time_arr[0]=getCurentSongTime(options,current_obj);
generateHistory(options,current_obj,audio11_html5_play_btn,audio11_html5_ximg_frame,audio11_html5_the_bars,audio11_html5_thumbsHolder,audio11_html5_thumbsHolderWrapper,audio11_html5_thumbsHolderVisibleWrapper,audio11_html5_historyPadding);
for (var i=0; i |