Skip to content
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

Added capacity to delete and re-order sections.basics.profiles #6

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"liveServer.settings.port": 5501
// "liveServer.settings.port": 5501;
editor.disableMonospaceOptimizations: true;
}
134 changes: 26 additions & 108 deletions app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 },

Expand All @@ -32,75 +33,48 @@ var router = new VueRouter({
});



var app = new Vue({
el: '#app',

router: router,





components:
{

},




},

data:
{
status: "laading",

sections: {},



/**
* Details of the current page/route.
*/
activePage: {
id: "",
title: "",
fontAwesomeIconCss: ""
},


countryCodes: []
status: "loading",

sections: {},
/**
* Details of the current page/route.
*/
activePage: {
id: "",
title: "",
fontAwesomeIconCss: ""
},

countryCodes: []
},





created()
{
this.sections = models.newDefaultSections();

console.log("this.sections=", this.sections);
{
this.sections = models.newDefaultSections();
console.log("this.sections=", this.sections);

//-- Register all components
pageComponents.registerComponents();
//-- Register all components
pageComponents.registerComponents();

//-- Get the component for the initial route path
var initialRoute = this.$route.path;
var component = pageComponents.getComponentByPath(initialRoute);
this.setActivePageByComponent(component);
//-- Get the component for the initial route path
var initialRoute = this.$route.path;
var component = pageComponents.getComponentByPath(initialRoute);
this.setActivePageByComponent(component);
},





destroyed()
{
},



},


mounted()
Expand All @@ -122,9 +96,6 @@ var app = new Vue({
},





methods: {
/**
* Set details of the currently selected "page" (route) from a registered component.
Expand All @@ -136,7 +107,7 @@ var app = new Vue({
this.activePage.id = component.id;
this.activePage.title = component.title;
this.activePage.fontAwesomeIconCss = component.fontAwesomeIcon;
},
},



Expand All @@ -150,17 +121,12 @@ var app = new Vue({
this.activePage.fontAwesomeIconCss = "";
},



loadFromStorage: function()
{
var savedData = storage.getLocalStorage("sections");

this.populateSections(savedData);
},



populateSections: function(data)
{
if (data)
Expand All @@ -175,9 +141,6 @@ var app = new Vue({
}
}
},



loadCountryCodes: function()
{
console.log("loadCountryCodes(): data", countryCodes);
Expand Down Expand Up @@ -211,9 +174,6 @@ var app = new Vue({

return "";
},



displayLocation: function()
{
return this.sections.basics.location.city + ", " + this.getCountryName(this.sections.basics.location.countryCode);
Expand Down Expand Up @@ -242,9 +202,6 @@ var app = new Vue({
return 50;
}
},



languageFluencyAsPercent: function(index)
{
var fluency = this.$root.sections.skills[index].level;
Expand All @@ -266,9 +223,6 @@ var app = new Vue({
return 50;
}
},



workEndDate: function(index)
{
var endDate = this.$root.sections.work[index].endDate;
Expand All @@ -277,9 +231,6 @@ var app = new Vue({

return endDate;
},



projectEndDate: function(index)
{
var endDate = this.$root.sections.projects[index].endDate;
Expand All @@ -288,18 +239,12 @@ var app = new Vue({

return endDate;
},



dateMonthYear: function(dateString)
{
var dt = new Date(dateString);

return dt.getFullYear() + ", " + this.getMonthName(dt.getMonth() + 1);
},



getMonthName: function(monthNumber)
{
if (monthNumber == 1) return "January";
Expand All @@ -317,9 +262,6 @@ var app = new Vue({

return "";
},



/**
* Clear save data and reset the sections structure.
*/
Expand All @@ -335,9 +277,6 @@ var app = new Vue({

return false;
},



saveResume: function()
{
var response = confirm("Resume saved");
Expand All @@ -347,9 +286,6 @@ var app = new Vue({
alert("Resume saved");
return false;
},



/**
* Open the sidebar on smaller screens.
*/
Expand All @@ -372,9 +308,6 @@ var app = new Vue({
}
},




/**
* Open the sidebar on smaller screens.
*/
Expand All @@ -386,9 +319,6 @@ var app = new Vue({
mySidebar.style.display = "none";
overlayBg.style.display = "none";
},



/**
* Show the full-page loading overlay.
*/
Expand All @@ -406,9 +336,6 @@ var app = new Vue({
{
document.getElementById("full-page-overlay").style.display = "none";
},



/**
* Find and mark the main navigation item for the selected "current" page/route
*/
Expand Down Expand Up @@ -460,9 +387,6 @@ var app = new Vue({
}
}
},



/**
* Collapse or un-collapse a content element by setting its collapse state to opposite of current state.
* @param {string} id ID of the content element to collapse/un-collapse.
Expand All @@ -479,9 +403,6 @@ var app = new Vue({
x.className = x.className.replace(" w3-show", "");
}
},



/**
* Move the position of an element in an array.
*
Expand Down Expand Up @@ -528,9 +449,6 @@ var app = new Vue({
},





watch: {
/**
* Detect when a route changes.
Expand Down
9 changes: 9 additions & 0 deletions app/page_registration.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 2 additions & 0 deletions components/export.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ var exportComponent = {

mounted: function()
{
stringDate = new Date().toISOString();
this.$root.sections.meta.lastModified = stringDate.slice(0,16) + stringDate.slice(stringDate.lastIndexOf("Z")); //.replace(":","");
this.json = JSON.stringify(this.$root.sections, null, 4);
},

Expand Down
9 changes: 0 additions & 9 deletions components/preview_single_field.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
Vue.component("preview-field", {
template: '#preview-single-field-template',


props: [
'label',
'value',
Expand All @@ -10,22 +9,16 @@ Vue.component("preview-field", {
'format',
],



mounted: function()
{
this.displayFormat = (this.format ? this.format : "");
},



destroyed: function()
{

},



data: function()
{
return {
Expand All @@ -34,8 +27,6 @@ Vue.component("preview-field", {
};
},



methods: {
getLabel: function()
{
Expand Down
Loading