j1-template 2024.0.0 → 2024.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/apps/public/cc/cc.yml +35 -33
- data/assets/data/cookieconsent.html +15 -106
- data/assets/data/docsearch.html +155 -0
- data/assets/data/iframes.html +96 -0
- data/assets/data/quicklinks.html +10 -0
- data/assets/data/speak2me.html +4 -3
- data/assets/data/translator.html +27 -147
- data/assets/themes/j1/adapter/js/{chat.js → chatbot.js} +20 -18
- data/assets/themes/j1/adapter/js/clipboard.js +1 -1
- data/assets/themes/j1/adapter/js/docsearch.js +270 -0
- data/assets/themes/j1/adapter/js/gallery.js +1 -1
- data/assets/themes/j1/adapter/js/iframer.js +350 -0
- data/assets/themes/j1/adapter/js/j1.js +16 -21
- data/assets/themes/j1/adapter/js/mmenu.js +1 -1
- data/assets/themes/j1/adapter/js/navigator.js +4 -0
- data/assets/themes/j1/adapter/js/rouge.js +1 -1
- data/assets/themes/j1/adapter/js/speak2me.js +2 -2
- data/assets/themes/j1/adapter/js/translator.js +5 -0
- data/assets/themes/j1/core/css/animate.css +4 -4
- data/assets/themes/j1/core/css/animate.min.css +1 -1
- data/assets/themes/j1/core/js/template.js +19 -7
- data/assets/themes/j1/core/js/template.min.js +1 -1
- data/assets/themes/j1/core/js/template.min.js.map +1 -1
- data/assets/themes/j1/modules/{chatgpt → chatbot}/css/theme/uno.css +10 -0
- data/assets/themes/j1/modules/chatbot/css/theme/uno.min.css +16 -0
- data/assets/themes/j1/modules/iframeResizer/LICENSE +1 -1
- data/assets/themes/j1/modules/iframeResizer/README.md +105 -0
- data/assets/themes/j1/modules/iframeResizer/{examples → example}/frame.absolute.html +12 -11
- data/assets/themes/j1/modules/iframeResizer/{examples → example}/frame.content.html +22 -28
- data/assets/themes/j1/modules/iframeResizer/{examples → example}/frame.hover.html +9 -8
- data/assets/themes/j1/modules/iframeResizer/{examples → example}/frame.nested.html +12 -12
- data/assets/themes/j1/modules/iframeResizer/{examples → example}/frame.textarea.html +6 -8
- data/assets/themes/j1/modules/iframeResizer/{examples → example}/frame.tolerance.html +11 -11
- data/assets/themes/j1/modules/iframeResizer/{examples → example}/index.html +43 -19
- data/assets/themes/j1/modules/iframeResizer/{examples → example}/two.html +8 -11
- data/assets/themes/j1/modules/iframeResizer/js/client/iframeResizer.contentWindow.js +84 -68
- data/assets/themes/j1/modules/iframeResizer/js/client/iframeResizer.contentWindow.min.js +10 -8
- data/assets/themes/j1/modules/iframeResizer/js/resizer.js +149 -72
- data/assets/themes/j1/modules/iframeResizer/js/resizer.min.js +11 -7
- data/lib/j1/version.rb +1 -1
- data/lib/starter_web/README.md +5 -5
- data/lib/starter_web/_config.yml +1 -1
- data/lib/starter_web/_data/modules/{chat.yml → chatbots.yml} +2 -2
- data/lib/starter_web/_data/modules/defaults/{chat.yml → chatbots.yml} +2 -2
- data/lib/starter_web/_data/modules/defaults/cookieconsent.yml +3 -75
- data/lib/starter_web/_data/modules/defaults/docsearch.yml +87 -0
- data/lib/starter_web/_data/modules/defaults/{framer.yml → iframer.yml} +56 -21
- data/lib/starter_web/_data/modules/defaults/navigator.yml +4 -0
- data/lib/starter_web/_data/modules/defaults/translator.yml +11 -52
- data/lib/starter_web/_data/modules/{framer.yml → docsearch.yml} +20 -9
- data/lib/starter_web/_data/modules/iframer.yml +103 -0
- data/lib/starter_web/_data/modules/navigator_menu.yml +39 -1
- data/lib/starter_web/_data/resources.yml +41 -19
- data/lib/starter_web/_data/templates/feed.xml +1 -1
- data/lib/starter_web/_plugins/asciidoctor/iframe-block.rb +46 -0
- data/lib/starter_web/_plugins/index/lunr.rb +3 -2
- data/lib/starter_web/package.json +74 -75
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/000_intro.adoc +1 -1
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/100_converter.adoc +1 -1
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/200_themes.adoc +1 -1
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/documents/100_converter/111_about_the_converter.asciidoc +1 -2
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/documents/100_converter/112_getting_started.asciidoc +1 -0
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/documents/200_themes/211_language_overview.asciidoc +0 -1
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/documents/200_themes/212_values.asciidoc +1 -2
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/documents/200_themes/213_fonts.asciidoc +4 -1
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/a2p.bat +2 -2
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/a2p.sh +2 -3
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/documentation.a2p +5 -9
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/documentation.adoc +1 -1
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/documentation.pdf +27727 -0
- data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/multi.adoc +1 -1
- data/lib/starter_web/pages/public/asciidoc_skeletons/simple-document/simple.adoc +1 -1
- data/lib/starter_web/pages/public/features/general.adoc +1 -1
- data/lib/starter_web/pages/public/features/template.adoc +1 -1
- data/lib/starter_web/pages/public/learn/roundtrip/asciidoc_extensions.adoc +1 -1
- data/lib/starter_web/pages/public/learn/roundtrip/bootstrap_themes.adoc +1 -1
- data/lib/starter_web/pages/public/learn/roundtrip/highlghter_rouge.adoc +1 -1
- data/lib/starter_web/pages/public/learn/roundtrip/lunr_search.adoc +1 -1
- data/lib/starter_web/pages/public/learn/roundtrip/modal_extentions.adoc +1 -1
- data/lib/starter_web/pages/public/learn/roundtrip/present_images.adoc +1 -1
- data/lib/starter_web/pages/public/learn/roundtrip/present_videos.adoc +1 -1
- data/lib/starter_web/pages/public/learn/roundtrip/responsive_tables.adoc +1 -1
- data/lib/starter_web/pages/public/learn/roundtrip/typography.adoc +1 -1
- data/lib/starter_web/pages/public/legal/en/100_copyright.adoc +1 -1
- data/lib/starter_web/pages/public/legal/en/300_privacy.adoc +1 -1
- data/lib/starter_web/pages/public/legal/en/400_comment_policy.adoc +1 -1
- data/lib/starter_web/pages/public/panels/intro_panel/panel.adoc +1 -1
- data/lib/starter_web/pages/public/plans/plans.adoc +1 -1
- data/lib/starter_web/pages/public/tools/previewer/_includes/documents/frame.hover.html +69 -0
- data/lib/starter_web/pages/public/tools/previewer/_includes/documents/frame.nested.html +75 -0
- data/lib/starter_web/pages/public/tools/previewer/_includes/documents/frame.textarea.html +57 -0
- data/lib/starter_web/pages/public/tools/previewer/_includes/documents/my.content.html +112 -0
- data/lib/starter_web/pages/public/tools/previewer/iframer_documents/iframe.content.html +51 -0
- data/lib/starter_web/pages/public/tools/previewer/iframer_documents/iframe.docsearch.info.html +84 -0
- data/lib/starter_web/pages/public/tools/previewer/preview_bootstrap_theme.adoc +1 -1
- data/lib/starter_web/pages/public/tools/previewer/preview_docsearch.adoc +92 -0
- data/lib/starter_web/pages/public/tools/previewer/preview_iframer.adoc +106 -0
- metadata +34 -25
- data/assets/themes/j1/adapter/js/framer.js +0 -237
- data/assets/themes/j1/modules/chat/css/theme/uno.css +0 -92
- data/assets/themes/j1/modules/chat/css/theme/uno.min.css +0 -16
- data/assets/themes/j1/modules/chatgpt/css/theme/uno.min.css +0 -16
- data/lib/starter_web/_data/_defaults/private.yml +0 -129
- data/lib/starter_web/_data/modules/nbinteract.yml +0 -476
- data/lib/starter_web/utilsrv/_defaults/package.json +0 -57
- data/lib/starter_web/utilsrv/package.json +0 -57
- data/lib/starter_web/utilsrv/server.js +0 -775
@@ -1,12 +1,13 @@
|
|
1
1
|
/*
|
2
2
|
* File: iframeResizer.js
|
3
|
+
* v4.3.7
|
3
4
|
* Desc: Force iframes to size to content.
|
4
5
|
* Requires: iframeResizer.contentWindow.js to be loaded into the target frame.
|
5
6
|
* Doc: https://github.com/davidjbradshaw/iframe-resizer
|
6
7
|
* Author: David J. Bradshaw - dave@bradshaw.net
|
7
8
|
* Contributor: Jure Mav - jure.mav@gmail.com
|
8
9
|
* Contributor: Reed Dadoune - reed@dadoune.com
|
9
|
-
|
10
|
+
*/
|
10
11
|
|
11
12
|
// eslint-disable-next-line sonarjs/cognitive-complexity, no-shadow-restricted-names
|
12
13
|
;(function (undefined) {
|
@@ -21,15 +22,15 @@
|
|
21
22
|
msgIdLen = msgId.length,
|
22
23
|
pagePosition = null,
|
23
24
|
requestAnimationFrame = window.requestAnimationFrame,
|
24
|
-
resetRequiredMethods = {
|
25
|
+
resetRequiredMethods = Object.freeze({
|
25
26
|
max: 1,
|
26
27
|
scroll: 1,
|
27
28
|
bodyScroll: 1,
|
28
29
|
documentElementScroll: 1
|
29
|
-
},
|
30
|
+
}),
|
30
31
|
settings = {},
|
31
32
|
timer = null,
|
32
|
-
defaults = {
|
33
|
+
defaults = Object.freeze({
|
33
34
|
autoResize: true,
|
34
35
|
bodyBackground: null,
|
35
36
|
bodyMargin: null,
|
@@ -46,6 +47,7 @@
|
|
46
47
|
maxWidth: Infinity,
|
47
48
|
minHeight: 0,
|
48
49
|
minWidth: 0,
|
50
|
+
mouseEvents: true,
|
49
51
|
resizeFrom: 'parent',
|
50
52
|
scrolling: false,
|
51
53
|
sizeHeight: true,
|
@@ -61,11 +63,13 @@
|
|
61
63
|
onMessage: function () {
|
62
64
|
warn('onMessage function not defined')
|
63
65
|
},
|
66
|
+
onMouseEnter: function () {},
|
67
|
+
onMouseLeave: function () {},
|
64
68
|
onResized: function () {},
|
65
69
|
onScroll: function () {
|
66
70
|
return true
|
67
71
|
}
|
68
|
-
}
|
72
|
+
})
|
69
73
|
|
70
74
|
function getMutationObserver() {
|
71
75
|
return (
|
@@ -92,13 +96,13 @@
|
|
92
96
|
requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame']
|
93
97
|
}
|
94
98
|
|
95
|
-
if (
|
96
|
-
log('setup', 'RequestAnimationFrame not supported')
|
97
|
-
} else {
|
99
|
+
if (requestAnimationFrame) {
|
98
100
|
// Firefox extension content-scripts have a globalThis object that is not the same as window.
|
99
101
|
// Binding `requestAnimationFrame` to window allows the function to work and prevents errors
|
100
102
|
// being thrown when run in that context, and should be a no-op in every other context.
|
101
103
|
requestAnimationFrame = requestAnimationFrame.bind(window)
|
104
|
+
} else {
|
105
|
+
log('setup', 'RequestAnimationFrame not supported')
|
102
106
|
}
|
103
107
|
}
|
104
108
|
|
@@ -106,11 +110,10 @@
|
|
106
110
|
var retStr = 'Host page: ' + iframeId
|
107
111
|
|
108
112
|
if (window.top !== window.self) {
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
}
|
113
|
+
retStr =
|
114
|
+
window.parentIFrame && window.parentIFrame.getId
|
115
|
+
? window.parentIFrame.getId() + ': ' + iframeId
|
116
|
+
: 'Nested host page: ' + iframeId
|
114
117
|
}
|
115
118
|
|
116
119
|
return retStr
|
@@ -158,7 +161,7 @@
|
|
158
161
|
}
|
159
162
|
|
160
163
|
function processMsg() {
|
161
|
-
var data = msg.
|
164
|
+
var data = msg.slice(msgIdLen).split(':')
|
162
165
|
var height = data[1] ? parseInt(data[1], 10) : 0
|
163
166
|
var iframe = settings[data[0]] && settings[data[0]].iframe
|
164
167
|
var compStyle = getComputedStyle(iframe)
|
@@ -267,14 +270,14 @@
|
|
267
270
|
|
268
271
|
function isMessageForUs() {
|
269
272
|
return (
|
270
|
-
msgId === ('' + msg).
|
271
|
-
msg.
|
273
|
+
msgId === ('' + msg).slice(0, msgIdLen) &&
|
274
|
+
msg.slice(msgIdLen).split(':')[0] in settings
|
272
275
|
) // ''+Protects against non-string msg
|
273
276
|
}
|
274
277
|
|
275
278
|
function isMessageFromMetaParent() {
|
276
279
|
// Test if this message is from a parent above us. This is an ugly test, however, updating
|
277
|
-
// the message format would break backwards
|
280
|
+
// the message format would break backwards compatibility.
|
278
281
|
var retCode = messageData.type in { true: 1, false: 1, undefined: 1 }
|
279
282
|
|
280
283
|
if (retCode) {
|
@@ -285,7 +288,7 @@
|
|
285
288
|
}
|
286
289
|
|
287
290
|
function getMsgBody(offset) {
|
288
|
-
return msg.
|
291
|
+
return msg.slice(msg.indexOf(':') + msgHeaderLen + offset)
|
289
292
|
}
|
290
293
|
|
291
294
|
function forwardMsgFromIFrame(msgBody) {
|
@@ -297,10 +300,12 @@
|
|
297
300
|
msgBody +
|
298
301
|
'}'
|
299
302
|
)
|
303
|
+
|
300
304
|
on('onMessage', {
|
301
305
|
iframe: messageData.iframe,
|
302
306
|
message: JSON.parse(msgBody)
|
303
307
|
})
|
308
|
+
|
304
309
|
log(iframeId, '--')
|
305
310
|
}
|
306
311
|
|
@@ -441,18 +446,18 @@
|
|
441
446
|
')'
|
442
447
|
)
|
443
448
|
|
444
|
-
if (window.top
|
445
|
-
scrollParent()
|
446
|
-
} else {
|
449
|
+
if (window.top === window.self) {
|
447
450
|
reposition()
|
451
|
+
} else {
|
452
|
+
scrollParent()
|
448
453
|
}
|
449
454
|
}
|
450
455
|
|
451
456
|
function scrollTo() {
|
452
|
-
if (false
|
453
|
-
setPagePosition(iframeId)
|
454
|
-
} else {
|
457
|
+
if (false === on('onScroll', pagePosition)) {
|
455
458
|
unsetPagePosition()
|
459
|
+
} else {
|
460
|
+
setPagePosition(iframeId)
|
456
461
|
}
|
457
462
|
}
|
458
463
|
|
@@ -499,11 +504,35 @@
|
|
499
504
|
|
500
505
|
if (target) {
|
501
506
|
jumpToTarget()
|
502
|
-
} else if (window.top
|
507
|
+
} else if (window.top === window.self) {
|
508
|
+
log(iframeId, 'In page link #' + hash + ' not found')
|
509
|
+
} else {
|
503
510
|
jumpToParent()
|
511
|
+
}
|
512
|
+
}
|
513
|
+
|
514
|
+
function onMouse(event) {
|
515
|
+
var mousePos = {}
|
516
|
+
|
517
|
+
if (Number(messageData.width) === 0 && Number(messageData.height) === 0) {
|
518
|
+
var data = getMsgBody(9).split(':')
|
519
|
+
mousePos = {
|
520
|
+
x: data[1],
|
521
|
+
y: data[0]
|
522
|
+
}
|
504
523
|
} else {
|
505
|
-
|
524
|
+
mousePos = {
|
525
|
+
x: messageData.width,
|
526
|
+
y: messageData.height
|
527
|
+
}
|
506
528
|
}
|
529
|
+
|
530
|
+
on(event, {
|
531
|
+
iframe: messageData.iframe,
|
532
|
+
screenX: Number(mousePos.x),
|
533
|
+
screenY: Number(mousePos.y),
|
534
|
+
type: messageData.type
|
535
|
+
})
|
507
536
|
}
|
508
537
|
|
509
538
|
function on(funcName, val) {
|
@@ -514,53 +543,86 @@
|
|
514
543
|
if (settings[iframeId] && settings[iframeId].firstRun) firstRun()
|
515
544
|
|
516
545
|
switch (messageData.type) {
|
517
|
-
case 'close':
|
546
|
+
case 'close': {
|
518
547
|
closeIFrame(messageData.iframe)
|
519
548
|
break
|
549
|
+
}
|
520
550
|
|
521
|
-
case 'message':
|
551
|
+
case 'message': {
|
522
552
|
forwardMsgFromIFrame(getMsgBody(6))
|
523
553
|
break
|
554
|
+
}
|
555
|
+
|
556
|
+
case 'mouseenter': {
|
557
|
+
onMouse('onMouseEnter')
|
558
|
+
break
|
559
|
+
}
|
560
|
+
|
561
|
+
case 'mouseleave': {
|
562
|
+
onMouse('onMouseLeave')
|
563
|
+
break
|
564
|
+
}
|
524
565
|
|
525
|
-
case 'autoResize':
|
566
|
+
case 'autoResize': {
|
526
567
|
settings[iframeId].autoResize = JSON.parse(getMsgBody(9))
|
527
568
|
break
|
569
|
+
}
|
528
570
|
|
529
|
-
case 'scrollTo':
|
571
|
+
case 'scrollTo': {
|
530
572
|
scrollRequestFromChild(false)
|
531
573
|
break
|
574
|
+
}
|
532
575
|
|
533
|
-
case 'scrollToOffset':
|
576
|
+
case 'scrollToOffset': {
|
534
577
|
scrollRequestFromChild(true)
|
535
578
|
break
|
579
|
+
}
|
536
580
|
|
537
|
-
case 'pageInfo':
|
581
|
+
case 'pageInfo': {
|
538
582
|
sendPageInfoToIframe(
|
539
583
|
settings[iframeId] && settings[iframeId].iframe,
|
540
584
|
iframeId
|
541
585
|
)
|
542
586
|
startPageInfoMonitor()
|
543
587
|
break
|
588
|
+
}
|
544
589
|
|
545
|
-
case 'pageInfoStop':
|
590
|
+
case 'pageInfoStop': {
|
546
591
|
stopPageInfoMonitor()
|
547
592
|
break
|
593
|
+
}
|
548
594
|
|
549
|
-
case 'inPageLink':
|
595
|
+
case 'inPageLink': {
|
550
596
|
findTarget(getMsgBody(9))
|
551
597
|
break
|
598
|
+
}
|
552
599
|
|
553
|
-
case 'reset':
|
600
|
+
case 'reset': {
|
554
601
|
resetIFrame(messageData)
|
555
602
|
break
|
603
|
+
}
|
556
604
|
|
557
|
-
case 'init':
|
605
|
+
case 'init': {
|
558
606
|
resizeIFrame()
|
559
607
|
on('onInit', messageData.iframe)
|
560
608
|
break
|
609
|
+
}
|
561
610
|
|
562
|
-
default:
|
563
|
-
|
611
|
+
default: {
|
612
|
+
if (
|
613
|
+
Number(messageData.width) === 0 &&
|
614
|
+
Number(messageData.height) === 0
|
615
|
+
) {
|
616
|
+
warn(
|
617
|
+
'Unsupported message received (' +
|
618
|
+
messageData.type +
|
619
|
+
'), this is likely due to the iframe containing a later ' +
|
620
|
+
'version of iframe-resizer than the parent page'
|
621
|
+
)
|
622
|
+
} else {
|
623
|
+
resizeIFrame()
|
624
|
+
}
|
625
|
+
}
|
564
626
|
}
|
565
627
|
}
|
566
628
|
|
@@ -674,13 +736,13 @@
|
|
674
736
|
if (null === pagePosition) {
|
675
737
|
pagePosition = {
|
676
738
|
x:
|
677
|
-
window.pageXOffset
|
678
|
-
?
|
679
|
-
:
|
739
|
+
window.pageXOffset === undefined
|
740
|
+
? document.documentElement.scrollLeft
|
741
|
+
: window.pageXOffset,
|
680
742
|
y:
|
681
|
-
window.pageYOffset
|
682
|
-
?
|
683
|
-
:
|
743
|
+
window.pageYOffset === undefined
|
744
|
+
? document.documentElement.scrollTop
|
745
|
+
: window.pageYOffset
|
684
746
|
}
|
685
747
|
log(
|
686
748
|
iframeId,
|
@@ -882,22 +944,25 @@
|
|
882
944
|
':' +
|
883
945
|
settings[iframeId].resizeFrom +
|
884
946
|
':' +
|
885
|
-
settings[iframeId].widthCalculationMethod
|
947
|
+
settings[iframeId].widthCalculationMethod +
|
948
|
+
':' +
|
949
|
+
settings[iframeId].mouseEvents
|
886
950
|
)
|
887
951
|
}
|
888
952
|
|
953
|
+
function isNumber(value) {
|
954
|
+
return typeof value === 'number'
|
955
|
+
}
|
956
|
+
|
889
957
|
function setupIFrame(iframe, options) {
|
890
958
|
function setLimits() {
|
891
959
|
function addStyle(style) {
|
892
|
-
|
893
|
-
|
894
|
-
|
895
|
-
|
896
|
-
|
897
|
-
log(
|
898
|
-
iframeId,
|
899
|
-
'Set ' + style + ' = ' + settings[iframeId][style] + 'px'
|
900
|
-
)
|
960
|
+
var styleValue = settings[iframeId][style]
|
961
|
+
if (Infinity !== styleValue && 0 !== styleValue) {
|
962
|
+
iframe.style[style] = isNumber(styleValue)
|
963
|
+
? styleValue + 'px'
|
964
|
+
: styleValue
|
965
|
+
log(iframeId, 'Set ' + style + ' = ' + iframe.style[style])
|
901
966
|
}
|
902
967
|
}
|
903
968
|
|
@@ -933,6 +998,10 @@
|
|
933
998
|
}
|
934
999
|
|
935
1000
|
function ensureHasId(iframeId) {
|
1001
|
+
if (typeof iframeId !== 'string') {
|
1002
|
+
throw new TypeError('Invaild id for iFrame. Expected String')
|
1003
|
+
}
|
1004
|
+
|
936
1005
|
if ('' === iframeId) {
|
937
1006
|
// eslint-disable-next-line no-multi-assign
|
938
1007
|
iframe.id = iframeId = newId()
|
@@ -961,21 +1030,25 @@
|
|
961
1030
|
? 'hidden'
|
962
1031
|
: 'auto'
|
963
1032
|
switch (settings[iframeId] && settings[iframeId].scrolling) {
|
964
|
-
case 'omit':
|
1033
|
+
case 'omit': {
|
965
1034
|
break
|
1035
|
+
}
|
966
1036
|
|
967
|
-
case true:
|
1037
|
+
case true: {
|
968
1038
|
iframe.scrolling = 'yes'
|
969
1039
|
break
|
1040
|
+
}
|
970
1041
|
|
971
|
-
case false:
|
1042
|
+
case false: {
|
972
1043
|
iframe.scrolling = 'no'
|
973
1044
|
break
|
1045
|
+
}
|
974
1046
|
|
975
|
-
default:
|
1047
|
+
default: {
|
976
1048
|
iframe.scrolling = settings[iframeId]
|
977
1049
|
? settings[iframeId].scrolling
|
978
1050
|
: 'no'
|
1051
|
+
}
|
979
1052
|
}
|
980
1053
|
}
|
981
1054
|
|
@@ -1133,11 +1206,12 @@
|
|
1133
1206
|
|
1134
1207
|
function processOptions(options) {
|
1135
1208
|
options = options || {}
|
1136
|
-
|
1137
|
-
|
1138
|
-
|
1139
|
-
|
1140
|
-
|
1209
|
+
|
1210
|
+
settings[iframeId] = Object.create(null) // Protect against prototype attacks
|
1211
|
+
settings[iframeId].iframe = iframe
|
1212
|
+
settings[iframeId].firstRun = true
|
1213
|
+
settings[iframeId].remoteHost =
|
1214
|
+
iframe.src && iframe.src.split('/').slice(0, 3).join('/')
|
1141
1215
|
|
1142
1216
|
checkOptions(options)
|
1143
1217
|
Object.keys(options).forEach(depricate, options)
|
@@ -1157,15 +1231,15 @@
|
|
1157
1231
|
|
1158
1232
|
var iframeId = ensureHasId(iframe.id)
|
1159
1233
|
|
1160
|
-
if (
|
1234
|
+
if (beenHere()) {
|
1235
|
+
warn(iframeId, 'Ignored iFrame, already setup.')
|
1236
|
+
} else {
|
1161
1237
|
processOptions(options)
|
1162
1238
|
setScrolling()
|
1163
1239
|
setLimits()
|
1164
1240
|
setupBodyMarginValues()
|
1165
1241
|
init(createOutgoingMsg(iframeId))
|
1166
1242
|
setupIFrameObject()
|
1167
|
-
} else {
|
1168
|
-
warn(iframeId, 'Ignored iFrame, already setup.')
|
1169
1243
|
}
|
1170
1244
|
}
|
1171
1245
|
|
@@ -1266,11 +1340,11 @@
|
|
1266
1340
|
/* istanbul ignore next */
|
1267
1341
|
function tabVisible() {
|
1268
1342
|
function resize() {
|
1269
|
-
sendTriggerMsg('Tab
|
1343
|
+
sendTriggerMsg('Tab Visible', 'resize')
|
1270
1344
|
}
|
1271
1345
|
|
1272
1346
|
if ('hidden' !== document.visibilityState) {
|
1273
|
-
log('document', 'Trigger event:
|
1347
|
+
log('document', 'Trigger event: Visibility change')
|
1274
1348
|
debouce(resize, 16)
|
1275
1349
|
}
|
1276
1350
|
}
|
@@ -1343,19 +1417,22 @@
|
|
1343
1417
|
|
1344
1418
|
switch (typeof target) {
|
1345
1419
|
case 'undefined':
|
1346
|
-
case 'string':
|
1420
|
+
case 'string': {
|
1347
1421
|
Array.prototype.forEach.call(
|
1348
1422
|
document.querySelectorAll(target || 'iframe'),
|
1349
1423
|
init.bind(undefined, options)
|
1350
1424
|
)
|
1351
1425
|
break
|
1426
|
+
}
|
1352
1427
|
|
1353
|
-
case 'object':
|
1428
|
+
case 'object': {
|
1354
1429
|
init(options, target)
|
1355
1430
|
break
|
1431
|
+
}
|
1356
1432
|
|
1357
|
-
default:
|
1433
|
+
default: {
|
1358
1434
|
throw new TypeError('Unexpected data type (' + typeof target + ')')
|
1435
|
+
}
|
1359
1436
|
}
|
1360
1437
|
|
1361
1438
|
return iFrames
|
@@ -1376,7 +1453,7 @@
|
|
1376
1453
|
}
|
1377
1454
|
}
|
1378
1455
|
|
1379
|
-
if (window.jQuery) {
|
1456
|
+
if (window.jQuery !== undefined) {
|
1380
1457
|
createJQueryPublicMethod(window.jQuery)
|
1381
1458
|
}
|
1382
1459
|
|
@@ -1,8 +1,12 @@
|
|
1
|
-
|
2
|
-
*
|
3
|
-
*
|
4
|
-
*
|
5
|
-
*
|
6
|
-
|
1
|
+
/*
|
2
|
+
* File: iframeResizer.min.js
|
3
|
+
* v4.3.7
|
4
|
+
* Desc: Force iframes to size to content.
|
5
|
+
* Requires: iframeResizer.contentWindow.js to be loaded into the target frame.
|
6
|
+
* Doc: https://github.com/davidjbradshaw/iframe-resizer
|
7
|
+
* Author: David J. Bradshaw - dave@bradshaw.net
|
8
|
+
* Contributor: Jure Mav - jure.mav@gmail.com
|
9
|
+
* Contributor: Reed Dadoune - reed@dadoune.com
|
10
|
+
*/
|
7
11
|
|
8
|
-
!function(l){if("undefined"!=typeof window){var e,m=0,g=!1,o=!1,v="message".length,I="[iFrameSizer]",x=I.length,F=null,r=window.requestAnimationFrame,h={max:1,scroll:1,bodyScroll:1,documentElementScroll:1},M={},i=null,w={autoResize:!0,bodyBackground:null,bodyMargin:null,bodyMarginV1:8,bodyPadding:null,checkOrigin:!0,inPageLinks:!1,enablePublicMethods:!0,heightCalculationMethod:"bodyOffset",id:"iFrameResizer",interval:32,log:!1,maxHeight:1/0,maxWidth:1/0,minHeight:0,minWidth:0,resizeFrom:"parent",scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,widthCalculationMethod:"scroll",onClose:function(){return!0},onClosed:function(){},onInit:function(){},onMessage:function(){E("onMessage function not defined")},onResized:function(){},onScroll:function(){return!0}},k={};window.jQuery&&((e=window.jQuery).fn?e.fn.iFrameResize||(e.fn.iFrameResize=function(i){return this.filter("iframe").each(function(e,n){d(n,i)}).end()}):T("","Unable to bind to jQuery, it is not fully loaded.")),"function"==typeof define&&define.amd?define([],q):"object"==typeof module&&"object"==typeof module.exports&&(module.exports=q()),window.iFrameResize=window.iFrameResize||q()}function p(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function z(e,n,i){e.addEventListener(n,i,!1)}function O(e,n,i){e.removeEventListener(n,i,!1)}function a(e){return I+"["+function(e){var n="Host page: "+e;return window.top!==window.self&&(n=window.parentIFrame&&window.parentIFrame.getId?window.parentIFrame.getId()+": "+e:"Nested host page: "+e),n}(e)+"]"}function t(e){return M[e]?M[e].log:g}function R(e,n){s("log",e,n,t(e))}function T(e,n){s("info",e,n,t(e))}function E(e,n){s("warn",e,n,!0)}function s(e,n,i,t){!0===t&&"object"==typeof window.console&&console[e](a(n),i)}function n(n){function e(){i("Height"),i("Width"),A(function(){P(b),S(y),d("onResized",b)},b,"init")}function i(e){var n=Number(M[y]["max"+e]),i=Number(M[y]["min"+e]),t=e.toLowerCase(),o=Number(b[t]);R(y,"Checking "+t+" is in range "+i+"-"+n),o<i&&(o=i,R(y,"Set "+t+" to min value")),n<o&&(o=n,R(y,"Set "+t+" to max value")),b[t]=""+o}function t(e){return p.substr(p.indexOf(":")+v+e)}function a(e,n){!function(e,n,i){k[i]||(k[i]=setTimeout(function(){k[i]=null,e()},n))}(function(){B("Send Page Info","pageInfo:"+function(){var e=document.body.getBoundingClientRect(),n=b.iframe.getBoundingClientRect();return JSON.stringify({iframeHeight:n.height,iframeWidth:n.width,clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),offsetTop:parseInt(n.top-e.top,10),offsetLeft:parseInt(n.left-e.left,10),scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,documentHeight:document.documentElement.clientHeight,documentWidth:document.documentElement.clientWidth,windowHeight:window.innerHeight,windowWidth:window.innerWidth})}(),e,n)},32,n)}function r(e){var n=e.getBoundingClientRect();return N(y),{x:Math.floor(Number(n.left)+Number(F.x)),y:Math.floor(Number(n.top)+Number(F.y))}}function o(e){var n=e?r(b.iframe):{x:0,y:0},i={x:Number(b.width)+n.x,y:Number(b.height)+n.y};R(y,"Reposition requested from iFrame (offset x:"+n.x+" y:"+n.y+")"),window.top!==window.self?window.parentIFrame?window.parentIFrame["scrollTo"+(e?"Offset":"")](i.x,i.y):E(y,"Unable to scroll to requested position, window.parentIFrame not found"):(F=i,s(),R(y,"--"))}function s(){!1!==d("onScroll",F)?S(y):H()}function d(e,n){return W(y,e,n)}var c,u,f,l,m,g,h,w,p=n.data,b={},y=null;"[iFrameResizerChild]Ready"===p?function(){for(var e in M)B("iFrame requested init",L(e),M[e].iframe,e)}():I===(""+p).substr(0,x)&&p.substr(x).split(":")[0]in M?(m=p.substr(x).split(":"),g=m[1]?parseInt(m[1],10):0,h=M[m[0]]&&M[m[0]].iframe,w=getComputedStyle(h),b={iframe:h,id:m[0],height:g+function(e){if("border-box"!==e.boxSizing)return 0;var n=e.paddingTop?parseInt(e.paddingTop,10):0,i=e.paddingBottom?parseInt(e.paddingBottom,10):0;return n+i}(w)+function(e){if("border-box"!==e.boxSizing)return 0;var n=e.borderTopWidth?parseInt(e.borderTopWidth,10):0,i=e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0;return n+i}(w),width:m[2],type:m[3]},y=b.id,M[y]&&(M[y].loaded=!0),(l=b.type in{true:1,false:1,undefined:1})&&R(y,"Ignoring init message from meta parent page"),!l&&(f=!0,M[u=y]||(f=!1,E(b.type+" No settings for "+u+". Message was: "+p)),f)&&(R(y,"Received: "+p),c=!0,null===b.iframe&&(E(y,"IFrame ("+b.id+") not found"),c=!1),c&&function(){var e,i=n.origin,t=M[y]&&M[y].checkOrigin;if(t&&""+i!="null"&&!(t.constructor===Array?function(){var e=0,n=!1;for(R(y,"Checking connection is from allowed list of origins: "+t);e<t.length;e++)if(t[e]===i){n=!0;break}return n}():(e=M[y]&&M[y].remoteHost,R(y,"Checking connection is from: "+e),i===e)))throw new Error("Unexpected message received from: "+i+" for "+b.iframe.id+". Message was: "+n.data+". This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.");return!0}()&&function(){switch(M[y]&&M[y].firstRun&&M[y]&&(M[y].firstRun=!1),b.type){case"close":C(b.iframe);break;case"message":!function(e){R(y,"onMessage passed: {iframe: "+b.iframe.id+", message: "+e+"}"),d("onMessage",{iframe:b.iframe,message:JSON.parse(e)}),R(y,"--")}(t(6));break;case"autoResize":M[y].autoResize=JSON.parse(t(9));break;case"scrollTo":o(!1);break;case"scrollToOffset":o(!0);break;case"pageInfo":a(M[y]&&M[y].iframe,y),function(){function e(n,i){function t(){M[r]?a(M[r].iframe,r):o()}["scroll","resize"].forEach(function(e){R(r,n+e+" listener for sendPageInfo"),i(window,e,t)})}function o(){e("Remove ",O)}var r=y;e("Add ",z),M[r]&&(M[r].stopPageInfo=o)}();break;case"pageInfoStop":M[y]&&M[y].stopPageInfo&&(M[y].stopPageInfo(),delete M[y].stopPageInfo);break;case"inPageLink":!function(e){var n,i=e.split("#")[1]||"",t=decodeURIComponent(i),o=document.getElementById(t)||document.getElementsByName(t)[0];o?(n=r(o),R(y,"Moving to in page link (#"+i+") at x: "+n.x+" y: "+n.y),F={x:n.x,y:n.y},s(),R(y,"--")):window.top!==window.self?window.parentIFrame?window.parentIFrame.moveToAnchor(i):R(y,"In page link #"+i+" not found and window.parentIFrame not found"):R(y,"In page link #"+i+" not found")}(t(9));break;case"reset":j(b);break;case"init":e(),d("onInit",b.iframe);break;default:e()}}())):T(y,"Ignored: "+p)}function W(e,n,i){var t=null,o=null;if(M[e]){if("function"!=typeof(t=M[e][n]))throw new TypeError(n+" on iFrame["+e+"] is not a function");o=t(i)}return o}function b(e){var n=e.id;delete M[n]}function C(e){var n=e.id;if(!1!==W(n,"onClose",n)){R(n,"Removing iFrame: "+n);try{e.parentNode&&e.parentNode.removeChild(e)}catch(e){E(e)}W(n,"onClosed",n),R(n,"--"),b(e)}else R(n,"Close iframe cancelled by onClose event")}function N(e){null===F&&R(e,"Get page position: "+(F={x:window.pageXOffset!==l?window.pageXOffset:document.documentElement.scrollLeft,y:window.pageYOffset!==l?window.pageYOffset:document.documentElement.scrollTop}).x+","+F.y)}function S(e){null!==F&&(window.scrollTo(F.x,F.y),R(e,"Set page position: "+F.x+","+F.y),H())}function H(){F=null}function j(e){R(e.id,"Size reset requested by "+("init"===e.type?"host page":"iFrame")),N(e.id),A(function(){P(e),B("reset","reset",e.iframe,e.id)},e,"reset")}function P(n){function i(e){o||"0"!==n[e]||(o=!0,R(t,"Hidden iFrame detected, creating visibility listener"),function(){function n(){Object.keys(M).forEach(function(e){!function(n){function e(e){return"0px"===(M[n]&&M[n].iframe.style[e])}M[n]&&null!==M[n].iframe.offsetParent&&(e("height")||e("width"))&&B("Visibility change","resize",M[n].iframe,n)}(e)})}function i(e){R("window","Mutation observed: "+e[0].target+" "+e[0].type),c(n,16)}var t=p();t&&function(){var e=document.querySelector("body");new t(i).observe(e,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0})}()}())}function e(e){!function(e){n.id?(n.iframe.style[e]=n[e]+"px",R(n.id,"IFrame ("+t+") "+e+" set to "+n[e]+"px")):R("undefined","messageData id not set")}(e),i(e)}var t=n.iframe.id;M[t]&&(M[t].sizeHeight&&e("height"),M[t].sizeWidth&&e("width"))}function A(e,n,i){i!==n.type&&r&&!window.jasmine?(R(n.id,"Requesting animation frame"),r(e)):e()}function B(e,n,i,t,o){var r,a=!1;t=t||i.id,M[t]&&(i&&"contentWindow"in i&&null!==i.contentWindow?(r=M[t]&&M[t].targetOrigin,R(t,"["+e+"] Sending msg to iframe["+t+"] ("+n+") targetOrigin: "+r),i.contentWindow.postMessage(I+n,r)):E(t,"["+e+"] IFrame("+t+") not found"),o&&M[t]&&M[t].warningTimeout&&(M[t].msgTimeout=setTimeout(function(){!M[t]||M[t].loaded||a||(a=!0,E(t,"IFrame has not responded within "+M[t].warningTimeout/1e3+" seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning."))},M[t].warningTimeout)))}function L(e){return e+":"+M[e].bodyMarginV1+":"+M[e].sizeWidth+":"+M[e].log+":"+M[e].interval+":"+M[e].enablePublicMethods+":"+M[e].autoResize+":"+M[e].bodyMargin+":"+M[e].heightCalculationMethod+":"+M[e].bodyBackground+":"+M[e].bodyPadding+":"+M[e].tolerance+":"+M[e].inPageLinks+":"+M[e].resizeFrom+":"+M[e].widthCalculationMethod}function d(i,e){function n(e){var n=e.split("Callback");if(2===n.length){var i="on"+n[0].charAt(0).toUpperCase()+n[0].slice(1);this[i]=this[e],delete this[e],E(c,"Deprecated: '"+e+"' has been renamed '"+i+"'. The old method will be removed in the next major version.")}}var t,o,r,a,s,d,c=(""===(o=i.id)&&(i.id=(t=e&&e.id||w.id+m++,null!==document.getElementById(t)&&(t+=m++),o=t),g=(e||{}).log,R(o,"Added missing iframe ID: "+o+" ("+i.src+")")),o);function u(e){1/0!==M[c][e]&&0!==M[c][e]&&(i.style[e]=M[c][e]+"px",R(c,"Set "+e+" = "+M[c][e]+"px"))}function f(e){if(M[c]["min"+e]>M[c]["max"+e])throw new Error("Value for min"+e+" can not be greater than max"+e)}c in M&&"iFrameResizer"in i?E(c,"Ignored iFrame, already setup."):(d=(d=e)||{},M[c]={firstRun:!0,iframe:i,remoteHost:i.src&&i.src.split("/").slice(0,3).join("/")},function(e){if("object"!=typeof e)throw new TypeError("Options is not an object")}(d),Object.keys(d).forEach(n,d),function(e){for(var n in w)Object.prototype.hasOwnProperty.call(w,n)&&(M[c][n]=Object.prototype.hasOwnProperty.call(e,n)?e[n]:w[n])}(d),M[c]&&(M[c].targetOrigin=!0===M[c].checkOrigin?function(e){return""===e||null!==e.match(/^(about:blank|javascript:|file:\/\/)/)?"*":e}(M[c].remoteHost):"*"),function(){switch(R(c,"IFrame scrolling "+(M[c]&&M[c].scrolling?"enabled":"disabled")+" for "+c),i.style.overflow=!1===(M[c]&&M[c].scrolling)?"hidden":"auto",M[c]&&M[c].scrolling){case"omit":break;case!0:i.scrolling="yes";break;case!1:i.scrolling="no";break;default:i.scrolling=M[c]?M[c].scrolling:"no"}}(),f("Height"),f("Width"),u("maxHeight"),u("minHeight"),u("maxWidth"),u("minWidth"),"number"!=typeof(M[c]&&M[c].bodyMargin)&&"0"!==(M[c]&&M[c].bodyMargin)||(M[c].bodyMarginV1=M[c].bodyMargin,M[c].bodyMargin=M[c].bodyMargin+"px"),r=L(c),(s=p())&&(a=s,i.parentNode&&new a(function(e){e.forEach(function(e){Array.prototype.slice.call(e.removedNodes).forEach(function(e){e===i&&C(i)})})}).observe(i.parentNode,{childList:!0})),z(i,"load",function(){B("iFrame.onload",r,i,l,!0),function(){var e=M[c]&&M[c].firstRun,n=M[c]&&M[c].heightCalculationMethod in h;!e&&n&&j({iframe:i,height:0,width:0,type:"init"})}()}),B("init",r,i,l,!0),M[c]&&(M[c].iframe.iFrameResizer={close:C.bind(null,M[c].iframe),removeListeners:b.bind(null,M[c].iframe),resize:B.bind(null,"Window resize","resize",M[c].iframe),moveToAnchor:function(e){B("Move to anchor","moveToAnchor:"+e,M[c].iframe,c)},sendMessage:function(e){B("Send Message","message:"+(e=JSON.stringify(e)),M[c].iframe,c)}}))}function c(e,n){null===i&&(i=setTimeout(function(){i=null,e()},n))}function u(){"hidden"!==document.visibilityState&&(R("document","Trigger event: Visiblity change"),c(function(){f("Tab Visable","resize")},16))}function f(n,i){Object.keys(M).forEach(function(e){!function(e){return M[e]&&"parent"===M[e].resizeFrom&&M[e].autoResize&&!M[e].firstRun}(e)||B(n,i,M[e].iframe,e)})}function y(){z(window,"message",n),z(window,"resize",function(){!function(e){R("window","Trigger event: "+e),c(function(){f("Window "+e,"resize")},16)}("resize")}),z(document,"visibilitychange",u),z(document,"-webkit-visibilitychange",u)}function q(){function i(e,n){n&&(function(){if(!n.tagName)throw new TypeError("Object is not a valid DOM element");if("IFRAME"!==n.tagName.toUpperCase())throw new TypeError("Expected <IFRAME> tag, found <"+n.tagName+">")}(),d(n,e),t.push(n))}var t;return function(){var e,n=["moz","webkit","o","ms"];for(e=0;e<n.length&&!r;e+=1)r=window[n[e]+"RequestAnimationFrame"];r?r=r.bind(window):R("setup","RequestAnimationFrame not supported")}(),y(),function(e,n){switch(t=[],function(e){e&&e.enablePublicMethods&&E("enablePublicMethods option has been removed, public methods are now always available in the iFrame")}(e),typeof n){case"undefined":case"string":Array.prototype.forEach.call(document.querySelectorAll(n||"iframe"),i.bind(l,e));break;case"object":i(e,n);break;default:throw new TypeError("Unexpected data type ("+typeof n+")")}return t}}}();
|
12
|
+
!function(d){var c,u,a,v,x,I,M,r,f,k,i,l,z;function m(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function F(e,n,i){e.addEventListener(n,i,!1)}function B(e,n,i){e.removeEventListener(n,i,!1)}function p(e){return x+"["+(n="Host page: "+(e=e),n=window.top!==window.self?window.parentIFrame&&window.parentIFrame.getId?window.parentIFrame.getId()+": "+e:"Nested host page: "+e:n)+"]";var n}function t(e){return k[e]?k[e].log:u}function O(e,n){o("log",e,n,t(e))}function E(e,n){o("info",e,n,t(e))}function R(e,n){o("warn",e,n,!0)}function o(e,n,i,t){!0===t&&"object"==typeof window.console&&console[e](p(n),i)}function w(e){function i(){t("Height"),t("Width"),P(function(){H(w),C(b),l("onResized",w)},w,"init")}function n(){var e=p.slice(I).split(":"),n=e[1]?parseInt(e[1],10):0,i=k[e[0]]&&k[e[0]].iframe,t=getComputedStyle(i);return{iframe:i,id:e[0],height:n+function(e){if("border-box"!==e.boxSizing)return 0;var n=e.paddingTop?parseInt(e.paddingTop,10):0,e=e.paddingBottom?parseInt(e.paddingBottom,10):0;return n+e}(t)+function(e){if("border-box"!==e.boxSizing)return 0;var n=e.borderTopWidth?parseInt(e.borderTopWidth,10):0,e=e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0;return n+e}(t),width:e[2],type:e[3]}}function t(e){var n=Number(k[b]["max"+e]),i=Number(k[b]["min"+e]),e=e.toLowerCase(),t=Number(w[e]);O(b,"Checking "+e+" is in range "+i+"-"+n),t<i&&(t=i,O(b,"Set "+e+" to min value")),n<t&&(t=n,O(b,"Set "+e+" to max value")),w[e]=""+t}function o(){var t=e.origin,o=k[b]&&k[b].checkOrigin;if(o&&""+t!="null"&&!function(){if(o.constructor!==Array)return e=k[b]&&k[b].remoteHost,O(b,"Checking connection is from: "+e),t===e;var e,n=0,i=!1;for(O(b,"Checking connection is from allowed list of origins: "+o);n<o.length;n++)if(o[n]===t){i=!0;break}return i}())throw new Error("Unexpected message received from: "+t+" for "+w.iframe.id+". Message was: "+e.data+". This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.");return 1}function a(e){return p.slice(p.indexOf(":")+v+e)}function s(i,t){var e,n,o;e=function(){var e,n;A("Send Page Info","pageInfo:"+(e=document.body.getBoundingClientRect(),n=w.iframe.getBoundingClientRect(),JSON.stringify({iframeHeight:n.height,iframeWidth:n.width,clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),offsetTop:parseInt(n.top-e.top,10),offsetLeft:parseInt(n.left-e.left,10),scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,documentHeight:document.documentElement.clientHeight,documentWidth:document.documentElement.clientWidth,windowHeight:window.innerHeight,windowWidth:window.innerWidth})),i,t)},n=32,z[o=t]||(z[o]=setTimeout(function(){z[o]=null,e()},n))}function r(e){e=e.getBoundingClientRect();return W(b),{x:Math.floor(Number(e.left)+Number(M.x)),y:Math.floor(Number(e.top)+Number(M.y))}}function d(e){var n=e?r(w.iframe):{x:0,y:0},i={x:Number(w.width)+n.x,y:Number(w.height)+n.y};O(b,"Reposition requested from iFrame (offset x:"+n.x+" y:"+n.y+")"),window.top===window.self?(M=i,c(),O(b,"--")):window.parentIFrame?window.parentIFrame["scrollTo"+(e?"Offset":"")](i.x,i.y):R(b,"Unable to scroll to requested position, window.parentIFrame not found")}function c(){!1===l("onScroll",M)?S():C(b)}function u(e){var e=e.split("#")[1]||"",n=decodeURIComponent(e),n=document.getElementById(n)||document.getElementsByName(n)[0];n?(n=r(n),O(b,"Moving to in page link (#"+e+") at x: "+n.x+" y: "+n.y),M={x:n.x,y:n.y},c(),O(b,"--")):window.top===window.self?O(b,"In page link #"+e+" not found"):window.parentIFrame?window.parentIFrame.moveToAnchor(e):O(b,"In page link #"+e+" not found and window.parentIFrame not found")}function f(e){var n,i={};i=0===Number(w.width)&&0===Number(w.height)?{x:(n=a(9).split(":"))[1],y:n[0]}:{x:w.width,y:w.height},l(e,{iframe:w.iframe,screenX:Number(i.x),screenY:Number(i.y),type:w.type})}function l(e,n){return T(b,e,n)}function m(){switch(k[b]&&k[b].firstRun&&k[b]&&(k[b].firstRun=!1),w.type){case"close":N(w.iframe);break;case"message":n=a(6),O(b,"onMessage passed: {iframe: "+w.iframe.id+", message: "+n+"}"),l("onMessage",{iframe:w.iframe,message:JSON.parse(n)}),O(b,"--");break;case"mouseenter":f("onMouseEnter");break;case"mouseleave":f("onMouseLeave");break;case"autoResize":k[b].autoResize=JSON.parse(a(9));break;case"scrollTo":d(!1);break;case"scrollToOffset":d(!0);break;case"pageInfo":s(k[b]&&k[b].iframe,b),r=b,e("Add ",F),k[r]&&(k[r].stopPageInfo=o);break;case"pageInfoStop":k[b]&&k[b].stopPageInfo&&(k[b].stopPageInfo(),delete k[b].stopPageInfo);break;case"inPageLink":u(a(9));break;case"reset":j(w);break;case"init":i(),l("onInit",w.iframe);break;default:0===Number(w.width)&&0===Number(w.height)?R("Unsupported message received ("+w.type+"), this is likely due to the iframe containing a later version of iframe-resizer than the parent page"):i()}function e(n,i){function t(){k[r]?s(k[r].iframe,r):o()}["scroll","resize"].forEach(function(e){O(r,n+e+" listener for sendPageInfo"),i(window,e,t)})}function o(){e("Remove ",B)}var r,n}var g,h,p=e.data,w={},b=null;if("[iFrameResizerChild]Ready"===p)for(var y in k)A("iFrame requested init",L(y),k[y].iframe,y);else x===(""+p).slice(0,I)&&p.slice(I).split(":")[0]in k?(w=n(),b=w.id,k[b]&&(k[b].loaded=!0),(h=w.type in{true:1,false:1,undefined:1})&&O(b,"Ignoring init message from meta parent page"),!h&&(h=!0,k[g=b]||(h=!1,R(w.type+" No settings for "+g+". Message was: "+p)),h)&&(O(b,"Received: "+p),g=!0,null===w.iframe&&(R(b,"IFrame ("+w.id+") not found"),g=!1),g&&o()&&m())):E(b,"Ignored: "+p)}function T(e,n,i){var t=null,o=null;if(k[e]){if("function"!=typeof(t=k[e][n]))throw new TypeError(n+" on iFrame["+e+"] is not a function");o=t(i)}return o}function g(e){e=e.id;delete k[e]}function N(e){var n=e.id;if(!1===T(n,"onClose",n))O(n,"Close iframe cancelled by onClose event");else{O(n,"Removing iFrame: "+n);try{e.parentNode&&e.parentNode.removeChild(e)}catch(e){R(e)}T(n,"onClosed",n),O(n,"--"),g(e)}}function W(e){null===M&&O(e,"Get page position: "+(M={x:window.pageXOffset===d?document.documentElement.scrollLeft:window.pageXOffset,y:window.pageYOffset===d?document.documentElement.scrollTop:window.pageYOffset}).x+","+M.y)}function C(e){null!==M&&(window.scrollTo(M.x,M.y),O(e,"Set page position: "+M.x+","+M.y),S())}function S(){M=null}function j(e){O(e.id,"Size reset requested by "+("init"===e.type?"host page":"iFrame")),W(e.id),P(function(){H(e),A("reset","reset",e.iframe,e.id)},e,"reset")}function H(o){function i(e){var n;function i(){Object.keys(k).forEach(function(e){function n(e){return"0px"===(k[i]&&k[i].iframe.style[e])}var i;k[i=e]&&null!==k[i].iframe.offsetParent&&(n("height")||n("width"))&&A("Visibility change","resize",k[i].iframe,i)})}function t(e){O("window","Mutation observed: "+e[0].target+" "+e[0].type),h(i,16)}!a&&"0"===o[e]&&(a=!0,O(r,"Hidden iFrame detected, creating visibility listener"),e=m())&&(n=document.querySelector("body"),new e(t).observe(n,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0}))}function e(e){var n;n=e,o.id?(o.iframe.style[n]=o[n]+"px",O(o.id,"IFrame ("+r+") "+n+" set to "+o[n]+"px")):O("undefined","messageData id not set"),i(e)}var r=o.iframe.id;k[r]&&(k[r].sizeHeight&&e("height"),k[r].sizeWidth)&&e("width")}function P(e,n,i){i!==n.type&&r&&!window.jasmine?(O(n.id,"Requesting animation frame"),r(e)):e()}function A(n,i,t,o,e){function r(){var e;t&&"contentWindow"in t&&null!==t.contentWindow?(e=k[o]&&k[o].targetOrigin,O(o,"["+n+"] Sending msg to iframe["+o+"] ("+i+") targetOrigin: "+e),t.contentWindow.postMessage(x+i,e)):R(o,"["+n+"] IFrame("+o+") not found")}function a(){e&&k[o]&&k[o].warningTimeout&&(k[o].msgTimeout=setTimeout(function(){!k[o]||k[o].loaded||s||(s=!0,R(o,"IFrame has not responded within "+k[o].warningTimeout/1e3+" seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning."))},k[o].warningTimeout))}var s=!1;o=o||t.id,k[o]&&(r(),a())}function L(e){return e+":"+k[e].bodyMarginV1+":"+k[e].sizeWidth+":"+k[e].log+":"+k[e].interval+":"+k[e].enablePublicMethods+":"+k[e].autoResize+":"+k[e].bodyMargin+":"+k[e].heightCalculationMethod+":"+k[e].bodyBackground+":"+k[e].bodyPadding+":"+k[e].tolerance+":"+k[e].inPageLinks+":"+k[e].resizeFrom+":"+k[e].widthCalculationMethod+":"+k[e].mouseEvents}function s(t,i){function e(i){var e=m();e&&(e=e,t.parentNode)&&new e(function(e){e.forEach(function(e){Array.prototype.slice.call(e.removedNodes).forEach(function(e){e===t&&N(t)})})}).observe(t.parentNode,{childList:!0}),F(t,"load",function(){var e,n;A("iFrame.onload",i,t,d,!0),e=k[r]&&k[r].firstRun,n=k[r]&&k[r].heightCalculationMethod in f,!e&&n&&j({iframe:t,height:0,width:0,type:"init"})}),A("init",i,t,d,!0)}function o(e){var n=e.split("Callback");2===n.length&&(this[n="on"+n[0].charAt(0).toUpperCase()+n[0].slice(1)]=this[e],delete this[e],R(r,"Deprecated: '"+e+"' has been renamed '"+n+"'. The old method will be removed in the next major version."))}function n(e){if(e=e||{},k[r]=Object.create(null),k[r].iframe=t,k[r].firstRun=!0,k[r].remoteHost=t.src&&t.src.split("/").slice(0,3).join("/"),"object"!=typeof e)throw new TypeError("Options is not an object");Object.keys(e).forEach(o,e);var n,i=e;for(n in l)Object.prototype.hasOwnProperty.call(l,n)&&(k[r][n]=(Object.prototype.hasOwnProperty.call(i,n)?i:l)[n]);k[r]&&(k[r].targetOrigin=!0!==k[r].checkOrigin||""===(e=k[r].remoteHost)||null!==e.match(/^(about:blank|javascript:|file:\/\/)/)?"*":e)}var r=function(e){if("string"!=typeof e)throw new TypeError("Invaild id for iFrame. Expected String");var n;return""===e&&(t.id=(n=i&&i.id||l.id+c++,null!==document.getElementById(n)&&(n+=c++),e=n),u=(i||{}).log,O(e,"Added missing iframe ID: "+e+" ("+t.src+")")),e}(t.id);if(r in k&&"iFrameResizer"in t)R(r,"Ignored iFrame, already setup.");else{switch(n(i),O(r,"IFrame scrolling "+(k[r]&&k[r].scrolling?"enabled":"disabled")+" for "+r),t.style.overflow=!1===(k[r]&&k[r].scrolling)?"hidden":"auto",k[r]&&k[r].scrolling){case"omit":break;case!0:t.scrolling="yes";break;case!1:t.scrolling="no";break;default:t.scrolling=k[r]?k[r].scrolling:"no"}s("Height"),s("Width"),a("maxHeight"),a("minHeight"),a("maxWidth"),a("minWidth"),"number"!=typeof(k[r]&&k[r].bodyMargin)&&"0"!==(k[r]&&k[r].bodyMargin)||(k[r].bodyMarginV1=k[r].bodyMargin,k[r].bodyMargin=k[r].bodyMargin+"px"),e(L(r)),k[r]&&(k[r].iframe.iFrameResizer={close:N.bind(null,k[r].iframe),removeListeners:g.bind(null,k[r].iframe),resize:A.bind(null,"Window resize","resize",k[r].iframe),moveToAnchor:function(e){A("Move to anchor","moveToAnchor:"+e,k[r].iframe,r)},sendMessage:function(e){A("Send Message","message:"+(e=JSON.stringify(e)),k[r].iframe,r)}})}function a(e){var n=k[r][e];1/0!==n&&0!==n&&(t.style[e]="number"==typeof n?n+"px":n,O(r,"Set "+e+" = "+t.style[e]))}function s(e){if(k[r]["min"+e]>k[r]["max"+e])throw new Error("Value for min"+e+" can not be greater than max"+e)}}function h(e,n){null===i&&(i=setTimeout(function(){i=null,e()},n))}function e(){"hidden"!==document.visibilityState&&(O("document","Trigger event: Visibility change"),h(function(){b("Tab Visible","resize")},16))}function b(i,t){Object.keys(k).forEach(function(e){var n;k[n=e]&&"parent"===k[n].resizeFrom&&k[n].autoResize&&!k[n].firstRun&&A(i,t,k[e].iframe,e)})}function y(){F(window,"message",w),F(window,"resize",function(){var e;O("window","Trigger event: "+(e="resize")),h(function(){b("Window "+e,"resize")},16)}),F(document,"visibilitychange",e),F(document,"-webkit-visibilitychange",e)}function n(){function t(e,n){if(n){if(!n.tagName)throw new TypeError("Object is not a valid DOM element");if("IFRAME"!==n.tagName.toUpperCase())throw new TypeError("Expected <IFRAME> tag, found <"+n.tagName+">");s(n,e),o.push(n)}}for(var o,e=["moz","webkit","o","ms"],n=0;n<e.length&&!r;n+=1)r=window[e[n]+"RequestAnimationFrame"];return r?r=r.bind(window):O("setup","RequestAnimationFrame not supported"),y(),function(e,n){var i;switch(o=[],(i=e)&&i.enablePublicMethods&&R("enablePublicMethods option has been removed, public methods are now always available in the iFrame"),typeof n){case"undefined":case"string":Array.prototype.forEach.call(document.querySelectorAll(n||"iframe"),t.bind(d,e));break;case"object":t(e,n);break;default:throw new TypeError("Unexpected data type ("+typeof n+")")}return o}}function q(e){e.fn?e.fn.iFrameResize||(e.fn.iFrameResize=function(i){return this.filter("iframe").each(function(e,n){s(n,i)}).end()}):E("","Unable to bind to jQuery, it is not fully loaded.")}"undefined"!=typeof window&&(c=0,a=u=!1,v="message".length,I=(x="[iFrameSizer]").length,M=null,r=window.requestAnimationFrame,f=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),k={},i=null,l=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyMarginV1:8,bodyPadding:null,checkOrigin:!0,inPageLinks:!1,enablePublicMethods:!0,heightCalculationMethod:"bodyOffset",id:"iFrameResizer",interval:32,log:!1,maxHeight:1/0,maxWidth:1/0,minHeight:0,minWidth:0,mouseEvents:!0,resizeFrom:"parent",scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,widthCalculationMethod:"scroll",onClose:function(){return!0},onClosed:function(){},onInit:function(){},onMessage:function(){R("onMessage function not defined")},onMouseEnter:function(){},onMouseLeave:function(){},onResized:function(){},onScroll:function(){return!0}}),z={},window.jQuery!==d&&q(window.jQuery),"function"==typeof define&&define.amd?define([],n):"object"==typeof module&&"object"==typeof module.exports&&(module.exports=n()),window.iFrameResize=window.iFrameResize||n())}();
|
data/lib/j1/version.rb
CHANGED
data/lib/starter_web/README.md
CHANGED
@@ -379,7 +379,7 @@ This command creates a **initial** project in folder **my-starter**.
|
|
379
379
|
2023-02-28 18:12:12 - GENERATE: Resolving dependencies...
|
380
380
|
2023-02-28 18:12:12 - GENERATE: Using bundler 2.3.7
|
381
381
|
...
|
382
|
-
2023-02-28 18:12:12 - GENERATE: Using j1-template 2024.0.
|
382
|
+
2023-02-28 18:12:12 - GENERATE: Using j1-template 2024.0.2
|
383
383
|
2023-02-28 18:12:12 - GENERATE: Bundle complete! 31 Gemfile dependencies, 78 gems now installed.
|
384
384
|
2023-02-28 18:12:12 - GENERATE: Bundled gems are installed into `../../.gem`
|
385
385
|
2023-02-28 18:12:12 - GENERATE: C:/Users/xxx/.gem/ruby/3.1.0;C:/DevTools/Ruby31-x64/lib/ruby/gems/3.1.0;
|
@@ -415,7 +415,7 @@ commands are available as well.
|
|
415
415
|
2023-02-28 18:17:48 - SETUP: Initialize the project ...
|
416
416
|
2023-02-28 18:17:48 - SETUP: Be patient, this will take a while ...
|
417
417
|
2023-02-28 18:17:49 - SETUP:
|
418
|
-
2023-02-28 18:17:49 - SETUP: > j1@2024.0.
|
418
|
+
2023-02-28 18:17:49 - SETUP: > j1@2024.0.2 setup C:\Users\xxx\j1-projects\my-starter
|
419
419
|
2023-02-28 18:17:49 - SETUP: > npm --silent run setup-start && npm --silent run setup-base && run-s -s setup:*
|
420
420
|
2023-02-28 18:17:49 - SETUP:
|
421
421
|
2023-02-28 18:17:50 - SETUP: Setup project for first use ..
|
@@ -460,7 +460,7 @@ browser. Let's start the journey ...
|
|
460
460
|
Check setup state of the J1 project ...
|
461
461
|
2023-02-28 18:26:18 - SITE: Starting up your site ...
|
462
462
|
2023-02-28 18:26:18 - SITE:
|
463
|
-
2023-02-28 18:26:18 - SITE: > j1@2024.0.
|
463
|
+
2023-02-28 18:26:18 - SITE: > j1@2024.0.2 j1-site C:\Users\jadams\j1-projects\my-starter
|
464
464
|
2023-02-28 18:26:18 - SITE: > run-p -s j1-site:*
|
465
465
|
2023-02-28 18:26:18 - SITE:
|
466
466
|
2023-02-28 18:26:20 - SITE: Startup UTILSRV ..
|
@@ -499,7 +499,7 @@ Check setup state of the J1 project ...
|
|
499
499
|
REBUILD: Rebuild the projects website ...
|
500
500
|
REBUILD: Be patient, this will take a while ...
|
501
501
|
2023-02-28 18:45:09 - REBUILD:
|
502
|
-
2023-02-28 18:45:09 - REBUILD: > j1@2024.0.
|
502
|
+
2023-02-28 18:45:09 - REBUILD: > j1@2024.0.2 rebuild C:\Users\xxx\j1-projects\my-starter
|
503
503
|
2023-02-28 18:45:09 - REBUILD: > run-s -s rebuild:* && run-s -s post-rebuild:*
|
504
504
|
2023-02-28 18:45:09 - REBUILD:
|
505
505
|
2023-02-28 18:45:10 - REBUILD: Rebuild site incremental ..
|
@@ -547,7 +547,7 @@ using Lerna for all packages:
|
|
547
547
|
2023-02-28 18:29:07 - RESET: Reset the project to factory state ...
|
548
548
|
2023-02-28 18:29:07 - RESET: Be patient, this will take a while ...
|
549
549
|
2023-02-28 18:29:08 - RESET:
|
550
|
-
2023-02-28 18:29:08 - RESET: > j1@2024.0.
|
550
|
+
2023-02-28 18:29:08 - RESET: > j1@2024.0.2 reset C:\Users\xxx\j1-projects\my-starter
|
551
551
|
2023-02-28 18:29:08 - RESET: > run-s -s reset:*
|
552
552
|
2023-02-28 18:29:08 - RESET:
|
553
553
|
2023-02-28 18:29:08 - RESET: Reset project to factory state ..
|
data/lib/starter_web/_config.yml
CHANGED
@@ -53,7 +53,7 @@ environment: development
|
|
53
53
|
# ------------------------------------------------------------------------------
|
54
54
|
# Sets the build version of the site
|
55
55
|
#
|
56
|
-
version: 2024.0.
|
56
|
+
version: 2024.0.2
|
57
57
|
|
58
58
|
# copyright
|
59
59
|
# ------------------------------------------------------------------------------
|
@@ -25,8 +25,8 @@ description:
|
|
25
25
|
settings:
|
26
26
|
enabled: false
|
27
27
|
|
28
|
-
#
|
29
|
-
#
|
28
|
+
# Provider settings
|
29
|
+
# ----------------------------------------------------------------------------
|
30
30
|
#
|
31
31
|
provider: <your-chatbot>
|
32
32
|
chatbotID: <your-chatbot-id>
|
@@ -66,8 +66,8 @@ defaults:
|
|
66
66
|
# ==========================================================================
|
67
67
|
# vivochat: 3d0b29f1-623a-4915-a817-e436d328f18f
|
68
68
|
# tutgpt: clo54vmlw000582y700nkde5t
|
69
|
-
# chatbob:
|
70
|
-
# webwhiz:
|
69
|
+
# chatbob: nzxiSnnrT2CgodkC71Q4JQ
|
70
|
+
# webwhiz: 653fcc96d6e3b30c477517f4 # NOT recommended as BROKEN since 10/2023
|
71
71
|
#
|
72
72
|
# ----------------------------------------------------------------------------
|
73
73
|
#
|