can only communicate with mobileclient using json

This commit is contained in:
Laura Klünder 2018-12-17 00:17:21 +01:00
parent 61967b0e4e
commit 65f511a6d9
4 changed files with 5 additions and 5 deletions

View file

@ -39,7 +39,7 @@
if (window.mobileclient) {
var $body = $('body');
if ($body.is('[data-user-data]')) {
mobileclient.set_user_data(JSON.parse($body.attr('data-user-data')));
mobileclient.set_user_data($body.attr('data-user-data'));
}
}
</script>

View file

@ -68,7 +68,7 @@ editor = {
var data = JSON.parse(elem.attr('data-user-data'));
data.changes_count_display = elem.attr('data-count-display');
data.direct_editing = elem.is('[data-direct-editing]');
mobileclient.set_user_data(data);
mobileclient.set_user_data(JSON.stringify(data));
},
_onbeforeunload: function(e) {
if ($('#sidebar').find('[data-onbeforeunload]').length) {

View file

@ -54,7 +54,7 @@ c3nav = {
$body.addClass('mobileclient');
c3nav._set_user_location(null);
if ($body.is('[data-user-data]')) {
mobileclient.set_user_data(JSON.parse($body.attr('data-user-data')));
mobileclient.set_user_data($body.attr('data-user-data'));
}
}
},
@ -1277,7 +1277,7 @@ c3nav = {
var $user = $('header #user');
$user.find('span').text(data.title);
$user.find('small').text(data.subtitle || '');
if (window.mobileclient) mobileclient.set_user_data(data);
if (window.mobileclient) mobileclient.set_user_data(JSON.stringify(data));
},
_last_wifi_scant: 0,

View file

@ -27,6 +27,6 @@ mobileclient = {
},
set_user_data: function(user_data) {
console.log('set_user_data');
console.log(user_data);
console.log(JSON.parse(user_data));
},
};