Files
TweakDrag/Plugin.php
2026-07-13 08:56:21 -03:00

66 lines
1.8 KiB
PHP

<?php
namespace Kanboard\Plugin\TweakDrag;
use Kanboard\Core\Plugin\Base;
class Plugin extends Base
{
public function initialize()
{
// Load the plugin stylesheet (drag cursor styling; inert until enabled).
$this->hook->on('template:layout:css', array(
'template' => 'plugins/TweakDrag/Asset/css/tweak-drag.css',
));
// Inject the column-gap CSS variable and, when enabled, the gap rule.
$this->template->hook->attach('template:layout:head', 'tweakDrag:layout/variable');
// Add a "Tweak Drag" entry to the Settings sidebar.
$this->template->hook->attach('template:config:sidebar', 'tweakDrag:config/sidebar');
// Optional: click-and-drag the board background to scroll horizontally.
if ((int) $this->configModel->get('tweakdrag_drag_scroll', 1) === 1) {
$this->hook->on('template:layout:js', array(
'template' => 'plugins/TweakDrag/Asset/js/drag-scroll.js',
));
}
// Auto-scroll the board while dragging a card near a screen edge. Always loaded;
// it only acts during an active card drag.
$this->hook->on('template:layout:js', array(
'template' => 'plugins/TweakDrag/Asset/js/drag-autoscroll.js',
));
}
public function getPluginName()
{
return 'TweakDrag';
}
public function getPluginDescription()
{
return t('Board drag, touch and column-gap tweaks (drag-to-scroll, wider column gap).');
}
public function getPluginAuthor()
{
return 'Ruben (drbeco)';
}
public function getPluginVersion()
{
return '1.2.4';
}
public function getPluginHomepage()
{
return 'https://code.beco.cc/beco/TweakDrag';
}
public function getCompatibleVersion()
{
return '>=1.2.0';
}
}