Skip to content

Commit

Permalink
#298 use jodit for rich-text editing
Browse files Browse the repository at this point in the history
  • Loading branch information
gruberroland committed Feb 19, 2024
1 parent e74eb54 commit 1db553e
Show file tree
Hide file tree
Showing 3,663 changed files with 41,563 additions and 177,469 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion codespell.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash

~/.local/bin/codespell --skip '*3rdParty*,*/ckeditor/*,*/po/*,*/locale/*,tmp,sess,config,graphics,*/style/images/*,*/style/*.gif,*/style/*.png,*/docs/manual-onePage/*,*/docs/manual-sources/images/*,*/templates/lib/*jquery*,*/templates/lib/*popper*,*/templates/lib/*tippy*,*/templates/lib/*flatpickr*,*/templates/lib/*Sortable*,*/templates/lib/*cropper*,*~,*/docs/phpdoc/*,*/docs/manual/*,*/docs/devel/images/*,*/docs/manual-pdf/*,*.sh,*/cropper.js,*/lib/extra/*,lam/.phpdoc,lam/composer.*' --ignore-words-list "tim,te,pres,files'" lam
~/.local/bin/codespell --skip '*3rdParty*,*/jodit/*,*/po/*,*/locale/*,tmp,sess,config,graphics,*/style/images/*,*/style/*.gif,*/style/*.png,*/docs/manual-onePage/*,*/docs/manual-sources/images/*,*/templates/lib/*jquery*,*/templates/lib/*popper*,*/templates/lib/*tippy*,*/templates/lib/*flatpickr*,*/templates/lib/*Sortable*,*/templates/lib/*cropper*,*~,*/docs/phpdoc/*,*/docs/manual/*,*/docs/devel/images/*,*/docs/manual-pdf/*,*.sh,*/cropper.js,*/lib/extra/*,lam/.phpdoc,lam/composer.*' --ignore-words-list "tim,te,pres,files'" lam
1 change: 0 additions & 1 deletion lam-packaging/buildPackages
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ export VERSION=`./getVersion`
rm -r lam/po
rm -r lam/tests
rm -f lam/lib/3rdParty/tcpdf/fonts/*.ttf
rm -r lam/templates/lib/extra/ckeditor/plugins/*/dev
rm -r lam/lib/3rdParty/composer/nesbot/carbon/bin
chmod -R -x+X lam/lib/3rdParty
rm lam/composer*
Expand Down
2 changes: 1 addition & 1 deletion lam-packaging/debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Depends: php (>= 8.0.2), php-ldap,
libapache2-mod-php | libapache2-mod-fcgid | php-fpm,
apache2 (>= 2.4.0) | httpd,
gettext, fonts-dejavu,
ckeditor (>= 4.0), libjs-jquery-jstree (>= 3.3.0),
libjs-jquery-jstree (>= 3.3.0),
php-phpseclib3, php-psr-log (<< 2.0), php-monolog (<< 3.0),
php-voku-portable-ascii (<< 3.0), libphp-phpmailer (<< 7.0),
debconf (>= 0.2.26) | debconf-2.0, ${misc:Depends}
Expand Down
22 changes: 10 additions & 12 deletions lam-packaging/debian/copyright
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ time.
* lib/modules/groupOfNames.inc
* lib/modules/groupOfNamesUser.inc
* lib/modules/groupOfUniqueNames.inc
* lib/modules/guacamole.inc
* lib/modules/heimdalKerberos.inc
* lib/modules/ipHost.inc
* lib/modules/kopanoAddressList.inc
Expand All @@ -34,6 +35,7 @@ time.
* lib/modules/kopanoGroup.inc
* lib/modules/kopanoServer.inc
* lib/modules/kopanoUser.inc
* lib/modules/lastBind.inc
* lib/modules/locking389ds.inc
* lib/modules/mitKerberos.inc
* lib/modules/mitKerberosPolicy.inc
Expand All @@ -45,10 +47,12 @@ time.
* lib/modules/oracleService.inc
* lib/modules/organizationalRole*.inc
* lib/modules/passwordSelfReset.inc
* lib/modules/powerDNS.inc
* lib/modules/ppolicy.inc
* lib/modules/ppolicyUser.inc
* lib/modules/qmailGroup.inc
* lib/modules/qmailUser.inc
* lib/modules/requestAccess.inc
* lib/modules/rfc2307bisAutomount.inc
* lib/modules/rfc2307bisPosixGroup.inc
* lib/modules/selfRegistration.inc
Expand All @@ -57,12 +61,6 @@ time.
* lib/modules/webauthn.inc
* lib/modules/windowsLDSGroup.inc
* lib/modules/windowsLDSUser.inc
* lib/modules/zarafaAddressList.inc
* lib/modules/zarafaContact.inc
* lib/modules/zarafaDynamicGroup.inc
* lib/modules/zarafaGroup.inc
* lib/modules/zarafaServer.inc
* lib/modules/zarafaUser.inc
* lib/types/alias.inc
* lib/types/automountType.inc
* lib/types/bind.inc
Expand All @@ -74,10 +72,9 @@ time.
* lib/types/nisObjectType.inc
* lib/types/nsview.inc
* lib/types/oracleContextType.inc
* lib/types/powerDNSType.inc
* lib/types/ppolicyType.inc
* lib/types/sudo.inc
* lib/types/zarafaAddressListType.inc
* lib/types/zarafaDynamicGroupType.inc


All other files are licensed under the conditions below.
Expand Down Expand Up @@ -1139,6 +1136,7 @@ accepting any such warranty or additional liability.
Programs and licenses with other licenses and/or authors than the
main license and authors:

graphics/webauthn.svg F 2017 Duo Security, Inc.
lib/3rdParty/composer/beberlei G 2013 Benjamin Eberlei
lib/3rdParty/composer/brick B Benjamin Morel
lib/3rdParty/composer/carbonphp B 2023 Carbon
Expand Down Expand Up @@ -1172,19 +1170,19 @@ lib/3rdParty/composer/webklex B 2016 We
lib/3rdParty/tcpdf D 2022 Nicola Asuni - Tecnick.com LTD
lib/3rdParty/tcpdf/fonts/dejavu*.z A Public Domain, Bitstream, Inc., Tavmjong Bah
lib/3rdParty/yubico/Yubico.php C 2015 Yubico AB
style/010_normalize.css B Nicolas Gallagher and Jonathan Neal
style/050_grid.css B
templates/lib/*jquery*.js B 2018 jQuery Foundation and other contributors
templates/lib/*popper*.js B
templates/lib/*tippy*.js B 2021 atomiks
templates/lib/*flatpickr*.js B 2017 Gregory Petrosyan
style/600_flatpickr.css B 2017 Gregory Petrosyan
templates/lib/*sweetalert2*.js B
style/*sweetalert2*.css B
templates/lib/extra/cropperjs B 2018 Chen Fengyuan
templates/lib/cropper*.js B 2018 Chen Fengyuan
style/600_cropper*.css B 2018 Chen Fengyuan
templates/lib/extra/jodit B Chupurnov
templates/lib/extra/friendlyCaptcha B
graphics/webauthn.svg F 2017 Duo Security, Inc.
templates/lib/400_Sortable*.js B RubaXa, owenm
style/010_normalize.css B Nicolas Gallagher and Jonathan Neal
style/050_grid.css B
templates/lib/extra/jstree/* B 2014 Ivan Bozhanov
style/jstree/* B 2014 Ivan Bozhanov
2 changes: 1 addition & 1 deletion lam-packaging/debian/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ fi
db_version 2.0 || [ $? -lt 30 ]

# 3rd party libs
jsThirdPartyLibs='ckeditor jstree'
jsThirdPartyLibs='jstree'
for jsThirdPartyLib in $jsThirdPartyLibs; do
if [ ! -L /usr/share/ldap-account-manager/templates/lib/extra/${jsThirdPartyLib} ] ; then
ln -s /usr/share/javascript/${jsThirdPartyLib} /usr/share/ldap-account-manager/templates/lib/extra/${jsThirdPartyLib}
Expand Down
1 change: 0 additions & 1 deletion lam-packaging/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ install:
install -D --mode=644 sess/.htaccess debian/ldap-account-manager/var/lib/ldap-account-manager/sess/.htaccess
cp -r style debian/ldap-account-manager/usr/share/ldap-account-manager/
cp -r templates debian/ldap-account-manager/usr/share/ldap-account-manager/
rm -r debian/ldap-account-manager/usr/share/ldap-account-manager/templates/lib/extra/ckeditor
rm -r debian/ldap-account-manager/usr/share/ldap-account-manager/templates/lib/extra/jstree

install -D --mode=755 lib/lamdaemon.pl debian/ldap-account-manager-lamdaemon/usr/share/ldap-account-manager/lib/lamdaemon.pl
Expand Down
1 change: 0 additions & 1 deletion lam-packaging/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ RUN apt-get install --no-install-recommends -y \
wget \
libldap-common \
gettext \
ckeditor \
libjs-jquery-jstree \
php-phpseclib3 \
php-voku-portable-ascii \
Expand Down
22 changes: 10 additions & 12 deletions lam/copyright
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ time.
* lib/modules/groupOfNames.inc
* lib/modules/groupOfNamesUser.inc
* lib/modules/groupOfUniqueNames.inc
* lib/modules/guacamole.inc
* lib/modules/heimdalKerberos.inc
* lib/modules/ipHost.inc
* lib/modules/kopanoAddressList.inc
Expand All @@ -34,6 +35,7 @@ time.
* lib/modules/kopanoGroup.inc
* lib/modules/kopanoServer.inc
* lib/modules/kopanoUser.inc
* lib/modules/lastBind.inc
* lib/modules/locking389ds.inc
* lib/modules/mitKerberos.inc
* lib/modules/mitKerberosPolicy.inc
Expand All @@ -45,10 +47,12 @@ time.
* lib/modules/oracleService.inc
* lib/modules/organizationalRole*.inc
* lib/modules/passwordSelfReset.inc
* lib/modules/powerDNS.inc
* lib/modules/ppolicy.inc
* lib/modules/ppolicyUser.inc
* lib/modules/qmailGroup.inc
* lib/modules/qmailUser.inc
* lib/modules/requestAccess.inc
* lib/modules/rfc2307bisAutomount.inc
* lib/modules/rfc2307bisPosixGroup.inc
* lib/modules/selfRegistration.inc
Expand All @@ -57,12 +61,6 @@ time.
* lib/modules/webauthn.inc
* lib/modules/windowsLDSGroup.inc
* lib/modules/windowsLDSUser.inc
* lib/modules/zarafaAddressList.inc
* lib/modules/zarafaContact.inc
* lib/modules/zarafaDynamicGroup.inc
* lib/modules/zarafaGroup.inc
* lib/modules/zarafaServer.inc
* lib/modules/zarafaUser.inc
* lib/types/alias.inc
* lib/types/automountType.inc
* lib/types/bind.inc
Expand All @@ -74,10 +72,9 @@ time.
* lib/types/nisObjectType.inc
* lib/types/nsview.inc
* lib/types/oracleContextType.inc
* lib/types/powerDNSType.inc
* lib/types/ppolicyType.inc
* lib/types/sudo.inc
* lib/types/zarafaAddressListType.inc
* lib/types/zarafaDynamicGroupType.inc


All other files are licensed under the conditions below.
Expand Down Expand Up @@ -1138,6 +1135,7 @@ accepting any such warranty or additional liability.
Programs and licenses with other licenses and/or authors than the
main license and authors:

graphics/webauthn.svg F 2017 Duo Security, Inc.
lib/3rdParty/composer/beberlei G 2013 Benjamin Eberlei
lib/3rdParty/composer/brick B Benjamin Morel
lib/3rdParty/composer/carbonphp B 2023 Carbon
Expand Down Expand Up @@ -1171,19 +1169,19 @@ lib/3rdParty/composer/webklex B 2016 We
lib/3rdParty/tcpdf D 2022 Nicola Asuni - Tecnick.com LTD
lib/3rdParty/tcpdf/fonts/dejavu*.z A Public Domain, Bitstream, Inc., Tavmjong Bah
lib/3rdParty/yubico/Yubico.php C 2015 Yubico AB
style/010_normalize.css B Nicolas Gallagher and Jonathan Neal
style/050_grid.css B
templates/lib/*jquery*.js B 2018 jQuery Foundation and other contributors
templates/lib/*popper*.js B
templates/lib/*tippy*.js B 2021 atomiks
templates/lib/*flatpickr*.js B 2017 Gregory Petrosyan
style/600_flatpickr.css B 2017 Gregory Petrosyan
templates/lib/*sweetalert2*.js B
style/*sweetalert2*.css B
templates/lib/extra/cropperjs B 2018 Chen Fengyuan
templates/lib/cropper*.js B 2018 Chen Fengyuan
style/600_cropper*.css B 2018 Chen Fengyuan
templates/lib/extra/jodit B Chupurnov
templates/lib/extra/friendlyCaptcha B
graphics/webauthn.svg F 2017 Duo Security, Inc.
templates/lib/400_Sortable*.js B RubaXa, owenm
style/010_normalize.css B Nicolas Gallagher and Jonathan Neal
style/050_grid.css B
templates/lib/extra/jstree/* B 2014 Ivan Bozhanov
style/jstree/* B 2014 Ivan Bozhanov
5 changes: 5 additions & 0 deletions lam/style/500_layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -1110,3 +1110,8 @@ div.tippy-box {
padding: 0 var(--lam-regular-space) var(--lam-regular-space) var(--lam-regular-space);
max-width: 25rem;
}

div.jodit-container {
margin: var(--lam-small-space);
margin-bottom: var(--lam-regular-space);
}
3 changes: 2 additions & 1 deletion lam/templates/config/confmain.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@

echo $_SESSION['header'];
printHeaderContents(_("LDAP Account Manager Configuration"), '../..');
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../../templates/lib/extra/jodit/jodit.css\">\n";
echo "<body>\n";
// include all JavaScript files
printJsIncludes('../..');
Expand Down Expand Up @@ -608,7 +609,7 @@

?>
</form>
<script type="text/javascript" src="../lib/extra/ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="../lib/extra/jodit/jodit.js"></script>
</body>
</html>
<?php
Expand Down
37 changes: 8 additions & 29 deletions lam/templates/lib/500_lam.js
Original file line number Diff line number Diff line change
Expand Up @@ -3374,35 +3374,14 @@ window.lam.richEdit = window.lam.richEdit || {};
* Inits the rich-text editors.
*/
window.lam.richEdit.init = function() {
const richEditorInputs = document.getElementsByClassName('lam-rich-edit');
Array.from(richEditorInputs).forEach(function (richInput) {
CKEDITOR.replace(richInput, {
plugins: 'dialogui,dialog,basicstyles,blockquote,notification,button,toolbar,clipboard,panel,floatpanel,menu,contextmenu,resize,elementspath'
+ ',enterkey,entities,popup,filetools,filebrowser,floatingspace,listblock,richcombo,format,horizontalrule,htmlwriter,wysiwygarea,image,indent'
+ ',indentlist,fakeobjects,link,list,magicline,maximize,pastetext,removeformat,showborders,sourcearea,specialchar,menubutton,stylescombo,tab'
+ ',table,tabletools,tableselection,undo,lineutils,widgetselection,widget,notificationaggregator,iframe,justify,font,panelbutton,colordialog,colorbutton',

toolbarGroups: [
{ name: 'document', groups: [ 'mode', 'document', 'doctools' ] },
{ name: 'clipboard', groups: [ 'clipboard', 'undo' ] },
{ name: 'editing', groups: [ 'find', 'selection', 'spellchecker', 'editing' ] },
{ name: 'forms', groups: [ 'forms' ] },
{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi', 'paragraph' ] },
{ name: 'links', groups: [ 'links' ] },
{ name: 'insert', groups: [ 'insert' ] },
{ name: 'colors', groups: [ 'colors' ] },
{ name: 'tools', groups: [ 'tools' ] },
{ name: 'styles', groups: [ 'styles' ] },
{ name: 'others', groups: [ 'others' ] }
],

removeButtons: 'About,Templates,Preview,Save,NewPage,Print,PasteFromWord,PasteText,Find,Replace,SelectAll,Form,Checkbox,Radio,TextField,Textarea,Select,Button,ImageButton,HiddenField,CopyFormatting,RemoveFormat,BidiLtr,BidiRtl,Language,Flash,PageBreak,ShowBlocks',

// Set the most common block elements.
format_tags: 'p;h1;h2;h3;pre',

height: 200
document.querySelectorAll('.lam-rich-edit').forEach(textarea => {
Jodit.make(textarea, {
beautifyHTML: false,
sourceEditorCDNUrlsJS: [],
sourceEditor: 'area',
uploader: {
"insertImageAsBase64URI": true
}
});
});
}
Expand Down
Loading

0 comments on commit 1db553e

Please sign in to comment.