@@ -372,6 +372,9 @@ var Settings = {
372372 if ( typeof jsonsettings . CrwodDensity === "undefined" ) {
373373 jsonsettings . CrwodDensity = [ ] ;
374374 }
375+ if ( typeof jsonsettings . Counting === "undefined" ) {
376+ jsonsettings . Counting = [ ] ;
377+ }
375378 var html = "<div id='settingseditor'><div class='title'>Einstellungen</div>" ;
376379 html += "<div class='startloc'>Startpunkt: <input value='" + jsonsettings . StartPos . lat + "' id='startlat'> Lat, <input value='" + jsonsettings . StartPos . lon + "' id='startlon'> Lon</div>" ;
377380 html += "<div class='wetterwarnings'>CellId's für DWD-Wetterwarnungen: <input value='" + jsonsettings . CellIds . join ( ";" ) + "' id='wetterids'> (Trennen durch \";\", <a href='https://www.dwd.de/DE/leistungen/opendata/help/warnungen/cap_warncellids_csv.html'>cap_warncellids_csv</a>)</div>" ;
@@ -403,7 +406,7 @@ var Settings = {
403406 var coord = coords [ j ] . split ( ";" ) ;
404407 polyjson [ j ] = { "Lat" : this . _filterFloat ( coord [ 0 ] ) , "Lon" : this . _filterFloat ( coord [ 1 ] ) } ;
405408 }
406- fightjson [ id ] = { "Poly" : polyjson } ;
409+ fightjson [ id ] = { "Poly" : polyjson , "Alias" : rowsf [ i ] . children [ 2 ] . innerText , "Level" : this . _filterFloat ( rowsf [ i ] . children [ 3 ] . innerText ) } ;
407410 }
408411 ret . FightDedection = fightjson ;
409412
@@ -425,7 +428,8 @@ var Settings = {
425428 }
426429 crowdjson [ id ] = {
427430 "Poly" : polyjson ,
428- "Count" : num
431+ "Count" : num ,
432+ "Alias" : rowsc [ i ] . children [ 3 ] . innerText
429433 } ;
430434 }
431435 ret . CrwodDensity = crowdjson ;
@@ -442,11 +446,11 @@ var Settings = {
442446 } ;
443447 savesettings . open ( "POST" , "/admin/set_json_settings" , true ) ;
444448 savesettings . send ( JSON . stringify ( ret ) ) ;
445- } ,
449+ } ,
446450 _renderFightDedection : function ( json ) {
447451 var ret = "" ;
448452 ret += "<table id='fighttable' class='settingstable'>" ;
449- ret += "<thead><tr><th width='150'>ID</th><th width='250'>Koordinaten</th><th width='50'></th></tr></thead>" ;
453+ ret += "<thead><tr><th width='150'>ID</th><th width='250'>Koordinaten</th><th width='150'>Alias</th><th width='150'>Alertlimit</th><th width=' 50'></th></tr></thead>" ;
450454 ret += "<tbody>" ;
451455 for ( var id in json ) {
452456 var coords = [ ] ;
@@ -456,18 +460,20 @@ var Settings = {
456460 ret += "<tr>" +
457461 "<td>" + id + "</td>" +
458462 "<td>" + coords . join ( "<br>" ) + "</td>" +
463+ "<td>" + json [ id ] . Alias + "</td>" +
464+ "<td>" + json [ id ] . Level + "</td>" +
459465 "<td><img src='../icons/general/edit.png' onclick='Settings.EditFight(this.parentNode.parentNode)' class='pointer'> <img src='../icons/general/remove.png' onclick='Settings.Delete(this.parentNode.parentNode)' class='pointer'></td>" +
460466 "</tr>" ;
461467 }
462468 ret += "</tbody>" ;
463- ret += "<tfoot><tr><td></td><td></td><td><img src='../icons/general/add.png' onclick='Settings.AddFight()' class='pointer'></td></tr></tfoot>" ;
469+ ret += "<tfoot><tr><td></td><td></td><td></td><td></td><td>< img src='../icons/general/add.png' onclick='Settings.AddFight()' class='pointer'></td></tr></tfoot>" ;
464470 ret += "</table>" ;
465471 return ret ;
466472 } ,
467473 _renderCrowdDensity : function ( json ) {
468474 var ret = "" ;
469475 ret += "<table id='crowdtable' class='settingstable'>" ;
470- ret += "<thead><tr><th width='150'>ID</th><th width='200'>Personenanzahl</th><th width='250'>Koordinaten</th><th width='50'></th></tr></thead>" ;
476+ ret += "<thead><tr><th width='150'>ID</th><th width='200'>Personenanzahl</th><th width='250'>Koordinaten</th><th width='150'>Alias</th><th width=' 50'></th></tr></thead>" ;
471477 ret += "<tbody>" ;
472478 for ( var id in json ) {
473479 var coords = [ ] ;
@@ -478,18 +484,21 @@ var Settings = {
478484 "<td>" + id + "</td>" +
479485 "<td>" + json [ id ] . Count + "</td>" +
480486 "<td>" + coords . join ( "<br>" ) + "</td>" +
487+ "<td>" + json [ id ] . Alias + "</td>" +
481488 "<td><img src='../icons/general/edit.png' onclick='Settings.EditDensity(this.parentNode.parentNode)' class='pointer'> <img src='../icons/general/remove.png' onclick='Settings.Delete(this.parentNode.parentNode)' class='pointer'></td>" +
482489 "</tr>" ;
483490 }
484491 ret += "</tbody>" ;
485- ret += "<tfoot><tr><td></td><td></td><td></td><td><img src='../icons/general/add.png' onclick='Settings.AddDensity()' class='pointer'></td></tr></tfoot>" ;
492+ ret += "<tfoot><tr><td></td><td></td><td></td><td></td><td>< img src='../icons/general/add.png' onclick='Settings.AddDensity()' class='pointer'></td></tr></tfoot>" ;
486493 ret += "</table>" ;
487494 return ret ;
488495 } ,
489496 AddFight : function ( ) {
490497 var newrow = document . createElement ( "tr" ) ;
491498 newrow . innerHTML = "<td><input style='width: 145px;'/></td>" ;
492499 newrow . innerHTML += "<td><textarea style='width: 240px;height: 60px;'></textarea></td>" ;
500+ newrow . innerHTML = "<td><input style='width: 145px;'/></td>" ;
501+ newrow . innerHTML = "<td><input style='width: 145px;'/></td>" ;
493502 newrow . innerHTML += "<td><img src='../icons/general/save.png' onclick='Settings.SaveRowfight(this.parentNode.parentNode)' class='pointer'> <img src='../icons/general/remove.png' onclick='Settings.Abort(this.parentNode.parentNode)' class='pointer'></td>" ;
494503 document . getElementById ( "fighttable" ) . children [ 1 ] . appendChild ( newrow ) ;
495504 } ,
@@ -498,6 +507,7 @@ var Settings = {
498507 newrow . innerHTML = "<td><input style='width: 145px;'/></td>" ;
499508 newrow . innerHTML += "<td><input style='width: 195px;'/></td>" ;
500509 newrow . innerHTML += "<td><textarea style='width: 240px;height: 60px;'></textarea></td>" ;
510+ newrow . innerHTML = "<td><input style='width: 145px;'/></td>" ;
501511 newrow . innerHTML += "<td><img src='../icons/general/save.png' onclick='Settings.SaveRowdensity(this.parentNode.parentNode)' class='pointer'> <img src='../icons/general/remove.png' onclick='Settings.Abort(this.parentNode.parentNode)' class='pointer'></td>" ;
502512 document . getElementById ( "crowdtable" ) . children [ 1 ] . appendChild ( newrow ) ;
503513 } ,
@@ -519,12 +529,18 @@ var Settings = {
519529 break ;
520530 }
521531 }
532+ if ( isNaN ( this . _filterFloat ( el . children [ 3 ] . children [ 0 ] . value ) ) ) {
533+ alert ( "Die Eingabe des Alertlevel erwartet einen Float" ) ;
534+ return ;
535+ }
522536 if ( fail ) {
523537 alert ( "Die Eingabe der Koordinaten ist nicht Korrekt!\n\nBeispiel:\n50.7;7.8\n50.6;7.9" ) ;
524538 return ;
525539 }
526540 el . innerHTML = "<td>" + el . children [ 0 ] . children [ 0 ] . value + "</td>" +
527541 "<td>" + coords + "</td>" +
542+ "<td>" + el . children [ 2 ] . children [ 0 ] . value + "</td>" +
543+ "<td>" + this . _filterFloat ( el . children [ 3 ] . children [ 0 ] . value ) + "</td>" +
528544 "<td><img src='../icons/general/edit.png' onclick='Settings.EditFight(this.parentNode.parentNode)' class='pointer'> <img src='../icons/general/remove.png' onclick='Settings.DeleteFight(this.parentNode.parentNode)' class='pointer'></td>" ;
529545 } ,
530546 SaveRowdensity : function ( el ) {
@@ -553,6 +569,7 @@ var Settings = {
553569 el . innerHTML = "<td>" + el . children [ 0 ] . children [ 0 ] . value + "</td>" +
554570 "<td>" + el . children [ 1 ] . children [ 0 ] . value + "</td>" +
555571 "<td>" + coords + "</td>" +
572+ "<td>" + el . children [ 3 ] . children [ 0 ] . value + "</td>" +
556573 "<td><img src='../icons/general/edit.png' onclick='Settings.EditDensity(this.parentNode.parentNode)' class='pointer'> <img src='../icons/general/remove.png' onclick='Settings.DeleteFight(this.parentNode.parentNode)' class='pointer'></td>" ;
557574 } ,
558575 Delete : function ( el ) {
@@ -564,12 +581,15 @@ var Settings = {
564581 EditFight : function ( el ) {
565582 el . innerHTML = "<td><input style='width: 145px;' value='" + el . children [ 0 ] . innerText + "'/></td>" +
566583 "<td><textarea style='width: 240px;height: 60px;'>" + el . children [ 1 ] . innerText + "</textarea></td>" +
584+ "<td><input style='width: 145px;' value='" + el . children [ 2 ] . innerText + "'/></td>" +
585+ "<td><input style='width: 145px;' value='" + el . children [ 3 ] . innerText + "'/></td>" +
567586 "<td><img src='../icons/general/save.png' onclick='Settings.SaveRowfight(this.parentNode.parentNode)' class='pointer'> <img src='../icons/general/remove.png' onclick='Settings.Abort(this.parentNode.parentNode)' class='pointer'></td>" ;
568587 } ,
569588 EditDensity : function ( el ) {
570589 el . innerHTML = "<td><input style='width: 145px;' value='" + el . children [ 0 ] . innerText + "'/></td>" +
571590 "<td><input style='width: 195px;' value='" + el . children [ 1 ] . innerText + "'/></td>" +
572591 "<td><textarea style='width: 240px;height: 60px;'>" + el . children [ 2 ] . innerText + "</textarea></td>" +
592+ "<td><input style='width: 145px;' value='" + el . children [ 3 ] . innerText + "'/></td>" +
573593 "<td><img src='../icons/general/save.png' onclick='Settings.SaveRowdensity(this.parentNode.parentNode)' class='pointer'> <img src='../icons/general/remove.png' onclick='Settings.Abort(this.parentNode.parentNode)' class='pointer'></td>" ;
574594 } ,
575595 _filterFloat : function ( value ) {
@@ -586,7 +606,6 @@ var ExImport = {
586606 html += "<div class='names'>names.json (Namen und Icons)<br/><textarea id='ex_names'></textarea> <img src='../icons/general/save.png' onclick='ExImport.SaveNames()' class='pointer'></div>" ;
587607 html += "<div class='names'>geo.json (Layer on the MAP) <a href='https://mapbox.github.io/togeojson/'>Kml Konverter</a><br/><textarea id='ex_geo'></textarea> <img src='../icons/general/save.png' onclick='ExImport.SaveGeo()' class='pointer'></div>" ;
588608 html += "<div class='names'>settings.json (Settings of the Map)<br/><textarea id='ex_settings'></textarea> <img src='../icons/general/save.png' onclick='ExImport.SaveSettings()' class='pointer'></div>" ;
589-
590609 html += "</div>" ;
591610 document . getElementById ( "content" ) . innerHTML = html ;
592611 document . getElementById ( "ex_names" ) . value = jsonnames ;
0 commit comments