Comparing version 1.0.3 to 1.0.4
The MIT License (MIT) | ||
Copyright (c) 2016 ZioNN | ||
Copyright (c) 2016 Rodrigo Perrote. | ||
@@ -5,0 +5,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy |
{ | ||
"name": "modal.js", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "A simple modern modal", | ||
@@ -5,0 +5,0 @@ "main": "modal.js", |
@@ -6,4 +6,4 @@ # Modal.js | ||
[![npm][npm-image]][npm-url] [![license][license-image]][license-url] [![changelog][changelog-image]][changelog-url] | ||
**NPM** | ||
@@ -29,3 +29,2 @@ | ||
## Modal on! | ||
@@ -88,20 +87,12 @@ | ||
You can modify defaults modal.json and create different templates of modal. Plugins.json have this structure: | ||
You can modify defaults modal.json. | ||
```javascript | ||
"text" : { //<-- Name for plugin. | ||
"element" : "", //<-- Parent element of content. | ||
"objAttrs": { //<-- Set attr to element. elm.attr = value | ||
"innerHTML" : "", | ||
"id" : "" | ||
}, | ||
'attrs' : { //<-- Set attr to element. elm.setAttribute(attr, value) | ||
}, | ||
"dfts" : { //<-- Overwrite defaults | ||
"shape" : "", | ||
"shapeStyle" : "", | ||
"layout" : "", | ||
"icon" : "", | ||
"mb_clase" : "" | ||
} | ||
"dfts" : { | ||
"shapeClassname":"modalShape-dft", | ||
"shapeStyle":"modalStyle-dft", | ||
"layout":"modalType-dft", | ||
"icon":"", | ||
"contentClassname":"modalContent-dft", | ||
"acc":"Ventana modal abierta. Presiona escape para cerrar la ventana" | ||
} | ||
@@ -121,22 +112,43 @@ ``` | ||
```javascript | ||
"iframe" : { | ||
"element" : "iframe", | ||
"objAttrs" :{ | ||
"id": "'mFrame-content'", | ||
"width": "args.content.width", | ||
"height": "args.content.height", | ||
"src" : "data" | ||
"iframe" : { //<-- name of new plugin or modal type. | ||
"element" : "iframe", //<-- element create on body of modal | ||
"objAttrs" :{ //<-- objAttrs set attributes on obj element | ||
"id": "'mFrame-content'", //<-- iframe.id | ||
"width": "args.content.width", //<-- iframe.width | ||
"height": "args.content.height", //<-- iframe.height | ||
"src" : "data" //<-- iframe.src | ||
}, | ||
"attrs" : { | ||
"'frameborder'" : "'0'", | ||
"'allowfullscreen'" : "''", | ||
"'mozallowfullscreen'" : "''", | ||
"'webkitallowfullscreen'" : "''", | ||
"'hspace'" : "'0'", | ||
"'vspace'" : "'0'", | ||
"'scrolling'" : "'auto'" | ||
"attrs" : { //<-- attrs set attributes on dom element | ||
"frameborder" : "'0'", //<-- iframe.setAttribute("frameborder","0") | ||
"allowfullscreen" : "''", //<-- iframe.setAttribute("allowfullscreen","") | ||
"mozallowfullscreen" : "''", | ||
"webkitallowfullscreen" : "''", | ||
"hspace" : "'0'", | ||
"vspace" : "'0'", | ||
"scrolling" : "'auto'" | ||
}, | ||
"dfts" : { | ||
"shapeClassname":"", | ||
"shapeStyle":"", | ||
"layout":"", | ||
"icon":"", | ||
"contentClassname":"", | ||
"acc":"" | ||
} | ||
} | ||
``` | ||
**NOTE: Important! objAttrs and attrs is under eval. You can use variables of args (parameter of modal) and set new parameters. Example: width, height and id. If you pass string need double quotes " ' ' ".** | ||
#### Json url | ||
Url of "plugins" or types of modals need this structure: | ||
* index.html -> calls modal js | ||
* js/modal.json | ||
* js/modal.js | ||
but before call modal js you can overwrite url: | ||
urlModal = "js/modal.json" -> Default | ||
## Acknowledgements | ||
@@ -143,0 +155,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
21613
161
0