commit
e88f1dfa8a
|
@ -710,8 +710,8 @@ define([
|
|||
this.options.updateFormControl.call(this, this._selectedItem);
|
||||
},
|
||||
|
||||
setValue: function(value) {
|
||||
Common.UI.ComboBox.prototype.setValue.call(this, value);
|
||||
setValue: function(value, defValue) {
|
||||
Common.UI.ComboBox.prototype.setValue.call(this, value, defValue);
|
||||
if (this.options.updateFormControl)
|
||||
this.options.updateFormControl.call(this, this._selectedItem);
|
||||
},
|
||||
|
|
|
@ -86,6 +86,7 @@ define([
|
|||
this.setApi(api);
|
||||
},
|
||||
setApi: function (api) {
|
||||
this.userCollection = this.getApplication().getCollection('Common.Collections.Users');
|
||||
if (api) {
|
||||
this.api = api;
|
||||
this.api.asc_registerCallback('asc_onChangeDocumentProtection',_.bind(this.onChangeProtectDocument, this));
|
||||
|
@ -95,6 +96,7 @@ define([
|
|||
|
||||
setMode: function(mode) {
|
||||
this.appConfig = mode;
|
||||
this.currentUserId = mode.user.id;
|
||||
|
||||
this.appConfig.isEdit && (this.view = this.createView('DocProtection', {
|
||||
mode: mode
|
||||
|
@ -183,7 +185,7 @@ define([
|
|||
});
|
||||
},
|
||||
|
||||
onChangeProtectDocument: function() {
|
||||
onChangeProtectDocument: function(userId) {
|
||||
var props = this.getDocProps(true),
|
||||
isProtected = props && (props.isReadOnly || props.isCommentsOnly || props.isFormsOnly || props.isReviewOnly);
|
||||
this.view && this.view.btnProtectDoc.toggle(isProtected, true);
|
||||
|
@ -204,6 +206,27 @@ define([
|
|||
if (this._docProtectDlg && this._docProtectDlg.isVisible())
|
||||
this._docProtectDlg.SetDisabled(!!this._state.lockDocProtect || isProtected);
|
||||
Common.NotificationCenter.trigger('protect:doclock', props);
|
||||
if (userId && this.userCollection) {
|
||||
var recUser = this.userCollection.findOriginalUser(userId);
|
||||
if (recUser && (recUser.get('idOriginal') !== this.currentUserId)) {
|
||||
var str = this.view.txtWasUnprotected;
|
||||
switch (this._state.docProtection.type) {
|
||||
case Asc.c_oAscEDocProtect.ReadOnly:
|
||||
str = this.view.txtWasProtectedView;
|
||||
break;
|
||||
case Asc.c_oAscEDocProtect.Comments:
|
||||
str = this.view.txtWasProtectedComment;
|
||||
break;
|
||||
case Asc.c_oAscEDocProtect.Forms:
|
||||
str = this.view.txtWasProtectedForms;
|
||||
break;
|
||||
case Asc.c_oAscEDocProtect.TrackedChanges:
|
||||
str = this.view.txtWasProtectedTrack;
|
||||
break;
|
||||
}
|
||||
str && Common.NotificationCenter.trigger('showmessage', {msg: str}, {timeout: 5000, hideCloseTip: true});
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
getDocProps: function(update) {
|
||||
|
|
|
@ -142,7 +142,12 @@ define([
|
|||
txtDocProtectedForms: 'Document is protected.<br>You may only fill in forms in this document.',
|
||||
hintProtectDoc: 'Protect document',
|
||||
txtDocUnlockDescription: 'Enter a password to unprotect document',
|
||||
txtUnlockTitle: 'Unprotect Document'
|
||||
txtUnlockTitle: 'Unprotect Document',
|
||||
txtWasProtectedView: 'Document has been protected by another user.\nYou may only view this document.',
|
||||
txtWasProtectedTrack: 'Document has been protected by another user.\nYou may edit this document, but all changes will be tracked.',
|
||||
txtWasProtectedComment: 'Document has been protected by another user.\nYou may only insert comments to this document.',
|
||||
txtWasProtectedForms: 'Document has been protected by another user.\nYou may only fill in forms in this document.',
|
||||
txtWasUnprotected: 'Document has been unprotected.'
|
||||
}
|
||||
}()), DE.Views.DocProtection || {}));
|
||||
});
|
|
@ -1634,6 +1634,11 @@
|
|||
"DE.Views.DocProtection.txtDocUnlockDescription": "Enter a password to unprotect document",
|
||||
"DE.Views.DocProtection.txtUnlockTitle": "Unprotect Document",
|
||||
"DE.Views.DocProtection.txtProtectDoc": "Protect Document",
|
||||
"DE.Views.DocProtection.txtWasProtectedView": "Document has been protected by another user.\nYou may only view this document.",
|
||||
"DE.Views.DocProtection.txtWasProtectedTrack": "Document has been protected by another user.\nYou may edit this document, but all changes will be tracked.",
|
||||
"DE.Views.DocProtection.txtWasProtectedComment": "Document has been protected by another user.\nYou may only insert comments to this document.",
|
||||
"DE.Views.DocProtection.txtWasProtectedForms": "Document has been protected by another user.\nYou may only fill in forms in this document.",
|
||||
"DE.Views.DocProtection.txtWasUnprotected": "Document has been unprotected.",
|
||||
"DE.Views.DocumentHolder.aboveText": "Above",
|
||||
"DE.Views.DocumentHolder.addCommentText": "Add comment",
|
||||
"DE.Views.DocumentHolder.advancedDropCapText": "Drop Cap Settings",
|
||||
|
|
|
@ -187,6 +187,7 @@ define([
|
|||
this.toolbar = options.toolbar;
|
||||
this.appConfig = options.mode;
|
||||
this.$el = this.toolbar.toolbar.$el.find('#animation-panel');
|
||||
var me = this;
|
||||
var _set = Common.enumLock;
|
||||
this.lockedControls = [];
|
||||
this._arrEffectName = [{group:'none', value: AscFormat.ANIM_PRESET_NONE, iconCls: 'animation-none', displayValue: this.textNone}].concat(Common.define.effectData.getEffectData());
|
||||
|
@ -293,7 +294,7 @@ define([
|
|||
|
||||
this.lockedControls.push(this.btnAddAnimation);
|
||||
|
||||
this.cmbDuration = new Common.UI.ComboBox({
|
||||
this.cmbDuration = new Common.UI.ComboBoxCustom({
|
||||
el: this.$el.find('#animation-spin-duration'),
|
||||
cls: 'input-group-nr',
|
||||
menuStyle: 'min-width: 100%;',
|
||||
|
@ -309,7 +310,10 @@ define([
|
|||
lock: [_set.slideDeleted, _set.noSlides, _set.noGraphic, _set.noAnimation, _set.noAnimationDuration, _set.timingLock],
|
||||
dataHint: '1',
|
||||
dataHintDirection: 'top',
|
||||
dataHintOffset: 'small'
|
||||
dataHintOffset: 'small',
|
||||
updateFormControl: function(record) {
|
||||
record && this.setRawValue(record.get('value') + ' ' + me.txtSec);
|
||||
}
|
||||
});
|
||||
this.lockedControls.push(this.cmbDuration);
|
||||
|
||||
|
|
Loading…
Reference in a new issue