Add scripts to create myops-getqueryview:
[myops.git] / web / query / evently / profile / profileReady / selectors / form / submit.js
diff --git a/web/query/evently/profile/profileReady/selectors/form/submit.js b/web/query/evently/profile/profileReady/selectors/form/submit.js
new file mode 100644 (file)
index 0000000..9a10e3a
--- /dev/null
@@ -0,0 +1,18 @@
+function() {
+  var f = $(this), app = $$(this).app;
+  var newComment = {
+    type : "comment",
+    post_id : app.post_id,
+    format : "markdown",
+    comment : $("[name=comment]", f).val(),
+    commenter : $$("#profile").profile,
+    created_at : new Date()
+  };
+  app.db.saveDoc(newComment, {
+    success : function(resp) {
+      $("#new-comment").html('<h2>Success! Your comment has posted.</h2><p>Refresh the page to see it.</p>');
+    }
+  });
+  
+  return false;
+};
\ No newline at end of file