login only with pond now

This commit is contained in:
Jeena 2014-02-21 11:01:11 +01:00
parent 69c5c270ad
commit 5a0950a8ee
6 changed files with 39 additions and 36 deletions

View file

@ -46,7 +46,7 @@ Pond.prototype.doOperation = function(method, operation, new_options, callback)
body = a.join("&");
}
var xhr = new XMLHttpRequest({mozSystem: true});
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
if(xhr.readyState == 4) {
if(xhr.status == 200) {
@ -76,7 +76,7 @@ Pond.prototype.reload = function(callback) {
Pond.prototype.getUnreadFeeds = function(callback, skip) {
var options = {
status: "all",
status: "unread",
limit: 100
};
@ -134,8 +134,6 @@ Pond.prototype.normalizeArticle = function(article) {
var timestamp = new Date(article.published_at).getTime() / 1000;
console.log(article.read)
return {
id: article.id,
guid_hash: article.url + article.id,
@ -195,7 +193,7 @@ Pond.prototype.setArticleUnstarred = function(articles, callback) {
}
Pond.prototype.logOut = function() {
this.doOperation("auth/sessions/" + this.session_token );
this.doOperation("DELETE", "auth/sessions/" + this.session_token );
localStorage.feeds = null;
}
@ -209,7 +207,7 @@ Pond.login = function(server_url, user, password, callback) {
var password_hash = md5(user + ':' + password)
var options = "username=" + user.toLowerCase() + "&" + "password=" + password_hash;
var xhr = new XMLHttpRequest({mozSystem: true});
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
if(xhr.readyState == 4) {
if(xhr.status == 201) {