j1_template_mde 2018.4.34 → 2018.4.35

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/_includes/themes/j1/layouts/layout_shim_generator.html +62 -13
  3. data/_includes/themes/j1/modules/navigator/generator.html +37 -35
  4. data/_includes/themes/j1/modules/navigator/procedures/{quicklinks.proc → _unused/quicklinks.proc} +0 -0
  5. data/_includes/themes/j1/modules/navigator/procedures/{sidebar.proc → _unused/sidebar.proc} +0 -0
  6. data/_layouts/default.html +0 -39
  7. data/lib/j1/version.rb +1 -1
  8. data/lib/starter_web/Gemfile +1 -1
  9. data/lib/starter_web/_config.yml +1 -1
  10. data/lib/starter_web/_data/j1_config.yml +22 -0
  11. data/lib/starter_web/_data/modules/j1_cookie_consent.yml +3 -3
  12. data/lib/starter_web/_data/modules/j1_navigator.yml +1 -1
  13. data/lib/starter_web/_data/modules/j1_navigator_menu.yml +12 -12
  14. data/lib/starter_web/_data/modules/j1_theme_switcher.yml +48 -55
  15. data/lib/starter_web/_rack/config.ru +15 -1
  16. data/lib/starter_web/assets/data/quicklinks.html +27 -11
  17. data/lib/starter_web/assets/images/pages/roundtrip/package.json +1 -1
  18. data/lib/starter_web/assets/themes/j1/core/js/adapter/cookie_consent.js +15 -14
  19. data/lib/starter_web/assets/themes/j1/core/js/adapter/navigator.js +24 -62
  20. data/lib/starter_web/assets/themes/j1/core/js/adapter/template.js +83 -46
  21. data/lib/starter_web/assets/themes/j1/core/js/template.js +1 -1
  22. data/lib/starter_web/assets/themes/j1/core/js/template.js.map +1 -1
  23. data/lib/starter_web/assets/themes/j1/core/js/template.min.js +1 -1
  24. data/lib/starter_web/collections/posts/protected/wikipedia/_posts/2016-11-20-minneapolis.adoc +1 -1
  25. data/lib/starter_web/collections/posts/protected/wikipedia/_posts/2016-11-24-narcisse-snake-dens.adoc +3 -3
  26. data/lib/starter_web/collections/posts/protected/wikipedia/_posts/2016-11-26-columbia-river.adoc +2 -2
  27. data/lib/starter_web/package.json +1 -1
  28. data/lib/starter_web/pages/public/legal/de/300_privacy.adoc +152 -55
  29. data/lib/starter_web/pages/public/legal/en/300_privacy.adoc +15 -4
  30. data/lib/starter_web/pages/public/start/roundtrip/000_includes/documents/{710_responsive_tables.asciidoc → 420_responsive_tables.asciidoc} +0 -0
  31. data/lib/starter_web/pages/public/start/roundtrip/100_present_images.adoc +18 -4
  32. data/lib/starter_web/pages/public/start/roundtrip/{300_typography.adoc → 200_typography.adoc} +0 -0
  33. data/lib/starter_web/pages/public/start/roundtrip/{400_icon_fonts.adoc → 300_icon_fonts.adoc} +0 -0
  34. data/lib/starter_web/pages/public/start/roundtrip/{500_asciidoc_extensions.adoc → 400_asciidoc_extensions.adoc} +4 -4
  35. data/lib/starter_web/pages/public/start/roundtrip/{700_extended_modals.adoc → 410_bs_modals_extentions.adoc} +1 -1
  36. data/lib/starter_web/pages/public/start/roundtrip/420_responsive_tables_extensions.adoc +267 -0
  37. data/lib/starter_web/pages/public/start/roundtrip/{600_themes.adoc → 500_themes.adoc} +11 -3
  38. data/lib/starter_web/pages/public/start/roundtrip/{200_cards.adoc → _unused/600_cards.adoc} +0 -0
  39. data/lib/starter_web/pages/public/start/roundtrip/{800_search_engine.adoc → _unused/710_search_engine.adoc} +0 -0
  40. data/lib/starter_web/pages/public/start/roundtrip/{800_google_custom_search.adoc → _unused/720_google_custom_search.adoc} +0 -0
  41. metadata +14 -14
  42. data/lib/starter_web/pages/public/start/roundtrip/710_responsive_tables.adoc +0 -53
@@ -1,8 +1,23 @@
1
+ # ------------------------------------------------------------------------------
2
+ # ~/config.ru (production)
3
+ # Provides run-time information for the (Rack) Application Loader "rackup"
4
+ #
1
5
  # Transforms J1 into a Web Application based on Rack and
2
6
  # Sinatra using the OmniAuth software stack managed by Warden
3
7
  # for authentication to create secured static J1 based web
4
8
  # sites.
5
9
  #
10
+ # Product/Info:
11
+ # https://jekyll-one.com
12
+ #
13
+ # Copyright (C) 2019 Juergen Adams
14
+ #
15
+ # J1 Template is licensed under the MIT License.
16
+ # See: https://github.com/jekyll-one/j1_template_mde/blob/master/LICENSE
17
+ #
18
+ # ------------------------------------------------------------------------------
19
+ # NOTE: This rackup config is used for PRODUCTION only.
20
+ # ------------------------------------------------------------------------------
6
21
  require 'dotenv'
7
22
  require 'j1_app'
8
23
 
@@ -29,6 +44,5 @@ end
29
44
  if ENV['J1_RACK_ENV'] == 'development'
30
45
  # Run the app in production mode
31
46
  # ------------------------------------------------------------------------------
32
- #run J1AppTest.site
33
47
  run J1App.site
34
48
  end
@@ -80,26 +80,44 @@ regenerate: true
80
80
  {% assign facebook_url = quicklinks_options.facebook_url %}
81
81
  {% assign twitter_url = quicklinks_options.twitter_url %}
82
82
 
83
+
84
+ {% comment %} Show|Hide Quicksearch icon
85
+ ------------------------------------------------------------------------------ {% endcomment %}
83
86
  {% if quick_search_config.enabled %}
84
87
  {% assign show_quick_search_icon = true %}
85
88
  {% else %}
86
89
  {% assign show_quick_search_icon = false %}
87
90
  {% endif %}
88
91
 
92
+ {% comment %} Show|Hide AuthManager icon
93
+ ------------------------------------------------------------------------------ {% endcomment %}
89
94
  {% if auth_manager_config.enabled %}
90
95
  {% assign show_auth_manager_icon = true %}
91
96
  {% else %}
92
97
  {% assign show_auth_manager_icon = false %}
93
98
  {% endif %}
94
99
 
100
+ {% comment %} Show|Hide Sidebar icon
101
+ ------------------------------------------------------------------------------ {% endcomment %}
95
102
  {% if quicklinks_options.sidebar %}
96
103
  {% assign show_sidebar_icon = true %}
97
104
  {% else %}
98
105
  {% assign show_sidebar_icon = false %}
99
106
  {% endif %}
100
107
 
101
- {% if consent_settings.enabled == "true" %} {% assign consent_enabled = true %} {% endif %}
102
- {% if consent_settings.show_cookie_consent_icon == "true" %} {% assign consent_icon_enabled = true %} {% endif %}
108
+ {% comment %} Show|Hide CookieConsent icon
109
+ ------------------------------------------------------------------------------ {% endcomment %}
110
+ {% if consent_options.enabled %}
111
+ {% assign consent_enabled = true %}
112
+ {% else %}
113
+ {% assign consent_enabled = false %}
114
+ {% endif %}
115
+
116
+ {% if consent_options.show_consent_icon %}
117
+ {% assign consent_icon_enabled = true %}
118
+ {% else %}
119
+ {% assign consent_icon_enabled = false %}
120
+ {% endif %}
103
121
 
104
122
  {% if consent_enabled and consent_icon_enabled %}
105
123
  {% assign show_cookie_consent_icon = true %}
@@ -107,6 +125,8 @@ regenerate: true
107
125
  {% assign show_cookie_consent_icon = false %}
108
126
  {% endif %}
109
127
 
128
+ {% comment %} Select icon family and size (color set dynamically by adapter)
129
+ ------------------------------------------------------------------------------ {% endcomment %}
110
130
  {% if quicklinks_options.icon_family == 'FontAwesome' or quicklinks_options.icon_family == 'FontAwesome4' or quicklinks_options.icon_family == 'FontAwesome5' %}
111
131
  {% assign icon_family = 'fa' %}
112
132
  {% elsif quicklinks_options.icon_family == 'MDI' or quicklinks_options.icon_family == 'Material Design Icons'%}
@@ -119,17 +139,13 @@ regenerate: true
119
139
  {% assign icon_size = size %}
120
140
 
121
141
 
122
- {% comment %} Icon color set dynamically by adapter
123
- --------------------------------------------------------------------------------
124
- {% include {{select_color}} color=quicklinks_options.icon_color fallback="#9E9E9E" %}
125
- {% assign my_icon_color = color %}
126
- {% capture icon_color %}style="color:{{my_icon_color}}"{% endcapture %}
127
- --------------------------------------------------------------------------------
128
- {% endcomment %}
129
-
130
-
131
142
  {% comment %} Main
132
143
  -------------------------------------------------------------------------------- {% endcomment %}
144
+ <!-- [INFO ] [j1.modules.navigator.quicklinks.html ] [AuthManager detected as: {{ show_auth_manager_icon }}] -->
145
+ <!-- [INFO ] [j1.modules.navigator.quicklinks.html ] [CookieConsent detected as: {{ consent_enabled }}] -->
146
+ <!-- [INFO ] [j1.modules.navigator.quicklinks.html ] [Show CookieConsent icon detected as: {{ show_cookie_consent_icon }}] -->
147
+ <!-- [INFO ] [j1.modules.navigator.quicklinks.html ] [Set icon familiy as: {{ icon_family }}] -->
148
+ <!-- [INFO ] [j1.modules.navigator.quicklinks.html ] [Set icon size as: {{ icon_size }}] -->
133
149
  <ul class="navbar-nav">
134
150
  {% if disqus_url != "none" %}<li nav-item><a id="disqus_id" class="nav-icon" href="{{disqus_url}}" target="_blank"><i class="{{icon_family}} {{icon_family}}-{{disqus_icon}} {{icon_size}}"></i></a></li>{% endif %}
135
151
  {% if github_url != "none" %}<li nav-item><a id="github_id" class="nav-icon" href="{{github_url}}" target="_blank"><i class="{{icon_family}} {{icon_family}}-{{github_icon}} {{icon_size}}"></i></a></li>{% endif %}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": true,
3
3
  "name": "web",
4
- "version": "2018.4.34",
4
+ "version": "2018.4.35",
5
5
  "description": "Web/Content sources for J1 Starter",
6
6
  "main": "_config.yml",
7
7
  "config": {
@@ -181,10 +181,11 @@ j1.cookieConsent = (function (j1, window) {
181
181
  var options = consentConfig;
182
182
  var current_page = window.location.pathname;
183
183
  var modalButtons = document.querySelectorAll('a.btn');
184
- var appDetected = j1.Navigator.appDetected();
185
- var authClientEnabled = j1.Navigator.authClientEnabled();
184
+ var appDetected = j1.appDetected();
185
+ var authClientEnabled = j1.authClientEnabled();
186
186
  var deleteOnDecline = options.delete_on_decline;
187
187
  var whitelistedPages = options.whitelisted_pages;
188
+ var stopScrolling = consentConfig.stop_scrolling;
188
189
  var user_state = {};
189
190
  var web_session_state = {};
190
191
  var whitelisted;
@@ -194,7 +195,7 @@ j1.cookieConsent = (function (j1, window) {
194
195
  // -------------------------------------------------------------------
195
196
  $(document).on('shown.bs.modal','#topFullCookieConsent', function () {
196
197
 
197
- if (consentConfig.stopScrolling) { $('body').addClass('stop-scrolling'); }
198
+ if ( stopScrolling ) { $('body').addClass('stop-scrolling'); }
198
199
 
199
200
  user_state = j1.getUserStateCookie();
200
201
  if ( appDetected ) {
@@ -308,15 +309,15 @@ j1.cookieConsent = (function (j1, window) {
308
309
  $(document).on('hide.bs.modal','#topFullCookieConsent', function () {
309
310
  logger.info('User closed topFullCookieConsent');
310
311
 
311
- // appDetected = j1.Navigator.appDetected();
312
- // authClientEnabled = j1.Navigator.authClientEnabled();
313
- //
314
- // // Show or Hide signin|cookie icon
315
- // if ( appDetected && authClientEnabled ) {
316
- // $('#quickLinksSignInOutButton').css('display', 'block');
317
- // } else {
318
- // $('#quickLinksSignInOutButton').css('display', 'none');
319
- // }
312
+ appDetected = j1.appDetected();
313
+ authClientEnabled = j1.authClientEnabled();
314
+
315
+ // Show or Hide signin|cookie icon
316
+ if ( appDetected && authClientEnabled ) {
317
+ $('#quickLinksSignInOutButton').css('display', 'block');
318
+ } else {
319
+ $('#quickLinksSignInOutButton').css('display', 'none');
320
+ }
320
321
 
321
322
  // Update sidebar
322
323
  logger.info('Update sidebar');
@@ -330,8 +331,8 @@ j1.cookieConsent = (function (j1, window) {
330
331
  $(document).on('hide.bs.modal','#cookieRevokeCentralDanger', function () {
331
332
  logger.info('User closed cookieRevokeCentralDanger');
332
333
 
333
- appDetected = j1.Navigator.appDetected();
334
- authClientEnabled = j1.Navigator.authClientEnabled();
334
+ appDetected = j1.appDetected();
335
+ authClientEnabled = j1.authClientEnabled();
335
336
 
336
337
  // Show or Hide signin|cookie icon
337
338
  if ( appDetected && authClientEnabled ) {
@@ -135,7 +135,7 @@ j1.Navigator = (function (j1, window) {
135
135
  {% comment %} Set global variables
136
136
  -------------------------------------------------------------------------- {% endcomment %}
137
137
  logger = log4javascript.getLogger("j1.Navigator.adapter"); // Setup logger
138
-
138
+
139
139
  // Set|Log status
140
140
  state = 'started';
141
141
  logger.info('state: ' + state);
@@ -150,7 +150,7 @@ j1.Navigator = (function (j1, window) {
150
150
  navTopsearchConfig = $.extend({}, {{nav_topsearch_config | replace: '=>', ':' }});
151
151
  navSidebarConfig = $.extend({}, {{nav_sidebar_config | replace: '=>', ':' }});
152
152
  navAuthClientConfig = $.extend({}, {{nav_authclient_config | replace: '=>', ':' }});
153
-
153
+
154
154
  authConfig = $.extend({}, {{auth_config | replace: '=>', ':' }});
155
155
  authClientEnabled = authConfig.enabled;
156
156
 
@@ -202,33 +202,28 @@ j1.Navigator = (function (j1, window) {
202
202
  // See: https://stackoverflow.com/questions/3709597/wait-until-all-jquery-ajax-requests-are-done
203
203
  $.when( load_color_data(), load_font_sizes(), j1.Navigator.loadSideBar(), j1.Navigator.loadQuickLinks() ).done (
204
204
  function( load_color_data_response, load_font_sizes_response, load_sidebar_response, load_quicklinks_response ) {
205
-
206
- logger.info('Check if web is running as an app');
207
205
  // Detect|Set J1 App status
208
- appDetected = j1.Navigator.appDetected();
209
- authClientEnabled = j1.Navigator.authClientEnabled();
210
- user_state = j1.getUserStateCookie();
206
+ appDetected = j1.appDetected();
207
+ authClientEnabled = j1.authClientEnabled();
211
208
 
212
- logger.info('Application status: ' + appDetected);
209
+ logger.info('Application status detected: ' + appDetected);
213
210
 
214
211
  // Run initializer functions
215
212
  logger.info('Load MenuBar and CSS styles');
216
- j1.Navigator.loadMenuBar( navMenuOptions );
217
- j1.Navigator.setCss( navBarOptions, navMenuOptions, navQuicklinksOptions, navTopsearchOptions, navSidebarOptions );
218
-
219
- // Detect|Enable AuthClient
220
- if ( appDetected && authClientEnabled ) {
221
- web_session_state = j1.getWebSessionCookie();
222
- user_state.provider_permissions = web_session_state.provider_permissions;
223
- web_session_state.cookies_accepted = user_state.cookies_accepted;
224
- $('#quickLinksSignInOutButton').css('display', 'block');
213
+ j1.Navigator.loadMenuBar( navMenuOptions );
214
+ j1.Navigator.setCss( navBarOptions, navMenuOptions, navQuicklinksOptions, navTopsearchOptions, navSidebarOptions );
225
215
 
226
- logger.info('Initialize AuthClient modals');
216
+ // Detect|Enable AuthClient
217
+ if ( appDetected ) {
218
+ logger.info('Load AuthClient modals');
227
219
  j1.Navigator.loadAuthClientModals( authConfig );
228
- } else {
229
- $('#quickLinksSignInOutButton').css('display', 'none');
230
- }
231
-
220
+
221
+ if ( authClientEnabled ) {
222
+ $('#quickLinksSignInOutButton').css('display', 'block');
223
+ } else {
224
+ $('#quickLinksSignInOutButton').css('display', 'none');
225
+ }
226
+ }
232
227
  // Set|Log status
233
228
  state = 'initialized';
234
229
  logger.info('state: ' + state);
@@ -276,7 +271,7 @@ j1.Navigator = (function (j1, window) {
276
271
  // Set processing to 'finished' to display page
277
272
  state = 'finished';
278
273
  logger.info('state: ' + state); // Set|Log status
279
-
274
+
280
275
  // Initialize theme selectors for J1Theme Switcher
281
276
  $('#ThemeList').bootstrapThemeSwitcher({localFeed: ''}); // Load from Bootswatch API
282
277
  $('#ThemeSelect').bootstrapThemeSwitcher(); // Load from localFeed
@@ -411,7 +406,7 @@ j1.Navigator = (function (j1, window) {
411
406
  var selector = $(id);
412
407
 
413
408
  if ( selector.length ) {
414
- var modals_data_path = authclient_modals_data_path + " > *";
409
+ var modals_data_path = authclient_modals_data_path + " > *";
415
410
  selector.load( modals_data_path, cb_load_closure( id ) );
416
411
  } else {
417
412
  var logText = "AuthClient Modals not loaded"
@@ -431,7 +426,7 @@ j1.Navigator = (function (j1, window) {
431
426
  // To be considered to re-add cookie updates for the auth state
432
427
  // -------------------------------------------------------------------------
433
428
  initAuthClient: function( options ) {
434
-
429
+
435
430
  var authConfig = options;
436
431
  var web_session_state = j1.getWebSessionCookie();
437
432
  var userAuthenticated = web_session_state.authenticated === 'true' ? true : false;
@@ -444,10 +439,10 @@ j1.Navigator = (function (j1, window) {
444
439
 
445
440
  j1.Navigator.modalEventHandler( authConfig );
446
441
 
447
- if ( j1.Navigator.appDetected() && j1.Navigator.authClientEnabled() ) {
442
+ if ( j1.appDetected() && j1.authClientEnabled() ) {
448
443
 
449
444
  // user_state = j1.getUserStateCookie();
450
- // web_session_state = j1.getWebSessionCookie();
445
+ // web_session_state = j1.getWebSessionCookie();
451
446
  // userAuthenticated = web_session_state.authenticated === 'true' ? true : false;
452
447
 
453
448
  // Toggle/Set SignIn/SignOut icon|link in QuickLinks
@@ -468,7 +463,7 @@ j1.Navigator = (function (j1, window) {
468
463
  // logger.info('Update cookies|sidebar');
469
464
  // j1.updateCookies( user_state );
470
465
  // j1.updateSidebar( user_state );
471
- }
466
+ }
472
467
 
473
468
  // Set|Log status
474
469
  state = 'initialized';
@@ -808,40 +803,7 @@ j1.Navigator = (function (j1, window) {
808
803
  });
809
804
 
810
805
  return true;
811
- }, // END delayMenushow
812
-
813
- // -------------------------------------------------------------------------
814
- // returns the state of the authClient
815
- // -------------------------------------------------------------------------
816
- authClientEnabled: function () {
817
-
818
- var authClientEnabled = {{site.j1_auth.enabled}};
819
- var hideOnCookiesDeclined = {{site.data.modules.j1_navigator.nav_authclient.hide_on_cookies_declined}};
820
- var user_state = j1.getUserStateCookie();
821
-
822
- if ( authClientEnabled ) {
823
- if (hideOnCookiesDeclined) {
824
- if ( user_state.cookies_accepted === 'declined' || user_state.cookies_accepted == 'pending') {
825
- return false;
826
- } else {
827
- return true;
828
- }
829
- } else {
830
- return true;
831
- }
832
- }
833
-
834
- return true;
835
- }, // END authClientEnabled
836
-
837
- // -------------------------------------------------------------------------
838
- // returns true if web session cookie exists
839
- // -------------------------------------------------------------------------
840
- appDetected: function () {
841
- var webSessionCookie = 'j1.web.session';
842
-
843
- return j1.existsCookie ( webSessionCookie );
844
- } // END appDetected
806
+ } // END delayMenushow
845
807
 
846
808
  }; // END return
847
809
  })(j1, window);
@@ -29,7 +29,7 @@ regenerate: true
29
29
  /*
30
30
  # -----------------------------------------------------------------------------
31
31
  # ~/assets/themes/j1/core/js/adapter/j1_template.js
32
- # JS Adapter for J1 Template
32
+ # Main JS Adapter for J1 Template
33
33
  #
34
34
  # Product/Info:
35
35
  # https://jekyll.one
@@ -56,9 +56,6 @@ regenerate: true
56
56
  {% assign environment = site.environment %}
57
57
  {% assign template_version = site.version %}
58
58
  {% assign hideOnReload = site.data.modules.j1_theme_switcher.hideOnReload %}
59
- {% assign flickerTimeout = site.data.modules.j1_theme_switcher.flicker_timeout %}
60
-
61
- {% unless flickerTimeout %} {% assign flickerTimeout = 250 %} {% endunless %}
62
59
 
63
60
  {% assign modules = site.data.modules %}
64
61
  {% assign banner_config = modules.j1_banner.banners %}
@@ -457,16 +454,17 @@ var j1 = function () {
457
454
  }, // END initClipboard
458
455
 
459
456
  // -------------------------------------------------------------------------
460
- // Show the page after timeout of {{hideOnReload}}
457
+ // Show the page after timeout of {{hideOnReload}} ms
461
458
  // Display the page if the (text) header is signaled as 'initialized'
462
459
  // AND the menubar is signaled as (state) 'finished'
463
460
  // -------------------------------------------------------------------------
464
461
  displayPage: function ( options ) {
465
462
  var settings = options;
463
+ var appDetected = j1.appDetected();
464
+ var authClientEnabled = j1.authClientEnabled();
466
465
  var user_state = {};
467
466
  var web_session_state = {};
468
- var appDetected = j1.Navigator.appDetected();
469
- var authClientEnabled = j1.Navigator.authClientEnabled();
467
+ var flickerTimeout = {{site.data.j1_config.flicker_timeout}}
470
468
  var logger;
471
469
 
472
470
  logger = log4javascript.getLogger('j1.Template.displayPage');
@@ -477,46 +475,50 @@ var j1 = function () {
477
475
 
478
476
  if ( j1.MastHead.state() === 'initialized' && j1.Navigator.state() === 'finished' ) {
479
477
 
480
- user_state = j1.getUserStateCookie();
481
-
482
- // Show or Hide cookie icon
483
- if ( user_state.cookies_accepted === 'accepted' ) {
484
- logText = 'Display cookie icon';
485
- logger.info(logText);
486
- // Display cookie icon
487
- $('#quickLinksCookieButton').css('display', 'block');
488
- } else {
489
- logText = 'Hide cookie icon';
490
- logger.info(logText);
491
- // Display cookie icon
492
- $('#quickLinksCookieButton').css('display', 'none');
493
- }
494
-
495
- // Show or Hide signin icon
496
- if ( appDetected && authClientEnabled ) {
497
- logText = 'Show signIn icon';
498
- logger.info(logText);
499
- $('#quickLinksSignInOutButton').css('display', 'block');
500
- } else {
501
- logText = 'Hide signIn icon';
502
- logger.info(logText);
503
- $('#quickLinksSignInOutButton').css('display', 'none');
504
- }
478
+ // pause the display of current page for flicker timeout [ms]
479
+ setTimeout( function() {
480
+ // display current page
481
+ $('#no_flicker').css('display', 'block');
482
+ user_state = j1.getUserStateCookie();
483
+
484
+ // Show or Hide cookie icon
485
+ if ( user_state.cookies_accepted === 'accepted' ) {
486
+ logText = 'Display cookie icon';
487
+ logger.info(logText);
488
+ // Display cookie icon
489
+ $('#quickLinksCookieButton').css('display', 'block');
490
+ } else {
491
+ logText = 'Hide cookie icon';
492
+ logger.info(logText);
493
+ // Display cookie icon
494
+ $('#quickLinksCookieButton').css('display', 'none');
495
+ }
505
496
 
506
- $('#no_flicker').css('display', 'block'); // display current page
507
- j1.scrollTo(); // scroll to an anchor element this page (if any)
497
+ // Show or Hide signin icon
498
+ if ( appDetected && authClientEnabled ) {
499
+ logText = 'Show signIn icon';
500
+ logger.info(logText);
501
+ $('#quickLinksSignInOutButton').css('display', 'block');
502
+ } else {
503
+ logText = 'Hide signIn icon';
504
+ logger.info(logText);
505
+ $('#quickLinksSignInOutButton').css('display', 'none');
506
+ }
508
507
 
509
- // Update sidebar
510
- logger.info('Update sidebar');
511
- j1.updateSidebar();
508
+ $('#no_flicker').css('display', 'block'); // display current page
509
+ j1.scrollTo(); // scroll to an anchor element this page (if any)
512
510
 
513
- // Set|Log status
514
- state = 'finished';
515
- logText = 'state: ' + state;
516
- logger.info(logText);
517
- logText = "J1 Template successfully initialized";
518
- logger.info(logText);
511
+ // Update sidebar
512
+ logger.info('Update sidebar');
513
+ j1.updateSidebar();
519
514
 
515
+ // Set|Log status
516
+ state = 'finished';
517
+ logText = 'state: ' + state;
518
+ logger.info(logText);
519
+ logText = "J1 Template successfully initialized";
520
+ logger.info(logText);
521
+ }, flickerTimeout );
520
522
  // clear interval checking
521
523
  clearInterval(headerLoaded);
522
524
  }
@@ -989,8 +991,8 @@ var j1 = function () {
989
991
  // -------------------------------------------------------------------------
990
992
  updateCookies: function ( data ) {
991
993
  var user_state = data;
992
- var appDetected = j1.Navigator.appDetected();
993
- var authClientEnabled = j1.Navigator.authClientEnabled();
994
+ var appDetected = j1.appDetected();
995
+ var authClientEnabled = j1.authClientEnabled();
994
996
  var cookiesDeclined = user_state.cookies_accepted === 'declined' ? true : false;
995
997
  var userAuthenticated;
996
998
  var web_session_state;
@@ -1081,7 +1083,42 @@ var j1 = function () {
1081
1083
  j1.updateMacros( user_state );
1082
1084
 
1083
1085
  return true;
1084
- } // END updateSidebar
1086
+ }, // END updateSidebar
1087
+
1088
+ // -------------------------------------------------------------------------
1089
+ // authClientEnabled:
1090
+ // Returns the state of the authClient
1091
+ // -------------------------------------------------------------------------
1092
+ authClientEnabled: function () {
1093
+
1094
+ var authClientEnabled = {{site.j1_auth.enabled}};
1095
+ var hideOnCookiesDeclined = {{site.data.modules.j1_navigator.nav_authclient.hide_on_cookies_declined}};
1096
+ var user_state = j1.getUserStateCookie();
1097
+
1098
+ if ( authClientEnabled ) {
1099
+ if (hideOnCookiesDeclined) {
1100
+ if ( user_state.cookies_accepted === 'declined' || user_state.cookies_accepted == 'pending') {
1101
+ return false;
1102
+ } else {
1103
+ return true;
1104
+ }
1105
+ } else {
1106
+ return true;
1107
+ }
1108
+ } else {
1109
+ return false;
1110
+ }
1111
+ }, // END authClientEnabled
1112
+
1113
+ // -------------------------------------------------------------------------
1114
+ // appDetected:
1115
+ // Returns true if a web session cookie exists
1116
+ // -------------------------------------------------------------------------
1117
+ appDetected: function () {
1118
+ var webSessionCookie = 'j1.web.session';
1119
+
1120
+ return j1.existsCookie ( webSessionCookie );
1121
+ } // END appDetected
1085
1122
 
1086
1123
  } // END j1 (return)
1087
1124
  }(j1, window);