add set_user_data to fakemobileclient.js

This commit is contained in:
Laura Klünder 2018-11-26 01:41:32 +01:00
parent d4f8675668
commit 5bb4560c82
3 changed files with 7 additions and 2 deletions

View file

@ -29,6 +29,7 @@
{% block subcontent %}
{% endblock %}
</main>
{% include 'site/fragment_fakemobileclient.html' %}
{% compress js %}
<script type="text/javascript" src="{% static 'jquery/jquery.js' %}"></script>
<script type="text/javascript">

View file

@ -6,5 +6,5 @@ class MobileclientMiddleware:
self.get_response = get_response
def __call__(self, request):
request.mobileclient = 'c3navclient' in request.META['HTTP_USER_AGENT']
request.mobileclient = 'c3navclient' in request.META['HTTP_USER_AGENT'] or 'fakemobileclient' in request.GET
return self.get_response(request)

View file

@ -24,5 +24,9 @@ mobileclient = {
},
createShortcut: function(url, title) {
console.log('mobileclient: shortcut url: '+url+' title: '+title);
}
},
set_user_data: function(user_data) {
console.log('set_user_data');
console.log(user_data);
},
};