Themabewertung:
  • 0 Bewertung(en) - 0 im Durchschnitt
  • 1
  • 2
  • 3
  • 4
  • 5

hilfe bei theme bearbeitung html
#1

tach. also folgendes. ich habe ein lockscreen theme, welches 4fach wallpaper change hat und ne uhr. jetzt wollte ich von nem anderen widget noch das wetter dazu haben. ich schaffe es aber einfach nicht, die beiden LockBackground.html zu einer zusammenzufassen.

Hier die .html von LockBackground, der es sein soll:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="sk" lang="sk">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta name="author" content="cTn" />
        <link type="text/css" rel="stylesheet" href="style.css" media="all" />
        <script src="jquery-1.6.2.min.js" type="text/javascript"></script>  
        <script src="jquery.ba-dotimeout.min.js" type="text/javascript"></script>
        <script src="functions.js" type="text/javascript"></script>        
    </head>
    <body onload="initiate()">
        <div id="swappers">
            <div id="swap-one"></div>
            <div id="swap-two"></div>
        </div>
        <div id="main-wrapper">
            <div id="time"></div>
            <div id="shadow"></div>
        </div>
        <div id="cache">
            <img src="Images/LockBackground-black.png" alt=""></img>        
        </div>
    </body>
</html>

und hier noch die .html von dem wetter, welches in die obige html mit rein soll.

Code:
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"

    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">



<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">

<head><title>LS Slimline</title></head>



<!---------------------------------------------------------------------------------------------------------------->

<!-- Style section Clock/Date-->

<style>



#Layer {

    width: 321px;

    height: 481px;

    position: absolute;

    top: -1px;

    right: 0px;

    down: 0px;

    left: -1px;

}

    

.stretch {

    width:100%;

    height:100%;

}



body {

    margin: 0;

}



SPAN#clock

{

    font-family: Helvetica;

    font-weight: bold;

    color: #FFF;

    font-size: 24px;

    text-align: center;
     display: none;

}



SPAN#ampm

{

    display: none;

    font-family: Helvetica;

    font-weight: bold;

    color: #FFF;

    font-size: 12px;

    opacity: 1.0;

}



SPAN#date

{

    font-family: Helvetica;

    font-weight: bold;

    text-align: center;

    text-transform: none;

    color: #FFF;

    text-shadow: transparent;

    font-size: 20px;

    padding-right: 0px;
     display: none;
}


<!---------------------------------------------------------------------------------------------------------------->

<!-- Style section Weather Widget-->

#WeatherContainer{

    background-color: rgba(0,0,0,0);

}



#TextContainer{

    font-size:55px;

    font-family: Helvetica;

    font-weight: bold;

    color:#000000;

}



#city{

    position: absolute; top: 458px; right: 0px; down: 0px; left: 10px; width: 256px; height: 481px;

    

    text-align: left;

    font-family: Helvetica;

    font-size: 13px;

    font-weight: bold;

    text-transform: lowercase;

    color: #FFF;

}



#temp{    

    position: absolute; top: 458px; right: 0px; down: 0px; left: 30px; width: 286px; height: 481px;

    display: ;

    margin-top:0px;

    text-align: right;

    //padding-right:0px;

    font-family: Helvetica;

    font-size: 20px;

    font-weight: bold;

    color: #FFF;

}



#desc{


    position: absolute; top: 458px; right: 0px; down: 0px; left: 119px; width: 320px; height: 481px;

    text-align: left;

    font-family: Helvetica;

    font-size: 14px;

    font-weight: bold;

    padding-top:0px;

    color: #FFF;

}



#TextContainer p{

    margin:0;

}



#weatherIcon{    

    position: absolute;top: 59px; right: 0px; down: 0px; left: 96px;

    display: none;

    height:20px;

    width:20px;

}



</style>

<!---------------------------------------------------------------------------------------------------------------->

<!-- Display Wallpaper (LockBackground.png) here -->

<div id="Layer"><img src="LockBackground.png" class="stretch"/></div>

<div id="Layer"><img src="Overlay.png" class="stretch"/></img></div>





<!---------------------------------------------------------------------------------------------------------------->

<!-- Direct the script to the general folder where the weather icons are located -->

<base href="Private/"/>



<!---------------------------------------------------------------------------------------------------------------->

<!-- Clock and Date Script -->

<script type="text/javascript">



    var this_weekday_name_array = new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat")

    var this_month_name_array = new Array("January","February","March","April","May","June","July","August","September","October","November","December")

    

    var this_date_timestamp = new Date()  



    var this_weekday = this_date_timestamp.getDay()    

    var this_date = this_date_timestamp.getDate()    

    var this_month = this_date_timestamp.getMonth()    

    var this_year = this_date_timestamp.getYear()    



    if (this_year < 1000)

        this_year+= 1900;

    if (this_year==101)

        this_year=2001;        



    var this_date_string = this_date + " " + this_month_name_array[this_month]//concat long date string



function init ( )

{

    timeDisplay = document.createTextNode ( "" );

    document.getElementById("clock").appendChild ( timeDisplay );

}



function updateClock ( )

{

    var currentTime = new Date ( );

    var currentHours = currentTime.getHours ( );

    var currentMinutes = currentTime.getMinutes ( );

    var currentSeconds = currentTime.getSeconds ( );



<!-- Pad the minutes and seconds with leading zeros, if required -->

       currentHours = ( currentHours < 10 ? "0" : "" ) + currentHours;

    currentMinutes = ( currentMinutes < 10 ? "0" : "" ) + currentMinutes;

    currentSeconds = ( currentSeconds < 10 ? "0" : "" ) + currentSeconds;

    

<!-- Defines either "AM" or "PM" as appropriate -->

    var timeOfDay = ( currentHours < 12 ) ? "AM" : "PM";

    

<!-- Convert hours component of "12" to "24" -->

    // currentHours = ( currentHours > 12 ) ? currentHours - 12 : currentHours;

    

<!-- Convert hours component from "0" to "12 at Midnight-->

    // currentHours = ( currentHours == 0 ) ? 12 : currentHours;



<!-- Compose the string for display-->

    var currentTimeString = currentHours + ":" + currentMinutes;



    <!-- Update the time display-->

    document.getElementById("clock").firstChild.nodeValue = currentTimeString;

}



function init2 ( )

{

    timeDisplay = document.createTextNode ( "" );

    document.getElementById("ampm").appendChild ( timeDisplay );

}



function amPm ( )

{

    var currentTime = new Date ( );

    var currentHours = currentTime.getHours ( );



<!-- Defines either "AM" or "PM" as appropriate -->

    var timeOfDay = ( currentHours < 12 ) ? "AM" : "PM";



<!-- Convert hours component of "12" to "24" -->

    currentHours = ( currentHours > 12 ) ? currentHours - 12 : currentHours;



<!-- Convert hours component from "0" to "12 at Midnight-->

    currentHours = ( currentHours == 0 ) ? 12 : currentHours;



<!-- Compose the string for display-->

    var currentTimeString = timeOfDay;



<!-- Update the string for display of AM/PM-->

    document.getElementById("ampm").firstChild.nodeValue = currentTimeString;

}



function init3 ( )

{

    timeDisplay = document.createTextNode ( "" );

    document.getElementById("date").appendChild ( timeDisplay );

}



function calendarDate ( )

{

    var this_weekday_name_array = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")

    var this_month_name_array = new Array("January","February","March","April","May","June","July","August","September","October","November","December")

    

    var this_date_timestamp = new Date()  



    var this_weekday = this_date_timestamp.getDay()    

    var this_date = this_date_timestamp.getDate()    

    var this_month = this_date_timestamp.getMonth()



    var suffix="";

    switch(this_date){case 1:case 21:case 31:suffix="st";

    break;case 2:case 22:suffix="nd";

    break;case 3:case 23:suffix="rd";

    break;default:suffix="th"};

        

    document.getElementById("date").firstChild.nodeValue = this_weekday_name_array[this_weekday] + "," + " " + this_date + suffix + " " + this_month_name_array[this_month]

}



<!---------------------------------------------------------------------------------------------------------------->

<!-- Weather Script -->

    var locale = "GMXX0064"

<!-- A few examples: ITXX0042=Milan/UKXX0085=London/USNY0996=NYC/USCA0638=LA/FRXX0023=Cannes-->



    var isCelsius = true

    var useRealFeel = false



    var enableWallpaper = true;

    var enableLockScreen = true;



    var stylesheetWall = 'mini'

    var stylesheetLock = 'mini'

    var stylesheet = 'mini'



    var iconSetWall = 'stardock'

    var iconExtWall = ".png"

    var iconSetLock = 'stardock'

    var iconExtLock = '.png'



    var source = 'yahooWeather'



    var updateInterval = 300



    var postal;

    var demoMode = false;

    var enabled;



    if (location.href.indexOf("LockBackground")  == -1){

        stylesheet = stylesheetWall;

        iconSet = iconSetWall;

        iconExt = iconExtWall;

        enabled = enableWallpaper;

    }else{

        stylesheet = stylesheetLock;

        iconSet = iconSetLock;

        iconExt = iconExtLock;

        enabled = enableLockScreen;

    }



    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(){

    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º";

        

    }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").innerHTML=tempValue+ "°C";

        document.getElementById("weatherIcon").src="Icon Sets/"+iconSet+"/"+MiniIcons[obj.icon]+iconExt;

        document.getElementById("WeatherContainer").className = "";    



        

    }else{

        //Could be down to any number of things, which is unhelpful...

        document.getElementById("WeatherContainer").className = "errorWeatherDataFetch";    

    }

    

    

}



function weatherRefresherTemp(){

    fetchWeatherData(dealWithWeather,postal);

    setTimeout(weatherRefresherTemp, 60*1000*updateInterval);

}



var MiniIcons =

[

    "0",               //0    tornado

    "1",               //1    tropical storm

    "2",               //2    hurricane

    "3",               //3    severe thunderstorms

    "4",               //4    thunderstorms

    "5",               //5    mixed rain and snow

    "6",               //6    mixed rain and sleet

    "7",               //7    mixed snow and sleet

    "8",               //8    freezing drizzle

    "9",               //9    drizzle

    "10",               //10    freezing rain

    "11",               //11    showers

    "12",               //12    showers

    "13",               //13    snow flurries

    "14",               //14    light snow showers

    "15",               //15    blowing snow

    "16",               //16    snow

    "17",               //17    hail

    "18",               //18    sleet

    "19",               //19    dust

    "20",               //20    foggy

    "21",               //21    haze

    "22",               //22    smoky

    "23",               //23    blustery

    "24",               //24    windy

    "25",               //25    cold

    "26",               //26    cloudy

    "27",              //27    mostly cloudy (night)

    "28",               //28    mostly cloudy (day)

    "29",              //29    partly cloudy (night)

    "30",               //30    partly cloudy (day)

    "31",              //31    clear (night)

    "32",               //32    sunny

    "33",               //33    fair (night)

    "34",               //34    fair (day)

    "35",               //35    mixed rain and hail

    "36",               //36    hot

    "37",               //37    isolated thunderstorms

    "38",               //38    scattered thunderstorms

    "39",               //39    scattered thunderstorms

    "40",               //40    scattered showers

    "41",               //41    heavy snow

    "42",               //42    scattered snow showers

    "43",               //43    heavy snow

    "44",               //44    partly cloudy

    "45",               //45    thundershowers

    "46",               //46    snow showers

    "47",               //47    isolated thundershowers

    "dunno",        //3200 not available

]



function constructError (string)

{

    return {error:true, errorString:string};

}



function findChild (element, nodeName)

{

    var child;

    

    for (child = element.firstChild; child != null; child = child.nextSibling)

    {

        if (child.nodeName == nodeName)

            return child;

    }

    

    return null;

}





function fetchWeatherData (callback, zip)

{

    url="http://weather.yahooapis.com/forecastrss?u=f&p=" //u=Farenheit, because accuWeather sucks

    

    var xml_request = new XMLHttpRequest();

    xml_request.onload = function(e) {xml_loaded(e, xml_request, callback);}

    xml_request.overrideMimeType("text/xml");

    xml_request.open("GET", url+zip);

    xml_request.setRequestHeader("Cache-Control", "no-cache");

    xml_request.send(null);

    

    return xml_request;

}



function xml_loaded (event, request, callback)

{

    if (request.responseXML)

    {

        var obj = {error:false, errorString:null};

        var effectiveRoot = findChild(findChild(request.responseXML, "rss"), "channel");

        obj.city = findChild(effectiveRoot, "yweather:location").getAttribute("city");

        obj.realFeel = findChild(effectiveRoot, "yweather:wind").getAttribute("chill");//Only accounts for windChill

        

        conditionTag = findChild(findChild(effectiveRoot, "item"), "yweather:condition");

        obj.temp = conditionTag.getAttribute("temp");

        obj.icon = conditionTag.getAttribute("code");

        obj.description = conditionTag.getAttribute("text");

        callback (obj);

    }else{

        callback ({error:true, errorString:"XML request failed. no responseXML"});

    }

}





function validateWeatherLocation (location, callback)

{

    var obj = {error:false, errorString:null, cities: new Array};

    obj.cities[0] = {zip: location}; //Not very clever, are we?

    callback (obj);

}



</script>

<!---------------------------------------------------------------------------------------------------------------->

<!-- Display All - Weather-Clock-Date  -->

<body bgcolor="Transparent" onload="onLoad()">

<div>

    <div id="WeatherContainer"> <div id="TextContainer"> <p id="city">Home</p> <p id="temp">C°</p> <p id="desc">NA</p> </div>

    <img id="weatherIcon" src=""/> </div>



    <table style="position: absolute; top: 428px; left: 255px; width: 320px; height: 22px;cellspacing="0" cellpadding="0">

    <tr>

    <td width="308" align="left" valign="top">

    <span id="clock">  

    <script language="JavaScript">updateClock(); setInterval('updateClock()', 1000 )</script>

    </span>

    </td>

    </tr>

    </table>



    <table style="position: absolute; top: 112px; left: 10px; width: 174px; height: 22px;cellspacing="0" cellpadding="0">

    <tr>

    <td width="308" align="right" valign="top">

    <span id="ampm">

    <script language="JavaScript">amPm(); setInterval('amPm()', 1000 )</script></span>

    </tr>

    </table>

    

    <table style="position: absolute; top: 454px; left: 2px; width: 320px; height: 480px;cellspacing="0" cellpadding="0">

    <td width="154" height="12" align="left" valign="top" margin-left="20">

    <span id="date">

    <script language="JavaScript">calendarDate(); setInterval('calendarDate()', 1000 )</script></span>

    </td></table>



</body>

</html>

vlt kann das hier ja jmd. habe es selber schon fast aufgegeben.
Zitieren
#2

Hi poecki,
schicke mir doch mal deine beiden Theme.
Dann kann dir geholfen werden. Wink

Gruß oldster
Zitieren
#3

geilo Biggrin

also hier das LS theme:
http://www.mediafire.com/?6ks0rtg0r4bysqe

und hier das themes, wovon das wetter (°C, Stadt, beschreibung) zum oberen soll Biggrin is alles schon so im style eingestellt.
http://www.mediafire.com/?x88h87ce8bteb6k

danke für deine hilfe
Zitieren
#4

LaughLaughLaugh

hab mal gleich die deutsche Übersetzung mit gemacht.

LaughLaughLaugh

Wenn noch etwas zu Ändern ist.....melde dich Wink

download

Gruß oldster
Zitieren
#5

super. danke dir Biggrin klappt 1A
Zitieren


Möglicherweise verwandte Themen…
Thema / Verfasser Antworten Ansichten Letzter Beitrag
Letzter Beitrag von mathes1988
07.11.2014, 02:22



Benutzer, die gerade dieses Thema anschauen: 3 Gast/Gäste