{"id":26818860,"url":"https://github.com/milesbarr/html-enhancer","last_synced_at":"2025-03-30T05:15:31.844Z","repository":{"id":281383708,"uuid":"945112295","full_name":"milesbarr/html-enhancer","owner":"milesbarr","description":"A lightweight JavaScript library that provides progressive enhancements for HTML.","archived":false,"fork":false,"pushed_at":"2025-03-29T16:21:41.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-29T17:27:00.630Z","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-29T16:21:44.000Z","dependencies_parsed_at":"2025-03-29T17:27:22.990Z","dependency_job_id":"427a746e-d33c-4c5a-afc5-da666dd09f78","html_url":"https://github.com/milesbarr/html-enhancer","commit_stats":null,"previous_names":["milesbarr/html-enhancements","milesbarr/html-enhancer"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milesbarr%2Fhtml-enhancer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milesbarr%2Fhtml-enhancer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milesbarr%2Fhtml-enhancer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milesbarr%2Fhtml-enhancer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/milesbarr","download_url":"https://codeload.github.com/milesbarr/html-enhancer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246277361,"owners_count":20751549,"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-30T05:15:31.314Z","updated_at":"2025-03-30T05:15:31.831Z","avatar_url":"https://github.com/milesbarr.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HTML Enhancer\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-enhance.js\" async defer\u003e\u003c/script\u003e\n\u003cscript src=\"html-enhance-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```html\n\u003cform \u003e\n```\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### 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### AJAX\n\nAllow for form submissions and link navigation with AJAX using\n`data-ajax-replace`\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-enhancer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmilesbarr%2Fhtml-enhancer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmilesbarr%2Fhtml-enhancer/lists"}