{"id":17584724,"url":"https://github.com/cssmagic/action","last_synced_at":"2025-08-21T04:31:04.886Z","repository":{"id":20288937,"uuid":"23562392","full_name":"cssmagic/action","owner":"cssmagic","description":"Easy and lazy solution for click-event-binding.","archived":false,"fork":false,"pushed_at":"2023-09-25T02:18:18.000Z","size":38,"stargazers_count":95,"open_issues_count":7,"forks_count":32,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-08-12T16:18:14.310Z","etag":null,"topics":["click","cmui","events","javascript","mouse"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cssmagic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2014-09-02T02:33:37.000Z","updated_at":"2024-06-08T17:56:51.000Z","dependencies_parsed_at":"2024-06-21T02:13:42.113Z","dependency_job_id":"1f62ecf5-fb47-4d8e-960f-a0f6a5da7fee","html_url":"https://github.com/cssmagic/action","commit_stats":{"total_commits":57,"total_committers":4,"mean_commits":14.25,"dds":0.5263157894736843,"last_synced_commit":"4467276b7f1dade1f0db328e9063eeedd4a40059"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/cssmagic/action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cssmagic%2Faction","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cssmagic%2Faction/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cssmagic%2Faction/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cssmagic%2Faction/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cssmagic","download_url":"https://codeload.github.com/cssmagic/action/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cssmagic%2Faction/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271258042,"owners_count":24727995,"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","status":"online","status_checked_at":"2025-08-20T02:00:09.606Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["click","cmui","events","javascript","mouse"],"created_at":"2024-10-22T02:07:53.240Z","updated_at":"2025-08-21T04:31:04.612Z","avatar_url":"https://github.com/cssmagic.png","language":"JavaScript","readme":"\u003e English version is [here](https://github.com/cssmagic/action/wiki).\n\n# Action\n\n\u003e 轻松随意绑定点击事件！\n\n## 用法简介\n\n#### 第一步\n\n先定义一些动作：\n\n```js\naction.define({\n    'my-action': function () {\n        //do something...\n    },\n    /* ... */\n})\n```\n\n#### 第二步\n\n在页面里创建元素：\n\n```html\n\u003cbutton data-action=\"my-action\"\u003ebtn\u003c/button\u003e\n\n\u003c!-- 或这样 --\u003e\n\u003ca href=\"#\" data-action=\"my-action\"\u003elink\u003c/a\u003e\n\n\u003c!-- 或这样 --\u003e\n\u003ca href=\"#my-action\" data-action\u003elink\u003c/a\u003e\n```\n\n#### 第三步\n\n其实已经不需要第三步了。\n\n点击这个元素就可以触发你定义的那个动作了！\n\n## 兼容性\n\n依赖以下类库：\n\n* jQuery（或兼容类库，比如 Zepto）\n\n支持以下浏览器：\n\n* Chrome / Firefox / Safari 等现代浏览器\n* IE 6+（需要 jQuery 1.x）\n\n## 体积\n\n* 源码： 2.7k\n* 压缩后： 0.4k\n\n## 安装\n\n0. 通过 npm 3+ 安装：\n\n\t```sh\n\t$ npm install cmui-action\n\t```\n\n0. 在页面中加载 Action 的脚本文件及必要的依赖：\n\n\t```html\n\t\u003cscript src=\"./node_modules/jquery/dist/jquery.js\"\u003e\u003c/script\u003e\n\t\u003cscript src=\"./node_modules/cmui-action/src/action.js\"\u003e\u003c/script\u003e\n\t```\n\n## API 文档\n\n* Action 提供了简洁易用的 API，[详见此文档](https://github.com/cssmagic/action/issues/9)。\n* 此外，建议阅读 [Wiki](https://github.com/cssmagic/action/wiki) 来获取更多信息。\n\n## 单元测试\n\n0. 把本项目的代码 fork 并 clone 到本地。\n0. 在本项目的根目录运行 `npm install`，安装必要的依赖。\n0. 在浏览器中打开 `test/test.html` 即可运行单元测试。\n\n## 谁在用？\n\n移动 UI 框架 [CMUI](https://github.com/CMUI/CMUI) 采用 Action 作为全局的基础设施，因此所有 CMUI 用户都在使用 Action：\n\n* [百姓网 - 手机版](http://m.baixing.com/)\n* [薇姿官方电子商城 - 手机版](http://m.vichy.com.cn/)\n* [优e网 - 手机版](http://m.uemall.com/)\n\n***\n\n## License\n\n[MIT License](http://www.opensource.org/licenses/mit-license.php)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcssmagic%2Faction","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcssmagic%2Faction","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcssmagic%2Faction/lists"}