2013-10-15 04:38:07 +02:00
|
|
|
var Miniflux = {};
|
2013-02-24 20:04:56 +01:00
|
|
|
|
2013-10-15 04:38:07 +02:00
|
|
|
Miniflux.App = (function() {
|
2013-09-14 18:10:38 +02:00
|
|
|
|
2013-10-15 04:38:07 +02:00
|
|
|
return {
|
|
|
|
Run: function() {
|
|
|
|
Miniflux.Event.ListenKeyboardEvents();
|
|
|
|
Miniflux.Event.ListenMouseEvents();
|
|
|
|
},
|
|
|
|
MozillaAuth: function(action) {
|
|
|
|
navigator.id.watch({
|
|
|
|
onlogin: function(assertion) {
|
2013-09-12 00:00:00 +02:00
|
|
|
|
2013-10-15 04:38:07 +02:00
|
|
|
var xhr = new XMLHttpRequest();
|
|
|
|
xhr.open("POST", "?action=" + action, true);
|
|
|
|
xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
|
|
|
|
xhr.setRequestHeader("Connection", "close");
|
2013-02-24 20:04:56 +01:00
|
|
|
|
2013-10-15 04:38:07 +02:00
|
|
|
xhr.onload = function () {
|
|
|
|
window.location.href = this.responseText;
|
|
|
|
};
|
2013-02-24 20:04:56 +01:00
|
|
|
|
2013-10-15 04:38:07 +02:00
|
|
|
xhr.send("token=" + assertion);
|
|
|
|
},
|
|
|
|
onlogout: function() {}
|
|
|
|
});
|
2013-07-29 02:10:07 +02:00
|
|
|
|
2013-10-15 04:38:07 +02:00
|
|
|
navigator.id.request();
|
2013-07-14 19:01:45 +02:00
|
|
|
}
|
2013-04-03 04:49:14 +02:00
|
|
|
}
|
|
|
|
|
2013-07-10 16:44:53 +02:00
|
|
|
})();
|