@@ -9,7 +9,7 @@ import { ImageProperties } from './properties-pane/image-properties-pane';
9
9
import { TocProperties } from './properties-pane/table-of-content-pane' ;
10
10
import { TableProperties } from './properties-pane/table-properties-pane' ;
11
11
import { StatusBar } from './properties-pane/status-bar' ;
12
- import { ViewChangeEventArgs , RequestNavigateEventArgs , ContainerContentChangeEventArgs , ContainerSelectionChangeEventArgs , ContainerDocumentChangeEventArgs , CustomContentMenuEventArgs , BeforeOpenCloseCustomContentMenuEventArgs , BeforePaneSwitchEventArgs , LayoutType , CommentDeleteEventArgs , ServiceFailureArgs , CommentActionEventArgs , XmlHttpRequestEventArgs , RevisionActionEventArgs } from '../document-editor/base' ;
12
+ import { ViewChangeEventArgs , RequestNavigateEventArgs , ContainerContentChangeEventArgs , ContainerSelectionChangeEventArgs , ContainerDocumentChangeEventArgs , CustomContentMenuEventArgs , BeforeOpenCloseCustomContentMenuEventArgs , BeforePaneSwitchEventArgs , LayoutType , CommentDeleteEventArgs , RevisionActionEventArgs , ServiceFailureArgs , CommentActionEventArgs , XmlHttpRequestEventArgs } from '../document-editor/base' ;
13
13
import { createSpinner } from '@syncfusion/ej2-popups' ;
14
14
import { ContainerServerActionSettingsModel , DocumentEditorSettingsModel , DocumentSettingsModel , FormFieldSettingsModel } from '../document-editor/document-editor-model' ;
15
15
import { CharacterFormatProperties , ParagraphFormatProperties , SectionFormatProperties } from '../document-editor/implementation' ;
@@ -19,7 +19,7 @@ import { ClickEventArgs } from '@syncfusion/ej2-navigations';
19
19
import { beforeAutoResize , internalAutoResize , internalZoomFactorChange , beforeCommentActionEvent , commentDeleteEvent , contentChangeEvent , trackChangeEvent , beforePaneSwitchEvent , serviceFailureEvent , documentChangeEvent , selectionChangeEvent , customContextMenuSelectEvent , customContextMenuBeforeOpenEvent , internalviewChangeEvent , beforeXmlHttpRequestSend , protectionTypeChangeEvent , internalDocumentEditorSettingsChange , internalStyleCollectionChange , revisionActionEvent } from '../document-editor/base/constants' ;
20
20
import { HelperMethods } from '../index' ;
21
21
import { SanitizeHtmlHelper } from '@syncfusion/ej2-base' ;
22
-
22
+ import { DialogUtility } from '@syncfusion/ej2-popups' ;
23
23
/**
24
24
* Document Editor container component.
25
25
*/
@@ -605,7 +605,13 @@ export class DocumentEditorContainer extends Component<HTMLElement> implements I
605
605
'Columns' : 'Columns' ,
606
606
'Column' : 'Column' ,
607
607
'Page Breaks' : 'Page Breaks' ,
608
- 'Section Breaks' : 'Section Breaks'
608
+ 'Section Breaks' : 'Section Breaks' ,
609
+ 'Link to Previous' : 'Link to Previous' ,
610
+ 'Link to PreviousTooltip' : 'Link this section with previous section header or footer' ,
611
+ 'Alternate Text' : 'Alternate Text' ,
612
+ 'The address of this site is not valid. Check the address and try again.' : 'The address of this site is not valid. Check the address and try again.' ,
613
+ 'OK' :'OK' ,
614
+ 'Information' :'Information'
609
615
} ;
610
616
/* eslint-enable @typescript-eslint/naming-convention */
611
617
/**
@@ -881,12 +887,19 @@ export class DocumentEditorContainer extends Component<HTMLElement> implements I
881
887
if ( ! isNullOrUndefined ( this . documentEditorSettings . maximumRows ) ) {
882
888
this . documentEditor . documentEditorSettings . maximumRows = this . documentEditorSettings . maximumRows ;
883
889
}
890
+ if ( ! isNullOrUndefined ( this . documentEditorSettings . maximumColumns ) ) {
891
+ this . documentEditor . documentEditorSettings . maximumColumns = this . documentEditorSettings . maximumColumns ;
892
+ }
884
893
if ( ! isNullOrUndefined ( this . documentEditorSettings . showHiddenMarks ) ) {
885
894
this . documentEditor . documentEditorSettings . showHiddenMarks = this . documentEditorSettings . showHiddenMarks ;
886
895
}
887
896
if ( ! isNullOrUndefined ( this . documentEditorSettings . showBookmarks ) ) {
888
897
this . documentEditor . documentEditorSettings . showBookmarks = this . documentEditorSettings . showBookmarks ;
889
898
}
899
+ if ( ! isNullOrUndefined ( this . documentEditorSettings . highlightEditableRanges ) ) {
900
+ this . documentEditor . documentEditorSettings . highlightEditableRanges = this . documentEditorSettings . highlightEditableRanges ;
901
+ }
902
+
890
903
if ( ! isNullOrUndefined ( this . documentEditorSettings . allowDragAndDrop ) ) {
891
904
this . documentEditor . documentEditorSettings . allowDragAndDrop = this . documentEditorSettings . allowDragAndDrop ;
892
905
}
@@ -988,6 +1001,7 @@ export class DocumentEditorContainer extends Component<HTMLElement> implements I
988
1001
width : '100%' ,
989
1002
enableTrackChanges : this . enableTrackChanges ,
990
1003
showRevisions : true ,
1004
+ showComments : true ,
991
1005
enableLockAndEdit : this . enableLockAndEdit ,
992
1006
enableAutoFocus : this . enableAutoFocus
993
1007
} ) ;
@@ -1165,8 +1179,9 @@ export class DocumentEditorContainer extends Component<HTMLElement> implements I
1165
1179
public onSelectionChange ( ) : void {
1166
1180
setTimeout ( ( ) => {
1167
1181
this . showPropertiesPaneOnSelection ( ) ;
1168
- let eventArgs : ContainerSelectionChangeEventArgs = { source : this } ;
1182
+ let eventArgs : ContainerSelectionChangeEventArgs = { source : this , isCompleted : this . documentEditor . documentHelper . isSelectionCompleted } ;
1169
1183
this . trigger ( selectionChangeEvent , eventArgs ) ;
1184
+ this . documentEditor . documentHelper . isSelectionCompleted = true ;
1170
1185
} ) ;
1171
1186
}
1172
1187
/**
@@ -1186,11 +1201,26 @@ export class DocumentEditorContainer extends Component<HTMLElement> implements I
1186
1201
*/
1187
1202
private onRequestNavigate ( args : RequestNavigateEventArgs ) : void {
1188
1203
if ( args . linkType !== 'Bookmark' ) {
1189
- let link : string = SanitizeHtmlHelper . sanitize ( args . navigationLink ) ;
1204
+ const navLink = args . navigationLink ;
1205
+ let link : string = SanitizeHtmlHelper . sanitize ( navLink ) ;
1190
1206
if ( args . localReference . length > 0 ) {
1191
1207
link += '#' + args . localReference ;
1192
1208
}
1193
- window . open ( link ) ;
1209
+ if ( navLink . substring ( 0 , 8 ) === 'file:///'
1210
+ || ( navLink . substring ( 0 , 7 ) === 'http://' && navLink . length > 7 )
1211
+ || ( navLink . substring ( 0 , 8 ) === 'https://' && navLink . length > 8 )
1212
+ || ( navLink . substring ( 0 , 4 ) === 'www.' && navLink . length > 4 )
1213
+ || ( navLink . substring ( 0 , 7 ) === 'mailto:' && navLink . length > 7 ) ) {
1214
+ window . open ( link ) ;
1215
+ }
1216
+ else {
1217
+ DialogUtility . alert ( {
1218
+ title : this . localObj . getConstant ( "Information" ) ,
1219
+ content : this . localObj . getConstant ( "The address of this site is not valid. Check the address and try again." ) ,
1220
+ okButton : { text : this . localObj . getConstant ( "OK" ) } ,
1221
+ closeOnEscape : true ,
1222
+ } ) ;
1223
+ }
1194
1224
args . isHandled = true ;
1195
1225
}
1196
1226
}
@@ -1320,19 +1350,17 @@ export class DocumentEditorContainer extends Component<HTMLElement> implements I
1320
1350
public destroy ( ) : void {
1321
1351
super . destroy ( ) ;
1322
1352
if ( this . element ) {
1353
+ if ( ! this . refreshing ) {
1354
+ this . element . classList . remove ( 'e-documenteditorcontainer' ) ;
1355
+ }
1323
1356
this . element . innerHTML = '' ;
1324
1357
}
1325
1358
if ( ! this . refreshing ) {
1326
- this . element . classList . remove ( 'e-documenteditorcontainer' ) ;
1327
1359
this . element = undefined ;
1328
1360
this . paragraphFormat = undefined ;
1329
1361
this . sectionFormat = undefined ;
1330
1362
this . characterFormat = undefined ;
1331
1363
}
1332
- if ( this . toolbarModule ) {
1333
- this . toolbarModule . destroy ( ) ;
1334
- this . toolbarModule = undefined ;
1335
- }
1336
1364
if ( this . toolbarContainer && this . toolbarContainer . parentElement ) {
1337
1365
this . toolbarContainer . innerHTML = '' ;
1338
1366
this . toolbarContainer . parentElement . removeChild ( this . toolbarContainer ) ;
@@ -1385,4 +1413,4 @@ export class DocumentEditorContainer extends Component<HTMLElement> implements I
1385
1413
this . statusBar = undefined ;
1386
1414
this . previousContext = undefined ;
1387
1415
}
1388
- }
1416
+ }
0 commit comments