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

LS Anzeige Cologne/Köln
#1

Hallo zusammen,

ich habe mal eine frage und zwar immer wenn ichd en Wettercode für meine stadt eingebe in meinem Fall Köln GMXX0018 so zieht er sich ja immer autom. Cologne

Kann man das irgendwie ändern das er anstatt Cologne Köln anzeigt ?

danke und gruß
Zitieren
#2

Welches Theme!?
Sprache ist sonst auch alles auf englisch!?
Zitieren
#3

öhm nein es komplett auf deutsch nur durch diesen Wettercode zieht er sich halt immer den Namen des Ortes von der Wetterseite und die ist ja auch englisch.

Der LS ist Typhon Weather
Zitieren
#4

GMXX ist der Code für Deutschland und da werden die Namen
auch deutsch geschrieben.
Versteh nicht ganz was du da für einen Fehler hast.
MFG
Zitieren
#5

ich hab das gleiche Problem auf dem iPad mit Lockinfo.
Wenn ich dort beim Wetterplugin den Code für München eingebe, wird Munich angezeigt
Zitieren
#6

@hell7 Da problem ist das er mir zwar das Wetter von Köln anzeigt aber als Namen nicht Köln sondern "Cologne"

Ich hätte aber gerne das dort anstatt Cologne Köln auf meinem LS steht !
Zitieren
#7

Wunder mich ja nur weil ich so etwas noch nie gelesen habe,
kenn allerdings den LS nicht.
Lade mal die html hier hoch,wenn der Code da drin steht.
MFG
Zitieren
#8

Das ist die HTML

Code:
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
        <meta name="viewport" content="width=320, user-scalable=no, initial-scale=1">
        <script src="jquery.min.js" charset="utf-8"></script>
        <script src="jquery.simpleWeather.min.js" charset="utf-8"></script>
        <script src="functions.js" type="text/javascript"></script>
        <script src="weather.js" type="text/javascript"></script>
        <style type="text/css">@import url("style.css");</style>
        <style type="text/css">@import url("background.css");</style>
        <style type="text/css">@import url("app.css");</style>
        <style type="text/css">@import url("custom.css");</style>
    </head>
    <body onload="handle()">
        <div id="background"></div>
        <div id="locationSelectorBG"></div>
        <div id="locationSelector"></div>
        <div id="locationLeft" class="locationArrows"></div>
        <div id="locationRight" class="locationArrows"></div>
        <div id="timeWrap" class="">
            <div id="mainDiv">
                <table id="divtable">
                    <tr><td id="hr1">
                        <script type="text/javascript">
                            //document.write('<td><img src="'+getHour(AM_PM).substring(0,1)+'.png" id="hr1" name="hr1"></td>');
        document.write(getHour(AM_PM).substring(0,1));
                        </script></td><td id="hr2">
                                <script type="text/javascript">
                                    //document.write('<td><img src="'+getHour(AM_PM).substring(1,2)+'.png" id="hr2" name="hr2"></td>');
                document.write(getHour(AM_PM).substring(1,2));
                                </script></td>
                        <td><img src="NOTamNORpm.png" id="ampm" name="ampm"></td>
                                    <td id="mn1"><script type="text/javascript">
                                        document.write(getMinute().substring(0,1));
                                    </script></td><td id="mn2">
                                    <script type="text/javascript">
                                        document.write(getMinute().substring(1,2));
                                    </script></td>
                    </tr>
                </table>
            </div>
            <div id="day">
                <script type="text/javascript">
                    //document.write("<img width=250 src="+Day()+".png>");
                    document.write(Day());
                </script>
            </div>
            <div id="month">
                <script type="text/javascript">
                    //document.write("<img width=420 src="+Month()+".png>");
                    document.write(Month());
                </script>
            </div>
            <div id="dayNumeric">
                <script type="text/javascript">
                    //document.write("<img width=150 src="+DayNumeric()+".png>");
                    document.write(DayNumeric().replace('date',''));
                </script>
            </div>
            <div id="year">
                <script type="text/javascript">
                    //document.write("<img width=180 src="+Year()+".png>");
                    document.write(Year());
                </script>
            </div>
        </div>
            <div id="weather" class="forecast0">
                <div id="Day0Weather" class="weatherSection">
                    <img id="weatherThumb" class="weatherThumb"/>
                    <h2 id="weatherCity" class="weatherCity" ></h2>
                    <div id="weatherTemp" class="weatherTemp" ></div>
                    <div id="weatherCurrently" class="weatherCurrently" ></div>
                </div>
                <div id="Day1Weather" class="weatherSection">
                    <img id="weatherThumb1" class="weatherThumb" />
                    <h2 id="weatherCity1" class="weatherCity" >Today</h2>
                    <div id="weatherTemp1" class="weatherTempHighLow" >
                        <div id="weather1High"></div>
                        <div id="weather1Low"></div>
                    </div>
                    <div id="weatherCurrently1" class="weatherCurrently" ></div>
                </div>
                    <div id="Day2Weather" class="weatherSection">
                        <img id="weatherThumb2" class="weatherThumb" />
                        <h2 id="weatherCity2" class="weatherCity" >Tomorrow</h2>
                        <div id="weatherTemp2" class="weatherTempHighLow" >
                            <div id="weather2High"></div>
                            <div id="weather2Low"></div>
                        </div>
                        <div id="weatherCurrently2" class="weatherCurrently" ></div>
                    </div>
            </div>
            <div id="loader"></div>
                <div id="unlock">KölscheJeck</div>
            </div>
                <script>
                getWeather();
                var currentWeatherShowing = 0;
                function tapWeather(){
                    if(currentWeatherShowing>1)
                        currentWeatherShowing=0;        
                    else    
                        currentWeatherShowing++;    
                    var t = $(this);
                    t.attr('class','forecast'+currentWeatherShowing);
                    $('#timeWrap').removeClass('showSelector');
                }
                $('#weather').click(function(){
                    if(currentWeatherShowing>1)
                        currentWeatherShowing=0;        
                    else    
                        currentWeatherShowing++;    
                    var t = $(this);
                    t.attr('class','forecast'+currentWeatherShowing);
                    var n = weather.themeName.toLowerCase();
                    $('#timeWrap').removeClass('showSelector');
                    if(n=="gravity-mauikek")
                    {
                        $('#weatherCity').removeClass('showSelector');
                    }
                    else
                    {
                        
                    }
                    
                    return false;
                });
                </script>
    </body>
</html>

Das wo ich den Code eingebe

Code:
{ "units" : "Celsius" , "places" : [ { "cityName" : "K&ouml;ln" , "zip" : "GMXX0018" },{ "cityName" : "Hamburg" , "zip" : "GMXX0049" }] , "lang" : "de-de", "theme":"","themeName":"default" }

Und des die Weather.js

Code:
var weather = {};
var TO, toShow;
var currentZip;
var temp;
var conditions;
function showSelector(el){
    el.toggleClass('showSelector');
    var wth = $('#weather');
    wth.toggleClass('showSelector');
}
function listCities(){
    //if(navigator.userAgent.toLowerCase().match("mozilla"))
    //    $('#timeWrap').hide();
    $('#locationSelector').html('');
    
    //populate locations selector
    for(var l = 0 ; l<weather.places.length ; l++){
        var cls="location";
        var cty = weather.places[l];
        console.log(cty.zip + "==" +currentZip);
        if(cty.zip==currentZip || (!currentZip && l==0)){
            cls="location active";
        }
        $('#locationSelector').append('<span ref="'+cty.zip+'" class="'+cls+'">'+cty.cityName+"</span>");
    }
    //Activate interactions
    var loc = $('.location');
    loc.click(function(){
        var t = $(this);
        t.addClass('active').siblings('span').removeClass('active');
        loadingAnimation(true, t.attr('ref'));
    });
    $('#locationRight').addClass('visible');
    locationArrows();                
    
    $('#timeWrap').click(function(){
        var t = $(this);
        showSelector(t);    
        var n = weather.themeName.toLowerCase();
        if(n=="gravity-mauikek")
        {
            showSelector($('#weatherCity'));
        }
    });
}
var currentPage = 1;
function locationArrows()
{
    var right = $('#locationRight');
    var left = $('#locationLeft');
    var sel = $('#locationSelector');
    right.click(function(){
        left.addClass('visible');
        var pos = sel.position().left;
        if(currentPage<weather.places.length){
            //slideLeft
            var lft = pos-320;
            sel.attr('style','-webkit-transform: translateX('+lft+'px);');
            currentPage ++;                 
        }
        if(currentPage==weather.places.length){
                right.removeClass('visible');
        }
    });
    left.click(function(){
        var pos = sel.position().left;
        right.addClass('visible');
        if(currentPage>1)
        {
            var lft = pos+320;
            sel.attr('style','-webkit-transform: translateX('+lft+'px);');
            currentPage--;
            if(currentPage==1){
                left.removeClass('visible');
            }
        }
    });
}
function loadingAnimation(fadeOut, zip)
{
    if(fadeOut){
        $('#loader').addClass('visible');
        renderWeather(zip);
    }
    else
        $('#loader').removeClass('visible');
}
function renderWeather(z)
{
    currentZip = z;
    if(TO)
        clearTimeout(TO);
    $.simpleWeather({
        //location: cLoc,
        zipcode: currentZip,
        unit: temp,
        success: function(weather) {
            var region = ', ' + weather.region;
            if(region == ', ')
            {
                region = ', ' + weather.country;
            }
            var curr0 = (conditions) ? conditions[weather.code].toLowerCase() : weather.currently;
            var curr1 = (conditions) ? conditions[weather.today.code].toLowerCase()  : weather.forecast;
            var curr2 = (conditions) ? conditions[weather.tomorrow.code].toLowerCase()  : weather.tomorrow.forecast;
            $("#weatherThumb").attr('src', weather.image[0]);
            $("#weatherCity").html(weather.city);
            $("#weatherTemp").html(weather.temp+'&deg; '+weather.units.temp);
            $("#weatherCurrently").text(curr0);//weather.currently);
            $('#weatherCurrently1').text(curr1);//weather.forecast);
            $('#weatherCurrently2').text(curr2);//weather.tomorrow.forecast);
            $("#weatherCity1").html('Heute');
            $("#weatherCity2").html('Morgen');
            $('#weather1High').html('<span class="label">Hoch: </span><span class="bold">'+weather.high +'&deg; </span>'+weather.units.temp);
            $('#weather1Low').html('<span class="label">Tief: </span><span class="bold">'+weather.low +'&deg; </span>'+weather.units.temp);
            $('#weather2High').html('<span class="label">Hoch: </span><span class="bold">'+weather.tomorrow.high +'&deg; </span>'+weather.units.temp);
            $('#weather2Low').html('<span class="label">Tief: </span><span class="bold">'+weather.tomorrow.low +'&deg; </span>'+weather.units.temp);
            $("#weatherThumb1").attr('src', weather.image[1]);
            $("#weatherThumb2").attr('src', weather.tomorrow.image);
            TO = setTimeout('getWeather()', 600000);
            setTimeout(function(){loadingAnimation(false);},500);
        },
        error: function(error) {
            $("#weatherThumb").attr('src', '');//replace with loading
            $("#weatherCity").html('');
            $("#weatherTemp").html('');
            $("#weatherCurrently").text('');
            $('#weatherCurrently1').text('');
            $("#weatherCity1").html('');
            $('#weather1High').html('');
            $('#weather1Low').html('');
            $("#weatherThumb1").attr('');
            $('#weatherCurrently2').text('');
            $("#weatherCity2").html('');
            $('#weather2High').html('');
            $('#weather2Low').html('');
            $("#weatherThumb2").attr('');
            TO = setTimeout('getWeather()',1000);
        }
    });
}
function getWeather(z){
    
    loadingAnimation(false);
    if(!weather.places){
        $('#loader').ajaxError(function(e, xhr, settings, exception) {
            if(isArray(weather.places)){
                if(weather.places.length>1)
                    listCities();
                currentZip = weather.places[0].zip;
            }
            else
                currentZip = weather.places.zip;
                renderWeather(currentZip);
        });
        //GET Weather.txt
        $.get('weather.txt', function(d){
            weather = eval("("+d+")");
            temp = weather.units.substr(0,1).toLowerCase();
            var lang = (weather.lang)?weather.lang:"en-us";
            $.get('lang/'+lang+'.txt', function(l){
                conditions = eval("("+l+")");
                if(isArray(weather.places)){
                    if(weather.places.length>1)
                        listCities();
                    currentZip = weather.places[0].zip;
                }
                else
                    currentZip = weather.places.zip;
                    renderWeather(currentZip);
            });
        });
    }
    else
    {
        renderWeather(currentZip);
    }
}
Zitieren
#9

Habe es eben mal getestet,der zeigt wirklich Cologne an,
habe es aber geändert,Lösung kommt gleich.
[Bild: u55o0rvbtghkk2066qsk.png]
Du suchst nach dieser Zeile und schreibst es so wie du es siehst rein,
dann sollte es funzen.
MFG

function dealWithWeather(obj){



if (obj.error == false){

document.getElementById("city").innerText="Köln";

document.getElementById("desc").innerText=descriptions[obj.icon];
Zitieren
#10

danke dir

aber wo soll ich die suchen ? function dealWithWeather(obj){ findet er nicht bei mir egal in welcher datei ich suche !

Zitieren
#11

könntest du vielleicht den kompletten code mal posten !?
Zitieren
#12

Sorry,ich kann dir da leider nicht helfen
und mein Code hilft dir nicht,da das eine andere html ist.
Bei deinem LS und allem was dazu gehört kenne ich mich zu wenig aus.
Kenne nur einen der dir helfen kann > oldster <
Frage da mal in diesem Thread an > https://iszene.com/thread-124579.html
MFG
Zitieren




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