-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
work to textual tree view of FEMA sitemap
- Loading branch information
Showing
5 changed files
with
173 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
/* | ||
window.onload = () => { | ||
createList(data); | ||
markupArray.push("</ul>"); | ||
$("#list").html(markupArray.join("")); | ||
}; | ||
*/ | ||
/* | ||
|
||
https://ajv.js.org/guide/getting-started.html#basic-data-validation | ||
https://www.npmjs.com/package/ajv | ||
|
||
// or ESM/TypeScript import | ||
import Ajv from "ajv" | ||
// Node.js require: | ||
const Ajv = require("ajv") | ||
|
||
const ajv = new Ajv() // options can be passed, e.g. {allErrors: true} | ||
|
||
const schema = { | ||
type: "object", | ||
properties: { | ||
foo: { type: "integer" }, | ||
bar: { type: "string" }, | ||
}, | ||
required: ["foo"], | ||
additionalProperties: false, | ||
} | ||
|
||
const data = { | ||
foo: 1, | ||
bar: "abc", | ||
} | ||
|
||
const validate = ajv.compile(schema) | ||
const valid = validate(data) | ||
if (!valid) console.log(validate.errors) | ||
|
||
|
||
*/ | ||
|
||
dataSource = { | ||
title: "", | ||
url: "emergency-managers", | ||
summary: "Emergency Managers", | ||
children: [ | ||
{ title: "Tools for Practitioners", url: "emergency-managers/practitioners" | ||
}, | ||
] | ||
}; | ||
|
||
/* | ||
Parent Page ID; | ||
Page ID; | ||
Page title; | ||
Block title; | ||
Block content; | ||
Page link; | ||
SEO title; | ||
SEO slug; | ||
SEO description; | ||
SEO H1; | ||
SEO additional | ||
*/ | ||
|
||
|
||
|
||
|
||
dataSource3 = { | ||
id: 1, | ||
name: "Lao Lao", | ||
title: "general manager", | ||
children: [ | ||
{ id: 2, name: "Bo Miao", title: "department manager" | ||
}, | ||
{ | ||
id: 3, | ||
name: "Su Miao", | ||
title: "department manager", | ||
children: [ | ||
{ id: 4, name: "Tie Hua", title: "senior engineer" | ||
}, | ||
{ | ||
id: 5, | ||
name: "Hei Hei", | ||
title: "senior engineer", | ||
children: [ | ||
{ id: 6, name: "Pang Pang", title: "engineer" | ||
}, | ||
{ id: 7, name: "Xiang Xiang", title: "UE engineer" | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
{ id: 8, name: "Yu Jie", title: "department manager" | ||
}, | ||
{ id: 9, name: "Yu Li", title: "department manager" | ||
}, | ||
{ id: 10, name: "Hong Miao", title: "department manager" | ||
}, | ||
{ id: 11, name: "Yu Wei", title: "department manager" | ||
}, | ||
{ id: 12, name: "Yu Tie", title: "department manager" | ||
}, | ||
], | ||
}; | ||
|
||
// See https://jsonlint.com/ for JSON formatting rules. | ||
// https://stackoverflow.com/questions/6692538/generate-unordered-list-from-json-data | ||
|
||
var jsonObj = { | ||
"labels": [ | ||
{ | ||
"labelFont": "35pt Calibri", | ||
"labelLocation": { | ||
"x": 0.1483, | ||
"y": 0.75 | ||
}, | ||
"labelText": "fluffer" | ||
}, | ||
{ | ||
"labelFont": "35pt Calibri", | ||
"labelLocation": { | ||
"x": 0.666, | ||
"y": 0.666 | ||
}, | ||
"labelText": "nutter" | ||
} | ||
] | ||
}; //some json to display |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"labels": [ | ||
{ | ||
"labelFont": "35pt Calibri", | ||
"labelLocation": { | ||
"x": 0.1483, | ||
"y": 0.75 | ||
}, | ||
"labelText": "fluffer" | ||
}, | ||
{ | ||
"labelFont": "35pt Calibri", | ||
"labelLocation": { | ||
"x": 0.666, | ||
"y": 0.666 | ||
}, | ||
"labelText": "nutter" | ||
} | ||
] | ||
} |