From 6b846c363ddd694bf32ac7e18f0316f4f2663e1b Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Wed, 22 Oct 2014 20:39:43 +0100 Subject: 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/ --- !NetSurf/Resources/en/maps.html,faf | 85 +++++++++++++++++++++++++++++++++++++ atari/Makefile.target | 1 + beos/Makefile.target | 2 +- content/fetchers/about.c | 17 ++++++++ content/fetchers/resource.c | 1 + framebuffer/Makefile.target | 2 +- framebuffer/res/maps.html | 1 + gtk/Makefile.target | 2 +- gtk/res/en/maps.html | 1 + gtk/res/maps.html | 1 + 10 files changed, 110 insertions(+), 3 deletions(-) create mode 100644 !NetSurf/Resources/en/maps.html,faf create mode 120000 framebuffer/res/maps.html create mode 120000 gtk/res/en/maps.html create mode 120000 gtk/res/maps.html diff --git a/!NetSurf/Resources/en/maps.html,faf b/!NetSurf/Resources/en/maps.html,faf new file mode 100644 index 000000000..2427d8a9c --- /dev/null +++ b/!NetSurf/Resources/en/maps.html,faf @@ -0,0 +1,85 @@ + + + +NetSurf: Static Maps + + + + +

NetSurf

+ + + +
+

Static Maps

+ +

Since NetSurf does not yet have enough JavaScript support +to handle most mapping sites on the web, we provide here a simple interface +to Google's Static Maps API.

+ +
+
+
+

Example: Oxford Street, London, UK

+ + +
+
+
+ + + +
Size
ScaleStandard
+Double
+
+
+ + + +
Zoom
Type
+
+
+
+ + + + +
+ + + diff --git a/atari/Makefile.target b/atari/Makefile.target index 5d1f972e3..a09681b16 100644 --- a/atari/Makefile.target +++ b/atari/Makefile.target @@ -199,6 +199,7 @@ endif $(Q)cp \!NetSurf/Resources/ca-bundle $(ATARI_TARGET_DIR)res/cabundle $(Q)$(SPLIT_MESSAGES) -l en -p atari -f messages resources/FatMessages > $(ATARI_TARGET_DIR)res/messages $(Q)cp \!NetSurf/Resources/en/welcome.html,faf $(ATARI_TARGET_DIR)res/welcome.html + $(Q)cp \!NetSurf/Resources/en/maps.html,faf $(ATARI_TARGET_DIR)res/maps.html $(Q)cp \!NetSurf/Resources/en/licence.html,faf $(ATARI_TARGET_DIR)res/licence.html $(Q)cp \!NetSurf/Resources/en/credits.html,faf $(ATARI_TARGET_DIR)res/credits.html diff --git a/beos/Makefile.target b/beos/Makefile.target index 9a57b41cb..478593cf6 100644 --- a/beos/Makefile.target +++ b/beos/Makefile.target @@ -110,7 +110,7 @@ RDEF_IMP_BEOS := $(addprefix $(OBJROOT)/,$(subst /,_,$(RDEF_IMP_BEOS))) RDEP_BEOS := \ adblock.css beosdefault.css default.css internal.css quirks.css \ netsurf.png favicon.png ca-bundle.txt \ - credits.html licence.html welcome.html + credits.html licence.html welcome.html maps.html RDEP_BEOS := $(addprefix beos/res/,$(RDEP_BEOS)) \ $(wildcard beos/res/icons/*.png) \ $(wildcard beos/res/??/*) \ 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", diff --git a/framebuffer/Makefile.target b/framebuffer/Makefile.target index 44b9626ed..699c8da80 100644 --- a/framebuffer/Makefile.target +++ b/framebuffer/Makefile.target @@ -186,7 +186,7 @@ EXETARGET := nsfb NETSURF_FRAMEBUFFER_RESOURCE_LIST := adblock.css credits.html \ default.css internal.css licence.html \ - netsurf.png quirks.css welcome.html Messages + netsurf.png quirks.css welcome.html maps.html Messages install-framebuffer: $(Q)mkdir -p $(DESTDIR)$(NETSURF_FRAMEBUFFER_BIN) diff --git a/framebuffer/res/maps.html b/framebuffer/res/maps.html new file mode 120000 index 000000000..5b394445b --- /dev/null +++ b/framebuffer/res/maps.html @@ -0,0 +1 @@ +../../!NetSurf/Resources/en/welcome.html,faf \ No newline at end of file diff --git a/gtk/Makefile.target b/gtk/Makefile.target index 8fed107fd..be0dad2ae 100644 --- a/gtk/Makefile.target +++ b/gtk/Makefile.target @@ -127,7 +127,7 @@ EXETARGET := nsgtk GTK_RESOURCES_LIST := \ languages themelist SearchEngines toolbarIndices ca-bundle.txt \ default.css adblock.css quirks.css internal.css gtkdefault.css \ - credits.html licence.html welcome.html Messages \ + credits.html licence.html welcome.html maps.html Messages \ default.ico favicon.png netsurf.png netsurf.xpm netsurf-16x16.xpm \ arrow_down_8x32.png diff --git a/gtk/res/en/maps.html b/gtk/res/en/maps.html new file mode 120000 index 000000000..bb1eedd5a --- /dev/null +++ b/gtk/res/en/maps.html @@ -0,0 +1 @@ +../../../!NetSurf/Resources/en/maps.html,faf \ No newline at end of file diff --git a/gtk/res/maps.html b/gtk/res/maps.html new file mode 120000 index 000000000..a32f725fb --- /dev/null +++ b/gtk/res/maps.html @@ -0,0 +1 @@ +en/maps.html \ No newline at end of file -- cgit v1.2.3