{"action":"created","issue":{"url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/issues/1352","labels_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/issues/1352/labels{/name}","comments_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/issues/1352/comments","events_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/issues/1352/events","html_url":"https://github.com/duckduckgo/zeroclickinfo-spice/pull/1352","id":52275197,"number":1352,"title":"Refactoring forecast spice","user":{"login":"kethinov","id":419567,"avatar_url":"https://avatars.githubusercontent.com/u/419567?v=3","gravatar_id":"","url":"https://api.github.com/users/kethinov","html_url":"https://github.com/kethinov","followers_url":"https://api.github.com/users/kethinov/followers","following_url":"https://api.github.com/users/kethinov/following{/other_user}","gists_url":"https://api.github.com/users/kethinov/gists{/gist_id}","starred_url":"https://api.github.com/users/kethinov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kethinov/subscriptions","organizations_url":"https://api.github.com/users/kethinov/orgs","repos_url":"https://api.github.com/users/kethinov/repos","events_url":"https://api.github.com/users/kethinov/events{/privacy}","received_events_url":"https://api.github.com/users/kethinov/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/labels/Improvement","name":"Improvement","color":"d7e102"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":15,"created_at":"2014-12-17T18:39:15Z","updated_at":"2015-03-17T03:55:58Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/pulls/1352","html_url":"https://github.com/duckduckgo/zeroclickinfo-spice/pull/1352","diff_url":"https://github.com/duckduckgo/zeroclickinfo-spice/pull/1352.diff","patch_url":"https://github.com/duckduckgo/zeroclickinfo-spice/pull/1352.patch"},"body":"**Changes:**\r\n- Namespaced CSS.\r\n- Removed ID selectors in CSS and replaced them with classes. Updated JS references accordingly.\r\n- Precached array lengths in JS for loops (along with other frequently referenced object member lookups) for a [performance improvement](http://stackoverflow.com/questions/6973942/is-optimizing-javascript-for-loops-really-necessary).\r\n- More efficient temperature converter.\r\n- Lots of other similar small JS optimizations.\r\n\r\n**Other changes similar to my [last PR](https://github.com/duckduckgo/zeroclickinfo-spice/pull/1341):**\r\n- Made code formatting consistent (now only follows one style for things like whitespace, quotes, etc).\r\n- Refactored JS to use function statements rather than function expressions where possible. This has the following benefits:\r\n  - This is the most readable way to obey the [onevar rule](http://wonko.com/post/try-to-use-one-var-statement-per-scope-in-javascript).\r\n  - This will give a named function in a stack trace in the debugger rather than an anonymous function, which makes debugging easier.\r\n  - There is a [small performance advantage](http://jsperf.com/fn-expression-vs-statement).\r\n\r\n**Questions:**\r\n- While everything seems to work in my testing, these changes are more extensive than the last PR I opened. Can anyone share a good list of test cases aside from things like \"forecast tomorrow\" and \"forecast next week\" etc?\r\n- `forecast_icons.handlebars` currently prefetches two different graphics (for both the light and dark themes) for all users regardless of which theme is selected. I think it would be better to engineer a way of fetching only the graphics that are relevant to whichever theme the user has selected, but I don't think that's possible purely from within the spice code. Can anyone speak to that?"},"comment":{"url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/issues/comments/82084633","html_url":"https://github.com/duckduckgo/zeroclickinfo-spice/pull/1352#issuecomment-82084633","issue_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/issues/1352","id":82084633,"user":{"login":"moollaza","id":873785,"avatar_url":"https://avatars.githubusercontent.com/u/873785?v=3","gravatar_id":"","url":"https://api.github.com/users/moollaza","html_url":"https://github.com/moollaza","followers_url":"https://api.github.com/users/moollaza/followers","following_url":"https://api.github.com/users/moollaza/following{/other_user}","gists_url":"https://api.github.com/users/moollaza/gists{/gist_id}","starred_url":"https://api.github.com/users/moollaza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moollaza/subscriptions","organizations_url":"https://api.github.com/users/moollaza/orgs","repos_url":"https://api.github.com/users/moollaza/repos","events_url":"https://api.github.com/users/moollaza/events{/privacy}","received_events_url":"https://api.github.com/users/moollaza/received_events","type":"User","site_admin":false},"created_at":"2015-03-17T03:55:58Z","updated_at":"2015-03-17T03:55:58Z","body":"@kethinov apologies for the delay -- are you still interested in finishing this? It looks like the Forecast Spice has changed a bit and so the PR is unmergable. Would you be interested in re-basing this and addressing the conflcits?"}}