Initial Commit

This commit is contained in:
Michail Topaloudis 2021-05-26 09:34:24 +01:00
parent f32e259b9a
commit 001c40d17a
14 changed files with 1756 additions and 0 deletions

File diff suppressed because it is too large Load diff

191
Assets/css/prism.css Normal file
View file

@ -0,0 +1,191 @@
/* PrismJS 1.20.0
https://prismjs.com/download.html#themes=prism-okaidia&languages=markup+css+clike+javascript+abap+abnf+actionscript+ada+al+antlr4+apacheconf+apl+applescript+aql+arduino+arff+asciidoc+asm6502+aspnet+autohotkey+autoit+bash+basic+batch+bbcode+bison+bnf+brainfuck+brightscript+bro+c+concurnas+csharp+cpp+cil+coffeescript+cmake+clojure+crystal+csp+css-extras+d+dart+dax+diff+django+dns-zone-file+docker+ebnf+eiffel+ejs+elixir+elm+etlua+erb+erlang+excel-formula+fsharp+factor+firestore-security-rules+flow+fortran+ftl+gcode+gdscript+gedcom+gherkin+git+glsl+gml+go+graphql+groovy+haml+handlebars+haskell+haxe+hcl+hlsl+http+hpkp+hsts+ichigojam+icon+iecst+inform7+ini+io+j+java+javadoc+javadoclike+javastacktrace+jolie+jq+jsdoc+js-extras+js-templates+json+jsonp+json5+julia+keyman+kotlin+latex+latte+less+lilypond+liquid+lisp+livescript+llvm+lolcode+lua+makefile+markdown+markup-templating+matlab+mel+mizar+monkey+moonscript+n1ql+n4js+nand2tetris-hdl+nasm+neon+nginx+nim+nix+nsis+objectivec+ocaml+opencl+oz+parigp+parser+pascal+pascaligo+pcaxis+peoplecode+perl+php+phpdoc+php-extras+plsql+powerquery+powershell+processing+prolog+properties+protobuf+pug+puppet+pure+purebasic+python+q+qml+qore+r+racket+jsx+tsx+renpy+reason+regex+rest+rip+roboconf+robotframework+ruby+rust+sas+sass+scss+scala+scheme+shell-session+smalltalk+smarty+solidity+solution-file+soy+sparql+splunk-spl+sqf+sql+stylus+swift+tap+tcl+textile+toml+tt2+turtle+twig+typescript+t4-cs+t4-vb+t4-templating+unrealscript+vala+vbnet+velocity+verilog+vhdl+vim+visual-basic+warpscript+wasm+wiki+xeora+xml-doc+xojo+xquery+yaml+zig&plugins=show-language+toolbar+copy-to-clipboard */
/**
* okaidia theme for JavaScript, CSS and HTML
* Loosely based on Monokai textmate theme by http://www.monokai.nl/
* @author ocodia
*/

code[class*="language-"],
pre[class*="language-"] {
color: #f8f8f2;
background: none;
text-shadow: 0 1px rgba(0, 0, 0, 0.3);
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
font-size: 1em;
text-align: left;
white-space: pre;
word-spacing: normal;
word-break: normal;
word-wrap: normal;
line-height: 1.5;

-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;

-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}

/* Code blocks */
pre[class*="language-"] {
padding: 1em;
margin: .5em 0;
overflow: auto;
border-radius: 0.3em;
}

:not(pre) > code[class*="language-"],
pre[class*="language-"] {
background: #272822;
}

/* Inline code */
:not(pre) > code[class*="language-"] {
padding: .1em;
border-radius: .3em;
white-space: normal;
}

.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
color: slategray;
}

.token.punctuation {
color: #f8f8f2;
}

.token.namespace {
opacity: .7;
}

.token.property,
.token.tag,
.token.constant,
.token.symbol,
.token.deleted {
color: #f92672;
}

.token.boolean,
.token.number {
color: #ae81ff;
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
color: #a6e22e;
}

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string,
.token.variable {
color: #f8f8f2;
}

.token.atrule,
.token.attr-value,
.token.function,
.token.class-name {
color: #e6db74;
}

.token.keyword {
color: #66d9ef;
}

.token.regex,
.token.important {
color: #fd971f;
}

.token.important,
.token.bold {
font-weight: bold;
}
.token.italic {
font-style: italic;
}

.token.entity {
cursor: help;
}

div.code-toolbar {
position: relative;
}

div.code-toolbar > .toolbar {
position: absolute;
top: .3em;
right: .2em;
transition: opacity 0.3s ease-in-out;
opacity: 0;
}

div.code-toolbar:hover > .toolbar {
opacity: 1;
}

/* Separate line b/c rules are thrown out if selector is invalid.
IE11 and old Edge versions don't support :focus-within. */
div.code-toolbar:focus-within > .toolbar {
opacity: 1;
}

div.code-toolbar > .toolbar .toolbar-item {
display: inline-block;
}

div.code-toolbar > .toolbar a {
cursor: pointer;
}

div.code-toolbar > .toolbar button {
background: none;
border: 0;
color: inherit;
font: inherit;
line-height: normal;
overflow: visible;
padding: 0;
-webkit-user-select: none; /* for button */
-moz-user-select: none;
-ms-user-select: none;
}

div.code-toolbar > .toolbar a,
div.code-toolbar > .toolbar button,
div.code-toolbar > .toolbar span {
color: #bbb;
font-size: .8em;
padding: 0 .5em;
background: #f5f2f0;
background: rgba(224, 224, 224, 0.2);
box-shadow: 0 2px 0 0 rgba(0,0,0,0.2);
border-radius: .5em;
}

div.code-toolbar > .toolbar a:hover,
div.code-toolbar > .toolbar a:focus,
div.code-toolbar > .toolbar button:hover,
div.code-toolbar > .toolbar button:focus,
div.code-toolbar > .toolbar span:hover,
div.code-toolbar > .toolbar span:focus {
color: inherit;
text-decoration: none;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

7
Assets/js/clipboard.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,18 @@
$(window).scroll(function() {
var height = $(window).scrollTop();

if (height > 200) {
$('#backToTop').fadeIn();
}
else {
$('#backToTop').fadeOut();
}
});

$(document).ready(function() {
$("#backToTop").click(function(event) {
event.preventDefault();
$("html, body").animate({ scrollTop: 0 }, "slow");
return false;
});
});

224
Assets/js/prism.js Normal file

File diff suppressed because one or more lines are too long

5
Makefile Normal file
View file

@ -0,0 +1,5 @@
plugin = OneExperienceKB

all:
@ echo "Build archive for plugin ${plugin}"
@ git archive HEAD --prefix=${plugin}/ --format=zip -o ${plugin}.zip

61
Plugin.php Normal file
View file

@ -0,0 +1,61 @@
<?php

namespace Kanboard\Plugin\OneExperienceKB;

use Kanboard\Core\Plugin\Base;

class Plugin extends Base {
public function initialize() {
global $themeOneExperienceKBConfig;

if (file_exists(DATA_DIR . '/files/OneExperienceKB/config.php')) {
require_once(DATA_DIR . '/files/OneExperienceKB/config.php');
}
else {
mkdir(DATA_DIR . '/files/OneExperienceKB/Assets/images', 0755, true);
copy('plugins/OneExperienceKB/config.php', DATA_DIR . '/files/OneExperienceKB/config.php');
copy('plugins/OneExperienceKB/Assets/images/brand-logo.png', DATA_DIR . '/files/OneExperienceKB/Assets/images/brand-logo.png');
}

if (file_exists('plugins/Customizer')) {
$this->template->setTemplateOverride('header/title', 'OneExperienceKB:layout/header/customizerTitle');
$this->template->setTemplateOverride('header', 'OneExperienceKB:header');
$this->template->setTemplateOverride('layout', 'OneExperienceKB:layout');
}
elseif (isset($themeOneExperienceKBConfig['logo'])) {
$this->template->setTemplateOverride('header/title', 'OneExperienceKB:layout/header/title');
$this->template->setTemplateOverride('header', 'OneExperienceKB:header');
$this->template->setTemplateOverride('layout', 'OneExperienceKB:layout');
}

$this->hook->on('template:layout:css', array('template' => 'plugins/OneExperienceKB/Assets/css/oneexperiencekb.css'));
$this->hook->on('template:layout:css', array('template' => 'plugins/OneExperienceKB/Assets/css/prism.css'));
$this->hook->on('template:layout:js', array('template' => 'plugins/OneExperienceKB/Assets/js/clipboard.min.js'));
$this->hook->on('template:layout:js', array('template' => 'plugins/OneExperienceKB/Assets/js/prism.js'));
$this->hook->on('template:layout:js', array('template' => 'plugins/OneExperienceKB/Assets/js/oneexperiencekb.js'));
}

public function getPluginName() {
return 'OneExperienceKB';
}

public function getPluginDescription() {
return t('This theme allows you to add special features like replacing the logo and adds syntax highlighting for Markdown code.');
}

public function getPluginAuthor() {
return 'Michail Topaloudis';
}

public function getPluginVersion() {
return '1.0.1';
}

public function getCompatibleVersion() {
return '>=1.0.48';
}

public function getPluginHomepage() {
return 'https://github.com/mojiro/OneExperienceKB';
}
}

38
Template/header.php Normal file
View file

@ -0,0 +1,38 @@
<?php global $themeOneExperienceKBConfig; ?>
<?php if (file_exists('plugins/Customizer')): ?>
<?php $_title = $this->render('OneExperienceKB:layout/header/customizerTitle', array(
'project' => isset($project) ? $project : null,
'task' => isset($task) ? $task : null,
'description' => isset($description) ? $description : null,
'title' => $title,
)); ?>
<?php else: ?>
<?php $_title = $this->render('header/title', array(
'project' => isset($project) ? $project : null,
'task' => isset($task) ? $task : null,
'description' => isset($description) ? $description : null,
'title' => $title,
)); ?>
<?php endif ?>
<?php $_top_right_corner = implode('&nbsp;', array(
$this->render('header/user_notifications'),
$this->render('header/creation_dropdown'),
$this->render('header/user_dropdown')
)); ?>
<?php if (!isset($themeOneExperienceKBConfig['backgroundColorHeader'])) : ?>
<header>
<?php else: ?>
<header style="background:<?= $themeOneExperienceKBConfig['backgroundColorHeader'] ?>">
<?php endif ?>
<div class="title-container">
<?= $_title ?>
</div>
<div class="board-selector-container">
<?php if (! empty($board_selector)): ?>
<?= $this->render('header/board_selector', array('board_selector' => $board_selector)) ?>
<?php endif ?>
</div>
<div class="menus-container">
<?= $_top_right_corner ?>
</div>
</header>

85
Template/layout.php Normal file
View file

@ -0,0 +1,85 @@
<!DOCTYPE html>
<html lang="<?= $this->app->jsLang() ?>">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="mobile-web-app-capable" content="yes">
<meta name="robots" content="noindex,nofollow">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="referrer" content="no-referrer">

<?php if (isset($board_public_refresh_interval)): ?>
<meta http-equiv="refresh" content="<?= $board_public_refresh_interval ?>">
<?php endif ?>

<?= $this->asset->colorCss() ?>
<?= $this->asset->css('assets/css/vendor.min.css') ?>
<?= $this->asset->css('assets/css/app.min.css') ?>
<?= $this->asset->css('assets/css/print.min.css', true, 'print') ?>
<?= $this->asset->customCss() ?>

<?php if (! isset($not_editable)): ?>
<?= $this->asset->js('assets/js/vendor.min.js') ?>
<?= $this->asset->js('assets/js/app.min.js') ?>
<?php endif ?>

<?= $this->hook->asset('css', 'template:layout:css') ?>
<?= $this->hook->asset('js', 'template:layout:js') ?>
<?php if (file_exists('plugins/Customizer') && null !== $this->task->customizerFileModel->getByType(2)) : ?>
<link rel="icon" type="image/png" href="<?= $this->url->href('CustomizerFileController', 'image', array('plugin' => 'customizer', 'file_id' => $this->task->customizerFileModel->getIdByType(2))) ?>">
<link rel="apple-touch-icon" href="<?= $this->url->href('CustomizerFileController', 'image', array('plugin' => 'customizer', 'file_id' => $this->task->customizerFileModel->getIdByType(2))) ?>">
<link rel="apple-touch-icon" sizes="72x72" href="<?= $this->url->href('CustomizerFileController', 'image', array('plugin' => 'customizer', 'file_id' => $this->task->customizerFileModel->getIdByType(2))) ?>">
<link rel="apple-touch-icon" sizes="114x114" href="<?= $this->url->href('CustomizerFileController', 'image', array('plugin' => 'customizer', 'file_id' => $this->task->customizerFileModel->getIdByType(2))) ?>">
<link rel="apple-touch-icon" sizes="144x144" href="<?= $this->url->href('CustomizerFileController', 'image', array('plugin' => 'customizer', 'file_id' => $this->task->customizerFileModel->getIdByType(2))) ?>">
<?php else: ?>
<link rel="icon" type="image/png" href="<?= $this->url->dir() ?>assets/img/favicon.png">
<link rel="apple-touch-icon" href="<?= $this->url->dir() ?>assets/img/touch-icon-iphone.png">
<link rel="apple-touch-icon" sizes="72x72" href="<?= $this->url->dir() ?>assets/img/touch-icon-ipad.png">
<link rel="apple-touch-icon" sizes="114x114" href="<?= $this->url->dir() ?>assets/img/touch-icon-iphone-retina.png">
<link rel="apple-touch-icon" sizes="144x144" href="<?= $this->url->dir() ?>assets/img/touch-icon-ipad-retina.png">
<?php endif ?>

<title>
<?php if (isset($page_title)): ?>
<?= $this->text->e($page_title) ?>
<?php elseif (isset($title)): ?>
<?= $this->text->e($title) ?>
<?php else: ?>
Kanboard
<?php endif ?>
</title>

<?= $this->hook->render('template:layout:head') ?>
</head>
<body data-status-url="<?= $this->url->href('UserAjaxController', 'status') ?>"
data-login-url="<?= $this->url->href('AuthController', 'login') ?>"
data-keyboard-shortcut-url="<?= $this->url->href('DocumentationController', 'shortcuts') ?>"
data-timezone="<?= $this->app->getTimezone() ?>"
data-js-date-format="<?= $this->app->getJsDateFormat() ?>"
data-js-time-format="<?= $this->app->getJsTimeFormat() ?>"
data-js-modal-close-msg="<?= t('Close window?\\n\\nChanges that you made have not been saved.') ?>"
>
<?php if (isset($no_layout) && $no_layout): ?>
<?= $this->app->flashMessage() ?>
<?= $content_for_layout ?>
<?php else: ?>
<?= $this->hook->render('template:layout:top') ?>
<?= $this->render('header', array(
'title' => $title,
'description' => isset($description) ? $description : '',
'board_selector' => isset($board_selector) ? $board_selector : array(),
'project' => isset($project) ? $project : array(),
)) ?>
<section class="page">
<?= $this->app->flashMessage() ?>
<?= $content_for_layout ?>
</section>
<?= $this->hook->render('template:layout:bottom') ?>
<div id="to-top">
<a href="#backToTop" id="backToTop" class="topshow">
<span><i class="fa fa-chevron-up" aria-hidden="true"></i></span>
</a>
</div>
<?php endif ?>
</body>
</html>

View file

@ -0,0 +1,22 @@
<?php global $themeOneExperienceKBConfig; ?>
<span class="logo">
<?php if (null !== $this->task->customizerFileModel->getByType(1)) : ?>
<?= $this->url->link('<img src="'.$this->url->href("CustomizerFileController", "image", array("plugin" => "customizer", "file_id" => $this->task->customizerFileModel->getIdByType(1))).'" style="float: left;max-height: 40px;margin-top: -7px;margin-right: 10px;" >', 'DashboardController', 'show', array(), false, '', t('Dashboard')) ?>
<?php endif ?>
</span>
<?php if (!isset($themeOneExperienceKBConfig['HeadingTitleColor'])) : ?>
<h1>
<?php else: ?>
<h1 style="color:<?= $themeOneExperienceKBConfig['HeadingTitleColor'] ?>">
<?php endif ?>
<span class="title">
<?php if (! empty($project) && ! empty($task)): ?>
<?= $this->url->link($this->text->e($project['name']), 'BoardViewController', 'show', array('project_id' => $project['id'])) ?>
<?php else: ?>
<?= $this->text->e($title) ?>
<?php endif ?>
</span>
<?php if (! empty($description)): ?>
<?= $this->app->tooltipHTML($description) ?>
<?php endif ?>
</h1>

View file

@ -0,0 +1,24 @@
<?php global $themeOneExperienceKBConfig; ?>
<span class="logo">
<?php if (!isset($themeOneExperienceKBConfig['logo'])) : ?>
<?= $this->url->link('K<span>B</span>', 'DashboardController', 'show', array(), false, '', t('Dashboard')) ?>
<?php else: ?>
<?= $this->url->link('<img src="'.$themeOneExperienceKBConfig['logo'].'" style="float: left;max-height: 40px;margin-top: -7px;margin-right: 10px;" />', 'DashboardController', 'show', array(), false, '', t('Dashboard')) ?>
<?php endif ?>
</span>
<?php if (!isset($themeOneExperienceKBConfig['HeadingTitleColor'])) : ?>
<h1>
<?php else: ?>
<h1 style="color:<?= $themeOneExperienceKBConfig['HeadingTitleColor'] ?>">
<?php endif ?>
<span class="title">
<?php if (! empty($project) && ! empty($task)): ?>
<?= $this->url->link($this->text->e($project['name']), 'BoardViewController', 'show', array('project_id' => $project['id'])) ?>
<?php else: ?>
<?= $this->text->e($title) ?>
<?php endif ?>
</span>
<?php if (! empty($description)): ?>
<?= $this->app->tooltipHTML($description) ?>
<?php endif ?>
</h1>

4
_config.yml Normal file
View file

@ -0,0 +1,4 @@
theme: mojiro-OneExperienceKB
title: Kanboard plugin theme
plugins:
- prism

14
config.php Normal file
View file

@ -0,0 +1,14 @@
<?php
/*******************************************************************/
/* if you want to change the values */
/*******************************************************************/

// Change the logo or color to the title and heading
// Just copy your logo-file in the "data/files/OneExperienceKB/Assets/images"
// The file should be to 50 Pixel is a good height

$themeOneExperienceKBConfig['logo'] = '/data/files/OneExperienceKB/Assets/images/brand-logo.png';

$themeOneExperienceKBConfig['backgroundColorHeader'] = '#0078d7';

$themeOneExperienceKBConfig['HeadingTitleColor'] = '#fff';