j1-template 2023.0.2 → 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/layouts/content_generator_post.html +8 -2
- data/_includes/themes/j1/layouts/layout_metadata_generator.html +6 -0
- data/_includes/themes/j1/procedures/blocks/footer/boxes/social_media_icons.proc +22 -22
- 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 +7 -3
- data/assets/data/banner.html +29 -18
- data/assets/data/panel.html +166 -120
- data/assets/themes/j1/adapter/js/navigator.js +77 -303
- data/assets/themes/j1/adapter/js/themer.js +106 -81
- 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 +3 -3
- data/lib/starter_web/README.md +5 -5
- data/lib/starter_web/_config.yml +23 -26
- data/lib/starter_web/_data/blocks/banner.yml +2 -1
- data/lib/starter_web/_data/blocks/panel.yml +7 -2
- data/lib/starter_web/_data/modules/attics.yml +2 -2
- data/lib/starter_web/_data/modules/defaults/navigator.yml +2 -2
- data/lib/starter_web/_data/modules/scroller.yml +5 -5
- data/lib/starter_web/_data/modules/themer.yml +0 -1
- 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/icons/scalable/facebook.svg +34 -0
- data/lib/starter_web/assets/images/icons/scalable/google.svg +35 -0
- data/lib/starter_web/assets/images/icons/scalable/ibm.svg +24 -0
- data/lib/starter_web/assets/images/icons/scalable/microsoft.svg +42 -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 +2 -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 -11
- data/assets/themes/j1/core/css/icon-fonts/materialdesign-light.css +0 -1222
- data/assets/themes/j1/core/css/icon-fonts/materialdesign-light.min.css +0 -1
- data/assets/themes/j1/core/css/icon-fonts/materialdesign.css +0 -22307
- data/assets/themes/j1/core/css/icon-fonts/materialdesign.min.css +0 -1
- data/assets/themes/j1/core/css/icon-fonts/twemoji.css +0 -9499
- data/assets/themes/j1/core/css/icon-fonts/twemoji.min.css +0 -1
- data/assets/themes/j1/core/css/themes/theme_vapor/bootstrap.css +0 -8876
- data/assets/themes/j1/core/css/themes/theme_vapor/bootstrap.min.css +0 -5
@@ -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,99 +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
|
-
|
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);
|
281
312
|
}
|
282
|
-
}
|
283
|
-
}, 25); // END dependencies_met_theme_applied
|
284
313
|
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
}
|
314
|
+
// reload page using the default thme
|
315
|
+
location.reload(true);
|
316
|
+
}
|
317
|
+
});
|
290
318
|
clearInterval(dependencies_met_user_state_available);
|
291
319
|
}
|
320
|
+
}, 25); // END dependencies_met_user_state_available
|
292
321
|
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
logger.debug('\n' + '
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
//
|
307
|
-
logger.warn('\n' + 'redirect to home page');
|
308
|
-
// window.location.href = error_page;
|
309
|
-
window.location.href = '/';
|
310
|
-
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);
|
311
335
|
}
|
312
|
-
}, 25); // END
|
336
|
+
}, 25); // END dependencies_met_theme_applied
|
337
|
+
|
313
338
|
}, // END init
|
314
339
|
|
315
340
|
// -------------------------------------------------------------------------
|