mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 01:01:41 +09:00
Consoliate all debug-related variables under the Rhymix object
This commit is contained in:
parent
3d64c26232
commit
0f554c6d51
4 changed files with 15 additions and 14 deletions
|
|
@ -257,7 +257,7 @@ class DisplayHandler extends Handler
|
|||
case 'HTML':
|
||||
$json_options = defined('JSON_PRETTY_PRINT') ? (JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE) : 0;
|
||||
$panel_script = sprintf('<script src="%s%s?t=%d"></script>', RX_BASEURL, 'common/js/debug.js', filemtime(RX_BASEDIR . 'common/js/debug.js'));
|
||||
$panel_script .= "\n<script>\nvar rhymix_debug_content = " . json_encode($data, $json_options) . ";\n</script>";
|
||||
$panel_script .= "\n<script>\nRhymix.currentDebugData = " . json_encode($data, $json_options) . ";\n</script>";
|
||||
$body_end_position = strrpos($output, '</body>') ?: strlen($output);
|
||||
$output = substr($output, 0, $body_end_position) . "\n$panel_script\n" . substr($output, $body_end_position);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ const Rhymix = {
|
|||
addedDocument: [],
|
||||
loadedPopupMenus: [],
|
||||
openWindowList: {},
|
||||
currentDebugData: null,
|
||||
pendingDebugData: [],
|
||||
showAjaxErrors: ['ALL'],
|
||||
unloading: false,
|
||||
|
|
@ -468,8 +469,8 @@ Rhymix.ajaxSuccessHandler = function(xhr, textStatus, action, data, params, succ
|
|||
// Add debug information.
|
||||
if (data._rx_debug) {
|
||||
data._rx_debug.page_title = "AJAX : " + action;
|
||||
if (window.rhymix_debug_add_data) {
|
||||
window.rhymix_debug_add_data(data._rx_debug);
|
||||
if (this.addDebugData) {
|
||||
this.addDebugData(data._rx_debug);
|
||||
} else {
|
||||
this.pendingDebugData.push(data._rx_debug);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ $(function() {
|
|||
}));
|
||||
|
||||
// Define a function for adding debug data to the panel.
|
||||
window.rhymix_debug_add_data = function(data, open) {
|
||||
Rhymix.addDebugData = function(data, open) {
|
||||
|
||||
// Define loop variables.
|
||||
var i, j, entry, num, cnt, backtrace, description;
|
||||
|
|
@ -238,15 +238,15 @@ $(function() {
|
|||
};
|
||||
|
||||
// Add debug data from the current request.
|
||||
if (window.rhymix_debug_content) {
|
||||
window.rhymix_debug_content.page_title = 'MAIN PAGE';
|
||||
rhymix_debug_add_data(window.rhymix_debug_content, true);
|
||||
if (Rhymix.currentDebugData) {
|
||||
Rhymix.currentDebugData.page_title = 'MAIN PAGE';
|
||||
Rhymix.addDebugData(Rhymix.currentDebugData, true);
|
||||
}
|
||||
|
||||
// Add debug data from pending AJAX requests.
|
||||
if (Rhymix.pendingDebugData) {
|
||||
while (Rhymix.pendingDebugData.length) {
|
||||
rhymix_debug_add_data(Rhymix.pendingDebugData.shift());
|
||||
Rhymix.addDebugData(Rhymix.pendingDebugData.shift());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -60,10 +60,10 @@
|
|||
// Add debug information.
|
||||
if (data._rx_debug) {
|
||||
data._rx_debug.page_title = "AJAX : " + params.module + "." + params.act;
|
||||
if (window.rhymix_debug_add_data) {
|
||||
window.rhymix_debug_add_data(data._rx_debug);
|
||||
if (Rhymix.addDebugData) {
|
||||
Rhymix.addDebugData(data._rx_debug);
|
||||
} else {
|
||||
window.rhymix_debug_pending_data.push(data._rx_debug);
|
||||
Rhymix.pendingDebugData.push(data._rx_debug);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -226,10 +226,10 @@
|
|||
// Add debug information.
|
||||
if (data._rx_debug) {
|
||||
data._rx_debug.page_title = "AJAX : " + request_info;
|
||||
if (window.rhymix_debug_add_data) {
|
||||
window.rhymix_debug_add_data(data._rx_debug);
|
||||
if (Rhymix.addDebugData) {
|
||||
Rhymix.addDebugData(data._rx_debug);
|
||||
} else {
|
||||
window.rhymix_debug_pending_data.push(data._rx_debug);
|
||||
Rhymix.pendingDebugData.push(data._rx_debug);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue