Page 1 of 1

Copy text from pop - up editor to posting_body

Posted: Sun Sep 29, 2019 10:33 am
by TJK
I'm developing an extension for our maths forum. I want to integrate an online latex equation editor so that writing mathematical formulae is easier. However, I'm having problem with the following: I want the written equation in the pop - up editor to be submitted to the posting_body form when copied. I cannot do that. I'd like some help to implement that part.

The extension can be downloaded from here. Apparently I cannot upload a zip file.

Thank you!

Re: Copy text from pop - up editor to posting_body

Posted: Sun Sep 29, 2019 10:51 am
by david63
The only extension that comes to mind that does something similar is the Advanced BBCode extension with adding links. It might be worth looking as to how that is done.

There may be other extensions doing the same.

Re: Copy text from pop - up editor to posting_body

Posted: Sun Sep 29, 2019 10:59 am
by TJK
Hi David,

I have that extension enabled in my board. How does this extension do that? Could you give me a kick in the right direction to know what to look for?

Re: Copy text from pop - up editor to posting_body

Posted: Sun Sep 29, 2019 11:46 am
by david63
TJK wrote:
Sun Sep 29, 2019 10:59 am
Hi David,

I have that extension enabled in my board. How does this extension do that? Could you give me a kick in the right direction to know what to look for?
I don't know - you will have to look into the code

Re: Copy text from pop - up editor to posting_body

Posted: Thu Oct 03, 2019 12:44 pm
by ViolaF
Better Prompt 4 BBCodes
https://www.phpbb.de/community/viewtopic.php?t=236211
have a simple Code-Base, so you can use it for the Latex-Thing

Re: Copy text from pop - up editor to posting_body

Posted: Thu Oct 03, 2019 1:05 pm
by mrgoldy
You can not upload zip files, as phpBB does not want to host extensions that are not validated, to prevent confusion and issues.

You can have a look at the editor.js file (github link) to find most of the functions used with BBCodes insertion.
For example, when submitting your popup, you can use insert_text() to insert the text into the textarea.