{"action":"created","issue":{"url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/issues/1727","repository_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice","labels_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/issues/1727/labels{/name}","comments_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/issues/1727/comments","events_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/issues/1727/events","html_url":"https://github.com/duckduckgo/zeroclickinfo-spice/pull/1727","id":66228144,"number":1727,"title":"New IA: Calculator","user":{"login":"sevastos","id":620714,"avatar_url":"https://avatars.githubusercontent.com/u/620714?v=3","gravatar_id":"","url":"https://api.github.com/users/sevastos","html_url":"https://github.com/sevastos","followers_url":"https://api.github.com/users/sevastos/followers","following_url":"https://api.github.com/users/sevastos/following{/other_user}","gists_url":"https://api.github.com/users/sevastos/gists{/gist_id}","starred_url":"https://api.github.com/users/sevastos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sevastos/subscriptions","organizations_url":"https://api.github.com/users/sevastos/orgs","repos_url":"https://api.github.com/users/sevastos/repos","events_url":"https://api.github.com/users/sevastos/events{/privacy}","received_events_url":"https://api.github.com/users/sevastos/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/labels/Abandoned","name":"Abandoned","color":"fbca04"},{"url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/labels/New%20Instant%20Answer","name":"New Instant Answer","color":"02d7e1"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":22,"created_at":"2015-04-03T21:08:06Z","updated_at":"2016-02-07T19:21:33Z","closed_at":"2015-10-29T20:55:01Z","pull_request":{"url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/pulls/1727","html_url":"https://github.com/duckduckgo/zeroclickinfo-spice/pull/1727","diff_url":"https://github.com/duckduckgo/zeroclickinfo-spice/pull/1727.diff","patch_url":"https://github.com/duckduckgo/zeroclickinfo-spice/pull/1727.patch"},"body":"#### Math calculator - WIP\r\nA math calculator with GUI.\r\n\r\n![Screenshot](http://i.imgur.com/aMhOLwf.png)\r\n\r\n#### State\r\n- Demo: To test put a math expression followed by an equal sign (`=`) e.x: `2+5^3=`\r\n- Trigger: Uses a regex for trigger searching for a `=` at the end of the query.\r\n - [ ]Revisit and finish properly triggering (to not conflict with original goodie?)\r\n- JS: Most of the foundation is in place, but restructuring is planned.\r\n- UI: Most CSS is done, except:\r\n  - [ ] Dark theme support\r\n  - [ ] Extensive cross platform (IE) testing\r\n  - [ ] UI transitions\r\n  - [ ] More testing on client configurations\r\n- UI/JS: Still todo:\r\n  - [ ] History log:\r\n    - [ ] more/less toggle\r\n    - [ ] replay of past formulas\r\n    - [ ] misc ideas\r\n  - [ ] Change angle toggle with label and input(type=checkbox)\r\n  - [ ] i18n\r\n- Formula: Basic operations work, but a lot of the functionality is disabled or is not fully developed. Complicated formulas may not work yet. A lot of progress is to happen in the following days to the point of being complete.\r\n  - [ ] Deleting/Backspace (this is quite crucial; WIP to cover all cases)\r\n  - [ ] Parentheses\r\n  - [X] Basic math ( + - / * )\r\n  - [ ] Trigonometric functions (work with rads, yet to develop to respect the angle unit option\r\n  - [X] Powers, ExpNotation\r\n  - [x] Roots\r\n  - [ ] Constants (any use of constants is not developed yet)\r\n  - [ ] log/ln: ln still to do\r\n  - [X] Factorial \r\n  - [ ] Flawless navigation :star2:\r\n  - [ ] Flawless complexity :star2: \r\n- Accessibility: Basic work is done, but there are still obvious things still to do (WAI etc.).\r\n- There is a features backlog, if room/needed\r\n- Refactors are imminent :smiling_imp: \r\n\r\n#### JS thinking\r\n##### `Calc`\r\nThe idea is to have `calc` normalize any user input (UI buttons, keys, clicks) and then feed the \"intentions\" to the active `calc.formula` (`Formula`)\r\n##### `Formula`\r\n`Formula` handles the presentation and calculating part. It's stores the math expressions in a structured way along with a virtual cursor which we could show on the UI.\r\nThis allows for much flexibility on what we can do with the formula ;)\r\n\r\n\r\n/cc @bsstoner @nilnilnil "},"comment":{"url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/issues/comments/181088776","html_url":"https://github.com/duckduckgo/zeroclickinfo-spice/pull/1727#issuecomment-181088776","issue_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/issues/1727","id":181088776,"user":{"login":"GuiltyDolphin","id":8598426,"avatar_url":"https://avatars.githubusercontent.com/u/8598426?v=3","gravatar_id":"","url":"https://api.github.com/users/GuiltyDolphin","html_url":"https://github.com/GuiltyDolphin","followers_url":"https://api.github.com/users/GuiltyDolphin/followers","following_url":"https://api.github.com/users/GuiltyDolphin/following{/other_user}","gists_url":"https://api.github.com/users/GuiltyDolphin/gists{/gist_id}","starred_url":"https://api.github.com/users/GuiltyDolphin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GuiltyDolphin/subscriptions","organizations_url":"https://api.github.com/users/GuiltyDolphin/orgs","repos_url":"https://api.github.com/users/GuiltyDolphin/repos","events_url":"https://api.github.com/users/GuiltyDolphin/events{/privacy}","received_events_url":"https://api.github.com/users/GuiltyDolphin/received_events","type":"User","site_admin":false},"created_at":"2016-02-07T19:21:33Z","updated_at":"2016-02-07T19:21:33Z","body":"@sevastos @JamyGolden Just so you know, I've been working on this over on duckduckgo/zeroclickinfo-goodies#2189.\r\n\r\nInstead of using any JS to do calculations, it sends requests to the Perl back-end (which is in a separate PR - duckduckgo/zeroclickinfo-goodies#1927) which does all the calculations. I've also changed up most of the JS (although I'm still using mostly the same CSS and Handlebars). \r\n\r\nI'm happy to discuss design and functionality (or anything else!) over on that PR, which is where I will be posting progress updates.\r\n\r\n/cc @bsstoner @moollaza "}}