New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
{v4] jInsertEditorText not available #30247
Comments
It's already 4 years since this was deprecate. Here #12561 you'll find all the info you need to fix whatever is broken |
don't agree to comment. "jInsertEditorText" javascript is available with latest stable joomla version (3.9.20). The issue comes with version 3.10 and version 4. (#12561 describes a totally different problem). |
// An object to hold each editor instance on page, only define if not defined.
Joomla.editors.instances = Joomla.editors.instances || {
/**
* Editors MUST register, per instance, the following:
*
* getValue Type Function
* Should return the complete data from the editor
* Example: function () { return this.element.value; }
* setValue Type Function
* Should replace the complete data of the editor
* Example: function (text) { return this.element.value = text; }
* replaceSelection Type Function
* Should replace the selected text of the editor
* If nothing selected, will insert the data at the cursor
* Example: function (text) { return insertAtCursor(this.element, text); }
*
* USAGE (jform_articletext is the editor id)
* getValue:
* Joomla.editors.instances['jform_articletext'].getValue();
* setValue:
* Joomla.editors.instances['jform_articletext'].setValue('Joomla! rocks');
* replaceSelection:
* Joomla.editors.instances['jform_articletext'].replaceSelection('Joomla! rocks')
*
* *********************************************************
* ANY INTERACTION WITH THE EDITORS SHOULD USE THE ABOVE API
* *********************************************************
*/
}; You should use the new API: |
I'm using this half-assed, paranoid(?) code in all of my xtd-plugins (select/enter something in a pop-up and insert via button). From a time when first 4-dev "releases" came up and I tested my dinosaur J3 xtd-plugins with some editors on both platforms:
|
@ReLater im wondering who could ever wrote that paranoid code, oh wait: #14935 (comment) |
Ah, f'ing auto correction of my keyboard. I wanted to type "paramount" not "paranoid" ;-) For me it looked like one of my own paranoia what-the-hell-is-really-needed IF structures reassembled from diverse code snippets found on stackexchange ;-) if (good && !bad) No harm meant. It's brilliant code... because it works ... |
@ReLater no worries I was trolling myself 😎 |
jInsertEditorText javascript used with editor-xtd plugin is not available
Expected result
Should replace / insert text when editing article
Actual result
javascript error as code is unavailable
System information (as much as possible)
with joomla 3.x code was in /media/editors/... -> directories gone in V4 (migrated to???)
Additional comments
The text was updated successfully, but these errors were encountered: