function openModuleCommentDialog(commentText,onSaveFunction,maxChars,readonly,isIFrame,alternativeTitle,additionalTitle, htmltextmode,height,width,showTinyMCE, showAddUserNameAndDate, additionalInfo) { if ($("#trv_module_dialog_comment").length == 0) { blockScreen(true); showTinyMCE = (showTinyMCE == null || !showTinyMCE) ? 0:1; showAddUserNameAndDate = (showAddUserNameAndDate == null || !showAddUserNameAndDate) ? 0:1; if (width == null) { if (showTinyMCE) { width = 830; } else { width = 500; } } if (height == null) { height = 300; } if (maxChars == null) { maxChars = 3800; } readonly = (readonly == null || !readonly) ? 0:1; isIFrame = (isIFrame == null || !isIFrame) ? 0:1; var position = getIFramePosition(isIFrame); if (showTinyMCE) { position = "top"; } $("body").append(""); $("#trv_module_dialog_comment").load("http://www.it-matchmaker.nl/core/modules/comment/components/dialog_comment.php?onSaveFunction="+onSaveFunction+"&maxChars="+maxChars+"&isIFrame="+isIFrame+"&readonly="+readonly+"&height="+height+"&showTinyMCE="+showTinyMCE+"&full_path=NVkzNENoeWMoUmQ1aGFGPUYzd0ZzdUE7LCgvKD4xekhkZTVDK0ZzRWhiNVdtQjA8PkMqZEI_KyA7JXA7PjN5VHomcUVXW1daUG8sM2Fjbn0,&app_language=nl&PHPSESSID=2a9b82a32f11003898458e355cd24b0e", function() { if(htmltextmode) { $("#trv_module_dialog_comment textarea").html(commentText).text(); } else { $("#trv_module_dialog_comment textarea").val(commentText); } if (readonly) { $("#trv_module_comment_dialog_char_count").html($("#trv_module_dialog_comment textarea").val().length); } else if (!showTinyMCE) { moduleCommentCountCommentChars(maxChars); } if (additionalTitle != null) { $("#additionalTitle_box").html("

"+additionalTitle+"

"); $("#additionalTitle_box").addClass("trv_module_comment_info"); } if (additionalInfo != null) { $("#additionalTitle_box").html($("#additionalTitle_box").html()+additionalInfo); $("#additionalTitle_box").addClass("trv_module_comment_info"); } var dialogTitle = "Commentaar"; if (alternativeTitle != null) { dialogTitle = alternativeTitle; } $("#trv_module_dialog_comment").dialog({ close: function(event, ui) { if (showTinyMCE) { tinymce.execCommand('mceRemoveEditor',true,'trvModuleCommentInputComment'); } multiContentChanged(false,'core_module_comment'); $(this).dialog('destroy'); $("#trv_module_dialog_comment").remove(); }, beforeClose: function(event, ui) { if (trv_multiContentChanged.core_module_comment) { return trv_confirmClose("$('#trv_module_dialog_comment').dialog('close')",1,isIFrame,"core_module_comment"); } }, open: function(event, ui) { if (showTinyMCE) { initTinyMCE("#trvModuleCommentInputComment", function(){ if (!readonly) { moduleCommentCountCommentChars(maxChars, false, true); } setTimeout(function(){tinymce.execCommand('mceFocus',false,'trvModuleCommentInputComment');}, 150); unblockScreen(true); }, readonly,false,showAddUserNameAndDate); } else { unblockScreen(true); } }, closeOnEscape: readonly, resizable: false, position: position, minHeight: height, height: 'auto', width: width, modal: true, bgiframe: true, title: dialogTitle, zIndex: 8000, stack: false }); }); } } function moduleCommentCountCommentChars(maxChars, getOnlyCount, showTinyMCE) { if (maxChars == null) { maxChars = 3800; } if (getOnlyCount == null) { getOnlyCount = false; } if (showTinyMCE) { var count = maxChars - tinymce.get('trvModuleCommentInputComment').getContent().length; } else { var count = maxChars - $("#trv_module_dialog_comment textarea").val().length; } if (!getOnlyCount) { var info = count; if (count < 0) { info = ""+count+""; } $("#trv_module_comment_dialog_char_count").html(info); } return count; }