Merge pull request #35 from ONLYOFFICE/feature/build-version
Feature/build version
This commit is contained in:
commit
8dcd118e42
|
@ -423,39 +423,41 @@ define([
|
||||||
|
|
||||||
var changes = version.changes, change, i;
|
var changes = version.changes, change, i;
|
||||||
if (changes && changes.length>0) {
|
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('docIdPrev', docIdPrev);
|
||||||
arrVersions[arrVersions.length-1].set('hasChanges', changes.length>1);
|
if (!_.isEmpty(version.serverVersion) && version.serverVersion == this.appOptions.buildVersion) {
|
||||||
for (i=changes.length-2; i>=0; i--) {
|
arrVersions[arrVersions.length-1].set('changeid', changes.length-1);
|
||||||
change = changes[i];
|
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);
|
user = usersStore.findUser(change.user.id);
|
||||||
if (!user) {
|
if (!user) {
|
||||||
user = new Common.Models.User({
|
user = new Common.Models.User({
|
||||||
id : change.user.id,
|
id : change.user.id,
|
||||||
username : change.user.name,
|
username : change.user.name,
|
||||||
colorval : Asc.c_oAscArrUserColors[usersCnt],
|
colorval : Asc.c_oAscArrUserColors[usersCnt],
|
||||||
color : this.generateUserColor(Asc.c_oAscArrUserColors[usersCnt++])
|
color : this.generateUserColor(Asc.c_oAscArrUserColors[usersCnt++])
|
||||||
});
|
});
|
||||||
usersStore.add(user);
|
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) {
|
} else if (ver==0 && versions.length==1) {
|
||||||
arrVersions[arrVersions.length-1].set('docId', version.key + '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.canEditStyles = this.appOptions.canLicense && this.appOptions.canEdit;
|
||||||
this.appOptions.canPrint = (this.permissions.print !== false);
|
this.appOptions.canPrint = (this.permissions.print !== false);
|
||||||
this.appOptions.canRename = !!this.permissions.rename;
|
this.appOptions.canRename = !!this.permissions.rename;
|
||||||
|
this.appOptions.buildVersion = params.asc_getBuildVersion();
|
||||||
|
|
||||||
var type = /^(?:(pdf|djvu|xps))$/.exec(this.document.fileType);
|
var type = /^(?:(pdf|djvu|xps))$/.exec(this.document.fileType);
|
||||||
this.appOptions.canDownloadOrigin = !this.appOptions.nativeApp && this.permissions.download !== false && (type && typeof type[1] === 'string');
|
this.appOptions.canDownloadOrigin = !this.appOptions.nativeApp && this.permissions.download !== false && (type && typeof type[1] === 'string');
|
||||||
|
|
Loading…
Reference in a new issue