{"id":26094189,"url":"https://github.com/milesbarr/html-enhancements","last_synced_at":"2025-07-24T15:38:30.986Z","repository":{"id":281383708,"uuid":"945112295","full_name":"milesbarr/html-enhancements","owner":"milesbarr","description":"A lightweight JavaScript library that provides progressive enhancements for HTML.","archived":false,"fork":false,"pushed_at":"2025-03-08T17:32:29.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-08T18:26:47.267Z","etag":null,"topics":["html","html5","javascript","javascript-vanilla","progressive-enhancement","vanilla-javascript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/milesbarr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-08T17:28:52.000Z","updated_at":"2025-03-08T17:32:32.000Z","dependencies_parsed_at":"2025-03-08T18:37:49.892Z","dependency_job_id":null,"html_url":"https://github.com/milesbarr/html-enhancements","commit_stats":null,"previous_names":["milesbarr/html-enhancements"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milesbarr%2Fhtml-enhancements","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milesbarr%2Fhtml-enhancements/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milesbarr%2Fhtml-enhancements/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milesbarr%2Fhtml-enhancements/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/milesbarr","download_url":"https://codeload.github.com/milesbarr/html-enhancements/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242692342,"owners_count":20170228,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["html","html5","javascript","javascript-vanilla","progressive-enhancement","vanilla-javascript"],"created_at":"2025-03-09T12:50:33.762Z","updated_at":"2025-07-24T15:38:30.946Z","avatar_url":"https://github.com/milesbarr.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HTML Enhancements\n\nA lightweight JavaScript library that provides progressive enhancements for HTML\nforms and user interactions. This library adds functionality while maintaining\nzero dependencies and graceful degradation.\n\n## Setup\n\nInclude the required files:\n\n```html\n\u003cscript src=\"html-enhancements.js\" async defer\u003e\u003c/script\u003e\n\u003cscript src=\"html-enhancements-ajax.js\" async defer\u003e\u003c/script\u003e\n```\n\n## Usage\n\n### Form Confirmations\n\nAdd confirmation dialogs to form submissions using the `data-confirm` or\n`data-formconfirm` attributes.\n\n```html\n\u003cform data-confirm=\"Are you sure you want to submit this form?\"\u003e\n  \u003c!-- Form content --\u003e\n  \u003cbutton data-formconfirm=\"Are you sure you want to press this button?\"\u003e\n\u003c/form\u003e\n```\n\n### Unsaved Changes Warning\n\nWarn users about unsaved form changes with the `data-warn-unsaved` attribute.\n\n```html\n\u003cform data-warn-unsaved\u003e\n  \u003c!-- Form content --\u003e\n\u003c/form\u003e\n```\n\n### Share Buttons\n\nAdd share buttons with the `data-share` attribute.\n\n```html\n\u003cbutton type=\"button\" data-share\u003eShare\u003c/button\u003e\n```\n\n### Copy Buttons\n\nAdd copy buttons with the `data-copy` attribute.\n\n```html\n\u003cinput type=\"text\" id=\"text\"\u003e\n\u003cbutton type=\"button\" data-copy=\"text\"\u003eCopy\u003c/button\u003e\n```\n\n### File Upload Previews\n\nPreview images for file inputs using the `data-preview-for` attribute.\n\n```html\n\u003cinput type=\"file\" id=\"upload\"\u003e\n\u003cimg data-preview-for=\"upload\"\u003e\n```\n\n### Character Counter\n\nShow the remaining character count for controls with the\n`data-chars-remaining-for` attribute.\n\n```html\n\u003ctextarea id=\"message\" maxlength=\"100\"\u003e\u003c/textarea\u003e\n\u003cspan data-chars-remaining-for=\"message\"\u003e\u003c/span\u003e\n```\n\n### Auto-resizable Textareas\n\nAutomatically resize textareas based on their content using the\n`data-auto-resize` attribute.\n\n```html\n\u003ctextarea data-auto-resize\u003e\u003c/textarea\u003e\n```\n\n### Smooth Scrolling\n\nEnable smooth scrolling for anchor links (links starting with #) automatically.\n\n```html\n\u003ca href=\"#section\"\u003eGo to section\u003c/a\u003e\n\u003cdiv id=\"section\"\u003eContent\u003c/div\u003e\n```\n\n### Invalid Inputs\n\nAutomatically set the `aria-invalid` attribute to `false` when an input changes.\n\n```html\n\u003cinput type=\"text\" aria-invalid=\"true\"\u003e\n```\n\n### Drag-and-Drop File Uploads\n\nAdd drag-and-drop file uploads with the `data-drop-zone` attribute.\n\n```html\n\u003clabel data-drop-zone\u003e\n  \u003cinput type=\"file\"\u003e\n\u003c/label\u003e\n```\n\n### AJAX\n\nAllow for form submissions and link navigation with AJAX using the\n`data-ajax-replace` attribute.\n\n```html\n\u003cdiv id=\"page\"\u003e\n  \u003ca href=\".\" data-ajax-replace=\"page\"\u003eRefresh page\u003c/a\u003e\n\u003c/div\u003e\n```\n\n## Graceful Degradation\n\nAll features are implemented as progressive enhancements, meaning the basic\nfunctionality will work even if JavaScript is disabled.\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmilesbarr%2Fhtml-enhancements","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmilesbarr%2Fhtml-enhancements","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmilesbarr%2Fhtml-enhancements/lists"}