Author: cfinck
Date: Thu Feb 21 02:03:41 2008
New Revision: 32440
URL:
http://svn.reactos.org/svn/reactos?rev=32440&view=rev
Log:
Few fixes to make valid HTML out of this (according to the W3 Validator)
The syntax for the HTML tags in JavaScript is described in detail here:
http://www.w3.org/TR/html4/appendix/notes.html#h-B.3.2.1
Modified:
trunk/web/reactos.org/htdocs/peoplemap/index.php
trunk/web/reactos.org/htdocs/peoplemap/peoplemap.js.php
Modified:
trunk/web/reactos.org/htdocs/peoplemap/index.php
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/peoplemap/i…
==============================================================================
---
trunk/web/reactos.org/htdocs/peoplemap/index.php (original)
+++
trunk/web/reactos.org/htdocs/peoplemap/index.php Thu Feb 21 02:03:41 2008
@@ -265,7 +265,7 @@
$logintext = $peoplemap_langres["mylocation_login"];
$logintext .= "<br><br>";
$logintext .= "<div style=\"text-align: center;\">";
- $logintext .= "<a href=\"/roscms/?page=login&target=" .
urlencode($_SERVER["PHP_SELF"]) . "\">" .
$peoplemap_langres["mylocation_login_page"] . "</a>";
+ $logintext .= "<a href=\"/roscms/?page=login&target=" .
urlencode($_SERVER["PHP_SELF"]) . "\">" .
$peoplemap_langres["mylocation_login_page"] . "</a>";
$logintext .= "<script type=\"text/javascript\">MyUserId =
-1;</script>";
$logintext .= "</div>";
Modified:
trunk/web/reactos.org/htdocs/peoplemap/peoplemap.js.php
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/peoplemap/p…
==============================================================================
---
trunk/web/reactos.org/htdocs/peoplemap/peoplemap.js.php (original)
+++
trunk/web/reactos.org/htdocs/peoplemap/peoplemap.js.php Thu Feb 21 02:03:41 2008
@@ -4,7 +4,16 @@
FILE:
web/reactos.org/htdocs/peoplemap/peoplemap.js.php
PURPOSE: Main JavaScript file (parsed by PHP before)
COPYRIGHT: Copyright 2007-2008 Colin Finck <mail(a)colinfinck.de>
+
+ charset=utf-8
*/
+
+<?php
+ function AddJSSlashes($input)
+ {
+ return str_replace("</", "<\/", $input);
+ }
+?>
var Map;
var IconTable;
@@ -19,7 +28,7 @@
function UpdateCounts()
{
- document.getElementById("counttext").innerHTML = "<?php echo
$peoplemap_langres["count1"]; ?>" + MarkerCount + "<?php echo
$peoplemap_langres["count2"]; ?>" + LocationCount + "<?php echo
$peoplemap_langres["count3"]; ?>" + UserCount + "<?php echo
$peoplemap_langres["count4"]; ?>";
+ document.getElementById("counttext").innerHTML = "<?php echo
$peoplemap_langres["count1"]; ?>" + MarkerCount + "<?php echo
$peoplemap_langres["count2"]; ?>" + LocationCount + "<?php echo
AddJSSlashes($peoplemap_langres["count3"]); ?>" + UserCount +
"<?php echo $peoplemap_langres["count4"]; ?>";
}
function GetIconPath(UserGroup)
@@ -47,14 +56,14 @@
var Marker = new GMarker( new GLatLng(Latitude, Longitude), CurrentIcon );
var html;
- html = "<strong><a
href=\"http://reactos.org/roscms/?page=user&sec=profil&sec2=&q… + UserId +
"\" target=\"_blank\">" + UserName +
"</a></strong><br>";
+ html = "<strong><a
href=\"http://reactos.org/roscms/?page=user&sec=profil&sec2=&q… + UserId +
"\" target=\"_blank\">" + UserName +
"<\/a><\/strong><br>";
html += FullName + "<br><br>";
// parseFloat strips off trailing zeros
html += "<?php echo $peoplemap_langres["latitude"]; ?>: " +
parseFloat(Latitude) + "°<br>";
html += "<?php echo $peoplemap_langres["longitude"]; ?>: " +
parseFloat(Longitude) + "°<br><br>";
- html += "<a href=\"javascript:RemoveUserFromMap(" + UserId + ");
UpdateCounts();\"><?php echo $peoplemap_langres["removefrommap"];
?></a>";
+ html += "<a href=\"javascript:RemoveUserFromMap(" + UserId + ");
UpdateCounts();\"><?php echo $peoplemap_langres["removefrommap"];
?><\/a>";
MarkerTable[UserId] = new Object();
MarkerTable[UserId].click = GEvent.addListener( Marker, "click", function()
{Marker.openInfoWindowHtml(html);} );
@@ -187,15 +196,15 @@
html += "<li>";
html += "<a href=\"javascript:AddUserToMap(" + UserId + ",
'" + UserName + "', '" + FullName + "', " +
Latitude + ", " + Longitude + "); UpdateCounts();\">";
html += UserName;
- html += "</a>";
+ html += "<\/a>";
if(FullName != "")
html += " (" + FullName + ")";
- html += "</li>";
+ html += "<\/li>";
}
- html += "</ul>";
+ html += "<\/ul>";
document.getElementById("add_user_result").innerHTML = html;
}
@@ -489,7 +498,7 @@
}
else
{
- // We set the marker at 0° N, 0° E. To ensure that the user sees the marker, reset the
viewport.
+ // We set the marker at 0° N, 0° E. To ensure that the user sees the marker, reset
the viewport.
Map.setCenter(new GLatLng(0, 0), 1);
}