if (typeof editor == "undefined" || editor == null || editor.isHidden()) { var emailContent = jQuery('#rmma-editor').val();}else { var emailContent = editor.getContent();}
//Send email action used to send users emailBlockly.Blocks['action_send_email'] = { init: function() { var rmmaGetEmailContent = function(content) { var currentContent = emailContent.length > 0 ? emailContent : content; jQuery('#rmma-editor-wrap, .lp-copy-editor').fadeIn(); /*while( currentContent == emailContent ){ setTimeout(function(){}, 250); if( currentContent != emailContent ){ return emailContent; } }*/ return currentContent; }
this.setHelpUrl(rmma_block_options.url+'/admin/admin.php?page=rm_kb&space_id=5088&manual_id=31779&lesson_id=310312'); this.setColour(186); this.appendDummyInput() .appendField("send user an email:"); this.appendDummyInput() .appendField("Subject: ") .appendField(new Blockly.FieldTextInput(""), "subject"); this.appendDummyInput() .appendField("Content:") .appendField(new Blockly.FieldTextInput("", rmmaGetEmailContent), "content"); this.setInputsInline(false); this.setOutput(true, "action"); this.setTooltip(''); }};
jQuery('body').on('click', '.button-save-copy', function(){ var editor = tinyMCE.EditorManager.get('rmma-editor');
if (typeof editor == "undefined" || editor == null || editor.isHidden()) { var content = jQuery('#rmma-editor').val(); } else { var content = editor.getContent(); }
emailContent = content; jQuery('#rmma-editor-wrap, .lp-copy-editor').fadeOut(400); return false; });
var showEditor = true;
//Send email action used to send users emailBlockly.Blocks['action_send_email'] = { init: function() { var rmmaGetEmailContent = function(content) { var currentContent = emailContent.length > 0 ? emailContent : content; if( showEditor ){ jQuery('#rmma-editor-wrap, .lp-copy-editor, .editor-overlay').fadeIn(); } return currentContent; }
this.setHelpUrl(rmma_block_options.url+'/admin/admin.php?page=rm_kb&space_id=5088&manual_id=31779&lesson_id=310312'); this.setColour(186); this.appendDummyInput() .appendField("send user an email:"); this.appendDummyInput() .appendField("Subject: ") .appendField(new Blockly.FieldTextInput(""), "subject"); this.appendDummyInput() .appendField("Content:") .appendField(new Blockly.FieldTextInput("", rmmaGetEmailContent), "content"); this.setInputsInline(false); this.setOutput(true, "action"); this.setTooltip(''); }};
jQuery('body').on('click', '.button-save-copy', function(){ if( typeof tinyMCE != "undefined" ){ var editor = tinyMCE.EditorManager.get('_rmma_editor'); }
if (typeof editor == "undefined" || editor == null || editor.isHidden()) { var content = jQuery('#_rmma_editor').val(); } else { var content = editor.getContent(); }
emailContent = content; showEditor = false; jQuery('.blocklyHtmlInput').sendkeys('\n').parents('.blocklyWidgetDiv').toggle().empty(); jQuery('#rmma-editor-wrap, .lp-copy-editor, .editor-overlay').fadeOut(400, function(){ showEditor = true; }); return false; });