{"id":21428341,"url":"https://github.com/ushelp/easymodal-bootstrap","last_synced_at":"2025-07-14T10:31:55.722Z","repository":{"id":57218906,"uuid":"71056855","full_name":"ushelp/EasyModal-Bootstrap","owner":"ushelp","description":"Bootstrap Modal extension plugin. Bootstrap 模态框扩展插件，能提供 `alert`, `confirm`, `prompt`, `modal 自定义` 等功能，简单易用。","archived":false,"fork":false,"pushed_at":"2019-08-13T07:11:23.000Z","size":411,"stargazers_count":2,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-19T23:02:23.931Z","etag":null,"topics":["bootstrap","bootstrap-alert","bootstrap-modal","bootstrap-plugin","modal"],"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/ushelp.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":["http://www.easyproject.cn/donation"]}},"created_at":"2016-10-16T14:49:32.000Z","updated_at":"2020-05-21T11:37:14.000Z","dependencies_parsed_at":"2022-08-28T23:22:29.045Z","dependency_job_id":null,"html_url":"https://github.com/ushelp/EasyModal-Bootstrap","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ushelp/EasyModal-Bootstrap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ushelp%2FEasyModal-Bootstrap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ushelp%2FEasyModal-Bootstrap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ushelp%2FEasyModal-Bootstrap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ushelp%2FEasyModal-Bootstrap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ushelp","download_url":"https://codeload.github.com/ushelp/EasyModal-Bootstrap/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ushelp%2FEasyModal-Bootstrap/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265280715,"owners_count":23739853,"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":["bootstrap","bootstrap-alert","bootstrap-modal","bootstrap-plugin","modal"],"created_at":"2024-11-22T22:12:48.970Z","updated_at":"2025-07-14T10:31:50.712Z","avatar_url":"https://github.com/ushelp.png","language":"JavaScript","funding_links":["http://www.easyproject.cn/donation"],"categories":[],"sub_categories":[],"readme":"# EasyModal - Bootstrap\n\n---------------\n\nEasyModal 是一个 Bootstrap 模态框扩展插件，能提供 `alert`, `confirm`, `prompt`, `modal 自定义` 等功能，简单易用。\n\nEasyModal is a Bootstrap Modal extension plugin, can provide `alert`, `confirm`, `prompt`, `modal custom function`  and so on, simple and easy to use.\n\nlatest version:  `1.2.0-RELEASE`\n\n\n## 安装\n\n- Download \n\n- Bower\n\n```\nbower install easymodal-bootstrap\n```\n\n- npm\n\n```\nnpm install easymodal-bootstrap\n```\n\n## Getting started/开始使用\n\n```HTML\n\u003c!-- Bootstrap start --\u003e\n\u003clink rel=\"stylesheet\" href=\"bootstrap-3.3.7-dist/css/bootstrap.min.css\"\u003e\n\u003cscript src=\"jquery/jquery-3.1.0.min.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"bootstrap-3.3.7-dist/js/bootstrap.min.js\"\u003e\u003c/script\u003e\n\u003c!-- Bootstrap end --\u003e\n\n\u003c!-- Bootstrap EasyModal START --\u003e\n\u003cscript src=\"dist/easy.bootstrap.easymodal-1.2.0.min.js\"\u003e\u003c/script\u003e\n\u003c!-- put your locale files after easy.bootstrap.easymodel.js --\u003e\n\u003cscript src=\"dist/lang/easy.bootstrap.easymodal-lang-en.js\"\u003e\u003c/script\u003e\n\u003c!-- Bootstrap EasyModal END --\u003e\n```\n\n\n## API\n\n### Core API\n```JS\nEasyModal.alert( msg, [callback, title,  btnTextArray, params] );\t\nEasyModal.confirm( msg, [callback, title,  btnTextArray, params] );\nEasyModal.prompt( msg, [defaultValue, callback, title, btnTextArray, params] );\t\t\nEasyModal.modal(title , content , modalFooter, [params]);\n```\n\n### params\n```JS\n{\n    // 'modal-sm', '', 'modal-lg'; default is ''; the modal size\n    // 模态对话框大小； 可选值 'modal-sm', '', ' modal-lg'； 默认为 ''\n    size: '', \n    // true, false; default is true; enable fadeIn and fadeOut effect\n    // 开启渐入渐出动画效果；可选值 true, false； 默认为 true \n    fade: true,\n    // true, 'static'; default is true; specify 'static' for a backdrop which doesn't close the modal on click\n    // 点击模块背景是否自动关闭, 'static' 为不关闭； 可选值 true, 'static'; 默认为 true\n    backdrop: true,\n    // true, false; default is true;  specify true for enter ESC key to close modal dialog\n    // 键盘上的 esc 键被按下时关闭模态框；可选值 true, false；默认为 true\n    keyboard: true\n}\n```\n\n### Global params\n```JS\nEasyModal.defaults={\n    // 'modal-sm', '', 'modal-lg'; default is ''; the modal size\n    size: '', \n    // true, false; default is true; enable fadeIn and fadeOut effect\n    fade: true,\n    // true, 'static'; default is true; specify 'static' for a backdrop which doesn't close the modal on click\n    backdrop: true,\n    // true, false; default is true;  specify true for enter ESC key to close modal dialog\n    keyboard: true\n}\n```\n\n\n\n## Usage/用例\n```JS\n\u003cbutton id=\"alertBtn\" type=\"button\" class=\"btn btn-warning\"\u003eEasyModal.alert()\u003c/button\u003e\n\u003cbutton id=\"confirmBtn\" type=\"button\" class=\"btn btn-danger\"\u003eEasyModal.confirm()\u003c/button\u003e\n\u003cbutton id=\"promptBtn\" type=\"button\" class=\"btn btn-primary\"\u003eEasyModal.prompt()\u003c/button\u003e\n\u003cbutton id=\"modalBtn\" type=\"button\" class=\"btn btn-info\"\u003eEasyModal.modal()\u003c/button\u003e\n\u003cbutton id=\"alertBtn2\" type=\"button\" class=\"btn btn-warning\"\u003eUser EasyModal.alert()\u003c/button\u003e\n\u003cbutton id=\"confirmBtn2\" type=\"button\" class=\"btn btn-danger\"\u003eUser EasyModal.confirm()\u003c/button\u003e\n\n$(function() {\n\n    $(\"#alertBtn\").on(\"click\", function() {\n    \t// EasyModal.alert( msg, [callback, title,  btnTextArray, params] )\t\n    \tEasyModal.alert('Account invalidate!');\n    })\n\n    $(\"#confirmBtn\").on(\"click\", function() {\n    \t// EasyModal.confirm( msg, [callback, title,  btnTextArray, params] )\t\n    \tEasyModal.confirm('Sure you want to delete it!', function(res) {\n    \t\tEasyModal.alert('You choice :' + res);\n    \t});\n    })\n\n    $(\"#promptBtn\").on(\"click\", function() {\n    \t// EasyModal.prompt( msg, [defaultValue, callback, title, btnTextArray, params] )\t\n    \tEasyModal.prompt('Input your age: ', 18, function(res) {\n    \t\tEasyModal.alert('Your age is:' + res);\n    \t});\n    })\n\n    $(\"#modalBtn\").on(\"click\", function() {\n    \t// EasyModal.modal(title , content , modalFooter, [params])\n    \tEasyModal.modal('ModalTitle', 'This is a demo!', 'Add button');\n    })\n    \n    $(\"#alertBtn2\").on(\"click\", function() {\n    \t// EasyModal.alert( msg, [callback, title,  btnTextArray, params] )\t\n    \tEasyModal.alert(\n    \t\t'Account invalidate!', \n    \t\tnull, \n    \t\t\"User Title\" ,\n    \t\t['User OK Button'],\n    \t\t{\n    \t\t\tsize: 'modal-sm',\n    \t\t\tfade: false,\n    \t\t\tbackdrop: 'static',\n    \t\t\tkeyboard: false\n    \t\t}\n    \t);\n    })\n\n    $(\"#confirmBtn2\").on(\"click\", function() {\n    \t// EasyModal.confirm( msg, [callback, title,  btnTextArray, params] )\t\n    \tEasyModal.confirm(\n    \t\t'Sure you want to delete it!', \n    \t\tfunction(res){\n    \t\t\tEasyModal.alert('You choice :' + res);\n    \t\t}, \n    \t\t\"User Title\" ,\n    \t\t['User Close Button', 'User OK Button'],\n    \t\t{\n    \t\t\tsize: 'modal-lg',\n    \t\t\tbackdrop: 'static'\n    \t\t}\n    \t);\n    })\n})\n```\n\n\n## Demo\n\n![Demo](doc/images/demo.png)\n\n![Demo](doc/images/demo2.png)\n\n\n\n## End\n\nEmail：\u003cinthinkcolor@gmail.com\u003e\n\n[http://www.easyproject.cn](http://www.easyproject.cn \"EasyProject Home\")\n\n\n**Donation/捐助:**\n\n\u003ca href=\"http://www.easyproject.cn/donation\"\u003e\n\u003cimg alt=\"\n支付宝/微信/QQ/云闪付/PayPal 扫码支付\" src=\"http://www.easyproject.cn/thanks/donation.png\"  title=\"支付宝/微信/QQ/云闪付/PayPal 扫码支付\"  height=\"320\" width=\"320\"\u003e\u003c/img\u003e\u003c/a\u003e\n\u003cdiv\u003e支付宝/微信/QQ/云闪付/PayPal\u003c/div\u003e\n\n\u003cbr/\u003e\n\n我们相信，每个人的点滴贡献，都将是推动产生更多、更好免费开源产品的一大步。\n\n**感谢慷慨捐助，以支持服务器运行和鼓励更多社区成员。**\n\nWe believe that the contribution of each bit by bit, will be driven to produce more and better free and open source products a big step.\n\n**Thank you donation to support the server running and encourage more community members.**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fushelp%2Feasymodal-bootstrap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fushelp%2Feasymodal-bootstrap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fushelp%2Feasymodal-bootstrap/lists"}