j1-template 2021.3.2 → 2022.0.3
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 +14 -14
- data/_includes/themes/j1/layouts/content_generator_news_panel_posts.html +4 -4
- data/_includes/themes/j1/layouts/content_generator_post.html +4 -4
- data/_includes/themes/j1/modules/connectors/analytic/google-analytics.html +3 -13
- data/_includes/themes/j1/modules/connectors/comment/hyvor.html +4 -5
- data/_includes/themes/j1/modules/navigator/generator.html +9 -11
- data/_includes/themes/j1/modules/search/docsearch.html +1 -1
- data/_includes/themes/j1/procedures/global/create_bs_button.proc +5 -5
- data/_includes/themes/j1/procedures/global/create_word_cloud.proc +5 -3
- data/_includes/themes/j1/procedures/layouts/module_writer.proc +1 -1
- data/_includes/themes/j1/procedures/posts/collate_timeline.proc +3 -3
- data/_includes/themes/j1/procedures/posts/create_series_header.proc +1 -1
- data/_layouts/default.html +66 -22
- data/_layouts/home.html +1 -1
- data/_layouts/raw.html +2 -1
- data/assets/data/article_navigator/index.html +1 -1
- data/assets/data/authclient.html +11 -11
- data/assets/data/banner.html +7 -25
- data/assets/data/cookieconsent.html +20 -20
- data/assets/data/{fam.html → fab.html} +42 -24
- data/assets/data/gallery_customizer.html +6 -6
- data/assets/data/menu.html +13 -13
- data/assets/data/mmenu.html +2 -2
- data/assets/data/panel.html +17 -23
- data/assets/data/private.json +1 -1
- data/assets/data/quicklinks.html +6 -7
- data/assets/data/rtext_resizer.html +1 -1
- data/assets/data/themes.bootswatch.json +75 -0
- data/assets/data/themes.json +6 -6
- data/assets/data/translator.html +23 -23
- data/assets/error_pages/HTTP445.html +110 -0
- data/assets/themes/j1/adapter/js/bmd.js +1 -1
- data/assets/themes/j1/adapter/js/clipboard.js +1 -1
- data/assets/themes/j1/adapter/js/cookieConsent.js +19 -10
- data/assets/themes/j1/adapter/js/{fam.js → fab.js} +121 -116
- data/assets/themes/j1/adapter/js/j1.js +258 -190
- data/assets/themes/j1/adapter/js/mmenu.js +18 -24
- data/assets/themes/j1/adapter/js/navigator.js +6 -4
- data/assets/themes/j1/adapter/js/themer.js +13 -4
- data/assets/themes/j1/adapter/js/toccer.js +37 -76
- data/assets/themes/j1/adapter/js/translator.js +10 -2
- data/assets/themes/j1/core/country-flags/css/theme/uno.min.css +15 -0
- data/assets/themes/j1/core/css/icon-fonts/mdi.css +22307 -0
- data/assets/themes/j1/core/css/icon-fonts/mdi.min.css +1 -0
- data/assets/themes/j1/core/css/icon-fonts/mdil.css +1222 -0
- data/assets/themes/j1/core/css/icon-fonts/mdil.min.css +1 -0
- data/assets/themes/j1/core/css/icon-fonts/twemoji.css +4 -0
- data/assets/themes/j1/core/css/themes/bootstrap/bootstrap.css +5341 -4730
- data/assets/themes/j1/core/css/themes/bootstrap/bootstrap.min.css +3 -1
- data/assets/themes/j1/core/css/themes/theme_vapor/bootstrap.css +8301 -0
- data/assets/themes/j1/core/css/themes/theme_vapor/bootstrap.min.css +3 -0
- data/assets/themes/j1/core/css/themes/{uno-dark → unodark}/bootstrap.css +5284 -4646
- data/assets/themes/j1/core/css/themes/unodark/bootstrap.min.css +3 -0
- data/assets/themes/j1/core/css/themes/{uno-light → unolight}/bootstrap.css +12188 -12734
- data/assets/themes/j1/core/css/themes/unolight/bootstrap.min.css +23 -0
- data/assets/themes/j1/core/css/vendor.css +2 -28
- data/assets/themes/j1/core/css/vendor.min.css +1 -1
- data/assets/themes/j1/core/js/template.js +111 -29
- data/assets/themes/j1/core/js/template.min.js +1 -1
- data/assets/themes/j1/core/js/template.min.js.map +1 -1
- data/assets/themes/j1/modules/bmd/js/bmd.js +2280 -0
- data/assets/themes/j1/modules/bmd/js/bmd.min.js +20 -0
- data/assets/themes/j1/modules/bootstrap/js/bootstrap.js +5072 -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/cookieConsent/js/cookieConsent.js +19 -17
- data/assets/themes/j1/modules/cookieConsent/js/cookieConsent.min.js +1 -1
- data/assets/themes/j1/modules/cryptoJS/js/aes.js +35 -0
- data/assets/themes/j1/modules/cryptoJS/js/aes.min.js +35 -0
- data/assets/themes/j1/modules/cryptoJS/js/hmac-md5.js +21 -0
- data/assets/themes/j1/modules/cryptoJS/js/hmac-ripemd160.js +31 -0
- data/assets/themes/j1/modules/cryptoJS/js/hmac-sha1.js +17 -0
- data/assets/themes/j1/modules/cryptoJS/js/hmac-sha224.js +19 -0
- data/assets/themes/j1/modules/cryptoJS/js/hmac-sha256.js +18 -0
- data/assets/themes/j1/modules/cryptoJS/js/hmac-sha3.js +21 -0
- data/assets/themes/j1/modules/cryptoJS/js/hmac-sha384.js +27 -0
- data/assets/themes/j1/modules/cryptoJS/js/hmac-sha512.js +25 -0
- data/assets/themes/j1/modules/cryptoJS/js/md5.js +19 -0
- data/assets/themes/j1/modules/cryptoJS/js/pbkdf2.js +19 -0
- data/assets/themes/j1/modules/cryptoJS/js/rabbit-legacy.js +36 -0
- data/assets/themes/j1/modules/cryptoJS/js/rabbit.js +36 -0
- data/assets/themes/j1/modules/cryptoJS/js/rc4.js +33 -0
- data/assets/themes/j1/modules/cryptoJS/js/ripemd160.js +29 -0
- data/assets/themes/j1/modules/cryptoJS/js/sha1.js +15 -0
- data/assets/themes/j1/modules/cryptoJS/js/sha224.js +17 -0
- data/assets/themes/j1/modules/cryptoJS/js/sha256.js +16 -0
- data/assets/themes/j1/modules/cryptoJS/js/sha3.js +19 -0
- data/assets/themes/j1/modules/cryptoJS/js/sha384.js +25 -0
- data/assets/themes/j1/modules/cryptoJS/js/sha512.js +23 -0
- data/assets/themes/j1/modules/cryptoJS/js/tripledes.js +51 -0
- data/assets/themes/j1/modules/deeplAPI/js/deeplAPI.2.js +460 -0
- data/assets/themes/j1/modules/deeplAPI/js/deeplAPI.js +379 -353
- data/assets/themes/j1/modules/deeplAPI/js/deeplAPI.min.js +1 -1
- data/assets/themes/j1/modules/{fam/css/theme/uno/fam.css → fab/css/theme/uno/fab.css} +32 -28
- data/assets/themes/j1/modules/{fam/css/theme/uno/fam.min.css → fab/css/theme/uno/fab.min.css} +3 -3
- data/assets/themes/j1/modules/{materialize → fab}/js/cash.js +20 -2
- data/assets/themes/j1/modules/{fam/js/fam.js → fab/js/fab.js} +4 -2
- data/assets/themes/j1/modules/gtag-opt-in/js/gtag-opt-in.js +107 -0
- data/assets/themes/j1/modules/{util/js/gtag-opt-in.js → gtag-opt-in/js/gtag-opt-in.min.js} +15 -1
- data/assets/themes/j1/modules/lightGallery/js/modules/lg-thumbnail.min.js +4 -1
- data/assets/themes/j1/modules/materialize/js/autocomplete.js +1 -1
- data/assets/themes/j1/modules/materialize/js/bin/materialize.js +12374 -0
- data/assets/themes/j1/modules/materialize/js/bin/materialize.min.js +6 -0
- data/assets/themes/j1/modules/materialize/js/global.js +1 -1
- data/assets/themes/j1/modules/materialize/js/select.js +1 -1
- data/assets/themes/j1/modules/materialize/js/{tapTarget.js → tapTarget.cash.js} +1 -1
- data/assets/themes/j1/modules/materialize/js/tapTarget.jQuery.js +187 -0
- data/assets/themes/j1/modules/msDropdown/css/themes/uno/msDropdown.css +278 -0
- data/assets/themes/j1/modules/popper/js/popper.js +1670 -2346
- data/assets/themes/j1/modules/popper/js/popper.min.js +6 -4
- data/assets/themes/j1/modules/popper/js/popper.min.js.map +1 -1
- data/assets/themes/j1/modules/scroller/js/scroller.js +6 -6
- data/assets/themes/j1/modules/scroller/js/scroller.min.js +1 -1
- data/assets/themes/j1/modules/translator/js/translator.js +6 -2
- data/assets/themes/j1/modules/translator/js/translator.min.js +1 -1
- data/assets/themes/j1/modules/twemoji/js/picker/twemoji-picker.js +2 -2
- data/assets/themes/j1/modules/twemoji/js/picker/twemoji-picker.min.js +1 -1
- data/exe/j1 +6 -7
- data/lib/j1/commands/generate.rb +15 -16
- data/lib/j1/version.rb +1 -1
- data/lib/starter_web/Gemfile +7 -1
- data/lib/starter_web/_config.yml +21 -24
- data/lib/starter_web/_data/_defaults/j1_config.yml +1 -1
- data/lib/starter_web/_data/_defaults/private.yml +3 -2
- data/lib/starter_web/_data/_defaults/resources.yml +1 -1
- data/lib/starter_web/_data/blocks/banner.yml +71 -68
- data/lib/starter_web/_data/blocks/defaults/banner.yml +5 -5
- data/lib/starter_web/_data/blocks/defaults/panel.yml +3 -3
- data/lib/starter_web/_data/blocks/panel.yml +171 -73
- data/lib/starter_web/_data/builder/defaults/_blog_navigator.yml +396 -0
- data/lib/starter_web/_data/builder/defaults/blog_navigator.yml +77 -64
- data/lib/starter_web/_data/j1_config.yml +3 -3
- data/lib/starter_web/_data/layouts/article_navigator.yml +1 -1
- data/lib/starter_web/_data/layouts/blog_archive.yml +1 -1
- data/lib/starter_web/_data/layouts/collection.yml +1 -1
- data/lib/starter_web/_data/layouts/default.yml +1 -1
- data/lib/starter_web/_data/layouts/home.yml +6 -26
- data/lib/starter_web/_data/layouts/news_panel_posts.yml +1 -1
- data/lib/starter_web/_data/layouts/page.yml +1 -1
- data/lib/starter_web/_data/layouts/post.yml +1 -1
- data/lib/starter_web/_data/modules/defaults/attics.yml +1 -1
- data/lib/starter_web/_data/modules/defaults/{fam.yml → fab.yml} +8 -7
- data/lib/starter_web/_data/modules/defaults/navigator.yml +3 -0
- data/lib/starter_web/_data/modules/defaults/rtable.yml +2 -1
- data/lib/starter_web/_data/modules/defaults/scoller.yml +33 -0
- data/lib/starter_web/_data/modules/defaults/themer.yml +1 -1
- data/lib/starter_web/_data/modules/defaults/toccer.yml +5 -4
- data/lib/starter_web/_data/modules/{fam.yml → fab.yml} +31 -31
- data/lib/starter_web/_data/modules/scroller.yml +2 -2
- data/lib/starter_web/_data/modules/toccer.yml +3 -5
- data/lib/starter_web/_data/modules/translator.yml +3 -3
- data/lib/starter_web/_data/private.yml +3 -2
- data/lib/starter_web/_data/resources.yml +72 -33
- data/lib/starter_web/_includes/attributes.asciidoc +121 -122
- data/lib/starter_web/_plugins/encodeBase64.rb +46 -0
- data/lib/starter_web/_plugins/encryptAES.rb +53 -0
- data/lib/starter_web/_plugins/filters.rb +2 -1
- data/lib/starter_web/_plugins/lunr_index.rb +1 -1
- data/lib/starter_web/_plugins/minifyJSON.rb +2 -2
- data/lib/starter_web/assets/images/pages/roundtrip/500_themes/themes-menu-1280x800.jpg +0 -0
- data/lib/starter_web/collections/posts/public/featured/_posts/0000-00-00-welcome-to-j1.adoc.erb +1 -4
- data/lib/starter_web/collections/posts/public/featured/_posts/2021-01-01-about-cookies.adoc +2 -2
- data/lib/starter_web/collections/posts/public/featured/_posts/2021-02-01-site-generators.adoc +2 -2
- data/lib/starter_web/collections/posts/public/featured/_posts/2021-03-03-about-j1.adoc +2 -2
- data/lib/starter_web/collections/posts/public/series/_posts/2020-01-01-post-wiki-series.adoc +1 -1
- data/lib/starter_web/collections/posts/public/series/_posts/2020-01-02-post-wiki-series.adoc +1 -1
- data/lib/starter_web/collections/posts/public/series/_posts/2020-01-03-post-wiki-series.adoc +2 -2
- data/lib/starter_web/index.html +1 -1
- data/lib/starter_web/package.json +1 -1
- data/lib/starter_web/pages/_test_pages/100_side-bar-tester.adoc +244 -0
- data/lib/starter_web/pages/_test_pages/_includes/attributes.asciidoc +110 -0
- data/lib/starter_web/pages/_test_pages/_includes/documents/100_gistblock.asciidoc +28 -0
- data/lib/starter_web/pages/_test_pages/_includes/documents/410_bottom_info.asciidoc +14 -0
- data/lib/starter_web/pages/_test_pages/_includes/documents/410_bottom_left_warning.asciidoc +11 -0
- data/lib/starter_web/pages/_test_pages/_includes/documents/410_bottom_right_danger.asciidoc +11 -0
- data/lib/starter_web/pages/_test_pages/_includes/documents/410_central_success.asciidoc +11 -0
- data/lib/starter_web/pages/_test_pages/_includes/documents/410_full_height_left_info.asciidoc +11 -0
- data/lib/starter_web/pages/_test_pages/_includes/documents/410_full_height_right_success.asciidoc +11 -0
- data/lib/starter_web/pages/_test_pages/_includes/documents/410_table_bs_modal_examples.asciidoc +47 -0
- data/lib/starter_web/pages/_test_pages/_includes/documents/410_top_info.asciidoc +11 -0
- data/lib/starter_web/pages/_test_pages/_includes/documents/410_top_left_info.asciidoc +11 -0
- data/lib/starter_web/pages/_test_pages/_includes/documents/410_top_right_success.asciidoc +11 -0
- data/lib/starter_web/pages/_test_pages/_includes/documents/419_advanced_modals_demo.asciidoc +337 -0
- data/lib/starter_web/pages/_test_pages/_includes/documents/tables/bs_modal_examples.asciidoc +47 -0
- data/lib/starter_web/pages/_test_pages/accordion-01-tester.adoc +220 -0
- data/lib/starter_web/pages/_test_pages/accordion-02-tester.adoc +177 -0
- data/lib/starter_web/pages/_test_pages/accordion-03-tester.adoc +148 -0
- data/lib/starter_web/pages/_test_pages/attribute-changes-01-tester.adoc +226 -0
- data/lib/starter_web/pages/_test_pages/backdrop-tester.adoc +109 -0
- data/lib/starter_web/pages/_test_pages/button-tester-1.adoc +127 -0
- data/lib/starter_web/pages/_test_pages/card-tester.adoc +128 -0
- data/lib/starter_web/pages/_test_pages/cookieConsent.adoc +96 -0
- data/lib/starter_web/pages/_test_pages/deepl.0.adoc +258 -0
- data/lib/starter_web/pages/_test_pages/deepl.adoc +204 -0
- data/lib/starter_web/pages/_test_pages/desandro-button.adoc +171 -0
- data/lib/starter_web/pages/_test_pages/desandro.adoc +147 -0
- data/lib/starter_web/pages/_test_pages/flipcard-1-tester.adoc +308 -0
- data/lib/starter_web/pages/_test_pages/formular-01-tester.adoc +167 -0
- data/lib/starter_web/pages/_test_pages/formular-02-tester.adoc +727 -0
- data/lib/starter_web/pages/_test_pages/google-translate-tester.0.adoc +113 -0
- data/lib/starter_web/pages/_test_pages/google-translate-tester.1.adoc +233 -0
- data/lib/starter_web/pages/_test_pages/google-translate-tester.3.adoc +149 -0
- data/lib/starter_web/pages/_test_pages/google-translate-tester.4.adoc +239 -0
- data/lib/starter_web/pages/_test_pages/infinite-scroll-tester-2.adoc +183 -0
- data/lib/starter_web/pages/_test_pages/infinite-scroll-tester-3.adoc +235 -0
- data/lib/starter_web/pages/_test_pages/infinite-scroll-tester-4.adoc +222 -0
- data/lib/starter_web/pages/_test_pages/infinite-scroll-tester-5.adoc +119 -0
- data/lib/starter_web/pages/_test_pages/infinite-scroll-tester.1.adoc +236 -0
- data/lib/starter_web/pages/_test_pages/infinite-scroll-tester.adoc +225 -0
- data/lib/starter_web/pages/_test_pages/list-group-tester.adoc +265 -0
- data/lib/starter_web/pages/_test_pages/tictok.adoc +127 -0
- data/lib/starter_web/pages/public/about/about_site.adoc +1 -1
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/000_intro.adoc +1 -1
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/100_converter.adoc +1 -1
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/200_themes.adoc +1 -1
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/documentation.a2p +1 -1
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/documentation.adoc +2 -2
- data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/multi.adoc +2 -2
- data/lib/starter_web/pages/public/asciidoc_skeletons/simple-document/simple.adoc +2 -2
- data/lib/starter_web/pages/public/blog/navigator/archive/categoryview.html +5 -5
- data/lib/starter_web/pages/public/blog/navigator/archive/dateview.html +4 -4
- data/lib/starter_web/pages/public/blog/navigator/archive/tagview.html +4 -3
- data/lib/starter_web/pages/public/blog/navigator/archive.html +4 -4
- data/lib/starter_web/pages/public/blog/navigator/index.html +1 -1
- data/lib/starter_web/pages/public/learn/quickstart.adoc +3 -3
- 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 +6 -7
- data/lib/starter_web/pages/public/learn/roundtrip/300_icon_fonts.adoc +2 -2
- data/lib/starter_web/pages/public/learn/roundtrip/400_asciidoc_extensions.adoc +2 -2
- data/lib/starter_web/pages/public/learn/roundtrip/410_bs_modals_extentions.adoc +3 -3
- data/lib/starter_web/pages/public/learn/roundtrip/420_responsive_tables_extensions.adoc +2 -2
- data/lib/starter_web/pages/public/learn/roundtrip/500_themes.adoc +4 -4
- data/lib/starter_web/pages/public/learn/roundtrip/600_quicksearch.adoc +13 -11
- data/lib/starter_web/pages/public/learn/roundtrip/_includes/attributes.asciidoc +1 -1
- data/lib/starter_web/pages/public/learn/roundtrip/_includes/documents/410_bottom_info.asciidoc +3 -3
- data/lib/starter_web/pages/public/learn/roundtrip/_includes/documents/410_bottom_left_warning.asciidoc +1 -1
- data/lib/starter_web/pages/public/learn/roundtrip/_includes/documents/410_bottom_right_danger.asciidoc +1 -1
- data/lib/starter_web/pages/public/learn/roundtrip/_includes/documents/410_central_success.asciidoc +1 -1
- data/lib/starter_web/pages/public/learn/roundtrip/_includes/documents/410_full_height_left_info.asciidoc +1 -1
- data/lib/starter_web/pages/public/learn/roundtrip/_includes/documents/410_full_height_right_success.asciidoc +1 -1
- data/lib/starter_web/pages/public/learn/roundtrip/_includes/documents/410_top_info.asciidoc +1 -1
- data/lib/starter_web/pages/public/learn/roundtrip/_includes/documents/410_top_left_info.asciidoc +1 -1
- data/lib/starter_web/pages/public/learn/roundtrip/_includes/documents/410_top_right_success.asciidoc +1 -1
- data/lib/starter_web/pages/public/learn/roundtrip/_includes/documents/419_advanced_modals_demo.asciidoc +51 -51
- data/lib/starter_web/pages/public/learn/where_to_go.adoc +3 -3
- data/lib/starter_web/pages/public/legal/de/100_copyright.adoc +3 -3
- data/lib/starter_web/pages/public/legal/de/100_impress.adoc +3 -3
- data/lib/starter_web/pages/public/legal/de/300_privacy.adoc +7 -7
- data/lib/starter_web/pages/public/legal/de/400_comment_policy.adoc +3 -3
- data/lib/starter_web/pages/public/legal/en/100_copyright.adoc +3 -3
- data/lib/starter_web/pages/public/legal/en/200_impress.adoc +3 -3
- data/lib/starter_web/pages/public/legal/en/300_privacy.adoc +6 -7
- data/lib/starter_web/pages/public/legal/en/400_comment_policy.adoc +3 -3
- data/lib/starter_web/pages/public/manuals/dropdown-help.adoc +1 -1
- data/lib/starter_web/pages/public/panels/intro_panel/_includes/attributes.asciidoc +55 -0
- data/lib/starter_web/pages/public/panels/intro_panel/panel.adoc +53 -5
- data/lib/starter_web/pages/public/previewer/preview_bootstrap_theme.adoc +1688 -686
- data/lib/starter_web/utilsrv/_defaults/package.json +1 -1
- data/lib/starter_web/utilsrv/package.json +1 -1
- metadata +107 -29
- data/assets/themes/j1/core/css/themes/uno-dark/bootstrap.min.css +0 -1
- data/assets/themes/j1/core/css/themes/uno-light/bootstrap.min.css +0 -23
- data/assets/themes/j1/modules/bmd/css/bootstrap-material-design.css +0 -12177
- data/assets/themes/j1/modules/bmd/css/bootstrap-material-design.min.css +0 -8
- data/assets/themes/j1/modules/bmd/js/bootstrap-material-design.full.js +0 -6930
- data/assets/themes/j1/modules/bmd/js/bootstrap-material-design.js +0 -6936
- data/assets/themes/j1/modules/bmd/js/bootstrap-material-design.js.map +0 -1
- data/assets/themes/j1/modules/bmd/js/bootstrap-material-design.min.js +0 -1
- data/assets/themes/j1/modules/popper/js/popper.js.map +0 -1
- data/assets/themes/j1/modules/util/js/domready.js +0 -146
- data/lib/j1/commands/help.rb +0 -32
- data/lib/j1/commands/module.rb +0 -69
- data/lib/starter_web/_data/blocks/defaults/panel.1.yml +0 -256
- data/lib/starter_web/_data/blocks/defaults/panel.2.yml +0 -250
@@ -0,0 +1,127 @@
|
|
1
|
+
---
|
2
|
+
title: Tester
|
3
|
+
tagline: button
|
4
|
+
date: 2020-11-03 00:00:00 +100
|
5
|
+
description: >
|
6
|
+
Welcome to the preview page focussing on the image module. This page
|
7
|
+
shows some valuable features of the J1 Template to manage your image-based
|
8
|
+
content using lightboxes, carousels (slider), and galleries.
|
9
|
+
|
10
|
+
categories: [ Testpages ]
|
11
|
+
tags: [ Example ]
|
12
|
+
|
13
|
+
comments: false
|
14
|
+
fab_menu_id: page_ctrl_simple
|
15
|
+
|
16
|
+
permalink: /pages/public/learn/button_tester/
|
17
|
+
regenerate: false
|
18
|
+
|
19
|
+
resources: [
|
20
|
+
clipboard, rouge, carousel, lightbox,
|
21
|
+
justifiedGallery, lightGallery
|
22
|
+
]
|
23
|
+
resource_options:
|
24
|
+
- attic:
|
25
|
+
padding_top: 400
|
26
|
+
padding_bottom: 50
|
27
|
+
opacity: 0.5
|
28
|
+
slides:
|
29
|
+
- url: /assets/images/pages/roundtrip/images-1920x1280-bw.jpg
|
30
|
+
alt: Photo by Ricardo Gomez Angel on Unsplash
|
31
|
+
badge:
|
32
|
+
type: unsplash
|
33
|
+
author: Ricardo Gomez Angel
|
34
|
+
href: https://unsplash.com/@ripato/portfolio
|
35
|
+
---
|
36
|
+
|
37
|
+
// Page Initializer
|
38
|
+
// =============================================================================
|
39
|
+
// Enable the Liquid Preprocessor
|
40
|
+
:page-liquid:
|
41
|
+
|
42
|
+
// Set (local) page attributes here
|
43
|
+
// -----------------------------------------------------------------------------
|
44
|
+
// :page--attr: <attr-value>
|
45
|
+
:images-dir: {imagesdir}/pages/roundtrip/100_present_images
|
46
|
+
|
47
|
+
// Load Liquid procedures
|
48
|
+
// -----------------------------------------------------------------------------
|
49
|
+
{% capture load_attributes %}themes/{{site.template.name}}/procedures/global/attributes_loader.proc{%endcapture%}
|
50
|
+
|
51
|
+
// Load page attributes
|
52
|
+
// -----------------------------------------------------------------------------
|
53
|
+
{% include {{load_attributes}} scope="all" %}
|
54
|
+
|
55
|
+
// Page content
|
56
|
+
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
57
|
+
|
58
|
+
// Include sub-documents (if any)
|
59
|
+
// -----------------------------------------------------------------------------
|
60
|
+
|
61
|
+
++++
|
62
|
+
<div>
|
63
|
+
|
64
|
+
<a href="#void" class="btn btn-xl btn-primary text-uppercase mr-2 mb-2">
|
65
|
+
<i class="mdi mdi-language-ruby mdi-3x mr-2"></i>
|
66
|
+
<span class="float-right text-left mt-2">Let's Use this Button
|
67
|
+
<span class="d-block r-text-200">30 days free for all users</span>
|
68
|
+
</span>
|
69
|
+
</a>
|
70
|
+
|
71
|
+
<a href="#void" class="btn btn-xl btn-primary text-uppercase mr-2 mb-2">
|
72
|
+
<i class="mdi mdi-language-ruby mdi-3x mr-2"></i>
|
73
|
+
<span class="float-right text-left mt-2">Let's Use this Button
|
74
|
+
<span class="d-block r-text-200">30 days free for all users</span>
|
75
|
+
</span>
|
76
|
+
</a>
|
77
|
+
|
78
|
+
</div>
|
79
|
+
|
80
|
+
<style>
|
81
|
+
|
82
|
+
/*
|
83
|
+
.btn-xl {
|
84
|
+
line-height: 1.4;
|
85
|
+
padding: 0.92857rem 1.85714rem;
|
86
|
+
font-size: 1.28571rem;
|
87
|
+
}
|
88
|
+
|
89
|
+
.u-btn-content {
|
90
|
+
white-space: normal;
|
91
|
+
}
|
92
|
+
|
93
|
+
.g-font-weight-600 {
|
94
|
+
font-weight: 600 !important;
|
95
|
+
}
|
96
|
+
|
97
|
+
.g-letter-spacing-0_5 {
|
98
|
+
letter-spacing: 0.03571rem;
|
99
|
+
}
|
100
|
+
|
101
|
+
.g-brd-2 {
|
102
|
+
border-width: 2px !important;
|
103
|
+
}
|
104
|
+
|
105
|
+
.g-mr-10 {
|
106
|
+
margin-right: 0.71429rem !important;
|
107
|
+
}
|
108
|
+
|
109
|
+
.g-mb-15 {
|
110
|
+
margin-bottom: 1.07143rem !important;
|
111
|
+
}
|
112
|
+
|
113
|
+
.g-font-size-11 {
|
114
|
+
font-size: 0.78571rem !important;
|
115
|
+
}
|
116
|
+
|
117
|
+
.g-font-size-42 {
|
118
|
+
font-size: 3rem !important;
|
119
|
+
}
|
120
|
+
|
121
|
+
.pull-left {
|
122
|
+
float: left;
|
123
|
+
}
|
124
|
+
*/
|
125
|
+
|
126
|
+
</style>
|
127
|
+
++++
|
@@ -0,0 +1,128 @@
|
|
1
|
+
---
|
2
|
+
title: Tester
|
3
|
+
tagline: button
|
4
|
+
date: 2020-11-03 00:00:00 +100
|
5
|
+
description: >
|
6
|
+
Welcome to the preview page focussing on the image module. This page
|
7
|
+
shows some valuable features of the J1 Template to manage your image-based
|
8
|
+
content using lightboxes, carousels (slider), and galleries.
|
9
|
+
|
10
|
+
categories: [ Testpages ]
|
11
|
+
tags: [ Example ]
|
12
|
+
|
13
|
+
comments: false
|
14
|
+
fab_menu_id: page_ctrl_simple
|
15
|
+
|
16
|
+
permalink: /pages/public/learn/card_tester/
|
17
|
+
regenerate: false
|
18
|
+
|
19
|
+
resources: [
|
20
|
+
clipboard, rouge, carousel, lightbox,
|
21
|
+
justifiedGallery, lightGallery
|
22
|
+
]
|
23
|
+
resource_options:
|
24
|
+
- attic:
|
25
|
+
padding_top: 400
|
26
|
+
padding_bottom: 50
|
27
|
+
opacity: 0.5
|
28
|
+
slides:
|
29
|
+
- url: /assets/images/pages/roundtrip/images-1920x1280-bw.jpg
|
30
|
+
alt: Photo by Ricardo Gomez Angel on Unsplash
|
31
|
+
badge:
|
32
|
+
type: unsplash
|
33
|
+
author: Ricardo Gomez Angel
|
34
|
+
href: https://unsplash.com/@ripato/portfolio
|
35
|
+
---
|
36
|
+
|
37
|
+
// Page Initializer
|
38
|
+
// =============================================================================
|
39
|
+
// Enable the Liquid Preprocessor
|
40
|
+
:page-liquid:
|
41
|
+
|
42
|
+
// Set (local) page attributes here
|
43
|
+
// -----------------------------------------------------------------------------
|
44
|
+
// :page--attr: <attr-value>
|
45
|
+
:images-dir: {imagesdir}/pages/roundtrip/100_present_images
|
46
|
+
|
47
|
+
// Load Liquid procedures
|
48
|
+
// -----------------------------------------------------------------------------
|
49
|
+
{% capture load_attributes %}themes/{{site.template.name}}/procedures/global/attributes_loader.proc{%endcapture%}
|
50
|
+
|
51
|
+
// Load page attributes
|
52
|
+
// -----------------------------------------------------------------------------
|
53
|
+
{% include {{load_attributes}} scope="all" %}
|
54
|
+
|
55
|
+
// Page content
|
56
|
+
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
57
|
+
|
58
|
+
// Include sub-documents (if any)
|
59
|
+
// -----------------------------------------------------------------------------
|
60
|
+
|
61
|
+
++++
|
62
|
+
<div>
|
63
|
+
|
64
|
+
<article class="card raised-z3 mb-5">
|
65
|
+
<h3 id="35983" class="card-header bg-primary">Welcome</h3>
|
66
|
+
<!-- h5 class="notoc card-subtitle text-muted mb-2">jekyll for everyone</h5 -->
|
67
|
+
|
68
|
+
<div class="row mx-0">
|
69
|
+
|
70
|
+
<div class="col-md-6 img-bg--fill px-0"
|
71
|
+
style="border-right: 1px dotted rgba(0, 0, 0, 0.25); background-image: url(/assets/images/modules/attics/katie-moum-1920x1280.jpg);">
|
72
|
+
</div>
|
73
|
+
|
74
|
+
<!-- div class="col-md-6 px-0">
|
75
|
+
<img class="img__object--cover" src="/assets/images/modules/attics/katie-moum-1920x1280.jpg" alt="Welcome">
|
76
|
+
</div -->
|
77
|
+
|
78
|
+
<div class="col-md-6 p-0">
|
79
|
+
<div class="card-body r-text-300">All you’re doing at the end of the day is writing your content, and the J1 Template does all the tricky things: putting out HTML, Javascript, and CSS. As a result, the site creation process gets out of your way. Sounds fun, isn’t it? ...</div>
|
80
|
+
<div class="card-footer r-text-200">
|
81
|
+
|
82
|
+
<div class="card-footer-text">
|
83
|
+
<i class="mdi mdi-calendar-blank mdi-md-grey mr-1"></i> 2021 March, 28
|
84
|
+
</div>
|
85
|
+
<a class="card-link text-muted text-lowercase" href="/posts/public/featured/2021/03/28/welcome-to-j1/#readmore">
|
86
|
+
Read · jekyll for everyone
|
87
|
+
</a>
|
88
|
+
</div>
|
89
|
+
</div>
|
90
|
+
|
91
|
+
</div>
|
92
|
+
|
93
|
+
</article>
|
94
|
+
|
95
|
+
|
96
|
+
<article class="card raised-z5 mb-5">
|
97
|
+
<h3 id="35983" class="card-header bg-primary">Welcome</h3>
|
98
|
+
<!-- h5 class="notoc card-subtitle text-muted mb-2">jekyll for everyone</h5 -->
|
99
|
+
<div class="card-body r-text-300">All you’re doing at the end of the day is writing your content, and the J1 Template does all the tricky things: putting out HTML, Javascript, and CSS. As a result, the site creation process gets out of your way. Sounds fun, isn’t it? ...</div>
|
100
|
+
<div class="card-footer r-text-200">
|
101
|
+
<div class="card-footer-text">
|
102
|
+
<i class="mdi mdi-calendar-blank mr-1"></i> 2021 March, 28
|
103
|
+
</div>
|
104
|
+
<a class="card-link md-grey-800 font-weight-bold g-font-size-12 text-uppercase" href="/posts/public/featured/2021/03/28/welcome-to-j1/#readmore">
|
105
|
+
Read · jekyll for everyone
|
106
|
+
</a>
|
107
|
+
</div>
|
108
|
+
</article>
|
109
|
+
|
110
|
+
</div>
|
111
|
+
|
112
|
+
<style>
|
113
|
+
|
114
|
+
|
115
|
+
.g-bg-img-hero {
|
116
|
+
background-size: cover;
|
117
|
+
background-repeat: no-repeat;
|
118
|
+
background-position: center;
|
119
|
+
}
|
120
|
+
|
121
|
+
.g-px-0 {
|
122
|
+
padding-left: 0 !important;
|
123
|
+
padding-right: 0 !important;
|
124
|
+
}
|
125
|
+
|
126
|
+
</style>
|
127
|
+
|
128
|
+
++++
|
@@ -0,0 +1,96 @@
|
|
1
|
+
---
|
2
|
+
title: J1
|
3
|
+
tagline: Cookie Consent
|
4
|
+
date: 2021-06-24 00:00:00 +100
|
5
|
+
description: >
|
6
|
+
Bootstrap Cookie Consent Module
|
7
|
+
for J1 Template
|
8
|
+
|
9
|
+
categories: [ Testpages ]
|
10
|
+
tags: [ Example ]
|
11
|
+
|
12
|
+
scrollbar: false
|
13
|
+
fab_menu_id: default
|
14
|
+
|
15
|
+
advertising: false
|
16
|
+
comments: false
|
17
|
+
|
18
|
+
permalink: /pages/public/cookieConsent/
|
19
|
+
regenerate: true
|
20
|
+
|
21
|
+
resources: [ bsCookieConsent ]
|
22
|
+
resource_options:
|
23
|
+
- attic:
|
24
|
+
padding_top: 400
|
25
|
+
padding_bottom: 50
|
26
|
+
opacity: 0.5
|
27
|
+
slides:
|
28
|
+
- url: /assets/images/modules/attics/cookies-1920x1200.jpg
|
29
|
+
---
|
30
|
+
|
31
|
+
// Page Initializer
|
32
|
+
// =============================================================================
|
33
|
+
// Enable the Liquid Preprocessor
|
34
|
+
:page-liquid:
|
35
|
+
|
36
|
+
// Set (local) page attributes here
|
37
|
+
// -----------------------------------------------------------------------------
|
38
|
+
// :page--attr: <attr-value>
|
39
|
+
:badges-enabled: false
|
40
|
+
|
41
|
+
// Load Liquid procedures
|
42
|
+
// -----------------------------------------------------------------------------
|
43
|
+
{% capture load_attributes %}themes/{{site.template.name}}/procedures/global/attributes_loader.proc{%endcapture%}
|
44
|
+
|
45
|
+
// Load page attributes
|
46
|
+
// -----------------------------------------------------------------------------
|
47
|
+
{% include {{load_attributes}} scope="global" %}
|
48
|
+
|
49
|
+
|
50
|
+
// Page content
|
51
|
+
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
52
|
+
|
53
|
+
++++
|
54
|
+
<div class="container">
|
55
|
+
<h2>Usage</h2>
|
56
|
+
<p>Initialize the cookie consent framework with the constructor</p>
|
57
|
+
<p><code>var cookieSettings = new BootstrapCookieConsent()</code></p>
|
58
|
+
<h3>Show the Dialog</h3>
|
59
|
+
<p>
|
60
|
+
On a new visit the dialog is shown automatically. For reconfiguration
|
61
|
+
show the Dialog again with <code>cookieSettings.showDialog()</code>.
|
62
|
+
</p>
|
63
|
+
<p>
|
64
|
+
<a href="javascript:showSettingsDialog()" class="btn btn-primary">Cookie Settings</a>
|
65
|
+
</p>
|
66
|
+
<h2>Read the settings</h2>
|
67
|
+
<p>Read all cookie settings with <code>cookieSettings.getSettings()</code></p>
|
68
|
+
<div class="card mb-4">
|
69
|
+
<div class="card-body">
|
70
|
+
<pre class="mb-0" id="settingsOutput"></pre>
|
71
|
+
</div>
|
72
|
+
</div>
|
73
|
+
<p>Read a specific cookie setting with <code>cookieSettings.getSettings('analyses')</code></p>
|
74
|
+
<div class="card">
|
75
|
+
<div class="card-body">
|
76
|
+
<pre class="mb-0" id="settingsAnalysisOutput"></pre>
|
77
|
+
</div>
|
78
|
+
</div>
|
79
|
+
</div>
|
80
|
+
|
81
|
+
<script>
|
82
|
+
|
83
|
+
function showSettingsDialog() {
|
84
|
+
j1.cookieConsent.showDialog();
|
85
|
+
}
|
86
|
+
|
87
|
+
var dependencies_met_cookie_consent_ready = setInterval (function (options) {
|
88
|
+
if ( typeof j1.cookieConsent !== 'undefined' ) {
|
89
|
+
$("#settingsOutput").text(JSON.stringify(j1.cookieConsent.getSettings()))
|
90
|
+
$("#settingsAnalysisOutput").text(j1.cookieConsent.getSettings('analyses'))
|
91
|
+
clearInterval(dependencies_met_cookie_consent_ready);
|
92
|
+
}
|
93
|
+
});
|
94
|
+
|
95
|
+
</script>
|
96
|
+
++++
|
@@ -0,0 +1,258 @@
|
|
1
|
+
---
|
2
|
+
title: Tester
|
3
|
+
tagline: deepl
|
4
|
+
date: 2020-11-03 00:00:00 +100
|
5
|
+
description: >
|
6
|
+
Welcome to the preview page focussing on the image module. This page
|
7
|
+
shows some valuable features of the J1 Template to manage your image-based
|
8
|
+
content using lightboxes, carousels (slider), and galleries.
|
9
|
+
|
10
|
+
categories: [ Testpages ]
|
11
|
+
tags: [ Example ]
|
12
|
+
|
13
|
+
comments: false
|
14
|
+
fab_menu_id: page_ctrl_simple
|
15
|
+
|
16
|
+
permalink: /pages/public/learn/deepl-0/
|
17
|
+
regenerate: false
|
18
|
+
|
19
|
+
resources: [ clipboard, rouge ]
|
20
|
+
resource_options:
|
21
|
+
- attic:
|
22
|
+
padding_top: 400
|
23
|
+
padding_bottom: 50
|
24
|
+
opacity: 0.5
|
25
|
+
slides:
|
26
|
+
- url: /assets/images/pages/roundtrip/images-1920x1280-bw.jpg
|
27
|
+
alt: Photo by Ricardo Gomez Angel on Unsplash
|
28
|
+
badge:
|
29
|
+
type: unsplash
|
30
|
+
author: Ricardo Gomez Angel
|
31
|
+
href: https://unsplash.com/@ripato/portfolio
|
32
|
+
---
|
33
|
+
|
34
|
+
// Page Initializer
|
35
|
+
// =============================================================================
|
36
|
+
// Enable the Liquid Preprocessor
|
37
|
+
:page-liquid:
|
38
|
+
|
39
|
+
// Set (local) page attributes here
|
40
|
+
// -----------------------------------------------------------------------------
|
41
|
+
// :page--attr: <attr-value>
|
42
|
+
:images-dir: {imagesdir}/pages/roundtrip/100_present_images
|
43
|
+
|
44
|
+
// Load Liquid procedures
|
45
|
+
// -----------------------------------------------------------------------------
|
46
|
+
{% capture load_attributes %}themes/{{site.template.name}}/procedures/global/attributes_loader.proc{%endcapture%}
|
47
|
+
|
48
|
+
// Load page attributes
|
49
|
+
// -----------------------------------------------------------------------------
|
50
|
+
{% include {{load_attributes}} scope="global" %}
|
51
|
+
|
52
|
+
// Page content
|
53
|
+
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
54
|
+
// https://github.com/EdwardBalaj/Simple-DeepL-API-Integration
|
55
|
+
|
56
|
+
// Include sub-documents (if any)
|
57
|
+
// -----------------------------------------------------------------------------
|
58
|
+
|
59
|
+
== Deepl API V2
|
60
|
+
|
61
|
+
An integration of the DeepL API that translates a given text from one language
|
62
|
+
(default:English) to another language and outputs the translation.
|
63
|
+
|
64
|
+
++++
|
65
|
+
<div>
|
66
|
+
<!-- Keeps all elements in a well laid out form. -->
|
67
|
+
<form id="layout">
|
68
|
+
<!-- Source language part, also kept in its own element. -->
|
69
|
+
<div id="source">
|
70
|
+
<!-- Since English is the only option, it will default to it. -->
|
71
|
+
<select id="source-language" name="source-language">
|
72
|
+
<option value="DE">Auto</option>
|
73
|
+
<option value="EN">English</option>
|
74
|
+
<option value="DE">German</option>
|
75
|
+
</select>
|
76
|
+
|
77
|
+
<textarea type="text" id="original-text"></textarea>
|
78
|
+
</div>
|
79
|
+
|
80
|
+
<!-- Uses the translateText() function in the API-DeepL.js file to parse the input, s
|
81
|
+
end it for translation, and then parse the response. -->
|
82
|
+
<input type="button" id="translate" onclick="translateText()" value="Translate">
|
83
|
+
</br>
|
84
|
+
|
85
|
+
<!-- Destination language part, also kept in its own element. -->
|
86
|
+
<div id="destination">
|
87
|
+
<!-- Since there are more destination languages, and they are all sorted in alphabetical order,
|
88
|
+
Bulgarian is the default one. -->
|
89
|
+
<select id="destination-language" name="destination-language">
|
90
|
+
<option value="BG">Bulgarian</option>
|
91
|
+
<option value="ZH">Chinese</option>
|
92
|
+
<option value="CS">Czech</option>
|
93
|
+
<option value="DA">Danish</option>
|
94
|
+
<option value="NL">Dutch</option>
|
95
|
+
<option value="EN-US">English (American)</option>
|
96
|
+
<option value="EN-GB">English (British)</option>
|
97
|
+
<option value="EN">English (Others)</option>
|
98
|
+
<option value="ET">Estonian</option>
|
99
|
+
<option value="FI">Finnish</option>
|
100
|
+
<option value="FR">French</option>
|
101
|
+
<option selected value="DE">German</option>
|
102
|
+
<option value="EL">Greek</option>
|
103
|
+
<option value="HU">Hungarian</option>
|
104
|
+
<option value="IT">Italian</option>
|
105
|
+
<option value="JA">Japanese</option>
|
106
|
+
<option value="LV">Latvian</option>
|
107
|
+
<option value="LT">Lithuanian</option>
|
108
|
+
<option value="PL">Polish</option>
|
109
|
+
<option value="PT-PT">Portuguese (Portugal)</option>
|
110
|
+
<option value="PT-BR">Portuguese (Brazilian)</option>
|
111
|
+
<option value="PT">Portuguese (Others)</option>
|
112
|
+
<option value="RO">Romanian</option>
|
113
|
+
<option value="RU">Russian</option>
|
114
|
+
<option value="SK">Slovak</option>
|
115
|
+
<option value="SL">Slovenian</option>
|
116
|
+
<option value="ES">Spanish</option>
|
117
|
+
<option value="SV">Swedish</option>
|
118
|
+
</select>
|
119
|
+
|
120
|
+
<textarea type="text" id="translated-text"></textarea>
|
121
|
+
</div>
|
122
|
+
|
123
|
+
</form>
|
124
|
+
</div>
|
125
|
+
++++
|
126
|
+
|
127
|
+
++++
|
128
|
+
<style>
|
129
|
+
|
130
|
+
textarea {
|
131
|
+
word-wrap: break-word;
|
132
|
+
min-width: 100%;
|
133
|
+
max-width: 100%;
|
134
|
+
min-height: 10em;
|
135
|
+
}
|
136
|
+
|
137
|
+
select {
|
138
|
+
display: block;
|
139
|
+
width: 10em;
|
140
|
+
margin: 1em 0;
|
141
|
+
}
|
142
|
+
|
143
|
+
</style>
|
144
|
+
++++
|
145
|
+
|
146
|
+
++++
|
147
|
+
<script>
|
148
|
+
|
149
|
+
/*
|
150
|
+
Author: Alexandru Edward Balaj
|
151
|
+
Date: 15/07/2021
|
152
|
+
Project: Simple DeepL API Integration
|
153
|
+
License: MIT License
|
154
|
+
File name: API-DeepL.js
|
155
|
+
File description: JavaScript algorithm that parses the input, sends it using the DeepL API,
|
156
|
+
and then parses the output to display it.
|
157
|
+
*/
|
158
|
+
|
159
|
+
/*
|
160
|
+
The aim of the algorithm design laid out here,
|
161
|
+
was to create a module oriented way,
|
162
|
+
to help with futures updates and allow for easier error tracking.
|
163
|
+
*/
|
164
|
+
|
165
|
+
/*
|
166
|
+
Authentication key given in the specifications.
|
167
|
+
*/
|
168
|
+
// var AUTH_KEY = "5652c0b9-adcf-7f2e-f6a2-3a577f700dc9:fx";
|
169
|
+
var AUTH_KEY = "fe1c56dc-1342-9899-26db-c5d701791e2d:fx";
|
170
|
+
|
171
|
+
var TAG_HANDLING = "xml";
|
172
|
+
/*
|
173
|
+
Since the specifications required for the website,
|
174
|
+
to accept only English text, the source language is coded here,
|
175
|
+
so that in the future, if required this could be easily changed.
|
176
|
+
*/
|
177
|
+
var SOURCE_LANG = "auto";
|
178
|
+
|
179
|
+
/*
|
180
|
+
According to XMLHttpRequest specifications, when the request is done,
|
181
|
+
it returns a code ("4"), and when the status of the request is ok,
|
182
|
+
it returns another code ("200");
|
183
|
+
*/
|
184
|
+
var READYSTATE_DONE = 4;
|
185
|
+
var STATUS_OK = 200;
|
186
|
+
|
187
|
+
/*
|
188
|
+
Creates an xmlHttpRequest object as soon as the page has loaded.
|
189
|
+
*/
|
190
|
+
var xhr = new XMLHttpRequest();
|
191
|
+
|
192
|
+
/*
|
193
|
+
Setup function for creating a request, designed as a module, according to DeepL API specifications.
|
194
|
+
*/
|
195
|
+
function setup() {
|
196
|
+
xhr.open("POST", "https://api-free.deepl.com/v2/translate", true);
|
197
|
+
|
198
|
+
xhr.setRequestHeader("Accept", "*/*");
|
199
|
+
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
|
200
|
+
// xhr.setRequestHeader("tag_handling", "xml");
|
201
|
+
// xhr.setRequestHeader("User-Agent", "DeepL API Implementation");
|
202
|
+
// xhr.setRequestHeader("Content-Length", null);
|
203
|
+
}
|
204
|
+
|
205
|
+
/*
|
206
|
+
Prepare text function used to parse, or arrange text, designed as a module.
|
207
|
+
Currently it splits all text whenever a newline ("\n") is met,
|
208
|
+
so that it preserves the original layout of the text,
|
209
|
+
which would have otherwise been lost because of the way DeepL accepts multiple sentences.
|
210
|
+
*/
|
211
|
+
function prepareText(original_text) {
|
212
|
+
return original_text.split("\n");
|
213
|
+
}
|
214
|
+
|
215
|
+
/*
|
216
|
+
Translate text function which uses all the other modules, in order to create a request,
|
217
|
+
which is sent to the DeepL API to translate, and then display the result, designed as a module.
|
218
|
+
*/
|
219
|
+
function translateText() {
|
220
|
+
setup();
|
221
|
+
|
222
|
+
var target_language = document.getElementById("destination-language").value;
|
223
|
+
|
224
|
+
var original_text = document.getElementById("original-text").value;
|
225
|
+
|
226
|
+
original_text_lines = prepareText(original_text);
|
227
|
+
|
228
|
+
// Makes a request with every line, as a new text to translate.
|
229
|
+
var request = "";
|
230
|
+
for(var i = 0; i < original_text_lines.length; i++) {
|
231
|
+
request += "&text=" + original_text_lines[i];
|
232
|
+
}
|
233
|
+
|
234
|
+
xhr.onload = function () {
|
235
|
+
if (xhr.readyState === xhr.DONE) {
|
236
|
+
if (xhr.status === 200) {
|
237
|
+
// Uses JSON to parse the response.
|
238
|
+
var result = JSON.parse(xhr.responseText);
|
239
|
+
|
240
|
+
// Recreates the response as one text, which kept its original layout.
|
241
|
+
var translated_text = "";
|
242
|
+
for(var i = 0; i < result.translations.length; i++) {
|
243
|
+
translated_text += result.translations[i].text;
|
244
|
+
translated_text += "\n";
|
245
|
+
}
|
246
|
+
|
247
|
+
document.getElementById("translated-text").value = translated_text;
|
248
|
+
}
|
249
|
+
}
|
250
|
+
};
|
251
|
+
|
252
|
+
// Send the request to the server for translation.
|
253
|
+
//xhr.send("auth_key=" + AUTH_KEY + request + "&source_lang=" + SOURCE_LANG + "&target_lang=" + target_language);
|
254
|
+
xhr.send("auth_key=" + AUTH_KEY + request + "&target_lang=" + target_language + "&tag_handling=xml&ignore_tags=em");
|
255
|
+
//xhr.send("auth_key=" + AUTH_KEY + request + "&source_lang=" + SOURCE_LANG + "&target_lang=" + target_language + "tag_handling=" + TAG_HANDLING);
|
256
|
+
}
|
257
|
+
</script>
|
258
|
+
++++
|