Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
b1771bd
Update README.md
JorchCortez Jan 1, 2025
32b677e
Merge pull request #40 from TheCodeRaccoons/Develop
JorchCortez Jan 5, 2025
8a59c5f
Merge pull request #45 from TheCodeRaccoons/Develop
JorchCortez Feb 2, 2025
dbf1e01
Merge pull request #48 from TheCodeRaccoons/Develop
JorchCortez Aug 5, 2025
3d0dbac
Merge pull request #50 from TheCodeRaccoons/Develop
JorchCortez Aug 19, 2025
d176679
Merge pull request #52 from TheCodeRaccoons/Develop
JorchCortez Aug 19, 2025
50db838
Merge pull request #54 from TheCodeRaccoons/Develop
JorchCortez Aug 19, 2025
6c6f69b
Update monthly hits badge in README
JorchCortez Sep 23, 2025
b8463c8
Merge pull request #55 from TheCodeRaccoons/JorchCortez-patch-1
JorchCortez Sep 23, 2025
9a9eb88
Fix error handling for undefined platform in ShareLink
JorchCortez Sep 24, 2025
a247642
Merge pull request #56 from TheCodeRaccoons/JorchCortez-patch-1
JorchCortez Sep 24, 2025
1eed54f
Once you click the copy button it will say clicked and an alert messa…
Likhithakathireddy Oct 29, 2025
f07411e
Update README with development follow link
JorchCortez Nov 6, 2025
26ff976
Merge pull request #59 from TheCodeRaccoons/JorchCortez-patch-2
JorchCortez Nov 6, 2025
2b39f51
Add .gitignore to exclude node_modules
JorchCortez Nov 7, 2025
5dd766b
Refactor ShareLink copy feedback and add template support
JorchCortez Nov 7, 2025
01f63d7
Add GitHub Actions workflow for tests
JorchCortez Nov 7, 2025
c43ad14
Add ShareLink Jest tests and setup dependencies
JorchCortez Nov 7, 2025
5395833
Add support for per-element copy template in ShareLink
JorchCortez Nov 7, 2025
d0b4f1c
Update tests.yml
JorchCortez Nov 7, 2025
1d814cb
Merge pull request #58 from Likhithakathireddy/feature/copiedstate
JorchCortez Nov 7, 2025
36329df
docs: add auto-updating contributors section and workflow
JorchCortez Nov 7, 2025
8868c7d
Add CommonJS exports and tests for functional modules
JorchCortez Nov 8, 2025
11fbea6
Update Dist/Functional/ReadTime.js
JorchCortez Nov 8, 2025
c994795
Update Dist/Functional/Marquee.js
JorchCortez Nov 8, 2025
a2ae3a1
Improve Marquee cloning safety and test reliability
JorchCortez Nov 8, 2025
223fe7c
Merge branch 'CopyToClipboard-unit-tests' of https://github.com/TheCo…
JorchCortez Nov 8, 2025
407b384
Merge pull request #61 from TheCodeRaccoons/CopyToClipboard-unit-tests
JorchCortez Nov 8, 2025
e8bb398
Add tests for CookieConsent and enable module export
JorchCortez Nov 10, 2025
47b1aef
Add tests and export for CountUp module
JorchCortez Nov 10, 2025
1c5450a
Add tests for FormCheck and enable module export
JorchCortez Nov 10, 2025
2ff790e
Polyfill innerText for jsdom in Jest setup
JorchCortez Nov 10, 2025
20b5074
Add Jest tests and improve CMSFilter module export
JorchCortez Nov 10, 2025
c64199f
Add tests and export for FormatNumbers module
JorchCortez Nov 10, 2025
c1abd49
Add Node.js test workflow with coverage reporting
JorchCortez Nov 10, 2025
29f0173
Add CommonJS export and tests for CMSSelect
JorchCortez Nov 10, 2025
55d822b
Update contributors-readme-action version
JorchCortez Nov 10, 2025
f44b098
Merge pull request #63 from TheCodeRaccoons/JorchCortez-patch-3
JorchCortez Nov 10, 2025
4a71fd4
Merge pull request #62 from TheCodeRaccoons/Feature-adding-tests-to-p…
JorchCortez Nov 10, 2025
ac74506
Update contributors-readme-action to version 2.3.11
JorchCortez Nov 10, 2025
ad6ac3a
Merge pull request #64 from TheCodeRaccoons/JorchCortez-patch-3
JorchCortez Nov 10, 2025
2bf26e7
Add pull-requests write permission to workflow
JorchCortez Nov 10, 2025
cc7e801
Merge pull request #65 from TheCodeRaccoons/JorchCortez-patch-4
JorchCortez Nov 10, 2025
fb43cfe
docs(readme): update contributors [skip ci]
github-actions[bot] Nov 10, 2025
195d850
Revise contributors section in README.md
JorchCortez Nov 10, 2025
8277017
Merge pull request #67 from TheCodeRaccoons/JorchCortez-patch-5
JorchCortez Nov 10, 2025
26b2d9d
Merge branch 'main' into contributors-readme-action-y9sQcMy4PB
JorchCortez Nov 10, 2025
ecab1f3
Merge pull request #66 from TheCodeRaccoons/contributors-readme-actio…
JorchCortez Nov 10, 2025
c79a846
Update README.md
JorchCortez Nov 10, 2025
5159055
Update monthly hits badge in README
JorchCortez Nov 10, 2025
1f42088
Remove GitHub License badge
JorchCortez Nov 12, 2025
f563a5a
Update tests.yml to report coverage summary
JorchCortez Dec 9, 2025
8daee36
Update package.json with new version and test settings
JorchCortez Jan 7, 2026
b5f1fdc
adds optional parameter for maximum elements displayed if the wt-cms-…
matthewcsimpson Feb 25, 2026
e2b9e15
Merge pull request #1 from matthewcsimpson/feature/cms-filter-optiona…
matthewcsimpson Feb 25, 2026
f95a215
address PR feedback
matthewcsimpson Feb 26, 2026
e6efa86
Merge pull request #69 from matthewcsimpson/feature/cms-filter-option…
JorchCortez Feb 26, 2026
5d573a9
docs(readme): update contributors [skip ci]
github-actions[bot] Feb 26, 2026
97b861e
Merge pull request #70 from TheCodeRaccoons/contributors-readme-actio…
JorchCortez Feb 26, 2026
abb6446
Merge branch 'TheCodeRaccoons:main' into main
matthewcsimpson Mar 9, 2026
2313a4e
feat: rangeslidersimple
Mar 19, 2026
4926cf1
css revision
Mar 19, 2026
302d497
vnumber
Mar 19, 2026
aa98ae5
simplify
Mar 19, 2026
dc3f6db
simplification
Mar 19, 2026
24e5a89
z-index changes
Mar 19, 2026
ea24283
selection update
Mar 19, 2026
2d06c61
track styling
Mar 19, 2026
2dc4f13
track styling
Mar 19, 2026
d798390
release candidate
Mar 19, 2026
40fc69b
testing update
Mar 19, 2026
c8aff02
pr feedback, float vs in
Mar 20, 2026
7b96473
pr feedback readme update
Mar 20, 2026
2b6f091
pr feedback: version
Mar 20, 2026
c8eaab9
pr feedback
Mar 20, 2026
bf0dca5
Merge pull request #72 from matthewcsimpson/improvement/simple-range-…
JorchCortez Mar 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: tests

on:
push:
branches: [ "**" ]
pull_request:
branches: [ "**" ]

jobs:
test:
name: tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm

- name: Install dependencies (lockfile)
if: ${{ hashFiles('package-lock.json') != '' }}
run: npm ci

- name: Install dependencies
if: ${{ hashFiles('package-lock.json') == '' }}
run: npm install

- name: Run tests with coverage
run: npx jest --runInBand --coverage --coverageReporters=text-summary --coverageReporters=lcov --coverageReporters=json-summary

- name: Upload coverage artifact
if: always() && hashFiles('coverage/coverage-summary.json') != ''
uses: actions/upload-artifact@v4
with:
name: coverage
path: coverage/**

- name: Add coverage summary to job summary
if: always() && hashFiles('coverage/coverage-summary.json') != ''
shell: bash
run: |
node <<'NODE'
const fs = require('fs');
const p = 'coverage/coverage-summary.json';
const out = process.env.GITHUB_STEP_SUMMARY;
if (!out) {
console.log('GITHUB_STEP_SUMMARY not set; skipping');
process.exit(0);
}
const s = JSON.parse(fs.readFileSync(p, 'utf8'));
const c = s.total;
const lines = [
'## Coverage summary',
'',
`- Statements: ${c.statements.pct}% (${c.statements.covered}/${c.statements.total})`,
`- Branches: ${c.branches.pct}% (${c.branches.covered}/${c.branches.total})`,
`- Functions: ${c.functions.pct}% (${c.functions.covered}/${c.functions.total})`,
`- Lines: ${c.lines.pct}% (${c.lines.covered}/${c.lines.total})`,
'',
];
fs.appendFileSync(out, lines.join('\n'));
NODE
31 changes: 31 additions & 0 deletions .github/workflows/update-contributors.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Update contributors in README

on:
push:
branches: [ main ]
workflow_dispatch:
schedule:
- cron: '0 6 * * 1' # Weekly, Mondays at 06:00 UTC

jobs:
update-contributors:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Update contributors section in README
uses: akhilmhdh/contributors-readme-action@v2.3.11
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
image_size: 80
use_username: true
pr_merge: true
columns_per_row: 8
commit_message: 'docs(readme): update contributors [skip ci]'
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules/
.vscode/
coverage/
11 changes: 11 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,17 @@ Testing
- Test your changes thoroughly before submitting.
- Add examples in the examples/ folder for any new functionality.
---

## Contributors
This project is made possible by:

The contributor list (avatars + profile links) in `README.md` is updated automatically after merges to `main` via a GitHub Action. To appear there:
1. Make at least one merged commit to the `main` branch (directly or via PR merge).
2. Ensure your GitHub profile has a public avatar (default works fine).

Inactive or bot accounts may be filtered out automatically.


## Join the Discussion
Participate in ongoing discussions in [GitHub Discussions](https://github.com/TheCodeRaccoons/WebTricks/discussions).
Share your feedback, ideas, and improvements.
Expand Down
7 changes: 7 additions & 0 deletions Dist/Functional/CookieConsent.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,3 +173,10 @@ if (/complete|interactive|loaded/.test(document.readyState)) {
} else {
window.addEventListener('DOMContentLoaded', InitializeCookieConsent);
}

// Allow requiring this module in test environments
try {
if (typeof module !== 'undefined' && module.exports) {
module.exports = { CookieConsent, InitializeCookieConsent };
}
} catch {}
9 changes: 8 additions & 1 deletion Dist/Functional/CopyToClipboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class CopyToClipboard {
this.ctcTarget = this.ctcContainer.querySelector(`[wt-copycb-element="target"]`) || null;
this.textTarget = this.ctcTrigger.querySelector(`[wt-copycb-element="texttarget"]`) || null;
this.ctcDefaultTxt = this.ctcTrigger.innerText;
this.textToCopy = this.ctcTarget.innerText;
this.textToCopy = this.ctcTarget ? this.ctcTarget.innerText : '';
this.copiedTxt = this.ctcTrigger.getAttribute("wt-copycb-message") || null;
this.activeClass = this.ctcTrigger.getAttribute('wt-copycb-active') || 'is-copy';
this.timeOut = this.ctcTrigger.getAttribute('wt-copycb-timeout') || 2000;
Expand Down Expand Up @@ -54,3 +54,10 @@ if (/complete|interactive|loaded/.test(document.readyState)) {
} else {
window.addEventListener('DOMContentLoaded', initializeCopyToClipboard);
}

// Allow requiring this module in test environments without affecting browser usage
try {
if (typeof module !== 'undefined' && module.exports) {
module.exports = { CopyToClipboard, InitializeCopyToClipboard: initializeCopyToClipboard };
}
} catch {}
7 changes: 7 additions & 0 deletions Dist/Functional/CountUp.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,10 @@ if (/complete|interactive|loaded/.test(document.readyState)) {
} else {
window.addEventListener('DOMContentLoaded', InitializeCountUp);
}

// Allow requiring this module in test environments without affecting browser usage
try {
if (typeof module !== 'undefined' && module.exports) {
module.exports = { CountUp, InitializeCountUp };
}
} catch {}
7 changes: 7 additions & 0 deletions Dist/Functional/FormCheck.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,10 @@ if (/complete|interactive|loaded/.test(document.readyState)) {
} else {
window.addEventListener('DOMContentLoaded', initializeFormCheck)
}

// Allow requiring this module in test environments without affecting browser usage
try {
if (typeof module !== 'undefined' && module.exports) {
module.exports = { FormCheck, InitializeFormCheck: initializeFormCheck };
}
} catch {}
7 changes: 7 additions & 0 deletions Dist/Functional/FormatNumbers.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,10 @@ if (/complete|interactive|loaded/.test(document.readyState)) {
} else {
window.addEventListener('DOMContentLoaded', InitializeFormatNumbers);
}

// Allow requiring this module in test environments without affecting browser usage
try {
if (typeof module !== 'undefined' && module.exports) {
module.exports = { NumberFormatter, InitializeFormatNumbers };
}
} catch {}
19 changes: 17 additions & 2 deletions Dist/Functional/Marquee.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,21 @@ class Marquee {

fillContainer() {
let totalSize = this.calculateTotalSize();
const targetSize = this.parentSize * 1.5;
const targetSize = this.parentSize * 1.5;
// Safety guards: avoid infinite loop if sizes cannot be measured (e.g., 0 widths in tests/SSR)
let iterations = 0;
const maxIterations = 200; // cap to a reasonable number

while (totalSize < targetSize) {
while (totalSize < targetSize && iterations < maxIterations) {
const beforeSize = totalSize;
this.elements.forEach(el => {
const clone = el.cloneNode(true);
this.container.appendChild(clone);
});
this.elements = Array.from(this.container.children);
totalSize = this.calculateTotalSize();
iterations++;
if (totalSize <= beforeSize) break; // cannot grow, abort to prevent infinite loop
}
}

Expand Down Expand Up @@ -135,3 +141,12 @@ if (/complete|interactive|loaded/.test(document.readyState)) {
} else {
window.addEventListener('DOMContentLoaded', InitializeMarquee);
};

// Allow requiring this module in test environments without affecting browser usage
try {
if (typeof module !== 'undefined' && module.exports) {
module.exports = { Marquee, InitializeMarquee };
}
} catch {
// Suppress errors when module/module.exports are undefined (e.g., in browser environments).
}
Loading
Loading