j1_template 2019.4.7 → 2019.4.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. checksums.yaml +4 -4
  2. data/_includes/themes/j1/layouts/content_generator_collection.html +24 -9
  3. data/_includes/themes/j1/layouts/content_generator_page.html +24 -9
  4. data/_includes/themes/j1/layouts/content_generator_post.html +27 -15
  5. data/_includes/themes/j1/layouts/layout_theme_generator.html +39 -19
  6. data/_includes/themes/j1/layouts/layout_theme_generator.new.html +118 -0
  7. data/_includes/themes/j1/layouts/layout_theme_generator.org.html +119 -0
  8. data/_includes/themes/j1/procedures/global/pager.proc +49 -51
  9. data/lib/j1/version.rb +1 -1
  10. data/lib/j1_app/j1_auth_manager/auth_manager.rb +27 -29
  11. data/lib/j1_app/j1_auth_manager/views/auth_manager_ui.erb +12 -8
  12. data/lib/starter_web/Gemfile +1 -1
  13. data/lib/starter_web/_cc_test_data/_config.yml +1 -1
  14. data/lib/starter_web/_cc_test_data/_data/blocks/banner.yml +57 -0
  15. data/lib/starter_web/_cc_test_data/_data/blocks/defaults/banner.yml +55 -0
  16. data/lib/starter_web/_cc_test_data/_data/blocks/defaults/footer.yml +3 -3
  17. data/lib/starter_web/_cc_test_data/_data/blocks/defaults/panel.yml +30 -38
  18. data/lib/starter_web/_cc_test_data/_data/blocks/footer.yml +181 -110
  19. data/lib/starter_web/_cc_test_data/_data/modules/back2top.yml +1 -1
  20. data/lib/starter_web/_cc_test_data/_data/modules/defaults/smooth_scroll.yml +169 -0
  21. data/lib/starter_web/_cc_test_data/_data/modules/defaults/theme_switcher.yml +168 -0
  22. data/lib/starter_web/_cc_test_data/_data/modules/smooth_scroll.yml +169 -0
  23. data/lib/starter_web/_cc_test_data/_data/modules/theme_switcher.yml +168 -0
  24. data/lib/starter_web/_config.yml +74 -71
  25. data/lib/starter_web/_data/blocks/banner.yml +57 -0
  26. data/lib/starter_web/_data/blocks/defaults/banner.yml +55 -0
  27. data/lib/starter_web/_data/modules/{j1_navigator_menu.yml → _old_configs/j1_navigator_menu.yml} +0 -0
  28. data/lib/starter_web/_data/modules/{j1_parallax.yml → _old_configs/j1_parallax.yml} +0 -0
  29. data/lib/starter_web/_data/modules/{j1_smooth_scroll.yml → _old_configs/j1_smooth_scroll.yml} +0 -0
  30. data/lib/starter_web/_data/modules/{j1_stickybits.yml → _old_configs/j1_stickybits.yml} +0 -0
  31. data/lib/starter_web/_data/modules/{j1_theme_switcher.yml → _old_configs/j1_theme_switcher.yml} +0 -0
  32. data/lib/starter_web/_data/modules/{j1_toccer.yml → _old_configs/j1_toccer.yml} +0 -0
  33. data/lib/starter_web/_data/modules/defaults/smooth_scroll.yml +169 -0
  34. data/lib/starter_web/_data/modules/defaults/stickybits.yml +37 -0
  35. data/lib/starter_web/_data/modules/defaults/theme_switcher.yml +168 -0
  36. data/lib/starter_web/_data/modules/defaults/toccer.yml +172 -0
  37. data/lib/starter_web/_data/modules/navigator_menu.yml +306 -0
  38. data/lib/starter_web/_data/modules/smooth_scroll.yml +169 -0
  39. data/lib/starter_web/_data/modules/stickybits.yml +38 -0
  40. data/lib/starter_web/_data/modules/theme_switcher.yml +168 -0
  41. data/lib/starter_web/_data/modules/toccer.yml +172 -0
  42. data/lib/starter_web/_data/resources.yml +23 -24
  43. data/lib/starter_web/_data/template_settings.yml +2 -2
  44. data/lib/starter_web/assets/data/authclient.html +9 -9
  45. data/lib/starter_web/assets/data/banner.html +24 -19
  46. data/lib/starter_web/assets/data/cookie_consent.html +9 -9
  47. data/lib/starter_web/assets/data/footer.html +9 -10
  48. data/lib/starter_web/assets/data/menu.html +23 -16
  49. data/lib/starter_web/assets/data/panel.html +9 -10
  50. data/lib/starter_web/assets/data/sidebar.html +9 -10
  51. data/lib/starter_web/assets/data/webhook.html +8 -8
  52. data/lib/starter_web/assets/images/pages/roundtrip/package.json +1 -1
  53. data/lib/starter_web/assets/themes/j1/adapter/js/back2top.js +11 -9
  54. data/lib/starter_web/assets/themes/j1/adapter/js/cookie_consent.js +5 -5
  55. data/lib/starter_web/assets/themes/j1/adapter/js/logger.js +8 -18
  56. data/lib/starter_web/assets/themes/j1/adapter/js/master_header.js +48 -70
  57. data/lib/starter_web/assets/themes/j1/adapter/js/navigator.js +45 -27
  58. data/lib/starter_web/assets/themes/j1/adapter/js/octokit.app_only.js +433 -0
  59. data/lib/starter_web/assets/themes/j1/adapter/js/octokit.js +179 -192
  60. data/lib/starter_web/assets/themes/j1/adapter/js/scroller.js +29 -28
  61. data/lib/starter_web/assets/themes/j1/adapter/js/searcher.js +5 -5
  62. data/lib/starter_web/assets/themes/j1/adapter/js/stickybits.js +14 -13
  63. data/lib/starter_web/assets/themes/j1/adapter/js/switcher.js +56 -52
  64. data/lib/starter_web/assets/themes/j1/adapter/js/template.js +256 -213
  65. data/lib/starter_web/assets/themes/j1/adapter/js/toccer.js +24 -21
  66. data/lib/starter_web/assets/themes/j1/core/js/template.js +9 -9
  67. data/lib/starter_web/assets/themes/j1/core/js/template.js.map +1 -1
  68. data/lib/starter_web/assets/themes/j1/core/js/template.min.js +1 -1
  69. data/lib/starter_web/package.json +1 -1
  70. data/lib/starter_web/pages/public/start/downloads/quickstarter/100_linux_starter.adoc +1 -1
  71. data/lib/starter_web/pages/public/start/roundtrip/420_responsive_tables_extensions.adoc +5 -0
  72. data/lib/starter_web/utilsrv/_defaults/package.json +1 -1
  73. data/lib/starter_web/utilsrv/package.json +1 -1
  74. metadata +38 -9
  75. data/lib/starter_web/_data/resources.new.yml +0 -876
@@ -0,0 +1,433 @@
1
+ ---
2
+ regenerate: false
3
+ ---
4
+
5
+ {% capture cache %}
6
+
7
+ {% comment %}
8
+ # -----------------------------------------------------------------------------
9
+ # ~/assets/themes/j1/adapter/js/octokit.js
10
+ # Liquid template to adapt GH WebHooks Core functions
11
+ #
12
+ # Product/Info:
13
+ # https://jekyll.one
14
+ # Copyright (C) 2019 Juergen Adams
15
+ #
16
+ # J1 Template is licensed under the MIT License.
17
+ # For details, see https://jekyll.one
18
+ # -----------------------------------------------------------------------------
19
+ # Test data:
20
+ # {{ liquid_var | debug }}
21
+ # -----------------------------------------------------------------------------
22
+ {% endcomment %}
23
+
24
+ {% comment %} Liquid procedures
25
+ -------------------------------------------------------------------------------- {% endcomment %}
26
+
27
+ {% comment %} Set global settings
28
+ -------------------------------------------------------------------------------- {% endcomment %}
29
+ {% assign environment = site.environment %}
30
+ {% assign template_version = site.version %}
31
+
32
+ {% comment %} Process YML config data
33
+ ================================================================================ {% endcomment %}
34
+
35
+ {% comment %} Set config files
36
+ -------------------------------------------------------------------------------- {% endcomment %}
37
+ {% assign site_config = site %}
38
+ {% assign template_config = site.data.template_settings %}
39
+ {% assign blocks = site.data.blocks %}
40
+ {% assign modules = site.data.modules %}
41
+
42
+ {% comment %} Set config data
43
+ -------------------------------------------------------------------------------- {% endcomment %}
44
+ {% assign webhook_defaults = modules.defaults.webhook.defaults %}
45
+ {% assign webhook_settings = modules.webhook.settings %}
46
+
47
+ {% comment %} Set config options
48
+ -------------------------------------------------------------------------------- {% endcomment %}
49
+ {% assign webhook_options = webhook_defaults | merge: webhook_settings %}
50
+
51
+ /*
52
+ # -----------------------------------------------------------------------------
53
+ # ~/assets/themes/j1/adapter/js/octokit.js
54
+ # J1 Adapter for GH WebHooks
55
+ #
56
+ # Product/Info:
57
+ # https://jekyll.one
58
+ #
59
+ # Copyright (C) 2019 Juergen Adams
60
+ #
61
+ # J1 Template is licensed under the MIT License.
62
+ # For details, see https://jekyll.one
63
+ # -----------------------------------------------------------------------------
64
+ # Adapter generated: {{site.time}}
65
+ # -----------------------------------------------------------------------------
66
+ */
67
+ 'use strict';
68
+
69
+ {% comment %} Main
70
+ -------------------------------------------------------------------------------- {% endcomment %}
71
+ j1.adapter['octokit'] = (function (j1, window) {
72
+
73
+ {% comment %} Global variables
74
+ ------------------------------------------------------------------------------ {% endcomment %}
75
+ var environment = '{{environment}}'; // Set environment
76
+ var state = 'not_started';
77
+ var moduleOptions = {};
78
+ var logger;
79
+ var logText;
80
+ var _this;
81
+ var json_data;
82
+ var success;
83
+
84
+ // ---------------------------------------------------------------------------
85
+ // Main object
86
+ // ---------------------------------------------------------------------------
87
+ return {
88
+
89
+ // -------------------------------------------------------------------------
90
+ // Initializer
91
+ // -------------------------------------------------------------------------
92
+ init: function () {
93
+
94
+ {% comment %} Set global variables
95
+ -------------------------------------------------------------------------- {% endcomment %}
96
+ _this = j1.adapter.octokit;
97
+ logger = log4javascript.getLogger('j1.adapter.octokit');
98
+
99
+ {% comment %} Load module config from yml data
100
+ -------------------------------------------------------------------------- {% endcomment %}
101
+ // Load module DEFAULTS|CONFIG
102
+ moduleOptions = $.extend({}, {{webhook_options | replace: '=>', ':' | replace: 'nil', '""'}});
103
+
104
+ if ( moduleOptions.enabled ) {
105
+ {% comment %} Inialize WebHooks if page (j1) is FULLY initialized
106
+ ------------------------------------------------------------------------ {% endcomment %}
107
+ var appDetected = j1.getMode() === 'app' ? true : false;
108
+ var authClientEnabled = j1.authClientEnabled();
109
+
110
+ {% comment %} Deferred (AJAX) data load
111
+ -------------------------------------------------------------------- {% endcomment %}
112
+ if ( (appDetected && authClientEnabled) || environment === 'development' || environment === 'test' ) {
113
+ logger.info('WebHooks allowed. Run initialization');
114
+
115
+ // Set|Log status
116
+ state = 'initialize';
117
+ logger.info('state: ' + state);
118
+ logger.info('Module is being initialized');
119
+
120
+ // Load webhook modals
121
+ $.when( j1.xhrLoadData('j1.adapter.octokit', moduleOptions))
122
+ .then (function (success) {
123
+ if (success) {
124
+ {% comment %} Run initializers if webhook modals LOADED
125
+ ------------------------------------------------------------------ {% endcomment %}
126
+ var dataLoaded = setInterval(function() {
127
+ if ( j1.adapter.octokit.getState() == 'finished') {
128
+ // clear interval checking
129
+ clearInterval(dataLoaded);
130
+ logger.info('Loading modal HTML data finished');
131
+ // Run initializers
132
+ j1.core.octokit.init(moduleOptions);
133
+ j1.adapter.octokit.eventHandler(moduleOptions);
134
+ }
135
+ }, 25); // END 'dataLoaded'
136
+ } else {
137
+ logger.error('Loading modal HTML data failed');
138
+ state = j1.adapter.octokit.getState();
139
+ logger.info('state: ' + state);
140
+ }
141
+ });
142
+ } else {
143
+ logger.info('WebHooks not allowed. Check environmental settings');
144
+ }
145
+
146
+ return true;
147
+ } else {
148
+ logger.info('WebHooks disabled. Initialization skipped');
149
+ return false;
150
+ } // END if moduleOptions.enabled
151
+
152
+ }, // END init
153
+
154
+ // -------------------------------------------------------------------------
155
+ // EventHandler for J1 Octotokit client
156
+ // Manage button click events for all BS Modals
157
+ // See: https://www.nickang.com/add-event-listener-for-loop-problem-in-javascript/
158
+ // -------------------------------------------------------------------------
159
+ eventHandler: function ( options ) {
160
+ var message = {};
161
+ var logText;
162
+ var json_message;
163
+
164
+ logText = 'eventHandler: register events';
165
+ logger.debug(logText);
166
+
167
+ var modalButtons = document.querySelectorAll('a.btn');
168
+ if (modalButtons == 0) {
169
+ logger.warn('eventHandler: no modal buttons found to register');
170
+ }
171
+
172
+ // Register button click events for WebHook modals
173
+ // -------------------------------------------------------------------
174
+ modalButtons.forEach( function(button, index) {
175
+ button.addEventListener( 'click', function(e) {
176
+
177
+ // acceptGitPullButton
178
+ // ---------------------------------------------------------------
179
+ if (this.id === 'acceptGitPullButton') {
180
+ logger.info('User clicked acceptGitPullButton');
181
+
182
+ $.when( j1.xhrAPI('http://localhost:41001/git?request=pull') )
183
+ .then( function ( response ) {
184
+ json_message = JSON.stringify(response, undefined, 2);
185
+
186
+ logText = 'Response received: ' + json_message;
187
+ logger.info(logText);
188
+
189
+ if ( response.status === 'success' ) {
190
+ $('#gitPullSuccess').find('.pull-message').html(response.response);
191
+ $('#gitPullSuccess').modal('show');
192
+ }
193
+
194
+ });
195
+
196
+ // false == prevent further event propagation (bubble up)
197
+ // like preventDefault()
198
+ return false;
199
+ }
200
+
201
+ // declineGitPullButton
202
+ // ---------------------------------------------------------------
203
+ if (this.id === 'declineGitPullButton') {
204
+ logger.info('User clicked declineGitPullButton');
205
+
206
+ return false;
207
+ }
208
+
209
+ // acceptGitPullButton
210
+ // ---------------------------------------------------------------
211
+ if (this.id === 'acceptGitPullButton') {
212
+ logger.info('User clicked acceptGitPullButton');
213
+
214
+ // if ( options.git.pull.enabled ) {
215
+ // // Send commit message (silent mode)
216
+ // // -------------------------------------------------------------
217
+ // message.type = 'command'
218
+ // message.action = 'pull'
219
+ // message.text = 'Run Git pull'
220
+ //
221
+ // j1.sendMessage( 'j1.adapter.octokit', 'j1.core.octokit', message );
222
+ // }
223
+
224
+ return false;
225
+ };
226
+
227
+ // requestFailedOkButton
228
+ // ---------------------------------------------------------------
229
+ if (this.id === 'requestFailedOkButton') {
230
+ logger.info('User clicked requestFailedOkButton');
231
+
232
+ return false;
233
+ }
234
+
235
+ });
236
+ });
237
+
238
+
239
+ // Register pre/post events for modal 'webhookCommitDetected'
240
+ // -------------------------------------------------------------------
241
+ $(document).on('shown.bs.modal','#webhookCommitDetected',
242
+ function (e) {
243
+ logger.info('Display webhookCommitDetected');
244
+
245
+ // Autohide modal if configured
246
+ if ( options.commit_detection.modal_commit_detected.autohide) {
247
+ var modalTimeOut = setInterval(function() {
248
+ $('#webhookCommitDetected').modal('hide');
249
+ logger.info('Hide modal on timeout');
250
+ // clear interval checking
251
+ clearInterval(modalTimeOut);
252
+ }, options.commit_detection.modal_commit_detected.autohidden);
253
+ }
254
+
255
+ }); // END shown modal 'webhookCommitDetected'
256
+
257
+ $(document).on('hide.bs.modal','#webhookCommitDetected',
258
+ function (e) {
259
+ logger.info('Closed webhookCommitDetected');
260
+ }); // END hide modal 'webhookCommitDetected'
261
+
262
+
263
+ // Register pre/post events for modal 'gitPullSuccess'
264
+ // -------------------------------------------------------------------
265
+ $(document).on('shown.bs.modal','#gitPullSuccess',
266
+ function () {
267
+ logger.info('Display gitPullSuccess');
268
+
269
+ // Autohide modal if configured
270
+ if ( options.commit_detection.modal_pull_response.autohide) {
271
+ var modalTimeOut = setInterval(function() {
272
+ $('#gitPullSuccess').modal('hide');
273
+ logger.info('Hide modal on timeout');
274
+ // clear interval checking
275
+ clearInterval(modalTimeOut);
276
+ }, options.commit_detection.modal_pull_response.autohidden);
277
+ }
278
+
279
+ }); // END shown modal 'gitPullSuccess'
280
+
281
+ $(document).on('hidden.bs.modal','#gitPullSuccess',
282
+ function () {
283
+
284
+ logger.info('Post processing on gitPullSuccess');
285
+
286
+ if ( options.utility_server.npm_client.enabled ) {
287
+ if ( options.utility_server.npm_client.built.execute ) {
288
+ // Send commit message (silent mode)
289
+ // -------------------------------------------------------------
290
+ message.type = 'command'
291
+ message.action = 'built'
292
+ message.text = 'Run NPM built'
293
+ j1.sendMessage( 'j1.adapter.octokit', 'j1.core.octokit', message );
294
+ }
295
+ }
296
+
297
+ }); // END hidden modal 'gitPullSuccess'
298
+
299
+ // Register pre/post events for modal 'npmScriptSuccess'
300
+ // -------------------------------------------------------------------
301
+ $(document).on('shown.bs.modal','#npmScriptSuccess',
302
+ function () {
303
+ logger.info('Display npmScriptSuccess');
304
+
305
+ // Autohide modal if configured
306
+ if ( options.commit_detection.modal_pull_response.autohide) {
307
+ var modalTimeOut = setInterval(function() {
308
+ $('#npmScriptSuccess').modal('hide');
309
+ logger.info('Hide modal on timeout');
310
+ // clear interval checking
311
+ clearInterval(modalTimeOut);
312
+ }, options.commit_detection.modal_pull_response.autohidden);
313
+ }
314
+
315
+ }); // END shown modal 'npmScriptSuccess'
316
+
317
+ $(document).on('hidden.bs.modal','#npmScriptSuccess',
318
+ function () {
319
+ logger.info('Post processing on npmScriptSuccess');
320
+ }); // END hidden modal 'npmScriptSuccess'
321
+
322
+ logText = 'eventHandler: events registered';
323
+ logger.debug(logText);
324
+
325
+ return true;
326
+ }, // END eventHandler
327
+
328
+ // -------------------------------------------------------------------------
329
+ // messageHandler
330
+ // Manage messages send from other J1 modules
331
+ // -------------------------------------------------------------------------
332
+ messageHandler: function ( sender, message ) {
333
+ var json_message = JSON.stringify(message, undefined, 2);
334
+
335
+ logText = 'Received message from ' + sender + ': ' + json_message;
336
+ logger.debug(logText);
337
+
338
+ // -----------------------------------------------------------------------
339
+ // Process commands|actions
340
+ // -----------------------------------------------------------------------
341
+
342
+ // -----------------------------------------------------------------------
343
+ // Command message (action), type 'module_initialized'
344
+ if ( message.type === 'command' && message.action === 'module_initialized' ) {
345
+ _this.setState('finished');
346
+ logger.info(message.text);
347
+ }
348
+
349
+ // -----------------------------------------------------------------------
350
+ // Command message (action), type (Git) 'pull'
351
+ if ( message.type === 'command' && message.action === 'pull' ) {
352
+ var url = 'http://localhost:41001/git?request=pull';
353
+
354
+ logText = 'Processing message from ' + sender + ', type: ' + message.type + ', action: ' + message.action;
355
+ logger.info(logText);
356
+
357
+ $.when( j1.xhrAPI(url) )
358
+ .then( function( response ) {
359
+ json_message = JSON.stringify(response, undefined, 2);
360
+
361
+ logText = 'Response from xhrAPI received: ' + json_message;
362
+ logger.info(logText);
363
+
364
+ if ( response.status === 'success' ) {
365
+ $('#gitPullSuccess').find('.pull-message').html(response.response);
366
+ $('#gitPullSuccess').modal('show');
367
+ }
368
+
369
+ if ( response.status === 'failed' ) {
370
+ $('#requestFailed').find('.pull-message').html(response.response + response.error);
371
+ $('#requestFailed').modal('show');
372
+ }
373
+ });
374
+ } // ENDIF message action 'pull'
375
+
376
+ // -----------------------------------------------------------------------
377
+ // Process command message (action), type (NPM) 'built'
378
+ if ( message.type === 'command' && message.action === 'built' ) {
379
+ //var url = 'http://localhost:41001/npm?request=get_version';
380
+ var url = 'http://localhost:41001/npm?request=rebuilt';
381
+
382
+ logText = 'Processing message from ' + sender + ', type: ' + message.type + ', action: ' + message.action;
383
+ logger.info(logText);
384
+
385
+ $.when( j1.xhrAPI(url) )
386
+ .then( function( response ) {
387
+ json_message = JSON.stringify(response, undefined, 2);
388
+
389
+ logText = 'Response from xhrAPI received: ' + json_message;
390
+ logger.info(logText);
391
+
392
+ if ( response.status === 'success' ) {
393
+ $('#npmScriptSuccess').find('.pull-message').html(response.response);
394
+ $('#npmScriptSuccess').modal('show');
395
+ }
396
+
397
+ if ( response.status === 'failed' ) {
398
+ $('#requestFailed').find('.pull-message').html(response.response + response.error);
399
+ $('#requestFailed').modal('show');
400
+ }
401
+
402
+ });
403
+ } // END message action 'pull'
404
+
405
+ //
406
+ // Place handling of other command|action here
407
+ //
408
+
409
+ return true;
410
+ }, // END messageHandler
411
+
412
+ // -------------------------------------------------------------------------
413
+ // Set the current (processing) state of the module
414
+ // -------------------------------------------------------------------------
415
+ setState: function ( stat ) {
416
+ state = stat;
417
+ }, // END setState
418
+
419
+ // -------------------------------------------------------------------------
420
+ // Returns the current (processing) state of the module
421
+ // -------------------------------------------------------------------------
422
+ getState: function () {
423
+ return state;
424
+ } // END state
425
+
426
+ }; // END return
427
+
428
+ })(j1, window);
429
+
430
+ {% endcapture %}
431
+
432
+ {{ cache | strip_empty_lines }}
433
+ {% assign cache = nil %}