miniflux-legacy/assets/js/app.js
2013-10-14 22:38:07 -04:00

33 lines
922 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, true);
xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhr.setRequestHeader("Connection", "close");
xhr.onload = function () {
window.location.href = this.responseText;
};
xhr.send("token=" + assertion);
},
onlogout: function() {}
});
navigator.id.request();
}
}
})();