Acorde a los documentos de Aloha Editor puede escuchar el evento "aloha-smart-content-changed" para obtener ayuda, por ejemplo, guardando los datos en cualquier mecanismo de persistencia que esté utilizando. Aquí hay un ejemplo de lo que estoy tratando de hacer:Escuchando el editor Aloha "aloha-smart-content-changed" ¿Evento?
<html>
<head>
<title>Aloha Event Testing</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="http://cdn.aloha-editor.org/current/lib/aloha.js" data-aloha-plugins="common/format, common/list, common/link, common/highlighteditables"></script>
<link href="http://cdn.aloha-editor.org/current/css/aloha.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
Aloha.ready(function() {
var $ = Aloha.jQuery;
$('.editable').aloha();
});
$(document).ready(function() {
$('.editable').bind('aloha-smart-content-changed', function() {
console.log('Aloha smart event handled.');
});
});
</script>
</head>
<body>
<div class="editable"></div>
</body>
</html>
Pero el controlador nunca se dispara. ¿Alguien que haya trabajado con Aloha sepa cómo escuchar adecuadamente el evento?
perfecto. Buen hallazgo, Amin, gracias! – mjswensen
alguna idea sobre cómo obtener el contenido real? :/ – Populus
@Populus Pruebe 'Aloha.getActiveEditable(). GetContents();'. – mjswensen