Quote from: donshakespeare at Feb 21, 2017, 06:54 AMRE: firebot6
Let's prepare a different sort of treat for your spellValues
Hopefully that solves ya issue.
That works the first time I insert something with the button/dropdown, but trying to insert a second item gives me this error when clicking "My button" on the toolbar:
Uncaught TypeError: spellValues.replace is not a function. Recreated on the fiddle:
http://fiddle.tinymce.com/fKfaab. I thought it might be it was trying to run the replace a second time, so I moved it outside the getValues function to the normal function, but that breaks everything. I probably should have started with something easier, but that's not my style.
Thanks for the help again!
I'll ask this here too. I was looking into the Template Plugins you linked me earlier and they seem like what I ultimately want to do, but I wanted to run my full idea by you first in case there's something even better.
My goal with all this is to be able to have a popup window from a button that has a listbox and several text fields. You'll select a spell by name from the dropdown which will populate the text fields with the separate pieces of data, which you can then edit and save back to the database if needed (editing from the popup is a luxury feature). Once you have a spell selected, you can insert it along with all of the data into the editor with the intended HTML markup (or if HTML markup doesn't work, I have a Modx snippet I can pass the data through to make the HTML, which is what I'm using currently).
Am I correct that Template Plugins will let me handle as many data points as I need, where as the current listbox I'm working with is just "value" and "text"? I'm also assuming the text field population and saving back to the database could be handled similar to methods you'd use without TinyMCE in the picture, so that's something for me to work on by myself.