lookbook 2.3.6 → 2.3.7
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.
- checksums.yaml +4 -4
- data/lib/lookbook/version.rb +1 -1
- data/public/lookbook-assets/css/lookbook.css +31 -37
- data/public/lookbook-assets/css/lookbook.css.map +1 -1
- data/public/lookbook-assets/css/themes/blue.css +0 -1
- data/public/lookbook-assets/css/themes/green.css +0 -1
- data/public/lookbook-assets/css/themes/indigo.css +0 -1
- data/public/lookbook-assets/css/themes/rose.css +0 -1
- data/public/lookbook-assets/css/themes/zinc.css +0 -1
- data/public/lookbook-assets/js/iframe.js +193 -193
- data/public/lookbook-assets/js/index.js +821 -821
- data/public/lookbook-assets/js/index.js.map +1 -1
- data/public/lookbook-assets/js/lookbook-core.js +0 -37
- data/public/lookbook-assets/js/lookbook.js +252 -289
- metadata +2 -378
- data/assets/icons/activity-square.svg +0 -1
- data/assets/icons/ampersand.svg +0 -1
- data/assets/icons/ampersands.svg +0 -1
- data/assets/icons/antenna.svg +0 -1
- data/assets/icons/app-window.svg +0 -1
- data/assets/icons/archive-x.svg +0 -1
- data/assets/icons/area-chart.svg +0 -1
- data/assets/icons/arrow-big-down-dash.svg +0 -1
- data/assets/icons/arrow-big-left-dash.svg +0 -1
- data/assets/icons/arrow-big-right-dash.svg +0 -1
- data/assets/icons/arrow-big-up-dash.svg +0 -1
- data/assets/icons/arrow-down-0-1.svg +0 -1
- data/assets/icons/arrow-down-1-0.svg +0 -1
- data/assets/icons/arrow-down-a-z.svg +0 -1
- data/assets/icons/arrow-down-from-line.svg +0 -1
- data/assets/icons/arrow-down-left-from-circle.svg +0 -1
- data/assets/icons/arrow-down-left-square.svg +0 -1
- data/assets/icons/arrow-down-narrow-wide.svg +0 -1
- data/assets/icons/arrow-down-right-from-circle.svg +0 -1
- data/assets/icons/arrow-down-right-square.svg +0 -1
- data/assets/icons/arrow-down-square.svg +0 -1
- data/assets/icons/arrow-down-to-dot.svg +0 -1
- data/assets/icons/arrow-down-to-line.svg +0 -1
- data/assets/icons/arrow-down-up.svg +0 -1
- data/assets/icons/arrow-down-wide-narrow.svg +0 -1
- data/assets/icons/arrow-down-z-a.svg +0 -1
- data/assets/icons/arrow-left-from-line.svg +0 -1
- data/assets/icons/arrow-left-square.svg +0 -1
- data/assets/icons/arrow-left-to-line.svg +0 -1
- data/assets/icons/arrow-right-from-line.svg +0 -1
- data/assets/icons/arrow-right-left.svg +0 -1
- data/assets/icons/arrow-right-square.svg +0 -1
- data/assets/icons/arrow-right-to-line.svg +0 -1
- data/assets/icons/arrow-up-0-1.svg +0 -1
- data/assets/icons/arrow-up-1-0.svg +0 -1
- data/assets/icons/arrow-up-a-z.svg +0 -1
- data/assets/icons/arrow-up-from-dot.svg +0 -1
- data/assets/icons/arrow-up-from-line.svg +0 -1
- data/assets/icons/arrow-up-left-from-circle.svg +0 -1
- data/assets/icons/arrow-up-left-square.svg +0 -1
- data/assets/icons/arrow-up-narrow-wide.svg +0 -1
- data/assets/icons/arrow-up-right-from-circle.svg +0 -1
- data/assets/icons/arrow-up-right-square.svg +0 -1
- data/assets/icons/arrow-up-square.svg +0 -1
- data/assets/icons/arrow-up-to-line.svg +0 -1
- data/assets/icons/arrow-up-wide-narrow.svg +0 -1
- data/assets/icons/arrow-up-z-a.svg +0 -1
- data/assets/icons/arrows-up-from-line.svg +0 -1
- data/assets/icons/atom.svg +0 -1
- data/assets/icons/badge-alert.svg +0 -1
- data/assets/icons/badge-cent.svg +0 -1
- data/assets/icons/badge-check.svg +0 -1
- data/assets/icons/badge-dollar-sign.svg +0 -1
- data/assets/icons/badge-euro.svg +0 -1
- data/assets/icons/badge-help.svg +0 -1
- data/assets/icons/badge-indian-rupee.svg +0 -1
- data/assets/icons/badge-info.svg +0 -1
- data/assets/icons/badge-japanese-yen.svg +0 -1
- data/assets/icons/badge-minus.svg +0 -1
- data/assets/icons/badge-percent.svg +0 -1
- data/assets/icons/badge-plus.svg +0 -1
- data/assets/icons/badge-pound-sterling.svg +0 -1
- data/assets/icons/badge-russian-ruble.svg +0 -1
- data/assets/icons/badge-swiss-franc.svg +0 -1
- data/assets/icons/badge-x.svg +0 -1
- data/assets/icons/badge.svg +0 -1
- data/assets/icons/ban.svg +0 -1
- data/assets/icons/bar-chart-big.svg +0 -1
- data/assets/icons/bar-chart-horizontal-big.svg +0 -1
- data/assets/icons/bell-dot.svg +0 -1
- data/assets/icons/biohazard.svg +0 -1
- data/assets/icons/blocks.svg +0 -1
- data/assets/icons/book-copy.svg +0 -1
- data/assets/icons/book-down.svg +0 -1
- data/assets/icons/book-key.svg +0 -1
- data/assets/icons/book-lock.svg +0 -1
- data/assets/icons/book-marked.svg +0 -1
- data/assets/icons/book-minus.svg +0 -1
- data/assets/icons/book-plus.svg +0 -1
- data/assets/icons/book-template.svg +0 -1
- data/assets/icons/book-up-2.svg +0 -1
- data/assets/icons/book-up.svg +0 -1
- data/assets/icons/book-x.svg +0 -1
- data/assets/icons/bookmark-check.svg +0 -1
- data/assets/icons/bookmark-x.svg +0 -1
- data/assets/icons/boom-box.svg +0 -1
- data/assets/icons/braces.svg +0 -1
- data/assets/icons/brackets.svg +0 -1
- data/assets/icons/brain-circuit.svg +0 -1
- data/assets/icons/brain-cog.svg +0 -1
- data/assets/icons/brain.svg +0 -1
- data/assets/icons/bring-to-front.svg +0 -1
- data/assets/icons/bug-off.svg +0 -1
- data/assets/icons/bug-play.svg +0 -1
- data/assets/icons/bus-front.svg +0 -1
- data/assets/icons/cable-car.svg +0 -1
- data/assets/icons/cable.svg +0 -1
- data/assets/icons/cake-slice.svg +0 -1
- data/assets/icons/candlestick-chart.svg +0 -1
- data/assets/icons/candy-cane.svg +0 -1
- data/assets/icons/car-front.svg +0 -1
- data/assets/icons/car-taxi-front.svg +0 -1
- data/assets/icons/case-lower.svg +0 -1
- data/assets/icons/case-sensitive.svg +0 -1
- data/assets/icons/case-upper.svg +0 -1
- data/assets/icons/cassette-tape.svg +0 -1
- data/assets/icons/castle.svg +0 -1
- data/assets/icons/chevron-down-circle.svg +0 -1
- data/assets/icons/chevron-down-square.svg +0 -1
- data/assets/icons/chevron-left-circle.svg +0 -1
- data/assets/icons/chevron-left-square.svg +0 -1
- data/assets/icons/chevron-right-circle.svg +0 -1
- data/assets/icons/chevron-right-square.svg +0 -1
- data/assets/icons/chevron-up-circle.svg +0 -1
- data/assets/icons/chevron-up-square.svg +0 -1
- data/assets/icons/church.svg +0 -1
- data/assets/icons/circle-dashed.svg +0 -1
- data/assets/icons/circle-dollar-sign.svg +0 -1
- data/assets/icons/circle-dot-dashed.svg +0 -1
- data/assets/icons/circle-equal.svg +0 -1
- data/assets/icons/circle-off.svg +0 -1
- data/assets/icons/circle-slash-2.svg +0 -1
- data/assets/icons/circle-slash.svg +0 -1
- data/assets/icons/circuit-board.svg +0 -1
- data/assets/icons/clipboard-paste.svg +0 -1
- data/assets/icons/club.svg +0 -1
- data/assets/icons/combine.svg +0 -1
- data/assets/icons/computer.svg +0 -1
- data/assets/icons/contact-2.svg +0 -1
- data/assets/icons/container.svg +0 -1
- data/assets/icons/copy-check.svg +0 -1
- data/assets/icons/copy-minus.svg +0 -1
- data/assets/icons/copy-plus.svg +0 -1
- data/assets/icons/copy-slash.svg +0 -1
- data/assets/icons/copy-x.svg +0 -1
- data/assets/icons/database-zap.svg +0 -1
- data/assets/icons/dessert.svg +0 -1
- data/assets/icons/disc-2.svg +0 -1
- data/assets/icons/disc-3.svg +0 -1
- data/assets/icons/donut.svg +0 -1
- data/assets/icons/door-closed.svg +0 -1
- data/assets/icons/door-open.svg +0 -1
- data/assets/icons/dot.svg +0 -1
- data/assets/icons/drama.svg +0 -1
- data/assets/icons/ferris-wheel.svg +0 -1
- data/assets/icons/file-code-2.svg +0 -1
- data/assets/icons/file-stack.svg +0 -1
- data/assets/icons/fish-symbol.svg +0 -1
- data/assets/icons/fold-horizontal.svg +0 -1
- data/assets/icons/fold-vertical.svg +0 -1
- data/assets/icons/folder-dot.svg +0 -1
- data/assets/icons/folder-git-2.svg +0 -1
- data/assets/icons/folder-git.svg +0 -1
- data/assets/icons/folder-kanban.svg +0 -1
- data/assets/icons/folder-open-dot.svg +0 -1
- data/assets/icons/folder-root.svg +0 -1
- data/assets/icons/folder-sync.svg +0 -1
- data/assets/icons/gallery-horizontal-end.svg +0 -1
- data/assets/icons/gallery-horizontal.svg +0 -1
- data/assets/icons/gallery-thumbnails.svg +0 -1
- data/assets/icons/gallery-vertical-end.svg +0 -1
- data/assets/icons/gallery-vertical.svg +0 -1
- data/assets/icons/gantt-chart-square.svg +0 -1
- data/assets/icons/gantt-chart.svg +0 -1
- data/assets/icons/gauge-circle.svg +0 -1
- data/assets/icons/goal.svg +0 -1
- data/assets/icons/grid-2x2.svg +0 -1
- data/assets/icons/grid-3x3.svg +0 -1
- data/assets/icons/group.svg +0 -1
- data/assets/icons/hard-drive-download.svg +0 -1
- data/assets/icons/hard-drive-upload.svg +0 -1
- data/assets/icons/hdmi-port.svg +0 -1
- data/assets/icons/hotel.svg +0 -1
- data/assets/icons/iteration-ccw.svg +0 -1
- data/assets/icons/iteration-cw.svg +0 -1
- data/assets/icons/kanban-square-dashed.svg +0 -1
- data/assets/icons/kanban-square.svg +0 -1
- data/assets/icons/kanban.svg +0 -1
- data/assets/icons/key-round.svg +0 -1
- data/assets/icons/key-square.svg +0 -1
- data/assets/icons/layout-panel-left.svg +0 -1
- data/assets/icons/layout-panel-top.svg +0 -1
- data/assets/icons/leafy-green.svg +0 -1
- data/assets/icons/ligature.svg +0 -1
- data/assets/icons/list-filter.svg +0 -1
- data/assets/icons/list-restart.svg +0 -1
- data/assets/icons/list-todo.svg +0 -1
- data/assets/icons/list-tree.svg +0 -1
- data/assets/icons/lollipop.svg +0 -1
- data/assets/icons/m-square.svg +0 -1
- data/assets/icons/mailbox.svg +0 -1
- data/assets/icons/memory-stick.svg +0 -1
- data/assets/icons/menu-square.svg +0 -1
- data/assets/icons/merge.svg +0 -1
- data/assets/icons/message-square-dashed.svg +0 -1
- data/assets/icons/message-square-plus.svg +0 -1
- data/assets/icons/messages-square.svg +0 -1
- data/assets/icons/monitor-check.svg +0 -1
- data/assets/icons/monitor-dot.svg +0 -1
- data/assets/icons/monitor-down.svg +0 -1
- data/assets/icons/monitor-pause.svg +0 -1
- data/assets/icons/monitor-play.svg +0 -1
- data/assets/icons/monitor-stop.svg +0 -1
- data/assets/icons/monitor-up.svg +0 -1
- data/assets/icons/monitor-x.svg +0 -1
- data/assets/icons/moon-star.svg +0 -1
- data/assets/icons/mouse-pointer-square-dashed.svg +0 -1
- data/assets/icons/mouse-pointer-square.svg +0 -1
- data/assets/icons/move-down-left.svg +0 -1
- data/assets/icons/move-down-right.svg +0 -1
- data/assets/icons/move-down.svg +0 -1
- data/assets/icons/move-left.svg +0 -1
- data/assets/icons/move-right.svg +0 -1
- data/assets/icons/move-up-left.svg +0 -1
- data/assets/icons/move-up-right.svg +0 -1
- data/assets/icons/move-up.svg +0 -1
- data/assets/icons/orbit.svg +0 -1
- data/assets/icons/panel-bottom-close.svg +0 -1
- data/assets/icons/panel-bottom-inactive.svg +0 -1
- data/assets/icons/panel-bottom-open.svg +0 -1
- data/assets/icons/panel-bottom.svg +0 -1
- data/assets/icons/panel-left-close.svg +0 -1
- data/assets/icons/panel-left-inactive.svg +0 -1
- data/assets/icons/panel-left-open.svg +0 -1
- data/assets/icons/panel-left.svg +0 -1
- data/assets/icons/panel-right-close.svg +0 -1
- data/assets/icons/panel-right-inactive.svg +0 -1
- data/assets/icons/panel-right-open.svg +0 -1
- data/assets/icons/panel-right.svg +0 -1
- data/assets/icons/panel-top-close.svg +0 -1
- data/assets/icons/panel-top-inactive.svg +0 -1
- data/assets/icons/panel-top-open.svg +0 -1
- data/assets/icons/panel-top.svg +0 -1
- data/assets/icons/parentheses.svg +0 -1
- data/assets/icons/parking-circle-off.svg +0 -1
- data/assets/icons/parking-circle.svg +0 -1
- data/assets/icons/parking-meter.svg +0 -1
- data/assets/icons/parking-square-off.svg +0 -1
- data/assets/icons/parking-square.svg +0 -1
- data/assets/icons/paw-print.svg +0 -1
- data/assets/icons/pc-case.svg +0 -1
- data/assets/icons/pen-line.svg +0 -1
- data/assets/icons/pen-square.svg +0 -1
- data/assets/icons/pen.svg +0 -1
- data/assets/icons/pencil-line.svg +0 -1
- data/assets/icons/pencil-ruler.svg +0 -1
- data/assets/icons/percent-circle.svg +0 -1
- data/assets/icons/percent-diamond.svg +0 -1
- data/assets/icons/percent-square.svg +0 -1
- data/assets/icons/pi-square.svg +0 -1
- data/assets/icons/pi.svg +0 -1
- data/assets/icons/pilcrow-square.svg +0 -1
- data/assets/icons/plane-landing.svg +0 -1
- data/assets/icons/plane-takeoff.svg +0 -1
- data/assets/icons/play-square.svg +0 -1
- data/assets/icons/plug-zap-2.svg +0 -1
- data/assets/icons/pocket-knife.svg +0 -1
- data/assets/icons/popcorn.svg +0 -1
- data/assets/icons/popsicle.svg +0 -1
- data/assets/icons/presentation.svg +0 -1
- data/assets/icons/projector.svg +0 -1
- data/assets/icons/rabbit.svg +0 -1
- data/assets/icons/radar.svg +0 -1
- data/assets/icons/radiation.svg +0 -1
- data/assets/icons/radio-tower.svg +0 -1
- data/assets/icons/rail-symbol.svg +0 -1
- data/assets/icons/rainbow.svg +0 -1
- data/assets/icons/rat.svg +0 -1
- data/assets/icons/ratio.svg +0 -1
- data/assets/icons/receipt.svg +0 -1
- data/assets/icons/redo-dot.svg +0 -1
- data/assets/icons/refresh-ccw-dot.svg +0 -1
- data/assets/icons/refresh-cw-off.svg +0 -1
- data/assets/icons/repeat-2.svg +0 -1
- data/assets/icons/replace-all.svg +0 -1
- data/assets/icons/replace.svg +0 -1
- data/assets/icons/roller-coaster.svg +0 -1
- data/assets/icons/rows.svg +0 -1
- data/assets/icons/satellite-dish.svg +0 -1
- data/assets/icons/satellite.svg +0 -1
- data/assets/icons/save-all.svg +0 -1
- data/assets/icons/scatter-chart.svg +0 -1
- data/assets/icons/school-2.svg +0 -1
- data/assets/icons/school.svg +0 -1
- data/assets/icons/scissors-line-dashed.svg +0 -1
- data/assets/icons/scissors-square-dashed-bottom.svg +0 -1
- data/assets/icons/scissors-square.svg +0 -1
- data/assets/icons/scroll-text.svg +0 -1
- data/assets/icons/search-check.svg +0 -1
- data/assets/icons/search-code.svg +0 -1
- data/assets/icons/search-slash.svg +0 -1
- data/assets/icons/search-x.svg +0 -1
- data/assets/icons/send-horizontal.svg +0 -1
- data/assets/icons/send-to-back.svg +0 -1
- data/assets/icons/shapes.svg +0 -1
- data/assets/icons/shell.svg +0 -1
- data/assets/icons/shield-ban.svg +0 -1
- data/assets/icons/shield-ellipsis.svg +0 -1
- data/assets/icons/shield-half.svg +0 -1
- data/assets/icons/shield-minus.svg +0 -1
- data/assets/icons/shield-plus.svg +0 -1
- data/assets/icons/shield-question.svg +0 -1
- data/assets/icons/shield-x.svg +0 -1
- data/assets/icons/ship-wheel.svg +0 -1
- data/assets/icons/shopping-basket.svg +0 -1
- data/assets/icons/sigma-square.svg +0 -1
- data/assets/icons/snail.svg +0 -1
- data/assets/icons/space.svg +0 -1
- data/assets/icons/spade.svg +0 -1
- data/assets/icons/sparkle.svg +0 -1
- data/assets/icons/sparkles.svg +0 -1
- data/assets/icons/speech.svg +0 -1
- data/assets/icons/spell-check-2.svg +0 -1
- data/assets/icons/spell-check.svg +0 -1
- data/assets/icons/split.svg +0 -1
- data/assets/icons/spray-can.svg +0 -1
- data/assets/icons/square-asterisk.svg +0 -1
- data/assets/icons/square-code.svg +0 -1
- data/assets/icons/square-dashed-bottom-code.svg +0 -1
- data/assets/icons/square-dashed-bottom.svg +0 -1
- data/assets/icons/square-dot.svg +0 -1
- data/assets/icons/square-equal.svg +0 -1
- data/assets/icons/square-slash.svg +0 -1
- data/assets/icons/square-stack.svg +0 -1
- data/assets/icons/squirrel.svg +0 -1
- data/assets/icons/step-back.svg +0 -1
- data/assets/icons/step-forward.svg +0 -1
- data/assets/icons/store.svg +0 -1
- data/assets/icons/table-properties.svg +0 -1
- data/assets/icons/tablet-smartphone.svg +0 -1
- data/assets/icons/tally-1.svg +0 -1
- data/assets/icons/tally-2.svg +0 -1
- data/assets/icons/tally-3.svg +0 -1
- data/assets/icons/tally-4.svg +0 -1
- data/assets/icons/tally-5.svg +0 -1
- data/assets/icons/test-tube-2.svg +0 -1
- data/assets/icons/test-tube.svg +0 -1
- data/assets/icons/test-tubes.svg +0 -1
- data/assets/icons/text-quote.svg +0 -1
- data/assets/icons/text-select.svg +0 -1
- data/assets/icons/text.svg +0 -1
- data/assets/icons/theater.svg +0 -1
- data/assets/icons/touchpad-off.svg +0 -1
- data/assets/icons/touchpad.svg +0 -1
- data/assets/icons/tractor.svg +0 -1
- data/assets/icons/traffic-cone.svg +0 -1
- data/assets/icons/train-front-tunnel.svg +0 -1
- data/assets/icons/train-front.svg +0 -1
- data/assets/icons/train-track.svg +0 -1
- data/assets/icons/tram-front.svg +0 -1
- data/assets/icons/triangle-right.svg +0 -1
- data/assets/icons/turtle.svg +0 -1
- data/assets/icons/undo-dot.svg +0 -1
- data/assets/icons/unfold-horizontal.svg +0 -1
- data/assets/icons/unfold-vertical.svg +0 -1
- data/assets/icons/ungroup.svg +0 -1
- data/assets/icons/unplug.svg +0 -1
- data/assets/icons/user-2.svg +0 -1
- data/assets/icons/user-check-2.svg +0 -1
- data/assets/icons/user-circle-2.svg +0 -1
- data/assets/icons/user-circle.svg +0 -1
- data/assets/icons/user-cog-2.svg +0 -1
- data/assets/icons/user-minus-2.svg +0 -1
- data/assets/icons/user-plus-2.svg +0 -1
- data/assets/icons/user-square-2.svg +0 -1
- data/assets/icons/user-square.svg +0 -1
- data/assets/icons/user-x-2.svg +0 -1
- data/assets/icons/users-2.svg +0 -1
- data/assets/icons/variable.svg +0 -1
- data/assets/icons/videotape.svg +0 -1
- data/assets/icons/wallet-2.svg +0 -1
- data/assets/icons/wallet-cards.svg +0 -1
- data/assets/icons/wallpaper.svg +0 -1
- data/assets/icons/warehouse.svg +0 -1
- data/assets/icons/whole-word.svg +0 -1
- data/assets/icons/workflow.svg +0 -1
@@ -10,24 +10,24 @@ var $b2e1fd3e30ab1f5c$exports = {};
|
|
10
10
|
*
|
11
11
|
*/ // eslint-disable-next-line sonarjs/cognitive-complexity, no-shadow-restricted-names
|
12
12
|
(function(undefined) {
|
13
|
-
if (typeof window ===
|
14
|
-
var autoResize = true, base = 10, bodyBackground =
|
13
|
+
if (typeof window === 'undefined') return; // don't run for server side render
|
14
|
+
var autoResize = true, base = 10, bodyBackground = '', bodyMargin = 0, bodyMarginStr = '', bodyObserver = null, bodyPadding = '', calculateWidth = false, doubleEventList = {
|
15
15
|
resize: 1,
|
16
16
|
click: 1
|
17
|
-
}, eventCancelTimer = 128, firstRun = true, height = 1, heightCalcModeDefault =
|
17
|
+
}, eventCancelTimer = 128, firstRun = true, height = 1, heightCalcModeDefault = 'bodyOffset', heightCalcMode = heightCalcModeDefault, initLock = true, initMsg = '', inPageLinks = {}, interval = 32, intervalTimer = null, logging = false, mouseEvents = false, msgID = '[iFrameSizer]', msgIdLen = msgID.length, myID = '', resetRequiredMethods = {
|
18
18
|
max: 1,
|
19
19
|
min: 1,
|
20
20
|
bodyScroll: 1,
|
21
21
|
documentElementScroll: 1
|
22
|
-
}, resizeFrom =
|
23
|
-
warn(
|
22
|
+
}, resizeFrom = 'child', sendPermit = true, target = window.parent, targetOriginDefault = '*', tolerance = 0, triggerLocked = false, triggerLockedTimer = null, throttledTimer = 16, width = 1, widthCalcModeDefault = 'scroll', widthCalcMode = widthCalcModeDefault, win = window, onMessage = function() {
|
23
|
+
warn('onMessage function not defined');
|
24
24
|
}, onReady = function() {}, onPageInfo = function() {}, customCalcMethods = {
|
25
25
|
height: function() {
|
26
|
-
warn(
|
26
|
+
warn('Custom height calculation function not defined');
|
27
27
|
return document.documentElement.offsetHeight;
|
28
28
|
},
|
29
29
|
width: function() {
|
30
|
-
warn(
|
30
|
+
warn('Custom width calculation function not defined');
|
31
31
|
return document.body.scrollWidth;
|
32
32
|
}
|
33
33
|
}, eventHandlersByName = {}, passiveSupported = false;
|
@@ -41,8 +41,8 @@ var $b2e1fd3e30ab1f5c$exports = {};
|
|
41
41
|
}
|
42
42
|
}
|
43
43
|
});
|
44
|
-
window.addEventListener(
|
45
|
-
window.removeEventListener(
|
44
|
+
window.addEventListener('test', noop, options);
|
45
|
+
window.removeEventListener('test', noop, options);
|
46
46
|
} catch (error) {
|
47
47
|
/* */ }
|
48
48
|
function addEventListener(el, evt, func, options) {
|
@@ -83,23 +83,23 @@ var $b2e1fd3e30ab1f5c$exports = {};
|
|
83
83
|
};
|
84
84
|
}
|
85
85
|
function formatLogMsg(msg) {
|
86
|
-
return msgID +
|
86
|
+
return msgID + '[' + myID + '] ' + msg;
|
87
87
|
}
|
88
88
|
function log(msg) {
|
89
|
-
if (logging &&
|
89
|
+
if (logging && 'object' === typeof window.console) // eslint-disable-next-line no-console
|
90
90
|
console.log(formatLogMsg(msg));
|
91
91
|
}
|
92
92
|
function warn(msg) {
|
93
|
-
if (
|
93
|
+
if ('object' === typeof window.console) // eslint-disable-next-line no-console
|
94
94
|
console.warn(formatLogMsg(msg));
|
95
95
|
}
|
96
96
|
function init() {
|
97
97
|
readDataFromParent();
|
98
|
-
log(
|
98
|
+
log('Initialising iFrame (' + window.location.href + ')');
|
99
99
|
readDataFromPage();
|
100
100
|
setMargin();
|
101
|
-
setBodyStyle(
|
102
|
-
setBodyStyle(
|
101
|
+
setBodyStyle('background', bodyBackground);
|
102
|
+
setBodyStyle('padding', bodyPadding);
|
103
103
|
injectClearFixIntoBodyElement();
|
104
104
|
checkHeightMode();
|
105
105
|
checkWidthMode();
|
@@ -108,14 +108,14 @@ var $b2e1fd3e30ab1f5c$exports = {};
|
|
108
108
|
setupMouseEvents();
|
109
109
|
startEventListeners();
|
110
110
|
inPageLinks = setupInPageLinks();
|
111
|
-
sendSize(
|
111
|
+
sendSize('init', 'Init message from host page');
|
112
112
|
onReady();
|
113
113
|
}
|
114
114
|
function readDataFromParent() {
|
115
115
|
function strBool(str) {
|
116
|
-
return
|
116
|
+
return 'true' === str;
|
117
117
|
}
|
118
|
-
var data = initMsg.slice(msgIdLen).split(
|
118
|
+
var data = initMsg.slice(msgIdLen).split(':');
|
119
119
|
myID = data[0];
|
120
120
|
bodyMargin = undefined === data[1] ? bodyMargin : Number(data[1]) // For V1 compatibility
|
121
121
|
;
|
@@ -134,9 +134,9 @@ var $b2e1fd3e30ab1f5c$exports = {};
|
|
134
134
|
mouseEvents = undefined === data[15] ? mouseEvents : strBool(data[15]);
|
135
135
|
}
|
136
136
|
function depricate(key) {
|
137
|
-
var splitName = key.split(
|
137
|
+
var splitName = key.split('Callback');
|
138
138
|
if (splitName.length === 2) {
|
139
|
-
var name =
|
139
|
+
var name = 'on' + splitName[0].charAt(0).toUpperCase() + splitName[0].slice(1);
|
140
140
|
this[name] = this[key];
|
141
141
|
delete this[key];
|
142
142
|
warn("Deprecated: '" + key + "' has been renamed '" + name + "'. The old method will be removed in the next major version.");
|
@@ -145,50 +145,50 @@ var $b2e1fd3e30ab1f5c$exports = {};
|
|
145
145
|
function readDataFromPage() {
|
146
146
|
function readData() {
|
147
147
|
var data = window.iFrameResizer;
|
148
|
-
log(
|
148
|
+
log('Reading data from page: ' + JSON.stringify(data));
|
149
149
|
Object.keys(data).forEach(depricate, data);
|
150
|
-
onMessage =
|
151
|
-
onReady =
|
152
|
-
targetOriginDefault =
|
153
|
-
heightCalcMode =
|
154
|
-
widthCalcMode =
|
150
|
+
onMessage = 'onMessage' in data ? data.onMessage : onMessage;
|
151
|
+
onReady = 'onReady' in data ? data.onReady : onReady;
|
152
|
+
targetOriginDefault = 'targetOrigin' in data ? data.targetOrigin : targetOriginDefault;
|
153
|
+
heightCalcMode = 'heightCalculationMethod' in data ? data.heightCalculationMethod : heightCalcMode;
|
154
|
+
widthCalcMode = 'widthCalculationMethod' in data ? data.widthCalculationMethod : widthCalcMode;
|
155
155
|
}
|
156
156
|
function setupCustomCalcMethods(calcMode, calcFunc) {
|
157
|
-
if (
|
158
|
-
log(
|
157
|
+
if ('function' === typeof calcMode) {
|
158
|
+
log('Setup custom ' + calcFunc + 'CalcMethod');
|
159
159
|
customCalcMethods[calcFunc] = calcMode;
|
160
|
-
calcMode =
|
160
|
+
calcMode = 'custom';
|
161
161
|
}
|
162
162
|
return calcMode;
|
163
163
|
}
|
164
|
-
if (
|
164
|
+
if ('iFrameResizer' in window && Object === window.iFrameResizer.constructor) {
|
165
165
|
readData();
|
166
|
-
heightCalcMode = setupCustomCalcMethods(heightCalcMode,
|
167
|
-
widthCalcMode = setupCustomCalcMethods(widthCalcMode,
|
166
|
+
heightCalcMode = setupCustomCalcMethods(heightCalcMode, 'height');
|
167
|
+
widthCalcMode = setupCustomCalcMethods(widthCalcMode, 'width');
|
168
168
|
}
|
169
|
-
log(
|
169
|
+
log('TargetOrigin for parent set to: ' + targetOriginDefault);
|
170
170
|
}
|
171
171
|
function chkCSS(attr, value) {
|
172
|
-
if (-1 !== value.indexOf(
|
173
|
-
warn(
|
174
|
-
value =
|
172
|
+
if (-1 !== value.indexOf('-')) {
|
173
|
+
warn('Negative CSS value ignored for ' + attr);
|
174
|
+
value = '';
|
175
175
|
}
|
176
176
|
return value;
|
177
177
|
}
|
178
178
|
function setBodyStyle(attr, value) {
|
179
|
-
if (undefined !== value &&
|
179
|
+
if (undefined !== value && '' !== value && 'null' !== value) {
|
180
180
|
document.body.style[attr] = value;
|
181
|
-
log(
|
181
|
+
log('Body ' + attr + ' set to "' + value + '"');
|
182
182
|
}
|
183
183
|
}
|
184
184
|
function setMargin() {
|
185
185
|
// If called via V1 script, convert bodyMargin from int to str
|
186
|
-
if (undefined === bodyMarginStr) bodyMarginStr = bodyMargin +
|
187
|
-
setBodyStyle(
|
186
|
+
if (undefined === bodyMarginStr) bodyMarginStr = bodyMargin + 'px';
|
187
|
+
setBodyStyle('margin', chkCSS('margin', bodyMarginStr));
|
188
188
|
}
|
189
189
|
function stopInfiniteResizingOfIFrame() {
|
190
|
-
document.documentElement.style.height =
|
191
|
-
document.body.style.height =
|
190
|
+
document.documentElement.style.height = '';
|
191
|
+
document.body.style.height = '';
|
192
192
|
log('HTML & body height set to "auto"');
|
193
193
|
}
|
194
194
|
function manageTriggerEvent(options) {
|
@@ -212,124 +212,124 @@ var $b2e1fd3e30ab1f5c$exports = {};
|
|
212
212
|
options.eventName = options.eventNames[0];
|
213
213
|
options.eventNames.map(listener[options.method]);
|
214
214
|
} else listener[options.method](options.eventName);
|
215
|
-
log(capitalizeFirstLetter(options.method) +
|
215
|
+
log(capitalizeFirstLetter(options.method) + ' event listener: ' + options.eventType);
|
216
216
|
}
|
217
217
|
function manageEventListeners(method) {
|
218
218
|
manageTriggerEvent({
|
219
219
|
method: method,
|
220
|
-
eventType:
|
220
|
+
eventType: 'Animation Start',
|
221
221
|
eventNames: [
|
222
|
-
|
223
|
-
|
222
|
+
'animationstart',
|
223
|
+
'webkitAnimationStart'
|
224
224
|
]
|
225
225
|
});
|
226
226
|
manageTriggerEvent({
|
227
227
|
method: method,
|
228
|
-
eventType:
|
228
|
+
eventType: 'Animation Iteration',
|
229
229
|
eventNames: [
|
230
|
-
|
231
|
-
|
230
|
+
'animationiteration',
|
231
|
+
'webkitAnimationIteration'
|
232
232
|
]
|
233
233
|
});
|
234
234
|
manageTriggerEvent({
|
235
235
|
method: method,
|
236
|
-
eventType:
|
236
|
+
eventType: 'Animation End',
|
237
237
|
eventNames: [
|
238
|
-
|
239
|
-
|
238
|
+
'animationend',
|
239
|
+
'webkitAnimationEnd'
|
240
240
|
]
|
241
241
|
});
|
242
242
|
manageTriggerEvent({
|
243
243
|
method: method,
|
244
|
-
eventType:
|
245
|
-
eventName:
|
244
|
+
eventType: 'Input',
|
245
|
+
eventName: 'input'
|
246
246
|
});
|
247
247
|
manageTriggerEvent({
|
248
248
|
method: method,
|
249
|
-
eventType:
|
250
|
-
eventName:
|
249
|
+
eventType: 'Mouse Up',
|
250
|
+
eventName: 'mouseup'
|
251
251
|
});
|
252
252
|
manageTriggerEvent({
|
253
253
|
method: method,
|
254
|
-
eventType:
|
255
|
-
eventName:
|
254
|
+
eventType: 'Mouse Down',
|
255
|
+
eventName: 'mousedown'
|
256
256
|
});
|
257
257
|
manageTriggerEvent({
|
258
258
|
method: method,
|
259
|
-
eventType:
|
260
|
-
eventName:
|
259
|
+
eventType: 'Orientation Change',
|
260
|
+
eventName: 'orientationchange'
|
261
261
|
});
|
262
262
|
manageTriggerEvent({
|
263
263
|
method: method,
|
264
|
-
eventType:
|
264
|
+
eventType: 'Print',
|
265
265
|
eventNames: [
|
266
|
-
|
267
|
-
|
266
|
+
'afterprint',
|
267
|
+
'beforeprint'
|
268
268
|
]
|
269
269
|
});
|
270
270
|
manageTriggerEvent({
|
271
271
|
method: method,
|
272
|
-
eventType:
|
273
|
-
eventName:
|
272
|
+
eventType: 'Ready State Change',
|
273
|
+
eventName: 'readystatechange'
|
274
274
|
});
|
275
275
|
manageTriggerEvent({
|
276
276
|
method: method,
|
277
|
-
eventType:
|
278
|
-
eventName:
|
277
|
+
eventType: 'Touch Start',
|
278
|
+
eventName: 'touchstart'
|
279
279
|
});
|
280
280
|
manageTriggerEvent({
|
281
281
|
method: method,
|
282
|
-
eventType:
|
283
|
-
eventName:
|
282
|
+
eventType: 'Touch End',
|
283
|
+
eventName: 'touchend'
|
284
284
|
});
|
285
285
|
manageTriggerEvent({
|
286
286
|
method: method,
|
287
|
-
eventType:
|
288
|
-
eventName:
|
287
|
+
eventType: 'Touch Cancel',
|
288
|
+
eventName: 'touchcancel'
|
289
289
|
});
|
290
290
|
manageTriggerEvent({
|
291
291
|
method: method,
|
292
|
-
eventType:
|
292
|
+
eventType: 'Transition Start',
|
293
293
|
eventNames: [
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
294
|
+
'transitionstart',
|
295
|
+
'webkitTransitionStart',
|
296
|
+
'MSTransitionStart',
|
297
|
+
'oTransitionStart',
|
298
|
+
'otransitionstart'
|
299
299
|
]
|
300
300
|
});
|
301
301
|
manageTriggerEvent({
|
302
302
|
method: method,
|
303
|
-
eventType:
|
303
|
+
eventType: 'Transition Iteration',
|
304
304
|
eventNames: [
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
305
|
+
'transitioniteration',
|
306
|
+
'webkitTransitionIteration',
|
307
|
+
'MSTransitionIteration',
|
308
|
+
'oTransitionIteration',
|
309
|
+
'otransitioniteration'
|
310
310
|
]
|
311
311
|
});
|
312
312
|
manageTriggerEvent({
|
313
313
|
method: method,
|
314
|
-
eventType:
|
314
|
+
eventType: 'Transition End',
|
315
315
|
eventNames: [
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
316
|
+
'transitionend',
|
317
|
+
'webkitTransitionEnd',
|
318
|
+
'MSTransitionEnd',
|
319
|
+
'oTransitionEnd',
|
320
|
+
'otransitionend'
|
321
321
|
]
|
322
322
|
});
|
323
|
-
if (
|
323
|
+
if ('child' === resizeFrom) manageTriggerEvent({
|
324
324
|
method: method,
|
325
|
-
eventType:
|
326
|
-
eventName:
|
325
|
+
eventType: 'IFrame Resized',
|
326
|
+
eventName: 'resize'
|
327
327
|
});
|
328
328
|
}
|
329
329
|
function checkCalcMode(calcMode, calcModeDefault, modes, type) {
|
330
330
|
if (calcModeDefault !== calcMode) {
|
331
331
|
if (!(calcMode in modes)) {
|
332
|
-
warn(calcMode +
|
332
|
+
warn(calcMode + ' is not a valid option for ' + type + 'CalculationMethod.');
|
333
333
|
calcMode = calcModeDefault;
|
334
334
|
}
|
335
335
|
log(type + ' calculation method set to "' + calcMode + '"');
|
@@ -337,16 +337,16 @@ var $b2e1fd3e30ab1f5c$exports = {};
|
|
337
337
|
return calcMode;
|
338
338
|
}
|
339
339
|
function checkHeightMode() {
|
340
|
-
heightCalcMode = checkCalcMode(heightCalcMode, heightCalcModeDefault, getHeight,
|
340
|
+
heightCalcMode = checkCalcMode(heightCalcMode, heightCalcModeDefault, getHeight, 'height');
|
341
341
|
}
|
342
342
|
function checkWidthMode() {
|
343
|
-
widthCalcMode = checkCalcMode(widthCalcMode, widthCalcModeDefault, getWidth,
|
343
|
+
widthCalcMode = checkCalcMode(widthCalcMode, widthCalcModeDefault, getWidth, 'width');
|
344
344
|
}
|
345
345
|
function startEventListeners() {
|
346
346
|
if (true === autoResize) {
|
347
|
-
manageEventListeners(
|
347
|
+
manageEventListeners('add');
|
348
348
|
setupMutationObserver();
|
349
|
-
} else log(
|
349
|
+
} else log('Auto Resize disabled');
|
350
350
|
}
|
351
351
|
// function stopMsgsToParent() {
|
352
352
|
// log('Disable outgoing messages')
|
@@ -361,7 +361,7 @@ var $b2e1fd3e30ab1f5c$exports = {};
|
|
361
361
|
bodyObserver.disconnect();
|
362
362
|
}
|
363
363
|
function stopEventListeners() {
|
364
|
-
manageEventListeners(
|
364
|
+
manageEventListeners('remove');
|
365
365
|
disconnectMutationObserver();
|
366
366
|
clearInterval(intervalTimer);
|
367
367
|
}
|
@@ -371,11 +371,11 @@ var $b2e1fd3e30ab1f5c$exports = {};
|
|
371
371
|
// if (true === autoResize) stopEventListeners()
|
372
372
|
// }
|
373
373
|
function injectClearFixIntoBodyElement() {
|
374
|
-
var clearFix = document.createElement(
|
375
|
-
clearFix.style.clear =
|
374
|
+
var clearFix = document.createElement('div');
|
375
|
+
clearFix.style.clear = 'both';
|
376
376
|
// Guard against the following having been globally redefined in CSS.
|
377
|
-
clearFix.style.display =
|
378
|
-
clearFix.style.height =
|
377
|
+
clearFix.style.display = 'block';
|
378
|
+
clearFix.style.height = '0';
|
379
379
|
document.body.appendChild(clearFix);
|
380
380
|
}
|
381
381
|
function setupInPageLinks() {
|
@@ -395,33 +395,33 @@ var $b2e1fd3e30ab1f5c$exports = {};
|
|
395
395
|
function findTarget(location) {
|
396
396
|
function jumpToTarget(target) {
|
397
397
|
var jumpPosition = getElementPosition(target);
|
398
|
-
log(
|
399
|
-
sendMsg(jumpPosition.y, jumpPosition.x,
|
398
|
+
log('Moving to in page link (#' + hash + ') at x: ' + jumpPosition.x + ' y: ' + jumpPosition.y);
|
399
|
+
sendMsg(jumpPosition.y, jumpPosition.x, 'scrollToOffset') // X&Y reversed at sendMsg uses height/width
|
400
400
|
;
|
401
401
|
}
|
402
|
-
var hash = location.split(
|
402
|
+
var hash = location.split('#')[1] || location, hashData = decodeURIComponent(hash), target = document.getElementById(hashData) || document.getElementsByName(hashData)[0];
|
403
403
|
if (undefined === target) {
|
404
|
-
log(
|
405
|
-
sendMsg(0, 0,
|
404
|
+
log('In page link (#' + hash + ') not found in iFrame, so sending to parent');
|
405
|
+
sendMsg(0, 0, 'inPageLink', '#' + hash);
|
406
406
|
} else jumpToTarget(target);
|
407
407
|
}
|
408
408
|
function checkLocationHash() {
|
409
409
|
var hash = window.location.hash;
|
410
410
|
var href = window.location.href;
|
411
|
-
if (
|
411
|
+
if ('' !== hash && '#' !== hash) findTarget(href);
|
412
412
|
}
|
413
413
|
function bindAnchors() {
|
414
414
|
function setupLink(el) {
|
415
415
|
function linkClicked(e) {
|
416
416
|
e.preventDefault();
|
417
|
-
/* jshint validthis:true */ findTarget(this.getAttribute(
|
417
|
+
/* jshint validthis:true */ findTarget(this.getAttribute('href'));
|
418
418
|
}
|
419
|
-
if (
|
419
|
+
if ('#' !== el.getAttribute('href')) addEventListener(el, 'click', linkClicked);
|
420
420
|
}
|
421
421
|
Array.prototype.forEach.call(document.querySelectorAll('a[href^="#"]'), setupLink);
|
422
422
|
}
|
423
423
|
function bindLocationHash() {
|
424
|
-
addEventListener(window,
|
424
|
+
addEventListener(window, 'hashchange', checkLocationHash);
|
425
425
|
}
|
426
426
|
function initCheck() {
|
427
427
|
// Check if page loaded with location hash after init resize
|
@@ -430,14 +430,14 @@ var $b2e1fd3e30ab1f5c$exports = {};
|
|
430
430
|
function enableInPageLinks() {
|
431
431
|
/* istanbul ignore else */ // Not testable in phantonJS
|
432
432
|
if (Array.prototype.forEach && document.querySelectorAll) {
|
433
|
-
log(
|
433
|
+
log('Setting up location.hash handlers');
|
434
434
|
bindAnchors();
|
435
435
|
bindLocationHash();
|
436
436
|
initCheck();
|
437
|
-
} else warn(
|
437
|
+
} else warn('In page linking not fully supported in this browser! (See README.md for IE8 workaround)');
|
438
438
|
}
|
439
439
|
if (inPageLinks.enable) enableInPageLinks();
|
440
|
-
else log(
|
440
|
+
else log('In page linking not enabled');
|
441
441
|
return {
|
442
442
|
findTarget: findTarget
|
443
443
|
};
|
@@ -445,17 +445,17 @@ var $b2e1fd3e30ab1f5c$exports = {};
|
|
445
445
|
function setupMouseEvents() {
|
446
446
|
if (mouseEvents !== true) return;
|
447
447
|
function sendMouse(e) {
|
448
|
-
sendMsg(0, 0, e.type, e.screenY +
|
448
|
+
sendMsg(0, 0, e.type, e.screenY + ':' + e.screenX);
|
449
449
|
}
|
450
450
|
function addMouseListener(evt, name) {
|
451
|
-
log(
|
451
|
+
log('Add event listener: ' + name);
|
452
452
|
addEventListener(window.document, evt, sendMouse);
|
453
453
|
}
|
454
|
-
addMouseListener(
|
455
|
-
addMouseListener(
|
454
|
+
addMouseListener('mouseenter', 'Mouse Enter');
|
455
|
+
addMouseListener('mouseleave', 'Mouse Leave');
|
456
456
|
}
|
457
457
|
function setupPublicMethods() {
|
458
|
-
log(
|
458
|
+
log('Enable public methods');
|
459
459
|
win.parentIFrame = {
|
460
460
|
autoResize: function autoResizeF(resize) {
|
461
461
|
if (true === resize && false === autoResize) {
|
@@ -465,41 +465,41 @@ var $b2e1fd3e30ab1f5c$exports = {};
|
|
465
465
|
autoResize = false;
|
466
466
|
stopEventListeners();
|
467
467
|
}
|
468
|
-
sendMsg(0, 0,
|
468
|
+
sendMsg(0, 0, 'autoResize', JSON.stringify(autoResize));
|
469
469
|
return autoResize;
|
470
470
|
},
|
471
471
|
close: function closeF() {
|
472
|
-
sendMsg(0, 0,
|
472
|
+
sendMsg(0, 0, 'close');
|
473
473
|
// teardown()
|
474
474
|
},
|
475
475
|
getId: function getIdF() {
|
476
476
|
return myID;
|
477
477
|
},
|
478
478
|
getPageInfo: function getPageInfoF(callback) {
|
479
|
-
if (
|
479
|
+
if ('function' === typeof callback) {
|
480
480
|
onPageInfo = callback;
|
481
|
-
sendMsg(0, 0,
|
481
|
+
sendMsg(0, 0, 'pageInfo');
|
482
482
|
} else {
|
483
483
|
onPageInfo = function() {};
|
484
|
-
sendMsg(0, 0,
|
484
|
+
sendMsg(0, 0, 'pageInfoStop');
|
485
485
|
}
|
486
486
|
},
|
487
487
|
moveToAnchor: function moveToAnchorF(hash) {
|
488
488
|
inPageLinks.findTarget(hash);
|
489
489
|
},
|
490
490
|
reset: function resetF() {
|
491
|
-
resetIFrame(
|
491
|
+
resetIFrame('parentIFrame.reset');
|
492
492
|
},
|
493
493
|
scrollTo: function scrollToF(x, y) {
|
494
|
-
sendMsg(y, x,
|
494
|
+
sendMsg(y, x, 'scrollTo') // X&Y reversed at sendMsg uses height/width
|
495
495
|
;
|
496
496
|
},
|
497
497
|
scrollToOffset: function scrollToF(x, y) {
|
498
|
-
sendMsg(y, x,
|
498
|
+
sendMsg(y, x, 'scrollToOffset') // X&Y reversed at sendMsg uses height/width
|
499
499
|
;
|
500
500
|
},
|
501
501
|
sendMessage: function sendMessageF(msg, targetOrigin) {
|
502
|
-
sendMsg(0, 0,
|
502
|
+
sendMsg(0, 0, 'message', JSON.stringify(msg), targetOrigin);
|
503
503
|
},
|
504
504
|
setHeightCalculationMethod: function setHeightCalculationMethodF(heightCalculationMethod) {
|
505
505
|
heightCalcMode = heightCalculationMethod;
|
@@ -510,20 +510,20 @@ var $b2e1fd3e30ab1f5c$exports = {};
|
|
510
510
|
checkWidthMode();
|
511
511
|
},
|
512
512
|
setTargetOrigin: function setTargetOriginF(targetOrigin) {
|
513
|
-
log(
|
513
|
+
log('Set targetOrigin: ' + targetOrigin);
|
514
514
|
targetOriginDefault = targetOrigin;
|
515
515
|
},
|
516
516
|
size: function sizeF(customHeight, customWidth) {
|
517
|
-
var valString =
|
518
|
-
sendSize(
|
517
|
+
var valString = '' + (customHeight || '') + (customWidth ? ',' + customWidth : '');
|
518
|
+
sendSize('size', 'parentIFrame.size(' + valString + ')', customHeight, customWidth);
|
519
519
|
}
|
520
520
|
};
|
521
521
|
}
|
522
522
|
function initInterval() {
|
523
523
|
if (0 !== interval) {
|
524
|
-
log(
|
524
|
+
log('setInterval: ' + interval + 'ms');
|
525
525
|
intervalTimer = setInterval(function() {
|
526
|
-
sendSize(
|
526
|
+
sendSize('interval', 'setInterval: ' + interval);
|
527
527
|
}, Math.abs(interval));
|
528
528
|
}
|
529
529
|
}
|
@@ -532,41 +532,41 @@ var $b2e1fd3e30ab1f5c$exports = {};
|
|
532
532
|
function addImageLoadListners(mutation) {
|
533
533
|
function addImageLoadListener(element) {
|
534
534
|
if (false === element.complete) {
|
535
|
-
log(
|
536
|
-
element.addEventListener(
|
537
|
-
element.addEventListener(
|
535
|
+
log('Attach listeners to ' + element.src);
|
536
|
+
element.addEventListener('load', imageLoaded, false);
|
537
|
+
element.addEventListener('error', imageError, false);
|
538
538
|
elements.push(element);
|
539
539
|
}
|
540
540
|
}
|
541
|
-
if (mutation.type ===
|
542
|
-
else if (mutation.type ===
|
541
|
+
if (mutation.type === 'attributes' && mutation.attributeName === 'src') addImageLoadListener(mutation.target);
|
542
|
+
else if (mutation.type === 'childList') Array.prototype.forEach.call(mutation.target.querySelectorAll('img'), addImageLoadListener);
|
543
543
|
}
|
544
544
|
function removeFromArray(element) {
|
545
545
|
elements.splice(elements.indexOf(element), 1);
|
546
546
|
}
|
547
547
|
function removeImageLoadListener(element) {
|
548
|
-
log(
|
549
|
-
element.removeEventListener(
|
550
|
-
element.removeEventListener(
|
548
|
+
log('Remove listeners from ' + element.src);
|
549
|
+
element.removeEventListener('load', imageLoaded, false);
|
550
|
+
element.removeEventListener('error', imageError, false);
|
551
551
|
removeFromArray(element);
|
552
552
|
}
|
553
553
|
function imageEventTriggered(event, type, typeDesc) {
|
554
554
|
removeImageLoadListener(event.target);
|
555
|
-
sendSize(type, typeDesc +
|
555
|
+
sendSize(type, typeDesc + ': ' + event.target.src);
|
556
556
|
}
|
557
557
|
function imageLoaded(event) {
|
558
|
-
imageEventTriggered(event,
|
558
|
+
imageEventTriggered(event, 'imageLoad', 'Image loaded');
|
559
559
|
}
|
560
560
|
function imageError(event) {
|
561
|
-
imageEventTriggered(event,
|
561
|
+
imageEventTriggered(event, 'imageLoadFailed', 'Image load failed');
|
562
562
|
}
|
563
563
|
function mutationObserved(mutations) {
|
564
|
-
sendSize(
|
564
|
+
sendSize('mutationObserver', 'mutationObserver: ' + mutations[0].target + ' ' + mutations[0].type);
|
565
565
|
// Deal with WebKit / Blink asyncing image loading when tags are injected into the page
|
566
566
|
mutations.forEach(addImageLoadListners);
|
567
567
|
}
|
568
568
|
function createMutationObserver() {
|
569
|
-
var target = document.querySelector(
|
569
|
+
var target = document.querySelector('body'), config = {
|
570
570
|
attributes: true,
|
571
571
|
attributeOldValue: false,
|
572
572
|
characterData: true,
|
@@ -575,15 +575,15 @@ var $b2e1fd3e30ab1f5c$exports = {};
|
|
575
575
|
subtree: true
|
576
576
|
};
|
577
577
|
observer = new MutationObserver(mutationObserved);
|
578
|
-
log(
|
578
|
+
log('Create body MutationObserver');
|
579
579
|
observer.observe(target, config);
|
580
580
|
return observer;
|
581
581
|
}
|
582
582
|
var elements = [], MutationObserver = window.MutationObserver || window.WebKitMutationObserver, observer = createMutationObserver();
|
583
583
|
return {
|
584
584
|
disconnect: function() {
|
585
|
-
if (
|
586
|
-
log(
|
585
|
+
if ('disconnect' in observer) {
|
586
|
+
log('Disconnect body MutationObserver');
|
587
587
|
observer.disconnect();
|
588
588
|
elements.forEach(removeImageLoadListener);
|
589
589
|
}
|
@@ -597,7 +597,7 @@ var $b2e1fd3e30ab1f5c$exports = {};
|
|
597
597
|
if (forceIntervalTimer) initInterval();
|
598
598
|
else bodyObserver = setupBodyMutationObserver();
|
599
599
|
} else {
|
600
|
-
log(
|
600
|
+
log('MutationObserver not supported in this browser!');
|
601
601
|
initInterval();
|
602
602
|
}
|
603
603
|
}
|
@@ -614,19 +614,19 @@ var $b2e1fd3e30ab1f5c$exports = {};
|
|
614
614
|
function chkEventThottle(timer) {
|
615
615
|
if (timer > throttledTimer / 2) {
|
616
616
|
throttledTimer = 2 * timer;
|
617
|
-
log(
|
617
|
+
log('Event throttle increased to ' + throttledTimer + 'ms');
|
618
618
|
}
|
619
619
|
}
|
620
620
|
// Idea from https://github.com/guardian/iframe-messenger
|
621
621
|
function getMaxElement(side, elements) {
|
622
622
|
var elementsLength = elements.length, elVal = 0, maxVal = 0, Side = capitalizeFirstLetter(side), timer = Date.now();
|
623
623
|
for(var i = 0; i < elementsLength; i++){
|
624
|
-
elVal = elements[i].getBoundingClientRect()[side] + getComputedStyle(
|
624
|
+
elVal = elements[i].getBoundingClientRect()[side] + getComputedStyle('margin' + Side, elements[i]);
|
625
625
|
if (elVal > maxVal) maxVal = elVal;
|
626
626
|
}
|
627
627
|
timer = Date.now() - timer;
|
628
|
-
log(
|
629
|
-
log(
|
628
|
+
log('Parsed ' + elementsLength + ' HTML elements');
|
629
|
+
log('Element position calculated in ' + timer + 'ms');
|
630
630
|
chkEventThottle(timer);
|
631
631
|
return maxVal;
|
632
632
|
}
|
@@ -640,19 +640,19 @@ var $b2e1fd3e30ab1f5c$exports = {};
|
|
640
640
|
}
|
641
641
|
function getTaggedElements(side, tag) {
|
642
642
|
function noTaggedElementsFound() {
|
643
|
-
warn(
|
644
|
-
return document.querySelectorAll(
|
643
|
+
warn('No tagged elements (' + tag + ') found on page');
|
644
|
+
return document.querySelectorAll('body *');
|
645
645
|
}
|
646
|
-
var elements = document.querySelectorAll(
|
646
|
+
var elements = document.querySelectorAll('[' + tag + ']');
|
647
647
|
if (elements.length === 0) noTaggedElementsFound();
|
648
648
|
return getMaxElement(side, elements);
|
649
649
|
}
|
650
650
|
function getAllElements() {
|
651
|
-
return document.querySelectorAll(
|
651
|
+
return document.querySelectorAll('body *');
|
652
652
|
}
|
653
653
|
var getHeight = {
|
654
654
|
bodyOffset: function getBodyOffsetHeight() {
|
655
|
-
return document.body.offsetHeight + getComputedStyle(
|
655
|
+
return document.body.offsetHeight + getComputedStyle('marginTop') + getComputedStyle('marginBottom');
|
656
656
|
},
|
657
657
|
offset: function() {
|
658
658
|
return getHeight.bodyOffset() // Backwards compatibility
|
@@ -681,10 +681,10 @@ var $b2e1fd3e30ab1f5c$exports = {};
|
|
681
681
|
;
|
682
682
|
},
|
683
683
|
lowestElement: function getBestHeight() {
|
684
|
-
return Math.max(getHeight.bodyOffset() || getHeight.documentElementOffset(), getMaxElement(
|
684
|
+
return Math.max(getHeight.bodyOffset() || getHeight.documentElementOffset(), getMaxElement('bottom', getAllElements()));
|
685
685
|
},
|
686
686
|
taggedElement: function getTaggedElementsHeight() {
|
687
|
-
return getTaggedElements(
|
687
|
+
return getTaggedElements('bottom', 'data-iframe-height');
|
688
688
|
}
|
689
689
|
}, getWidth = {
|
690
690
|
bodyScroll: function getBodyScrollWidth() {
|
@@ -712,10 +712,10 @@ var $b2e1fd3e30ab1f5c$exports = {};
|
|
712
712
|
return Math.min.apply(null, getAllMeasurements(getWidth));
|
713
713
|
},
|
714
714
|
rightMostElement: function rightMostElement() {
|
715
|
-
return getMaxElement(
|
715
|
+
return getMaxElement('right', getAllElements());
|
716
716
|
},
|
717
717
|
taggedElement: function getTaggedElementsWidth() {
|
718
|
-
return getTaggedElements(
|
718
|
+
return getTaggedElements('right', 'data-iframe-width');
|
719
719
|
}
|
720
720
|
};
|
721
721
|
function sizeIFrame(triggerEvent, triggerEventDesc, customHeight, customWidth) {
|
@@ -744,7 +744,7 @@ var $b2e1fd3e30ab1f5c$exports = {};
|
|
744
744
|
return heightCalcMode in resetRequiredMethods || calculateWidth && widthCalcMode in resetRequiredMethods;
|
745
745
|
}
|
746
746
|
function logIgnored() {
|
747
|
-
log(
|
747
|
+
log('No change in size detected');
|
748
748
|
}
|
749
749
|
function checkDownSizing() {
|
750
750
|
if (isForceResizableEvent() && isForceResizableCalcMode()) resetIFrame(triggerEventDesc);
|
@@ -753,7 +753,7 @@ var $b2e1fd3e30ab1f5c$exports = {};
|
|
753
753
|
})) logIgnored();
|
754
754
|
}
|
755
755
|
var currentHeight, currentWidth;
|
756
|
-
if (isSizeChangeDetected() ||
|
756
|
+
if (isSizeChangeDetected() || 'init' === triggerEvent) {
|
757
757
|
lockTrigger();
|
758
758
|
resizeIFrame();
|
759
759
|
} else checkDownSizing();
|
@@ -765,28 +765,28 @@ var $b2e1fd3e30ab1f5c$exports = {};
|
|
765
765
|
reset: 1,
|
766
766
|
resetPage: 1,
|
767
767
|
init: 1
|
768
|
-
})) log(
|
768
|
+
})) log('Trigger event: ' + triggerEventDesc);
|
769
769
|
}
|
770
770
|
function isDoubleFiredEvent() {
|
771
771
|
return triggerLocked && triggerEvent in doubleEventList;
|
772
772
|
}
|
773
|
-
if (isDoubleFiredEvent()) log(
|
773
|
+
if (isDoubleFiredEvent()) log('Trigger event cancelled: ' + triggerEvent);
|
774
774
|
else {
|
775
775
|
recordTrigger();
|
776
|
-
if (triggerEvent ===
|
776
|
+
if (triggerEvent === 'init') sizeIFrame(triggerEvent, triggerEventDesc, customHeight, customWidth);
|
777
777
|
else sizeIFrameThrottled(triggerEvent, triggerEventDesc, customHeight, customWidth);
|
778
778
|
}
|
779
779
|
}
|
780
780
|
function lockTrigger() {
|
781
781
|
if (!triggerLocked) {
|
782
782
|
triggerLocked = true;
|
783
|
-
log(
|
783
|
+
log('Trigger event lock on');
|
784
784
|
}
|
785
785
|
clearTimeout(triggerLockedTimer);
|
786
786
|
triggerLockedTimer = setTimeout(function() {
|
787
787
|
triggerLocked = false;
|
788
|
-
log(
|
789
|
-
log(
|
788
|
+
log('Trigger event lock off');
|
789
|
+
log('--');
|
790
790
|
}, eventCancelTimer);
|
791
791
|
}
|
792
792
|
function triggerReset(triggerEvent) {
|
@@ -797,19 +797,19 @@ var $b2e1fd3e30ab1f5c$exports = {};
|
|
797
797
|
function resetIFrame(triggerEventDesc) {
|
798
798
|
var hcm = heightCalcMode;
|
799
799
|
heightCalcMode = heightCalcModeDefault;
|
800
|
-
log(
|
800
|
+
log('Reset trigger event: ' + triggerEventDesc);
|
801
801
|
lockTrigger();
|
802
|
-
triggerReset(
|
802
|
+
triggerReset('reset');
|
803
803
|
heightCalcMode = hcm;
|
804
804
|
}
|
805
805
|
function sendMsg(height, width, triggerEvent, msg, targetOrigin) {
|
806
806
|
function setTargetOrigin() {
|
807
807
|
if (undefined === targetOrigin) targetOrigin = targetOriginDefault;
|
808
|
-
else log(
|
808
|
+
else log('Message targetOrigin: ' + targetOrigin);
|
809
809
|
}
|
810
810
|
function sendToParent() {
|
811
|
-
var size = height +
|
812
|
-
log(
|
811
|
+
var size = height + ':' + width, message = myID + ':' + size + ':' + triggerEvent + (undefined === msg ? '' : ':' + msg);
|
812
|
+
log('Sending message to host page (' + message + ')');
|
813
813
|
target.postMessage(msgID + message, targetOrigin);
|
814
814
|
}
|
815
815
|
if (true === sendPermit) {
|
@@ -829,14 +829,14 @@ var $b2e1fd3e30ab1f5c$exports = {};
|
|
829
829
|
}, eventCancelTimer);
|
830
830
|
},
|
831
831
|
reset: function resetFromParent() {
|
832
|
-
if (initLock) log(
|
832
|
+
if (initLock) log('Page reset ignored by init');
|
833
833
|
else {
|
834
|
-
log(
|
835
|
-
triggerReset(
|
834
|
+
log('Page size reset by host page');
|
835
|
+
triggerReset('resetPage');
|
836
836
|
}
|
837
837
|
},
|
838
838
|
resize: function resizeFromParent() {
|
839
|
-
sendSize(
|
839
|
+
sendSize('resizeParent', 'Parent window requested size check');
|
840
840
|
},
|
841
841
|
moveToAnchor: function moveToAnchorF() {
|
842
842
|
inPageLinks.findTarget(getData());
|
@@ -846,35 +846,35 @@ var $b2e1fd3e30ab1f5c$exports = {};
|
|
846
846
|
},
|
847
847
|
pageInfo: function pageInfoFromParent() {
|
848
848
|
var msgBody = getData();
|
849
|
-
log(
|
849
|
+
log('PageInfoFromParent called from parent: ' + msgBody);
|
850
850
|
onPageInfo(JSON.parse(msgBody));
|
851
|
-
log(
|
851
|
+
log(' --');
|
852
852
|
},
|
853
853
|
message: function messageFromParent() {
|
854
854
|
var msgBody = getData();
|
855
|
-
log(
|
855
|
+
log('onMessage called from parent: ' + msgBody);
|
856
856
|
// eslint-disable-next-line sonarjs/no-extra-arguments
|
857
857
|
onMessage(JSON.parse(msgBody));
|
858
|
-
log(
|
858
|
+
log(' --');
|
859
859
|
}
|
860
860
|
};
|
861
861
|
function isMessageForUs() {
|
862
|
-
return msgID === (
|
862
|
+
return msgID === ('' + event.data).slice(0, msgIdLen) // ''+ Protects against non-string messages
|
863
863
|
;
|
864
864
|
}
|
865
865
|
function getMessageType() {
|
866
|
-
return event.data.split(
|
866
|
+
return event.data.split(']')[1].split(':')[0];
|
867
867
|
}
|
868
868
|
function getData() {
|
869
|
-
return event.data.slice(event.data.indexOf(
|
869
|
+
return event.data.slice(event.data.indexOf(':') + 1);
|
870
870
|
}
|
871
871
|
function isMiddleTier() {
|
872
|
-
return !(0, $b2e1fd3e30ab1f5c$exports) &&
|
872
|
+
return !(0, $b2e1fd3e30ab1f5c$exports) && 'iFrameResize' in window || window.jQuery !== undefined && 'iFrameResize' in window.jQuery.prototype;
|
873
873
|
}
|
874
874
|
function isInitMsg() {
|
875
875
|
// Test if this message is from a child below us. This is an ugly test, however, updating
|
876
876
|
// the message format would break backwards compatibility.
|
877
|
-
return event.data.split(
|
877
|
+
return event.data.split(':')[2] in {
|
878
878
|
true: 1,
|
879
879
|
false: 1
|
880
880
|
};
|
@@ -882,7 +882,7 @@ var $b2e1fd3e30ab1f5c$exports = {};
|
|
882
882
|
function callFromParent() {
|
883
883
|
var messageType = getMessageType();
|
884
884
|
if (messageType in processRequestFromParent) processRequestFromParent[messageType]();
|
885
|
-
else if (!isMiddleTier() && !isInitMsg()) warn(
|
885
|
+
else if (!isMiddleTier() && !isInitMsg()) warn('Unexpected message (' + event.data + ')');
|
886
886
|
}
|
887
887
|
function processMessage() {
|
888
888
|
if (false === firstRun) callFromParent();
|
@@ -894,10 +894,10 @@ var $b2e1fd3e30ab1f5c$exports = {};
|
|
894
894
|
// Normally the parent kicks things off when it detects the iFrame has loaded.
|
895
895
|
// If this script is async-loaded, then tell parent page to retry init.
|
896
896
|
function chkLateLoaded() {
|
897
|
-
if (
|
897
|
+
if ('loading' !== document.readyState) window.parent.postMessage('[iFrameResizerChild]Ready', '*');
|
898
898
|
}
|
899
|
-
addEventListener(window,
|
900
|
-
addEventListener(window,
|
899
|
+
addEventListener(window, 'message', receiver);
|
900
|
+
addEventListener(window, 'readystatechange', chkLateLoaded);
|
901
901
|
chkLateLoaded();
|
902
902
|
})();
|
903
903
|
|