Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V5.0.0 #1205

Closed
wants to merge 88 commits into from
Closed

V5.0.0 #1205

Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
7b67b97
Upgrade jQuery move to local version
davidjbradshaw Feb 2, 2024
c886b9b
Add resize observer
davidjbradshaw Feb 2, 2024
1ca9148
v4.3.9
davidjbradshaw Feb 2, 2024
cdec43c
Remove unneed packages
davidjbradshaw Feb 2, 2024
f043d02
rebuild
davidjbradshaw Feb 2, 2024
4f10bb0
Remove :not(option):not(optgroup) from querySelectorAll
davidjbradshaw Feb 2, 2024
918f521
#400 log element used to calculate lowest/tagged element
davidjbradshaw Feb 2, 2024
8d37faf
Remove help on textAreas not resizing, as issue is now dealtwith usin…
davidjbradshaw Feb 2, 2024
cb12e7a
#1008 Always return module.exports
davidjbradshaw Feb 2, 2024
ecb148b
Upper Case tag names
davidjbradshaw Feb 2, 2024
68616b7
Update build
davidjbradshaw Feb 2, 2024
6e6e7e2
Update with details of resizeObserver
davidjbradshaw Feb 2, 2024
cf37611
Update with info on ResizeObserver
davidjbradshaw Feb 2, 2024
fda9779
Add gaurd for null elements
davidjbradshaw Feb 2, 2024
99eb6be
Add Safari to tests
davidjbradshaw Feb 2, 2024
81bb50a
Disable unreliable test
davidjbradshaw Feb 2, 2024
21dec0b
Remove IE support
davidjbradshaw Feb 2, 2024
6bc8f23
#1204 Throw typeError if maxHeight et al is not a number
davidjbradshaw Feb 2, 2024
484f4ce
Update build
davidjbradshaw Feb 2, 2024
87f518d
#811 #727 Use Math.ceil() to round up subpixel heights
davidjbradshaw Feb 2, 2024
dd49763
Only check min < max if both are numbers
davidjbradshaw Feb 2, 2024
755eb3c
Refactor code to remove vender RAF and simplify msg creation
davidjbradshaw Feb 4, 2024
b6a3659
var -> const/let
davidjbradshaw Feb 4, 2024
548315c
Deprecate body options
davidjbradshaw Feb 4, 2024
1cd1e0b
Add browser tab vis and touch events
davidjbradshaw Feb 4, 2024
e4066c4
Remove more IE11 code and convert some funcs to lambdas
davidjbradshaw Feb 4, 2024
e01d104
onInit -> onReady
davidjbradshaw Feb 4, 2024
534879d
onInit -> onReady
davidjbradshaw Feb 4, 2024
c126283
Tidy
davidjbradshaw Feb 4, 2024
d24eead
Tidy
davidjbradshaw Feb 4, 2024
20677ff
Update copyright year to 2024
davidjbradshaw Feb 7, 2024
3599496
Add: skip non-vislble elements in lowestElement
davidjbradshaw Feb 9, 2024
9f0a7ca
Exclude taggedElement from visible check
davidjbradshaw Feb 9, 2024
a779415
Typo
davidjbradshaw Feb 9, 2024
e928fcf
Remove feature check for flatMap and ResizeObserver
davidjbradshaw Feb 9, 2024
1cdcf03
Tidy
davidjbradshaw Feb 9, 2024
bb1ca53
Add boundingClientRect size methods
davidjbradshaw Feb 9, 2024
dbb986a
Add boundingClientRect size methods
davidjbradshaw Feb 9, 2024
256fe08
formating
davidjbradshaw Feb 9, 2024
5748990
Update calculation modes and defaults
davidjbradshaw Feb 10, 2024
f2417e5
debadge
davidjbradshaw Feb 10, 2024
8db8971
Updated to V5
davidjbradshaw Feb 10, 2024
0adac1c
Add fix to eslint
davidjbradshaw Feb 10, 2024
30125c7
Update build
davidjbradshaw Feb 10, 2024
f274d88
Update upgrade.md
davidjbradshaw Feb 10, 2024
5c77e8e
Add size offset anf update values return by getPageIfo
davidjbradshaw Feb 11, 2024
41aac40
Update build
davidjbradshaw Feb 11, 2024
f857e15
Merge branch 'master' into resizeObserver
davidjbradshaw Feb 11, 2024
44024da
Update log messages
davidjbradshaw Feb 11, 2024
6ca97cc
Update build
davidjbradshaw Feb 11, 2024
5bce787
Add targetIframe option
davidjbradshaw Feb 12, 2024
064d75a
Add targetIframe option
davidjbradshaw Feb 12, 2024
4c9c72e
remove iframe from being passed to trigger function
davidjbradshaw Feb 12, 2024
7cfa30e
Change targertIframe -> messageTarget
davidjbradshaw Feb 12, 2024
a6f419a
messageTarget -> postMessageTarget
davidjbradshaw Feb 12, 2024
3e4c8e1
Add docs for google apps script
davidjbradshaw Feb 12, 2024
779d22f
Update google_apps_script.md
davidjbradshaw Feb 12, 2024
75f54e8
Update copyright
davidjbradshaw Feb 12, 2024
036a09c
Update options.md
davidjbradshaw Feb 12, 2024
2136c04
Update options.md
davidjbradshaw Feb 12, 2024
6a184dd
Fix margins
davidjbradshaw Feb 12, 2024
c192eff
tidy
davidjbradshaw Feb 12, 2024
4348b40
Remove jQuery
davidjbradshaw Feb 12, 2024
325e3bd
Remove 'grow' calc method
davidjbradshaw Feb 12, 2024
3958a12
convert const to let
davidjbradshaw Feb 12, 2024
bbe32c1
Create Animation example
davidjbradshaw Feb 13, 2024
972b7a4
Update build
davidjbradshaw Feb 13, 2024
033ec32
Add resize observer to all non static elements outside document flow
davidjbradshaw Feb 13, 2024
aadd442
Remove animation event listeners
davidjbradshaw Feb 13, 2024
f1d27f5
Disable browser event listeners that are no longer required
davidjbradshaw Feb 13, 2024
af2bb04
Remove jQuery from two.html
davidjbradshaw Feb 13, 2024
e9d8b97
Switch from timer -> perf API
davidjbradshaw Feb 13, 2024
d0b2547
Remove legacy code
davidjbradshaw Feb 13, 2024
6f874a2
#708 Fix possible memory leak
davidjbradshaw Feb 13, 2024
0d59dac
Remove jsHint comments
davidjbradshaw Feb 13, 2024
fb3e34c
Remove jsHint
davidjbradshaw Feb 13, 2024
a5e7c31
Update eslint config
davidjbradshaw Feb 14, 2024
ab0ae9e
Bump eslint config versions
davidjbradshaw Feb 14, 2024
458755c
Disable old qunit tests
davidjbradshaw Feb 14, 2024
70a053a
Update eslint scanner config
davidjbradshaw Feb 14, 2024
db26752
update to v3
davidjbradshaw Feb 14, 2024
5e7105e
Fix link to .eslintrc
davidjbradshaw Feb 14, 2024
7506b31
Fix sarif
davidjbradshaw Feb 14, 2024
8826698
Fix @microsoft/eslint-formatter-sarif
davidjbradshaw Feb 14, 2024
cea2845
Remove @microsoft/eslint-formatter-sarif
davidjbradshaw Feb 14, 2024
b28a525
sarif formatter -> v3
davidjbradshaw Feb 15, 2024
c98463d
@microsoft/eslint-formatter-sarif
davidjbradshaw Feb 15, 2024
1007154
Fix github action
davidjbradshaw Feb 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
},
"parserOptions": { "ecmaVersion": 2015 },
"rules": {
"const-case/uppercase": 0,
"func-names": 0,
"global-require": 0,
"no-param-reassign": 0,
"no-plusplus": 0,
"no-use-before-define": 0,
"no-shadow": 0,
"no-var": 0,
"object-shorthand": 0,
"one-var": 0,
"prefer-arrow-callback": 0,
Expand All @@ -28,7 +28,6 @@
"vars-on-top": 0,
"yoda": 0,
"ie11/no-collection-args": ["error"],
"ie11/no-for-in-const": ["error"],
"ie11/no-loop-func": ["warn"],
"ie11/no-weak-collections": ["error"],
"import/no-amd": 0,
Expand All @@ -48,11 +47,13 @@
"unicorn/prefer-node-append": 0,
"unicorn/prefer-node-protocol": 0,
"unicorn/prefer-node-remove": 0,
"unicorn/prefer-number-properties": 0,
"unicorn/prefer-query-selector": 0,
"unicorn/prefer-spread": 0,
"unicorn/prefer-string-slice": 0,
"unicorn/prefer-top-level-await": 0,
"unicorn/prefer-number-properties": 0,
"unicorn/prevent-abbreviations": 0,
"unicorn/switch-case-braces": 0
"unicorn/switch-case-braces": 0,
"xss/no-mixed-html": 0
}
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ This library enables the automatic resizing of the height and width of both same
- Domain authentication for cross domain iFrames.
- Provides a range of page size calculation methods to support complex CSS layouts.
- Detects changes to the DOM that can cause the page to resize using [MutationObserver](https://developer.mozilla.org/en/docs/Web/API/MutationObserver).
- Detects HTML elements resizing with [ResizeObserver](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver/ResizeObserver).
- Detects events that can cause the page to resize (Window Resize, CSS Animation and Transition, Orientation Change and Mouse events).
- Simplified messaging between iFrame and host page via [postMessage](https://developer.mozilla.org/en-US/docs/Web/API/window.postMessage).
- Fixes in page links in iFrame and supports links between the iFrame and parent page.
Expand Down
4 changes: 3 additions & 1 deletion docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ The most common cause of this is not placing the [iframeResizer.contentWindow.mi

### IFrame not detecting CSS :hover events

If your page resizes via CSS `:hover` events, these won't be detected by default. It is however possible to create `mouseover` and `mouseout` event listeners on the elements that are resized via CSS and have these events call the [parentIFrame.size()](##parentiframesize-customheight-customwidth) method. With jQuery this can be done as follows
CSS `:hover` events that cause the page to resize outside of the standard document flow can sometimes be difficult to detect. If this is an issue, then a workaround is to create `mouseover` and `mouseout` event listeners on the elements that are resized via CSS and have these events call the [parentIFrame.size()](##parentiframesize-customheight-customwidth) method. With jQuery this can be done as follows.

```js
function resize(){
Expand All @@ -43,6 +43,7 @@ function resize(){
$(*Element with hover style*).hover(resize);
```

<!--
### IFrame not detecting textarea resizes

Both FireFox and the WebKit based browsers allow the user to resize `textarea` input boxes. Unfortunately the WebKit browsers don't trigger the mutation event when this happens. This can be worked around to some extent with the following code.
Expand All @@ -64,6 +65,7 @@ $('textarea')
}
})
```
-->

### IFrame flickers

Expand Down
2 changes: 1 addition & 1 deletion example/frame.absolute.html
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
>
</div>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="jquery-3.7.1.min.js"></script>

<script
type="text/javascript"
Expand Down
2 changes: 1 addition & 1 deletion example/frame.content.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<title>iFrame message passing test</title>
<meta name="description" content="iFrame message passing test" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="jquery-3.7.1.min.js"></script>
<style>
*,
*:before,
Expand Down
30 changes: 19 additions & 11 deletions example/frame.hover.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,15 @@
<a href="frame.content.html">Back to page 1</a>

<p>
Mouse over the code example below.
Mouse over the code example below.
</p>
<p>
In modern browsers size changes caused by CSS are detected via the ResizeObserver API,
however, if you have an element outside the standard document flow, or in really old browses you may need to detect this
yourself and ask iFrameResizer to update the page size.
</p>
<p>
Uncomment the code below to see this working.
</p>

<xmp>
Expand All @@ -31,10 +39,10 @@
}
</script>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="jquery-3.7.1.min.js"></script>
<script
type="text/javascript"
src="../js/iframeResizer.contentWindow.min.js"
src="../js/iframeResizer.contentWindow.js"
></script>

<div id="code">
Expand All @@ -50,14 +58,14 @@
}
</style>
<script>
;(function() {
$('xmp').hover(function() {
if ('parentIFrame' in window) {
// Fix race condition in FireFox with setTimeout
setTimeout(parentIFrame.size.bind(parentIFrame), 0)
}
})
})()
// ;(function() {
// $('xmp').hover(function() {
// if ('parentIFrame' in window) {
// // Fix race condition in FireFox with setTimeout
// setTimeout(parentIFrame.size.bind(parentIFrame), 0)
// }
// })
// })()
</script>
</div>

Expand Down
2 changes: 1 addition & 1 deletion example/frame.nested.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ <h2>Nested iFrame</h2>
</div>
<p id="callback"></p>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="jquery-3.7.1.min.js"></script>

<script type="text/javascript" src="../js/iframeResizer.min.js"></script>
<script type="text/javascript">
Expand Down
2 changes: 1 addition & 1 deletion example/frame.textarea.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

<textarea id="textArea">Resize me</textarea>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="jquery-3.7.1.min.js"></script>
<script src="../js/iframeResizer.contentWindow.min.js"></script>

<script>
Expand Down
2 changes: 1 addition & 1 deletion example/frame.tolerance.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
>
</div>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="jquery-3.7.1.min.js"></script>
<script
type="text/javascript"
src="../js/iframeResizer.contentWindow.min.js"
Expand Down
2 changes: 1 addition & 1 deletion example/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ <h2>Automagically resizing iFrame</h2>

<![endif]-->

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="jquery-3.7.1.min.js"></script>
<script type="text/javascript" src="../js/iframeResizer.min.js"></script>
<script type="text/javascript">
/*
Expand Down
2 changes: 2 additions & 0 deletions example/jquery-3.7.1.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion example/two.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ <h2>Automagically resizing iFrame</h2>

<![endif]-->

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="jquery-3.7.1.min.js"></script>
<script type="text/javascript" src="../src/iframeResizer.js"></script>
<script type="text/javascript">
/*
Expand Down
12 changes: 6 additions & 6 deletions gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ module.exports = function (grunt) {
},
single: {
singleRun: true,
browsers: ['Chrome', 'Firefox'] // 'Safari', 'PhantomJS'
browsers: ['Chrome'] // 'Firefox', 'PhantomJS', 'Safari'
},
watch: {
singleRun: false,
Expand Down Expand Up @@ -136,8 +136,8 @@ module.exports = function (grunt) {
},
deployExample: {
command: function () {
var retStr = '',
fs = require('fs')
let retStr = ''
const fs = require('fs')

if (fs.existsSync('bin')) {
retStr = 'bin/deploy.sh'
Expand Down Expand Up @@ -199,7 +199,7 @@ module.exports = function (grunt) {
grunt.registerMultiTask('removeBlock', function () {
// set up a removal regular expression
// eslint-disable-next-line security/detect-non-literal-regexp
var removalRegEx = new RegExp(
const removalRegEx = new RegExp(
'(// ' +
this.options()[0] +
' //)(?:[^])*?(// ' +
Expand All @@ -209,8 +209,8 @@ module.exports = function (grunt) {
)

this.data.forEach(function (fileObj) {
var sourceFile = grunt.file.read(fileObj.src)
var removedFile = sourceFile.replace(removalRegEx, '')
const sourceFile = grunt.file.read(fileObj.src)
const removedFile = sourceFile.replace(removalRegEx, '')

grunt.file.write(fileObj.dest, removedFile)
}) // for each loop end
Expand Down
Loading
Loading