Permalink
Browse files

Cleaned up a merge conflict and some more comment create stuff.

  • Loading branch information...
1 parent 2ee12f4 commit 9402a38725cffc6ec53f9de213fddec23932d489 Tyler Frankenstein committed Feb 8, 2012
Showing with 9 additions and 6 deletions.
  1. +8 −6 drupalgap/pages/comment_edit.js
  2. +1 −0 drupalgap/pages/node.js
@@ -3,6 +3,8 @@ var drupalgap_page_comment_edit_content_type;
$('#drupalgap_page_comment_edit').live('pageshow',function(){
try {
+ // @todo - Check the user's permissions before even attempting to do stuff with comments...
+
// Load node.
drupalgap_page_comment_edit_node = drupalgap_services_node_retrieve(drupalgap_page_comment_edit_nid);
if (!drupalgap_page_comment_edit_node) {
@@ -68,15 +70,15 @@ $('#drupalgap_page_comment_edit_submit').live('click',function(){
return false;
}
- comment = drupalgap_services_comment_create({"nid":drupalgap_page_comment_edit_nid,"body":body});
+ comment_create_result = drupalgap_services_comment_create({"nid":drupalgap_page_comment_edit_nid,"body":body});
- if (comment.cid) {
- alert("Comment posted!");
- $.mobile.changePage("node.html");
+ if (comment_create_result.errorThrown) {
+ alert(comment_create_result.errorThrown);
}
else {
- // @todo - display a more informative message here.
- alert("There was a problem posting the comment. Please review the console for more information.")''
+ //comment_create_result.cid
+ alert("Comment posted!");
+ $.mobile.changePage("node.html");
}
}
catch (error) {
View
@@ -42,6 +42,7 @@ $('#drupalgap_page_node').live('pageshow',function(){
$('#drupalgap_page_node_button_comments').show();
break;
case "2": // comments open
+ // @todo - check user's permissions for comments before showing buttons
$('#drupalgap_page_node_comments').show();
$('#drupalgap_page_node_button_comment').show();
$('#drupalgap_page_node_button_comments').show();

0 comments on commit 9402a38

Please sign in to comment.