
Originally Posted by
armadillo
As I said, you should re-download the theme and the bug will be fixed. I made a silent update. I also explained the changes I made so you don't have to replace all files.
Now to fix the remaining minor bugs:
1. To fix the default expansion of the world map in case you set animations to true (animations suck in html) open init.
js and find the following section:
Code:
daynightDIV.innerHTML = tzHTML;
container.appendChild(daynightDIV);
clockDIV.appendChild(container);
lockinfoDIV.appendChild(clockDIV);
updateClock();
toggleDayNight(true);
wtShowWorldTimes = !wtShowWorldTimes;
wtToggleCityTime();
break;
and delete the line "toggleDayNight(true);"
2. To get rid of the persistent header for Notifications even when deleting the last item and hide empty sections is enabled, open push.
js and find the following code:
Code:
function pushDataDisplay() {
if(!pushDIV){
return false;
}
var html = "";
var ids = {};
var pushCount = pushDataCount(); // number of messages (not cleared)
clearRelativeTimers(pushDIV);
if(pushDIV && pushData.length) { // && Notifications.preferences.Enabled) {
and replace the last line by this code:
Code:
if(pushDIV && pushCount > 0) { // && Notifications.preferences.Enabled) {
If you don't want to make those changes, you can alternatively just reinstall the theme. It has been silently updated without change in version.
Aramdillo, on my push.js, i found not your line
Here my push.js :
Code:
callbacks['com.ashman.lockinfo.PushNotificationPlugin'] = updatePush;
var pushDIV;
var pushIgnoreIDs = new Array();
var pushLastQty = 0;
if (!string_push) {
var string_push = "Notifications";
}
window.addEventListener('load', initPush, false);
function initPush() {
setTimeout( function(){
var lockinfoDIV = document.getElementById("lockinfo");
var position = sections.indexOf("Notifications");
var prevElem;
var nextElem;
if(position == -1) {
return; // Dont display this section since it is not on the list
}
prevElem = document.getElementById(sections[position - 1]);
if(!prevElem) {
nextElem = null;
} else {
nextElem = prevElem.nextSibling;
}
pushDIV = document.createElement("DIV");
pushDIV.limit = pushDIV.defaultLimit = pushLimit;
pushDIV.id = "Notifications";
pushDIV.className = "empty container";
pushDIV.style.display = hideEmptySections ? "none" : "block";
pushDIV.update = updatePush;
pushDIV.innerHTML = "<div class='header expanded' ontouchstart='catchSwipe(event, toggleSection, [this.parentNode]);'><div id='Notification_Arrow' class='arrow'></div><img src='images/pushh.gif'/> "+string_push+" (<span id='PushCount'>0</span>)</div><div class='container'><div class='container'></div></div>";
lockinfoDIV.insertBefore(pushDIV, nextElem);
},150);
}
function updatePush(PushInfo){
if(!pushDIV){
return false;
}
if(!PushInfo){
if(pushDIV.previous){
PushInfo = pushDIV.previous;
} else {
return false;
}
}
var notifications = PushInfo.notifications;
if (notifications[0].text == undefined) { notifications = notifications[0]; }
var html = "";
var ids = {};
clearRelativeTimers(pushDIV);
if(pushDIV && notifications.length) { // && Push.preferences.Enabled){
pushDIV.previous = PushInfo;
if(globalHide >= 0){
pushDIV.style.display = "block";
}
var relativeTimes = [];
if (pushLastQty != notifications.length) { // more elements than it had before
for (i=0; i < pushIgnoreIDs.length; i++) { // need to adjust indexes
pushIgnoreIDs[i] = pushIgnoreIDs[i] + notifications.length - pushLastQty;
}
pushLastQty = notifications.length;
}
for(i = 0; i < notifications.length && i < pushDIV.limit; i++){
if ( pushIgnoreIDs.indexOf(i) > -1 ) { // check if item needs to be ignored
// Do nothing
} else {
var date = new Date(notifications[i].date*1000);
var PushID = "Push_" + i;
ids[PushID] = true;
if(collapseAllButFirst_push){
subsectionCollapsed(PushID, "Notifications", !i);
}
if(i > 0){
html += "</div>";
}
var PushText = notifications[i].text;
var PushApp = notifications[i].application;
html += "<div id='"+PushID+"' class='Push_" + PushApp + "' ontouchstart='event.stopPropagation();catchSwipe(event, toggleSection, [this]);' class='container'><div class='sub1 header expanded'><div class='arrow'></div><div class='push_clear' ontouchstart='event.stopPropagation();' onclick='pushClear(""+i+"");'></div>";
html += "<span><img src='Icon Sets/none.png'>" + PushApp + "</span>";
html += "<span class='sub2'> – "+date.format(date.isSameDay() ? format_time : format_date_time_short);
if(displayRelativeTimes){
html += " (<span id='Push_"+i+"'></span>)";
relativeTimes.push(["Push_"+i, date]);
}
html += "</div><div class='container'>";
html += "<div class='sub sub1'>" + PushText;
html += "</div></div>";
}
}
pushDIV.lastChild.innerHTML = html + "</div>";
// if(displayLoadMore && notifications.length > pushDIV.limit){
// addLoadMoreBar(pushDIV);
// }
for(i = 0; i < relativeTimes.length; i++){
relativeTime(pushDIV, relativeTimes[i][0], relativeTimes[i][1], false, false, string_justNow.upperFirst());
}
if(collapsed[pushDIV.id]){
collapsed[pushDIV.id] = false;
toggleSection([pushDIV, true]);
}
for(var id in collapsed){
if(id.indexOf("Push_") == 0 && collapsed[id] && ids[id]){
collapsed[id] = false;
toggleSection([id, true]);
}
}
document.getElementById("PushCount").innerHTML = notifications.length - pushIgnoreIDs.length;
removeClass(pushDIV, "empty");
} else {
addClass(pushDIV, "empty");
if(hideEmptySections){
pushDIV.style.display = "none";
revertCollapsed(pushDIV.id, "Push_");
}else{
pushDIV.lastChild.innerHTML = "";
document.getElementById("PushCount").innerHTML = "0";
}
}
var pushCount = parseInt(document.getElementById("PushCount").innerHTML);
if (pushCount > 0) {
document.getElementById("Notification_Arrow").className = "arrow";
} else {
document.getElementById("Notification_Arrow").className = "";
}
return true;
}
function pushClear(itemID) {
pushIgnoreIDs.push (parseInt(itemID));
document.getElementById("Push_"+itemID).style.display = "none";
var pushCount = parseInt(document.getElementById("PushCount").innerHTML);
if (pushCount > 1) {
pushCount = pushCount - 1;
} else {
pushCount = 0;
pushDIV.style.display = "none";
revertCollapsed(pushDIV.id, "Push_");
}
document.getElementById("PushCount").innerHTML = "" + pushCount;
}