j1-template 2022.0.9 → 2022.0.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (218) hide show
  1. checksums.yaml +4 -4
  2. data/_includes/themes/j1/modules/ads/google_ad_content_home.html +11 -0
  3. data/_includes/themes/j1/modules/ads/google_ad_top_home.html +11 -0
  4. data/apps/public/cc/index.adoc +0 -1
  5. data/assets/data/article_navigator/index.html +0 -1
  6. data/assets/data/news_panel_posts/index.html +0 -1
  7. data/assets/error_pages/HTTP445.html +5 -4
  8. data/assets/error_pages/HTTP446.html +2 -2
  9. data/assets/error_pages/HTTP447.html +110 -0
  10. data/assets/error_pages/HTTP448.html +111 -0
  11. data/assets/themes/j1/adapter/js/advertising.js +442 -0
  12. data/assets/themes/j1/adapter/js/algolia.js +10 -13
  13. data/assets/themes/j1/adapter/js/analytics.js +259 -0
  14. data/assets/themes/j1/adapter/js/asciidoctor.js +10 -13
  15. data/assets/themes/j1/adapter/js/attic.js +10 -5
  16. data/assets/themes/j1/adapter/js/bmd.js +10 -14
  17. data/assets/themes/j1/adapter/js/carousel.js +10 -13
  18. data/assets/themes/j1/adapter/js/clipboard.js +9 -10
  19. data/assets/themes/j1/adapter/js/comments.js +407 -0
  20. data/assets/themes/j1/adapter/js/cookieConsent.js +107 -84
  21. data/assets/themes/j1/adapter/js/fab.js +11 -11
  22. data/assets/themes/j1/adapter/js/framer.js +59 -64
  23. data/assets/themes/j1/adapter/js/j1.js +203 -258
  24. data/assets/themes/j1/adapter/js/justifiedGallery.js +12 -14
  25. data/assets/themes/j1/adapter/js/justifiedGalleryCustomizer.js +10 -13
  26. data/assets/themes/j1/adapter/js/lightbox.js +12 -9
  27. data/assets/themes/j1/adapter/js/logger.js +11 -5
  28. data/assets/themes/j1/adapter/js/mmenu.js +11 -12
  29. data/assets/themes/j1/adapter/js/navigator.js +13 -12
  30. data/assets/themes/j1/adapter/js/quicksearch.js +10 -13
  31. data/assets/themes/j1/adapter/js/rouge.js +11 -14
  32. data/assets/themes/j1/adapter/js/rtable.js +10 -13
  33. data/assets/themes/j1/adapter/js/rtextResizer.js +10 -13
  34. data/assets/themes/j1/adapter/js/scroller.js +14 -12
  35. data/assets/themes/j1/adapter/js/themer.js +12 -3
  36. data/assets/themes/j1/adapter/js/toccer.js +10 -13
  37. data/assets/themes/j1/adapter/js/translator.js +50 -96
  38. data/assets/themes/j1/core/css/themes/unolight/bootstrap.css +6 -0
  39. data/assets/themes/j1/core/css/themes/unolight/bootstrap.min.css +1 -1
  40. data/assets/themes/j1/core/js/template.js +13 -5
  41. data/assets/themes/j1/core/js/template.min.js +1 -1
  42. data/assets/themes/j1/core/js/template.min.js.map +1 -1
  43. data/assets/themes/j1/modules/advertising/js/google/adInitializer.js +127 -0
  44. data/assets/themes/j1/modules/cookieConsent/js/cookieConsent.js +11 -2
  45. data/assets/themes/j1/modules/cookieConsent/js/cookieConsent.min.js +1 -1
  46. data/assets/themes/j1/modules/deeplAPI/js/deeplAPI.2.js +1 -1
  47. data/assets/themes/j1/modules/deeplAPI/js/deeplAPI.js +1 -1
  48. data/assets/themes/j1/modules/scroller/js/scroller.js +1 -1
  49. data/lib/j1/version.rb +1 -1
  50. data/lib/starter_web/Gemfile +1 -1
  51. data/lib/starter_web/_config.yml +1 -13
  52. data/lib/starter_web/_data/apps/carousel.yml +2 -2
  53. data/lib/starter_web/_data/apps/defaults/carousel.yml +3 -2
  54. data/lib/starter_web/_data/apps/defaults/justifiedGallery.yml +2 -2
  55. data/lib/starter_web/_data/apps/defaults/justifiedGalleryCustomizer.yml +2 -2
  56. data/lib/starter_web/_data/apps/defaults/lightGallery.yml +2 -2
  57. data/lib/starter_web/_data/apps/defaults/lightbox.yml +2 -2
  58. data/lib/starter_web/_data/apps/justifiedGallery.yml +2 -2
  59. data/lib/starter_web/_data/apps/justifiedGalleryCustomizer.yml +2 -2
  60. data/lib/starter_web/_data/apps/lightGallery.yml +2 -2
  61. data/lib/starter_web/_data/apps/lightbox.yml +2 -2
  62. data/lib/starter_web/_data/blocks/banner.yml +3 -2
  63. data/lib/starter_web/_data/blocks/defaults/banner.yml +9 -0
  64. data/lib/starter_web/_data/blocks/defaults/footer.yml +9 -0
  65. data/lib/starter_web/_data/blocks/defaults/panel.yml +9 -0
  66. data/lib/starter_web/_data/blocks/footer.yml +3 -2
  67. data/lib/starter_web/_data/blocks/panel.yml +3 -2
  68. data/lib/starter_web/_data/builder/blog_navigator.yml +3 -2
  69. data/lib/starter_web/_data/builder/defaults/blog_navigator.yml +8 -8
  70. data/lib/starter_web/_data/j1_config.yml +0 -116
  71. data/lib/starter_web/_data/layouts/default.yml +21 -21
  72. data/lib/starter_web/_data/layouts/home.ads.yml +262 -0
  73. data/lib/starter_web/_data/layouts/home.no-ads.yml +262 -0
  74. data/lib/starter_web/_data/layouts/home.yml +24 -0
  75. data/lib/starter_web/_data/layouts/page.yml +7 -18
  76. data/lib/starter_web/_data/layouts/post.yml +0 -11
  77. data/lib/starter_web/_data/modules/advertising.yml +139 -12
  78. data/lib/starter_web/_data/modules/analytics.yml +99 -0
  79. data/lib/starter_web/_data/modules/attics.yml +3 -2
  80. data/lib/starter_web/_data/modules/comments.yml +55 -0
  81. data/lib/starter_web/_data/modules/cookieconsent.yml +2 -1
  82. data/lib/starter_web/_data/modules/cookies.yml +1 -1
  83. data/lib/starter_web/_data/modules/defaults/advertising.yml +105 -0
  84. data/lib/starter_web/_data/modules/defaults/analytics.yml +93 -0
  85. data/lib/starter_web/_data/modules/defaults/attics.yml +3 -2
  86. data/lib/starter_web/_data/modules/defaults/authentication.yml +51 -48
  87. data/lib/starter_web/_data/modules/defaults/comments.yml +114 -0
  88. data/lib/starter_web/_data/modules/defaults/cookieconsent.yml +3 -3
  89. data/lib/starter_web/_data/modules/defaults/cookies.yml +105 -26
  90. data/lib/starter_web/_data/modules/defaults/fab.yml +4 -2
  91. data/lib/starter_web/_data/modules/defaults/framer.yml +2 -3
  92. data/lib/starter_web/_data/modules/defaults/log4javascript.yml +3 -2
  93. data/lib/starter_web/_data/modules/defaults/log4r.yml +2 -2
  94. data/lib/starter_web/_data/modules/defaults/navigator.yml +4 -2
  95. data/lib/starter_web/_data/modules/defaults/quicksearch.yml +4 -3
  96. data/lib/starter_web/_data/modules/defaults/rtable.yml +3 -2
  97. data/lib/starter_web/_data/modules/defaults/scoller.yml +3 -2
  98. data/lib/starter_web/_data/modules/defaults/themer.yml +119 -118
  99. data/lib/starter_web/_data/modules/defaults/toccer.yml +1 -1
  100. data/lib/starter_web/_data/modules/defaults/translator.yml +1 -1
  101. data/lib/starter_web/_data/modules/fab.yml +3 -2
  102. data/lib/starter_web/_data/modules/framer.yml +3 -4
  103. data/lib/starter_web/_data/modules/log4r.yml +2 -2
  104. data/lib/starter_web/_data/modules/navigator.yml +4 -2
  105. data/lib/starter_web/_data/modules/quicksearch.yml +3 -3
  106. data/lib/starter_web/_data/modules/rtable.yml +3 -3
  107. data/lib/starter_web/_data/modules/scroller.yml +2 -3
  108. data/lib/starter_web/_data/modules/themer.yml +2 -3
  109. data/lib/starter_web/_data/modules/toccer.yml +3 -3
  110. data/lib/starter_web/_data/modules/translator.yml +1 -1
  111. data/lib/starter_web/_data/plugins/defaults/paginator.yml +2 -2
  112. data/lib/starter_web/_data/plugins/paginator.yml +2 -2
  113. data/lib/starter_web/_data/resources.yml +447 -290
  114. data/lib/starter_web/_includes/attributes.asciidoc +1 -1
  115. data/lib/starter_web/_includes/themes/j1/modules/ads/google_ad_content_home.html +11 -0
  116. data/lib/starter_web/_includes/themes/j1/modules/ads/google_ad_top_home.html +11 -0
  117. data/lib/starter_web/_plugins/lunr_index.rb +1 -1
  118. data/lib/starter_web/collections/posts/public/featured/_posts/0000-00-00-welcome-to-j1.adoc.erb +1 -1
  119. data/lib/starter_web/collections/posts/public/featured/_posts/2021-01-01-about-cookies.adoc +1 -1
  120. data/lib/starter_web/collections/posts/public/featured/_posts/2021-01-01-about-cookies.ads.asciidoc +196 -0
  121. data/lib/starter_web/collections/posts/public/featured/_posts/2021-01-01-about-cookies.comments.asciidoc +182 -0
  122. data/lib/starter_web/collections/posts/public/featured/_posts/2021-02-01-site-generators.adoc +1 -1
  123. data/lib/starter_web/collections/posts/public/featured/_posts/2021-03-03-about-j1.adoc +1 -1
  124. data/lib/starter_web/collections/posts/public/series/_posts/2020-01-01-post-wiki-series.adoc +1 -1
  125. data/lib/starter_web/collections/posts/public/series/_posts/2020-01-02-post-wiki-series.adoc +1 -1
  126. data/lib/starter_web/collections/posts/public/series/_posts/2020-01-03-post-wiki-series.adoc +1 -1
  127. data/lib/starter_web/index.html +0 -4
  128. data/lib/starter_web/package.json +1 -1
  129. data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/documentation.adoc +0 -1
  130. data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/multi.adoc +0 -1
  131. data/lib/starter_web/pages/public/asciidoc_skeletons/simple-document/simple.adoc +0 -1
  132. data/lib/starter_web/pages/public/blog/navigator/archive/categoryview.html +0 -1
  133. data/lib/starter_web/pages/public/blog/navigator/archive/dateview.html +0 -1
  134. data/lib/starter_web/pages/public/blog/navigator/archive/tagview.html +0 -1
  135. data/lib/starter_web/pages/public/blog/navigator/archive.html +0 -1
  136. data/lib/starter_web/pages/public/blog/navigator/index.html +0 -1
  137. data/lib/starter_web/pages/public/learn/roundtrip/100_present_images.adoc +4 -3
  138. data/lib/starter_web/pages/public/learn/roundtrip/100_present_images.ads.asciidoc +265 -0
  139. data/lib/starter_web/pages/public/learn/roundtrip/100_present_images.base.asciidoc +237 -0
  140. data/lib/starter_web/pages/public/learn/roundtrip/100_present_images.comments.asciidoc +237 -0
  141. data/lib/starter_web/pages/public/learn/roundtrip/100_present_videos.adoc +62 -0
  142. data/lib/starter_web/pages/public/learn/roundtrip/_includes/google-ad.js +130 -0
  143. data/lib/starter_web/pages/public/legal/en/100_copyright.adoc +0 -1
  144. data/lib/starter_web/pages/public/legal/en/200_impress.adoc +0 -1
  145. data/lib/starter_web/pages/public/legal/en/400_comment_policy.adoc +0 -1
  146. data/lib/starter_web/pages/public/manuals/dropdown-help.adoc +23 -2
  147. data/lib/starter_web/pages/public/previewer/preview_bootstrap_theme.adoc +100 -166
  148. data/lib/starter_web/utilsrv/_defaults/package.json +1 -1
  149. data/lib/starter_web/utilsrv/package.json +1 -1
  150. metadata +25 -70
  151. data/_includes/themes/j1/blocks/ads/ad.html +0 -64
  152. data/_includes/themes/j1/modules/boards/news_pin_board.html +0 -183
  153. data/_includes/themes/j1/modules/connectors/ad/custom-provider.html +0 -30
  154. data/_includes/themes/j1/modules/connectors/ad/google-adsense.html +0 -62
  155. data/_includes/themes/j1/modules/connectors/ads +0 -56
  156. data/_includes/themes/j1/modules/connectors/analytic/custom-provider.html +0 -32
  157. data/_includes/themes/j1/modules/connectors/analytic/google-analytics.html +0 -30
  158. data/_includes/themes/j1/modules/connectors/analytics +0 -60
  159. data/_includes/themes/j1/modules/connectors/comment/commento.html +0 -31
  160. data/_includes/themes/j1/modules/connectors/comment/custom-provider.html +0 -30
  161. data/_includes/themes/j1/modules/connectors/comment/disqus.html +0 -32
  162. data/_includes/themes/j1/modules/connectors/comment/facebook.html +0 -30
  163. data/_includes/themes/j1/modules/connectors/comment/hyvor.html +0 -32
  164. data/_includes/themes/j1/modules/connectors/comment/just-comments.html +0 -31
  165. data/_includes/themes/j1/modules/connectors/comments +0 -64
  166. data/_includes/themes/j1/modules/connectors/sharing +0 -29
  167. data/_includes/themes/j1/modules/connectors/survey/custom-provider.html +0 -30
  168. data/_includes/themes/j1/modules/connectors/survey/jotform.html +0 -32
  169. data/_includes/themes/j1/modules/connectors/surveys +0 -58
  170. data/_includes/themes/j1/modules/connectors/translator +0 -58
  171. data/_includes/themes/j1/modules/connectors/translators/custom-translator.html +0 -32
  172. data/_includes/themes/j1/modules/connectors/translators/google-translator.html +0 -53
  173. data/_includes/themes/j1/modules/search/algolia.html +0 -181
  174. data/_includes/themes/j1/modules/search/docsearch.html +0 -42
  175. data/assets/data/disqus.js +0 -81
  176. data/assets/data/hyvor.js +0 -72
  177. data/lib/starter_web/pages/_test_pages/100_side-bar-tester.adoc +0 -244
  178. data/lib/starter_web/pages/_test_pages/_includes/attributes.asciidoc +0 -110
  179. data/lib/starter_web/pages/_test_pages/_includes/documents/100_gistblock.asciidoc +0 -28
  180. data/lib/starter_web/pages/_test_pages/_includes/documents/410_bottom_info.asciidoc +0 -14
  181. data/lib/starter_web/pages/_test_pages/_includes/documents/410_bottom_left_warning.asciidoc +0 -11
  182. data/lib/starter_web/pages/_test_pages/_includes/documents/410_bottom_right_danger.asciidoc +0 -11
  183. data/lib/starter_web/pages/_test_pages/_includes/documents/410_central_success.asciidoc +0 -11
  184. data/lib/starter_web/pages/_test_pages/_includes/documents/410_full_height_left_info.asciidoc +0 -11
  185. data/lib/starter_web/pages/_test_pages/_includes/documents/410_full_height_right_success.asciidoc +0 -11
  186. data/lib/starter_web/pages/_test_pages/_includes/documents/410_table_bs_modal_examples.asciidoc +0 -47
  187. data/lib/starter_web/pages/_test_pages/_includes/documents/410_top_info.asciidoc +0 -11
  188. data/lib/starter_web/pages/_test_pages/_includes/documents/410_top_left_info.asciidoc +0 -11
  189. data/lib/starter_web/pages/_test_pages/_includes/documents/410_top_right_success.asciidoc +0 -11
  190. data/lib/starter_web/pages/_test_pages/_includes/documents/419_advanced_modals_demo.asciidoc +0 -337
  191. data/lib/starter_web/pages/_test_pages/_includes/documents/tables/bs_modal_examples.asciidoc +0 -47
  192. data/lib/starter_web/pages/_test_pages/accordion-01-tester.adoc +0 -220
  193. data/lib/starter_web/pages/_test_pages/accordion-02-tester.adoc +0 -177
  194. data/lib/starter_web/pages/_test_pages/accordion-03-tester.adoc +0 -148
  195. data/lib/starter_web/pages/_test_pages/attribute-changes-01-tester.adoc +0 -226
  196. data/lib/starter_web/pages/_test_pages/backdrop-tester.adoc +0 -109
  197. data/lib/starter_web/pages/_test_pages/button-tester-1.adoc +0 -127
  198. data/lib/starter_web/pages/_test_pages/card-tester.adoc +0 -128
  199. data/lib/starter_web/pages/_test_pages/cookieConsent.adoc +0 -96
  200. data/lib/starter_web/pages/_test_pages/deepl.0.adoc +0 -258
  201. data/lib/starter_web/pages/_test_pages/deepl.adoc +0 -204
  202. data/lib/starter_web/pages/_test_pages/desandro-button.adoc +0 -171
  203. data/lib/starter_web/pages/_test_pages/desandro.adoc +0 -147
  204. data/lib/starter_web/pages/_test_pages/flipcard-1-tester.adoc +0 -308
  205. data/lib/starter_web/pages/_test_pages/formular-01-tester.adoc +0 -167
  206. data/lib/starter_web/pages/_test_pages/formular-02-tester.adoc +0 -727
  207. data/lib/starter_web/pages/_test_pages/google-translate-tester.0.adoc +0 -113
  208. data/lib/starter_web/pages/_test_pages/google-translate-tester.1.adoc +0 -231
  209. data/lib/starter_web/pages/_test_pages/google-translate-tester.3.adoc +0 -149
  210. data/lib/starter_web/pages/_test_pages/google-translate-tester.4.adoc +0 -237
  211. data/lib/starter_web/pages/_test_pages/infinite-scroll-tester-2.adoc +0 -183
  212. data/lib/starter_web/pages/_test_pages/infinite-scroll-tester-3.adoc +0 -235
  213. data/lib/starter_web/pages/_test_pages/infinite-scroll-tester-4.adoc +0 -222
  214. data/lib/starter_web/pages/_test_pages/infinite-scroll-tester-5.adoc +0 -119
  215. data/lib/starter_web/pages/_test_pages/infinite-scroll-tester.1.adoc +0 -236
  216. data/lib/starter_web/pages/_test_pages/infinite-scroll-tester.adoc +0 -225
  217. data/lib/starter_web/pages/_test_pages/list-group-tester.adoc +0 -265
  218. data/lib/starter_web/pages/_test_pages/tictok.adoc +0 -127
@@ -1,258 +0,0 @@
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
- ++++
@@ -1,204 +0,0 @@
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/
17
- regenerate: false
18
-
19
- resources: [ clipboard, rouge, j1deepl, j1scroll ]
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 class="paragraph">
66
- <p>
67
- How do I call a function after a find for all the returned elements?
68
- </p>
69
- </div>
70
-
71
- <div>
72
- <form id="layout">
73
- <!-- Supported source languages -->
74
- <div id="source">
75
- <select id="source-language" name="source-language">
76
- <option selected value="auto">Auto</option>
77
- <option value="CS">Czech</option>
78
- <option value="DA">Danish</option>
79
- <option value="DE">German</option>
80
- <option value="NL">Dutch</option>
81
- <option value="EN">English</option>
82
- <option value="FR">French</option>
83
- <option value="EL">Greek</option>
84
- <option value="IT">Italian</option>
85
- <option value="ES">Spanish</option>
86
- <option value="SV">Swedish</option>
87
- </select>
88
-
89
- <textarea type="text" id="original-text"></textarea>
90
- </div>
91
-
92
- <!-- Event handler for the button (onClick) moved to JS part -->
93
- <input type="button" id="translate" value="Translate">
94
-
95
- </br>
96
-
97
- <!-- Supported destination languages (all) -->
98
- <div id="destination">
99
- <select id="destination-language" name="destination-language">
100
- <option value="BG">Bulgarian</option>
101
- <option value="ZH">Chinese</option>
102
- <option value="CS">Czech</option>
103
- <option value="DA">Danish</option>
104
- <option value="NL">Dutch</option>
105
- <option value="EN-US">English (American)</option>
106
- <option value="EN-GB">English (British)</option>
107
- <option value="EN">English (Others)</option>
108
- <option value="ET">Estonian</option>
109
- <option value="FI">Finnish</option>
110
- <option value="FR">French</option>
111
- <option selected value="DE">German</option>
112
- <option value="EL">Greek</option>
113
- <option value="HU">Hungarian</option>
114
- <option value="IT">Italian</option>
115
- <option value="JA">Japanese</option>
116
- <option value="LV">Latvian</option>
117
- <option value="LT">Lithuanian</option>
118
- <option value="PL">Polish</option>
119
- <option value="PT-PT">Portuguese (Portugal)</option>
120
- <option value="PT-BR">Portuguese (Brazilian)</option>
121
- <option value="PT">Portuguese (Others)</option>
122
- <option value="RO">Romanian</option>
123
- <option value="RU">Russian</option>
124
- <option value="SK">Slovak</option>
125
- <option value="SL">Slovenian</option>
126
- <option value="ES">Spanish</option>
127
- <option value="SV">Swedish</option>
128
- </select>
129
-
130
- <textarea type="text" id="translated-text"></textarea>
131
- </div>
132
-
133
- </form>
134
- </div>
135
- ++++
136
-
137
- ++++
138
- <style>
139
- textarea {
140
- word-wrap: break-word;
141
- min-width: 100%;
142
- max-width: 100%;
143
- min-height: 10em;
144
- }
145
-
146
- select {
147
- display: block;
148
- width: 10em;
149
- margin: 1em 0;
150
- }
151
- </style>
152
- ++++
153
-
154
- ++++
155
- <script>
156
- $(document).ready(function() {
157
- $('#translate').click(function() {
158
- var fromLanguage = $('#source-language').val();
159
- var toLanguage = $('#destination-language').val();
160
-
161
- // var paragraphs = $('p');
162
- // for (para of paragraphs) {
163
- // $(para).addClass('brums-content');
164
- // }
165
-
166
- // var paragraphs = $('#main-content').find('p');
167
-
168
- // $('.paragraph').find('p').each(function() {
169
- // $('p').addClass('translate');
170
- // $('.translate').j1deepl({
171
- // auth_key: 'fe1c56dc-1342-9899-26db-c5d701791e2d:fx',
172
- // source_lang: fromLanguage,
173
- // target_lang: toLanguage,
174
- // targetElement: '.translate'
175
- // });
176
- // $('.translate').j1deepl('destroy');
177
- // });
178
-
179
- // Create new translations ($objects)
180
- $('#original-text').j1deepl({
181
- api: 'pro',
182
- auth_key: '1c360075-1a30-28c7-e4eb-2c0c0164ce4b',
183
- tag_handling: 'xml',
184
- ignore_tags: 'em',
185
- source_lang: fromLanguage,
186
- target_lang: toLanguage,
187
- targetElement: '#translated-text',
188
- });
189
-
190
- // $('.translate').j1deepl({
191
- // auth_key: 'fe1c56dc-1342-9899-26db-c5d701791e2d:fx',
192
- // source_lang: fromLanguage,
193
- // target_lang: toLanguage,
194
- // targetElement: '.translate'
195
- // });
196
-
197
- // destroy existing translation for next tranlations ($object)
198
- $('#original-text').j1deepl('destroy');
199
- //$('.translate').j1deepl('destroy');
200
-
201
- });
202
- });
203
- </script>
204
- ++++
@@ -1,171 +0,0 @@
1
- ---
2
- title: Tester
3
- tagline: infinite scroll
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/desandro-button/
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="global" %}
54
-
55
- // Page content
56
- // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
57
-
58
- // Include sub-documents (if any)
59
- // -----------------------------------------------------------------------------
60
-
61
- == Infinite Scroll v4 - button
62
- ++++
63
- <div class="post-container">
64
- <article class="post">
65
- <h1>1a - Lorem ipsum dolor sit amet</h1>
66
- <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc tristique mauris nec sapien efficitur, sit amet varius est interdum. Curabitur quis sem felis. Curabitur at quam sit amet mi tempor tristique quis in lorem. Cras id felis sit amet erat accumsan ornare.</p>
67
- <p><img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/82/orange-tree.jpg" alt="orange-tree" /></p>
68
- <p>Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.</p>
69
- <p>Nullam vel odio nec turpis consequat iaculis at ut nibh. Nulla interdum lacus vitae sapien porttitor congue sagittis ac felis.Curabitur in ligula porttitor, varius purus sed, elementum nibh. Nunc ut libero posuere.</p>
70
- </article>
71
- <article class="post">
72
- <h1>1b - Ullamcorper quam at</h1>
73
- <p>Ullamcorper quam at, hendrerit eros. Mauris quis vehicula enim.</p>
74
- <p><img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/82/cat-nose.jpg" alt="cat nose"></p>
75
- <p>Duis elementum nisi tortor, ut elementum quam mattis condimentum. Aenean vitae massa sit amet ligula sollicitudin venenatis. Praesent ultrices laoreet hendrerit. Duis tempus ullamcorper enim, ac volutpat augue faucibus sit amet.</p>
76
- <p>Donec at consequat elit. Suspendisse dignissim ante vitae urna rutrum cursus. Morbi finibus semper facilisis. In varius sem ut turpis molestie volutpat. Duis ut posuere est. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis malesuada placerat luctus. In eget feugiat sapien. Sed gravida ultrices accumsan.</p>
77
- <p>In nec ex at mi scelerisque malesuada.</p>
78
- <p>Nullam arcu diam, mollis sit amet condimentum et, finibus in ex. Morbi bibendum magna vel tortor fringilla efficitur. Aliquam sed lectus lacus.</p>
79
- </article>
80
- <article class="post">
81
- <h1>1c - Orci varius natoque penatibus et magnis dis parturient montes</h1>
82
- <p>Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. In varius turpis ipsum, et porta eros eleifend ullamcorper. Sed arcu nisl, rhoncus porta fermentum in, eleifend non dolor.</p>
83
- <p>Mauris sagittis a lectus eu fringilla. Maecenas varius cursus aliquam.</p>
84
- <p>Suspendisse maximus congue augue eu venenatis. Aliquam urna purus, suscipit ut purus vel, iaculis rhoncus nulla. Donec a velit elementum, pellentesque metus blandit, lacinia erat. Fusce pulvinar mattis erat ac efficitur. Pellentesque aliquam eleifend ligula, eu ullamcorper elit pretium sit amet.</p>
85
- <p>Praesent placerat eros sem, vel pretium libero pharetra nec. Morbi hendrerit eleifend commodo. Morbi sodales nunc purus, consequat eleifend nulla dignissim non.</p>
86
- </article>
87
- <article class="post">
88
- <h1>1d - Donec a urna in turpis maximus</h1>
89
- <p>Donec a urna in turpis maximus faucibus a nec mauris.</p>
90
- <p>Donec iaculis, justo a egestas venenatis, dui nisl faucibus urna, sit amet condimentum quam dui ut libero. Etiam aliquet urna quis nisi aliquam, vitae tincidunt est feugiat.</p>
91
- <p>Integer viverra at arcu quis faucibus. Praesent nec venenatis odio. Donec non mattis massa, quis vestibulum leo. Etiam eleifend diam ac magna egestas aliquam. Sed vulputate risus eget efficitur auctor. Mauris aliquam ac purus at semper. Praesent vulputate hendrerit eros, vitae semper turpis venenatis et. Proin et est felis. Etiam sem risus, elementum id cursus quis, laoreet quis orci. Cras eget fermentum lorem, vitae pharetra augue. Etiam tincidunt nulla faucibus, egestas lacus sed, semper metus.</p>
92
- </article>
93
- </div>
94
-
95
- <div class="page-load-status">
96
- <div class="loader-ellips infinite-scroll-request">
97
- <span class="loader-ellips__dot"></span>
98
- <span class="loader-ellips__dot"></span>
99
- <span class="loader-ellips__dot"></span>
100
- <span class="loader-ellips__dot"></span>
101
- </div>
102
- <p class="infinite-scroll-last">End of content</p>
103
- <p class="infinite-scroll-error">No more pages to load</p>
104
- </div>
105
-
106
- <p>
107
- <button class="view-more-button">View more</button>
108
- </p>
109
-
110
-
111
- <style>
112
- .post {
113
- border-top: 1px solid #DDD;
114
- margin: 60px 0;
115
- }
116
-
117
- .post img {
118
- display: block;
119
- max-width: 100%;
120
- }
121
-
122
- button {
123
- font-size: 20px;
124
- padding: 10px 20px;
125
- border-radius: 5px;
126
- background: #CCC;
127
- border: none;
128
- }
129
-
130
- .page-load-status {
131
- display: none; /* hidden by default */
132
- padding-top: 20px;
133
- border-top: 1px solid #DDD;
134
- text-align: center;
135
- color: #777;
136
- }
137
-
138
- /* loader ellips in separate pen CSS */
139
-
140
- </style>
141
-
142
- <script>
143
-
144
- $(document).ready(function() {
145
-
146
- var dependencies_met_page_ready = setInterval (function (options) {
147
- if ( j1.getState() === 'finished' ) {
148
- var logger = log4javascript.getLogger("j1.infiniteScroll");
149
- var log_text = 'module infiniteScroll is being initialized';
150
- logger.info(log_text);
151
-
152
- $('.post-container').infiniteScroll({
153
- path: function() {
154
- var pageNumber = ( this.loadCount + 1 );
155
- return `/pages/public/scroller/desandro-p${pageNumber}.html`;
156
- },
157
- append: '.post',
158
- button: '.view-more-button',
159
- // using button, disable loading on scroll
160
- scrollThreshold: false,
161
- history: false,
162
- status: '.page-load-status',
163
- });
164
-
165
- clearInterval(dependencies_met_page_ready);
166
- }
167
- });
168
- });
169
-
170
- </script>
171
- ++++