vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Advanced Editor (WYSIWYG) in Chrome and Opera (https://vborg.vbsupport.ru/showthread.php?t=326343)

Scandal 04-26-2018 07:54 AM

Advanced Editor (WYSIWYG) in Chrome and Opera
 
I'm trying to find a solution to make Advanced Editor (WYSIWYG) to be working in Chrome and Opera.

Anyone could help?

Could anyone describe what's the exact issue and how "easy" is that to be fixed?

Nas.er 04-27-2018 02:28 PM

1 Attachment(s)
try this and work for me 100%

In template: editor_toolbar_on
Find:
PHP Code:

</if>
                <
td>
                    <
div class="imagebutton" id="{$editorid}_cmd_resize_0_100"><img src="$stylevar[imgdir_editor]/resize_0.gif" width="21" height="9" alt="$vbphrase[decrease_size]/></div>
                    <
div class="imagebutton" id="{$editorid}_cmd_resize_1_100"><img src="$stylevar[imgdir_editor]/resize_1.gif" width="21" height="9" alt="$vbphrase[increase_size]/></div>
                </
td

Below Add:
PHP Code:

            <if condition="$show['wysiwyg_compatible']">
                <
td><div class="imagebutton" id="{$editorid}_cmd_switchmode"><img src="$stylevar[imgdir_editor]/switchmode.gif" width="21" height="20" alt="$vbphrase[switch_editor_mode]/></div></td>
            </if>
            <
td><div class="imagebutton" id="{$editorid}_cmd_switchmode">
                    <
p style="margin-top: 0; margin-bottom: 0"><img src="$stylevar[imgdir_editor]/switchmode.gif" width="21" height="20" alt="$vbphrase[switch_editor_mode]/></div></td

And
In template: showthread_quickreply
Find:
PHP Code:

</if>
                <
td>
                    <
div class="imagebutton"  id="{$editorid}_cmd_resize_0_100"><img  src="$stylevar[imgdir_editor]/resize_0.gif" width="21" height="9"  alt="$vbphrase[decrease_size]/></div>
                    <
div class="imagebutton"  id="{$editorid}_cmd_resize_1_100"><img  src="$stylevar[imgdir_editor]/resize_1.gif" width="21" height="9"  alt="$vbphrase[increase_size]/></div>
                </
td

Below Add:
PHP Code:

<if condition="$show['wysiwyg_compatible']">
                <
td><div class="imagebutton"  id="{$editorid}_cmd_switchmode"><img  src="$stylevar[imgdir_editor]/switchmode.gif" width="21" height="20"  alt="$vbphrase[switch_editor_mode]/></div></td>
            </if>
            <
td><div class="imagebutton" id="{$editorid}_cmd_switchmode">
                    <
p style="margin-top: 0; margin-bottom:  0"><img src="$stylevar[imgdir_editor]/switchmode.gif" width="21"  height="20" alt="$vbphrase[switch_editor_mode]"  /></div></td

https://vbulletin.org/forum/attachme...1&d=1524846894

Scandal 04-28-2018 08:44 AM

Hello Nas.er :)

Yes, it seems it is enabling the WYSIWYG editor for Chrome.
Basically, if I just for test do this:
1. Open file /includes/functions_editor.php
2. Make the function is_wysiwyg_compatible($userchoice = -1, $editormode = 'fe') to return 2;

... will enable too the editor, but still there are issues like:
1. I cannot insert smilies. I see this on the browser console:
Code:

vbulletin_textedit.js?v=384:3865 Uncaught TypeError: Cannot read property 'createRange' of undefined
    at vB_Text_Editor.insert_text (vbulletin_textedit.js?v=384:3865)
    at vB_Text_Editor.insert_smilie (vbulletin_textedit.js?v=384:3775)
    at HTMLImageElement.vB_Text_Editor_Events.smilie_onclick (vbulletin_textedit.js?v=384:6044)

The issue is on this part of code:
Code:

                        var sel = this.editdoc.selection.createRange();

                        sel.pasteHTML(text);

(about function this.insert_text()).

2. Also I cannot use the insert link button. When I click it to enter a link, I see a "true" phrase linkable on the editor. Not the expected browser popup to enter the link.

Any idea? :)

MaKayWeB 04-28-2018 03:03 PM

thank you maybe i'm looking about 1 month now i find it solution.

Scandal 04-29-2018 12:25 PM

Yes, but just enabling the Advanced Editor with the pre-noticed issues (smilies insert, link insert) is it not make it good for the production site. :(

Nas.er 04-29-2018 03:46 PM

Quote:

Originally Posted by Scandal (Post 2594437)
Yes, but just enabling the Advanced Editor with the pre-noticed issues (smilies insert, link insert) is it not make it good for the production site. :(

i have no issues with that after enabling WYS editor!

Scandal 04-29-2018 07:05 PM

Very strange, I still have them. I have them in two diff vB3 boards. :(

Nas.er 05-02-2018 11:19 AM

Quote:

Originally Posted by Scandal (Post 2594439)
Very strange, I still have them. I have them in two diff vB3 boards. :(

:eek: well. you right. after looking in my forum . but that not issue! its simpley just switch the wysiwyg button on and off when you need insert a link.

hoangzu 06-10-2018 03:12 PM

I also looking for this code too. My forum v3.8.11 not working WYSIWYG with Chrome and MS Edge on windows 10 as well.
If any one have any code for WYSIWYG with Chrome and MS Edge that it is wonderful. :)

Kind Regards,


All times are GMT. The time now is 02:25 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01966 seconds
  • Memory Usage 1,766KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (4)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete