提交 c8590fbf 编写于 作者: U unknown

内容管理加入tiny

上级 60ee1b36
......@@ -190,6 +190,11 @@
"text": MWF.xApplication.cms.FormDesigner.LP.modules.htmledit,
"className": "Htmleditor"
},
"tinymceEditor": {
"icon": "tinymceeditor.png",
"text": MWF.xApplication.cms.FormDesigner.LP.modules.tinymceEditor,
"className": "TinyMCEEditor"
},
"log": {
"icon": "log.png",
"text": MWF.xApplication.cms.FormDesigner.LP.modules.log,
......
......@@ -191,6 +191,11 @@
"text": MWF.xApplication.cms.FormDesigner.LP.modules.htmledit,
"className": "Htmleditor"
},
"tinymceEditor": {
"icon": "tinymceeditor.png",
"text": MWF.xApplication.cms.FormDesigner.LP.modules.tinymceEditor,
"className": "TinyMCEEditor"
},
"log": {
"icon": "log.png",
"text": MWF.xApplication.cms.FormDesigner.LP.modules.log,
......
......@@ -8,7 +8,7 @@ MWF.xApplication.cms.FormDesigner.Module.Form = MWF.CMSFCForm = new Class({
"propertyPath": "../x_component_cms_FormDesigner/Module/Form/form.html",
"mode": "PC",
"fields": ["Calendar", "Checkbox", "Datagrid", "Datagrid$Title", "Datagrid$Data", "Datatable", "Datatable$Title", "Datatable$Data",
"Datatemplate", "Htmleditor", "Number", "Office", "Orgfield", "Personfield", "Readerfield", "Authorfield", "Org", "Reader", "Author", "Radio", "Select", "Textarea", "Textfield", "Address","Combox"],
"Datatemplate", "Htmleditor", "TinyMCEEditor", "Number", "Office", "Orgfield", "Personfield", "Readerfield", "Authorfield", "Org", "Reader", "Author", "Radio", "Select", "Textarea", "Textfield", "Address","Combox"],
"injectActions" : [
{
"name" : "top",
......
......@@ -38,6 +38,7 @@ MWF.xDesktop.requireApp("cms.FormDesigner", "Module.Tab", null, false);
MWF.xDesktop.requireApp("cms.FormDesigner", "Module.Tree", null, false);
MWF.xDesktop.requireApp("cms.FormDesigner", "Module.Iframe", null, false);
MWF.xDesktop.requireApp("cms.FormDesigner", "Module.Htmleditor", null, false);
MWF.xDesktop.requireApp("cms.FormDesigner", "Module.TinyMCEEditor", null, false);
MWF.xDesktop.requireApp("cms.FormDesigner", "Module.Common", null, false);
MWF.xDesktop.requireApp("cms.FormDesigner", "Module.Documenteditor", null, false);
MWF.xDesktop.requireApp("cms.FormDesigner", "Module.Office", null, false);
......
MWF.xApplication.cms.FormDesigner.Module = MWF.xApplication.cms.FormDesigner.Module || {};
MWF.xDesktop.requireApp("process.FormDesigner", "Module.TinyMCEEditor", null, false);
MWF.xApplication.cms.FormDesigner.Module.TinyMCEEditor = MWF.CMSFCTinyMCEEditor = new Class({
Extends: MWF.FCTinyMCEEditor,
Implements : [MWF.CMSFCMI],
_setEditStyle_custom: function(name){
if (name=="editorProperties"){
if (this.editor){
Object.each(this.json.editorProperties, function(value, key){
if (value=="true") this.json.editorProperties[key] = true;
if (value=="false") this.json.editorProperties[key] = false;
}.bind(this));
this.distroyEditor();
var config = Object.clone(this.json.editorProperties);
if (this.json.config){
if (this.json.config.code){
var obj = MWF.Macro.exec(this.json.config.code, this);
Object.each(obj, function(v, k){
config[k] = v;
});
}
}
this.loadTinyMCEEditor(config);
}
}
if (name=="templateCode"){
if (this.editor) {
this.editor.setContent(this.json.templateCode);
}
}
},
_initModule: function(){
this.node.empty();
var config = Object.clone(this.json.editorProperties);
if (this.json.config){
if (this.json.config.code){
var obj = MWF.Macro.exec(this.json.config.code, this);
Object.each(obj, function(v, k){
config[k] = v;
});
}
}
this.loadTinyMCEEditor(config);
this._setNodeProperty();
if (!this.form.isSubform) this._createIconAction() ;
this._setNodeEvent();
}
});
MWF.xDesktop.requireApp("process.Xform", "TinyMCEEditor", null, false);
MWF.xApplication.cms.Xform.TinyMCEEditor = MWF.CMSTinyMCEEditor = new Class({
Extends: MWF.APPTinyMCEEditor,
getImageUploadOption: function(){
return {
localImageMaxWidth : 2000,
reference: this.form.businessData.document.id,
referenceType: "cmsDocument"
};
},
getEditorId: function(){
return this.form.businessData.document.id +"_"+this.json.id + "_" + (layout.mobile ? "mobile" : "pc");
},
getText: function () {
return this.editor ? this.editor.getContent({format: 'text'}) : "";
},
getImages: function () {
if( !this.editor )return [];
var result = [];
var imgaes = this.editor.getBody();
if (imgaes) {
for (var i = 0; i < imgaes.$.length; i++) {
result.push(imgaes.getItem(i).$);
}
}
return result;
},
getImageIds: function () {
var result = [];
var images = this.getImages();
for (var i = 0; i < images.length; i++) {
var img = images[i];
if (img.getAttribute("data-id")) {
result.push(img.getAttribute("data-id"))
}
}
return result;
},
_loadStyles: function () {
if (this.json.styles) this.node.setStyles(this.json.styles);
this.node.setStyle("overflow", "hidden");
},
validationConfigItem: function (routeName, data) {
var flag = (data.status == "all") ? true : (routeName == "publish");
if (flag) {
var n = this.getData();
var v = (data.valueType == "value") ? n : n.length;
switch (data.operateor) {
case "isnull":
if (!v) {
this.notValidationMode(data.prompt);
return false;
}
break;
case "notnull":
if (v) {
this.notValidationMode(data.prompt);
return false;
}
break;
case "gt":
if (v > data.value) {
this.notValidationMode(data.prompt);
return false;
}
break;
case "lt":
if (v < data.value) {
this.notValidationMode(data.prompt);
return false;
}
break;
case "equal":
if (v == data.value) {
this.notValidationMode(data.prompt);
return false;
}
break;
case "neq":
if (v != data.value) {
this.notValidationMode(data.prompt);
return false;
}
break;
case "contain":
if (v.indexOf(data.value) != -1) {
this.notValidationMode(data.prompt);
return false;
}
break;
case "notcontain":
if (v.indexOf(data.value) == -1) {
this.notValidationMode(data.prompt);
return false;
}
break;
}
}
return true;
}
});
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册