Skip to content

Commit

Permalink
Fill info when refresh file
Browse files Browse the repository at this point in the history
  • Loading branch information
JuliaRadzhabova committed Jun 24, 2024
1 parent e7b4749 commit fff4c1a
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions apps/documenteditor/main/app/controller/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3021,6 +3021,35 @@ define([
}
if (data.token)
docInfo.put_Token(data.token);

var _user = new Asc.asc_CUserInfo(); // change for guest!!
_user.put_Id(this.appOptions.user.id);
_user.put_FullName(this.appOptions.user.fullname);
_user.put_IsAnonymousUser(!!this.appOptions.user.anonymous);
docInfo.put_UserInfo(_user);

var _options = $.extend({}, this.document.options, this.editorConfig.actionLink || {});
docInfo.put_Options(_options);

docInfo.put_Format(this.document.fileType);
docInfo.put_Lang(this.editorConfig.lang);
docInfo.put_Mode(this.editorConfig.mode);
docInfo.put_Permissions(this.permissions);
docInfo.put_DirectUrl(data.document && data.document.directUrl ? data.document.directUrl : this.document.directUrl);
docInfo.put_VKey(data.document && data.document.vkey ? data.document.vkey : this.document.vkey);
docInfo.put_EncryptedInfo(data.editorConfig && data.editorConfig.encryptionKeys ? data.editorConfig.encryptionKeys : this.editorConfig.encryptionKeys);

var enable = !this.editorConfig.customization || (this.editorConfig.customization.macros!==false);
docInfo.asc_putIsEnabledMacroses(!!enable);
enable = !this.editorConfig.customization || (this.editorConfig.customization.plugins!==false);
docInfo.asc_putIsEnabledPlugins(!!enable);

var type = /^(?:(pdf|djvu|xps|oxps))$/.exec(this.document.fileType);
var coEditMode = (type && typeof type[1] === 'string') ? 'strict' : // offline viewer for pdf|djvu|xps|oxps
!(this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object') ? 'fast' : // fast by default
this.editorConfig.mode === 'view' && this.editorConfig.coEditing.change!==false ? 'fast' : // if can change mode in viewer - set fast for using live viewer
this.editorConfig.coEditing.mode || 'fast';
docInfo.put_CoEditingMode(coEditMode);
this.api.asc_refreshFile(docInfo);
}
},
Expand Down

0 comments on commit fff4c1a

Please sign in to comment.