j1-template 2021.1.2 → 2021.1.7
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/layout_metadata_generator.html +23 -9
- data/_includes/themes/j1/modules/connectors/ad/google-adsense.html +7 -15
- data/_includes/themes/j1/modules/connectors/analytic/google-analytics.html +9 -5
- data/_includes/themes/j1/modules/navigator/generator.html +2 -2
- data/_includes/themes/j1/modules/navigator/procedures/topsearch.proc +2 -2
- data/_includes/themes/j1/procedures/posts/collate_timeline.proc +8 -7
- data/_layouts/default.html +4 -7
- data/assets/data/authclient.html +231 -229
- data/assets/data/banner.html +30 -32
- data/assets/data/cookieconsent.html +249 -0
- data/assets/data/fam.html +1 -1
- data/assets/data/footer.html +1 -1
- data/assets/data/gallery_customizer.html +10 -5
- data/assets/data/menu.html +3 -3
- data/assets/data/mmenu.html +4 -3
- data/assets/data/mmenu_sidebar.html +1 -1
- data/assets/data/mmenu_toc.html +1 -1
- data/assets/data/panel.html +11 -10
- data/assets/data/quicklinks.html +20 -18
- data/assets/data/themes.json +6 -6
- data/assets/themes/j1/adapter/js/{cookiebar.js → cookieConsent.js} +129 -55
- data/assets/themes/j1/adapter/js/j1.js +160 -151
- data/assets/themes/j1/adapter/js/justifiedGalleryCustomizer.js +3 -2
- data/assets/themes/j1/adapter/js/mmenu.js +8 -4
- data/assets/themes/j1/adapter/js/navigator.1.js +896 -0
- data/assets/themes/j1/adapter/js/navigator.2.js +928 -0
- data/assets/themes/j1/adapter/js/navigator.js +176 -209
- data/assets/themes/j1/adapter/js/themer.1.js +326 -0
- data/assets/themes/j1/adapter/js/themer.js +41 -57
- data/assets/themes/j1/adapter/js/toccer.js +4 -45
- data/assets/themes/j1/core/css/themes/uno-dark/bootstrap.css +17 -14
- 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 +3859 -187
- data/assets/themes/j1/core/css/themes/uno-light/bootstrap.min.css +1 -1
- data/assets/themes/j1/core/js/template.js +3 -9
- data/assets/themes/j1/core/js/template.js.map +1 -1
- data/assets/themes/j1/core/js/template.min.js +3 -9
- data/assets/themes/j1/core/js/template.min.js.map +1 -1
- data/assets/themes/j1/modules/cookieConsent/LICENSE +21 -0
- data/assets/themes/j1/modules/cookieConsent/js/cookieConsent.js +286 -0
- data/assets/themes/j1/modules/cookieConsent/js/cookieConsent.min.js +28 -0
- data/assets/themes/j1/modules/fam/css/{uno → theme/uno}/fam.css +0 -0
- data/assets/themes/j1/modules/fam/css/theme/uno/fam.min.css +15 -0
- data/assets/themes/j1/modules/fam/js/fam.js +1 -6
- data/assets/themes/j1/modules/iframeResizer/examples/frame.absolute.html +4 -2
- data/assets/themes/j1/modules/iframeResizer/examples/frame.content.html +4 -3
- data/assets/themes/j1/modules/iframeResizer/examples/frame.hover.html +4 -2
- data/assets/themes/j1/modules/iframeResizer/examples/frame.nested.html +4 -2
- data/assets/themes/j1/modules/iframeResizer/examples/frame.textarea.html +4 -2
- data/assets/themes/j1/modules/iframeResizer/examples/frame.tolerance.html +4 -2
- data/assets/themes/j1/modules/iframeResizer/examples/index.html +2 -0
- data/assets/themes/j1/modules/iframeResizer/examples/two.html +4 -2
- data/assets/themes/j1/modules/mmenuLight/css/{mmenu.css → mmenu-light.css} +0 -0
- data/assets/themes/j1/modules/mmenuLight/css/{mmenu.min.css → mmenu-light.min.css} +0 -0
- data/assets/themes/j1/modules/mmenuLight/css/theme/{uno.css → uno/mmenu.css} +0 -0
- data/assets/themes/j1/modules/mmenuLight/css/theme/{uno.min.css → uno/mmenu.min.css} +0 -0
- data/assets/themes/j1/modules/rtable/css/theme/{uno.css → uno/rtable.css} +0 -0
- data/assets/themes/j1/modules/rtable/css/theme/{uno.min.css → uno/rtable.min.css} +0 -0
- data/assets/themes/j1/modules/themeSwitcher/js/switcher.js +33 -47
- data/assets/themes/j1/modules/themeSwitcher/js/switcher.min.js +410 -2
- data/assets/themes/j1/modules/util/js/domready.js +146 -0
- data/assets/themes/j1/modules/util/js/gtag-opt-in.js +1 -0
- data/lib/j1/version.rb +1 -1
- data/lib/j1_app/j1_auth_manager/auth_manager.rb +2 -3
- data/lib/starter_web/Gemfile +1 -1
- data/lib/starter_web/_config.yml +6 -5
- data/lib/starter_web/_data/_defaults/resources.yml +11 -8
- data/lib/starter_web/_data/apps/defaults/justifiedGalleryCustomizer.yml +1 -0
- data/lib/starter_web/_data/blocks/banner.yml +5 -3
- data/lib/starter_web/_data/blocks/panel.yml +9 -7
- data/lib/starter_web/_data/builder/blog_navigator.yml +1 -0
- data/lib/starter_web/_data/j1_config.yml +20 -17
- data/lib/starter_web/_data/layouts/default.yml +1 -1
- data/lib/starter_web/_data/layouts/home.yml +6 -5
- data/lib/starter_web/_data/layouts/page.yml +1 -1
- data/lib/starter_web/_data/modules/{cookiebar.yml → cookieconsent.yml} +4 -4
- data/lib/starter_web/_data/modules/defaults/authentication.yml +1 -0
- data/lib/starter_web/_data/modules/defaults/cookieconsent.yml +135 -0
- data/lib/starter_web/_data/modules/defaults/navigator.yml +5 -2
- data/lib/starter_web/_data/modules/defaults/themer.yml +2 -1
- data/lib/starter_web/_data/modules/navigator.yml +24 -21
- data/lib/starter_web/_data/pages/builder.yml +7 -7
- data/lib/starter_web/_data/private.default.yml +119 -0
- data/lib/starter_web/_data/private.yml +6 -6
- data/lib/starter_web/_data/resources.yml +15 -14
- data/lib/starter_web/_includes/attributes.asciidoc +10 -1
- data/lib/starter_web/_plugins/lunr_index.rb +1 -1
- data/lib/starter_web/assets/images/modules/attics/{cookies-1920x1200-bw.jpg → cookies-1920x1200.jpg} +0 -0
- data/lib/starter_web/assets/images/modules/attics/lianhao-1920x1280.jpg +0 -0
- data/lib/starter_web/collections/posts/public/featured/_posts/0000-00-00-welcome-to-j1.adoc.erb +3 -3
- data/lib/starter_web/collections/posts/public/featured/_posts/2020-01-01-about-cookies.adoc +4 -4
- data/lib/starter_web/collections/posts/public/featured/_posts/2021-03-01-site-generators.adoc +1 -7
- data/lib/starter_web/collections/posts/public/featured/_posts/2021-03-03-about-j1.adoc +2 -7
- data/lib/starter_web/dot.gitignore +1 -1
- data/lib/starter_web/index.html +1 -1
- data/lib/starter_web/package.json +1 -1
- data/lib/starter_web/pages/public/blog/navigator/archive.html +4 -3
- data/lib/starter_web/pages/public/blog/navigator/archive/categoryview.html +14 -8
- data/lib/starter_web/pages/public/blog/navigator/archive/dateview.html +11 -8
- data/lib/starter_web/pages/public/blog/navigator/archive/tagview.html +6 -5
- data/lib/starter_web/pages/public/cookieConsent.adoc +93 -0
- data/lib/starter_web/pages/public/learn/roundtrip/400_asciidoc_extensions.adoc +2 -1
- data/lib/starter_web/pages/public/legal/en/300_privacy.adoc +104 -209
- data/lib/starter_web/pages/public/panels/intro_panel/panel.adoc +6 -1
- data/lib/starter_web/utilsrv/_defaults/package.json +1 -1
- data/lib/starter_web/utilsrv/package.json +1 -1
- metadata +26 -15
- data/_includes/themes/j1/modules/navigator/generator.org.html +0 -232
- data/assets/data/cookiebar.html +0 -285
- data/lib/starter_web/_data/modules/defaults/cookiebar.yml +0 -132
@@ -0,0 +1,928 @@
|
|
1
|
+
---
|
2
|
+
regenerate: true
|
3
|
+
---
|
4
|
+
|
5
|
+
{% capture cache %}
|
6
|
+
|
7
|
+
{% comment %}
|
8
|
+
# -----------------------------------------------------------------------------
|
9
|
+
# ~/assets/themes/j1/adapter/js/navigator.js
|
10
|
+
# Liquid template to adapt Navigator Core functions
|
11
|
+
#
|
12
|
+
# Product/Info:
|
13
|
+
# https://jekyll.one
|
14
|
+
#
|
15
|
+
# Copyright (C) 2021 Juergen Adams
|
16
|
+
#
|
17
|
+
# J1 Template is licensed under the MIT License.
|
18
|
+
# For details, see https://jekyll.one
|
19
|
+
# -----------------------------------------------------------------------------
|
20
|
+
# Test data:
|
21
|
+
# {{ liquid_var | debug }}
|
22
|
+
# -----------------------------------------------------------------------------
|
23
|
+
# NOTE:
|
24
|
+
#
|
25
|
+
# JSON pretty print
|
26
|
+
# Example: var str = JSON.stringify(obj, null, 2); // spacing level = 2
|
27
|
+
# See: https://stackoverflow.com/questions/4810841/how-can-i-pretty-print-json-using-javascript
|
28
|
+
# -----------------------------------------------------------------------------
|
29
|
+
# NOTE:
|
30
|
+
# jadams, 2020-06-21:
|
31
|
+
# J1 Navigator needs a general revision on BS4 code and functionalities
|
32
|
+
# Current, only base function are tested with BS4 (was coded for BS3)
|
33
|
+
# -----------------------------------------------------------------------------
|
34
|
+
# NOTE:
|
35
|
+
# jadams, 2020-07-17:
|
36
|
+
# J1 Navigator can't be minfied for now. Uglifier fails on an ES6
|
37
|
+
# (most probably) structure that couldn't fixed by 'harmony' setting.
|
38
|
+
# Minifier fails by:
|
39
|
+
# Unexpected token: punc ())
|
40
|
+
# Current, minifying has been disabled
|
41
|
+
# -----------------------------------------------------------------------------
|
42
|
+
{% endcomment %}
|
43
|
+
|
44
|
+
{% comment %} Liquid procedures
|
45
|
+
-------------------------------------------------------------------------------- {% endcomment %}
|
46
|
+
{% capture select_color %}themes/{{site.template.name}}/procedures/global/select_color.proc{% endcapture %}
|
47
|
+
|
48
|
+
{% comment %} Set global settings
|
49
|
+
-------------------------------------------------------------------------------- {% endcomment %}
|
50
|
+
{% assign environment = site.environment %}
|
51
|
+
{% assign brand_image_height = site.brand.image_height %}
|
52
|
+
|
53
|
+
{% comment %} Process YML config data
|
54
|
+
================================================================================ {% endcomment %}
|
55
|
+
|
56
|
+
|
57
|
+
{% comment %} Set config files
|
58
|
+
{% assign auth_manager_config = site.j1_auth %}
|
59
|
+
-------------------------------------------------------------------------------- {% endcomment %}
|
60
|
+
{% assign template_config = site.data.j1_config %}
|
61
|
+
{% assign blocks = site.data.blocks %}
|
62
|
+
{% assign modules = site.data.modules %}
|
63
|
+
|
64
|
+
{% assign themer_defaults = modules.defaults.themer.defaults %}
|
65
|
+
{% assign themer_settings = modules.themer.settings %}
|
66
|
+
|
67
|
+
{% assign authentication_defaults = modules.defaults.authentication.defaults %}
|
68
|
+
{% assign authentication_settings = modules.authentication.settings %}
|
69
|
+
|
70
|
+
{% assign template_config = site.data.template_settings %}
|
71
|
+
{% assign navigator_defaults = site.data.modules.defaults.navigator.defaults %}
|
72
|
+
{% assign navigator_settings = site.data.modules.navigator.settings %}
|
73
|
+
|
74
|
+
{% comment %} Set config data
|
75
|
+
-------------------------------------------------------------------------------- {% endcomment %}
|
76
|
+
{% assign nav_bar_defaults = navigator_defaults.nav_bar %}
|
77
|
+
{% assign nav_bar_settings = navigator_settings.nav_bar %}
|
78
|
+
{% assign nav_menu_defaults = navigator_defaults.nav_menu %}
|
79
|
+
{% assign nav_menu_settings = navigator_settings.nav_menu %}
|
80
|
+
|
81
|
+
{% assign nav_quicklinks_defaults = navigator_defaults.nav_quicklinks %}
|
82
|
+
{% assign nav_quicklinks_settings = navigator_settings.nav_quicklinks %}
|
83
|
+
{% assign nav_topsearch_defaults = navigator_defaults.nav_topsearch %}
|
84
|
+
{% assign nav_topsearch_settings = navigator_settings.nav_topsearch %}
|
85
|
+
{% assign nav_authclient_defaults = authentication_defaults.auth_client %}
|
86
|
+
{% assign nav_authclient_settings = authentication_settings.auth_client %}
|
87
|
+
|
88
|
+
{% comment %} Set config options
|
89
|
+
-------------------------------------------------------------------------------- {% endcomment %}
|
90
|
+
{% assign authentication_options = authentication_defaults | merge: authentication_settings %}
|
91
|
+
{% assign themer_options = themer_defaults | merge: themer_settings %}
|
92
|
+
{% assign nav_bar_options = nav_bar_defaults | merge: nav_bar_settings %}
|
93
|
+
{% assign nav_menu_options = nav_menu_defaults | merge: nav_menu_settings %}
|
94
|
+
{% assign quicklinks_options = nav_quicklinks_defaults | merge: nav_quicklinks_settings %}
|
95
|
+
{% assign topsearch_options = nav_topsearch_defaults | merge: nav_topsearch_settings %}
|
96
|
+
{% assign authclient_options = nav_authclient_defaults | merge: nav_authclient_settings %}
|
97
|
+
|
98
|
+
{% assign nav_bar_id = navigator_defaults.nav_bar.id %}
|
99
|
+
{% assign nav_menu_id = navigator_defaults.nav_menu.id %}
|
100
|
+
{% assign nav_quicklinks_id = navigator_defaults.nav_quicklinks.id %}
|
101
|
+
{% assign nav_navbar_media_breakpoint = navigator_defaults.nav_bar.media_breakpoint %}
|
102
|
+
{% assign authclient_modals_id = navigator_defaults.nav_authclient.xhr_container_id %}
|
103
|
+
|
104
|
+
{% if nav_bar_options.dropdown_animate_duration != null %}
|
105
|
+
{% assign animate_duration = nav_bar_options.dropdown_animate_duration %}
|
106
|
+
{% else %}
|
107
|
+
{% assign animate_duration = 1 %}
|
108
|
+
{% endif %}
|
109
|
+
|
110
|
+
{% assign production = false %}
|
111
|
+
{% if environment == 'prod' or environment == 'production' %}
|
112
|
+
{% assign production = true %}
|
113
|
+
{% endif %}
|
114
|
+
|
115
|
+
{% comment %}
|
116
|
+
--------------------------------------------------------------------------------
|
117
|
+
Set|Overload Liquid vars hardwired to NOT break the (MD) style
|
118
|
+
ToDo: Remove configuration from j1_navigator.yml
|
119
|
+
-------------------------------------------------------------------------------- {% endcomment %}
|
120
|
+
{% assign dropdown_border_height = "3" %}
|
121
|
+
|
122
|
+
/*
|
123
|
+
# -----------------------------------------------------------------------------
|
124
|
+
# ~/assets/themes/j1/adapter/js/navigator.js
|
125
|
+
# JS Adapter for J1 Navigator
|
126
|
+
#
|
127
|
+
# Product/Info:
|
128
|
+
# {{site.data.template_settings.theme_author_url}}
|
129
|
+
#
|
130
|
+
# Copyright (C) 2021 Juergen Adams
|
131
|
+
#
|
132
|
+
# J1 Template is licensed under the MIT License.
|
133
|
+
# For details, see {{site.data.template_settings.theme_author_url}}
|
134
|
+
# -----------------------------------------------------------------------------
|
135
|
+
# NOTE: For AJAX (XHR) loads see
|
136
|
+
# https://stackoverflow.com/questions/3709597/wait-until-all-jquery-ajax-requests-are-done
|
137
|
+
# -----------------------------------------------------------------------------
|
138
|
+
# NOTE: For getStyleValue helper see
|
139
|
+
# https://stackoverflow.com/questions/16965515/how-to-get-a-style-attribute-from-a-css-class-by-javascript-jquery
|
140
|
+
# -----------------------------------------------------------------------------
|
141
|
+
# Adapter generated: {{site.time}}
|
142
|
+
# -----------------------------------------------------------------------------
|
143
|
+
*/
|
144
|
+
|
145
|
+
// -----------------------------------------------------------------------------
|
146
|
+
// ESLint shimming
|
147
|
+
// -----------------------------------------------------------------------------
|
148
|
+
/* eslint indent: "off" */
|
149
|
+
// -----------------------------------------------------------------------------
|
150
|
+
'use strict';
|
151
|
+
|
152
|
+
j1.adapter['navigator'] = (function (j1, window) {
|
153
|
+
|
154
|
+
// ---------------------------------------------------------------------------
|
155
|
+
// globals
|
156
|
+
// ---------------------------------------------------------------------------
|
157
|
+
var environment = '{{environment}}';
|
158
|
+
var dclFinished = false;
|
159
|
+
var moduleOptions = {};
|
160
|
+
|
161
|
+
var nav_menu_id = '{{nav_menu_id}}';
|
162
|
+
var nav_quicklinks_id = '{{nav_quicklinks_id}}';
|
163
|
+
|
164
|
+
var authclient_modals_id = '{{authclient_modals_id}}';
|
165
|
+
var authclient_xhr_data_element = '{{authclient_options.xhr_data_element}}';
|
166
|
+
var authclient_modals_data_path = '{{authclient_options.xhr_data_path}}';
|
167
|
+
|
168
|
+
var nav_menu_data_path = '{{nav_menu_options.data_path}}';
|
169
|
+
var nav_quicklinks_data_path = '{{quicklinks_options.data_path}}';
|
170
|
+
|
171
|
+
var colors_data_path = '{{template_config.colors_data_path}}';
|
172
|
+
var font_size_data_path = '{{template_config.font_size_data_path}}';
|
173
|
+
|
174
|
+
|
175
|
+
var cookie_names = j1.getCookieNames();
|
176
|
+
var cookie_user_session_name = cookie_names.user_session;
|
177
|
+
|
178
|
+
var user_session = {};
|
179
|
+
var user_session_merged = {};
|
180
|
+
var session_state = {};
|
181
|
+
|
182
|
+
var themerEnabled = {{themer_options.enabled}}; //was (test): false;
|
183
|
+
var authClientEnabled;
|
184
|
+
var appDetected;
|
185
|
+
var json_data;
|
186
|
+
var _this;
|
187
|
+
var logger;
|
188
|
+
var logText;
|
189
|
+
|
190
|
+
|
191
|
+
// ---------------------------------------------------------------------------
|
192
|
+
// helper functions
|
193
|
+
// ---------------------------------------------------------------------------
|
194
|
+
|
195
|
+
// ---------------------------------------------------------------------------
|
196
|
+
// main object
|
197
|
+
// ---------------------------------------------------------------------------
|
198
|
+
return {
|
199
|
+
|
200
|
+
// -------------------------------------------------------------------------
|
201
|
+
// module initializer
|
202
|
+
// -------------------------------------------------------------------------
|
203
|
+
init: function (options) {
|
204
|
+
|
205
|
+
// -----------------------------------------------------------------------
|
206
|
+
// globals
|
207
|
+
// -----------------------------------------------------------------------
|
208
|
+
_this = j1.adapter.navigator;
|
209
|
+
logger = log4javascript.getLogger('j1.adapter.navigator');
|
210
|
+
|
211
|
+
// initialize state flag
|
212
|
+
_this.setState('started');
|
213
|
+
logger.info('state: ' + _this.getState());
|
214
|
+
logger.info('module is being initialized');
|
215
|
+
|
216
|
+
// -----------------------------------------------------------------------
|
217
|
+
// defaults
|
218
|
+
// -----------------------------------------------------------------------
|
219
|
+
var settings = $.extend({
|
220
|
+
module_name: 'j1.adapter.navigator',
|
221
|
+
generated: '{{site.time}}'
|
222
|
+
}, options);
|
223
|
+
|
224
|
+
// -----------------------------------------------------------------------
|
225
|
+
// options loader
|
226
|
+
// -----------------------------------------------------------------------
|
227
|
+
/* eslint-disable */
|
228
|
+
var authConfig = {};
|
229
|
+
var navDefaults = {};
|
230
|
+
var navBarConfig = {};
|
231
|
+
var navMenuConfig = {};
|
232
|
+
var navQuicklinksConfig = {};
|
233
|
+
var navTopsearchConfig = {};
|
234
|
+
var navAuthClientConfig = {};
|
235
|
+
var navBarOptions = {};
|
236
|
+
var navMenuOptions = {};
|
237
|
+
var navQuicklinksOptions = {};
|
238
|
+
var navTopsearchOptions = {};
|
239
|
+
var navAuthClientOptions = {};
|
240
|
+
var navAuthMAnagerConfig = {};
|
241
|
+
|
242
|
+
var user_state = {};
|
243
|
+
var cookie_names = j1.getCookieNames();
|
244
|
+
var cookie_user_state_name = cookie_names.user_state;
|
245
|
+
|
246
|
+
var themerOptions = {};
|
247
|
+
var interval_count = 0;
|
248
|
+
var user_state_detected;
|
249
|
+
var themes_count;
|
250
|
+
var max_count = 100;
|
251
|
+
|
252
|
+
|
253
|
+
navDefaults = $.extend({}, {{navigator_defaults | replace: '=>', ':' }});
|
254
|
+
navBarConfig = $.extend({}, {{nav_bar_options | replace: '=>', ':' }});
|
255
|
+
navMenuConfig = $.extend({}, {{nav_menu_options | replace: '=>', ':' }});
|
256
|
+
navQuicklinksConfig = $.extend({}, {{quicklinks_options | replace: '=>', ':' }});
|
257
|
+
navTopsearchConfig = $.extend({}, {{topsearch_options | replace: '=>', ':' }});
|
258
|
+
navAuthClientConfig = $.extend({}, {{authclient_options | replace: '=>', ':' }});
|
259
|
+
|
260
|
+
navAuthMAnagerConfig = $.extend({}, {{authentication_options | replace: '=>', ':' }});
|
261
|
+
authClientEnabled = navAuthMAnagerConfig.enabled;
|
262
|
+
|
263
|
+
themerOptions = $.extend({}, {{themer_options | replace: '=>', ':' | replace: 'nil', '""' }});
|
264
|
+
|
265
|
+
// Merge|Overload module CONFIG by DEFAULTS
|
266
|
+
//
|
267
|
+
navBarOptions = j1.mergeData(navBarConfig, navDefaults.nav_bar);
|
268
|
+
navMenuOptions = j1.mergeData(navMenuConfig, navDefaults.nav_menu);
|
269
|
+
navQuicklinksOptions = j1.mergeData(navQuicklinksConfig, navDefaults.nav_quicklinks);
|
270
|
+
navTopsearchOptions = j1.mergeData(navTopsearchConfig, navDefaults.nav_topsearch);
|
271
|
+
navAuthClientConfig = j1.mergeData(navAuthClientConfig, navDefaults.nav_authclient);
|
272
|
+
|
273
|
+
// save config settings into the adapter object for global access
|
274
|
+
//
|
275
|
+
_this['navDefaults'] = navDefaults;
|
276
|
+
_this['navBarOptions'] = navBarOptions;
|
277
|
+
_this['navMenuOptions'] = navMenuOptions;
|
278
|
+
_this['navQuicklinksOptions'] = navQuicklinksOptions;
|
279
|
+
_this['navTopsearchOptions'] = navTopsearchOptions;
|
280
|
+
_this['navAuthClientConfig'] = navAuthClientConfig;
|
281
|
+
_this['navAuthManagerConfig'] = navAuthMAnagerConfig;
|
282
|
+
|
283
|
+
// Load (individual) frontmatter options (currently NOT used)
|
284
|
+
if (options != null) { var frontmatterOptions = $.extend({}, options) }
|
285
|
+
/* eslint-enable */
|
286
|
+
|
287
|
+
// -----------------------------------------------------------------------
|
288
|
+
// Load HTML data (AJAX)
|
289
|
+
// -----------------------------------------------------------------------
|
290
|
+
// jadams, 202-06-24: Promise (chain) if $.when seems NOT to work correctly.
|
291
|
+
// It seems a chain using .then will be a better solution to make it sure
|
292
|
+
// that the last Deferred set the state to 'data_loaded'.
|
293
|
+
// Found the final state randomly set to 'null' what prevent the module
|
294
|
+
// to run mmenuInitializer.
|
295
|
+
// Workaround: Set 'data_loaded' to be returned by all Deferred in
|
296
|
+
// the chain.
|
297
|
+
// See: https://stackoverflow.com/questions/5436327/jquery-deferreds-and-promises-then-vs-done
|
298
|
+
// authclient_xhr_data_element
|
299
|
+
// -----------------------------------------------------------------------
|
300
|
+
// data loader
|
301
|
+
// -----------------------------------------------------------------------
|
302
|
+
j1.xhrData({
|
303
|
+
xhr_container_id: navQuicklinksOptions.xhr_container_id,
|
304
|
+
xhr_data_path: navQuicklinksOptions.xhr_data_path,
|
305
|
+
xhr_data_element: navQuicklinksOptions.xhr_data_element },
|
306
|
+
'j1.adapter.navigator',
|
307
|
+
null);
|
308
|
+
j1.xhrData({
|
309
|
+
xhr_container_id: navAuthClientConfig.xhr_container_id,
|
310
|
+
xhr_data_path: navAuthClientConfig.xhr_data_path,
|
311
|
+
xhr_data_element: navAuthClientConfig.xhr_data_element },
|
312
|
+
'j1.adapter.navigator',
|
313
|
+
null);
|
314
|
+
j1.xhrData({
|
315
|
+
xhr_container_id: navMenuOptions.xhr_container_id,
|
316
|
+
xhr_data_path: navMenuOptions.xhr_data_path,
|
317
|
+
xhr_data_element: navMenuOptions.xhr_data_element },
|
318
|
+
'j1.adapter.navigator',
|
319
|
+
'data_loaded');
|
320
|
+
|
321
|
+
var dependencies_met_load_menu_finished = setInterval (function () {
|
322
|
+
if (j1.xhrDOMState['#'+navQuicklinksOptions.xhr_container_id] === 'not loaded' ||
|
323
|
+
j1.xhrDOMState['#'+navAuthClientConfig.xhr_container_id] === 'not loaded' ||
|
324
|
+
j1.xhrDOMState['#'+navMenuOptions.xhr_container_id] === 'not loaded' ){
|
325
|
+
logger.error('load HTML data (AJAX): failed');
|
326
|
+
_this.setState('finished');
|
327
|
+
logger.info('state: ' + _this.getState());
|
328
|
+
logger.info('initializing module: failed');
|
329
|
+
logger.info('met dependencies for: xhrData');
|
330
|
+
clearInterval(dependencies_met_load_menu_finished);
|
331
|
+
} else if (j1.xhrDOMState['#'+navQuicklinksOptions.xhr_container_id] === 'success' &&
|
332
|
+
j1.xhrDOMState['#'+navAuthClientConfig.xhr_container_id] === 'success' &&
|
333
|
+
j1.xhrDOMState['#'+navMenuOptions.xhr_container_id] === 'success' ) {
|
334
|
+
// continue if all AJAX loads (xhrData) has finished
|
335
|
+
_this.setState('processing');
|
336
|
+
logger.info('status: ' + _this.getState());
|
337
|
+
logger.info('initialize navigator core');
|
338
|
+
|
339
|
+
// Detect|Set J1 App status
|
340
|
+
appDetected = j1.appDetected();
|
341
|
+
authClientEnabled = j1.authEnabled();
|
342
|
+
logger.info('application status detected: ' + appDetected);
|
343
|
+
|
344
|
+
j1.core.navigator.init (_this.navDefaults, _this.navMenuOptions);
|
345
|
+
|
346
|
+
// load themes (to menu) if themer is enabled|finished
|
347
|
+
if (themerEnabled) {
|
348
|
+
logText = 'theme switcher: enabled';
|
349
|
+
logger.info(logText);
|
350
|
+
|
351
|
+
// Detect|Set J1 UserState
|
352
|
+
user_state_detected = j1.existsCookie(cookie_user_state_name);
|
353
|
+
if (user_state_detected) {
|
354
|
+
user_state = j1.readCookie(cookie_user_state_name);
|
355
|
+
}
|
356
|
+
|
357
|
+
var dependencies_met_page_finished = setInterval(function() {
|
358
|
+
// jadams, 2020-10-03: NOT needed to wait for j1 get finished
|
359
|
+
// if (j1.getState() == 'finished') {
|
360
|
+
// jadams, 2021-06-22: disabled check on themer get finished
|
361
|
+
if (j1.adapter.navigator.getState() == 'core_initialized') {
|
362
|
+
// if ('true' === 'true') {
|
363
|
+
// initialize theme switcher menus
|
364
|
+
|
365
|
+
logText = 'load themes';
|
366
|
+
logger.info(logText);
|
367
|
+
|
368
|
+
// load LOCAL themes from JSON data
|
369
|
+
logText = 'load local themes (json file)';
|
370
|
+
logger.info(logText);
|
371
|
+
$('#local_themes').bootstrapThemeSwitcher({
|
372
|
+
localFeed: themerOptions.localThemes
|
373
|
+
});
|
374
|
+
|
375
|
+
// load REMOTE themes from Bootswatch API (localFeed EMPTY!)
|
376
|
+
$('#remote_themes').bootstrapThemeSwitcher({
|
377
|
+
localFeed: '',
|
378
|
+
bootswatchApiVersion: themerOptions.bootswatchApiVersion
|
379
|
+
});
|
380
|
+
|
381
|
+
// jadams, 2021-04-22: Up to now, it is unclear why in some
|
382
|
+
// cases the menu bar is NOT fully loaded for THEMES
|
383
|
+
// TODO: Add additional checks to find the reason
|
384
|
+
|
385
|
+
// added same checks (as already done by adapter themer) to
|
386
|
+
// check if remote theme menu detected as LOADED
|
387
|
+
//
|
388
|
+
var dependencies_met_remote_themes_loaded = setInterval(function() {
|
389
|
+
interval_count += 1;
|
390
|
+
themes_count = document.getElementById("remote_themes").getElementsByTagName("li").length;
|
391
|
+
if ( themes_count > 0 ) {
|
392
|
+
logger.info('remote themes loaded: successfully');
|
393
|
+
logger.info('remote themes loaded: successfully after: ' + interval_count * 25 + ' ms');
|
394
|
+
|
395
|
+
clearInterval(dependencies_met_remote_themes_loaded);
|
396
|
+
// clearInterval(dependencies_met_page_finished);
|
397
|
+
} else {
|
398
|
+
logger.debug('wait for theme to be loaded: ' + user_state.theme_name);
|
399
|
+
}
|
400
|
+
if (interval_count > max_count) {
|
401
|
+
logger.warn('remote themes loading: failed');
|
402
|
+
logger.warn('continue processing');
|
403
|
+
clearInterval(dependencies_met_remote_themes_loaded);
|
404
|
+
// clearInterval(dependencies_met_page_finished);
|
405
|
+
}
|
406
|
+
clearInterval(dependencies_met_page_finished);
|
407
|
+
}, 25);
|
408
|
+
|
409
|
+
// clearInterval(dependencies_met_page_finished);
|
410
|
+
}
|
411
|
+
_this.setState('initialized');
|
412
|
+
}, 25); // END 'dependencies_met_page_finished'
|
413
|
+
} else {
|
414
|
+
logText = 'theme switcher detected as: disabled';
|
415
|
+
logger.info(logText);
|
416
|
+
}
|
417
|
+
|
418
|
+
// -----------------------------------------------------------------
|
419
|
+
// event handler|css styles
|
420
|
+
// -----------------------------------------------------------------
|
421
|
+
// continue if Theme CSS is applied
|
422
|
+
var dependencies_met_themer_finished = setInterval(function() {
|
423
|
+
if (themerEnabled) {
|
424
|
+
if (j1.adapter.themer.getState() === 'finished') {
|
425
|
+
_this.setState('processing');
|
426
|
+
|
427
|
+
// logger.info('initialize eventHandler');
|
428
|
+
// j1.core.navigator.eventHandler();
|
429
|
+
|
430
|
+
var dependencies_met_page_finished = setInterval(function() {
|
431
|
+
// if (j1.getState() == 'finished') {
|
432
|
+
if (true) {
|
433
|
+
// set general|global theme colors
|
434
|
+
logger.info('initializing dynamic CSS styles: started');
|
435
|
+
_this.setCSS (
|
436
|
+
navDefaults, navBarOptions, navMenuOptions,
|
437
|
+
navQuicklinksOptions, navTopsearchOptions
|
438
|
+
);
|
439
|
+
clearInterval(dependencies_met_page_finished);
|
440
|
+
}
|
441
|
+
logger.info('initializing dynamic CSS styles: finished');
|
442
|
+
}, 25); // END 'dependencies_met_page_finished'
|
443
|
+
|
444
|
+
logger.info('init auth client');
|
445
|
+
_this.initAuthClient(_this.navAuthManagerConfig);
|
446
|
+
|
447
|
+
_this.setState('finished');
|
448
|
+
logger.info('state: ' + _this.getState());
|
449
|
+
logger.info('module initialized successfully');
|
450
|
+
logger.info('met dependencies for: j1');
|
451
|
+
clearInterval(dependencies_met_themer_finished);
|
452
|
+
}
|
453
|
+
} else {
|
454
|
+
_this.setState('processing');
|
455
|
+
|
456
|
+
// logger.info('initialize eventHandler');
|
457
|
+
// j1.core.navigator.eventHandler();
|
458
|
+
|
459
|
+
// set general|global theme colors
|
460
|
+
logger.info('apply dynamic CSS styles');
|
461
|
+
_this.setCSS (
|
462
|
+
navDefaults, navBarOptions, navMenuOptions,
|
463
|
+
navQuicklinksOptions, navTopsearchOptions
|
464
|
+
);
|
465
|
+
|
466
|
+
logger.info('init auth client');
|
467
|
+
_this.initAuthClient(_this.navAuthManagerConfig);
|
468
|
+
_this.setState('finished');
|
469
|
+
logger.info('state: ' + _this.getState());
|
470
|
+
clearInterval(dependencies_met_themer_finished);
|
471
|
+
}
|
472
|
+
}, 25); // END 'dependencies_met_themer_finished'
|
473
|
+
logger.info('met dependencies for: themer');
|
474
|
+
clearInterval(dependencies_met_load_menu_finished);
|
475
|
+
} else {
|
476
|
+
logger.error('load HTML data (AJAX) failed for unknown reason');
|
477
|
+
_this.setState('finished');
|
478
|
+
logger.info('state: ' + _this.getState());
|
479
|
+
logger.info('met dependencies for: xhrData');
|
480
|
+
clearInterval(dependencies_met_load_menu_finished);
|
481
|
+
}
|
482
|
+
}, 25); // END 'dependencies_met_load_menu_finished'
|
483
|
+
|
484
|
+
// --------------------------------------------------------------------
|
485
|
+
// Register event 'reset on resize' to call j1.core.navigator on
|
486
|
+
// manageDropdownMenu to manage the (current) NAV menu for
|
487
|
+
// desktop or mobile
|
488
|
+
// ---------------------------------------------------------------------
|
489
|
+
$(window).on('resize', function() {
|
490
|
+
j1.core.navigator.manageDropdownMenu(navDefaults, navMenuOptions);
|
491
|
+
|
492
|
+
// jadams, 2020-07-10: cause severe trouble on mobile devices if
|
493
|
+
// OnScreen Kbd comes up and reduces the window size (resize event)
|
494
|
+
// DISABLED
|
495
|
+
// -------------------------------------------------------------------
|
496
|
+
// Hide|Close topSearch on resize event
|
497
|
+
// $('.top-search').slideUp();
|
498
|
+
|
499
|
+
// Manage sticky NAV bars
|
500
|
+
setTimeout (function() {
|
501
|
+
j1.core.navigator.navbarSticky();
|
502
|
+
}, 500);
|
503
|
+
|
504
|
+
// Scroll the page one pixel back and forth to get
|
505
|
+
// the right position for Toccer (trigger) and SSM
|
506
|
+
$(window).scrollTop($(window).scrollTop()+1);
|
507
|
+
$(window).scrollTop($(window).scrollTop()-1);
|
508
|
+
|
509
|
+
// jadams, 2020-06-21: unclear|forgotten what I'm doing here!
|
510
|
+
// Looks like the old BS3 implementation
|
511
|
+
//
|
512
|
+
// $('.navbar-collapse').removeClass('in');
|
513
|
+
// $('.navbar-collapse').removeClass('on');
|
514
|
+
// $('.navbar-collapse').removeClass('bounceIn');
|
515
|
+
});
|
516
|
+
}, // END init
|
517
|
+
|
518
|
+
// -------------------------------------------------------------------------
|
519
|
+
// initialize JS portion for the dialogs (modals) used by J1AuthClient
|
520
|
+
// NOTE: Currently cookie updates NOT processed at the NAV module
|
521
|
+
// All updates on Cookies are managed by Cookie Consent.
|
522
|
+
// To be considered to re-add cookie updates for the auth state
|
523
|
+
// -------------------------------------------------------------------------
|
524
|
+
initAuthClient: function(auth_config) {
|
525
|
+
var logger = log4javascript.getLogger('j1.adapter.navigator.initAuthClient');
|
526
|
+
var user_session = j1.readCookie(cookie_user_session_name);
|
527
|
+
|
528
|
+
_this.modalEventHandler(auth_config);
|
529
|
+
|
530
|
+
if (j1.appDetected() && j1.authEnabled()) {
|
531
|
+
// Toggle/Set SignIn/SignOut icon|link in QuickLinks
|
532
|
+
// See: https://stackoverflow.com/questions/13524107/how-to-set-data-attributes-in-html-elements
|
533
|
+
if (user_session.authenticated === 'true') {
|
534
|
+
// Set SignOut
|
535
|
+
$('#navLinkSignInOut').attr('data-target', '#modalOmniSignOut');
|
536
|
+
$('#iconSignInOut').removeClass('mdi-login').addClass('mdi-logout');
|
537
|
+
} else {
|
538
|
+
// Set SignIn
|
539
|
+
$('#navLinkSignInOut').attr('data-target', '#modalOmniSignIn');
|
540
|
+
$('#iconSignInOut').removeClass('mdi-logout').addClass('mdi-login');
|
541
|
+
}
|
542
|
+
}
|
543
|
+
|
544
|
+
return true;
|
545
|
+
}, // END initAuthClient
|
546
|
+
|
547
|
+
// -------------------------------------------------------------------------
|
548
|
+
// modalEventHandler
|
549
|
+
// Manage button click events for all BS Modals
|
550
|
+
// See: https://www.nickang.com/add-event-listener-for-loop-problem-in-javascript/
|
551
|
+
// -------------------------------------------------------------------------
|
552
|
+
modalEventHandler: function (options) {
|
553
|
+
// var logger = log4javascript.getLogger('j1.adapter.navigator.EventHandler');
|
554
|
+
var authConfig = options.j1_auth;
|
555
|
+
var route;
|
556
|
+
var provider;
|
557
|
+
var provider_url;
|
558
|
+
var allowed_users;
|
559
|
+
var logText;
|
560
|
+
|
561
|
+
var signIn = {
|
562
|
+
provider: authConfig.providers.activated[0],
|
563
|
+
users: authConfig.providers[authConfig.providers['activated'][0]]['users'],
|
564
|
+
do: false
|
565
|
+
};
|
566
|
+
|
567
|
+
var signOut = {
|
568
|
+
provider: authConfig.providers.activated[0],
|
569
|
+
providerSignOut: false,
|
570
|
+
do: false
|
571
|
+
};
|
572
|
+
|
573
|
+
logText = 'initialize button click events';
|
574
|
+
logger.info(logText);
|
575
|
+
|
576
|
+
// Manage button click events for modal "signInOutButton"
|
577
|
+
// -----------------------------------------------------------------------
|
578
|
+
$('ul.nav-pills > li').click(function (e) {
|
579
|
+
e.preventDefault();
|
580
|
+
// jadams, 2019-07-30: To be checked if needed
|
581
|
+
signIn.provider = $(this).text().trim();
|
582
|
+
signIn.provider = signIn.provider.toLowerCase();
|
583
|
+
signIn.allowed_users = signIn.users.toString();
|
584
|
+
});
|
585
|
+
|
586
|
+
$('a.btn').click(function() {
|
587
|
+
if (this.id === 'signInButton') {
|
588
|
+
signIn.do = true;
|
589
|
+
} else {
|
590
|
+
signIn.do = false;
|
591
|
+
}
|
592
|
+
if (this.id === 'signOutButton') {
|
593
|
+
signOut.do = true;
|
594
|
+
} else {
|
595
|
+
signOut.do = false;
|
596
|
+
}
|
597
|
+
});
|
598
|
+
|
599
|
+
$('input:checkbox[name="providerSignOut"]').on('click', function (e) {
|
600
|
+
e.stopPropagation();
|
601
|
+
signOut.providerSignOut = $('input:checkbox[name="providerSignOut"]').is(':checked');
|
602
|
+
if(environment === 'development') {
|
603
|
+
logText = 'provider signout set to: ' + signOut.providerSignOut;
|
604
|
+
logger.info(logText);
|
605
|
+
}
|
606
|
+
});
|
607
|
+
|
608
|
+
// Manage pre events on modal "modalOmniSignIn"
|
609
|
+
// -----------------------------------------------------------------------
|
610
|
+
$('#modalOmniSignOut').on('show.bs.modal', function() {
|
611
|
+
var modal = $(this);
|
612
|
+
logger.info('place current user data');
|
613
|
+
user_session = j1.readCookie(cookie_user_session_name);
|
614
|
+
modal.find('.user-info').text('You are signed in to provider: ' + user_session.provider);
|
615
|
+
}); // END SHOW modalOmniSignOut
|
616
|
+
|
617
|
+
// Manage post events on modal "modalOmniSignIn"
|
618
|
+
// -----------------------------------------------------------------------
|
619
|
+
$('#modalOmniSignIn').on('hidden.bs.modal', function() {
|
620
|
+
if (signIn.do == true) {
|
621
|
+
provider = signIn.provider.toLowerCase();
|
622
|
+
allowed_users = signIn.users.toString();
|
623
|
+
logText = 'provider detected: ' + provider;
|
624
|
+
logger.info(logText);
|
625
|
+
|
626
|
+
var route = '/authentication?request=signin&provider=' +provider+ '&allowed_users=' +allowed_users;
|
627
|
+
logText = 'call middleware for signin on route: ' + route;
|
628
|
+
logger.info(logText);
|
629
|
+
window.location.href = route;
|
630
|
+
} else {
|
631
|
+
provider = signIn.provider.toLowerCase();
|
632
|
+
logText = 'provider detected: ' + provider;
|
633
|
+
logger.info(logText);
|
634
|
+
logText = 'login declined for provider: ' +provider;
|
635
|
+
logger.info(logText);
|
636
|
+
}
|
637
|
+
}); // END post events "modalOmniSignIn"
|
638
|
+
|
639
|
+
// Manage post events on modal "modalOmniSignOut"
|
640
|
+
// -----------------------------------------------------------------------
|
641
|
+
$('#modalOmniSignOut').on('hidden.bs.modal', function() {
|
642
|
+
if (signOut.do == true) {
|
643
|
+
logger.info('load active provider from cookie: ' + cookie_user_session_name);
|
644
|
+
|
645
|
+
user_session = j1.readCookie(cookie_user_session_name);
|
646
|
+
provider = user_session.provider;
|
647
|
+
provider_url = user_session.provider_site_url;
|
648
|
+
|
649
|
+
logText = 'provider detected: ' + provider;
|
650
|
+
logger.info(logText);
|
651
|
+
logText = 'initiate signout for provider: ' +provider;
|
652
|
+
logger.info(logText);
|
653
|
+
|
654
|
+
var route = '/authentication?request=signout&provider=' + provider + '&provider_signout=' + signOut.providerSignOut; // + '/logout/';
|
655
|
+
logText = 'call middleware on route : ' +route;
|
656
|
+
logger.info(logText);
|
657
|
+
window.location.href = route;
|
658
|
+
} else {
|
659
|
+
provider = signOut.provider.toLowerCase();
|
660
|
+
logText = 'provider detected: ' + provider;
|
661
|
+
logger.info(logText);
|
662
|
+
logText = 'signout declined for provider: ' +provider ;
|
663
|
+
logger.info(logText);
|
664
|
+
}
|
665
|
+
}); // END post events "modalSignOut"
|
666
|
+
|
667
|
+
logText = 'initialize button click events completed';
|
668
|
+
logger.info(logText);
|
669
|
+
|
670
|
+
return true;
|
671
|
+
}, // END modalEventHandler
|
672
|
+
|
673
|
+
// -------------------------------------------------------------------------
|
674
|
+
// setCSS
|
675
|
+
// Set dynamic CSS styles
|
676
|
+
// -------------------------------------------------------------------------
|
677
|
+
setCSS: function (navDefaults, navBarOptions, navMenuOptions, navQuicklinksOptions, navTopsearchOptions) {
|
678
|
+
var logger = log4javascript.getLogger('j1.adapter.navigator.setCSS');
|
679
|
+
var gridBreakpoint_lg = '992px';
|
680
|
+
var gridBreakpoint_md = '768px';
|
681
|
+
var gridBreakpoint_sm = '576px';
|
682
|
+
var navPrimaryColor = navDefaults.nav_primary_color;
|
683
|
+
|
684
|
+
logger.info('set dynamic styles for the theme loaded');
|
685
|
+
|
686
|
+
// Set|Resolve navMenuOptions
|
687
|
+
// ------------------------------------------------------------------------
|
688
|
+
navMenuOptions.dropdown_font_size = navMenuOptions.dropdown_font_size;
|
689
|
+
navMenuOptions.megamenu_font_size = navMenuOptions.megamenu_font_size;
|
690
|
+
|
691
|
+
// Set|Resolve navBarOptions
|
692
|
+
// -----------------------------------------------------------------------
|
693
|
+
navBarOptions.background_color_full = navBarOptions.background_color_full;
|
694
|
+
|
695
|
+
// Set|Resolve navMenuOptions
|
696
|
+
// -----------------------------------------------------------------------
|
697
|
+
navMenuOptions.menu_item_color = navMenuOptions.menu_item_color;
|
698
|
+
navMenuOptions.menu_item_color_hover = navMenuOptions.menu_item_color_hover;
|
699
|
+
navMenuOptions.menu_item_dropdown_color = navMenuOptions.menu_item_dropdown_color;
|
700
|
+
navMenuOptions.dropdown_item_color = navMenuOptions.dropdown_item_color;
|
701
|
+
navMenuOptions.dropdown_background_color_hover = navMenuOptions.dropdown_background_color_hover;
|
702
|
+
navMenuOptions.dropdown_background_color_active = navMenuOptions.dropdown_background_color_active;
|
703
|
+
navMenuOptions.dropdown_border_color = navMenuOptions.dropdown_border_color;
|
704
|
+
|
705
|
+
// Set|Resolve navQuicklinksOptions
|
706
|
+
// -----------------------------------------------------------------------
|
707
|
+
navQuicklinksOptions.icon_color = navQuicklinksOptions.icon_color;
|
708
|
+
navQuicklinksOptions.icon_color_hover = navQuicklinksOptions.icon_color_hover;
|
709
|
+
navQuicklinksOptions.background_color = navQuicklinksOptions.background_color;
|
710
|
+
|
711
|
+
// Set|Resolve navTopsearchOptions
|
712
|
+
// -----------------------------------------------------------------------
|
713
|
+
navTopsearchOptions.input_color = navTopsearchOptions.input_color;
|
714
|
+
navTopsearchOptions.background_color = navTopsearchOptions.background_color;
|
715
|
+
|
716
|
+
// Set dymanic styles
|
717
|
+
// -----------------------------------------------------------------------
|
718
|
+
// $('nav-primary').css({"background-color": "navPrimaryColor"});
|
719
|
+
|
720
|
+
// navBar styles
|
721
|
+
// -----------------------------------------------------------------------
|
722
|
+
var bg_primary = j1.getStyleValue('bg-primary', 'background-color');
|
723
|
+
var bg_scrolled = bg_primary;
|
724
|
+
var bg_collapsed = bg_primary;
|
725
|
+
|
726
|
+
$('head').append('<style>.mdi-bg-primary {color: ' +bg_scrolled+ ';}</style>');
|
727
|
+
|
728
|
+
// Size of brand image
|
729
|
+
$('head').append('<style>.navbar-brand > img { height: {{brand_image_height}}px !important; }</style>');
|
730
|
+
|
731
|
+
// Navbar transparent-light (light)
|
732
|
+
$('head').append('<style>@media (min-width: ' +gridBreakpoint_lg+ ') { nav.navbar.navigator.navbar-transparent.light { background-color: ' +navBarOptions.background_color_full+ ' !important; border-bottom: solid 0px !important; } }</style>');
|
733
|
+
$('head').append('<style>@media (min-width: ' +gridBreakpoint_lg+ ') { nav.navbar.navigator.navbar-scrolled.light { background-color: ' +bg_scrolled+ ' !important; } }</style>');
|
734
|
+
|
735
|
+
$('head').append('<style id="dynNav">@media (max-width: ' +gridBreakpoint_md+ ') { nav.navbar.navigator.navbar-transparent.light { background-color: ' +navBarOptions.background_color_full+ ' !important; border-bottom: solid 0px !important; } }</style>');
|
736
|
+
$('head').append('<style id="dynNav">@media (max-width: ' +gridBreakpoint_md+ ') { nav.navbar.navigator.navbar-scrolled.light { background-color: ' +bg_scrolled+ ' !important; } }</style>');
|
737
|
+
$('head').append('<style id="dynNav">@media (min-width: ' +gridBreakpoint_md+ ') { nav.navbar.navigator.navbar-transparent.light { background-color: ' +navBarOptions.background_color_full+ ' !important; border-bottom: solid 0px !important; } }</style>');
|
738
|
+
$('head').append('<style id="dynNav">@media (min-width: ' +gridBreakpoint_md+ ') { nav.navbar.navigator.navbar-scrolled.light { background-color: ' +bg_scrolled+ ' !important; } }</style>');
|
739
|
+
|
740
|
+
$('head').append('<style id="dynNav">@media (max-width: ' +gridBreakpoint_sm+ ') { nav.navbar.navigator.navbar-transparent.light { background-color: ' +navBarOptions.background_color_full+ ' !important; border-bottom: solid 0px !important; } }</style>');
|
741
|
+
$('head').append('<style id="dynNav">@media (max-width: ' +gridBreakpoint_sm+ ') { nav.navbar.navigator.navbar-scrolled.light { background-color: ' +bg_scrolled+ ' !important; } }</style>');
|
742
|
+
|
743
|
+
// navQuicklinks styles
|
744
|
+
// -----------------------------------------------------------------------
|
745
|
+
$('head').append('<style>.attr-nav> ul > li > a { color: ' +navQuicklinksOptions.icon_color+ ' !important; }</style>');
|
746
|
+
$('head').append('<style>.attr-nav> ul > li > a:hover { color: ' +navQuicklinksOptions.icon_color_hover+ ' !important; }</style>');
|
747
|
+
|
748
|
+
// navMenu styles
|
749
|
+
// -----------------------------------------------------------------------
|
750
|
+
// Remove background for anchor
|
751
|
+
$('head').append('<style>.dropdown-menu > .active > a { background-color: transparent !important; }</style>');
|
752
|
+
// hover menu-item|menu-sub-item
|
753
|
+
$('head').append('<style>@media (min-width: ' +gridBreakpoint_lg+ ') { nav.navbar.navigator .dropdown-item:focus, nav.navbar.navigator .dropdown-item:hover, nav.navbar.navigator .nav-sub-item:focus, nav.navbar.navigator .nav-sub-item:hover { background: ' +navMenuOptions.dropdown_background_color_hover+ ' !important; }}</style>');
|
754
|
+
|
755
|
+
// Limit 1st dropdown item width
|
756
|
+
$('head').append('<style>@media (min-width: ' +gridBreakpoint_lg+ ') { nav.navbar.navigator ul.nav.navbar-right .dropdown-menu .dropdown-menu { left: -' +navMenuOptions.dropdown_item_min_width+ 'rem !important; } }</style>');
|
757
|
+
|
758
|
+
// Limit last (2nd) dropdown in height (nav.navbar.navigator li.dropdown ul.dropdown-menu ul.dropdown-menu)
|
759
|
+
// !important
|
760
|
+
$('head').append('<style>@media (min-width: ' +gridBreakpoint_lg+ ') { nav.navbar.navigator li.dropdown ul.dropdown-menu ul.dropdown-menu { top: -' +navMenuOptions.dropdown_border_top+ 'px !important; max-height: ' +navMenuOptions.dropdown_menu_max_height+ 'em; } }</style>');
|
761
|
+
|
762
|
+
// Set dropdown item colors
|
763
|
+
$('head').append('<style>@media (min-width: ' +gridBreakpoint_lg+ ') { nav.navbar.navigator ul.nav > li > a { color: ' +navMenuOptions.menu_item_color+ ' !important; } }</style>');
|
764
|
+
$('head').append('<style>@media (min-width: ' +gridBreakpoint_lg+ ') { nav.navbar.navigator ul.nav > li > a:hover { color: ' +navMenuOptions.menu_item_color_hover+ ' !important; } }</style>');
|
765
|
+
|
766
|
+
// Dropdown menu styles
|
767
|
+
// jadams, 2017-11-30: removed left padding from dropdown mwenu (for new j1nav style based on Navigator|Slate)
|
768
|
+
$('head').append('<style>@media (min-width: ' +gridBreakpoint_lg+ ') { nav.navbar.navigator li.dropdown ul.dropdown-menu { animation-duration: ' +navMenuOptions.dropdown_animate_duration+ 's !important; color: ' +bg_scrolled+ ' !important; min-width: ' +navMenuOptions.dropdown_item_min_width+ 'rem !important; border-top: solid ' +navMenuOptions.dropdown_border_top+ 'px !important; border-radius: ' +navMenuOptions.dropdown_border_radius+ 'px !important; left: 0; } }</style>');
|
769
|
+
|
770
|
+
{% if dropdown_style == 'raised' %}
|
771
|
+
$('head').append('<style>@media (min-width: ' +gridBreakpoint_lg+ ') { nav.navbar.navigator li.dropdown ul.dropdown-menu { box-shadow: 0 16px 38px -12px rgba(0, 0, 0, 0.56), 0 4px 25px 0px rgba(0, 0, 0, 0.12), 0 8px 10px -5px rgba(0, 0, 0, 0.2) !important; } }</style>');
|
772
|
+
{% endif %}
|
773
|
+
|
774
|
+
// jadams, 2017-11-22: configure dropdown_font_size|color
|
775
|
+
$('head').append('<style>@media (min-width: ' +gridBreakpoint_lg+ ') { nav.navbar.navigator li.dropdown ul.dropdown-menu > li > a { color: ' +navMenuOptions.dropdown_item_color+ ' !important; font-size: ' +navMenuOptions.dropdown_font_size+ ' !important; font-weight: 400; } }</style>');
|
776
|
+
$('head').append('<style>@media (min-width: ' +gridBreakpoint_lg+ ') { nav.navbar.navigator ul.dropdown-menu.megamenu-content .content ul.menu-col li a { color: ' +navMenuOptions.dropdown_item_color+ ' !important; font-size: ' +navMenuOptions.megamenu_font_size+ ' !important; font-weight: 400; } }</style>');
|
777
|
+
|
778
|
+
// navQuicklinks styles
|
779
|
+
// -----------------------------------------------------------------------
|
780
|
+
|
781
|
+
// navTopSearch Styles
|
782
|
+
// -----------------------------------------------------------------------
|
783
|
+
// jadams, 2020-07-08: disabled because colors for icons set by the icon font settings
|
784
|
+
// $('head').append('<style>.top-search .input-group-addon { color: ' +navTopsearchOptions.input_color+ ' !important; }</style>');
|
785
|
+
$('head').append('<style>.top-search { background-color: ' +navTopsearchOptions.background_color+ ' !important; }</style>');
|
786
|
+
$('head').append('<style>.top-search input.form-control { color: ' +navTopsearchOptions.input_color+ ' !important; }</style>');
|
787
|
+
|
788
|
+
// Timeline styles
|
789
|
+
// -----------------------------------------------------------------------
|
790
|
+
$('head').append('<style>.timeline > li > .timeline-panel:after {border-right-color: ' +bg_scrolled+ '; border-left-color: ' +bg_scrolled+ ';}</style>');
|
791
|
+
$('head').append('<style>.tmicon {background: ' +bg_scrolled+ ';}</style>');
|
792
|
+
|
793
|
+
// Heading styles
|
794
|
+
// -----------------------------------------------------------------------
|
795
|
+
$('head').append('<style>.heading:after {background: ' +bg_scrolled+ ' !important;}</style>');
|
796
|
+
|
797
|
+
// Tag Cloud styles
|
798
|
+
// -----------------------------------------------------------------------
|
799
|
+
$('head').append('<style>.tag-cloud ul li a {background-color: ' +bg_scrolled+ ' !important;}</style>');
|
800
|
+
// $('head').append('<style>.tag-cloud ul li a:hover {background-color: #212121 !important;}</style>');
|
801
|
+
|
802
|
+
// Toccer styles
|
803
|
+
// -----------------------------------------------------------------------
|
804
|
+
$('head').append('<style>.is-active-link::before {background-color: ' +bg_scrolled+ ' !important;}</style>');
|
805
|
+
|
806
|
+
// BS extended Modal styles
|
807
|
+
// -----------------------------------------------------------------------
|
808
|
+
$('head').append('<style>.modal-dialog.modal-notify.modal-primary .modal-header {background-color: ' +bg_scrolled+ ';}</style>');
|
809
|
+
|
810
|
+
// BS nav|pills styles
|
811
|
+
// -----------------------------------------------------------------------
|
812
|
+
$('head').append('<style>.nav-pills .nav-link.active, .nav-pills .show > .nav-link {background-color: ' +bg_scrolled+ ' !important;}</style>');
|
813
|
+
|
814
|
+
return true;
|
815
|
+
}, // END setCSS
|
816
|
+
|
817
|
+
// -------------------------------------------------------------------------
|
818
|
+
// delayShowMenu
|
819
|
+
// delay all dropdown menu to open for "delay" time
|
820
|
+
// See: http://jsfiddle.net/AndreasPizsa/NzvKC/
|
821
|
+
// -------------------------------------------------------------------------
|
822
|
+
delayShowMenu: function ( menuOpenDelay ) {
|
823
|
+
var logger = log4javascript.getLogger('j1.adapter.navigator.delayShowMenu');
|
824
|
+
var theTimer = 0;
|
825
|
+
var theElement = null;
|
826
|
+
var theLastPosition = {x:0,y:0};
|
827
|
+
|
828
|
+
logText ='entered delayShowMenu';
|
829
|
+
logger.info(logText);
|
830
|
+
|
831
|
+
// $('#navigator_nav_menu')
|
832
|
+
// .find('li.dropdown.nav-item')
|
833
|
+
|
834
|
+
$('[data-toggle]').closest('li')
|
835
|
+
.on('mouseenter', function (inEvent) {
|
836
|
+
if (theElement) theElement.removeClass('open');
|
837
|
+
window.clearTimeout(theTimer);
|
838
|
+
theElement = $(this);
|
839
|
+
|
840
|
+
theTimer = window.setTimeout(function () {
|
841
|
+
theElement.addClass('open');
|
842
|
+
}, menuOpenDelay);
|
843
|
+
})
|
844
|
+
.on('mousemove', function (inEvent) {
|
845
|
+
if(Math.abs(theLastPosition.x - inEvent.ScreenX) > 4 ||
|
846
|
+
Math.abs(theLastPosition.y - inEvent.ScreenY) > 4) {
|
847
|
+
theLastPosition.x = inEvent.ScreenX;
|
848
|
+
theLastPosition.y = inEvent.ScreenY;
|
849
|
+
return;
|
850
|
+
}
|
851
|
+
if (theElement.hasClass('open')) return;
|
852
|
+
window.clearTimeout(theTimer);
|
853
|
+
theTimer = window.setTimeout(function () {
|
854
|
+
theElement.addClass('open');
|
855
|
+
}, menuOpenDelay);
|
856
|
+
})
|
857
|
+
.on('mouseleave', function (inEvent) {
|
858
|
+
window.clearTimeout(theTimer);
|
859
|
+
theElement = $(this);
|
860
|
+
theTimer = window.setTimeout(function () {
|
861
|
+
theElement.removeClass('open');
|
862
|
+
}, menuOpenDelay);
|
863
|
+
});
|
864
|
+
|
865
|
+
return true;
|
866
|
+
}, // END delayShowMenu
|
867
|
+
|
868
|
+
// -------------------------------------------------------------------------
|
869
|
+
// messageHandler
|
870
|
+
// Manage messages (paylods) send from other J1 modules
|
871
|
+
// -------------------------------------------------------------------------
|
872
|
+
messageHandler: function (sender, message) {
|
873
|
+
// var json_message = JSON.stringify(message, undefined, 2); // multiline
|
874
|
+
var json_message = JSON.stringify(message);
|
875
|
+
_this.setState(message.action);
|
876
|
+
|
877
|
+
logText = 'received message from ' + sender + ': ' + json_message;
|
878
|
+
logger.info(logText);
|
879
|
+
|
880
|
+
logText = 'set state to: ' + message.action;
|
881
|
+
logger.info(logText);
|
882
|
+
|
883
|
+
// -----------------------------------------------------------------------
|
884
|
+
// Process commands|actions
|
885
|
+
// -----------------------------------------------------------------------
|
886
|
+
if (message.type === 'command' && message.action === 'module_initialized') {
|
887
|
+
//
|
888
|
+
// Place handling of command|action here
|
889
|
+
//
|
890
|
+
logger.info(message.text);
|
891
|
+
}
|
892
|
+
if (message.type === 'command' && message.action === 'status') {
|
893
|
+
logger.info('messageHandler: received - ' + message.action);
|
894
|
+
}
|
895
|
+
|
896
|
+
//
|
897
|
+
// Place handling of other command|action here
|
898
|
+
//
|
899
|
+
|
900
|
+
return true;
|
901
|
+
}, // END messageHandler
|
902
|
+
|
903
|
+
// -------------------------------------------------------------------------
|
904
|
+
// setState()
|
905
|
+
// Sets the current (processing) state of the module
|
906
|
+
// -------------------------------------------------------------------------
|
907
|
+
setState: function (stat) {
|
908
|
+
_this.state = stat;
|
909
|
+
}, // END setState
|
910
|
+
|
911
|
+
// -------------------------------------------------------------------------
|
912
|
+
// getState()
|
913
|
+
// Returns the current (processing) state of the module
|
914
|
+
// -------------------------------------------------------------------------
|
915
|
+
getState: function () {
|
916
|
+
return _this.state;
|
917
|
+
} // END getState
|
918
|
+
|
919
|
+
}; // END return
|
920
|
+
})(j1, window);
|
921
|
+
|
922
|
+
{% endcapture %}
|
923
|
+
{% if production %}
|
924
|
+
{{ cache | minifyJS }}
|
925
|
+
{% else %}
|
926
|
+
{{ cache | strip_empty_lines }}
|
927
|
+
{% endif %}
|
928
|
+
{% assign cache = nil %}
|