New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restructure data #49

Closed
neocotic opened this Issue Nov 8, 2011 · 3 comments

Comments

Projects
None yet
1 participant
@neocotic
Member

neocotic commented Nov 8, 2011

After some experimentation with the options page for #47 I realise that the data stored in localStorage is messy. Although organised it doesn't look nice and creates restrictions while lifting others. The solution would be to reorganise all the misc entries in to an array of objects which would then be parsed in to JSON, instead of doing this for each entry and then building the objects from these values.

The primary areas that require this rework are templates and URL shorteners (meta/config information). However, this should be done with the greatest care and testing as these are central to the extension and nothing should be overlooked. Consider the reasons that this was not done originally and fix those restrictions another way.

This should be done either before or alongside #48 as that issue will be adding an additional entry for each template.

Ensure that the objects are future-proof and that any new properties can be assigned to them in any future releases.

@ghost ghost assigned neocotic Nov 8, 2011

@neocotic

This comment has been minimized.

Member

neocotic commented Jan 16, 2012

This could also include a new stats object stored in localStorage which could contain statistical information based on their usage. For example;

  • count - Total number of templates
  • customCount - Total number of templates (excl. read-only)
  • popular - Access to the most used template (will require a new property on templates to capture and store usage)

And probably more...

Properties of this object could then be made available in templates through one or more tags.

@neocotic

This comment has been minimized.

Member

neocotic commented Jan 16, 2012

This change is now included in the latest code so I just have to try and break it. Things to be tested;

☑ Update process (from 0.3.0.0 to 1.0.0) doesn't break the settings for existing installations.
☑ Properties of templates can be changed (via options page).
☑ Predefined templates cannot have certain read-only properties changed (via options page).
☑ New properties can be added to existing templates during initialization.
☑ Changes to predefined templates are picked up during initialization.
☑ New predefined templates are picked up during initialization.
☑ Importing template(s) still works.
☑ Exporting template(s) still works.

That said, I'd also like to go through the code and change all references of features to templates before 1.0.0 is released.

@neocotic

This comment has been minimized.

Member

neocotic commented Feb 13, 2012

I'm extremely happy with this and glad I finally got around to doing it. Closing this off now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment