From 228939a4f16c83326752ce819857f0907a3080da Mon Sep 17 00:00:00 2001 From: ovc Date: Thu, 19 Sep 2024 18:52:09 +0300 Subject: [PATCH] kanban-color module added --- bx-custom-include/event-log/!main.php | 16 ++++++++ bx-custom-include/kanban-color/lang_ru.php | 3 ++ bx-custom-include/kanban-color/main.php | 16 ++++++++ bx-custom-include/kanban-color/script.js | 19 +++++++++ bx-custom-include/kanban-color/style.css | 46 ++++++++++++++++++++++ 5 files changed, 100 insertions(+) create mode 100644 bx-custom-include/event-log/!main.php create mode 100644 bx-custom-include/kanban-color/lang_ru.php create mode 100644 bx-custom-include/kanban-color/main.php create mode 100644 bx-custom-include/kanban-color/script.js create mode 100644 bx-custom-include/kanban-color/style.css diff --git a/bx-custom-include/event-log/!main.php b/bx-custom-include/event-log/!main.php new file mode 100644 index 0000000..9a2b120 --- /dev/null +++ b/bx-custom-include/event-log/!main.php @@ -0,0 +1,16 @@ + '/local/bx-custom-include/' . EMB_NAME . '/script.js', + 'css' => '/local/bx-custom-include/' . EMB_NAME . '/style.css', + 'lang' => '/local/bx-custom-include/' . EMB_NAME . '/lang_' . LANGUAGE_ID . '.php', + 'rel' => Array('popup', 'ajax', 'fx', 'ls', 'date', 'json', 'window','jquery'), + 'skip_core' => false, + ) +); +CJSCore::Init(array(EMB_NAME)); +?> \ No newline at end of file diff --git a/bx-custom-include/kanban-color/lang_ru.php b/bx-custom-include/kanban-color/lang_ru.php new file mode 100644 index 0000000..15c5adc --- /dev/null +++ b/bx-custom-include/kanban-color/lang_ru.php @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/bx-custom-include/kanban-color/main.php b/bx-custom-include/kanban-color/main.php new file mode 100644 index 0000000..fd11a24 --- /dev/null +++ b/bx-custom-include/kanban-color/main.php @@ -0,0 +1,16 @@ + '/local/bx-custom-include/' . EMB_NAME . '/script.js', + 'css' => '/local/bx-custom-include/' . EMB_NAME . '/style.css', + 'lang' => '/local/bx-custom-include/' . EMB_NAME . '/lang_' . LANGUAGE_ID . '.php', + 'rel' => Array('popup', 'ajax', 'fx', 'ls', 'date', 'json', 'window','jquery'), + 'skip_core' => false, + ) +); +CJSCore::Init(array(EMB_NAME)); +?> \ No newline at end of file diff --git a/bx-custom-include/kanban-color/script.js b/bx-custom-include/kanban-color/script.js new file mode 100644 index 0000000..ab1ff69 --- /dev/null +++ b/bx-custom-include/kanban-color/script.js @@ -0,0 +1,19 @@ +BX.addCustomEvent('Kanban.Grid:onRender', grid => { + if (grid.getData().entityType != 'DYNAMIC_183') + return; + + const items = grid.getItems(); + + for (let key in items) { + if (key < 1) continue; + const item = items[key]; + console.log(item); + if (!('data' in item) || !('dateCreate' in item.data)) continue; + const SIX_HOURS = 1000 * 60 * 60 * 6; + const createdDate = new Date(item.data.dateCreate); + if ((createdDate + SIX_HOURS) >= Date.now()) { + // new Date("18.09.2024 09:28:58", "DD.MM.YYYY HH:mm:ss") + BX.addClass(item.container, 'kanban-color-bg-animate'); + } + } +}); \ No newline at end of file diff --git a/bx-custom-include/kanban-color/style.css b/bx-custom-include/kanban-color/style.css new file mode 100644 index 0000000..ab23482 --- /dev/null +++ b/bx-custom-include/kanban-color/style.css @@ -0,0 +1,46 @@ +.kanban-color-bg-animate .crm-kanban-item-line { + -webkit-animation: pulse 2s infinite; + -moz-animation: pulse 2s infinite; + -o-animation: pulse 2s infinite; + animation: pulse 2s infinite; +} + +@-webkit-keyframes pulse { + 0% { + background-color: #fff; + } + + 100% { + background-color: #f54819; + } +} + +@-moz-keyframes pulse { + 0% { + background-color: #fff; + } + + 100% { + background-color: #f54819; + } +} + +@-o-keyframes pulse { + 0% { + background-color: #fff; + } + + 100% { + background-color: #f54819; + } +} + +@keyframes pulse { + 0% { + background-color: #fff; + } + + 100% { + background-color: #f54819; + } +} \ No newline at end of file