{"action":"created","comment":{"url":"https://api.github.com/repos/bardsoftware/ace/pulls/comments/72061367","id":72061367,"diff_hunk":"@@ -1,49 +1,91 @@\n define((require, exports, module) ->\n-    exports.setupPreviewer = (editor) ->\n-        require(\"ace/ext/jquery\")\n-        katex = null\n-\n-        initKaTeX = (onLoaded) ->\n-            # Adding KaTeX CSS\n-            cssKatexPath = require.toUrl(\"../katex/katex.min.css\")\n-            linkKatex = $(\"<link>\").attr(\"rel\", \"stylesheet\").attr(\"href\", cssKatexPath)\n-            $(\"head\").append(linkKatex)\n-\n-            # Adding CSS for demo formula\n-            cssDemoPath = require.toUrl(\"./katex-demo.css\")\n-            linkDemo = $(\"<link>\").attr(\"rel\", \"stylesheet\").attr(\"href\", cssDemoPath)\n-            $(\"head\").append(linkDemo)\n-\n-            # Adding DOM element to place formula into\n-            span = $(\"<span>\").attr(\"id\", \"formula\")\n-            $(\"body\").append(span)\n-\n-            require([\"ace/ext/katex/katex\"], (katexInner) ->\n-                katex = katexInner\n-                onLoaded()\n-                return\n-            )\n-            return\n-\n-        onLoaded = ->\n-            selectedText = editor.getSelectedText()\n-            try\n-                katex.render(selectedText, $(\"#formula\")[0])\n-            catch e\n-                $(\"#formula\").text(e.message)\n-            return\n-\n-        callback = (editor) ->\n-            unless katex?\n-                initKaTeX(onLoaded)\n-                return\n-            onLoaded()\n-\n-        editor.commands.addCommand({\n-            name: \"previewLaTeXFormula\",\n-            bindKey: {win: \"Alt-p\", mac: \"Alt-p\"},\n-            exec: callback\n-        })\n+  exports.setupPreviewer = (editor, popoverHandler) ->\n+    katex = null\n+    popoverHandler = popoverHandler ? {\n+      show: (jqPopoverContainer, options) ->\n+        jqPopoverContainer.css($(\"textarea.ace_text-input\").position())","path":"lib/ace/ext/papeeria/katex-previewer.coffee","position":51,"original_position":51,"commit_id":"0590e04fcd771ff79d20085c27826573d289d433","original_commit_id":"0590e04fcd771ff79d20085c27826573d289d433","user":{"login":"dbarashev","id":2028330,"avatar_url":"https://avatars.githubusercontent.com/u/2028330?v=3","gravatar_id":"","url":"https://api.github.com/users/dbarashev","html_url":"https://github.com/dbarashev","followers_url":"https://api.github.com/users/dbarashev/followers","following_url":"https://api.github.com/users/dbarashev/following{/other_user}","gists_url":"https://api.github.com/users/dbarashev/gists{/gist_id}","starred_url":"https://api.github.com/users/dbarashev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dbarashev/subscriptions","organizations_url":"https://api.github.com/users/dbarashev/orgs","repos_url":"https://api.github.com/users/dbarashev/repos","events_url":"https://api.github.com/users/dbarashev/events{/privacy}","received_events_url":"https://api.github.com/users/dbarashev/received_events","type":"User","site_admin":false},"body":"Something must be wrong here. `css` method with a single argument expects a property name (and returns its value) or object with key-value pairs. I guess you meant the latter, but in this case `position` returns object with `top` and `left` and values as numbers, while CSS `top` and `left` need units of measurement. So pls make this both less error-prone and clearer to the reader: save `position()` and call `css` adding \"px\" unit to position values.","created_at":"2016-07-25T13:19:40Z","updated_at":"2016-07-25T13:19:40Z","html_url":"https://github.com/bardsoftware/ace/pull/60#discussion_r72061367","pull_request_url":"https://api.github.com/repos/bardsoftware/ace/pulls/60","_links":{"self":{"href":"https://api.github.com/repos/bardsoftware/ace/pulls/comments/72061367"},"html":{"href":"https://github.com/bardsoftware/ace/pull/60#discussion_r72061367"},"pull_request":{"href":"https://api.github.com/repos/bardsoftware/ace/pulls/60"}}},"pull_request":{"url":"https://api.github.com/repos/bardsoftware/ace/pulls/60","id":78204312,"html_url":"https://github.com/bardsoftware/ace/pull/60","diff_url":"https://github.com/bardsoftware/ace/pull/60.diff","patch_url":"https://github.com/bardsoftware/ace/pull/60.patch","issue_url":"https://api.github.com/repos/bardsoftware/ace/issues/60","number":60,"state":"open","locked":false,"title":"Bootstrap popover to display formula preview","user":{"login":"yanenkoa","id":11256769,"avatar_url":"https://avatars.githubusercontent.com/u/11256769?v=3","gravatar_id":"","url":"https://api.github.com/users/yanenkoa","html_url":"https://github.com/yanenkoa","followers_url":"https://api.github.com/users/yanenkoa/followers","following_url":"https://api.github.com/users/yanenkoa/following{/other_user}","gists_url":"https://api.github.com/users/yanenkoa/gists{/gist_id}","starred_url":"https://api.github.com/users/yanenkoa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yanenkoa/subscriptions","organizations_url":"https://api.github.com/users/yanenkoa/orgs","repos_url":"https://api.github.com/users/yanenkoa/repos","events_url":"https://api.github.com/users/yanenkoa/events{/privacy}","received_events_url":"https://api.github.com/users/yanenkoa/received_events","type":"User","site_admin":false},"body":"@dbarashev added basic preview in Bootstrap popover. Still to do (as far as I am aware):\r\n\r\n1. Destroy popover on any user action in ACE -- so far you need to press Alt-p the second time to make it disappear\r\n2. Deal with big formulas -- so far big enough formulas don't fit in a popover","created_at":"2016-07-20T19:24:35Z","updated_at":"2016-07-25T13:19:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6d7786aa09d456ba0437a1e38fda8de7554509ee","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/bardsoftware/ace/pulls/60/commits","review_comments_url":"https://api.github.com/repos/bardsoftware/ace/pulls/60/comments","review_comment_url":"https://api.github.com/repos/bardsoftware/ace/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bardsoftware/ace/issues/60/comments","statuses_url":"https://api.github.com/repos/bardsoftware/ace/statuses/0590e04fcd771ff79d20085c27826573d289d433","head":{"label":"bardsoftware:tkt_59_popover","ref":"tkt_59_popover","sha":"0590e04fcd771ff79d20085c27826573d289d433","user":{"login":"bardsoftware","id":2625618,"avatar_url":"https://avatars.githubusercontent.com/u/2625618?v=3","gravatar_id":"","url":"https://api.github.com/users/bardsoftware","html_url":"https://github.com/bardsoftware","followers_url":"https://api.github.com/users/bardsoftware/followers","following_url":"https://api.github.com/users/bardsoftware/following{/other_user}","gists_url":"https://api.github.com/users/bardsoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/bardsoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bardsoftware/subscriptions","organizations_url":"https://api.github.com/users/bardsoftware/orgs","repos_url":"https://api.github.com/users/bardsoftware/repos","events_url":"https://api.github.com/users/bardsoftware/events{/privacy}","received_events_url":"https://api.github.com/users/bardsoftware/received_events","type":"Organization","site_admin":false},"repo":{"id":13590146,"name":"ace","full_name":"bardsoftware/ace","owner":{"login":"bardsoftware","id":2625618,"avatar_url":"https://avatars.githubusercontent.com/u/2625618?v=3","gravatar_id":"","url":"https://api.github.com/users/bardsoftware","html_url":"https://github.com/bardsoftware","followers_url":"https://api.github.com/users/bardsoftware/followers","following_url":"https://api.github.com/users/bardsoftware/following{/other_user}","gists_url":"https://api.github.com/users/bardsoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/bardsoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bardsoftware/subscriptions","organizations_url":"https://api.github.com/users/bardsoftware/orgs","repos_url":"https://api.github.com/users/bardsoftware/repos","events_url":"https://api.github.com/users/bardsoftware/events{/privacy}","received_events_url":"https://api.github.com/users/bardsoftware/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bardsoftware/ace","description":"Ace (Ajax.org Cloud9 Editor)","fork":true,"url":"https://api.github.com/repos/bardsoftware/ace","forks_url":"https://api.github.com/repos/bardsoftware/ace/forks","keys_url":"https://api.github.com/repos/bardsoftware/ace/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bardsoftware/ace/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bardsoftware/ace/teams","hooks_url":"https://api.github.com/repos/bardsoftware/ace/hooks","issue_events_url":"https://api.github.com/repos/bardsoftware/ace/issues/events{/number}","events_url":"https://api.github.com/repos/bardsoftware/ace/events","assignees_url":"https://api.github.com/repos/bardsoftware/ace/assignees{/user}","branches_url":"https://api.github.com/repos/bardsoftware/ace/branches{/branch}","tags_url":"https://api.github.com/repos/bardsoftware/ace/tags","blobs_url":"https://api.github.com/repos/bardsoftware/ace/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bardsoftware/ace/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bardsoftware/ace/git/refs{/sha}","trees_url":"https://api.github.com/repos/bardsoftware/ace/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bardsoftware/ace/statuses/{sha}","languages_url":"https://api.github.com/repos/bardsoftware/ace/languages","stargazers_url":"https://api.github.com/repos/bardsoftware/ace/stargazers","contributors_url":"https://api.github.com/repos/bardsoftware/ace/contributors","subscribers_url":"https://api.github.com/repos/bardsoftware/ace/subscribers","subscription_url":"https://api.github.com/repos/bardsoftware/ace/subscription","commits_url":"https://api.github.com/repos/bardsoftware/ace/commits{/sha}","git_commits_url":"https://api.github.com/repos/bardsoftware/ace/git/commits{/sha}","comments_url":"https://api.github.com/repos/bardsoftware/ace/comments{/number}","issue_comment_url":"https://api.github.com/repos/bardsoftware/ace/issues/comments{/number}","contents_url":"https://api.github.com/repos/bardsoftware/ace/contents/{+path}","compare_url":"https://api.github.com/repos/bardsoftware/ace/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bardsoftware/ace/merges","archive_url":"https://api.github.com/repos/bardsoftware/ace/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bardsoftware/ace/downloads","issues_url":"https://api.github.com/repos/bardsoftware/ace/issues{/number}","pulls_url":"https://api.github.com/repos/bardsoftware/ace/pulls{/number}","milestones_url":"https://api.github.com/repos/bardsoftware/ace/milestones{/number}","notifications_url":"https://api.github.com/repos/bardsoftware/ace/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bardsoftware/ace/labels{/name}","releases_url":"https://api.github.com/repos/bardsoftware/ace/releases{/id}","deployments_url":"https://api.github.com/repos/bardsoftware/ace/deployments","created_at":"2013-10-15T13:03:16Z","updated_at":"2016-07-04T14:13:07Z","pushed_at":"2016-07-25T12:48:34Z","git_url":"git://github.com/bardsoftware/ace.git","ssh_url":"git@github.com:bardsoftware/ace.git","clone_url":"https://github.com/bardsoftware/ace.git","svn_url":"https://github.com/bardsoftware/ace","homepage":"http://ace.c9.io","size":37112,"stargazers_count":5,"watchers_count":5,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":9,"forks":0,"open_issues":9,"watchers":5,"default_branch":"internship-2016"}},"base":{"label":"bardsoftware:internship-2016","ref":"internship-2016","sha":"11c8ef333c31498fee0da0720b717833ef622f41","user":{"login":"bardsoftware","id":2625618,"avatar_url":"https://avatars.githubusercontent.com/u/2625618?v=3","gravatar_id":"","url":"https://api.github.com/users/bardsoftware","html_url":"https://github.com/bardsoftware","followers_url":"https://api.github.com/users/bardsoftware/followers","following_url":"https://api.github.com/users/bardsoftware/following{/other_user}","gists_url":"https://api.github.com/users/bardsoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/bardsoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bardsoftware/subscriptions","organizations_url":"https://api.github.com/users/bardsoftware/orgs","repos_url":"https://api.github.com/users/bardsoftware/repos","events_url":"https://api.github.com/users/bardsoftware/events{/privacy}","received_events_url":"https://api.github.com/users/bardsoftware/received_events","type":"Organization","site_admin":false},"repo":{"id":13590146,"name":"ace","full_name":"bardsoftware/ace","owner":{"login":"bardsoftware","id":2625618,"avatar_url":"https://avatars.githubusercontent.com/u/2625618?v=3","gravatar_id":"","url":"https://api.github.com/users/bardsoftware","html_url":"https://github.com/bardsoftware","followers_url":"https://api.github.com/users/bardsoftware/followers","following_url":"https://api.github.com/users/bardsoftware/following{/other_user}","gists_url":"https://api.github.com/users/bardsoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/bardsoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bardsoftware/subscriptions","organizations_url":"https://api.github.com/users/bardsoftware/orgs","repos_url":"https://api.github.com/users/bardsoftware/repos","events_url":"https://api.github.com/users/bardsoftware/events{/privacy}","received_events_url":"https://api.github.com/users/bardsoftware/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bardsoftware/ace","description":"Ace (Ajax.org Cloud9 Editor)","fork":true,"url":"https://api.github.com/repos/bardsoftware/ace","forks_url":"https://api.github.com/repos/bardsoftware/ace/forks","keys_url":"https://api.github.com/repos/bardsoftware/ace/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bardsoftware/ace/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bardsoftware/ace/teams","hooks_url":"https://api.github.com/repos/bardsoftware/ace/hooks","issue_events_url":"https://api.github.com/repos/bardsoftware/ace/issues/events{/number}","events_url":"https://api.github.com/repos/bardsoftware/ace/events","assignees_url":"https://api.github.com/repos/bardsoftware/ace/assignees{/user}","branches_url":"https://api.github.com/repos/bardsoftware/ace/branches{/branch}","tags_url":"https://api.github.com/repos/bardsoftware/ace/tags","blobs_url":"https://api.github.com/repos/bardsoftware/ace/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bardsoftware/ace/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bardsoftware/ace/git/refs{/sha}","trees_url":"https://api.github.com/repos/bardsoftware/ace/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bardsoftware/ace/statuses/{sha}","languages_url":"https://api.github.com/repos/bardsoftware/ace/languages","stargazers_url":"https://api.github.com/repos/bardsoftware/ace/stargazers","contributors_url":"https://api.github.com/repos/bardsoftware/ace/contributors","subscribers_url":"https://api.github.com/repos/bardsoftware/ace/subscribers","subscription_url":"https://api.github.com/repos/bardsoftware/ace/subscription","commits_url":"https://api.github.com/repos/bardsoftware/ace/commits{/sha}","git_commits_url":"https://api.github.com/repos/bardsoftware/ace/git/commits{/sha}","comments_url":"https://api.github.com/repos/bardsoftware/ace/comments{/number}","issue_comment_url":"https://api.github.com/repos/bardsoftware/ace/issues/comments{/number}","contents_url":"https://api.github.com/repos/bardsoftware/ace/contents/{+path}","compare_url":"https://api.github.com/repos/bardsoftware/ace/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bardsoftware/ace/merges","archive_url":"https://api.github.com/repos/bardsoftware/ace/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bardsoftware/ace/downloads","issues_url":"https://api.github.com/repos/bardsoftware/ace/issues{/number}","pulls_url":"https://api.github.com/repos/bardsoftware/ace/pulls{/number}","milestones_url":"https://api.github.com/repos/bardsoftware/ace/milestones{/number}","notifications_url":"https://api.github.com/repos/bardsoftware/ace/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bardsoftware/ace/labels{/name}","releases_url":"https://api.github.com/repos/bardsoftware/ace/releases{/id}","deployments_url":"https://api.github.com/repos/bardsoftware/ace/deployments","created_at":"2013-10-15T13:03:16Z","updated_at":"2016-07-04T14:13:07Z","pushed_at":"2016-07-25T12:48:34Z","git_url":"git://github.com/bardsoftware/ace.git","ssh_url":"git@github.com:bardsoftware/ace.git","clone_url":"https://github.com/bardsoftware/ace.git","svn_url":"https://github.com/bardsoftware/ace","homepage":"http://ace.c9.io","size":37112,"stargazers_count":5,"watchers_count":5,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":9,"forks":0,"open_issues":9,"watchers":5,"default_branch":"internship-2016"}},"_links":{"self":{"href":"https://api.github.com/repos/bardsoftware/ace/pulls/60"},"html":{"href":"https://github.com/bardsoftware/ace/pull/60"},"issue":{"href":"https://api.github.com/repos/bardsoftware/ace/issues/60"},"comments":{"href":"https://api.github.com/repos/bardsoftware/ace/issues/60/comments"},"review_comments":{"href":"https://api.github.com/repos/bardsoftware/ace/pulls/60/comments"},"review_comment":{"href":"https://api.github.com/repos/bardsoftware/ace/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bardsoftware/ace/pulls/60/commits"},"statuses":{"href":"https://api.github.com/repos/bardsoftware/ace/statuses/0590e04fcd771ff79d20085c27826573d289d433"}}}}
{"actor":{"display_login":"dbarashev"}}