{"id":15046843,"url":"https://github.com/blikblum/nextbone-modals","last_synced_at":"2026-01-03T06:48:20.680Z","repository":{"id":44882746,"uuid":"166418328","full_name":"blikblum/nextbone-modals","owner":"blikblum","description":"Modals implementation for Nextbone","archived":false,"fork":false,"pushed_at":"2024-05-19T01:04:24.000Z","size":9605,"stargazers_count":0,"open_issues_count":11,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-23T12:46:59.554Z","etag":null,"topics":["bootstrap","modals","nextbone"],"latest_commit_sha":null,"homepage":"https://blikblum.github.io/nextbone-modals/example/dist/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/blikblum.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2019-01-18T14:35:28.000Z","updated_at":"2024-05-19T01:04:28.000Z","dependencies_parsed_at":"2024-05-19T02:24:26.196Z","dependency_job_id":"a609c16f-e114-41a1-b33f-d607eb003455","html_url":"https://github.com/blikblum/nextbone-modals","commit_stats":{"total_commits":103,"total_committers":4,"mean_commits":25.75,"dds":"0.21359223300970875","last_synced_commit":"06721a79d517c91d0560bc55bd5e3c613db684f2"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blikblum%2Fnextbone-modals","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blikblum%2Fnextbone-modals/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blikblum%2Fnextbone-modals/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blikblum%2Fnextbone-modals/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blikblum","download_url":"https://codeload.github.com/blikblum/nextbone-modals/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243965778,"owners_count":20375918,"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","modals","nextbone"],"created_at":"2024-09-24T20:53:39.098Z","updated_at":"2026-01-03T06:48:20.636Z","avatar_url":"https://github.com/blikblum.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nextbone Modals\n\nSimple modal service for Nextbone.\n\nSee [live example](https://blikblum.github.io/nextbone-modals/example/dist/) with Bootstrap\n\n## Usage\n\n### Bootstrap\n\n```js\nimport { BootstrapModals } from 'nextbone-modals';\n\n// optional. Configure default button captions\nBootstrapModals.setCaptions({\n  ok: 'OK',\n  cancel: 'Cancel',\n  yes: 'Yes',\n  no: 'No'\n});\n\n// optional. Configure default options\nBootstrapModals.setOptions({\n  centered: true,\n  customClass: 'my-modal-class'\n});\n\nconst modalService = new BootstrapModals();\n\nmodalService.setup({\n  container: '#modal-container'\n});\n\nmodalService.alert({\n  title: 'Here is a alert modal!',\n  text: 'Here is some text to demo that you can pass anything to your view'\n}).then(() =\u003e {\n  console.log('Yay! The alert has been closed!');\n});\n\nmodalService.confirm({\n  title: 'Here is a confirm modal!',\n  text: 'Here is some text to demo that you can pass anything to your view'\n}).then(confirmed =\u003e {\n  if (confirmed) {\n    console.log('Yay! The user confirmed!');\n  } else {\n    console.log('Boo! The user cancelled!');\n  }\n});\n\nmodalService.prompt({\n  title: 'Here is a prompt modal!',\n  text: 'Here is some text to demo that you can pass anything to your view'\n}).then(response =\u003e {\n  if (response) {\n    console.log('Yay! The user wrote a response!');\n  } else {\n    console.log('Boo! The user cancelled!');\n  }\n});\n\n// see a full example ar ./example\n\n```\n\n### Custom implementation\n\n```js\nimport $ from 'jquery'\nimport { Modals } from 'nextbone-modals';\nimport AlertView from './views/alert';\nimport ConfirmView from './views/confirm';\nimport PromptView from './views/prompt';\n\ncustomElements.define('nextbone-modal-alert', AlertView);\ncustomElements.define('nextbone-modal-confirm', ConfirmView);\ncustomElements.define('nextbone-modal-prompt', PromptView);\n\nclass MyModalService extends Modals {\n  initialize() {\n    this.$el = $('\u003cdiv class=\"modal-container\"/\u003e').appendTo(document.body);\n  },\n\n  render(view) {\n    this.$el.append(view);\n  },\n\n  remove(view) {\n    view.$el.remove();\n  },\n\n  animateIn(view) {\n    return new Promise(resolve =\u003e {\n      $(view).fadeIn(300, resolve);\n      this.$el.fadeIn(300, resolve);\n    });\n  },\n\n  animateOut(view) {\n    return new Promise(resolve =\u003e {\n      $(view).fadeOut(300, resolve);\n      this.$el.fadeOut(300, resolve);\n    });\n  },\n\n  animateSwap(oldView, newView) {\n    oldView.$el.hide();\n    newView.$el.show();\n  }\n};\n\nconst modalService = new ModalService();\n\n// same usage as bootstrap\n```\n\n\n## Contributing\n\n### Getting Started\n\n[Fork](https://help.github.com/articles/fork-a-repo/) and\n[clone](http://git-scm.com/docs/git-clone) this repo.\n\n```\nnpm install\n```\n\n### Running Tests\n\n```\nnpm test\n```\n\n===\n\n© 2015 James Kyle. Distributed under ISC license.\n© 2019 Luiz Américo\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblikblum%2Fnextbone-modals","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblikblum%2Fnextbone-modals","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblikblum%2Fnextbone-modals/lists"}