miniflux-legacy/assets/js/app.js
2013-12-22 21:43:29 -05:00

32 lines
851 B
JavaScript

var Miniflux = {};
Miniflux.App = (function() {
return {
Run: function() {
Miniflux.Event.ListenKeyboardEvents();
Miniflux.Event.ListenMouseEvents();
},
MozillaAuth: function(action) {
navigator.id.watch({
onlogin: function(assertion) {
var xhr = new XMLHttpRequest();
xhr.open("POST", "?action=" + action + "&token=" + assertion, true);
xhr.setRequestHeader("Connection", "close");
xhr.onload = function () {
window.location.href = this.responseText;
};
xhr.send("token=" + assertion);
},
onlogout: function() {}
});
navigator.id.request();
}
}
})();