2018-10-27 21:23:58 +02:00
|
|
|
// Generated by CoffeeScript 1.12.7
|
2017-01-19 12:33:11 +01:00
|
|
|
(function() {
|
|
|
|
var values;
|
|
|
|
|
|
|
|
values = {};
|
|
|
|
|
|
|
|
$(document).ready(function() {
|
|
|
|
$("script[type='application/init']").each(function() {
|
2018-07-26 21:01:39 +02:00
|
|
|
var e, k, results, tmp;
|
2017-01-19 12:33:11 +01:00
|
|
|
try {
|
2017-01-19 13:13:36 +01:00
|
|
|
tmp = JSON.parse($(this).text());
|
2017-01-19 12:33:11 +01:00
|
|
|
results = [];
|
|
|
|
for (k in tmp) {
|
2018-10-28 21:58:59 +01:00
|
|
|
values[k] = tmp[k];
|
|
|
|
results.push(console.log('values=', values[k]));
|
2017-01-19 12:33:11 +01:00
|
|
|
}
|
|
|
|
return results;
|
|
|
|
} catch (error) {
|
|
|
|
e = error;
|
|
|
|
return console.log('Parsing error', e);
|
|
|
|
}
|
|
|
|
});
|
2018-07-27 21:43:23 +02:00
|
|
|
return window.addEventListener("message", function(e) {
|
2018-07-26 21:01:39 +02:00
|
|
|
var client_id, message, salt, session_state, ss, stat;
|
|
|
|
message = e.data;
|
2018-10-27 21:23:58 +02:00
|
|
|
console.log('message=', message);
|
2018-07-26 21:01:39 +02:00
|
|
|
client_id = decodeURIComponent(message.split(' ')[0]);
|
2018-10-27 21:21:17 +02:00
|
|
|
console.log('client_id=', client_id);
|
2018-07-26 21:01:39 +02:00
|
|
|
session_state = decodeURIComponent(message.split(' ')[1]);
|
2018-10-27 21:21:17 +02:00
|
|
|
console.log('session_state=', session_state);
|
2018-07-26 21:01:39 +02:00
|
|
|
salt = decodeURIComponent(session_state.split('.')[1]);
|
2018-10-27 21:21:17 +02:00
|
|
|
console.log('salt=', salt);
|
2018-10-28 21:58:59 +01:00
|
|
|
ss = btoa(client_id + ' ' + e.origin + ' ' + salt) + '.' + salt;
|
2018-07-26 21:01:39 +02:00
|
|
|
if (session_state === ss) {
|
|
|
|
stat = 'unchanged';
|
|
|
|
} else {
|
|
|
|
stat = 'changed';
|
|
|
|
}
|
2018-07-28 07:28:30 +02:00
|
|
|
return e.source.postMessage(stat, e.origin);
|
|
|
|
}, false);
|
2017-01-19 12:33:11 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
}).call(this);
|