{"action":"created","comment":{"url":"https://api.github.com/repos/miiixr/picklete/pulls/comments/38563977","id":38563977,"diff_hunk":"@@ -0,0 +1,45 @@\n+$(\"#brandSelect\").val(undefined);\n+$(\"#brandSelect\").change(function() {\n+  if($(\"#brandSelect :selected\").text() != '選擇品牌'){\n+    $(\"input[type='radio'][name='brandType'][value='origin']\").prop(\"checked\", true);\n+    $(\"input[type='radio'][name='brandType'][value='custom']\").prop(\"checked\", false);\n+  }\n+});\n+$(\"input[type='text'][name='customBrand']\" ).focus(function() {\n+  $(\"input[type='radio'][name='brandType'][value='custom']\").prop(\"checked\", true);\n+  $(\"input[type='radio'][name='brandType'][value='origin']\").prop(\"checked\", false);\n+\n+});\n+\n+$('input[type=submit]').click(function () {\n+  if( $('input[name=brandType]:checked').val() == 'origin' ){\n+    if($(\"#brandSelect :selected\").text() == '選擇品牌'){\n+      $(\"#brandSelect\").prop('required', true);\n+    }\n+  else{\n+    $(\"#brandSelect\").prop('required', false);\n+    }\n+  }\n+});\n+\n+\n+$(\".color-filter\").click(function(){\n+  $(\"#color-filter\").attr('class', $(this).attr('class'));\n+});\n+\n+$('form').on('click','.btn-add',function(e){\n+  e.preventDefault();\n+  s = $($(this).parent().parent()).prop('outerHTML');\n+  $(this).parent().parent().after(s);\n+  $(this).remove();\n+});","path":"assets/javascripts/admin/goodCreate.js","position":35,"original_position":35,"commit_id":"6dc748721a0da364fd00129749556c7d131ad17a","original_commit_id":"6dc748721a0da364fd00129749556c7d131ad17a","user":{"login":"clonn","id":347807,"avatar_url":"https://avatars.githubusercontent.com/u/347807?v=3","gravatar_id":"","url":"https://api.github.com/users/clonn","html_url":"https://github.com/clonn","followers_url":"https://api.github.com/users/clonn/followers","following_url":"https://api.github.com/users/clonn/following{/other_user}","gists_url":"https://api.github.com/users/clonn/gists{/gist_id}","starred_url":"https://api.github.com/users/clonn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clonn/subscriptions","organizations_url":"https://api.github.com/users/clonn/orgs","repos_url":"https://api.github.com/users/clonn/repos","events_url":"https://api.github.com/users/clonn/events{/privacy}","received_events_url":"https://api.github.com/users/clonn/received_events","type":"User","site_admin":false},"body":"```\r\nvar that = $(this);\r\n// that...\r\n```\r\n\r\n盡量避免讓 jquery 重複查詢執行，盡量用記憶體換取執行效能。","created_at":"2015-09-02T18:02:54Z","updated_at":"2015-09-02T18:02:54Z","html_url":"https://github.com/miiixr/picklete/pull/51#discussion_r38563977","pull_request_url":"https://api.github.com/repos/miiixr/picklete/pulls/51","_links":{"self":{"href":"https://api.github.com/repos/miiixr/picklete/pulls/comments/38563977"},"html":{"href":"https://github.com/miiixr/picklete/pull/51#discussion_r38563977"},"pull_request":{"href":"https://api.github.com/repos/miiixr/picklete/pulls/51"}}},"pull_request":{"url":"https://api.github.com/repos/miiixr/picklete/pulls/51","id":43986438,"html_url":"https://github.com/miiixr/picklete/pull/51","diff_url":"https://github.com/miiixr/picklete/pull/51.diff","patch_url":"https://github.com/miiixr/picklete/pull/51.patch","issue_url":"https://api.github.com/repos/miiixr/picklete/issues/51","number":51,"state":"open","locked":false,"title":"update product showCreate view","user":{"login":"v123582","id":5959524,"avatar_url":"https://avatars.githubusercontent.com/u/5959524?v=3","gravatar_id":"","url":"https://api.github.com/users/v123582","html_url":"https://github.com/v123582","followers_url":"https://api.github.com/users/v123582/followers","following_url":"https://api.github.com/users/v123582/following{/other_user}","gists_url":"https://api.github.com/users/v123582/gists{/gist_id}","starred_url":"https://api.github.com/users/v123582/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/v123582/subscriptions","organizations_url":"https://api.github.com/users/v123582/orgs","repos_url":"https://api.github.com/users/v123582/repos","events_url":"https://api.github.com/users/v123582/events{/privacy}","received_events_url":"https://api.github.com/users/v123582/received_events","type":"User","site_admin":false},"body":"* fix ambiguous column name: 'Dpt.weight', 'DptSubs.weight'\r\n* brandSelect\r\n* color-filter\r\n* btn-add and btn-remove","created_at":"2015-09-02T12:39:34Z","updated_at":"2015-09-02T18:02:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bdfbca51abc62132af2a8cf63421e694d5f9a582","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/miiixr/picklete/pulls/51/commits","review_comments_url":"https://api.github.com/repos/miiixr/picklete/pulls/51/comments","review_comment_url":"https://api.github.com/repos/miiixr/picklete/pulls/comments{/number}","comments_url":"https://api.github.com/repos/miiixr/picklete/issues/51/comments","statuses_url":"https://api.github.com/repos/miiixr/picklete/statuses/6dc748721a0da364fd00129749556c7d131ad17a","head":{"label":"v123582:feature/product_showCreate","ref":"feature/product_showCreate","sha":"6dc748721a0da364fd00129749556c7d131ad17a","user":{"login":"v123582","id":5959524,"avatar_url":"https://avatars.githubusercontent.com/u/5959524?v=3","gravatar_id":"","url":"https://api.github.com/users/v123582","html_url":"https://github.com/v123582","followers_url":"https://api.github.com/users/v123582/followers","following_url":"https://api.github.com/users/v123582/following{/other_user}","gists_url":"https://api.github.com/users/v123582/gists{/gist_id}","starred_url":"https://api.github.com/users/v123582/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/v123582/subscriptions","organizations_url":"https://api.github.com/users/v123582/orgs","repos_url":"https://api.github.com/users/v123582/repos","events_url":"https://api.github.com/users/v123582/events{/privacy}","received_events_url":"https://api.github.com/users/v123582/received_events","type":"User","site_admin":false},"repo":{"id":41799679,"name":"picklete","full_name":"v123582/picklete","owner":{"login":"v123582","id":5959524,"avatar_url":"https://avatars.githubusercontent.com/u/5959524?v=3","gravatar_id":"","url":"https://api.github.com/users/v123582","html_url":"https://github.com/v123582","followers_url":"https://api.github.com/users/v123582/followers","following_url":"https://api.github.com/users/v123582/following{/other_user}","gists_url":"https://api.github.com/users/v123582/gists{/gist_id}","starred_url":"https://api.github.com/users/v123582/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/v123582/subscriptions","organizations_url":"https://api.github.com/users/v123582/orgs","repos_url":"https://api.github.com/users/v123582/repos","events_url":"https://api.github.com/users/v123582/events{/privacy}","received_events_url":"https://api.github.com/users/v123582/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/v123582/picklete","description":"","fork":true,"url":"https://api.github.com/repos/v123582/picklete","forks_url":"https://api.github.com/repos/v123582/picklete/forks","keys_url":"https://api.github.com/repos/v123582/picklete/keys{/key_id}","collaborators_url":"https://api.github.com/repos/v123582/picklete/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/v123582/picklete/teams","hooks_url":"https://api.github.com/repos/v123582/picklete/hooks","issue_events_url":"https://api.github.com/repos/v123582/picklete/issues/events{/number}","events_url":"https://api.github.com/repos/v123582/picklete/events","assignees_url":"https://api.github.com/repos/v123582/picklete/assignees{/user}","branches_url":"https://api.github.com/repos/v123582/picklete/branches{/branch}","tags_url":"https://api.github.com/repos/v123582/picklete/tags","blobs_url":"https://api.github.com/repos/v123582/picklete/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/v123582/picklete/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/v123582/picklete/git/refs{/sha}","trees_url":"https://api.github.com/repos/v123582/picklete/git/trees{/sha}","statuses_url":"https://api.github.com/repos/v123582/picklete/statuses/{sha}","languages_url":"https://api.github.com/repos/v123582/picklete/languages","stargazers_url":"https://api.github.com/repos/v123582/picklete/stargazers","contributors_url":"https://api.github.com/repos/v123582/picklete/contributors","subscribers_url":"https://api.github.com/repos/v123582/picklete/subscribers","subscription_url":"https://api.github.com/repos/v123582/picklete/subscription","commits_url":"https://api.github.com/repos/v123582/picklete/commits{/sha}","git_commits_url":"https://api.github.com/repos/v123582/picklete/git/commits{/sha}","comments_url":"https://api.github.com/repos/v123582/picklete/comments{/number}","issue_comment_url":"https://api.github.com/repos/v123582/picklete/issues/comments{/number}","contents_url":"https://api.github.com/repos/v123582/picklete/contents/{+path}","compare_url":"https://api.github.com/repos/v123582/picklete/compare/{base}...{head}","merges_url":"https://api.github.com/repos/v123582/picklete/merges","archive_url":"https://api.github.com/repos/v123582/picklete/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/v123582/picklete/downloads","issues_url":"https://api.github.com/repos/v123582/picklete/issues{/number}","pulls_url":"https://api.github.com/repos/v123582/picklete/pulls{/number}","milestones_url":"https://api.github.com/repos/v123582/picklete/milestones{/number}","notifications_url":"https://api.github.com/repos/v123582/picklete/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/v123582/picklete/labels{/name}","releases_url":"https://api.github.com/repos/v123582/picklete/releases{/id}","created_at":"2015-09-02T12:27:38Z","updated_at":"2015-09-02T12:27:39Z","pushed_at":"2015-09-02T16:33:56Z","git_url":"git://github.com/v123582/picklete.git","ssh_url":"git@github.com:v123582/picklete.git","clone_url":"https://github.com/v123582/picklete.git","svn_url":"https://github.com/v123582/picklete","homepage":null,"size":2656,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"miiixr:develop","ref":"develop","sha":"940f650d33e0c9202aa92968a2596f15f9e17d05","user":{"login":"miiixr","id":13635773,"avatar_url":"https://avatars.githubusercontent.com/u/13635773?v=3","gravatar_id":"","url":"https://api.github.com/users/miiixr","html_url":"https://github.com/miiixr","followers_url":"https://api.github.com/users/miiixr/followers","following_url":"https://api.github.com/users/miiixr/following{/other_user}","gists_url":"https://api.github.com/users/miiixr/gists{/gist_id}","starred_url":"https://api.github.com/users/miiixr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miiixr/subscriptions","organizations_url":"https://api.github.com/users/miiixr/orgs","repos_url":"https://api.github.com/users/miiixr/repos","events_url":"https://api.github.com/users/miiixr/events{/privacy}","received_events_url":"https://api.github.com/users/miiixr/received_events","type":"Organization","site_admin":false},"repo":{"id":40162704,"name":"picklete","full_name":"miiixr/picklete","owner":{"login":"miiixr","id":13635773,"avatar_url":"https://avatars.githubusercontent.com/u/13635773?v=3","gravatar_id":"","url":"https://api.github.com/users/miiixr","html_url":"https://github.com/miiixr","followers_url":"https://api.github.com/users/miiixr/followers","following_url":"https://api.github.com/users/miiixr/following{/other_user}","gists_url":"https://api.github.com/users/miiixr/gists{/gist_id}","starred_url":"https://api.github.com/users/miiixr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miiixr/subscriptions","organizations_url":"https://api.github.com/users/miiixr/orgs","repos_url":"https://api.github.com/users/miiixr/repos","events_url":"https://api.github.com/users/miiixr/events{/privacy}","received_events_url":"https://api.github.com/users/miiixr/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/miiixr/picklete","description":"","fork":false,"url":"https://api.github.com/repos/miiixr/picklete","forks_url":"https://api.github.com/repos/miiixr/picklete/forks","keys_url":"https://api.github.com/repos/miiixr/picklete/keys{/key_id}","collaborators_url":"https://api.github.com/repos/miiixr/picklete/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/miiixr/picklete/teams","hooks_url":"https://api.github.com/repos/miiixr/picklete/hooks","issue_events_url":"https://api.github.com/repos/miiixr/picklete/issues/events{/number}","events_url":"https://api.github.com/repos/miiixr/picklete/events","assignees_url":"https://api.github.com/repos/miiixr/picklete/assignees{/user}","branches_url":"https://api.github.com/repos/miiixr/picklete/branches{/branch}","tags_url":"https://api.github.com/repos/miiixr/picklete/tags","blobs_url":"https://api.github.com/repos/miiixr/picklete/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/miiixr/picklete/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/miiixr/picklete/git/refs{/sha}","trees_url":"https://api.github.com/repos/miiixr/picklete/git/trees{/sha}","statuses_url":"https://api.github.com/repos/miiixr/picklete/statuses/{sha}","languages_url":"https://api.github.com/repos/miiixr/picklete/languages","stargazers_url":"https://api.github.com/repos/miiixr/picklete/stargazers","contributors_url":"https://api.github.com/repos/miiixr/picklete/contributors","subscribers_url":"https://api.github.com/repos/miiixr/picklete/subscribers","subscription_url":"https://api.github.com/repos/miiixr/picklete/subscription","commits_url":"https://api.github.com/repos/miiixr/picklete/commits{/sha}","git_commits_url":"https://api.github.com/repos/miiixr/picklete/git/commits{/sha}","comments_url":"https://api.github.com/repos/miiixr/picklete/comments{/number}","issue_comment_url":"https://api.github.com/repos/miiixr/picklete/issues/comments{/number}","contents_url":"https://api.github.com/repos/miiixr/picklete/contents/{+path}","compare_url":"https://api.github.com/repos/miiixr/picklete/compare/{base}...{head}","merges_url":"https://api.github.com/repos/miiixr/picklete/merges","archive_url":"https://api.github.com/repos/miiixr/picklete/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/miiixr/picklete/downloads","issues_url":"https://api.github.com/repos/miiixr/picklete/issues{/number}","pulls_url":"https://api.github.com/repos/miiixr/picklete/pulls{/number}","milestones_url":"https://api.github.com/repos/miiixr/picklete/milestones{/number}","notifications_url":"https://api.github.com/repos/miiixr/picklete/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/miiixr/picklete/labels{/name}","releases_url":"https://api.github.com/repos/miiixr/picklete/releases{/id}","created_at":"2015-08-04T04:07:03Z","updated_at":"2015-08-31T00:04:38Z","pushed_at":"2015-09-02T16:33:56Z","git_url":"git://github.com/miiixr/picklete.git","ssh_url":"git@github.com:miiixr/picklete.git","clone_url":"https://github.com/miiixr/picklete.git","svn_url":"https://github.com/miiixr/picklete","homepage":null,"size":2656,"stargazers_count":2,"watchers_count":2,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":5,"forks":9,"open_issues":5,"watchers":2,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/miiixr/picklete/pulls/51"},"html":{"href":"https://github.com/miiixr/picklete/pull/51"},"issue":{"href":"https://api.github.com/repos/miiixr/picklete/issues/51"},"comments":{"href":"https://api.github.com/repos/miiixr/picklete/issues/51/comments"},"review_comments":{"href":"https://api.github.com/repos/miiixr/picklete/pulls/51/comments"},"review_comment":{"href":"https://api.github.com/repos/miiixr/picklete/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/miiixr/picklete/pulls/51/commits"},"statuses":{"href":"https://api.github.com/repos/miiixr/picklete/statuses/6dc748721a0da364fd00129749556c7d131ad17a"}}}}