mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
NEW: Subject line for email links in HtmlEditorField
This commit is contained in:
parent
2aa1c1e11e
commit
6ad8f7c3dd
@ -253,6 +253,7 @@ class HtmlEditorField_Toolbar extends RequestHandler {
|
||||
EmailField::create('email', _t('HtmlEditorField.EMAIL', 'Email address')),
|
||||
TreeDropdownField::create('file', _t('HtmlEditorField.FILE', 'File'), 'File', 'ID', 'Title', true),
|
||||
TextField::create('Anchor', _t('HtmlEditorField.ANCHORVALUE', 'Anchor')),
|
||||
TextField::create('Subject', _t('HtmlEditorField.SUBJECT', 'Email subject')),
|
||||
TextField::create('Description', _t('HtmlEditorField.LINKDESCR', 'Link description')),
|
||||
CheckboxField::create('TargetBlank',
|
||||
_t('HtmlEditorField.LINKOPENNEWWIN', 'Open link in a new window?')),
|
||||
|
@ -572,7 +572,9 @@ ss.editorWrappers['default'] = ss.editorWrappers.tinyMCE;
|
||||
this.find('.field[id$="Anchor_Holder"]').show();
|
||||
}
|
||||
|
||||
if(linkType !== 'email') {
|
||||
if(linkType == 'email') {
|
||||
this.find('.field[id$="Subject_Holder"]').show();
|
||||
} else {
|
||||
this.find('.field[id$="TargetBlank_Holder"]').show();
|
||||
}
|
||||
|
||||
@ -587,6 +589,7 @@ ss.editorWrappers['default'] = ss.editorWrappers.tinyMCE;
|
||||
getLinkAttributes: function() {
|
||||
var href,
|
||||
target = null,
|
||||
subject = this.find(':input[name=Subject]').val(),
|
||||
anchor = this.find(':input[name=Anchor]').val();
|
||||
|
||||
// Determine target
|
||||
@ -616,6 +619,9 @@ ss.editorWrappers['default'] = ss.editorWrappers.tinyMCE;
|
||||
|
||||
case 'email':
|
||||
href = 'mailto:' + this.find(':input[name=email]').val();
|
||||
if(subject) {
|
||||
href += '?subject=' + encodeURIComponent(subject);
|
||||
}
|
||||
target = null;
|
||||
break;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user