message_admin - Enable another preview mode ("HTML (Raw)")
authorTim Otten <totten@civicrm.org>
Thu, 16 Jun 2022 01:04:58 +0000 (18:04 -0700)
committerTim Otten <totten@civicrm.org>
Thu, 16 Jun 2022 01:04:58 +0000 (18:04 -0700)
This is similar to the "HTML" preview, except it shows the raw HTML (with syntax highlighting).

ext/message_admin/ang/crmMsgadm/Edit.js
ext/message_admin/ang/crmMsgadm/Preview.html

index d6f955271d5727c50ed0e458ae1f869ad99fc8ce..6e01a76a7a4dbbda4b338035bd55521134712da7 100644 (file)
         formatName: 'msg_html',
         formats: [
           {id: 0, name: 'msg_html', label: ts('HTML')},
-          {id: 1, name: 'msg_text', label: ts('Text')}
+          {id: 1, name: 'msg_html_raw', label: ts('HTML (Raw)')},
+          {id: 2, name: 'msg_text', label: ts('Text')}
         ],
         revisionName: $ctrl.tab,
         revisions: _.reduce(revisionTypes, function(acc, revType){
index 1c15b012420e8ca51c9e12c9ef9e7068035b6d90..74c9f2b2265377990271808ddc139de408caa6dd 100644 (file)
           </div>
         </div>
 
+        <div class="form-group" ng-if="!$ctrl.preview.loading && model.formats[$ctrl.formatId].name === 'msg_html_raw'">
+          <div class="jumbotron well col-sm-12">
+            <!-- <textarea ng-model="$ctrl.preview.html"></textarea> -->
+            <div ng-model="$ctrl.preview.html"
+                 ng-disabled="true"
+                 crm-monaco="$ctrl.monacoOptions({language: 'html', crmHeightPct: 0.5})"
+            ></div>
+          </div>
+        </div>
+
       </div>
 
     </div>