j1-template 2021.1.29 → 2021.2.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/layouts/content_generator_news_panel_posts.html +6 -6
- data/_includes/themes/j1/layouts/content_generator_post.html +3 -0
- data/_includes/themes/j1/procedures/posts/collate_timeline.proc +5 -5
- data/_includes/themes/j1/procedures/posts/create_series_header.proc +6 -6
- data/_layouts/default.html +36 -26
- data/assets/data/mdil_icons.json +2417 -0
- data/assets/data/panel.html +10 -10
- data/assets/data/quicklinks.html +1 -2
- data/assets/themes/j1/adapter/js/fam.js +1 -1
- data/assets/themes/j1/adapter/js/j1.js +139 -139
- data/assets/themes/j1/adapter/js/navigator.js +11 -4
- data/assets/themes/j1/adapter/js/rtable.js +77 -24
- data/assets/themes/j1/core/css/icon-fonts/materialdesign-light.css +1222 -0
- data/assets/themes/j1/core/css/icon-fonts/materialdesign-light.min.css +1 -0
- data/assets/themes/j1/core/css/icon-fonts/materialdesign.css +1 -1
- data/assets/themes/j1/core/css/themes/uno-dark/bootstrap.css +58 -109
- data/assets/themes/j1/core/css/themes/uno-dark/bootstrap.min.css +1 -1
- data/assets/themes/j1/core/css/themes/uno-light/bootstrap.css +28 -18
- data/assets/themes/j1/core/css/themes/uno-light/bootstrap.min.css +1 -1
- data/assets/themes/j1/core/css/vendor.css +7 -20
- data/assets/themes/j1/core/css/vendor.min.css +1 -1
- data/assets/themes/j1/core/fonts/material_design_icons_light/fonts/eot/materialdesignicons-light-webfont.eot +0 -0
- data/assets/themes/j1/core/fonts/material_design_icons_light/fonts/materialdesignicons-light-webfont.woff +0 -0
- data/assets/themes/j1/core/fonts/material_design_icons_light/fonts/materialdesignicons-light-webfont.woff2 +0 -0
- data/assets/themes/j1/core/fonts/material_design_icons_light/fonts/svg/materialdesignicons-light-webfont.svg +801 -0
- data/assets/themes/j1/core/fonts/material_design_icons_light/fonts/ttf/materialdesignicons-light-webfont.ttf +0 -0
- data/assets/themes/j1/core/js/template.js +16 -7
- data/assets/themes/j1/core/js/template.js.map +1 -1
- data/assets/themes/j1/core/js/template.min.js +16 -7
- data/assets/themes/j1/core/js/template.min.js.map +1 -1
- data/assets/themes/j1/modules/carousel/css/theme/uno.css +1 -1
- data/assets/themes/j1/modules/carousel/css/theme/uno.min.css +1 -1
- data/assets/themes/j1/modules/j1Deepl/js/j1deepl.js +385 -0
- data/assets/themes/j1/modules/j1Deepl/js/j1deepl.min.js +18 -0
- data/assets/themes/j1/modules/j1Scroll/js/j1scroll.js +3 -0
- data/assets/themes/j1/modules/justifiedGallery/css/theme/uno.css +1 -1
- data/assets/themes/j1/modules/justifiedGallery/css/theme/uno.min.css +1 -1
- data/assets/themes/j1/modules/mdiPreviewer/css/previewer.css +1 -1
- data/assets/themes/j1/modules/mdiPreviewer/css/previewer.min.css +1 -1
- data/assets/themes/j1/modules/mdiPreviewer/js/previewer.js +5 -15
- data/assets/themes/j1/modules/mdiPreviewer/js/previewer.min.js +1 -1
- data/assets/themes/j1/modules/mdilPreviewer/css/previewer.css +97 -0
- data/assets/themes/j1/modules/mdilPreviewer/css/previewer.min.css +15 -0
- data/assets/themes/j1/modules/mdilPreviewer/js/previewer.js +125 -0
- data/assets/themes/j1/modules/mdilPreviewer/js/previewer.min.js +15 -0
- data/assets/themes/j1/modules/rtable/css/theme/uno/rtable.css +3 -3
- data/assets/themes/j1/modules/rtable/css/theme/uno/rtable.min.css +2 -174
- data/assets/themes/j1/modules/rtable/js/rtable.js +59 -25
- data/assets/themes/j1/modules/rtable/js/rtable.min.js +12 -683
- data/assets/themes/j1/modules/showOnScroll/js/showOnScroll.js +73 -73
- data/assets/themes/j1/modules/showOnScroll/js/showOnScroll.min.js +15 -15
- data/lib/j1/commands/generate.rb +5 -8
- data/lib/j1/version.rb +3 -3
- data/lib/starter_web/Gemfile +1 -1
- data/lib/starter_web/_config.yml +15 -51
- data/lib/starter_web/_data/blocks/banner.yml +4 -5
- data/lib/starter_web/_data/modules/defaults/rtable.yml +34 -0
- data/lib/starter_web/_data/modules/j1scroll.yml +2 -2
- data/lib/starter_web/_data/modules/navigator_menu.yml +3 -3
- data/lib/starter_web/_data/modules/rtable.yml +34 -0
- data/lib/starter_web/_data/resources.yml +45 -1
- data/lib/starter_web/_includes/attributes.asciidoc +6 -1
- data/lib/starter_web/_plugins/lunr_index.rb +1 -1
- data/lib/starter_web/assets/images/modules/attics/annie-spratt-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/antonino-visalli-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/humble-lamb-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/library-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/romain-vignes-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/sigmund-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/{pages/videos → modules/attics}/szabo-viktor-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/pages/asciidoc_skeletons/example-pdf-screenshot.png +0 -0
- data/lib/starter_web/collections/posts/public/featured/_posts/{2020-01-01-about-cookies.adoc → 2021-01-01-about-cookies.adoc} +0 -0
- data/lib/starter_web/collections/posts/public/featured/_posts/{2021-03-01-site-generators.adoc → 2021-02-01-site-generators.adoc} +0 -0
- data/lib/starter_web/collections/posts/public/{wikipedia/_posts/2016-11-20-minneapolis.adoc → series/_posts/2020-01-01-post-wiki-series.adoc} +11 -10
- data/lib/starter_web/collections/posts/public/{wikipedia/_posts/2016-11-24-narcisse-snake-dens.adoc → series/_posts/2020-01-02-post-wiki-series.adoc} +15 -13
- data/lib/starter_web/collections/posts/public/{wikipedia/_posts/2016-11-26-columbia-river.adoc → series/_posts/2020-01-03-post-wiki-series.adoc} +28 -11
- data/lib/starter_web/collections/posts/public/{wikipedia → series}/_posts/_includes/attributes.asciidoc +0 -0
- data/lib/starter_web/collections/posts/public/{wikipedia → series}/_posts/_includes/documents/readme +0 -0
- data/lib/starter_web/collections/posts/public/{wikipedia → series}/_posts/_includes/tables/readme +0 -0
- data/lib/starter_web/index.html +2 -2
- data/lib/starter_web/package.json +2 -2
- data/lib/starter_web/pages/public/asciidoc_skeletons/{book → documentation}/000_intro.adoc +5 -7
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/100_converter.adoc +43 -0
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/200_themes.adoc +61 -0
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/attributes.asciidoc +95 -0
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/documents/000_intro.asciidoc +54 -0
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/documents/100_converter/000_basic_example.asciidoc +31 -0
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/documents/100_converter/111_about_the_converter.asciidoc +111 -0
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/documents/100_converter/112_getting_started.asciidoc +95 -0
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/documents/100_converter/113_themes.asciidoc +39 -0
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/documents/100_converter.asciidoc +8 -0
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/documents/200_themes/211_language_overview.asciidoc +122 -0
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/documents/200_themes/212_values.asciidoc +502 -0
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/documents/200_themes/213_fonts.asciidoc +261 -0
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/documents/200_themes.asciidoc +8 -0
- data/lib/starter_web/pages/public/asciidoc_skeletons/{book → documentation}/a2p.bat +1 -1
- data/lib/starter_web/pages/public/asciidoc_skeletons/{book → documentation}/a2p.sh +2 -2
- data/lib/starter_web/pages/public/asciidoc_skeletons/{book/book.a2p → documentation/documentation.a2p} +2 -8
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/documentation.adoc +86 -0
- data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/_includes/documents/100_chapter.asciidoc +848 -40
- data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/_includes/documents/200_chapter.asciidoc +149 -38
- data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/multi.adoc +2 -7
- data/lib/starter_web/pages/public/asciidoc_skeletons/simple-document/simple.adoc +312 -119
- data/lib/starter_web/pages/public/blog/navigator/archive/categoryview.html +4 -27
- data/lib/starter_web/pages/public/blog/navigator/archive/dateview.html +5 -27
- data/lib/starter_web/pages/public/blog/navigator/archive/tagview.html +0 -20
- data/lib/starter_web/pages/public/blog/navigator/archive.html +5 -27
- data/lib/starter_web/pages/public/previewer/bootstrap_theme.adoc +1 -1
- data/lib/starter_web/utilsrv/_defaults/package.json +1 -1
- data/lib/starter_web/utilsrv/package.json +1 -1
- metadata +53 -83
- data/assets/themes/j1/modules/rtable/js/tablesaw-init.js +0 -18
- data/assets/themes/j1/modules/rtable/js/tablesaw.stackonly.js +0 -2371
- data/lib/starter_web/collections/posts/public/series/_posts/2020-01-01-post-test-series.adoc +0 -128
- data/lib/starter_web/collections/posts/public/series/_posts/2020-01-02-post-test-series.adoc +0 -131
- data/lib/starter_web/collections/posts/public/series/_posts/2020-01-03-post-test-series.adoc +0 -131
- data/lib/starter_web/collections/posts/public/series/_posts/2020-01-04-post-test-series.adoc +0 -132
- data/lib/starter_web/pages/public/asciidoc_skeletons/_templates/asciidoc-extensions/blindtext.asciidoc +0 -11
- data/lib/starter_web/pages/public/asciidoc_skeletons/_templates/asciidoc-extensions/font_icons.asciidoc +0 -23
- data/lib/starter_web/pages/public/asciidoc_skeletons/_templates/asciidoc-extensions/gallery.asciidoc +0 -5
- data/lib/starter_web/pages/public/asciidoc_skeletons/_templates/asciidoc-extensions/lightbox.asciidoc +0 -7
- data/lib/starter_web/pages/public/asciidoc_skeletons/_templates/documents/chapter_document.asciidoc +0 -9
- data/lib/starter_web/pages/public/asciidoc_skeletons/_templates/documents/entry_document.asciidoc +0 -3
- data/lib/starter_web/pages/public/asciidoc_skeletons/_templates/images/image.asciidoc +0 -6
- data/lib/starter_web/pages/public/asciidoc_skeletons/_templates/tables/table_2_column.asciidoc +0 -12
- data/lib/starter_web/pages/public/asciidoc_skeletons/_templates/tables/table_2_column_options.asciidoc +0 -30
- data/lib/starter_web/pages/public/asciidoc_skeletons/_templates/tables/table_3_column.asciidoc +0 -16
- data/lib/starter_web/pages/public/asciidoc_skeletons/_templates/tables/table_4_column.asciidoc +0 -25
- data/lib/starter_web/pages/public/asciidoc_skeletons/book/100_chapter.adoc +0 -62
- data/lib/starter_web/pages/public/asciidoc_skeletons/book/200_chapter.adoc +0 -64
- data/lib/starter_web/pages/public/asciidoc_skeletons/book/900_references.adoc +0 -73
- data/lib/starter_web/pages/public/asciidoc_skeletons/book/_includes/attributes.asciidoc +0 -74
- data/lib/starter_web/pages/public/asciidoc_skeletons/book/_includes/documents/000_intro.asciidoc +0 -33
- data/lib/starter_web/pages/public/asciidoc_skeletons/book/_includes/documents/100_chapter/100_chapter_document.asciidoc +0 -21
- data/lib/starter_web/pages/public/asciidoc_skeletons/book/_includes/documents/100_chapter/110_chapter_document.asciidoc +0 -36
- data/lib/starter_web/pages/public/asciidoc_skeletons/book/_includes/documents/100_chapter.asciidoc +0 -7
- data/lib/starter_web/pages/public/asciidoc_skeletons/book/_includes/documents/200_chapter/200_chapter_document.asciidoc +0 -53
- data/lib/starter_web/pages/public/asciidoc_skeletons/book/_includes/documents/200_chapter.asciidoc +0 -5
- data/lib/starter_web/pages/public/asciidoc_skeletons/book/_includes/documents/900_references/000_intro.asciidoc +0 -23
- data/lib/starter_web/pages/public/asciidoc_skeletons/book/_includes/documents/900_references/100_chapter_document.asciidoc +0 -33
- data/lib/starter_web/pages/public/asciidoc_skeletons/book/_includes/documents/900_references/200_chapter_document.asciidoc +0 -26
- data/lib/starter_web/pages/public/asciidoc_skeletons/book/_includes/documents/900_references/900_sources.asciidoc +0 -81
- data/lib/starter_web/pages/public/asciidoc_skeletons/book/_includes/documents/900_references.asciidoc +0 -23
- data/lib/starter_web/pages/public/asciidoc_skeletons/book/_includes/documents/tables/110_material_design_icons.asciidoc +0 -102
- data/lib/starter_web/pages/public/asciidoc_skeletons/book/book.adoc +0 -136
- data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/100_chapter.asciidoc +0 -60
- data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/200_chapter.asciidoc +0 -59
- data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/_includes/documents/tables/110_material_design_icons.asciidoc +0 -102
- data/lib/starter_web/pages/public/features/modules.adoc +0 -104
- data/lib/starter_web/pages/public/features/platform.adoc +0 -104
- data/lib/starter_web/pages/public/previewer/_includes/attributes.asciidoc +0 -60
- data/lib/starter_web/pages/public/previewer/_includes/documents/licenses/mit.asciidoc +0 -19
- data/lib/starter_web/pages/public/previewer/_includes/documents/readme +0 -0
- data/lib/starter_web/pages/public/previewer/_includes/documents/rouge/100_language_examples.asciidoc +0 -119
- data/lib/starter_web/pages/public/previewer/_includes/tables/mdi_icons/100_absolute_sizes.asciidoc +0 -39
- data/lib/starter_web/pages/public/previewer/_includes/tables/mdi_icons/110_bs_grid_sizes.asciidoc +0 -47
- data/lib/starter_web/pages/public/previewer/_includes/tables/mdi_icons/120_relative_sizes.asciidoc +0 -47
- data/lib/starter_web/pages/public/previewer/_includes/tables/mdi_icons/200_rotate.asciidoc +0 -71
- data/lib/starter_web/pages/public/previewer/_includes/tables/mdi_icons/300_flip.asciidoc +0 -31
- data/lib/starter_web/pages/public/previewer/_includes/tables/mdi_icons/400_spin_pulsed.asciidoc +0 -39
- data/lib/starter_web/pages/public/previewer/_includes/tables/mdi_icons/500_bw_color_palette.asciidoc +0 -61
- data/lib/starter_web/pages/public/previewer/_includes/tables/mdi_icons/510_bs_color_palette.asciidoc +0 -55
- data/lib/starter_web/pages/public/previewer/_includes/tables/mdi_icons/600_md_color_palette.asciidoc +0 -95
- data/lib/starter_web/pages/public/previewer/_includes/tables/mdi_icons/601_md_color_palette_indigo.asciidoc +0 -95
- data/lib/starter_web/pages/public/previewer/_includes/tables/mdi_icons/602_md_color_palette_pink.asciidoc +0 -95
- data/lib/starter_web/pages/public/previewer/_includes/tables/rouge/200_rouge_attributes.asciidoc +0 -41
- data/lib/starter_web/pages/public/previewer/_includes/tables/rouge/300_supported_languages.asciidoc +0 -857
- data/lib/starter_web/pages/public/previewer/_includes/tables/twitter_emoji/100_bs_sizes.asciidoc +0 -47
- data/lib/starter_web/pages/public/previewer/_includes/tables/twitter_emoji/100_relative_sizes.asciidoc +0 -47
- data/lib/starter_web/pages/public/previewer/_includes/tables/twitter_emoji/200_rotate.asciidoc +0 -71
- data/lib/starter_web/pages/public/previewer/_includes/tables/twitter_emoji/300_flip.asciidoc +0 -30
- data/lib/starter_web/pages/public/previewer/_includes/tables/twitter_emoji/400_spin_pulsed.asciidoc +0 -31
- data/lib/starter_web/pages/public/previewer/iframer.adoc +0 -93
- data/lib/starter_web/pages/public/previewer/justified_gallery.html +0 -41
- data/lib/starter_web/pages/public/previewer/md_color_palette.adoc +0 -574
- data/lib/starter_web/pages/public/previewer/mdi_icons_preview.adoc +0 -220
- data/lib/starter_web/pages/public/previewer/rouge.adoc +0 -133
- data/lib/starter_web/pages/public/previewer/twitter_emoji_preview.adoc +0 -191
@@ -12,4 +12,4 @@
|
|
12
12
|
# See: https://github.com/jekyll-one-org/J1 Template/blob/master/LICENSE
|
13
13
|
# -----------------------------------------------------------------------------
|
14
14
|
*/
|
15
|
-
.j1-owl-gutter.row{margin-right:0;margin-left:0}.j1-owl-gutter>[class^="col-"],.j1-owl-gutter>[class^=" col-"]{padding-right:0;padding-left:0}.j1-owl-gutter-2.row{margin-right:-1px;margin-left:-1px}.j1-owl-gutter-2>[class^="col-"],.j1-owl-gutter-2>[class^=" col-"]{padding-right:1px;padding-left:1px}.owl-carousel .item p{margin:3px}.owl-carousel .item img{opacity:1;width:100%;height:auto}.slider-title{
|
15
|
+
.j1-owl-gutter.row{margin-right:0;margin-left:0}.j1-owl-gutter>[class^="col-"],.j1-owl-gutter>[class^=" col-"]{padding-right:0;padding-left:0}.j1-owl-gutter-2.row{margin-right:-1px;margin-left:-1px}.j1-owl-gutter-2>[class^="col-"],.j1-owl-gutter-2>[class^=" col-"]{padding-right:1px;padding-left:1px}.owl-carousel .item p{margin:3px}.owl-carousel .item img{opacity:1;width:100%;height:auto}.slider-title{line-height:1.25rem;font-size:1.125rem;font-weight:500;margin-bottom:.5rem}.owl-btn{color:#777;cursor:pointer;font-size:18px;padding:2px 9px;text-align:center;background:#f5f5f5}.owl-btn:hover{color:#fff;background:#72c02c}.owl-theme .owl-controls{margin-top:10px;text-align:center}.owl-theme .owl-controls .owl-buttons div{color:#212121;display:inline-block;zoom:1;margin:5px;padding:3px 10px;font-size:12px;font-weight:500;-webkit-border-radius:30px;-moz-border-radius:30px;background:#2196f3}.owl-theme .owl-controls.clickable .owl-buttons div:hover{opacity:1;text-decoration:none}.owl-theme .owl-controls .owl-page{display:inline-block;zoom:1}.owl-theme .owl-controls .owl-page span{display:block;width:1.25rem;height:1.25rem;margin:5px 7px;filter:Alpha(Opacity=50);opacity:.5;-webkit-border-radius:20px;-moz-border-radius:20px;border-radius:20px;background:#2196f3}.owl-theme .owl-controls .owl-page.active span,.owl-theme .owl-controls.clickable .owl-page:hover span{opacity:1}.owl-theme .owl-controls .owl-page span.owl-numbers{height:auto;width:auto;color:#FFF;padding:2px 10px;font-size:12px;-webkit-border-radius:30px;-moz-border-radius:30px;border-radius:30px}.owl-item.loading{min-height:150px;background:url(../../images/ajax-loader.gif) no-repeat center center}.owl-carousel .container{display:table;height:inherit}.owl-carousel .caption{display:table-cell}.owl-carousel .caption h1,.owl-carousel .caption p,.owl-carousel .caption div{position:relative;margin-top:2rem;margin-right:2rem;margin-left:2rem}.owl-carousel .caption h1 span{padding:.25em 0;line-height:180%}.owl-item .carousel-caption{opacity:0;position:absolute;bottom:3px;left:3px;right:3px;color:white;font-size:1rem;font-weight:300;font-family:sans-serif;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center}.owl-item .carousel-caption:hover{opacity:1;-webkit-transition:opacity 500ms;-moz-transition:opacity 500ms;-o-transition:opacity 500ms;transition:opacity 500ms;background:rgba(0,0,0,0.5)}span.carousel-caption a{color:#fff;text-decoration:none}
|
@@ -0,0 +1,385 @@
|
|
1
|
+
/*
|
2
|
+
# -----------------------------------------------------------------------------
|
3
|
+
# ~/assets/themes/j1/modules/j1Deepl/js/j1deepl.js
|
4
|
+
# J1 core module for j1Deepl
|
5
|
+
#
|
6
|
+
# Product/Info:
|
7
|
+
# https://jekyll.one
|
8
|
+
#
|
9
|
+
# Copyright (C) 2021 Juergen Adams
|
10
|
+
#
|
11
|
+
# J1 Template is licensed under the MIT License.
|
12
|
+
# For details, see https://jekyll.one
|
13
|
+
# -----------------------------------------------------------------------------
|
14
|
+
# NOTE: Based on https://github.com/jquery-boilerplate/jquery-boilerplate
|
15
|
+
# See: https://www.dotnetcurry.com/jquery/1069/authoring-jquery-plugins
|
16
|
+
# -----------------------------------------------------------------------------
|
17
|
+
*/
|
18
|
+
|
19
|
+
// the semi-colon before function invocation is a SAFETY method against
|
20
|
+
// concatenated scripts and/or other plugins which may NOT be closed
|
21
|
+
// properly.
|
22
|
+
//
|
23
|
+
;(function($, window, document, undefined) {
|
24
|
+
|
25
|
+
'use strict';
|
26
|
+
|
27
|
+
// Create the defaults
|
28
|
+
var pluginName = 'j1deepl',
|
29
|
+
defaults = {
|
30
|
+
api: 'free', // free (default) | pro
|
31
|
+
auth_key: false, // API authorization key.
|
32
|
+
source_lang: 'auto', // autodetection (default: auto)|supported language. Specifies the language for the input text.
|
33
|
+
target_lang: 'DE', // language to be tranlasted in.
|
34
|
+
max_chars: false, // false (unlimited) or number. Number of chars from the source text passed for translation.
|
35
|
+
split_sentences: '1', // enabled (1, default)|disabled (0)|nonewlines. Sets the translation engine to first split the input text into sentences.
|
36
|
+
preserve_formatting: '0', // disabled (0, default)|enabled (1). Sets the translation engine to respect the original formatting.
|
37
|
+
formality: 'default', // default|more|less. Sets the translated text should lean towards formal or informal language.
|
38
|
+
tag_handling: false, // false (value=0)|xml. Sets which kind of tags should be handled. If set, API is able to process structured XML content.
|
39
|
+
outline_detection: true, // false (value=0) or true (NO value passed). Controls the automatic mechanism on XML tags for splitting. If disabled, all splitting_tags are to be specified.
|
40
|
+
non_splitting_tags: false, // false or comma-separated list of XML tags. Disable automated splitting on the tags specified.
|
41
|
+
splitting_tags: false, // false or comma-separated list of XML tags which always cause splitting.
|
42
|
+
ignore_tags: false, // false or comma-separated list of XML tags that indicate text NOT to be translated.
|
43
|
+
onInit: function (){}, // callback after plugin has initialized.
|
44
|
+
onBeforeTranslation: function (){}, // callback before translation started.
|
45
|
+
onAfterTranslation: function (){} // callback after translation finished.
|
46
|
+
};
|
47
|
+
|
48
|
+
// -------------------------------------------------------------------------
|
49
|
+
// plugin constructor
|
50
|
+
// create the jquery plugin
|
51
|
+
// -------------------------------------------------------------------------
|
52
|
+
function Plugin (element, options) {
|
53
|
+
this.element = element;
|
54
|
+
this.settings = $.extend( {}, defaults, options);
|
55
|
+
this.settings.elementID = '#' + this.element.id;
|
56
|
+
this.xhr = new XMLHttpRequest();
|
57
|
+
|
58
|
+
// call the plugin initializer
|
59
|
+
this.init(this.settings);
|
60
|
+
}
|
61
|
+
|
62
|
+
// Avoid plugin prototype conflicts
|
63
|
+
$.extend(Plugin.prototype, {
|
64
|
+
// -----------------------------------------------------------------------
|
65
|
+
// init
|
66
|
+
// initialize the plugin
|
67
|
+
// -----------------------------------------------------------------------
|
68
|
+
init: function(options) {
|
69
|
+
var logger = log4javascript.getLogger('j1deepl.init');
|
70
|
+
|
71
|
+
logger.info('\n' + 'initializing plugin: started');
|
72
|
+
this.translate(options);
|
73
|
+
logger.info('\n' + 'initializing plugin: finished');
|
74
|
+
},
|
75
|
+
// -----------------------------------------------------------------------
|
76
|
+
// prepareXHR
|
77
|
+
// Prepare a XHR request according to DeepL API specification
|
78
|
+
// for the required HTTP header settings
|
79
|
+
// See: https://www.deepl.com/de/docs-api/simulator/
|
80
|
+
// -----------------------------------------------------------------------
|
81
|
+
// NOTE: "User-Agent" NOT used as the use is qualified UNSECURE
|
82
|
+
// -----------------------------------------------------------------------
|
83
|
+
prepareXHR: function (settings) {
|
84
|
+
if (settings.api === 'free') {
|
85
|
+
this.xhr.open("POST", "https://api-free.deepl.com/v2/translate", true);
|
86
|
+
} else if (settings.api === 'pro') {
|
87
|
+
this.xhr.open("POST", "https://api.deepl.com/v2/translate", true);
|
88
|
+
} else {
|
89
|
+
this.xhr.open("POST", "https://api-free.deepl.com/v2/translate", true);
|
90
|
+
}
|
91
|
+
// Set required header parameters
|
92
|
+
this.xhr.setRequestHeader("Accept", "*/*");
|
93
|
+
this.xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
|
94
|
+
},
|
95
|
+
// -----------------------------------------------------------------------
|
96
|
+
// prepareText
|
97
|
+
// Prepare text function used to parse, or arrange text, designed as
|
98
|
+
// a module. Currently it splits all text whenever a newline ("\n")
|
99
|
+
// is met, so that it preserves the original layout of the text, which
|
100
|
+
// would have otherwise been lost because of the way DeepL accepts
|
101
|
+
// multiple sentences.
|
102
|
+
// -----------------------------------------------------------------------
|
103
|
+
prepareText: function (source_text) {
|
104
|
+
return source_text.split("\n");
|
105
|
+
},
|
106
|
+
// -----------------------------------------------------------------------
|
107
|
+
// translate
|
108
|
+
// Translate text function which uses all the other modules, in order to
|
109
|
+
// create a request, which is sent to the DeepL API to translate, and
|
110
|
+
// then display the result, designed as a module.
|
111
|
+
// -----------------------------------------------------------------------
|
112
|
+
translate: function (settings) {
|
113
|
+
const logger = log4javascript.getLogger('j1deepl.translate');
|
114
|
+
const READYSTATE_DONE = 4;
|
115
|
+
const STATUS_OK = 200;
|
116
|
+
const SUPPORTED_LANG = ['BG', 'CS', 'DA', 'DE', 'EL', 'EN-GB', 'EN-US', 'EN', 'ES', 'ET', 'FI', 'FR', 'HU', 'IT', 'JA', 'LT', 'LV', 'NL', 'PL', 'PT-PT', 'PT-BR', 'PT', 'RO', 'RU', 'SK', 'SL', 'SV', 'ZH'];
|
117
|
+
const ALLOWED_FORMALITY_LANG = ['DE', 'FR', 'IT', 'ES', 'NL', 'PL', 'PT', 'PT-BR', 'RU'];
|
118
|
+
const ALLOWED_TAG_HANDLING = ['xml'];
|
119
|
+
const TARGET_ELEMENT = settings.targetElement;
|
120
|
+
const TARGET_ELEMENT_EXISTS = $(TARGET_ELEMENT).length;
|
121
|
+
const ERROR_TEXT = 'Translation failed.' + '\n' + 'Reason: ';
|
122
|
+
const WARNING_TEXT = 'Translation skipped.' + '\n' + 'Reason: ';
|
123
|
+
|
124
|
+
var BASE_TARGET_ELEMENT;
|
125
|
+
var ELEMENT_TYPE;
|
126
|
+
var SOURCE_TEXT_FOUND;
|
127
|
+
|
128
|
+
var API_RESPONSE = {};
|
129
|
+
API_RESPONSE['400'] = 'Bad request. Please check error message and your parameters.';
|
130
|
+
API_RESPONSE['401'] = 'Authorization failed. Please supply a valid DeepL-Auth-Key.';
|
131
|
+
API_RESPONSE['403'] = 'Forbidden. The access to the requested resource is denied, because of insufficient access rights.';
|
132
|
+
API_RESPONSE['404'] = 'The requested resource could not be found.';
|
133
|
+
API_RESPONSE['413'] = 'The request size exceeds the limit.';
|
134
|
+
API_RESPONSE['415'] = 'The requested entries format specified in the Accept header is not supported.';
|
135
|
+
API_RESPONSE['429'] = 'Too many requests. Please wait and resend your request.';
|
136
|
+
API_RESPONSE['456'] = 'Quota exceeded. The maximum amount of glossaries has been reached.';
|
137
|
+
API_RESPONSE['500'] = 'Internal server error';
|
138
|
+
API_RESPONSE['503'] = 'Resource currently unavailable. Try again later.';
|
139
|
+
API_RESPONSE['529'] = 'Too many requests. Please wait and resend your request.';
|
140
|
+
|
141
|
+
var reason_text;
|
142
|
+
var request = '';
|
143
|
+
var element = '';
|
144
|
+
var source_text = '';
|
145
|
+
var source_text_lines = '';
|
146
|
+
var source_lang;
|
147
|
+
var target_lang;
|
148
|
+
|
149
|
+
// check if passed HTML element or ID exists
|
150
|
+
if (TARGET_ELEMENT_EXISTS) {
|
151
|
+
BASE_TARGET_ELEMENT = (TARGET_ELEMENT.includes('.')||TARGET_ELEMENT.includes('#')) ? TARGET_ELEMENT.substring(1) : TARGET_ELEMENT;
|
152
|
+
ELEMENT_TYPE = $(TARGET_ELEMENT).get(0).nodeName;
|
153
|
+
|
154
|
+
// Read the text to be translated from the given HTML element
|
155
|
+
if (ELEMENT_TYPE === 'TEXTAREA') {
|
156
|
+
source_text = this.element.value;
|
157
|
+
} else if (ELEMENT_TYPE === 'P') {
|
158
|
+
element = this.element;
|
159
|
+
source_text = $(TARGET_ELEMENT).text();
|
160
|
+
}
|
161
|
+
SOURCE_TEXT_FOUND = source_text.length;
|
162
|
+
} else {
|
163
|
+
logger.error('\n' + 'target element does not exists: ' + TARGET_ELEMENT);
|
164
|
+
return false;
|
165
|
+
}
|
166
|
+
|
167
|
+
// limit the source text if required
|
168
|
+
if (settings.max_char && source_text.length > settings.max_char ) {
|
169
|
+
var source_text_limited = source_text.substring(0, settings.max_char -3);
|
170
|
+
source_text = source_text_limited + ' ...';
|
171
|
+
logger.info('\n' + 'limit for source text ' + '(max: ' + settings.max_char + ')' + ' reached: ' + source_text.length);
|
172
|
+
}
|
173
|
+
source_text_lines = this.prepareText(source_text);
|
174
|
+
|
175
|
+
// prepare the XHR request for the API (free/pro) requested
|
176
|
+
this.prepareXHR(settings);
|
177
|
+
|
178
|
+
// Makes a request with every line, as a new text to translate
|
179
|
+
var source_text_request = "";
|
180
|
+
for(var i = 0; i < source_text_lines.length; i++) {
|
181
|
+
source_text_request += "&text=" + source_text_lines[i];
|
182
|
+
}
|
183
|
+
|
184
|
+
this.xhr.onload = function () {
|
185
|
+
if (this.readyState === READYSTATE_DONE) {
|
186
|
+
if (this.status === STATUS_OK) {
|
187
|
+
// JSON parse the response
|
188
|
+
var result = JSON.parse(this.responseText);
|
189
|
+
|
190
|
+
// recreate the response as one text to keep its original layout
|
191
|
+
var translated_text = "";
|
192
|
+
for(var i = 0; i < result.translations.length; i++) {
|
193
|
+
translated_text += result.translations[i].text;
|
194
|
+
translated_text += "\n";
|
195
|
+
}
|
196
|
+
|
197
|
+
// update the HTM element (content) by the tranlation
|
198
|
+
if (ELEMENT_TYPE === 'TEXTAREA') {
|
199
|
+
$(TARGET_ELEMENT).val(translated_text);
|
200
|
+
} else if (ELEMENT_TYPE === 'P') {
|
201
|
+
$(TARGET_ELEMENT).text(translated_text);
|
202
|
+
}
|
203
|
+
} else {
|
204
|
+
logger.error('\n' + 'API returned ' + this.status + ': ' + API_RESPONSE[this.status]);
|
205
|
+
}
|
206
|
+
}
|
207
|
+
};
|
208
|
+
|
209
|
+
// ---------------------------------------------------------------------
|
210
|
+
// preflight (validity check) on given parameters
|
211
|
+
// ---------------------------------------------------------------------
|
212
|
+
|
213
|
+
// Check for SUPPORTED language by option source_lang|target_lang
|
214
|
+
source_lang = this.settings.source_lang;
|
215
|
+
target_lang = this.settings.target_lang;
|
216
|
+
|
217
|
+
if (this.settings.source_lang != 'auto') {
|
218
|
+
this.settings.source_lang = (SUPPORTED_LANG.indexOf(this.settings.source_lang) > -1) ? this.settings.source_lang : false;
|
219
|
+
}
|
220
|
+
this.settings.target_lang = (SUPPORTED_LANG.indexOf(this.settings.target_lang) > -1) ? this.settings.target_lang : false;
|
221
|
+
|
222
|
+
// stop processing if invalid language or NO AUTH key passed
|
223
|
+
if (!this.settings.auth_key || !this.settings.source_lang || !this.settings.target_lang) {
|
224
|
+
if (!this.settings.auth_key) {
|
225
|
+
reason_text = 'NO AUTH key passed.';
|
226
|
+
logger.error('\n' + 'invalid option found. ' + reason_text);
|
227
|
+
}
|
228
|
+
if (!this.settings.source_lang) {
|
229
|
+
reason_text = 'WRONG source language passed: ' + source_lang;
|
230
|
+
logger.error('\n' + 'invalid option found. ' + reason_text);
|
231
|
+
}
|
232
|
+
if (!this.settings.target_lang) {
|
233
|
+
reason_text = 'WRONG target language passed: ' + target_lang;
|
234
|
+
logger.error('\n' + 'invalid option found. ' + reason_text);
|
235
|
+
}
|
236
|
+
|
237
|
+
// update the HTML element (content) by an error text
|
238
|
+
if (ELEMENT_TYPE === 'TEXTAREA') {
|
239
|
+
$(TARGET_ELEMENT).val(ERROR_TEXT + reason_text);
|
240
|
+
} else if (ELEMENT_TYPE === 'P') {
|
241
|
+
$(TARGET_ELEMENT).text(ERROR_TEXT + reason_text);
|
242
|
+
}
|
243
|
+
return false;
|
244
|
+
}
|
245
|
+
|
246
|
+
if(!SOURCE_TEXT_FOUND) {
|
247
|
+
reason_text = 'NO text found for translation';
|
248
|
+
// update the HTML element (content) by an error text
|
249
|
+
if (ELEMENT_TYPE === 'TEXTAREA') {
|
250
|
+
$(TARGET_ELEMENT).val(WARNING_TEXT + reason_text);
|
251
|
+
} else if (ELEMENT_TYPE === 'P') {
|
252
|
+
$(TARGET_ELEMENT).text(WARNING_TEXT + reason_text);
|
253
|
+
}
|
254
|
+
logger.warn('\n' + 'no text found for translation');
|
255
|
+
return false;
|
256
|
+
}
|
257
|
+
|
258
|
+
// Check for VALID language supported by option 'formality'
|
259
|
+
if (this.settings.formality != 'default' ) {
|
260
|
+
if (!(ALLOWED_FORMALITY_LANG.indexOf(this.settings.target_lang) > -1)) {
|
261
|
+
logger.warn('\n' + 'wrong language found for formality setting: ' + this.settings.target_lang);
|
262
|
+
}
|
263
|
+
this.settings.formality = (ALLOWED_FORMALITY_LANG.indexOf(this.settings.target_lang) > -1) ? this.settings.formality : 'default';
|
264
|
+
}
|
265
|
+
|
266
|
+
// Check for VALID tag handling and options
|
267
|
+
if (this.settings.tag_handling) {
|
268
|
+
var tag_handling = this.settings.tag_handling;
|
269
|
+
// check for VALID method
|
270
|
+
this.settings.tag_handling = (ALLOWED_TAG_HANDLING.indexOf(this.settings.tag_handling) > -1) ? this.settings.tag_handling : false;
|
271
|
+
if (this.settings.tag_handling) {
|
272
|
+
this.settings.non_splitting_tags = this.settings.non_splitting_tags ? encodeURIComponent(this.settings.non_splitting_tags) : false;
|
273
|
+
this.settings.splitting_tags = this.settings.splitting_tags ? encodeURIComponent(this.settings.splitting_tags) : false;
|
274
|
+
this.settings.ignore_tags = this.settings.ignore_tags ? encodeURIComponent(this.settings.ignore_tags) : false;
|
275
|
+
} else {
|
276
|
+
logger.error('\n' + 'invalid option found for tag handling : ' + tag_handling);
|
277
|
+
logger.warn('\n' + 'disable option: ' + 'tag_handling');
|
278
|
+
// reset to defaults if WRONG method detected
|
279
|
+
if (this.settings.non_splitting_tags) {
|
280
|
+
logger.warn('\n' + 'disable option: ' + this.settings.non_splitting_tags);
|
281
|
+
this.settings.non_splitting_tags = false;
|
282
|
+
}
|
283
|
+
if (this.settings.splitting_tags) {
|
284
|
+
logger.warn('\n' + 'disable option : ' + this.settings.splitting_tags);
|
285
|
+
this.settings.splitting_tags = false;
|
286
|
+
}
|
287
|
+
if (this.settings.ignore_tags) {
|
288
|
+
logger.warn('\n' + 'disable option: ' + this.settings.ignore_tags);
|
289
|
+
this.settings.ignore_tags = false;
|
290
|
+
}
|
291
|
+
}
|
292
|
+
} else {
|
293
|
+
// reset tags to their defaults if NO tag_handling is enabled but settings passed
|
294
|
+
if (this.settings.non_splitting_tags) {
|
295
|
+
logger.warn('\n' + 'invalid option found: ' + this.settings.non_splitting_tags);
|
296
|
+
this.settings.non_splitting_tags = false;
|
297
|
+
}
|
298
|
+
if (this.settings.splitting_tags) {
|
299
|
+
logger.warn('\n' + 'invalid option found: ' + this.settings.splitting_tags);
|
300
|
+
this.settings.splitting_tags = false;
|
301
|
+
}
|
302
|
+
if (this.settings.ignore_tags) {
|
303
|
+
logger.warn('\n' + 'invalid option found: ' + this.settings.ignore_tags);
|
304
|
+
this.settings.ignore_tags = false;
|
305
|
+
}
|
306
|
+
}
|
307
|
+
|
308
|
+
// ---------------------------------------------------------------------
|
309
|
+
// construct the API request body
|
310
|
+
// ---------------------------------------------------------------------
|
311
|
+
request = "auth_key=" + this.settings.auth_key;
|
312
|
+
request += (this.settings.source_lang != 'auto' ) ? "&source_lang=" + this.settings.source_lang : '';
|
313
|
+
request += "&target_lang=" + this.settings.target_lang;
|
314
|
+
request += (this.settings.formality != 'default' ) ? "&formality=" + this.settings.formality : '';
|
315
|
+
request += (this.settings.split_sentences) ? "&split_sentences=" + this.settings.formality : '';
|
316
|
+
request += (this.settings.tag_handling) ? "&tag_handling=" + this.settings.tag_handling : "&tag_handling=0";
|
317
|
+
request += (this.settings.tag_handling && this.settings.non_splitting_tags) ? "&non_splitting_tags=" + this.settings.non_splitting_tags : '';
|
318
|
+
request += (this.settings.tag_handling && this.settings.splitting_tags) ? "&splitting_tags=" + this.settings.splitting_tags : '';
|
319
|
+
request += (this.settings.tag_handling && this.settings.ignore_tags) ? "&ignore_tags=" + this.settings.ignore_tags : '';
|
320
|
+
request += source_text_request;
|
321
|
+
|
322
|
+
// Send the constructed request to the API for translation
|
323
|
+
this.xhr.send(request);
|
324
|
+
} // END translate
|
325
|
+
|
326
|
+
}); // END prototype
|
327
|
+
|
328
|
+
// ---------------------------------------------------------------------------
|
329
|
+
// plugin wrapper
|
330
|
+
// A really lightweight plugin wrapper around the constructor,
|
331
|
+
// wrapper around the constructor to prevent multiple instantiations
|
332
|
+
// preventing against multiple instantiations and allowing any
|
333
|
+
// public function (ie. a function whose name doesn't start
|
334
|
+
// with an underscore) to be called via the jQuery plugin,
|
335
|
+
// e.g. $(element).defaultPluginName('functionName', arg1, arg2)
|
336
|
+
// ---------------------------------------------------------------------------
|
337
|
+
$.fn[pluginName] = function ( options ) {
|
338
|
+
var args = arguments;
|
339
|
+
|
340
|
+
// Is the first parameter an object (options), or was omitted,
|
341
|
+
// instantiate a new instance of the plugin.
|
342
|
+
//
|
343
|
+
if (options === undefined || typeof options === 'object') {
|
344
|
+
return this.each(function () {
|
345
|
+
// Only allow the plugin to be instantiated once,
|
346
|
+
// so we check that the element has no plugin instantiation yet
|
347
|
+
if (!$.data(this, 'plugin_' + pluginName)) {
|
348
|
+
// if it has no instance, create a new one, pass options to the
|
349
|
+
// plugin constructor, and store the plugin instance in the
|
350
|
+
// elements jQuery data object.
|
351
|
+
$.data(this, 'plugin_' + pluginName, new Plugin( this, options ));
|
352
|
+
}
|
353
|
+
});
|
354
|
+
} else if (typeof options === 'string' && options[0] !== '_' && options !== 'init') {
|
355
|
+
// If the first parameter is a string and it doesn't start
|
356
|
+
// with an underscore or "contains" the `init`-function,
|
357
|
+
// treat this as a call to a public method.
|
358
|
+
|
359
|
+
// Cache the method call to make it possible to return a value
|
360
|
+
var returns;
|
361
|
+
|
362
|
+
this.each(function () {
|
363
|
+
var instance = $.data(this, 'plugin_' + pluginName);
|
364
|
+
|
365
|
+
// Tests that there's already a plugin-instance
|
366
|
+
// and checks that the requested public method exists
|
367
|
+
if (instance instanceof Plugin && typeof instance[options] === 'function') {
|
368
|
+
// Call the method of our plugin instance,
|
369
|
+
// and pass it the supplied arguments.
|
370
|
+
returns = instance[options].apply( instance, Array.prototype.slice.call( args, 1 ) );
|
371
|
+
}
|
372
|
+
|
373
|
+
// Allow instances to be destroyed via the 'destroy' method
|
374
|
+
if (options === 'destroy') {
|
375
|
+
$.data(this, 'plugin_' + pluginName, null);
|
376
|
+
}
|
377
|
+
});
|
378
|
+
|
379
|
+
// If the earlier cached method gives a value back return the value,
|
380
|
+
// otherwise return "this" to preserve chainability.
|
381
|
+
return returns !== undefined ? returns : this;
|
382
|
+
}
|
383
|
+
}; // END plugin wrapper
|
384
|
+
|
385
|
+
})(jQuery, window, document);
|
@@ -0,0 +1,18 @@
|
|
1
|
+
/*
|
2
|
+
# -----------------------------------------------------------------------------
|
3
|
+
# ~/assets/themes/j1/modules/j1Deepl/js/j1deepl.min.js
|
4
|
+
# J1 core module for j1Deepl
|
5
|
+
#
|
6
|
+
# Product/Info:
|
7
|
+
# https://jekyll.one
|
8
|
+
#
|
9
|
+
# Copyright (C) 2021 Juergen Adams
|
10
|
+
#
|
11
|
+
# J1 Template is licensed under the MIT License.
|
12
|
+
# For details, see https://jekyll.one
|
13
|
+
# -----------------------------------------------------------------------------
|
14
|
+
# NOTE: Based on https://github.com/jquery-boilerplate/jquery-boilerplate
|
15
|
+
# See: https://www.dotnetcurry.com/jquery/1069/authoring-jquery-plugins
|
16
|
+
# -----------------------------------------------------------------------------
|
17
|
+
*/
|
18
|
+
(function(e,c,a,g){var d="j1deepl",f={api:"free",auth_key:false,source_lang:"auto",target_lang:"DE",max_chars:false,split_sentences:"1",preserve_formatting:"0",formality:"default",tag_handling:false,outline_detection:true,non_splitting_tags:false,splitting_tags:false,ignore_tags:false,onInit:function(){},onBeforeTranslation:function(){},onAfterTranslation:function(){}};function b(i,h){this.element=i;this.settings=e.extend({},f,h);this.settings.elementID="#"+this.element.id;this.xhr=new XMLHttpRequest();this.init(this.settings)}e.extend(b.prototype,{init:function(i){var h=log4javascript.getLogger("j1deepl.init");h.info("\ninitializing plugin: started");this.translate(i);h.info("\ninitializing plugin: finished")},prepareXHR:function(h){if(h.api==="free"){this.xhr.open("POST","https://api-free.deepl.com/v2/translate",true)}else{if(h.api==="pro"){this.xhr.open("POST","https://api.deepl.com/v2/translate",true)}else{this.xhr.open("POST","https://api-free.deepl.com/v2/translate",true)}}this.xhr.setRequestHeader("Accept","*/*");this.xhr.setRequestHeader("Content-Type","application/x-www-form-urlencoded")},prepareText:function(h){return h.split("\n")},translate:function(C){const H=log4javascript.getLogger("j1deepl.translate");const n=4;const t=200;const u=["BG","CS","DA","DE","EL","EN-GB","EN-US","EN","ES","ET","FI","FR","HU","IT","JA","LT","LV","NL","PL","PT-PT","PT-BR","PT","RO","RU","SK","SL","SV","ZH"];const h=["DE","FR","IT","ES","NL","PL","PT","PT-BR","RU"];const r=["xml"];const w=C.targetElement;const q=e(w).length;const D="Translation failed.\nReason: ";const o="Translation skipped.\nReason: ";var y;var F;var v;var x={};x["400"]="Bad request. Please check error message and your parameters.";x["401"]="Authorization failed. Please supply a valid DeepL-Auth-Key.";x["403"]="Forbidden. The access to the requested resource is denied, because of insufficient access rights.";x["404"]="The requested resource could not be found.";x["413"]="The request size exceeds the limit.";x["415"]="The requested entries format specified in the Accept header is not supported.";x["429"]="Too many requests. Please wait and resend your request.";x["456"]="Quota exceeded. The maximum amount of glossaries has been reached.";x["500"]="Internal server error";x["503"]="Resource currently unavailable. Try again later.";x["529"]="Too many requests. Please wait and resend your request.";var l;var k="";var j="";var B="";var E="";var m;var G;if(q){y=(w.includes(".")||w.includes("#"))?w.substring(1):w;F=e(w).get(0).nodeName;if(F==="TEXTAREA"){B=this.element.value}else{if(F==="P"){j=this.element;B=e(w).text()}}v=B.length}else{H.error("\ntarget element does not exists: "+w);return false}if(C.max_char&&B.length>C.max_char){var s=B.substring(0,C.max_char-3);B=s+" ...";H.info("\nlimit for source text (max: "+C.max_char+") reached: "+B.length)}E=this.prepareText(B);this.prepareXHR(C);var p="";for(var A=0;A<E.length;A++){p+="&text="+E[A]}this.xhr.onload=function(){if(this.readyState===n){if(this.status===t){var I=JSON.parse(this.responseText);var J="";for(var K=0;K<I.translations.length;K++){J+=I.translations[K].text;J+="\n"}if(F==="TEXTAREA"){e(w).val(J)}else{if(F==="P"){e(w).text(J)}}}else{H.error("\nAPI returned "+this.status+": "+x[this.status])}}};m=this.settings.source_lang;G=this.settings.target_lang;if(this.settings.source_lang!="auto"){this.settings.source_lang=(u.indexOf(this.settings.source_lang)>-1)?this.settings.source_lang:false}this.settings.target_lang=(u.indexOf(this.settings.target_lang)>-1)?this.settings.target_lang:false;if(!this.settings.auth_key||!this.settings.source_lang||!this.settings.target_lang){if(!this.settings.auth_key){l="NO AUTH key passed.";H.error("\ninvalid option found. "+l)}if(!this.settings.source_lang){l="WRONG source language passed: "+m;H.error("\ninvalid option found. "+l)}if(!this.settings.target_lang){l="WRONG target language passed: "+G;H.error("\ninvalid option found. "+l)}if(F==="TEXTAREA"){e(w).val(D+l)}else{if(F==="P"){e(w).text(D+l)}}return false}if(!v){l="NO text found for translation";if(F==="TEXTAREA"){e(w).val(o+l)}else{if(F==="P"){e(w).text(o+l)}}H.warn("\nno text found for translation");return false}if(this.settings.formality!="default"){if(!(h.indexOf(this.settings.target_lang)>-1)){H.warn("\nwrong language found for formality setting: "+this.settings.target_lang)}this.settings.formality=(h.indexOf(this.settings.target_lang)>-1)?this.settings.formality:"default"}if(this.settings.tag_handling){var z=this.settings.tag_handling;this.settings.tag_handling=(r.indexOf(this.settings.tag_handling)>-1)?this.settings.tag_handling:false;if(this.settings.tag_handling){this.settings.non_splitting_tags=this.settings.non_splitting_tags?encodeURIComponent(this.settings.non_splitting_tags):false;this.settings.splitting_tags=this.settings.splitting_tags?encodeURIComponent(this.settings.splitting_tags):false;this.settings.ignore_tags=this.settings.ignore_tags?encodeURIComponent(this.settings.ignore_tags):false}else{H.error("\ninvalid option found for tag handling : "+z);H.warn("\ndisable option: tag_handling");if(this.settings.non_splitting_tags){H.warn("\ndisable option: "+this.settings.non_splitting_tags);this.settings.non_splitting_tags=false}if(this.settings.splitting_tags){H.warn("\ndisable option : "+this.settings.splitting_tags);this.settings.splitting_tags=false}if(this.settings.ignore_tags){H.warn("\ndisable option: "+this.settings.ignore_tags);this.settings.ignore_tags=false}}}else{if(this.settings.non_splitting_tags){H.warn("\ninvalid option found: "+this.settings.non_splitting_tags);this.settings.non_splitting_tags=false}if(this.settings.splitting_tags){H.warn("\ninvalid option found: "+this.settings.splitting_tags);this.settings.splitting_tags=false}if(this.settings.ignore_tags){H.warn("\ninvalid option found: "+this.settings.ignore_tags);this.settings.ignore_tags=false}}k="auth_key="+this.settings.auth_key;k+=(this.settings.source_lang!="auto")?"&source_lang="+this.settings.source_lang:"";k+="&target_lang="+this.settings.target_lang;k+=(this.settings.formality!="default")?"&formality="+this.settings.formality:"";k+=(this.settings.split_sentences)?"&split_sentences="+this.settings.formality:"";k+=(this.settings.tag_handling)?"&tag_handling="+this.settings.tag_handling:"&tag_handling=0";k+=(this.settings.tag_handling&&this.settings.non_splitting_tags)?"&non_splitting_tags="+this.settings.non_splitting_tags:"";k+=(this.settings.tag_handling&&this.settings.splitting_tags)?"&splitting_tags="+this.settings.splitting_tags:"";k+=(this.settings.tag_handling&&this.settings.ignore_tags)?"&ignore_tags="+this.settings.ignore_tags:"";k+=p;this.xhr.send(k)}});e.fn[d]=function(i){var h=arguments;if(i===g||typeof i==="object"){return this.each(function(){if(!e.data(this,"plugin_"+d)){e.data(this,"plugin_"+d,new b(this,i))}})}else{if(typeof i==="string"&&i[0]!=="_"&&i!=="init"){var j;this.each(function(){var k=e.data(this,"plugin_"+d);if(k instanceof b&&typeof k[i]==="function"){j=k[i].apply(k,Array.prototype.slice.call(h,1))}if(i==="destroy"){e.data(this,"plugin_"+d,null)}});return j!==g?j:this}}}})(jQuery,window,document);
|
@@ -11,6 +11,9 @@
|
|
11
11
|
# J1 Template is licensed under the MIT License.
|
12
12
|
# For details, see https://jekyll.one
|
13
13
|
# -----------------------------------------------------------------------------
|
14
|
+
# NOTE: Based on https://github.com/jquery-boilerplate/jquery-boilerplate
|
15
|
+
# See: https://www.dotnetcurry.com/jquery/1069/authoring-jquery-plugins
|
16
|
+
# -----------------------------------------------------------------------------
|
14
17
|
*/
|
15
18
|
|
16
19
|
// the semi-colon before function invocation is a SAFETY method against
|
@@ -12,4 +12,4 @@
|
|
12
12
|
# See: https://github.com/jekyll-one-org/J1 Template/blob/master/LICENSE
|
13
13
|
# -----------------------------------------------------------------------------
|
14
14
|
*/
|
15
|
-
.jg-gallery-title{
|
15
|
+
.jg-gallery-title{line-height:1.25rem;font-size:1.125rem;font-weight:500;margin-bottom:.5rem}.justified-gallery img.img-overlay{height:64px;width:64px;bottom:0;left:50%;margin-left:-35px;margin-top:-35px;position:absolute;right:0;top:50%;-webkit-transition:background-color .15s ease 0s;-o-transition:background-color .15s ease 0s;transition:background-color .15s ease 0s}
|
@@ -12,4 +12,4 @@
|
|
12
12
|
# See: https://github.com/jekyll-one-org/J1 Template/blob/master/LICENSE
|
13
13
|
# -----------------------------------------------------------------------------
|
14
14
|
*/
|
15
|
-
.icons{//display:none;//padding:0 20px 10px 20px;-webkit-column-count:2;-moz-column-count:2;column-count:2;-webkit-column-gap:2rem;-moz-column-gap:2rem;column-gap:2rem}.icons div{line-height:3rem;color:rgba(0,0,0,0.6)}.icons div span{cursor:pointer;font-size:1rem;text-overflow:ellipsis;display:inline-block;max-width:calc(100% - 90px);overflow:hidden;vertical-align:middle;white-space:nowrap;margin-left:.5rem}.icons div code:hover,.icons div span:hover,.icons div i:hover{color:rgba(0,0,0,0.5)}.icons div code:hover{border-color:#2196f3}.icons div code{color:#424242;background-color:#e0e0e0;border:1px solid #9e9e9e;width:80px;margin-left:2px;margin-right:4px;border-radius:4px;display:inline-block;vertical-align:middle;text-align:center;line-height:24px;cursor:pointer}.icons div i{display:inline-block;width:32px;height:24px;margin-right:.5rem;text-align:center;vertical-align:middle;cursor:pointer;line-height:24px}.icons .mdi:before{font-size:24px}div.copied{position:fixed;top:100px;left:50%;width:
|
15
|
+
.icons{//display:none;//padding:0 20px 10px 20px;-webkit-column-count:2;-moz-column-count:2;column-count:2;-webkit-column-gap:2rem;-moz-column-gap:2rem;column-gap:2rem}.icons div{line-height:3rem;color:rgba(0,0,0,0.6)}.icons div span{cursor:pointer;font-size:1rem;text-overflow:ellipsis;display:inline-block;max-width:calc(100% - 90px);overflow:hidden;vertical-align:middle;white-space:nowrap;margin-left:.5rem}.icons div code:hover,.icons div span:hover,.icons div i:hover{color:rgba(0,0,0,0.5)}.icons div code:hover{border-color:#2196f3}.icons div code{color:#424242;background-color:#e0e0e0;border:1px solid #9e9e9e;width:80px;margin-left:2px;margin-right:4px;border-radius:4px;display:inline-block;vertical-align:middle;text-align:center;line-height:24px;cursor:pointer}.icons div i{display:inline-block;width:32px;height:24px;margin-right:.5rem;text-align:center;vertical-align:middle;cursor:pointer;line-height:24px}.icons .mdi:before{font-size:24px}div.copied{position:fixed;top:100px;left:50%;width:200px;text-align:center;color:#fafafa;background-color:#2196f3;border:1px solid #0d47a1;padding:10px 15px;border-radius:4px;margin-left:-100px;box-shadow:0 0 10px rgba(0,0,0,0.2)}
|
@@ -14,10 +14,8 @@
|
|
14
14
|
*/
|
15
15
|
;(function () {
|
16
16
|
|
17
|
-
var icons
|
17
|
+
var icons = {};
|
18
18
|
var icon_database = '/assets/data/mdi_icons.json';
|
19
|
-
var language = document.documentElement.lang;
|
20
|
-
var responseText;
|
21
19
|
|
22
20
|
function load_data_database() {
|
23
21
|
// Returns the icon database object
|
@@ -49,14 +47,6 @@
|
|
49
47
|
// var reference = document.querySelector("#mdi-icon");
|
50
48
|
// var popper = document.querySelector(".my-popper");
|
51
49
|
|
52
|
-
if (language == 'en') {
|
53
|
-
responseText = 'Copied to Clipboard';
|
54
|
-
} else if (language == 'de') {
|
55
|
-
responseText = 'Kopiert zur Zwischenablage';
|
56
|
-
} else {
|
57
|
-
responseText = 'Copied to Clipboard';
|
58
|
-
}
|
59
|
-
|
60
50
|
var copyFrom = document.createElement('textarea');
|
61
51
|
copyFrom.setAttribute("style", "position:fixed;opacity:0;top:100px;left:100px;");
|
62
52
|
copyFrom.value = text;
|
@@ -65,7 +55,7 @@
|
|
65
55
|
document.execCommand('copy');
|
66
56
|
var copied = document.createElement('div');
|
67
57
|
copied.setAttribute('class', 'copied');
|
68
|
-
copied.appendChild(document.createTextNode(
|
58
|
+
copied.appendChild(document.createTextNode('Copied to Clipboard'));
|
69
59
|
document.body.appendChild(copied);
|
70
60
|
|
71
61
|
// Popper currently NOT used
|
@@ -81,8 +71,8 @@
|
|
81
71
|
document.body.removeChild(copied);
|
82
72
|
}, 1500);
|
83
73
|
};
|
84
|
-
// Skip info record 0 (j=1)
|
85
|
-
for (var j
|
74
|
+
// Skip info record 0 (j=1) ???
|
75
|
+
for (var j=0; j<icons.length; j++) {
|
86
76
|
var div = document.createElement('div'),
|
87
77
|
i = document.createElement('i');
|
88
78
|
div.setAttribute("id", "mdi-icon");
|
@@ -118,7 +108,7 @@
|
|
118
108
|
};
|
119
109
|
})(icons[j]);
|
120
110
|
|
121
|
-
document.getElementById('icons').appendChild(div);
|
111
|
+
document.getElementById('mdi-icons').appendChild(div);
|
122
112
|
}
|
123
113
|
});
|
124
114
|
|
@@ -12,4 +12,4 @@
|
|
12
12
|
# See: https://github.com/jekyll-one-org/J1 Template/blob/master/LICENSE
|
13
13
|
# -----------------------------------------------------------------------------
|
14
14
|
*/
|
15
|
-
(function(){var a={};var
|
15
|
+
(function(){var a={};var c="/assets/data/mdi_icons.json";function b(){return $.ajax({url:c,success:function(d){if(typeof d=="string"){a=JSON.parse(d)}if(typeof d=="object"){a=d}}})}$.when(b()).done(function(h){a.push({name:"blank",codepoint:"F068C"});var k=function(m){var j=document.createElement("textarea");j.setAttribute("style","position:fixed;opacity:0;top:100px;left:100px;");j.value=m;document.body.appendChild(j);j.select();document.execCommand("copy");var i=document.createElement("div");i.setAttribute("class","copied");i.appendChild(document.createTextNode("Copied to Clipboard"));document.body.appendChild(i);setTimeout(function(){document.body.removeChild(j);document.body.removeChild(i)},1500)};for(var d=0;d<a.length;d++){var l=document.createElement("div"),e=document.createElement("i");l.setAttribute("id","mdi-icon");e.className="mdi mdi-"+a[d].name;l.appendChild(e);var g=document.createElement("code");g.appendChild(document.createTextNode("#"+a[d].codepoint));l.appendChild(g);var f=document.createElement("span");f.appendChild(document.createTextNode(a[d].name));l.appendChild(f);e.onmouseup=(function(i){return function(){k(i.name)}})(a[d]);g.onmouseup=(function(i){return function(){k("#"+i.codepoint)}})(a[d]);f.onmouseup=(function(i){return function(){k("mdi-"+i.name)}})(a[d]);document.getElementById("mdi-icons").appendChild(l)}})})();
|