diff options
author | Marcin Rataj <lidel@lidel.org> | 2017-10-21 17:19:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-21 17:19:46 +0200 |
commit | 362ba18d975b7241222881441c1f0f6bbcedae1f (patch) | |
tree | c3f1ff48ac73b4a1997b93a7649103ed0c2956b0 | |
parent | ca8318bce8ae84264abd8361e05d1914d3325106 (diff) | |
parent | 88f108f551836399b8f79b434a24e63db8d43d21 (diff) | |
download | discourse-umap-362ba18d975b7241222881441c1f0f6bbcedae1f.tar.gz |
Merge pull request #3 from lidel/fix-issue-2
Iframe fix and maintenance
-rw-r--r-- | README.md | 21 | ||||
-rw-r--r-- | assets/javascripts/iframe_whitelist.js | 3 | ||||
-rw-r--r-- | plugin.rb | 5 |
3 files changed, 17 insertions, 12 deletions
@@ -1,8 +1,7 @@ discourse-openstreetmap ======================= -Discourse plugin to support OSM via URL Oneboxing and iframe whitelisting - +> Discourse plugin to support OSM via URL Oneboxing ## Installation on top of Docker image @@ -24,9 +23,21 @@ Rebuild Discourse: `/var/discourse/launcher rebuild app` ### What URLs are oneboxed by this plugin? -`http://www.openstreetmap.org/?mlat=[Marker Latitude]&mlon=[Marker Longitude]#map=[Zoom Level]/[Latitude]/[Longitude]&layers=[Layer code]` + https://www.openstreetmap.org/?mlat=[Marker Latitude]&mlon=[Marker Longitude]#map=[Zoom Level]/[Latitude]/[Longitude]&layers=[Layer code] + +will be onboxed as a mini-map: + +> ![onebox-sample](https://user-images.githubusercontent.com/157609/31852642-79ace722-b67b-11e7-848f-41ba85fd80ef.png) + +### Can I just copy&paste `<iframe>` code from OpenStreetMap.org's share menu? + +Sure you can! In past it was done by this plugin, but there is now an `allowed iframes` setting on the Discourse settings page itself at `/admin/site_settings/category/all_results?filter=allowed_iframes`. + +Something to keep in mind: embedding of OSM `iframe` is enabled by default only for HTTPS URL. This means if it does not work for you, change `<iframe src=http://www.openstreetmap.org/export/embed.html?(..)` to have `src=https://` instead. + -### I don't like/need oneboxing: can't I just copy&paste `<iframe>` code from OpenStreetMap.org's share menu? +> ![iframe-example](https://user-images.githubusercontent.com/157609/31852829-4c23c4f2-b67f-11e7-8cd3-f0d4c14bf93c.png) -Sure you can! You don't even need this plugin for that, as [iframe code is whitelisted in Discourse itself since v1.1.1](https://github.com/discourse/discourse/commit/9dccd975d9446fc99f4c76322b8934c5afd25888). +### Is this all there is? I want more OSM integration! +You are in luck! There is a great [Locations Plugin](https://meta.discourse.org/t/locations-plugin/69742?u=lidel), which can be installed in addition to this one. diff --git a/assets/javascripts/iframe_whitelist.js b/assets/javascripts/iframe_whitelist.js deleted file mode 100644 index 1ed5e80..0000000 --- a/assets/javascripts/iframe_whitelist.js +++ /dev/null @@ -1,3 +0,0 @@ -(function() { - Discourse.Markdown.whiteListIframe(/^(https?:)?\/\/www\.openstreetmap\.org\/export\/embed.html\?.+/i); -})(); @@ -1,10 +1,7 @@ # name: OpenStreetMap Onebox -# version: 0.1 +# version: 0.2 # authors: Marcin Rataj -# whitelist raw iframes posted by users -register_asset('javascripts/iframe_whitelist.js', :server_side) - class Onebox::Engine::OpenStreetMapOnebox include Onebox::Engine |