Skip to content

Commit 4500c82

Browse files
committed
1008846: ES code revamp
1 parent ba86f66 commit 4500c82

3 files changed

Lines changed: 22 additions & 29 deletions

File tree

Document-Processing/Word/Word-Processor/javascript-es5/how-to/customize-font-family-drop-down.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ Similarly, you can use [`documentEditorSettings`](https://ej2.syncfusion.com/jav
1616

1717
The following example code illustrates how to change the font families in Document editor container.
1818

19-
```ts
20-
let container: DocumentEditorContainer = new DocumentEditorContainer({ enableToolbar: true,height: '590px',
19+
```js
20+
var container = new ej.documenteditor.DocumentEditorContainer({ enableToolbar: true,height: '590px',
2121
// Add required font families to list it in font drop down
2222
documentEditorSettings: {
2323
fontFamilies: ['Algerian', 'Arial', 'Calibri', 'Windings'],
2424
}
2525
});
26-
DocumentEditorContainer.Inject(Toolbar);
26+
ej.documenteditor.DocumentEditorContainer.Inject(ej.documenteditor.Toolbar);
2727
container.serviceUrl = 'https://document.syncfusion.com/web-services/docx-editor/api/documenteditor/';
2828
container.appendTo('#container');
2929
```

Document-Processing/Word/Word-Processor/javascript-es5/how-to/resize-document-editor.md

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ DocumentEditorContainer initially render with default height. You can change hei
1818

1919
The following example code illustrates how to change height of Document Editor.
2020

21-
```ts
22-
let container: DocumentEditorContainer = new DocumentEditorContainer({
21+
```js
22+
var container = new ej.documenteditor.DocumentEditorContainer({
2323
enableToolbar: true, height: "590px"
2424
});
2525
container.appendTo('#DocumentEditor');
@@ -33,9 +33,9 @@ DocumentEditorContainer initially render with default width. You can change widt
3333

3434
The following example code illustrates how to change width of Document Editor.
3535

36-
```ts
37-
let container: DocumentEditorContainer = new DocumentEditorContainer({
38-
enableToolbar: true, width: "100%"
36+
```js
37+
var container = new ej.documenteditor.DocumentEditorContainer({
38+
enableToolbar: true, width: "100%"
3939
});
4040
container.appendTo('#DocumentEditor');
4141
```
@@ -48,18 +48,13 @@ Using [`resize`](https://ej2.syncfusion.com/javascript/documentation/api/documen
4848

4949
The following example code illustrates how to fit Document Editor to browser window size.
5050

51-
```ts
52-
import {
53-
DocumentEditorContainer,
54-
Toolbar,
55-
} from '@syncfusion/ej2-documenteditor';
56-
57-
let container: DocumentEditorContainer = new DocumentEditorContainer({ enableToolbar: true, height: '590px' });
58-
DocumentEditorContainer.Inject(Toolbar);
51+
```js
52+
var container = new ej.documenteditor.DocumentEditorContainer({ enableToolbar: true, height: '590px' });
53+
ej.documenteditor.DocumentEditorContainer.Inject(ej.documenteditor.Toolbar);
5954
container.serviceUrl =
6055
'https://document.syncfusion.com/web-services/docx-editor/api/documenteditor/';
6156

62-
container.created = (): void => {
57+
container.created = () => {
6358
setInterval(() => {
6459
updateDocumentEditorSize();
6560
}, 100);

Document-Processing/Word/Word-Processor/javascript-es5/how-to/set-default-format-in-document-editor.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,14 @@ You can use [`setDefaultParagraphFormat`](https://ej2.syncfusion.com/javascript/
6363

6464
The following example code illustrates how to change the paragraph format(before spacing, line spacing etc.,) default value in Document editor.
6565

66-
```ts
66+
```js
6767
import { ParagraphFormatProperties, DocumentEditorContainer, Toolbar } from '@syncfusion/ej2-documenteditor';
6868

69-
let container: DocumentEditorContainer = new DocumentEditorContainer({ height: "590px" });
69+
var container = new ej.documenteditor.DocumentEditorContainer({height: "590px" });
7070
container.serviceUrl = 'https://document.syncfusion.com/web-services/docx-editor/api/documenteditor/';
71-
DocumentEditorContainer.Inject(Toolbar);
71+
ej.documenteditor.DocumentEditorContainer.Inject(ej.documenteditor.Toolbar);
7272

73-
let defaultParagraphFormat: ParagraphFormatProperties = {
73+
var defaultParagraphFormat = {
7474
beforeSpacing: 8,
7575
lineSpacing: 1.5,
7676
leftIndent: 24,
@@ -88,26 +88,24 @@ You can use [`setDefaultSectionFormat`](https://ej2.syncfusion.com/javascript/do
8888

8989
The following example code illustrates how to change the section format(header and footer distance, page width and height, etc.,) default value in Document editor.
9090

91-
```ts
92-
import { SectionFormatProperties, DocumentEditorContainer, Toolbar } from '@syncfusion/ej2-documenteditor';
93-
94-
let container: DocumentEditorContainer = new DocumentEditorContainer({ height: "590px" });
91+
```js
92+
var container = new ej.documenteditor.DocumentEditorContainer({height: "590px" });
9593
container.serviceUrl = 'https://document.syncfusion.com/web-services/docx-editor/api/documenteditor/';
96-
DocumentEditorContainer.Inject(Toolbar);
94+
ej.documenteditor.DocumentEditorContainer.Inject(ej.documenteditor.Toolbar);
9795

98-
let defaultSectionFormat: SectionFormatProperties = {
96+
var defaultSectionFormat = {
9997
pageWidth: 500,
10098
pageHeight: 800,
10199
headerDistance: 56,
102100
footerDistance: 48,
103-
leftMargin: 12,
101+
leftMargin: 24,
104102
rightMargin: 12,
105103
topMargin: 0,
106104
bottomMargin: 0
107105

108106
};
109107
container.setDefaultSectionFormat(defaultSectionFormat);
110-
container.appendTo('#container');
108+
container.appendTo('#container');
111109
```
112110

113111
> The Web API hosted link `https://document.syncfusion.com/web-services/docx-editor/api/documenteditor/` utilized in the Document Editor's serviceUrl property is intended solely for demonstration and evaluation purposes. For production deployment, please host your own web service with your required server configurations. You can refer and reuse the [GitHub Web Service example](https://github.com/SyncfusionExamples/EJ2-DocumentEditor-WebServices) or [Docker image](https://hub.docker.com/r/syncfusion/word-processor-server) for hosting your own web service and use for the serviceUrl property.

0 commit comments

Comments
 (0)