xoops forums

Tarik

Not too shy to talk
Posted on: 2013/9/8 10:10
Tarik
Tarik (Show more)
Not too shy to talk
Posts: 170
Since: 2010/2/3 1
#1

SCEditor- v1.4.4

Down at the Arabic Support we hate the default XOOPS BBCode editor simply because it disregard the rtl aspect in addition to other xoops feature and lack in looks - looks are important to attract people - and some folks even considered bundling a diffrent editor instead of it, one i found very nice was SCEditor which i started to convert immediately and after a friend notified me that there is an old thread about this editor linking to the SVN - what a box of wonders - but an older version which helped a little in understanding the process

so here is the SCEditor v 1.4.4 integrated with XOOPS Smilies support and hopefully image manager in the near future



Install steps are in the page/readme so good luck
and if there is any remarks please do give them to make it better

Mamba

Moderator
Posted on: 2013/9/8 12:59
Mamba
Mamba (Show more)
Moderator
Posts: 10799
Since: 2004/4/23
#2

Re: SCEditor- v1.4.4

Tarik, I am so glad that this has been now updated.

However, please be aware that we'll need an updated version of your YouTube sanitizer for XOOPS 2.5.7, since the preg_replace /e has been deprecated in PHP 5.5, and we need to use callbacks.

The appropriate changes have been made in XOOPS 2.5.7 SVN, but if somebody overwrites them with your changes, then he will get "deprecated" error notices, or worse, it might break the YouTube sanitizer.

So if you can, please provide two version of the YouTube changes, one for XOOPS 2.5.6 or less, and one for XOOPS 2.5.7+, so we can avoid any issues

Could you also update the SVN with this version, so people who go there, can download the latest version too? Thanks!

Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs

Tarik

Not too shy to talk
Posted on: 2013/9/8 13:09
Tarik
Tarik (Show more)
Not too shy to talk
Posts: 170
Since: 2010/2/3 1
#3

Re: SCEditor- v1.4.4

roger i'll do it as soon as i get some free time, SourceForge SVN still scares a little lol but i'm gonna do it as well,

Thanks for the informations

by the way is there a way to embed new BBCode into Xoops w/o hacking? i even considered making it as a module but the patterns doesnt even load to a trigger

Mamba

Moderator
Posted on: 2013/9/8 13:59
Mamba
Mamba (Show more)
Moderator
Posts: 10799
Since: 2004/4/23
#4

Re: SCEditor- v1.4.4

I see some problems right now - it seems like it is hardcoded into RTL, instead of taking the value from the language setup. Am I doing something wrong?

Also, one of the previous incompatibilites seem to be still there:

- Selecting Color inserts "#" in front of color code (XOOPS doesn't use it)

[EDIT] but you've changed it in text sanitizer, so XOOPS reads this correctly.

I seem to have also problems with Preview (I was testing it with NewBB) - the text shows in Preview, but it disappears from the Editor, i.e. I cannot continue with editing. I need to check if this is my configuration (XOOPS 2.5.7 pre-Beta 1, and PHP 5.5.3), or something else...

Quote:
by the way is there a way to embed new BBCode into Xoops w/o hacking? i even considered making it as a module but the patterns doesnt even load to a trigger

I am not sure, I never did it, so I don't know. Try to investigate how it is being currently done in XOOPS, and if it's possible to add BBCodes...
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs

Mamba

Moderator
Posted on: 2013/9/8 15:16
Mamba
Mamba (Show more)
Moderator
Posts: 10799
Since: 2004/4/23
#5

Re: SCEditor- v1.4.4

Quote:
I see some problems right now - it seems like it is hardcoded into RTL, instead of taking the value from the language setup. Am I doing something wrong?

The problems was that you had in formsceditor.php on line 128:

if(!_XOOPS_EDITOR_SCEDITOR_DIRECTION == "ltr"){
        
$rtl "false";


You needed to remove the "!" from the check, otherwise it was switching for LTR value to RTL. I've submitted the code it GitHub...
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs

Tarik

Not too shy to talk
Posted on: 2013/9/8 15:19
Tarik
Tarik (Show more)
Not too shy to talk
Posts: 170
Since: 2010/2/3 1
#6

Re: SCEditor- v1.4.4

every editor -including tinymce bbcode plugin- uses the # syntax so i added it
i didn't hardcode rtl, the direction is changed based on a constant in the language file to state if a language is rtl or ltr
and it seems at the end that ill make a single class file where i put all the new bbcodes to simplify the integration process.

an other thing, why do i have to hack the cms to add a new bbcode editor to block manager? any new editor is labeled as html editor in blocks and the select after the editor (the one where you choose the type of the block) disappear.

Mamba

Moderator
Posted on: 2013/9/8 15:59
Mamba
Mamba (Show more)
Moderator
Posts: 10799
Since: 2004/4/23
#7

Re: SCEditor- v1.4.4

Quote:
i didn't hardcode rtl,

No, you didn't. There was a bug which was causing me to have RTL settings (see above)

Quote:
an other thing, why do i have to hack the cms to add a new bbcode editor to block manager? any new editor is labeled as html editor in blocks and the select after the editor (the one where you choose the type of the block) disappear.

I am not sure, I understand. You can choose any editor as the "Blocks Editor". Just go to System Module Settings:

modules/system/admin.php?fct=preferences&op=showmod&mod=1

and at the bottom you can select the editor for Blocks, Modules, and Comments.

If you have just added your new editor to XOOPS, you need to updates the System module, so the new editor is then visible in the selection.
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs

Tarik

Not too shy to talk
Posted on: 2013/9/9 5:35
Tarik
Tarik (Show more)
Not too shy to talk
Posts: 170
Since: 2010/2/3 1
#8

Re: SCEditor- v1.4.4

Resized Image

this select is only shown in 'dhtmltextarea' or 'textarea' so any editor other than these 2 have bbcode disabled and only html works, its due to the a condition in
modules\system\class\block.php line 113
if ( in_array$editor_configs["editor"], array('dhtmltextarea','textarea' ) ) ) {
                
$ctype_select = new XoopsFormSelect(_AM_SYSTEM_BLOCKS_CTYPE'c_type'$this->getVar('c_type'));
                
$ctype_select->addOptionArray(array(
                    
'H' => _AM_SYSTEM_BLOCKS_HTML,
                    
'P' => _AM_SYSTEM_BLOCKS_PHP,
                    
'S' => _AM_SYSTEM_BLOCKS_AFWSMILE,
                    
'T' => _AM_SYSTEM_BLOCKS_AFNOSMILE));
                
$form->addElement($ctype_select);
            } else {
                
$form->addElement(new XoopsFormHidden('c_type''H'));
            }


and seems like the preview bug only occur when making a new topic or post, i still dont know the cause yet but i'll keep looking for the problem