# jpag-main-modal

> Bootstrap modal control

Latest version **1.0.3** (published 2019-03-13) · ISC license · 0 weekly downloads

## Install

```sh
npm install jpag-main-modal
pnpm add jpag-main-modal
yarn add jpag-main-modal
bun add jpag-main-modal
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2019-03-13 |
| First published | 2019-01-18 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 24.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Pedro Aguayo |
| Maintainers | piteraguayo |
| Keywords | Javascript, Node, Bootstrap, modal |

## Links

- npm: https://www.npmjs.com/package/jpag-main-modal
- Repository: https://github.com/Piteraguayo/jpag-main-modal
- Homepage: https://github.com/Piteraguayo/jpag-main-modal#readme
- Issues: https://github.com/Piteraguayo/jpag-main-modal/issues
- npm.io page: https://npm.io/package/jpag-main-modal

## Alternatives

- [@sveltejs/kit](https://npm.io/package/@sveltejs/kit.md) — 2.2M weekly downloads
- [@tangle-network/brand](https://npm.io/package/@tangle-network/brand.md) — 10.0K weekly downloads
- [seneca](https://npm.io/package/seneca.md) — 7.4K weekly downloads
- [@bsb/base](https://npm.io/package/@bsb/base.md) — 7.2K weekly downloads
- [@modern-js/plugin-swc](https://npm.io/package/@modern-js/plugin-swc.md) — 3.4K weekly downloads

## Recent versions

- 1.0.3 (latest) — 2019-03-13
- 1.0.2 — 2019-01-18
- 1.0.1 — 2019-01-18
- 1.0.0 — 2019-01-18

## README

#Main modal control 

Front script to manage Bootstrap modal windows.

###NPM
####Install in Your Project
```sh
npm install jpag-main-modal
```

####Link on your HTML


On your app.js:
```javascript node
const app = express()
app.use('/jpag-main-modal', express.static('node_modules/jpag-main-modal/index.js'));
```
On your HTML:
```html
<script src="/jpag-main-modal"></script>
```
###CDN
```html
<script src="https://cdn.jsdelivr.net/gh/Piteraguayo/jpag-main-modal/index.js"></script>
```

####CSS
Use basic Bootstrap css or implement your own overwriting the classes.

####Usage

```javascript
mainModal.showWithContent('Hello world');
```

**RESULT:**

![Simple mesage](https://raw.githubusercontent.com/Piteraguayo/jpag-main-modal/master/mainModalSimpleMessage.png)

```javascript
function onAcceptYourModal(){
	alert('YOU ACCEPTED THE MODAL');
	mainModal.hide();
}

function onCancelYourModal(){
	alert('YOU CANCELLED THE MODAL');
}

mainModal.showFooter=true;
mainModal.showCancel=true;
mainModal.acceptLabel='Save';
mainModal.onAccept= onAcceptYourModal;
mainModal.onCancel= onCancelYourModal;
mainModal.showWithContent('<span style="color:red">Do you want to delete the files?</span>');
```

**RESULT:**

![Simple mesage](https://raw.githubusercontent.com/Piteraguayo/jpag-main-modal/master/mainModalCancelMessage.png)

You can load async content by using
```javascript
mainModal.showContentFromServer(urlYouWant);
```

---
_Source: https://npm.io/package/jpag-main-modal · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
