Shaarli icon indicating copy to clipboard operation
Shaarli copied to clipboard

Option for enable HTML in descriptions, including WYSIWYG

Open BmdOnline opened this issue 10 years ago • 1 comments

Editeur WYSIWYG

J'ai testé 3 éditeurs différents :

  • NicEdit : n'est plus mis à jour. Souci de couleur de fond, il faudrait revoir le CSS.
  • CKEditor : performant mais plus compliqué à mettre en œuvre.
  • TinyMCE : comparable à ckeditor, plus simple à mettre en œuvre.

J'ai finalement retenu TinyMCE.

Principe

Une variable disablehtml servira à désactiver l'affichage HTML et l'édition WYSIWYG. Cette variable est basé sur le même principe que la variable disablejquery.

  1. Créer ou modifier le fichier data/options.php, pour y ajouter :
<?php
$GLOBALS['disablehtml']=false;
?>
  1. Créer ou modifier le fichier inc/user.css, pour y ajouter :
/* CSS Stylsheet for Shaarli -
http://sebsauvage.net/wiki/doku.php?id=php:shaarli */
strong{font-weight: bold}
blockquote{margin-left: 50px;}

BmdOnline avatar Oct 03 '13 19:10 BmdOnline

for reference, the only changed files (aside from adding TinyMCE) are in:

  • inc/user.sample.css
  • index.php
  • tpl/page.footer.html

This is a candidate for the plugin system at https://github.com/shaarli/Shaarli/issues/14. Implementation proposal at https://github.com/shaarli/Shaarli/pull/52

nodiscc avatar Nov 26 '14 07:11 nodiscc