{"action":"created","comment":{"url":"https://api.github.com/repos/nasum/nasulog/pulls/comments/49961634","id":49961634,"diff_hunk":"@@ -39,16 +37,36 @@ export default class PoemForm extends React.Component {\n         }\n       }\n     })\n+    .on({\n+      // 候補から選択してもonChangeイベントが発火しないので、\n+      // 強制的にonChangeさせる\n+      'textComplete:select': (e, value, strategy) => {\n+        this.onDescriptionChange(e)\n+      }\n+    })\n+  }\n+\n+  onTitleChange(event) {\n+    this.setState({ title: event.target.value })\n   }\n \n-  onChange(event) {\n-    let attr = {}\n-    attr[event.target.id] = event.target.value\n-    this.setState(attr)\n+  onDescriptionChange(event) {\n+    this.setState({ description: event.target.value })\n+    setTimeout( ()=>{ this.createPreview() }, 1000 )\n   }\n \n   rawMarkup() {\n-    return { __html: markdown.render(this.state.description) };\n+    return { __html: this.state.description_html };\n+  }\n+\n+  createPreview() {\n+    $.post(","path":"app/assets/javascripts/components/PoemForm.jsx","position":51,"original_position":51,"commit_id":"2f14c98e1626d0168b90118670e4e1a2d9048888","original_commit_id":"2f14c98e1626d0168b90118670e4e1a2d9048888","user":{"login":"suzan2go","id":8841470,"avatar_url":"https://avatars.githubusercontent.com/u/8841470?v=3","gravatar_id":"","url":"https://api.github.com/users/suzan2go","html_url":"https://github.com/suzan2go","followers_url":"https://api.github.com/users/suzan2go/followers","following_url":"https://api.github.com/users/suzan2go/following{/other_user}","gists_url":"https://api.github.com/users/suzan2go/gists{/gist_id}","starred_url":"https://api.github.com/users/suzan2go/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/suzan2go/subscriptions","organizations_url":"https://api.github.com/users/suzan2go/orgs","repos_url":"https://api.github.com/users/suzan2go/repos","events_url":"https://api.github.com/users/suzan2go/events{/privacy}","received_events_url":"https://api.github.com/users/suzan2go/received_events","type":"User","site_admin":false},"body":"まあどっちでも取れるなら、(普通にやったら)素直に長文をクエリに含めなくていい `POST` がいいんじゃない？というのが私の結論！\r\n`POST` のままで！","created_at":"2016-01-18T04:38:18Z","updated_at":"2016-01-18T04:38:18Z","html_url":"https://github.com/nasum/nasulog/pull/98#discussion_r49961634","pull_request_url":"https://api.github.com/repos/nasum/nasulog/pulls/98","_links":{"self":{"href":"https://api.github.com/repos/nasum/nasulog/pulls/comments/49961634"},"html":{"href":"https://github.com/nasum/nasulog/pull/98#discussion_r49961634"},"pull_request":{"href":"https://api.github.com/repos/nasum/nasulog/pulls/98"}}},"pull_request":{"url":"https://api.github.com/repos/nasum/nasulog/pulls/98","id":56279375,"html_url":"https://github.com/nasum/nasulog/pull/98","diff_url":"https://github.com/nasum/nasulog/pull/98.diff","patch_url":"https://github.com/nasum/nasulog/pull/98.patch","issue_url":"https://api.github.com/repos/nasum/nasulog/issues/98","number":98,"state":"open","locked":false,"title":"FIX #93 プレビューをサーバーサイドで行う","user":{"login":"suzan2go","id":8841470,"avatar_url":"https://avatars.githubusercontent.com/u/8841470?v=3","gravatar_id":"","url":"https://api.github.com/users/suzan2go","html_url":"https://github.com/suzan2go","followers_url":"https://api.github.com/users/suzan2go/followers","following_url":"https://api.github.com/users/suzan2go/following{/other_user}","gists_url":"https://api.github.com/users/suzan2go/gists{/gist_id}","starred_url":"https://api.github.com/users/suzan2go/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/suzan2go/subscriptions","organizations_url":"https://api.github.com/users/suzan2go/orgs","repos_url":"https://api.github.com/users/suzan2go/repos","events_url":"https://api.github.com/users/suzan2go/events{/privacy}","received_events_url":"https://api.github.com/users/suzan2go/received_events","type":"User","site_admin":false},"body":"## やったこと\r\n* JSのマークダウンパーサは意外とサーバーサイドと差分があるので、サーバーサイドでrenderした結果をプレビューとしてかえすようにする\r\n\r\n## よくなったこと\r\n* Windowsではemojiが白黒になってしまっていたが、カラー表示できるようになる\r\n* 今までoctocatとかの文字はJS側ではプレビューで表示されなかったが、表示されるようになる\r\n\r\n## 悪くなったこと\r\n* 多少レスポンス遅く感じることがあるかも","created_at":"2016-01-17T14:57:55Z","updated_at":"2016-01-18T04:38:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b8a9f27bef94a6c0ea0cd647ad02cdb599917636","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/nasum/nasulog/pulls/98/commits","review_comments_url":"https://api.github.com/repos/nasum/nasulog/pulls/98/comments","review_comment_url":"https://api.github.com/repos/nasum/nasulog/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nasum/nasulog/issues/98/comments","statuses_url":"https://api.github.com/repos/nasum/nasulog/statuses/2f14c98e1626d0168b90118670e4e1a2d9048888","head":{"label":"nasum:serverside-render-markdown-preview","ref":"serverside-render-markdown-preview","sha":"2f14c98e1626d0168b90118670e4e1a2d9048888","user":{"login":"nasum","id":1456806,"avatar_url":"https://avatars.githubusercontent.com/u/1456806?v=3","gravatar_id":"","url":"https://api.github.com/users/nasum","html_url":"https://github.com/nasum","followers_url":"https://api.github.com/users/nasum/followers","following_url":"https://api.github.com/users/nasum/following{/other_user}","gists_url":"https://api.github.com/users/nasum/gists{/gist_id}","starred_url":"https://api.github.com/users/nasum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nasum/subscriptions","organizations_url":"https://api.github.com/users/nasum/orgs","repos_url":"https://api.github.com/users/nasum/repos","events_url":"https://api.github.com/users/nasum/events{/privacy}","received_events_url":"https://api.github.com/users/nasum/received_events","type":"User","site_admin":false},"repo":{"id":48110379,"name":"nasulog","full_name":"nasum/nasulog","owner":{"login":"nasum","id":1456806,"avatar_url":"https://avatars.githubusercontent.com/u/1456806?v=3","gravatar_id":"","url":"https://api.github.com/users/nasum","html_url":"https://github.com/nasum","followers_url":"https://api.github.com/users/nasum/followers","following_url":"https://api.github.com/users/nasum/following{/other_user}","gists_url":"https://api.github.com/users/nasum/gists{/gist_id}","starred_url":"https://api.github.com/users/nasum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nasum/subscriptions","organizations_url":"https://api.github.com/users/nasum/orgs","repos_url":"https://api.github.com/users/nasum/repos","events_url":"https://api.github.com/users/nasum/events{/privacy}","received_events_url":"https://api.github.com/users/nasum/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nasum/nasulog","description":"ポエム投稿サービス","fork":false,"url":"https://api.github.com/repos/nasum/nasulog","forks_url":"https://api.github.com/repos/nasum/nasulog/forks","keys_url":"https://api.github.com/repos/nasum/nasulog/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nasum/nasulog/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nasum/nasulog/teams","hooks_url":"https://api.github.com/repos/nasum/nasulog/hooks","issue_events_url":"https://api.github.com/repos/nasum/nasulog/issues/events{/number}","events_url":"https://api.github.com/repos/nasum/nasulog/events","assignees_url":"https://api.github.com/repos/nasum/nasulog/assignees{/user}","branches_url":"https://api.github.com/repos/nasum/nasulog/branches{/branch}","tags_url":"https://api.github.com/repos/nasum/nasulog/tags","blobs_url":"https://api.github.com/repos/nasum/nasulog/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nasum/nasulog/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nasum/nasulog/git/refs{/sha}","trees_url":"https://api.github.com/repos/nasum/nasulog/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nasum/nasulog/statuses/{sha}","languages_url":"https://api.github.com/repos/nasum/nasulog/languages","stargazers_url":"https://api.github.com/repos/nasum/nasulog/stargazers","contributors_url":"https://api.github.com/repos/nasum/nasulog/contributors","subscribers_url":"https://api.github.com/repos/nasum/nasulog/subscribers","subscription_url":"https://api.github.com/repos/nasum/nasulog/subscription","commits_url":"https://api.github.com/repos/nasum/nasulog/commits{/sha}","git_commits_url":"https://api.github.com/repos/nasum/nasulog/git/commits{/sha}","comments_url":"https://api.github.com/repos/nasum/nasulog/comments{/number}","issue_comment_url":"https://api.github.com/repos/nasum/nasulog/issues/comments{/number}","contents_url":"https://api.github.com/repos/nasum/nasulog/contents/{+path}","compare_url":"https://api.github.com/repos/nasum/nasulog/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nasum/nasulog/merges","archive_url":"https://api.github.com/repos/nasum/nasulog/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nasum/nasulog/downloads","issues_url":"https://api.github.com/repos/nasum/nasulog/issues{/number}","pulls_url":"https://api.github.com/repos/nasum/nasulog/pulls{/number}","milestones_url":"https://api.github.com/repos/nasum/nasulog/milestones{/number}","notifications_url":"https://api.github.com/repos/nasum/nasulog/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nasum/nasulog/labels{/name}","releases_url":"https://api.github.com/repos/nasum/nasulog/releases{/id}","created_at":"2015-12-16T12:57:40Z","updated_at":"2016-01-13T10:59:29Z","pushed_at":"2016-01-17T14:57:55Z","git_url":"git://github.com/nasum/nasulog.git","ssh_url":"git@github.com:nasum/nasulog.git","clone_url":"https://github.com/nasum/nasulog.git","svn_url":"https://github.com/nasum/nasulog","homepage":"","size":4474,"stargazers_count":3,"watchers_count":3,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":21,"forks":4,"open_issues":21,"watchers":3,"default_branch":"master"}},"base":{"label":"nasum:master","ref":"master","sha":"4c68a633afe80f173d19215091e7d6c513ab2a95","user":{"login":"nasum","id":1456806,"avatar_url":"https://avatars.githubusercontent.com/u/1456806?v=3","gravatar_id":"","url":"https://api.github.com/users/nasum","html_url":"https://github.com/nasum","followers_url":"https://api.github.com/users/nasum/followers","following_url":"https://api.github.com/users/nasum/following{/other_user}","gists_url":"https://api.github.com/users/nasum/gists{/gist_id}","starred_url":"https://api.github.com/users/nasum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nasum/subscriptions","organizations_url":"https://api.github.com/users/nasum/orgs","repos_url":"https://api.github.com/users/nasum/repos","events_url":"https://api.github.com/users/nasum/events{/privacy}","received_events_url":"https://api.github.com/users/nasum/received_events","type":"User","site_admin":false},"repo":{"id":48110379,"name":"nasulog","full_name":"nasum/nasulog","owner":{"login":"nasum","id":1456806,"avatar_url":"https://avatars.githubusercontent.com/u/1456806?v=3","gravatar_id":"","url":"https://api.github.com/users/nasum","html_url":"https://github.com/nasum","followers_url":"https://api.github.com/users/nasum/followers","following_url":"https://api.github.com/users/nasum/following{/other_user}","gists_url":"https://api.github.com/users/nasum/gists{/gist_id}","starred_url":"https://api.github.com/users/nasum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nasum/subscriptions","organizations_url":"https://api.github.com/users/nasum/orgs","repos_url":"https://api.github.com/users/nasum/repos","events_url":"https://api.github.com/users/nasum/events{/privacy}","received_events_url":"https://api.github.com/users/nasum/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nasum/nasulog","description":"ポエム投稿サービス","fork":false,"url":"https://api.github.com/repos/nasum/nasulog","forks_url":"https://api.github.com/repos/nasum/nasulog/forks","keys_url":"https://api.github.com/repos/nasum/nasulog/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nasum/nasulog/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nasum/nasulog/teams","hooks_url":"https://api.github.com/repos/nasum/nasulog/hooks","issue_events_url":"https://api.github.com/repos/nasum/nasulog/issues/events{/number}","events_url":"https://api.github.com/repos/nasum/nasulog/events","assignees_url":"https://api.github.com/repos/nasum/nasulog/assignees{/user}","branches_url":"https://api.github.com/repos/nasum/nasulog/branches{/branch}","tags_url":"https://api.github.com/repos/nasum/nasulog/tags","blobs_url":"https://api.github.com/repos/nasum/nasulog/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nasum/nasulog/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nasum/nasulog/git/refs{/sha}","trees_url":"https://api.github.com/repos/nasum/nasulog/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nasum/nasulog/statuses/{sha}","languages_url":"https://api.github.com/repos/nasum/nasulog/languages","stargazers_url":"https://api.github.com/repos/nasum/nasulog/stargazers","contributors_url":"https://api.github.com/repos/nasum/nasulog/contributors","subscribers_url":"https://api.github.com/repos/nasum/nasulog/subscribers","subscription_url":"https://api.github.com/repos/nasum/nasulog/subscription","commits_url":"https://api.github.com/repos/nasum/nasulog/commits{/sha}","git_commits_url":"https://api.github.com/repos/nasum/nasulog/git/commits{/sha}","comments_url":"https://api.github.com/repos/nasum/nasulog/comments{/number}","issue_comment_url":"https://api.github.com/repos/nasum/nasulog/issues/comments{/number}","contents_url":"https://api.github.com/repos/nasum/nasulog/contents/{+path}","compare_url":"https://api.github.com/repos/nasum/nasulog/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nasum/nasulog/merges","archive_url":"https://api.github.com/repos/nasum/nasulog/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nasum/nasulog/downloads","issues_url":"https://api.github.com/repos/nasum/nasulog/issues{/number}","pulls_url":"https://api.github.com/repos/nasum/nasulog/pulls{/number}","milestones_url":"https://api.github.com/repos/nasum/nasulog/milestones{/number}","notifications_url":"https://api.github.com/repos/nasum/nasulog/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nasum/nasulog/labels{/name}","releases_url":"https://api.github.com/repos/nasum/nasulog/releases{/id}","created_at":"2015-12-16T12:57:40Z","updated_at":"2016-01-13T10:59:29Z","pushed_at":"2016-01-17T14:57:55Z","git_url":"git://github.com/nasum/nasulog.git","ssh_url":"git@github.com:nasum/nasulog.git","clone_url":"https://github.com/nasum/nasulog.git","svn_url":"https://github.com/nasum/nasulog","homepage":"","size":4474,"stargazers_count":3,"watchers_count":3,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":21,"forks":4,"open_issues":21,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nasum/nasulog/pulls/98"},"html":{"href":"https://github.com/nasum/nasulog/pull/98"},"issue":{"href":"https://api.github.com/repos/nasum/nasulog/issues/98"},"comments":{"href":"https://api.github.com/repos/nasum/nasulog/issues/98/comments"},"review_comments":{"href":"https://api.github.com/repos/nasum/nasulog/pulls/98/comments"},"review_comment":{"href":"https://api.github.com/repos/nasum/nasulog/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nasum/nasulog/pulls/98/commits"},"statuses":{"href":"https://api.github.com/repos/nasum/nasulog/statuses/2f14c98e1626d0168b90118670e4e1a2d9048888"}}}}