{"id":28548328,"url":"https://github.com/gitguanqi/xqmsg","last_synced_at":"2025-07-01T18:32:18.211Z","repository":{"id":60641640,"uuid":"544442483","full_name":"gitguanqi/xqmsg","owner":"gitguanqi","description":"This is a js show message tip plugin.","archived":false,"fork":false,"pushed_at":"2024-01-13T10:13:23.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-08T21:13:13.739Z","etag":null,"topics":["javascript","msg"],"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/gitguanqi.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":"2022-10-02T13:46:29.000Z","updated_at":"2022-10-04T00:06:06.000Z","dependencies_parsed_at":"2023-01-19T00:15:24.262Z","dependency_job_id":null,"html_url":"https://github.com/gitguanqi/xqmsg","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gitguanqi/xqmsg","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitguanqi%2Fxqmsg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitguanqi%2Fxqmsg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitguanqi%2Fxqmsg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitguanqi%2Fxqmsg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gitguanqi","download_url":"https://codeload.github.com/gitguanqi/xqmsg/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitguanqi%2Fxqmsg/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263017436,"owners_count":23400500,"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":["javascript","msg"],"created_at":"2025-06-10T01:09:39.824Z","updated_at":"2025-07-01T18:32:18.203Z","avatar_url":"https://github.com/gitguanqi.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# xqmsg\n\nThis is a js show message tip plugin.\n\n[View Chinese documents](./zh.md)\n\n## Install\n\n**Browser**:\n\nimport cdn\n\n```html\n\u003c!-- css style --\u003e\n\u003clink rel=\"stylesheet\" href=\"https://xqgj.cc/xqcdn/libs/xqmsg/css/xqmsg.min.css\"\u003e\n\u003c!-- Browser --\u003e\n\u003cscript src=\"https://xqgj.cc/xqcdn/libs/xqmsg/js/xqmsg.min.js\"\u003e\u003c/script\u003e\n\u003c!-- es module --\u003e\n\u003cscript type=\"module\"\u003e\n    import xqmsg from '../lib/js/xqmsg-esm.min.js';\n\u003c/script\u003e\n```\n\n## Usage\n\n+ html\n\n```html\n\u003ch4\u003e1. pop\u003c/h4\u003e\n\u003cp\u003e\n    \u003cbutton class=\"popBtn\" data-type=\"1\" data-text=\"success\"\u003esuccess\u003c/button\u003e\n    \u003cbutton class=\"popBtn\" data-type=\"2\" data-text=\"error\"\u003eerror\u003c/button\u003e\n    \u003cbutton class=\"popBtn\" data-type=\"3\" data-text=\"warning\"\u003ewarning\u003c/button\u003e\n    \u003cbutton class=\"popBtn\" data-type=\"4\" data-text=\"info\"\u003einfo\u003c/button\u003e\n\u003c/p\u003e\n\u003ch4\u003e2.msg\u003c/h4\u003e\n\u003cp\u003e\n    \u003cbutton class=\"msgBtn\" data-type=\"0\" data-text=\"top\"\u003etop\u003c/button\u003e\n    \u003cbutton class=\"msgBtn\" data-type=\"1\" data-text=\"middle\"\u003emiddle\u003c/button\u003e\n    \u003cbutton class=\"msgBtn\" data-type=\"2\" data-text=\"bottom\"\u003ebottom\u003c/button\u003e\n\u003c/p\u003e\n\u003ch4\u003e3.confirm\u003c/h4\u003e\n\u003cp\u003e\n    \u003cbutton class=\"confirmBtn\"\u003econfirm\u003c/button\u003e\n\u003c/p\u003e\n```\n\n+ call\n\n```js\n// 1. pop\nlet popBtn = document.querySelectorAll('.popBtn');\nfor (let i = 0; i \u003c popBtn.length; i++) {\n    const item = popBtn[i];\n    item.addEventListener('click', popSet, false);\n}\n\nfunction popSet (event) {\n    let e = event || window.event;\n    let params = e.target.dataset;\n    xqmsg.pop(params.text, params.type);\n}\n\n// 2.msg\nlet msgBtn = document.querySelectorAll('.msgBtn');\nfor (let i = 0; i \u003c msgBtn.length; i++) {\n    const item = msgBtn[i];\n    item.addEventListener('click', msgSet, false);\n}\n\nfunction msgSet (event) {\n    let e = event || window.event;\n    let params = e.target.dataset;\n    xqmsg.msg(params.text, params.type);\n}\n\n// 3.confirm\nlet confirmBtn = document.querySelector('.confirmBtn');\nconfirmBtn.addEventListener('click', confirmSet, false);\nasync function confirmSet () {  \n    let res = await xqmsg.confirm('You want to leave me?');\n    console.log(res);\n    // {type: 1, msg: 'confirm'}\n    // {type: 2, msg: 'cancel'}\n}\n```\n\n## View xqmsg\n\nRun this script to view the demonstration case: `npm run test:browser`.\n\n+ [demo](https://xqgj.cc/xqmsg/test/browser.html)\n\n## ask questions\n\n[submit your question](https://github.com/gitguanqi/xqmsg/issues/new)\n\n## Author\n\n[@gitguanqi](https://github.com/gitguanqi)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgitguanqi%2Fxqmsg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgitguanqi%2Fxqmsg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgitguanqi%2Fxqmsg/lists"}