diff --git a/app/app.js b/app/app.js index 2059a49..abea1aa 100644 --- a/app/app.js +++ b/app/app.js @@ -20,6 +20,7 @@ var router = new VueRouter({ { path: '/section/skills', component: sectionSkillsComponent }, { path: '/section/languages', component: sectionLanguagesComponent }, { path: '/section/interests', component: sectionInterestsComponent }, + { path: '/section/meta', component: sectionMetaComponent }, { path: '/section/references', component: sectionReferencesComponent }, { path: '/section/projects', component: sectionProjectsComponent }, diff --git a/app/page_registration.js b/app/page_registration.js index 13ff1bb..5bef120 100644 --- a/app/page_registration.js +++ b/app/page_registration.js @@ -162,6 +162,15 @@ var pageComponents = { fontAwesomeIcon: "fas fa-map" }); + this.registerComponent({ + id: "meta", + path: "#/section/meta", + type: "page", + title: "Meta", + description: "", + fontAwesomeIcon: "fas fa-info" + }); + this.registerComponent({ id: "references", path: "#/section/references", diff --git a/components/section_basics.js b/components/section_basics.js index b68d0b6..41240c8 100644 --- a/components/section_basics.js +++ b/components/section_basics.js @@ -1,10 +1,6 @@ var sectionBasicsComponent = { template: '#section-basics-template', - - - - mounted: function() { var savedData = storage.getLocalStorage("section.basics"); @@ -25,19 +21,11 @@ var sectionBasicsComponent = { } }, - - - - destroyed: function() { }, - - - - data: function() { return { @@ -45,10 +33,6 @@ var sectionBasicsComponent = { }; }, - - - - watch: { /** * Watch all data for changes @@ -66,10 +50,6 @@ var sectionBasicsComponent = { } }, - - - - methods: { addProfile: function() { diff --git a/components/section_meta.js b/components/section_meta.js new file mode 100644 index 0000000..16777a5 --- /dev/null +++ b/components/section_meta.js @@ -0,0 +1,60 @@ +var sectionMetaComponent = { + template: '#section-meta-template', + + mounted: function() + { + var savedData = storage.getLocalStorage("section.meta"); + + if (savedData) + { + // Data previously saved. + this.data = savedData; + + for (var key in savedData) + { + if (savedData.hasOwnProperty(key)) + { + //console.log(key + " > " + savedData[key]); + this[key] = savedData[key]; + } + } + } + }, + + destroyed: function() + { + + }, + + data: function() + { + return { + + }; + }, + + watch: { + /** + * Watch all data for changes + */ + $data: { + handler: function(val, oldVal) + { + // Save the data to localStorage + //NOTE: I'm initially not concerned about performance here/ + //storage.setLocalStorage("section.basics", val); + + //this.$root.sections.basics = val; + }, + deep: true + } + }, + + methods: { + addProfile: function() + { + var item = models.newDefaultMeta(); + this.$root.sections.meta.profiles.push(item); + } + } +}; \ No newline at end of file diff --git a/index.html b/index.html index bd6e692..d6abd1c 100644 --- a/index.html +++ b/index.html @@ -47,7 +47,8 @@