j1-template 2023.2.7 → 2023.3.1
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/layouts/content_generator_news_panel_posts.html +2 -1
- data/_includes/themes/j1/layouts/content_generator_post.html +2 -2
- data/_includes/themes/j1/layouts/layout_metadata_generator.html +38 -38
- data/_includes/themes/j1/procedures/blocks/footer/boxes/about_box.proc +1 -1
- data/_includes/themes/j1/procedures/blocks/footer/boxes/contacts_box.proc +1 -1
- data/_includes/themes/j1/procedures/blocks/footer/boxes/issue.proc +1 -1
- data/_includes/themes/j1/procedures/blocks/footer/boxes/links_box.proc +1 -1
- data/_includes/themes/j1/procedures/blocks/footer/boxes/news_box.proc +1 -1
- data/_includes/themes/j1/procedures/layouts/default_writer.proc +1 -3
- data/_includes/themes/j1/procedures/layouts/module_writer.proc +7 -23
- data/_includes/themes/j1/procedures/layouts/resource_writer.proc +8 -8
- data/_includes/themes/j1/procedures/posts/create_series_header.proc +1 -1
- data/_layouts/compress.html +26 -21
- data/_layouts/default.html +36 -30
- data/assets/data/banner.html +5 -2
- data/assets/data/footer.html +15 -3
- data/assets/data/masonry.html +1 -1
- data/assets/data/masterslider.html +1 -0
- data/assets/data/menu.html +4 -4
- data/assets/data/panel.html +6 -3
- data/assets/data/quicklinks.html +138 -149
- data/assets/error_pages/HTTP204.html +3 -3
- data/assets/error_pages/HTTP400.html +3 -3
- data/assets/error_pages/HTTP401.html +3 -3
- data/assets/error_pages/HTTP403.html +3 -3
- data/assets/error_pages/HTTP404.html +3 -3
- data/assets/error_pages/HTTP444.html +3 -3
- data/assets/error_pages/HTTP445.html +3 -3
- data/assets/error_pages/HTTP446.html +5 -5
- data/assets/error_pages/HTTP447.html +7 -7
- data/assets/error_pages/HTTP448.html +7 -7
- data/assets/error_pages/HTTP500.html +3 -3
- data/assets/error_pages/HTTP501.html +3 -3
- data/assets/error_pages/HTTP502.html +3 -3
- data/assets/error_pages/HTTP503.html +3 -3
- data/assets/themes/j1/adapter/js/advertising.js +355 -156
- data/assets/themes/j1/adapter/js/analytics.js +1 -1
- data/assets/themes/j1/adapter/js/asciidoctor.js +1 -1
- data/assets/themes/j1/adapter/js/attic.js +22 -14
- data/assets/themes/j1/adapter/js/bmd.js +1 -1
- data/assets/themes/j1/adapter/js/carousel.js +5 -4
- data/assets/themes/j1/adapter/js/clipboard.js +1 -1
- data/assets/themes/j1/adapter/js/comments.js +5 -5
- data/assets/themes/j1/adapter/js/cookieConsent.js +1 -1
- data/assets/themes/j1/adapter/js/customFunctions.js +1 -1
- data/assets/themes/j1/adapter/js/customModule.js +1 -1
- data/assets/themes/j1/adapter/js/dropdowns.js +4 -2
- data/assets/themes/j1/adapter/js/fab.js +9 -6
- data/assets/themes/j1/adapter/js/framer.js +1 -1
- data/assets/themes/j1/adapter/js/iconPicker.js +227 -0
- data/assets/themes/j1/adapter/js/j1.js +402 -76
- data/assets/themes/j1/adapter/js/justifiedGallery.js +9 -3
- data/assets/themes/j1/adapter/js/justifiedGalleryCustomizer.js +2 -2
- data/assets/themes/j1/adapter/js/lightbox.js +4 -3
- data/assets/themes/j1/adapter/js/logger.js +1 -1
- data/assets/themes/j1/adapter/js/lunr.js +1 -1
- data/assets/themes/j1/adapter/js/masonry.js +4 -3
- data/assets/themes/j1/adapter/js/masterslider.js +30 -57
- data/assets/themes/j1/adapter/js/mmenu.js +2 -2
- data/assets/themes/j1/adapter/js/navigator.js +7 -5
- data/assets/themes/j1/adapter/js/nbinteract.js +9 -9
- data/assets/themes/j1/adapter/js/particles.js +2 -2
- data/assets/themes/j1/adapter/js/rangeSlider.js +2 -2
- data/assets/themes/j1/adapter/js/rouge.js +2 -2
- data/assets/themes/j1/adapter/js/rtable.js +1 -1
- data/assets/themes/j1/adapter/js/rtextResizer.js +1 -1
- data/assets/themes/j1/adapter/js/scroller.js +97 -109
- data/assets/themes/j1/adapter/js/slick.js +28 -18
- data/assets/themes/j1/adapter/js/themeToggler.js +259 -0
- data/assets/themes/j1/adapter/js/themer.js +63 -23
- data/assets/themes/j1/adapter/js/toccer.js +9 -6
- data/assets/themes/j1/adapter/js/translator.js +4 -2
- data/assets/themes/j1/adapter/js/waves.js +6 -4
- data/assets/themes/j1/core/css/themes/bootstrap/bootstrap.css +1322 -417
- data/assets/themes/j1/core/css/themes/bootstrap/bootstrap.min.css +3 -3
- data/assets/themes/j1/core/css/themes/unodark/bootstrap.css +2064 -1273
- data/assets/themes/j1/core/css/themes/unodark/bootstrap.min.css +3 -3
- data/assets/themes/j1/core/css/themes/unolight/bootstrap.css +10280 -9399
- data/assets/themes/j1/core/css/themes/unolight/bootstrap.min.css +10 -10
- data/assets/themes/j1/core/css/vendor.css +0 -14
- data/assets/themes/j1/core/css/vendor.min.css +1 -1
- data/assets/themes/j1/modules/backstretch/js/backstretch.js +6 -4
- data/assets/themes/j1/modules/backstretch/js/backstretch.min.js +1 -1
- data/assets/themes/j1/modules/deeplAPI/js/deeplAPI.js +1 -1
- data/assets/themes/j1/modules/deeplAPI/js/deeplAPI.min.js +1 -1
- data/assets/themes/j1/modules/iconPicker/README.md +266 -0
- data/assets/themes/j1/modules/iconPicker/css/universal-icon-picker.css +419 -0
- data/assets/themes/j1/modules/iconPicker/css/universal-icon-picker.min.css +17 -0
- data/assets/themes/j1/modules/iconPicker/icons-libraries/font-awesome-brands.json +467 -0
- data/assets/themes/j1/modules/iconPicker/icons-libraries/font-awesome-brands.min.json +1 -0
- data/assets/themes/j1/modules/iconPicker/icons-libraries/font-awesome-regular.json +169 -0
- data/assets/themes/j1/modules/iconPicker/icons-libraries/font-awesome-regular.min.json +1 -0
- data/assets/themes/j1/modules/iconPicker/icons-libraries/font-awesome-solid.json +1136 -0
- data/assets/themes/j1/modules/iconPicker/icons-libraries/font-awesome-solid.min.json +1 -0
- data/assets/themes/j1/modules/iconPicker/icons-libraries/font-awesome.json +1772 -0
- data/assets/themes/j1/modules/iconPicker/icons-libraries/font-awesome.min.json +1 -0
- data/assets/themes/j1/modules/iconPicker/icons-libraries/mdi-icons-light.json +292 -0
- data/assets/themes/j1/modules/iconPicker/icons-libraries/mdi-icons-light.min.json +1 -0
- data/assets/themes/j1/modules/iconPicker/icons-libraries/mdi-icons-regular.json +7312 -0
- data/assets/themes/j1/modules/iconPicker/icons-libraries/mdi-icons-regular.min.json +1 -0
- data/assets/themes/j1/modules/iconPicker/images/magnifying-glass-solid.svg +1 -0
- data/assets/themes/j1/modules/iconPicker/images/star-of-life-solid.svg +3 -0
- data/assets/themes/j1/modules/iconPicker/images/xmark-solid.svg +3 -0
- data/assets/themes/j1/modules/iconPicker/js/universal-icon-picker.js +493 -0
- data/assets/themes/j1/modules/iconPicker/js/universal-icon-picker.min.js +17 -0
- data/assets/themes/j1/modules/jquery/AUTHORS.txt +372 -0
- data/assets/themes/j1/modules/jquery/LICENSE.txt +43 -0
- data/assets/themes/j1/modules/jquery/css/images/ui-icons_444444_256x240.png +0 -0
- data/assets/themes/j1/modules/jquery/css/images/ui-icons_555555_256x240.png +0 -0
- data/assets/themes/j1/modules/jquery/css/images/ui-icons_777620_256x240.png +0 -0
- data/assets/themes/j1/modules/jquery/css/images/ui-icons_777777_256x240.png +0 -0
- data/assets/themes/j1/modules/jquery/css/images/ui-icons_cc0000_256x240.png +0 -0
- data/assets/themes/j1/modules/jquery/css/images/ui-icons_ffffff_256x240.png +0 -0
- data/assets/themes/j1/modules/jquery/css/jquery-ui/jquery-ui.css +92 -92
- data/assets/themes/j1/modules/jquery/css/jquery-ui/jquery-ui.min.css +4 -4
- data/assets/themes/j1/modules/jquery/css/jquery-ui/jquery-ui.structure.css +88 -88
- data/assets/themes/j1/modules/jquery/css/jquery-ui/jquery-ui.structure.min.css +2 -2
- data/assets/themes/j1/modules/jquery/css/jquery-ui/jquery-ui.theme.css +4 -4
- data/assets/themes/j1/modules/jquery/css/jquery-ui/jquery-ui.theme.min.css +2 -2
- data/assets/themes/j1/modules/jquery/js/jquery-ui.js +13683 -13678
- data/assets/themes/j1/modules/jquery/js/jquery-ui.min.js +3 -3
- data/assets/themes/j1/modules/jquery/js/jquery.js +1029 -1203
- data/assets/themes/j1/modules/jquery/js/jquery.min.js +2 -2
- data/assets/themes/j1/modules/jquery/js/jquery.min.map +1 -1
- data/assets/themes/j1/modules/jquery-3.5.1/css/jquery-ui/jquery-ui.css +1315 -0
- data/assets/themes/j1/modules/jquery-3.5.1/css/jquery-ui/jquery-ui.min.css +7 -0
- data/assets/themes/j1/modules/jquery-3.5.1/css/jquery-ui/jquery-ui.structure.css +886 -0
- data/assets/themes/j1/modules/jquery-3.5.1/css/jquery-ui/jquery-ui.structure.min.css +5 -0
- data/assets/themes/j1/modules/jquery-3.5.1/css/jquery-ui/jquery-ui.theme.css +446 -0
- data/assets/themes/j1/modules/jquery-3.5.1/css/jquery-ui/jquery-ui.theme.min.css +5 -0
- data/assets/themes/j1/modules/jquery-3.5.1/js/extensions/hasClass.js +37 -0
- data/assets/themes/j1/modules/jquery-3.5.1/js/extensions/hasClass.min.js +17 -0
- data/assets/themes/j1/modules/jquery-3.5.1/js/extensions/removeClass.js +42 -0
- data/assets/themes/j1/modules/jquery-3.5.1/js/extensions/removeClass.min.js +17 -0
- data/assets/themes/j1/modules/jquery-3.5.1/js/jquery-ui.js +19057 -0
- data/assets/themes/j1/modules/jquery-3.5.1/js/jquery-ui.min.js +6 -0
- data/assets/themes/j1/modules/jquery-3.5.1/js/jquery.js +10872 -0
- data/assets/themes/j1/modules/jquery-3.5.1/js/jquery.min.js +2 -0
- data/assets/themes/j1/modules/jquery-3.5.1/js/jquery.min.map +1 -0
- data/assets/themes/j1/modules/jquery-3.5.1/js/require.js +2145 -0
- data/assets/themes/j1/modules/jquery-3.5.1/js/require.min.js +5 -0
- data/assets/themes/j1/modules/lightGallery/js/modules/j1/j1-video.js +2 -2
- data/assets/themes/j1/modules/lightGallery/js/modules/j1/j1-video.min.js +1 -1
- data/assets/themes/j1/modules/masterslider/css/theme/uno.css +9 -9
- data/assets/themes/j1/modules/masterslider/css/theme/uno.min.css +1 -1
- data/assets/themes/j1/modules/mmenuLight/css/theme/uno/mmenu.css +2 -2
- data/assets/themes/j1/modules/mmenuLight/css/theme/uno/mmenu.min.css +1 -1
- data/assets/themes/j1/modules/rouge/css/uno.dark/theme.css +136 -47
- data/assets/themes/j1/modules/rouge/css/uno.light/theme.css +9 -9
- data/assets/themes/j1/modules/scroller/js/scroller.js +76 -69
- data/assets/themes/j1/modules/scroller/js/scroller.min.js +1 -1
- data/assets/themes/j1/modules/translator/js/translator.js +1 -1
- data/assets/themes/j1/modules/translator/js/translator.min.js +1 -1
- data/lib/j1/version.rb +1 -1
- data/lib/starter_web/Gemfile +2 -2
- data/lib/starter_web/README.md +5 -5
- data/lib/starter_web/_config.yml +5 -2
- data/lib/starter_web/_data/blocks/banner.yml +8 -5
- data/lib/starter_web/_data/blocks/defaults/footer.yml +4 -4
- data/lib/starter_web/_data/blocks/footer.yml +12 -5
- data/lib/starter_web/_data/blocks/panel.yml +41 -38
- data/lib/starter_web/_data/j1_config.yml +68 -58
- data/lib/starter_web/_data/layouts/collection.yml +1 -0
- data/lib/starter_web/_data/layouts/default.yml +1 -1
- data/lib/starter_web/_data/layouts/home.yml +38 -9
- data/lib/starter_web/_data/layouts/news_panel_posts.yml +1 -0
- data/lib/starter_web/_data/layouts/page.yml +2 -1
- data/lib/starter_web/_data/layouts/post.yml +1 -0
- data/lib/starter_web/_data/layouts/raw.yml +1 -0
- data/lib/starter_web/_data/modules/advertising.yml +209 -58
- data/lib/starter_web/_data/modules/analytics.yml +2 -2
- data/lib/starter_web/_data/modules/attics.yml +4 -7
- data/lib/starter_web/_data/modules/defaults/advertising.yml +3 -2
- data/lib/starter_web/_data/modules/defaults/attics.yml +3 -3
- data/lib/starter_web/_data/modules/defaults/iconPicker.yml +42 -0
- data/lib/starter_web/_data/modules/defaults/navigator.yml +15 -13
- data/lib/starter_web/_data/modules/defaults/theme_toggler.yml +42 -0
- data/lib/starter_web/_data/modules/iconPicker.yml +64 -0
- data/lib/starter_web/_data/modules/masonry.yml +3 -3
- data/lib/starter_web/_data/modules/masterslider.yml +5 -5
- data/lib/starter_web/_data/modules/navigator_menu.yml +311 -160
- data/lib/starter_web/_data/modules/scroller.yml +8 -8
- data/lib/starter_web/_data/modules/slick.yml +47 -86
- data/lib/starter_web/_data/modules/theme_toggler.yml +29 -0
- data/lib/starter_web/_data/modules/themer.yml +0 -6
- data/lib/starter_web/_data/resources.yml +54 -53
- data/lib/starter_web/_data/templates/feed.xml +1 -1
- data/lib/starter_web/_includes/attributes.0.asciidoc +626 -0
- data/lib/starter_web/_includes/attributes.asciidoc +81 -72
- data/lib/starter_web/_includes/google/static/google_ad_5128488466.html +19 -0
- data/lib/starter_web/_includes/google/static/google_ad_7284712660.html +19 -0
- data/lib/starter_web/_includes/google/templates/google_ads.html +55 -0
- data/lib/starter_web/_plugins/asciidoctor/google-ad-block.rb +47 -0
- data/lib/starter_web/_plugins/index/lunr.rb +1 -1
- data/lib/starter_web/assets/images/badges/configBinder.jpg +0 -0
- data/lib/starter_web/assets/images/badges/docsBinder.jpg +0 -0
- data/lib/starter_web/assets/images/badges/notebookBinder.jpg +0 -0
- data/lib/starter_web/assets/images/badges/scaleable/configBinder.svg +1 -1
- data/lib/starter_web/assets/images/badges/scaleable/docsBinder.svg +1 -1
- data/lib/starter_web/assets/images/badges/scaleable/myBinder.svg +1 -1
- data/lib/starter_web/assets/images/badges/scaleable/notebookBinder.svg +1 -1
- data/lib/starter_web/assets/images/icons/hyvor-talk/jpg/hyvor-logo.512x512.jpg +0 -0
- data/lib/starter_web/assets/images/icons/hyvor-talk/png/hyvor-logo.24x24.jpg +0 -0
- data/lib/starter_web/assets/images/icons/hyvor-talk/scalable/hyvor-logo.svg +1 -1
- data/lib/starter_web/assets/images/icons/j1/jpg/j1-256x256.jpg +0 -0
- data/lib/starter_web/assets/images/icons/j1/jpg/j1-512x512.jpg +0 -0
- data/lib/starter_web/assets/images/icons/j1/jpg/j1-64x64.jpg +0 -0
- data/lib/starter_web/assets/images/icons/j1/png/j1-256x256.png +0 -0
- data/lib/starter_web/assets/images/icons/j1/png/j1-512x512.jpg +0 -0
- data/lib/starter_web/assets/images/icons/j1/png/j1-512x512.jpg.png +0 -0
- data/lib/starter_web/assets/images/icons/j1/png/j1-512x512.png +0 -0
- data/lib/starter_web/assets/images/icons/j1/png/j1-64x64.png +0 -0
- data/lib/starter_web/assets/images/icons/j1/scalable/j1.svg +1 -1
- data/lib/starter_web/assets/images/icons/mdi/mdi.svg +1 -0
- data/lib/starter_web/assets/images/icons/mdi/mdil.svg +1 -0
- data/lib/starter_web/assets/images/modules/attics/1920x1280/alexander-redl.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/1920x1280/alina-grubnyak.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/1920x1280/andrea-badino.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/1920x1280/brad-neathery.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/1920x1280/brigitta-schneiter.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/1920x1280/bruno-figueiredo.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/1920x1280/clem-onojeghuo.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/1920x1280/core_web_vitals_best.png +0 -0
- data/lib/starter_web/assets/images/modules/attics/1920x1280/crawford-jolly.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/1920x1280/eleni-afiontzi.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/1920x1280/fly-d.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/1920x1280/guillaume-bolduc.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/1920x1280/harpal-singh.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/1920x1280/hayden-mills-2.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/1920x1280/j1-content-mockup-1.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/1920x1280/j1-content-mockup-2.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/1920x1280/j1-content-mockup-3.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/1920x1280/j1-starter-mockup-1.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/1920x1280/john-schnobrich-2.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/1920x1280/josep-martins.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/1920x1280/josh-liu.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/1920x1280/kelly-sikkemal.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/1920x1280/kira-auf-der-heide.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/1920x1280/kristopher-roller.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/1920x1280/kristopher-roller.webp +0 -0
- data/lib/starter_web/assets/images/modules/attics/1920x1280/matthaeus.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/1920x1280/melanie-deziel.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/1920x1280/milad-fakurian.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/1920x1280/mohammad-rahmani.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/1920x1280/nasa.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/1920x1280/quino-al-2.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/1920x1280/recha-oktaviani.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/building-blocks-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/christina-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/cookies-1920x1200.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/katie-moum-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/modules/icons/j1/scalable/j1.svg +1 -1
- data/lib/starter_web/assets/images/pages/asciidoc_skeletons/example-pdf-screenshot.jpg +0 -0
- data/lib/starter_web/assets/images/pages/core_web_vitals/200-create-a-link-1.jpg +0 -0
- data/lib/starter_web/assets/images/pages/core_web_vitals/core_web_vitals_best.jpg +0 -0
- data/lib/starter_web/assets/images/pages/core_web_vitals/core_web_vitals_best_full.jpg +0 -0
- data/lib/starter_web/assets/images/pages/features/bootswatch-themes-1280x800.jpg +0 -0
- data/lib/starter_web/assets/images/pages/features/global-mobile-traffic-1920x1080.jpg +0 -0
- data/lib/starter_web/assets/images/pages/features/google-lighthouse-1080x300.jpg +0 -0
- data/lib/starter_web/assets/images/pages/features/mobile-navigation-600x800.jpg +0 -0
- data/lib/starter_web/assets/images/pages/features/native-speakers-by-language.jpg +0 -0
- data/lib/starter_web/assets/images/pages/html_validator/appdevtools-html-validator.jpg +0 -0
- data/lib/starter_web/assets/images/pages/html_validator/freeformatter-html-validator.jpg +0 -0
- data/lib/starter_web/assets/images/pages/html_validator/w3c-nu-checker.jpg +0 -0
- data/lib/starter_web/assets/images/pages/html_validator/w3c-validator.jpg +0 -0
- data/lib/starter_web/assets/images/posts/featured/dynamic-web-access.jpg +0 -0
- data/lib/starter_web/assets/images/posts/featured/jamstack-generators.jpg +0 -0
- data/lib/starter_web/assets/images/posts/featured/jekyll.1200x400.jpg +0 -0
- data/lib/starter_web/assets/images/posts/featured/jekyll.jpg +0 -0
- data/lib/starter_web/assets/images/posts/featured/static-web-access.jpg +0 -0
- data/lib/starter_web/assets/images/promo/home/screenshot.jpg +0 -0
- data/lib/starter_web/assets/images/quotes/promo/home/screenshot.jpg +0 -0
- data/lib/starter_web/assets/images/quotes/promo/jekyll/jekyll-faq.jpg +0 -0
- data/lib/starter_web/assets/images/quotes/promo/jekyll/jekyll-generator.jpg +0 -0
- data/lib/starter_web/assets/images/quotes/promo/jekyll/jekyll-generator.png +0 -0
- data/lib/starter_web/assets/images/quotes/promo/jekyll/jekyll-og.png +0 -0
- data/lib/starter_web/assets/images/quotes/promo/jekyll/scalable/jekyll-faq.psd +0 -0
- data/lib/starter_web/collections/_biography/a-life-in-questions.adoc +8 -9
- data/lib/starter_web/collections/_biography/becoming.adoc +23 -10
- data/lib/starter_web/collections/_biography/born-to-run.adoc +28 -10
- data/lib/starter_web/collections/_biography/forty-autumns.adoc +20 -13
- data/lib/starter_web/collections/_biography/not-dead-yet.adoc +25 -15
- data/lib/starter_web/collections/_biography/princess-diarist-the.adoc +24 -15
- data/lib/starter_web/collections/_biography/when-breath-becomes-air.adoc +25 -12
- data/lib/starter_web/collections/_fantasy/harry-potter-deathly-hallows.adoc +14 -10
- data/lib/starter_web/collections/_fantasy/harry-potter-philosophers-stone.adoc +11 -8
- data/lib/starter_web/collections/_fantasy/mistborn-trilogy.adoc +32 -8
- data/lib/starter_web/collections/_fantasy/ready-player-one.adoc +17 -14
- data/lib/starter_web/collections/_fantasy/sword-of-destiny.adoc +27 -13
- data/lib/starter_web/collections/_fantasy/terry-pratchet-diary.adoc +38 -15
- data/lib/starter_web/collections/_people/diana-petersen.adoc +2 -0
- data/lib/starter_web/collections/_people/larry-parker.adoc +2 -0
- data/lib/starter_web/collections/_people/parveen-anand.adoc +2 -0
- data/lib/starter_web/collections/_portfolio/branding.adoc +5 -0
- data/lib/starter_web/collections/_portfolio/graphic_design.adoc +5 -0
- data/lib/starter_web/collections/_portfolio/identity.adoc +5 -0
- data/lib/starter_web/collections/_portfolio/illustration.adoc +5 -0
- data/lib/starter_web/collections/_portfolio/photography.adoc +5 -0
- data/lib/starter_web/collections/_portfolio/web_design.adoc +5 -0
- data/lib/starter_web/collections/_romance/{breath-of-snow-and-ashes-a.adoc → breath-of-snow-and-ashes.adoc} +20 -5
- data/lib/starter_web/collections/_romance/dressmaker-the.adoc +26 -14
- data/lib/starter_web/collections/_romance/fiery-cross-the.adoc +12 -9
- data/lib/starter_web/collections/_romance/it-ends-with-us.adoc +14 -11
- data/lib/starter_web/collections/_romance/outlander-novel.adoc +48 -25
- data/lib/starter_web/collections/_romance/virgins-outlander-short-story.adoc +30 -15
- data/lib/starter_web/collections/posts/public/featured/_posts/0000-00-00-welcome-to-j1.adoc.erb +4 -2
- data/lib/starter_web/collections/posts/public/featured/_posts/2021-01-01-about-cookies.adoc +4 -1
- data/lib/starter_web/collections/posts/public/featured/_posts/2021-02-01-static-site-generators.adoc +5 -3
- data/lib/starter_web/collections/posts/public/featured/_posts/2022-02-01-about-j1.adoc +4 -1
- data/lib/starter_web/collections/posts/public/featured/_posts/_includes/attributes.asciidoc +2 -2
- data/lib/starter_web/index.html +1 -18
- data/lib/starter_web/package.json +3 -3
- data/lib/starter_web/pages/public/about/features.adoc +1 -1
- data/lib/starter_web/pages/public/about/reporting_issues.adoc +1 -1
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/attributes.asciidoc +1 -1
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/documents/100_converter/112_getting_started.asciidoc +1 -1
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/documents/200_themes/212_values.asciidoc +4 -4
- data/lib/starter_web/pages/public/blog/navigator/index.html +2 -2
- data/lib/starter_web/pages/public/learn/bookshelf/article_previewer/viewer_all_books.adoc +1 -1
- data/lib/starter_web/pages/public/learn/bookshelf/article_previewer/viewer_biography.adoc +1 -1
- data/lib/starter_web/pages/public/learn/bookshelf/article_previewer/viewer_fantasy.adoc +1 -1
- data/lib/starter_web/pages/public/learn/bookshelf/article_previewer/viewer_romance.adoc +1 -1
- data/lib/starter_web/pages/public/learn/bookshelf/jekyll_collections.adoc +75 -65
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/attributes.asciidoc +58 -0
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/accordion.asciidoc +34 -0
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/alerts.asciidoc +15 -0
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/badges.asciidoc +9 -0
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/body.asciidoc +14 -0
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/breadcrumbs.asciidoc +14 -0
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/buttons.asciidoc +75 -0
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/cards.asciidoc +22 -0
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/carousel.asciidoc +37 -0
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/close.asciidoc +15 -0
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/code.asciidoc +14 -0
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/color_system.asciidoc +353 -0
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/components.asciidoc +69 -0
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/dropdowns.asciidoc +53 -0
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/figures.asciidoc +5 -0
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/forms.asciidoc +270 -0
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/grid.asciidoc +49 -0
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/links.asciidoc +21 -0
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/list_groups.asciidoc +28 -0
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/modals.asciidoc +43 -0
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/navbar.asciidoc +45 -0
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/navs.asciidoc +28 -0
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/offcanvas.asciidoc +16 -0
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/options.asciidoc +30 -0
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/pagination.asciidoc +40 -0
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/paragraph.asciidoc +5 -0
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/placeholders.asciidoc +5 -0
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/popovers.asciidoc +28 -0
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/position.asciidoc +8 -0
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/progress_bars.asciidoc +12 -0
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/spacing.asciidoc +14 -0
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/spinners.asciidoc +12 -0
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/tables.asciidoc +55 -0
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/thumbnails.asciidoc +9 -0
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/toasts.asciidoc +18 -0
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/tooltips.asciidoc +28 -0
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/typography.asciidoc +115 -0
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/z_index.asciidoc +26 -0
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/tables/_table.asciidoc +9 -0
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/tables/accordion.asciidoc +87 -0
- data/lib/starter_web/pages/public/learn/bs_sass_variables/bs_sass_variables.adoc +262 -0
- data/lib/starter_web/pages/public/learn/core_web_vitals/_includes/attributes.asciidoc +59 -0
- data/lib/starter_web/pages/public/learn/core_web_vitals/_includes/documents/100_chapter.asciidoc +541 -0
- data/lib/starter_web/pages/public/learn/core_web_vitals/_includes/documents/200_chapter.asciidoc +33 -0
- data/lib/starter_web/pages/public/learn/core_web_vitals/_includes/tables/build_command_options.asciidoc +72 -0
- data/lib/starter_web/pages/public/learn/core_web_vitals/_includes/tables/files_and_folders.asciidoc +66 -0
- data/lib/starter_web/pages/public/learn/core_web_vitals/_includes/tables/global_configuration_options.asciidoc +63 -0
- data/lib/starter_web/pages/public/learn/core_web_vitals/_includes/tables/global_variables.asciidoc +26 -0
- data/lib/starter_web/pages/public/learn/core_web_vitals/_includes/tables/page_variables.asciidoc +54 -0
- data/lib/starter_web/pages/public/learn/core_web_vitals/_includes/tables/serve_command_options.asciidoc +45 -0
- data/lib/starter_web/pages/public/learn/core_web_vitals/_includes/tables/site_variables.asciidoc +59 -0
- data/lib/starter_web/pages/public/learn/core_web_vitals/core_web_vitals.adoc +442 -0
- data/lib/starter_web/pages/public/learn/roundtrip/_includes/attributes.0.asciidoc +112 -0
- data/lib/starter_web/pages/public/learn/roundtrip/_includes/attributes.asciidoc +2 -2
- data/lib/starter_web/pages/public/learn/roundtrip/_includes/documents/100_gistblock.asciidoc +3 -4
- data/lib/starter_web/pages/public/learn/roundtrip/_includes/documents/themes_rouge.asciidoc +1 -1
- data/lib/starter_web/pages/public/learn/roundtrip/asciidoc_extensions.adoc +2 -2
- data/lib/starter_web/pages/public/learn/roundtrip/icon_fonts.adoc +10 -10
- data/lib/starter_web/pages/public/learn/roundtrip/present_images.adoc +35 -4
- data/lib/starter_web/pages/public/learn/roundtrip/responsive_tables.adoc +3 -3
- data/lib/starter_web/pages/public/learn/where_to_go.adoc +41 -49
- data/lib/starter_web/pages/public/legal/en/100_copyright.adoc +2 -2
- data/lib/starter_web/pages/public/legal/en/300_privacy.adoc +2 -2
- data/lib/starter_web/pages/public/legal/en/400_comment_policy.adoc +2 -2
- data/lib/starter_web/pages/public/tools/cheatsheet/gem.adoc +255 -0
- data/lib/starter_web/pages/public/tools/cheatsheet/git.adoc +1458 -0
- data/lib/starter_web/pages/public/tools/cheatsheet/j1.adoc +63 -0
- data/lib/starter_web/pages/public/tools/cheatsheet/yaml.adoc +514 -0
- data/lib/starter_web/pages/public/{previewer → tools/previewer}/preview_bootstrap_theme.adoc +94 -5
- data/lib/starter_web/utilsrv/_defaults/package.json +1 -1
- data/lib/starter_web/utilsrv/package.json +1 -1
- metadata +169 -60
- data/_includes/themes/j1/modules/ads/google_ad_content_home.html +0 -11
- data/_includes/themes/j1/modules/ads/google_ad_top_home.html +0 -11
- data/assets/themes/j1/core/css/nbinteract-tutorial/styles.css +0 -1711
- data/assets/themes/j1/core/css/nbinteract-tutorial/styles.min.css +0 -1
- data/assets/themes/j1/modules/advertising/js/google/adInitializer.js +0 -127
- data/assets/themes/j1/modules/deeplAPI/js/deeplAPI.2.js +0 -460
- data/assets/themes/j1/modules/mdiPreviewer/css/previewer.css +0 -97
- data/assets/themes/j1/modules/mdiPreviewer/css/previewer.min.css +0 -15
- data/assets/themes/j1/modules/mdiPreviewer/js/previewer.js +0 -115
- data/assets/themes/j1/modules/mdiPreviewer/js/previewer.min.js +0 -15
- data/assets/themes/j1/modules/mdilPreviewer/css/previewer.css +0 -97
- data/assets/themes/j1/modules/mdilPreviewer/css/previewer.min.css +0 -15
- data/assets/themes/j1/modules/mdilPreviewer/js/previewer.js +0 -125
- data/assets/themes/j1/modules/mdilPreviewer/js/previewer.min.js +0 -15
- data/lib/starter_web/_includes/themes/j1/modules/ads/google_ad_content_home.html +0 -11
- data/lib/starter_web/_includes/themes/j1/modules/ads/google_ad_top_home.html +0 -11
- data/lib/starter_web/assets/images/icons/j1/j1-256x256.gif +0 -0
- data/lib/starter_web/assets/images/pages/asciidoc_skeletons/example-pdf-screenshot.png +0 -0
- data/lib/starter_web/assets/images/pages/features/bootswatch-themes-1280x800.png +0 -0
- data/lib/starter_web/assets/images/pages/features/global-mobile-traffic-1920x1080.png +0 -0
- data/lib/starter_web/assets/images/pages/features/google-lighthouse-1080x300.png +0 -0
- data/lib/starter_web/assets/images/pages/features/mobile-navigation-600x800.png +0 -0
- data/lib/starter_web/assets/images/pages/features/native-speakers-by-language.png +0 -0
- data/lib/starter_web/assets/images/pages/nbinteract/binderhub-architecture.jpg +0 -0
- data/lib/starter_web/assets/images/pages/nbinteract/jupyterlab-architecture.jpg +0 -0
- data/lib/starter_web/assets/images/pages/nbinteract/mandelbrot-menge-1920x1200.jpg +0 -0
- data/lib/starter_web/assets/images/pages/nbinteract/mandelbrot-menge.png +0 -0
- data/lib/starter_web/assets/images/pages/nbinteract/manual/nbi-textbook-example.jpg +0 -0
- data/lib/starter_web/assets/images/pages/nbinteract/manual/nbi_bar.jpg +0 -0
- data/lib/starter_web/assets/images/pages/nbinteract/manual/nbi_hist.jpg +0 -0
- data/lib/starter_web/assets/images/pages/nbinteract/manual/nbi_line.jpg +0 -0
- data/lib/starter_web/assets/images/pages/nbinteract/manual/nbi_multiple_choice.jpg +0 -0
- data/lib/starter_web/assets/images/pages/nbinteract/manual/nbi_scatter.jpg +0 -0
- data/lib/starter_web/assets/images/pages/nbinteract/manual/nbi_scatter_drag.jpg +0 -0
- data/lib/starter_web/assets/images/pages/nbinteract/manual/nbi_short_answer.jpg +0 -0
- data/lib/starter_web/assets/images/pages/nbinteract/nbi-textbook-example.jpg +0 -0
- data/lib/starter_web/assets/images/posts/featured/dynamic-web-access.png +0 -0
- data/lib/starter_web/assets/images/posts/featured/jamstack-generators.png +0 -0
- data/lib/starter_web/assets/images/posts/featured/jekyll.1200x400.png +0 -0
- data/lib/starter_web/assets/images/posts/featured/jekyll.png +0 -0
- data/lib/starter_web/assets/images/posts/featured/post-1.jpg +0 -0
- data/lib/starter_web/assets/images/posts/featured/post-2.jpg +0 -0
- data/lib/starter_web/assets/images/posts/featured/post-3.jpg +0 -0
- data/lib/starter_web/assets/images/posts/featured/post-4.jpg +0 -0
- data/lib/starter_web/assets/images/posts/featured/post-5.jpg +0 -0
- data/lib/starter_web/assets/images/posts/featured/static-web-access.png +0 -0
- data/lib/starter_web/collections/posts/public/series/_posts/2022-08-01-organize-your-life.adoc +0 -118
- data/lib/starter_web/collections/posts/public/series/_posts/2022-08-02-organize-your-life.adoc +0 -118
- data/lib/starter_web/collections/posts/public/series/_posts/2022-08-03-organize-your-life.adoc +0 -118
- data/lib/starter_web/collections/posts/public/series/_posts/2022-09-01-organize-your-life.adoc +0 -117
- data/lib/starter_web/collections/posts/public/series/_posts/2022-09-02-organize-your-life.adoc +0 -117
- /data/lib/starter_web/assets/images/badges/{configBinder.png → png/configBinder.png} +0 -0
- /data/lib/starter_web/assets/images/badges/{docsBinder.png → png/docsBinder.png} +0 -0
- /data/lib/starter_web/assets/images/badges/{notebookBinder.png → png/notebookBinder.png} +0 -0
- /data/lib/starter_web/assets/images/icons/hyvor-talk/{hyvor-logo.24x24.png → png/hyvor-logo.24x24.png} +0 -0
- /data/lib/starter_web/assets/images/icons/hyvor-talk/{hyvor-logo.512x512.png → png/hyvor-logo.512x512.png} +0 -0
@@ -0,0 +1,493 @@
|
|
1
|
+
/*
|
2
|
+
# -----------------------------------------------------------------------------
|
3
|
+
# ~/theme_uno/modules/iconPicker/js/universal-icon-picker.js
|
4
|
+
# UniversalIconPicker v.1.1.0 implementation for J1 Theme
|
5
|
+
#
|
6
|
+
# Product/Info:
|
7
|
+
# https://jekyll.one
|
8
|
+
# https://github.com/migliori/universal-icon-picker
|
9
|
+
#
|
10
|
+
# Copyright (C) 2023 Juergen Adams
|
11
|
+
# Copyright (C) 2023 Gilles Migliori
|
12
|
+
#
|
13
|
+
# J1 Theme is licensed under the MIT License.
|
14
|
+
# See: https://github.com/jekyll-one-org/j1-template/blob/main/LICENSE.md
|
15
|
+
# -----------------------------------------------------------------------------
|
16
|
+
*/
|
17
|
+
const iconPickerUrl = document.currentScript.src.replace(/js\/([a-z\.-]+)$/gm, '');
|
18
|
+
const loadedDependencies = [];
|
19
|
+
|
20
|
+
(function (root, factory) {
|
21
|
+
if (typeof define === 'function' && define.amd) {
|
22
|
+
define([], factory('UniversalIconPicker'));
|
23
|
+
} else if (typeof exports === 'object') {
|
24
|
+
module.exports = factory('UniversalIconPicker');
|
25
|
+
} else {
|
26
|
+
root['UniversalIconPicker'] = factory('UniversalIconPicker');
|
27
|
+
}
|
28
|
+
}(this, function () {
|
29
|
+
'use strict';
|
30
|
+
|
31
|
+
const createDomEle = function (string) {
|
32
|
+
const ele = document.createElement('div');
|
33
|
+
ele.innerHTML = string;
|
34
|
+
return ele.firstChild;
|
35
|
+
}
|
36
|
+
|
37
|
+
const debounce = function (func, wait, immediate) {
|
38
|
+
let timeout;
|
39
|
+
return function () {
|
40
|
+
const context = this,
|
41
|
+
args = arguments;
|
42
|
+
const later = function () {
|
43
|
+
timeout = null;
|
44
|
+
if (!immediate) func.apply(context, args);
|
45
|
+
};
|
46
|
+
const callNow = immediate && !timeout;
|
47
|
+
clearTimeout(timeout);
|
48
|
+
timeout = setTimeout(later, wait);
|
49
|
+
if (callNow) func.apply(context, args);
|
50
|
+
};
|
51
|
+
};
|
52
|
+
|
53
|
+
const escapeHtml = function (text) {
|
54
|
+
const map = {
|
55
|
+
'&': '&',
|
56
|
+
'<': '<',
|
57
|
+
'>': '>',
|
58
|
+
'"': '"',
|
59
|
+
"'": '''
|
60
|
+
};
|
61
|
+
|
62
|
+
return text.replace(/[&<>"']/g, function (m) { return map[m]; });
|
63
|
+
};
|
64
|
+
|
65
|
+
/**
|
66
|
+
* Merge defaults with user options
|
67
|
+
* @param {Object} defaults Default settings
|
68
|
+
* @param {Object} options User options
|
69
|
+
*/
|
70
|
+
const extend = function (defaults, options) {
|
71
|
+
let prop, extended = {};
|
72
|
+
for (prop in defaults) {
|
73
|
+
if (Object.prototype.hasOwnProperty.call(defaults, prop)) {
|
74
|
+
extended[prop] = defaults[prop];
|
75
|
+
}
|
76
|
+
}
|
77
|
+
for (prop in options) {
|
78
|
+
if (Object.prototype.hasOwnProperty.call(options, prop)) {
|
79
|
+
extended[prop] = options[prop];
|
80
|
+
}
|
81
|
+
}
|
82
|
+
|
83
|
+
return extended;
|
84
|
+
};
|
85
|
+
|
86
|
+
const getLibraryName = function (string) {
|
87
|
+
return string.replace(/([A-Z])/g, ' $1');
|
88
|
+
}
|
89
|
+
|
90
|
+
/**
|
91
|
+
* Plugin Object
|
92
|
+
* @param selector The html selector to initialize
|
93
|
+
* @param {Object} options User options
|
94
|
+
* @constructor
|
95
|
+
*/
|
96
|
+
function UniversalIconPicker (selector, options) {
|
97
|
+
this.selector = selector;
|
98
|
+
|
99
|
+
let defaults = {
|
100
|
+
allowEmpty: true,
|
101
|
+
iconLibraries: null,
|
102
|
+
iconLibrariesCss: null,
|
103
|
+
mode: 'autoload', // autoload | onrequest
|
104
|
+
onBeforeOpen: null,
|
105
|
+
onReset: null,
|
106
|
+
onSelect: null,
|
107
|
+
resetSelector: null,
|
108
|
+
loadCustomCss: false
|
109
|
+
};
|
110
|
+
this.options = extend(defaults, options);
|
111
|
+
|
112
|
+
this.activeLibraryId = '';
|
113
|
+
this.filterIcon = '';
|
114
|
+
this.iconEventsLoaded = false;
|
115
|
+
this.iconLibraries = {};
|
116
|
+
this.iconLibrariesLoaded = false;
|
117
|
+
this.iconMarkup = '';
|
118
|
+
this.iconWrap = '';
|
119
|
+
this.idSuffix = '-' + this.selector.replace(/[#\s[\]="]/g, '');
|
120
|
+
this.sideBarBtn = '';
|
121
|
+
this.sideBarList = [];
|
122
|
+
|
123
|
+
this.universalWrap = '<div class="uip-modal uip-open" id="uip-modal' + this.idSuffix + '"><div class="uip-modal--content"><div class="uip-modal--header"><div class="uip-modal--header-logo-area"><span class="uip-modal--header-logo-title">Icon Picker</span></div><div class="uip-modal--header-close-btn"><img src="' + iconPickerUrl + '/images/xmark-solid.svg" width="40" height="40" alt="Close" title="Close" /></div></div><div class="uip-modal--body"><div id="uip-modal--sidebar' + this.idSuffix + '" class="uip-modal--sidebar"><div class="uip-modal--sidebar-tabs"></div></div><div id="uip-modal--icon-preview-wrap' + this.idSuffix + '" class="uip-modal--icon-preview-wrap"><div class="uip-modal--icon-search"><input name="" value="" placeholder="Filter by name..."><img src="' + iconPickerUrl + '/images/magnifying-glass-solid.svg" width="20" height="16" alt="Search" title="Search" /></div><div class="uip-modal--icon-preview-inner"><div id="uip-modal--icon-preview' + this.idSuffix + '" class="uip-modal--icon-preview"></div></div></div></div><div class="uip-modal--footer"><button class="uip-insert-icon-button mt-3 mb-3 mr-6">Copy to clipboard</button></div></div></div>';
|
124
|
+
|
125
|
+
this.universalDomEle = createDomEle(this.universalWrap);
|
126
|
+
this.sidebarTabs = this.universalDomEle.querySelector('.uip-modal--sidebar-tabs');
|
127
|
+
this.previewWrap = this.universalDomEle.querySelector('#uip-modal--icon-preview' + this.idSuffix);
|
128
|
+
this.searchInput = this.universalDomEle.querySelector('.uip-modal--icon-search input');
|
129
|
+
if (this.options.mode === 'autoload') {
|
130
|
+
this.init();
|
131
|
+
} else {
|
132
|
+
document.querySelector(this.selector).addEventListener('click', this.init.bind(this), { once: true });
|
133
|
+
}
|
134
|
+
}
|
135
|
+
|
136
|
+
|
137
|
+
// Plugin prototype
|
138
|
+
UniversalIconPicker.prototype = {
|
139
|
+
|
140
|
+
/* Public functions
|
141
|
+
------------------------------------------------------------------------ */
|
142
|
+
|
143
|
+
init: function () {
|
144
|
+
this._loadCssFiles();
|
145
|
+
if (this.options.mode !== 'autoload') {
|
146
|
+
this._onBeforeOpen().then(() => {
|
147
|
+
this.open();
|
148
|
+
});
|
149
|
+
}
|
150
|
+
document.querySelector(this.selector).addEventListener('click', () => {
|
151
|
+
this._onBeforeOpen().then(() => {
|
152
|
+
this.open();
|
153
|
+
});
|
154
|
+
});
|
155
|
+
|
156
|
+
//Remove selected icon
|
157
|
+
if (this.options.resetSelector) {
|
158
|
+
document.querySelector(this.options.resetSelector).addEventListener('click', this.options.onReset);
|
159
|
+
}
|
160
|
+
},
|
161
|
+
|
162
|
+
open: function () {
|
163
|
+
this._loadIconLibraries().then(() => {
|
164
|
+
this.iconLibrariesLoaded = true;
|
165
|
+
if (!document.getElementById('uip-modal' + this.idSuffix)) {
|
166
|
+
// push universal dom to body
|
167
|
+
document.body.appendChild(this.universalDomEle);
|
168
|
+
|
169
|
+
// jadams, 2023-05-21: disable page scrolling if modal is OPEN
|
170
|
+
document.body.classList.add('stop-scrolling');
|
171
|
+
|
172
|
+
// Icon library close by clicking close button
|
173
|
+
this.universalDomEle.querySelector('.uip-modal--header-close-btn').addEventListener('click', () => {
|
174
|
+
this.universalDomEle.classList.add('uip-close');
|
175
|
+
this.universalDomEle.classList.remove('uip-open');
|
176
|
+
// jadams, 2023-05-21: (re-)enable page scrolling if modal is CLOSED
|
177
|
+
document.body.classList.remove('stop-scrolling');
|
178
|
+
});
|
179
|
+
|
180
|
+
// Insert button
|
181
|
+
this.universalDomEle.querySelector('.uip-insert-icon-button').addEventListener('click', () => {
|
182
|
+
let selected = this.universalDomEle.querySelector('.universal-selected');
|
183
|
+
|
184
|
+
if (selected) {
|
185
|
+
let iconHtml = selected.querySelector('i').outerHTML;
|
186
|
+
let jsonOutput = {
|
187
|
+
'libraryId': selected.dataset.libraryId,
|
188
|
+
'libraryName': selected.dataset.libraryName,
|
189
|
+
'iconHtml': null,
|
190
|
+
'iconMarkup': null,
|
191
|
+
'iconClass': null,
|
192
|
+
'iconText': null
|
193
|
+
};
|
194
|
+
if (!selected.querySelector('i').classList.value.match('uip-icon-none')) {
|
195
|
+
jsonOutput.iconHtml = iconHtml;
|
196
|
+
jsonOutput.iconMarkup = escapeHtml(iconHtml);
|
197
|
+
jsonOutput.iconClass = selected.querySelector('i').classList.value;
|
198
|
+
jsonOutput.iconText = selected.querySelector('i').innerText;
|
199
|
+
}
|
200
|
+
|
201
|
+
this.options.onSelect(jsonOutput);
|
202
|
+
}
|
203
|
+
// jadams, 2023-05-21: disable modal CLOSE on a select
|
204
|
+
// this.universalDomEle.classList.add('uip-close');
|
205
|
+
// this.universalDomEle.classList.remove('uip-open');
|
206
|
+
});
|
207
|
+
} else {
|
208
|
+
// Icon library open if dom element exist
|
209
|
+
this.universalDomEle.classList.remove('uip-close');
|
210
|
+
this.universalDomEle.classList.add('uip-open');
|
211
|
+
// jadams, 2023-05-21: disable page scrolling if modal is OPEN
|
212
|
+
document.body.classList.add('stop-scrolling');
|
213
|
+
}
|
214
|
+
|
215
|
+
if (!this.iconEventsLoaded) {
|
216
|
+
// selected icon highlighted by adding class
|
217
|
+
this.universalDomEle.querySelectorAll('.uip-icon-item').forEach((item) => {
|
218
|
+
item.addEventListener('click', (evt) => {
|
219
|
+
this.iconWrap.forEach((el) => {
|
220
|
+
el.classList.remove('universal-selected');
|
221
|
+
});
|
222
|
+
evt.currentTarget.classList.toggle('universal-selected');
|
223
|
+
});
|
224
|
+
item.addEventListener('dblclick', (evt) => {
|
225
|
+
this.universalDomEle.querySelector('.uip-insert-icon-button').click();
|
226
|
+
});
|
227
|
+
});
|
228
|
+
this.iconEventsLoaded = true;
|
229
|
+
}
|
230
|
+
|
231
|
+
this.universalDomEle.querySelector('.uip-modal--icon-search input').focus();
|
232
|
+
});
|
233
|
+
},
|
234
|
+
|
235
|
+
setOptions: function (opts) {
|
236
|
+
this.options = extend(this.options, opts);
|
237
|
+
if (opts.iconLibrariesCss) {
|
238
|
+
this._loadCssFiles();
|
239
|
+
}
|
240
|
+
if (opts.iconLibraries) {
|
241
|
+
// dom icon events need to be reloaded
|
242
|
+
this.iconEventsLoaded = false;
|
243
|
+
this.iconLibrariesLoaded = false;
|
244
|
+
this._resetIconAndSidebarList();
|
245
|
+
}
|
246
|
+
},
|
247
|
+
|
248
|
+
/* Private functions
|
249
|
+
------------------------------------------------------------------------ */
|
250
|
+
|
251
|
+
_clickHandlerFunc: function (e) {
|
252
|
+
if (!e.currentTarget.classList.contains('universal-active')) {
|
253
|
+
this.sideBarBtn.forEach(function (item) {
|
254
|
+
item.classList.remove('universal-active');
|
255
|
+
});
|
256
|
+
e.currentTarget.classList.add('universal-active')
|
257
|
+
}
|
258
|
+
this._sidebarFilterFunc(e.currentTarget.dataset['libraryId']);
|
259
|
+
},
|
260
|
+
|
261
|
+
_iconItemMarkup: function (libraryName, libraryItem) {
|
262
|
+
let markup = '',
|
263
|
+
library = libraryItem['icon-style'],
|
264
|
+
prefix = libraryItem['prefix'];
|
265
|
+
|
266
|
+
if (this.options.allowEmpty) {
|
267
|
+
markup += '<div class="uip-icon-item" data-library-id="' + library + '" data-filter="" data-library-name="' + libraryName + '"><div class="uip-icon-item-inner"><i class="' + prefix + ' uip-icon-none"> </i><div class="uip-icon-item-name" title="None">None</div></div></div>';
|
268
|
+
}
|
269
|
+
if (prefix.match(/^material-icons/)) {
|
270
|
+
libraryItem['icons'].forEach(function (item) {
|
271
|
+
markup += '<div class="uip-icon-item" data-library-id="' + library + '" data-filter="' + item + '" data-library-name="' + libraryName + '"><div class="uip-icon-item-inner"><i class="' + prefix + '">' + item + '</i><div class="uip-icon-item-name" title="' + item + '">' + item.replace("-", " ") + '</div></div></div>';
|
272
|
+
});
|
273
|
+
} else {
|
274
|
+
libraryItem['icons'].forEach(function (item) {
|
275
|
+
markup += '<div class="uip-icon-item" data-library-id="' + library + '" data-filter="' + item + '" data-library-name="' + libraryName + '"><div class="uip-icon-item-inner"><i class="' + [prefix, item].join('') + '"></i><div class="uip-icon-item-name" title="' + item + '">' + item.replace("-", " ") + '</div></div></div>';
|
276
|
+
});
|
277
|
+
}
|
278
|
+
|
279
|
+
return markup;
|
280
|
+
},
|
281
|
+
|
282
|
+
_iconItemPush: function (arrayList) {
|
283
|
+
this.previewWrap.innerHTML = '';
|
284
|
+
arrayList.forEach((item) => {
|
285
|
+
this.previewWrap.appendChild(item[1]);
|
286
|
+
});
|
287
|
+
},
|
288
|
+
|
289
|
+
_loadCssFiles: function () {
|
290
|
+
let link = document.createElement('link');
|
291
|
+
if (!loadedDependencies.includes('universal-icon-picker.min.css') & !this.options.loadCustomCss) {
|
292
|
+
link.rel = 'stylesheet';
|
293
|
+
link.type = 'text/css';
|
294
|
+
link.href = iconPickerUrl + 'css/universal-icon-picker.min.css';
|
295
|
+
link.media = 'screen';
|
296
|
+
document.head.appendChild(link);
|
297
|
+
loadedDependencies.push('universal-icon-picker.min.css');
|
298
|
+
}
|
299
|
+
if (this.options.iconLibrariesCss) {
|
300
|
+
this.options.iconLibrariesCss.forEach(cssFile => {
|
301
|
+
if (!loadedDependencies.includes(cssFile)) {
|
302
|
+
let cssFileLink = iconPickerUrl + 'css/' + cssFile;
|
303
|
+
if (cssFile.match(/^http|^\/\//)) {
|
304
|
+
cssFileLink = cssFile;
|
305
|
+
}
|
306
|
+
link = document.createElement('link');
|
307
|
+
link.rel = 'stylesheet';
|
308
|
+
link.type = 'text/css';
|
309
|
+
link.href = cssFileLink;
|
310
|
+
link.media = 'screen';
|
311
|
+
document.head.appendChild(link);
|
312
|
+
loadedDependencies.push(cssFile);
|
313
|
+
}
|
314
|
+
});
|
315
|
+
}
|
316
|
+
},
|
317
|
+
|
318
|
+
_loadIconLibraries: async function (i = 0) {
|
319
|
+
if (!this.options.iconLibraries) {
|
320
|
+
console.error('Universal icon picker - no icon library loaded');
|
321
|
+
return false;
|
322
|
+
}
|
323
|
+
if (this.iconLibrariesLoaded) {
|
324
|
+
return true;
|
325
|
+
}
|
326
|
+
if (i === 0 && this.options.iconLibraries.length > 1) {
|
327
|
+
this.sideBarList.push({
|
328
|
+
"title": "all icons",
|
329
|
+
"list-icon": "",
|
330
|
+
"library-id": "all",
|
331
|
+
"prefix": ""
|
332
|
+
});
|
333
|
+
}
|
334
|
+
|
335
|
+
let iconLib = this.options.iconLibraries[i];
|
336
|
+
|
337
|
+
await fetch(iconPickerUrl + 'icons-libraries/' + iconLib)
|
338
|
+
.then(response => response.json())
|
339
|
+
.then(data => {
|
340
|
+
// Success!
|
341
|
+
const camelCasedIconLibrary = iconLib.replace(/-([a-z])/g, function (g) { return g[1].toUpperCase(); }).replace(/\.[a-z.]+$/, '');
|
342
|
+
let newLibrary = {};
|
343
|
+
newLibrary[camelCasedIconLibrary] = data;
|
344
|
+
Object.assign(this.iconLibraries, newLibrary); // new icon library merge
|
345
|
+
if (i + 1 === this.options.iconLibraries.length) {
|
346
|
+
//set icon and sidebar list
|
347
|
+
this._setIconAndSidebarList();
|
348
|
+
|
349
|
+
this.activeLibraryId = this.sideBarList[0]['library-id'];
|
350
|
+
|
351
|
+
//sidebar list markup push
|
352
|
+
this.sidebarTabs.innerHTML = this._sideBarListMarkup(this.sideBarList);
|
353
|
+
|
354
|
+
//icon markup push
|
355
|
+
this.previewWrap.innerHTML = this.iconMarkup;
|
356
|
+
|
357
|
+
// get all icon wrapper dom element
|
358
|
+
this.iconWrap = this.previewWrap.querySelectorAll('.uip-icon-item');
|
359
|
+
|
360
|
+
//set event lisner to search input
|
361
|
+
this.searchInput.addEventListener('keyup', debounce(this._searchFunc, 100).bind(this), false);
|
362
|
+
|
363
|
+
//get all sidebar list item wrapper dom element
|
364
|
+
this.sideBarBtn = this.sidebarTabs.querySelectorAll('.uip-modal--sidebar-tab-item');
|
365
|
+
|
366
|
+
//set click event lisner to sidebar list item
|
367
|
+
this.sideBarBtn.forEach((item) => {
|
368
|
+
item.addEventListener('click', this._clickHandlerFunc.bind(this), false);
|
369
|
+
});
|
370
|
+
|
371
|
+
return true;
|
372
|
+
} else {
|
373
|
+
return this._loadIconLibraries(i + 1);
|
374
|
+
}
|
375
|
+
}).catch((error) => {
|
376
|
+
console.log(error);
|
377
|
+
return error;
|
378
|
+
});
|
379
|
+
},
|
380
|
+
|
381
|
+
_onBeforeOpen: async function () {
|
382
|
+
if (typeof (this.options.onBeforeOpen) === 'function') {
|
383
|
+
return this.options.onBeforeOpen();
|
384
|
+
}
|
385
|
+
},
|
386
|
+
|
387
|
+
_resetIconAndSidebarList: function () {
|
388
|
+
this.sideBarList = [];
|
389
|
+
this.iconMarkup = '';
|
390
|
+
this.iconLibraries = {};
|
391
|
+
this.iconWrap = '';
|
392
|
+
this.filterIcon = '';
|
393
|
+
this.sideBarBtn = '';
|
394
|
+
this.activeLibraryId = '';
|
395
|
+
},
|
396
|
+
|
397
|
+
_searchFunc: function (e) {
|
398
|
+
// console.log(this.value.toLowerCase());
|
399
|
+
|
400
|
+
const searchText = e.target.value.toLowerCase();
|
401
|
+
this._searchFilterFunc(searchText, 'filter');
|
402
|
+
|
403
|
+
},
|
404
|
+
|
405
|
+
_searchFilterFunc: function (filterText, dataName) {
|
406
|
+
this.filterIcon = Object.entries(this.iconWrap).filter((item) => {
|
407
|
+
if (-1 == item[1].dataset[dataName].indexOf(filterText) || (this.activeLibraryId !== 'all' && item[1].dataset['libraryId'] !== this.activeLibraryId)) {
|
408
|
+
return false;
|
409
|
+
}
|
410
|
+
return true;
|
411
|
+
});
|
412
|
+
|
413
|
+
this._iconItemPush(this.filterIcon);
|
414
|
+
|
415
|
+
},
|
416
|
+
|
417
|
+
_setIconAndSidebarList: function () {
|
418
|
+
for (const [libraryName, libraryContent] of Object.entries(this.iconLibraries)) {
|
419
|
+
this._setSideBarList(getLibraryName(libraryName), libraryContent);
|
420
|
+
this._setIconMarkup(libraryName, libraryContent);
|
421
|
+
}
|
422
|
+
},
|
423
|
+
|
424
|
+
_setIconMarkup: function (libraryName, libraryContent) {
|
425
|
+
if (libraryContent.icons !== undefined) {
|
426
|
+
this.iconMarkup += this._iconItemMarkup(libraryName, libraryContent)
|
427
|
+
} else {
|
428
|
+
Object.entries(libraryContent).forEach((item) => {
|
429
|
+
this.iconMarkup += this._iconItemMarkup(libraryName, item[1])
|
430
|
+
});
|
431
|
+
}
|
432
|
+
},
|
433
|
+
|
434
|
+
_sidebarFilterFunc: function (filterText) {
|
435
|
+
this.activeLibraryId = filterText;
|
436
|
+
this.filterIcon = Object.entries(this.iconWrap).filter(function (item) {
|
437
|
+
if ('all' === filterText || filterText === item[1].dataset['libraryId']) {
|
438
|
+
return true;
|
439
|
+
}
|
440
|
+
return false;
|
441
|
+
});
|
442
|
+
|
443
|
+
this._iconItemPush(this.filterIcon);
|
444
|
+
|
445
|
+
},
|
446
|
+
|
447
|
+
_setSideBarList: function (libraryName, libraryContent) {
|
448
|
+
let listItem;
|
449
|
+
if (libraryContent.icons !== undefined) {
|
450
|
+
listItem = {
|
451
|
+
'title': libraryName,
|
452
|
+
'prefix': libraryContent['prefix'] !== undefined ? libraryContent['prefix'] : '',
|
453
|
+
'list-icon': libraryContent['list-icon'] !== undefined ? libraryContent['list-icon'] : '',
|
454
|
+
'library-id': libraryContent['icon-style'] !== undefined ? libraryContent['icon-style'] : 'all',
|
455
|
+
};
|
456
|
+
this.sideBarList.push(listItem);
|
457
|
+
} else {
|
458
|
+
Object.entries(libraryContent).forEach(item => {
|
459
|
+
listItem = {
|
460
|
+
"title": libraryName + ' - ' + item[0],
|
461
|
+
"prefix": item[1]['prefix'] !== undefined ? item[1]['prefix'] : '',
|
462
|
+
"list-icon": item[1]['list-icon'] !== undefined ? item[1]['list-icon'] : "",
|
463
|
+
"library-id": item[1]['icon-style'] !== undefined ? item[1]['icon-style'] : "all",
|
464
|
+
};
|
465
|
+
this.sideBarList.push(listItem)
|
466
|
+
});
|
467
|
+
}
|
468
|
+
},
|
469
|
+
|
470
|
+
_sideBarListMarkup: function (sideBarList) {
|
471
|
+
let markup = '';
|
472
|
+
sideBarList.forEach((item) => {
|
473
|
+
let activeClazz = '';
|
474
|
+
if (item['library-id'] === this.activeLibraryId) {
|
475
|
+
activeClazz = ' universal-active';
|
476
|
+
}
|
477
|
+
if ('all' !== item['library-id']) {
|
478
|
+
let iconTag = '<i class="' + item['list-icon'] + '"></i>';
|
479
|
+
if (item['prefix'].match(/^material-icons/)) {
|
480
|
+
iconTag = '<i class="' + item['prefix'] + '">' + item['list-icon'] + '</i>';
|
481
|
+
}
|
482
|
+
markup += '<div class="uip-modal--sidebar-tab-item' + activeClazz + '" data-library-id="' + item['library-id'] + '">' + iconTag + item['title'] + '</div>';
|
483
|
+
} else {
|
484
|
+
markup += '<div class="uip-modal--sidebar-tab-item' + activeClazz + '" data-library-id="' + item['library-id'] + '"><img src="' + iconPickerUrl + '/images/star-of-life-solid.svg" width="13.125px" height="auto" alt="All" title="All" />' + item['title'] + '</div>';
|
485
|
+
}
|
486
|
+
});
|
487
|
+
|
488
|
+
return markup;
|
489
|
+
}
|
490
|
+
};
|
491
|
+
|
492
|
+
return UniversalIconPicker;
|
493
|
+
}));
|
@@ -0,0 +1,17 @@
|
|
1
|
+
/*
|
2
|
+
# -----------------------------------------------------------------------------
|
3
|
+
# ~/theme_uno/modules/iconPicker/js/universal-icon-picker.min.js
|
4
|
+
# UniversalIconPicker v.1.1.0 implementation for J1 Theme
|
5
|
+
#
|
6
|
+
# Product/Info:
|
7
|
+
# https://jekyll.one
|
8
|
+
# https://github.com/migliori/universal-icon-picker
|
9
|
+
#
|
10
|
+
# Copyright (C) 2023 Juergen Adams
|
11
|
+
# Copyright (C) 2023 Gilles Migliori
|
12
|
+
#
|
13
|
+
# J1 Theme is licensed under the MIT License.
|
14
|
+
# See: https://github.com/jekyll-one-org/j1-template/blob/main/LICENSE.md
|
15
|
+
# -----------------------------------------------------------------------------
|
16
|
+
*/
|
17
|
+
const iconPickerUrl=document.currentScript.src.replace(/js\/([a-z\.-]+)$/gm,""),loadedDependencies=[];!function(i,e){"function"==typeof define&&define.amd?define([],e("UniversalIconPicker")):"object"==typeof exports?module.exports=e("UniversalIconPicker"):i.UniversalIconPicker=e("UniversalIconPicker")}(this,function(){"use strict";let i=function(i){let e=document.createElement("div");return e.innerHTML=i,e.firstChild},e=function(i,e,t){let s;return function(){let r=this,n=arguments,a=function(){s=null,t||i.apply(r,n)},o=t&&!s;clearTimeout(s),s=setTimeout(a,e),o&&i.apply(r,n)}},t=function(i){let e={"&":"&","<":"<",">":">",'"':""","'":"'"};return i.replace(/[&<>"']/g,function(i){return e[i]})},s=function(i,e){let t,s={};for(t in i)Object.prototype.hasOwnProperty.call(i,t)&&(s[t]=i[t]);for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&(s[t]=e[t]);return s};function r(e,t){this.selector=e,this.options=s({allowEmpty:!0,iconLibraries:null,iconLibrariesCss:null,mode:"autoload",onBeforeOpen:null,onReset:null,onSelect:null,resetSelector:null,loadCustomCss:!1},t),this.activeLibraryId="",this.filterIcon="",this.iconEventsLoaded=!1,this.iconLibraries={},this.iconLibrariesLoaded=!1,this.iconMarkup="",this.iconWrap="",this.idSuffix="-"+this.selector.replace(/[#\s[\]="]/g,""),this.sideBarBtn="",this.sideBarList=[],this.universalWrap='<div class="uip-modal uip-open" id="uip-modal'+this.idSuffix+'"><div class="uip-modal--content"><div class="uip-modal--header"><div class="uip-modal--header-logo-area"><span class="uip-modal--header-logo-title">Icon Picker</span></div><div class="uip-modal--header-close-btn"><img src="'+iconPickerUrl+'/images/xmark-solid.svg" width="40" height="40" alt="Close" title="Close" /></div></div><div class="uip-modal--body"><div id="uip-modal--sidebar'+this.idSuffix+'" class="uip-modal--sidebar"><div class="uip-modal--sidebar-tabs"></div></div><div id="uip-modal--icon-preview-wrap'+this.idSuffix+'" class="uip-modal--icon-preview-wrap"><div class="uip-modal--icon-search"><input name="" value="" placeholder="Filter by name..."><img src="'+iconPickerUrl+'/images/magnifying-glass-solid.svg" width="20" height="16" alt="Search" title="Search" /></div><div class="uip-modal--icon-preview-inner"><div id="uip-modal--icon-preview'+this.idSuffix+'" class="uip-modal--icon-preview"></div></div></div></div><div class="uip-modal--footer"><button class="uip-insert-icon-button mt-3 mb-3 mr-6">Copy to clipboard</button></div></div></div>',this.universalDomEle=i(this.universalWrap),this.sidebarTabs=this.universalDomEle.querySelector(".uip-modal--sidebar-tabs"),this.previewWrap=this.universalDomEle.querySelector("#uip-modal--icon-preview"+this.idSuffix),this.searchInput=this.universalDomEle.querySelector(".uip-modal--icon-search input"),"autoload"===this.options.mode?this.init():document.querySelector(this.selector).addEventListener("click",this.init.bind(this),{once:!0})}return r.prototype={init:function(){this._loadCssFiles(),"autoload"!==this.options.mode&&this._onBeforeOpen().then(()=>{this.open()}),document.querySelector(this.selector).addEventListener("click",()=>{this._onBeforeOpen().then(()=>{this.open()})}),this.options.resetSelector&&document.querySelector(this.options.resetSelector).addEventListener("click",this.options.onReset)},open:function(){this._loadIconLibraries().then(()=>{this.iconLibrariesLoaded=!0,document.getElementById("uip-modal"+this.idSuffix)?(this.universalDomEle.classList.remove("uip-close"),this.universalDomEle.classList.add("uip-open"),document.body.classList.add("stop-scrolling")):(document.body.appendChild(this.universalDomEle),document.body.classList.add("stop-scrolling"),this.universalDomEle.querySelector(".uip-modal--header-close-btn").addEventListener("click",()=>{this.universalDomEle.classList.add("uip-close"),this.universalDomEle.classList.remove("uip-open"),document.body.classList.remove("stop-scrolling")}),this.universalDomEle.querySelector(".uip-insert-icon-button").addEventListener("click",()=>{let i=this.universalDomEle.querySelector(".universal-selected");if(i){let e=i.querySelector("i").outerHTML,s={libraryId:i.dataset.libraryId,libraryName:i.dataset.libraryName,iconHtml:null,iconMarkup:null,iconClass:null,iconText:null};i.querySelector("i").classList.value.match("uip-icon-none")||(s.iconHtml=e,s.iconMarkup=t(e),s.iconClass=i.querySelector("i").classList.value,s.iconText=i.querySelector("i").innerText),this.options.onSelect(s)}})),this.iconEventsLoaded||(this.universalDomEle.querySelectorAll(".uip-icon-item").forEach(i=>{i.addEventListener("click",i=>{this.iconWrap.forEach(i=>{i.classList.remove("universal-selected")}),i.currentTarget.classList.toggle("universal-selected")}),i.addEventListener("dblclick",i=>{this.universalDomEle.querySelector(".uip-insert-icon-button").click()})}),this.iconEventsLoaded=!0),this.universalDomEle.querySelector(".uip-modal--icon-search input").focus()})},setOptions:function(i){this.options=s(this.options,i),i.iconLibrariesCss&&this._loadCssFiles(),i.iconLibraries&&(this.iconEventsLoaded=!1,this.iconLibrariesLoaded=!1,this._resetIconAndSidebarList())},_clickHandlerFunc:function(i){i.currentTarget.classList.contains("universal-active")||(this.sideBarBtn.forEach(function(i){i.classList.remove("universal-active")}),i.currentTarget.classList.add("universal-active")),this._sidebarFilterFunc(i.currentTarget.dataset.libraryId)},_iconItemMarkup:function(i,e){let t="",s=e["icon-style"],r=e.prefix;return this.options.allowEmpty&&(t+='<div class="uip-icon-item" data-library-id="'+s+'" data-filter="" data-library-name="'+i+'"><div class="uip-icon-item-inner"><i class="'+r+' uip-icon-none"> </i><div class="uip-icon-item-name" title="None">None</div></div></div>'),r.match(/^material-icons/)?e.icons.forEach(function(e){t+='<div class="uip-icon-item" data-library-id="'+s+'" data-filter="'+e+'" data-library-name="'+i+'"><div class="uip-icon-item-inner"><i class="'+r+'">'+e+'</i><div class="uip-icon-item-name" title="'+e+'">'+e.replace("-"," ")+"</div></div></div>"}):e.icons.forEach(function(e){t+='<div class="uip-icon-item" data-library-id="'+s+'" data-filter="'+e+'" data-library-name="'+i+'"><div class="uip-icon-item-inner"><i class="'+[r,e].join("")+'"></i><div class="uip-icon-item-name" title="'+e+'">'+e.replace("-"," ")+"</div></div></div>"}),t},_iconItemPush:function(i){this.previewWrap.innerHTML="",i.forEach(i=>{this.previewWrap.appendChild(i[1])})},_loadCssFiles:function(){let i=document.createElement("link");!loadedDependencies.includes("universal-icon-picker.min.css")&!this.options.loadCustomCss&&(i.rel="stylesheet",i.type="text/css",i.href=iconPickerUrl+"css/universal-icon-picker.min.css",i.media="screen",document.head.appendChild(i),loadedDependencies.push("universal-icon-picker.min.css")),this.options.iconLibrariesCss&&this.options.iconLibrariesCss.forEach(e=>{if(!loadedDependencies.includes(e)){let t=iconPickerUrl+"css/"+e;e.match(/^http|^\/\//)&&(t=e),(i=document.createElement("link")).rel="stylesheet",i.type="text/css",i.href=t,i.media="screen",document.head.appendChild(i),loadedDependencies.push(e)}})},_loadIconLibraries:async function(i=0){if(!this.options.iconLibraries)return console.error("Universal icon picker - no icon library loaded"),!1;if(this.iconLibrariesLoaded)return!0;0===i&&this.options.iconLibraries.length>1&&this.sideBarList.push({title:"all icons","list-icon":"","library-id":"all",prefix:""});let t=this.options.iconLibraries[i];await fetch(iconPickerUrl+"icons-libraries/"+t).then(i=>i.json()).then(s=>{let r=t.replace(/-([a-z])/g,function(i){return i[1].toUpperCase()}).replace(/\.[a-z.]+$/,""),n={};return(n[r]=s,Object.assign(this.iconLibraries,n),i+1===this.options.iconLibraries.length)?(this._setIconAndSidebarList(),this.activeLibraryId=this.sideBarList[0]["library-id"],this.sidebarTabs.innerHTML=this._sideBarListMarkup(this.sideBarList),this.previewWrap.innerHTML=this.iconMarkup,this.iconWrap=this.previewWrap.querySelectorAll(".uip-icon-item"),this.searchInput.addEventListener("keyup",e(this._searchFunc,100).bind(this),!1),this.sideBarBtn=this.sidebarTabs.querySelectorAll(".uip-modal--sidebar-tab-item"),this.sideBarBtn.forEach(i=>{i.addEventListener("click",this._clickHandlerFunc.bind(this),!1)}),!0):this._loadIconLibraries(i+1)}).catch(i=>(console.log(i),i))},_onBeforeOpen:async function(){if("function"==typeof this.options.onBeforeOpen)return this.options.onBeforeOpen()},_resetIconAndSidebarList:function(){this.sideBarList=[],this.iconMarkup="",this.iconLibraries={},this.iconWrap="",this.filterIcon="",this.sideBarBtn="",this.activeLibraryId=""},_searchFunc:function(i){let e=i.target.value.toLowerCase();this._searchFilterFunc(e,"filter")},_searchFilterFunc:function(i,e){this.filterIcon=Object.entries(this.iconWrap).filter(t=>-1!=t[1].dataset[e].indexOf(i)&&("all"===this.activeLibraryId||t[1].dataset.libraryId===this.activeLibraryId)),this._iconItemPush(this.filterIcon)},_setIconAndSidebarList:function(){for(let[i,e]of Object.entries(this.iconLibraries)){var t;this._setSideBarList((t=i).replace(/([A-Z])/g," $1"),e),this._setIconMarkup(i,e)}},_setIconMarkup:function(i,e){void 0!==e.icons?this.iconMarkup+=this._iconItemMarkup(i,e):Object.entries(e).forEach(e=>{this.iconMarkup+=this._iconItemMarkup(i,e[1])})},_sidebarFilterFunc:function(i){this.activeLibraryId=i,this.filterIcon=Object.entries(this.iconWrap).filter(function(e){return"all"===i||i===e[1].dataset.libraryId}),this._iconItemPush(this.filterIcon)},_setSideBarList:function(i,e){let t;void 0!==e.icons?(t={title:i,prefix:void 0!==e.prefix?e.prefix:"","list-icon":void 0!==e["list-icon"]?e["list-icon"]:"","library-id":void 0!==e["icon-style"]?e["icon-style"]:"all"},this.sideBarList.push(t)):Object.entries(e).forEach(e=>{t={title:i+" - "+e[0],prefix:void 0!==e[1].prefix?e[1].prefix:"","list-icon":void 0!==e[1]["list-icon"]?e[1]["list-icon"]:"","library-id":void 0!==e[1]["icon-style"]?e[1]["icon-style"]:"all"},this.sideBarList.push(t)})},_sideBarListMarkup:function(i){let e="";return i.forEach(i=>{let t="";if(i["library-id"]===this.activeLibraryId&&(t=" universal-active"),"all"!==i["library-id"]){let s='<i class="'+i["list-icon"]+'"></i>';i.prefix.match(/^material-icons/)&&(s='<i class="'+i.prefix+'">'+i["list-icon"]+"</i>"),e+='<div class="uip-modal--sidebar-tab-item'+t+'" data-library-id="'+i["library-id"]+'">'+s+i.title+"</div>"}else e+='<div class="uip-modal--sidebar-tab-item'+t+'" data-library-id="'+i["library-id"]+'"><img src="'+iconPickerUrl+'/images/star-of-life-solid.svg" width="13.125px" height="auto" alt="All" title="All" />'+i.title+"</div>"}),e}},r});
|