diff --git a/docs/logic/add.js b/docs/logic/add.js index 1e5429a..7bb0cb1 100644 --- a/docs/logic/add.js +++ b/docs/logic/add.js @@ -1,294 +1,297 @@ -const { ipcRenderer } = nodeRequire('electron'); - -function Add() +if (window.showAdd != undefined && window.showAdd) { - this.overlay = null; - this.display = null; - this.grid = null; + const { ipcRenderer } = nodeRequire('electron'); - this.elementList = []; - this.keys = null; - var parent = this; - - // STATE - this.enabledOverlay = false; - this.addedTitle = false - this.addedDate = false - this.addedPerson = false - this.addedSource = false - this.addedProject = false - this.addedType = false - this.addedLink = false - this.addedTags = false - this.addedNote = false - this.addedQuote = false - this.addedTerms = false - this.addedProgress = false - - this.install = function() + function Add() { - this.grid = document.getElementById("grid"); - this.overlay = document.getElementById("overlay"); + this.overlay = null; + this.display = null; + this.grid = null; + + this.elementList = []; + this.keys = null; + var parent = this; + + // STATE + this.enabledOverlay = false; + this.addedTitle = false + this.addedDate = false + this.addedPerson = false + this.addedSource = false + this.addedProject = false + this.addedType = false + this.addedLink = false + this.addedTags = false + this.addedNote = false + this.addedQuote = false + this.addedTerms = false + this.addedProgress = false + + this.install = function() + { + this.grid = document.getElementById("grid"); + this.overlay = document.getElementById("overlay"); + + this.setupElement('Title', 'TITLE', 'upper'); + this.setupElement('Date', 'DATE', 'lower'); + this.setupElement('Type', 'TYPE', 'lower'); + this.setupElement('Link', 'LINK', 'url'); + this.setupElement('Person', 'PERS', 'text'); + this.setupElement('Source', 'SRCE', 'title'); + this.setupElement('Project', 'PROJ', 'text'); + this.setupElement('Tags', 'TAGS', 'tags'); + this.setupElement('Progress', 'PROG', 'text'); + this.setupElement('Note', 'NOTE', 'text'); // long + this.setupElement('Quote', 'QOTE', 'quote'); // long + this.setupElement('Terms', 'TERM', 'quote'); // long + // DONE + // REVI + this.keys = Object.keys(this.elementList); + + // SETUP + this.overlay.innerHTML = ''; + let content = `