mwf.xdesktop.requireapp("process.xform", "$module", null, false);
mwf.xdesktop.requireapp("cms.xform", "widget.comment", null, false);
/** @class comment 评论组件。
* @o2cn 评论组件
* @example
* //可以在脚本中获取该组件
* //方法1:
* var comment = this.form.get("name"); //获取组件
* //方法2
* var comment = this.target; //在组件事件脚本中获取
* @extends mwf.xapplication.process.xform.$module
* @o2category formcomponents
* @o2range {cms}
* @hideconstructor
*/
mwf.xapplication.cms.xform.comment = mwf.cmscomment = new class(
/** @lends mwf.xapplication.process.xform.comment# */
{
extends: mwf.app$module,
_loaduserinterface: function(){
this.node.empty();
this.node.setstyle("-webkit-user-select", "text");
debugger;
var config = {};
if(this.json.editorproperties){
config = object.clone(this.json.editorproperties);
}
if (this.json.config){
if (this.json.config.code){
var obj = this.form.macro.exec(this.json.config.code, this);
object.each(obj, function(v, k){
config[k] = v;
});
}
}
/**
* @summary 评论组件使用this.comment实现功能
* @member {mwf.xapplication.cms.xform.widget.comment}
* @example
* //可以在脚本中获取该组件
* var field = this.form.get("fieldid"); //获取组件对象
* var items = field.comment.editor; //获取评论的编辑器对象
*/
this.comment = new mwf.xapplication.cms.xform.widget.comment( this.form.app, this.node, {
"documentid" : this.form.businessdata.document.id,
"countperpage" : this.json.countperpage || 10,
"isallowmodified" : this.json.isallowmodified,
"isallowpublish" : this.json.isallowpublish,
"isadmin" : this.form.app.isadmin,
"editorproperties" : config
});
this.comment.load();
}
});
source