Commit 8dcd118e authored by Alexander Trofimov's avatar Alexander Trofimov Committed by GitHub

Merge pull request #35 from ONLYOFFICE/feature/build-version

Feature/build version
parents 4048b849 c4da0e12
......@@ -423,39 +423,41 @@ define([
var changes = version.changes, change, i;
if (changes && changes.length>0) {
arrVersions[arrVersions.length-1].set('changeid', changes.length-1);
arrVersions[arrVersions.length-1].set('docIdPrev', docIdPrev);
arrVersions[arrVersions.length-1].set('hasChanges', changes.length>1);
for (i=changes.length-2; i>=0; i--) {
change = changes[i];
user = usersStore.findUser(change.user.id);
if (!user) {
user = new Common.Models.User({
id : change.user.id,
username : change.user.name,
colorval : Asc.c_oAscArrUserColors[usersCnt],
color : this.generateUserColor(Asc.c_oAscArrUserColors[usersCnt++])
});
usersStore.add(user);
if (!_.isEmpty(version.serverVersion) && version.serverVersion == this.appOptions.buildVersion) {
arrVersions[arrVersions.length-1].set('changeid', changes.length-1);
arrVersions[arrVersions.length-1].set('hasChanges', changes.length>1);
for (i=changes.length-2; i>=0; i--) {
change = changes[i];
user = usersStore.findUser(change.user.id);
if (!user) {
user = new Common.Models.User({
id : change.user.id,
username : change.user.name,
colorval : Asc.c_oAscArrUserColors[usersCnt],
color : this.generateUserColor(Asc.c_oAscArrUserColors[usersCnt++])
});
usersStore.add(user);
}
arrVersions.push(new Common.Models.HistoryVersion({
version: version.versionGroup,
revision: version.version,
changeid: i,
userid : change.user.id,
username : change.user.name,
usercolor: user.get('color'),
created: change.created,
docId: version.key,
docIdPrev: docIdPrev,
selected: false,
canRestore: this.appOptions.canHistoryRestore,
isRevision: false,
isVisible: true
}));
arrColors.push(user.get('colorval'));
}
arrVersions.push(new Common.Models.HistoryVersion({
version: version.versionGroup,
revision: version.version,
changeid: i,
userid : change.user.id,
username : change.user.name,
usercolor: user.get('color'),
created: change.created,
docId: version.key,
docIdPrev: docIdPrev,
selected: false,
canRestore: this.appOptions.canHistoryRestore,
isRevision: false,
isVisible: true
}));
arrColors.push(user.get('colorval'));
}
} else if (ver==0 && versions.length==1) {
arrVersions[arrVersions.length-1].set('docId', version.key + '1');
......@@ -978,6 +980,7 @@ define([
this.appOptions.canEditStyles = this.appOptions.canLicense && this.appOptions.canEdit;
this.appOptions.canPrint = (this.permissions.print !== false);
this.appOptions.canRename = !!this.permissions.rename;
this.appOptions.buildVersion = params.asc_getBuildVersion();
var type = /^(?:(pdf|djvu|xps))$/.exec(this.document.fileType);
this.appOptions.canDownloadOrigin = !this.appOptions.nativeApp && this.permissions.download !== false && (type && typeof type[1] === 'string');
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment