From 13d9bc8283945dfb22d520f870ac1002f9c6b42c Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Tue, 28 Apr 2015 22:29:50 -0600 Subject: [PATCH] CRM-16354 - Remove old wysiwyg code --- CRM/Activity/Form/Activity.php | 8 +- CRM/Admin/Form/Preferences/Display.php | 9 - CRM/Contact/Form/Relationship.php | 2 - CRM/Core/Form/Search.php | 9 +- CRM/Core/Page.php | 1 - CRM/Core/Smarty.php | 14 -- CRM/Event/Page/ManageEvent.php | 1 - js/wysiwyg/crm.ckeditor.js | 3 + templates/CRM/Activity/Form/Activity.tpl | 6 +- templates/CRM/Admin/Form/MessageTemplates.tpl | 2 +- templates/CRM/Admin/Page/MessageTemplates.tpl | 3 - .../CRM/Admin/Page/ScheduleReminders.tpl | 2 - templates/CRM/Batch/Form/Entry.js | 24 +-- templates/CRM/Batch/Form/Entry.tpl | 23 +-- templates/CRM/Campaign/Form/Survey/Main.tpl | 2 - templates/CRM/Case/Form/Activity.tpl | 6 +- templates/CRM/Case/Form/Case.tpl | 2 +- templates/CRM/Case/Page/CustomDataView.tpl | 4 - templates/CRM/Contact/Form/Relationship.tpl | 4 +- templates/CRM/Contact/Form/Task/Email.hlp | 9 +- .../CRM/Contact/Form/Task/EmailCommon.tpl | 2 +- .../CRM/Contact/Form/Task/PDFLetterCommon.tpl | 5 +- templates/CRM/Contact/Page/View/Summary.tpl | 2 - templates/CRM/Mailing/Form/ForwardMailing.tpl | 31 --- templates/CRM/Mailing/Form/InsertTokens.tpl | 183 +----------------- templates/CRM/common/TabHeader.tpl | 4 - templates/CRM/common/batchCopy.tpl | 41 +--- templates/CRM/common/customData.tpl | 4 - templates/CRM/common/drupal.tpl | 3 - templates/CRM/common/drupal6.tpl | 3 - templates/CRM/common/joomla.tpl | 3 - templates/CRM/common/wordpress.tpl | 3 - templates/CRM/common/wysiwyg.tpl | 37 ---- 33 files changed, 35 insertions(+), 420 deletions(-) delete mode 100644 templates/CRM/common/wysiwyg.tpl diff --git a/CRM/Activity/Form/Activity.php b/CRM/Activity/Form/Activity.php index 1fe07df7cb..cc825b6a9c 100644 --- a/CRM/Activity/Form/Activity.php +++ b/CRM/Activity/Form/Activity.php @@ -157,8 +157,7 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task { 'details' => array( 'type' => 'wysiwyg', 'label' => ts('Details'), - // forces a smaller edit window - 'attributes' => array('rows' => 4, 'cols' => 60), + 'attributes' => array('class' => 'huge'), 'required' => FALSE, ), 'status_id' => array( @@ -664,10 +663,7 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task { $attribute = CRM_Utils_Array::value('attributes', $values); $required = !empty($values['required']); - if ($values['type'] == 'wysiwyg') { - $this->addWysiwyg($field, $values['label'], $attribute, $required); - } - elseif ($values['type'] == 'select' && empty($attribute)) { + if ($values['type'] == 'select' && empty($attribute)) { $this->addSelect($field, array('entity' => 'activity'), $required); } elseif ($values['type'] == 'entityRef') { diff --git a/CRM/Admin/Form/Preferences/Display.php b/CRM/Admin/Form/Preferences/Display.php index 5fde51486a..6fb5569b47 100644 --- a/CRM/Admin/Form/Preferences/Display.php +++ b/CRM/Admin/Form/Preferences/Display.php @@ -226,17 +226,8 @@ class CRM_Admin_Form_Preferences_Display extends CRM_Admin_Form_Preferences { CRM_Core_BAO_OptionValue::updateOptionWeights($opGroupId, array_flip($preferenceWeights)); } - $config = CRM_Core_Config::singleton(); - if ($config->userSystem->is_drupal == '1' && module_exists("wysiwyg")) { - variable_set('civicrm_wysiwyg_input_format', $this->_params['wysiwyg_input_format']); - } - $this->_config->editor_id = $this->_params['editor_id']; - // set default editor to session if changed - $session = CRM_Core_Session::singleton(); - $session->set('defaultWysiwygEditor', $this->_params['editor_id']); - $this->postProcessCommon(); } diff --git a/CRM/Contact/Form/Relationship.php b/CRM/Contact/Form/Relationship.php index 275b27b66c..661432c665 100644 --- a/CRM/Contact/Form/Relationship.php +++ b/CRM/Contact/Form/Relationship.php @@ -297,8 +297,6 @@ class CRM_Contact_Form_Relationship extends CRM_Core_Form { ); return; } - // Just in case custom data includes a rich text field - $this->assign('includeWysiwygEditor', TRUE); // Select list $relationshipList = CRM_Contact_BAO_Relationship::getContactRelationshipType($this->_contactId, $this->_rtype, $this->_relationshipId); diff --git a/CRM/Core/Form/Search.php b/CRM/Core/Form/Search.php index 9aba90f824..98af386968 100644 --- a/CRM/Core/Form/Search.php +++ b/CRM/Core/Form/Search.php @@ -94,14 +94,7 @@ class CRM_Core_Form_Search extends CRM_Core_Form { * Common buildform tasks required by all searches */ public function buildQuickform() { - $resources = CRM_Core_Resources::singleton(); - - if ($resources->ajaxPopupsEnabled) { - // Script needed by some popups - $this->assign('includeWysiwygEditor', TRUE); - } - - $resources + CRM_Core_Resources::singleton() ->addScriptFile('civicrm', 'js/crm.searchForm.js', 1, 'html-header') ->addStyleFile('civicrm', 'css/searchForm.css', 1, 'html-header'); diff --git a/CRM/Core/Page.php b/CRM/Core/Page.php index 0dd6d87142..97f07de085 100644 --- a/CRM/Core/Page.php +++ b/CRM/Core/Page.php @@ -227,7 +227,6 @@ class CRM_Core_Page { CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'ajaxPopupsEnabled', NULL, TRUE) ) { CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js', 1, 'html-header'); - $this->assign('includeWysiwygEditor', TRUE); } $content = self::$_template->fetch('CRM/common/' . strtolower($config->userFramework) . '.tpl'); diff --git a/CRM/Core/Smarty.php b/CRM/Core/Smarty.php index 1e7b03379e..7553d4ae86 100644 --- a/CRM/Core/Smarty.php +++ b/CRM/Core/Smarty.php @@ -141,20 +141,6 @@ class CRM_Core_Smarty extends Smarty { $this->assign_by_ref('config', $config); $this->assign_by_ref('session', $session); - // check default editor and assign to template - $defaultWysiwygEditor = $session->get('defaultWysiwygEditor'); - if (!$defaultWysiwygEditor && !CRM_Core_Config::isUpgradeMode()) { - $defaultWysiwygEditor = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, - 'editor_id' - ); - // For logged-in users, store it in session to reduce db calls - if ($session->get('userID')) { - $session->set('defaultWysiwygEditor', $defaultWysiwygEditor); - } - } - - $this->assign('defaultWysiwygEditor', $defaultWysiwygEditor); - global $tsLocale; $this->assign('tsLocale', $tsLocale); diff --git a/CRM/Event/Page/ManageEvent.php b/CRM/Event/Page/ManageEvent.php index 75ae25dbdd..4dae8e7c61 100644 --- a/CRM/Event/Page/ManageEvent.php +++ b/CRM/Event/Page/ManageEvent.php @@ -248,7 +248,6 @@ class CRM_Event_Page_ManageEvent extends CRM_Core_Page { * @return void */ public function browse() { - $this->assign('includeWysiwygEditor', TRUE); $this->_sortByCharacter = CRM_Utils_Request::retrieve('sortByCharacter', 'String', $this diff --git a/js/wysiwyg/crm.ckeditor.js b/js/wysiwyg/crm.ckeditor.js index f42ab23319..fe7fc499d8 100644 --- a/js/wysiwyg/crm.ckeditor.js +++ b/js/wysiwyg/crm.ckeditor.js @@ -25,6 +25,9 @@ editor.config.filebrowserUploadUrl = uploadUrl + '&type=files'; editor.config.filebrowserImageUploadUrl = uploadUrl + '&type=images'; editor.config.filebrowserFlashUploadUrl = uploadUrl + '&type=flash'; + editor.on('focus', function() { + $(item).trigger('focus'); + }); editor.on('blur', function() { editor.updateElement(); $(item).trigger("blur"); diff --git a/templates/CRM/Activity/Form/Activity.tpl b/templates/CRM/Activity/Form/Activity.tpl index 896c090f7e..9916977ef0 100644 --- a/templates/CRM/Activity/Form/Activity.tpl +++ b/templates/CRM/Activity/Form/Activity.tpl @@ -155,13 +155,11 @@ {$form.details.label} {if $activityTypeName eq "Print PDF Letter"} - {* If using plain textarea, assign class=huge to make input large enough. *} - {if $defaultWysiwygEditor eq 0}{$form.details.html|crmAddClass:huge}{else}{$form.details.html}{/if} + {$form.details.html} {else} - {* If using plain textarea, assign class=huge to make input large enough. *} - {if $defaultWysiwygEditor eq 0}{$form.details.html|crmStripAlternatives|crmAddClass:huge}{else}{$form.details.html|crmStripAlternatives}{/if} + {$form.details.html|crmStripAlternatives} {/if} diff --git a/templates/CRM/Admin/Form/MessageTemplates.tpl b/templates/CRM/Admin/Form/MessageTemplates.tpl index ca03ec8860..2f362dde80 100644 --- a/templates/CRM/Admin/Form/MessageTemplates.tpl +++ b/templates/CRM/Admin/Form/MessageTemplates.tpl @@ -69,7 +69,7 @@
- {help id="id-token-html" tplFile=$tplFile isAdmin=$isAdmin editor=$editor file="CRM/Contact/Form/Task/Email.hlp"} + {help id="id-token-html" tplFile=$tplFile isAdmin=$isAdmin file="CRM/Contact/Form/Task/Email.hlp"}
diff --git a/templates/CRM/Admin/Page/MessageTemplates.tpl b/templates/CRM/Admin/Page/MessageTemplates.tpl index c17fac0451..ef4ce5405f 100644 --- a/templates/CRM/Admin/Page/MessageTemplates.tpl +++ b/templates/CRM/Admin/Page/MessageTemplates.tpl @@ -87,9 +87,6 @@ {if $rows and $action ne 2 and $action ne 4} - {* include wysiwyg related files*} - {include file="CRM/common/wysiwyg.tpl" includeWysiwygEditor=true} -
  • {ts}User-driven Messages{/ts}
  • diff --git a/templates/CRM/Admin/Page/ScheduleReminders.tpl b/templates/CRM/Admin/Page/ScheduleReminders.tpl index 7f6cb7eaba..ff9c7da401 100644 --- a/templates/CRM/Admin/Page/ScheduleReminders.tpl +++ b/templates/CRM/Admin/Page/ScheduleReminders.tpl @@ -33,8 +33,6 @@ {if $action eq 1 or $action eq 2 or $action eq 8 or $action eq 16384} {include file="CRM/Admin/Form/ScheduleReminders.tpl"} {else} - {* include wysiwyg related files*} - {include file="CRM/common/wysiwyg.tpl" includeWysiwygEditor=true} {if !$component} {capture assign=schedRemindersDocLink}{docURL page="user/current/email/scheduled-reminders/"}{/capture}
    diff --git a/templates/CRM/Batch/Form/Entry.js b/templates/CRM/Batch/Form/Entry.js index 5a5ce82dce..76de1283bc 100755 --- a/templates/CRM/Batch/Form/Entry.js +++ b/templates/CRM/Batch/Form/Entry.js @@ -216,9 +216,6 @@ function setFieldValue(fname, fieldValue, blockNo) { //check if it is date element var isDateElement = elementId.attr('format'); - // check if it is wysiwyg element - var editor = elementId.attr('editor'); - //get the element type var elementType = elementId.attr('type'); @@ -244,25 +241,8 @@ function setFieldValue(fname, fieldValue, blockNo) { } } else { - if (editor) { - switch (editor) { - case 'ckeditor': - elemtId = elementId.attr('id'); - oEditor = CKEDITOR.instances[elemtId]; - oEditor.setData(htmlContent); - break; - case 'tinymce': - var elemtId = element.attr('id'); - tinyMCE.get(elemtId).setContent(htmlContent); - break; - case 'joomlaeditor': - // TO DO - case 'drupalwysiwyg': - // TO DO - break; - default: - elementId.val(fieldValue); - } + if (elementId.is('textarea')) { + CRM.wysiwyg.setVal(elementId, fieldValue); } else { elementId.val(fieldValue); diff --git a/templates/CRM/Batch/Form/Entry.tpl b/templates/CRM/Batch/Form/Entry.tpl index ec71ea6737..f2f33d856c 100755 --- a/templates/CRM/Batch/Form/Entry.tpl +++ b/templates/CRM/Batch/Form/Entry.tpl @@ -427,9 +427,6 @@ function setFieldValue(fname, fieldValue, blockNo) { //check if it is date element var isDateElement = elementId.attr('format'); - // check if it is wysiwyg element - var editor = elementId.attr('editor'); - //get the element type var elementType = elementId.attr('type'); @@ -455,24 +452,8 @@ function setFieldValue(fname, fieldValue, blockNo) { } } else { - if (editor) { - switch (editor) { - case 'ckeditor': - var elemtId = elementId.attr('id'); - oEditor = CKEDITOR.instances[elemtId]; - oEditor.setData(htmlContent); - break; - case 'tinymce': - var elemtId = element.attr('id'); - tinyMCE.get(elemtId).setContent(htmlContent); - break; - case 'joomlaeditor': - // TO DO - case 'drupalwysiwyg': - // TO DO - default: - elementId.val(fieldValue); - } + if (elementId.is('textarea')) { + CRM.wysiwyg.setVal(elementId, fieldValue); } else { elementId.val(fieldValue); diff --git a/templates/CRM/Campaign/Form/Survey/Main.tpl b/templates/CRM/Campaign/Form/Survey/Main.tpl index 46dc9dde18..93dd5416ad 100644 --- a/templates/CRM/Campaign/Form/Survey/Main.tpl +++ b/templates/CRM/Campaign/Form/Survey/Main.tpl @@ -107,8 +107,6 @@ }); {/literal} -{* editor has already been included in TabHeader.tpl so set flag true *} -{include file="CRM/common/customData.tpl" includeWysiwygEditor=true} {literal} -{/literal} diff --git a/templates/CRM/Mailing/Form/InsertTokens.tpl b/templates/CRM/Mailing/Form/InsertTokens.tpl index 57dc5c8122..a711b1b76b 100644 --- a/templates/CRM/Mailing/Form/InsertTokens.tpl +++ b/templates/CRM/Mailing/Form/InsertTokens.tpl @@ -75,7 +75,6 @@ var isMailing = false; {/if} {literal} -var editor = {/literal}"{$editor}"{literal}; function showSaveUpdateChkBox(prefix) { prefix = prefix || ''; if (document.getElementById(prefix + "template") == null) { @@ -127,33 +126,7 @@ function selectValue( val, prefix) { document.getElementById("text_message").value =""; } } - if ( editor == "ckeditor" ) { - oEditor = CKEDITOR.instances[html_message]; - oEditor.setData(''); - } - else if ( editor == "tinymce" ) { - tinyMCE.getInstanceById(html_message).setContent( html_body ); - } - else if ( editor == "joomlaeditor" ) { - document.getElementById(html_message).value = '' ; - tinyMCE.execCommand('mceSetContent',false, ''); - } - else if ( editor =="drupalwysiwyg" ) { - if (Drupal.wysiwyg.instances[html_message].setContent) { - Drupal.wysiwyg.instances[html_message].setContent(html_body); - } - // @TODO: Remove this when http://drupal.org/node/614146 drops - else if (Drupal.wysiwyg.instances[html_message].insert) { - alert("Please note your editor doesn't completely support this function. You may need to clear the contents of the editor prior to choosing a new template."); - Drupal.wysiwyg.instances[html_message].insert(html_body); - } - else { - alert("Sorry, your editor doesn't support this function yet."); - } - } - else { - document.getElementById(html_message).value = '' ; - } + CRM.wysiwyg.setVal('#' + html_message, ''); if ( isPDF ) { showBindFormatChkBox(); } @@ -184,38 +157,9 @@ function selectValue( val, prefix) { else { cj("#subject").val( data.subject ); } - var html_body = ""; - if ( data.msg_html ) { - html_body = data.msg_html; - } - if (editor == "ckeditor") { - oEditor = CKEDITOR.instances[html_message]; - oEditor.setData( html_body ); - } - else if (editor == "tinymce") { - tinyMCE.execInstanceCommand('html_message',"mceInsertContent",false, html_body ); - } - else if (editor == "joomlaeditor") { - cj("#"+ html_message).val( html_body ); - tinyMCE.execCommand('mceSetContent',false, html_body); - } - else if ( editor =="drupalwysiwyg") { - if (Drupal.wysiwyg.instances[html_message].setContent) { - Drupal.wysiwyg.instances[html_message].setContent(html_body); - } - // @TODO: Remove this when http://drupal.org/node/614146 drops - else if (Drupal.wysiwyg.instances[html_message].insert) { - alert("Please note your editor doesn't completely support this function. You may need to clear the contents of the editor prior to choosing a new template."); - Drupal.wysiwyg.instances[html_message].insert(html_body); - } - else { - alert("Sorry, your editor doesn't support this function yet."); - } - } - else { - cj("#"+ html_message).val( html_body ); - } + CRM.wysiwyg.setVal('#' + html_message, data.msg_html || ''); + if (isPDF) { var bind = data.pdf_format_id ? true : false ; selectFormat( data.pdf_format_id, bind ); @@ -270,52 +214,7 @@ if ( isMailing ) { showSaveUpdateChkBox(); } - {/literal} - {if $editor eq "ckeditor"} - {literal} - CRM.$(function($) { - oEditor = CKEDITOR.instances['html_message']; - oEditor.BaseHref = '' ; - oEditor.UserFilesPath = '' ; - oEditor.on( 'focus', verify ); - }); - {/literal} - {elseif $editor eq "tinymce"} - {literal} - CRM.$(function($) { - if ( isMailing ) { - $('div.html').hover( - function( ) { - if ( tinyMCE.get(html_message) ) { - tinyMCE.get(html_message).onKeyUp.add(function() { - verify( ); - }); - } - }, - function( ) { - if ( tinyMCE.get(html_message) ) { - if ( tinyMCE.get(html_message).getContent() ) { - verify( ); - } - } - } - ); - } - }); - {/literal} - {elseif $editor eq "drupalwysiwyg"} - {literal} - CRM.$(function($) { - if ( isMailing ) { - $('div.html').hover( - verify, - verify - ); - } - }); - {/literal} - {/if} - {literal} + cj('#' + html_message).on('focus change', verify); } CRM.$(function($) { @@ -323,12 +222,10 @@ CRM.$(function($) { var token = $(this).val(), field = $(this).data('field'); - if (field === 'html_message') { - tokenReplHtml(token); - } else { + if (field !== 'html_message') { field = textMsgID($(this)); - $('#' + field).replaceSelection(token); } + CRM.wysiwyg.insert('#' + field, token); $(this).select2('val', ''); if (isMailing) { verify(); @@ -349,39 +246,6 @@ CRM.$(function($) { return field; } - function tokenReplHtml(token) { - var editor = {/literal}"{$editor}"{literal}; - if ( editor == "tinymce" ) { - tinyMCE.execInstanceCommand('html_message',"mceInsertContent",false, token ); - } - else if ( editor == "joomlaeditor" ) { - tinyMCE.execCommand('mceInsertContent',false, token); - var msg = document.getElementById(html_message).value; - var cursorlen = document.getElementById(html_message).selectionStart; - var textlen = msg.length; - document.getElementById(html_message).value = msg.substring(0, cursorlen) + token + msg.substring(cursorlen, textlen); - var cursorPos = (cursorlen + token.length); - document.getElementById(html_message).selectionStart = cursorPos; - document.getElementById(html_message).selectionEnd = cursorPos; - document.getElementById(html_message).focus(); - } - else if ( editor == "ckeditor" ) { - oEditor = CKEDITOR.instances[html_message]; - oEditor.insertHtml(token.toString() ); - } - else if ( editor == "drupalwysiwyg" ) { - if (Drupal.wysiwyg.instances[html_message].insert) { - Drupal.wysiwyg.instances[html_message].insert(token.toString() ); - } - else { - alert("Sorry, your editor doesn't support this function yet."); - } - } - else { - $( "#"+ html_message ).replaceSelection( token ); - } - } - // Initialize token selector widgets var form = $('form.{/literal}{$form.formClass}{literal}'); $('input.crm-token-selector', form) @@ -422,44 +286,15 @@ CRM.$(function($) { if ( !isNaN( emailID ) ) { var dataUrl = {/literal}"{crmURL p='civicrm/ajax/signature' h=0 }"{literal}; $.post( dataUrl, {emailID: emailID}, function( data ) { - var editor = {/literal}"{$editor}"{literal}; if (data.signature_text) { - // get existing text & html and append signatue var textMessage = $("#"+ text_message).val( ) + '\n\n--\n' + data.signature_text; - - // append signature $("#"+ text_message).val( textMessage ); } - if ( data.signature_html ) { - var htmlMessage = $("#"+ html_message).val( ) + '

    --
    ' + data.signature_html; - - // set wysiwg editor - if ( editor == "ckeditor" ) { - oEditor = CKEDITOR.instances[html_message]; - var htmlMessage = oEditor.getData( ) + '

    --' + data.signature_html; - oEditor.setData( htmlMessage ); - } - else if ( editor == "tinymce" ) { - tinyMCE.execInstanceCommand('html_message',"mceInsertContent",false, htmlMessage); - } - else if ( editor == "drupalwysiwyg" ) { - if (Drupal.wysiwyg.instances[html_message].setContent) { - Drupal.wysiwyg.instances[html_message].setContent(htmlMessage); - } - // @TODO: Remove this when http://drupal.org/node/614146 drops - else if (Drupal.wysiwyg.instances[html_message].insert) { - alert("Please note your editor doesn't completely support this function. You may need to clear the contents of the editor prior to choosing a new template."); - Drupal.wysiwyg.instances[html_message].insert(htmlMessage); - } - else { - alert("Sorry, your editor doesn't support this function yet."); - } - } - else { - $("#"+ html_message).val(htmlMessage); - } + if (data.signature_html) { + var htmlMessage = CRM.wysiwyg.getVal("#" + html_message) + '

    --
    ' + data.signature_html; + CRM.wysiwyg.setVal("#" + html_message, htmlMessage); } }, 'json'); } diff --git a/templates/CRM/common/TabHeader.tpl b/templates/CRM/common/TabHeader.tpl index fbb1194eee..7d65c5d1b1 100644 --- a/templates/CRM/common/TabHeader.tpl +++ b/templates/CRM/common/TabHeader.tpl @@ -23,10 +23,6 @@ | see the CiviCRM license FAQ at http://civicrm.org/licensing | +--------------------------------------------------------------------+ *} - -{* include wysiwyg related files*} -{include file="CRM/common/wysiwyg.tpl" includeWysiwygEditor=true} - {* enclose all tabs and its content in a block *}
    {if $tabHeader and count($tabHeader)} diff --git a/templates/CRM/common/batchCopy.tpl b/templates/CRM/common/batchCopy.tpl index 7b46b1defa..fce5a2a385 100644 --- a/templates/CRM/common/batchCopy.tpl +++ b/templates/CRM/common/batchCopy.tpl @@ -45,9 +45,6 @@ //check if it is date element var isDateElement = elementId.attr('format'); - // check if it is wysiwyg element - var editor = elementId.attr('editor'); - //get the element type var elementType = elementId.attr('type'); @@ -94,39 +91,11 @@ } } } - else if ( editor ) { - var firstElementId = firstElement.attr('id'); - switch ( editor ) { - case 'ckeditor': - //get the content of first element - oEditor = CKEDITOR.instances[firstElementId]; - var htmlContent = oEditor.getData( ); - - // copy first element content to all the elements - elementId.each( function() { - var elemtId = $(this).attr('id'); - oEditor = CKEDITOR.instances[elemtId]; - oEditor.setData( htmlContent ); - }); - break; - case 'tinymce': - //get the content of first element - var htmlContent = tinyMCE.get( firstElementId ).getContent(); - - // copy first element content to all the elements - elementId.each( function() { - var elemtId = $(this).attr('id'); - tinyMCE.get( elemtId ).setContent( htmlContent ); - }); - break; - case 'joomlaeditor': - // TO DO - case 'drupalwysiwyg': - // TO DO - default: - elementId.val( firstElementValue ).change(); - - } + else if (elementId.is('textarea')) { + var text = CRM.wysiwyg.getVal(firstElement); + elementId.each(function() { + CRM.wysiwyg.setVal(this, text); + }); } else { if (elementId.is('select') === true && firstElement.parent().find(':input').select().index() >= 1 && firstElement.parent().find('select').select().index < 1) { diff --git a/templates/CRM/common/customData.tpl b/templates/CRM/common/customData.tpl index ad8aef9af7..9524e30395 100644 --- a/templates/CRM/common/customData.tpl +++ b/templates/CRM/common/customData.tpl @@ -23,10 +23,6 @@ | see the CiviCRM license FAQ at http://civicrm.org/licensing | +--------------------------------------------------------------------+ *} -{* include wysiwyg related files*} -{if !$includeWysiwygEditor} - {include file="CRM/common/wysiwyg.tpl" includeWysiwygEditor=true} -{/if} {literal} - - - {/if} -{/if} -- 2.25.1