Aloha Editor の最初のバージョンを使用していますが、新しいバージョンに更新したいと考えています。
最初のバージョンでは、このスクリプトを使用して変更を読み取りました。
Aloha.ready(function() {
Aloha.require( ['aloha', 'aloha/jquery'], function( Aloha, jQuery) {
// save all changes after leaving an editable
Aloha.bind('aloha-editable-deactivated', function(){
var content = Aloha.activeEditable.getContents();
var contentId = Aloha.activeEditable.obj[0].id;
//var pageId = document.referrer;
//var pageId = window.location.pathname;
var pageId = location.pathname + location.search;
// textarea handling -- html id is "xy" and will be "xy-aloha" for the aloha editable
if ( contentId.match(/-aloha$/gi) ) {
contentId = contentId.replace( /-aloha/gi, '' );
}
var request = jQuery.ajax({
url: "editor_save.php",
type: "POST",
data: {
content : content,
contentId : contentId,
pageId : pageId
},
dataType: "html"
});
request.done(function(msg) {
jQuery("#log").html( msg ).show().delay(800).fadeOut();
});
request.error(function(jqXHR, textStatus) {
alert( "Request failed: " + textStatus );
});
});
});
});
このスクリプトのバージョン 2.0 では、それについて何も見つかりません。