{"action":"created","comment":{"url":"https://api.github.com/repos/Kapiton42/hh-js-homework/pulls/comments/60895154","id":60895154,"diff_hunk":"@@ -0,0 +1,140 @@\n+\"use strict\";\n+\n+\n+\n+(function (){\n+    function getDomElementPosition (parent, element) {\n+        var Elements = parent.children;\n+        for (var i = 0; i < Elements.length; i++) {\n+            if (Elements[i] == element) {\n+                return i;\n+            }\n+        }\n+        return -1\n+    }\n+    \n+    function rebuildItemsList(listItems) {\n+        list.innerHTML = \"\";\n+        console.log(listItems);\n+        if(listItems != undefined)\n+            for (var i = 0; i < listItems.length; i++) {\n+                var newNode = document.createElement(\"li\");\n+                newNode.setAttribute(\"draggable\",true);\n+                newNode.setAttribute(\"data-element-id\", listItems[i].item.id );\n+                newNode.appendChild(document.createTextNode(listItems[i].item.text));\n+                list.appendChild(newNode);\n+            }\n+    }\n+\n+    function addItem(item) {\n+        console.log(item);\n+        var newNode = document.createElement(\"li\");\n+            newNode.setAttribute(\"draggable\", true);","path":"static/main.js","position":32,"original_position":32,"commit_id":"b6db3aeaf245731eb5e21eed058db1f46ff1c589","original_commit_id":"b6db3aeaf245731eb5e21eed058db1f46ff1c589","user":{"login":"Kapiton42","id":14073718,"avatar_url":"https://avatars.githubusercontent.com/u/14073718?v=3","gravatar_id":"","url":"https://api.github.com/users/Kapiton42","html_url":"https://github.com/Kapiton42","followers_url":"https://api.github.com/users/Kapiton42/followers","following_url":"https://api.github.com/users/Kapiton42/following{/other_user}","gists_url":"https://api.github.com/users/Kapiton42/gists{/gist_id}","starred_url":"https://api.github.com/users/Kapiton42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kapiton42/subscriptions","organizations_url":"https://api.github.com/users/Kapiton42/orgs","repos_url":"https://api.github.com/users/Kapiton42/repos","events_url":"https://api.github.com/users/Kapiton42/events{/privacy}","received_events_url":"https://api.github.com/users/Kapiton42/received_events","type":"User","site_admin":false},"body":"не совсем понял, что ты имеешь ввиду Создание элементов через document.createElement ?","created_at":"2016-04-25T10:52:35Z","updated_at":"2016-04-25T10:52:35Z","html_url":"https://github.com/Kapiton42/hh-js-homework/pull/1#discussion_r60895154","pull_request_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/Kapiton42/hh-js-homework/pulls/comments/60895154"},"html":{"href":"https://github.com/Kapiton42/hh-js-homework/pull/1#discussion_r60895154"},"pull_request":{"href":"https://api.github.com/repos/Kapiton42/hh-js-homework/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/Kapiton42/hh-js-homework/pulls/1","id":67690252,"html_url":"https://github.com/Kapiton42/hh-js-homework/pull/1","diff_url":"https://github.com/Kapiton42/hh-js-homework/pull/1.diff","patch_url":"https://github.com/Kapiton42/hh-js-homework/pull/1.patch","issue_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/issues/1","number":1,"state":"open","locked":false,"title":"first version","user":{"login":"Kapiton42","id":14073718,"avatar_url":"https://avatars.githubusercontent.com/u/14073718?v=3","gravatar_id":"","url":"https://api.github.com/users/Kapiton42","html_url":"https://github.com/Kapiton42","followers_url":"https://api.github.com/users/Kapiton42/followers","following_url":"https://api.github.com/users/Kapiton42/following{/other_user}","gists_url":"https://api.github.com/users/Kapiton42/gists{/gist_id}","starred_url":"https://api.github.com/users/Kapiton42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kapiton42/subscriptions","organizations_url":"https://api.github.com/users/Kapiton42/orgs","repos_url":"https://api.github.com/users/Kapiton42/repos","events_url":"https://api.github.com/users/Kapiton42/events{/privacy}","received_events_url":"https://api.github.com/users/Kapiton42/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-04-25T09:36:36Z","updated_at":"2016-04-25T10:52:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cdcb0d5a7260b5fe270163e6d64cdfa3d9e75184","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/pulls/1/commits","review_comments_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/pulls/1/comments","review_comment_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/issues/1/comments","statuses_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/statuses/b6db3aeaf245731eb5e21eed058db1f46ff1c589","head":{"label":"Kapiton42:dev","ref":"dev","sha":"b6db3aeaf245731eb5e21eed058db1f46ff1c589","user":{"login":"Kapiton42","id":14073718,"avatar_url":"https://avatars.githubusercontent.com/u/14073718?v=3","gravatar_id":"","url":"https://api.github.com/users/Kapiton42","html_url":"https://github.com/Kapiton42","followers_url":"https://api.github.com/users/Kapiton42/followers","following_url":"https://api.github.com/users/Kapiton42/following{/other_user}","gists_url":"https://api.github.com/users/Kapiton42/gists{/gist_id}","starred_url":"https://api.github.com/users/Kapiton42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kapiton42/subscriptions","organizations_url":"https://api.github.com/users/Kapiton42/orgs","repos_url":"https://api.github.com/users/Kapiton42/repos","events_url":"https://api.github.com/users/Kapiton42/events{/privacy}","received_events_url":"https://api.github.com/users/Kapiton42/received_events","type":"User","site_admin":false},"repo":{"id":57029705,"name":"hh-js-homework","full_name":"Kapiton42/hh-js-homework","owner":{"login":"Kapiton42","id":14073718,"avatar_url":"https://avatars.githubusercontent.com/u/14073718?v=3","gravatar_id":"","url":"https://api.github.com/users/Kapiton42","html_url":"https://github.com/Kapiton42","followers_url":"https://api.github.com/users/Kapiton42/followers","following_url":"https://api.github.com/users/Kapiton42/following{/other_user}","gists_url":"https://api.github.com/users/Kapiton42/gists{/gist_id}","starred_url":"https://api.github.com/users/Kapiton42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kapiton42/subscriptions","organizations_url":"https://api.github.com/users/Kapiton42/orgs","repos_url":"https://api.github.com/users/Kapiton42/repos","events_url":"https://api.github.com/users/Kapiton42/events{/privacy}","received_events_url":"https://api.github.com/users/Kapiton42/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Kapiton42/hh-js-homework","description":"","fork":false,"url":"https://api.github.com/repos/Kapiton42/hh-js-homework","forks_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/forks","keys_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/teams","hooks_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/hooks","issue_events_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/issues/events{/number}","events_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/events","assignees_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/assignees{/user}","branches_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/branches{/branch}","tags_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/tags","blobs_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/git/refs{/sha}","trees_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/statuses/{sha}","languages_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/languages","stargazers_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/stargazers","contributors_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/contributors","subscribers_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/subscribers","subscription_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/subscription","commits_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/commits{/sha}","git_commits_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/git/commits{/sha}","comments_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/comments{/number}","issue_comment_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/issues/comments{/number}","contents_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/contents/{+path}","compare_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/merges","archive_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/downloads","issues_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/issues{/number}","pulls_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/pulls{/number}","milestones_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/milestones{/number}","notifications_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/labels{/name}","releases_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/releases{/id}","deployments_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/deployments","created_at":"2016-04-25T09:34:27Z","updated_at":"2016-04-25T09:36:05Z","pushed_at":"2016-04-25T09:38:02Z","git_url":"git://github.com/Kapiton42/hh-js-homework.git","ssh_url":"git@github.com:Kapiton42/hh-js-homework.git","clone_url":"https://github.com/Kapiton42/hh-js-homework.git","svn_url":"https://github.com/Kapiton42/hh-js-homework","homepage":null,"size":3,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":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":"dev"}},"base":{"label":"Kapiton42:master","ref":"master","sha":"75e8ad00198038a8c2ab0a2016c6e4e312cf6b5c","user":{"login":"Kapiton42","id":14073718,"avatar_url":"https://avatars.githubusercontent.com/u/14073718?v=3","gravatar_id":"","url":"https://api.github.com/users/Kapiton42","html_url":"https://github.com/Kapiton42","followers_url":"https://api.github.com/users/Kapiton42/followers","following_url":"https://api.github.com/users/Kapiton42/following{/other_user}","gists_url":"https://api.github.com/users/Kapiton42/gists{/gist_id}","starred_url":"https://api.github.com/users/Kapiton42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kapiton42/subscriptions","organizations_url":"https://api.github.com/users/Kapiton42/orgs","repos_url":"https://api.github.com/users/Kapiton42/repos","events_url":"https://api.github.com/users/Kapiton42/events{/privacy}","received_events_url":"https://api.github.com/users/Kapiton42/received_events","type":"User","site_admin":false},"repo":{"id":57029705,"name":"hh-js-homework","full_name":"Kapiton42/hh-js-homework","owner":{"login":"Kapiton42","id":14073718,"avatar_url":"https://avatars.githubusercontent.com/u/14073718?v=3","gravatar_id":"","url":"https://api.github.com/users/Kapiton42","html_url":"https://github.com/Kapiton42","followers_url":"https://api.github.com/users/Kapiton42/followers","following_url":"https://api.github.com/users/Kapiton42/following{/other_user}","gists_url":"https://api.github.com/users/Kapiton42/gists{/gist_id}","starred_url":"https://api.github.com/users/Kapiton42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kapiton42/subscriptions","organizations_url":"https://api.github.com/users/Kapiton42/orgs","repos_url":"https://api.github.com/users/Kapiton42/repos","events_url":"https://api.github.com/users/Kapiton42/events{/privacy}","received_events_url":"https://api.github.com/users/Kapiton42/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Kapiton42/hh-js-homework","description":"","fork":false,"url":"https://api.github.com/repos/Kapiton42/hh-js-homework","forks_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/forks","keys_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/teams","hooks_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/hooks","issue_events_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/issues/events{/number}","events_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/events","assignees_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/assignees{/user}","branches_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/branches{/branch}","tags_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/tags","blobs_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/git/refs{/sha}","trees_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/statuses/{sha}","languages_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/languages","stargazers_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/stargazers","contributors_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/contributors","subscribers_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/subscribers","subscription_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/subscription","commits_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/commits{/sha}","git_commits_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/git/commits{/sha}","comments_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/comments{/number}","issue_comment_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/issues/comments{/number}","contents_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/contents/{+path}","compare_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/merges","archive_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/downloads","issues_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/issues{/number}","pulls_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/pulls{/number}","milestones_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/milestones{/number}","notifications_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/labels{/name}","releases_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/releases{/id}","deployments_url":"https://api.github.com/repos/Kapiton42/hh-js-homework/deployments","created_at":"2016-04-25T09:34:27Z","updated_at":"2016-04-25T09:36:05Z","pushed_at":"2016-04-25T09:38:02Z","git_url":"git://github.com/Kapiton42/hh-js-homework.git","ssh_url":"git@github.com:Kapiton42/hh-js-homework.git","clone_url":"https://github.com/Kapiton42/hh-js-homework.git","svn_url":"https://github.com/Kapiton42/hh-js-homework","homepage":null,"size":3,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":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":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/Kapiton42/hh-js-homework/pulls/1"},"html":{"href":"https://github.com/Kapiton42/hh-js-homework/pull/1"},"issue":{"href":"https://api.github.com/repos/Kapiton42/hh-js-homework/issues/1"},"comments":{"href":"https://api.github.com/repos/Kapiton42/hh-js-homework/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/Kapiton42/hh-js-homework/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/Kapiton42/hh-js-homework/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Kapiton42/hh-js-homework/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/Kapiton42/hh-js-homework/statuses/b6db3aeaf245731eb5e21eed058db1f46ff1c589"}}}}