iframe-resizer 4.3.11 → 4.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.editorconfig +19 -0
- package/README.md +11 -99
- package/package.json +7 -12
package/.editorconfig
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# EditorConfig helps developers define and maintain consistent
|
|
2
|
+
# coding styles between different editors and IDEs
|
|
3
|
+
# editorconfig.org
|
|
4
|
+
|
|
5
|
+
root = true
|
|
6
|
+
|
|
7
|
+
[*]
|
|
8
|
+
end_of_line = lf
|
|
9
|
+
charset = utf-8
|
|
10
|
+
trim_trailing_whitespace = true
|
|
11
|
+
insert_final_newline = true
|
|
12
|
+
indent_style = space
|
|
13
|
+
indent_size = 2
|
|
14
|
+
|
|
15
|
+
[*.hbs]
|
|
16
|
+
insert_final_newline = false
|
|
17
|
+
|
|
18
|
+
[*.{diff,md}]
|
|
19
|
+
trim_trailing_whitespace = false
|
package/README.md
CHANGED
|
@@ -1,105 +1,17 @@
|
|
|
1
|
-
<img src="https://
|
|
1
|
+
[<img src="https://iframe-resizer.com/logo-full.svg" alt="" title="" style="margin-bottom: -20px">](https://iframe-resizer.com)
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
[](https://npm-stat.com/charts.html?package=iframe-resizer&from=2014-12-31)
|
|
5
|
-
[](https://www.jsdelivr.com/package/npm/iframe-resizer)
|
|
6
|
-
[](https://coveralls.io/github/davidjbradshaw/iframe-resizer)
|
|
3
|
+
This package is a legacy version of __[iframe-resizer](https://iframe-resizer.com)__. This project has now been split in to separate packages for the parent and child pages.
|
|
7
4
|
|
|
8
|
-
|
|
5
|
+
* [@iframe-resizer/parent](https://www.npmjs.com/package/@iframe-resizer/parent)
|
|
6
|
+
* [@iframe-resizer/child](https://www.npmjs.com/package/@iframe-resizer/child)
|
|
9
7
|
|
|
10
|
-
|
|
11
|
-
- Works with multiple and nested iFrames.
|
|
12
|
-
- Domain authentication for cross domain iFrames.
|
|
13
|
-
- Provides a range of page size calculation methods to support complex CSS layouts.
|
|
14
|
-
- Detects changes to the DOM that can cause the page to resize using [MutationObserver](https://developer.mozilla.org/en/docs/Web/API/MutationObserver).
|
|
15
|
-
- Detects events that can cause the page to resize (Window Resize, CSS Animation and Transition, Orientation Change and Mouse events).
|
|
16
|
-
- Simplified messaging between iFrame and host page via [postMessage](https://developer.mozilla.org/en-US/docs/Web/API/window.postMessage).
|
|
17
|
-
- Fixes in page links in iFrame and supports links between the iFrame and parent page.
|
|
18
|
-
- Provides custom sizing and scrolling methods.
|
|
19
|
-
- Exposes parent position and viewport size to the iFrame.
|
|
20
|
-
- Provides `onMouseEnter` and `onMouseLeave` events for the iFrame.
|
|
21
|
-
- Works with [ViewerJS](http://viewerjs.org/) to support PDF and ODF documents.
|
|
8
|
+
Their is now also versions of _iframe-resizer_ for React, Vue and jQuery.
|
|
22
9
|
|
|
23
|
-
|
|
10
|
+
* [@iframe-resizer/react](https://www.npmjs.com/package/@iframe-resizer/react)
|
|
11
|
+
* [@iframe-resizer/vue](https://www.npmjs.com/package/@iframe-resizer/vue)
|
|
12
|
+
* [@iframe-resizer/jquery](https://www.npmjs.com/package/@iframe-resizer/jquery)
|
|
24
13
|
|
|
25
|
-
|
|
14
|
+
**For more details please see our new website: [https://iframe-resizer.com](https://iframe-resizer.com).**
|
|
26
15
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
## Getting Started
|
|
30
|
-
|
|
31
|
-
### Install
|
|
32
|
-
|
|
33
|
-
This package can be installed via NPM (`npm install iframe-resizer --save`).
|
|
34
|
-
|
|
35
|
-
### Usage
|
|
36
|
-
|
|
37
|
-
The package contains two minified JavaScript files in the [js](https://github.com/davidjbradshaw/iframe-resizer/tree/master/js) folder. The first ([iframeResizer.min.js](https://raw.githubusercontent.com/davidjbradshaw/iframe-resizer/master/js/iframeResizer.min.js)) is for the page hosting the iFrames. It can be called with via JavaScript:
|
|
38
|
-
|
|
39
|
-
```js
|
|
40
|
-
const iframes = iFrameResize( [{options}], [css selector] || [iframe] );
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
The second file ([iframeResizer.contentWindow.min.js](https://raw.github.com/davidjbradshaw/iframe-resizer/master/js/iframeResizer.contentWindow.min.js)) needs placing in the page(s) contained within your iFrame. <i>This file is designed to be a guest on someone else's system, so has no dependencies and won't do anything until it's activated by a message from the containing page</i>.
|
|
44
|
-
|
|
45
|
-
### Typical setup
|
|
46
|
-
|
|
47
|
-
The normal configuration is to have the iFrame resize when the browser window changes size or the content of the iFrame changes. To set this up you need to configure one of the dimensions of the iFrame to a percentage and tell the library to only update the other dimension. Normally you would set the width to 100% and have the height scale to fit the content.
|
|
48
|
-
|
|
49
|
-
```html
|
|
50
|
-
<style>
|
|
51
|
-
iframe {
|
|
52
|
-
width: 1px;
|
|
53
|
-
min-width: 100%;
|
|
54
|
-
}
|
|
55
|
-
</style>
|
|
56
|
-
<script src="/js/iframeResizer.min.js"></script>
|
|
57
|
-
<iframe id="myIframe" src="http://anotherdomain.com/iframe.html"></iframe>
|
|
58
|
-
<script>
|
|
59
|
-
iFrameResize({ log: true }, '#myIframe')
|
|
60
|
-
</script>
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
**Note:** Using _min-width_ to set the width of the iFrame, works around an issue in iOS that can prevent the iFrame from sizing correctly.
|
|
64
|
-
|
|
65
|
-
If you have problems, check the [troubleshooting](https://github.com/davidjbradshaw/iframe-resizer/blob/master/docs/troubleshooting.md) section.
|
|
66
|
-
|
|
67
|
-
### Example
|
|
68
|
-
|
|
69
|
-
To see this working take a look at this [example](https://davidjbradshaw.github.io/iframe-resizer/example/) and watch the [console](https://developer.mozilla.org/en-US/docs/Tools/Web_Console).
|
|
70
|
-
|
|
71
|
-
## API Documentation
|
|
72
|
-
|
|
73
|
-
IFrame-Resizer provides an extensive range of options and APIs for both the parent page and the iframed page.
|
|
74
|
-
|
|
75
|
-
- **Parent Page API**
|
|
76
|
-
- [Options](https://github.com/davidjbradshaw/iframe-resizer/blob/master/docs/parent_page/options.md)
|
|
77
|
-
- [Events](https://github.com/davidjbradshaw/iframe-resizer/blob/master/docs/parent_page/events.md)
|
|
78
|
-
- [Methods](https://github.com/davidjbradshaw/iframe-resizer/blob/master/docs/parent_page/methods.md)
|
|
79
|
-
- **IFramed Page API**
|
|
80
|
-
- [Options](https://github.com/davidjbradshaw/iframe-resizer/blob/master/docs/iframed_page/options.md)
|
|
81
|
-
- [Events](https://github.com/davidjbradshaw/iframe-resizer/blob/master/docs/iframed_page/events.md)
|
|
82
|
-
- [Methods](https://github.com/davidjbradshaw/iframe-resizer/blob/master/docs/iframed_page/methods.md)
|
|
83
|
-
- **Use with Libraries and Frameworks**
|
|
84
|
-
- [React](https://github.com/davidjbradshaw/iframe-resizer-react)
|
|
85
|
-
- [Vue](https://github.com/davidjbradshaw/iframe-resizer/blob/master/docs/use_with/vue.md)
|
|
86
|
-
- [Nuxt](https://github.com/davidjbradshaw/iframe-resizer/issues/831#issuecomment-665760332)
|
|
87
|
-
- [Angular](https://github.com/davidjbradshaw/iframe-resizer/issues/478#issuecomment-347958630)
|
|
88
|
-
- [Ember](https://github.com/alexlafroscia/ember-iframe-resizer-modifier)
|
|
89
|
-
- [jQuery](https://github.com/davidjbradshaw/iframe-resizer/blob/master/docs/use_with/jquery.md)
|
|
90
|
-
- [Google Apps Script](https://stackoverflow.com/a/65724113/2087070)
|
|
91
|
-
- [Troubleshooting](https://github.com/davidjbradshaw/iframe-resizer/blob/master/docs/troubleshooting.md)
|
|
92
|
-
- [Upgrade from version 3](https://github.com/davidjbradshaw/iframe-resizer/blob/master/docs/upgrade.md)
|
|
93
|
-
- [Version history](https://github.com/davidjbradshaw/iframe-resizer/blob/master/CHANGELOG.md)
|
|
94
|
-
|
|
95
|
-
## License
|
|
96
|
-
|
|
97
|
-
Copyright © 2013-23 [David J. Bradshaw](https://github.com/davidjbradshaw) -
|
|
98
|
-
Licensed under the [MIT License](LICENSE)
|
|
99
|
-
|
|
100
|
-
<!--
|
|
101
|
-
[](https://nodei.co/npm/iframe-resizer/)
|
|
102
|
-
|
|
103
|
-
[](https://travis-ci.org/davidjbradshaw/iframe-resizer)
|
|
104
|
-
[](https://snyk.io/test/github/davidjbradshaw/iframe-resizer)
|
|
105
|
-
-->
|
|
16
|
+
---
|
|
17
|
+
Copyright © 2013-24 [David J. Bradshaw](https://github.com/davidjbradshaw)
|
package/package.json
CHANGED
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "iframe-resizer",
|
|
3
|
-
"version": "4.
|
|
4
|
-
"homepage": "https://
|
|
3
|
+
"version": "4.4.1",
|
|
4
|
+
"homepage": "https://iframe-resizer.com",
|
|
5
5
|
"authors": [
|
|
6
6
|
"David J. Bradshaw <dave@bradshaw.net>"
|
|
7
7
|
],
|
|
8
|
-
"maintainers": [
|
|
9
|
-
{
|
|
10
|
-
"name": "David J. Bradshaw",
|
|
11
|
-
"email": "dave@bradshaw.net"
|
|
12
|
-
}
|
|
13
|
-
],
|
|
14
8
|
"scripts": {
|
|
9
|
+
"postinstall": "node bin/post.js",
|
|
15
10
|
"build": "grunt build",
|
|
16
11
|
"eslint": "eslint *.js src/* --color",
|
|
17
12
|
"eslint:fix": "npm run eslint -- --fix",
|
|
@@ -19,7 +14,7 @@
|
|
|
19
14
|
"test": "grunt travis",
|
|
20
15
|
"upgrade": "npm-check-updates -u && npm install && npm run test"
|
|
21
16
|
},
|
|
22
|
-
"description": "
|
|
17
|
+
"description": "This package has now been split into two separate packages. Please use '@iframe-resizer/parent' and '@iframe-resizer/child' for new projects. This package will continue to be maintained for existing projects.",
|
|
23
18
|
"repository": {
|
|
24
19
|
"type": "git",
|
|
25
20
|
"url": "https://github.com/davidjbradshaw/iframe-resizer.git"
|
|
@@ -27,7 +22,7 @@
|
|
|
27
22
|
"github": "https://github.com/davidjbradshaw/iframe-resizer",
|
|
28
23
|
"funding": {
|
|
29
24
|
"type": "individual",
|
|
30
|
-
"url": "https://
|
|
25
|
+
"url": "https://iframe-resizer.com//pricing"
|
|
31
26
|
},
|
|
32
27
|
"devDependencies": {
|
|
33
28
|
"cosmiconfig": "^9.0.0",
|
|
@@ -113,7 +108,7 @@
|
|
|
113
108
|
"engines": {
|
|
114
109
|
"node": ">=0.8.0"
|
|
115
110
|
},
|
|
116
|
-
"license": "
|
|
111
|
+
"license": "GPL-3.0",
|
|
117
112
|
"keywords": [
|
|
118
113
|
"CrossDomain",
|
|
119
114
|
"Cross-Domain",
|
|
@@ -133,4 +128,4 @@
|
|
|
133
128
|
"responsive-iframes",
|
|
134
129
|
"jquery-plugin"
|
|
135
130
|
]
|
|
136
|
-
}
|
|
131
|
+
}
|