Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

modal.js

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

modal.js - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

2

LICENSE.md
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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc