@patch-adams/core 1.4.18 → 1.4.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.cjs +26 -0
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +26 -0
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +26 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +26 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -406,6 +406,12 @@ function generateLrsBridgeCode(options) {
|
|
|
406
406
|
'use strict';
|
|
407
407
|
|
|
408
408
|
var DEBUG = ${options.debug};
|
|
409
|
+
// Allow URL-based debug toggle: ?pa_debug=1 or #pa_debug
|
|
410
|
+
try {
|
|
411
|
+
if (window.location.search.indexOf('pa_debug') > -1 || window.location.hash.indexOf('pa_debug') > -1) {
|
|
412
|
+
DEBUG = true;
|
|
413
|
+
}
|
|
414
|
+
} catch (e) {}
|
|
409
415
|
var TRACK_MEDIA = ${options.trackMedia};
|
|
410
416
|
var TRACK_NAVIGATION = ${options.trackNavigation};
|
|
411
417
|
var TRACK_QUIZZES = ${options.trackQuizzes};
|
|
@@ -2777,6 +2783,17 @@ function generateLrsBridgeCode(options) {
|
|
|
2777
2783
|
function sendStatement(statement) {
|
|
2778
2784
|
log('Sending statement:', statement.verb.display['en-US'] || statement.verb.id, statement);
|
|
2779
2785
|
|
|
2786
|
+
// Log first statement visibly (not gated by DEBUG) for production diagnostics
|
|
2787
|
+
if (LRS.stats.statementsSent === 0 && LRS.stats.statementsFailed === 0 && LRS.stats.statementsQueued === 0) {
|
|
2788
|
+
if (window.console && window.console.info) {
|
|
2789
|
+
var verb = statement.verb.display ? (statement.verb.display['en-US'] || statement.verb.id) : statement.verb.id;
|
|
2790
|
+
console.info('[PA-LRS] First statement: verb=' + verb +
|
|
2791
|
+
', endpoint=' + (LRS_ENDPOINT || 'NONE') +
|
|
2792
|
+
', proxy=' + (LRS_PROXY_ENDPOINT ? 'yes' : 'no') +
|
|
2793
|
+
', mode=' + LRS.mode);
|
|
2794
|
+
}
|
|
2795
|
+
}
|
|
2796
|
+
|
|
2780
2797
|
// Store in event log
|
|
2781
2798
|
LRS.eventLog.push({
|
|
2782
2799
|
statement: statement,
|
|
@@ -3956,6 +3973,15 @@ function generateLrsBridgeCode(options) {
|
|
|
3956
3973
|
LRS.mode = 'offline';
|
|
3957
3974
|
}
|
|
3958
3975
|
|
|
3976
|
+
// Always-visible bridge summary (not gated by DEBUG)
|
|
3977
|
+
// This ensures diagnostics are available even in production builds
|
|
3978
|
+
if (window.console && window.console.info) {
|
|
3979
|
+
console.info('[PA-LRS] Bridge: mode=' + LRS.mode +
|
|
3980
|
+
', endpoint=' + (LRS_ENDPOINT ? LRS_ENDPOINT.substring(0, 30) + '...' : 'NONE') +
|
|
3981
|
+
', proxy=' + (LRS_PROXY_ENDPOINT ? 'yes' : 'no') +
|
|
3982
|
+
', actor=' + (LRS.actor ? (LRS.actor.name || 'anonymous') : 'none'));
|
|
3983
|
+
}
|
|
3984
|
+
|
|
3959
3985
|
// Set up event interceptors
|
|
3960
3986
|
setupMediaInterceptors();
|
|
3961
3987
|
setupNavigationInterceptors();
|