Skip to content

Commit

Permalink
Ability to comment on a POI (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
humitos committed Jan 16, 2015
1 parent 0d3fdaf commit 12929be
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 9 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ http://pois.elblogdehumitos.com.ar/master/

**Date:** not released yet

- Comments for all the POIs using disqus threads (#43)

## Version 0.3

**Date:** 01/15/2015
Expand Down
23 changes: 17 additions & 6 deletions web/assets/js/site.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,13 @@ function callback(data) {
iconSize: [32, 37],
iconAnchor: [18.5, 35],
popupAnchor: [0, -27]
});
var marker = L.marker(pos, {
icon: markerIcon,
keyboard: false
})
});
var marker = L.marker(pos, {
icon: markerIcon,
keyboard: false
})

// show a label next to the icon on mouse hover
// show a label next to the icon on mouse hover
if (e.tags.name) {
marker.bindLabel(
e.tags.name,
Expand All @@ -198,6 +198,17 @@ function callback(data) {
marker.on('click', function(e) {
var element = e.target._element;
$('#developer > .tags').html(develop_parser(element));

var name = element.tags.name ? element.tags.name : element.id;
$('#comments #comment-name').html(name);
// reload disqus thread
DISQUS.reset({
reload: true,
config: function () {
this.page.identifier = element.id;
this.page.url = 'http://pois.elblogdehumitos.com.ar/#!' + element.id;
}
});
});

if (poi.tagParser) var markerPopup = poi.tagParser(e);
Expand Down
4 changes: 4 additions & 0 deletions web/assets/js/tags-parsers.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,5 +189,9 @@ function parse_tags(element, titlePopup, functions) {
markerPopup += data.callback(element);
}
}

markerPopup += '<br> <span class="fa fa-comments"></span> ';
markerPopup += '<a href="#" onclick="javascript: sidebar.open(\'comments\'); return false;">Ver comentarios</a>';

return markerPopup;
}
4 changes: 1 addition & 3 deletions web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,7 @@ <h1>Herramientas usadas</h1>
<div class="sidebar-pane" id="comments">
<div class="close-button"><span class="fa fa-close" onclick="javascript: sidebar.close()"></span></div>
<h1>Comentarios</h1>
<p>¿Errores? ¿Ideas? ¿Sugerencias?</p>
<p>¡Dejanos tus comentarios!</p>
<p>¡Dejá un comentario para <strong id="comment-name">nuestro website</strong>!</p>
<div id="disqus_thread"></div>
<script type="text/javascript">
var disqus_shortname = 'osmpois'; // required: replace example with your forum shortname
Expand Down Expand Up @@ -335,6 +334,5 @@ <h1>Modo experto</h1>
</script>
<noscript><p><img src="//elblogdehumitos.com.ar/piwik/piwik.php?idsite=2" style="border:0;" alt="" /></p></noscript>
<!-- End Piwik Code -->

</body>
</html>

0 comments on commit 12929be

Please sign in to comment.