j1-template 2023.0.3 → 2023.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/_includes/themes/j1/layouts/content_generator_collection.html +26 -74
- data/_includes/themes/j1/procedures/collections/create_collection_article_preview.proc +64 -19
- data/_includes/themes/j1/procedures/collections/pager.proc +127 -0
- data/_includes/themes/j1/procedures/posts/pager.proc +4 -4
- data/assets/data/banner.html +2 -2
- data/assets/data/panel.html +130 -141
- data/assets/themes/j1/adapter/js/themer.js +106 -85
- data/assets/themes/j1/modules/themeSwitcher/js/_unsued/switcher.1.js +454 -0
- data/lib/j1/version.rb +1 -1
- data/lib/starter_web/Gemfile +1 -1
- data/lib/starter_web/README.md +5 -5
- data/lib/starter_web/_config.yml +16 -19
- data/lib/starter_web/_data/blocks/panel.yml +1 -1
- data/lib/starter_web/_data/modules/attics.yml +2 -2
- data/lib/starter_web/_data/modules/scroller.yml +5 -5
- data/lib/starter_web/_data/templates/feed.xml +1 -1
- data/lib/starter_web/_plugins/index/lunr.rb +1 -1
- data/lib/starter_web/assets/images/{triangles-bg.png → backgrounds/triangles-bg.png} +0 -0
- data/lib/starter_web/assets/images/{agency/img/logos → icons/scalable}/facebook.svg +0 -0
- data/lib/starter_web/assets/images/{agency/img/logos → icons/scalable}/google.svg +0 -0
- data/lib/starter_web/assets/images/{agency/img/logos → icons/scalable}/ibm.svg +0 -0
- data/lib/starter_web/assets/images/{agency/img/logos → icons/scalable}/microsoft.svg +0 -0
- data/lib/starter_web/collections/_biography/a-life-in-questions.adoc +98 -0
- data/lib/starter_web/collections/_biography/becoming.adoc +89 -0
- data/lib/starter_web/collections/_biography/born-to-run.adoc +92 -0
- data/lib/starter_web/collections/_biography/forty-autumns.adoc +91 -0
- data/lib/starter_web/collections/_biography/not-dead-yet.adoc +85 -0
- data/lib/starter_web/collections/_biography/princess-diarist-the.adoc +88 -0
- data/lib/starter_web/collections/_biography/when-breath-becomes-air.adoc +90 -0
- data/lib/starter_web/package.json +1 -1
- data/lib/starter_web/pages/public/blog/navigator/archive/allview.html +1 -0
- data/lib/starter_web/pages/public/blog/navigator/archive/categoryview.html +1 -0
- data/lib/starter_web/pages/public/blog/navigator/archive/dateview.html +1 -0
- data/lib/starter_web/pages/public/blog/navigator/archive/tagview.html +1 -0
- data/lib/starter_web/pages/public/blog/navigator/index.html +2 -1
- data/lib/starter_web/pages/public/bookshelf/viewer_biography.adoc +62 -0
- data/lib/starter_web/pages/public/bookshelf/whats_up.adoc +287 -0
- data/lib/starter_web/pages/public/previewer/preview_bootstrap_theme.adoc +1 -0
- data/lib/starter_web/utilsrv/_defaults/package.json +1 -1
- data/lib/starter_web/utilsrv/package.json +1 -1
- metadata +18 -36
- data/lib/starter_web/_includes/custom/agency/portfolio.html +0 -67
- data/lib/starter_web/_includes/custom/agency/services.html +0 -35
- data/lib/starter_web/_includes/custom/agency/team.html +0 -29
- data/lib/starter_web/assets/images/agency/img/about/1.jpg +0 -0
- data/lib/starter_web/assets/images/agency/img/about/2.jpg +0 -0
- data/lib/starter_web/assets/images/agency/img/about/3.jpg +0 -0
- data/lib/starter_web/assets/images/agency/img/about/4.jpg +0 -0
- data/lib/starter_web/assets/images/agency/img/close-icon.svg +0 -1
- data/lib/starter_web/assets/images/agency/img/header-bg.jpg +0 -0
- data/lib/starter_web/assets/images/agency/img/map-image.png +0 -0
- data/lib/starter_web/assets/images/agency/img/navbar-logo.svg +0 -1
- data/lib/starter_web/assets/images/agency/img/portfolio/1.jpg +0 -0
- data/lib/starter_web/assets/images/agency/img/portfolio/2.jpg +0 -0
- data/lib/starter_web/assets/images/agency/img/portfolio/3.jpg +0 -0
- data/lib/starter_web/assets/images/agency/img/portfolio/4.jpg +0 -0
- data/lib/starter_web/assets/images/agency/img/portfolio/5.jpg +0 -0
- data/lib/starter_web/assets/images/agency/img/portfolio/6.jpg +0 -0
- data/lib/starter_web/assets/images/agency/img/screenshot.png +0 -0
- data/lib/starter_web/assets/images/agency/img/team/1.jpg +0 -0
- data/lib/starter_web/assets/images/agency/img/team/2.jpg +0 -0
- data/lib/starter_web/assets/images/agency/img/team/3.jpg +0 -0
- data/lib/starter_web/pages/public/learn/mweb/mweb-tester.adoc +0 -299
- data/lib/starter_web/pages/public/learn/mweb/static/index.css +0 -237
- data/lib/starter_web/pages/public/learn/mweb/static/index.js +0 -1138
- data/lib/starter_web/pages/public/learn/mweb/static/lodash.min.js +0 -140
- data/lib/starter_web/pages/public/learn/mweb/static/socket.io/socket.io.js +0 -4570
- data/lib/starter_web/pages/public/learn/mweb/static/socket.io/socket.io.min.js +0 -7
- data/lib/starter_web/pages/public/learn/mweb/static/video-js.min.css +0 -1
- data/lib/starter_web/pages/public/learn/mweb/static/video.min.js +0 -26
data/assets/data/panel.html
CHANGED
@@ -224,149 +224,143 @@ exclude_from_search: true
|
|
224
224
|
<div class="container {{panel_settings.properties}}">
|
225
225
|
|
226
226
|
<!-- Heading -->
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
</div>
|
235
|
-
</div>
|
236
|
-
{% endif %}
|
237
|
-
|
238
|
-
{% if heading_position == 'center' %}
|
239
|
-
<div class="text-center mb-2">
|
240
|
-
<h2 class="mb-0 {{heading_translate}}">{{panel_settings.title}}</h2>
|
241
|
-
<p class="h4 mb-0 text-muted {{heading_translate}}"><i>{{panel_settings.tagline}}</i></p>
|
242
|
-
<div class="d-inline-block g-width-50 g-height-2 bg-primary mb-2"></div>
|
243
|
-
</div>
|
244
|
-
{% endif%}
|
227
|
+
{% if heading_position == 'left' %}
|
228
|
+
<div class="{{panel_settings.animate}} mb-2">
|
229
|
+
<h2 class="g-font-weight-500 mb-0 {{heading_translate}}">{{panel_settings.title}}</h2>
|
230
|
+
<p class="tagline mb-0 {{heading_translate}}"><b>{{panel_settings.tagline}}</b></p>
|
231
|
+
<div class="d-inline-block g-width-50 g-height-2 bg-primary mb-2"></div>
|
232
|
+
</div>
|
233
|
+
{% endif %}
|
245
234
|
|
246
|
-
|
247
|
-
|
235
|
+
{% if heading_position == 'center' %}
|
236
|
+
<div class="text-center mb-2">
|
237
|
+
<h2 class="mb-0 {{heading_translate}}">{{panel_settings.title}}</h2>
|
238
|
+
<p class="h4 mb-0 text-muted {{heading_translate}}"><i>{{panel_settings.tagline}}</i></p>
|
239
|
+
<div class="d-inline-block g-width-50 g-height-2 bg-primary mb-2"></div>
|
248
240
|
</div>
|
241
|
+
{% endif%}
|
242
|
+
|
243
|
+
<!-- Description -->
|
244
|
+
<div class="{{description_properties}}">{{panel_settings.description}}</div>
|
249
245
|
<!-- End Heading -->
|
250
246
|
|
251
247
|
<!-- Cards -->
|
252
248
|
<div class="card-deck {{panel_settings.id}}" style="display: none;">
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
{% endfor %}
|
273
|
-
{% if card_enabled == false %} {% assign card_items = card_items|minus:1 %} {% assign card_enabled = nil %} {% endif %}
|
274
|
-
{% endfor %}
|
275
|
-
{% assign col_size = 12|divided_by:card_items %}
|
276
|
-
|
277
|
-
{% include {{select_icon_size}} family=icon_family size=icon_size %}
|
278
|
-
{% assign icon_size = size %}
|
279
|
-
|
280
|
-
{% comment %} extract link for card icon
|
281
|
-
------------------------------------------------------------------ {% endcomment %}
|
282
|
-
{% for items in card_buttons %} {% for item in items %}
|
283
|
-
{% if item[0] == 'button' %}
|
284
|
-
{% for elm in item[1] %}
|
285
|
-
{% assign key = elm[0] %}
|
286
|
-
{% assign value = elm[1] %}
|
287
|
-
{% if key == 'href' %} {% assign card_href = value %} {% endif %}
|
249
|
+
{% assign card_items = cards|size %}
|
250
|
+
{% for card in cards %}
|
251
|
+
|
252
|
+
{% for items in card %}
|
253
|
+
{% for item in items[1] %}
|
254
|
+
{% assign key = item[0] %}
|
255
|
+
{% assign value = item[1] %}
|
256
|
+
{% if key == 'enabled' %} {% assign card_enabled = value %} {% endif %}
|
257
|
+
{% if key == 'type' %} {% assign card_type = value %} {% endif %}
|
258
|
+
{% if key == 'properties' %} {% assign card_properties = value %} {% endif %}
|
259
|
+
{% if key == 'icon' %} {% assign card_icon = value %} {% endif %}
|
260
|
+
{% if key == 'icon_size' %} {% assign card_icon_size = value %} {% endif %}
|
261
|
+
{% if key == 'icon_family' %} {% assign card_icon_family = value | downcase %} {% endif %}
|
262
|
+
{% if key == 'icon_color' %} {% assign card_icon_color = value %} {% endif %}
|
263
|
+
{% if key == 'title' %} {% assign card_title = value | strip_newlines%} {% endif %}
|
264
|
+
{% if key == 'title_translate' %} {% assign card_title_translate = value %} {% endif %}
|
265
|
+
{% if key == 'tagline' %} {% assign card_tagline = value | strip_newlines%} {% endif %}
|
266
|
+
{% if key == 'text' %} {% assign card_text = value | strip_newlines %} {% endif %}
|
267
|
+
{% if key == 'buttons' %} {% assign card_buttons = value %} {% endif %}
|
288
268
|
{% endfor %}
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
{%
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
269
|
+
{% if card_enabled == false %} {% assign card_items = card_items|minus:1 %} {% assign card_enabled = nil %} {% endif %}
|
270
|
+
{% endfor %}
|
271
|
+
{% assign col_size = 12|divided_by:card_items %}
|
272
|
+
|
273
|
+
{% include {{select_icon_size}} family=icon_family size=icon_size %}
|
274
|
+
{% assign icon_size = size %}
|
275
|
+
|
276
|
+
{% comment %} extract link for card icon
|
277
|
+
------------------------------------------------------------------ {% endcomment %}
|
278
|
+
{% for items in card_buttons %} {% for item in items %}
|
279
|
+
{% if item[0] == 'button' %}
|
280
|
+
{% for elm in item[1] %}
|
281
|
+
{% assign key = elm[0] %}
|
282
|
+
{% assign value = elm[1] %}
|
283
|
+
{% if key == 'href' %} {% assign card_href = value %} {% endif %}
|
284
|
+
{% endfor %}
|
285
|
+
{% endif %}
|
286
|
+
{% endfor %} {% endfor %}
|
287
|
+
|
288
|
+
{% if card_type == 'text' and card_enabled %}
|
289
|
+
{% assign card_raised = 'raised-z5' %}
|
290
|
+
<article class="card raised-z0 mb-3">
|
291
|
+
<div class="card-header bg-primary pt-2 pb-2">
|
292
|
+
<div class="d-flex flex-row align-items-center">
|
293
|
+
<div class="mr-3">
|
294
|
+
{% if card_icon_family == 'iconify' %}
|
306
295
|
{% if card_icon_color == 'bg-primary' %}
|
307
|
-
<
|
296
|
+
<span class="{{card_icon_family}} {{card_icon_family}}-{{card_icon_size}} iconify-md-bg-primary" data-icon="{{card_icon}}" data-inline="false"></span>
|
308
297
|
{% else %}
|
309
|
-
<
|
298
|
+
<span class="{{card_icon_family}} {{card_icon_family}}-{{card_icon_size}} {{card_icon_family}}-{{card_icon_color}}" data-icon="{{card_icon}}" data-inline="false"></span>
|
310
299
|
{% endif %}
|
311
|
-
|
312
|
-
|
300
|
+
{% else %}
|
301
|
+
<span>
|
302
|
+
{% if card_icon_color == 'bg-primary' %}
|
303
|
+
<i class="{{card_icon_family}} {{card_icon_family}}-{{card_icon}} {{card_icon_family}}-{{card_icon_size}} mdi-md-white"></i>
|
304
|
+
{% else %}
|
305
|
+
<i class="{{card_icon_family}} {{card_icon_family}}-{{card_icon}} {{card_icon_family}}-{{card_icon_size}} {{card_icon_family}}-{{card_icon_color}}"></i>
|
306
|
+
{% endif %}
|
307
|
+
</span>
|
308
|
+
{% endif %}
|
309
|
+
</div>
|
310
|
+
<h3 class="m-0 {{card_title_translate}}">{{card_title}}</h3>
|
313
311
|
</div>
|
314
|
-
<h3 class="m-0 {{card_title_translate}}">{{card_title}}</h3>
|
315
312
|
</div>
|
316
|
-
</div>
|
317
313
|
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
314
|
+
<div class="card-body g-min-height-200 r-text-300 mt-0">{{card_text}}</div>
|
315
|
+
<div class="card-footer r-text-200 md-grey-900 text-lowercase">
|
316
|
+
{% for data in card_buttons %} {% for item in data %} {% for button in item[1] %}
|
317
|
+
{% assign key = button[0] %}
|
318
|
+
{% assign value = button[1] %}
|
319
|
+
{% if key == 'text' %} {% assign button_text = value %} {% endif %}
|
320
|
+
{% if key == 'class' %} {% assign button_class = value %} {% endif %}
|
321
|
+
{% if key == 'icon' %} {% assign button_icon = value %} {% endif %}
|
322
|
+
{% if key == 'icon_family' %} {% assign button_icon_family = value %} {% endif %}
|
323
|
+
{% if key == 'icon_color' %} {% assign button_icon_color = value %} {% endif %}
|
324
|
+
{% if key == 'icon_size' %} {% assign button_icon_size = value %} {% endif %}
|
325
|
+
{% if key == 'href' %} {% assign button_href = value %} {% endif %}
|
326
|
+
{% if key == 'target' %} {% assign button_target = value %} {% endif %}
|
327
|
+
{% endfor %} {% endfor %} {% endfor %}
|
328
|
+
|
329
|
+
{% if button_target == null %}
|
330
|
+
<a class="card-link md-grey-900" href="{{button_href}}">{{readmore_text}} · {{button_text}}</a>
|
331
|
+
{% else %}
|
332
|
+
<a class="card-link md-grey-900" href="{{button_href}}" target="{{button_target}}">{{readmore_text}} · {{button_text}}</a>
|
333
|
+
{% endif %}
|
334
|
+
</div>
|
339
335
|
|
340
|
-
|
341
|
-
|
336
|
+
</article>
|
337
|
+
{% endif %}
|
342
338
|
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
339
|
+
<!-- Calculate 'column setters' to manage BS break points for 'responsive' card deck (rcard-deck) -->
|
340
|
+
{% assign sm = forloop.index | modulo: bs_card_deck.break_on_sm %}
|
341
|
+
{% assign md = forloop.index | modulo: bs_card_deck.break_on_md %}
|
342
|
+
{% assign lg = forloop.index | modulo: bs_card_deck.break_on_lg %}
|
343
|
+
{% assign xl = forloop.index | modulo: bs_card_deck.break_on_xl %}
|
348
344
|
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
345
|
+
<!-- Add 'column setters' for BS break points -->
|
346
|
+
{% if sm == 0 %}
|
347
|
+
<div class="w-100 d-none d-sm-block d-md-none"> <!-- break on sm --> </div>
|
348
|
+
{% endif %}
|
353
349
|
|
354
|
-
|
355
|
-
|
356
|
-
|
350
|
+
{% if md == 0 %}
|
351
|
+
<div class="w-100 d-none d-md-block d-lg-none"> <!-- break on md --> </div>
|
352
|
+
{% endif %}
|
357
353
|
|
358
|
-
|
359
|
-
|
360
|
-
|
354
|
+
{% if lg == 0 %}
|
355
|
+
<div class="w-100 d-none d-lg-block d-xl-none"> <!-- break on lg --> </div>
|
356
|
+
{% endif %}
|
361
357
|
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
358
|
+
{% if xl == 0 %}
|
359
|
+
<div class="w-100 d-none d-xl-block"> <!-- break on xl --> </div>
|
360
|
+
{% endif %}
|
361
|
+
{% endfor %}
|
366
362
|
</div>
|
367
363
|
<!-- End Cards -->
|
368
|
-
{% comment %} END cards
|
369
|
-
-------------------------------------------------------------------- {% endcomment %}
|
370
364
|
|
371
365
|
</div>
|
372
366
|
<!-- END main container -->
|
@@ -413,11 +407,10 @@ exclude_from_search: true
|
|
413
407
|
<div>
|
414
408
|
|
415
409
|
{% if heading_position == 'left' %}
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
</div>
|
410
|
+
<div class="{{panel_settings.animate}} mb-2">
|
411
|
+
<h2 class="g-font-weight-500 mb-0 {{heading_translate}}">{{panel_settings.title}}</h2>
|
412
|
+
<p class="tagline mb-0 {{heading_translate}}"><b>{{panel_settings.tagline}}</b></p>
|
413
|
+
<div class="d-inline-block g-width-50 g-height-2 bg-primary mb-2"></div>
|
421
414
|
</div>
|
422
415
|
{% endif %}
|
423
416
|
|
@@ -589,11 +582,10 @@ exclude_from_search: true
|
|
589
582
|
<div class="noclass">
|
590
583
|
|
591
584
|
{% if heading_position == 'left' %}
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
</div>
|
585
|
+
<div class="{{panel_settings.animate}} mb-2">
|
586
|
+
<h2 class="g-font-weight-500 mb-0 {{heading_translate}}">{{panel_settings.title}}</h2>
|
587
|
+
<p class="tagline mb-0 {{heading_translate}}"><b>{{panel_settings.tagline}}</b></p>
|
588
|
+
<div class="d-inline-block g-width-50 g-height-2 bg-primary mb-2"></div>
|
597
589
|
</div>
|
598
590
|
{% endif %}
|
599
591
|
|
@@ -762,11 +754,10 @@ exclude_from_search: true
|
|
762
754
|
<div>
|
763
755
|
|
764
756
|
{% if heading_position == 'left' %}
|
765
|
-
|
766
|
-
|
767
|
-
|
768
|
-
|
769
|
-
</div>
|
757
|
+
<div class="{{panel_settings.animate}} mb-2">
|
758
|
+
<h2 class="g-font-weight-500 mb-0 {{heading_translate}}">{{panel_settings.title}}</h2>
|
759
|
+
<p class="tagline mb-0 {{heading_translate}}"><b>{{panel_settings.tagline}}</b></p>
|
760
|
+
<div class="d-inline-block g-width-50 g-height-2 bg-primary mb-2"></div>
|
770
761
|
</div>
|
771
762
|
{% endif %}
|
772
763
|
|
@@ -779,9 +770,7 @@ exclude_from_search: true
|
|
779
770
|
{% endif%}
|
780
771
|
|
781
772
|
<!-- Description -->
|
782
|
-
<div class="{{panel_settings.description_properties}}">
|
783
|
-
{{panel_options.description}}
|
784
|
-
</div>
|
773
|
+
<div class="{{panel_settings.description_properties}}">{{panel_options.description}}</div>
|
785
774
|
|
786
775
|
</div>
|
787
776
|
<!-- End Heading -->
|
@@ -815,7 +804,7 @@ exclude_from_search: true
|
|
815
804
|
|
816
805
|
<!-- [INFO ] [~/assets/data/panel.html ] [ blocktype detected as: {{card_block}} ] -->
|
817
806
|
{% if card_block == 'card-list' %}
|
818
|
-
<div>
|
807
|
+
<div class="no-class">
|
819
808
|
<ul id="{{panel_settings.id}}-scroll-group" class="scroll-group scroll-group-horizontal align-items-stretch flex-wrap">
|
820
809
|
<!-- [INFO ] [~/assets/data/panel.html ] [ write post items (card_block == 'card-list')] -->
|
821
810
|
{% for post in site.posts %}
|
@@ -154,6 +154,22 @@ j1.adapter.themer = (function (j1, window) {
|
|
154
154
|
return false;
|
155
155
|
}
|
156
156
|
|
157
|
+
// see: https://stackoverflow.com/questions/4301968/checking-a-url-in-jquery-javascript
|
158
|
+
// see: https://stackoverflow.com/questions/16481598/prevent-unhandled-jquery-ajax-error
|
159
|
+
//
|
160
|
+
var urlExists = function(url, callback) {
|
161
|
+
if ( ! $.isFunction(callback)) {
|
162
|
+
throw Error('Not a valid callback');
|
163
|
+
}
|
164
|
+
|
165
|
+
$.ajax({
|
166
|
+
type: 'HEAD',
|
167
|
+
url: url,
|
168
|
+
success: $.proxy(callback, this, true),
|
169
|
+
error: $.proxy(callback, this, false)
|
170
|
+
});
|
171
|
+
};
|
172
|
+
|
157
173
|
// ---------------------------------------------------------------------------
|
158
174
|
// Main object
|
159
175
|
// ---------------------------------------------------------------------------
|
@@ -202,7 +218,7 @@ j1.adapter.themer = (function (j1, window) {
|
|
202
218
|
user_state = j1.readCookie(cookie_names.user_state);
|
203
219
|
user_consent = j1.readCookie(cookie_names.user_consent);
|
204
220
|
|
205
|
-
logger.
|
221
|
+
logger.debug('\n' + 'cookie ' + cookie_names.user_state + ' successfully loaded after: ' + interval_count * 25 + ' ms');
|
206
222
|
|
207
223
|
// initial theme data
|
208
224
|
if (user_state.theme_css === '') {
|
@@ -217,103 +233,108 @@ j1.adapter.themer = (function (j1, window) {
|
|
217
233
|
secure: secure,
|
218
234
|
expires: 365
|
219
235
|
});
|
236
|
+
|
220
237
|
if (!cookie_written) {
|
221
|
-
|
238
|
+
logger.error('\n' + 'failed to write cookie: ' + cookie_names.user_consent);
|
222
239
|
}
|
223
240
|
}
|
224
241
|
|
225
|
-
// check cookie consistency
|
226
|
-
// if (Object.keys(user_state).length > 2) {
|
227
|
-
// logger.debug('\n' + 'consistent state detected for cookie: ' + cookie_names.user_state);
|
228
|
-
// } else {
|
229
|
-
// logger.fatal('\n' + 'inconsistent state detected for cookie: ' + cookie_names.user_state);
|
230
|
-
// }
|
231
|
-
|
232
242
|
// set the theme switcher state
|
233
243
|
user_state.theme_switcher = themerOptions.enabled;
|
234
|
-
|
235
244
|
if (themerOptions.enabled) {
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
245
|
+
// enable BS ThemeSwitcher
|
246
|
+
logger.info('\n' + 'themes detected as: ' + themerOptions.enabled);
|
247
|
+
logger.info('\n' + 'remote themes are being initialized');
|
248
|
+
|
249
|
+
/* eslint-disable */
|
250
|
+
// load list of remote themes
|
251
|
+
$('#remote_themes').bootstrapThemeSwitcher.defaults = {
|
252
|
+
debug: themerOptions.debug,
|
253
|
+
saveToCookie: themerOptions.saveToCookie,
|
254
|
+
cssThemeLink: themerOptions.cssThemeLink,
|
255
|
+
cookieThemeName: themerOptions.cookieThemeName,
|
256
|
+
cookieDefaultThemeName: themerOptions.cookieDefaultThemeName,
|
257
|
+
cookieThemeCss: themerOptions.cookieThemeCss,
|
258
|
+
cookieThemeExtensionCss: themerOptions.cookieThemeExtensionCss,
|
259
|
+
cookieExpiration: themerOptions.cookieExpiration,
|
260
|
+
cookiePath: themerOptions.cookiePath,
|
261
|
+
defaultCssFile: themerOptions.defaultCssFile,
|
262
|
+
bootswatchApiUrl: themerOptions.bootswatchApiUrl,
|
263
|
+
bootswatchApiVersion: themerOptions.bootswatchApiVersion,
|
264
|
+
loadFromBootswatch: themerOptions.loadFromBootswatch,
|
265
|
+
localFeed: themerOptions.localThemes,
|
266
|
+
excludeBootswatch: themerOptions.excludeBootswatch,
|
267
|
+
includeBootswatch: themerOptions.includeBootswatch,
|
268
|
+
skipIncludeBootswatch: themerOptions.skipIncludeBootswatch
|
269
|
+
};
|
270
|
+
/* eslint-enable */
|
271
|
+
} else {
|
272
|
+
logger.warn('\n' + 'themes detected as: disabled');
|
273
|
+
logger.warn('\n' + 'no remote themes are available');
|
274
|
+
}
|
275
|
+
|
276
|
+
// validate theme to be loaded
|
277
|
+
urlExists(user_state.theme_css, function(success) {
|
278
|
+
// load theme
|
279
|
+
if (success) {
|
280
|
+
// continue processing if page is ready
|
281
|
+
var dependencies_met_theme_loaded = setInterval (function () {
|
282
|
+
if (j1.getState() == 'finished') {
|
283
|
+
theme_css_html = '<link rel="stylesheet" id="' + id + '" href="' + user_state.theme_css + '" type="text/css" />';
|
284
|
+
$('head').append(theme_css_html);
|
285
|
+
|
286
|
+
clearInterval(dependencies_met_theme_loaded);
|
287
|
+
}
|
288
|
+
}, 25); // END dependencies_met_theme_loaded
|
289
|
+
} else {
|
290
|
+
// invalid theme, fallback on default
|
291
|
+
logger.warn('\n' + 'themes CSS invalid: ' + user_state.theme_css);
|
292
|
+
theme_css_html = '<link rel="stylesheet" id="' + id + '" href="' + default_theme_css + '" type="text/css" />';
|
293
|
+
logger.warn('\n' + 'set default theme :' + default_theme_name);
|
294
|
+
logger.debug('\n' + 'theme CSS loaded: ' + default_theme_css);
|
295
|
+
$('head').append(theme_css_html);
|
296
|
+
|
297
|
+
// write theme defaults to cookie
|
298
|
+
user_state.theme_name = default_theme_name;
|
299
|
+
user_state.theme_css = default_theme_css;
|
300
|
+
user_state.theme_author = default_theme_author;
|
301
|
+
user_state.theme_author_url = default_theme_author_url;
|
302
|
+
|
303
|
+
cookie_written = j1.writeCookie({
|
304
|
+
name: cookie_names.user_state,
|
305
|
+
data: user_state,
|
306
|
+
secure: secure,
|
307
|
+
expires: 365
|
308
|
+
});
|
309
|
+
|
310
|
+
if (!cookie_written) {
|
311
|
+
logger.error('\n' + 'failed to write cookie: ' + cookie_names.user_consent);
|
285
312
|
}
|
286
|
-
}
|
287
|
-
}, 25); // END dependencies_met_theme_applied
|
288
313
|
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
// }
|
314
|
+
// reload page using the default thme
|
315
|
+
location.reload(true);
|
316
|
+
}
|
317
|
+
});
|
294
318
|
clearInterval(dependencies_met_user_state_available);
|
295
319
|
}
|
320
|
+
}, 25); // END dependencies_met_user_state_available
|
296
321
|
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
logger.debug('\n' + '
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
//
|
311
|
-
logger.warn('\n' + 'redirect to home page');
|
312
|
-
// window.location.href = error_page;
|
313
|
-
window.location.href = '/';
|
314
|
-
clearInterval(dependencies_met_user_state_available);
|
322
|
+
// set final module state if theme loaded
|
323
|
+
var dependencies_met_theme_applied = setInterval (function () {
|
324
|
+
user_state = j1.readCookie(cookie_names.user_state);
|
325
|
+
styleLoaded = styleSheetLoaded(user_state.theme_css);
|
326
|
+
|
327
|
+
if (styleLoaded) {
|
328
|
+
logger.info('\n' + 'theme loaded successfully: ' + user_state.theme_name);
|
329
|
+
logger.debug('\n' + 'theme CSS loaded: ' + user_state.theme_css);
|
330
|
+
_this.setState('finished');
|
331
|
+
logger.debug('\n' + 'state: ' + _this.getState());
|
332
|
+
logger.info('\n' + 'module initialized successfully');
|
333
|
+
|
334
|
+
clearInterval(dependencies_met_theme_applied);
|
315
335
|
}
|
316
|
-
}, 25); // END
|
336
|
+
}, 25); // END dependencies_met_theme_applied
|
337
|
+
|
317
338
|
}, // END init
|
318
339
|
|
319
340
|
// -------------------------------------------------------------------------
|