Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
paulrouget committed Jul 1, 2012
1 parent fedf6fb commit 2e90472
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 0 deletions.
File renamed without changes.
Binary file added throbber.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
55 changes: 55 additions & 0 deletions updatebug.js
@@ -0,0 +1,55 @@
let gUpdate = {

/* WHITE BOARD */
whiteboard: function() {
let form = $("#form-whiteboard");
form.classList.add("loading");
form.setAttribute("disabled", "true");
let shell = {whiteboard: form.value};
gBz.updateBug(gWorld.bugid, shell,
function(error, success) {
form.classList.remove("loading");
form.setAttribute("disabled", "true");
if (error || !success) {
console.error("Error while updating whiteboard list");
return;
}
});
return false;
},

/* COMMENTS */

postComment: function() {
let text = $(".addcomment > textarea").value;
let comment = {text: text};
let id = gWorld.bugid;
$(".comments").classList.add("loading");
if (comment) {
gBz.addComment(id, comment, function(error, success) {
if (error || !success) {
$(".comments").classList.remove("loading");
console.error("Error while posting comment:" + error);
return;
}
this.updateComments(function() {
$(".comments").classList.remove("loading");
});
}.bind(this));
}
},

updateComments: function(callback) {
// FIXME: no need to go through all the comments…
gBz.bugComments(gWorld.bugid, function(error, comments) {
if (error) {
console.error("Error: didn't manage to fetch the comments.");
callback();
return;
}
gWorld.comments = this.preprocessComments(comments);
this.renderTemplateOfType("oncomments");
callback();
}.bind(this));
},
}

0 comments on commit 2e90472

Please sign in to comment.