Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Popup window with Advanced Editor
steam
✭
Hi,
I have popup window with Advanced Editor, I show window like
echo anchor(sprite('SpInbox', 'Sprite Sprite16').' '.t('Send PM'), url(SignInUrl($ReturnUrl), true), 'PM Popup', array('class' => 'Popup', 'rel' => 'nofollow'));
Bold and other edit options do not work
When the popup window is displayed with editor, it does not work and sent message is saved and displayed without the format in a single line.
If you send private message without popup window everything works.
Thanks, for any suggestion
0
Comments
No one has a similar bug with popup window and editor?
I guess no one has tried to do that
Based on the problems you are describing, I would think that some JavaScript selectors are set to elements which are not available when the editor is in a popup. For example, I see a "editor-active" class in the body tag, when I inspect this element.
Maybe the javascript error console shows up any hints...?
Yes @R_J
I found this error in javascript console:
TypeError: sel.nativeSelection is null[Saber más] wysihtml5-0.4.0pre.js:2973:17
on wysihtml5-0.4.0pre.js file line:
sel._ranges.length = sel.rangeCount = sel.nativeSelection.rangeCount;
sel.nativeSelection is null, something goes wrong with editor when popup is opened ...
You would have to do some debugging: try to find out where "sel" is defined. It should look similar to
var sel = ...
. Afterwards you might be able to see what would be missing to make it rum.Is declared in this function:
I have debugged with the javascript console of firefox ... It's a bit confusing and I do not really understand this javascript code.
I'll send you a user and link by private message, to see if at first glance you see something strange. I know that it is a complicated error, I thank you very much if you can take a look at least above.
Not sure if it helps, but I found this
It seems to be quite similar to your problem:when page is loaded and editor is hidden, the result is an error.
You should try changing line 2973 in /plugins/editor/js/wysihtml5-0.4.0pre.js
Comment out the line (by adding
//
at the beginning of the line) and insertsel._ranges.length = sel.rangeCount = (sel.nativeSelection ? sel.nativeSelection.rangeCount : 0);
below the old line.Please report back if that has solved your problem!
I also found this page with this solution
But it does not work.
Does not give the error "sel.nativeSelection is null", but is looped the editor javascript in this line and still does not work in the popup window
I did leave the javascript code as it was.
How did you create the popup? Did you simply add to it the class Popup ? it should work just like that without adding js.. I have a popup for onlinenow plugin and it shows the editor works fine.
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌
Hi @vrijvlinder,
On the code:
echo anchor(sprite('SpInbox', 'Sprite Sprite16').' '.t('Send PM'), url(SignInUrl($ReturnUrl), true), 'PM Popup', array('class' => 'Popup', 'rel' => 'nofollow', 'title' => 'enviar mensaje privado a: '.$Args['Author']->Name));
That is printed in html:
<a href="http://web.org/messages/add/antonio" class="PM Popup" rel="nofollow" title="enviar mensaje privado a: antonio"><span class="Sprite Sprite16 SpInbox"></span> Mensaje privado</a>
Thanks
I was wrong about the code that makes the link private message, sorry, this is it:
echo anchor(sprite('SpInbox', 'Sprite Sprite16').' '.t('Send PM'), url('/messages/add/'.$Args['Author']->Name, true), 'PM Popup', array('rel' => 'nofollow', 'title' => 'enviar mensaje privado a: '.$Args['Author']->Name));
I have discovered one thing ...
If I delete with the browser html editor main editor, and then I open popup window the editor that is in the popup works!
The problem has to be in the javascript wysihtml5-0.4.0pre.js or forms.
And I found this - https://github.com/jhollingworth/bootstrap-wysihtml5/issues/14