j1-template 2020.0.14 → 2020.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/_includes/themes/j1/modules/navigator/procedures/topsearch.proc +1 -1
- data/assets/data/search.json +25 -22
- data/assets/themes/j1/core/css/theme_extensions.css +8 -72
- data/assets/themes/j1/core/css/theme_extensions.min.css +1 -1
- data/assets/themes/j1/core/css/uno.css +11 -72
- data/assets/themes/j1/core/css/uno.min.css +1 -1
- data/assets/themes/j1/modules/bsThemeSwitcher/js/switcher.js +1 -0
- data/assets/themes/j1/modules/jekyllSearch/js/simple-jekyll-search.js +11 -167
- data/assets/themes/j1/modules/jekyllSearch/js/simple-jekyll-search.min.js +2 -2
- data/lib/j1/version.rb +1 -1
- data/lib/starter_web/Gemfile +7 -4
- data/lib/starter_web/_config.yml +1 -1
- data/lib/starter_web/_data/modules/defaults/jekyll_search.yml +4 -1
- data/lib/starter_web/_data/modules/defaults/navigator.yml +1 -1
- data/lib/starter_web/_data/resources.yml +1 -1
- data/lib/starter_web/_data/utilities/util_srv.yml +1 -1
- data/lib/starter_web/index.html +2 -2
- data/lib/starter_web/package.json +9 -9
- data/lib/starter_web/pages/public/learn/kickstarter/web_in_a_day/100_meet_and_greet_jekyll.adoc +1 -0
- data/lib/starter_web/pages/public/learn/roundtrip/500_themes.adoc +1 -1
- data/lib/starter_web/utilsrv/_defaults/package.json +1 -1
- data/lib/starter_web/utilsrv/package.json +1 -1
- metadata +4 -11
- data/_includes/themes/j1/procedures/layouts/module_writer.1.proc +0 -270
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Simple-Jekyll-Search
|
|
2
|
+
* Simple-Jekyll-Search v1.7.12
|
|
3
3
|
* Copyright 2015-2020, Christian Fei
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
|
|
6
|
+
(function(){var w={compile:l,setOptions:D};var e={};e.pattern=/\{(.*?)\}/g;e.template="";e.middleware=function(){};function D(J){e.pattern=J.pattern||e.pattern;e.template=J.template||e.template;e.results_output=J.results_output;if(typeof J.middleware==="function"){e.middleware=J.middleware}}function l(K){var J;return e.template.replace(e.pattern,function(L,O){var M=e.middleware(O,K[O],e.template);var N=document.getElementById(e.results_output);N.style.display="none";if(M!==undefined){return M}N.style.display="block";if(O=="tags"){J=K[O].replace(/\s+/g,"");K[O]=J.replace(/,/g," · ")}if(O=="date"){if(K[O].length){K[O]=K[O].substring(0,10)}else{K[O]="2020-01-01"}}return K[O]||L})}function z(P,O){var M=O.length;var J=P.length;if(J>M){return false}if(J===M){return P===O}outer:for(var L=0,K=0;L<J;L++){var N=P.charCodeAt(L);while(K<M){if(O.charCodeAt(K++)===N){continue outer}}return false}return true}var k=z;var c=new B();function B(){this.matches=function(K,J){return k(J,K)}}var A=new s();function s(){this.matches=function(K,J){if(typeof K!=="string"){return false}K=K.trim();return K.toLowerCase().indexOf(J.toLowerCase())>=0}}var r={put:j,clear:x,get:F,search:n,setOptions:d};var H=[];var b={};b.fuzzy=false;b.limit=10;b.searchStrategy=b.fuzzy?c:A;b.minSearchItemLen=4;b.resultsOutput=document.getElementById("jss-panel");function j(J){if(o(J)){return t(J)}if(q(J)){return i(J)}return undefined}function x(){H.length=0;return H}function F(){return H}function o(J){return !!J&&Object.prototype.toString.call(J)==="[object Object]"}function q(J){return !!J&&Object.prototype.toString.call(J)==="[object Array]"}function t(J){H.push(J);return H}function i(L){var K=[];for(var J=0;J<L.length;J++){if(o(L[J])){K.push(t(L[J]))}}return K}function n(J){var K=J.length;if(K<b.minSearchItemLen){return[]}if(!J){return[]}return u(H,J,b.searchStrategy,b)}function d(J){b=J||{};b.fuzzy=J.fuzzy||false;b.limit=J.limit||10;b.minSearchItemLen=J.minSearchItemLen||3;b.searchStrategy=J.fuzzy?c:A;b.resultsOutput=J.resultsOutput||"jss-panel"}function u(O,J,P,M){var N=[];for(var L=0;L<O.length&&N.length<M.limit;L++){var K=a(O[L],J,P,M);if(K){N.push(K)}}return N}function a(M,J,N,L){for(var K in M){if(!g(M[K],L.exclude)&&N.matches(M[K],J)){return M}}}function g(N,K){var L=false;K=K||[];for(var M=0;M<K.length;M++){var J=K[M];if(!L&&new RegExp(N).test(J)){L=true}}return L}var y={load:m};function m(J,L){var K=v();K.open("GET",J,true);K.onreadystatechange=E(K,L);K.send()}function E(J,K){return function(){if(J.readyState===4&&J.status===200){try{K(null,JSON.parse(J.responseText))}catch(L){K(L,null)}}}}function v(){return(window.XMLHttpRequest)?new XMLHttpRequest():new ActiveXObject("Microsoft.XMLHTTP")}var f=function I(L){if(!J(L)){throw new Error("-- OptionsValidator: required options missing")}if(!(this instanceof I)){return new I(L)}var K=L.required;this.getRequiredOptions=function(){return K};this.validate=function(M){var N=[];K.forEach(function(O){if(M[O]===undefined){N.push(O)}});return N};function J(M){if(!M){return false}return M.required!==undefined&&M.required instanceof Array}};var p={merge:h,isJSON:G};function h(L,K){var M={};for(var J in L){M[J]=L[J];if(K[J]!==undefined){M[J]=K[J]}}return M}function G(J){try{if(J instanceof Object&&JSON.parse(JSON.stringify(J))){return true}return false}catch(K){return false}}var C={};(function(N,S){var Q={};var K={searchInput:null,resultsContainer:null,results_output:null,json:[],searchResultTemplate:'<li><a href="{url}" title="{desc}">{title}</a></li>',templateMiddleware:function(){},noResultsText:"No results found",limit:10,fuzzy:false,exclude:[]};var R=["searchInput","resultsContainer","results_output","json"];var O=f({required:R});var aa;var P;N.SimpleJekyllSearch=function V(ab){aa=log4javascript.getLogger("j1.core.j1_searcher");aa.info("start initialization");var ac=O.validate(ab);if(ac.length>0){aa.error("missing required options: "+R)}K=p.merge(K,ab);w.setOptions({template:K.searchResultTemplate,results_output:K.results_output,middleware:K.templateMiddleware});r.setOptions({fuzzy:K.fuzzy,limit:K.limit});if(p.isJSON(K.json)){T(K.json)}else{L(K.json)}return true};N.SimpleJekyllSearch.init=N.SimpleJekyllSearch;if(typeof N.SimpleJekyllSearchInit==="function"){N.SimpleJekyllSearchInit.call(this,N.SimpleJekyllSearch)}function T(ab){r.put(ab);M()}function L(ab){y.load(ab,function(ad,ac){if(ad){aa.error("failed to get data at: "+ab)}T(ac)})}function W(){K.resultsContainer.innerHTML=""}function J(ab){K.resultsContainer.innerHTML+=ab}function M(){K.searchInput.addEventListener("keyup",function(ad){var ab=ad.which;if(U(ab)){W();var ac=ad.target.value;if(X(ac)){Z(r.search(ac));$(".result-group-item-text:contains("+ac+")").each(function(){var ae=new RegExp(ac,"gi");$(this).html($(this).text().replace(ae,'<code style="color: red !important; font-weight: 700;font-size: 125% !important">'+ac+"</code>"))});$("h6.result-item:contains("+ac+")").each(function(){var ae=new RegExp(ac,"gi");$(this).html($(this).html().replace(ae,' <code style="color: red !important; font-weight: 700;font-size: 135% !important">'+ac+"</code> "))})}}})}function Z(ac){if(ac.length===0){var ad=S.getElementById(K.results_output);ad.style.display="none";return J(K.noResultsText)}for(var ab=0;ab<ac.length;ab++){J(w.compile(ac[ab]))}}function X(ab){return ab&&ab.length>0}function U(ab){return[13,16,20,37,38,39,40,91].indexOf(ab)===-1}function Y(ab){throw new Error("SimpleJekyllSearch --- "+ab)}})(window,document)}());
|
data/lib/j1/version.rb
CHANGED
data/lib/starter_web/Gemfile
CHANGED
|
@@ -40,18 +40,21 @@ ruby RUBY_VERSION
|
|
|
40
40
|
# NOTE: J1 Template is using Jekyll v3.8 and above
|
|
41
41
|
#
|
|
42
42
|
|
|
43
|
-
#
|
|
43
|
+
# ------------------------------------------------------------------------------
|
|
44
|
+
# Use Jekyll version from GH master
|
|
44
45
|
#
|
|
46
|
+
# Support for Ruby version 2.7 (DEC 2019)
|
|
45
47
|
# See: https://github.com/jekyll/jekyll/issues/8049
|
|
46
|
-
# gem
|
|
48
|
+
# gem 'jekyll', github: 'jekyll/jekyll'
|
|
47
49
|
|
|
48
|
-
#
|
|
50
|
+
# ------------------------------------------------------------------------------
|
|
51
|
+
# Use Jekyll version from RubyGems
|
|
49
52
|
#
|
|
50
53
|
gem 'jekyll', '~> 4.0'
|
|
51
54
|
|
|
52
55
|
# Theme Rubies, default: J1 Template (NOT used for the developmnet system)
|
|
53
56
|
#
|
|
54
|
-
gem 'j1-template', '~> 2020.0.
|
|
57
|
+
gem 'j1-template', '~> 2020.0.15'
|
|
55
58
|
|
|
56
59
|
# ------------------------------------------------------------------------------
|
|
57
60
|
# PRODUCTION: Gem needed for the Jekyll and J1 prod environment
|
data/lib/starter_web/_config.yml
CHANGED
|
@@ -53,7 +53,7 @@ environment: production
|
|
|
53
53
|
# ------------------------------------------------------------------------------
|
|
54
54
|
# Sets the build version of J1 Template Gem
|
|
55
55
|
#
|
|
56
|
-
version: 2020.0.
|
|
56
|
+
version: 2020.0.15
|
|
57
57
|
|
|
58
58
|
# version
|
|
59
59
|
# ------------------------------------------------------------------------------
|
|
@@ -140,7 +140,10 @@ defaults:
|
|
|
140
140
|
<div>
|
|
141
141
|
<h4 class="result-item"> <a href="{url}" target="{target}">{title} - {tagline}</a> </h4>
|
|
142
142
|
<p class="result-group-item-text">{excerpt}</p>
|
|
143
|
-
<p class="result-group-item-text small text-muted mb-3"
|
|
143
|
+
<p class="result-group-item-text small text-muted mb-3">
|
|
144
|
+
<i class="mdi mdi-calendar-blank mdi-18px mr-1"></i>{date}
|
|
145
|
+
<i class="mdi mdi-tag mdi-18px ml-2 mr-1"></i>{tags}
|
|
146
|
+
</p>
|
|
144
147
|
</div>
|
|
145
148
|
</li>
|
|
146
149
|
|
|
@@ -199,7 +199,7 @@ defaults:
|
|
|
199
199
|
icon_size: mdi-2x
|
|
200
200
|
search_icon: magnify
|
|
201
201
|
close_icon: close
|
|
202
|
-
clear_icon:
|
|
202
|
+
clear_icon: filter-remove
|
|
203
203
|
input_color: rgba(0, 0, 0, 0.7) # rgba-darken-700
|
|
204
204
|
background_color: "#FAFAFA" # md-grey-50
|
|
205
205
|
placeholder: QuickSearch
|
|
@@ -350,7 +350,7 @@ resources:
|
|
|
350
350
|
# 5 log4javascript log4javascript@1.4.15
|
|
351
351
|
# 6 Bootstrap bootstrap@4.4.1
|
|
352
352
|
# 6 bs_material_design bootstrap-material-design@4.0.0-beta.4
|
|
353
|
-
# 7 j1_template j1_template_4@2020.0.
|
|
353
|
+
# 7 j1_template j1_template_4@2020.0.15
|
|
354
354
|
# 8 tocbot tocbot@4.11.2
|
|
355
355
|
# 9 jekyll_search simple_jekyll_search@1.1.5
|
|
356
356
|
# 10 bs_theme_switcher bs_theme_switcher@1.1.5
|
|
@@ -73,7 +73,7 @@ settings:
|
|
|
73
73
|
enabled: false
|
|
74
74
|
|
|
75
75
|
built:
|
|
76
|
-
execute: false #
|
|
76
|
+
execute: false # rebuild disabled for testing (as Jekyll is running in parallel)
|
|
77
77
|
response_success: The built request to your local site finished successfully.
|
|
78
78
|
response_failed: "The built request to your local fite has failed. Reason: "
|
|
79
79
|
|
data/lib/starter_web/index.html
CHANGED
|
@@ -56,11 +56,11 @@ resource_options:
|
|
|
56
56
|
If you see this page within the J1 Template DEVELOPMENT system,
|
|
57
57
|
re-run a site built running:
|
|
58
58
|
|
|
59
|
-
yarn
|
|
59
|
+
yarn rebuild site
|
|
60
60
|
|
|
61
61
|
If you're on a RUNTIME system run a built like so:
|
|
62
62
|
|
|
63
|
-
yarn
|
|
63
|
+
yarn rebuild
|
|
64
64
|
|
|
65
65
|
and open the website again by:
|
|
66
66
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"private": true,
|
|
3
3
|
"name": "j1_starter",
|
|
4
|
-
"version": "2020.0.
|
|
4
|
+
"version": "2020.0.15",
|
|
5
5
|
"description": "J1 Template starter Web",
|
|
6
6
|
"homepage": "https://your.site",
|
|
7
7
|
"author": {
|
|
@@ -57,16 +57,16 @@
|
|
|
57
57
|
"app:open": "npm run delay-3s && cross-var opn $npm_package_jekyll_opt_app_url",
|
|
58
58
|
"algolia": "cross-var cross-env ALGOLIA_API_KEY=$npm_package_algolia_admin_key bundle exec jekyll algolia",
|
|
59
59
|
"algolia-check": "cross-var cross-env ALGOLIA_API_KEY=$npm_package_algolia_admin_key bundle exec jekyll algolia --dry-run --verbose",
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
60
|
+
"build": "run-p -s build:*",
|
|
61
|
+
"build:info": "echo build site incremental ..",
|
|
62
|
+
"build:do": "cross-env SINATRA_ACTIVESUPPORT_WARNING=false bundle exec jekyll b --incremental",
|
|
63
63
|
"bundle": "shx rm -f Gemfile.lock && cross-env if-env BUNDLE_VENDORIZE=true && run-s bundle_vendor || run-s bundle_global",
|
|
64
64
|
"bundle_global": "cross-var cross-env BUNDLE_GEMFILE=$npm_package_jekyll_gemfile bundle install",
|
|
65
65
|
"bundle_vendor": "cross-var cross-env BUNDLE_GEMFILE=$npm_package_jekyll_gemfile bundle install --path $npm_package_jekyll_vendor_path",
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
66
|
+
"rebuild": "run-p -s rebuild:*",
|
|
67
|
+
"rebuild:info": "echo Build site from scratch ..",
|
|
68
|
+
"rebuild:clean": "echo Clean up site files .. && bundle exec jekyll clean",
|
|
69
|
+
"rebuild:do": "cross-env SINATRA_ACTIVESUPPORT_WARNING=false bundle exec jekyll b --incremental",
|
|
70
70
|
"delay-1s": "node ./node_modules/npm-delay 1000",
|
|
71
71
|
"delay-2s": "node ./node_modules/npm-delay 2000",
|
|
72
72
|
"delay-3s": "node ./node_modules/npm-delay 3000",
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
"setup:node-modules-base": "echo Bootstrap project modules .. && echo J1 Project modules: >> install.log && npm --silent install >> install.log",
|
|
103
103
|
"setup:node-modules-utilsrv": "echo Bootstrap utility server modules .. && echo J1 Utility Server modules: >> install.log && cd utilsrv && npm --silent install >> ../install.log && cd .. && echo done.",
|
|
104
104
|
"setup:detect-os": "echo Detect OS .. && cross-env if-env OS=Windows_NT && cross-var echo \"OS detected: $OS\" || OS=$(echo $(getos)) && echo \"OS detected: $OS\" && echo done.",
|
|
105
|
-
"setup:site": "run-s -s
|
|
105
|
+
"setup:site": "run-s -s build",
|
|
106
106
|
"site": "run-p -s site:*",
|
|
107
107
|
"site:jekyll": "echo Startup the site .. && cross-env SINATRA_ACTIVESUPPORT_WARNING=false bundle exec jekyll s --incremental --livereload --open",
|
|
108
108
|
"site:utilsrv": "npm --prefix ./utilsrv --silent run utilsrv",
|
|
@@ -85,7 +85,7 @@ Independendly from using Bootstrap or any other CSS framwork.
|
|
|
85
85
|
Thanks to the people at link:{bootswatch-home}[Bootswatch, {window}], a great
|
|
86
86
|
set of already prepared Bootstrap stylesheets in various designs are available
|
|
87
87
|
at their website. No need to start from the scratch, to re-define all the
|
|
88
|
-
Bootstrap variables and
|
|
88
|
+
Bootstrap variables and rebuild the framework files to create a new theme. Many
|
|
89
89
|
different styles are available. What is already available is at least a good
|
|
90
90
|
base for your modifications: your unique design.
|
|
91
91
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: j1-template
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2020.0.
|
|
4
|
+
version: 2020.0.15
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- juergen_jekyll_one
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-07-
|
|
11
|
+
date: 2020-07-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: jekyll
|
|
@@ -130,22 +130,16 @@ dependencies:
|
|
|
130
130
|
name: rack
|
|
131
131
|
requirement: !ruby/object:Gem::Requirement
|
|
132
132
|
requirements:
|
|
133
|
-
- - "~>"
|
|
134
|
-
- !ruby/object:Gem::Version
|
|
135
|
-
version: '2.0'
|
|
136
133
|
- - ">="
|
|
137
134
|
- !ruby/object:Gem::Version
|
|
138
|
-
version: 2.
|
|
135
|
+
version: 2.2.3
|
|
139
136
|
type: :runtime
|
|
140
137
|
prerelease: false
|
|
141
138
|
version_requirements: !ruby/object:Gem::Requirement
|
|
142
139
|
requirements:
|
|
143
|
-
- - "~>"
|
|
144
|
-
- !ruby/object:Gem::Version
|
|
145
|
-
version: '2.0'
|
|
146
140
|
- - ">="
|
|
147
141
|
- !ruby/object:Gem::Version
|
|
148
|
-
version: 2.
|
|
142
|
+
version: 2.2.3
|
|
149
143
|
- !ruby/object:Gem::Dependency
|
|
150
144
|
name: rack-protection
|
|
151
145
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -329,7 +323,6 @@ files:
|
|
|
329
323
|
- _includes/themes/j1/procedures/global/setup.proc
|
|
330
324
|
- _includes/themes/j1/procedures/layouts/content_writer.proc
|
|
331
325
|
- _includes/themes/j1/procedures/layouts/default_writer.proc
|
|
332
|
-
- _includes/themes/j1/procedures/layouts/module_writer.1.proc
|
|
333
326
|
- _includes/themes/j1/procedures/layouts/module_writer.proc
|
|
334
327
|
- _includes/themes/j1/procedures/layouts/resource_writer.proc
|
|
335
328
|
- _includes/themes/j1/procedures/posts/collate_calendar.proc
|
|
@@ -1,270 +0,0 @@
|
|
|
1
|
-
{% comment %}
|
|
2
|
-
# -----------------------------------------------------------------------------
|
|
3
|
-
# ~/_includes/themes/j1/procedures/layouts/module_writer.proc
|
|
4
|
-
# Liquid PROCEDURE to write|place the HTML markup for Javascript init
|
|
5
|
-
# scripts defined for a layout
|
|
6
|
-
#
|
|
7
|
-
# Product/Info:
|
|
8
|
-
# https://jekyll.one
|
|
9
|
-
#
|
|
10
|
-
# Copyright (C) 2020 Juergen Adams
|
|
11
|
-
#
|
|
12
|
-
# J1 Template is licensed under the MIT License.
|
|
13
|
-
# See: https://github.com/jekyll-one-org/J1 Template/blob/master/LICENSE
|
|
14
|
-
# -----------------------------------------------------------------------------
|
|
15
|
-
# Test data:
|
|
16
|
-
# liquid_var: {{ liquid_var | debug }}
|
|
17
|
-
# -----------------------------------------------------------------------------
|
|
18
|
-
{% endcomment %}
|
|
19
|
-
|
|
20
|
-
{% comment %} liquid procedures
|
|
21
|
-
-------------------------------------------------------------------------------- {% endcomment %}
|
|
22
|
-
{% include themes/{{site.template.name}}/procedures/global/set_base_vars_folders.proc %}
|
|
23
|
-
|
|
24
|
-
{% comment %}
|
|
25
|
-
jadams, 2019-08-23: globals set via layouts/default.html (!!!)
|
|
26
|
-
NO need to load this again
|
|
27
|
-
--------------------------------------------------------------------------------
|
|
28
|
-
{% include themes/{{site.template.name}}/procedures/global/set_base_vars_folders.proc %}
|
|
29
|
-
--------------------------------------------------------------------------------
|
|
30
|
-
{% endcomment %}
|
|
31
|
-
|
|
32
|
-
{% capture collect_module_defaults %}themes/{{site.template.name}}/procedures/layouts/collect_module_defaults.proc{% endcapture %}
|
|
33
|
-
{% capture collect_frontmatter_options %}themes/{{site.template.name}}/procedures/global/collect_frontmatter_options.proc{% endcapture %}
|
|
34
|
-
{% capture collect_page_options %}themes/{{site.template.name}}/procedures/global/collect_page_options.proc{% endcapture %}
|
|
35
|
-
|
|
36
|
-
{% comment %} process YML config data
|
|
37
|
-
================================================================================ {% endcomment %}
|
|
38
|
-
|
|
39
|
-
{% comment %} set config data
|
|
40
|
-
-------------------------------------------------------------------------------- {% endcomment %}
|
|
41
|
-
|
|
42
|
-
{% comment %} variables
|
|
43
|
-
-------------------------------------------------------------------------------- {% endcomment %}
|
|
44
|
-
{% assign placement = include.region %}
|
|
45
|
-
{% assign resource_globals = include.global %}
|
|
46
|
-
{% assign resource_settings = include.resource %}
|
|
47
|
-
|
|
48
|
-
{% assign dependency_check_cycle = resource_globals.dependency_check_cycle %}
|
|
49
|
-
{% assign dependency_check_max_count = resource_globals.dependency_check_timeout %}
|
|
50
|
-
|
|
51
|
-
{% assign depends = '' %}
|
|
52
|
-
|
|
53
|
-
{% comment %} helpers
|
|
54
|
-
-------------------------------------------------------------------------------- {% endcomment %}
|
|
55
|
-
{% capture adapter_prefix %}j1.adapter.{% endcapture %}
|
|
56
|
-
{% capture state_condition %}.getState() == 'finished'{% endcapture %}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
{% comment %} main
|
|
60
|
-
-------------------------------------------------------------------------------- {% endcomment %}
|
|
61
|
-
{% if resource_settings.enabled == false %}
|
|
62
|
-
<!-- [WARN ] [j1.layout.module_writer.proc ] [ {{resource_settings.id}} module detected as: {{ resource_settings.enabled }} ] -->
|
|
63
|
-
{% endif %}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
{% if resource_settings.enabled and placement == 'body-footer' %}
|
|
67
|
-
|
|
68
|
-
{% comment %} collect module dependency conditions (if any)
|
|
69
|
-
------------------------------------------------------------------------------ {% endcomment %}
|
|
70
|
-
{% if resource_settings.dependencies %}
|
|
71
|
-
<!-- [INFO ] [j1.layout.module_writer.proc ] [ dependencies detected: {{resource_settings.dependencies | split:','}} ] -->
|
|
72
|
-
|
|
73
|
-
{% comment %} create dependency conditions (depends)
|
|
74
|
-
---------------------------------------------------------------------------- {% endcomment %}
|
|
75
|
-
{% for dependency in resource_settings.dependencies %}
|
|
76
|
-
{% capture depends %}{{depends|append:{{adapter_prefix}}{{dependency}}{{state_condition}}{% endcapture %}
|
|
77
|
-
{% if forloop.last %}{% else %}{% capture depends %}{{depends|append:' && '}}{% endcapture %}{% endif %}
|
|
78
|
-
{% endfor %}
|
|
79
|
-
{% endif %}
|
|
80
|
-
|
|
81
|
-
{% comment %} NOTE:
|
|
82
|
-
Module default values collected by J1 Adapter
|
|
83
|
-
------------------------------------------------------------------------------ {% endcomment %}
|
|
84
|
-
|
|
85
|
-
{% comment %} collect frontmatter|page options (page)
|
|
86
|
-
------------------------------------------------------------------------------ {% endcomment %}
|
|
87
|
-
{% include {{collect_frontmatter_options}} module=resource_settings.id %}
|
|
88
|
-
{% assign frontmatter_options = {{frontmatter_options}} %}
|
|
89
|
-
|
|
90
|
-
{% include {{collect_page_options}} %}
|
|
91
|
-
{% assign page_options = {{page_options}} %}
|
|
92
|
-
|
|
93
|
-
{% assign layout_valid = false %}
|
|
94
|
-
{% for layout in resource_settings.layout %}
|
|
95
|
-
{% assign layout = layout|downcase %}
|
|
96
|
-
{% if layout == page.layout or layout == "all" %} {% assign layout_valid = true %} {% endif %}
|
|
97
|
-
{% endfor %}
|
|
98
|
-
|
|
99
|
-
{% assign resource_valid = false %}
|
|
100
|
-
{% if resource_settings.required == 'always' %}
|
|
101
|
-
{% assign resource_valid = true %}
|
|
102
|
-
{% else %}
|
|
103
|
-
{% for resource in page.resources %}
|
|
104
|
-
{% if resource == resource_settings.id %} {% assign resource_valid = true %} {% endif %}
|
|
105
|
-
{% endfor %}
|
|
106
|
-
{% endif %}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
{% if layout_valid and resource_valid and resource_settings.enabled %}
|
|
110
|
-
|
|
111
|
-
{% comment %} process all data keys
|
|
112
|
-
---------------------------------------------------------------------------- {% endcomment %}
|
|
113
|
-
{% for data_var in resource_settings.data %}
|
|
114
|
-
|
|
115
|
-
{% assign data_key = data_var[0] %}
|
|
116
|
-
{% assign data_value = data_var[1] %}
|
|
117
|
-
|
|
118
|
-
{% comment %}
|
|
119
|
-
--------------------------------------------------------------------------
|
|
120
|
-
WORKAROUND: and id != "j1_footer". For unclear reasons
|
|
121
|
-
a UNKNOWN|NOT EXISTING resource "j1_footer" is detected causing
|
|
122
|
-
wrong adapter placements
|
|
123
|
-
-------------------------------------------------------------------------- {% endcomment %}
|
|
124
|
-
|
|
125
|
-
{% if data_key == 'init_function' and resource_settings.id != "j1_footer" %}
|
|
126
|
-
|
|
127
|
-
<!-- [INFO ] [j1.layout.module_writer.proc ] [ place J1 adapter for resource: {{resource_settings.id}} ] -->
|
|
128
|
-
<script>
|
|
129
|
-
$(document).ready(function() {
|
|
130
|
-
var logger = log4javascript.getLogger("j1.module_loader");
|
|
131
|
-
|
|
132
|
-
{% if resource_settings.id == 'log4javascript' %}
|
|
133
|
-
var start = moment();
|
|
134
|
-
var finished = '';
|
|
135
|
-
var elapsed = '';
|
|
136
|
-
var log_text = '[' +start.format("HH:mm:ss.SSS")+ '] [INFO ] [j1.layout.module_writer.proc ] [ {{resource_settings.comment|strip}} is being initialized ]';
|
|
137
|
-
console.info(log_text);
|
|
138
|
-
{% else %}
|
|
139
|
-
var log_text = '{{resource_settings.comment|strip}} is being initialized';
|
|
140
|
-
logger.info(log_text);
|
|
141
|
-
{% endif %}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
{% comment %} place initializer|s
|
|
145
|
-
-------------------------------------------------------------------- {% endcomment %}
|
|
146
|
-
{% for init_function in data_value %}
|
|
147
|
-
|
|
148
|
-
{% comment %} pass module specific frontmatter options
|
|
149
|
-
------------------------------------------------------------------ {% endcomment %}
|
|
150
|
-
{% if frontmatter_options %}
|
|
151
|
-
// [INFO ] [j1.layout.module_writer.proc ] [ pass module specific frontmatter options for: {{resource_settings.id}} ]
|
|
152
|
-
{% capture frontmatter_options %}{{frontmatter_options}}, {"layout": "{{page.layout}}", "scrollbar": "{{page.scrollbar}}", "toc": "{{page.toc}}", "comments": "{{page.comments}}"}{% endcapture %}
|
|
153
|
-
var settings = $.extend({}, {{frontmatter_options}});
|
|
154
|
-
|
|
155
|
-
{% comment %} create resource_settings.dependencies (if any)
|
|
156
|
-
---------------------------------------------------------------- {% endcomment %}
|
|
157
|
-
{% if resource_settings.dependencies %}
|
|
158
|
-
var interval_count = 0;
|
|
159
|
-
var dependencies_met_{{resource_settings.id}} = setInterval(function() {
|
|
160
|
-
var max_count = {{dependency_check_max_count}};
|
|
161
|
-
interval_count += 1;
|
|
162
|
-
if ( {{depends}} ) {
|
|
163
|
-
{{init_function}}( settings );
|
|
164
|
-
logger.info('dependencies of module {{resource_settings.id}} met for: {{resource_settings.dependencies}}');
|
|
165
|
-
logger.debug('dependencies of module {{resource_settings.id}} met after: ' + interval_count * {{dependency_check_cycle}} + ' ms');
|
|
166
|
-
clearInterval(dependencies_met_{{resource_settings.id}});
|
|
167
|
-
}
|
|
168
|
-
if (interval_count > max_count) {
|
|
169
|
-
logger.warn('dependency check failed for module: {{resource_settings.id}}');
|
|
170
|
-
clearInterval(dependencies_met_{{resource_settings.id}});
|
|
171
|
-
logger.warn('run initializer {{resource_settings.id}} unchecked for: {{resource_settings.dependencies}}');
|
|
172
|
-
{{init_function}}(settings);
|
|
173
|
-
}
|
|
174
|
-
}, {{dependency_check_cycle}});
|
|
175
|
-
{% else %}
|
|
176
|
-
{{init_function}}(settings);
|
|
177
|
-
{% endif %}
|
|
178
|
-
{% else %}
|
|
179
|
-
{% comment %} no module specific frontmatter options
|
|
180
|
-
---------------------------------------------------------------- {% endcomment %}
|
|
181
|
-
|
|
182
|
-
{% comment %} pass default settings
|
|
183
|
-
---------------------------------------------------------------- {% endcomment %}
|
|
184
|
-
{% if resource_settings.pass_init_data %}
|
|
185
|
-
|
|
186
|
-
// [INFO ] [j1.layout.module_writer.proc ] [ pass init data for: {{resource_settings.id}} ]
|
|
187
|
-
{% capture settings %}{"layout": "{{page.layout}}", "scrollbar": "{{page.scrollbar}}", "toc": "{{page.toc}}", "comments": "{{page.comments}}"}{% endcapture %}
|
|
188
|
-
var settings = $.extend({}, {{settings}});
|
|
189
|
-
|
|
190
|
-
{% comment %} create resource_settings.dependencies (if any)
|
|
191
|
-
-------------------------------------------------------------- {% endcomment %}
|
|
192
|
-
{% if resource_settings.dependencies %}
|
|
193
|
-
// Initialize module if resource_settings.dependencies reached state 'finished'
|
|
194
|
-
var interval_count = 0;
|
|
195
|
-
var max_count = {{dependency_check_max_count}};
|
|
196
|
-
var dependencies_met_{{resource_settings.id}} = setInterval(function() {
|
|
197
|
-
interval_count += 1;
|
|
198
|
-
if ( {{depends}} ) {
|
|
199
|
-
{{init_function}}(settings);
|
|
200
|
-
logger.info('dependencies of module {{resource_settings.id}} met for: {{resource_settings.dependencies}}');
|
|
201
|
-
logger.debug('dependencies of module {{resource_settings.id}} met after: ' + interval_count * {{dependency_check_cycle}} + ' ms');
|
|
202
|
-
clearInterval(dependencies_met_{{resource_settings.id}});
|
|
203
|
-
}
|
|
204
|
-
if (interval_count > max_count) {
|
|
205
|
-
logger.warn('dependency check failed for module: {{resource_settings.id}}');
|
|
206
|
-
clearInterval(dependencies_met_{{resource_settings.id}});
|
|
207
|
-
logger.warn('run initializer {{resource_settings.id}} unchecked for: {{resource_settings.dependencies}}');
|
|
208
|
-
{{init_function}}(settings);
|
|
209
|
-
}
|
|
210
|
-
}, {{dependency_check_cycle}});
|
|
211
|
-
{% else %}
|
|
212
|
-
{{init_function}}(settings);
|
|
213
|
-
{% endif %}
|
|
214
|
-
{% else %}
|
|
215
|
-
{% comment %} no default settings
|
|
216
|
-
-------------------------------------------------------------- {% endcomment %}
|
|
217
|
-
|
|
218
|
-
{% comment %} create resource_settings.dependencies (if any)
|
|
219
|
-
-------------------------------------------------------------- {% endcomment %}
|
|
220
|
-
{% if resource_settings.dependencies %}
|
|
221
|
-
var interval_count = 0;
|
|
222
|
-
var max_count = {{dependency_check_max_count}};
|
|
223
|
-
var dependencies_met_{{resource_settings.id}} = setInterval(function() {
|
|
224
|
-
interval_count += 1;
|
|
225
|
-
if ( {{depends}} ) {
|
|
226
|
-
{{init_function}}();
|
|
227
|
-
logger.info('dependencies of module {{resource_settings.id}} met for: {{resource_settings.dependencies}}');
|
|
228
|
-
logger.debug('dependencies of module {{resource_settings.id}} met after: ' + interval_count * {{dependency_check_cycle}} + ' ms');
|
|
229
|
-
clearInterval(dependencies_met_{{resource_settings.id}});
|
|
230
|
-
}
|
|
231
|
-
if (interval_count > max_count) {
|
|
232
|
-
logger.warn('dependency check failed for module: {{resource_settings.id}}');
|
|
233
|
-
clearInterval(dependencies_met_{{resource_settings.id}});
|
|
234
|
-
logger.warn('run initializer {{resource_settings.id}} unchecked for: {{resource_settings.dependencies}}');
|
|
235
|
-
{{init_function}}();
|
|
236
|
-
}
|
|
237
|
-
}, {{dependency_check_cycle}});
|
|
238
|
-
{% else %}
|
|
239
|
-
{{init_function}}();
|
|
240
|
-
{% endif %}
|
|
241
|
-
{% endif %}
|
|
242
|
-
{% endif %}
|
|
243
|
-
{% endfor %}
|
|
244
|
-
});
|
|
245
|
-
</script>
|
|
246
|
-
{% endif %}
|
|
247
|
-
|
|
248
|
-
{% endfor %}
|
|
249
|
-
|
|
250
|
-
{% comment %} END Process all data keys
|
|
251
|
-
---------------------------------------------------------------------------- {% endcomment %}
|
|
252
|
-
<!-- [INFO ] [j1.layout.module_writer.proc ] [ placement for all data_keys finished ] -->
|
|
253
|
-
<!-- [DEBUG ] [j1.layout.module_writer.proc ] [ reset all data_keys ] -->
|
|
254
|
-
|
|
255
|
-
{% comment %} reset all data keys
|
|
256
|
-
----------------------------------------------------------------------------
|
|
257
|
-
{% assign is_placed = true %}
|
|
258
|
-
{% assign name = nil %}
|
|
259
|
-
{% assign resource_settings.enabled = nil %}
|
|
260
|
-
{% assign resource_settings.id = nil %}
|
|
261
|
-
{% assign resource_settings.comment = nil %}
|
|
262
|
-
{% assign resource_settings.layout = nil %}
|
|
263
|
-
{% assign resource_settings.required = nil %}
|
|
264
|
-
{% assign resource_settings.pass_init_data = nil %}
|
|
265
|
-
{% assign resource_settings.dependencies = nil %}
|
|
266
|
-
{% assign depends = nil %}
|
|
267
|
-
{% assign resource_settings.data = nil %}
|
|
268
|
-
---------------------------------------------------------------------------- {% endcomment %}
|
|
269
|
-
{% endif %}
|
|
270
|
-
{% endif %}
|