{"id":21348104,"url":"https://github.com/brijeshb42/medium-style-confirm","last_synced_at":"2026-01-03T13:04:44.622Z","repository":{"id":28691791,"uuid":"32211911","full_name":"brijeshb42/medium-style-confirm","owner":"brijeshb42","description":"medium.com style confirm dialog","archived":false,"fork":false,"pushed_at":"2018-05-29T16:08:12.000Z","size":39,"stargazers_count":166,"open_issues_count":0,"forks_count":19,"subscribers_count":8,"default_branch":"gh-pages","last_synced_at":"2025-03-08T17:34:16.335Z","etag":null,"topics":["dialog","dialog-box","medium"],"latest_commit_sha":null,"homepage":"http://bitwiser.in/medium-style-confirm/","language":"HTML","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/brijeshb42.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":"2015-03-14T12:59:00.000Z","updated_at":"2024-03-24T05:10:06.000Z","dependencies_parsed_at":"2022-08-29T09:50:38.159Z","dependency_job_id":null,"html_url":"https://github.com/brijeshb42/medium-style-confirm","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brijeshb42%2Fmedium-style-confirm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brijeshb42%2Fmedium-style-confirm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brijeshb42%2Fmedium-style-confirm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brijeshb42%2Fmedium-style-confirm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brijeshb42","download_url":"https://codeload.github.com/brijeshb42/medium-style-confirm/tar.gz/refs/heads/gh-pages","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243822387,"owners_count":20353518,"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":["dialog","dialog-box","medium"],"created_at":"2024-11-22T02:17:57.895Z","updated_at":"2026-01-03T13:04:44.560Z","avatar_url":"https://github.com/brijeshb42.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"## medium-style-confirm\n\n### Demo @ [bitwiser.in](http://bitwiser.in/medium-style-confirm/)\n\n### Usage\n\n* `mscConfirm(title, okCallback)` :\n```js\nmscConfirm(\"Delete?\",function(){\n    alert(\"Post deleted\");\n});\n```\n\n* `mscConfirm(title, subheading, okCallback)` :\n```js\nmscConfirm(\"Delete\", \"Are you sure you want to delete this post?\", function(){\n    alert(\"Post deleted\");\n});\n```\n\n* `mscConfirm(title, subheading, okCallback, cancelCallback)` :\n```js\nmscConfirm(\"Delete\", \"Are you sure you want to delete this post?\", function(){\n  alert(\"Post deleted\");\n},\nfunction() {\n  alert('Cancelled');\n});\n```\n\n* `mscConfirm(object)` :\n```js\nmscConfirm({\n    title: 'License',\n    subtitle: 'Do you accept the licese agreement?',    // default: ''\n    okText: 'I Agree',      // default: OK\n    cancelText: 'I Dont',   // default: Cancel\n    dismissOverlay: true,   // default: false, closes dialog when clicked on overlay.\n    onOk: function() {\n        alert('Awesome.');\n    },\n    onCancel: function() {\n        alert('Sad face :( .');\n    }\n});\n```\n\n#### New\n### Prompt -\u003e Equivalent of JS `prompt()`\n##### The API for `mscPrompt` and `mscConfirm` is same. Just the `onOk` callback of prompt receives a `value` parameter entered into the prompt.\n* `mscPrompt(object)` :\n```js\nmscPrompt({\n    title: 'Subscribe',\n    subtitle: 'Enter your email to subscribe to the newsletter.',    // default: '',\n    defaultValue: 'email',  // default: '', this value will be prefilled in the prompt box  \n    okText: 'Subscribe',    // default: OK\n    cancelText: 'Cancel',   // default: Cancel\n    dismissOverlay: true,   // default: false, closes dialog when clicked on overlay.\n    placeholder: 'Enter your email',     // placeholder value to show in input textbox\n    onOk: function(value) {\n        mscAlert(value+ \" has been subscribed to the newsletter.\");\n    },\n    onCancel: function() {\n        mscAlert('Sad face :( .');\n    }\n});\n```\n\n### Alert -\u003e Equivalent of JS `alert()`\n* `mscAlert(text)` :\n```js\nmscAlert(\"Hello World.\");\n```\n\n##### Added support for new lines and carriage return in mscAlert()\n* `mscAlert(object)` :\n```js\nmscAlert({\n  title: 'Done',\n\n  subtitle: 'You have been registered successfully. \\n Your reg. ID is 4321', // default: ''\n\n  okText: 'Close',    // default: OK\n\n});\n```\n\n### Installation\n* Install via bower `bower install medium-style-confirm` or download [msc-style.css](http://bitwiser.in/medium-style-confirm/css/msc-style.css) and [msc-script.js](http://bitwiser.in/medium-style-confirm/js/msc-script.js).\n* Include `msc-style.css` in html as `\u003clink rel=\"stylesheet\" href=\"msc-style.css\"\u003e` just before ending `head` tag.\n* Include `msc-script.js` in html as `\u003cscript src=\"msc-script.js\"\u003e` just before ending `body` tag.\n* Call the `mscConfirm()` function as shown above.\n\n### LICENSE\n#### MIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrijeshb42%2Fmedium-style-confirm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrijeshb42%2Fmedium-style-confirm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrijeshb42%2Fmedium-style-confirm/lists"}