{"action":"created","issue":{"url":"https://api.github.com/repos/CindyJS/CindyJS/issues/369","repository_url":"https://api.github.com/repos/CindyJS/CindyJS","labels_url":"https://api.github.com/repos/CindyJS/CindyJS/issues/369/labels{/name}","comments_url":"https://api.github.com/repos/CindyJS/CindyJS/issues/369/comments","events_url":"https://api.github.com/repos/CindyJS/CindyJS/issues/369/events","html_url":"https://github.com/CindyJS/CindyJS/pull/369","id":159955018,"number":369,"title":"Buttons","user":{"login":"gagern","id":190759,"avatar_url":"https://avatars.githubusercontent.com/u/190759?v=3","gravatar_id":"","url":"https://api.github.com/users/gagern","html_url":"https://github.com/gagern","followers_url":"https://api.github.com/users/gagern/followers","following_url":"https://api.github.com/users/gagern/following{/other_user}","gists_url":"https://api.github.com/users/gagern/gists{/gist_id}","starred_url":"https://api.github.com/users/gagern/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gagern/subscriptions","organizations_url":"https://api.github.com/users/gagern/orgs","repos_url":"https://api.github.com/users/gagern/repos","events_url":"https://api.github.com/users/gagern/events{/privacy}","received_events_url":"https://api.github.com/users/gagern/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/CindyJS/CindyJS/labels/Cinderella%20compat.","name":"Cinderella compat.","color":"0052cc"},{"url":"https://api.github.com/repos/CindyJS/CindyJS/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/CindyJS/CindyJS/labels/mc%C2%B2","name":"mc²","color":"fbca04"}],"state":"open","locked":false,"assignee":{"login":"kranich","id":7249754,"avatar_url":"https://avatars.githubusercontent.com/u/7249754?v=3","gravatar_id":"","url":"https://api.github.com/users/kranich","html_url":"https://github.com/kranich","followers_url":"https://api.github.com/users/kranich/followers","following_url":"https://api.github.com/users/kranich/following{/other_user}","gists_url":"https://api.github.com/users/kranich/gists{/gist_id}","starred_url":"https://api.github.com/users/kranich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kranich/subscriptions","organizations_url":"https://api.github.com/users/kranich/orgs","repos_url":"https://api.github.com/users/kranich/repos","events_url":"https://api.github.com/users/kranich/events{/privacy}","received_events_url":"https://api.github.com/users/kranich/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/CindyJS/CindyJS/milestones/2","html_url":"https://github.com/CindyJS/CindyJS/milestones/MC2%20Project%20Meeting%20Potsdam","labels_url":"https://api.github.com/repos/CindyJS/CindyJS/milestones/2/labels","id":1722666,"number":2,"title":"MC2 Project Meeting Potsdam","description":"","creator":{"login":"kortenkamp","id":1773555,"avatar_url":"https://avatars.githubusercontent.com/u/1773555?v=3","gravatar_id":"","url":"https://api.github.com/users/kortenkamp","html_url":"https://github.com/kortenkamp","followers_url":"https://api.github.com/users/kortenkamp/followers","following_url":"https://api.github.com/users/kortenkamp/following{/other_user}","gists_url":"https://api.github.com/users/kortenkamp/gists{/gist_id}","starred_url":"https://api.github.com/users/kortenkamp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kortenkamp/subscriptions","organizations_url":"https://api.github.com/users/kortenkamp/orgs","repos_url":"https://api.github.com/users/kortenkamp/repos","events_url":"https://api.github.com/users/kortenkamp/events{/privacy}","received_events_url":"https://api.github.com/users/kortenkamp/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":0,"state":"open","created_at":"2016-04-21T11:44:55Z","updated_at":"2016-06-13T13:51:01Z","due_on":"2016-05-22T22:00:00Z","closed_at":null},"comments":22,"created_at":"2016-06-13T13:51:01Z","updated_at":"2016-06-14T18:26:21Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/CindyJS/CindyJS/pulls/369","html_url":"https://github.com/CindyJS/CindyJS/pull/369","diff_url":"https://github.com/CindyJS/CindyJS/pull/369.diff","patch_url":"https://github.com/CindyJS/CindyJS/pull/369.patch"},"body":"This implements buttons, a much-needed feature and part of #14. The buttons have type `PushButton` or `Switch` in accordance with Cinderella merge request !110. Currently buttons don't cooperate with the KaTeX plugin yet. I'd include that in a subsequent pull request.\r\n\r\nThe approach is somewhat hackish, since it re-uses part of the `drawtext` pipeline but takes a different branch at the end of that code path. Feel free to suggest other alternatives which resolve this in a cleaner fashion without too much code duplication.\r\n\r\nThe style is handled by a new stylesheet, `CindyJS.css` built from [`CindyJS.scss`](https://github.com/gagern/CindyJS/blob/buttons/src/scss/CindyJS.scss) using [SASS](http://sass-lang.com/). It provides settings which I consider crucial for the operation of CindyJS widgets. All classes are prefixed by `CindyJS-`, and all effects are restricted to CindyJS widget containers. So it should be safe to include this CSS into all documents alongside `Cindy.js`, and we should advocate doing so at least if features that need it might be used (like buttons). This differs from the existing [`cindy.css`](https://github.com/gagern/CindyJS/blob/buttons/css/cindy.css) which does pretty non-standard settings like forcing the position of all `canvas` elements to be absolute. That file is used in some examples, but I'd vote to get rid of that file an all its uses in order to avoid confusion, and I'd definitely not request third party sites to include that file. If you prefer a different default style for these buttons, feel free to suggest changes to `CindyJS.scss`.\r\n\r\nI'm making use of the newly found fact (or perhaps newly added feature?) that I can assign an issue to multiple people, and hope that one of the assignees finds time to review this."},"comment":{"url":"https://api.github.com/repos/CindyJS/CindyJS/issues/comments/225972245","html_url":"https://github.com/CindyJS/CindyJS/pull/369#issuecomment-225972245","issue_url":"https://api.github.com/repos/CindyJS/CindyJS/issues/369","id":225972245,"user":{"login":"gagern","id":190759,"avatar_url":"https://avatars.githubusercontent.com/u/190759?v=3","gravatar_id":"","url":"https://api.github.com/users/gagern","html_url":"https://github.com/gagern","followers_url":"https://api.github.com/users/gagern/followers","following_url":"https://api.github.com/users/gagern/following{/other_user}","gists_url":"https://api.github.com/users/gagern/gists{/gist_id}","starred_url":"https://api.github.com/users/gagern/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gagern/subscriptions","organizations_url":"https://api.github.com/users/gagern/orgs","repos_url":"https://api.github.com/users/gagern/repos","events_url":"https://api.github.com/users/gagern/events{/privacy}","received_events_url":"https://api.github.com/users/gagern/received_events","type":"User","site_admin":false},"created_at":"2016-06-14T18:26:20Z","updated_at":"2016-06-14T18:26:20Z","body":"I found that the fact that the `<div>`s containing the buttons resp. labels are so much higher than they appear will also break interaction with the underlying canvas: in the Buttons1 example, one can't drag the point *A* into the area above a button.\r\n\r\nYes, this whole mess is incredibly hackish. For buttons it might be cleaner to do this in canvas. For text boxes, however, I fear that we'd cause serious grief for people using input methods. And doing buttons in a different way than text boxes feels weird, too. So I'd like some more discussion before changing directions here.\r\n\r\nWe *could* change the meaning of button positions, in such a way that buttons get positioned by center or corner or something like that, instead of baseline. That would simplify things a lot, with positioning by top left corner being the easiest. We could try to compensate for this when exporting. Adjusting for line height in the default font should be fairly easy. Adjusting for actual button dimensions would likely be hard in a headless setup, but it might be worth trying nonetheless."}}
{"actor":{"display_login":"gagern"}}