benjaffe/chrome-okc-plugin — pull request #89 by studgeek (2014-06-16 03:10:29+00:00)
Title: Make suggest questions mode persistent (issue #88)

First rough draft at making suggestions persistent (suggestion #88). Its rough and needs cleanup, but shows the idea.

It makes the following changes:
- Enabling suggest mode can be done with localStorage. So localStorage.setItem("devMode", true); enables and localStorage.removeItem("devMode"); disables.
- Suggestions are stored in localStorage. So they persist across refreshes and sessions.
- Persisted suggestions can be cleared with Clear Suggestions button.
- Suggest Question is shown for all questions (when enabled) to make it easy to suggest questions for new categories.
- The list of existing categories for each question is shown.
- Gets rid of all the dialogs, including the verification dialogs and the category dialogs. The user is expected to read wiki and know what they are doing.
- Categories are no longer shown in the suggested text. Instead the user is asked to group by them in their email. With an update in the wiki page I think this will work better. The grouping by category is very simple now in the new style.
- Includes a link back to wiki to explain how to use it.

Work still to do:
- Suggest questions is not shown when moving to a new page. This is because the extension currently doesn't catch page transitions (it only loads on a new page). The workaround is to simply refresh the page. Since the state is persisted they are all there after refreshing.
- Style cleanup (including introducing constants and some refactoring)