
Bez szaleństw
Zaloguj lub Zarejestruj się aby uzyskać pełny dostęp do forum.
Posted 22 March 2009 - 10:24

Posted 22 March 2009 - 11:24
Posted 22 March 2009 - 11:35
Posted 22 March 2009 - 11:40
Posted 22 March 2009 - 11:56
Posted 22 March 2009 - 12:26
Posted 22 March 2009 - 12:54
Posted 22 March 2009 - 12:57
Posted 22 March 2009 - 13:10
Posted 22 March 2009 - 13:12
Posted 22 March 2009 - 13:19
Posted 22 March 2009 - 13:27
Posted 22 March 2009 - 15:07
Posted 22 March 2009 - 15:12
Posted 22 March 2009 - 15:27
function buildCal(m, y, cM, cH, cDW, cD){
var mn=['Styczeń','Luty','Marzec','Kwiecień','Maj','Czerwiec','Lipiec','Sierpień','Wrzesień','Październik','Listopad','Grudzień'];
var dim=[31,0,31,30,31,30,31,31,30,31,30,31];
var oD = new Date(y, m-1, 1); //DD replaced line to fix date bug when current day is 31st
oD.od=oD.getDay()+1; //DD replaced line to fix date bug when current day is 31st
var todaydate=new Date() //DD added
var scanfortoday=(y==todaydate.getFullYear() && m==todaydate.getMonth()+1)? todaydate.getDate() : 0 //DD added
dim[1]=(((oD.getFullYear()%100!=0)&&(oD.getFullYear()%4==0))||(oD.getFullYear()%400==0))?29:28;
var t='<table cols="7" width="50%" class="'+cM+'" cellpadding="0" border="0" cellspacing="0"><tr align="center">';
// t+='<td colspan="7" align="center" class="'+cH+'">'+mn[m-1]+' '+y+'</td></tr><tr align="center">';
for(s=0;s<7;s++)t+='<td class="'+cDW+'">'+"[b]NPWSCPS[/b]".substr(s,1)+'</td>';
t+='</tr><tr align="center">';
for(i=1;i<=42;i++) {
var x=((i-oD.od>=0)&&(i-oD.od<dim[m-1]))? i-oD.od+1 : ' ';
if (x==scanfortoday) //DD added
x='<span id="today">'+x+'</span>' //DD added
t+='<td class="'+cD+'">'+x+'</td>';
if(((i)%7==0)&&(i<36))t+='</tr><tr align="center">';
}
return t+='</tr></table>';
}
var postal;
var demoMode = false;
var enabled;
var xmlReq = new XMLHttpRequest();
var launchReq = new XMLHttpRequest();
if (location.href.indexOf("Wallpaper") == -1){
stylesheet = stylesheetLock;
iconSet = iconSetLock;
iconExt = iconExtLock;
enabled = enableLockScreen;
}else{
stylesheet = stylesheetWall;
iconSet = iconSetWall;
iconExt = iconExtWall;
enabled = enableWallpaper;
}
if(enabled == true){
if(iconSet == null || iconSet == 'null' || iconSet == ""){
var iconSet = stylesheet;
}
var headID = document.getElementsByTagName("head")[0];
var styleNode = document.createElement('link');
styleNode.type = 'text/css';
styleNode.rel = 'stylesheet';
styleNode.href = 'Stylesheets/'+stylesheet+'.css';
headID.appendChild(styleNode);
var scriptNode = document.createElement('script');
scriptNode.type = 'text/javascript';
scriptNode.src = 'Sources/'+source+'.js';
headID.appendChild(scriptNode);
}
function onLoad(){
update();
if (enabled == true){
if (demoMode == true){
document.getElementById("weatherIcon").src="Icon Sets/"+iconSet+"/"+"cloudy1"+iconExt;
document.getElementById("city").innerText="Somewhere";
document.getElementById("desc").innerText="Partly Cloudy";
document.getElementById("temp").innerText="100ş";
document.getElementById("forecast").innerText="Sun";
}else{
document.getElementById("weatherIcon").src="Icon Sets/"+iconSet+"/"+"dunno"+iconExt;
validateWeatherLocation(escape(locale).replace(/^%u/g, "%"), setPostal)
}
}else{
document.getElementsByTagName("body")[0].innerText='';
}
}
function convertTemp(num)
{
if (isCelsius == true)
return Math.round ((num - 32) * 5 / 9);
else
return num;
}
function setPostal(obj){
if (obj.error == false){
if(obj.cities.length > 0){
postal = escape(obj.cities[0].zip).replace(/^%u/g, "%")
document.getElementById("WeatherContainer").className = "";
weatherRefresherTemp();
}else{
document.getElementById("city").innerText="Not Found";
document.getElementById("WeatherContainer").className = "errorLocaleNotFound";
}
}else{
document.getElementById("city").innerText=obj.errorString;
document.getElementById("WeatherContainer").className = "errorLocaleValidate";
setTimeout('validateWeatherLocation(escape(locale).replace(/^%u/g, "%"), setPostal)', Math.round(1000*60*5));
}
}
function dealWithWeather(obj){
if (obj.error == false){
document.getElementById("city").innerText=obj.city;
document.getElementById("desc").innerText=obj.description.toLowerCase();
if(useRealFeel == true){
tempValue = convertTemp(obj.realFeel);
}else{
tempValue = convertTemp(obj.temp)
}
document.getElementById("temp").innerText=tempValue+"Âş";
document.getElementById("weatherIcon").src="Icon Sets/"+iconSet+"/"+MiniIcons[obj.icon]+iconExt;
/*ProductRed*/
lastResults = new Array;
lastResults[0] = {daycode:obj.daycode, icon:obj.icon, hi:obj.hi, lo:obj.lo, now:obj.temp};
var c = obj.forecast.length;
if (c > 6) c = 6; // just to be safe
var i = 0;
while (i < c)
{
var forecast = obj.forecast[i];
document.getElementById('day'+i).innerText = forecast.daycode;
document.getElementById('hi'+i).innerText = convertTemp(forecast.hi)+"Âş";;
document.getElementById('low'+i).innerText = convertTemp(forecast.lo)+"Âş";;
document.getElementById('wIcon'+i).src="Icon Sets/"+iconSet+"/"+MiniIcons[forecast.icon]+iconExt;
lastResults[i+1] = {daycode:forecast.daycode, icon:forecast.icon, hi:forecast.hi, lo:forecast.lo};
i = i + 1;
}
/*ProductRed*/
document.getElementById("WeatherContainer").className = "";
}else{
//Could be down to any number of things, which is unhelpful...
document.getElementById("WeatherContainer").className = "errorWeatherDataFetch";
}
}
function weatherRefresherTemp(){ //I'm a bastard ugly hack. Hate me.
fetchWeatherData(dealWithWeather,postal);
setTimeout(weatherRefresherTemp, 60*1000*updateInterval);
}
function showElement(name)
{
document.getElementById(name + "Icon").style.display = 'inline';
if (xmlReq.responseXML.getElementsByTagName("MMS")[0].firstChild.nodeValue < "2") {
document.getElementById("MMSNumber").innerHTML = "<img src='imgs/mms.png' />1 nowa wiadomość MMS";
} else {
document.getElementById("MMSNumber").innerHTML = "<img src='imgs/mms.png' />" + xmlReq.responseXML.getElementsByTagName("MMS")[0].firstChild.nodeValue + " nowych wiadomości MMS";
}
if (xmlReq.responseXML.getElementsByTagName("SMS")[0].firstChild.nodeValue < "2") {
document.getElementById("SMSNumber").innerHTML = "<img src='imgs/sms.png' />1 nowa wiadomość SMS";
} else {
document.getElementById("SMSNumber").innerHTML = "<img src='imgs/sms.png' />" + xmlReq.responseXML.getElementsByTagName("SMS")[0].firstChild.nodeValue + " nowych wiadomości SMS";
}
if (xmlReq.responseXML.getElementsByTagName("Call")[0].firstChild.nodeValue < "2") {
document.getElementById("CallNumber").innerHTML = "<img src='imgs/call.png' />1 nieodebrane połączenie";
} else {
document.getElementById("CallNumber").innerHTML = "<img src='imgs/call.png' />" + xmlReq.responseXML.getElementsByTagName("Call")[0].firstChild.nodeValue + " nieodebranych połączeń";
}
if (xmlReq.responseXML.getElementsByTagName("Mail")[0].firstChild.nodeValue < "2") {
document.getElementById("MailNumber").innerHTML = "<img src='imgs/mail.png' />1 nowy e-mail";
} else {
document.getElementById("MailNumber").innerHTML = "<img src='imgs/mail.png' />" + xmlReq.responseXML.getElementsByTagName("Mail")[0].firstChild.nodeValue + " nowych e-maili";
}
if (xmlReq.responseXML.getElementsByTagName("IM")[0].firstChild.nodeValue < "2") {
document.getElementById("IMNumber").innerHTML = "<img src='imgs/im.png' />1 nowa wiadomość";
} else {
document.getElementById("IMNumber").innerHTML = "<img src='imgs/im.png' />" + xmlReq.responseXML.getElementsByTagName("IM")[0].firstChild.nodeValue + " nowych wiadomości";
}
}
function hideElement(name)
{
document.getElementById(name + "Icon").style.display = 'none';
}
function updateIcon(name)
{
var show = 0;
try
{
if (xmlReq.responseXML.getElementsByTagName(name)[0].firstChild.nodeValue != "0")
show = 1;
}
catch(error)
{
}
if (show)
showElement(name);
else
hideElement(name);
}
function processXml()
{
if (xmlReq.readyState != 4)
return;
if (xmlReq.status != 200 && xmlReq.status != 0)
return;
updateIcon("Calendar");
updateIcon("Call");
updateIcon("RSS");
updateIcon("MMS");
updateIcon("SMS");
updateIcon("IM");
updateIcon("Mail");
updateIcon("Silent");
}
function update()
{
xmlReq.onreadystatechange = processXml;
xmlReq.timeout = 2000;
xmlReq.open("GET", "http://127.0.0.1:16322/status", true);
xmlReq.send();
setTimeout(update, 3000);
}
function iconClick(name)
{
}
Posted 22 March 2009 - 16:06
Posted 22 March 2009 - 17:15
Posted 22 March 2009 - 18:04
a nie możesz dopisać mojego rozwiązania do wallpaper.js ?
Posted 22 March 2009 - 18:18
A moze ty moglbys to zrobic?: ) Nie jestem w tym za dobry..
Posted 22 March 2009 - 18:25
Posted 22 March 2009 - 18:41
Posted 22 March 2009 - 22:22
Posted 23 March 2009 - 17:15
Posted 23 March 2009 - 17:18
0 members, 1 guests, 0 anonymous users