MyBB Community Forums

Full Version: Yui Editor - Inserting into post an attachments
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I need help with Yui Editor.

Users can't insert their attachments into post, because of error:

editpost.php?pid=91001:686 Uncaught TypeError: $(...).sceditor is not a function
    at HTMLInputElement.onclick (editpost.php?pid=91001:686)
onclick @ editpost.php?pid=91001:686

<input type="button" class="button" name="insert" value="Wstaw do posta" onclick="$('#message').sceditor('instance').insertText('[attachment=6923]'); return false;">

How it should be?
edit post_attachments_attachment_postinsert template

find: $('#message').sceditor('instance')

replace: MyBBEditor

so will be like :
<input type="button" class="button" name="insert" value="Wstaw do posta" onclick="MyBBEditor.insertText('[attachment=6923]'); return false;">
Still the same.

editpost.php?pid=91001:686 Uncaught TypeError: $(...).MyBBEditor is not a function
    at HTMLInputElement.onclick (editpost.php?pid=91001:686)
onclick @ editpost.php?pid=91001:686
(2018-03-18, 09:44 PM)Hewret Wrote: [ -> ]Still the same.

editpost.php?pid=91001:686 Uncaught TypeError: $(...).MyBBEditor is not a function
    at HTMLInputElement.onclick (editpost.php?pid=91001:686)
onclick @ editpost.php?pid=91001:686

?
why $(...).MyBBEditor ?
Doesn't has the red part ($(...).).

and you really properly read the previous post?
I said to replace $('#message').sceditor('instance'), and not only sceditor('instance')
Okay, I checked again and works.

Thank you!