From b52762e06e69a00d74629c5609d0e1d26a0ef265 Mon Sep 17 00:00:00 2001 From: Tomas Dittmann Date: Mon, 6 Dec 2021 16:51:50 +0100 Subject: [PATCH] Add files via upload --- RCB/Assets/css/style.css | 3 +++ RCB/Assets/js/function.js | 9 +++++++++ RCB/Plugin.php | 39 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 51 insertions(+) create mode 100644 RCB/Assets/css/style.css create mode 100644 RCB/Assets/js/function.js create mode 100644 RCB/Plugin.php diff --git a/RCB/Assets/css/style.css b/RCB/Assets/css/style.css new file mode 100644 index 0000000..5a39746 --- /dev/null +++ b/RCB/Assets/css/style.css @@ -0,0 +1,3 @@ +pre { + resize:both +} \ No newline at end of file diff --git a/RCB/Assets/js/function.js b/RCB/Assets/js/function.js new file mode 100644 index 0000000..d35fc8a --- /dev/null +++ b/RCB/Assets/js/function.js @@ -0,0 +1,9 @@ +KB.on('dom.ready', function() { + var list = [...document.getElementsByTagName("pre")] + + for (let item of list) { + if (item.scrollHeight > 200) { + item.style.height = "200px" + } + } +}); diff --git a/RCB/Plugin.php b/RCB/Plugin.php new file mode 100644 index 0000000..4a2bee8 --- /dev/null +++ b/RCB/Plugin.php @@ -0,0 +1,39 @@ +hook->on('template:layout:css', array('template' => 'plugins/RCB/Assets/css/style.css')); + $this->hook->on('template:layout:js', array('template' => 'plugins/RCB/Assets/js/function.js')); + } + + public function getPluginName() + { + return 'Resizable codeblocks'; + } + + public function getPluginDescription() + { + return 'Make codeblocks resizable, scrollable and limit their initial height to 200 pixels'; + } + + public function getPluginAuthor() + { + return 'Tomas Dittmann'; + } + + public function getPluginVersion() + { + return '1.0.0'; + } + + public function getPluginHomepage() + { + return "https://github.com/Chaosmeister/RCB"; + } +}