7. Mai 2014 18:11
var textAreaName = "new_firmenprofil";
function onLoad(textarea) {
textAreaName = textarea;
Xrm.Page.getAttribute(textAreaName).setSubmitMode("always");
$('#' + textAreaName + '_d').append('<textarea id="wysiwyg" name="wysiwyg" style="width:90%;height:90%;">' + $("#" + textAreaName).val() + '</textarea>');
$('#' + textAreaName).hide();
tinyMCE.init({
mode : "exact",
elements : "wysiwyg",
theme : "advanced",
plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,inlinepopups,autosave",
theme_advanced_buttons1 : "newdocument,|,bold,italic,underline,|,justifyleft,justifycenter,justifyright,fontselect,fontsizeselect,formatselect",
theme_advanced_buttons2 : "cut,copy,paste,|,bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,|,code,preview,|,forecolor,backcolor",
theme_advanced_buttons3 : "insertdate,inserttime,|,spellchecker,advhr,,removeformat,|,sub,sup,|,charmap,emotions",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : true,
onchange_callback : "myCustomOnChangeHandler"
});
}
function myCustomOnChangeHandler(inst) {
if(inst.isDirty()) {
inst.save();
}
Xrm.Page.getAttribute(textAreaName).setValue($('#wysiwyg').val());
return true;
}
function onSave() {
for (var i=0; i<tinymce.editors.length; i++) {
tinyMCE.execCommand('mceRemoveControl',false, tinymce.editors[i].id);
};
$('#wysiwyg').remove();
}
7. Mai 2014 18:43
7. Mai 2014 21:48
8. Mai 2014 09:01