commit 6ad7948670aa76cde3bbd377538aec5f6ed5ee5e Author: ovc Date: Thu Sep 19 02:16:43 2024 +0300 init diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3122429 --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +/* +!php_interface +!bx-custom-include +!.htaccess +!.gitignore +!README.md +!init.php \ No newline at end of file diff --git a/.htaccess b/.htaccess new file mode 100644 index 0000000..05683aa --- /dev/null +++ b/.htaccess @@ -0,0 +1 @@ +Deny From All \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/bx-custom-include/event-log/lang_ru.php b/bx-custom-include/event-log/lang_ru.php new file mode 100644 index 0000000..15c5adc --- /dev/null +++ b/bx-custom-include/event-log/lang_ru.php @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/bx-custom-include/event-log/main.php b/bx-custom-include/event-log/main.php new file mode 100644 index 0000000..6b56243 --- /dev/null +++ b/bx-custom-include/event-log/main.php @@ -0,0 +1,14 @@ + '/local/bx-custom-include/event-log/script.js', + 'css' => '/local/bx-custom-include/event-log/style.css', + 'lang' => '/local/bx-custom-include/event-log/lang_' . LANGUAGE_ID . '.php', + 'rel' => Array('popup', 'ajax', 'fx', 'ls', 'date', 'json', 'window','jquery'), + 'skip_core' => false, + ) +); +CJSCore::Init(array('event-log')); +?> \ No newline at end of file diff --git a/bx-custom-include/event-log/script.js b/bx-custom-include/event-log/script.js new file mode 100644 index 0000000..f65e854 --- /dev/null +++ b/bx-custom-include/event-log/script.js @@ -0,0 +1,23 @@ +let originalBxOnCustomEvent = BX.onCustomEvent; + +BX.onCustomEvent = function (eventObject, eventName, eventParams, secureParams) { + let realEventName = BX.type.isString(eventName) ? + eventName : BX.type.isString(eventObject) ? eventObject : null; + + if (realEventName) { + console.log( + '%c' + realEventName, + 'background: #222; color: #bada55; font-weight: bold; padding: 3px 4px;' + ); + } + + console.dir({ + eventObject: eventObject, + eventParams: eventParams, + secureParams: secureParams + }); + + originalBxOnCustomEvent.apply( + null, arguments + ); +}; diff --git a/bx-custom-include/event-log/style.css b/bx-custom-include/event-log/style.css new file mode 100644 index 0000000..e69de29 diff --git a/php_interface/init.php b/php_interface/init.php new file mode 100644 index 0000000..fdc86a1 --- /dev/null +++ b/php_interface/init.php @@ -0,0 +1,10 @@ + \ No newline at end of file