summaryrefslogtreecommitdiff
path: root/content/fetchers
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2014-10-22 20:39:43 +0100
committerMichael Drake <tlsa@netsurf-browser.org>2014-10-22 20:42:21 +0100
commit6b846c363ddd694bf32ac7e18f0316f4f2663e1b (patch)
treeb4a7628819ab8e66b364b9de2bbb09dcd48b48f2 /content/fetchers
parentdc5deb26b1dbc8936d311ddfa51c8ddab122dbda (diff)
downloadnetsurf-6b846c363ddd694bf32ac7e18f0316f4f2663e1b.tar.gz
netsurf-6b846c363ddd694bf32ac7e18f0316f4f2663e1b.tar.bz2
Add trivial maps facilitator at about:maps
This is a simple HTML front end for the Google Static Maps API, since we don't yet have enough JS support for the full Google Maps. See: https://developers.google.com/maps/documentation/staticmaps/
Diffstat (limited to 'content/fetchers')
-rw-r--r--content/fetchers/about.c17
-rw-r--r--content/fetchers/resource.c1
2 files changed, 18 insertions, 0 deletions
diff --git a/content/fetchers/about.c b/content/fetchers/about.c
index 18528cda7..eeea3d992 100644
--- a/content/fetchers/about.c
+++ b/content/fetchers/about.c
@@ -572,6 +572,21 @@ static bool fetch_about_welcome_handler(struct fetch_about_context *ctx)
return true;
}
+static bool fetch_about_maps_handler(struct fetch_about_context *ctx)
+{
+ fetch_msg msg;
+
+ /* content is going to return redirect */
+ fetch_set_http_code(ctx->fetchh, 302);
+
+ msg.type = FETCH_REDIRECT;
+ msg.data.redirect = "resource:maps.html";
+
+ fetch_about_send_callback(&msg, ctx);
+
+ return true;
+}
+
/* Forward declaration because this handler requires the handler table. */
static bool fetch_about_about_handler(struct fetch_about_context *ctx);
@@ -593,6 +608,8 @@ struct about_handlers about_handler_list[] = {
fetch_about_licence_handler, true },
{ "welcome", SLEN("welcome"), NULL,
fetch_about_welcome_handler, false },
+ { "maps", SLEN("maps"), NULL,
+ fetch_about_maps_handler, false },
{ "config", SLEN("config"), NULL,
fetch_about_config_handler, false },
{ "Choices", SLEN("Choices"), NULL,
diff --git a/content/fetchers/resource.c b/content/fetchers/resource.c
index 723d09481..1a439aa5f 100644
--- a/content/fetchers/resource.c
+++ b/content/fetchers/resource.c
@@ -83,6 +83,7 @@ static const char *fetch_resource_paths[] = {
"credits.html",
"licence.html",
"welcome.html",
+ "maps.html",
"favicon.ico",
"default.ico",
"netsurf.png",