{"action":"created","comment":{"url":"https://api.github.com/repos/edraut/pulitzer/pulls/comments/43144496","id":43144496,"diff_hunk":"@@ -4,17 +4,35 @@ var Select2Trigger = Class.extend({\n   }\n });\n \n-$(document).ready(function(){\n-  $(document).on('change', '#post_type_content_element_type_content_element_type_id', function(){\n-    $dimensionsFields = $(this).parent().find($('.image_dimensions')).first();\n-    if ($('option:selected', this).text() == \"Image\"){\n-      $dimensionsFields.show();\n-    } else {\n-      $dimensionsFields.hide();\n-    }\n-  });\n+var ToggleContentElementAttr = Class.extend({","path":"app/assets/javascripts/pulitzer.js","position":13,"original_position":13,"commit_id":"0f785041237d4a30725ef6245de113fd9467d915","original_commit_id":"0f785041237d4a30725ef6245de113fd9467d915","user":{"login":"edraut","id":15188,"avatar_url":"https://avatars.githubusercontent.com/u/15188?v=3","gravatar_id":"","url":"https://api.github.com/users/edraut","html_url":"https://github.com/edraut","followers_url":"https://api.github.com/users/edraut/followers","following_url":"https://api.github.com/users/edraut/following{/other_user}","gists_url":"https://api.github.com/users/edraut/gists{/gist_id}","starred_url":"https://api.github.com/users/edraut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edraut/subscriptions","organizations_url":"https://api.github.com/users/edraut/orgs","repos_url":"https://api.github.com/users/edraut/repos","events_url":"https://api.github.com/users/edraut/events{/privacy}","received_events_url":"https://api.github.com/users/edraut/received_events","type":"User","site_admin":false},"body":"@gomayonqui, why is this done in javascript? Shouldn't there just be separate form views for each content element type? I think it would be much simpler. We would be able to completely remove this class.","created_at":"2015-10-27T16:13:08Z","updated_at":"2015-10-27T16:13:08Z","html_url":"https://github.com/edraut/pulitzer/pull/16#discussion_r43144496","pull_request_url":"https://api.github.com/repos/edraut/pulitzer/pulls/16","_links":{"self":{"href":"https://api.github.com/repos/edraut/pulitzer/pulls/comments/43144496"},"html":{"href":"https://github.com/edraut/pulitzer/pull/16#discussion_r43144496"},"pull_request":{"href":"https://api.github.com/repos/edraut/pulitzer/pulls/16"}}},"pull_request":{"url":"https://api.github.com/repos/edraut/pulitzer/pulls/16","id":48228018,"html_url":"https://github.com/edraut/pulitzer/pull/16","diff_url":"https://github.com/edraut/pulitzer/pull/16.diff","patch_url":"https://github.com/edraut/pulitzer/pull/16.patch","issue_url":"https://api.github.com/repos/edraut/pulitzer/issues/16","number":16,"state":"open","locked":false,"title":"Add rich text editor","user":{"login":"gomayonqui","id":1708733,"avatar_url":"https://avatars.githubusercontent.com/u/1708733?v=3","gravatar_id":"","url":"https://api.github.com/users/gomayonqui","html_url":"https://github.com/gomayonqui","followers_url":"https://api.github.com/users/gomayonqui/followers","following_url":"https://api.github.com/users/gomayonqui/following{/other_user}","gists_url":"https://api.github.com/users/gomayonqui/gists{/gist_id}","starred_url":"https://api.github.com/users/gomayonqui/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gomayonqui/subscriptions","organizations_url":"https://api.github.com/users/gomayonqui/orgs","repos_url":"https://api.github.com/users/gomayonqui/repos","events_url":"https://api.github.com/users/gomayonqui/events{/privacy}","received_events_url":"https://api.github.com/users/gomayonqui/received_events","type":"User","site_admin":false},"body":"Add a rich text editor option for a post type content element, using wysihtml5.","created_at":"2015-10-20T16:53:24Z","updated_at":"2015-10-27T16:13:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4f2aed8c70a737a9caa2454e7a80f714a107829d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/edraut/pulitzer/pulls/16/commits","review_comments_url":"https://api.github.com/repos/edraut/pulitzer/pulls/16/comments","review_comment_url":"https://api.github.com/repos/edraut/pulitzer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/edraut/pulitzer/issues/16/comments","statuses_url":"https://api.github.com/repos/edraut/pulitzer/statuses/0f785041237d4a30725ef6245de113fd9467d915","head":{"label":"edraut:add-rich-text-editor","ref":"add-rich-text-editor","sha":"0f785041237d4a30725ef6245de113fd9467d915","user":{"login":"edraut","id":15188,"avatar_url":"https://avatars.githubusercontent.com/u/15188?v=3","gravatar_id":"","url":"https://api.github.com/users/edraut","html_url":"https://github.com/edraut","followers_url":"https://api.github.com/users/edraut/followers","following_url":"https://api.github.com/users/edraut/following{/other_user}","gists_url":"https://api.github.com/users/edraut/gists{/gist_id}","starred_url":"https://api.github.com/users/edraut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edraut/subscriptions","organizations_url":"https://api.github.com/users/edraut/orgs","repos_url":"https://api.github.com/users/edraut/repos","events_url":"https://api.github.com/users/edraut/events{/privacy}","received_events_url":"https://api.github.com/users/edraut/received_events","type":"User","site_admin":false},"repo":{"id":37878641,"name":"pulitzer","full_name":"edraut/pulitzer","owner":{"login":"edraut","id":15188,"avatar_url":"https://avatars.githubusercontent.com/u/15188?v=3","gravatar_id":"","url":"https://api.github.com/users/edraut","html_url":"https://github.com/edraut","followers_url":"https://api.github.com/users/edraut/followers","following_url":"https://api.github.com/users/edraut/following{/other_user}","gists_url":"https://api.github.com/users/edraut/gists{/gist_id}","starred_url":"https://api.github.com/users/edraut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edraut/subscriptions","organizations_url":"https://api.github.com/users/edraut/orgs","repos_url":"https://api.github.com/users/edraut/repos","events_url":"https://api.github.com/users/edraut/events{/privacy}","received_events_url":"https://api.github.com/users/edraut/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/edraut/pulitzer","description":"A content management engine for Ruby on Rails.","fork":false,"url":"https://api.github.com/repos/edraut/pulitzer","forks_url":"https://api.github.com/repos/edraut/pulitzer/forks","keys_url":"https://api.github.com/repos/edraut/pulitzer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edraut/pulitzer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edraut/pulitzer/teams","hooks_url":"https://api.github.com/repos/edraut/pulitzer/hooks","issue_events_url":"https://api.github.com/repos/edraut/pulitzer/issues/events{/number}","events_url":"https://api.github.com/repos/edraut/pulitzer/events","assignees_url":"https://api.github.com/repos/edraut/pulitzer/assignees{/user}","branches_url":"https://api.github.com/repos/edraut/pulitzer/branches{/branch}","tags_url":"https://api.github.com/repos/edraut/pulitzer/tags","blobs_url":"https://api.github.com/repos/edraut/pulitzer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edraut/pulitzer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edraut/pulitzer/git/refs{/sha}","trees_url":"https://api.github.com/repos/edraut/pulitzer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edraut/pulitzer/statuses/{sha}","languages_url":"https://api.github.com/repos/edraut/pulitzer/languages","stargazers_url":"https://api.github.com/repos/edraut/pulitzer/stargazers","contributors_url":"https://api.github.com/repos/edraut/pulitzer/contributors","subscribers_url":"https://api.github.com/repos/edraut/pulitzer/subscribers","subscription_url":"https://api.github.com/repos/edraut/pulitzer/subscription","commits_url":"https://api.github.com/repos/edraut/pulitzer/commits{/sha}","git_commits_url":"https://api.github.com/repos/edraut/pulitzer/git/commits{/sha}","comments_url":"https://api.github.com/repos/edraut/pulitzer/comments{/number}","issue_comment_url":"https://api.github.com/repos/edraut/pulitzer/issues/comments{/number}","contents_url":"https://api.github.com/repos/edraut/pulitzer/contents/{+path}","compare_url":"https://api.github.com/repos/edraut/pulitzer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edraut/pulitzer/merges","archive_url":"https://api.github.com/repos/edraut/pulitzer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edraut/pulitzer/downloads","issues_url":"https://api.github.com/repos/edraut/pulitzer/issues{/number}","pulls_url":"https://api.github.com/repos/edraut/pulitzer/pulls{/number}","milestones_url":"https://api.github.com/repos/edraut/pulitzer/milestones{/number}","notifications_url":"https://api.github.com/repos/edraut/pulitzer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edraut/pulitzer/labels{/name}","releases_url":"https://api.github.com/repos/edraut/pulitzer/releases{/id}","created_at":"2015-06-22T20:21:41Z","updated_at":"2015-08-28T16:26:20Z","pushed_at":"2015-10-26T19:02:47Z","git_url":"git://github.com/edraut/pulitzer.git","ssh_url":"git@github.com:edraut/pulitzer.git","clone_url":"https://github.com/edraut/pulitzer.git","svn_url":"https://github.com/edraut/pulitzer","homepage":"","size":1123,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":1,"default_branch":"master"}},"base":{"label":"edraut:master","ref":"master","sha":"696c1d4701729497c326f430bf06b3ad27dbfa72","user":{"login":"edraut","id":15188,"avatar_url":"https://avatars.githubusercontent.com/u/15188?v=3","gravatar_id":"","url":"https://api.github.com/users/edraut","html_url":"https://github.com/edraut","followers_url":"https://api.github.com/users/edraut/followers","following_url":"https://api.github.com/users/edraut/following{/other_user}","gists_url":"https://api.github.com/users/edraut/gists{/gist_id}","starred_url":"https://api.github.com/users/edraut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edraut/subscriptions","organizations_url":"https://api.github.com/users/edraut/orgs","repos_url":"https://api.github.com/users/edraut/repos","events_url":"https://api.github.com/users/edraut/events{/privacy}","received_events_url":"https://api.github.com/users/edraut/received_events","type":"User","site_admin":false},"repo":{"id":37878641,"name":"pulitzer","full_name":"edraut/pulitzer","owner":{"login":"edraut","id":15188,"avatar_url":"https://avatars.githubusercontent.com/u/15188?v=3","gravatar_id":"","url":"https://api.github.com/users/edraut","html_url":"https://github.com/edraut","followers_url":"https://api.github.com/users/edraut/followers","following_url":"https://api.github.com/users/edraut/following{/other_user}","gists_url":"https://api.github.com/users/edraut/gists{/gist_id}","starred_url":"https://api.github.com/users/edraut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edraut/subscriptions","organizations_url":"https://api.github.com/users/edraut/orgs","repos_url":"https://api.github.com/users/edraut/repos","events_url":"https://api.github.com/users/edraut/events{/privacy}","received_events_url":"https://api.github.com/users/edraut/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/edraut/pulitzer","description":"A content management engine for Ruby on Rails.","fork":false,"url":"https://api.github.com/repos/edraut/pulitzer","forks_url":"https://api.github.com/repos/edraut/pulitzer/forks","keys_url":"https://api.github.com/repos/edraut/pulitzer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edraut/pulitzer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edraut/pulitzer/teams","hooks_url":"https://api.github.com/repos/edraut/pulitzer/hooks","issue_events_url":"https://api.github.com/repos/edraut/pulitzer/issues/events{/number}","events_url":"https://api.github.com/repos/edraut/pulitzer/events","assignees_url":"https://api.github.com/repos/edraut/pulitzer/assignees{/user}","branches_url":"https://api.github.com/repos/edraut/pulitzer/branches{/branch}","tags_url":"https://api.github.com/repos/edraut/pulitzer/tags","blobs_url":"https://api.github.com/repos/edraut/pulitzer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edraut/pulitzer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edraut/pulitzer/git/refs{/sha}","trees_url":"https://api.github.com/repos/edraut/pulitzer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edraut/pulitzer/statuses/{sha}","languages_url":"https://api.github.com/repos/edraut/pulitzer/languages","stargazers_url":"https://api.github.com/repos/edraut/pulitzer/stargazers","contributors_url":"https://api.github.com/repos/edraut/pulitzer/contributors","subscribers_url":"https://api.github.com/repos/edraut/pulitzer/subscribers","subscription_url":"https://api.github.com/repos/edraut/pulitzer/subscription","commits_url":"https://api.github.com/repos/edraut/pulitzer/commits{/sha}","git_commits_url":"https://api.github.com/repos/edraut/pulitzer/git/commits{/sha}","comments_url":"https://api.github.com/repos/edraut/pulitzer/comments{/number}","issue_comment_url":"https://api.github.com/repos/edraut/pulitzer/issues/comments{/number}","contents_url":"https://api.github.com/repos/edraut/pulitzer/contents/{+path}","compare_url":"https://api.github.com/repos/edraut/pulitzer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edraut/pulitzer/merges","archive_url":"https://api.github.com/repos/edraut/pulitzer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edraut/pulitzer/downloads","issues_url":"https://api.github.com/repos/edraut/pulitzer/issues{/number}","pulls_url":"https://api.github.com/repos/edraut/pulitzer/pulls{/number}","milestones_url":"https://api.github.com/repos/edraut/pulitzer/milestones{/number}","notifications_url":"https://api.github.com/repos/edraut/pulitzer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edraut/pulitzer/labels{/name}","releases_url":"https://api.github.com/repos/edraut/pulitzer/releases{/id}","created_at":"2015-06-22T20:21:41Z","updated_at":"2015-08-28T16:26:20Z","pushed_at":"2015-10-26T19:02:47Z","git_url":"git://github.com/edraut/pulitzer.git","ssh_url":"git@github.com:edraut/pulitzer.git","clone_url":"https://github.com/edraut/pulitzer.git","svn_url":"https://github.com/edraut/pulitzer","homepage":"","size":1123,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/edraut/pulitzer/pulls/16"},"html":{"href":"https://github.com/edraut/pulitzer/pull/16"},"issue":{"href":"https://api.github.com/repos/edraut/pulitzer/issues/16"},"comments":{"href":"https://api.github.com/repos/edraut/pulitzer/issues/16/comments"},"review_comments":{"href":"https://api.github.com/repos/edraut/pulitzer/pulls/16/comments"},"review_comment":{"href":"https://api.github.com/repos/edraut/pulitzer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/edraut/pulitzer/pulls/16/commits"},"statuses":{"href":"https://api.github.com/repos/edraut/pulitzer/statuses/0f785041237d4a30725ef6245de113fd9467d915"}}}}