Skip to content

Commit e32ed8b

Browse files
authored
Merge pull request #36 from SolverForge/issue-17-module-boundaries
Split footer into its own frontend module
2 parents 7a04865 + cc29acd commit e32ed8b

File tree

5 files changed

+76
-54
lines changed

5 files changed

+76
-54
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ solverforge-ui/
431431
│ ├── 16-rail-blocks.css # rail blocks, changeovers, unassigned styles
432432
│ ├── 17-gantt-layout.css # split layout, grid table, view controls
433433
│ └── 18-gantt-bars.css # Frappe bar overrides, pinned/highlighted bars
434-
├── js-src/ # 15 JS source files
434+
├── js-src/ # 16 JS source files
435435
│ ├── 00-core.js # SF namespace, escHtml, el()
436436
│ ├── 01-score.js # score parsing
437437
│ ├── 02-colors.js # Tango palette + project colors
@@ -444,9 +444,10 @@ solverforge-ui/
444444
│ ├── 09-toast.js # showToast(), showError()
445445
│ ├── 10-backend.js # createBackend() — axum/tauri/fetch
446446
│ ├── 11-solver.js # createSolver() — SSE state machine
447-
│ ├── 12-api-guide.js # createApiGuide(), createFooter()
447+
│ ├── 12-api-guide.js # createApiGuide()
448448
│ ├── 13-rail.js # timeline rail header, cards, blocks, changeovers
449-
│ └── 14-gantt.js # Frappe Gantt wrapper (split pane, grid, chart)
449+
│ ├── 14-gantt.js # Frappe Gantt wrapper (split pane, grid, chart)
450+
│ └── 15-footer.js # createFooter()
450451
└── static/sf/ # Embedded assets (include_dir!)
451452
├── sf.css # concatenated from css-src/
452453
├── sf.js # concatenated from js-src/

js-src/12-api-guide.js

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -42,21 +42,4 @@
4242

4343
return guide;
4444
};
45-
46-
sf.createFooter = function (config) {
47-
sf.assert(config, 'createFooter(config) requires a configuration object');
48-
49-
var footer = sf.el('footer', { className: 'sf-footer' });
50-
if (config.links) {
51-
config.links.forEach(function (link, i) {
52-
if (i > 0) footer.appendChild(sf.el('span', { className: 'sf-vr' }));
53-
footer.appendChild(sf.el('a', { href: link.url, target: '_blank' }, link.label));
54-
});
55-
}
56-
if (config.version) {
57-
footer.appendChild(sf.el('span', { style: { marginLeft: 'auto' } }, config.version));
58-
}
59-
return footer;
60-
};
61-
6245
})(SF);

js-src/15-footer.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/* ============================================================================
2+
SolverForge UI — Footer Factory
3+
============================================================================ */
4+
5+
(function (sf) {
6+
'use strict';
7+
8+
sf.createFooter = function (config) {
9+
sf.assert(config, 'createFooter(config) requires a configuration object');
10+
11+
var footer = sf.el('footer', { className: 'sf-footer' });
12+
if (config.links) {
13+
config.links.forEach(function (link, i) {
14+
if (i > 0) footer.appendChild(sf.el('span', { className: 'sf-vr' }));
15+
footer.appendChild(sf.el('a', { href: link.url, target: '_blank' }, link.label));
16+
});
17+
}
18+
if (config.version) {
19+
footer.appendChild(sf.el('span', { style: { marginLeft: 'auto' } }, config.version));
20+
}
21+
return footer;
22+
};
23+
24+
})(SF);

static/sf/sf.0.1.0.js

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1137,23 +1137,6 @@ const SF = (function () {
11371137

11381138
return guide;
11391139
};
1140-
1141-
sf.createFooter = function (config) {
1142-
sf.assert(config, 'createFooter(config) requires a configuration object');
1143-
1144-
var footer = sf.el('footer', { className: 'sf-footer' });
1145-
if (config.links) {
1146-
config.links.forEach(function (link, i) {
1147-
if (i > 0) footer.appendChild(sf.el('span', { className: 'sf-vr' }));
1148-
footer.appendChild(sf.el('a', { href: link.url, target: '_blank' }, link.label));
1149-
});
1150-
}
1151-
if (config.version) {
1152-
footer.appendChild(sf.el('span', { style: { marginLeft: 'auto' } }, config.version));
1153-
}
1154-
return footer;
1155-
};
1156-
11571140
})(SF);
11581141
/* ============================================================================
11591142
SolverForge UI — Timeline Rail
@@ -1873,3 +1856,27 @@ const SF = (function () {
18731856
};
18741857

18751858
})(SF);
1859+
/* ============================================================================
1860+
SolverForge UI — Footer Factory
1861+
============================================================================ */
1862+
1863+
(function (sf) {
1864+
'use strict';
1865+
1866+
sf.createFooter = function (config) {
1867+
sf.assert(config, 'createFooter(config) requires a configuration object');
1868+
1869+
var footer = sf.el('footer', { className: 'sf-footer' });
1870+
if (config.links) {
1871+
config.links.forEach(function (link, i) {
1872+
if (i > 0) footer.appendChild(sf.el('span', { className: 'sf-vr' }));
1873+
footer.appendChild(sf.el('a', { href: link.url, target: '_blank' }, link.label));
1874+
});
1875+
}
1876+
if (config.version) {
1877+
footer.appendChild(sf.el('span', { style: { marginLeft: 'auto' } }, config.version));
1878+
}
1879+
return footer;
1880+
};
1881+
1882+
})(SF);

static/sf/sf.js

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1137,23 +1137,6 @@ const SF = (function () {
11371137

11381138
return guide;
11391139
};
1140-
1141-
sf.createFooter = function (config) {
1142-
sf.assert(config, 'createFooter(config) requires a configuration object');
1143-
1144-
var footer = sf.el('footer', { className: 'sf-footer' });
1145-
if (config.links) {
1146-
config.links.forEach(function (link, i) {
1147-
if (i > 0) footer.appendChild(sf.el('span', { className: 'sf-vr' }));
1148-
footer.appendChild(sf.el('a', { href: link.url, target: '_blank' }, link.label));
1149-
});
1150-
}
1151-
if (config.version) {
1152-
footer.appendChild(sf.el('span', { style: { marginLeft: 'auto' } }, config.version));
1153-
}
1154-
return footer;
1155-
};
1156-
11571140
})(SF);
11581141
/* ============================================================================
11591142
SolverForge UI — Timeline Rail
@@ -1873,3 +1856,27 @@ const SF = (function () {
18731856
};
18741857

18751858
})(SF);
1859+
/* ============================================================================
1860+
SolverForge UI — Footer Factory
1861+
============================================================================ */
1862+
1863+
(function (sf) {
1864+
'use strict';
1865+
1866+
sf.createFooter = function (config) {
1867+
sf.assert(config, 'createFooter(config) requires a configuration object');
1868+
1869+
var footer = sf.el('footer', { className: 'sf-footer' });
1870+
if (config.links) {
1871+
config.links.forEach(function (link, i) {
1872+
if (i > 0) footer.appendChild(sf.el('span', { className: 'sf-vr' }));
1873+
footer.appendChild(sf.el('a', { href: link.url, target: '_blank' }, link.label));
1874+
});
1875+
}
1876+
if (config.version) {
1877+
footer.appendChild(sf.el('span', { style: { marginLeft: 'auto' } }, config.version));
1878+
}
1879+
return footer;
1880+
};
1881+
1882+
})(SF);

0 commit comments

Comments
 (0)