22@{
33 ViewData [" Title" ] = " View document" ;
44}
5- <div >
6-
5+ <div style =" margin-top :80px " >
76 <ejs-button id =" new" content =' New Document' ></ejs-button >
87 <ejs-button id =" edit" content =' Edit' ></ejs-button >
98 <ejs-button id =" delete" content =' Delete' onclick =' deleteRecords()' ></ejs-button >
2625<script >
2726
2827function loggedOut () {
29- window .location .href = ' http://localhost:5000/Home/Index ' ;
28+ window .location .href = window . location . origin ;
3029}
3130
3231// Initialize DocumentEditorcontainer component
@@ -36,7 +35,7 @@ width: "100%",
3635height: ' 590px' ,
3736toolbarItems: [ ' Undo' , ' Redo' , ' Separator' , ' Image' , ' Table' , ' Hyperlink' , ' Bookmark' , ' Comments' , ' TableOfContents' , ' Separator' , ' Header' , ' Footer' , ' PageSetup' , ' PageNumber' , ' Break' , ' Separator' , ' Find' , ' Separator' , ' LocalClipboard' ],
3837serviceUrl:
39- ' http://localhost:5000 /api/documenteditor/'
38+ window . location . origin + ' /api/documenteditor/'
4039});
4140ej .documenteditor .DocumentEditorContainer .Inject (ej .documenteditor .Toolbar );
4241container .appendTo (' #DocumentEditor' );
@@ -183,7 +182,7 @@ function onClose(){
183182}
184183function makeHTTPRequest (APIName ) {
185184 var httpRequest = new XMLHttpRequest ();
186- httpRequest .open (' POST' ," /api/documenteditor/" + APIName+ " " );
185+ httpRequest .open (' POST' , window . location . origin + ' /api/documenteditor/' + APIName);
187186 httpRequest .setRequestHeader (' Content-Type' , ' application/json;charset=UTF-8' );
188187 httpRequest .send (JSON .stringify ({ " fileName" : fileName }));
189188}
@@ -219,7 +218,7 @@ function refresh(){
219218
220219function retriveDataSource (){
221220 var httpRequest = new XMLHttpRequest ();
222- httpRequest .open (' POST' ,' /api/documenteditor/RetriveDataSource' );
221+ httpRequest .open (' POST' , window . location . origin + ' /api/documenteditor/RetriveDataSource' );
223222 httpRequest .setRequestHeader (' Content-Type' , ' application/json;charset=UTF-8' );
224223 httpRequest .onreadystatechange = () => {
225224 if (httpRequest .readyState === 4 ) {
@@ -238,7 +237,7 @@ function createNewDocument(){
238237 var docName = document .getElementById (' field_text' ).value ;
239238 if (docName != ' ' ){
240239 var httpRequest = new XMLHttpRequest ();
241- httpRequest .open (' POST' ,' /api/documenteditor/InsertRow' );
240+ httpRequest .open (' POST' , window . location . origin + ' /api/documenteditor/InsertRow' );
242241 httpRequest .setRequestHeader (' Content-Type' , ' application/json;charset=UTF-8' );
243242 httpRequest .onreadystatechange = () => {
244243 if (httpRequest .readyState === 4 ) {
@@ -292,7 +291,7 @@ function selectionAlertDialog() {
292291}
293292function ImportDocument (){
294293 var http = new XMLHttpRequest ();
295- http .open (' POST' , ' /api/documenteditor/ImportFile' );
294+ http .open (' POST' , window . location . origin + ' /api/documenteditor/ImportFile' );
296295 http .setRequestHeader (' Content-Type' , ' application/json;charset=UTF-8' );
297296 http .onreadystatechange = () => {
298297 if (http .readyState === 4 ) {
@@ -325,7 +324,8 @@ function ImportDocument(){
325324function enableProtection () {
326325 if (" @ViewBag.userName" == " User1"
327326 || " @ViewBag.userName" == " User2" ) {
328- container .documentEditor .editor .enforceProtection (" 123" , " RevisionsOnly" );
327+ container .documentEditor .editor .enforceProtection (" 123" , " RevisionsOnly" );
328+ container .documentEditor .showrestricteditingpane (false );
329329 }
330330 else if (" @ViewBag.userName" == " Author" ) {
331331 // stop the document protection
0 commit comments