Skip to content

Commit e7e904f

Browse files
Integrated latest changes at 10-29-2025 1:30:04 PM
1 parent e48952f commit e7e904f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+1511
-38
lines changed

ej2-javascript-toc.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
<li>
1616
AI Coding Assistant
1717
<ul>
18-
<li><a href="/ej2-javascript/ai-coding-assistants/overview">Overview</a></li>
19-
<li><a href="/ej2-javascript/ai-coding-assistants/mcp-server">MCP Server</a></li>
18+
<li><a href="/ej2-javascript/ai-coding-assistant/overview">Overview</a></li>
19+
<li><a href="/ej2-javascript/ai-coding-assistant/mcp-server">MCP Server</a></li>
2020
</ul>
2121
</li>
2222
<li>
@@ -2104,7 +2104,6 @@
21042104
<li><a href="/ej2-javascript/rich-text-editor/tools/text-formatting">Text formatting and structural</a></li>
21052105
<li><a href="/ej2-javascript/rich-text-editor/tools/styling-tools">Styling Tools</a></li>
21062106
<li><a href="/ej2-javascript/rich-text-editor/tools/fullscreen-tool">Expanding Editor to Fullscreen View</a></li>
2107-
<li><a href="/ej2-javascript/rich-text-editor/tools/nested-blockquote">Inserting Nested Blockquotes</a></li>
21082107
</ul>
21092108
</li>
21102109
<li>Editor Types
@@ -2128,6 +2127,7 @@
21282127
<li><a href="/ej2-javascript/rich-text-editor/smart-editing/mentions">Mention Integration</a></li>
21292128
<li><a href="/ej2-javascript/rich-text-editor/smart-editing/slash-menu">Slash Commands</a></li>
21302129
<li><a href="/ej2-javascript/rich-text-editor/smart-editing/emoji-picker">Emoji Picker</a></li>
2130+
<li><a href="/ej2-javascript/rich-text-editor/mail-merge">Mail Merge Integration</a></li>
21312131
</ul>
21322132
</li>
21332133
<li>Validation and Security

ej2-javascript/chart/js/es5-getting-started.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ domainurl: ##DomainURL##
1313

1414
This section explains you the steps required to create a simple chart and demonstrate the basic usage of the chart control.
1515

16+
> **Ready to streamline your Syncfusion<sup style="font-size:70%">&reg;</sup> JavaScript development?** Discover the full potential of Syncfusion<sup style="font-size:70%">&reg;</sup> JavaScript controls with Syncfusion<sup style="font-size:70%">&reg;</sup> AI Coding Assistant. Effortlessly integrate, configure, and enhance your projects with intelligent, context-aware code suggestions, streamlined setups, and real-time insights—all seamlessly integrated into your preferred AI-powered IDEs like VS Code, Cursor, Syncfusion<sup style="font-size:70%">&reg;</sup> CodeStudio and more. [Explore Syncfusion<sup style="font-size:70%">&reg;</sup> AI Coding Assistant](https://ej2.syncfusion.com/javascript/documentation/ai-coding-assistant/overview)
17+
1618
## Dependencies
1719

1820
Below is the list of minimum dependencies required to use the Chart.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#container {
2+
visibility: hidden;
3+
}
4+
5+
#loader {
6+
color: #008cff;
7+
height: 40px;
8+
left: 45%;
9+
position: absolute;
10+
top: 45%;
11+
width: 30%;
12+
}
13+
14+
#element1, #element2 {
15+
background: #333333;
16+
border: 1px solid #cecece;
17+
box-sizing: border-box;
18+
float: left;
19+
height: 100px;
20+
width:100px;
21+
}
22+
23+
#element2 {
24+
margin-left: 20px;
25+
}
Lines changed: 199 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,199 @@
1+
2+
var rteValue =
3+
'<p>Dear <span contenteditable="false" class="e-mention-chip"><span>{{FirstName}}</span></span> ' +
4+
'<span contenteditable="false" class="e-mention-chip"><span>{{LastName}}</span></span>,</p>' +
5+
'<p>We are thrilled to have you with us! Your unique promotional code for this month is: ' +
6+
'<span contenteditable="false" class="e-mention-chip"><span>{{PromoCode}}</span></span>.</p>' +
7+
'<p>Your current subscription plan is: ' +
8+
'<span contenteditable="false" class="e-mention-chip"><span>{{SubscriptionPlan}}</span></span>.</p>' +
9+
'<p>Your customer ID is: ' +
10+
'<span contenteditable="false" class="e-mention-chip"><span>{{CustomerID}}</span></span>.</p>' +
11+
'<p>Your promotional code expires on: ' +
12+
'<span contenteditable="false" class="e-mention-chip"><span>{{ExpirationDate}}</span></span>.</p>' +
13+
"<p>Feel free to browse our latest offerings and updates. If you need any assistance, don't hesitate to contact us at " +
14+
'<a href="mailto:{{SupportEmail}}"><span contenteditable="false" class="e-mention-chip"><span>{{SupportEmail}}</span></span></a> ' +
15+
'or call us at <span contenteditable="false" class="e-mention-chip"><span>{{SupportPhoneNumber}}</span></span>.</p>' +
16+
'<p>Best regards,<br>The <span contenteditable="false" class="e-mention-chip"><span>{{CompanyName}}</span></span> Team</p>';
17+
18+
var dropdownContent =
19+
' <span style="display:inline-flex;"><span class="e-rte-dropdown-btn-text">Insert Field</span></span>';
20+
21+
var textToValueMap = {
22+
'First Name': 'FirstName',
23+
'Last Name': 'LastName',
24+
'Support Email': 'SupportEmail',
25+
'Company Name': 'CompanyName',
26+
'Promo Code': 'PromoCode',
27+
'Support Phone Number': 'SupportPhoneNumber',
28+
'Customer ID': 'CustomerID',
29+
'Expiration Date': 'ExpirationDate',
30+
'Subscription Plan': 'SubscriptionPlan',
31+
};
32+
33+
var mergeData = [
34+
{ Name: 'First Name', Field: 'FirstName' },
35+
{ Name: 'Last Name', Field: 'LastName' },
36+
{ Name: 'Promo Code', Field: 'PromoCode' },
37+
{ Name: 'Customer ID', Field: 'CustomerID' },
38+
{ Name: 'Subscription Plan', Field: 'SubscriptionPlan' },
39+
{ Name: 'Expiration Date', Field: 'ExpirationDate' },
40+
{ Name: 'Support Email', Field: 'SupportEmail' },
41+
{ Name: 'Support Phone Number', Field: 'SupportPhoneNumber' },
42+
{ Name: 'Company Name', Field: 'CompanyName' },
43+
];
44+
45+
var placeholderData = {
46+
FirstName: 'John',
47+
LastName: 'Doe',
48+
PromoCode: 'ABC123',
49+
SubscriptionPlan: 'Premium',
50+
CustomerID: '123456',
51+
ExpirationDate: '2024-12-31',
52+
SupportEmail: 'support@example.com',
53+
SupportPhoneNumber: '+1-800-555-5555',
54+
CompanyName: 'Example Inc.',
55+
};
56+
57+
function onActionBegin(args) {
58+
if (
59+
args.requestType === 'EnterAction' &&
60+
mergeObj.element.classList.contains('e-popup-open')
61+
) {
62+
args.cancel = true;
63+
}
64+
}
65+
66+
function onActionComplete(e) {
67+
if (e.requestType === 'SourceCode') {
68+
mailMergeEditor
69+
.getToolbar()
70+
.querySelector('#merge_data')
71+
.parentElement.classList.add('e-overlay');
72+
mailMergeEditor
73+
.getToolbar()
74+
.querySelector('#insertField')
75+
.parentElement.classList.add('e-overlay');
76+
} else if (e.requestType === 'Preview') {
77+
mailMergeEditor
78+
.getToolbar()
79+
.querySelector('#merge_data')
80+
.parentElement.classList.remove('e-overlay');
81+
mailMergeEditor
82+
.getToolbar()
83+
.querySelector('#insertField')
84+
.parentElement.classList.remove('e-overlay');
85+
}
86+
}
87+
88+
function onDropDownClose() {
89+
if (mailMergeEditor) {
90+
mailMergeEditor.focusIn();
91+
}
92+
}
93+
94+
function onItemSelect(args) {
95+
if (args.item.text != null) {
96+
var value = textToValueMap[args.item.text];
97+
var trimmedValue = value.trim();
98+
mailMergeEditor.formatter.editorManager.nodeSelection.restore();
99+
mailMergeEditor.executeCommand(
100+
'insertHTML',
101+
'<span contenteditable="false" class="e-mention-chip"><span>{{' +
102+
trimmedValue +
103+
'}}</span></span>&nbsp;',
104+
{ undo: true }
105+
);
106+
}
107+
}
108+
109+
function onClickHandler() {
110+
if (mailMergeEditor) {
111+
var editorContent = mailMergeEditor.value;
112+
var mergedContent = replacePlaceholders(editorContent, placeholderData);
113+
if (mailMergeEditor.formatter.getUndoRedoStack().length === 0) {
114+
mailMergeEditor.formatter.saveData();
115+
}
116+
mailMergeEditor.value = mergedContent;
117+
mailMergeEditor.formatter.saveData();
118+
} else {
119+
console.log('MailMergeEditor is not initialized.');
120+
}
121+
}
122+
123+
function replacePlaceholders(template, data) {
124+
return template.replace(/{{\s*(\w+)\s*}}/g, function (match, key) {
125+
var value = data[key.trim()];
126+
return value !== undefined ? value : match;
127+
});
128+
}
129+
130+
var mailMergeEditor = new ej.richtexteditor.RichTextEditor({
131+
value: rteValue,
132+
toolbarSettings: {
133+
items: [
134+
'Bold',
135+
'Italic',
136+
'Underline',
137+
'|',
138+
'Formats',
139+
'Alignments',
140+
'OrderedList',
141+
'UnorderedList',
142+
'|',
143+
'CreateLink',
144+
'Image',
145+
'CreateTable',
146+
'|',
147+
{ tooltipText: 'Merge Data', template: '#merge_data', command: 'Custom' },
148+
{
149+
tooltipText: 'Insert Field',
150+
template: '#insertField',
151+
command: 'Custom',
152+
},
153+
'SourceCode',
154+
'|',
155+
'Undo',
156+
'Redo',
157+
],
158+
},
159+
actionBegin: onActionBegin,
160+
actionComplete: onActionComplete,
161+
saveInterval: 1,
162+
});
163+
mailMergeEditor.appendTo('#mailMergeEditor');
164+
165+
var insertField = new ej.splitbuttons.DropDownButton({
166+
items: [
167+
{ text: 'First Name' },
168+
{ text: 'Last Name' },
169+
{ text: 'Support Email' },
170+
{ text: 'Company Name' },
171+
{ text: 'Promo Code' },
172+
{ text: 'Support Phone Number' },
173+
{ text: 'Customer ID' },
174+
{ text: 'Expiration Date' },
175+
{ text: 'Subscription Plan' },
176+
],
177+
content: dropdownContent,
178+
select: onItemSelect,
179+
close: onDropDownClose,
180+
});
181+
insertField.appendTo('#insertField');
182+
183+
var mergeField = document.getElementById('merge_data');
184+
if (mergeField) {
185+
mergeField.addEventListener('click', onClickHandler);
186+
}
187+
188+
var mergeObj = new ej.dropdowns.Mention({
189+
dataSource: mergeData,
190+
fields: { text: 'Name', value: 'Field' },
191+
displayTemplate: '<span>{{${Field}}}</span>',
192+
193+
popupWidth: '250px',
194+
popupHeight: '200px',
195+
target: mailMergeEditor.inputElement,
196+
mentionChar: '{{',
197+
allowSpaces: true,
198+
});
199+
mergeObj.appendTo('#mentionField');

0 commit comments

Comments
 (0)