j1-template 2020.0.11 → 2020.0.16
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/about_box.proc +2 -2
- data/_includes/themes/j1/blocks/footer/boxes/links_box.proc +3 -3
- data/_includes/themes/j1/blocks/footer/boxes/news_box.proc +3 -3
- 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 +26 -25
- data/_includes/themes/j1/layouts/content_generator_post.html +13 -13
- 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 +0 -1
- data/_includes/themes/j1/modules/navigator/procedures/topsearch.proc +5 -5
- data/_includes/themes/j1/procedures/global/create_word_cloud.proc +5 -2
- data/_includes/themes/j1/procedures/layouts/content_writer.proc +8 -9
- data/_includes/themes/j1/procedures/layouts/module_writer.proc +3 -13
- data/_includes/themes/j1/procedures/posts/collate_timeline.proc +14 -14
- data/_layouts/default.html +60 -59
- data/apps/public/cc/index.adoc +1 -5
- data/assets/data/authclient.html +48 -27
- data/assets/data/banner.html +23 -23
- data/assets/data/carousel.json +30 -21
- data/assets/data/cookiebar.html +277 -0
- data/assets/data/footer.html +14 -7
- data/assets/data/galleries.json +90 -81
- data/assets/data/gallery_customizer.html +21 -12
- data/assets/data/jupyter/notebooks/_html/template.full.head.html +10 -10
- data/assets/data/jupyter/notebooks/_html/visualisation.html +11 -11
- data/assets/data/jupyter/notebooks/html/template.html +7 -7
- data/assets/data/jupyter/notebooks/html/visualisation.ok.html +12 -12
- data/assets/data/jupyter/notebooks/visualisation.ipynb +1 -1
- data/assets/data/mdi_icons.json +55 -1
- data/assets/data/menu.html +16 -9
- data/assets/data/mmenu.html +48 -95
- data/assets/data/mmenu_sidebar.html +40 -44
- data/assets/data/mmenu_toc.html +20 -4
- data/assets/data/panel.html +44 -38
- data/assets/data/quicklinks.html +36 -20
- data/assets/data/search.json +165 -0
- data/assets/data/ssm.html +15 -4
- data/assets/data/themes.json +17 -6
- data/assets/data/twa_v1.json +54 -0
- data/assets/themes/j1/adapter/js/algolia.js +28 -17
- data/assets/themes/j1/adapter/js/attic.js +51 -40
- data/assets/themes/j1/adapter/js/carousel.js +27 -13
- data/assets/themes/j1/adapter/js/clipboard.js +232 -0
- data/assets/themes/j1/adapter/js/cookiebar.js +204 -0
- data/assets/themes/j1/adapter/js/framer.js +37 -21
- data/assets/themes/j1/adapter/js/gallery_customizer.js +230 -250
- data/assets/themes/j1/adapter/js/j1.js +563 -803
- data/assets/themes/j1/adapter/js/{justified_gallery.js → jf_gallery.js} +32 -22
- data/assets/themes/j1/adapter/js/lightbox.js +20 -10
- data/assets/themes/j1/adapter/js/logger.js +13 -6
- data/assets/themes/j1/adapter/js/mdb.js +164 -0
- data/assets/themes/j1/adapter/js/mmenu.js +60 -69
- data/assets/themes/j1/adapter/js/navigator.js +200 -169
- data/assets/themes/j1/adapter/js/searcher.js +30 -14
- data/assets/themes/j1/adapter/js/ssm.js +111 -88
- data/assets/themes/j1/adapter/js/themer.js +71 -103
- data/assets/themes/j1/adapter/js/toccer.js +30 -22
- data/assets/themes/j1/core/css/animate.css +2382 -0
- data/assets/themes/j1/core/css/animate.min.css +7 -0
- data/assets/themes/j1/core/css/fontawesome.css +4415 -0
- data/assets/themes/j1/core/css/fontawesome.min.css +1 -0
- data/assets/themes/j1/core/css/iconify-icons.css +4106 -0
- data/assets/themes/j1/core/css/iconify-icons.min.css +1 -0
- data/assets/themes/j1/core/css/material-design-icons.css +14532 -0
- data/assets/themes/j1/core/css/material-design-icons.min.css +1 -0
- data/assets/themes/j1/core/css/theme_extensions.css +326 -3004
- data/assets/themes/j1/core/css/theme_extensions.min.css +1 -1
- data/assets/themes/j1/core/css/twemoji.css +9485 -0
- data/assets/themes/j1/core/css/twemoji.min.css +1 -0
- data/assets/themes/j1/core/css/uno.css +453 -3039
- data/assets/themes/j1/core/css/uno.min.css +1 -1
- data/assets/themes/j1/core/css/vendor.css +884 -33335
- data/assets/themes/j1/core/css/vendor.min.css +2 -9
- data/assets/themes/j1/core/js/template.js +25 -416
- 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/modules/backstretch/js/backstretch.js +1695 -0
- data/assets/themes/j1/modules/backstretch/js/backstretch.min.js +21 -0
- data/assets/themes/j1/modules/backstretch/js/backstretch.min.js.org +1 -0
- data/assets/themes/j1/modules/bmd/css/bootstrap-material-design.css +12177 -0
- data/assets/themes/j1/modules/bmd/css/bootstrap-material-design.min.css +8 -0
- data/assets/themes/j1/modules/bmd/js/bootstrap-material-design.js +6930 -0
- data/assets/themes/j1/modules/bmd/js/bootstrap-material-design.js.map +1 -0
- data/assets/themes/j1/modules/bmd/js/bootstrap-material-design.min.js +1 -0
- data/assets/themes/j1/modules/bootstrap/css/bootstrap.css +10278 -0
- data/assets/themes/j1/modules/bootstrap/css/bootstrap.css.map +1 -0
- data/assets/themes/j1/modules/bootstrap/css/bootstrap.min.css +7 -0
- data/assets/themes/j1/modules/bootstrap/css/bootstrap.min.css.map +1 -0
- data/assets/themes/j1/modules/bootstrap/js/bootstrap.js +4420 -0
- data/assets/themes/j1/modules/bootstrap/js/bootstrap.js.map +1 -0
- data/assets/themes/j1/modules/bootstrap/js/bootstrap.min.js +7 -0
- data/assets/themes/j1/modules/bootstrap/js/bootstrap.min.js.map +1 -0
- data/assets/themes/j1/modules/bsDatepicker/css/datepicker.css +203 -0
- data/assets/themes/j1/modules/bsDatepicker/css/theme/uno.css +235 -0
- data/assets/themes/j1/modules/bsDatepicker/js/datepicker.js +509 -0
- data/assets/themes/j1/modules/bsDatepicker/less/datepicker.less +122 -0
- data/assets/themes/j1/modules/bsThemeSwitcher/js/switcher.js +435 -0
- data/assets/themes/j1/modules/bsThemeSwitcher/js/switcher.min.js +20 -0
- data/assets/themes/j1/{extensions → modules}/carousel/css/carousel.css +1 -1
- data/assets/themes/j1/{extensions → modules}/carousel/css/carousel.min.css +1 -1
- data/assets/themes/j1/{extensions → modules}/carousel/css/carousel_transitions.css +1 -1
- data/assets/themes/j1/{extensions → modules}/carousel/css/carousel_transitions.min.css +1 -1
- data/assets/themes/j1/{extensions → modules}/carousel/css/theme/uno.css +1 -1
- data/assets/themes/j1/{extensions → modules}/carousel/css/theme/uno.min.css +1 -1
- data/assets/themes/j1/{extensions → modules}/carousel/images/ajax-loader.gif +0 -0
- data/assets/themes/j1/{extensions → modules}/carousel/images/grabbing.png +0 -0
- data/assets/themes/j1/{extensions → modules}/carousel/images/owl-logo.png +0 -0
- data/assets/themes/j1/{extensions → modules}/carousel/images/owl.video.play.png +0 -0
- data/assets/themes/j1/{extensions → modules}/carousel/js/carousel.js +0 -0
- data/assets/themes/j1/{extensions → modules}/carousel/js/carousel.min.js +0 -0
- data/assets/themes/j1/modules/clipboard/LICENSE +20 -0
- data/assets/themes/j1/modules/clipboard/css/theme/uno.css +52 -0
- data/assets/themes/j1/modules/clipboard/css/theme/uno.min.css +52 -0
- data/assets/themes/j1/modules/clipboard/js/clipboard.js +975 -0
- data/assets/themes/j1/modules/clipboard/js/clipboard.min.js +7 -0
- data/assets/themes/j1/{extensions/iconify → modules/iconifyAPI}/js/iconify.min.js +0 -0
- data/assets/themes/j1/modules/iframeResizer/LICENSE +21 -0
- data/assets/themes/j1/modules/iframeResizer/examples/frame.absolute.html +127 -0
- data/assets/themes/j1/modules/iframeResizer/examples/frame.content.html +157 -0
- data/assets/themes/j1/modules/iframeResizer/examples/frame.hover.html +68 -0
- data/assets/themes/j1/modules/iframeResizer/examples/frame.nested.html +100 -0
- data/assets/themes/j1/modules/iframeResizer/examples/frame.textarea.html +45 -0
- data/assets/themes/j1/modules/iframeResizer/examples/frame.tolerance.html +113 -0
- data/assets/themes/j1/modules/iframeResizer/examples/index.html +83 -0
- data/assets/themes/j1/modules/iframeResizer/examples/two.html +88 -0
- data/assets/themes/j1/modules/iframeResizer/js/client/iframeResizer.contentWindow.js +1288 -0
- data/assets/themes/j1/modules/iframeResizer/js/client/iframeResizer.contentWindow.map +1 -0
- data/assets/themes/j1/modules/iframeResizer/js/client/iframeResizer.contentWindow.min.js +10 -0
- data/assets/themes/j1/modules/iframeResizer/js/iframeResizer.js +1390 -0
- data/assets/themes/j1/modules/iframeResizer/js/iframeResizer.map +1 -0
- data/assets/themes/j1/modules/iframeResizer/js/iframeResizer.min.js +9 -0
- data/assets/themes/j1/modules/jekyllSearch/js/simple-jekyll-search.js +468 -0
- data/assets/themes/j1/modules/jekyllSearch/js/simple-jekyll-search.min.js +6 -0
- data/assets/themes/j1/modules/jqMouseWheel/README.md +76 -0
- data/assets/themes/j1/modules/jqMouseWheel/js/jquery.mousewheel.js +221 -0
- data/assets/themes/j1/modules/jqMouseWheel/js/jquery.mousewheel.min.js +9 -0
- data/assets/themes/j1/modules/jquery/js/jquery.js +10869 -0
- data/assets/themes/j1/modules/jquery/js/jquery.min.js +2 -0
- data/assets/themes/j1/{extensions/justified_gallery → modules/justifiedGallery}/LICENSE +0 -0
- data/assets/themes/j1/{extensions/justified_gallery → modules/justifiedGallery}/README.md +0 -0
- data/assets/themes/j1/{extensions/justified_gallery → modules/justifiedGallery}/_versions/v3.7.0/css/justifiedGallery.css +0 -0
- data/assets/themes/j1/{extensions/justified_gallery → modules/justifiedGallery}/_versions/v3.7.0/css/justifiedGallery.min.css +0 -0
- data/assets/themes/j1/{extensions/justified_gallery → modules/justifiedGallery}/_versions/v3.7.0/css/theme/uno.css +1 -1
- data/assets/themes/j1/{extensions/justified_gallery → modules/justifiedGallery}/_versions/v3.7.0/js/justifiedGallery.3.7.0.js +0 -0
- data/assets/themes/j1/{extensions/justified_gallery → modules/justifiedGallery}/_versions/v3.7.0/js/justifiedGallery.js +0 -0
- data/assets/themes/j1/{extensions/justified_gallery → modules/justifiedGallery}/_versions/v3.7.0/js/justifiedGallery.min.js +0 -0
- data/assets/themes/j1/{extensions/justified_gallery → modules/justifiedGallery}/_versions/v3.7.0/less/.csslintrc +0 -0
- data/assets/themes/j1/{extensions/justified_gallery → modules/justifiedGallery}/_versions/v3.7.0/less/justifiedGallery.less +0 -0
- data/assets/themes/j1/{extensions/justified_gallery → modules/justifiedGallery}/_versions/v4.0.0/css/justifiedGallery.css +0 -0
- data/assets/themes/j1/{extensions/justified_gallery → modules/justifiedGallery}/_versions/v4.0.0/css/justifiedGallery.min.css +0 -0
- data/assets/themes/j1/{extensions/justified_gallery → modules/justifiedGallery}/_versions/v4.0.0/css/theme/uno.css +1 -1
- data/assets/themes/j1/{extensions/justified_gallery → modules/justifiedGallery}/_versions/v4.0.0/js/jquery.justifiedGallery.js +0 -0
- data/assets/themes/j1/{extensions/justified_gallery → modules/justifiedGallery}/_versions/v4.0.0/js/jquery.justifiedGallery.min.js +0 -0
- data/assets/themes/j1/{extensions/justified_gallery → modules/justifiedGallery}/css/justifiedGallery.css +0 -0
- data/assets/themes/j1/{extensions/justified_gallery → modules/justifiedGallery}/css/justifiedGallery.min.css +0 -0
- data/assets/themes/j1/{extensions/justified_gallery → modules/justifiedGallery}/css/theme/uno.css +1 -1
- data/assets/themes/j1/{extensions/justified_gallery → modules/justifiedGallery}/css/theme/uno.min.css +1 -1
- data/assets/themes/j1/{extensions/justified_gallery → modules/justifiedGallery}/js/justifiedGallery.js +0 -0
- data/assets/themes/j1/{extensions/justified_gallery → modules/justifiedGallery}/js/justifiedGallery.min.js +0 -0
- data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/core/lg-fb-comment-box.css +0 -0
- data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/core/lg-fb-comment-box.min.css +0 -0
- data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/core/lg-transitions.css +0 -0
- data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/core/lg-transitions.min.css +0 -0
- data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/core/lightgallery.css +0 -0
- data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/core/lightgallery.min.css +0 -0
- data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/fonts/lg.eot +0 -0
- data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/fonts/lg.svg +0 -0
- data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/fonts/lg.ttf +0 -0
- data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/fonts/lg.woff +0 -0
- data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/img/loading.gif +0 -0
- data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/img/video-play.png +0 -0
- data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/img/vimeo-play.png +0 -0
- data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/img/youtube-play.png +0 -0
- data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/themes/icons/animation-w.png +0 -0
- data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/themes/icons/customize-w.png +0 -0
- data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/themes/icons/dynamic-w.png +0 -0
- data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/themes/icons/facebook-icon.svg +0 -0
- data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/themes/icons/googleplus-icon.svg +0 -0
- data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/themes/icons/html5-w.png +0 -0
- data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/themes/icons/linked-in.png +0 -0
- data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/themes/icons/module-w.png +0 -0
- data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/themes/icons/play-button.png +0 -0
- data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/themes/icons/responsive-w.png +0 -0
- data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/themes/icons/thumb-w.png +0 -0
- data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/themes/icons/touch-w.png +0 -0
- data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/themes/icons/twitter-icon.svg +0 -0
- data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/themes/icons/twitter.png +0 -0
- data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/themes/icons/video1-w.png +0 -0
- data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/themes/icons/zoom-w.png +0 -0
- data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/themes/icons/zoom.png +0 -0
- data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/themes/uno.css +1 -1
- data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/themes/uno.min.css +1 -1
- data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/js/core/lightgallery.js +0 -0
- data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/js/core/lightgallery.min.js +0 -0
- data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/js/modules/j1/j1-video.js +0 -0
- data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/js/modules/j1/j1-video.min.js +0 -0
- data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/js/modules/lg-autoplay.js +0 -0
- data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/js/modules/lg-autoplay.min.js +0 -0
- data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/js/modules/lg-fullscreen.js +0 -0
- data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/js/modules/lg-fullscreen.min.js +0 -0
- data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/js/modules/lg-hash.js +0 -0
- data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/js/modules/lg-hash.min.js +0 -0
- data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/js/modules/lg-pager.js +0 -0
- data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/js/modules/lg-pager.min.js +0 -0
- data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/js/modules/lg-share.js +0 -0
- data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/js/modules/lg-share.min.js +0 -0
- data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/js/modules/lg-thumbnail.js +0 -0
- data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/js/modules/lg-thumbnail.min.js +0 -0
- data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/js/modules/lg-video.js +0 -0
- data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/js/modules/lg-video.min.js +0 -0
- data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/js/modules/lg-zoom.js +0 -0
- data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/js/modules/lg-zoom.min.js +0 -0
- data/assets/themes/j1/modules/lightbox/LICENSE +22 -0
- data/assets/themes/j1/modules/lightbox/css/lightbox.css +224 -0
- data/assets/themes/j1/modules/lightbox/css/lightbox.min.css +21 -0
- data/assets/themes/j1/modules/lightbox/css/theme/uno.css +25 -0
- data/assets/themes/j1/modules/lightbox/css/theme/uno.min.css +26 -0
- data/assets/themes/j1/modules/lightbox/images/close.png +0 -0
- data/assets/themes/j1/modules/lightbox/images/loading.gif +0 -0
- data/assets/themes/j1/modules/lightbox/images/next.png +0 -0
- data/assets/themes/j1/modules/lightbox/images/prev.png +0 -0
- data/assets/themes/j1/modules/lightbox/js/lightbox.js +583 -0
- data/assets/themes/j1/modules/lightbox/js/lightbox.min.js +35 -0
- data/assets/themes/j1/modules/mmenuLight/css/mmenu.css +392 -0
- data/assets/themes/j1/modules/mmenuLight/css/mmenu.min.css +393 -0
- data/assets/themes/j1/modules/mmenuLight/css/theme/uno.css +178 -0
- data/assets/themes/j1/modules/mmenuLight/css/theme/uno.min.css +170 -0
- data/assets/themes/j1/modules/mmenuLight/js/mmenu.js +563 -0
- data/assets/themes/j1/modules/mmenuLight/js/mmenu.min.js +30 -0
- data/assets/themes/j1/modules/noUISlider/LICENSE +13 -0
- data/assets/themes/j1/modules/noUISlider/css/nouislider.css +260 -0
- data/assets/themes/j1/modules/noUISlider/css/nouislider.min.css +1 -0
- data/assets/themes/j1/modules/noUISlider/js/nouislider.js +2312 -0
- data/assets/themes/j1/modules/noUISlider/js/nouislider.min.js +3 -0
- data/assets/themes/j1/modules/polyfills/js/msie.js +140 -0
- data/assets/themes/j1/modules/popper/js/popper.js +2623 -0
- data/assets/themes/j1/modules/popper/js/popper.js.map +1 -0
- data/assets/themes/j1/modules/popper/js/popper.min.js +4 -0
- data/assets/themes/j1/modules/popper/js/popper.min.js.map +1 -0
- data/assets/themes/j1/{extensions → modules}/rouge/css/base16.dark/theme.css +0 -0
- data/assets/themes/j1/{extensions → modules}/rouge/css/base16.light/theme.css +0 -0
- data/assets/themes/j1/{extensions → modules}/rouge/css/base16.monokai.dark/theme.css +0 -0
- data/assets/themes/j1/{extensions → modules}/rouge/css/base16.monokai.light/theme.css +0 -0
- data/assets/themes/j1/{extensions → modules}/rouge/css/base16.monokai/theme.css +0 -0
- data/assets/themes/j1/{extensions → modules}/rouge/css/base16.solarized.dark/theme.css +0 -0
- data/assets/themes/j1/{extensions → modules}/rouge/css/base16.solarized.light/theme.css +0 -0
- data/assets/themes/j1/{extensions → modules}/rouge/css/base16.solarized/theme.css +0 -0
- data/assets/themes/j1/{extensions → modules}/rouge/css/base16/theme.css +0 -0
- data/assets/themes/j1/{extensions → modules}/rouge/css/colorful/theme.css +0 -0
- data/assets/themes/j1/{extensions → modules}/rouge/css/github/theme.css +0 -0
- data/assets/themes/j1/{extensions → modules}/rouge/css/gruvbox.dark/theme.css +0 -0
- data/assets/themes/j1/{extensions → modules}/rouge/css/gruvbox.light/theme.css +0 -0
- data/assets/themes/j1/{extensions → modules}/rouge/css/gruvbox/theme.css +0 -0
- data/assets/themes/j1/{extensions → modules}/rouge/css/igorpro/theme.css +0 -0
- data/assets/themes/j1/{extensions → modules}/rouge/css/molokai/theme.css +0 -0
- data/assets/themes/j1/{extensions → modules}/rouge/css/monokai.sublime/theme.css +0 -0
- data/assets/themes/j1/{extensions → modules}/rouge/css/monokai/theme.css +0 -0
- data/assets/themes/j1/{extensions → modules}/rouge/css/pastie/theme.css +0 -0
- data/assets/themes/j1/{extensions → modules}/rouge/css/thankful_eyes/theme.css +0 -0
- data/assets/themes/j1/{extensions → modules}/rouge/css/tulip/theme.css +0 -0
- data/assets/themes/j1/modules/tocbot/css/theme/uno.css +89 -0
- data/assets/themes/j1/modules/tocbot/css/theme/uno.min.css +89 -0
- data/assets/themes/j1/modules/tocbot/css/tocbot.css +75 -0
- data/assets/themes/j1/modules/tocbot/css/tocbot.min.css +19 -0
- data/assets/themes/j1/modules/tocbot/js/tocbot.js +19 -0
- data/assets/themes/j1/modules/tocbot/js/tocbot.min.js +19 -0
- data/assets/themes/j1/modules/twemoji/js/LICENSE +21 -0
- data/assets/themes/j1/modules/twemoji/js/picker/LICENSE +21 -0
- data/assets/themes/j1/modules/twemoji/js/picker/twemoji-picker.js +275 -0
- data/assets/themes/j1/modules/twemoji/js/picker/twemoji-picker.min.js +275 -0
- data/assets/themes/j1/modules/twemoji/js/twemoji.js +589 -0
- data/assets/themes/j1/modules/twemoji/js/twemoji.min.js +25 -0
- data/assets/themes/j1/modules/util/js/js.cookie.js +163 -0
- data/assets/themes/j1/modules/util/js/lite-url.js +203 -0
- data/assets/themes/j1/modules/util/js/lite-url.min.js +7 -0
- data/assets/themes/j1/{extensions/log4javascript/log4javascript.min.js → modules/util/js/log4javascript.js} +0 -2
- data/assets/themes/j1/modules/util/js/platform.js +1260 -0
- data/assets/themes/j1/{extensions → modules}/videojs/css/themes/city.css +0 -0
- data/assets/themes/j1/{extensions → modules}/videojs/css/themes/city.min.css +0 -0
- data/assets/themes/j1/{extensions → modules}/videojs/css/themes/fantasy.css +0 -0
- data/assets/themes/j1/{extensions → modules}/videojs/css/themes/fantasy.min.css +0 -0
- data/assets/themes/j1/{extensions → modules}/videojs/css/themes/forest.css +0 -0
- data/assets/themes/j1/{extensions → modules}/videojs/css/themes/forest.min.css +0 -0
- data/assets/themes/j1/{extensions → modules}/videojs/css/themes/sea.css +0 -0
- data/assets/themes/j1/{extensions → modules}/videojs/css/themes/sea.min.css +0 -0
- data/assets/themes/j1/{extensions → modules}/videojs/css/video-js.css +0 -0
- data/assets/themes/j1/{extensions → modules}/videojs/css/video-js.min.css +0 -0
- data/assets/themes/j1/{extensions → modules}/videojs/js/video.js +0 -0
- data/assets/themes/j1/{extensions → modules}/videojs/js/video.min.js +0 -0
- data/assets/themes/j1/{extensions → modules}/vimeo/froogaloop/js/froogaloop2.min.js +0 -0
- data/assets/themes/j1/{extensions → modules}/vimeo/player/js/player.js +0 -0
- data/assets/themes/j1/{extensions → modules}/vimeo/player/js/player.js.map +0 -0
- data/assets/themes/j1/{extensions → modules}/vimeo/player/js/player.min.js +0 -0
- data/assets/themes/j1/{extensions → modules}/vimeo/player/js/player.min.js.map +0 -0
- data/lib/j1/version.rb +1 -1
- data/lib/j1_app/j1_auth_manager/views/auth_manager_ui.erb +391 -389
- data/lib/starter_web/Gemfile +22 -13
- 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 +23 -31
- data/lib/starter_web/_data/blocks/footer.yml +10 -3
- data/lib/starter_web/_data/blocks/panel.yml +21 -21
- 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/cookiebar.yml +2 -2
- data/lib/starter_web/_data/modules/defaults/attics.yml +16 -15
- data/lib/starter_web/_data/modules/defaults/authentication.yml +8 -9
- data/lib/starter_web/_data/modules/defaults/cookie_consent.yml +75 -12
- data/lib/starter_web/_data/modules/defaults/cookiebar.yml +101 -50
- data/lib/starter_web/_data/modules/defaults/jekyll_search.yml +12 -9
- data/lib/starter_web/_data/modules/defaults/navigator.yml +57 -21
- data/lib/starter_web/_data/modules/jekyll_search.yml +1 -20
- data/lib/starter_web/_data/modules/navigator.yml +1 -1
- data/lib/starter_web/_data/modules/navigator_menu.yml +6 -7
- data/lib/starter_web/_data/modules/themer.yml +10 -11
- data/lib/starter_web/_data/resources.yml +379 -174
- data/lib/starter_web/_data/template_settings.yml +96 -4
- data/lib/starter_web/_data/utilities/util_srv.yml +1 -1
- data/lib/starter_web/_plugins/asciidoctor-extensions/banner.rb +43 -0
- 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/panel.rb +43 -0
- data/lib/starter_web/_plugins/asciidoctor-extensions/twitter-emoji-inline.rb +2 -2
- data/lib/starter_web/_plugins/{asciidoctor-extensions/lorem-inline.rb → lorem-inline.rb} +0 -0
- data/lib/starter_web/_plugins/minifyJS.rb +54 -0
- data/lib/starter_web/_plugins/minifyJSON.rb +47 -0
- data/lib/starter_web/assets/images/pages/material/apple-touch-icon.png +0 -0
- data/lib/starter_web/assets/videos/headers/still/underground-broadway.webp +0 -0
- data/lib/starter_web/assets/videos/headers/still/victoria-oskolovich-on-vimeo.webp +0 -0
- data/lib/starter_web/collections/posts/public/featured/_posts/0000-00-00-welcome-to-j1-template.adoc.erb +3 -4
- data/lib/starter_web/collections/posts/public/featured/_posts/2018-05-01-confusion-about-base-url.adoc +1 -1
- data/lib/starter_web/collections/posts/public/featured/_posts/2019-05-01-top-open-source-static-site-generators.adoc +17 -17
- data/lib/starter_web/collections/posts/public/featured/_posts/2019-06-01-about-cookies.adoc +36 -40
- data/lib/starter_web/collections/posts/public/series/_posts/2018-11-01-docker-using-shared-folders.adoc +4 -6
- data/lib/starter_web/collections/posts/public/wikipedia/_posts/2016-11-20-minneapolis.adoc +1 -3
- data/lib/starter_web/collections/posts/public/wikipedia/_posts/2016-11-24-narcisse-snake-dens.adoc +3 -3
- data/lib/starter_web/collections/posts/public/wikipedia/_posts/2016-11-26-columbia-river.adoc +4 -4
- data/lib/starter_web/index.html +12 -13
- data/lib/starter_web/package.json +10 -10
- data/lib/starter_web/pages/{public → protected}/site_search.adoc +2 -2
- data/lib/starter_web/pages/public/blog/navigator/archive.html +24 -18
- data/lib/starter_web/pages/public/blog/navigator/archive/categoryview.html +39 -34
- data/lib/starter_web/pages/public/blog/navigator/archive/dateview.html +43 -30
- data/lib/starter_web/pages/public/blog/navigator/archive/tagview.html +29 -29
- data/lib/starter_web/pages/public/blog/navigator/index.html +2 -2
- data/lib/starter_web/pages/public/learn/examples/floating_ad.adoc +221 -0
- data/lib/starter_web/pages/public/learn/examples/floating_div.adoc +33 -1
- data/lib/starter_web/pages/public/learn/kickstarter/web_in_a_day/100_meet_and_greet_jekyll.adoc +1 -0
- data/lib/starter_web/pages/public/learn/roundtrip/000_bs_tour.1.asciidoc +1 -2
- data/lib/starter_web/pages/public/learn/roundtrip/000_bs_tour.adoc +1 -2
- data/lib/starter_web/pages/public/learn/roundtrip/000_bs_tour_api.adoc +16 -18
- data/lib/starter_web/pages/public/learn/roundtrip/000_includes/attributes.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/100_present_videos.adoc +2 -2
- data/lib/starter_web/pages/public/learn/roundtrip/200_typography.adoc +7 -3
- data/lib/starter_web/pages/public/learn/roundtrip/300_icon_fonts.adoc +36 -45
- data/lib/starter_web/pages/public/learn/roundtrip/400_asciidoc_extensions.adoc +1 -1
- data/lib/starter_web/pages/public/learn/roundtrip/410_bs_modals_extentions.adoc +9 -10
- data/lib/starter_web/pages/public/learn/roundtrip/420_responsive_tables_extensions.adoc +39 -39
- data/lib/starter_web/pages/public/learn/roundtrip/500_themes.adoc +20 -22
- data/lib/starter_web/pages/public/{previewer/mdb_preview → learn/roundtrip/510_mdb_preview}/000_includes/attributes.asciidoc +0 -0
- data/lib/starter_web/pages/public/{previewer/mdb_preview → learn/roundtrip/510_mdb_preview}/000_includes/documents/100_buttons.asciidoc +0 -0
- data/lib/starter_web/pages/public/{previewer/mdb_preview → learn/roundtrip/510_mdb_preview}/mdb_previewer.adoc +2 -2
- data/lib/starter_web/pages/public/learn/vtutorials/000_includes/attributes.asciidoc +1 -1
- data/lib/starter_web/pages/public/learn/vtutorials/000_includes/documents/419_advanced_modals_html.asciidoc +5 -5
- data/lib/starter_web/pages/public/learn/whats_up.adoc +2 -2
- data/lib/starter_web/pages/public/previewer/bootstrap_theme.adoc +11 -13
- data/lib/starter_web/pages/public/previewer/iframer.adoc +17 -15
- data/lib/starter_web/pages/public/previewer/justified_gallery.html +2 -2
- data/lib/starter_web/pages/public/previewer/mdi_icons_preview.adoc +2 -2
- data/lib/starter_web/pages/public/previewer/twitter_emoji_preview.adoc +3 -3
- data/lib/starter_web/utilsrv/_defaults/package.json +1 -1
- data/lib/starter_web/utilsrv/package.json +1 -1
- metadata +255 -165
- data/assets/data/colors.json +0 -42
- data/assets/data/cookie_consent.html +0 -223
- data/assets/data/font_sizes.json +0 -42
- data/assets/data/messages.yml +0 -131
- data/assets/data/search.yml +0 -153
- data/assets/themes/j1/adapter/js/cookie_consent.js +0 -277
- data/assets/themes/j1/core/css/custom.scss +0 -28
- data/assets/themes/j1/core/css/globals.css +0 -14523
- data/assets/themes/j1/core/css/globals.min.css +0 -1
- data/assets/themes/j1/core/css/uno.scss +0 -28
- data/assets/themes/j1/core/css/vendor.scss +0 -28
- 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/lib/starter_web/_data/modules/cookie_consent.yml +0 -128
- data/lib/starter_web/assets/videos/headers/still/underground-broadway.png +0 -0
- data/lib/starter_web/assets/videos/headers/still/victoria-oskolovich-on-vimeo.png +0 -0
- data/lib/starter_web/pages/public/clear_button.adoc +0 -121
@@ -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 || {});
|