Not logged in. · Lost password · Register
Forum: General Help and Support Plugins RSS
CKGedit / WRAP plugins: add Wrap's centeralign option in CKGedit toolbar
Avatar
AmHebus #1
Member since Dec 2019 · 5 posts
Group memberships: Members
Show profile · Link to this post
Subject: CKGedit / WRAP plugins: add Wrap's centeralign option in CKGedit toolbar
Hi,
I installed both CKGedit and WRAP plugins and i see that some wrap options were availiable in CKGedit toolbar (e.g Box Types & Special types).
I would like to add centeralign option in this box.
How can i do ?
Thx for your help !
Avatar
turnermm (Moderator) #2
Member since Oct 2009 · 4812 posts · Location: Canada
Group memberships: Global Moderators, Members, Super Mods
Show profile · Link to this post
The ckgedit wrap is based on the wrap plugin, which does not have a centeralign selection in its toolbox.  You can do this, however, by entering the wrap plugin's code for centeralign directly into the ckgedit editor.
Myron Turner
github: https://github.com/turnermm
plugins, templates: http://www.mturner.org/devel
Avatar
AmHebus #3
Member since Dec 2019 · 5 posts
Group memberships: Members
Show profile · Link to this post
Hello and thank you for your answer.
Precisely, I think it is necessary to modify 2 files for that, the lib/plugins/ckgedit/ckedit/ckeditor/plugins/wrap/dialogs/wrap.js file and the lang file but I don't know how to proceed....
Avatar
turnermm (Moderator) #4
Member since Oct 2009 · 4812 posts · Location: Canada
Group memberships: Global Moderators, Members, Super Mods
Show profile · Link to this post
I'm not sure I was clear.  Just type your text and the markup directly into the editor, just as you would so if you were using the native dokuwiki editor.  See attached.  Ckgedit will accept the markup
Myron Turner
github: https://github.com/turnermm
plugins, templates: http://www.mturner.org/devel
The author has attached one file to this post:
Screenshot_2019-12-11 ✎ playground wrap_examples-2 [mturner org].png 38.3 kBytes
You have no permission to open this file.
Avatar
AmHebus #5
Member since Dec 2019 · 5 posts
Group memberships: Members
Show profile · Link to this post
Hello and thank you for your answer.
Indeed i knew this solution, but I would like to add a "centered alignment" button directly in the dialog box.
Is that possible?
Here : [Image: https://zupimages.net/up/19/50/n4iw.jpg]
OR here: [Image: https://zupimages.net/up/19/50/4gv5.jpg]
Regards,
Avatar
turnermm (Moderator) #6
Member since Oct 2009 · 4812 posts · Location: Canada
Group memberships: Global Moderators, Members, Super Mods
Show profile · Link to this post
It's possible, if you know javascript.  You can edit ckeditor/plugins/wrap/dialogs/wrap.js, add the language string to both wrap/lang/en.js and your own language.  In wrap.js add the required radio button and the needed return values in the case structure of the OK function.
Myron Turner
github: https://github.com/turnermm
plugins, templates: http://www.mturner.org/devel
Avatar
AmHebus #7
Member since Dec 2019 · 5 posts
Group memberships: Members
Show profile · Link to this post
Hello,
it was as I thought, and it generates the code to center the words.
But the problem is that the generated tag is in lower case, whereas to activate the centering the tag must be in upper case.
generated code: <wrap centeralign>my text</wrap>
expected code: <WRAP centeralign>my text</wrap>
did I make a mistake somewhere?
Regards,
Avatar
AmHebus #8
Member since Dec 2019 · 5 posts
Group memberships: Members
Show profile · Link to this post
Quote by AmHebus:
Hello,
it was as I thought, and it generates the code to center the words.
But the problem is that the generated tag is in lower case, whereas to activate the centering the tag must be in upper case.
generated code: <wrap centeralign>my text</wrap>
expected code: <WRAP centeralign>my text</wrap>
did I make a mistake somewhere?
Regards,

Ok, i found it: it must be a "syntaxDiv" in the TypeValue switch in wrap.js
Thx a lot for your time.
Regards.
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2020-04-06, 05:18:47 (UTC +02:00)