{"action":"created","comment":{"url":"https://api.github.com/repos/ehanjaki/Puzzle/pulls/comments/141592422","pull_request_review_id":65827838,"id":141592422,"diff_hunk":"@@ -1,23 +1,73 @@\n $(document).ready(function() {\r\n-  // При загрузке страницы выполнится весь написанный здесь код\r\n-  // alert(\"Привет!!!\");\r\n \r\n   var data = {};\r\n   data.scene = $(\".scene\");\r\n   data.box = data.scene.find(\".box\");\r\n   data.setka = data.scene.find(\".setka\");\r\n+  data.c = []\r\n+  data.s = []\r\n \r\n-var c = []\r\n-for (var i = 0; i < 9; i++) {\r\n-  var b = $(\"<div>\", {class: \"img img\" +i});\r\n-  b.css({left: 521, top: 80});\r\n-  b.appendTo(data.box);\r\n-  c.push(b);\r\n-}\r\n+  for (var i = 0; i < 9; i++) {\r\n+    var b = $(\"<div>\", {class: \"img img\" +i});\r\n+    pos = getRand();\r\n+    b.data({begin_pos: pos});\r\n+    b.css(pos);\r\n+    b.appendTo(data.box);\r\n+    data.c.push(b);\r\n+  }\r\n \r\n-var s = []\r\n-for (var i = 0; i < 9; i++) {\r\n-  var a = $(\"<div>\").addClass(\"b b\" +i).appendTo(data.setka);\r\n-  s.push(a);\r\n-}\r\n+  for (var i = 0; i < 9; i++) {\r\n+    var a = $(\"<div>\").addClass(\"b b\" +i).appendTo(data.setka);\r\n+    pos = a.position();\r\n+    a.data({cell_pos: pos});\r\n+    data.s.push(a);\r\n+    pos = data.s[i].data().cell_pos\r\n+  }\r\n+  var elems = $('.img'),\r\n+      parent = $('body'),\r\n+      setka = $('.setka');\r\n+\r\n+  elems.on('mousedown', function(event) {\r\n+    var elem = $(this)\r\n+        pos = elem.position();\r\n+        shiftX = event.pageX - pos.left,\r\n+        shiftY = event.pageY - pos.top;\r\n+\r\n+    parent.on('mousemove', function(event) {\r\n+      pos = newCoord(shiftX, shiftY);\r\n+      new_coords = positionElem(new_coords, data);\r\n+      elem.css(new_coords);\r\n+    });\r\n+\r\n+    parent.on('mouseup', function(event) {\r\n+      parent.off(\"mouseup\")\r\n+      parent.off(\"mousemove\")\r\n+      pos = newCoord(shiftX, shiftY);\r","path":"_include/js/script.js","position":59,"original_position":59,"commit_id":"37a2c058fa755596a2c1db3e47f7a7f6f031bf88","original_commit_id":"37a2c058fa755596a2c1db3e47f7a7f6f031bf88","user":{"login":"AnsGit","id":6313159,"avatar_url":"https://avatars1.githubusercontent.com/u/6313159?v=4","gravatar_id":"","url":"https://api.github.com/users/AnsGit","html_url":"https://github.com/AnsGit","followers_url":"https://api.github.com/users/AnsGit/followers","following_url":"https://api.github.com/users/AnsGit/following{/other_user}","gists_url":"https://api.github.com/users/AnsGit/gists{/gist_id}","starred_url":"https://api.github.com/users/AnsGit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AnsGit/subscriptions","organizations_url":"https://api.github.com/users/AnsGit/orgs","repos_url":"https://api.github.com/users/AnsGit/repos","events_url":"https://api.github.com/users/AnsGit/events{/privacy}","received_events_url":"https://api.github.com/users/AnsGit/received_events","type":"User","site_admin":false},"body":"Все строки 45-51 не играют никакой роли. Переменная **pos**, которая инициализируется трижды в этих строках, в дальнейшем не используется. Думаю, эти строки нужно удалить.","created_at":"2017-09-28T11:30:35Z","updated_at":"2017-09-28T11:37:47Z","html_url":"https://github.com/ehanjaki/Puzzle/pull/3#discussion_r141592422","pull_request_url":"https://api.github.com/repos/ehanjaki/Puzzle/pulls/3","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/ehanjaki/Puzzle/pulls/comments/141592422"},"html":{"href":"https://github.com/ehanjaki/Puzzle/pull/3#discussion_r141592422"},"pull_request":{"href":"https://api.github.com/repos/ehanjaki/Puzzle/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/ehanjaki/Puzzle/pulls/3","id":139495513,"html_url":"https://github.com/ehanjaki/Puzzle/pull/3","diff_url":"https://github.com/ehanjaki/Puzzle/pull/3.diff","patch_url":"https://github.com/ehanjaki/Puzzle/pull/3.patch","issue_url":"https://api.github.com/repos/ehanjaki/Puzzle/issues/3","number":3,"state":"open","locked":false,"title":"dev","user":{"login":"ehanjaki","id":31611927,"avatar_url":"https://avatars2.githubusercontent.com/u/31611927?v=4","gravatar_id":"","url":"https://api.github.com/users/ehanjaki","html_url":"https://github.com/ehanjaki","followers_url":"https://api.github.com/users/ehanjaki/followers","following_url":"https://api.github.com/users/ehanjaki/following{/other_user}","gists_url":"https://api.github.com/users/ehanjaki/gists{/gist_id}","starred_url":"https://api.github.com/users/ehanjaki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ehanjaki/subscriptions","organizations_url":"https://api.github.com/users/ehanjaki/orgs","repos_url":"https://api.github.com/users/ehanjaki/repos","events_url":"https://api.github.com/users/ehanjaki/events{/privacy}","received_events_url":"https://api.github.com/users/ehanjaki/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-09-06T08:02:19Z","updated_at":"2017-09-28T11:37:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1d5ba321b4792c9f31eb3445622f5fdd92f6e5e2","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/ehanjaki/Puzzle/pulls/3/commits","review_comments_url":"https://api.github.com/repos/ehanjaki/Puzzle/pulls/3/comments","review_comment_url":"https://api.github.com/repos/ehanjaki/Puzzle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ehanjaki/Puzzle/issues/3/comments","statuses_url":"https://api.github.com/repos/ehanjaki/Puzzle/statuses/37a2c058fa755596a2c1db3e47f7a7f6f031bf88","head":{"label":"ehanjaki:dev","ref":"dev","sha":"37a2c058fa755596a2c1db3e47f7a7f6f031bf88","user":{"login":"ehanjaki","id":31611927,"avatar_url":"https://avatars2.githubusercontent.com/u/31611927?v=4","gravatar_id":"","url":"https://api.github.com/users/ehanjaki","html_url":"https://github.com/ehanjaki","followers_url":"https://api.github.com/users/ehanjaki/followers","following_url":"https://api.github.com/users/ehanjaki/following{/other_user}","gists_url":"https://api.github.com/users/ehanjaki/gists{/gist_id}","starred_url":"https://api.github.com/users/ehanjaki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ehanjaki/subscriptions","organizations_url":"https://api.github.com/users/ehanjaki/orgs","repos_url":"https://api.github.com/users/ehanjaki/repos","events_url":"https://api.github.com/users/ehanjaki/events{/privacy}","received_events_url":"https://api.github.com/users/ehanjaki/received_events","type":"User","site_admin":false},"repo":{"id":102337583,"name":"Puzzle","full_name":"ehanjaki/Puzzle","owner":{"login":"ehanjaki","id":31611927,"avatar_url":"https://avatars2.githubusercontent.com/u/31611927?v=4","gravatar_id":"","url":"https://api.github.com/users/ehanjaki","html_url":"https://github.com/ehanjaki","followers_url":"https://api.github.com/users/ehanjaki/followers","following_url":"https://api.github.com/users/ehanjaki/following{/other_user}","gists_url":"https://api.github.com/users/ehanjaki/gists{/gist_id}","starred_url":"https://api.github.com/users/ehanjaki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ehanjaki/subscriptions","organizations_url":"https://api.github.com/users/ehanjaki/orgs","repos_url":"https://api.github.com/users/ehanjaki/repos","events_url":"https://api.github.com/users/ehanjaki/events{/privacy}","received_events_url":"https://api.github.com/users/ehanjaki/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ehanjaki/Puzzle","description":null,"fork":false,"url":"https://api.github.com/repos/ehanjaki/Puzzle","forks_url":"https://api.github.com/repos/ehanjaki/Puzzle/forks","keys_url":"https://api.github.com/repos/ehanjaki/Puzzle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ehanjaki/Puzzle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ehanjaki/Puzzle/teams","hooks_url":"https://api.github.com/repos/ehanjaki/Puzzle/hooks","issue_events_url":"https://api.github.com/repos/ehanjaki/Puzzle/issues/events{/number}","events_url":"https://api.github.com/repos/ehanjaki/Puzzle/events","assignees_url":"https://api.github.com/repos/ehanjaki/Puzzle/assignees{/user}","branches_url":"https://api.github.com/repos/ehanjaki/Puzzle/branches{/branch}","tags_url":"https://api.github.com/repos/ehanjaki/Puzzle/tags","blobs_url":"https://api.github.com/repos/ehanjaki/Puzzle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ehanjaki/Puzzle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ehanjaki/Puzzle/git/refs{/sha}","trees_url":"https://api.github.com/repos/ehanjaki/Puzzle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ehanjaki/Puzzle/statuses/{sha}","languages_url":"https://api.github.com/repos/ehanjaki/Puzzle/languages","stargazers_url":"https://api.github.com/repos/ehanjaki/Puzzle/stargazers","contributors_url":"https://api.github.com/repos/ehanjaki/Puzzle/contributors","subscribers_url":"https://api.github.com/repos/ehanjaki/Puzzle/subscribers","subscription_url":"https://api.github.com/repos/ehanjaki/Puzzle/subscription","commits_url":"https://api.github.com/repos/ehanjaki/Puzzle/commits{/sha}","git_commits_url":"https://api.github.com/repos/ehanjaki/Puzzle/git/commits{/sha}","comments_url":"https://api.github.com/repos/ehanjaki/Puzzle/comments{/number}","issue_comment_url":"https://api.github.com/repos/ehanjaki/Puzzle/issues/comments{/number}","contents_url":"https://api.github.com/repos/ehanjaki/Puzzle/contents/{+path}","compare_url":"https://api.github.com/repos/ehanjaki/Puzzle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ehanjaki/Puzzle/merges","archive_url":"https://api.github.com/repos/ehanjaki/Puzzle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ehanjaki/Puzzle/downloads","issues_url":"https://api.github.com/repos/ehanjaki/Puzzle/issues{/number}","pulls_url":"https://api.github.com/repos/ehanjaki/Puzzle/pulls{/number}","milestones_url":"https://api.github.com/repos/ehanjaki/Puzzle/milestones{/number}","notifications_url":"https://api.github.com/repos/ehanjaki/Puzzle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ehanjaki/Puzzle/labels{/name}","releases_url":"https://api.github.com/repos/ehanjaki/Puzzle/releases{/id}","deployments_url":"https://api.github.com/repos/ehanjaki/Puzzle/deployments","created_at":"2017-09-04T08:29:01Z","updated_at":"2017-09-04T11:09:03Z","pushed_at":"2017-09-28T09:53:20Z","git_url":"git://github.com/ehanjaki/Puzzle.git","ssh_url":"git@github.com:ehanjaki/Puzzle.git","clone_url":"https://github.com/ehanjaki/Puzzle.git","svn_url":"https://github.com/ehanjaki/Puzzle","homepage":null,"size":162,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"ehanjaki:master","ref":"master","sha":"4a2989a6b4dc868c4d8f195d62178a23cad2fc09","user":{"login":"ehanjaki","id":31611927,"avatar_url":"https://avatars2.githubusercontent.com/u/31611927?v=4","gravatar_id":"","url":"https://api.github.com/users/ehanjaki","html_url":"https://github.com/ehanjaki","followers_url":"https://api.github.com/users/ehanjaki/followers","following_url":"https://api.github.com/users/ehanjaki/following{/other_user}","gists_url":"https://api.github.com/users/ehanjaki/gists{/gist_id}","starred_url":"https://api.github.com/users/ehanjaki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ehanjaki/subscriptions","organizations_url":"https://api.github.com/users/ehanjaki/orgs","repos_url":"https://api.github.com/users/ehanjaki/repos","events_url":"https://api.github.com/users/ehanjaki/events{/privacy}","received_events_url":"https://api.github.com/users/ehanjaki/received_events","type":"User","site_admin":false},"repo":{"id":102337583,"name":"Puzzle","full_name":"ehanjaki/Puzzle","owner":{"login":"ehanjaki","id":31611927,"avatar_url":"https://avatars2.githubusercontent.com/u/31611927?v=4","gravatar_id":"","url":"https://api.github.com/users/ehanjaki","html_url":"https://github.com/ehanjaki","followers_url":"https://api.github.com/users/ehanjaki/followers","following_url":"https://api.github.com/users/ehanjaki/following{/other_user}","gists_url":"https://api.github.com/users/ehanjaki/gists{/gist_id}","starred_url":"https://api.github.com/users/ehanjaki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ehanjaki/subscriptions","organizations_url":"https://api.github.com/users/ehanjaki/orgs","repos_url":"https://api.github.com/users/ehanjaki/repos","events_url":"https://api.github.com/users/ehanjaki/events{/privacy}","received_events_url":"https://api.github.com/users/ehanjaki/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ehanjaki/Puzzle","description":null,"fork":false,"url":"https://api.github.com/repos/ehanjaki/Puzzle","forks_url":"https://api.github.com/repos/ehanjaki/Puzzle/forks","keys_url":"https://api.github.com/repos/ehanjaki/Puzzle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ehanjaki/Puzzle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ehanjaki/Puzzle/teams","hooks_url":"https://api.github.com/repos/ehanjaki/Puzzle/hooks","issue_events_url":"https://api.github.com/repos/ehanjaki/Puzzle/issues/events{/number}","events_url":"https://api.github.com/repos/ehanjaki/Puzzle/events","assignees_url":"https://api.github.com/repos/ehanjaki/Puzzle/assignees{/user}","branches_url":"https://api.github.com/repos/ehanjaki/Puzzle/branches{/branch}","tags_url":"https://api.github.com/repos/ehanjaki/Puzzle/tags","blobs_url":"https://api.github.com/repos/ehanjaki/Puzzle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ehanjaki/Puzzle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ehanjaki/Puzzle/git/refs{/sha}","trees_url":"https://api.github.com/repos/ehanjaki/Puzzle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ehanjaki/Puzzle/statuses/{sha}","languages_url":"https://api.github.com/repos/ehanjaki/Puzzle/languages","stargazers_url":"https://api.github.com/repos/ehanjaki/Puzzle/stargazers","contributors_url":"https://api.github.com/repos/ehanjaki/Puzzle/contributors","subscribers_url":"https://api.github.com/repos/ehanjaki/Puzzle/subscribers","subscription_url":"https://api.github.com/repos/ehanjaki/Puzzle/subscription","commits_url":"https://api.github.com/repos/ehanjaki/Puzzle/commits{/sha}","git_commits_url":"https://api.github.com/repos/ehanjaki/Puzzle/git/commits{/sha}","comments_url":"https://api.github.com/repos/ehanjaki/Puzzle/comments{/number}","issue_comment_url":"https://api.github.com/repos/ehanjaki/Puzzle/issues/comments{/number}","contents_url":"https://api.github.com/repos/ehanjaki/Puzzle/contents/{+path}","compare_url":"https://api.github.com/repos/ehanjaki/Puzzle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ehanjaki/Puzzle/merges","archive_url":"https://api.github.com/repos/ehanjaki/Puzzle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ehanjaki/Puzzle/downloads","issues_url":"https://api.github.com/repos/ehanjaki/Puzzle/issues{/number}","pulls_url":"https://api.github.com/repos/ehanjaki/Puzzle/pulls{/number}","milestones_url":"https://api.github.com/repos/ehanjaki/Puzzle/milestones{/number}","notifications_url":"https://api.github.com/repos/ehanjaki/Puzzle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ehanjaki/Puzzle/labels{/name}","releases_url":"https://api.github.com/repos/ehanjaki/Puzzle/releases{/id}","deployments_url":"https://api.github.com/repos/ehanjaki/Puzzle/deployments","created_at":"2017-09-04T08:29:01Z","updated_at":"2017-09-04T11:09:03Z","pushed_at":"2017-09-28T09:53:20Z","git_url":"git://github.com/ehanjaki/Puzzle.git","ssh_url":"git@github.com:ehanjaki/Puzzle.git","clone_url":"https://github.com/ehanjaki/Puzzle.git","svn_url":"https://github.com/ehanjaki/Puzzle","homepage":null,"size":162,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ehanjaki/Puzzle/pulls/3"},"html":{"href":"https://github.com/ehanjaki/Puzzle/pull/3"},"issue":{"href":"https://api.github.com/repos/ehanjaki/Puzzle/issues/3"},"comments":{"href":"https://api.github.com/repos/ehanjaki/Puzzle/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/ehanjaki/Puzzle/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/ehanjaki/Puzzle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ehanjaki/Puzzle/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/ehanjaki/Puzzle/statuses/37a2c058fa755596a2c1db3e47f7a7f6f031bf88"}},"author_association":"OWNER"}}
{"actor":{"display_login":"AnsGit"}}