recommend the app when clicking he locate button on another device

This commit is contained in:
Laura Klünder 2017-12-24 04:59:40 +01:00
parent 93dd1d3e32
commit f2b8ba05a3
3 changed files with 18 additions and 2 deletions

View file

@ -131,6 +131,9 @@ main.account form {
#modal-content :last-child { #modal-content :last-child {
margin-bottom: 0; margin-bottom: 0;
} }
.app-download-buttons {
margin-top: 20px;
}
#map { #map {
position: absolute; position: absolute;

View file

@ -705,6 +705,7 @@ c3nav = {
.on('blur', c3nav._locationinput_blur) .on('blur', c3nav._locationinput_blur)
.on('keydown', c3nav._locationinput_keydown); .on('keydown', c3nav._locationinput_keydown);
$('.locationinput .clear').on('click', c3nav._locationinput_clear); $('.locationinput .clear').on('click', c3nav._locationinput_clear);
$('.locationinput .locate').on('click', c3nav._locationinput_locate);
$('#autocomplete').on('mouseover', '.location', c3nav._locationinput_hover_suggestion) $('#autocomplete').on('mouseover', '.location', c3nav._locationinput_hover_suggestion)
.on('click', '.location', c3nav._locationinput_click_suggestion); .on('click', '.location', c3nav._locationinput_click_suggestion);
$('html').on('focus', '*', c3nav._locationinput_global_focuschange) $('html').on('focus', '*', c3nav._locationinput_global_focuschange)
@ -738,6 +739,11 @@ c3nav = {
c3nav.update_state(); c3nav.update_state();
$(this).parent().find('input').focus(); $(this).parent().find('input').focus();
}, },
_locationinput_locate: function () {
if (!window.mobileclient) {
c3nav.open_modal($('#app-ad').html());
}
},
_locationinput_reset_autocomplete: function () { _locationinput_reset_autocomplete: function () {
// hide autocomplete // hide autocomplete
var $autocomplete = $('#autocomplete'); var $autocomplete = $('#autocomplete');
@ -937,7 +943,7 @@ c3nav = {
}, },
_modal_link_click: function(e) { _modal_link_click: function(e) {
var location = $(this).attr('href'); var location = $(this).attr('href');
if (location.startsWith('/control/')) { if ($(this).is('[target]') || location.startsWith('/control/')) {
$(this).attr('target', '_blank'); $(this).attr('target', '_blank');
return; return;
} }

View file

@ -29,7 +29,7 @@
<button class="button-clear as-origin">{% trans 'Route from here' %}</button> <button class="button-clear as-origin">{% trans 'Route from here' %}</button>
</section> </section>
<section class="share-ui"> <section class="share-ui">
<h3>Share</h3> <h3>{% trans 'Share' %}</h3>
<img src=""> <img src="">
<input type="text" readonly> <input type="text" readonly>
<p> <p>
@ -37,6 +37,13 @@
<button class="mobileclient-shortcut">{% trans 'create shortcut' %}</button> <button class="mobileclient-shortcut">{% trans 'create shortcut' %}</button>
</p> </p>
</section> </section>
<section id="app-ad">
<h3>{% trans 'Wifi-based location' %}</h3>
<p>{% trans 'Get the c3nav app for Android to see your location on the map.' %}</p>
<p class="app-download-buttons">
<a class="button" href="https://play.google.com/store/apps/details?id=de.c3nav.droid" target="_blank">Google Play</a>
</p>
</section>
<section class="reload-msg"> <section class="reload-msg">
<img src="{% static 'img/loader.gif' %}"> <img src="{% static 'img/loader.gif' %}">
</section> </section>