@@ -9,7 +9,7 @@ import { ImageProperties } from './properties-pane/image-properties-pane';
99import { TocProperties } from './properties-pane/table-of-content-pane' ;
1010import { TableProperties } from './properties-pane/table-properties-pane' ;
1111import { 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' ;
1313import { createSpinner } from '@syncfusion/ej2-popups' ;
1414import { ContainerServerActionSettingsModel , DocumentEditorSettingsModel , DocumentSettingsModel , FormFieldSettingsModel } from '../document-editor/document-editor-model' ;
1515import { CharacterFormatProperties , ParagraphFormatProperties , SectionFormatProperties } from '../document-editor/implementation' ;
@@ -19,7 +19,7 @@ import { ClickEventArgs } from '@syncfusion/ej2-navigations';
1919import { beforeAutoResize , internalAutoResize , internalZoomFactorChange , beforeCommentActionEvent , commentDeleteEvent , contentChangeEvent , trackChangeEvent , beforePaneSwitchEvent , serviceFailureEvent , documentChangeEvent , selectionChangeEvent , customContextMenuSelectEvent , customContextMenuBeforeOpenEvent , internalviewChangeEvent , beforeXmlHttpRequestSend , protectionTypeChangeEvent , internalDocumentEditorSettingsChange , internalStyleCollectionChange , revisionActionEvent } from '../document-editor/base/constants' ;
2020import { HelperMethods } from '../index' ;
2121import { SanitizeHtmlHelper } from '@syncfusion/ej2-base' ;
22-
22+ import { DialogUtility } from '@syncfusion/ej2-popups' ;
2323/**
2424 * Document Editor container component.
2525 */
@@ -605,7 +605,13 @@ export class DocumentEditorContainer extends Component<HTMLElement> implements I
605605 'Columns' : 'Columns' ,
606606 'Column' : 'Column' ,
607607 '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'
609615 } ;
610616 /* eslint-enable @typescript-eslint/naming-convention */
611617 /**
@@ -881,12 +887,19 @@ export class DocumentEditorContainer extends Component<HTMLElement> implements I
881887 if ( ! isNullOrUndefined ( this . documentEditorSettings . maximumRows ) ) {
882888 this . documentEditor . documentEditorSettings . maximumRows = this . documentEditorSettings . maximumRows ;
883889 }
890+ if ( ! isNullOrUndefined ( this . documentEditorSettings . maximumColumns ) ) {
891+ this . documentEditor . documentEditorSettings . maximumColumns = this . documentEditorSettings . maximumColumns ;
892+ }
884893 if ( ! isNullOrUndefined ( this . documentEditorSettings . showHiddenMarks ) ) {
885894 this . documentEditor . documentEditorSettings . showHiddenMarks = this . documentEditorSettings . showHiddenMarks ;
886895 }
887896 if ( ! isNullOrUndefined ( this . documentEditorSettings . showBookmarks ) ) {
888897 this . documentEditor . documentEditorSettings . showBookmarks = this . documentEditorSettings . showBookmarks ;
889898 }
899+ if ( ! isNullOrUndefined ( this . documentEditorSettings . highlightEditableRanges ) ) {
900+ this . documentEditor . documentEditorSettings . highlightEditableRanges = this . documentEditorSettings . highlightEditableRanges ;
901+ }
902+
890903 if ( ! isNullOrUndefined ( this . documentEditorSettings . allowDragAndDrop ) ) {
891904 this . documentEditor . documentEditorSettings . allowDragAndDrop = this . documentEditorSettings . allowDragAndDrop ;
892905 }
@@ -988,6 +1001,7 @@ export class DocumentEditorContainer extends Component<HTMLElement> implements I
9881001 width : '100%' ,
9891002 enableTrackChanges : this . enableTrackChanges ,
9901003 showRevisions : true ,
1004+ showComments : true ,
9911005 enableLockAndEdit : this . enableLockAndEdit ,
9921006 enableAutoFocus : this . enableAutoFocus
9931007 } ) ;
@@ -1165,8 +1179,9 @@ export class DocumentEditorContainer extends Component<HTMLElement> implements I
11651179 public onSelectionChange ( ) : void {
11661180 setTimeout ( ( ) => {
11671181 this . showPropertiesPaneOnSelection ( ) ;
1168- let eventArgs : ContainerSelectionChangeEventArgs = { source : this } ;
1182+ let eventArgs : ContainerSelectionChangeEventArgs = { source : this , isCompleted : this . documentEditor . documentHelper . isSelectionCompleted } ;
11691183 this . trigger ( selectionChangeEvent , eventArgs ) ;
1184+ this . documentEditor . documentHelper . isSelectionCompleted = true ;
11701185 } ) ;
11711186 }
11721187 /**
@@ -1186,11 +1201,26 @@ export class DocumentEditorContainer extends Component<HTMLElement> implements I
11861201 */
11871202 private onRequestNavigate ( args : RequestNavigateEventArgs ) : void {
11881203 if ( args . linkType !== 'Bookmark' ) {
1189- let link : string = SanitizeHtmlHelper . sanitize ( args . navigationLink ) ;
1204+ const navLink = args . navigationLink ;
1205+ let link : string = SanitizeHtmlHelper . sanitize ( navLink ) ;
11901206 if ( args . localReference . length > 0 ) {
11911207 link += '#' + args . localReference ;
11921208 }
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+ }
11941224 args . isHandled = true ;
11951225 }
11961226 }
@@ -1320,19 +1350,17 @@ export class DocumentEditorContainer extends Component<HTMLElement> implements I
13201350 public destroy ( ) : void {
13211351 super . destroy ( ) ;
13221352 if ( this . element ) {
1353+ if ( ! this . refreshing ) {
1354+ this . element . classList . remove ( 'e-documenteditorcontainer' ) ;
1355+ }
13231356 this . element . innerHTML = '' ;
13241357 }
13251358 if ( ! this . refreshing ) {
1326- this . element . classList . remove ( 'e-documenteditorcontainer' ) ;
13271359 this . element = undefined ;
13281360 this . paragraphFormat = undefined ;
13291361 this . sectionFormat = undefined ;
13301362 this . characterFormat = undefined ;
13311363 }
1332- if ( this . toolbarModule ) {
1333- this . toolbarModule . destroy ( ) ;
1334- this . toolbarModule = undefined ;
1335- }
13361364 if ( this . toolbarContainer && this . toolbarContainer . parentElement ) {
13371365 this . toolbarContainer . innerHTML = '' ;
13381366 this . toolbarContainer . parentElement . removeChild ( this . toolbarContainer ) ;
@@ -1385,4 +1413,4 @@ export class DocumentEditorContainer extends Component<HTMLElement> implements I
13851413 this . statusBar = undefined ;
13861414 this . previousContext = undefined ;
13871415 }
1388- }
1416+ }
0 commit comments