{"action":"created","comment":{"url":"https://api.github.com/repos/codex-team/codex.editor/pulls/comments/65808006","id":65808006,"diff_hunk":"@@ -297,9 +301,50 @@ cEditor.callback = {\n \n         cEditor.content.workingNodeChanged();\n \n+        /* Closing toolbar */\n         cEditor.toolbar.close();\n         cEditor.toolbar.move();\n \n+        /* Changing focused block to Previous or Next Node */\n+        var selection = window.getSelection(),\n+            focusedElement = selection.anchorNode.parentNode;\n+\n+        // console.log('focused %o', focusedElement);\n+\n+        if (event.keyCode == cEditor.core.keys.DOWN) {\n+\n+            while ( focusedElement.nextSibling == null ) {\n+                focusedElement = focusedElement.parentNode;\n+            }\n+\n+            // console.log('nextNode: %o', focusedElement.nextSibling);\n+\n+            if ( selection.focusNode.length == selection.anchorOffset ) {\n+\n+                cEditor.content.caretOffset      = 0;\n+                cEditor.content.focusedNodeIndex = 0;\n+\n+                cEditor.content.setCaret(focusedElement.nextSibling);\n+            }\n+        }\n+        else if (event.keyCode == cEditor.core.keys.UP) {\n+\n+            while ( focusedElement.previousSibling == null ) {\n+                focusedElement = focusedElement.parentNode;\n+            }\n+\n+            // console.log('nextNode: %o', focusedElement.previousSibling);\n+\n+            if ( selection.anchorOffset == 0 ) {\n+\n+                cEditor.content.caretOffset      = 0;\n+                cEditor.content.focusedNodeIndex = 0;\n+","path":"codex-editor.js","position":76,"original_position":68,"commit_id":"6134914cc72f69a4390881bb5fcd9c725056bebb","original_commit_id":"6134914cc72f69a4390881bb5fcd9c725056bebb","user":{"login":"illiiiillllilii","id":15259299,"avatar_url":"https://avatars.githubusercontent.com/u/15259299?v=3","gravatar_id":"","url":"https://api.github.com/users/illiiiillllilii","html_url":"https://github.com/illiiiillllilii","followers_url":"https://api.github.com/users/illiiiillllilii/followers","following_url":"https://api.github.com/users/illiiiillllilii/following{/other_user}","gists_url":"https://api.github.com/users/illiiiillllilii/gists{/gist_id}","starred_url":"https://api.github.com/users/illiiiillllilii/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/illiiiillllilii/subscriptions","organizations_url":"https://api.github.com/users/illiiiillllilii/orgs","repos_url":"https://api.github.com/users/illiiiillllilii/repos","events_url":"https://api.github.com/users/illiiiillllilii/events{/privacy}","received_events_url":"https://api.github.com/users/illiiiillllilii/received_events","type":"User","site_admin":false},"body":"Пожалуй. Это будет логичнее, чем кидать в самое начало блока","created_at":"2016-06-04T21:39:25Z","updated_at":"2016-06-04T21:39:25Z","html_url":"https://github.com/codex-team/codex.editor/pull/32#discussion_r65808006","pull_request_url":"https://api.github.com/repos/codex-team/codex.editor/pulls/32","_links":{"self":{"href":"https://api.github.com/repos/codex-team/codex.editor/pulls/comments/65808006"},"html":{"href":"https://github.com/codex-team/codex.editor/pull/32#discussion_r65808006"},"pull_request":{"href":"https://api.github.com/repos/codex-team/codex.editor/pulls/32"}}},"pull_request":{"url":"https://api.github.com/repos/codex-team/codex.editor/pulls/32","id":72612940,"html_url":"https://github.com/codex-team/codex.editor/pull/32","diff_url":"https://github.com/codex-team/codex.editor/pull/32.diff","patch_url":"https://github.com/codex-team/codex.editor/pull/32.patch","issue_url":"https://api.github.com/repos/codex-team/codex.editor/issues/32","number":32,"state":"open","locked":false,"title":"Переход курсора на следующий и предыдущий блоки при нажатии на кнопки вверх/вниз","user":{"login":"khaydarov","id":6507765,"avatar_url":"https://avatars.githubusercontent.com/u/6507765?v=3","gravatar_id":"","url":"https://api.github.com/users/khaydarov","html_url":"https://github.com/khaydarov","followers_url":"https://api.github.com/users/khaydarov/followers","following_url":"https://api.github.com/users/khaydarov/following{/other_user}","gists_url":"https://api.github.com/users/khaydarov/gists{/gist_id}","starred_url":"https://api.github.com/users/khaydarov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/khaydarov/subscriptions","organizations_url":"https://api.github.com/users/khaydarov/orgs","repos_url":"https://api.github.com/users/khaydarov/repos","events_url":"https://api.github.com/users/khaydarov/events{/privacy}","received_events_url":"https://api.github.com/users/khaydarov/received_events","type":"User","site_admin":false},"body":" - [ ] @n0str \r\n\r\n- [ ] @neSpecc \r\n\r\n- [ ] @illiiiillllilii \r\n","created_at":"2016-06-04T21:00:58Z","updated_at":"2016-06-04T21:39:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"323993492f6b8b062259898fa66f00a8c49ec06f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/codex-team/codex.editor/pulls/32/commits","review_comments_url":"https://api.github.com/repos/codex-team/codex.editor/pulls/32/comments","review_comment_url":"https://api.github.com/repos/codex-team/codex.editor/pulls/comments{/number}","comments_url":"https://api.github.com/repos/codex-team/codex.editor/issues/32/comments","statuses_url":"https://api.github.com/repos/codex-team/codex.editor/statuses/6134914cc72f69a4390881bb5fcd9c725056bebb","head":{"label":"codex-team:transition","ref":"transition","sha":"6134914cc72f69a4390881bb5fcd9c725056bebb","user":{"login":"codex-team","id":16060815,"avatar_url":"https://avatars.githubusercontent.com/u/16060815?v=3","gravatar_id":"","url":"https://api.github.com/users/codex-team","html_url":"https://github.com/codex-team","followers_url":"https://api.github.com/users/codex-team/followers","following_url":"https://api.github.com/users/codex-team/following{/other_user}","gists_url":"https://api.github.com/users/codex-team/gists{/gist_id}","starred_url":"https://api.github.com/users/codex-team/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codex-team/subscriptions","organizations_url":"https://api.github.com/users/codex-team/orgs","repos_url":"https://api.github.com/users/codex-team/repos","events_url":"https://api.github.com/users/codex-team/events{/privacy}","received_events_url":"https://api.github.com/users/codex-team/received_events","type":"Organization","site_admin":false},"repo":{"id":47039255,"name":"codex.editor","full_name":"codex-team/codex.editor","owner":{"login":"codex-team","id":16060815,"avatar_url":"https://avatars.githubusercontent.com/u/16060815?v=3","gravatar_id":"","url":"https://api.github.com/users/codex-team","html_url":"https://github.com/codex-team","followers_url":"https://api.github.com/users/codex-team/followers","following_url":"https://api.github.com/users/codex-team/following{/other_user}","gists_url":"https://api.github.com/users/codex-team/gists{/gist_id}","starred_url":"https://api.github.com/users/codex-team/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codex-team/subscriptions","organizations_url":"https://api.github.com/users/codex-team/orgs","repos_url":"https://api.github.com/users/codex-team/repos","events_url":"https://api.github.com/users/codex-team/events{/privacy}","received_events_url":"https://api.github.com/users/codex-team/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/codex-team/codex.editor","description":"CodeX Editor sources","fork":false,"url":"https://api.github.com/repos/codex-team/codex.editor","forks_url":"https://api.github.com/repos/codex-team/codex.editor/forks","keys_url":"https://api.github.com/repos/codex-team/codex.editor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/codex-team/codex.editor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/codex-team/codex.editor/teams","hooks_url":"https://api.github.com/repos/codex-team/codex.editor/hooks","issue_events_url":"https://api.github.com/repos/codex-team/codex.editor/issues/events{/number}","events_url":"https://api.github.com/repos/codex-team/codex.editor/events","assignees_url":"https://api.github.com/repos/codex-team/codex.editor/assignees{/user}","branches_url":"https://api.github.com/repos/codex-team/codex.editor/branches{/branch}","tags_url":"https://api.github.com/repos/codex-team/codex.editor/tags","blobs_url":"https://api.github.com/repos/codex-team/codex.editor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/codex-team/codex.editor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/codex-team/codex.editor/git/refs{/sha}","trees_url":"https://api.github.com/repos/codex-team/codex.editor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/codex-team/codex.editor/statuses/{sha}","languages_url":"https://api.github.com/repos/codex-team/codex.editor/languages","stargazers_url":"https://api.github.com/repos/codex-team/codex.editor/stargazers","contributors_url":"https://api.github.com/repos/codex-team/codex.editor/contributors","subscribers_url":"https://api.github.com/repos/codex-team/codex.editor/subscribers","subscription_url":"https://api.github.com/repos/codex-team/codex.editor/subscription","commits_url":"https://api.github.com/repos/codex-team/codex.editor/commits{/sha}","git_commits_url":"https://api.github.com/repos/codex-team/codex.editor/git/commits{/sha}","comments_url":"https://api.github.com/repos/codex-team/codex.editor/comments{/number}","issue_comment_url":"https://api.github.com/repos/codex-team/codex.editor/issues/comments{/number}","contents_url":"https://api.github.com/repos/codex-team/codex.editor/contents/{+path}","compare_url":"https://api.github.com/repos/codex-team/codex.editor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/codex-team/codex.editor/merges","archive_url":"https://api.github.com/repos/codex-team/codex.editor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/codex-team/codex.editor/downloads","issues_url":"https://api.github.com/repos/codex-team/codex.editor/issues{/number}","pulls_url":"https://api.github.com/repos/codex-team/codex.editor/pulls{/number}","milestones_url":"https://api.github.com/repos/codex-team/codex.editor/milestones{/number}","notifications_url":"https://api.github.com/repos/codex-team/codex.editor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/codex-team/codex.editor/labels{/name}","releases_url":"https://api.github.com/repos/codex-team/codex.editor/releases{/id}","deployments_url":"https://api.github.com/repos/codex-team/codex.editor/deployments","created_at":"2015-11-28T20:56:35Z","updated_at":"2016-01-27T15:58:50Z","pushed_at":"2016-06-04T21:00:58Z","git_url":"git://github.com/codex-team/codex.editor.git","ssh_url":"git@github.com:codex-team/codex.editor.git","clone_url":"https://github.com/codex-team/codex.editor.git","svn_url":"https://github.com/codex-team/codex.editor","homepage":null,"size":87,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":13,"forks":1,"open_issues":13,"watchers":1,"default_branch":"master"}},"base":{"label":"codex-team:master","ref":"master","sha":"9444cbd80ae464b4d635e73d61306490a39cfa98","user":{"login":"codex-team","id":16060815,"avatar_url":"https://avatars.githubusercontent.com/u/16060815?v=3","gravatar_id":"","url":"https://api.github.com/users/codex-team","html_url":"https://github.com/codex-team","followers_url":"https://api.github.com/users/codex-team/followers","following_url":"https://api.github.com/users/codex-team/following{/other_user}","gists_url":"https://api.github.com/users/codex-team/gists{/gist_id}","starred_url":"https://api.github.com/users/codex-team/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codex-team/subscriptions","organizations_url":"https://api.github.com/users/codex-team/orgs","repos_url":"https://api.github.com/users/codex-team/repos","events_url":"https://api.github.com/users/codex-team/events{/privacy}","received_events_url":"https://api.github.com/users/codex-team/received_events","type":"Organization","site_admin":false},"repo":{"id":47039255,"name":"codex.editor","full_name":"codex-team/codex.editor","owner":{"login":"codex-team","id":16060815,"avatar_url":"https://avatars.githubusercontent.com/u/16060815?v=3","gravatar_id":"","url":"https://api.github.com/users/codex-team","html_url":"https://github.com/codex-team","followers_url":"https://api.github.com/users/codex-team/followers","following_url":"https://api.github.com/users/codex-team/following{/other_user}","gists_url":"https://api.github.com/users/codex-team/gists{/gist_id}","starred_url":"https://api.github.com/users/codex-team/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codex-team/subscriptions","organizations_url":"https://api.github.com/users/codex-team/orgs","repos_url":"https://api.github.com/users/codex-team/repos","events_url":"https://api.github.com/users/codex-team/events{/privacy}","received_events_url":"https://api.github.com/users/codex-team/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/codex-team/codex.editor","description":"CodeX Editor sources","fork":false,"url":"https://api.github.com/repos/codex-team/codex.editor","forks_url":"https://api.github.com/repos/codex-team/codex.editor/forks","keys_url":"https://api.github.com/repos/codex-team/codex.editor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/codex-team/codex.editor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/codex-team/codex.editor/teams","hooks_url":"https://api.github.com/repos/codex-team/codex.editor/hooks","issue_events_url":"https://api.github.com/repos/codex-team/codex.editor/issues/events{/number}","events_url":"https://api.github.com/repos/codex-team/codex.editor/events","assignees_url":"https://api.github.com/repos/codex-team/codex.editor/assignees{/user}","branches_url":"https://api.github.com/repos/codex-team/codex.editor/branches{/branch}","tags_url":"https://api.github.com/repos/codex-team/codex.editor/tags","blobs_url":"https://api.github.com/repos/codex-team/codex.editor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/codex-team/codex.editor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/codex-team/codex.editor/git/refs{/sha}","trees_url":"https://api.github.com/repos/codex-team/codex.editor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/codex-team/codex.editor/statuses/{sha}","languages_url":"https://api.github.com/repos/codex-team/codex.editor/languages","stargazers_url":"https://api.github.com/repos/codex-team/codex.editor/stargazers","contributors_url":"https://api.github.com/repos/codex-team/codex.editor/contributors","subscribers_url":"https://api.github.com/repos/codex-team/codex.editor/subscribers","subscription_url":"https://api.github.com/repos/codex-team/codex.editor/subscription","commits_url":"https://api.github.com/repos/codex-team/codex.editor/commits{/sha}","git_commits_url":"https://api.github.com/repos/codex-team/codex.editor/git/commits{/sha}","comments_url":"https://api.github.com/repos/codex-team/codex.editor/comments{/number}","issue_comment_url":"https://api.github.com/repos/codex-team/codex.editor/issues/comments{/number}","contents_url":"https://api.github.com/repos/codex-team/codex.editor/contents/{+path}","compare_url":"https://api.github.com/repos/codex-team/codex.editor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/codex-team/codex.editor/merges","archive_url":"https://api.github.com/repos/codex-team/codex.editor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/codex-team/codex.editor/downloads","issues_url":"https://api.github.com/repos/codex-team/codex.editor/issues{/number}","pulls_url":"https://api.github.com/repos/codex-team/codex.editor/pulls{/number}","milestones_url":"https://api.github.com/repos/codex-team/codex.editor/milestones{/number}","notifications_url":"https://api.github.com/repos/codex-team/codex.editor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/codex-team/codex.editor/labels{/name}","releases_url":"https://api.github.com/repos/codex-team/codex.editor/releases{/id}","deployments_url":"https://api.github.com/repos/codex-team/codex.editor/deployments","created_at":"2015-11-28T20:56:35Z","updated_at":"2016-01-27T15:58:50Z","pushed_at":"2016-06-04T21:00:58Z","git_url":"git://github.com/codex-team/codex.editor.git","ssh_url":"git@github.com:codex-team/codex.editor.git","clone_url":"https://github.com/codex-team/codex.editor.git","svn_url":"https://github.com/codex-team/codex.editor","homepage":null,"size":87,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":13,"forks":1,"open_issues":13,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/codex-team/codex.editor/pulls/32"},"html":{"href":"https://github.com/codex-team/codex.editor/pull/32"},"issue":{"href":"https://api.github.com/repos/codex-team/codex.editor/issues/32"},"comments":{"href":"https://api.github.com/repos/codex-team/codex.editor/issues/32/comments"},"review_comments":{"href":"https://api.github.com/repos/codex-team/codex.editor/pulls/32/comments"},"review_comment":{"href":"https://api.github.com/repos/codex-team/codex.editor/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/codex-team/codex.editor/pulls/32/commits"},"statuses":{"href":"https://api.github.com/repos/codex-team/codex.editor/statuses/6134914cc72f69a4390881bb5fcd9c725056bebb"}}}}
{"actor":{"display_login":"illiiiillllilii"}}