Merge pull request #90 from ONLYOFFICE/feature/bugfix5.1.3
Feature/bugfix5.1.3
This commit is contained in:
commit
3740ba637f
|
@ -674,7 +674,7 @@ define([
|
||||||
};
|
};
|
||||||
btn.setDisabled( true );
|
btn.setDisabled( true );
|
||||||
} else {
|
} else {
|
||||||
btn.setDisabled( btn.keepState.disabled );
|
btn.setDisabled( btn.keepState && btn.keepState.disabled || lock);
|
||||||
delete btn.keepState;
|
delete btn.keepState;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -193,7 +193,6 @@ define([
|
||||||
$('#settings-readermode input:checkbox').attr('checked', Common.SharedSettings.get('readerMode'));
|
$('#settings-readermode input:checkbox').attr('checked', Common.SharedSettings.get('readerMode'));
|
||||||
$('#settings-search').single('click', _.bind(me.onSearch, me));
|
$('#settings-search').single('click', _.bind(me.onSearch, me));
|
||||||
$('#settings-readermode input:checkbox').single('change', _.bind(me.onReaderMode, me));
|
$('#settings-readermode input:checkbox').single('change', _.bind(me.onReaderMode, me));
|
||||||
$('#settings-edit-document').single('click', _.bind(me.onEditDocumet, me));
|
|
||||||
$('#settings-help').single('click', _.bind(me.onShowHelp, me));
|
$('#settings-help').single('click', _.bind(me.onShowHelp, me));
|
||||||
$('#settings-download').single('click', _.bind(me.onDownloadOrigin, me));
|
$('#settings-download').single('click', _.bind(me.onDownloadOrigin, me));
|
||||||
}
|
}
|
||||||
|
@ -267,10 +266,6 @@ define([
|
||||||
|
|
||||||
// Handlers
|
// Handlers
|
||||||
|
|
||||||
onEditDocumet: function() {
|
|
||||||
Common.Gateway.requestEditRights();
|
|
||||||
},
|
|
||||||
|
|
||||||
onSearch: function (e) {
|
onSearch: function (e) {
|
||||||
var toolbarView = DE.getController('Toolbar').getView('Toolbar');
|
var toolbarView = DE.getController('Toolbar').getView('Toolbar');
|
||||||
|
|
||||||
|
|
|
@ -25,18 +25,6 @@
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<% } %>
|
<% } %>
|
||||||
<li>
|
|
||||||
<a id="settings-edit-document" class="item-link no-indicator">
|
|
||||||
<div class="item-content">
|
|
||||||
<div class="item-media">
|
|
||||||
<i class="icon icon-edit"></i>
|
|
||||||
</div>
|
|
||||||
<div class="item-inner">
|
|
||||||
<div class="item-title"><%= scope.textEditDoc %></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
<li>
|
||||||
<div id="settings-readermode" class="item-content">
|
<div id="settings-readermode" class="item-content">
|
||||||
<div class="item-media">
|
<div class="item-media">
|
||||||
|
|
|
@ -34,6 +34,9 @@
|
||||||
<a href="#" id="toolbar-add" class="link icon-only" style="display: none;">
|
<a href="#" id="toolbar-add" class="link icon-only" style="display: none;">
|
||||||
<i class="icon icon-plus"></i>
|
<i class="icon icon-plus"></i>
|
||||||
</a>
|
</a>
|
||||||
|
<a href="#" id="toolbar-edit-document" class="link icon-only" style="display: none;">
|
||||||
|
<i class="icon icon-edit"></i>
|
||||||
|
</a>
|
||||||
<% if (!phone) { %>
|
<% if (!phone) { %>
|
||||||
<a href="#" id="toolbar-search" class="link icon-only">
|
<a href="#" id="toolbar-search" class="link icon-only">
|
||||||
<i class="icon icon-search"></i>
|
<i class="icon icon-search"></i>
|
||||||
|
|
|
@ -108,10 +108,8 @@ define([
|
||||||
isPhone = Common.SharedSettings.get('phone');
|
isPhone = Common.SharedSettings.get('phone');
|
||||||
|
|
||||||
if (_isEdit) {
|
if (_isEdit) {
|
||||||
$layour.find('#settings-edit-document').hide();
|
|
||||||
$layour.find('#settings-search .item-title').text(this.textFindAndReplace)
|
$layour.find('#settings-search .item-title').text(this.textFindAndReplace)
|
||||||
} else {
|
} else {
|
||||||
if (!_canEdit) $layour.find('#settings-edit-document').hide();
|
|
||||||
$layour.find('#settings-document').hide();
|
$layour.find('#settings-document').hide();
|
||||||
}
|
}
|
||||||
if (!_canReader)
|
if (!_canReader)
|
||||||
|
@ -213,7 +211,6 @@ define([
|
||||||
permissions = _.extend(permissions, data.doc.permissions);
|
permissions = _.extend(permissions, data.doc.permissions);
|
||||||
|
|
||||||
if (permissions.edit === false) {
|
if (permissions.edit === false) {
|
||||||
$('#settings-edit-document').hide();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -62,7 +62,8 @@ define([
|
||||||
"click #toolbar-search" : "searchToggle",
|
"click #toolbar-search" : "searchToggle",
|
||||||
"click #toolbar-edit" : "showEdition",
|
"click #toolbar-edit" : "showEdition",
|
||||||
"click #toolbar-add" : "showInserts",
|
"click #toolbar-add" : "showInserts",
|
||||||
"click #toolbar-settings" : "showSettings"
|
"click #toolbar-settings" : "showSettings",
|
||||||
|
"click #toolbar-edit-document": "editDocument"
|
||||||
},
|
},
|
||||||
|
|
||||||
// Set innerHTML and get the references to the DOM elements
|
// Set innerHTML and get the references to the DOM elements
|
||||||
|
@ -100,6 +101,8 @@ define([
|
||||||
setMode: function (mode) {
|
setMode: function (mode) {
|
||||||
if (mode.isEdit) {
|
if (mode.isEdit) {
|
||||||
$('#toolbar-edit, #toolbar-add, #toolbar-undo, #toolbar-redo').show();
|
$('#toolbar-edit, #toolbar-add, #toolbar-undo, #toolbar-redo').show();
|
||||||
|
} else if (mode.canEdit && mode.canRequestEditRights){
|
||||||
|
$('#toolbar-edit-document').show();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -147,6 +150,10 @@ define([
|
||||||
DE.getController('Settings').showModal();
|
DE.getController('Settings').showModal();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
editDocument: function () {
|
||||||
|
Common.Gateway.requestEditRights();
|
||||||
|
},
|
||||||
|
|
||||||
textBack: 'Back'
|
textBack: 'Back'
|
||||||
}
|
}
|
||||||
})(), DE.Views.Toolbar || {}))
|
})(), DE.Views.Toolbar || {}))
|
||||||
|
|
|
@ -155,7 +155,6 @@ define([
|
||||||
var me = this;
|
var me = this;
|
||||||
$('#settings-search').single('click', _.bind(me._onSearch, me));
|
$('#settings-search').single('click', _.bind(me._onSearch, me));
|
||||||
$('#settings-readermode input:checkbox').single('change', _.bind(me._onReaderMode, me));
|
$('#settings-readermode input:checkbox').single('change', _.bind(me._onReaderMode, me));
|
||||||
$('#settings-edit-presentation').single('click', _.bind(me._onEditPresentation, me));
|
|
||||||
$(modalView).find('.formats a').single('click', _.bind(me._onSaveFormat, me));
|
$(modalView).find('.formats a').single('click', _.bind(me._onSaveFormat, me));
|
||||||
$('#page-settings-setup-view li').single('click', _.bind(me._onSlideSize, me));
|
$('#page-settings-setup-view li').single('click', _.bind(me._onSlideSize, me));
|
||||||
|
|
||||||
|
@ -224,10 +223,6 @@ define([
|
||||||
$('#settings-presentation-title').html(name ? name : '-');
|
$('#settings-presentation-title').html(name ? name : '-');
|
||||||
},
|
},
|
||||||
|
|
||||||
_onEditPresentation: function() {
|
|
||||||
Common.Gateway.requestEditRights();
|
|
||||||
},
|
|
||||||
|
|
||||||
_onSearch: function (e) {
|
_onSearch: function (e) {
|
||||||
var toolbarView = PE.getController('Toolbar').getView('Toolbar');
|
var toolbarView = PE.getController('Toolbar').getView('Toolbar');
|
||||||
|
|
||||||
|
|
|
@ -25,18 +25,6 @@
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<% } %>
|
<% } %>
|
||||||
<li>
|
|
||||||
<a id="settings-edit-presentation" class="item-link no-indicator">
|
|
||||||
<div class="item-content">
|
|
||||||
<div class="item-media">
|
|
||||||
<i class="icon icon-edit"></i>
|
|
||||||
</div>
|
|
||||||
<div class="item-inner">
|
|
||||||
<div class="item-title"><%= scope.textEditPresent %></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
<li>
|
||||||
<a id="settings-presentation-setup" class="item-link">
|
<a id="settings-presentation-setup" class="item-link">
|
||||||
<div class="item-content">
|
<div class="item-content">
|
||||||
|
|
|
@ -37,6 +37,9 @@
|
||||||
<a href="#" id="toolbar-add" class="link icon-only" style="display: none;">
|
<a href="#" id="toolbar-add" class="link icon-only" style="display: none;">
|
||||||
<i class="icon icon-plus"></i>
|
<i class="icon icon-plus"></i>
|
||||||
</a>
|
</a>
|
||||||
|
<a href="#" id="toolbar-edit-document" class="link icon-only" style="display: none;">
|
||||||
|
<i class="icon icon-edit"></i>
|
||||||
|
</a>
|
||||||
<% if (!phone) { %>
|
<% if (!phone) { %>
|
||||||
<a href="#" id="toolbar-search" class="link icon-only">
|
<a href="#" id="toolbar-search" class="link icon-only">
|
||||||
<i class="icon icon-search"></i>
|
<i class="icon icon-search"></i>
|
||||||
|
|
|
@ -109,11 +109,9 @@ define([
|
||||||
isPhone = Common.SharedSettings.get('phone');
|
isPhone = Common.SharedSettings.get('phone');
|
||||||
|
|
||||||
if (isEdit) {
|
if (isEdit) {
|
||||||
$layour.find('#settings-edit-presentation').hide();
|
|
||||||
$layour.find('#settings-readermode').hide();
|
$layour.find('#settings-readermode').hide();
|
||||||
$layour.find('#settings-search .item-title').text(this.textFindAndReplace)
|
$layour.find('#settings-search .item-title').text(this.textFindAndReplace)
|
||||||
} else {
|
} else {
|
||||||
if (!canEdit) $layour.find('#settings-edit-presentation').hide();
|
|
||||||
$layour.find('#settings-presentation-setup').hide();
|
$layour.find('#settings-presentation-setup').hide();
|
||||||
$layour.find('#settings-readermode input:checkbox')
|
$layour.find('#settings-readermode input:checkbox')
|
||||||
.attr('checked', Common.SharedSettings.get('readerMode'))
|
.attr('checked', Common.SharedSettings.get('readerMode'))
|
||||||
|
@ -190,7 +188,6 @@ define([
|
||||||
permissions = _.extend(permissions, data.doc.permissions);
|
permissions = _.extend(permissions, data.doc.permissions);
|
||||||
|
|
||||||
if (permissions.edit === false) {
|
if (permissions.edit === false) {
|
||||||
$('#settings-edit-presentation').hide();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -63,7 +63,8 @@ define([
|
||||||
"click #toolbar-edit" : "showEdition",
|
"click #toolbar-edit" : "showEdition",
|
||||||
"click #toolbar-add" : "showInserts",
|
"click #toolbar-add" : "showInserts",
|
||||||
"click #toolbar-settings" : "showSettings",
|
"click #toolbar-settings" : "showSettings",
|
||||||
"click #toolbar-preview" : "showPreview"
|
"click #toolbar-preview" : "showPreview",
|
||||||
|
"click #toolbar-edit-document": "editDocument"
|
||||||
},
|
},
|
||||||
|
|
||||||
// Set innerHTML and get the references to the DOM elements
|
// Set innerHTML and get the references to the DOM elements
|
||||||
|
@ -101,6 +102,8 @@ define([
|
||||||
setMode: function (mode) {
|
setMode: function (mode) {
|
||||||
if (mode.isEdit) {
|
if (mode.isEdit) {
|
||||||
$('#toolbar-edit, #toolbar-add, #toolbar-undo, #toolbar-redo').show();
|
$('#toolbar-edit, #toolbar-add, #toolbar-undo, #toolbar-redo').show();
|
||||||
|
} else if (mode.canEdit && mode.canRequestEditRights){
|
||||||
|
$('#toolbar-edit-document').show();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -152,6 +155,10 @@ define([
|
||||||
PE.getController('DocumentPreview').show();
|
PE.getController('DocumentPreview').show();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
editDocument: function () {
|
||||||
|
Common.Gateway.requestEditRights();
|
||||||
|
},
|
||||||
|
|
||||||
textBack: 'Back'
|
textBack: 'Back'
|
||||||
}
|
}
|
||||||
})(), PE.Views.Toolbar || {}))
|
})(), PE.Views.Toolbar || {}))
|
||||||
|
|
|
@ -872,7 +872,6 @@ define([
|
||||||
this.appOptions.canChat = this.appOptions.canLicense && !this.appOptions.isOffline && !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.chat===false);
|
this.appOptions.canChat = this.appOptions.canLicense && !this.appOptions.isOffline && !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.chat===false);
|
||||||
this.appOptions.canRename = !!this.permissions.rename;
|
this.appOptions.canRename = !!this.permissions.rename;
|
||||||
this.appOptions.trialMode = params.asc_getLicenseMode();
|
this.appOptions.trialMode = params.asc_getLicenseMode();
|
||||||
this.appOptions.canProtect = this.appOptions.isEdit && this.appOptions.isDesktopApp && this.appOptions.isOffline && this.api.asc_isSignaturesSupport();
|
|
||||||
this.appOptions.canModifyFilter = (this.permissions.modifyFilter!==false);
|
this.appOptions.canModifyFilter = (this.permissions.modifyFilter!==false);
|
||||||
this.appOptions.canBranding = (licType === Asc.c_oLicenseResult.Success) && (typeof this.editorConfig.customization == 'object');
|
this.appOptions.canBranding = (licType === Asc.c_oLicenseResult.Success) && (typeof this.editorConfig.customization == 'object');
|
||||||
if (this.appOptions.canBranding)
|
if (this.appOptions.canBranding)
|
||||||
|
@ -897,6 +896,7 @@ define([
|
||||||
(typeof (this.editorConfig.customization) == 'object' && !!this.editorConfig.customization.forcesave);
|
(typeof (this.editorConfig.customization) == 'object' && !!this.editorConfig.customization.forcesave);
|
||||||
this.appOptions.forcesave = this.appOptions.canForcesave;
|
this.appOptions.forcesave = this.appOptions.canForcesave;
|
||||||
this.appOptions.canEditComments= this.appOptions.isOffline || !(typeof (this.editorConfig.customization) == 'object' && this.editorConfig.customization.commentAuthorOnly);
|
this.appOptions.canEditComments= this.appOptions.isOffline || !(typeof (this.editorConfig.customization) == 'object' && this.editorConfig.customization.commentAuthorOnly);
|
||||||
|
this.appOptions.canProtect = this.appOptions.isEdit && this.appOptions.isDesktopApp && this.appOptions.isOffline && this.api.asc_isSignaturesSupport() && !(this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge);
|
||||||
|
|
||||||
this.applyModeCommonElements();
|
this.applyModeCommonElements();
|
||||||
this.applyModeEditorElements();
|
this.applyModeEditorElements();
|
||||||
|
|
|
@ -148,7 +148,6 @@ define([
|
||||||
onPageShow: function(view, pageId) {
|
onPageShow: function(view, pageId) {
|
||||||
var me = this;
|
var me = this;
|
||||||
$('#settings-search').single('click', _.bind(me._onSearch, me));
|
$('#settings-search').single('click', _.bind(me._onSearch, me));
|
||||||
$('#settings-edit-document').single('click', _.bind(me._onEditDocument, me));
|
|
||||||
$(modalView).find('.formats a').single('click', _.bind(me._onSaveFormat, me));
|
$(modalView).find('.formats a').single('click', _.bind(me._onSaveFormat, me));
|
||||||
me.initSettings(pageId);
|
me.initSettings(pageId);
|
||||||
},
|
},
|
||||||
|
@ -200,10 +199,6 @@ define([
|
||||||
|
|
||||||
// API handlers
|
// API handlers
|
||||||
|
|
||||||
_onEditDocument: function() {
|
|
||||||
Common.Gateway.requestEditRights();
|
|
||||||
},
|
|
||||||
|
|
||||||
_onSearch: function (e) {
|
_onSearch: function (e) {
|
||||||
var toolbarView = SSE.getController('Toolbar').getView('Toolbar');
|
var toolbarView = SSE.getController('Toolbar').getView('Toolbar');
|
||||||
|
|
||||||
|
|
|
@ -25,18 +25,6 @@
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<% } %>
|
<% } %>
|
||||||
<li>
|
|
||||||
<a id="settings-edit-document" class="item-link no-indicator">
|
|
||||||
<div class="item-content">
|
|
||||||
<div class="item-media">
|
|
||||||
<i class="icon icon-edit"></i>
|
|
||||||
</div>
|
|
||||||
<div class="item-inner">
|
|
||||||
<div class="item-title"><%= scope.textEditDoc %></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
<li>
|
||||||
<a id="settings-download" class="item-link">
|
<a id="settings-download" class="item-link">
|
||||||
<div class="item-content">
|
<div class="item-content">
|
||||||
|
|
|
@ -34,6 +34,9 @@
|
||||||
<a href="#" id="toolbar-add" class="link icon-only" style="display: none;">
|
<a href="#" id="toolbar-add" class="link icon-only" style="display: none;">
|
||||||
<i class="icon icon-plus"></i>
|
<i class="icon icon-plus"></i>
|
||||||
</a>
|
</a>
|
||||||
|
<a href="#" id="toolbar-edit-document" class="link icon-only" style="display: none;">
|
||||||
|
<i class="icon icon-edit"></i>
|
||||||
|
</a>
|
||||||
<% if (!phone) { %>
|
<% if (!phone) { %>
|
||||||
<a href="#" id="toolbar-search" class="link icon-only">
|
<a href="#" id="toolbar-search" class="link icon-only">
|
||||||
<i class="icon icon-search"></i>
|
<i class="icon icon-search"></i>
|
||||||
|
|
|
@ -114,10 +114,8 @@ define([
|
||||||
isPhone = Common.SharedSettings.get('phone');
|
isPhone = Common.SharedSettings.get('phone');
|
||||||
|
|
||||||
if (isEdit) {
|
if (isEdit) {
|
||||||
$layout.find('#settings-edit-document').hide();
|
|
||||||
$layout.find('#settings-search .item-title').text(this.textFindAndReplace)
|
$layout.find('#settings-search .item-title').text(this.textFindAndReplace)
|
||||||
} else {
|
} else {
|
||||||
if (!canEdit) $layout.find('#settings-edit-document').hide();
|
|
||||||
}
|
}
|
||||||
if (!canDownload) $layout.find('#settings-download').hide();
|
if (!canDownload) $layout.find('#settings-download').hide();
|
||||||
if (!canAbout) $layout.find('#settings-about').hide();
|
if (!canAbout) $layout.find('#settings-about').hide();
|
||||||
|
@ -185,7 +183,6 @@ define([
|
||||||
permissions = _.extend(permissions, data.doc.permissions);
|
permissions = _.extend(permissions, data.doc.permissions);
|
||||||
|
|
||||||
if (permissions.edit === false) {
|
if (permissions.edit === false) {
|
||||||
$('#settings-edit-document').hide();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -62,7 +62,8 @@ define([
|
||||||
"click #toolbar-search" : "searchToggle",
|
"click #toolbar-search" : "searchToggle",
|
||||||
"click #toolbar-edit" : "showEdition",
|
"click #toolbar-edit" : "showEdition",
|
||||||
"click #toolbar-add" : "showInserts",
|
"click #toolbar-add" : "showInserts",
|
||||||
"click #toolbar-settings" : "showSettings"
|
"click #toolbar-settings" : "showSettings",
|
||||||
|
"click #toolbar-edit-document": "editDocument"
|
||||||
},
|
},
|
||||||
|
|
||||||
// Set innerHTML and get the references to the DOM elements
|
// Set innerHTML and get the references to the DOM elements
|
||||||
|
@ -93,6 +94,8 @@ define([
|
||||||
setMode: function (mode) {
|
setMode: function (mode) {
|
||||||
if (mode.isEdit) {
|
if (mode.isEdit) {
|
||||||
$('#toolbar-edit, #toolbar-add, #toolbar-undo, #toolbar-redo').show();
|
$('#toolbar-edit, #toolbar-add, #toolbar-undo, #toolbar-redo').show();
|
||||||
|
} else if (mode.canEdit && mode.canRequestEditRights){
|
||||||
|
$('#toolbar-edit-document').show();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -148,6 +151,10 @@ define([
|
||||||
this.$btnEdit.toggleClass('disabled', val);
|
this.$btnEdit.toggleClass('disabled', val);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
editDocument: function () {
|
||||||
|
Common.Gateway.requestEditRights();
|
||||||
|
},
|
||||||
|
|
||||||
textBack: 'Back'
|
textBack: 'Back'
|
||||||
}
|
}
|
||||||
})(), SSE.Views.Toolbar || {}))
|
})(), SSE.Views.Toolbar || {}))
|
||||||
|
|
Loading…
Reference in a new issue