j1-template 2022.0.12 → 2022.0.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/assets/themes/j1/adapter/js/advertising.js +61 -32
- data/assets/themes/j1/adapter/js/algolia.js +9 -9
- data/assets/themes/j1/adapter/js/analytics.js +46 -24
- data/assets/themes/j1/adapter/js/asciidoctor.js +9 -9
- data/assets/themes/j1/adapter/js/attic.js +9 -1
- data/assets/themes/j1/adapter/js/bmd.js +9 -10
- data/assets/themes/j1/adapter/js/carousel.js +9 -9
- data/assets/themes/j1/adapter/js/clipboard.js +8 -8
- data/assets/themes/j1/adapter/js/comments.js +31 -10
- data/assets/themes/j1/adapter/js/cookieConsent.js +70 -78
- data/assets/themes/j1/adapter/js/fab.js +10 -10
- data/assets/themes/j1/adapter/js/framer.js +59 -58
- data/assets/themes/j1/adapter/js/j1.js +139 -92
- data/assets/themes/j1/adapter/js/justifiedGallery.js +11 -10
- data/assets/themes/j1/adapter/js/justifiedGalleryCustomizer.js +9 -9
- data/assets/themes/j1/adapter/js/lightbox.js +11 -4
- data/assets/themes/j1/adapter/js/logger.js +10 -3
- data/assets/themes/j1/adapter/js/mmenu.js +9 -9
- data/assets/themes/j1/adapter/js/navigator.js +9 -9
- data/assets/themes/j1/adapter/js/quicksearch.js +9 -9
- data/assets/themes/j1/adapter/js/rouge.js +9 -9
- data/assets/themes/j1/adapter/js/rtable.js +9 -9
- data/assets/themes/j1/adapter/js/rtextResizer.js +9 -9
- data/assets/themes/j1/adapter/js/scroller.js +12 -7
- data/assets/themes/j1/adapter/js/themer.js +11 -2
- data/assets/themes/j1/adapter/js/toccer.js +9 -9
- data/assets/themes/j1/adapter/js/translator.js +13 -16
- data/assets/themes/j1/modules/advertising/js/google/adInitializer.js +14 -4
- data/lib/j1/version.rb +1 -1
- data/lib/starter_web/Gemfile +1 -1
- data/lib/starter_web/_config.yml +1 -1
- data/lib/starter_web/_data/layouts/home.ads.yml +262 -0
- data/lib/starter_web/_data/layouts/home.no-ads.yml +262 -0
- data/lib/starter_web/_data/layouts/home.yml +1 -1
- data/lib/starter_web/_data/modules/advertising.yml +1 -2
- data/lib/starter_web/_data/modules/analytics.yml +1 -1
- data/lib/starter_web/_data/modules/cookies.yml +0 -2
- data/lib/starter_web/_data/modules/defaults/advertising.yml +0 -1
- data/lib/starter_web/_data/modules/defaults/comments.yml +4 -4
- data/lib/starter_web/_data/modules/defaults/cookies.yml +104 -36
- data/lib/starter_web/_includes/attributes.asciidoc +1 -1
- data/lib/starter_web/_plugins/lunr_index.rb +1 -1
- data/lib/starter_web/collections/posts/public/featured/_posts/0000-00-00-welcome-to-j1.adoc.erb +1 -1
- data/lib/starter_web/collections/posts/public/featured/_posts/2021-01-01-about-cookies.adoc +1 -1
- data/lib/starter_web/collections/posts/public/featured/_posts/2021-01-01-about-cookies.ads.asciidoc +1 -1
- data/lib/starter_web/collections/posts/public/featured/_posts/2021-01-01-about-cookies.comments.asciidoc +1 -1
- data/lib/starter_web/collections/posts/public/featured/_posts/2021-02-01-site-generators.adoc +1 -1
- data/lib/starter_web/collections/posts/public/featured/_posts/2021-03-03-about-j1.adoc +1 -1
- data/lib/starter_web/collections/posts/public/series/_posts/2020-01-01-post-wiki-series.adoc +1 -1
- data/lib/starter_web/collections/posts/public/series/_posts/2020-01-02-post-wiki-series.adoc +1 -1
- data/lib/starter_web/collections/posts/public/series/_posts/2020-01-03-post-wiki-series.adoc +1 -1
- data/lib/starter_web/index.html +0 -3
- data/lib/starter_web/package.json +1 -1
- data/lib/starter_web/pages/public/manuals/dropdown-help.adoc +23 -2
- data/lib/starter_web/pages/public/previewer/preview_bootstrap_theme.adoc +100 -166
- data/lib/starter_web/utilsrv/_defaults/package.json +1 -1
- data/lib/starter_web/utilsrv/package.json +1 -1
- metadata +4 -2
@@ -60,8 +60,8 @@ regenerate: true
|
|
60
60
|
{% assign themer_defaults = modules.defaults.themer.defaults %}
|
61
61
|
{% assign themer_settings = modules.themer.settings %}
|
62
62
|
|
63
|
-
{% assign tracking_enabled =
|
64
|
-
{% assign tracking_id =
|
63
|
+
{% assign tracking_enabled = modules.analytics.enabled %}
|
64
|
+
{% assign tracking_id = modules.analytics.google.trackingID %}
|
65
65
|
|
66
66
|
{% assign authentication_defaults = modules.defaults.authentication.defaults %}
|
67
67
|
{% assign authentication_settings = modules.authentication.settings %}
|
@@ -134,24 +134,25 @@ var j1 = (function () {
|
|
134
134
|
// ---------------------------------------------------------------------------
|
135
135
|
// globals
|
136
136
|
// ---------------------------------------------------------------------------
|
137
|
-
var rePager
|
138
|
-
var environment
|
139
|
-
var moduleOptions
|
140
|
-
var j1_runtime_data
|
137
|
+
var rePager = new RegExp('navigator|dateview|tagview|archive');
|
138
|
+
var environment = '{{environment}}';
|
139
|
+
var moduleOptions = {};
|
140
|
+
var j1_runtime_data = {};
|
141
141
|
|
142
142
|
// Status information
|
143
|
-
var state
|
144
|
-
var mode
|
143
|
+
var state = 'not_started';
|
144
|
+
var mode = 'not_detected';
|
145
145
|
|
146
146
|
// Default tracking provider information
|
147
|
-
var tracking_enabled
|
148
|
-
var tracking_id
|
149
|
-
var tracking_id_valid
|
147
|
+
// var tracking_enabled = ('{{tracking_enabled}}' === 'true') ? true: false;
|
148
|
+
// var tracking_id = '{{tracking_id}}';
|
149
|
+
// var tracking_id_valid = (tracking_id.includes('tracking-id')) ? false : true;
|
150
150
|
|
151
151
|
// Default comment provider information
|
152
|
-
var comment_provider
|
153
|
-
var site_id
|
154
|
-
var
|
152
|
+
var comment_provider = '{{comment_provider}}';
|
153
|
+
var site_id = '{{site_id}}';
|
154
|
+
var checkCookies = {{cookie_options.checkCookies}};
|
155
|
+
var expireCookiesOnRequiredOnly = ('{{cookie_options.expireCookiesOnRequiredOnly}}' === 'true') ? true: false;
|
155
156
|
|
156
157
|
var current_user_data;
|
157
158
|
var current_page;
|
@@ -252,7 +253,15 @@ var j1 = (function () {
|
|
252
253
|
init: function (options) {
|
253
254
|
|
254
255
|
// -----------------------------------------------------------------------
|
255
|
-
//
|
256
|
+
// Default module settings
|
257
|
+
// -----------------------------------------------------------------------
|
258
|
+
var settings = $.extend({
|
259
|
+
module_name: 'j1',
|
260
|
+
generated: '{{site.time}}'
|
261
|
+
}, options);
|
262
|
+
|
263
|
+
// -----------------------------------------------------------------------
|
264
|
+
// Global variable settings
|
256
265
|
// -----------------------------------------------------------------------
|
257
266
|
var logger = log4javascript.getLogger('j1.init');
|
258
267
|
var url = new liteURL(window.location.href);
|
@@ -267,15 +276,6 @@ var j1 = (function () {
|
|
267
276
|
var j1Cookies = j1.findCookie('j1');
|
268
277
|
var themerOptions = $.extend({}, {{themer_options | replace: '=>', ':' | replace: 'nil', '""' }});
|
269
278
|
|
270
|
-
// -----------------------------------------------------------------------
|
271
|
-
// options loader
|
272
|
-
// -----------------------------------------------------------------------
|
273
|
-
var settings = $.extend({
|
274
|
-
foo: 'foo_option',
|
275
|
-
bar: 'bar_option'
|
276
|
-
},
|
277
|
-
options
|
278
|
-
);
|
279
279
|
// -----------------------------------------------------------------------
|
280
280
|
// status settings
|
281
281
|
// save status into the adapter object for (later) global access
|
@@ -348,7 +348,7 @@ var j1 = (function () {
|
|
348
348
|
|
349
349
|
// jadams, 2021-12-06: Check if access to cookies for this site failed.
|
350
350
|
// Possibly, a third-party domain or an attacker tries to access it.
|
351
|
-
if (
|
351
|
+
if (checkCookies) {
|
352
352
|
if (!user_state) {
|
353
353
|
logger.error('\n' + 'Access to cookie failed or cookie not found: ' + cookie_names.user_state);
|
354
354
|
logger.debug('\n' + 'j1 cookies found:' + j1Cookies.length);
|
@@ -358,10 +358,12 @@ var j1 = (function () {
|
|
358
358
|
}
|
359
359
|
|
360
360
|
if (!user_consent.analysis || !user_consent.personalization) {
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
361
|
+
if (expireCookiesOnRequiredOnly) {
|
362
|
+
// expire permanent cookies to session
|
363
|
+
j1.expireCookie({ name: cookie_names.user_state });
|
364
|
+
j1.expireCookie({ name: cookie_names.user_consent });
|
365
|
+
j1.expireCookie({ name: cookie_names.user_translate });
|
366
|
+
}
|
365
367
|
}
|
366
368
|
|
367
369
|
// initialize event handler for window/history/back on <ESC>
|
@@ -1509,22 +1511,19 @@ var j1 = (function () {
|
|
1509
1511
|
var baseUrl = url.origin;;
|
1510
1512
|
var hostname = url.hostname;
|
1511
1513
|
var auto_domain = hostname.substring(hostname.lastIndexOf('.', hostname.lastIndexOf('.') - 1) + 1);
|
1514
|
+
var auto_secure = (url.protocol.includes('https')) ? true : false;
|
1512
1515
|
var stringifiedAttributes = '';
|
1513
1516
|
var cookie_data = {};
|
1514
1517
|
var data_json;
|
1515
1518
|
var data_encoded;
|
1516
|
-
var expires;
|
1517
|
-
var domainAttribute;
|
1518
1519
|
|
1519
1520
|
var defaults = {
|
1520
|
-
|
1521
|
-
|
1522
|
-
|
1523
|
-
|
1524
|
-
|
1525
|
-
|
1526
|
-
http_only: '{{cookie_options.http_only}}',
|
1527
|
-
secure: '{{cookie_options.secure}}'
|
1521
|
+
path: '{{cookie_options.path}}',
|
1522
|
+
expires: '{{cookie_options.expires}}',
|
1523
|
+
domain: ('{{cookie_options.domain}}' === 'false') ? false : '{{cookie_options.domain}}',
|
1524
|
+
samesite: '{{cookie_options.same_site}}',
|
1525
|
+
http_only: ('{{cookie_options.http_only}}' === 'true'),
|
1526
|
+
secure: ('{{cookie_options.secure}}' === 'false') ? false : '{{cookie_options.secure}}'
|
1528
1527
|
};
|
1529
1528
|
var settings = $.extend(defaults, options);
|
1530
1529
|
|
@@ -1547,6 +1546,8 @@ var j1 = (function () {
|
|
1547
1546
|
data_encoded = window.btoa(data_json);
|
1548
1547
|
}
|
1549
1548
|
|
1549
|
+
// collect the cookie attributes
|
1550
|
+
// -----------------------------------------------------------------------
|
1550
1551
|
stringifiedAttributes += '; ' + 'Path=' + settings.path;
|
1551
1552
|
|
1552
1553
|
if (settings.expires > 0) {
|
@@ -1559,20 +1560,23 @@ var j1 = (function () {
|
|
1559
1560
|
// set domain used by cookies
|
1560
1561
|
if (settings.domain) {
|
1561
1562
|
if (settings.domain == 'auto') {
|
1562
|
-
|
1563
|
-
|
1564
|
-
|
1565
|
-
domainAttribute = settings.domain;
|
1566
|
-
stringifiedAttributes += '; ' + 'Domain=' + domainAttribute;
|
1563
|
+
stringifiedAttributes += '; ' + 'Domain=' + auto_domain;
|
1564
|
+
} else {
|
1565
|
+
stringifiedAttributes += '; ' + 'Domain=' + settings.domain;
|
1567
1566
|
}
|
1568
1567
|
}
|
1569
1568
|
|
1570
|
-
|
1571
|
-
|
1569
|
+
// set secure attribute
|
1570
|
+
if (settings.secure) {
|
1571
|
+
if (settings.secure == 'auto') {
|
1572
|
+
stringifiedAttributes += '; ' + 'Secure=' + auto_secure;
|
1573
|
+
} else {
|
1574
|
+
stringifiedAttributes += '; ' + 'Secure=' + settings.secure;
|
1575
|
+
}
|
1572
1576
|
}
|
1573
1577
|
|
1574
1578
|
// write the cookie
|
1575
|
-
//
|
1579
|
+
// -----------------------------------------------------------------------
|
1576
1580
|
document.cookie = settings.name + '=' + data_encoded + stringifiedAttributes;
|
1577
1581
|
|
1578
1582
|
if (j1.existsCookie(settings.name)) {
|
@@ -1580,14 +1584,13 @@ var j1 = (function () {
|
|
1580
1584
|
} else {
|
1581
1585
|
return false;
|
1582
1586
|
}
|
1583
|
-
|
1584
1587
|
},
|
1585
1588
|
|
1586
1589
|
// -------------------------------------------------------------------------
|
1587
1590
|
// findCookie (Vanilla JS)
|
1588
|
-
// Search for cookies (
|
1589
|
-
// name.
|
1590
|
-
// as a partial like 'j1'
|
1591
|
+
// Search for cookies (by name) in the page header that matches a given
|
1592
|
+
// (name) string. A cookie name can be given as full name, like 'j1.user.state',
|
1593
|
+
// or as a partial like 'j1'
|
1591
1594
|
// Returns all names found as an array.
|
1592
1595
|
// -------------------------------------------------------------------------
|
1593
1596
|
// See: https://stackoverflow.com/questions/52287989/javascript-cookie-remove-or-delete-with-regex-regular-expression
|
@@ -1603,31 +1606,51 @@ var j1 = (function () {
|
|
1603
1606
|
// removeCookie (Vanilla JS)
|
1604
1607
|
// -------------------------------------------------------------------------
|
1605
1608
|
removeCookie: function (options /*name, [path, domain]*/) {
|
1606
|
-
var
|
1609
|
+
var url = new liteURL(window.location.href);
|
1610
|
+
var baseUrl = url.origin;;
|
1611
|
+
var hostname = url.hostname;
|
1612
|
+
var auto_domain = hostname.substring(hostname.lastIndexOf('.', hostname.lastIndexOf('.') - 1) + 1);
|
1613
|
+
var auto_secure = (url.protocol.includes('https')) ? true : false;
|
1614
|
+
var stringifiedAttributes = '';
|
1607
1615
|
|
1608
1616
|
var defaults = {
|
1609
1617
|
path: '{{cookie_options.path}}',
|
1610
|
-
expires: '
|
1611
|
-
domain: '{{cookie_options.domain}}',
|
1618
|
+
expires: 'Thu, 01 Jan 1970 00:00:00 UTC', // clear cookies by settting the expiry date in the PAST
|
1619
|
+
domain: ('{{cookie_options.domain}}' === 'false') ? false : '{{cookie_options.domain}}',
|
1612
1620
|
samesite: '{{cookie_options.same_site}}',
|
1613
|
-
http_only: '{{cookie_options.http_only}}',
|
1614
|
-
secure: '{{cookie_options.secure}}'
|
1621
|
+
http_only: ('{{cookie_options.http_only}}' === 'true'),
|
1622
|
+
secure: ('{{cookie_options.secure}}' === 'false') ? false : '{{cookie_options.secure}}'
|
1615
1623
|
};
|
1616
|
-
var
|
1624
|
+
var settings = $.extend(defaults, options);
|
1617
1625
|
|
1618
|
-
|
1626
|
+
// collect the cookie attributes
|
1627
|
+
// -----------------------------------------------------------------------
|
1628
|
+
stringifiedAttributes += '; ' + 'Path=' + settings.path;
|
1629
|
+
stringifiedAttributes += '; ' + 'SameSite=' + settings.samesite;
|
1630
|
+
stringifiedAttributes += '; ' + 'Expires=' + settings.expires;
|
1619
1631
|
|
1620
1632
|
// set domain used by cookies
|
1621
|
-
if (settings.domain
|
1622
|
-
|
1623
|
-
|
1624
|
-
|
1625
|
-
|
1633
|
+
if (settings.domain) {
|
1634
|
+
if (settings.domain == 'auto') {
|
1635
|
+
stringifiedAttributes += '; ' + 'Domain=' + auto_domain;
|
1636
|
+
} else if (typeof settings.domain == 'string') {
|
1637
|
+
stringifiedAttributes += '; ' + 'Domain=' + settings.domain;
|
1638
|
+
}
|
1626
1639
|
}
|
1627
1640
|
|
1641
|
+
// set secure attribute
|
1642
|
+
if (settings.secure) {
|
1643
|
+
if (settings.secure == 'auto') {
|
1644
|
+
stringifiedAttributes += '; ' + 'Secure=' + auto_secure;
|
1645
|
+
} else {
|
1646
|
+
stringifiedAttributes += '; ' + 'Secure=' + settings.secure;
|
1647
|
+
}
|
1648
|
+
}
|
1649
|
+
|
1650
|
+
// clear|remove the cookie if exists
|
1651
|
+
// -----------------------------------------------------------------------
|
1628
1652
|
if (j1.findCookie(settings.name)) {
|
1629
|
-
|
1630
|
-
document.cookie = settings.name + '=; Domain=' + domainAttribute + '; Expires=Thu, 01 Jan 1970 00:00:00 UTC; Path=/;';
|
1653
|
+
document.cookie = settings.name + '=;' + stringifiedAttributes;
|
1631
1654
|
return true;
|
1632
1655
|
} else {
|
1633
1656
|
return false;
|
@@ -1642,49 +1665,71 @@ var j1 = (function () {
|
|
1642
1665
|
// automatically by the browser if the last session (browser tab|window)
|
1643
1666
|
// is closed.
|
1644
1667
|
// -------------------------------------------------------------------------
|
1645
|
-
// expireCookie() returns 'true' if cookie is set successfully
|
1646
|
-
// otherwise 'false' (e.g NOT found)
|
1668
|
+
// expireCookie() returns 'true' if cookie is set successfully
|
1669
|
+
// (to session), otherwise 'false' (e.g. NOT found)
|
1647
1670
|
// -------------------------------------------------------------------------
|
1648
1671
|
// NOTE:
|
1649
1672
|
// See: https://stackoverflow.com/questions/179355/clearing-all-cookies-with-javascript
|
1673
|
+
//
|
1650
1674
|
// NOTE:
|
1651
1675
|
// There is NO way you could get a trace of Path, Domain and other
|
1652
1676
|
// attributes of cookies as they are only read by browsers and NOT shown
|
1653
|
-
// to JavaScript. For that reason, attributes needs to be set explicitly
|
1677
|
+
// to JavaScript. For that reason, attributes needs to be set explicitly
|
1678
|
+
// to already KNOWN values.
|
1679
|
+
//
|
1654
1680
|
// -------------------------------------------------------------------------
|
1655
1681
|
expireCookie: function (options /*name [,path, samesite, secure]*/) {
|
1656
|
-
var url
|
1657
|
-
var baseUrl
|
1658
|
-
var hostname
|
1659
|
-
var
|
1660
|
-
var
|
1682
|
+
var url = new liteURL(window.location.href);
|
1683
|
+
var baseUrl = url.origin;;
|
1684
|
+
var hostname = url.hostname;
|
1685
|
+
var auto_domain = hostname.substring(hostname.lastIndexOf('.', hostname.lastIndexOf('.') - 1) + 1);
|
1686
|
+
var auto_secure = (url.protocol.includes('https')) ? true : false;
|
1687
|
+
var stringifiedAttributes = '';
|
1661
1688
|
|
1662
1689
|
var defaults = {
|
1663
1690
|
path: '{{cookie_options.path}}',
|
1664
1691
|
expires: '{{cookie_options.expires}}',
|
1665
|
-
domain: '{{cookie_options.domain}}',
|
1692
|
+
domain: ('{{cookie_options.domain}}' === 'false') ? false : '{{cookie_options.domain}}',
|
1666
1693
|
samesite: '{{cookie_options.same_site}}',
|
1667
|
-
http_only: '{{cookie_options.http_only}}',
|
1668
|
-
secure: '{{cookie_options.secure}}'
|
1694
|
+
http_only: ('{{cookie_options.http_only}}' === 'true'),
|
1695
|
+
secure: ('{{cookie_options.secure}}' === 'false') ? false : '{{cookie_options.secure}}'
|
1669
1696
|
};
|
1670
1697
|
var settings = $.extend(defaults, options);
|
1671
1698
|
|
1699
|
+
// collect the cookie attributes
|
1700
|
+
// -----------------------------------------------------------------------
|
1701
|
+
stringifiedAttributes += '; ' + 'Path=' + settings.path;
|
1702
|
+
stringifiedAttributes += '; ' + 'SameSite=' + settings.samesite;
|
1703
|
+
|
1672
1704
|
// set domain used by cookies
|
1673
|
-
if (settings.domain
|
1674
|
-
|
1675
|
-
|
1676
|
-
|
1677
|
-
|
1705
|
+
if (settings.domain) {
|
1706
|
+
if (settings.domain == 'auto') {
|
1707
|
+
stringifiedAttributes += '; ' + 'Domain=' + auto_domain;
|
1708
|
+
} else if (typeof settings.domain == 'string') {
|
1709
|
+
if (settings.domain !== 'false') {
|
1710
|
+
stringifiedAttributes += '; ' + 'Domain=' + settings.domain;
|
1711
|
+
}
|
1712
|
+
}
|
1713
|
+
}
|
1714
|
+
|
1715
|
+
// set secure attribute
|
1716
|
+
if (settings.secure) {
|
1717
|
+
if (settings.secure == 'auto') {
|
1718
|
+
stringifiedAttributes += '; ' + 'Secure=' + auto_secure;
|
1719
|
+
} else {
|
1720
|
+
stringifiedAttributes += '; ' + 'Secure=' + settings.secure;
|
1721
|
+
}
|
1678
1722
|
}
|
1679
1723
|
|
1680
|
-
var dc = document.cookie;
|
1681
|
-
var end = dc.length;
|
1682
|
-
var prefix = settings.name + '=';
|
1724
|
+
var dc = document.cookie; // all cookies in page
|
1725
|
+
var end = dc.length; // default to end of the string
|
1726
|
+
var prefix = settings.name + '='; // search string for the cookie name given
|
1683
1727
|
var begin = dc.indexOf('; ' + prefix);
|
1684
1728
|
var content = '';
|
1685
1729
|
|
1686
1730
|
// collect the cookie content
|
1687
|
-
//
|
1731
|
+
// -----------------------------------------------------------------------
|
1732
|
+
|
1688
1733
|
// found, and not in the first position
|
1689
1734
|
if (begin !== -1) {
|
1690
1735
|
// exclude the "; "
|
@@ -1702,20 +1747,17 @@ var j1 = (function () {
|
|
1702
1747
|
end = dc.indexOf(';', begin);
|
1703
1748
|
}
|
1704
1749
|
|
1705
|
-
//
|
1750
|
+
// write the cookie content, expire to session
|
1751
|
+
// -----------------------------------------------------------------------
|
1706
1752
|
content = decodeURI(dc.substring(begin + prefix.length, end) ).replace(/"/g, '');
|
1707
|
-
|
1708
|
-
document.cookie = settings.name + '=' + content +'; Path=' + settings.path + '; ' + 'SameSite=' + settings.samesite + '; ' + 'Domain=' + domainAttribute + '; Secure' + '; ';
|
1709
|
-
} else {
|
1710
|
-
document.cookie = settings.name + '=' + content +'; Path=' + settings.path + '; ' + 'SameSite=' + settings.samesite + '; ' + 'Domain=' + domainAttribute + '; ';
|
1711
|
-
}
|
1753
|
+
document.cookie = settings.name + '=' + content + stringifiedAttributes;
|
1712
1754
|
|
1713
1755
|
return true;
|
1714
1756
|
},
|
1715
1757
|
|
1716
1758
|
// -------------------------------------------------------------------------
|
1717
1759
|
// existsCookie (Vanilla JS)
|
1718
|
-
// returns true if a given
|
1760
|
+
// returns true if a cookie of given name exists
|
1719
1761
|
// -------------------------------------------------------------------------
|
1720
1762
|
existsCookie: function (name) {
|
1721
1763
|
var dc = document.cookie;
|
@@ -1725,6 +1767,9 @@ var j1 = (function () {
|
|
1725
1767
|
var cookieExists = false;
|
1726
1768
|
var cookieContent = '';
|
1727
1769
|
|
1770
|
+
// collect the cookie content
|
1771
|
+
// -----------------------------------------------------------------------
|
1772
|
+
|
1728
1773
|
// found, and not in first position
|
1729
1774
|
if (begin !== -1) {
|
1730
1775
|
// exclude the "; "
|
@@ -1742,6 +1787,8 @@ var j1 = (function () {
|
|
1742
1787
|
end = dc.indexOf(';', begin);
|
1743
1788
|
}
|
1744
1789
|
|
1790
|
+
// check if the cookie exists
|
1791
|
+
// -----------------------------------------------------------------------
|
1745
1792
|
cookieContent = decodeURI(dc.substring(begin + prefix.length, end) ).replace(/"/g, '');
|
1746
1793
|
cookieExists = cookieContent.length ? true : false;
|
1747
1794
|
|
@@ -100,16 +100,6 @@ j1.adapter.justifiedGallery = (function (j1, window) {
|
|
100
100
|
// -------------------------------------------------------------------------
|
101
101
|
init: function (options) {
|
102
102
|
|
103
|
-
{% comment %} Set global variables
|
104
|
-
-------------------------------------------------------------------------- {% endcomment %}
|
105
|
-
_this = j1.adapter.justifiedGallery;
|
106
|
-
logger = log4javascript.getLogger('j1.adapter.justifiedGallery');
|
107
|
-
|
108
|
-
// initialize state flag
|
109
|
-
_this.setState('started');
|
110
|
-
logger.info('\n' + 'state: ' + _this.getState());
|
111
|
-
logger.info('\n' + 'module is being initialized');
|
112
|
-
|
113
103
|
// -----------------------------------------------------------------------
|
114
104
|
// Default module settings
|
115
105
|
// -----------------------------------------------------------------------
|
@@ -118,6 +108,17 @@ j1.adapter.justifiedGallery = (function (j1, window) {
|
|
118
108
|
generated: '{{site.time}}'
|
119
109
|
}, options);
|
120
110
|
|
111
|
+
// -----------------------------------------------------------------------
|
112
|
+
// Global variable settings
|
113
|
+
// -----------------------------------------------------------------------
|
114
|
+
_this = j1.adapter.justifiedGallery;
|
115
|
+
logger = log4javascript.getLogger('j1.adapter.justifiedGallery');
|
116
|
+
|
117
|
+
// initialize state flag
|
118
|
+
_this.setState('started');
|
119
|
+
logger.info('\n' + 'state: ' + _this.getState());
|
120
|
+
logger.info('\n' + 'module is being initialized');
|
121
|
+
|
121
122
|
{% comment %} Load module config from yml data
|
122
123
|
-------------------------------------------------------------------------- {% endcomment %}
|
123
124
|
// Load module DEFAULTS|CONFIG
|
@@ -111,7 +111,15 @@ j1.adapter.justifiedGalleryCustomizer = (function (j1, window) {
|
|
111
111
|
init: function (options) {
|
112
112
|
|
113
113
|
// -----------------------------------------------------------------------
|
114
|
-
//
|
114
|
+
// Default module settings
|
115
|
+
// -----------------------------------------------------------------------
|
116
|
+
var settings = $.extend({
|
117
|
+
module_name: 'j1.adapter.justifiedGalleryCustomizer',
|
118
|
+
generated: '{{site.time}}'
|
119
|
+
}, options);
|
120
|
+
|
121
|
+
// -----------------------------------------------------------------------
|
122
|
+
// Global variable settings
|
115
123
|
// -----------------------------------------------------------------------
|
116
124
|
_this = j1.adapter.justifiedGalleryCustomizer;
|
117
125
|
logger = log4javascript.getLogger('j1.adapter.justifiedGalleryCustomizer');
|
@@ -121,14 +129,6 @@ j1.adapter.justifiedGalleryCustomizer = (function (j1, window) {
|
|
121
129
|
logger.info('\n' + 'state: ' + _this.getState());
|
122
130
|
logger.info('\n' + 'module is being initialized');
|
123
131
|
|
124
|
-
// -----------------------------------------------------------------------
|
125
|
-
// Default module settings
|
126
|
-
// -----------------------------------------------------------------------
|
127
|
-
var settings = $.extend({
|
128
|
-
module_name: 'j1.adapter.justifiedGalleryCustomizer',
|
129
|
-
generated: '{{site.time}}'
|
130
|
-
}, options);
|
131
|
-
|
132
132
|
{% comment %} Load gallery config from yml data
|
133
133
|
-------------------------------------------------------------------------- {% endcomment %}
|
134
134
|
/* eslint-disable */
|
@@ -102,16 +102,23 @@ j1.adapter.lightbox = (function (j1, window) {
|
|
102
102
|
// -------------------------------------------------------------------------
|
103
103
|
// Initializer
|
104
104
|
// -------------------------------------------------------------------------
|
105
|
-
init: function () {
|
106
|
-
// initialize state flag
|
107
|
-
j1.adapter.lightbox.state = 'pending';
|
105
|
+
init: function (options) {
|
108
106
|
|
109
107
|
// -----------------------------------------------------------------------
|
110
|
-
//
|
108
|
+
// Default module settings
|
109
|
+
// -----------------------------------------------------------------------
|
110
|
+
var settings = $.extend({
|
111
|
+
module_name: 'j1.adapter.lightbox',
|
112
|
+
generated: '{{site.time}}'
|
113
|
+
}, options);
|
114
|
+
|
115
|
+
// -----------------------------------------------------------------------
|
116
|
+
// Global variable settings
|
111
117
|
// -----------------------------------------------------------------------
|
112
118
|
_this = j1.adapter.lightbox;
|
113
119
|
logger = log4javascript.getLogger('j1.adapter.lightbox');
|
114
120
|
|
121
|
+
j1.adapter.lightbox.state = 'pending';
|
115
122
|
_this.setState('started');
|
116
123
|
logger.info('\n' + 'state: ' + _this.getState());
|
117
124
|
logger.info('\n' + 'module is being initialized');
|
@@ -175,7 +175,14 @@ j1.adapter.logger = (function (j1, window) {
|
|
175
175
|
// initialize state flag
|
176
176
|
j1.adapter.logger.state = 'started';
|
177
177
|
|
178
|
-
//
|
178
|
+
// -----------------------------------------------------------------------
|
179
|
+
// Default module settings
|
180
|
+
// -----------------------------------------------------------------------
|
181
|
+
var settings = $.extend({
|
182
|
+
module_name: 'j1.adapter.logger',
|
183
|
+
generated: '{{site.time}}'
|
184
|
+
}, options);
|
185
|
+
|
179
186
|
/* eslint-disable */
|
180
187
|
loggerOptions = $.extend({}, {{logger_options | replace: '=>', ':' | replace: 'nil', '""'}});
|
181
188
|
utilServerOptions = $.extend({}, {{util_server_options | replace: '=>', ':' | replace: 'nil', '""'}});
|
@@ -183,8 +190,8 @@ j1.adapter.logger = (function (j1, window) {
|
|
183
190
|
ajaxAppenderOptions = loggerOptions.appenders[1].appender;
|
184
191
|
|
185
192
|
// -----------------------------------------------------------------------
|
186
|
-
//
|
187
|
-
//
|
193
|
+
// Global variable settings
|
194
|
+
// -----------------------------------------------------------------------
|
188
195
|
_this = j1.adapter.logger;
|
189
196
|
logger = log4javascript.getLogger('j1.adapter.logger');
|
190
197
|
|
@@ -135,7 +135,15 @@ j1.adapter.mmenu = (function (j1, window) {
|
|
135
135
|
init: function (options) {
|
136
136
|
|
137
137
|
// -----------------------------------------------------------------------
|
138
|
-
//
|
138
|
+
// Default module settings
|
139
|
+
// -----------------------------------------------------------------------
|
140
|
+
var settings = $.extend({
|
141
|
+
module_name: 'j1.adapter.mmenu',
|
142
|
+
generated: '{{site.time}}'
|
143
|
+
}, options);
|
144
|
+
|
145
|
+
// -----------------------------------------------------------------------
|
146
|
+
// Global variable settings
|
139
147
|
// -----------------------------------------------------------------------
|
140
148
|
_this = j1.adapter.mmenu;
|
141
149
|
logger = log4javascript.getLogger('j1.adapter.mmenu');
|
@@ -145,14 +153,6 @@ j1.adapter.mmenu = (function (j1, window) {
|
|
145
153
|
logger.info('\n' + 'state: ' + _this.getState());
|
146
154
|
logger.info('\n' + 'module is being initialized');
|
147
155
|
|
148
|
-
// -----------------------------------------------------------------------
|
149
|
-
// defaults
|
150
|
-
// -----------------------------------------------------------------------
|
151
|
-
var settings = $.extend({
|
152
|
-
module_name: 'j1.adapter.mmenu',
|
153
|
-
generated: '{{site.time}}'
|
154
|
-
}, options);
|
155
|
-
|
156
156
|
// -----------------------------------------------------------------------
|
157
157
|
// options loader
|
158
158
|
// -----------------------------------------------------------------------
|
@@ -202,7 +202,15 @@ j1.adapter.navigator = (function (j1, window) {
|
|
202
202
|
init: function (options) {
|
203
203
|
|
204
204
|
// -----------------------------------------------------------------------
|
205
|
-
//
|
205
|
+
// Default module settings
|
206
|
+
// -----------------------------------------------------------------------
|
207
|
+
var settings = $.extend({
|
208
|
+
module_name: 'j1.adapter.navigator',
|
209
|
+
generated: '{{site.time}}'
|
210
|
+
}, options);
|
211
|
+
|
212
|
+
// -----------------------------------------------------------------------
|
213
|
+
// Global variable settings
|
206
214
|
// -----------------------------------------------------------------------
|
207
215
|
_this = j1.adapter.navigator;
|
208
216
|
logger = log4javascript.getLogger('j1.adapter.navigator');
|
@@ -212,14 +220,6 @@ j1.adapter.navigator = (function (j1, window) {
|
|
212
220
|
logger.info('\n' + 'state: ' + _this.getState());
|
213
221
|
logger.info('\n' + 'module is being initialized');
|
214
222
|
|
215
|
-
// -----------------------------------------------------------------------
|
216
|
-
// defaults
|
217
|
-
// -----------------------------------------------------------------------
|
218
|
-
var settings = $.extend({
|
219
|
-
module_name: 'j1.adapter.navigator',
|
220
|
-
generated: '{{site.time}}'
|
221
|
-
}, options);
|
222
|
-
|
223
223
|
// -----------------------------------------------------------------------
|
224
224
|
// options loader
|
225
225
|
// -----------------------------------------------------------------------
|
@@ -98,7 +98,15 @@ j1.adapter.quicksearch = (function (j1, window) {
|
|
98
98
|
init: function (options) {
|
99
99
|
|
100
100
|
// -----------------------------------------------------------------------
|
101
|
-
//
|
101
|
+
// Default module settings
|
102
|
+
// -----------------------------------------------------------------------
|
103
|
+
var settings = $.extend({
|
104
|
+
module_name: 'j1.adapter.quicksearch',
|
105
|
+
generated: '{{site.time}}'
|
106
|
+
}, options);
|
107
|
+
|
108
|
+
// -----------------------------------------------------------------------
|
109
|
+
// Global variable settings
|
102
110
|
// -----------------------------------------------------------------------
|
103
111
|
_this = j1.adapter.quicksearch;
|
104
112
|
logger = log4javascript.getLogger('j1.adapter.quicksearch');
|
@@ -108,14 +116,6 @@ j1.adapter.quicksearch = (function (j1, window) {
|
|
108
116
|
logger.info('\n' + 'state: ' + _this.getState());
|
109
117
|
logger.info('\n' + 'module is being initialized');
|
110
118
|
|
111
|
-
// -----------------------------------------------------------------------
|
112
|
-
// defaults
|
113
|
-
// -----------------------------------------------------------------------
|
114
|
-
var settings = $.extend({
|
115
|
-
module_name: 'j1.adapter.quicksearch',
|
116
|
-
generated: '{{site.time}}'
|
117
|
-
}, options);
|
118
|
-
|
119
119
|
// -----------------------------------------------------------------------
|
120
120
|
// options loader
|
121
121
|
// -----------------------------------------------------------------------
|
@@ -101,7 +101,15 @@ j1.adapter.rouge = (function (j1, window) {
|
|
101
101
|
init: function (options) {
|
102
102
|
|
103
103
|
// -----------------------------------------------------------------------
|
104
|
-
//
|
104
|
+
// Default module settings
|
105
|
+
// -----------------------------------------------------------------------
|
106
|
+
var settings = $.extend({
|
107
|
+
module_name: 'j1.adapter.rouge',
|
108
|
+
generated: '{{site.time}}'
|
109
|
+
}, options);
|
110
|
+
|
111
|
+
// -----------------------------------------------------------------------
|
112
|
+
// Global variable settings
|
105
113
|
// -----------------------------------------------------------------------
|
106
114
|
_this = j1.adapter.rouge;
|
107
115
|
logger = log4javascript.getLogger('j1.adapter.rouge');
|
@@ -111,14 +119,6 @@ j1.adapter.rouge = (function (j1, window) {
|
|
111
119
|
logger.info('\n' + 'state: ' + _this.getState());
|
112
120
|
logger.info('\n' + 'module is being initialized');
|
113
121
|
|
114
|
-
// -----------------------------------------------------------------------
|
115
|
-
// Default module settings
|
116
|
-
// -----------------------------------------------------------------------
|
117
|
-
var settings = $.extend({
|
118
|
-
module_name: 'j1.adapter.rouge',
|
119
|
-
generated: '{{site.time}}'
|
120
|
-
}, options);
|
121
|
-
|
122
122
|
// -----------------------------------------------------------------------
|
123
123
|
// rouge initializer
|
124
124
|
// -----------------------------------------------------------------------
|