{"id":22769704,"url":"https://github.com/bfontaine/toggle-text","last_synced_at":"2025-03-30T11:29:29.479Z","repository":{"id":15660723,"uuid":"18398142","full_name":"bfontaine/toggle-text","owner":"bfontaine","description":"Quick library to make togglable text","archived":false,"fork":false,"pushed_at":"2015-03-24T19:52:28.000Z","size":167,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-23T23:43:42.217Z","etag":null,"topics":["js","library","text"],"latest_commit_sha":null,"homepage":null,"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/bfontaine.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}},"created_at":"2014-04-03T09:43:12.000Z","updated_at":"2019-10-26T07:15:34.000Z","dependencies_parsed_at":"2022-08-26T18:50:54.774Z","dependency_job_id":null,"html_url":"https://github.com/bfontaine/toggle-text","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bfontaine%2Ftoggle-text","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bfontaine%2Ftoggle-text/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bfontaine%2Ftoggle-text/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bfontaine%2Ftoggle-text/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bfontaine","download_url":"https://codeload.github.com/bfontaine/toggle-text/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246313025,"owners_count":20757418,"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":["js","library","text"],"created_at":"2024-12-11T15:14:06.007Z","updated_at":"2025-03-30T11:29:29.456Z","avatar_url":"https://github.com/bfontaine.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# toggle-text\n\n[![Build Status](https://travis-ci.org/bfontaine/toggle-text.svg?branch=master)](https://travis-ci.org/bfontaine/toggle-text)\n\n`toggle-text.js` is a lightweight library (0.3kb minified and gzip’d) to make\ntogglable text. It has no dependencies and is dead easy to use. This was\noriginally made for a personal project but it might be useful to others.\n\n## Install\n\nDrop [`toggle-text.js`][js] at the bottom of your page. You can bundle it with\nother JavaScript files in any order because it doesn’t have any dependency, and\nrely only on the presence of a `\u003cbody\u003e` element.\n\n[js]: https://raw.githubusercontent.com/bfontaine/toggle-text/master/toggle-text.js\n\n## Usage\n\nDrop `toggle-text.js` at the end of your page and you’re done on the JS part.\nTo mark an element as “togglable”, add the `toggle-text` class to it, and put\nthe alternative text in a `data-toggle-text` attribute.\n\nFor example, I heavily use this library for large numbers when you don’t care\nof what each exact number is, like on social network profiles:\n\n```html\n\u003cli class=\"toggle-text\" data-toggle-text=\"1259\"\u003e1.2k\u003c/li\u003e\n```\n\nWhen the user click on this `li` element, the `1.2k` text will be replaced by\n`1259`. When they click again on it, it’ll go back to the initial text.\n\n## Tests\n\nOpen `test/client.html` in your browser.\n\n## Contributing\n\n### Code\n\n1. [Fork the repo][help-fork]\n2. Run the tests suite to ensure all tests pass before you change any code\n3. Create a new branch\n4. If you’re fixing a bug, add a test which shows the bug\n5. Write your code\n6. Run the tests suite\n7. [Open a pull-request][help-pr]\n\n[help-fork]: https://help.github.com/articles/fork-a-repo\n[help-pr]: https://help.github.com/articles/creating-a-pull-request\n\n### Bug reports\n\nDon’t know how to fix a bug? Don’t worry, you can still help with a bug report.\nStart by [opening an issue][help-issue], and describe the problem: what should\nhappen, what happens instead, the browser you’re using, and all steps required\nfor one to reproduce the bug. Thank you!\n\n[help-issue]: https://github.com/bfontaine/toggle-text/issues/new\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbfontaine%2Ftoggle-text","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbfontaine%2Ftoggle-text","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbfontaine%2Ftoggle-text/lists"}