6
アロハエディタのドキュメントには、「aloha-smart-content-changed」イベントのリッスンを聞くことができます。たとえば、使用している永続性メカニズムにデータを保存することができます。ここに私がしようとしているものの例があります:アロハ・エディタ "aloha-smart-content-changed"イベントを聞く?
<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>
しかし、ハンドラは決して起動しません。アロハと一緒に仕事をしている方は、イベントを正しく聞く方法を知っていますか?
パーフェクトを助けjsfiddle here
希望でこれをテストしました。ニースを見つける、アミン、ありがとう! – mjswensen
実際のコンテンツをどのように入手するかについてのご意見はありますか? :/ – Populus
@Populus Aloha.getActiveEditable()。getContents(); 'を試してください。 – mjswensen