Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1025959
D302.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Jun 13, 5:33 PM
Size
2 KB
Mime Type
text/x-diff
Expires
Sat, Jun 14, 5:33 PM (3 h, 56 m)
Engine
blob
Format
Raw Data
Handle
661626
Attached To
D302: INP-1698 - Allow using CKEditor and CodeMirror on same textarea
D302.diff
View Options
Index: branches/5.3.x/core/admin_templates/forms/form_edit_emails.tpl
===================================================================
--- branches/5.3.x/core/admin_templates/forms/form_edit_emails.tpl
+++ branches/5.3.x/core/admin_templates/forms/form_edit_emails.tpl
@@ -99,10 +99,11 @@
get_control($field_mask, $fields[$i]).disabled = !$enabled;
}
+ $(get_control($field_mask, 'ReplyMessageSignature')).trigger('refresh');
get_control($field_mask, 'ProcessUnmatchedEmails', undefined, '_cb').disabled = !$enabled;
}
reflectFromFields();
</script>
-<inp2:m_include t="incs/footer"/>
\ No newline at end of file
+<inp2:m_include t="incs/footer"/>
Index: branches/5.3.x/core/admin_templates/js/forms.js
===================================================================
--- branches/5.3.x/core/admin_templates/js/forms.js
+++ branches/5.3.x/core/admin_templates/js/forms.js
@@ -134,15 +134,27 @@
}
if ( !$.isEmptyObject($CodeMirrorEditors) ) {
- var $editor;
-
- for (var $editor_id in $CodeMirrorEditors) {
- var $textarea_element = $('#' + jq($editor_id)),
+ $.each($CodeMirrorEditors, function ($editor_id, $editor_options) {
+ var $editor,
+ $textarea_element = $('#' + jq($editor_id)),
$height = parseInt($textarea_element.height(), 10);
- $editor = CodeMirror.fromTextArea($textarea_element.get(0), $CodeMirrorEditors[$editor_id]);
+ if ( $textarea_element.is(':disabled') ) {
+ $editor_options.readOnly = 'nocursor';
+ }
+
+ $editor = CodeMirror.fromTextArea($textarea_element.get(0), $editor_options);
$editor.setSize(null, $height);
- }
+
+ $textarea_element
+ .on('change', function ($e) {
+ $editor.getDoc().setValue($textarea_element.val());
+ })
+ .on('refresh', function ($e) {
+ $editor.setOption('readOnly', $textarea_element.is(':disabled') ? 'nocursor' : '');
+ })
+ ;
+ });
}
}
Index: branches/5.3.x/core/admin_templates/popups/editor.tpl
===================================================================
--- branches/5.3.x/core/admin_templates/popups/editor.tpl
+++ branches/5.3.x/core/admin_templates/popups/editor.tpl
@@ -25,7 +25,10 @@
}
if (!$opener.closed) {
- $opener.document.getElementById($TargetField).value = CKEDITOR.instances['Content'].getData();
+ $opener.$($opener.document.getElementById($TargetField))
+ .val(CKEDITOR.instances['Content'].getData())
+ .change()
+ ;
}
window_close();
@@ -86,4 +89,4 @@
</script>
<inp2:m_Set _force_popup="1"/>
-<inp2:m_include t="incs/footer"/>
\ No newline at end of file
+<inp2:m_include t="incs/footer"/>
Event Timeline
Log In to Comment