first commit

This commit is contained in:
aschwarz
2023-04-25 13:25:59 +02:00
commit 086d1e1e9e
1774 changed files with 396049 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

View File

@ -0,0 +1,270 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>iFrame message passing test</title>
<meta name="description" content="iFrame message passing test">
<script src="jquery.js"></script>
<style>
a { float:right; }
</style>
</head>
<body>
<b>iFrame</b>
<div>Some content to be replaced</div>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna
aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint
occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will
give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the
master-builder of human happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but
because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful.
Nor again is there anyone who loves or pursues or desires to obtain pain of itself, because it is pain, but because
occasionally circumstances occur in which toil and pain can procure him some great pleasure. To take a trivial
example, which of us ever undertakes laborious physical exercise, except to obtain some advantage from it? But who
has any right to find fault with a man who chooses to enjoy a pleasure that has no annoying consequences, or one who
avoids a pain that produces no resultant pleasure?
</p>
<p>
On the other hand, we denounce with righteous indignation and dislike men who are so beguiled and demoralized by the
charms of pleasure of the moment, so blinded by desire, that they cannot foresee the pain and trouble that are bound
to ensue; and equal blame belongs to those who fail in their duty through weakness of will, which is the same as
saying through shrinking from toil and pain. These cases are perfectly simple and easy to distinguish. In a free
hour, when our power of choice is untrammelled and when nothing prevents our being able to do what we like best,
every pleasure is to be welcomed and every pain avoided. But in certain circumstances and owing to the claims of duty
or the obligations of business it will frequently occur that pleasures have to be repudiated and annoyances accepted.
The wise man therefore always holds in these matters to this principle of selection: he rejects pleasures to secure
other greater pleasures, or else he endures pains to avoid worse pains.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna
aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint
occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will
give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the
master-builder of human happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but
because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful.
Nor again is there anyone who loves or pursues or desires to obtain pain of itself, because it is pain, but because
occasionally circumstances occur in which toil and pain can procure him some great pleasure. To take a trivial
example, which of us ever undertakes laborious physical exercise, except to obtain some advantage from it? But who
has any right to find fault with a man who chooses to enjoy a pleasure that has no annoying consequences, or one who
avoids a pain that produces no resultant pleasure?
</p>
<p>
On the other hand, we denounce with righteous indignation and dislike men who are so beguiled and demoralized by the
charms of pleasure of the moment, so blinded by desire, that they cannot foresee the pain and trouble that are bound
to ensue; and equal blame belongs to those who fail in their duty through weakness of will, which is the same as
saying through shrinking from toil and pain. These cases are perfectly simple and easy to distinguish. In a free
hour, when our power of choice is untrammelled and when nothing prevents our being able to do what we like best,
every pleasure is to be welcomed and every pain avoided. But in certain circumstances and owing to the claims of duty
or the obligations of business it will frequently occur that pleasures have to be repudiated and annoyances accepted.
The wise man therefore always holds in these matters to this principle of selection: he rejects pleasures to secure
other greater pleasures, or else he endures pains to avoid worse pains.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna
aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint
occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will
give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the
master-builder of human happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but
because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful.
Nor again is there anyone who loves or pursues or desires to obtain pain of itself, because it is pain, but because
occasionally circumstances occur in which toil and pain can procure him some great pleasure. To take a trivial
example, which of us ever undertakes laborious physical exercise, except to obtain some advantage from it? But who
has any right to find fault with a man who chooses to enjoy a pleasure that has no annoying consequences, or one who
avoids a pain that produces no resultant pleasure?
</p>
<p>
On the other hand, we denounce with righteous indignation and dislike men who are so beguiled and demoralized by the
charms of pleasure of the moment, so blinded by desire, that they cannot foresee the pain and trouble that are bound
to ensue; and equal blame belongs to those who fail in their duty through weakness of will, which is the same as
saying through shrinking from toil and pain. These cases are perfectly simple and easy to distinguish. In a free
hour, when our power of choice is untrammelled and when nothing prevents our being able to do what we like best,
every pleasure is to be welcomed and every pain avoided. But in certain circumstances and owing to the claims of duty
or the obligations of business it will frequently occur that pleasures have to be repudiated and annoyances accepted.
The wise man therefore always holds in these matters to this principle of selection: he rejects pleasures to secure
other greater pleasures, or else he endures pains to avoid worse pains.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna
aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint
occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will
give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the
master-builder of human happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but
because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful.
Nor again is there anyone who loves or pursues or desires to obtain pain of itself, because it is pain, but because
occasionally circumstances occur in which toil and pain can procure him some great pleasure. To take a trivial
example, which of us ever undertakes laborious physical exercise, except to obtain some advantage from it? But who
has any right to find fault with a man who chooses to enjoy a pleasure that has no annoying consequences, or one who
avoids a pain that produces no resultant pleasure?
</p>
<p>
On the other hand, we denounce with righteous indignation and dislike men who are so beguiled and demoralized by the
charms of pleasure of the moment, so blinded by desire, that they cannot foresee the pain and trouble that are bound
to ensue; and equal blame belongs to those who fail in their duty through weakness of will, which is the same as
saying through shrinking from toil and pain. These cases are perfectly simple and easy to distinguish. In a free
hour, when our power of choice is untrammelled and when nothing prevents our being able to do what we like best,
every pleasure is to be welcomed and every pain avoided. But in certain circumstances and owing to the claims of duty
or the obligations of business it will frequently occur that pleasures have to be repudiated and annoyances accepted.
The wise man therefore always holds in these matters to this principle of selection: he rejects pleasures to secure
other greater pleasures, or else he endures pains to avoid worse pains.
</p>
<script type="text/javascript">
(function () {
var logging = true;
try {
function addEventListener(e, func) {
if (window.addEventListener) {
window.addEventListener(e, func, false);
} else if (window.attachEvent) {
window.attachEvent('on' + e, func);
}
}
function log(msg) {
if (logging && window.console) {
console.info('[Test] ' + msg);
}
}
function warn(msg) {
if (window.console) {
console.warn('[Test] ' + msg);
}
}
function init(test) {
function changeContent() {
$('p').eq(0).remove();
}
function callMethod(methodName, val1, val2) {
if ('parentIFrame' in window)
window.parentIFrame[methodName](val1, val2);
else
warn('window.parentIFrame methods not enabled.')
}
//console.info(test);
switch (test) {
case 'changeContent':
setInterval(function () { changeContent(); }, 2);
break;
case 'close':
init('imageAsSecondMutation');
setTimeout(function () {
callMethod('close');
}, 2000);
break;
case 'pageChange':
location.href = '../../example/frame.hover.html';
break;
case 'nested':
location.href = 'frame.nested.html';
break;
case 'size':
changeContent();
callMethod('size');
break;
case 'autoResize':
callMethod('setAutoResize', true);
setTimeout(function () {
changeContent();
}, 500);
break;
case 'size100':
callMethod('size', 100);
break;
case 'size200300':
callMethod('size', 200, 300);
break;
case 'jsTrigger':
changeContent();
callMethod('trigger');
break;
case 'chkHeight':
callMethod('sendMessage', document.body.offsetHeight);
break;
case 'chkBackground':
callMethod('sendMessage', document.body.style.background);
break;
case 'chkSendMsg':
callMethod('sendMessage', 'message: test string');
break;
case 'chkSendObj':
callMethod('sendMessage', { message: 'test object' });
break;
case 'chkGetId':
if ('parentIFrame' in window)
callMethod('sendMessage', window.parentIFrame.getId());
break;
case 'setHeightCalculationMethod':
if ('parentIFrame' in window) {
parentIFrame.setHeightCalculationMethod('max');
callMethod('size');
}
break;
case 'width':
$('p').width(3000);
break;
case 'image':
$('p').html('<img src="djb.jpg">');
break;
case 'imageAsSecondMutation':
$('div').html('How now brown cow');
$('p').html('<img src="djb.jpg">');
$('b').html('<img src="djb2.jpg">');
break;
}
}
window.iFrameResizer = {
onMessage: init
}
}
catch (e) {
warn(e);
}
})();
</script>
<script type="text/javascript" src="../../js/iframeResizer.contentWindow.min.js"></script>
</body>
</html>

View File

@ -0,0 +1,46 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>iFrame message passing test</title>
<meta name="description" content="iFrame message passing test">
<meta name="viewport" content="width=device-width">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<style>
*,
*:before,
*:after {
box-model: border-box;
}
a {
float: right;
margin-left: 10px;
}
h2 {
margin-top: 0;
}
</style>
</head>
<body>
<h2>Late load JS test</h2>
<p>Load JS with require after load event has fired.</p>
<div style="margin:20px;">
</div>
<script src="jquery.js"></script>
<script>
$(document).ready(function () {
setTimeout(function () {
console.log('Load Script');
$.getScript('../../js/iframeResizer.contentWindow.min.js');
}, 500);
});
</script>
</body>
</html>

View File

@ -0,0 +1,45 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>iFrame message passing test</title>
<meta name="description" content="iFrame message passing test">
<meta name="viewport" content="width=device-width">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<style>
*, *:before, *:after {box-model: border-box;}
a { float:right; margin-left:10px;}
h2 {margin-top: 0;}
</style>
</head>
<body>
<h2>Nested iFrame</h2>
<p>Resize window or click one of the links in the nested iFrame to watch it resize.</p>
<div style="margin:20px;">
<iframe id="nestedIFrame" src="frame.content.html" width="100%" scrolling="no"></iframe>
</div>
<p id="callback">
</p>
<script type="text/javascript" src="../../js/iframeResizer.contentWindow.min.js"></script>
<script src="jquery.js"></script>
<script type="text/javascript" src="../../src/iframeResizer.js"></script>
<script type="text/javascript" src="../../js/ie8.polyfils.min.js"></script>
<script type="text/javascript">
iFrameResize({
//log : true, // Enable console logging
onResized: function (messageData) { // Callback fn when message is received
setTimeout(function () { parentIFrame.sendMessage('nested') }, 50);
}
});
</script>
</body>
</html>

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,244 @@
/**
* QUnit v1.12.0 - A JavaScript Unit Testing Framework
*
* https://qunitjs.com
*
* Copyright 2012 jQuery Foundation and other contributors
* Released under the MIT license.
* https://jquery.org/license
*/
/** Font Family and Sizes */
#qunit-tests, #qunit-header, #qunit-banner, #qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult {
font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial, sans-serif;
}
#qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult, #qunit-tests li { font-size: small; }
#qunit-tests { font-size: smaller; }
/** Resets */
#qunit-tests, #qunit-header, #qunit-banner, #qunit-userAgent, #qunit-testresult, #qunit-modulefilter {
margin: 0;
padding: 0;
}
/** Header */
#qunit-header {
padding: 0.5em 0 0.5em 1em;
color: #8699a4;
background-color: #0d3349;
font-size: 1.5em;
line-height: 1em;
font-weight: normal;
border-radius: 5px 5px 0 0;
-moz-border-radius: 5px 5px 0 0;
-webkit-border-top-right-radius: 5px;
-webkit-border-top-left-radius: 5px;
}
#qunit-header a {
text-decoration: none;
color: #c2ccd1;
}
#qunit-header a:hover,
#qunit-header a:focus {
color: #fff;
}
#qunit-testrunner-toolbar label {
display: inline-block;
padding: 0 .5em 0 .1em;
}
#qunit-banner {
height: 5px;
}
#qunit-testrunner-toolbar {
padding: 0.5em 0 0.5em 2em;
color: #5E740B;
background-color: #eee;
overflow: hidden;
}
#qunit-userAgent {
padding: 0.5em 0 0.5em 2.5em;
background-color: #2b81af;
color: #fff;
text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 1px;
}
#qunit-modulefilter-container {
float: right;
}
/** Tests: Pass/Fail */
#qunit-tests {
list-style-position: inside;
}
#qunit-tests li {
padding: 0.4em 0.5em 0.4em 2.5em;
border-bottom: 1px solid #fff;
list-style-position: inside;
}
#qunit-tests.hidepass li.pass, #qunit-tests.hidepass li.running {
display: none;
}
#qunit-tests li strong {
cursor: pointer;
}
#qunit-tests li a {
padding: 0.5em;
color: #c2ccd1;
text-decoration: none;
}
#qunit-tests li a:hover,
#qunit-tests li a:focus {
color: #000;
}
#qunit-tests li .runtime {
float: right;
font-size: smaller;
}
.qunit-assert-list {
margin-top: 0.5em;
padding: 0.5em;
background-color: #fff;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
}
.qunit-collapsed {
display: none;
}
#qunit-tests table {
border-collapse: collapse;
margin-top: .2em;
}
#qunit-tests th {
text-align: right;
vertical-align: top;
padding: 0 .5em 0 0;
}
#qunit-tests td {
vertical-align: top;
}
#qunit-tests pre {
margin: 0;
white-space: pre-wrap;
word-wrap: break-word;
}
#qunit-tests del {
background-color: #e0f2be;
color: #374e0c;
text-decoration: none;
}
#qunit-tests ins {
background-color: #ffcaca;
color: #500;
text-decoration: none;
}
/*** Test Counts */
#qunit-tests b.counts { color: black; }
#qunit-tests b.passed { color: #5E740B; }
#qunit-tests b.failed { color: #710909; }
#qunit-tests li li {
padding: 5px;
background-color: #fff;
border-bottom: none;
list-style-position: inside;
}
/*** Passing Styles */
#qunit-tests li li.pass {
color: #3c510c;
background-color: #fff;
border-left: 10px solid #C6E746;
}
#qunit-tests .pass { color: #528CE0; background-color: #D2E0E6; }
#qunit-tests .pass .test-name { color: #366097; }
#qunit-tests .pass .test-actual,
#qunit-tests .pass .test-expected { color: #999999; }
#qunit-banner.qunit-pass { background-color: #C6E746; }
/*** Failing Styles */
#qunit-tests li li.fail {
color: #710909;
background-color: #fff;
border-left: 10px solid #EE5757;
white-space: pre;
}
#qunit-tests > li:last-child {
border-radius: 0 0 5px 5px;
-moz-border-radius: 0 0 5px 5px;
-webkit-border-bottom-right-radius: 5px;
-webkit-border-bottom-left-radius: 5px;
}
#qunit-tests .fail { color: #000000; background-color: #EE5757; }
#qunit-tests .fail .test-name,
#qunit-tests .fail .module-name { color: #000000; }
#qunit-tests .fail .test-actual { color: #EE5757; }
#qunit-tests .fail .test-expected { color: green; }
#qunit-banner.qunit-fail { background-color: #EE5757; }
/** Result */
#qunit-testresult {
padding: 0.5em 0.5em 0.5em 2.5em;
color: #2b81af;
background-color: #D2E0E6;
border-bottom: 1px solid white;
}
#qunit-testresult .module-name {
font-weight: bold;
}
/** Fixture */
#qunit-fixture {
position: absolute;
top: -10000px;
left: -10000px;
width: 1000px;
height: 1000px;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,9 @@
function sendMessage(msg) {
'use strict';
//var msgId = '[iFrameSizerTest]:';
//document.getElementsByTagName('iframe')[0].contentWindow.postMessage( msgId + msg, '*' );
//console.log('Sending '+msg);
document.getElementsByTagName('iframe')[0].iFrameResizer.sendMessage(msg);
}