1/** 2 * Orleans Express Debug Initialization 3 * This file initializes the debug system and must be loaded before other scripts 4 */ 5 6(function() { 7 'use strict'; 8 9 /** 10 * Check if debug is active for a specific module 11 */ 12 function isDebugActive(module) { 13 // Default to false if config not available 14 if (!window.oeDebugConfig) { 15 return false; 16 } 17 // Handle WordPress localize_script conversion (true becomes "1", false becomes "") 18 return window.oeDebugConfig[module] === "1" || window.oeDebugConfig[module] === true; 19 } 20 21 /** 22 * Orleans Express Debug object with module-specific logging 23 */ 24 window.oeDebug = { 25 /** 26 * Debug log for billetterie 27 */ 28 billetterie: function() { 29 if (isDebugActive('billetterie')) { 30 console.log.apply(console, ['[BILLETTERIE]'].concat(Array.prototype.slice.call(arguments))); 31 } 32 }, 33 34 /** 35 * Debug log for map 36 */ 37 map: function() { 38 if (isDebugActive('map')) { 39 console.log.apply(console, ['[MAP]'].concat(Array.prototype.slice.call(arguments))); 40 } 41 }, 42 43 /** 44 * Debug log for theme 45 */ 46 theme: function() { 47 if (isDebugActive('theme')) { 48 console.log.apply(console, ['[THEME]'].concat(Array.prototype.slice.call(arguments))); 49 } 50 }, 51 52 /** 53 * Debug log for KAPI 54 */ 55 kapi: function() { 56 if (isDebugActive('kapi')) { 57 console.log.apply(console, ['[KAPI]'].concat(Array.prototype.slice.call(arguments))); 58 } 59 }, 60 61 /** 62 * Generic debug log with custom tag 63 */ 64 log: function(module, tag) { 65 if (isDebugActive(module)) { 66 var args = Array.prototype.slice.call(arguments, 2); 67 console.log.apply(console, ['[' + tag + ']'].concat(args)); 68 } 69 }, 70 71 /** 72 * Debug log with emoji tags (for existing code compatibility) 73 */ 74 funnel: function(emoji, tag) { 75 if (isDebugActive('billetterie')) { 76 var args = Array.prototype.slice.call(arguments, 2); 77 console.log.apply(console, [emoji + ' [' + tag + ']'].concat(args)); 78 } 79 }, 80 81 /** 82 * Check if any debug mode is active 83 */ 84 isActive: function() { 85 if (!window.oeDebugConfig) { 86 return false; 87 } 88 for (var key in window.oeDebugConfig) { 89 if (window.oeDebugConfig.hasOwnProperty(key) && window.oeDebugConfig[key] === true) { 90 return true; 91 } 92 } 93 return false; 94 }, 95 96 /** 97 * Get current debug configuration 98 */ 99 getConfig: function() { 100 return window.oeDebugConfig || { 101 billetterie: false, 102 map: false, 103 theme: false, 104 kapi: false 105 }; 106 } 107 }; 108})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.