From 77344163edef5e20f652c82c634e3aeac61d970a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 3 Mar 2012 12:16:00 -0400 Subject: [PATCH] add osm.png Add an underlay for the osm plugin. Update links to right path to icon. Note that the osm plugin has a pervasive bug in how it links to icons; it assumes the site is at /. I did not attempt to fix that; it should be using urlto() to make a correct relative link. --- IkiWiki/Plugin/osm.pm | 7 ++++--- underlays/osm/ikiwiki/images/osm.png | Bin 0 -> 2982 bytes 2 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 underlays/osm/ikiwiki/images/osm.png diff --git a/IkiWiki/Plugin/osm.pm b/IkiWiki/Plugin/osm.pm index e47e83b07..0fd7ca400 100644 --- a/IkiWiki/Plugin/osm.pm +++ b/IkiWiki/Plugin/osm.pm @@ -10,6 +10,7 @@ use IkiWiki 3.0; sub import { add_underlay("javascript"); + add_underlay("osm"); hook(type => "getsetup", id => "osm", call => \&getsetup); hook(type => "format", id => "osm", call => \&format); hook(type => "preprocess", id => "osm", call => \&preprocess); @@ -34,7 +35,7 @@ sub getsetup () { }, osm_default_icon => { type => "string", - example => "img/osm.png", + example => "/ikiwiki/images/osm.png", description => "the icon shon on links and on the main map", safe => 0, rebuild => 1, @@ -137,7 +138,7 @@ sub process_waypoint { my $name = scrub($params{'name'} || $p, $page, $dest); # sanitized here my $desc = scrub($params{'desc'} || '', $page, $dest); # sanitized here my $zoom = scrub($params{'zoom'} // $config{'osm_default_zoom'} // 15, $page, $dest); # sanitized below - my $icon = $config{'osm__default_icon'} || "img/osm.png"; # sanitized: we trust $config + my $icon = $config{'osm__default_icon'} || "/ikiwiki/images/osm.png"; # sanitized: we trust $config my $map = scrub($params{'map'} || 'map', $page, $dest); # sanitized here my $alt = $config{'osm_alt'} ? "alt=\"$config{'osm_alt'}\"" : ''; # sanitized: we trust $config if ($zoom !~ /^\d\d?$/ || $zoom < 2 || $zoom > 18) { @@ -169,7 +170,7 @@ sub process_waypoint { } } } - $icon = "/img/unknown.png" unless $icon; + $icon = "/ikiwiki/images/osm.png" unless $icon; $tag = '' unless $tag; if ($page eq $dest) { if (!defined($config{'osm_format'}) || !$config{'osm_format'}) { diff --git a/underlays/osm/ikiwiki/images/osm.png b/underlays/osm/ikiwiki/images/osm.png new file mode 100644 index 0000000000000000000000000000000000000000..487bf003c711613b7feb3e495a3279f646ad4ba8 GIT binary patch literal 2982 zcmV;X3t9AuP)pt-|6Qu;*3#8oUA+VYQIaQ!1_hL$d592+fDwvd7&Jl}fi+8^dbx9Zlt zmxqQ(1DQvTbRLfM9sTs3r|*b&{`?(L*e|Iwqv!2dw2$Y0_X5ADro~IBLWrz)LoIt7 zoq*x@8qF$`laq$yID>&eAO>JrR>||cjNP&7qSG%fJU*kIJO7wnuQzz}%{Kv1A1o~S zZr=Lr8$XNxBv36iZVU~NFO?jbY3!|;AOV-C(Qib0jHEw)cUF%%XU_G;Cp|N<`sn`p zyb%~4jK|~8baizd2?PQWKv4)U5WZvrS>uLUv331}<(7p0Y z-+JX6Uwus~(%QJcp53{-wzN~X=F5fJT6ZiwH9R&rH#RkNv@5ChyRouf>0)Uk0w!SD-j z{Mqk)?^iBf&^oId)NPwRsgO(O-FSbu)VdvPy+Og;V>Eo6Prm# zMYt=BC$QmfURyLa!tW18k$e!su9xVVTiIFO{cUv*PQlP{b& zcO;^2X7TxTdM1ZRj0}jL-YzV!%5w2874v}mAMLVvqk$q7Y^}n@U;j1EUwE8>;eOP< zI#rP-91d}Ec9zt!1UtK1sGeUA4Gqs_v)TN@!otma_wJ#bnLEp!TaT>KiTcfpjpyMJH ziR*cIo<~IMCOzLG6`x^g=N4m61Sz{&FdBH$L05vf9f{$KAccaI5=Bvn_s4kl@>7^@ ziShCA@xj5tm*0N-ZIl}~Zcy0jfUAt2JUjiB#8{sY={#Q04`Bnl)kakm4hs9+`FIyY ziBdF{(c?DdPL^uDOvkg>FX!1Vt&_>;QN1vh>EO5uu45x5?CoZ$9kekF!}#EX4?a|1 zd+jy$L)XaMR44lqy+S#t;8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