如何保存新的Aloha Editor 2.0?

时间:2015-01-22 00:56:59

标签: aloha-editor

我正在使用第一版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版本中找到任何相关内容。

0 个答案:

没有答案