X-Git-Url: http://git.onelab.eu/?p=myops.git;a=blobdiff_plain;f=web%2Fquery%2Fevently%2Fprofile%2FprofileReady%2Fselectors%2F%23preview%2Fclick.js;fp=web%2Fquery%2Fevently%2Fprofile%2FprofileReady%2Fselectors%2F%23preview%2Fclick.js;h=7517c932471af1d6f4680f6fceb8d411f99db75d;hp=0000000000000000000000000000000000000000;hb=85070b3d456667f238051af1a2f1f2a0c12300ab;hpb=607f0e13927eb18075c375fa9ba5527da4fcbb44 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 index 0000000..7517c93 --- /dev/null +++ b/web/query/evently/profile/profileReady/selectors/#preview/click.js @@ -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