tosdr/tosdr-firefox — pull request #22 by cimm (2014-10-08 22:26:19+00:00)
Title: Refactor service update logic

Second pull request to try to separate the responsibilities from `main.js` into multiple functions, see #21 for the TOSDR API calls.

This commit adds an UpdateTracker function which contains all the logic to decide if it's time to fetch the list of services from the TOSDR server (after 13 days, like before). This removes the need for date calculations in the `main.js` file and removes the duplicate request services call code.

**Note** if this pull request and pull request #21 will probably conflict on master when both are merged at the same time. If one is merged with master I'll rebase the other one.

@AbdullahDiaa Feel free to give your opinion. Tell me if you feel this is useless. I would like to help but totally understand it's your project and you might not agree with my programming ideas. ;) Just tell me and reject both pull requests, no hard feelings.