GitHub PullRequestReviewCommentEvent at 2014-07-21 20:51:42
Repository: kuma
Actor: darkwing
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/mozilla/kuma/pulls/comments/15195443","id":15195443,"diff_hunk":"@@ -0,0 +1,83 @@\n+// get state from cookie (or default) and apply it\n+function initState() {\n+    // state is 1 (on) if disable_native_spell == false; our default setting\n+    var state = 1;\n+\n+    // we'll set this cookie anytime we set the native spellcheck setting\n+    var saved_state = document.cookie.replace(/(?:(?:^|.*;\\s*)disable_native_spell\\s*\\=\\s*([^;]*).*$)|^.*$/, \"$1\");\n+\n+    // state is 2 (off) if disable_native_spell == true\n+    if (typeof(saved_state) != undefined && saved_state == 'true') state = 2;\n+\n+    // it appears the instance isn't ready at this point, so listen\n+    CKEDITOR.on('instanceReady', function() {\n+        applyState(state);\n+    });\n+\n+    return state;\n+}\n+\n+// sometimes we need the opposite state\n+function reverseState(state) {\n+    if (state == 1) return 2;\n+    return 1;\n+}\n+\n+// sometimes we need to translate state into setting value\n+function stateToSetting(state) {\n+    if (state == 2) return true;\n+    return false;\n+}\n+\n+// apply a new_state: 1 (native spell checking on) or 2 (off)\n+function applyState(new_state) {\n+    var editor = CKEDITOR.instances.id_content;\n+\n+    // if we enable native spellchecker, disable other spell checkers\n+    var excludes = ['checkspell', 'scaytcheck'];\n+    for (var i=0; i<excludes.length; i++) {\n+        var command = editor.getCommand(excludes[i]);\n+        if (new_state == CKEDITOR.TRISTATE_ON) {\n+            command.disable();\n+        }\n+        else if (new_state == CKEDITOR.TRISTATE_OFF) {\n+            command.enable();\n+        }\n+    }\n+\n+    // if ckeditor's setting is false, then browser spellcheck is true. and vice versa.\n+    editor.document.getBody().setAttribute('spellcheck', !stateToSetting(new_state));\n+\n+    // TODO: enable right-click context menu for native spellchecker\n+\n+    // save ckeditor's setting value in a cookie\n+    document.cookie = 'disable_native_spell='+stateToSetting(new_state)+';expires=Fri, 31 Dec 9999 23:59:59 GMT';\n+}\n+\n+CKEDITOR.plugins.add('mdn-spell', {\n+\n+    init: function(editor) {\n+        var lang = editor.lang;\n+        editor.addCommand('mdn-spell', {\n+            exec: function() {\n+                var button = this;\n+\n+                // we want to apply the reverse of button.state, since it's a toggle\n+                applyState(reverseState(button.state));\n+                // and change the UI\n+                button.toggleState();\n+            },\n+            state: initState(),\n+            canUndo: false\n+        });\n+\n+        editor.ui.addButton('mdn-spell',\n+        {\n+            //label: 'Use browser\\'s default spell check',","path":"media/js/libs/ckeditor/plugins/mdn-spell/plugin.js","position":76,"original_position":76,"commit_id":"4bf424deb402f7f36cf5ae2fb61181745a141274","original_commit_id":"4bf424deb402f7f36cf5ae2fb61181745a141274","user":{"login":"darkwing","id":46655,"avatar_url":"https://avatars.githubusercontent.com/u/46655?","gravatar_id":"e15d8725aa42ce94ff509dd9136284d8","url":"https://api.github.com/users/darkwing","html_url":"https://github.com/darkwing","followers_url":"https://api.github.com/users/darkwing/followers","following_url":"https://api.github.com/users/darkwing/following{/other_user}","gists_url":"https://api.github.com/users/darkwing/gists{/gist_id}","starred_url":"https://api.github.com/users/darkwing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darkwing/subscriptions","organizations_url":"https://api.github.com/users/darkwing/orgs","repos_url":"https://api.github.com/users/darkwing/repos","events_url":"https://api.github.com/users/darkwing/events{/privacy}","received_events_url":"https://api.github.com/users/darkwing/received_events","type":"User","site_admin":false},"body":"We can axe this before merge","created_at":"2014-07-21T20:51:42Z","updated_at":"2014-07-21T20:51:42Z","html_url":"https://github.com/mozilla/kuma/pull/2575#discussion_r15195443","pull_request_url":"https://api.github.com/repos/mozilla/kuma/pulls/2575","_links":{"self":{"href":"https://api.github.com/repos/mozilla/kuma/pulls/comments/15195443"},"html":{"href":"https://github.com/mozilla/kuma/pull/2575#discussion_r15195443"},"pull_request":{"href":"https://api.github.com/repos/mozilla/kuma/pulls/2575"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla/kuma/pulls/2575","id":18677494,"html_url":"https://github.com/mozilla/kuma/pull/2575","diff_url":"https://github.com/mozilla/kuma/pull/2575.diff","patch_url":"https://github.com/mozilla/kuma/pull/2575.patch","issue_url":"https://api.github.com/repos/mozilla/kuma/issues/2575","number":2575,"state":"open","title":"[Bug 1032056] Add plugin for native spell checker","user":{"login":"hoosteeno","id":94519,"avatar_url":"https://avatars.githubusercontent.com/u/94519?","gravatar_id":"e2ade0b79ce3562c447b94539e3045be","url":"https://api.github.com/users/hoosteeno","html_url":"https://github.com/hoosteeno","followers_url":"https://api.github.com/users/hoosteeno/followers","following_url":"https://api.github.com/users/hoosteeno/following{/other_user}","gists_url":"https://api.github.com/users/hoosteeno/gists{/gist_id}","starred_url":"https://api.github.com/users/hoosteeno/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hoosteeno/subscriptions","organizations_url":"https://api.github.com/users/hoosteeno/orgs","repos_url":"https://api.github.com/users/hoosteeno/repos","events_url":"https://api.github.com/users/hoosteeno/events{/privacy}","received_events_url":"https://api.github.com/users/hoosteeno/received_events","type":"User","site_admin":false},"body":"Here's a first try at a CKEDITOR plugin for enabling the native spellchecker. Features...\r\n* native spellchecker is on by default\r\n* state of spellchecker preference is saved in a cookie\r\n* other spellcheckers are disabled if native spellchecker is on\r\n\r\n","created_at":"2014-07-21T20:24:39Z","updated_at":"2014-07-21T20:51:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"33e86a828f6bbe188e081bec6dc26ab7d345dfdb","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mozilla/kuma/pulls/2575/commits","review_comments_url":"https://api.github.com/repos/mozilla/kuma/pulls/2575/comments","review_comment_url":"https://api.github.com/repos/mozilla/kuma/pulls/comments/{number}","comments_url":"https://api.github.com/repos/mozilla/kuma/issues/2575/comments","statuses_url":"https://api.github.com/repos/mozilla/kuma/statuses/4bf424deb402f7f36cf5ae2fb61181745a141274","head":{"label":"hoosteeno:1032056","ref":"1032056","sha":"4bf424deb402f7f36cf5ae2fb61181745a141274","user":{"login":"hoosteeno","id":94519,"avatar_url":"https://avatars.githubusercontent.com/u/94519?","gravatar_id":"e2ade0b79ce3562c447b94539e3045be","url":"https://api.github.com/users/hoosteeno","html_url":"https://github.com/hoosteeno","followers_url":"https://api.github.com/users/hoosteeno/followers","following_url":"https://api.github.com/users/hoosteeno/following{/other_user}","gists_url":"https://api.github.com/users/hoosteeno/gists{/gist_id}","starred_url":"https://api.github.com/users/hoosteeno/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hoosteeno/subscriptions","organizations_url":"https://api.github.com/users/hoosteeno/orgs","repos_url":"https://api.github.com/users/hoosteeno/repos","events_url":"https://api.github.com/users/hoosteeno/events{/privacy}","received_events_url":"https://api.github.com/users/hoosteeno/received_events","type":"User","site_admin":false},"repo":{"id":19325694,"name":"kuma","full_name":"hoosteeno/kuma","owner":{"login":"hoosteeno","id":94519,"avatar_url":"https://avatars.githubusercontent.com/u/94519?","gravatar_id":"e2ade0b79ce3562c447b94539e3045be","url":"https://api.github.com/users/hoosteeno","html_url":"https://github.com/hoosteeno","followers_url":"https://api.github.com/users/hoosteeno/followers","following_url":"https://api.github.com/users/hoosteeno/following{/other_user}","gists_url":"https://api.github.com/users/hoosteeno/gists{/gist_id}","starred_url":"https://api.github.com/users/hoosteeno/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hoosteeno/subscriptions","organizations_url":"https://api.github.com/users/hoosteeno/orgs","repos_url":"https://api.github.com/users/hoosteeno/repos","events_url":"https://api.github.com/users/hoosteeno/events{/privacy}","received_events_url":"https://api.github.com/users/hoosteeno/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hoosteeno/kuma","description":"The Django project that powers MDN.","fork":true,"url":"https://api.github.com/repos/hoosteeno/kuma","forks_url":"https://api.github.com/repos/hoosteeno/kuma/forks","keys_url":"https://api.github.com/repos/hoosteeno/kuma/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hoosteeno/kuma/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hoosteeno/kuma/teams","hooks_url":"https://api.github.com/repos/hoosteeno/kuma/hooks","issue_events_url":"https://api.github.com/repos/hoosteeno/kuma/issues/events{/number}","events_url":"https://api.github.com/repos/hoosteeno/kuma/events","assignees_url":"https://api.github.com/repos/hoosteeno/kuma/assignees{/user}","branches_url":"https://api.github.com/repos/hoosteeno/kuma/branches{/branch}","tags_url":"https://api.github.com/repos/hoosteeno/kuma/tags","blobs_url":"https://api.github.com/repos/hoosteeno/kuma/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hoosteeno/kuma/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hoosteeno/kuma/git/refs{/sha}","trees_url":"https://api.github.com/repos/hoosteeno/kuma/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hoosteeno/kuma/statuses/{sha}","languages_url":"https://api.github.com/repos/hoosteeno/kuma/languages","stargazers_url":"https://api.github.com/repos/hoosteeno/kuma/stargazers","contributors_url":"https://api.github.com/repos/hoosteeno/kuma/contributors","subscribers_url":"https://api.github.com/repos/hoosteeno/kuma/subscribers","subscription_url":"https://api.github.com/repos/hoosteeno/kuma/subscription","commits_url":"https://api.github.com/repos/hoosteeno/kuma/commits{/sha}","git_commits_url":"https://api.github.com/repos/hoosteeno/kuma/git/commits{/sha}","comments_url":"https://api.github.com/repos/hoosteeno/kuma/comments{/number}","issue_comment_url":"https://api.github.com/repos/hoosteeno/kuma/issues/comments/{number}","contents_url":"https://api.github.com/repos/hoosteeno/kuma/contents/{+path}","compare_url":"https://api.github.com/repos/hoosteeno/kuma/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hoosteeno/kuma/merges","archive_url":"https://api.github.com/repos/hoosteeno/kuma/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hoosteeno/kuma/downloads","issues_url":"https://api.github.com/repos/hoosteeno/kuma/issues{/number}","pulls_url":"https://api.github.com/repos/hoosteeno/kuma/pulls{/number}","milestones_url":"https://api.github.com/repos/hoosteeno/kuma/milestones{/number}","notifications_url":"https://api.github.com/repos/hoosteeno/kuma/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hoosteeno/kuma/labels{/name}","releases_url":"https://api.github.com/repos/hoosteeno/kuma/releases{/id}","created_at":"2014-04-30T20:06:31Z","updated_at":"2014-07-01T15:18:20Z","pushed_at":"2014-07-21T20:20:40Z","git_url":"git://github.com/hoosteeno/kuma.git","ssh_url":"git@github.com:hoosteeno/kuma.git","clone_url":"https://github.com/hoosteeno/kuma.git","svn_url":"https://github.com/hoosteeno/kuma","homepage":"https://developer.mozilla.org","size":34456,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mozilla:master","ref":"master","sha":"d4ff8b40f2e8ca8bb1eff729934640fdb3985ae3","user":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?","gravatar_id":"9ba739c8f3288e256b13553e4d257b5e","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"repo":{"id":1352520,"name":"kuma","full_name":"mozilla/kuma","owner":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?","gravatar_id":"9ba739c8f3288e256b13553e4d257b5e","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla/kuma","description":"The Django project that powers MDN.","fork":false,"url":"https://api.github.com/repos/mozilla/kuma","forks_url":"https://api.github.com/repos/mozilla/kuma/forks","keys_url":"https://api.github.com/repos/mozilla/kuma/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/kuma/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/kuma/teams","hooks_url":"https://api.github.com/repos/mozilla/kuma/hooks","issue_events_url":"https://api.github.com/repos/mozilla/kuma/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/kuma/events","assignees_url":"https://api.github.com/repos/mozilla/kuma/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/kuma/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/kuma/tags","blobs_url":"https://api.github.com/repos/mozilla/kuma/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/kuma/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/kuma/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/kuma/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/kuma/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/kuma/languages","stargazers_url":"https://api.github.com/repos/mozilla/kuma/stargazers","contributors_url":"https://api.github.com/repos/mozilla/kuma/contributors","subscribers_url":"https://api.github.com/repos/mozilla/kuma/subscribers","subscription_url":"https://api.github.com/repos/mozilla/kuma/subscription","commits_url":"https://api.github.com/repos/mozilla/kuma/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/kuma/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/kuma/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/kuma/issues/comments/{number}","contents_url":"https://api.github.com/repos/mozilla/kuma/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/kuma/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/kuma/merges","archive_url":"https://api.github.com/repos/mozilla/kuma/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/kuma/downloads","issues_url":"https://api.github.com/repos/mozilla/kuma/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/kuma/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/kuma/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/kuma/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/kuma/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/kuma/releases{/id}","created_at":"2011-02-10T21:48:06Z","updated_at":"2014-07-20T11:18:27Z","pushed_at":"2014-07-21T20:49:56Z","git_url":"git://github.com/mozilla/kuma.git","ssh_url":"git@github.com:mozilla/kuma.git","clone_url":"https://github.com/mozilla/kuma.git","svn_url":"https://github.com/mozilla/kuma","homepage":"https://developer.mozilla.org","size":58236,"stargazers_count":456,"watchers_count":456,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"forks_count":264,"mirror_url":null,"open_issues_count":69,"forks":264,"open_issues":69,"watchers":456,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/kuma/pulls/2575"},"html":{"href":"https://github.com/mozilla/kuma/pull/2575"},"issue":{"href":"https://api.github.com/repos/mozilla/kuma/issues/2575"},"comments":{"href":"https://api.github.com/repos/mozilla/kuma/issues/2575/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/kuma/pulls/2575/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/kuma/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/mozilla/kuma/pulls/2575/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/kuma/statuses/4bf424deb402f7f36cf5ae2fb61181745a141274"}}}}