How in joomla with API with AJAX get field "Editor" for form? - joomla

Insert this $code in module,
<form ...>
<?= JEditor::getInstance($name_editor)->display($namefield, $valuefield, '100%', 'auto', 10, 4, TRUE, $idfield, NULL, NULL,$paramsEditor); ?>
<input .../>
<input type="submit"/>
</form>
I’ll paste this code into the Joomla module, everything works fine, the WYSIWYG editor is loaded on the site. It has everything, a panel, buttons for boldness, size, indentation, etc.
But when the module works in AJAX mode, then when loading the form into the page, instead of the WYSIWYG editor, the usual <TEXTAREA> is displayed, next to the button is "Turn off editor". If you click on the "Turn Off Editor" button, nothing happens.
.
In my module there is a setting for choosing the type of editors "TynyEditor", "CodeMirror", "ArkEditor" . After choosing the type of editor and saving the settings, before the editor worked fine "JEditor::getInstance($name_editor)->displays()" without AJAX. But how to use Joomla API to display the Editor through Ajax page?

Related

Corrupted data in Ace Editor when using browser 'back' button in single page app

I'm using Ace Editor in a Rails app with TurboLinks. The editor is initialized each time a page is loaded (including when a page is loaded via the browser 'back' button):
$(document).on('turbolinks:load', function () {
var editor = ace.edit("editor");
});
When clicking a link to another page in the application, and then clicking the browser 'back' button, the editor field is corrupted. For example, if the data in the editor is:
toto
tata
The data (displayed in the textarea of the editor) after going to another page an coming back becomes:
12tototataXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
How to prevent this from happening in my application?
My workaround was the following (executed at each turbolinks:load event, including when user uses 'back' button):
remove the previous editor div (exists only when using 'back' button), with something like $('#editor').remove()
load the content from a hidden div that is never edited
add a new div for the editor, with the content to edit (something like $('#foo').after(${content})
initialize the editor with ace.edit("editor");

Want to replace "<p> </p>" with "<p></p>" on new paragraph button click in telerik rad editor

When we use New paragraph button in telerik rad editor it puts "<p> </p>".
Just Want to replace "<p> </p>" with "<p></p>" on new paragraph button click in telerik rad editor.
The entity inside the paragraph tags is added on purpose. If you remove it the browser won't be able to render the new line.
What I also noticed when testing the requested behavior is that IE automatically fills the contents of the empty tags with even when the content filters of the editor are disabled: http://demos.telerik.com/aspnet-ajax/editor/examples/builtincontentfilters/defaultcs.aspx.
I was able to reproduce this behavior in other WYSIWYG editors as well as in an editable iframe, which means that this is a browser behavior.

Joomla 1.5 - Displaying an content in a modal popup?

I would like to place a link to an article that contains some HTML and have that appear in a modal popup.
Modal pop-ups are maybe not already enabled on my web site. How I can enable them?
SOLVED:
Many JOOMLA templates turn the modal behavior ON. If not add this to main index <head></head>
<?php JHTML::_('behavior.modal'); ?>
On an article (HTML editor) use class="modal". Format your link like:
<a class="modal" href="terms/tou.html" rel="{handler:'iframe',size:{x:700,y:600}}">TOU</a>

Joomla 1.5 system messages in modal window?

I have made a link, that gives me Joomla's registration edit form into a modal window. Everything is okay with this but, when user click on save button, loads the whole homepage in to modal window with a message that says everything saved. How can I make it just load the system message in to modal window and not the whole home page?
set tmpl=component & format=raw in the controller before calling for the template. Your system msgs div should be inside the component to be shown.

set focus on textbox on a button click in mvc3

I have made a form in MVC and have included tabs. So I want to redirect to a text on a button lcik which is not in the default tab. So how can I do that
Write some jquery:
$('#buttonId').click(function(){
$('#textboxtofocusId').focus();
})

Resources