{"action":"created","comment":{"url":"https://api.github.com/repos/mycolorway/simditor/pulls/comments/42578731","id":42578731,"diff_hunk":"@@ -0,0 +1,67 @@\n+\n+class FontScaleButton extends Button\n+\n+  name: 'fontScale'\n+\n+  icon: 'font'\n+\n+  disableTag: 'pre'\n+\n+  htmlTag: 'span'\n+\n+  _init: ->\n+    @menu = [{\n+      name: '150%'\n+      text: @_t('fontScaleXLarge')\n+      param: '5'\n+    }, {\n+      name: '125%'\n+      text: @_t('fontScaleLarge')\n+      param: '4'\n+    }, {\n+      name: '100%'\n+      text: @_t('fontScaleNormal')\n+      param: '3'\n+    }, {\n+      name: '75%'\n+      text: @_t('fontScaleSmall')\n+      param: '2'\n+    }, {\n+      name: '50%'\n+      text: @_t('fontScaleXSmall')\n+      param: '1'\n+    }]\n+    super()\n+\n+  _activeStatus: ->\n+    range = @editor.selection.range()\n+    @setActive $(range.startContainer).parents('span[style*=\"font-size\"]').length > 0\n+    @active\n+\n+  command: (param)->\n+    range = @editor.selection.range()\n+    return if range.collapsed\n+\n+    # Use span[style] instead of font[size]\n+    document.execCommand 'styleWithCSS', false, true\n+    document.execCommand 'fontSize', false, param\n+    document.execCommand 'styleWithCSS', false, false\n+\n+    sizeMap =","path":"src/buttons/fontScale.coffee","position":50,"original_position":50,"commit_id":"0061a39a161ac838f238d92e5b551b078e21599f","original_commit_id":"0061a39a161ac838f238d92e5b551b078e21599f","user":{"login":"farthinker","id":184323,"avatar_url":"https://avatars.githubusercontent.com/u/184323?v=3","gravatar_id":"","url":"https://api.github.com/users/farthinker","html_url":"https://github.com/farthinker","followers_url":"https://api.github.com/users/farthinker/followers","following_url":"https://api.github.com/users/farthinker/following{/other_user}","gists_url":"https://api.github.com/users/farthinker/gists{/gist_id}","starred_url":"https://api.github.com/users/farthinker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/farthinker/subscriptions","organizations_url":"https://api.github.com/users/farthinker/orgs","repos_url":"https://api.github.com/users/farthinker/repos","events_url":"https://api.github.com/users/farthinker/events{/privacy}","received_events_url":"https://api.github.com/users/farthinker/received_events","type":"User","site_admin":false},"body":"这个写成原型变量吧","created_at":"2015-10-21T02:47:02Z","updated_at":"2015-10-21T02:47:02Z","html_url":"https://github.com/mycolorway/simditor/pull/343#discussion_r42578731","pull_request_url":"https://api.github.com/repos/mycolorway/simditor/pulls/343","_links":{"self":{"href":"https://api.github.com/repos/mycolorway/simditor/pulls/comments/42578731"},"html":{"href":"https://github.com/mycolorway/simditor/pull/343#discussion_r42578731"},"pull_request":{"href":"https://api.github.com/repos/mycolorway/simditor/pulls/343"}}},"pull_request":{"url":"https://api.github.com/repos/mycolorway/simditor/pulls/343","id":48248115,"html_url":"https://github.com/mycolorway/simditor/pull/343","diff_url":"https://github.com/mycolorway/simditor/pull/343.diff","patch_url":"https://github.com/mycolorway/simditor/pull/343.patch","issue_url":"https://api.github.com/repos/mycolorway/simditor/issues/343","number":343,"state":"open","locked":false,"title":"ADD: fontScale button","user":{"login":"tinyfive","id":607967,"avatar_url":"https://avatars.githubusercontent.com/u/607967?v=3","gravatar_id":"","url":"https://api.github.com/users/tinyfive","html_url":"https://github.com/tinyfive","followers_url":"https://api.github.com/users/tinyfive/followers","following_url":"https://api.github.com/users/tinyfive/following{/other_user}","gists_url":"https://api.github.com/users/tinyfive/gists{/gist_id}","starred_url":"https://api.github.com/users/tinyfive/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tinyfive/subscriptions","organizations_url":"https://api.github.com/users/tinyfive/orgs","repos_url":"https://api.github.com/users/tinyfive/repos","events_url":"https://api.github.com/users/tinyfive/events{/privacy}","received_events_url":"https://api.github.com/users/tinyfive/received_events","type":"User","site_admin":false},"body":"ADD: fontScale button\r\nFIX: docs","created_at":"2015-10-20T19:44:43Z","updated_at":"2015-10-21T02:47:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7e1dca2ffa036c435c48e85580d8d34550d63d7b","assignee":{"login":"farthinker","id":184323,"avatar_url":"https://avatars.githubusercontent.com/u/184323?v=3","gravatar_id":"","url":"https://api.github.com/users/farthinker","html_url":"https://github.com/farthinker","followers_url":"https://api.github.com/users/farthinker/followers","following_url":"https://api.github.com/users/farthinker/following{/other_user}","gists_url":"https://api.github.com/users/farthinker/gists{/gist_id}","starred_url":"https://api.github.com/users/farthinker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/farthinker/subscriptions","organizations_url":"https://api.github.com/users/farthinker/orgs","repos_url":"https://api.github.com/users/farthinker/repos","events_url":"https://api.github.com/users/farthinker/events{/privacy}","received_events_url":"https://api.github.com/users/farthinker/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/mycolorway/simditor/pulls/343/commits","review_comments_url":"https://api.github.com/repos/mycolorway/simditor/pulls/343/comments","review_comment_url":"https://api.github.com/repos/mycolorway/simditor/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mycolorway/simditor/issues/343/comments","statuses_url":"https://api.github.com/repos/mycolorway/simditor/statuses/0061a39a161ac838f238d92e5b551b078e21599f","head":{"label":"mycolorway:tf-font-scale","ref":"tf-font-scale","sha":"0061a39a161ac838f238d92e5b551b078e21599f","user":{"login":"mycolorway","id":530175,"avatar_url":"https://avatars.githubusercontent.com/u/530175?v=3","gravatar_id":"","url":"https://api.github.com/users/mycolorway","html_url":"https://github.com/mycolorway","followers_url":"https://api.github.com/users/mycolorway/followers","following_url":"https://api.github.com/users/mycolorway/following{/other_user}","gists_url":"https://api.github.com/users/mycolorway/gists{/gist_id}","starred_url":"https://api.github.com/users/mycolorway/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mycolorway/subscriptions","organizations_url":"https://api.github.com/users/mycolorway/orgs","repos_url":"https://api.github.com/users/mycolorway/repos","events_url":"https://api.github.com/users/mycolorway/events{/privacy}","received_events_url":"https://api.github.com/users/mycolorway/received_events","type":"Organization","site_admin":false},"repo":{"id":15787723,"name":"simditor","full_name":"mycolorway/simditor","owner":{"login":"mycolorway","id":530175,"avatar_url":"https://avatars.githubusercontent.com/u/530175?v=3","gravatar_id":"","url":"https://api.github.com/users/mycolorway","html_url":"https://github.com/mycolorway","followers_url":"https://api.github.com/users/mycolorway/followers","following_url":"https://api.github.com/users/mycolorway/following{/other_user}","gists_url":"https://api.github.com/users/mycolorway/gists{/gist_id}","starred_url":"https://api.github.com/users/mycolorway/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mycolorway/subscriptions","organizations_url":"https://api.github.com/users/mycolorway/orgs","repos_url":"https://api.github.com/users/mycolorway/repos","events_url":"https://api.github.com/users/mycolorway/events{/privacy}","received_events_url":"https://api.github.com/users/mycolorway/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mycolorway/simditor","description":"An Easy and Fast WYSIWYG Editor","fork":false,"url":"https://api.github.com/repos/mycolorway/simditor","forks_url":"https://api.github.com/repos/mycolorway/simditor/forks","keys_url":"https://api.github.com/repos/mycolorway/simditor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mycolorway/simditor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mycolorway/simditor/teams","hooks_url":"https://api.github.com/repos/mycolorway/simditor/hooks","issue_events_url":"https://api.github.com/repos/mycolorway/simditor/issues/events{/number}","events_url":"https://api.github.com/repos/mycolorway/simditor/events","assignees_url":"https://api.github.com/repos/mycolorway/simditor/assignees{/user}","branches_url":"https://api.github.com/repos/mycolorway/simditor/branches{/branch}","tags_url":"https://api.github.com/repos/mycolorway/simditor/tags","blobs_url":"https://api.github.com/repos/mycolorway/simditor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mycolorway/simditor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mycolorway/simditor/git/refs{/sha}","trees_url":"https://api.github.com/repos/mycolorway/simditor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mycolorway/simditor/statuses/{sha}","languages_url":"https://api.github.com/repos/mycolorway/simditor/languages","stargazers_url":"https://api.github.com/repos/mycolorway/simditor/stargazers","contributors_url":"https://api.github.com/repos/mycolorway/simditor/contributors","subscribers_url":"https://api.github.com/repos/mycolorway/simditor/subscribers","subscription_url":"https://api.github.com/repos/mycolorway/simditor/subscription","commits_url":"https://api.github.com/repos/mycolorway/simditor/commits{/sha}","git_commits_url":"https://api.github.com/repos/mycolorway/simditor/git/commits{/sha}","comments_url":"https://api.github.com/repos/mycolorway/simditor/comments{/number}","issue_comment_url":"https://api.github.com/repos/mycolorway/simditor/issues/comments{/number}","contents_url":"https://api.github.com/repos/mycolorway/simditor/contents/{+path}","compare_url":"https://api.github.com/repos/mycolorway/simditor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mycolorway/simditor/merges","archive_url":"https://api.github.com/repos/mycolorway/simditor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mycolorway/simditor/downloads","issues_url":"https://api.github.com/repos/mycolorway/simditor/issues{/number}","pulls_url":"https://api.github.com/repos/mycolorway/simditor/pulls{/number}","milestones_url":"https://api.github.com/repos/mycolorway/simditor/milestones{/number}","notifications_url":"https://api.github.com/repos/mycolorway/simditor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mycolorway/simditor/labels{/name}","releases_url":"https://api.github.com/repos/mycolorway/simditor/releases{/id}","created_at":"2014-01-10T03:54:08Z","updated_at":"2015-10-21T02:23:25Z","pushed_at":"2015-10-20T19:44:43Z","git_url":"git://github.com/mycolorway/simditor.git","ssh_url":"git@github.com:mycolorway/simditor.git","clone_url":"https://github.com/mycolorway/simditor.git","svn_url":"https://github.com/mycolorway/simditor","homepage":"http://simditor.tower.im","size":7392,"stargazers_count":1744,"watchers_count":1744,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":405,"mirror_url":null,"open_issues_count":11,"forks":405,"open_issues":11,"watchers":1744,"default_branch":"master"}},"base":{"label":"mycolorway:master","ref":"master","sha":"d55f082d8af98ad5c2772bfd6a991bee8a98f934","user":{"login":"mycolorway","id":530175,"avatar_url":"https://avatars.githubusercontent.com/u/530175?v=3","gravatar_id":"","url":"https://api.github.com/users/mycolorway","html_url":"https://github.com/mycolorway","followers_url":"https://api.github.com/users/mycolorway/followers","following_url":"https://api.github.com/users/mycolorway/following{/other_user}","gists_url":"https://api.github.com/users/mycolorway/gists{/gist_id}","starred_url":"https://api.github.com/users/mycolorway/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mycolorway/subscriptions","organizations_url":"https://api.github.com/users/mycolorway/orgs","repos_url":"https://api.github.com/users/mycolorway/repos","events_url":"https://api.github.com/users/mycolorway/events{/privacy}","received_events_url":"https://api.github.com/users/mycolorway/received_events","type":"Organization","site_admin":false},"repo":{"id":15787723,"name":"simditor","full_name":"mycolorway/simditor","owner":{"login":"mycolorway","id":530175,"avatar_url":"https://avatars.githubusercontent.com/u/530175?v=3","gravatar_id":"","url":"https://api.github.com/users/mycolorway","html_url":"https://github.com/mycolorway","followers_url":"https://api.github.com/users/mycolorway/followers","following_url":"https://api.github.com/users/mycolorway/following{/other_user}","gists_url":"https://api.github.com/users/mycolorway/gists{/gist_id}","starred_url":"https://api.github.com/users/mycolorway/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mycolorway/subscriptions","organizations_url":"https://api.github.com/users/mycolorway/orgs","repos_url":"https://api.github.com/users/mycolorway/repos","events_url":"https://api.github.com/users/mycolorway/events{/privacy}","received_events_url":"https://api.github.com/users/mycolorway/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mycolorway/simditor","description":"An Easy and Fast WYSIWYG Editor","fork":false,"url":"https://api.github.com/repos/mycolorway/simditor","forks_url":"https://api.github.com/repos/mycolorway/simditor/forks","keys_url":"https://api.github.com/repos/mycolorway/simditor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mycolorway/simditor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mycolorway/simditor/teams","hooks_url":"https://api.github.com/repos/mycolorway/simditor/hooks","issue_events_url":"https://api.github.com/repos/mycolorway/simditor/issues/events{/number}","events_url":"https://api.github.com/repos/mycolorway/simditor/events","assignees_url":"https://api.github.com/repos/mycolorway/simditor/assignees{/user}","branches_url":"https://api.github.com/repos/mycolorway/simditor/branches{/branch}","tags_url":"https://api.github.com/repos/mycolorway/simditor/tags","blobs_url":"https://api.github.com/repos/mycolorway/simditor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mycolorway/simditor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mycolorway/simditor/git/refs{/sha}","trees_url":"https://api.github.com/repos/mycolorway/simditor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mycolorway/simditor/statuses/{sha}","languages_url":"https://api.github.com/repos/mycolorway/simditor/languages","stargazers_url":"https://api.github.com/repos/mycolorway/simditor/stargazers","contributors_url":"https://api.github.com/repos/mycolorway/simditor/contributors","subscribers_url":"https://api.github.com/repos/mycolorway/simditor/subscribers","subscription_url":"https://api.github.com/repos/mycolorway/simditor/subscription","commits_url":"https://api.github.com/repos/mycolorway/simditor/commits{/sha}","git_commits_url":"https://api.github.com/repos/mycolorway/simditor/git/commits{/sha}","comments_url":"https://api.github.com/repos/mycolorway/simditor/comments{/number}","issue_comment_url":"https://api.github.com/repos/mycolorway/simditor/issues/comments{/number}","contents_url":"https://api.github.com/repos/mycolorway/simditor/contents/{+path}","compare_url":"https://api.github.com/repos/mycolorway/simditor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mycolorway/simditor/merges","archive_url":"https://api.github.com/repos/mycolorway/simditor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mycolorway/simditor/downloads","issues_url":"https://api.github.com/repos/mycolorway/simditor/issues{/number}","pulls_url":"https://api.github.com/repos/mycolorway/simditor/pulls{/number}","milestones_url":"https://api.github.com/repos/mycolorway/simditor/milestones{/number}","notifications_url":"https://api.github.com/repos/mycolorway/simditor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mycolorway/simditor/labels{/name}","releases_url":"https://api.github.com/repos/mycolorway/simditor/releases{/id}","created_at":"2014-01-10T03:54:08Z","updated_at":"2015-10-21T02:23:25Z","pushed_at":"2015-10-20T19:44:43Z","git_url":"git://github.com/mycolorway/simditor.git","ssh_url":"git@github.com:mycolorway/simditor.git","clone_url":"https://github.com/mycolorway/simditor.git","svn_url":"https://github.com/mycolorway/simditor","homepage":"http://simditor.tower.im","size":7392,"stargazers_count":1744,"watchers_count":1744,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":405,"mirror_url":null,"open_issues_count":11,"forks":405,"open_issues":11,"watchers":1744,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mycolorway/simditor/pulls/343"},"html":{"href":"https://github.com/mycolorway/simditor/pull/343"},"issue":{"href":"https://api.github.com/repos/mycolorway/simditor/issues/343"},"comments":{"href":"https://api.github.com/repos/mycolorway/simditor/issues/343/comments"},"review_comments":{"href":"https://api.github.com/repos/mycolorway/simditor/pulls/343/comments"},"review_comment":{"href":"https://api.github.com/repos/mycolorway/simditor/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mycolorway/simditor/pulls/343/commits"},"statuses":{"href":"https://api.github.com/repos/mycolorway/simditor/statuses/0061a39a161ac838f238d92e5b551b078e21599f"}}}}