1 (edited by SamC 2011-09-22 10:44)

Topic: [Extension release] WYSIWYG editor (SCEditor)

I've just finished making a WYSIWYG BBCode editor extension to go with it. I'm still testing this extension so if you decide to use it don't use it on anything important. I'm hoping someone can help check for bugs in them.  smile

sc_wysiwyg
This extension should work in at least IE6+ (Although the as you type emoticon conversion only works in IE9+), FF 3.5, Chrome, Opera 9.5+ and Safari 4+.

You can download it here:
http://www.sceditor.com/integration/
Supports v1.4.x version.

// Sorry for editing your post
// Trace

2

Re: [Extension release] WYSIWYG editor (SCEditor)

Screenshot of the WYSIWYG editor:
http://www.samclarke.com/wp-content/uploads/2011/08/pun_wysiwyg-300x175.png

3 (edited by hklown 2011-08-19 04:36)

Re: [Extension release] WYSIWYG editor (SCEditor)

Cool extensions! Could you elaborate a little on your reasoning for not using regular expressions?

EDIT: Also, don't fall into the same trap I did- only official extensions should start with "pun_". One of these days I'll get around to fixing the folders in my SVN, but it's such a pain  tongue

4 (edited by SamC 2011-08-19 15:41)

Re: [Extension release] WYSIWYG editor (SCEditor)

The main reason it doesn't use regex is because I wanted to be able to add new BBCodes without having to create a new regex every time. I.e. for the PHP tag which only allows text inside it I can simply do:

[code=php]new SBBCodeParser_BBCode('php', function($content, $attribs, $node)
{
    $highlighter = new HyperLight('php');
    return '<pre><code class="php">' . $highlighter->render($node->get_text()) . '</code></pre>';
}, false, array(), array('text_node'));[/code]

Much easier for me. smile

hklown wrote:

Also, don't fall into the same trap I did- only official extensions should start with "pun_". One of these days I'll get around to fixing the folders in my SVN, but it's such a pain ;p

Whoops, thanks for letting me know. I've upadated them now. smile I just assumed since they all seemed to start with pun_ that it was some kind of naming convention.

EDIT: In case anyone wants to see it working there is a there is a demo here. The BBCode editor is the 2nd editor on the page.

5

Re: [Extension release] WYSIWYG editor (SCEditor)

Excellent extension. Unfortunately the system requirement php 5.3 or higher .

Re: [Extension release] WYSIWYG editor (SCEditor)

Have you seen www.regexr.com? Also, http://www.regular-expressions.info/ has a lot of good tutorials, and www.regexbuddy.com is an amazing tool that makes building regular expressions really easy (although you have to buy it sad).

You could also build a method that returns a customized regular expression, so that you wouldn't have to manually make one each time you want to implement a new tag. The reason I suggest it is because you give up a lot of appeal if your extension is incompatible with a core piece of the software (because you automatically create an incompatibility between your extension and others that do things the canonical way.)

Regardless, keep up the coding. It's good stuff.

7

Re: [Extension release] WYSIWYG editor (SCEditor)

I know the last two sites but the first one looks useful!

It's not that I don't like regex, the editor uses it to convert from BBCode to HTML, it's just I decided I didn't want to use it for the BBCode parser on my site. Since I originaly just wanted to use the same BBCode editor and parser on my site and forum so everything was consistent I wasn't too bothered with making it compatible with the built in parser.

I've now updated the WYSIWYG extension to no longer require the parser which should solve that problem.

Excellent extension. Unfortunately the system requirement php 5.3 or higher .

The BBCode parser uses unonymous functions which only came in with PHP 5.3. It could be made compatible with lower versions if anyone wanted it though.

Re: [Extension release] WYSIWYG editor (SCEditor)

I get the following error:

K:\wamp\www\include\parser.php(801) : eval()'d code on line 34

9 (edited by darpro 2011-09-15 10:25)

Re: [Extension release] WYSIWYG editor (SCEditor)

Very nice editor. I started using them on my page.

Question
1.    If “sc_sbbcode” installation is required, because currently  I install only “sc_wysiwyg” and is working correctly. (Can I use only sc_wysiwyg?)
2.    How can I modify displayed number of function. I would like display only few most common liek: bold, italic, upload file etc.

Errors
1.    When I install “sc_sbbcode” the error appears in parse.php (801), described by bingiman.

Functionality/Features

1.    When I click on “Font Color” I open very slow (about 2-3s), maybe better show only a few major color
       (like in Windows Paint). When I want use non common color I can switch to source code.
2.    Insert a image function - nice if it were an optional possibility to give height and width
3.    Nice to have possibility to upload image on forum server (not third party hosting) or upload on other image hosting server automatically like in “Nice editor” (In this editor are 2 option by link or by imageshack.us,  see page: http://nicedit.com/demos.php

10

Re: [Extension release] WYSIWYG editor (SCEditor)

SamC wrote:

It could be made compatible with lower versions if anyone wanted it though.

Please, made this compatible with PHP => 5.0

11

Re: [Extension release] WYSIWYG editor (SCEditor)

Thank you for the detailed reply.

1.    If “sc_sbbcode” installation is required, because currently  I install only “sc_wysiwyg” and is working correctly. (Can I use only sc_wysiwyg?)

The sc_wysiwyg plugin can now be installed without sc_sbbcode.

2.    How can I modify displayed number of function. I would like display only few most common liek: bold, italic, upload file etc.

I will add an option for that. At the moment if you want you can edit the line 67 if using PunBB 1.4 or line 122 if using 1.3 of the WYSIWYG plugins manifest.xml file:

toolbar: "bold,italic,underline,strike,subscript,superscript|left,center,right,justify|" +
"font,size,color,removeformat|cut,copy,paste,pastetext|bulletlist,orderedlist|" +
"table|code,quote|horizontalrule,image,email,link,unlink|emoticon,date,time|source",

Just delete the ones you don't want.

1.    When I install “sc_sbbcode” the error appears in parse.php (801), described by bingiman.

Are you using a version of PHP below 5.3? If so that will be why, it currently requires PHP 5.3+. If not could you tell me what you are doing when you get the error.

1.    When I click on “Font Color” I open very slow (about 2-3s), maybe better show only a few major color
       (like in Windows Paint). When I want use non common color I can switch to source code.

I've added a default colour set with a few less colours to the plugin which should speed it up.

2.    Insert a image function - nice if it were an optional possibility to give height and width
3.    Nice to have possibility to upload image on forum server (not third party hosting) or upload on other image hosting server automatically like in “Nice editor” (In this editor are 2 option by link or by imageshack.us,  see page: http://nicedit.com/demos.php

I have been thinking of adding both of them for a while so when I next have time I will add them.

Please, made this compatible with PHP => 5.0

I will update it as soon as I have some spare time.

12

Re: [Extension release] WYSIWYG editor (SCEditor)

Thanks for replay,

I'm using 5.2.8 on a share hosting, so I can't change it.
But as you say "sc_wysiwyg" working without "sc_sbbcode", so there are no problem.

So I'm waiting for new update.  smile

13

Re: [Extension release] WYSIWYG editor (SCEditor)

Hi,

I find probably important bug.
Can you look on that, because currently users which use Opera or Chrom can't creat new topic and post.
(With statistic it is about 15% of users.)

See on the screen
When you enter all required data, you have still message to enter the required fields

http://s4.postimage.org/mked9lyx2/Required_field.png

Browsers:

Opera 11.11 - NOK
Chrome 13.0.782.220 m - NOK
Firefox 6.0.2 - OK
IE7 - OK

14

Re: [Extension release] WYSIWYG editor (SCEditor)

Hello,

I did test it with both Opera and Chrome so I'm not sure why it's not working.

Could you let me know what version of PunBB you're using and what other plugins you have installed so I can check it's not conflicting with any of them for some reason.

15

Re: [Extension release] WYSIWYG editor (SCEditor)

Version:
PunBB 1.3.5

I have installed many plugins.

Installed plugins
Admin add user v1.1.1.
Animated avatars v0.1.1.
Broadcast e-mail v0.2
Events registration v0.8.2
JS post quote v2.2.2
Post karma v1.1.2.
Posts RSS feed v1.0.
Private Messaging v1.2.9.
Pun Admin Manage Extensions Improved v1.4.
Pun Move Posts v1.0.1.
Pun tags v1.5.
PunBB Repository v1.2.3.
WYSIWYG BBCode editor v1.0.0.

16 (edited by SamC 2011-09-16 14:55)

Re: [Extension release] WYSIWYG editor (SCEditor)

I've now tested it with Chrome and the same version of Opera with all the same plugins and the same language and I still can't get it to give the error. So I'm not sure what could be causing it.

Are you using a different theme from the default one? If so it's possible it might be conflicting with that, I can't really see how though. Would it be possible to have a link to your forum so I can see if I can find anything that might be causing the bug.

I've also updated it now to allow an optional height and width to be specified when inserting an image and fix a small bug with font colours.

17

Re: [Extension release] WYSIWYG editor (SCEditor)

Hi,

Thanks for replay and checking the error on my site.
The problem was caused by facebook plugin, but new version solves the problem.
Now it works perfect on most common browser.

18

Re: [Extension release] WYSIWYG editor (SCEditor)

Hi Sam,

I've just installed your wysiwyg extension, and I'm really impressed about your work.

I've got a question however. I'm not sure I understand the difference between the two extensions. Does sc_wysiwyg support all sc_bbcode tags, such as youtube ? Or does it only support the tags corresponding to visible buttons?

Thanks in advance, and once again congratulations sir

19

Re: [Extension release] WYSIWYG editor (SCEditor)

Hello,

It only supports the tags corresponding to visible buttons. If you enter a tag it doesn't know it just leaves it alone so if the forum supports a tag the editor doesn't they can still be entered they just wont be WYSIWYG.

I've just finished updating the editor and it now supports the YouTube tag (doesn't need sc_bbcode to parse it) as well as a few smaller improvements.

20

Re: [Extension release] WYSIWYG editor (SCEditor)

sc_sbbcode should now support PHP 5+. I can't actually test it with PHP 5 as all my computers have PHP 5.3 on so if you get an error let me know.  smile

21 (edited by toni0 2011-09-20 09:48)

Re: [Extension release] WYSIWYG editor (SCEditor)

SamC wrote:

I've just finished updating the editor and it now supports the YouTube tag

Awesome. Any chance I can donate few bucks to you for this great addon?

  • I have noticed a bug. When I click on smileys, some of them are duplicated (I use default smileys only)
    You can check it here directly on my forum WYSIWYG demo

  • Is it also possible to add a Jquery line in Iframe's head that would refresh the WYSIWYG CSS?
    Everytime I upload a new version I have to refresh it manually, else changes are never displayed.

22

Re: [Extension release] WYSIWYG editor (SCEditor)

Awesome. Any chance I can donate few bucks to you for this great addon?

Sure! If you want to donate you can via PayPal here.


I have noticed a bug. When I click on smileys, some of them are duplicated (I use default smileys only)
You can check it here directly on my forum WYSIWYG demo

I've just updated it and that should now be fixed.


Is it also possible to add a Jquery line in Iframe's head that would refresh the WYSIWYG CSS?
Everytime I upload a new version I have to refresh it manually, else changes are never displayed.

It should now refresh whenever a new version is installed.

23 (edited by toni0 2011-09-20 13:20)

Re: [Extension release] WYSIWYG editor (SCEditor)

SamC wrote:

Sure! If you want to donate you can via PayPal here.

Done

SamC wrote:

I've just updated it and that should now be fixed.
It should now refresh whenever a new version is installed.

Great job man, thanks for your responsiveness, I'll try that asap.
What was wrong with duplicated smileys?

  • Another issue : colors are also duplicated 3 times, check the same link I gave you before.

  • The cherry on the cake would be to have a resizable iframe, like the original PunBB text box one on this forum.

After that, we'll probably reach perfection in my opinion smile

24 (edited by SamC 2011-09-20 14:02)

Re: [Extension release] WYSIWYG editor (SCEditor)

Thank you very much for the donation!

What was wrong with duplicated smileys?

It was because when I made the editor I didn't reckon on needing multiple codes for the same emotion so I didn't have an option for hiding duplicates.


toni0 wrote:

Another issue : colors are also duplicated 3 times, check the same link I gave you before.

They are actually all different but they change so little they look the same! I've just updated it to go back to using it's default auto generated set of colours for now. I've improved the speed of the colour picker so it hopefully shouldn't be too slow.


toni0 wrote:

The cherry on the cake would be to have a resizable iframe, like the original PunBB text box one on this forum.

I will try and add that sometime tonight as it will take a bit longer to do.


toni0 wrote:

After that, we'll probably reach perfection in my opinion  smile

It will get there eventually.  smile

Re: [Extension release] WYSIWYG editor (SCEditor)

not work for me sad