{"action":"created","issue":{"url":"https://api.github.com/repos/maherm/steamgifts_scripts/issues/3","repository_url":"https://api.github.com/repos/maherm/steamgifts_scripts","labels_url":"https://api.github.com/repos/maherm/steamgifts_scripts/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/maherm/steamgifts_scripts/issues/3/comments","events_url":"https://api.github.com/repos/maherm/steamgifts_scripts/issues/3/events","html_url":"https://github.com/maherm/steamgifts_scripts/pull/3","id":217578862,"number":3,"title":"New features","user":{"login":"crazoter","id":9276766,"avatar_url":"https://avatars1.githubusercontent.com/u/9276766?v=3","gravatar_id":"","url":"https://api.github.com/users/crazoter","html_url":"https://github.com/crazoter","followers_url":"https://api.github.com/users/crazoter/followers","following_url":"https://api.github.com/users/crazoter/following{/other_user}","gists_url":"https://api.github.com/users/crazoter/gists{/gist_id}","starred_url":"https://api.github.com/users/crazoter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crazoter/subscriptions","organizations_url":"https://api.github.com/users/crazoter/orgs","repos_url":"https://api.github.com/users/crazoter/repos","events_url":"https://api.github.com/users/crazoter/events{/privacy}","received_events_url":"https://api.github.com/users/crazoter/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":34,"created_at":"2017-03-28T14:28:03Z","updated_at":"2017-04-07T19:34:13Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/maherm/steamgifts_scripts/pulls/3","html_url":"https://github.com/maherm/steamgifts_scripts/pull/3","diff_url":"https://github.com/maherm/steamgifts_scripts/pull/3.diff","patch_url":"https://github.com/maherm/steamgifts_scripts/pull/3.patch"},"body":"+ Colored bookmarks for entered / owned giveaways (CAUTION: DOESN'T ACCOUNT FOR DLCs?)\r\n+ Marked giveaways as train\r\n\r\nDescript:\r\n~~Quick and dirty addition.~~\r\n\r\nEDIT 2: Program breaking issues should be fixed. Please check and confirm it is so :) Old bookmarks may appear as entered if the user had entered them previously before this update and vice versa; fixDatabase() doesn't work because Giveaways.loadGiveaway never calls the callback...\r\nFurther extensive testing indicates this coloring of bookmarks may be somewhat buggy but generally works as intended. Will continue working on it tmr.\r\n~~EDIT: program breaking issues found in new features, do not merge yet~~\r\n~~+ Upon further testing, the code is currently suffering from race issues; the code if a giveaway has been entered is a hit and miss when you refresh the page; works fine on the page itself, but the bookmark may revert after refreshing. Will debug when I get some free time.  I was interacting with multiple bookmarks via multiple tabs... that must have affected the save code because it's currently using only 1 save file. I'll need to change the save method by ensuring the data is updated first before saving.~~\r\n~~+ Old bookmarks may appear as entered if the user had entered them previously before this update and vice versa.~~\r\n~~I've not implemented a database/giveaway check etc. Should be quite straight forward.~~\r\n\r\nPossible Issues (No DLC detection):\r\nThe only possible issue is that I only used the \"isOwned\" variable to check if a giveaway is owned and did not account for DLCs before marking the bookmark in red. Minor issue, since very few people, if any, are going to bookmark games that they cannot enter.\r\n\r\nImplementation:\r\nI used the descriptions of the bookmarks to identify if they are part of train. Simply put, if their descriptions are the same (by the same user and generally ending in the same time), I assume the giveaways are together. Works pretty good. For the entered/owned giveaways, I simply leveraged on the sgapi and put a click handler on the enter/exit giveaway button. Clicking will automatically trigger the buildNavRows and saving of bookmark data to reflect changes. \r\n\r\nPreview:\r\n![Image](http://i.imgur.com/KbMpiRo.png)\r\n\r\nFuture optimizations: This was a *really* quick fix so there's some code bloat that shouldn't affect users. The added styles can be edited into the css files and the addBookmarkMenuItem function header can be optimized to remove the \"hasEnded\" variable amongst other nitpick optimizations. It otherwise works as intended.\r\n\r\nEDIT: The ellipsis now cover only the title, leaving the points still visible if a train giveaway bookmark's title gets too long"},"comment":{"url":"https://api.github.com/repos/maherm/steamgifts_scripts/issues/comments/292631574","html_url":"https://github.com/maherm/steamgifts_scripts/pull/3#issuecomment-292631574","issue_url":"https://api.github.com/repos/maherm/steamgifts_scripts/issues/3","id":292631574,"user":{"login":"maherm","id":5812806,"avatar_url":"https://avatars3.githubusercontent.com/u/5812806?v=3","gravatar_id":"","url":"https://api.github.com/users/maherm","html_url":"https://github.com/maherm","followers_url":"https://api.github.com/users/maherm/followers","following_url":"https://api.github.com/users/maherm/following{/other_user}","gists_url":"https://api.github.com/users/maherm/gists{/gist_id}","starred_url":"https://api.github.com/users/maherm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maherm/subscriptions","organizations_url":"https://api.github.com/users/maherm/orgs","repos_url":"https://api.github.com/users/maherm/repos","events_url":"https://api.github.com/users/maherm/events{/privacy}","received_events_url":"https://api.github.com/users/maherm/received_events","type":"User","site_admin":false},"created_at":"2017-04-07T19:34:13Z","updated_at":"2017-04-07T19:34:13Z","body":"Great work! I'll try to have a look at it and merge it this weekend."}}
{"actor":{"display_login":"maherm"}}