0 && a==-1){
+ alert("Can't add person without relation, select someone first!"); return;
+ }
+ var x,y;
+ var b=hole.length>0 ? hole[0] : json.people.length;
+ //console.log(a);
+ if (a!=-1) {
+ x=json.people[a].x+250;
+ y=json.people[a].y;
+ } else {
+ x=100;y=300;
+ }
+ var tmp={"id":b,"x":x,"y":y,"w":box.w,"h":box.h,"gn":gn.value,"fn":fn.value,"sx":sx.selectedIndex,"br":br.value,"dt":dt.value,"oi":oi.value};
+ if (hole.length>0){
+ //check for hole
+ //console.log(hole);
+ json.people[hole[0]]=tmp;
+ hole.shift();
+ } else {
+ //add to end
+ json.people.push(tmp);
+ }
+
+ if (a!=-1) {
+ json.lines.push({"id":a+"-"+b,"rl":rl.selectedIndex});
+ }
+ //hsChld[a].push(b);
+ bldHsCh();
+ poplst();
+ draw(1);
+}
+function updPer(){
+ //console.log(selc);
+ if (selc[0]!=-1) {
+ json.people[selc[0]].gn=gn.value;
+ json.people[selc[0]].fn=fn.value;
+ json.people[selc[0]].br=br.value;
+ json.people[selc[0]].dt=dt.value;
+ json.people[selc[0]].oi=oi.value;
+ json.people[selc[0]].sx=sx.selectedIndex;
+ //console.log();
+ draw(1);
+ }
+}
+function delPer(){
+ //console.log(selc,hsChld[selc]);
+ if (selc[0]==0 || hsChld[selc[0]] && hsChld[selc[0]].length>0) {
+ alert("Can't delete person with sub branches or id:0");
+ return;
+ } else {
+ //delete
+ json.people[selc[0]]=null;
+ //mark as hole for reuse;
+ hole.push(selc[0]);
+ }
+ for (a in json.lines) { ln.options.remove(0); } //clear
+
+ for(let i=0;i {
+ var inp=document.getElementById("inp").getBoundingClientRect();
+ var tmp=inp.top + window.scrollY;
+ //console.log(tmp,inp.top, window.scrollY);
+ can.style.top=tmp+"px";
+ draw(1);
+ }, "500");
+}
+
+//Listeners ***
+window.addEventListener('resize', function(event) { rstim=setTimeout(scale,150); }, true);
+can.onmousedown = clkd;
+can.onmouseout= clku;
+can.onmouseup = clku;
+can.onmousemove = movr;
+can.addEventListener("touchstart", clkd, {passive: true});
+can.addEventListener("touchend", clku, false);
+//spr.addEventListener("touchcancel", handleCancel, false);
+can.addEventListener("touchmove", movr, {passive: true});
+aPer.addEventListener('click', addPer);
+uPer.addEventListener('click', updPer);
+dPer.addEventListener('click', delPer);
+cent.addEventListener('click', pan);
+lt.onclick = function(){ openFD('.json',load) }
+st.addEventListener('click', save);
+nt.addEventListener('click', newt);
+ln.addEventListener('click', mselc);
+ln.addEventListener('keyup', mselc);
+rl.addEventListener('change', updln);
+bg.addEventListener('change', chbg);
+hd.addEventListener('click', hide);
+fu.addEventListener('click', fullscreen);
+//ln.addEventListener('dblclick', updln);
+json = JSON.parse(data);
+cent.cen = 1;
+pan(0,150); //move canvas down
+fullscreen(); // Set up offset
+start();
\ No newline at end of file
diff --git a/lib/Controller/PageController.php b/lib/Controller/PageController.php
new file mode 100644
index 0000000..ffc60f2
--- /dev/null
+++ b/lib/Controller/PageController.php
@@ -0,0 +1,37 @@
+userId = $UserId;
+ }
+
+ /**
+ * CAUTION: the @Stuff turns off security checks; for this page no admin is
+ * required and no CSRF check. If you don't know what CSRF is, read
+ * it up in the docs or you might create a security hole. This is
+ * basically the only required method to add this exemption, don't
+ * add it to any other method if you don't exactly know what it does
+ *
+ * @NoAdminRequired
+ * @NoCSRFRequired
+ */
+ public function index() {
+ $response = new TemplateResponse('familytree', 'index'); // templates/index.php
+ $csp = new ContentSecurityPolicy();
+ $csp->allowEvalScript(true);
+ $response->setContentSecurityPolicy($csp);
+
+ return $response;
+ }
+
+}
diff --git a/templates/content/index.php b/templates/content/index.php
new file mode 100644
index 0000000..081bc46
--- /dev/null
+++ b/templates/content/index.php
@@ -0,0 +1,48 @@
+
+
+
+
+
+
Tree name:
ID Lines: select id pair and set relation on left.
+
Given names:
+
Family name:
+
Gender:
+
+
+
Birth:
+
Death:
+
Other info:
+
Relation:
+
+
+
Buttons:
Version 1.2.1
+
+
+
+
+
+
+Background colour:
+ Select multiple
+
+
+
\ No newline at end of file
diff --git a/templates/index.php b/templates/index.php
new file mode 100644
index 0000000..5b5e189
--- /dev/null
+++ b/templates/index.php
@@ -0,0 +1,6 @@
+
+inc('content/index')); ?>
+