16 Commits
Author SHA1 Message Date
TheWitness d34fbaacc4 fix: Restore base javascript files for testing (#8037)
* fix: Restore base javascript files for testing

* fix: screenfull 6.0.2 is missing screenfull.js

* fix: Restoring screenful after discovering how the files are managed

* fix: Remove node modules directory after installing modules

* fix: Change in screenfull.js behavior affects cacti

* fix: Restore jQuery 4 compatibility in the tablesorter pager plugin

$.isArray()/$.trim() were removed in jQuery 4.0, which this PR pins in
package.json. The restored jquery.tablesorter.pager.js still called
E.isArray(...)/E.trim(...), so any Ajax pager response threw before
rendering. Also fix a TypeError in the countChildRows branch, which
indexed into `a` while it was still an undeclared var.

Add patches/tablesorter+2.32.0.patch so the fix survives the next
`npm run build:js` sync from node_modules, following the existing
pace-js patch-package precedent.

* fix: Rewrite screenfull's ESM export during sync-js instead of downgrading

screenfull 6+ ships ESM-only (`export default screenfull;` in
node_modules/screenfull/index.js), which throws "export declarations
may only appear at top level of a module" when the copied file is
loaded as a classic <script>.

Add a post-copy transform step to build/sync-js.mjs that rewrites that
line to `window.screenfull = screenfull;` for include/js/screenfull.js,
so the 6.0.2 pin in package.json can be kept instead of reverting to
5.2.0. Throws if the expected export line isn't found, so a future
screenfull release changing its export shape fails the build loudly
rather than silently shipping a broken asset.

Updates tests/js/sync_js.test.mjs to cover the transform and its
failure mode.
2026-09-18 06:16:35 -07:00
Thomas Vincent ca2e4f07c2 Build releases from managed dependencies (#7888)
* chore: manage front-end JavaScript libraries with npm and Dependabot

Move all third-party front-end JavaScript to npm so Dependabot tracks it, and
drop the committed copies in favour of a build. package.json pins jquery,
jquery-ui, jstree (3.3.12 -> 3.3.17), billboard.js, pace-js, tablesorter and
jquery-validation; build/sync-js.mjs copies their dist files into include/js/
and runs on npm install via postinstall.

pace-js carries a one-line local fix (a stray regex alternation that made it
match the empty string) applied through patch-package
(patches/pace-js+1.2.4.patch); the fix should be sent upstream so the patch can
be dropped. Only Cacti's own themed jquery-ui/jstree CSS stays committed.

An npm ecosystem is added to dependabot.yml for develop. The release pipeline
and any workflow that serves Cacti pages must run 'npm ci' (which builds via
postinstall) before use, since the generated files are no longer in the tree.

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>

* hardening: remove vendored development artifacts

* feat(release): attach the built artifact to the release

The workflow already builds an attested, checksummed archive carrying the
Composer dependencies, then discards it after thirty days.

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>

* ci: fail the publish step when the bundle is empty

An unmatched glob would otherwise reach gh as a literal path.

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>

* ci: treat the maintenance lock notice as expected log output

The line records the lock working, so a second maintenance run overlapping
in CI failed unrelated pull requests.

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>

* docs: consolidate release dependency changelog

* ci: build managed JavaScript in release artifacts

* test: cover managed JavaScript build end to end

* deps: complete phpseclib 4 migration

* deps: update patch-package to audited release

* ci: satisfy workflow shell policy

* chore: source DOMPurify from npm and update it to 3.4.14

Add dompurify to the npm-managed set (was committed at 3.4.7) and bump to 3.4.14.
DOMPurify is the client-side XSS sanitizer used on tree labels, device tooltips
and plugin messages; keeping it current with upstream bypass fixes matters more
than for the UI libraries.

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>

* docs: preserve release changelog ordering

* test: preserve DOMPurify source map in npm build

* chore: source htmx, d3, big.js, lzjs and screenfull from npm

Add the remaining unmodified third-party libraries to the npm-managed build:
htmx.org 2.0.6, d3 7.8.2, big.js 6.2.2, lzjs 1.3.1 and screenfull 3.3.3. Each
was verified byte-identical (lzjs differs only in a JSDoc comment) to the copies
being removed. htmx in particular moves from a hand-tracked SHA pin to npm with
lockfile integrity.

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>

* test: cover phpseclib 4 integration

* ci: build managed assets before htmx tests

---------

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
2026-09-01 23:11:49 -07:00
Petr Macek 108eb73eb0 update billboard.js and d3.js (#5253)
* update billboard.js and d3.js

* update
2023-03-07 08:20:58 -05:00
TheWitness 26ec752ef0 Swapping out c3 for billboard, fix help rendering on Settings page, light CSS fixes
These changes facilitate Intropage 4.0's release.
2021-03-31 19:58:25 -04:00
TheWitness 7c0cfe4a01 Partially rolling back #3927 due to compatibility
It looks like c3 needs to be updated to be compatible with d3 version 6.  Link to related issues here: https://groups.google.com/g/c3js/c/yFj7NVpat4Y
2020-11-21 10:18:10 -05:00
DavidLiedkeandTheWitness e1ec7d6a62 Update c3.js & d3.js (#3927)
Co-authored-by: TheWitness <thewitness@cacti.net>
2020-11-20 08:41:22 -05:00
DavidLiedke 916b53d846 Update JavaScript library c3.js to version 0.6.14 (#2810)
* Update c3.js & d3.js

* Update Changelog
2019-07-08 11:02:13 +01:00
DavidLiedkeandMark Brugnoli-Vinten 80da122ffb Update d3.js to 5.9.2 (#2729)
* Update d3.js to 5.9.2

... from 5.9.1

* Update feature number for d3 change


Co-authored-by: Mark Brugnoli-Vinten <netniv@hotmail.com>
2019-06-11 17:49:39 +01:00
DavidLiedke 73abced31d Update d3.js to 5.9.1 (#2399)
... from 5.7.0
2019-02-11 23:07:58 +00:00
DavidLiedke b2250669ed Update c3.js and d3.js (#2039)
c3.js to 0.6.8 from 0.5.4
d3.js to 5.7.0 from 4.13.0
2018-10-09 10:39:55 +01:00
DavidLiedke a3252c1af5 Update d3.js to 4.13 (#1307)
from 4.12.2
2018-02-06 17:37:04 -07:00
DavidLiedke c34e0e2467 Update d3.js to 4.12.2 (#1235)
from 4.10.2
2018-01-19 07:29:59 -06:00
DavidLiedke 46ca87d4f5 .js Updates (#976)
* Update d3.js to 4.10.2

* Update screenfull.js to 3.3.1

* Update Chart.js to 2.7
2017-09-15 06:46:24 -05:00
DavidLiedke e66d18b98e Update d3.js to 4.9.1 2017-05-31 21:08:24 +02:00
cigamit 3a1b33da27 Update d3.js to latest version 2017-04-02 07:26:13 -05:00
cigamit 796e5210d4 adding d3 and c3 charting apis 2016-07-19 21:55:50 -05:00