j1-template 2020.0.8 → 2020.0.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/_includes/themes/j1/blocks/ads/ad.html +64 -0
- data/_includes/themes/j1/blocks/footer/boxes/links_box.proc +1 -1
- data/_includes/themes/j1/layouts/content_generator_blog_archive.html +3 -2
- data/_includes/themes/j1/layouts/content_generator_collection.html +3 -2
- data/_includes/themes/j1/layouts/content_generator_page.html +3 -2
- data/_includes/themes/j1/layouts/content_generator_post.html +12 -12
- data/_includes/themes/j1/layouts/layout_metadata_generator.html +134 -4
- data/_includes/themes/j1/modules/connectors/ad/custom-provider.html +6 -9
- data/_includes/themes/j1/modules/connectors/ad/google-adsense.html +9 -6
- data/_includes/themes/j1/modules/connectors/ads +3 -6
- data/_includes/themes/j1/modules/navigator/generator.html +6 -7
- data/_includes/themes/j1/modules/navigator/procedures/topsearch.proc +10 -5
- data/_includes/themes/j1/procedures/layouts/module_writer.proc +1 -1
- data/_includes/themes/j1/procedures/posts/collate_timeline.proc +7 -7
- data/_layouts/default.html +18 -13
- data/assets/data/authclient.html +18 -8
- data/assets/data/banner.html +23 -23
- data/assets/data/carousel.json +30 -21
- data/assets/data/cookie_consent.html +79 -51
- data/assets/data/footer.html +14 -5
- data/assets/data/galleries.json +90 -81
- data/assets/data/gallery_customizer.html +19 -10
- data/assets/data/mdi_icons.json +55 -1
- data/assets/data/menu.html +14 -7
- data/assets/data/mmenu.html +47 -94
- data/assets/data/mmenu_sidebar.html +40 -44
- data/assets/data/mmenu_toc.html +19 -3
- data/assets/data/panel.html +30 -23
- data/assets/data/quicklinks.html +13 -3
- data/assets/data/{search.yml → search.json} +44 -14
- data/assets/data/ssm.html +20 -9
- data/assets/data/themes.json +17 -6
- data/assets/data/twa_v1.json +7034 -6978
- data/assets/themes/j1/adapter/js/algolia.js +34 -17
- data/assets/themes/j1/adapter/js/attic.js +66 -46
- data/assets/themes/j1/adapter/js/carousel.js +43 -22
- data/assets/themes/j1/adapter/js/clipboard.js +230 -0
- data/assets/themes/j1/adapter/js/cookie_consent.js +21 -4
- data/assets/themes/j1/adapter/js/framer.js +18 -3
- data/assets/themes/j1/adapter/js/gallery_customizer.js +27 -10
- data/assets/themes/j1/adapter/js/j1.js +342 -757
- data/assets/themes/j1/adapter/js/{justified_gallery.js → jf_gallery.js} +64 -38
- data/assets/themes/j1/adapter/js/lightbox.js +20 -3
- data/assets/themes/j1/adapter/js/logger.js +23 -6
- data/assets/themes/j1/adapter/js/mdb.js +167 -0
- data/assets/themes/j1/adapter/js/mmenu.js +33 -30
- data/assets/themes/j1/adapter/js/navigator.js +126 -140
- data/assets/themes/j1/adapter/js/searcher.js +22 -4
- data/assets/themes/j1/adapter/js/ssm.js +84 -63
- data/assets/themes/j1/adapter/js/themer.js +35 -53
- data/assets/themes/j1/adapter/js/toccer.js +29 -14
- data/assets/themes/j1/core/css/theme_extensions.css +120 -1230
- data/assets/themes/j1/core/css/theme_extensions.min.css +1 -1
- data/assets/themes/j1/core/css/uno.css +256 -1288
- data/assets/themes/j1/core/css/uno.min.css +1 -1
- data/assets/themes/j1/core/css/vendor.css +7 -57
- data/assets/themes/j1/core/css/vendor.min.css +2 -2
- data/assets/themes/j1/core/js/template.js +16 -86
- data/assets/themes/j1/core/js/template.js.map +1 -1
- data/assets/themes/j1/core/js/template.min.js +1 -1
- data/assets/themes/j1/extensions/bsDatepicker/css/datepicker.css +203 -0
- data/assets/themes/j1/extensions/bsDatepicker/css/theme/uno.css +235 -0
- data/assets/themes/j1/extensions/bsDatepicker/js/datepicker.js +509 -0
- data/assets/themes/j1/extensions/bsDatepicker/less/datepicker.less +122 -0
- data/assets/themes/j1/extensions/bsThemeSwitcher/js/switcher.js +425 -0
- data/assets/themes/j1/extensions/bsThemeSwitcher/js/switcher.min.js +20 -0
- data/assets/themes/j1/extensions/clipboard/LICENSE +20 -0
- data/assets/themes/j1/extensions/clipboard/css/theme/uno.css +52 -0
- data/assets/themes/j1/extensions/clipboard/css/theme/uno.min.css +52 -0
- data/assets/themes/j1/extensions/clipboard/js/clipboard.js +975 -0
- data/assets/themes/j1/extensions/clipboard/js/clipboard.min.js +7 -0
- data/assets/themes/j1/extensions/{iconify → iconifyAPI}/js/iconify.min.js +0 -0
- data/assets/themes/j1/extensions/iframeResizer/LICENSE +21 -0
- data/assets/themes/j1/extensions/iframeResizer/examples/frame.absolute.html +127 -0
- data/assets/themes/j1/extensions/iframeResizer/examples/frame.content.html +157 -0
- data/assets/themes/j1/extensions/iframeResizer/examples/frame.hover.html +68 -0
- data/assets/themes/j1/extensions/iframeResizer/examples/frame.nested.html +100 -0
- data/assets/themes/j1/extensions/iframeResizer/examples/frame.textarea.html +45 -0
- data/assets/themes/j1/extensions/iframeResizer/examples/frame.tolerance.html +113 -0
- data/assets/themes/j1/extensions/iframeResizer/examples/index.html +83 -0
- data/assets/themes/j1/extensions/iframeResizer/examples/two.html +88 -0
- data/assets/themes/j1/extensions/iframeResizer/js/client/iframeResizer.contentWindow.js +1288 -0
- data/assets/themes/j1/extensions/iframeResizer/js/client/iframeResizer.contentWindow.map +1 -0
- data/assets/themes/j1/extensions/iframeResizer/js/client/iframeResizer.contentWindow.min.js +10 -0
- data/assets/themes/j1/extensions/iframeResizer/js/iframeResizer.js +1390 -0
- data/assets/themes/j1/extensions/iframeResizer/js/iframeResizer.map +1 -0
- data/assets/themes/j1/extensions/iframeResizer/js/iframeResizer.min.js +9 -0
- data/assets/themes/j1/extensions/jqMouseWheel/README.md +76 -0
- data/assets/themes/j1/extensions/jqMouseWheel/js/jquery.mousewheel.js +221 -0
- data/assets/themes/j1/extensions/jqMouseWheel/js/jquery.mousewheel.min.js +9 -0
- data/assets/themes/j1/extensions/{justified_gallery → justifiedGallery}/LICENSE +0 -0
- data/assets/themes/j1/extensions/{justified_gallery → justifiedGallery}/README.md +0 -0
- data/assets/themes/j1/extensions/{justified_gallery → justifiedGallery}/_versions/v3.7.0/css/justifiedGallery.css +0 -0
- data/assets/themes/j1/extensions/{justified_gallery → justifiedGallery}/_versions/v3.7.0/css/justifiedGallery.min.css +0 -0
- data/assets/themes/j1/extensions/{justified_gallery → justifiedGallery}/_versions/v3.7.0/css/theme/uno.css +0 -0
- data/assets/themes/j1/extensions/{justified_gallery → justifiedGallery}/_versions/v3.7.0/js/justifiedGallery.3.7.0.js +0 -0
- data/assets/themes/j1/extensions/{justified_gallery → justifiedGallery}/_versions/v3.7.0/js/justifiedGallery.js +0 -0
- data/assets/themes/j1/extensions/{justified_gallery → justifiedGallery}/_versions/v3.7.0/js/justifiedGallery.min.js +0 -0
- data/assets/themes/j1/extensions/{justified_gallery → justifiedGallery}/_versions/v3.7.0/less/.csslintrc +0 -0
- data/assets/themes/j1/extensions/{justified_gallery → justifiedGallery}/_versions/v3.7.0/less/justifiedGallery.less +0 -0
- data/assets/themes/j1/extensions/{justified_gallery → justifiedGallery}/_versions/v4.0.0/css/justifiedGallery.css +0 -0
- data/assets/themes/j1/extensions/{justified_gallery → justifiedGallery}/_versions/v4.0.0/css/justifiedGallery.min.css +0 -0
- data/assets/themes/j1/extensions/{justified_gallery → justifiedGallery}/_versions/v4.0.0/css/theme/uno.css +0 -0
- data/assets/themes/j1/extensions/{justified_gallery → justifiedGallery}/_versions/v4.0.0/js/jquery.justifiedGallery.js +0 -0
- data/assets/themes/j1/extensions/{justified_gallery → justifiedGallery}/_versions/v4.0.0/js/jquery.justifiedGallery.min.js +0 -0
- data/assets/themes/j1/extensions/{justified_gallery → justifiedGallery}/css/justifiedGallery.css +0 -0
- data/assets/themes/j1/extensions/{justified_gallery → justifiedGallery}/css/justifiedGallery.min.css +0 -0
- data/assets/themes/j1/extensions/{justified_gallery → justifiedGallery}/css/theme/uno.css +0 -0
- data/assets/themes/j1/extensions/{justified_gallery → justifiedGallery}/css/theme/uno.min.css +0 -0
- data/assets/themes/j1/extensions/{justified_gallery → justifiedGallery}/js/justifiedGallery.js +0 -0
- data/assets/themes/j1/extensions/{justified_gallery → justifiedGallery}/js/justifiedGallery.min.js +0 -0
- data/assets/themes/j1/extensions/{light_gallery → lightGallery}/css/core/lg-fb-comment-box.css +0 -0
- data/assets/themes/j1/extensions/{light_gallery → lightGallery}/css/core/lg-fb-comment-box.min.css +0 -0
- data/assets/themes/j1/extensions/{light_gallery → lightGallery}/css/core/lg-transitions.css +0 -0
- data/assets/themes/j1/extensions/{light_gallery → lightGallery}/css/core/lg-transitions.min.css +0 -0
- data/assets/themes/j1/extensions/{light_gallery → lightGallery}/css/core/lightgallery.css +0 -0
- data/assets/themes/j1/extensions/{light_gallery → lightGallery}/css/core/lightgallery.min.css +0 -0
- data/assets/themes/j1/extensions/{light_gallery → lightGallery}/css/fonts/lg.eot +0 -0
- data/assets/themes/j1/extensions/{light_gallery → lightGallery}/css/fonts/lg.svg +0 -0
- data/assets/themes/j1/extensions/{light_gallery → lightGallery}/css/fonts/lg.ttf +0 -0
- data/assets/themes/j1/extensions/{light_gallery → lightGallery}/css/fonts/lg.woff +0 -0
- data/assets/themes/j1/extensions/{light_gallery → lightGallery}/css/img/loading.gif +0 -0
- data/assets/themes/j1/extensions/{light_gallery → lightGallery}/css/img/video-play.png +0 -0
- data/assets/themes/j1/extensions/{light_gallery → lightGallery}/css/img/vimeo-play.png +0 -0
- data/assets/themes/j1/extensions/{light_gallery → lightGallery}/css/img/youtube-play.png +0 -0
- data/assets/themes/j1/extensions/{light_gallery → lightGallery}/css/themes/icons/animation-w.png +0 -0
- data/assets/themes/j1/extensions/{light_gallery → lightGallery}/css/themes/icons/customize-w.png +0 -0
- data/assets/themes/j1/extensions/{light_gallery → lightGallery}/css/themes/icons/dynamic-w.png +0 -0
- data/assets/themes/j1/extensions/{light_gallery → lightGallery}/css/themes/icons/facebook-icon.svg +0 -0
- data/assets/themes/j1/extensions/{light_gallery → lightGallery}/css/themes/icons/googleplus-icon.svg +0 -0
- data/assets/themes/j1/extensions/{light_gallery → lightGallery}/css/themes/icons/html5-w.png +0 -0
- data/assets/themes/j1/extensions/{light_gallery → lightGallery}/css/themes/icons/linked-in.png +0 -0
- data/assets/themes/j1/extensions/{light_gallery → lightGallery}/css/themes/icons/module-w.png +0 -0
- data/assets/themes/j1/extensions/{light_gallery → lightGallery}/css/themes/icons/play-button.png +0 -0
- data/assets/themes/j1/extensions/{light_gallery → lightGallery}/css/themes/icons/responsive-w.png +0 -0
- data/assets/themes/j1/extensions/{light_gallery → lightGallery}/css/themes/icons/thumb-w.png +0 -0
- data/assets/themes/j1/extensions/{light_gallery → lightGallery}/css/themes/icons/touch-w.png +0 -0
- data/assets/themes/j1/extensions/{light_gallery → lightGallery}/css/themes/icons/twitter-icon.svg +0 -0
- data/assets/themes/j1/extensions/{light_gallery → lightGallery}/css/themes/icons/twitter.png +0 -0
- data/assets/themes/j1/extensions/{light_gallery → lightGallery}/css/themes/icons/video1-w.png +0 -0
- data/assets/themes/j1/extensions/{light_gallery → lightGallery}/css/themes/icons/zoom-w.png +0 -0
- data/assets/themes/j1/extensions/{light_gallery → lightGallery}/css/themes/icons/zoom.png +0 -0
- data/assets/themes/j1/extensions/{light_gallery → lightGallery}/css/themes/uno.css +1 -1
- data/assets/themes/j1/extensions/{light_gallery → lightGallery}/css/themes/uno.min.css +1 -1
- data/assets/themes/j1/extensions/{light_gallery → lightGallery}/js/core/lightgallery.js +0 -0
- data/assets/themes/j1/extensions/{light_gallery → lightGallery}/js/core/lightgallery.min.js +0 -0
- data/assets/themes/j1/extensions/{light_gallery → lightGallery}/js/modules/j1/j1-video.js +0 -0
- data/assets/themes/j1/extensions/{light_gallery → lightGallery}/js/modules/j1/j1-video.min.js +0 -0
- data/assets/themes/j1/extensions/{light_gallery → lightGallery}/js/modules/lg-autoplay.js +0 -0
- data/assets/themes/j1/extensions/{light_gallery → lightGallery}/js/modules/lg-autoplay.min.js +0 -0
- data/assets/themes/j1/extensions/{light_gallery → lightGallery}/js/modules/lg-fullscreen.js +0 -0
- data/assets/themes/j1/extensions/{light_gallery → lightGallery}/js/modules/lg-fullscreen.min.js +0 -0
- data/assets/themes/j1/extensions/{light_gallery → lightGallery}/js/modules/lg-hash.js +0 -0
- data/assets/themes/j1/extensions/{light_gallery → lightGallery}/js/modules/lg-hash.min.js +0 -0
- data/assets/themes/j1/extensions/{light_gallery → lightGallery}/js/modules/lg-pager.js +0 -0
- data/assets/themes/j1/extensions/{light_gallery → lightGallery}/js/modules/lg-pager.min.js +0 -0
- data/assets/themes/j1/extensions/{light_gallery → lightGallery}/js/modules/lg-share.js +0 -0
- data/assets/themes/j1/extensions/{light_gallery → lightGallery}/js/modules/lg-share.min.js +0 -0
- data/assets/themes/j1/extensions/{light_gallery → lightGallery}/js/modules/lg-thumbnail.js +0 -0
- data/assets/themes/j1/extensions/{light_gallery → lightGallery}/js/modules/lg-thumbnail.min.js +0 -0
- data/assets/themes/j1/extensions/{light_gallery → lightGallery}/js/modules/lg-video.js +0 -0
- data/assets/themes/j1/extensions/{light_gallery → lightGallery}/js/modules/lg-video.min.js +0 -0
- data/assets/themes/j1/extensions/{light_gallery → lightGallery}/js/modules/lg-zoom.js +0 -0
- data/assets/themes/j1/extensions/{light_gallery → lightGallery}/js/modules/lg-zoom.min.js +0 -0
- data/assets/themes/j1/extensions/lightbox/LICENSE +22 -0
- data/assets/themes/j1/extensions/lightbox/css/lightbox.css +224 -0
- data/assets/themes/j1/extensions/lightbox/css/lightbox.min.css +21 -0
- data/assets/themes/j1/extensions/lightbox/css/theme/uno.css +25 -0
- data/assets/themes/j1/extensions/lightbox/css/theme/uno.min.css +26 -0
- data/{lib/starter_web/assets/images/modules/lightbox → assets/themes/j1/extensions/lightbox/images}/close.png +0 -0
- data/{lib/starter_web/assets/images/modules/lightbox → assets/themes/j1/extensions/lightbox/images}/loading.gif +0 -0
- data/{lib/starter_web/assets/images/modules/lightbox → assets/themes/j1/extensions/lightbox/images}/next.png +0 -0
- data/{lib/starter_web/assets/images/modules/lightbox → assets/themes/j1/extensions/lightbox/images}/prev.png +0 -0
- data/assets/themes/j1/extensions/lightbox/js/lightbox.js +583 -0
- data/assets/themes/j1/extensions/lightbox/js/lightbox.min.js +35 -0
- data/assets/themes/j1/extensions/mmenuLight/css/mmenu.css +392 -0
- data/assets/themes/j1/extensions/mmenuLight/css/mmenu.min.css +393 -0
- data/assets/themes/j1/extensions/mmenuLight/css/theme/uno.css +170 -0
- data/assets/themes/j1/extensions/mmenuLight/css/theme/uno.min.css +169 -0
- data/assets/themes/j1/extensions/mmenuLight/js/mmenu.js +30 -0
- data/assets/themes/j1/extensions/noUISlider/LICENSE +13 -0
- data/assets/themes/j1/extensions/noUISlider/css/nouislider.css +260 -0
- data/assets/themes/j1/extensions/noUISlider/css/nouislider.min.css +1 -0
- data/assets/themes/j1/extensions/noUISlider/js/nouislider.js +2312 -0
- data/assets/themes/j1/extensions/noUISlider/js/nouislider.min.js +3 -0
- data/assets/themes/j1/extensions/twemoji/js/LICENSE +21 -0
- data/assets/themes/j1/extensions/twemoji/js/picker/LICENSE +21 -0
- data/assets/themes/j1/extensions/twemoji/js/picker/twemoji-picker.js +21 -0
- data/assets/themes/j1/extensions/twemoji/js/picker/twemoji-picker.min.js +21 -0
- data/assets/themes/j1/extensions/twemoji/js/twemoji.js +590 -0
- data/assets/themes/j1/extensions/twemoji/js/twemoji.min.js +25 -0
- data/lib/j1/version.rb +3 -3
- data/lib/starter_web/Gemfile +7 -1
- data/lib/starter_web/_config.yml +9 -8
- data/lib/starter_web/_data/_defaults/resources.yml +13 -13
- data/lib/starter_web/_data/blocks/banner.yml +21 -29
- data/lib/starter_web/_data/blocks/footer.yml +10 -3
- data/lib/starter_web/_data/blocks/panel.yml +13 -13
- data/lib/starter_web/_data/layouts/default.yml +10 -0
- data/lib/starter_web/_data/layouts/home.yml +7 -7
- data/lib/starter_web/_data/layouts/page.yml +15 -16
- data/lib/starter_web/_data/modules/advertising.yml +48 -0
- data/lib/starter_web/_data/modules/attics.yml +2 -38
- data/lib/starter_web/_data/modules/cookie_consent.yml +3 -95
- data/lib/starter_web/_data/modules/defaults/attics.yml +16 -15
- data/lib/starter_web/_data/modules/defaults/cookie_consent.yml +75 -12
- data/lib/starter_web/_data/modules/defaults/jekyll_search.yml +9 -9
- data/lib/starter_web/_data/modules/defaults/navigator.yml +56 -21
- data/lib/starter_web/_data/modules/defaults/ssm.yml +3 -3
- data/lib/starter_web/_data/modules/defaults/toccer.yml +4 -8
- data/lib/starter_web/_data/modules/jekyll_search.yml +3 -21
- data/lib/starter_web/_data/modules/navigator.yml +1 -1
- data/lib/starter_web/_data/modules/navigator_menu.yml +4 -0
- data/lib/starter_web/_data/modules/ssm.yml +9 -0
- data/lib/starter_web/_data/modules/themer.yml +2 -3
- data/lib/starter_web/_data/modules/toccer.yml +6 -11
- data/lib/starter_web/_data/resources.yml +240 -112
- data/lib/starter_web/_data/template_settings.yml +117 -6
- data/lib/starter_web/_plugins/asciidoctor-extensions/fab-icon-inline.rb +1 -1
- data/lib/starter_web/_plugins/asciidoctor-extensions/fas-icon-inline.rb +2 -2
- data/lib/starter_web/_plugins/asciidoctor-extensions/iconify-icon-inline.rb +2 -2
- data/lib/starter_web/_plugins/asciidoctor-extensions/mdi-icon-inline.rb +2 -2
- data/lib/starter_web/_plugins/asciidoctor-extensions/twitter-emoji-inline.rb +2 -2
- data/lib/starter_web/_plugins/minifyJS.rb +54 -0
- data/lib/starter_web/_plugins/{uglify.rb → minifyJSON.rb} +15 -9
- data/lib/starter_web/assets/images/modules/attics/admin-dashboard-bootstrap-1280x600.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/alex-holyoake-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/anaya-katlego-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/antonella-lombardi-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/antonino-visalli-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/banner/library-1920x800-bw.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/banner/signpost-1920x800-bw.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/banner/water-journal-1280x600.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/banner/write-1280x600-bw.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/brandon-mowinkel-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/building-blocks-1920x1280-bw.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/cookies-1920x1200-bw.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/daniel-jensen-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/giammarco-boscaro-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/go-up-1920x1280-bw.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/ian-schneider-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/ideas-start-here-1920x1280-bw.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/jason-rosewell-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/jessica-ruscello-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/lianhao-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/library-1920x1280-bw.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/matthaeus-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/nousnou-iwasaki-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/premium-1920x1280-bw.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/robert-v-ruggiero-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/romain-vignes-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/runner-1920x1200-bw.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/spider-web-1920x1200-bw.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/the-place-1920x1280-bw.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/welcome-1920x1280-bw.jpg +0 -0
- data/lib/starter_web/assets/images/modules/carousel/cats/cat-1.jpg +0 -0
- data/lib/starter_web/assets/images/modules/carousel/mega_cities/andreas-brucker_b.jpg +0 -0
- data/lib/starter_web/assets/images/modules/carousel/mega_cities/denys-nevozhai-1_b.jpg +0 -0
- data/lib/starter_web/assets/images/modules/carousel/mega_cities/denys-nevozhai-2_b.jpg +0 -0
- data/lib/starter_web/assets/images/modules/carousel/mega_cities/luca-bravo_b.jpg +0 -0
- data/lib/starter_web/assets/images/modules/carousel/mega_cities/thomas-tucker_b.jpg +0 -0
- data/lib/starter_web/assets/images/modules/gallery/mega_cities/banter-snaps_b.jpg +0 -0
- data/lib/starter_web/assets/images/modules/gallery/mega_cities/denys-nevozhai-1_b.jpg +0 -0
- data/lib/starter_web/assets/images/modules/gallery/mega_cities/denys-nevozhai-2-bw.jpg +0 -0
- data/lib/starter_web/assets/images/modules/gallery/mega_cities/denys-nevozhai-2_b.jpg +0 -0
- data/lib/starter_web/assets/images/modules/gallery/mega_cities/emmad-mazhari_b.jpg +0 -0
- data/lib/starter_web/assets/images/modules/gallery/mega_cities/ethan-brooke_b.jpg +0 -0
- data/lib/starter_web/assets/images/modules/gallery/mega_cities/federico-rizzarelli_b.jpg +0 -0
- data/lib/starter_web/assets/images/modules/gallery/mega_cities/gints-gailis_b.jpg +0 -0
- data/lib/starter_web/assets/images/modules/gallery/mega_cities/johan-mouchet_b.jpg +0 -0
- data/lib/starter_web/assets/images/modules/gallery/mega_cities/luca-bravo_b.jpg +0 -0
- data/lib/starter_web/assets/images/modules/gallery/mega_cities/oskars-sylwan_b.jpg +0 -0
- data/lib/starter_web/assets/images/modules/gallery/mega_cities/steven-diaz_b.jpg +0 -0
- data/lib/starter_web/assets/images/modules/gallery/mega_cities/thomas-tucker-bw.jpg +0 -0
- data/lib/starter_web/assets/images/modules/gallery/mega_cities/thomas-tucker_b.jpg +0 -0
- data/lib/starter_web/index.html +9 -8
- data/lib/starter_web/package.json +1 -1
- data/lib/starter_web/pages/public/clear_button.adoc +121 -0
- data/lib/starter_web/pages/public/learn/examples/floating_ad.adoc +221 -0
- data/lib/starter_web/pages/public/learn/{floating_sidebar.adoc → examples/floating_div.adoc} +60 -50
- data/lib/starter_web/pages/public/learn/kickstarter/web_in_a_day/000_includes/parts.asciidoc +1 -1
- data/lib/starter_web/pages/public/learn/kickstarter/web_in_a_day/100_meet_and_greet_jekyll.adoc +9 -4
- data/lib/starter_web/pages/public/learn/roundtrip/000_bs_tour_api.adoc +2 -2
- data/lib/starter_web/pages/public/learn/roundtrip/000_includes/documents/410_table_3_column.asciidoc +1 -1
- data/lib/starter_web/pages/public/learn/roundtrip/000_includes/documents/419_advanced_modals_html.asciidoc +5 -5
- data/lib/starter_web/pages/public/learn/roundtrip/100_present_images.adoc +2 -2
- data/lib/starter_web/pages/public/learn/roundtrip/200_typography.adoc +4 -3
- data/lib/starter_web/pages/public/learn/roundtrip/300_icon_fonts.adoc +35 -44
- data/lib/starter_web/pages/public/learn/roundtrip/400_asciidoc_extensions.adoc +1 -1
- data/lib/starter_web/pages/public/learn/roundtrip/420_responsive_tables_extensions.adoc +39 -39
- data/lib/starter_web/pages/public/learn/vtutorials/000_includes/documents/410_table_3_column.asciidoc +1 -1
- data/lib/starter_web/pages/public/learn/whats_up.adoc +1 -0
- data/lib/starter_web/pages/public/panels/intro_panel/panel.adoc +54 -48
- data/lib/starter_web/pages/public/previewer/000_includes/tables/mdi_icons/100_absolute_sizes.asciidoc +1 -1
- data/lib/starter_web/pages/public/previewer/000_includes/tables/mdi_icons/110_bs_grid_sizes.asciidoc +1 -1
- data/lib/starter_web/pages/public/previewer/000_includes/tables/mdi_icons/120_relative_sizes.asciidoc +1 -41
- data/lib/starter_web/pages/public/previewer/000_includes/tables/mdi_icons/200_rotate.asciidoc +1 -1
- data/lib/starter_web/pages/public/previewer/000_includes/tables/mdi_icons/300_flip.asciidoc +1 -1
- data/lib/starter_web/pages/public/previewer/000_includes/tables/mdi_icons/400_spin_pulsed.asciidoc +1 -1
- data/lib/starter_web/pages/public/previewer/000_includes/tables/mdi_icons/500_bw_color_palette.asciidoc +1 -1
- data/lib/starter_web/pages/public/previewer/000_includes/tables/mdi_icons/510_bs_color_palette.asciidoc +1 -1
- data/lib/starter_web/pages/public/previewer/000_includes/tables/mdi_icons/600_md_color_palette.asciidoc +1 -1
- data/lib/starter_web/pages/public/previewer/000_includes/tables/mdi_icons/601_md_color_palette_indigo.asciidoc +1 -1
- data/lib/starter_web/pages/public/previewer/000_includes/tables/mdi_icons/602_md_color_palette_pink.asciidoc +1 -1
- data/lib/starter_web/pages/public/previewer/000_includes/tables/twitter_emoji/100_bs_sizes.asciidoc +1 -1
- data/lib/starter_web/pages/public/previewer/000_includes/tables/twitter_emoji/100_relative_sizes.asciidoc +1 -1
- data/lib/starter_web/pages/public/previewer/000_includes/tables/twitter_emoji/200_rotate.asciidoc +1 -1
- data/lib/starter_web/pages/public/previewer/000_includes/tables/twitter_emoji/300_flip.asciidoc +1 -1
- data/lib/starter_web/pages/public/previewer/000_includes/tables/twitter_emoji/400_spin_pulsed.asciidoc +1 -1
- data/lib/starter_web/pages/public/previewer/bootstrap_theme.adoc +672 -863
- data/lib/starter_web/pages/public/previewer/iframer.adoc +15 -14
- data/lib/starter_web/pages/public/previewer/justified_gallery.html +1 -1
- data/lib/starter_web/pages/public/previewer/mdb_preview/000_includes/attributes.asciidoc +69 -0
- data/lib/starter_web/pages/public/previewer/mdb_preview/000_includes/documents/100_buttons.asciidoc +170 -0
- data/lib/starter_web/pages/public/previewer/mdb_preview/mdb_previewer.adoc +52 -0
- data/lib/starter_web/pages/public/previewer/mdi_icons_preview.adoc +1 -1
- data/lib/starter_web/pages/public/previewer/twitter_emoji_preview.adoc +2 -2
- data/lib/starter_web/utilsrv/_defaults/package.json +1 -1
- data/lib/starter_web/utilsrv/package.json +1 -1
- metadata +148 -105
- data/assets/data/colors.json +0 -42
- data/assets/data/font_sizes.json +0 -42
- data/assets/data/messages.yml +0 -131
- data/assets/themes/j1/extensions/iframe_resizer/examples/frame.absolute.html +0 -86
- data/assets/themes/j1/extensions/iframe_resizer/examples/frame.content.html +0 -58
- data/assets/themes/j1/extensions/iframe_resizer/examples/frame.hover.html +0 -51
- data/assets/themes/j1/extensions/iframe_resizer/examples/frame.nested.html +0 -68
- data/assets/themes/j1/extensions/iframe_resizer/examples/frame.textarea.html +0 -46
- data/assets/themes/j1/extensions/iframe_resizer/examples/frame.tolerance.html +0 -79
- data/assets/themes/j1/extensions/iframe_resizer/examples/index.html +0 -70
- data/assets/themes/j1/extensions/iframe_resizer/examples/two.html +0 -71
- data/assets/themes/j1/extensions/iframe_resizer/js/client/iframeResizer.contentWindow.js +0 -1104
- data/assets/themes/j1/extensions/iframe_resizer/js/client/iframeResizer.contentWindow.map +0 -1
- data/assets/themes/j1/extensions/iframe_resizer/js/client/iframeResizer.contentWindow.min.js +0 -10
- data/assets/themes/j1/extensions/log4javascript/log4javascript.js +0 -5826
- data/assets/themes/j1/extensions/log4javascript/log4javascript.min.js +0 -266
- data/lib/starter_web/assets/images/modules/attics/admin-dashboard-bootstrap-1280x600.png +0 -0
- data/lib/starter_web/assets/images/modules/attics/mae-mu-Vf9gbsLZyf0-unsplash.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/mae-mue-1920x1280-v.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/mae-mue-1920x1280.jpg +0 -0
@@ -1,46 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<meta charset="utf-8">
|
5
|
-
<title>iFrame message passing test</title>
|
6
|
-
<meta name="description" content="iFrame message passing test">
|
7
|
-
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
8
|
-
<style>
|
9
|
-
a { float:right; margin-left:10px;}
|
10
|
-
</style>
|
11
|
-
</head>
|
12
|
-
<body>
|
13
|
-
|
14
|
-
<b>iFrame TextArea Example</b>
|
15
|
-
<a href="frame.content.html">Back to page 1</a>
|
16
|
-
</a>
|
17
|
-
|
18
|
-
<p>
|
19
|
-
Resize the textarea below.
|
20
|
-
</p>
|
21
|
-
|
22
|
-
<textarea id="textArea">Resize me</textarea>
|
23
|
-
|
24
|
-
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
|
25
|
-
<script src="../js/client/iframeResizer.contentWindow.min.js" defer></script>
|
26
|
-
|
27
|
-
<script>
|
28
|
-
|
29
|
-
|
30
|
-
function store(){
|
31
|
-
this.x = this.offsetWidth;
|
32
|
-
this.y = this.offsetHeight;
|
33
|
-
}
|
34
|
-
|
35
|
-
$('textarea').each(store).on('mouseover mouseout',function(){
|
36
|
-
if (this.offsetWidth !== this.x || this.offsetHeight !== this.y){
|
37
|
-
if ('parentIFrame' in window) parentIFrame.size();
|
38
|
-
store.call(this);
|
39
|
-
}
|
40
|
-
});
|
41
|
-
|
42
|
-
|
43
|
-
</script>
|
44
|
-
|
45
|
-
</body>
|
46
|
-
</html>
|
@@ -1,79 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<meta charset="utf-8">
|
5
|
-
<title>iFrame message passing test</title>
|
6
|
-
<meta name="description" content="iFrame message passing test">
|
7
|
-
<style>
|
8
|
-
a.back { float:right; margin-left:8px;}
|
9
|
-
body {border:solid 1px red;}
|
10
|
-
p{padding:5px 212px 5px 5px;margin:0 0 5px;}
|
11
|
-
#abs{
|
12
|
-
position: absolute;
|
13
|
-
top:0;
|
14
|
-
bottom:-10;px
|
15
|
-
right:0;
|
16
|
-
width: 200px;
|
17
|
-
height: 101%;
|
18
|
-
background-color: wheat;
|
19
|
-
}
|
20
|
-
a.top{
|
21
|
-
position: absolute;
|
22
|
-
bottom:-10px;
|
23
|
-
right:0;
|
24
|
-
margin:5px;
|
25
|
-
}
|
26
|
-
</style>
|
27
|
-
</head>
|
28
|
-
<body>
|
29
|
-
|
30
|
-
<p>
|
31
|
-
<b>iFrame</b>
|
32
|
-
|
33
|
-
<a href="frame.content.html" class="back">Back to page 1</a>
|
34
|
-
|
35
|
-
<a href='#' class="back" onclick="if ('parentIFrame' in window) window.parentIFrame.scrollTo(0,99999999);return false;">Bottom</a>
|
36
|
-
</p>
|
37
|
-
<p>
|
38
|
-
This page has an absolute position elemnt that take it out side the normal document body, which is marked with a red border on this page. This prevents the normal height calculation, which is based on the body tag from returning the correct height. To work around this you can set the <b>heightCalculationMethod</b> option to use one of the other page height propeties.
|
39
|
-
</p>
|
40
|
-
<p>
|
41
|
-
Use the dropdown to change the sizing method of the page, select the different sizing options to see how the effect the page. Note that they can have different effects in different browsers, so you are normally best off selecting <b>max</b> if you need to change away from the default <b>bodyOffset</b> option.
|
42
|
-
</p>
|
43
|
-
<p>
|
44
|
-
<b>Height Calculation Method</b>
|
45
|
-
<select name="heightCalculationMethod">
|
46
|
-
<option>bodyOffset</option>
|
47
|
-
<option>bodyScroll</option>
|
48
|
-
<option>documentElementOffset</option>
|
49
|
-
<option>documentElementScroll</option>
|
50
|
-
<option>max</option>
|
51
|
-
<option>min</option>
|
52
|
-
<option>grow</option>
|
53
|
-
<option>lowestElement</option>
|
54
|
-
</select>
|
55
|
-
</p>
|
56
|
-
<p>
|
57
|
-
<i>This option should be used sparingly, as the alternate methods can be less acurate at working out the correct page size, can cause screen flicker and can sometimes fail to reduce in size when the frame content changes in browsers that do not support mutationObservers (See <a href="http://caniuse.com/mutationobserver">caniuse.com</a> for details).</i>
|
58
|
-
</p>
|
59
|
-
|
60
|
-
<div id="abs">
|
61
|
-
Absolute positioned element
|
62
|
-
<a href='#' class="top" onclick="if ('parentIFrame' in window) window.parentIFrame.scrollTo(0,0);return false;">Top</a>
|
63
|
-
</div>
|
64
|
-
|
65
|
-
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
|
66
|
-
<script src="../js/client/iframeResizer.contentWindow.min.js" defer></script>
|
67
|
-
<script>
|
68
|
-
|
69
|
-
$('select').on('change',function(){
|
70
|
-
if ('parentIFrame' in window){
|
71
|
-
parentIFrame.setHeightCalculationMethod($(this).val());
|
72
|
-
parentIFrame.size();
|
73
|
-
}
|
74
|
-
});
|
75
|
-
|
76
|
-
</script>
|
77
|
-
|
78
|
-
</body>
|
79
|
-
</html>
|
@@ -1,70 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<meta charset="utf-8">
|
5
|
-
<title>iFrame message passing test</title>
|
6
|
-
<meta name="description" content="iFrame message passing test">
|
7
|
-
<meta name="viewport" content="width=device-width">
|
8
|
-
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
9
|
-
</head>
|
10
|
-
<body>
|
11
|
-
<h2>Automagically resizing iFrame</h2>
|
12
|
-
<p>Resize window or click one of the links in the iFrame to watch it resize. Or try with <a name="anchorParentTest" href="two.html">two iFrames</a>.</p>
|
13
|
-
<div style="margin:20px;">
|
14
|
-
<iframe src="frame.content.html" width="100%" scrolling="no"></iframe>
|
15
|
-
</div>
|
16
|
-
<p id="callback">
|
17
|
-
</p>
|
18
|
-
<div style="margin: 8px 0;font-size:13px;">
|
19
|
-
For details on how this works, see
|
20
|
-
<a href="http://davidjbradshaw.github.io/iframe-resizer/">http://davidjbradshaw.github.io/iframe-resizer/</a>.
|
21
|
-
</div>
|
22
|
-
|
23
|
-
<!-- MDN PolyFils for IE8 (This is not normally needed if you use the jQuery version) -->
|
24
|
-
<!--[if lte IE 8]>
|
25
|
-
<script src="../js/ie8.polyfils.min.js"></script>
|
26
|
-
<![endif]-->
|
27
|
-
|
28
|
-
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
|
29
|
-
<script src="../js/client/iframeResizer.contentWindow.min.js" defer></script>
|
30
|
-
|
31
|
-
<script>
|
32
|
-
/*
|
33
|
-
* If you do not understand what the code below does, then please just use the
|
34
|
-
* following call in your own code.
|
35
|
-
*
|
36
|
-
* iFrameResize({log:true});
|
37
|
-
*
|
38
|
-
* Once you have it working, set the log option to false.
|
39
|
-
*/
|
40
|
-
|
41
|
-
iFrameResize({
|
42
|
-
log : true,
|
43
|
-
inPageLinks : true,
|
44
|
-
resizedCallback : function(messageData){
|
45
|
-
$('p#callback').html(
|
46
|
-
'<b>Frame ID:</b> ' + messageData.iframe.id +
|
47
|
-
' <b>Height:</b> ' + messageData.height +
|
48
|
-
' <b>Width:</b> ' + messageData.width +
|
49
|
-
' <b>Event type:</b> ' + messageData.type
|
50
|
-
);
|
51
|
-
},
|
52
|
-
messageCallback : function(messageData){
|
53
|
-
$('p#callback').html(
|
54
|
-
'<b>Frame ID:</b> ' + messageData.iframe.id +
|
55
|
-
' <b>Message:</b> ' + messageData.message
|
56
|
-
);
|
57
|
-
alert(messageData.message);
|
58
|
-
document.getElementsByTagName('iframe')[0].iFrameResizer.sendMessage('Hello back from parent page');
|
59
|
-
},
|
60
|
-
closedCallback : function(id){
|
61
|
-
$('p#callback').html(
|
62
|
-
'<b>IFrame (</b>' + id +
|
63
|
-
'<b>) removed from page.</b>'
|
64
|
-
);
|
65
|
-
}
|
66
|
-
});
|
67
|
-
</script>
|
68
|
-
|
69
|
-
</body>
|
70
|
-
</html>
|
@@ -1,71 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<meta charset="utf-8">
|
5
|
-
<title>iFrame message passing test</title>
|
6
|
-
<meta name="description" content="iFrame message passing test">
|
7
|
-
<meta name="viewport" content="width=device-width">
|
8
|
-
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
9
|
-
</head>
|
10
|
-
<body>
|
11
|
-
<h2>Automagically resizing iFrame</h2>
|
12
|
-
<p>Resize window or click one of the links in the iFrame to watch it resize. Or go back to a <a name="anchorParentTest" href="index.html">single iFrame</a>.</p>
|
13
|
-
<div style="margin:20px;">
|
14
|
-
<iframe src="frame.content.html" width="48%" scrolling="no" style="float:left;margin-right:2%"></iframe>
|
15
|
-
<iframe src="frame.content.html" width="48%" scrolling="no"></iframe>
|
16
|
-
</div>
|
17
|
-
<p id="callback">
|
18
|
-
</p>
|
19
|
-
<div style="margin: 8px 0;font-size:13px;">
|
20
|
-
For details on how this works, see
|
21
|
-
<a href="http://davidjbradshaw.github.io/iframe-resizer/">http://davidjbradshaw.github.io/iframe-resizer/</a>.
|
22
|
-
</div>
|
23
|
-
|
24
|
-
<!-- MDN PolyFils for IE8 -->
|
25
|
-
<!--[if lte IE 8]>
|
26
|
-
<script src="../js/ie8.polyfils.min.js"></script>
|
27
|
-
<![endif]-->
|
28
|
-
|
29
|
-
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
|
30
|
-
<script src="../js/client/iframeResizer.contentWindow.min.js" defer></script>
|
31
|
-
|
32
|
-
<script>
|
33
|
-
/*
|
34
|
-
* If you do not understand what the code below does, then please just use the
|
35
|
-
* following call in your own code.
|
36
|
-
*
|
37
|
-
* iFrameResize({log:true});
|
38
|
-
*
|
39
|
-
* Once you have it working, set the log option to false.
|
40
|
-
*/
|
41
|
-
|
42
|
-
iFrameResize({
|
43
|
-
log : true,
|
44
|
-
enablePublicMethods : true,
|
45
|
-
enableInPageLinks : true,
|
46
|
-
resizedCallback : function(messageData){
|
47
|
-
$('p#callback').html(
|
48
|
-
'<b>Frame ID:</b> ' + messageData.iframe.id +
|
49
|
-
' <b>Height:</b> ' + messageData.height +
|
50
|
-
' <b>Width:</b> ' + messageData.width +
|
51
|
-
' <b>Event type:</b> ' + messageData.type
|
52
|
-
);
|
53
|
-
},
|
54
|
-
messageCallback : function(messageData){
|
55
|
-
$('p#callback').html(
|
56
|
-
'<b>Frame ID:</b> ' + messageData.iframe.id +
|
57
|
-
' <b>Message:</b> ' + messageData.message
|
58
|
-
);
|
59
|
-
alert(messageData.message + ' (' + messageData.iframe.id + ')' );
|
60
|
-
},
|
61
|
-
closedCallback : function(id){
|
62
|
-
$('p#callback').html(
|
63
|
-
'<b>IFrame (</b>' + id +
|
64
|
-
'<b>) removed from page.</b>'
|
65
|
-
);
|
66
|
-
}
|
67
|
-
});
|
68
|
-
</script>
|
69
|
-
|
70
|
-
</body>
|
71
|
-
</html>
|
@@ -1,1104 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* File: iframeResizer.contentWindow.js
|
3
|
-
* Desc: Include this file in any page being loaded into an iframe
|
4
|
-
* to force the iframe to resize to the content size.
|
5
|
-
* Requires: iframeResizer.js on host page.
|
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: Ian Caunce - ian@hallnet.co.uk
|
10
|
-
*/
|
11
|
-
|
12
|
-
|
13
|
-
;(function(window, undefined) {
|
14
|
-
'use strict';
|
15
|
-
|
16
|
-
var
|
17
|
-
autoResize = true,
|
18
|
-
base = 10,
|
19
|
-
bodyBackground = '',
|
20
|
-
bodyMargin = 0,
|
21
|
-
bodyMarginStr = '',
|
22
|
-
bodyObserver = null,
|
23
|
-
bodyPadding = '',
|
24
|
-
calculateWidth = false,
|
25
|
-
doubleEventList = {'resize':1,'click':1},
|
26
|
-
eventCancelTimer = 128,
|
27
|
-
firstRun = true,
|
28
|
-
height = 1,
|
29
|
-
heightCalcModeDefault = 'bodyOffset',
|
30
|
-
heightCalcMode = heightCalcModeDefault,
|
31
|
-
initLock = true,
|
32
|
-
initMsg = '',
|
33
|
-
inPageLinks = {},
|
34
|
-
interval = 32,
|
35
|
-
intervalTimer = null,
|
36
|
-
logging = false,
|
37
|
-
msgID = '[iFrameSizer]', //Must match host page msg ID
|
38
|
-
msgIdLen = msgID.length,
|
39
|
-
myID = '',
|
40
|
-
observer = null,
|
41
|
-
resetRequiredMethods = {max:1,min:1,bodyScroll:1,documentElementScroll:1},
|
42
|
-
resizeFrom = 'child',
|
43
|
-
sendPermit = true,
|
44
|
-
target = window.parent,
|
45
|
-
targetOriginDefault = '*',
|
46
|
-
tolerance = 0,
|
47
|
-
triggerLocked = false,
|
48
|
-
triggerLockedTimer = null,
|
49
|
-
throttledTimer = 16,
|
50
|
-
width = 1,
|
51
|
-
widthCalcModeDefault = 'scroll',
|
52
|
-
widthCalcMode = widthCalcModeDefault,
|
53
|
-
win = window,
|
54
|
-
messageCallback = function(){ warn('MessageCallback function not defined'); },
|
55
|
-
readyCallback = function(){},
|
56
|
-
pageInfoCallback = function(){},
|
57
|
-
customCalcMethods = {
|
58
|
-
height: function(){
|
59
|
-
warn('Custom height calculation function not defined');
|
60
|
-
return document.documentElement.offsetHeight;
|
61
|
-
},
|
62
|
-
width: function(){
|
63
|
-
warn('Custom width calculation function not defined');
|
64
|
-
return document.body.scrollWidth;
|
65
|
-
}
|
66
|
-
},
|
67
|
-
eventHandlersByName = {};
|
68
|
-
|
69
|
-
|
70
|
-
function addEventListener(el,evt,func){
|
71
|
-
/* istanbul ignore else */ // Not testable in phantonJS
|
72
|
-
if ('addEventListener' in window){
|
73
|
-
el.addEventListener(evt,func, false);
|
74
|
-
} else if ('attachEvent' in window){ //IE
|
75
|
-
el.attachEvent('on'+evt,func);
|
76
|
-
}
|
77
|
-
}
|
78
|
-
|
79
|
-
function removeEventListener(el,evt,func){
|
80
|
-
/* istanbul ignore else */ // Not testable in phantonJS
|
81
|
-
if ('removeEventListener' in window){
|
82
|
-
el.removeEventListener(evt,func, false);
|
83
|
-
} else if ('detachEvent' in window){ //IE
|
84
|
-
el.detachEvent('on'+evt,func);
|
85
|
-
}
|
86
|
-
}
|
87
|
-
|
88
|
-
function capitalizeFirstLetter(string) {
|
89
|
-
return string.charAt(0).toUpperCase() + string.slice(1);
|
90
|
-
}
|
91
|
-
|
92
|
-
//Based on underscore.js
|
93
|
-
function throttle(func) {
|
94
|
-
var
|
95
|
-
context, args, result,
|
96
|
-
timeout = null,
|
97
|
-
previous = 0,
|
98
|
-
later = function() {
|
99
|
-
previous = getNow();
|
100
|
-
timeout = null;
|
101
|
-
result = func.apply(context, args);
|
102
|
-
if (!timeout) {
|
103
|
-
context = args = null;
|
104
|
-
}
|
105
|
-
};
|
106
|
-
|
107
|
-
return function() {
|
108
|
-
var now = getNow();
|
109
|
-
|
110
|
-
if (!previous) {
|
111
|
-
previous = now;
|
112
|
-
}
|
113
|
-
|
114
|
-
var remaining = throttledTimer - (now - previous);
|
115
|
-
|
116
|
-
context = this;
|
117
|
-
args = arguments;
|
118
|
-
|
119
|
-
if (remaining <= 0 || remaining > throttledTimer) {
|
120
|
-
if (timeout) {
|
121
|
-
clearTimeout(timeout);
|
122
|
-
timeout = null;
|
123
|
-
}
|
124
|
-
|
125
|
-
previous = now;
|
126
|
-
result = func.apply(context, args);
|
127
|
-
|
128
|
-
if (!timeout) {
|
129
|
-
context = args = null;
|
130
|
-
}
|
131
|
-
|
132
|
-
} else if (!timeout) {
|
133
|
-
timeout = setTimeout(later, remaining);
|
134
|
-
}
|
135
|
-
|
136
|
-
return result;
|
137
|
-
};
|
138
|
-
}
|
139
|
-
|
140
|
-
var getNow = Date.now || function() {
|
141
|
-
/* istanbul ignore next */ // Not testable in PhantonJS
|
142
|
-
return new Date().getTime();
|
143
|
-
};
|
144
|
-
|
145
|
-
function formatLogMsg(msg){
|
146
|
-
return msgID + '[' + myID + ']' + ' ' + msg;
|
147
|
-
}
|
148
|
-
|
149
|
-
function log(msg){
|
150
|
-
if (logging && ('object' === typeof window.console)){
|
151
|
-
console.log(formatLogMsg(msg));
|
152
|
-
}
|
153
|
-
}
|
154
|
-
|
155
|
-
function warn(msg){
|
156
|
-
if ('object' === typeof window.console){
|
157
|
-
console.warn(formatLogMsg(msg));
|
158
|
-
}
|
159
|
-
}
|
160
|
-
|
161
|
-
|
162
|
-
function init(){
|
163
|
-
readDataFromParent();
|
164
|
-
log('Initialising iFrame ('+location.href+')');
|
165
|
-
readDataFromPage();
|
166
|
-
setMargin();
|
167
|
-
setBodyStyle('background',bodyBackground);
|
168
|
-
setBodyStyle('padding',bodyPadding);
|
169
|
-
injectClearFixIntoBodyElement();
|
170
|
-
checkHeightMode();
|
171
|
-
checkWidthMode();
|
172
|
-
stopInfiniteResizingOfIFrame();
|
173
|
-
setupPublicMethods();
|
174
|
-
startEventListeners();
|
175
|
-
inPageLinks = setupInPageLinks();
|
176
|
-
sendSize('init','Init message from host page');
|
177
|
-
readyCallback();
|
178
|
-
}
|
179
|
-
|
180
|
-
function readDataFromParent(){
|
181
|
-
|
182
|
-
function strBool(str){
|
183
|
-
return 'true' === str ? true : false;
|
184
|
-
}
|
185
|
-
|
186
|
-
var data = initMsg.substr(msgIdLen).split(':');
|
187
|
-
|
188
|
-
myID = data[0];
|
189
|
-
bodyMargin = (undefined !== data[1]) ? Number(data[1]) : bodyMargin; //For V1 compatibility
|
190
|
-
calculateWidth = (undefined !== data[2]) ? strBool(data[2]) : calculateWidth;
|
191
|
-
logging = (undefined !== data[3]) ? strBool(data[3]) : logging;
|
192
|
-
interval = (undefined !== data[4]) ? Number(data[4]) : interval;
|
193
|
-
autoResize = (undefined !== data[6]) ? strBool(data[6]) : autoResize;
|
194
|
-
bodyMarginStr = data[7];
|
195
|
-
heightCalcMode = (undefined !== data[8]) ? data[8] : heightCalcMode;
|
196
|
-
bodyBackground = data[9];
|
197
|
-
bodyPadding = data[10];
|
198
|
-
tolerance = (undefined !== data[11]) ? Number(data[11]) : tolerance;
|
199
|
-
inPageLinks.enable = (undefined !== data[12]) ? strBool(data[12]): false;
|
200
|
-
resizeFrom = (undefined !== data[13]) ? data[13] : resizeFrom;
|
201
|
-
widthCalcMode = (undefined !== data[14]) ? data[14] : widthCalcMode;
|
202
|
-
}
|
203
|
-
|
204
|
-
function readDataFromPage(){
|
205
|
-
function readData(){
|
206
|
-
var data = window.iFrameResizer;
|
207
|
-
|
208
|
-
log('Reading data from page: ' + JSON.stringify(data));
|
209
|
-
|
210
|
-
messageCallback = ('messageCallback' in data) ? data.messageCallback : messageCallback;
|
211
|
-
readyCallback = ('readyCallback' in data) ? data.readyCallback : readyCallback;
|
212
|
-
targetOriginDefault = ('targetOrigin' in data) ? data.targetOrigin : targetOriginDefault;
|
213
|
-
heightCalcMode = ('heightCalculationMethod' in data) ? data.heightCalculationMethod : heightCalcMode;
|
214
|
-
widthCalcMode = ('widthCalculationMethod' in data) ? data.widthCalculationMethod : widthCalcMode;
|
215
|
-
}
|
216
|
-
|
217
|
-
function setupCustomCalcMethods(calcMode, calcFunc){
|
218
|
-
if ('function' === typeof calcMode) {
|
219
|
-
log('Setup custom ' + calcFunc + 'CalcMethod');
|
220
|
-
customCalcMethods[calcFunc] = calcMode;
|
221
|
-
calcMode = 'custom';
|
222
|
-
}
|
223
|
-
|
224
|
-
return calcMode;
|
225
|
-
}
|
226
|
-
|
227
|
-
if(('iFrameResizer' in window) && (Object === window.iFrameResizer.constructor)) {
|
228
|
-
readData();
|
229
|
-
heightCalcMode = setupCustomCalcMethods(heightCalcMode, 'height');
|
230
|
-
widthCalcMode = setupCustomCalcMethods(widthCalcMode, 'width');
|
231
|
-
}
|
232
|
-
|
233
|
-
log('TargetOrigin for parent set to: ' + targetOriginDefault);
|
234
|
-
}
|
235
|
-
|
236
|
-
|
237
|
-
function chkCSS(attr,value){
|
238
|
-
if (-1 !== value.indexOf('-')){
|
239
|
-
warn('Negative CSS value ignored for '+attr);
|
240
|
-
value='';
|
241
|
-
}
|
242
|
-
return value;
|
243
|
-
}
|
244
|
-
|
245
|
-
function setBodyStyle(attr,value){
|
246
|
-
if ((undefined !== value) && ('' !== value) && ('null' !== value)){
|
247
|
-
document.body.style[attr] = value;
|
248
|
-
log('Body '+attr+' set to "'+value+'"');
|
249
|
-
}
|
250
|
-
}
|
251
|
-
|
252
|
-
function setMargin(){
|
253
|
-
//If called via V1 script, convert bodyMargin from int to str
|
254
|
-
if (undefined === bodyMarginStr){
|
255
|
-
bodyMarginStr = bodyMargin+'px';
|
256
|
-
}
|
257
|
-
|
258
|
-
setBodyStyle('margin',chkCSS('margin',bodyMarginStr));
|
259
|
-
}
|
260
|
-
|
261
|
-
function stopInfiniteResizingOfIFrame(){
|
262
|
-
document.documentElement.style.height = '';
|
263
|
-
document.body.style.height = '';
|
264
|
-
log('HTML & body height set to "auto"');
|
265
|
-
}
|
266
|
-
|
267
|
-
|
268
|
-
function manageTriggerEvent(options){
|
269
|
-
|
270
|
-
var listener = {
|
271
|
-
add: function(eventName){
|
272
|
-
function handleEvent(){
|
273
|
-
sendSize(options.eventName,options.eventType);
|
274
|
-
}
|
275
|
-
|
276
|
-
eventHandlersByName[eventName] = handleEvent;
|
277
|
-
|
278
|
-
addEventListener(window,eventName,handleEvent);
|
279
|
-
},
|
280
|
-
remove: function(eventName){
|
281
|
-
var handleEvent = eventHandlersByName[eventName];
|
282
|
-
delete eventHandlersByName[eventName];
|
283
|
-
|
284
|
-
removeEventListener(window,eventName,handleEvent);
|
285
|
-
}
|
286
|
-
};
|
287
|
-
|
288
|
-
if(options.eventNames && Array.prototype.map){
|
289
|
-
options.eventName = options.eventNames[0];
|
290
|
-
options.eventNames.map(listener[options.method]);
|
291
|
-
} else {
|
292
|
-
listener[options.method](options.eventName);
|
293
|
-
}
|
294
|
-
|
295
|
-
log(capitalizeFirstLetter(options.method) + ' event listener: ' + options.eventType);
|
296
|
-
}
|
297
|
-
|
298
|
-
function manageEventListeners(method){
|
299
|
-
manageTriggerEvent({method:method, eventType: 'Animation Start', eventNames: ['animationstart','webkitAnimationStart'] });
|
300
|
-
manageTriggerEvent({method:method, eventType: 'Animation Iteration', eventNames: ['animationiteration','webkitAnimationIteration'] });
|
301
|
-
manageTriggerEvent({method:method, eventType: 'Animation End', eventNames: ['animationend','webkitAnimationEnd'] });
|
302
|
-
manageTriggerEvent({method:method, eventType: 'Input', eventName: 'input' });
|
303
|
-
manageTriggerEvent({method:method, eventType: 'Mouse Up', eventName: 'mouseup' });
|
304
|
-
manageTriggerEvent({method:method, eventType: 'Mouse Down', eventName: 'mousedown' });
|
305
|
-
manageTriggerEvent({method:method, eventType: 'Orientation Change', eventName: 'orientationchange' });
|
306
|
-
manageTriggerEvent({method:method, eventType: 'Print', eventName: ['afterprint', 'beforeprint'] });
|
307
|
-
manageTriggerEvent({method:method, eventType: 'Ready State Change', eventName: 'readystatechange' });
|
308
|
-
manageTriggerEvent({method:method, eventType: 'Touch Start', eventName: 'touchstart' });
|
309
|
-
manageTriggerEvent({method:method, eventType: 'Touch End', eventName: 'touchend' });
|
310
|
-
manageTriggerEvent({method:method, eventType: 'Touch Cancel', eventName: 'touchcancel' });
|
311
|
-
manageTriggerEvent({method:method, eventType: 'Transition Start', eventNames: ['transitionstart','webkitTransitionStart','MSTransitionStart','oTransitionStart','otransitionstart'] });
|
312
|
-
manageTriggerEvent({method:method, eventType: 'Transition Iteration', eventNames: ['transitioniteration','webkitTransitionIteration','MSTransitionIteration','oTransitionIteration','otransitioniteration'] });
|
313
|
-
manageTriggerEvent({method:method, eventType: 'Transition End', eventNames: ['transitionend','webkitTransitionEnd','MSTransitionEnd','oTransitionEnd','otransitionend'] });
|
314
|
-
if('child' === resizeFrom){
|
315
|
-
manageTriggerEvent({method:method, eventType: 'IFrame Resized', eventName: 'resize' });
|
316
|
-
}
|
317
|
-
}
|
318
|
-
|
319
|
-
function checkCalcMode(calcMode,calcModeDefault,modes,type){
|
320
|
-
if (calcModeDefault !== calcMode){
|
321
|
-
if (!(calcMode in modes)){
|
322
|
-
warn(calcMode + ' is not a valid option for '+type+'CalculationMethod.');
|
323
|
-
calcMode=calcModeDefault;
|
324
|
-
}
|
325
|
-
log(type+' calculation method set to "'+calcMode+'"');
|
326
|
-
}
|
327
|
-
|
328
|
-
return calcMode;
|
329
|
-
}
|
330
|
-
|
331
|
-
function checkHeightMode(){
|
332
|
-
heightCalcMode = checkCalcMode(heightCalcMode,heightCalcModeDefault,getHeight,'height');
|
333
|
-
}
|
334
|
-
|
335
|
-
function checkWidthMode(){
|
336
|
-
widthCalcMode = checkCalcMode(widthCalcMode,widthCalcModeDefault,getWidth,'width');
|
337
|
-
}
|
338
|
-
|
339
|
-
function startEventListeners(){
|
340
|
-
if ( true === autoResize ) {
|
341
|
-
manageEventListeners('add');
|
342
|
-
setupMutationObserver();
|
343
|
-
}
|
344
|
-
else {
|
345
|
-
log('Auto Resize disabled');
|
346
|
-
}
|
347
|
-
}
|
348
|
-
|
349
|
-
function stopMsgsToParent(){
|
350
|
-
log('Disable outgoing messages');
|
351
|
-
sendPermit = false;
|
352
|
-
}
|
353
|
-
|
354
|
-
function removeMsgListener(){
|
355
|
-
log('Remove event listener: Message');
|
356
|
-
removeEventListener(window, 'message', receiver);
|
357
|
-
}
|
358
|
-
|
359
|
-
function disconnectMutationObserver(){
|
360
|
-
if (null !== bodyObserver){
|
361
|
-
/* istanbul ignore next */ // Not testable in PhantonJS
|
362
|
-
bodyObserver.disconnect();
|
363
|
-
}
|
364
|
-
}
|
365
|
-
|
366
|
-
function stopEventListeners(){
|
367
|
-
manageEventListeners('remove');
|
368
|
-
disconnectMutationObserver();
|
369
|
-
clearInterval(intervalTimer);
|
370
|
-
}
|
371
|
-
|
372
|
-
function teardown(){
|
373
|
-
stopMsgsToParent();
|
374
|
-
removeMsgListener();
|
375
|
-
if (true === autoResize) stopEventListeners();
|
376
|
-
}
|
377
|
-
|
378
|
-
function injectClearFixIntoBodyElement(){
|
379
|
-
var clearFix = document.createElement('div');
|
380
|
-
clearFix.style.clear = 'both';
|
381
|
-
clearFix.style.display = 'block'; //Guard against this having been globally redefined in CSS.
|
382
|
-
document.body.appendChild(clearFix);
|
383
|
-
}
|
384
|
-
|
385
|
-
function setupInPageLinks(){
|
386
|
-
|
387
|
-
function getPagePosition (){
|
388
|
-
return {
|
389
|
-
x: (window.pageXOffset !== undefined) ? window.pageXOffset : document.documentElement.scrollLeft,
|
390
|
-
y: (window.pageYOffset !== undefined) ? window.pageYOffset : document.documentElement.scrollTop
|
391
|
-
};
|
392
|
-
}
|
393
|
-
|
394
|
-
function getElementPosition(el){
|
395
|
-
var
|
396
|
-
elPosition = el.getBoundingClientRect(),
|
397
|
-
pagePosition = getPagePosition();
|
398
|
-
|
399
|
-
return {
|
400
|
-
x: parseInt(elPosition.left,10) + parseInt(pagePosition.x,10),
|
401
|
-
y: parseInt(elPosition.top,10) + parseInt(pagePosition.y,10)
|
402
|
-
};
|
403
|
-
}
|
404
|
-
|
405
|
-
function findTarget(location){
|
406
|
-
function jumpToTarget(target){
|
407
|
-
var jumpPosition = getElementPosition(target);
|
408
|
-
|
409
|
-
log('Moving to in page link (#'+hash+') at x: '+jumpPosition.x+' y: '+jumpPosition.y);
|
410
|
-
sendMsg(jumpPosition.y, jumpPosition.x, 'scrollToOffset'); // X&Y reversed at sendMsg uses height/width
|
411
|
-
}
|
412
|
-
|
413
|
-
var
|
414
|
-
hash = location.split('#')[1] || location, //Remove # if present
|
415
|
-
hashData = decodeURIComponent(hash),
|
416
|
-
target = document.getElementById(hashData) || document.getElementsByName(hashData)[0];
|
417
|
-
|
418
|
-
if (undefined !== target){
|
419
|
-
jumpToTarget(target);
|
420
|
-
} else {
|
421
|
-
log('In page link (#' + hash + ') not found in iFrame, so sending to parent');
|
422
|
-
sendMsg(0,0,'inPageLink','#'+hash);
|
423
|
-
}
|
424
|
-
}
|
425
|
-
|
426
|
-
function checkLocationHash(){
|
427
|
-
if ('' !== location.hash && '#' !== location.hash){
|
428
|
-
findTarget(location.href);
|
429
|
-
}
|
430
|
-
}
|
431
|
-
|
432
|
-
function bindAnchors(){
|
433
|
-
function setupLink(el){
|
434
|
-
function linkClicked(e){
|
435
|
-
e.preventDefault();
|
436
|
-
|
437
|
-
/*jshint validthis:true */
|
438
|
-
findTarget(this.getAttribute('href'));
|
439
|
-
}
|
440
|
-
|
441
|
-
if ('#' !== el.getAttribute('href')){
|
442
|
-
addEventListener(el,'click',linkClicked);
|
443
|
-
}
|
444
|
-
}
|
445
|
-
|
446
|
-
Array.prototype.forEach.call( document.querySelectorAll( 'a[href^="#"]' ), setupLink );
|
447
|
-
}
|
448
|
-
|
449
|
-
function bindLocationHash(){
|
450
|
-
addEventListener(window,'hashchange',checkLocationHash);
|
451
|
-
}
|
452
|
-
|
453
|
-
function initCheck(){ //check if page loaded with location hash after init resize
|
454
|
-
setTimeout(checkLocationHash,eventCancelTimer);
|
455
|
-
}
|
456
|
-
|
457
|
-
function enableInPageLinks(){
|
458
|
-
/* istanbul ignore else */ // Not testable in phantonJS
|
459
|
-
if(Array.prototype.forEach && document.querySelectorAll){
|
460
|
-
log('Setting up location.hash handlers');
|
461
|
-
bindAnchors();
|
462
|
-
bindLocationHash();
|
463
|
-
initCheck();
|
464
|
-
} else {
|
465
|
-
warn('In page linking not fully supported in this browser! (See README.md for IE8 workaround)');
|
466
|
-
}
|
467
|
-
}
|
468
|
-
|
469
|
-
if(inPageLinks.enable){
|
470
|
-
enableInPageLinks();
|
471
|
-
} else {
|
472
|
-
log('In page linking not enabled');
|
473
|
-
}
|
474
|
-
|
475
|
-
return {
|
476
|
-
findTarget:findTarget
|
477
|
-
};
|
478
|
-
}
|
479
|
-
|
480
|
-
function setupPublicMethods(){
|
481
|
-
log('Enable public methods');
|
482
|
-
|
483
|
-
win.parentIFrame = {
|
484
|
-
|
485
|
-
autoResize: function autoResizeF(resize){
|
486
|
-
if (true === resize && false === autoResize) {
|
487
|
-
autoResize=true;
|
488
|
-
startEventListeners();
|
489
|
-
//sendSize('autoResize','Auto Resize enabled');
|
490
|
-
} else if (false === resize && true === autoResize) {
|
491
|
-
autoResize=false;
|
492
|
-
stopEventListeners();
|
493
|
-
}
|
494
|
-
|
495
|
-
return autoResize;
|
496
|
-
},
|
497
|
-
|
498
|
-
close: function closeF(){
|
499
|
-
sendMsg(0,0,'close');
|
500
|
-
teardown();
|
501
|
-
},
|
502
|
-
|
503
|
-
getId: function getIdF(){
|
504
|
-
return myID;
|
505
|
-
},
|
506
|
-
|
507
|
-
getPageInfo: function getPageInfoF(callback){
|
508
|
-
if ('function' === typeof callback){
|
509
|
-
pageInfoCallback = callback;
|
510
|
-
sendMsg(0,0,'pageInfo');
|
511
|
-
} else {
|
512
|
-
pageInfoCallback = function(){};
|
513
|
-
sendMsg(0,0,'pageInfoStop');
|
514
|
-
}
|
515
|
-
},
|
516
|
-
|
517
|
-
moveToAnchor: function moveToAnchorF(hash){
|
518
|
-
inPageLinks.findTarget(hash);
|
519
|
-
},
|
520
|
-
|
521
|
-
reset: function resetF(){
|
522
|
-
resetIFrame('parentIFrame.reset');
|
523
|
-
},
|
524
|
-
|
525
|
-
scrollTo: function scrollToF(x,y){
|
526
|
-
sendMsg(y,x,'scrollTo'); // X&Y reversed at sendMsg uses height/width
|
527
|
-
},
|
528
|
-
|
529
|
-
scrollToOffset: function scrollToF(x,y){
|
530
|
-
sendMsg(y,x,'scrollToOffset'); // X&Y reversed at sendMsg uses height/width
|
531
|
-
},
|
532
|
-
|
533
|
-
sendMessage: function sendMessageF(msg,targetOrigin){
|
534
|
-
sendMsg(0,0,'message',JSON.stringify(msg),targetOrigin);
|
535
|
-
},
|
536
|
-
|
537
|
-
setHeightCalculationMethod: function setHeightCalculationMethodF(heightCalculationMethod){
|
538
|
-
heightCalcMode = heightCalculationMethod;
|
539
|
-
checkHeightMode();
|
540
|
-
},
|
541
|
-
|
542
|
-
setWidthCalculationMethod: function setWidthCalculationMethodF(widthCalculationMethod){
|
543
|
-
widthCalcMode = widthCalculationMethod;
|
544
|
-
checkWidthMode();
|
545
|
-
},
|
546
|
-
|
547
|
-
setTargetOrigin: function setTargetOriginF(targetOrigin){
|
548
|
-
log('Set targetOrigin: '+targetOrigin);
|
549
|
-
targetOriginDefault = targetOrigin;
|
550
|
-
},
|
551
|
-
|
552
|
-
size: function sizeF(customHeight, customWidth){
|
553
|
-
var valString = ''+(customHeight?customHeight:'')+(customWidth?','+customWidth:'');
|
554
|
-
//lockTrigger();
|
555
|
-
sendSize('size','parentIFrame.size('+valString+')', customHeight, customWidth);
|
556
|
-
}
|
557
|
-
};
|
558
|
-
}
|
559
|
-
|
560
|
-
function initInterval(){
|
561
|
-
if ( 0 !== interval ){
|
562
|
-
log('setInterval: '+interval+'ms');
|
563
|
-
intervalTimer = setInterval(function(){
|
564
|
-
sendSize('interval','setInterval: '+interval);
|
565
|
-
},Math.abs(interval));
|
566
|
-
}
|
567
|
-
}
|
568
|
-
|
569
|
-
/* istanbul ignore next */ //Not testable in PhantomJS
|
570
|
-
function setupBodyMutationObserver(){
|
571
|
-
function addImageLoadListners(mutation) {
|
572
|
-
function addImageLoadListener(element){
|
573
|
-
if (false === element.complete) {
|
574
|
-
log('Attach listeners to ' + element.src);
|
575
|
-
element.addEventListener('load', imageLoaded, false);
|
576
|
-
element.addEventListener('error', imageError, false);
|
577
|
-
elements.push(element);
|
578
|
-
}
|
579
|
-
}
|
580
|
-
|
581
|
-
if (mutation.type === 'attributes' && mutation.attributeName === 'src'){
|
582
|
-
addImageLoadListener(mutation.target);
|
583
|
-
} else if (mutation.type === 'childList'){
|
584
|
-
Array.prototype.forEach.call(
|
585
|
-
mutation.target.querySelectorAll('img'),
|
586
|
-
addImageLoadListener
|
587
|
-
);
|
588
|
-
}
|
589
|
-
}
|
590
|
-
|
591
|
-
function removeFromArray(element){
|
592
|
-
elements.splice(elements.indexOf(element),1);
|
593
|
-
}
|
594
|
-
|
595
|
-
function removeImageLoadListener(element){
|
596
|
-
log('Remove listeners from ' + element.src);
|
597
|
-
element.removeEventListener('load', imageLoaded, false);
|
598
|
-
element.removeEventListener('error', imageError, false);
|
599
|
-
removeFromArray(element);
|
600
|
-
}
|
601
|
-
|
602
|
-
function imageEventTriggered(event,type,typeDesc){
|
603
|
-
removeImageLoadListener(event.target);
|
604
|
-
sendSize(type, typeDesc + ': ' + event.target.src, undefined, undefined);
|
605
|
-
}
|
606
|
-
|
607
|
-
function imageLoaded(event) {
|
608
|
-
imageEventTriggered(event,'imageLoad','Image loaded');
|
609
|
-
}
|
610
|
-
|
611
|
-
function imageError(event) {
|
612
|
-
imageEventTriggered(event,'imageLoadFailed','Image load failed');
|
613
|
-
}
|
614
|
-
|
615
|
-
function mutationObserved(mutations) {
|
616
|
-
sendSize('mutationObserver','mutationObserver: ' + mutations[0].target + ' ' + mutations[0].type);
|
617
|
-
|
618
|
-
//Deal with WebKit asyncing image loading when tags are injected into the page
|
619
|
-
mutations.forEach(addImageLoadListners);
|
620
|
-
}
|
621
|
-
|
622
|
-
function createMutationObserver(){
|
623
|
-
var
|
624
|
-
target = document.querySelector('body'),
|
625
|
-
|
626
|
-
config = {
|
627
|
-
attributes : true,
|
628
|
-
attributeOldValue : false,
|
629
|
-
characterData : true,
|
630
|
-
characterDataOldValue : false,
|
631
|
-
childList : true,
|
632
|
-
subtree : true
|
633
|
-
};
|
634
|
-
|
635
|
-
observer = new MutationObserver(mutationObserved);
|
636
|
-
|
637
|
-
log('Create body MutationObserver');
|
638
|
-
observer.observe(target, config);
|
639
|
-
|
640
|
-
return observer;
|
641
|
-
}
|
642
|
-
|
643
|
-
var
|
644
|
-
elements = [],
|
645
|
-
MutationObserver = window.MutationObserver || window.WebKitMutationObserver,
|
646
|
-
observer = createMutationObserver();
|
647
|
-
|
648
|
-
return {
|
649
|
-
disconnect: function (){
|
650
|
-
if ('disconnect' in observer){
|
651
|
-
log('Disconnect body MutationObserver');
|
652
|
-
observer.disconnect();
|
653
|
-
elements.forEach(removeImageLoadListener);
|
654
|
-
}
|
655
|
-
}
|
656
|
-
};
|
657
|
-
}
|
658
|
-
|
659
|
-
function setupMutationObserver(){
|
660
|
-
var forceIntervalTimer = 0 > interval;
|
661
|
-
|
662
|
-
/* istanbul ignore if */ // Not testable in PhantomJS
|
663
|
-
if (window.MutationObserver || window.WebKitMutationObserver){
|
664
|
-
if (forceIntervalTimer) {
|
665
|
-
initInterval();
|
666
|
-
} else {
|
667
|
-
bodyObserver = setupBodyMutationObserver();
|
668
|
-
}
|
669
|
-
} else {
|
670
|
-
log('MutationObserver not supported in this browser!');
|
671
|
-
initInterval();
|
672
|
-
}
|
673
|
-
}
|
674
|
-
|
675
|
-
|
676
|
-
// document.documentElement.offsetHeight is not reliable, so
|
677
|
-
// we have to jump through hoops to get a better value.
|
678
|
-
function getComputedStyle(prop,el) {
|
679
|
-
/* istanbul ignore next */ //Not testable in PhantomJS
|
680
|
-
function convertUnitsToPxForIE8(value) {
|
681
|
-
var PIXEL = /^\d+(px)?$/i;
|
682
|
-
|
683
|
-
if (PIXEL.test(value)) {
|
684
|
-
return parseInt(value,base);
|
685
|
-
}
|
686
|
-
|
687
|
-
var
|
688
|
-
style = el.style.left,
|
689
|
-
runtimeStyle = el.runtimeStyle.left;
|
690
|
-
|
691
|
-
el.runtimeStyle.left = el.currentStyle.left;
|
692
|
-
el.style.left = value || 0;
|
693
|
-
value = el.style.pixelLeft;
|
694
|
-
el.style.left = style;
|
695
|
-
el.runtimeStyle.left = runtimeStyle;
|
696
|
-
|
697
|
-
return value;
|
698
|
-
}
|
699
|
-
|
700
|
-
var retVal = 0;
|
701
|
-
el = el || document.body;
|
702
|
-
|
703
|
-
/* istanbul ignore else */ // Not testable in phantonJS
|
704
|
-
if (('defaultView' in document) && ('getComputedStyle' in document.defaultView)) {
|
705
|
-
retVal = document.defaultView.getComputedStyle(el, null);
|
706
|
-
retVal = (null !== retVal) ? retVal[prop] : 0;
|
707
|
-
} else {//IE8
|
708
|
-
retVal = convertUnitsToPxForIE8(el.currentStyle[prop]);
|
709
|
-
}
|
710
|
-
|
711
|
-
return parseInt(retVal,base);
|
712
|
-
}
|
713
|
-
|
714
|
-
function chkEventThottle(timer){
|
715
|
-
if(timer > throttledTimer/2){
|
716
|
-
throttledTimer = 2*timer;
|
717
|
-
log('Event throttle increased to ' + throttledTimer + 'ms');
|
718
|
-
}
|
719
|
-
}
|
720
|
-
|
721
|
-
//Idea from https://github.com/guardian/iframe-messenger
|
722
|
-
function getMaxElement(side,elements) {
|
723
|
-
var
|
724
|
-
elementsLength = elements.length,
|
725
|
-
elVal = 0,
|
726
|
-
maxVal = 0,
|
727
|
-
Side = capitalizeFirstLetter(side),
|
728
|
-
timer = getNow();
|
729
|
-
|
730
|
-
for (var i = 0; i < elementsLength; i++) {
|
731
|
-
elVal = elements[i].getBoundingClientRect()[side] + getComputedStyle('margin'+Side,elements[i]);
|
732
|
-
if (elVal > maxVal) {
|
733
|
-
maxVal = elVal;
|
734
|
-
}
|
735
|
-
}
|
736
|
-
|
737
|
-
timer = getNow() - timer;
|
738
|
-
|
739
|
-
log('Parsed '+elementsLength+' HTML elements');
|
740
|
-
log('Element position calculated in ' + timer + 'ms');
|
741
|
-
|
742
|
-
chkEventThottle(timer);
|
743
|
-
|
744
|
-
return maxVal;
|
745
|
-
}
|
746
|
-
|
747
|
-
function getAllMeasurements(dimention){
|
748
|
-
return [
|
749
|
-
dimention.bodyOffset(),
|
750
|
-
dimention.bodyScroll(),
|
751
|
-
dimention.documentElementOffset(),
|
752
|
-
dimention.documentElementScroll()
|
753
|
-
];
|
754
|
-
}
|
755
|
-
|
756
|
-
function getTaggedElements(side,tag){
|
757
|
-
function noTaggedElementsFound(){
|
758
|
-
warn('No tagged elements ('+tag+') found on page');
|
759
|
-
return document.querySelectorAll('body *');
|
760
|
-
}
|
761
|
-
|
762
|
-
var elements = document.querySelectorAll('['+tag+']');
|
763
|
-
|
764
|
-
if (0 === elements.length) noTaggedElementsFound();
|
765
|
-
|
766
|
-
return getMaxElement(side,elements);
|
767
|
-
}
|
768
|
-
|
769
|
-
function getAllElements(){
|
770
|
-
return document.querySelectorAll('body *');
|
771
|
-
}
|
772
|
-
|
773
|
-
var
|
774
|
-
getHeight = {
|
775
|
-
bodyOffset: function getBodyOffsetHeight(){
|
776
|
-
return document.body.offsetHeight + getComputedStyle('marginTop') + getComputedStyle('marginBottom');
|
777
|
-
},
|
778
|
-
|
779
|
-
offset: function(){
|
780
|
-
return getHeight.bodyOffset(); //Backwards compatability
|
781
|
-
},
|
782
|
-
|
783
|
-
bodyScroll: function getBodyScrollHeight(){
|
784
|
-
return document.body.scrollHeight;
|
785
|
-
},
|
786
|
-
|
787
|
-
custom: function getCustomWidth(){
|
788
|
-
return customCalcMethods.height();
|
789
|
-
},
|
790
|
-
|
791
|
-
documentElementOffset: function getDEOffsetHeight(){
|
792
|
-
return document.documentElement.offsetHeight;
|
793
|
-
},
|
794
|
-
|
795
|
-
documentElementScroll: function getDEScrollHeight(){
|
796
|
-
return document.documentElement.scrollHeight;
|
797
|
-
},
|
798
|
-
|
799
|
-
max: function getMaxHeight(){
|
800
|
-
return Math.max.apply(null,getAllMeasurements(getHeight));
|
801
|
-
},
|
802
|
-
|
803
|
-
min: function getMinHeight(){
|
804
|
-
return Math.min.apply(null,getAllMeasurements(getHeight));
|
805
|
-
},
|
806
|
-
|
807
|
-
grow: function growHeight(){
|
808
|
-
return getHeight.max(); //Run max without the forced downsizing
|
809
|
-
},
|
810
|
-
|
811
|
-
lowestElement: function getBestHeight(){
|
812
|
-
return Math.max(getHeight.bodyOffset(), getMaxElement('bottom',getAllElements()));
|
813
|
-
},
|
814
|
-
|
815
|
-
taggedElement: function getTaggedElementsHeight(){
|
816
|
-
return getTaggedElements('bottom','data-iframe-height');
|
817
|
-
}
|
818
|
-
},
|
819
|
-
|
820
|
-
getWidth = {
|
821
|
-
bodyScroll: function getBodyScrollWidth(){
|
822
|
-
return document.body.scrollWidth;
|
823
|
-
},
|
824
|
-
|
825
|
-
bodyOffset: function getBodyOffsetWidth(){
|
826
|
-
return document.body.offsetWidth;
|
827
|
-
},
|
828
|
-
|
829
|
-
custom: function getCustomWidth(){
|
830
|
-
return customCalcMethods.width();
|
831
|
-
},
|
832
|
-
|
833
|
-
documentElementScroll: function getDEScrollWidth(){
|
834
|
-
return document.documentElement.scrollWidth;
|
835
|
-
},
|
836
|
-
|
837
|
-
documentElementOffset: function getDEOffsetWidth(){
|
838
|
-
return document.documentElement.offsetWidth;
|
839
|
-
},
|
840
|
-
|
841
|
-
scroll: function getMaxWidth(){
|
842
|
-
return Math.max(getWidth.bodyScroll(), getWidth.documentElementScroll());
|
843
|
-
},
|
844
|
-
|
845
|
-
max: function getMaxWidth(){
|
846
|
-
return Math.max.apply(null,getAllMeasurements(getWidth));
|
847
|
-
},
|
848
|
-
|
849
|
-
min: function getMinWidth(){
|
850
|
-
return Math.min.apply(null,getAllMeasurements(getWidth));
|
851
|
-
},
|
852
|
-
|
853
|
-
rightMostElement: function rightMostElement(){
|
854
|
-
return getMaxElement('right', getAllElements());
|
855
|
-
},
|
856
|
-
|
857
|
-
taggedElement: function getTaggedElementsWidth(){
|
858
|
-
return getTaggedElements('right', 'data-iframe-width');
|
859
|
-
}
|
860
|
-
};
|
861
|
-
|
862
|
-
|
863
|
-
function sizeIFrame(triggerEvent, triggerEventDesc, customHeight, customWidth){
|
864
|
-
|
865
|
-
function resizeIFrame(){
|
866
|
-
height = currentHeight;
|
867
|
-
width = currentWidth;
|
868
|
-
|
869
|
-
sendMsg(height,width,triggerEvent);
|
870
|
-
}
|
871
|
-
|
872
|
-
function isSizeChangeDetected(){
|
873
|
-
function checkTolarance(a,b){
|
874
|
-
var retVal = Math.abs(a-b) <= tolerance;
|
875
|
-
return !retVal;
|
876
|
-
}
|
877
|
-
|
878
|
-
currentHeight = (undefined !== customHeight) ? customHeight : getHeight[heightCalcMode]();
|
879
|
-
currentWidth = (undefined !== customWidth ) ? customWidth : getWidth[widthCalcMode]();
|
880
|
-
|
881
|
-
return checkTolarance(height,currentHeight) || (calculateWidth && checkTolarance(width,currentWidth));
|
882
|
-
}
|
883
|
-
|
884
|
-
function isForceResizableEvent(){
|
885
|
-
return !(triggerEvent in {'init':1,'interval':1,'size':1});
|
886
|
-
}
|
887
|
-
|
888
|
-
function isForceResizableCalcMode(){
|
889
|
-
return (heightCalcMode in resetRequiredMethods) || (calculateWidth && widthCalcMode in resetRequiredMethods);
|
890
|
-
}
|
891
|
-
|
892
|
-
function logIgnored(){
|
893
|
-
log('No change in size detected');
|
894
|
-
}
|
895
|
-
|
896
|
-
function checkDownSizing(){
|
897
|
-
if (isForceResizableEvent() && isForceResizableCalcMode()){
|
898
|
-
resetIFrame(triggerEventDesc);
|
899
|
-
} else if (!(triggerEvent in {'interval':1})){
|
900
|
-
logIgnored();
|
901
|
-
}
|
902
|
-
}
|
903
|
-
|
904
|
-
var currentHeight,currentWidth;
|
905
|
-
|
906
|
-
if (isSizeChangeDetected() || 'init' === triggerEvent){
|
907
|
-
lockTrigger();
|
908
|
-
resizeIFrame();
|
909
|
-
} else {
|
910
|
-
checkDownSizing();
|
911
|
-
}
|
912
|
-
}
|
913
|
-
|
914
|
-
var sizeIFrameThrottled = throttle(sizeIFrame);
|
915
|
-
|
916
|
-
function sendSize(triggerEvent, triggerEventDesc, customHeight, customWidth){
|
917
|
-
function recordTrigger(){
|
918
|
-
if (!(triggerEvent in {'reset':1,'resetPage':1,'init':1})){
|
919
|
-
log( 'Trigger event: ' + triggerEventDesc );
|
920
|
-
}
|
921
|
-
}
|
922
|
-
|
923
|
-
function isDoubleFiredEvent(){
|
924
|
-
return triggerLocked && (triggerEvent in doubleEventList);
|
925
|
-
}
|
926
|
-
|
927
|
-
if (!isDoubleFiredEvent()){
|
928
|
-
recordTrigger();
|
929
|
-
sizeIFrameThrottled(triggerEvent, triggerEventDesc, customHeight, customWidth);
|
930
|
-
} else {
|
931
|
-
log('Trigger event cancelled: '+triggerEvent);
|
932
|
-
}
|
933
|
-
}
|
934
|
-
|
935
|
-
function lockTrigger(){
|
936
|
-
if (!triggerLocked){
|
937
|
-
triggerLocked = true;
|
938
|
-
log('Trigger event lock on');
|
939
|
-
}
|
940
|
-
clearTimeout(triggerLockedTimer);
|
941
|
-
triggerLockedTimer = setTimeout(function(){
|
942
|
-
triggerLocked = false;
|
943
|
-
log('Trigger event lock off');
|
944
|
-
log('--');
|
945
|
-
},eventCancelTimer);
|
946
|
-
}
|
947
|
-
|
948
|
-
function triggerReset(triggerEvent){
|
949
|
-
height = getHeight[heightCalcMode]();
|
950
|
-
width = getWidth[widthCalcMode]();
|
951
|
-
|
952
|
-
sendMsg(height,width,triggerEvent);
|
953
|
-
}
|
954
|
-
|
955
|
-
function resetIFrame(triggerEventDesc){
|
956
|
-
var hcm = heightCalcMode;
|
957
|
-
heightCalcMode = heightCalcModeDefault;
|
958
|
-
|
959
|
-
log('Reset trigger event: ' + triggerEventDesc);
|
960
|
-
lockTrigger();
|
961
|
-
triggerReset('reset');
|
962
|
-
|
963
|
-
heightCalcMode = hcm;
|
964
|
-
}
|
965
|
-
|
966
|
-
function sendMsg(height,width,triggerEvent,msg,targetOrigin){
|
967
|
-
function setTargetOrigin(){
|
968
|
-
if (undefined === targetOrigin){
|
969
|
-
targetOrigin = targetOriginDefault;
|
970
|
-
} else {
|
971
|
-
log('Message targetOrigin: '+targetOrigin);
|
972
|
-
}
|
973
|
-
}
|
974
|
-
|
975
|
-
function sendToParent(){
|
976
|
-
var
|
977
|
-
size = height + ':' + width,
|
978
|
-
message = myID + ':' + size + ':' + triggerEvent + (undefined !== msg ? ':' + msg : '');
|
979
|
-
|
980
|
-
log('Sending message to host page (' + message + ')');
|
981
|
-
target.postMessage( msgID + message, targetOrigin);
|
982
|
-
}
|
983
|
-
|
984
|
-
if(true === sendPermit){
|
985
|
-
setTargetOrigin();
|
986
|
-
sendToParent();
|
987
|
-
}
|
988
|
-
}
|
989
|
-
|
990
|
-
function receiver(event) {
|
991
|
-
var processRequestFromParent = {
|
992
|
-
init: function initFromParent(){
|
993
|
-
function fireInit(){
|
994
|
-
initMsg = event.data;
|
995
|
-
target = event.source;
|
996
|
-
|
997
|
-
init();
|
998
|
-
firstRun = false;
|
999
|
-
setTimeout(function(){ initLock = false;},eventCancelTimer);
|
1000
|
-
}
|
1001
|
-
|
1002
|
-
if (document.body){
|
1003
|
-
fireInit();
|
1004
|
-
} else {
|
1005
|
-
log('Waiting for page ready');
|
1006
|
-
addEventListener(window,'readystatechange',processRequestFromParent.initFromParent);
|
1007
|
-
}
|
1008
|
-
},
|
1009
|
-
|
1010
|
-
reset: function resetFromParent(){
|
1011
|
-
if (!initLock){
|
1012
|
-
log('Page size reset by host page');
|
1013
|
-
triggerReset('resetPage');
|
1014
|
-
} else {
|
1015
|
-
log('Page reset ignored by init');
|
1016
|
-
}
|
1017
|
-
},
|
1018
|
-
|
1019
|
-
resize: function resizeFromParent(){
|
1020
|
-
sendSize('resizeParent','Parent window requested size check');
|
1021
|
-
},
|
1022
|
-
|
1023
|
-
moveToAnchor: function moveToAnchorF(){
|
1024
|
-
inPageLinks.findTarget(getData());
|
1025
|
-
},
|
1026
|
-
inPageLink: function inPageLinkF() {this.moveToAnchor();}, //Backward compatability
|
1027
|
-
|
1028
|
-
pageInfo: function pageInfoFromParent(){
|
1029
|
-
var msgBody = getData();
|
1030
|
-
log('PageInfoFromParent called from parent: ' + msgBody );
|
1031
|
-
pageInfoCallback(JSON.parse(msgBody));
|
1032
|
-
log(' --');
|
1033
|
-
},
|
1034
|
-
|
1035
|
-
message: function messageFromParent(){
|
1036
|
-
var msgBody = getData();
|
1037
|
-
|
1038
|
-
log('MessageCallback called from parent: ' + msgBody );
|
1039
|
-
messageCallback(JSON.parse(msgBody));
|
1040
|
-
log(' --');
|
1041
|
-
}
|
1042
|
-
};
|
1043
|
-
|
1044
|
-
function isMessageForUs(){
|
1045
|
-
return msgID === (''+event.data).substr(0,msgIdLen); //''+ Protects against non-string messages
|
1046
|
-
}
|
1047
|
-
|
1048
|
-
function getMessageType(){
|
1049
|
-
return event.data.split(']')[1].split(':')[0];
|
1050
|
-
}
|
1051
|
-
|
1052
|
-
function getData(){
|
1053
|
-
return event.data.substr(event.data.indexOf(':')+1);
|
1054
|
-
}
|
1055
|
-
|
1056
|
-
function isMiddleTier(){
|
1057
|
-
return ('iFrameResize' in window);
|
1058
|
-
}
|
1059
|
-
|
1060
|
-
function isInitMsg(){
|
1061
|
-
//Test if this message is from a child below us. This is an ugly test, however, updating
|
1062
|
-
//the message format would break backwards compatibity.
|
1063
|
-
return event.data.split(':')[2] in {'true':1,'false':1};
|
1064
|
-
}
|
1065
|
-
|
1066
|
-
function callFromParent(){
|
1067
|
-
var messageType = getMessageType();
|
1068
|
-
|
1069
|
-
if (messageType in processRequestFromParent){
|
1070
|
-
processRequestFromParent[messageType]();
|
1071
|
-
} else if (!isMiddleTier() && !isInitMsg()){
|
1072
|
-
warn('Unexpected message ('+event.data+')');
|
1073
|
-
}
|
1074
|
-
}
|
1075
|
-
|
1076
|
-
function processMessage(){
|
1077
|
-
if (false === firstRun) {
|
1078
|
-
callFromParent();
|
1079
|
-
} else if (isInitMsg()) {
|
1080
|
-
processRequestFromParent.init();
|
1081
|
-
} else {
|
1082
|
-
log('Ignored message of type "' + getMessageType() + '". Received before initialization.');
|
1083
|
-
}
|
1084
|
-
}
|
1085
|
-
|
1086
|
-
if (isMessageForUs()){
|
1087
|
-
processMessage();
|
1088
|
-
}
|
1089
|
-
}
|
1090
|
-
|
1091
|
-
//Normally the parent kicks things off when it detects the iFrame has loaded.
|
1092
|
-
//If this script is async-loaded, then tell parent page to retry init.
|
1093
|
-
function chkLateLoaded(){
|
1094
|
-
if('loading' !== document.readyState){
|
1095
|
-
window.parent.postMessage('[iFrameResizerChild]Ready','*');
|
1096
|
-
}
|
1097
|
-
}
|
1098
|
-
|
1099
|
-
addEventListener(window, 'message', receiver);
|
1100
|
-
chkLateLoaded();
|
1101
|
-
|
1102
|
-
|
1103
|
-
|
1104
|
-
})(window || {});
|