WYSIWYG editor

General discussion of development ideas and the approaches taken in the 3.x branch of phpBB. The next feature release of phpBB 3 will be 3.3/Proteus.
Forum rules
Please do not post support questions regarding installing, updating, or upgrading phpBB 3.2.x. If you need support for phpBB 3.2.x please visit the 3.2.x Support Forum on phpbb.com.

If you have questions regarding writing extensions please post in Extension Writers Discussion to receive proper guidance from our staff and community.
Post Reply
User avatar
naim
Registered User
Posts: 50
Joined: Thu Oct 13, 2011 7:21 pm
Location: Isolation
Contact:

Re: WYSIWYG editor

Post by naim »

it is entirely client-side, all we have to do is implement it to the template. (and of-course make sure that all tags are allowed...)

leviatan21
Registered User
Posts: 18
Joined: Tue May 05, 2009 5:51 pm

Re: WYSIWYG editor

Post by leviatan21 »

naim wrote:http://wysiwygbbcode.codeplex.com/ it is lightweight and is perfect for phpBB.
may be it looks fine, but have a lot of faults, the main problem is that is not phpbb integrated :
1) Doesn't take into account permissions or if some of the bbcodes are not allowed
2) Doesn't take into account custom bbcodes
QA Team Member - I don't support by PM,
Customize forums, install Skins/Mods ! Sendme a PM | Don't forget to visit my other mods
Excuse me for my poor English, I speak Spanish. | Image phpBB en Español

User avatar
nextgen
Registered User
Posts: 128
Joined: Sat Jul 24, 2010 4:59 am
Location: Guatemala
Contact:

Re: WYSIWYG editor

Post by nextgen »

callumacrae wrote:
nextgen wrote:The editor looks good but the question is whether security is not at risk.
How could it be a security risk? It's almost entirely client side.
publishers include such functions to put iframes, it does not want vurnerable the system.

the ckeditor I see is the same as used in vB4
*Imagine a signature super spectacular.*

User avatar
naim
Registered User
Posts: 50
Joined: Thu Oct 13, 2011 7:21 pm
Location: Isolation
Contact:

Re: WYSIWYG editor

Post by naim »

leviatan21 wrote:
naim wrote:http://wysiwygbbcode.codeplex.com/ it is lightweight and is perfect for phpBB.
may be it looks fine, but have a lot of faults, the main problem is that is not phpbb integrated :
1) Doesn't take into account permissions or if some of the bbcodes are not allowed
2) Doesn't take into account custom bbcodes
About the editor, the "YouTube" button should be removed... - it is useless...
The Quote button does have a little fault, but except that is works fine, it has Bold, Italic, Underline, Color selection, just like phpbb.
Since the source is small, i'm sure if decided to use this editor, someone will be happy to edit it.

1. If you looked through the source "sample.html", you will see that all you have to-do is put the buttons in <!-- IF... Wrappers.
2. you are right about custom BBCodes, but the script file of this editor is very small and you can easily insert custom codes.

leviatan21
Registered User
Posts: 18
Joined: Tue May 05, 2009 5:51 pm

Re: WYSIWYG editor

Post by leviatan21 »

naim wrote:Since the source is small, i'm sure if decided to use this editor, someone will be happy to edit it.
1. If you looked through the source "sample.html", you will see that all you have to-do is put the buttons in <!-- IF... Wrappers.
2. you are right about custom BBCodes, but the script file of this editor is very small and you can easily insert custom codes.
You are welcome to do it and then share your result with all of us.
Hope to see your topic at phpbb.com :roll:
QA Team Member - I don't support by PM,
Customize forums, install Skins/Mods ! Sendme a PM | Don't forget to visit my other mods
Excuse me for my poor English, I speak Spanish. | Image phpBB en Español

User avatar
naim
Registered User
Posts: 50
Joined: Thu Oct 13, 2011 7:21 pm
Location: Isolation
Contact:

Re: WYSIWYG editor

Post by naim »

Well, i looked at the CKEditor, and it is much better then what i suggested and it has a bbcode plugin!
There is a problem with smilies, permissions was not a problem, i am currently working on custom commands.
Note: Before testing the attached files on your forum, please back up "prosilver" template.
The CKEditor folder has been included in the archive, if you want you can download CKEditor from http://ckeditor.com/

Attachment compressed in 7z format (http://sevenzip.sourceforge.net/)
Attachments
ckephpbb.7z
Snapshot-1
(988.31 KiB) Downloaded 538 times

wGEric
Registered User
Posts: 521
Joined: Wed Jun 11, 2003 2:07 am
Contact:

Re: WYSIWYG editor

Post by wGEric »

Both of us apparently had very similar ideas:

https://github.com/wGEric/phpbb3/commit ... 7779e3c172

I think you have the right idea of putting the CKEditor config in posting_editor.html. I was trying to think of a good way to pass in config options, custom bbcodes and similes. I was thinking of creating a javascript phpbb config variable that would hold things like that.

I want to figure out a way to have CSS in the styles folder so that style authors can customize the look of CKEditor. Then for translations CKEditor has its own language files. It would probably be ok to use those instead of the phpBB language files.
Eric

User avatar
naim
Registered User
Posts: 50
Joined: Thu Oct 13, 2011 7:21 pm
Location: Isolation
Contact:

Re: WYSIWYG editor

Post by naim »

wGEric wrote:Both of us apparently had very similar ideas:

https://github.com/wGEric/phpbb3/commit ... 7779e3c172

I think you have the right idea of putting the CKEditor config in posting_editor.html. I was trying to think of a good way to pass in config options, custom bbcodes and similes. I was thinking of creating a javascript phpbb config variable that would hold things like that.

I want to figure out a way to have CSS in the styles folder so that style authors can customize the look of CKEditor. Then for translations CKEditor has its own language files. It would probably be ok to use those instead of the phpBB language files.
We should probably omit all languages files and include them only with translations (not like the snapshot i uploaded or whats in your github).
phpBB's template engine won't compile .js files, so you must write the configuration in "posting_editor.html".

About Styles: http://docs.cksource.com/ckeditor_api/s ... esSet.html (Probably need to make a custom style panel, or create a Styler's panel for phpBB).

User avatar
Igor Isaias Banlian
Registered User
Posts: 1
Joined: Fri Oct 21, 2011 4:38 pm
Location: Brazil / São Paulo / SP
Contact:

Re: WYSIWYG editor

Post by Igor Isaias Banlian »

naim wrote:Well, i looked at the CKEditor, and it is much better then what i suggested and it has a bbcode plugin!
There is a problem with smilies, permissions was not a problem, i am currently working on custom commands.
Note: Before testing the attached files on your forum, please back up "prosilver" template.
The CKEditor folder has been included in the archive, if you want you can download CKEditor from http://ckeditor.com/

Attachment compressed in 7z format (http://sevenzip.sourceforge.net/)
Please, we all need a CKEditor MOD for phpBB that works correctly, then continue your good work on developing it!

Here I had problems with:

1) The smilies are not working properly;
2) The Flash button does not work correctly.

I wish he had a few more buttons:

1) A button to the tags [ code ] [ / code ];
2) A button to attach YouTube videos to posts.

I would also like it could be used in the Quick Reply box and theme subsilver2 too...

Note: The Almsamim WYSIWYG editor has a button to attach YouTube videos to the posts, but due to changes in the YouTube API, function does not work anymore...

Sorry for my bad English, I am Brazilian!

Regards,
Igor Isaias Banlian

wiktor
Registered User
Posts: 7
Joined: Tue May 24, 2011 12:05 pm

Re: WYSIWYG editor

Post by wiktor »

naim wrote:
The WYSIWYG editor that convinced me the most so far was CKEditor. There have been discussions about integration a while ago. From what I can tell CKEditor is pluggable.
i think CKEditor is a bit heavy for phpBB.
(...)
Hi, I'm from the CKEditor team and just wanted to add 0.02$ and say that I do not agree with your opinion :)

Please do not judge CKEditor just by looking at the size of the downloaded package etc.
This pretty old blog post explains some details regarding loading performance.

The size of CKEditor can be easily reduced by removing the plugins that are not needed (e.g all the "form" buttons), removing _source/_samples folders etc.
After you decide which plugins and buttons do you really need, you may recreate the package and end up with a much smaller and even faster editor.
It cannot be reduced to 20KB, ok, but just because it is an application that has much more features.

When taking the default package of the CKEditor and the mentioned WYSIWYG BBCode Editor, you are comparing actually two totally different applications:
- a pretty basic editor that is rarely maintained, which in fact simply inserts a contenteditable element inside of an iframe and... that's all.
- and the editor that has hundreds of additional things inside of it, e.g to be more accessible, that supports RTL languages, with some decent keyboard navigation and really, with hundreds of tweaks to deal with various browsers issues with contenteditable elements reported by users.

I could list much more features of CKEditor, but even this small set of things explains why it does not make sense to include a very basic editor in an application that is used by milions of users around the world.

At the end, let me just add that the bbcode plugin that is available in CKEditor is just a sample, to show that CKEditor is capable of producing different syntax than HTML. The list of supported tags can be further extended.
CTO, CKSource
http://ckeditor.com/

Post Reply