mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-05 09:41:40 +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':
|
case 'HTML':
|
||||||
$json_options = defined('JSON_PRETTY_PRINT') ? (JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE) : 0;
|
$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 = 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);
|
$body_end_position = strrpos($output, '</body>') ?: strlen($output);
|
||||||
$output = substr($output, 0, $body_end_position) . "\n$panel_script\n" . substr($output, $body_end_position);
|
$output = substr($output, 0, $body_end_position) . "\n$panel_script\n" . substr($output, $body_end_position);
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ const Rhymix = {
|
||||||
addedDocument: [],
|
addedDocument: [],
|
||||||
loadedPopupMenus: [],
|
loadedPopupMenus: [],
|
||||||
openWindowList: {},
|
openWindowList: {},
|
||||||
|
currentDebugData: null,
|
||||||
pendingDebugData: [],
|
pendingDebugData: [],
|
||||||
showAjaxErrors: ['ALL'],
|
showAjaxErrors: ['ALL'],
|
||||||
unloading: false,
|
unloading: false,
|
||||||
|
|
@ -468,8 +469,8 @@ Rhymix.ajaxSuccessHandler = function(xhr, textStatus, action, data, params, succ
|
||||||
// Add debug information.
|
// Add debug information.
|
||||||
if (data._rx_debug) {
|
if (data._rx_debug) {
|
||||||
data._rx_debug.page_title = "AJAX : " + action;
|
data._rx_debug.page_title = "AJAX : " + action;
|
||||||
if (window.rhymix_debug_add_data) {
|
if (this.addDebugData) {
|
||||||
window.rhymix_debug_add_data(data._rx_debug);
|
this.addDebugData(data._rx_debug);
|
||||||
} else {
|
} else {
|
||||||
this.pendingDebugData.push(data._rx_debug);
|
this.pendingDebugData.push(data._rx_debug);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ $(function() {
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// Define a function for adding debug data to the panel.
|
// 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.
|
// Define loop variables.
|
||||||
var i, j, entry, num, cnt, backtrace, description;
|
var i, j, entry, num, cnt, backtrace, description;
|
||||||
|
|
@ -238,15 +238,15 @@ $(function() {
|
||||||
};
|
};
|
||||||
|
|
||||||
// Add debug data from the current request.
|
// Add debug data from the current request.
|
||||||
if (window.rhymix_debug_content) {
|
if (Rhymix.currentDebugData) {
|
||||||
window.rhymix_debug_content.page_title = 'MAIN PAGE';
|
Rhymix.currentDebugData.page_title = 'MAIN PAGE';
|
||||||
rhymix_debug_add_data(window.rhymix_debug_content, true);
|
Rhymix.addDebugData(Rhymix.currentDebugData, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add debug data from pending AJAX requests.
|
// Add debug data from pending AJAX requests.
|
||||||
if (Rhymix.pendingDebugData) {
|
if (Rhymix.pendingDebugData) {
|
||||||
while (Rhymix.pendingDebugData.length) {
|
while (Rhymix.pendingDebugData.length) {
|
||||||
rhymix_debug_add_data(Rhymix.pendingDebugData.shift());
|
Rhymix.addDebugData(Rhymix.pendingDebugData.shift());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -60,10 +60,10 @@
|
||||||
// Add debug information.
|
// Add debug information.
|
||||||
if (data._rx_debug) {
|
if (data._rx_debug) {
|
||||||
data._rx_debug.page_title = "AJAX : " + params.module + "." + params.act;
|
data._rx_debug.page_title = "AJAX : " + params.module + "." + params.act;
|
||||||
if (window.rhymix_debug_add_data) {
|
if (Rhymix.addDebugData) {
|
||||||
window.rhymix_debug_add_data(data._rx_debug);
|
Rhymix.addDebugData(data._rx_debug);
|
||||||
} else {
|
} else {
|
||||||
window.rhymix_debug_pending_data.push(data._rx_debug);
|
Rhymix.pendingDebugData.push(data._rx_debug);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -226,10 +226,10 @@
|
||||||
// Add debug information.
|
// Add debug information.
|
||||||
if (data._rx_debug) {
|
if (data._rx_debug) {
|
||||||
data._rx_debug.page_title = "AJAX : " + request_info;
|
data._rx_debug.page_title = "AJAX : " + request_info;
|
||||||
if (window.rhymix_debug_add_data) {
|
if (Rhymix.addDebugData) {
|
||||||
window.rhymix_debug_add_data(data._rx_debug);
|
Rhymix.addDebugData(data._rx_debug);
|
||||||
} else {
|
} 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