can only communicate with mobileclient using json
This commit is contained in:
parent
61967b0e4e
commit
65f511a6d9
4 changed files with 5 additions and 5 deletions
|
@ -39,7 +39,7 @@
|
||||||
if (window.mobileclient) {
|
if (window.mobileclient) {
|
||||||
var $body = $('body');
|
var $body = $('body');
|
||||||
if ($body.is('[data-user-data]')) {
|
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>
|
</script>
|
||||||
|
|
|
@ -68,7 +68,7 @@ editor = {
|
||||||
var data = JSON.parse(elem.attr('data-user-data'));
|
var data = JSON.parse(elem.attr('data-user-data'));
|
||||||
data.changes_count_display = elem.attr('data-count-display');
|
data.changes_count_display = elem.attr('data-count-display');
|
||||||
data.direct_editing = elem.is('[data-direct-editing]');
|
data.direct_editing = elem.is('[data-direct-editing]');
|
||||||
mobileclient.set_user_data(data);
|
mobileclient.set_user_data(JSON.stringify(data));
|
||||||
},
|
},
|
||||||
_onbeforeunload: function(e) {
|
_onbeforeunload: function(e) {
|
||||||
if ($('#sidebar').find('[data-onbeforeunload]').length) {
|
if ($('#sidebar').find('[data-onbeforeunload]').length) {
|
||||||
|
|
|
@ -54,7 +54,7 @@ c3nav = {
|
||||||
$body.addClass('mobileclient');
|
$body.addClass('mobileclient');
|
||||||
c3nav._set_user_location(null);
|
c3nav._set_user_location(null);
|
||||||
if ($body.is('[data-user-data]')) {
|
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');
|
var $user = $('header #user');
|
||||||
$user.find('span').text(data.title);
|
$user.find('span').text(data.title);
|
||||||
$user.find('small').text(data.subtitle || '');
|
$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,
|
_last_wifi_scant: 0,
|
||||||
|
|
|
@ -27,6 +27,6 @@ mobileclient = {
|
||||||
},
|
},
|
||||||
set_user_data: function(user_data) {
|
set_user_data: function(user_data) {
|
||||||
console.log('set_user_data');
|
console.log('set_user_data');
|
||||||
console.log(user_data);
|
console.log(JSON.parse(user_data));
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue