j1-template 2022.3.2 → 2022.4.1
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/j1.js +150 -75
- data/assets/themes/j1/adapter/js/nbinteract.js +18 -7
- data/assets/themes/j1/adapter/js/rangeSlider.js +27 -10
- data/assets/themes/j1/modules/nbInteract/js/nbinteract/nbinteract-core.js +1 -1
- data/assets/themes/j1/modules/nbInteract/js/nbinteract/nbinteract-core.js.map +1 -1
- data/assets/themes/j1/modules/nbInteract/js/nbinteract/nbinteract-core.min.js +1 -1
- data/assets/themes/j1/modules/rangeSlider/css/theme/uno/nouislider.css +5 -0
- data/assets/themes/j1/modules/rangeSlider/css/theme/uno/nouislider.min.css +1 -1
- data/lib/j1/version.rb +3 -3
- data/lib/starter_web/Gemfile +1 -1
- data/lib/starter_web/_config.yml +1 -1
- data/lib/starter_web/_data/j1_config.yml +22 -7
- data/lib/starter_web/_data/modules/defaults/nbinteract.yml +8 -0
- data/lib/starter_web/_data/modules/rangeSlider.yml +38 -1
- data/lib/starter_web/_plugins/asciidoctor-extensions/range-slider-block.rb +44 -0
- data/lib/starter_web/_plugins/lunr_index.rb +1 -1
- data/lib/starter_web/package.json +1 -1
- data/lib/starter_web/pages/public/jupyter/notebooks/j1/j1_odes_in_python.ipynb +16 -16
- data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/j1_interactive_widgets.html +919 -919
- data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/j1_odes_in_python.html +10 -10
- data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/nbi_docs_recipes_graphing.html +473 -473
- data/lib/starter_web/pages/public/previewer/preview_bootstrap_theme.adoc +2 -2
- data/lib/starter_web/utilsrv/_defaults/package.json +1 -1
- data/lib/starter_web/utilsrv/package.json +1 -1
- metadata +3 -7
- data/assets/themes/j1/modules/nbInteract/js/nbinteract/_new/nbinteract-core.js +0 -94
- data/assets/themes/j1/modules/nbInteract/js/nbinteract/_new/nbinteract-core.js.map +0 -1
- data/assets/themes/j1/modules/nbInteract/js/nbinteract/_old/j1-nbinteract-core.js +0 -94
- data/assets/themes/j1/modules/nbInteract/js/nbinteract/_old/j1-nbinteract-core.js.map +0 -1
- data/lib/starter_web/pages/public/se/se-fake.adoc +0 -47
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e07e5eb997a7a0078e71f6bd8efd0fd907e0cc59d887a8cfb8f153b38b9ca6b
|
4
|
+
data.tar.gz: cc7938b1eaf98b964aa829eb310c67cc420a3d9b336f0dcc55558e5217a64409
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f58244f65fb65a5ad1bd4399cd01ed45c450842f167056409b63a473d07b259a64b8fd4fc8767b0c95f68a726d9f504102ba3fa7b65a4332467811de6d6adcd
|
7
|
+
data.tar.gz: 60ae440d39596a2887e254110379bd2525614c6612f30d7f7a8c1a6bac007f592cdf1d67f9184a1d0c20a84025c9407ec2567fab0650c649273e1acb3d2bb0a9
|
@@ -134,26 +134,41 @@ var j1 = (function () {
|
|
134
134
|
// ---------------------------------------------------------------------------
|
135
135
|
// globals
|
136
136
|
// ---------------------------------------------------------------------------
|
137
|
+
// base page resources
|
137
138
|
var rePager = new RegExp('navigator|dateview|tagview|archive');
|
138
139
|
var environment = '{{environment}}';
|
139
140
|
var moduleOptions = {};
|
140
141
|
var j1_runtime_data = {};
|
142
|
+
var _this;
|
143
|
+
var settings;
|
144
|
+
var json_data;
|
145
|
+
var ep;
|
146
|
+
var baseUrl;
|
147
|
+
var referrer;
|
141
148
|
|
142
|
-
//
|
149
|
+
// defaults for status information
|
143
150
|
var state = 'not_started';
|
144
151
|
var mode = 'not_detected';
|
145
152
|
|
146
|
-
//
|
147
|
-
|
148
|
-
|
149
|
-
|
153
|
+
// defaults for tracking providers
|
154
|
+
var tracking_enabled = ('{{tracking_enabled}}' === 'true') ? true: false;
|
155
|
+
var tracking_id = '{{tracking_id}}';
|
156
|
+
var tracking_id_valid = (tracking_id.includes('tracking-id')) ? false : true;
|
150
157
|
|
151
|
-
//
|
158
|
+
// defaults for comment providers
|
152
159
|
var comment_provider = '{{comment_provider}}';
|
153
160
|
var site_id = '{{site_id}}';
|
154
161
|
var checkCookies = {{cookie_options.checkCookies}};
|
155
162
|
var expireCookiesOnRequiredOnly = ('{{cookie_options.expireCookiesOnRequiredOnly}}' === 'true') ? true: false;
|
156
163
|
|
164
|
+
// defaults for dynamic pages
|
165
|
+
var autoScrollRatioThreshold = '{{template_config.autoScrollRatioThreshold}}';
|
166
|
+
var pageGrowthRatio = 0; // ratio a dynamic page has grown in height
|
167
|
+
var pageBaseHeigth = 0; // base height of a dynamic page
|
168
|
+
var staticPage = false; // defalt: false, but decided in ResizeObserver
|
169
|
+
var pageHeight; // height of a page dynamic detected in ResizeObserver
|
170
|
+
|
171
|
+
// defaults for the cookie management
|
157
172
|
var current_user_data;
|
158
173
|
var current_page;
|
159
174
|
var previous_page;
|
@@ -163,30 +178,23 @@ var j1 = (function () {
|
|
163
178
|
var user_session_detected;
|
164
179
|
var cookie_written;
|
165
180
|
|
166
|
-
//
|
181
|
+
// defaults for themes
|
167
182
|
var themeName;
|
168
183
|
var themeCss;
|
169
184
|
var cssExtension = (environment === 'production')
|
170
185
|
? '.min.css'
|
171
186
|
: '.css'
|
172
187
|
|
173
|
-
|
188
|
+
// defaults for data files
|
174
189
|
var colors_data_path = '{{template_config.colors_data_path}}';
|
175
190
|
var font_size_data_path = '{{template_config.font_size_data_path}}';
|
176
191
|
var runtime_data_path = '{{template_config.runtime_data_path}}';
|
177
192
|
var message_catalog_data_path = '{{template_config.message_catalog_data_path}}';
|
178
193
|
|
179
|
-
// Logger
|
194
|
+
// Logger resources
|
180
195
|
var logger;
|
181
196
|
var logText;
|
182
197
|
|
183
|
-
var _this;
|
184
|
-
var settings;
|
185
|
-
var json_data;
|
186
|
-
var ep;
|
187
|
-
var baseUrl;
|
188
|
-
var referrer;
|
189
|
-
|
190
198
|
// initial cookie settings
|
191
199
|
var cookie_names = {
|
192
200
|
'app_session': '{{template_config.cookies.app_session}}',
|
@@ -282,44 +290,6 @@ var j1 = (function () {
|
|
282
290
|
j1['xhrDataState'] = {};
|
283
291
|
j1['xhrDOMState'] = {};
|
284
292
|
|
285
|
-
// -----------------------------------------------------------------------
|
286
|
-
// final updates before browser page|tab
|
287
|
-
// see: https://stackoverflow.com/questions/3888902/detect-browser-or-tab-closing
|
288
|
-
// -----------------------------------------------------------------------
|
289
|
-
window.addEventListener('beforeunload', function (event) {
|
290
|
-
var cookie_names = j1.getCookieNames();
|
291
|
-
var date = new Date();
|
292
|
-
var timestamp_now = date.toISOString();
|
293
|
-
var user_state = j1.readCookie(cookie_names.user_state);
|
294
|
-
var user_consent = j1.readCookie(cookie_names.user_consent);
|
295
|
-
var ep_status;
|
296
|
-
var url;
|
297
|
-
var baseUrl;
|
298
|
-
|
299
|
-
// final update of the user state cookie
|
300
|
-
user_state.session_active = false;
|
301
|
-
user_state.last_session_ts = timestamp_now;
|
302
|
-
|
303
|
-
if (!user_consent.analysis || !user_consent.personalization) {
|
304
|
-
logger.debug('\n' + 'write to cookie : ' + cookie_names.user_state);
|
305
|
-
|
306
|
-
cookie_written = j1.writeCookie({
|
307
|
-
name: cookie_names.user_state,
|
308
|
-
data: user_state,
|
309
|
-
secure: secure,
|
310
|
-
expires: 0
|
311
|
-
});
|
312
|
-
} else {
|
313
|
-
logger.debug('\n' + 'write to cookie : ' + cookie_names.user_state);
|
314
|
-
cookie_written = j1.writeCookie({
|
315
|
-
name: cookie_names.user_state,
|
316
|
-
data: user_state,
|
317
|
-
secure: secure,
|
318
|
-
expires: 365
|
319
|
-
});
|
320
|
-
}
|
321
|
-
}); // END beforeunload
|
322
|
-
|
323
293
|
// -----------------------------------------------------------------------
|
324
294
|
// initialize|load user cookies
|
325
295
|
// -----------------------------------------------------------------------
|
@@ -354,11 +324,7 @@ var j1 = (function () {
|
|
354
324
|
}
|
355
325
|
}
|
356
326
|
|
357
|
-
|
358
|
-
// -----------------------------------------------------------------------
|
359
|
-
window.onkeyup = function (event) {
|
360
|
-
if (event.keyCode == 27) window.history.back();
|
361
|
-
};
|
327
|
+
j1.registerEvents(logger);
|
362
328
|
|
363
329
|
// detect middleware (mode 'app') and update user session cookie
|
364
330
|
// -----------------------------------------------------------------------
|
@@ -988,12 +954,16 @@ var j1 = (function () {
|
|
988
954
|
logText = '\n' + 'page finalized successfully';
|
989
955
|
logger.info(logText);
|
990
956
|
|
991
|
-
// do a (smooth) scroll if all nav elements ready
|
957
|
+
// do a (smooth) scroll for static pages (if all nav elements ready)
|
992
958
|
// -----------------------------------------------------------------
|
993
959
|
var dependencies_met_navigator_finished = setInterval(function() {
|
994
|
-
|
960
|
+
// NOTE: dynamic pages scrolled at a growth ratio of 100 percent as well
|
961
|
+
if (j1.adapter.navigator.getState() == 'finished' && staticPage) {
|
995
962
|
// if a page requested contains an anchor element, do a smooth scroll
|
996
|
-
|
963
|
+
logger.debug('\n' + 'Scroll static page, growth ratio at 100 (percent)');
|
964
|
+
// NOTE: on some pages, the offset is NOT correct
|
965
|
+
var scrollOffset = j1.getScrollOffset();
|
966
|
+
j1.scrollTo(scrollOffset);
|
997
967
|
clearInterval(dependencies_met_navigator_finished);
|
998
968
|
}
|
999
969
|
}, 25);
|
@@ -1003,7 +973,6 @@ var j1 = (function () {
|
|
1003
973
|
// web mode
|
1004
974
|
// ---------------------------------------------------------------------
|
1005
975
|
setTimeout (function() {
|
1006
|
-
// j1.setState('finished');
|
1007
976
|
logger.info('\n' + 'state: finished');
|
1008
977
|
logger.info('\n' + 'page initialization: finished');
|
1009
978
|
|
@@ -1129,15 +1098,19 @@ var j1 = (function () {
|
|
1129
1098
|
logText = '\n' + 'page finalized successfully';
|
1130
1099
|
logger.info(logText);
|
1131
1100
|
|
1132
|
-
// do a (smooth) scroll if all nav elements ready
|
1101
|
+
// do a (smooth) scroll for static pages (if all nav elements ready)
|
1133
1102
|
// -------------------------------------------------------------------
|
1134
1103
|
var dependencies_met_navigator_finished = setInterval(function() {
|
1135
|
-
if (j1.adapter.navigator.getState() == 'finished') {
|
1104
|
+
if (j1.adapter.navigator.getState() == 'finished' && staticPage) {
|
1105
|
+
logger.debug('\n' + 'Scroll static page, growth ratio at 100 (percent)');
|
1136
1106
|
// if a page requested contains an anchor element, do a smooth scroll
|
1137
|
-
|
1107
|
+
// NOTE: on some pages, the offset is NOT correct
|
1108
|
+
var scrollOffset = j1.getScrollOffset();
|
1109
|
+
j1.scrollTo(scrollOffset);
|
1138
1110
|
clearInterval(dependencies_met_navigator_finished);
|
1139
1111
|
}
|
1140
1112
|
}, 25);
|
1113
|
+
|
1141
1114
|
}, flickerTimeout);
|
1142
1115
|
}
|
1143
1116
|
},
|
@@ -1191,11 +1164,11 @@ var j1 = (function () {
|
|
1191
1164
|
|
1192
1165
|
// -------------------------------------------------------------------------
|
1193
1166
|
// getScrollOffset()
|
1194
|
-
// Calculate offset for correct (smooth) scroll position
|
1167
|
+
// Calculate offset for a correct (smooth) scroll position
|
1195
1168
|
// -------------------------------------------------------------------------
|
1196
1169
|
getScrollOffset: function () {
|
1197
1170
|
var scrollOffset;
|
1198
|
-
var offsetCorrection;
|
1171
|
+
var offsetCorrection = 0;
|
1199
1172
|
|
1200
1173
|
var $pagehead = $('.attic');
|
1201
1174
|
var $navbar = $('nav.navbar');
|
@@ -1210,8 +1183,10 @@ var j1 = (function () {
|
|
1210
1183
|
|
1211
1184
|
// Unclear why or what element cause the need of a correction
|
1212
1185
|
// TODO: General revision of scrollOffset needed
|
1186
|
+
// NOTE: Disabled for now
|
1213
1187
|
//
|
1214
|
-
offsetCorrection = navbarType == 'fixed' ? 10 : -25;
|
1188
|
+
// offsetCorrection = navbarType == 'fixed' ? 10 : -25;
|
1189
|
+
|
1215
1190
|
scrollOffset = navbarType == 'fixed'
|
1216
1191
|
? -1*(n + a + f) + offsetCorrection
|
1217
1192
|
: -1*(n + a + f) + h + offsetCorrection;
|
@@ -1224,23 +1199,25 @@ var j1 = (function () {
|
|
1224
1199
|
// Scrolls smooth to any anchor referenced by an page URL on
|
1225
1200
|
// e.g. a page reload. Values e.g for delay are taken from
|
1226
1201
|
// TOCCER module
|
1202
|
+
// NOTE: crollTo() is triggered by 'onDocumentHeigthChange'
|
1227
1203
|
// -------------------------------------------------------------------------
|
1228
|
-
scrollTo: function () {
|
1204
|
+
scrollTo: function (offset) {
|
1229
1205
|
var logger = log4javascript.getLogger('j1.scrollTo');
|
1230
1206
|
var anchor = window.location.href.split('#')[1];
|
1231
1207
|
var anchor_id = typeof anchor !== 'undefined' ? '#' + anchor : false;
|
1232
1208
|
var scrollDuration = {{toccer_options.scrollSmoothDuration}};
|
1233
|
-
var scrollOffset = j1.getScrollOffset();
|
1209
|
+
var scrollOffset = offset ; // j1.getScrollOffset();
|
1234
1210
|
var isSlider = false;
|
1235
|
-
var selector;
|
1211
|
+
var selector = $(anchor_id);
|
1236
1212
|
|
1237
|
-
|
1238
|
-
|
1239
|
-
|
1213
|
+
// skip invalid anchors|selectors
|
1214
|
+
//
|
1215
|
+
if (typeof anchor === 'undefined' || anchor.includes('googtrans') || !$(selector).length) {
|
1240
1216
|
return false;
|
1241
1217
|
}
|
1242
1218
|
|
1243
1219
|
// Check if the anchor is an slider/gallery element
|
1220
|
+
//
|
1244
1221
|
if (typeof anchor !== 'undefined') {
|
1245
1222
|
isSlider = anchor.includes('slide');
|
1246
1223
|
}
|
@@ -1249,6 +1226,7 @@ var j1 = (function () {
|
|
1249
1226
|
// scroll only, if an anchor is given with an URL
|
1250
1227
|
selector = $(anchor_id);
|
1251
1228
|
if (selector.length) {
|
1229
|
+
logger.info('\n' + 'scrollTo header: ' + anchor_id);
|
1252
1230
|
j1.core.scrollSmooth.scroll(anchor_id, {
|
1253
1231
|
duration: scrollDuration,
|
1254
1232
|
offset: scrollOffset,
|
@@ -2251,6 +2229,7 @@ var j1 = (function () {
|
|
2251
2229
|
window.location.href = 'about:blank';
|
2252
2230
|
}
|
2253
2231
|
},
|
2232
|
+
|
2254
2233
|
// -------------------------------------------------------------------------
|
2255
2234
|
// goBack()
|
2256
2235
|
// Redirect current page to last visited page (referrer)
|
@@ -2258,6 +2237,102 @@ var j1 = (function () {
|
|
2258
2237
|
goBack: function () {
|
2259
2238
|
// where visitor has come from
|
2260
2239
|
window.location.href = document.referrer;
|
2240
|
+
},
|
2241
|
+
|
2242
|
+
// -------------------------------------------------------------------------
|
2243
|
+
// registerEvents()
|
2244
|
+
// Redirect current page to last visited page (referrer)
|
2245
|
+
// -------------------------------------------------------------------------
|
2246
|
+
registerEvents: function (logger) {
|
2247
|
+
|
2248
|
+
// Add ResizeObserver to monitor the page height of dynamic pages
|
2249
|
+
// see: https://stackoverflow.com/questions/14866775/detect-document-height-change
|
2250
|
+
//
|
2251
|
+
const observer = new ResizeObserver(entries => {
|
2252
|
+
const scrollOffset = j1.getScrollOffset();
|
2253
|
+
// Set autoScrollRatioThreshold if NOT specified
|
2254
|
+
autoScrollRatioThreshold = autoScrollRatioThreshold ? autoScrollRatioThreshold : 100;
|
2255
|
+
for (const entry of entries) {
|
2256
|
+
|
2257
|
+
// each entry is an instance of ResizeObserverEntry
|
2258
|
+
pageHeight = Math.round(entry.contentRect.height);
|
2259
|
+
|
2260
|
+
// set base height on a page height <> 0
|
2261
|
+
if (!pageBaseHeigth && pageHeight) {
|
2262
|
+
pageBaseHeigth = pageHeight;
|
2263
|
+
}
|
2264
|
+
|
2265
|
+
// calculation of the ratio a page that has lengthened
|
2266
|
+
if (pageBaseHeigth) {
|
2267
|
+
pageGrowthRatio = Math.round(pageHeight / pageBaseHeigth *100);
|
2268
|
+
}
|
2269
|
+
|
2270
|
+
// log only if page grown above 'autoScrollRatioThreshold'
|
2271
|
+
if (pageGrowthRatio > autoScrollRatioThreshold) {
|
2272
|
+
logger.debug('\n' + 'Page growth ratio reached the threshold: ', pageGrowthRatio);
|
2273
|
+
}
|
2274
|
+
|
2275
|
+
// identify a 'staticPage'
|
2276
|
+
if (pageGrowthRatio < autoScrollRatioThreshold) {
|
2277
|
+
staticPage = true;
|
2278
|
+
} else {
|
2279
|
+
// identify a page as 'dynamic' if autoScrollRatioThreshold reached
|
2280
|
+
staticPage = false;
|
2281
|
+
}
|
2282
|
+
|
2283
|
+
// dynamic page that has been increased in size above the threshold
|
2284
|
+
if (pageGrowthRatio > autoScrollRatioThreshold) {
|
2285
|
+
j1.scrollTo(scrollOffset);
|
2286
|
+
logger.debug('\n' + 'Scroll dynamic page on growth ratio: ', pageGrowthRatio);
|
2287
|
+
}
|
2288
|
+
}
|
2289
|
+
});
|
2290
|
+
// monitor the page 'body'
|
2291
|
+
observer.observe(document.querySelector('body'));
|
2292
|
+
|
2293
|
+
// -----------------------------------------------------------------------
|
2294
|
+
// final updates before browser page|tab
|
2295
|
+
// see: https://stackoverflow.com/questions/3888902/detect-browser-or-tab-closing
|
2296
|
+
// -----------------------------------------------------------------------
|
2297
|
+
window.addEventListener('beforeunload', function (event) {
|
2298
|
+
var cookie_names = j1.getCookieNames();
|
2299
|
+
var date = new Date();
|
2300
|
+
var timestamp_now = date.toISOString();
|
2301
|
+
var user_state = j1.readCookie(cookie_names.user_state);
|
2302
|
+
var user_consent = j1.readCookie(cookie_names.user_consent);
|
2303
|
+
var url = new liteURL(window.location.href);
|
2304
|
+
var secure = (url.protocol.includes('https')) ? true : false;
|
2305
|
+
var ep_status;
|
2306
|
+
var url;
|
2307
|
+
var baseUrl;
|
2308
|
+
|
2309
|
+
// final update of the user state cookie
|
2310
|
+
user_state.session_active = false;
|
2311
|
+
user_state.last_session_ts = timestamp_now;
|
2312
|
+
|
2313
|
+
if (!user_consent.analysis || !user_consent.personalization) {
|
2314
|
+
|
2315
|
+
cookie_written = j1.writeCookie({
|
2316
|
+
name: cookie_names.user_state,
|
2317
|
+
data: user_state,
|
2318
|
+
secure: secure,
|
2319
|
+
expires: 0
|
2320
|
+
});
|
2321
|
+
} else {
|
2322
|
+
cookie_written = j1.writeCookie({
|
2323
|
+
name: cookie_names.user_state,
|
2324
|
+
data: user_state,
|
2325
|
+
secure: secure,
|
2326
|
+
expires: 365
|
2327
|
+
});
|
2328
|
+
}
|
2329
|
+
}); // END beforeunload
|
2330
|
+
|
2331
|
+
// initialize event handler for window/history/back on <ESC>
|
2332
|
+
//
|
2333
|
+
window.onkeyup = function (event) {
|
2334
|
+
if (event.keyCode == 27) window.history.back();
|
2335
|
+
};
|
2261
2336
|
}
|
2262
2337
|
};
|
2263
2338
|
}) (j1, window);
|
@@ -503,6 +503,7 @@ j1.adapter.nbinteract = (function (j1, window) {
|
|
503
503
|
if (nbiButtonState) {
|
504
504
|
// button NOT removed
|
505
505
|
logger.warn('NBI initialialization failed on textbook: {{textbook_id}}');
|
506
|
+
spinner.stop();
|
506
507
|
// hide the info modal
|
507
508
|
$(nbiModalSuccessID).modal('hide');
|
508
509
|
|
@@ -1059,6 +1060,11 @@ j1.adapter.nbinteract = (function (j1, window) {
|
|
1059
1060
|
}
|
1060
1061
|
}
|
1061
1062
|
|
1063
|
+
if (nbiNotebookReady == 'first_widget') {
|
1064
|
+
if (nbiIndicateNbiActivity) spinner.stop();
|
1065
|
+
$('.fab-btn').show();
|
1066
|
+
}
|
1067
|
+
|
1062
1068
|
widgetCells = document.querySelectorAll('.output_widget_view').length;
|
1063
1069
|
var dependencies_met_page_rendered = setInterval(function() {
|
1064
1070
|
widgetCellsRendered = document.querySelectorAll('.widget-vbox').length;
|
@@ -1151,17 +1157,22 @@ j1.adapter.nbinteract = (function (j1, window) {
|
|
1151
1157
|
if (message.type === 'command' && message.action === 'error') {
|
1152
1158
|
var messageTS;
|
1153
1159
|
|
1154
|
-
if (
|
1160
|
+
if (message.text.includes('Too many users') ||
|
1161
|
+
message.text.includes('Insufficent nodes') ||
|
1162
|
+
message.text.includes('ImagePullBackOff') ||
|
1163
|
+
message.text.includes('failed to connect')
|
1164
|
+
) {
|
1155
1165
|
var modaBodyText = `
|
1156
|
-
The <i>Binder Service</i>
|
1166
|
+
The <i>Binder Service</i> seems currently not available or is overloaded.
|
1157
1167
|
All interactive components on the page are <b>not</b> available.
|
1158
|
-
You can reload the page or re-open later
|
1168
|
+
You can reload the page now to re-connect or re-open it at a later time.
|
1159
1169
|
`;
|
1160
|
-
logger.error('\n', 'Binder access:
|
1170
|
+
logger.error('\n', 'Binder access failed: ' + message.text);
|
1161
1171
|
if ($(nbiModalTRInfo).is(':hidden')) {
|
1162
1172
|
document.getElementById('nbiModalTRInfoBody').innerHTML = modaBodyText;
|
1163
1173
|
$(nbiModalTRInfo).modal('show');
|
1164
1174
|
}
|
1175
|
+
|
1165
1176
|
return;
|
1166
1177
|
}
|
1167
1178
|
|
@@ -1251,16 +1262,16 @@ j1.adapter.nbinteract = (function (j1, window) {
|
|
1251
1262
|
}, // END getState
|
1252
1263
|
|
1253
1264
|
// -------------------------------------------------------------------------
|
1254
|
-
//
|
1265
|
+
// checkURL()
|
1255
1266
|
// Returns the current (processing) state of the module
|
1256
1267
|
// -------------------------------------------------------------------------
|
1257
1268
|
checkURL: function (uri, flags) {
|
1258
1269
|
_this.setState('process_checks');
|
1259
|
-
$.get(uri).done(function () {
|
1270
|
+
$.get(uri).done(function (e) {
|
1260
1271
|
_this.setState('finished_checks');
|
1261
1272
|
flags.checkURL = true;
|
1262
1273
|
return true;
|
1263
|
-
}).fail(function () {
|
1274
|
+
}).fail(function (e) {
|
1264
1275
|
_this.setState('finished_checks');
|
1265
1276
|
flags.checkURL = false;
|
1266
1277
|
});
|
@@ -93,8 +93,16 @@ j1.adapter.rangeSlider = (function (j1, window) {
|
|
93
93
|
// Helper functions
|
94
94
|
// ---------------------------------------------------------------------------
|
95
95
|
|
96
|
-
function
|
97
|
-
|
96
|
+
function prepend(newNode, referenceNode) {
|
97
|
+
referenceNode.parentNode.insertBefore(newNode, referenceNode);
|
98
|
+
}
|
99
|
+
|
100
|
+
function append(newNode, referenceNode) {
|
101
|
+
referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling);
|
102
|
+
}
|
103
|
+
|
104
|
+
function insert(newNode, referenceNode) {
|
105
|
+
referenceNode.appendChild(newNode);
|
98
106
|
}
|
99
107
|
|
100
108
|
// ---------------------------------------------------------------------------
|
@@ -133,7 +141,7 @@ j1.adapter.rangeSlider = (function (j1, window) {
|
|
133
141
|
if (j1.getState() == 'finished') {
|
134
142
|
|
135
143
|
logger.info('\n' + 'module is being initialized');
|
136
|
-
|
144
|
+
|
137
145
|
// initialize state flag
|
138
146
|
_this.setState('started');
|
139
147
|
logger.debug('\n' + 'state: ' + _this.getState());
|
@@ -163,8 +171,10 @@ j1.adapter.rangeSlider = (function (j1, window) {
|
|
163
171
|
{% assign format_decimals = range_slider_options.options.format.decimals %}
|
164
172
|
{% assign cbOnUpdate = range_slider_options.options.cbOnUpdate %}
|
165
173
|
|
174
|
+
|
166
175
|
{% comment %} overload defaults by slider options
|
167
|
-
|
176
|
+
---------------------------------------------------------------- {% endcomment %}
|
177
|
+
{% if item.slider.options.title %} {% assign title = item.slider.options.title %} {% endif %}
|
168
178
|
{% if item.slider.options.label %} {% assign label = item.slider.options.label %} {% endif %}
|
169
179
|
{% if item.slider.options.start %} {% assign start = item.slider.options.start %} {% endif %}
|
170
180
|
{% if item.slider.options.connect %} {% assign connect = item.slider.options.connect %} {% endif %}
|
@@ -176,7 +186,8 @@ j1.adapter.rangeSlider = (function (j1, window) {
|
|
176
186
|
{% if item.slider.options.cbOnUpdate %} {% assign cbOnUpdate = item.slider.options.cbOnUpdate %} {% endif %}
|
177
187
|
|
178
188
|
elms.forEach(function (elm) {
|
179
|
-
var id
|
189
|
+
var id = elm.id;
|
190
|
+
var parent = document.getElementById(id);
|
180
191
|
|
181
192
|
if (id === '{{slider_id}}') {
|
182
193
|
// processing rangeSlider: {{slider_id}}
|
@@ -198,11 +209,17 @@ j1.adapter.rangeSlider = (function (j1, window) {
|
|
198
209
|
})
|
199
210
|
});
|
200
211
|
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
212
|
+
if ('{{title}}'.length) {
|
213
|
+
var title = document.createElement('div');
|
214
|
+
title.classList.add('range-slider-title');
|
215
|
+
title.innerHTML = '{{title}}';
|
216
|
+
prepend(title, parent);
|
217
|
+
}
|
218
|
+
|
219
|
+
var label = document.createElement('label');
|
220
|
+
label.classList.add('range-slider-label');
|
221
|
+
label.innerHTML = '{{label}}';
|
222
|
+
insert(label, parent);
|
206
223
|
|
207
224
|
slider_{{slider_id}}.noUiSlider.on('update', function (values, handle) {
|
208
225
|
var logger = log4javascript.getLogger('j1.adapter.rangeSlider.cbOnUpdate');
|