j1-template 2021.1.5 → 2021.1.10
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 +4 -4
- data/_includes/themes/j1/modules/connectors/ads +18 -7
- data/_includes/themes/j1/modules/connectors/analytic/google-analytics.html +6 -6
- data/_includes/themes/j1/modules/connectors/analytics +17 -3
- data/_includes/themes/j1/modules/connectors/comments +22 -8
- data/_includes/themes/j1/modules/connectors/translator +20 -6
- data/_includes/themes/j1/procedures/global/select_location.proc +3 -3
- data/assets/data/themes.json +6 -6
- data/assets/error_pages/HTTP204.html +30 -10
- data/assets/error_pages/HTTP400.html +29 -8
- data/assets/error_pages/HTTP401.html +29 -9
- data/assets/error_pages/HTTP403.html +29 -8
- data/assets/error_pages/HTTP404.html +29 -8
- data/assets/error_pages/HTTP500.html +29 -8
- data/assets/error_pages/HTTP501.html +29 -8
- data/assets/error_pages/HTTP502.html +29 -8
- data/assets/error_pages/HTTP503.html +30 -8
- data/assets/themes/j1/adapter/js/cookieConsent.js +93 -56
- data/assets/themes/j1/adapter/js/fam.js +2 -1
- data/assets/themes/j1/adapter/js/j1.js +176 -170
- data/assets/themes/j1/adapter/js/navigator.js +157 -200
- 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/js/template.js +1 -1
- data/assets/themes/j1/core/js/template.js.map +1 -1
- data/assets/themes/j1/core/js/template.min.js +1 -1
- data/assets/themes/j1/core/js/template.min.js.map +1 -1
- data/assets/themes/j1/modules/cookieConsent/js/cookieConsent.js +25 -10
- data/assets/themes/j1/modules/cookieConsent/js/cookieConsent.min.js +5 -6
- 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/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 +34 -49
- data/assets/themes/j1/modules/themeSwitcher/js/switcher.min.js +410 -2
- 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 +18 -10
- data/lib/starter_web/_data/_defaults/private.default.yml +119 -0
- data/lib/starter_web/_data/j1_config.yml +21 -18
- data/lib/starter_web/_data/modules/cookieconsent.yml +1 -0
- data/lib/starter_web/_data/modules/defaults/cookieconsent.yml +10 -9
- data/lib/starter_web/_data/modules/defaults/themer.yml +2 -1
- data/lib/starter_web/_data/private.default.yml +119 -0
- data/lib/starter_web/_data/resources.yml +6 -7
- data/lib/starter_web/_includes/attributes.asciidoc +1 -1
- data/lib/starter_web/_plugins/lunr_index.rb +1 -1
- data/lib/starter_web/dot.gitignore +2 -2
- data/lib/starter_web/index.html +3 -3
- data/lib/starter_web/package.json +2 -2
- data/lib/starter_web/pages/public/blog/navigator/archive.html +5 -3
- data/lib/starter_web/pages/public/blog/navigator/archive/categoryview.html +3 -2
- data/lib/starter_web/pages/public/blog/navigator/archive/dateview.html +6 -4
- data/lib/starter_web/pages/public/blog/navigator/archive/tagview.html +23 -5
- data/lib/starter_web/pages/public/legal/en/300_privacy.adoc +9 -6
- data/lib/starter_web/utilsrv/_defaults/package.json +1 -1
- data/lib/starter_web/utilsrv/package.json +1 -1
- metadata +13 -65
- data/assets/error_pages/HTTP520.html +0 -68
- data/assets/error_pages/HTTP521.html +0 -68
- data/assets/error_pages/HTTP533.html +0 -68
- data/assets/themes/j1/modules/_lightGallery/css/core/lg-fb-comment-box.css +0 -58
- data/assets/themes/j1/modules/_lightGallery/css/core/lg-fb-comment-box.min.css +0 -5
- data/assets/themes/j1/modules/_lightGallery/css/core/lg-transitions.css +0 -778
- data/assets/themes/j1/modules/_lightGallery/css/core/lg-transitions.min.css +0 -5
- data/assets/themes/j1/modules/_lightGallery/css/core/lightgallery.css +0 -981
- data/assets/themes/j1/modules/_lightGallery/css/core/lightgallery.min.css +0 -5
- data/assets/themes/j1/modules/_lightGallery/css/fonts/lg.eot +0 -0
- data/assets/themes/j1/modules/_lightGallery/css/fonts/lg.svg +0 -47
- data/assets/themes/j1/modules/_lightGallery/css/fonts/lg.ttf +0 -0
- data/assets/themes/j1/modules/_lightGallery/css/fonts/lg.woff +0 -0
- data/assets/themes/j1/modules/_lightGallery/css/img/loading.gif +0 -0
- data/assets/themes/j1/modules/_lightGallery/css/img/video-play.png +0 -0
- data/assets/themes/j1/modules/_lightGallery/css/img/vimeo-play.png +0 -0
- data/assets/themes/j1/modules/_lightGallery/css/img/youtube-play.png +0 -0
- data/assets/themes/j1/modules/_lightGallery/css/themes/icons/animation-w.png +0 -0
- data/assets/themes/j1/modules/_lightGallery/css/themes/icons/customize-w.png +0 -0
- data/assets/themes/j1/modules/_lightGallery/css/themes/icons/dynamic-w.png +0 -0
- data/assets/themes/j1/modules/_lightGallery/css/themes/icons/facebook-icon.svg +0 -10
- data/assets/themes/j1/modules/_lightGallery/css/themes/icons/googleplus-icon.svg +0 -30
- data/assets/themes/j1/modules/_lightGallery/css/themes/icons/html5-w.png +0 -0
- data/assets/themes/j1/modules/_lightGallery/css/themes/icons/linked-in.png +0 -0
- data/assets/themes/j1/modules/_lightGallery/css/themes/icons/module-w.png +0 -0
- data/assets/themes/j1/modules/_lightGallery/css/themes/icons/play-button.png +0 -0
- data/assets/themes/j1/modules/_lightGallery/css/themes/icons/responsive-w.png +0 -0
- data/assets/themes/j1/modules/_lightGallery/css/themes/icons/thumb-w.png +0 -0
- data/assets/themes/j1/modules/_lightGallery/css/themes/icons/touch-w.png +0 -0
- data/assets/themes/j1/modules/_lightGallery/css/themes/icons/twitter-icon.svg +0 -15
- data/assets/themes/j1/modules/_lightGallery/css/themes/icons/twitter.png +0 -0
- data/assets/themes/j1/modules/_lightGallery/css/themes/icons/video1-w.png +0 -0
- data/assets/themes/j1/modules/_lightGallery/css/themes/icons/zoom-w.png +0 -0
- data/assets/themes/j1/modules/_lightGallery/css/themes/icons/zoom.png +0 -0
- data/assets/themes/j1/modules/_lightGallery/css/themes/uno.css +0 -262
- data/assets/themes/j1/modules/_lightGallery/css/themes/uno.min.css +0 -15
- data/assets/themes/j1/modules/_lightGallery/js/core/lightgallery.js +0 -1362
- data/assets/themes/j1/modules/_lightGallery/js/core/lightgallery.min.js +0 -4
- data/assets/themes/j1/modules/_lightGallery/js/modules/j1/j1-video.js +0 -402
- data/assets/themes/j1/modules/_lightGallery/js/modules/j1/j1-video.min.js +0 -8
- data/assets/themes/j1/modules/_lightGallery/js/modules/lg-autoplay.js +0 -206
- data/assets/themes/j1/modules/_lightGallery/js/modules/lg-autoplay.min.js +0 -5
- data/assets/themes/j1/modules/_lightGallery/js/modules/lg-fullscreen.js +0 -126
- data/assets/themes/j1/modules/_lightGallery/js/modules/lg-fullscreen.min.js +0 -5
- data/assets/themes/j1/modules/_lightGallery/js/modules/lg-hash.js +0 -101
- data/assets/themes/j1/modules/_lightGallery/js/modules/lg-hash.min.js +0 -5
- data/assets/themes/j1/modules/_lightGallery/js/modules/lg-pager.js +0 -105
- data/assets/themes/j1/modules/_lightGallery/js/modules/lg-pager.min.js +0 -5
- data/assets/themes/j1/modules/_lightGallery/js/modules/lg-share.js +0 -107
- data/assets/themes/j1/modules/_lightGallery/js/modules/lg-share.min.js +0 -5
- data/assets/themes/j1/modules/_lightGallery/js/modules/lg-thumbnail.js +0 -478
- data/assets/themes/j1/modules/_lightGallery/js/modules/lg-thumbnail.min.js +0 -5
- data/assets/themes/j1/modules/_lightGallery/js/modules/lg-video.js +0 -342
- data/assets/themes/j1/modules/_lightGallery/js/modules/lg-video.min.js +0 -5
- data/assets/themes/j1/modules/_lightGallery/js/modules/lg-zoom.js +0 -527
- data/assets/themes/j1/modules/_lightGallery/js/modules/lg-zoom.min.js +0 -5
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
# -----------------------------------------------------------------------------
|
3
|
-
# ~/assets/themes/j1/modules/bsThemeSwitcher/js/switcher.
|
3
|
+
# ~/assets/themes/j1/modules/bsThemeSwitcher/js/switcher.js
|
4
4
|
# Provides Javascript functions for Bootstrap ThemeSwitcher
|
5
5
|
#
|
6
6
|
# Product/Info:
|
@@ -15,7 +15,26 @@
|
|
15
15
|
# Bootstrap Theme Switcher is licensed under the MIT License.
|
16
16
|
# See: https://github.com/jguadagno/bootstrapThemeSwitcher
|
17
17
|
# -----------------------------------------------------------------------------
|
18
|
+
# NOTE: This modules is MODIFIED to be used with MobileMenu (mmenuLight).
|
19
|
+
# The original version cannot be used with J1 for theme menu creation!
|
20
|
+
# -----------------------------------------------------------------------------
|
18
21
|
*/
|
22
|
+
'use strict';
|
23
|
+
|
24
|
+
// -----------------------------------------------------------------------------
|
25
|
+
// ESLint shimming
|
26
|
+
// -----------------------------------------------------------------------------
|
27
|
+
/* eslint indent: "off" */
|
28
|
+
/* eslint no-console: ["error", { allow: ["log", "warn", "error"] }] */
|
29
|
+
/* eslint no-unused-vars: "off" */
|
30
|
+
/* eslint no-undef: "off" */
|
31
|
+
/* eslint no-useless-escape: "off" */
|
32
|
+
/* eslint no-prototype-builtins: "off" */
|
33
|
+
/* eslint no-shadow-restricted-names: "off" */
|
34
|
+
/* global jQuery */
|
35
|
+
/* global Cookies */
|
36
|
+
// -----------------------------------------------------------------------------
|
37
|
+
|
19
38
|
/**
|
20
39
|
* jQuery Twitter Bootstrap Theme Switcher v1.1.5
|
21
40
|
* https://github.com/jguadagno/bootstrapThemeSwitcher
|
@@ -23,4 +42,393 @@
|
|
23
42
|
* Copyright 2014, Joseph Guadagno
|
24
43
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
25
44
|
*/
|
26
|
-
|
45
|
+
|
46
|
+
(function ($, window, document, undefined) {
|
47
|
+
|
48
|
+
var old = $.fn.bootstrapThemeSwitcher;
|
49
|
+
|
50
|
+
var cookie_names = j1.getCookieNames();
|
51
|
+
const user_state_cookie_name = cookie_names.user_state;
|
52
|
+
|
53
|
+
var logger = log4javascript.getLogger('j1.core.switcher');
|
54
|
+
var logText;
|
55
|
+
|
56
|
+
var user_state_detected;
|
57
|
+
var j1_user_state = {};
|
58
|
+
var j1_user_state_json;
|
59
|
+
var j1_user_state_cookie;
|
60
|
+
|
61
|
+
// Constructor
|
62
|
+
// ---------------------------------------------------------------------------
|
63
|
+
var BootstrapThemeSwitcher = function (element, options) {
|
64
|
+
|
65
|
+
this.$element = $(element);
|
66
|
+
this.settings = $.extend({}, $.fn.bootstrapThemeSwitcher.defaults, options);
|
67
|
+
this.themesList = [];
|
68
|
+
|
69
|
+
// loading local themes
|
70
|
+
this.getThemes();
|
71
|
+
return this;
|
72
|
+
};
|
73
|
+
|
74
|
+
// Prototype
|
75
|
+
// ---------------------------------------------------------------------------
|
76
|
+
BootstrapThemeSwitcher.prototype = {
|
77
|
+
clear: function () {
|
78
|
+
logger.debug('bootstrapThemeSwitcher.clear');
|
79
|
+
return this.$element.each(function () {
|
80
|
+
this.$element.empty();
|
81
|
+
});
|
82
|
+
},
|
83
|
+
update: function () {
|
84
|
+
logger.debug('bootstrapThemeSwitcher.update');
|
85
|
+
this.getThemes();
|
86
|
+
},
|
87
|
+
|
88
|
+
// -------------------------------------------------------------------------
|
89
|
+
// checkStyleSheetByName
|
90
|
+
// -------------------------------------------------------------------------
|
91
|
+
checkStyleSheetByName: function (name) {
|
92
|
+
var found = false;
|
93
|
+
var test = '\/' + name + '\/';
|
94
|
+
var re = new RegExp(test, 'i');
|
95
|
+
|
96
|
+
for(var i = 0; i < document.styleSheets.length; i++){
|
97
|
+
if(re.test(document.styleSheets[i].href)){
|
98
|
+
found=true;
|
99
|
+
break;
|
100
|
+
}
|
101
|
+
}
|
102
|
+
return found;
|
103
|
+
},
|
104
|
+
|
105
|
+
// -------------------------------------------------------------------------
|
106
|
+
// switchTheme
|
107
|
+
// -------------------------------------------------------------------------
|
108
|
+
// NOTE:
|
109
|
+
// For J1 template, switchTheme set only the cookies contents. The theme
|
110
|
+
// switch is done by a page reload. The reload triggers the theme_generator
|
111
|
+
// to load theme CSS from cookies, finally.
|
112
|
+
// -------------------------------------------------------------------------
|
113
|
+
switchTheme: function (name, cssFile) {
|
114
|
+
|
115
|
+
var $this = $(this);
|
116
|
+
var settings = $.extend({}, $.fn.bootstrapThemeSwitcher.defaults, $this.data('bootstrapThemeSwitcher'));
|
117
|
+
var themeName;
|
118
|
+
var theme_css;
|
119
|
+
var theme_extension_css;
|
120
|
+
|
121
|
+
var id = settings.cssThemeLink;
|
122
|
+
var debug = settings.debug;
|
123
|
+
var includeCSS = this.settings.includeBootswatch;
|
124
|
+
|
125
|
+
// detect|set user state cookie
|
126
|
+
user_state_detected = j1.existsCookie ( 'j1.user.state' );
|
127
|
+
if ( user_state_detected ) {
|
128
|
+
logger.debug('cookie found: j1.user.state');
|
129
|
+
j1_user_state = j1.readCookie(user_state_cookie_name);
|
130
|
+
} else {
|
131
|
+
logger.error('cookie not found: j1.user.state');
|
132
|
+
}
|
133
|
+
|
134
|
+
themeName = j1_user_state.theme_name;
|
135
|
+
theme_css = j1_user_state.theme_css;
|
136
|
+
|
137
|
+
if (typeof cssFile === 'undefined') { cssFile = this.settings.defaultCssFile; }
|
138
|
+
if (typeof name === 'undefined') { name = cssFile; }
|
139
|
+
|
140
|
+
// check if theme is to be saved to cookie
|
141
|
+
if (settings.saveToCookie) {
|
142
|
+
if ( typeof Cookies === 'undefined' ) {
|
143
|
+
if ( debug === 'true' ) {
|
144
|
+
logger.error('cookies library not present');
|
145
|
+
}
|
146
|
+
return false;
|
147
|
+
}
|
148
|
+
|
149
|
+
j1_user_state.theme_name = name;
|
150
|
+
j1_user_state.theme_css = cssFile;
|
151
|
+
|
152
|
+
if (!(j1_user_state.theme_name.includes('Uno') || j1_user_state.theme_name == 'Bootstrap')) {
|
153
|
+
j1_user_state.theme_author = 'Bootswatch';
|
154
|
+
j1_user_state.theme_author_url = 'https://bootswatch.com/';
|
155
|
+
} else {
|
156
|
+
j1_user_state.theme_author = 'J1 Team';
|
157
|
+
j1_user_state.theme_author_url = 'https://jekyll.one/';
|
158
|
+
}
|
159
|
+
|
160
|
+
j1.writeCookie({
|
161
|
+
name: user_state_cookie_name,
|
162
|
+
data: j1_user_state
|
163
|
+
});
|
164
|
+
|
165
|
+
// force reload the page from the server (skip cache)
|
166
|
+
// and detect selected theme from cookie
|
167
|
+
location.reload(true);
|
168
|
+
} else {
|
169
|
+
logger.warn('write to cookie : disabled');
|
170
|
+
logger.warn('selected theme not activated: ' + name);
|
171
|
+
} // END if saveToCookie
|
172
|
+
|
173
|
+
}, // END switchTheme
|
174
|
+
|
175
|
+
// -------------------------------------------------------------------------
|
176
|
+
// loadThemeFromCookie
|
177
|
+
// -------------------------------------------------------------------------
|
178
|
+
loadThemeFromCookie: function (options) {
|
179
|
+
|
180
|
+
if ( typeof Cookies === 'undefined' ) {
|
181
|
+
logger.error('cookies library not present');
|
182
|
+
return false;
|
183
|
+
}
|
184
|
+
|
185
|
+
var settings = $.extend({}, $.fn.bootstrapThemeSwitcher.defaults, options);
|
186
|
+
|
187
|
+
// detect|set user state cookie
|
188
|
+
user_state_detected = j1.existsCookie ( 'j1.user.state' );
|
189
|
+
|
190
|
+
if ( user_state_detected ) {
|
191
|
+
logger.info('cookie found: j1.user.state');
|
192
|
+
j1_user_state = j1.readCookie(user_state_cookie_name);
|
193
|
+
} else {
|
194
|
+
logger.error('cookie not found: j1.user.state');
|
195
|
+
}
|
196
|
+
|
197
|
+
var themeName = j1_user_state.theme_name;
|
198
|
+
var themeCss = j1_user_state.theme_css;
|
199
|
+
this.switchTheme(themeName, themeCss);
|
200
|
+
|
201
|
+
}, // END loadThemeFromCookie
|
202
|
+
|
203
|
+
// -------------------------------------------------------------------------
|
204
|
+
// addTheme
|
205
|
+
// -------------------------------------------------------------------------
|
206
|
+
addTheme: function(name, cssFile, start, deleteCount) {
|
207
|
+
if (typeof start === 'undefined') { start = 0; }
|
208
|
+
if (typeof deleteCount === 'undefined') { deleteCount = 0; }
|
209
|
+
this.themesList.splice(start, deleteCount, {name: name, css: cssFile});
|
210
|
+
this.addThemesToControl();
|
211
|
+
}, // END addTheme
|
212
|
+
|
213
|
+
// -------------------------------------------------------------------------
|
214
|
+
// addThemesToControl
|
215
|
+
// -------------------------------------------------------------------------
|
216
|
+
addThemesToControl: function() {
|
217
|
+
if (typeof this.$element === 'undefined') {
|
218
|
+
logger.error('bootstrapThemeSelector|addThemesToControl: Element is undefined');
|
219
|
+
return false;
|
220
|
+
}
|
221
|
+
if (typeof this.themesList === 'undefined') {
|
222
|
+
logger.error('bootstrapThemeSelector|addThemesToControl: Themes is undefined');
|
223
|
+
return false;
|
224
|
+
}
|
225
|
+
|
226
|
+
// if BootSwatch excludes are set
|
227
|
+
if(this.settings.excludeBootswatch){
|
228
|
+
var excludeBootswatchs;
|
229
|
+
// split the string on ,
|
230
|
+
if(this.settings.excludeBootswatch.indexOf(',') !== -1){
|
231
|
+
excludeBootswatchs = this.settings.excludeBootswatch.replace(/ /g, '').split(',');
|
232
|
+
} else {
|
233
|
+
excludeBootswatchs = [];
|
234
|
+
excludeBootswatchs.push(this.settings.excludeBootswatch);
|
235
|
+
}
|
236
|
+
|
237
|
+
var tempThemeList = this.themesList;
|
238
|
+
$.each(tempThemeList, function (i, value) {
|
239
|
+
if(value && value.name){
|
240
|
+
if( $.inArray( value.name, excludeBootswatchs ) !== -1 ){
|
241
|
+
tempThemeList.splice(i,1);
|
242
|
+
}
|
243
|
+
}
|
244
|
+
});
|
245
|
+
this.themesList = tempThemeList;
|
246
|
+
}
|
247
|
+
|
248
|
+
var base = this;
|
249
|
+
|
250
|
+
if (this.$element.is('ul')) {
|
251
|
+
var $this = $(this);
|
252
|
+
var settings = $.extend({}, $.fn.bootstrapThemeSwitcher.defaults, $this.data('bootstrapThemeSwitcher'));
|
253
|
+
var id = settings.cssThemeLink;
|
254
|
+
var themeName;
|
255
|
+
var debug = settings.debug;
|
256
|
+
|
257
|
+
// detect|set user state cookie
|
258
|
+
user_state_detected = j1.existsCookie ( 'j1.user.state' );
|
259
|
+
if ( user_state_detected ) {
|
260
|
+
logger.debug('User state cookie found');
|
261
|
+
j1_user_state = j1.readCookie(user_state_cookie_name);
|
262
|
+
} else {
|
263
|
+
logger.error('User state NOT cookie found');
|
264
|
+
}
|
265
|
+
|
266
|
+
themeName = j1_user_state.theme_name;
|
267
|
+
|
268
|
+
if ( debug === 'true' ) {
|
269
|
+
logger.debug('bootstrapThemeSelector: UL element selected');
|
270
|
+
}
|
271
|
+
this.$element.empty();
|
272
|
+
|
273
|
+
var cssClass;
|
274
|
+
var iconColor = '#9E9E9E';
|
275
|
+
$.each(this.themesList, function (i, value) {
|
276
|
+
// Use DIFFERENT class for MobileMenu
|
277
|
+
//if (base.$element[0].id.includes('MMenu')) {
|
278
|
+
if (base.$element[0].id.includes('mmenu')) {
|
279
|
+
cssClass = 'mmenu-item';
|
280
|
+
} else {
|
281
|
+
cssClass = 'dropdown-item';
|
282
|
+
}
|
283
|
+
// Add class "active" to the current theme selected
|
284
|
+
if ( value.name === themeName ) {
|
285
|
+
// if (base.$element[0].id.includes('MMenu')) {
|
286
|
+
if (base.$element[0].id.includes('mmenu')) {
|
287
|
+
cssClass = 'mmenu-item active';
|
288
|
+
} else {
|
289
|
+
cssClass = 'dropdown-item active';
|
290
|
+
}
|
291
|
+
}
|
292
|
+
var li = $('<li />')
|
293
|
+
.attr('class',cssClass)
|
294
|
+
.append('<a href="#"><i class="mdi mdi-view-quilt mdi-18px mr-2" style="color: ' +iconColor+ '"></i>' +value.name+ '</a>')
|
295
|
+
.on('click', function () {
|
296
|
+
if (settings.loadFromBootswatch) {
|
297
|
+
base.switchTheme(value.name, value.css);
|
298
|
+
} else {
|
299
|
+
base.switchTheme(value.name, value.cssCdn);
|
300
|
+
}
|
301
|
+
// remove previous "active" class and apply to latest clicked element
|
302
|
+
$(this).parent().find('li').removeClass('active');
|
303
|
+
$(this).addClass('active');
|
304
|
+
});
|
305
|
+
base.$element.append(li);
|
306
|
+
});
|
307
|
+
|
308
|
+
} else if (this.$element.is('select')) {
|
309
|
+
logger.debug('bootstrapThemeSelector: SELECT element selected');
|
310
|
+
this.$element.empty();
|
311
|
+
|
312
|
+
var optionSelectedMarker;
|
313
|
+
$.each(this.themesList, function (i, value) {
|
314
|
+
optionSelectedMarker = null;
|
315
|
+
if ( value.name === themeName ) {
|
316
|
+
optionSelectedMarker = 'selected';
|
317
|
+
}
|
318
|
+
if (settings.loadFromBootswatch) {
|
319
|
+
base.$element.append('<option ' + optionSelectedMarker + ' value=\'' + value.css + '\'>' + value.name + '</option>');
|
320
|
+
} else {
|
321
|
+
base.$element.append('<option ' + optionSelectedMarker + ' value=\'' + value.cssCdn + '\'>' + value.name + '</option>');
|
322
|
+
}
|
323
|
+
});
|
324
|
+
this.$element.on('change', function () {
|
325
|
+
var optionSelected = $('option:selected', this);
|
326
|
+
base.switchTheme(optionSelected.text(), optionSelected.val());
|
327
|
+
});
|
328
|
+
|
329
|
+
} else {
|
330
|
+
// no container found to add Theme list
|
331
|
+
logger.info('bootstrapThemeSelector: no UL or SELECT element found');
|
332
|
+
logger.error('bootstrapThemeSelector: failed');
|
333
|
+
// console.warn('bootstrapThemeSelector only works with ul or select elements');
|
334
|
+
}
|
335
|
+
}, // END addThemesToControl
|
336
|
+
|
337
|
+
// -------------------------------------------------------------------------
|
338
|
+
// getThemes
|
339
|
+
// -------------------------------------------------------------------------
|
340
|
+
getThemes: function() {
|
341
|
+
var base = this;
|
342
|
+
|
343
|
+
if (this.settings.localFeed !== null && this.settings.localFeed !== '') {
|
344
|
+
// Deferred loading themes from local themes (json file)
|
345
|
+
$.ajax({
|
346
|
+
url: this.settings.localFeed,
|
347
|
+
// jadams 2016-10-10: removed the setting for sychronous XMLHttpRequest
|
348
|
+
// async: false,
|
349
|
+
dataType: 'json',
|
350
|
+
success: function (data) {
|
351
|
+
base.themesList = data.themes;
|
352
|
+
base.addThemesToControl();
|
353
|
+
},
|
354
|
+
error: function (jqXHR, textStatus, errorThrown) {
|
355
|
+
logger.error('Failed to retrieve the local feed from: \'' + base.settings.localFeed + '\'');
|
356
|
+
}
|
357
|
+
});
|
358
|
+
} else {
|
359
|
+
// Deferred loading remote themes from Bootswatch API
|
360
|
+
// -----------------------------------------------------------------------
|
361
|
+
$.ajax({
|
362
|
+
url: this.settings.bootswatchApiUrl + '/' + this.settings.bootswatchApiVersion + '.json',
|
363
|
+
// jadams 2016-10-10: removed the setting for sychronous XMLHttpRequest
|
364
|
+
// async: false,
|
365
|
+
dataType: 'json',
|
366
|
+
success: function (data) {
|
367
|
+
if (typeof data.themes === 'undefined') {
|
368
|
+
return null;
|
369
|
+
}
|
370
|
+
base.themesList = data.themes;
|
371
|
+
base.themesList.splice(0,0, {name: 'default', css: base.settings.defaultCssFile});
|
372
|
+
base.addThemesToControl();
|
373
|
+
}
|
374
|
+
});
|
375
|
+
}
|
376
|
+
}, // END getThemes
|
377
|
+
|
378
|
+
// -------------------------------------------------------------------------
|
379
|
+
// themes
|
380
|
+
// -------------------------------------------------------------------------
|
381
|
+
themes : function (newThemeList) {
|
382
|
+
if (typeof newThemeList === 'undefined') {
|
383
|
+
return this.themesList;
|
384
|
+
}
|
385
|
+
else {
|
386
|
+
// TODO: Set the associated control.
|
387
|
+
this.themesList = newThemeList;
|
388
|
+
}
|
389
|
+
} // END themes
|
390
|
+
|
391
|
+
}; // END prototype
|
392
|
+
|
393
|
+
// Plugin definition
|
394
|
+
// ---------------------------------------------------------------------------
|
395
|
+
$.fn.bootstrapThemeSwitcher = function (option) {
|
396
|
+
var methodReturn;
|
397
|
+
var args = Array.prototype.slice.call(arguments, 1);
|
398
|
+
var $this = $(this);
|
399
|
+
var data = $this.data('bootstrapThemeSwitcher');
|
400
|
+
var options = typeof option === 'object' && option;
|
401
|
+
|
402
|
+
if (!data) {
|
403
|
+
$this.data('bootstrapThemeSwitcher', (data = new BootstrapThemeSwitcher(this, options) ));
|
404
|
+
}
|
405
|
+
if (typeof option === 'string') {
|
406
|
+
methodReturn = data[ option ].apply(data, args);
|
407
|
+
}
|
408
|
+
return ( typeof methodReturn === 'undefined' ) ? $this : methodReturn;
|
409
|
+
};
|
410
|
+
|
411
|
+
$.fn.bootstrapThemeSwitcher.defaults = {
|
412
|
+
debug: false,
|
413
|
+
saveToCookie: true,
|
414
|
+
cssThemeLink: 'bootstrapTheme',
|
415
|
+
cookieThemeName: 'bootstrapTheme.name',
|
416
|
+
cookieThemeCss: 'boostrapTheme.css',
|
417
|
+
cookieExpiration: 365,
|
418
|
+
cookiePath: '/',
|
419
|
+
defaultCssFile: 'https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css',
|
420
|
+
bootswatchApiUrl: 'https://bootswatch.com/api/',
|
421
|
+
bootswatchApiVersion: '4',
|
422
|
+
loadFromBootswatch: true,
|
423
|
+
localFeed: '',
|
424
|
+
excludeBootswatch: ''
|
425
|
+
};
|
426
|
+
|
427
|
+
$.fn.bootstrapThemeSwitcher.Constructor = BootstrapThemeSwitcher;
|
428
|
+
|
429
|
+
$.fn.bootstrapThemeSwitcher.noConflict = function () {
|
430
|
+
$.fn.BootstrapThemeSwitcher = old;
|
431
|
+
return this;
|
432
|
+
};
|
433
|
+
|
434
|
+
})(jQuery, window, document);
|
data/lib/j1/version.rb
CHANGED
@@ -154,10 +154,9 @@ module J1App
|
|
154
154
|
# --------------------------------------------------------------------------
|
155
155
|
j1_mw_auth_mgr.info 'initialize web session cookie'
|
156
156
|
use Rack::Session::Cookie,
|
157
|
-
http_only: true,
|
157
|
+
http_only: true,
|
158
158
|
key: 'j1.app.session',
|
159
|
-
|
160
|
-
same_site: 'Lax',
|
159
|
+
same_site: 'Strict',
|
161
160
|
secret: ENV['J1_SESSION_SECRET'] || SecureRandom.hex
|
162
161
|
|
163
162
|
# use Rack::Cache do |config|
|
data/lib/starter_web/Gemfile
CHANGED
@@ -54,7 +54,7 @@ gem 'jekyll', '~> 4.2'
|
|
54
54
|
|
55
55
|
# Theme Rubies, default: J1 Template (NOT used for the development system)
|
56
56
|
#
|
57
|
-
gem 'j1-template', '~> 2021.1.
|
57
|
+
gem 'j1-template', '~> 2021.1.10'
|
58
58
|
|
59
59
|
# ------------------------------------------------------------------------------
|
60
60
|
# PRODUCTION: Gem needed for the Jekyll and J1 prod environment
|