Add scripts to create myops-getqueryview:
[myops.git] / web / query / evently / profile / profileReady / selectors / #preview / click.js
diff --git a/web/query/evently/profile/profileReady/selectors/#preview/click.js b/web/query/evently/profile/profileReady/selectors/#preview/click.js
new file mode 100644 (file)
index 0000000..7517c93
--- /dev/null
@@ -0,0 +1,15 @@
+function() {
+  var f = $(this), app = $$(this).app;
+  var Mustache = app.require("lib/mustache");
+  var markdown = app.require("vendor/couchapp/lib/markdown");
+
+  var c = {
+    name : $$("#profile").profile.nickname,
+    url : $$("#profile").profile.url,
+    avatar : $$("#profile").profile.gravatar_url,
+    html : markdown.encode(Mustache.escape($("[name=comment]", f).val())),
+    created_at : JSON.parse(JSON.stringify(new Date()))
+  };
+  
+  $("#comment-preview").html(Mustache.to_html(app.ddoc.templates.partials.comment, c));
+};
\ No newline at end of file