add contents

This commit is contained in:
Trevor Batley
2025-10-09 15:04:29 +11:00
parent 170362eec1
commit bce7dd054a
2537 changed files with 301282 additions and 0 deletions

View File

View File

@@ -0,0 +1,72 @@
<?php
/**
* Composant Action pour HowHard (Toolbar)
*
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
* @author Fabrice DEJAIGHER <fabrice@chtiland.com>
*/
if (!defined('DOKU_INC'))
{
die();
}
if (!defined('DOKU_PLUGIN'))
{
define('DOKU_PLUGIN', DOKU_INC . 'lib/plugins/');
}
require_once(DOKU_PLUGIN . 'action.php');
class action_plugin_howhard extends DokuWiki_Action_Plugin
{
function register(Doku_Event_Handler $controller)
{
$controller->register_hook('TOOLBAR_DEFINE', 'AFTER', $this, 'handle_toolbar', array ());
}
function handle_toolbar(&$event, $param)
{
$event->data[] = array
(
'type' => 'picker',
'title' => 'HowHard',
'class' => 'howhard_toolbar',
'icon' => '../../plugins/howhard/images/toolbar/level_select.png',
'list' => array (
array (
'type' => 'insert',
'title' => $this->getLang('level1'),
'icon' => '../../plugins/howhard/images/toolbar/1.png',
'insert' => '{{howhard>1}}',
),
array (
'type' => 'insert',
'title' => $this->getLang('level2'),
'icon' => '../../plugins/howhard/images/toolbar/2.png',
'insert' => '{{howhard>2}}',
),
array (
'type' => 'insert',
'title' => $this->getLang('level3'),
'icon' => '../../plugins/howhard/images/toolbar/3.png',
'insert' => '{{howhard>3}}',
),
array (
'type' => 'insert',
'title' => $this->getLang('level4'),
'icon' => '../../plugins/howhard/images/toolbar/4.png',
'insert' => '{{howhard>4}}',
),
array (
'type' => 'insert',
'title' => $this->getLang('level5'),
'icon' => '../../plugins/howhard/images/toolbar/5.png',
'insert' => '{{howhard>5}}',
)
)
);
}
}

View File

@@ -0,0 +1,9 @@
<?php
/**
* Default settings for the howhard plugin
*
* @author Fabrice DEJAIGHER <fabrice@chtiland.com>
*/
$conf['confhowhardstyle'] = '1';
$conf['confhowhardcompact'] = '0';

View File

@@ -0,0 +1,10 @@
<?php
/**
* Options for the Howhard plugin
*
* @author Fabrice DEJAIGHER <fabrice@chtiland.com>
*/
$meta['confhowhardstyle'] = array('multichoice','_choices' => array('1','2','3','4'));
$meta['confhowhardcompact'] = array('onoff');

View File

@@ -0,0 +1,3 @@
.idea/dictionaries/fabrice.xml
.idea/dictionaries/
.idea/

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 696 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 757 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 694 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 713 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 735 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 603 B

View File

@@ -0,0 +1,13 @@
<?php
/**
* German language file for howhard plugin
*
* @author taggic http://forum.dokuwiki.org/user/6866
*/
$lang['howhardtitle'] = 'Komplexit&auml;t'; // Schwierigkeitsgrad, Anforderung
$lang['level1'] = 'sehr leicht'; // sehr einfach - Neuling
$lang['level2'] = 'leicht'; // einfach - Anfänger
$lang['level3'] = 'mittel'; // durchschnittlich - Anwender
$lang['level4'] = 'schwer'; // hoch - Fachmann
$lang['level5'] = 'sehr schwer'; // sehr hoch - Meister

View File

@@ -0,0 +1,9 @@
<?php
/**
* German language file for howhard plugin
*
* @author taggic http://forum.dokuwiki.org/user/6866
*/
$lang['confhowhardstyle'] = 'W&auml;hle ein Bild :<br>1 : <img src="'.DOKU_BASE.'lib/plugins/howhard/images/style1/3.png"><br>2 : <img src="'.DOKU_BASE.'lib/plugins/howhard/images/style2/3.png"><br><br>3 : <img src="'.DOKU_BASE.'lib/plugins/howhard/images/style3/3.png"><br><br>4 : <img src="'.DOKU_BASE.'lib/plugins/howhard/images/style4/3.png">';

View File

@@ -0,0 +1,19 @@
<?php
/**
* English language file for howhard plugin
*
* @author Fabrice DEJAIGHER <fabrice@chtiland.com>
*/
// menu entry for admin plugins
// $lang['menu'] = 'Your menu entry';
// custom language strings for the plugin
$lang['howhardtitle'] = 'Difficulty';
$lang['level1'] = 'Very easy';
$lang['level2'] = 'Easy';
$lang['level3'] = 'Medium';
$lang['level4'] = 'Hard';
$lang['level5'] = 'Very Hard';

View File

@@ -0,0 +1,13 @@
<?php
/**
* english language file for howhard plugin
*
* @author Fabrice DEJAIGHER <fabrice@chtiland.com>
*/
// keys need to match the config setting name
// $lang['fixme'] = 'FIXME';
$lang['confhowhardcompact'] = 'Compact style (not working with style 1)';
$lang['confhowhardstyle'] = 'Choose image :<br>1 : <img src="'.DOKU_BASE.'lib/plugins/howhard/images/style1/3.png"><br>2 : <img src="'.DOKU_BASE.'lib/plugins/howhard/images/style2/3.png"><br><br>3 : <img src="'.DOKU_BASE.'lib/plugins/howhard/images/style3/3.png"><br><br>4 : <img src="'.DOKU_BASE.'lib/plugins/howhard/images/style4/3.png">';

View File

@@ -0,0 +1,13 @@
<?php
/**
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
*
* @author polkillas <polkillas@polkillas.net>
*/
$lang['howhardtitle'] = 'Dificultad';
$lang['level1'] = 'Muy fácil';
$lang['level2'] = 'Fácil';
$lang['level3'] = 'Media';
$lang['level4'] = 'Difícil';
$lang['level5'] = 'Muy difícil';

View File

@@ -0,0 +1,8 @@
<?php
/**
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
*
* @author polkillas <polkillas@polkillas.net>
*/
$lang['confhowhardstyle'] = 'Escoge imagen :<br>1 : <img src="'.DOKU_BASE.'lib/plugins/howhard/images/style1/3.png"><br>2 : <img src="'.DOKU_BASE.'lib/plugins/howhard/images/style2/3.png"><br><br>3 : <img src="'.DOKU_BASE.'lib/plugins/howhard/images/style3/3.png"><br><br>4 : <img src="'.DOKU_BASE.'lib/plugins/howhard/images/style4/3.png">';

View File

@@ -0,0 +1,14 @@
<?php
/**
* French language file for howhard plugin
*
* @author Fabrice DEJAIGHER <fabrice@chtiland.com>
*/
$lang['howhardtitle'] = 'Difficulté';
$lang['level1'] = 'Très facile';
$lang['level2'] = 'Facile';
$lang['level3'] = 'Moyen';
$lang['level4'] = 'Difficile';
$lang['level5'] = 'Très difficile';

View File

@@ -0,0 +1,10 @@
<?php
/**
* French language file for howhard plugin
*
* @author Fabrice DEJAIGHER <fabrice@chtiland.com>
*/
$lang['confhowhardcompact'] = 'Style compact (Non compatible avec le style 1).';
$lang['confhowhardstyle'] = 'Choix de l\'image :<br>1 : <img src="'.DOKU_BASE.'lib/plugins/howhard/images/style1/3.png"><br>2 : <img src="'.DOKU_BASE.'lib/plugins/howhard/images/style2/3.png"><br><br>3 : <img src="'.DOKU_BASE.'lib/plugins/howhard/images/style3/3.png"><br><br>4 : <img src="'.DOKU_BASE.'lib/plugins/howhard/images/style4/3.png">';

View File

@@ -0,0 +1,13 @@
<?php
/**
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
*
* @author Myeongjin <aranet100@gmail.com>
*/
$lang['howhardtitle'] = '난이도';
$lang['level1'] = '매우 쉬움';
$lang['level2'] = '쉬움';
$lang['level3'] = '보통';
$lang['level4'] = '어려움';
$lang['level5'] = '매우 어려움';

View File

@@ -0,0 +1,9 @@
<?php
/**
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
*
* @author Myeongjin <aranet100@gmail.com>
*/
$lang['compact'] = '아담한 스타일 (스타일 1로 된 부족한 측면)';
$lang['confhowhardstyle'] = '그림 선택 :<br>1 : <img src="/lib/plugins/howhard/images/style1/3.png"><br>2 : <img src="/lib/plugins/howhard/images/style2/3.png"><br><br>3 : <img src="/lib/plugins/howhard/images/style3/3.png"><br><br>4 : <img src="/lib/plugins/howhard/images/style4/3.png">';

View File

@@ -0,0 +1,13 @@
<?php
/**
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
*
* @author Rene <wllywlnt@yahoo.com>
*/
$lang['howhardtitle'] = 'Moeilijkheid';
$lang['level1'] = 'Erg makkelijk';
$lang['level2'] = 'Gemakkelijk';
$lang['level3'] = 'Gemiddeld';
$lang['level4'] = 'Moeilijk';
$lang['level5'] = 'Erg Moeilijk';

View File

@@ -0,0 +1,8 @@
<?php
/**
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
*
* @author Rene <wllywlnt@yahoo.com>
*/
$lang['confhowhardstyle'] = 'Kies plaatje:<br>1 : <img src="'.DOKU_BASE.'lib/plugins/howhard/images/style1/3.png"><br>2 : <img src="'.DOKU_BASE.'lib/plugins/howhard/images/style2/3.png"><br><br>3 : <img src="'.DOKU_BASE.'lib/plugins/howhard/images/style3/3.png"><br><br>4 : <img src="'.DOKU_BASE.'lib/plugins/howhard/images/style4/3.png">';

View File

@@ -0,0 +1,13 @@
<?php
/**
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
*
* @author Arne Hanssen <arne.hanssen@getmail.no>
*/
$lang['howhardtitle'] = 'Vanskelig';
$lang['level1'] = 'Svært lett';
$lang['level2'] = 'Lett';
$lang['level3'] = 'Medium';
$lang['level4'] = 'Hard';
$lang['level5'] = 'Svært hard';

View File

@@ -0,0 +1,9 @@
<?php
/**
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
*
* @author Arne Hanssen <arne.hanssen@getmail.no>
*/
$lang['compact'] = 'Kompakt stil (ikke kompatibel med bilde 1)';
$lang['confhowhardstyle'] = 'Velg bilde:<br>1: <img src="/lib/plugins/howhard/images/style1/3.png"><br>2: <img src="/lib/plugins/howhard/images/style2/3.png"><br><br>3: <img src="/lib/plugins/howhard/images/style3/3.png"><br><br>4: <img src="/lib/plugins/howhard/images/style4/3.png">';

View File

@@ -0,0 +1,13 @@
<?php
/**
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
*
* @author Alexandre Belchior <alexbelchior@gmail.com>
*/
$lang['howhardtitle'] = 'Dificuldade';
$lang['level1'] = 'Muito fácil';
$lang['level2'] = 'Fácil';
$lang['level3'] = 'Médio';
$lang['level4'] = 'Difícil';
$lang['level5'] = 'Muito difícil';

View File

@@ -0,0 +1,9 @@
<?php
/**
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
*
* @author Alexandre Belchior <alexbelchior@gmail.com>
*/
$lang['compact'] = 'Estilo compacto (aspecto pobre com estilo 1)';
$lang['confhowhardstyle'] = 'Escolha a imagem :<br>1 : <img src="/lib/plugins/howhard/images/style1/3.png"><br>2 : <img src="/lib/plugins/howhard/images/style2/3.png"><br><br>3 : <img src="/lib/plugins/howhard/images/style3/3.png"><br><br>4 : <img src="/lib/plugins/howhard/images/style4/3.png">';

View File

@@ -0,0 +1,13 @@
<?php
/**
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
*
* @author Aleksandr Selivanov <alexgearbox@yandex.ru>
*/
$lang['howhardtitle'] = 'Сложность';
$lang['level1'] = 'очень низкая';
$lang['level2'] = 'низкая';
$lang['level3'] = 'средняя';
$lang['level4'] = 'высокая';
$lang['level5'] = 'очень высокая';

View File

@@ -0,0 +1,8 @@
<?php
/**
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
*
* @author Aleksandr Selivanov <alexgearbox@yandex.ru>
*/
$lang['confhowhardstyle'] = 'Выберите изображение:<br>1. <img src="'.DOKU_BASE.'lib/plugins/howhard/images/style1/3.png"><br>2. <img src="'.DOKU_BASE.'lib/plugins/howhard/images/style2/3.png"><br><br>3 : <img src="'.DOKU_BASE.'lib/plugins/howhard/images/style3/3.png"><br><br>4 : <img src="'.DOKU_BASE.'lib/plugins/howhard/images/style4/3.png">';

View File

@@ -0,0 +1,13 @@
<?php
/**
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
*
* @author ilker R. Kapac <irifat@gmail.com>
*/
$lang['howhardtitle'] = 'Zorluk Seviyesi';
$lang['level1'] = 'Çok kolay';
$lang['level2'] = 'Kolay';
$lang['level3'] = 'Orta';
$lang['level4'] = 'Zor';
$lang['level5'] = 'Çok zor';

View File

@@ -0,0 +1,10 @@
<?php
/**
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
*
* @author ilker R. Kapac <irifat@gmail.com>
* @author İlker Kapaç <irifat@gmail.com>
*/
$lang['compact'] = 'Basit Düzen';
$lang['confhowhardstyle'] = 'Kullanılacak görseli seçin :<br>1 : <img src="/lib/plugins/howhard/images/style1/3.png"><br>2 : <img src="/lib/plugins/howhard/images/style2/3.png"><br><br>3 : <img src="/lib/plugins/howhard/images/style3/3.png"><br><br>4 : <img src="/lib/plugins/howhard/images/style4/3.png">';

View File

@@ -0,0 +1,8 @@
# General Plugin Info do not edit
base howhard
author Fabrice DEJAIGHER pour Chtiland.fr
email fabrice@chtiland.com
date 2016-05-15
name Plugin HowHard
desc Rate difficulty of an article
url https://www.dokuwiki.org/plugin:howhard

View File

@@ -0,0 +1,44 @@
.howhard {
float: right;
width: 150px;
border-radius: 10px;
text-align: center;
border: 1px solid #777;
box-shadow: 3px 3px 0 #aaa;
}
.howhard_img {
margin-top: 5px;
}
.howhard_txt {
font-weight: bold;
font-size: 14px;
}
.howhard_title {
font-weight: bold;
font-size: 16px;
border-bottom: 1px solid;
}
.howhard_compact {
float: right;
width: 130px;
text-align: center;
}
.howhard_img_compact {
margin-top: 0;
}
.howhard_txt_compact {
margin-top: -21px;
font-weight: bold;
font-size: 14px;
}
div.picker.howhard_toolbar {
width: auto;
}

View File

@@ -0,0 +1,136 @@
<?php
/**
* DokuWiki Plugin HowHard (Syntax Component)
*
* @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html
* @author Fabrice DEJAIGHER <fabrice@chtiland.com>
*/
// must be run within Dokuwiki
if (!defined('DOKU_INC'))
{
die();
}
if (!defined('DOKU_LF'))
{
define('DOKU_LF', "\n");
}
if (!defined('DOKU_TAB'))
{
define('DOKU_TAB', "\t");
}
if (!defined('DOKU_PLUGIN'))
{
define('DOKU_PLUGIN', DOKU_INC . 'lib/plugins/');
}
require_once DOKU_PLUGIN.'syntax.php';
class syntax_plugin_howhard extends DokuWiki_Syntax_Plugin
{
var $notes_hh = array('1','2','3','4','5');
var $note_defaut = '1';
public function getType()
{
return 'container';
}
public function getPType()
{
return 'normal';
}
public function getAllowedTypes()
{
return array('container','substition','protected','disabled','formatting','paragraphs');
}
public function getSort()
{
return 195;
}
public function connectTo($mode)
{
$this->Lexer->addSpecialPattern('\{\{howhard>.*?\}\}',$mode,'plugin_howhard');
}
public function handle($match, $state, $pos, Doku_Handler $handler)
{
switch ($state)
{
case DOKU_LEXER_ENTER :
break;
case DOKU_LEXER_UNMATCHED :
return array($state,$this->note_defaut);
break;
case DOKU_LEXER_SPECIAL :
$retour = substr($match,-3,1);
if(!in_array("$retour",$this->notes_hh) or empty($retour))
{
$retour=$this->note_defaut;
}
return array($state,$retour);
break;
default :
return array($state);
}
}
public function render($mode, Doku_Renderer $renderer, $indata)
{
list($state, $data) = $indata;
if($mode == 'xhtml')
{
// Compact mode ?
$isCompact = false;
if($this->getConf('confhowhardcompact') // Activated
&& $this->getConf('confhowhardstyle') != 1) // But not for style '1'
{
$isCompact = '_compact';
}
// vars
$text_level = 'level'.$data;
$style = $this->getConf('confhowhardstyle');
// Render
$renderer->doc.= '<div class="howhard'.$isCompact.'">';
if(!$isCompact) // If not compact, add title.
{
$renderer->doc.= '<div class="howhard_title">'.$this->getLang('howhardtitle').'</div>';
}
$renderer->doc.= '<div class="howhard_img_compact">';
$renderer->doc.= '<img src="'.DOKU_BASE.'lib/plugins/howhard/images/style'.$style.'/'.$data.'.png" border="0" rel="'.$this->getLang($text_level).'">';
$renderer->doc.= '</div>';
$renderer->doc.= '<div class="howhard_txt'.$isCompact.'">'.$this->getLang($text_level).'</div>';
$renderer->doc.= '</div>';
return true;
}
else
{
return false;
}
}
}