Hallo
Ich wollte in Firefox eine Uhr oben hinzufügen, habe mir eine userChrome.js erstellt den Code von Endor dort eingefügt es Funktioinert nicht.
Was mache ich da falsch?.
[Blockierte Grafik: https://www2.pic-upload.de/thumb/33834499/Unbenannt.jpg]
Code
function doDatUhrCallback() {try{doDatUhr();}catch(ex){} }
function doDatUhr() {
var days = ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"];
var months = ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"];
//var title = content.document.title;
window.setTimeout(doDatUhrCallback, 1000);
var D = new Date();
var day = days[D.getDay()];
var month = months[D.getMonth()];
var year = D.getFullYear();
var hour = D.getHours();
var minute = D.getMinutes();
var second = D.getSeconds();
var date = day + ", " + (D.getDate() < 10 ? "0" +D.getDate() : D.getDate()) + ". " + month + " " + year + " ";
var time = (hour < 10 ? "0" +hour : hour) + ":" + (minute < 10 ? "0" +minute : minute) + ":" + (second < 10 ? "0" +second : second);
var timestr = date + time + " Uhr" + " ";
var status = document.getElementById("statusbar-clock-display");
status.setAttribute("value", timestr);
if (hours < 6 || hours > 20) {
status.setAttribute("style", "color: #ff0000;");
}
else {
status.setAttribute("style", "color: #000000;");
}
status.setAttribute("style", clockstyle);
}
var ClockStatus = document.getElementById("spring_revertAddonBarStatusBar");
var ClockLabel = document.createElement("label");
ClockLabel.setAttribute("id", "statusbar-clock-display");
ClockLabel.setAttribute("class", "statusbarpanel-text");
ClockLabel.setAttribute("style", "font-size: 14px;");
ClockStatus.parentNode.insertBefore(ClockLabel, ClockStatus.previousSibling);
doDatUhr();
Alles anzeigen