legacyweb-pages 1.0.4 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/images/stripebg.jpg +0 -0
- package/index.js +3 -3
- package/lib/page.js +129 -126
- package/lib/theme.js +45 -45
- package/package.json +24 -17
- package/templates/leftpane.ejs +45 -45
- package/templates/ribbon.ejs +38 -38
- package/themes/business.json +27 -27
- package/themes/christmas.json +29 -29
- package/themes/fall.json +29 -29
- package/themes/forest.json +29 -29
- package/themes/library.json +29 -29
- package/themes/news.json +31 -0
- package/themes/ocean.json +29 -29
- package/themes/sami.json +29 -29
- package/themes/space.json +28 -28
- package/themes/spring.json +29 -29
- package/themes/summer.json +29 -29
- package/themes/winter.json +29 -29
- package/samples/left-business/business.js +0 -30
- package/samples/left-business/content-home.pug +0 -2
- package/samples/left-business/content-page1.pug +0 -2
- package/samples/left-business/header.html +0 -1
- package/samples/left-christmas/christmas.js +0 -30
- package/samples/left-christmas/content-home.pug +0 -2
- package/samples/left-christmas/content-page1.pug +0 -2
- package/samples/left-christmas/header.html +0 -1
- package/samples/left-fall/content-home.pug +0 -2
- package/samples/left-fall/content-page1.pug +0 -2
- package/samples/left-fall/fall.js +0 -30
- package/samples/left-fall/header.html +0 -1
- package/samples/left-forest/content-home.pug +0 -2
- package/samples/left-forest/content-page1.pug +0 -2
- package/samples/left-forest/forest.js +0 -33
- package/samples/left-forest/header.html +0 -1
- package/samples/left-forest/images/leaves.jpg +0 -0
- package/samples/left-library/content-home.pug +0 -2
- package/samples/left-library/content-page1.pug +0 -2
- package/samples/left-library/header.html +0 -1
- package/samples/left-library/library.js +0 -30
- package/samples/left-ocean/content-home.pug +0 -2
- package/samples/left-ocean/content-page1.pug +0 -2
- package/samples/left-ocean/header.html +0 -1
- package/samples/left-ocean/ocean.js +0 -30
- package/samples/left-sami/content-home.pug +0 -2
- package/samples/left-sami/content-page1.pug +0 -2
- package/samples/left-sami/header.html +0 -1
- package/samples/left-sami/sami.js +0 -30
- package/samples/left-space/content-home.pug +0 -2
- package/samples/left-space/content-page1.pug +0 -2
- package/samples/left-space/header.html +0 -1
- package/samples/left-space/space.js +0 -30
- package/samples/left-spring/content-home.pug +0 -2
- package/samples/left-spring/content-page1.pug +0 -2
- package/samples/left-spring/header.html +0 -1
- package/samples/left-spring/spring.js +0 -30
- package/samples/left-summer/content-home.pug +0 -2
- package/samples/left-summer/content-page1.pug +0 -2
- package/samples/left-summer/header.html +0 -1
- package/samples/left-summer/summer.js +0 -30
- package/samples/left-winter/content-home.pug +0 -2
- package/samples/left-winter/content-page1.pug +0 -2
- package/samples/left-winter/header.html +0 -1
- package/samples/left-winter/winter.js +0 -30
- package/samples/ribbon-business/content-home.pug +0 -55
- package/samples/ribbon-business/content-page1.pug +0 -2
- package/samples/ribbon-business/header.html +0 -1
- package/samples/ribbon-business/ribbon-business.js +0 -28
- package/samples/ribbon-business/strip.pug +0 -1
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
# legacyweb-pages
|
|
2
|
-
|
|
3
|
-
This is a toolkit for generating simple pages for legacyweb.
|
|
4
|
-
|
|
1
|
+
# legacyweb-pages
|
|
2
|
+
|
|
3
|
+
This is a toolkit for generating simple pages for legacyweb.
|
|
4
|
+
|
|
5
5
|
It includes templates, themes, and functions for generating pages based on these. This project is currently under development.
|
|
Binary file
|
package/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const Page = require('./lib/page');
|
|
2
|
-
|
|
3
|
-
module.exports = Page;
|
|
1
|
+
const Page = require('./lib/page');
|
|
2
|
+
|
|
3
|
+
module.exports = Page;
|
package/lib/page.js
CHANGED
|
@@ -1,126 +1,129 @@
|
|
|
1
|
-
const ejs = require('ejs');
|
|
2
|
-
const express = require('express');
|
|
3
|
-
const fs = require('fs');
|
|
4
|
-
const path = require('path');
|
|
5
|
-
const joi = require('joi');
|
|
6
|
-
|
|
7
|
-
const relativePath = joi.string().regex(/^\/[a-zA-Z0-9\/?=]*$/);
|
|
8
|
-
|
|
9
|
-
function Page(template, theme, title, home, addHomeLink=true, staticPaths=[]) {
|
|
10
|
-
this.setTemplate(template);
|
|
11
|
-
this.setTheme(theme);
|
|
12
|
-
this.pages = [];
|
|
13
|
-
this.links = [];
|
|
14
|
-
this.addPage({
|
|
15
|
-
path: '/',
|
|
16
|
-
gen: home.gen,
|
|
17
|
-
title,
|
|
18
|
-
method: 'get'
|
|
19
|
-
});
|
|
20
|
-
if (addHomeLink) {
|
|
21
|
-
this.addLink({
|
|
22
|
-
url: '/',
|
|
23
|
-
text: 'Home'
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
this.headerHtml = '';
|
|
27
|
-
this.port = process.env.EXPRESS_PORT || 3000;
|
|
28
|
-
this.app = express();
|
|
29
|
-
|
|
30
|
-
//
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
legacyPage.app.
|
|
119
|
-
return;
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
|
|
1
|
+
const ejs = require('ejs');
|
|
2
|
+
const express = require('express');
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const joi = require('joi');
|
|
6
|
+
|
|
7
|
+
const relativePath = joi.string().regex(/^\/[a-zA-Z0-9\/?=]*$/);
|
|
8
|
+
|
|
9
|
+
function Page(template, theme, title, home, addHomeLink=true, staticPaths=[]) {
|
|
10
|
+
this.setTemplate(template);
|
|
11
|
+
this.setTheme(theme);
|
|
12
|
+
this.pages = [];
|
|
13
|
+
this.links = [];
|
|
14
|
+
this.addPage({
|
|
15
|
+
path: '/',
|
|
16
|
+
gen: home.gen,
|
|
17
|
+
title,
|
|
18
|
+
method: 'get'
|
|
19
|
+
});
|
|
20
|
+
if (addHomeLink) {
|
|
21
|
+
this.addLink({
|
|
22
|
+
url: '/',
|
|
23
|
+
text: 'Home'
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
this.headerHtml = '';
|
|
27
|
+
this.port = process.env.EXPRESS_PORT || 3000;
|
|
28
|
+
this.app = express();
|
|
29
|
+
|
|
30
|
+
// Pre-defined static paths
|
|
31
|
+
this.app.use('/images', express.static(path.join(__dirname, '..', 'images')));
|
|
32
|
+
|
|
33
|
+
// Define static paths
|
|
34
|
+
staticPaths.forEach(staticPath => {
|
|
35
|
+
this.app.use(staticPath.webPath, express.static(staticPath.filePath));
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
Page.prototype.setTemplate = function(template) {
|
|
40
|
+
const templateFile = path.join(__dirname, '..', 'templates', `${template}.ejs`);
|
|
41
|
+
if (!fs.existsSync(templateFile)) {
|
|
42
|
+
throw new Error(`Theme "${templateFile}" does not exist`);
|
|
43
|
+
}
|
|
44
|
+
this.template = fs.readFileSync(templateFile, 'utf-8');
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
Page.prototype.setTheme = function(theme) {
|
|
48
|
+
const themeFile = path.join(__dirname, '..', 'themes', `${theme}.json`);
|
|
49
|
+
if (!fs.existsSync(themeFile)) {
|
|
50
|
+
throw new Error(`Theme "${theme}" does not exist`);
|
|
51
|
+
}
|
|
52
|
+
this.theme = JSON.parse(fs.readFileSync(themeFile), 'utf-8');
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
Page.prototype.setBgImage = function(element, bgImage) {
|
|
56
|
+
joi.attempt(element, joi.string().valid('body', 'links', 'strip', 'content'));
|
|
57
|
+
this.theme[element].bgImage = bgImage;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
Page.prototype.setHeader = function(code) {
|
|
61
|
+
this.headerHtml = code;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
Page.prototype.setStrip = function(code) {
|
|
65
|
+
this.stripHtml = code;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
Page.prototype.addLink = function(link) {
|
|
69
|
+
joi.attempt(link, joi.object({
|
|
70
|
+
url: joi.alternatives().try(joi.string().uri(), relativePath).required(),
|
|
71
|
+
text: joi.string().min(1).required()
|
|
72
|
+
}));
|
|
73
|
+
this.links.push(link);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
Page.prototype.addPage = function(page) {
|
|
77
|
+
let validatedPage = joi.attempt(page, joi.object({
|
|
78
|
+
path: relativePath.required(),
|
|
79
|
+
gen: joi.func().required(),
|
|
80
|
+
title: joi.string().min(1).required(),
|
|
81
|
+
method: joi.string().valid('get', 'post').default('get'),
|
|
82
|
+
middleware: joi.array().default([])
|
|
83
|
+
}));
|
|
84
|
+
|
|
85
|
+
this.pages.push(validatedPage);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
Page.prototype.start = function() {
|
|
89
|
+
|
|
90
|
+
const legacyPage = this;
|
|
91
|
+
|
|
92
|
+
this.pages.forEach(page => {
|
|
93
|
+
const renderPage = async function(req, res) {
|
|
94
|
+
try {
|
|
95
|
+
// Render content first in case we want to change the theme, header, etc. as part of the gen fn
|
|
96
|
+
const content = await page.gen(req, res);
|
|
97
|
+
|
|
98
|
+
const data = Object.assign({
|
|
99
|
+
page: {
|
|
100
|
+
header: legacyPage.headerHtml,
|
|
101
|
+
strip: legacyPage.stripHtml,
|
|
102
|
+
title: page.title,
|
|
103
|
+
links: legacyPage.links,
|
|
104
|
+
content
|
|
105
|
+
}
|
|
106
|
+
}, legacyPage.theme);
|
|
107
|
+
const renderedPage = ejs.render(legacyPage.template, data);
|
|
108
|
+
|
|
109
|
+
res.status(200).send(renderedPage);
|
|
110
|
+
} catch (err) {
|
|
111
|
+
const statusCode = err.status || 500;
|
|
112
|
+
return res.status(statusCode).send(err.message);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
switch (page.method) {
|
|
117
|
+
case 'post':
|
|
118
|
+
legacyPage.app.post(page.path, page.middleware, renderPage);
|
|
119
|
+
return;
|
|
120
|
+
default:
|
|
121
|
+
legacyPage.app.get(page.path, page.middleware, renderPage);
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
this.app.listen(this.port);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
module.exports = Page
|
package/lib/theme.js
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
const joi = require('joi');
|
|
2
|
-
|
|
3
|
-
function Theme(theme) {
|
|
4
|
-
const schema = joi.object({
|
|
5
|
-
body: joi.object({
|
|
6
|
-
bgColor: joi.string().default('white'),
|
|
7
|
-
bgImage: joi.string().optional(),
|
|
8
|
-
linkColor: joi.string().default('blue'),
|
|
9
|
-
borderColor: joi.string().default('black'),
|
|
10
|
-
borderThickness: joi.number().default(4)
|
|
11
|
-
}).default(),
|
|
12
|
-
header: joi.object({
|
|
13
|
-
bgColor: joi.string().default('white'),
|
|
14
|
-
bgImage: joi.string().optional(),
|
|
15
|
-
font: joi.object({
|
|
16
|
-
face: joi.string().default('Tahoma'),
|
|
17
|
-
bold: joi.boolean().default(true),
|
|
18
|
-
color: joi.string().default('black')
|
|
19
|
-
}).default()
|
|
20
|
-
}).default(),
|
|
21
|
-
links: joi.object({
|
|
22
|
-
bgColor: joi.string().default('white'),
|
|
23
|
-
bgImage: joi.string().optional(),
|
|
24
|
-
font: joi.object({
|
|
25
|
-
face: joi.string().default('Tahoma'),
|
|
26
|
-
bold: joi.boolean.default(true),
|
|
27
|
-
color: joi.string().default('black')
|
|
28
|
-
}).default()
|
|
29
|
-
}),
|
|
30
|
-
content: joi.object({
|
|
31
|
-
bgColor: joi.string().default('white'),
|
|
32
|
-
bgImage: joi.string().optional(),
|
|
33
|
-
font: joi.object({
|
|
34
|
-
face: joi.string().default('Tahoma'),
|
|
35
|
-
bold: joi.boolean.default(false),
|
|
36
|
-
color: joi.string().default('black')
|
|
37
|
-
}).default()
|
|
38
|
-
}).default()
|
|
39
|
-
}).default();
|
|
40
|
-
|
|
41
|
-
const validated = joi.attempt(theme, schema, {stripUnknown: true});
|
|
42
|
-
|
|
43
|
-
return validated;
|
|
44
|
-
}
|
|
45
|
-
|
|
1
|
+
const joi = require('joi');
|
|
2
|
+
|
|
3
|
+
function Theme(theme) {
|
|
4
|
+
const schema = joi.object({
|
|
5
|
+
body: joi.object({
|
|
6
|
+
bgColor: joi.string().default('white'),
|
|
7
|
+
bgImage: joi.string().optional(),
|
|
8
|
+
linkColor: joi.string().default('blue'),
|
|
9
|
+
borderColor: joi.string().default('black'),
|
|
10
|
+
borderThickness: joi.number().default(4)
|
|
11
|
+
}).default(),
|
|
12
|
+
header: joi.object({
|
|
13
|
+
bgColor: joi.string().default('white'),
|
|
14
|
+
bgImage: joi.string().optional(),
|
|
15
|
+
font: joi.object({
|
|
16
|
+
face: joi.string().default('Tahoma'),
|
|
17
|
+
bold: joi.boolean().default(true),
|
|
18
|
+
color: joi.string().default('black')
|
|
19
|
+
}).default()
|
|
20
|
+
}).default(),
|
|
21
|
+
links: joi.object({
|
|
22
|
+
bgColor: joi.string().default('white'),
|
|
23
|
+
bgImage: joi.string().optional(),
|
|
24
|
+
font: joi.object({
|
|
25
|
+
face: joi.string().default('Tahoma'),
|
|
26
|
+
bold: joi.boolean.default(true),
|
|
27
|
+
color: joi.string().default('black')
|
|
28
|
+
}).default()
|
|
29
|
+
}),
|
|
30
|
+
content: joi.object({
|
|
31
|
+
bgColor: joi.string().default('white'),
|
|
32
|
+
bgImage: joi.string().optional(),
|
|
33
|
+
font: joi.object({
|
|
34
|
+
face: joi.string().default('Tahoma'),
|
|
35
|
+
bold: joi.boolean.default(false),
|
|
36
|
+
color: joi.string().default('black')
|
|
37
|
+
}).default()
|
|
38
|
+
}).default()
|
|
39
|
+
}).default();
|
|
40
|
+
|
|
41
|
+
const validated = joi.attempt(theme, schema, {stripUnknown: true});
|
|
42
|
+
|
|
43
|
+
return validated;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
46
|
module.exports = Theme;
|
package/package.json
CHANGED
|
@@ -1,17 +1,24 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "legacyweb-pages",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "A toolkit for generating legacyweb pages",
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
8
|
-
},
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "legacyweb-pages",
|
|
3
|
+
"version": "1.0.5",
|
|
4
|
+
"description": "A toolkit for generating legacyweb pages",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"images/**",
|
|
11
|
+
"lib/**",
|
|
12
|
+
"templates/**",
|
|
13
|
+
"themes/**",
|
|
14
|
+
"index.js"
|
|
15
|
+
],
|
|
16
|
+
"author": "Justin Schwartzbeck (justinmschw@gmail.com)",
|
|
17
|
+
"license": "ISC",
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"ejs": "^3.1.8",
|
|
20
|
+
"express": "^4.18.2",
|
|
21
|
+
"joi": "17.5.0",
|
|
22
|
+
"pug": "3.0.2"
|
|
23
|
+
}
|
|
24
|
+
}
|
package/templates/leftpane.ejs
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
<html>
|
|
2
|
-
<title><%= page.title %></title>
|
|
3
|
-
<body bgcolor="<%= body.bgColor %>" <% if (body.bgImage) { %>background="<%- body.bgImage %>"<% } %> link="<%= body.linkColor %>" vlink="<%= body.linkColor %>">
|
|
4
|
-
|
|
5
|
-
<table width="780px" border=0>
|
|
6
|
-
<tr>
|
|
7
|
-
<!-- This is actually where the "border" color is defined -->
|
|
8
|
-
<td bgcolor="<%= body.borderColor %>">
|
|
9
|
-
|
|
10
|
-
<!-- This inner table is where the page content (header, links, content) actually go
|
|
11
|
-
cellspacing = border thickness
|
|
12
|
-
-->
|
|
13
|
-
<table width="780px" border=0 cellspacing=<%= body.borderThickness %> >
|
|
14
|
-
<tr />
|
|
15
|
-
|
|
16
|
-
<td height=80px colspan=2 bgcolor="<%= header.bgColor %>" <% if (header.bgImage) { %> background="<%= header.bgImage %>" <% } %>>
|
|
17
|
-
<font size=7 face="<%= header.font.face %>" color="<%= header.font.color %>">
|
|
18
|
-
<% if (header.font.bold) { %> <b><%- page.header %></b> <% } else { %><%- page.header %><% } %>
|
|
19
|
-
</font>
|
|
20
|
-
</td>
|
|
21
|
-
|
|
22
|
-
<tr />
|
|
23
|
-
<td height=600px width=180px bgcolor="<%= links.bgColor %>" <% if (links.bgImage) { %> background="<%= links.bgImage %>" <% } %> valign=top>
|
|
24
|
-
<table border="0">
|
|
25
|
-
<% page.links.forEach(link => { %>
|
|
26
|
-
<tr>
|
|
27
|
-
<td <% if (links.bgColor) { %>bgcolor="<%= links.bgColor %>"<% } %>>
|
|
28
|
-
<font size=4 face="<%= links.font.face %>">
|
|
29
|
-
<% if (links.font.bold) { %><b><a href="<%- link.url %>"><%= link.text %></a></b><% } else { %><a href="<%- link.url %>"><%= link.text %></a><% } %>
|
|
30
|
-
</font>
|
|
31
|
-
</td>
|
|
32
|
-
</tr>
|
|
33
|
-
<%})%>
|
|
34
|
-
</table>
|
|
35
|
-
</td>
|
|
36
|
-
<td height=600px width=600px bgcolor="<%= content.bgColor %>" <% if (content.bgImage) { %> background="<%= content.bgImage %>" <% } %> valign=top>
|
|
37
|
-
<font face="<%= content.font.face %>">
|
|
38
|
-
<%- page.content %>
|
|
39
|
-
</font>
|
|
40
|
-
</td>
|
|
41
|
-
</table>
|
|
42
|
-
</td>
|
|
43
|
-
</table>
|
|
44
|
-
|
|
45
|
-
</body>
|
|
1
|
+
<html>
|
|
2
|
+
<title><%= page.title %></title>
|
|
3
|
+
<body bgcolor="<%= body.bgColor %>" <% if (body.bgImage) { %>background="<%- body.bgImage %>"<% } %> link="<%= body.linkColor %>" vlink="<%= body.linkColor %>">
|
|
4
|
+
|
|
5
|
+
<table width="780px" border=0>
|
|
6
|
+
<tr>
|
|
7
|
+
<!-- This is actually where the "border" color is defined -->
|
|
8
|
+
<td bgcolor="<%= body.borderColor %>">
|
|
9
|
+
|
|
10
|
+
<!-- This inner table is where the page content (header, links, content) actually go
|
|
11
|
+
cellspacing = border thickness
|
|
12
|
+
-->
|
|
13
|
+
<table width="780px" border=0 cellspacing=<%= body.borderThickness %> >
|
|
14
|
+
<tr />
|
|
15
|
+
|
|
16
|
+
<td height=80px colspan=2 bgcolor="<%= header.bgColor %>" <% if (header.bgImage) { %> background="<%= header.bgImage %>" <% } %>>
|
|
17
|
+
<font size=7 face="<%= header.font.face %>" color="<%= header.font.color %>">
|
|
18
|
+
<% if (header.font.bold) { %> <b><%- page.header %></b> <% } else { %><%- page.header %><% } %>
|
|
19
|
+
</font>
|
|
20
|
+
</td>
|
|
21
|
+
|
|
22
|
+
<tr />
|
|
23
|
+
<td height=600px width=180px bgcolor="<%= links.bgColor %>" <% if (links.bgImage) { %> background="<%= links.bgImage %>" <% } %> valign=top>
|
|
24
|
+
<table border="0">
|
|
25
|
+
<% page.links.forEach(link => { %>
|
|
26
|
+
<tr>
|
|
27
|
+
<td <% if (links.bgColor) { %>bgcolor="<%= links.bgColor %>"<% } %>>
|
|
28
|
+
<font size=4 face="<%= links.font.face %>">
|
|
29
|
+
<% if (links.font.bold) { %><b><a href="<%- link.url %>"><%= link.text %></a></b><% } else { %><a href="<%- link.url %>"><%= link.text %></a><% } %>
|
|
30
|
+
</font>
|
|
31
|
+
</td>
|
|
32
|
+
</tr>
|
|
33
|
+
<%})%>
|
|
34
|
+
</table>
|
|
35
|
+
</td>
|
|
36
|
+
<td height=600px width=600px bgcolor="<%= content.bgColor %>" <% if (content.bgImage) { %> background="<%= content.bgImage %>" <% } %> valign=top>
|
|
37
|
+
<font face="<%= content.font.face %>">
|
|
38
|
+
<%- page.content %>
|
|
39
|
+
</font>
|
|
40
|
+
</td>
|
|
41
|
+
</table>
|
|
42
|
+
</td>
|
|
43
|
+
</table>
|
|
44
|
+
|
|
45
|
+
</body>
|
|
46
46
|
</html>
|
package/templates/ribbon.ejs
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
<html>
|
|
2
|
-
<title><%= page.title %></title>
|
|
3
|
-
<body bgcolor="<%= body.bgColor %>" <% if (body.bgImage) { %>background="<%- body.bgImage %>"<% } %> link="<%= body.linkColor %>" vlink="<%= body.linkColor %>">
|
|
4
|
-
<center>
|
|
5
|
-
<table width="786px" border=0>
|
|
6
|
-
<tr>
|
|
7
|
-
<!-- This is actually where the "border" color is defined -->
|
|
8
|
-
<td bgcolor="<%= body.borderColor %>">
|
|
9
|
-
|
|
10
|
-
<!-- This inner table is where the page content (header, links, content) actually go
|
|
11
|
-
cellspacing = border thickness
|
|
12
|
-
-->
|
|
13
|
-
<table width="780px" border=0 cellspacing=<%= body.borderThickness %> >
|
|
14
|
-
<tr />
|
|
15
|
-
|
|
16
|
-
<td height=80px bgcolor="<%= header.bgColor %>" <% if (header.bgImage) { %> background="<%= header.bgImage %>" <% } %>>
|
|
17
|
-
<font size=7 face="<%= header.font.face %>" color="<%= header.font.color %>">
|
|
18
|
-
<% if (header.font.bold) { %> <b><%- page.header %></b> <% } else { %><%- page.header %><% } %>
|
|
19
|
-
</font>
|
|
20
|
-
</td>
|
|
21
|
-
|
|
22
|
-
<tr>
|
|
23
|
-
<td height=20px bgcolor="<%= links.bgColor %>" <% if (links.bgImage) { %> background="<%= links.bgImage %>" <% } %> valign=top>
|
|
24
|
-
<%- page.strip %>
|
|
25
|
-
</td>
|
|
26
|
-
</tr>
|
|
27
|
-
<tr />
|
|
28
|
-
|
|
29
|
-
<td bgcolor="<%= content.bgColor %>" <% if (content.bgImage) { %> background="<%= content.bgImage %>" <% } %> valign=top>
|
|
30
|
-
<font face="<%= content.font.face %>">
|
|
31
|
-
<%- page.content %>
|
|
32
|
-
</font>
|
|
33
|
-
</td>
|
|
34
|
-
</table>
|
|
35
|
-
</td>
|
|
36
|
-
</table>
|
|
37
|
-
</center>
|
|
38
|
-
</body>
|
|
1
|
+
<html>
|
|
2
|
+
<title><%= page.title %></title>
|
|
3
|
+
<body bgcolor="<%= body.bgColor %>" <% if (body.bgImage) { %>background="<%- body.bgImage %>"<% } %> link="<%= body.linkColor %>" vlink="<%= body.linkColor %>">
|
|
4
|
+
<center>
|
|
5
|
+
<table width="786px" border=0>
|
|
6
|
+
<tr>
|
|
7
|
+
<!-- This is actually where the "border" color is defined -->
|
|
8
|
+
<td bgcolor="<%= body.borderColor %>">
|
|
9
|
+
|
|
10
|
+
<!-- This inner table is where the page content (header, links, content) actually go
|
|
11
|
+
cellspacing = border thickness
|
|
12
|
+
-->
|
|
13
|
+
<table width="780px" border=0 cellspacing=<%= body.borderThickness %> >
|
|
14
|
+
<tr />
|
|
15
|
+
|
|
16
|
+
<td height=80px bgcolor="<%= header.bgColor %>" <% if (header.bgImage) { %> background="<%= header.bgImage %>" <% } %>>
|
|
17
|
+
<font size=7 face="<%= header.font.face %>" color="<%= header.font.color %>">
|
|
18
|
+
<% if (header.font.bold) { %> <b><%- page.header %></b> <% } else { %><%- page.header %><% } %>
|
|
19
|
+
</font>
|
|
20
|
+
</td>
|
|
21
|
+
|
|
22
|
+
<tr>
|
|
23
|
+
<td height=20px bgcolor="<%= links.bgColor %>" <% if (links.bgImage) { %> background="<%= links.bgImage %>" <% } %> valign=top>
|
|
24
|
+
<%- page.strip %>
|
|
25
|
+
</td>
|
|
26
|
+
</tr>
|
|
27
|
+
<tr />
|
|
28
|
+
|
|
29
|
+
<td bgcolor="<%= content.bgColor %>" <% if (content.bgImage) { %> background="<%= content.bgImage %>" <% } %> valign=top>
|
|
30
|
+
<font face="<%= content.font.face %>">
|
|
31
|
+
<%- page.content %>
|
|
32
|
+
</font>
|
|
33
|
+
</td>
|
|
34
|
+
</table>
|
|
35
|
+
</td>
|
|
36
|
+
</table>
|
|
37
|
+
</center>
|
|
38
|
+
</body>
|
|
39
39
|
</html>
|
package/themes/business.json
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
{
|
|
2
|
-
"body": {
|
|
3
|
-
"bgColor": "#00008B",
|
|
4
|
-
"linkColor": "blue",
|
|
5
|
-
"borderColor": "black",
|
|
6
|
-
"borderThickness": 4
|
|
7
|
-
},
|
|
8
|
-
"header": {
|
|
9
|
-
"bgColor": "#808080",
|
|
10
|
-
"font": {
|
|
11
|
-
"face": "Courier New",
|
|
12
|
-
"bold": true
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
"links": {
|
|
16
|
-
"bgColor": "#D3D3D3",
|
|
17
|
-
"font": {
|
|
18
|
-
"face": "Tahoma",
|
|
19
|
-
"bold": true
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
"content": {
|
|
23
|
-
"bgColor": "#FFFFFF",
|
|
24
|
-
"font": {
|
|
25
|
-
"face": "Tahoma"
|
|
26
|
-
}
|
|
27
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"body": {
|
|
3
|
+
"bgColor": "#00008B",
|
|
4
|
+
"linkColor": "blue",
|
|
5
|
+
"borderColor": "black",
|
|
6
|
+
"borderThickness": 4
|
|
7
|
+
},
|
|
8
|
+
"header": {
|
|
9
|
+
"bgColor": "#808080",
|
|
10
|
+
"font": {
|
|
11
|
+
"face": "Courier New",
|
|
12
|
+
"bold": true
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"links": {
|
|
16
|
+
"bgColor": "#D3D3D3",
|
|
17
|
+
"font": {
|
|
18
|
+
"face": "Tahoma",
|
|
19
|
+
"bold": true
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"content": {
|
|
23
|
+
"bgColor": "#FFFFFF",
|
|
24
|
+
"font": {
|
|
25
|
+
"face": "Tahoma"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
28
|
}
|