commit
41f1d7372c
|
@ -306,7 +306,7 @@ define([
|
|||
matchword = Common.SharedSettings.get('search-highlight') || false;
|
||||
|
||||
if (search && search.length) {
|
||||
if (!this.api.asc_replaceText(search, replace, false, matchcase, matchword)) {
|
||||
if (!this.api.asc_replaceText(search, replace || '', false, matchcase, matchword)) {
|
||||
var me = this;
|
||||
uiApp.alert(
|
||||
'',
|
||||
|
@ -324,7 +324,7 @@ define([
|
|||
matchword = Common.SharedSettings.get('search-highlight') || false;
|
||||
|
||||
if (search && search.length) {
|
||||
this.api.asc_replaceText(search, replace, true, matchcase, matchword);
|
||||
this.api.asc_replaceText(search, replace || '', true, matchcase, matchword);
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -143,13 +143,17 @@ define([
|
|||
|
||||
setMode: function (mode) {
|
||||
this.getView('Settings').setMode(mode);
|
||||
if (mode.canBranding)
|
||||
_licInfo = mode.customization;
|
||||
_canReview = mode.canReview;
|
||||
_isReviewOnly = mode.isReviewOnly;
|
||||
_fileKey = mode.fileKey;
|
||||
_isEdit = mode.isEdit;
|
||||
_lang = mode.lang;
|
||||
if (mode.isDisconnected) {
|
||||
_canReview = _isReviewOnly = _isEdit = false;
|
||||
} else {
|
||||
if (mode.canBranding)
|
||||
_licInfo = mode.customization;
|
||||
_canReview = mode.canReview;
|
||||
_isReviewOnly = mode.isReviewOnly;
|
||||
_fileKey = mode.fileKey;
|
||||
_isEdit = mode.isEdit;
|
||||
_lang = mode.lang;
|
||||
}
|
||||
},
|
||||
|
||||
initEvents: function () {
|
||||
|
|
|
@ -181,13 +181,17 @@ define([
|
|||
$('#toolbar-search, #document-back, #toolbar-collaboration').removeClass('disabled');
|
||||
},
|
||||
|
||||
deactivateEditControls: function() {
|
||||
$('#toolbar-edit, #toolbar-add, #toolbar-settings').addClass('disabled');
|
||||
deactivateEditControls: function(enableDownload) {
|
||||
$('#toolbar-edit, #toolbar-add').addClass('disabled');
|
||||
if (enableDownload)
|
||||
DE.getController('Settings').setMode({isDisconnected: true, enableDownload: enableDownload});
|
||||
else
|
||||
$('#toolbar-settings').addClass('disabled');
|
||||
},
|
||||
|
||||
onCoAuthoringDisconnect: function() {
|
||||
onCoAuthoringDisconnect: function(enableDownload) {
|
||||
this.isDisconnected = true;
|
||||
this.deactivateEditControls();
|
||||
this.deactivateEditControls(enableDownload);
|
||||
$('#toolbar-undo').toggleClass('disabled', true);
|
||||
$('#toolbar-redo').toggleClass('disabled', true);
|
||||
DE.getController('AddContainer').hideModal();
|
||||
|
|
|
@ -106,22 +106,29 @@ define([
|
|||
},
|
||||
|
||||
setMode: function (mode) {
|
||||
_isEdit = mode.isEdit;
|
||||
_canEdit = !mode.isEdit && mode.canEdit && mode.canRequestEditRights;
|
||||
_canDownload = mode.canDownload;
|
||||
_canDownloadOrigin = mode.canDownloadOrigin;
|
||||
_canReader = !mode.isEdit && !mode.isRestrictedEdit && mode.canReader;
|
||||
_canPrint = mode.canPrint;
|
||||
_canReview = mode.canReview;
|
||||
_isReviewOnly = mode.isReviewOnly;
|
||||
if (mode.isDisconnected) {
|
||||
_canEdit = _isEdit = false;
|
||||
_canReview = false;
|
||||
_isReviewOnly = false;
|
||||
if (!mode.enableDownload)
|
||||
_canPrint = _canDownload = _canDownloadOrigin = false;
|
||||
} else {
|
||||
_isEdit = mode.isEdit;
|
||||
_canEdit = !mode.isEdit && mode.canEdit && mode.canRequestEditRights;
|
||||
_canReader = !mode.isEdit && !mode.isRestrictedEdit && mode.canReader;
|
||||
_canReview = mode.canReview;
|
||||
_isReviewOnly = mode.isReviewOnly;
|
||||
_canDownload = mode.canDownload;
|
||||
_canDownloadOrigin = mode.canDownloadOrigin;
|
||||
_canPrint = mode.canPrint;
|
||||
if (mode.customization && mode.canBrandingExt) {
|
||||
_canAbout = (mode.customization.about!==false);
|
||||
}
|
||||
|
||||
if (mode.customization && mode.canBrandingExt) {
|
||||
_canAbout = (mode.customization.about!==false);
|
||||
}
|
||||
|
||||
if (mode.customization) {
|
||||
_canHelp = (mode.customization.help!==false);
|
||||
_isShowMacros = (mode.customization.macros!==false);
|
||||
if (mode.customization) {
|
||||
_canHelp = (mode.customization.help!==false);
|
||||
_isShowMacros = (mode.customization.macros!==false);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -294,7 +294,7 @@ define([
|
|||
var matchcase = Common.SharedSettings.get('search-case-sensitive') || false;
|
||||
|
||||
if (search && search.length) {
|
||||
if (!this.api.asc_replaceText(search, replace, false, matchcase)) {
|
||||
if (!this.api.asc_replaceText(search, replace || '', false, matchcase)) {
|
||||
var me = this;
|
||||
uiApp.alert(
|
||||
'',
|
||||
|
@ -311,7 +311,7 @@ define([
|
|||
var matchcase = Common.SharedSettings.get('search-case-sensitive') || false;
|
||||
|
||||
if (search && search.length) {
|
||||
this.api.asc_replaceText(search, replace, true, matchcase);
|
||||
this.api.asc_replaceText(search, replace || '', true, matchcase);
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -190,13 +190,17 @@ define([
|
|||
$('#toolbar-preview, #toolbar-search, #document-back, #toolbar-collaboration').removeClass('disabled');
|
||||
},
|
||||
|
||||
deactivateEditControls: function() {
|
||||
$('#toolbar-edit, #toolbar-add, #toolbar-settings').addClass('disabled');
|
||||
deactivateEditControls: function(enableDownload) {
|
||||
$('#toolbar-edit, #toolbar-add').addClass('disabled');
|
||||
if (enableDownload)
|
||||
PE.getController('Settings').setMode({isDisconnected: true, enableDownload: enableDownload});
|
||||
else
|
||||
$('#toolbar-settings').addClass('disabled');
|
||||
},
|
||||
|
||||
onCoAuthoringDisconnect: function() {
|
||||
onCoAuthoringDisconnect: function(enableDownload) {
|
||||
this.isDisconnected = true;
|
||||
this.deactivateEditControls();
|
||||
this.deactivateEditControls(enableDownload);
|
||||
$('#toolbar-undo').toggleClass('disabled', true);
|
||||
$('#toolbar-redo').toggleClass('disabled', true);
|
||||
PE.getController('AddContainer').hideModal();
|
||||
|
|
|
@ -107,18 +107,24 @@ define([
|
|||
},
|
||||
|
||||
setMode: function (mode) {
|
||||
isEdit = mode.isEdit;
|
||||
canEdit = !mode.isEdit && mode.canEdit && mode.canRequestEditRights;
|
||||
canDownload = mode.canDownload || mode.canDownloadOrigin;
|
||||
canPrint = mode.canPrint;
|
||||
if (mode.isDisconnected) {
|
||||
canEdit = isEdit = false;
|
||||
if (!mode.enableDownload)
|
||||
canPrint = canDownload = false;
|
||||
} else {
|
||||
isEdit = mode.isEdit;
|
||||
canEdit = !mode.isEdit && mode.canEdit && mode.canRequestEditRights;
|
||||
canDownload = mode.canDownload || mode.canDownloadOrigin;
|
||||
canPrint = mode.canPrint;
|
||||
|
||||
if (mode.customization && mode.canBrandingExt) {
|
||||
canAbout = (mode.customization.about!==false);
|
||||
}
|
||||
if (mode.customization && mode.canBrandingExt) {
|
||||
canAbout = (mode.customization.about!==false);
|
||||
}
|
||||
|
||||
if (mode.customization) {
|
||||
canHelp = (mode.customization.help!==false);
|
||||
isShowMacros = (mode.customization.macros!==false);
|
||||
if (mode.customization) {
|
||||
canHelp = (mode.customization.help!==false);
|
||||
isShowMacros = (mode.customization.macros!==false);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -345,7 +345,7 @@ define([
|
|||
|
||||
var options = new Asc.asc_CFindOptions();
|
||||
options.asc_setFindWhat(search);
|
||||
options.asc_setReplaceWith(replace);
|
||||
options.asc_setReplaceWith(replace || '');
|
||||
options.asc_setIsMatchCase(matchCase);
|
||||
options.asc_setIsWholeCell(matchCell);
|
||||
options.asc_setScanOnOnlySheet(lookInSheet);
|
||||
|
@ -369,7 +369,7 @@ define([
|
|||
|
||||
var options = new Asc.asc_CFindOptions();
|
||||
options.asc_setFindWhat(search);
|
||||
options.asc_setReplaceWith(replace);
|
||||
options.asc_setReplaceWith(replace || '');
|
||||
options.asc_setIsMatchCase(matchCase);
|
||||
options.asc_setIsWholeCell(matchCell);
|
||||
options.asc_setScanOnOnlySheet(lookInSheet);
|
||||
|
|
|
@ -209,13 +209,17 @@ define([
|
|||
$('#toolbar-search, #document-back, #toolbar-collaboration').removeClass('disabled');
|
||||
},
|
||||
|
||||
deactivateEditControls: function() {
|
||||
$('#toolbar-edit, #toolbar-add, #toolbar-settings').addClass('disabled');
|
||||
deactivateEditControls: function(enableDownload) {
|
||||
$('#toolbar-edit, #toolbar-add').addClass('disabled');
|
||||
if (enableDownload)
|
||||
SSE.getController('Settings').setMode({isDisconnected: true, enableDownload: enableDownload});
|
||||
else
|
||||
$('#toolbar-settings').addClass('disabled');
|
||||
},
|
||||
|
||||
onCoAuthoringDisconnect: function() {
|
||||
onCoAuthoringDisconnect: function(enableDownload) {
|
||||
this.isDisconnected = true;
|
||||
this.deactivateEditControls();
|
||||
this.deactivateEditControls(enableDownload);
|
||||
$('#toolbar-undo').toggleClass('disabled', true);
|
||||
$('#toolbar-redo').toggleClass('disabled', true);
|
||||
SSE.getController('AddContainer').hideModal();
|
||||
|
|
|
@ -116,18 +116,24 @@ define([
|
|||
},
|
||||
|
||||
setMode: function (mode) {
|
||||
isEdit = mode.isEdit;
|
||||
canEdit = !mode.isEdit && mode.canEdit && mode.canRequestEditRights;
|
||||
canDownload = mode.canDownload || mode.canDownloadOrigin;
|
||||
canPrint = mode.canPrint;
|
||||
if (mode.isDisconnected) {
|
||||
canEdit = isEdit = false;
|
||||
if (!mode.enableDownload)
|
||||
canPrint = canDownload = false;
|
||||
} else {
|
||||
isEdit = mode.isEdit;
|
||||
canEdit = !mode.isEdit && mode.canEdit && mode.canRequestEditRights;
|
||||
canDownload = mode.canDownload || mode.canDownloadOrigin;
|
||||
canPrint = mode.canPrint;
|
||||
|
||||
if (mode.customization && mode.canBrandingExt) {
|
||||
canAbout = (mode.customization.about!==false);
|
||||
}
|
||||
if (mode.customization && mode.canBrandingExt) {
|
||||
canAbout = (mode.customization.about!==false);
|
||||
}
|
||||
|
||||
if (mode.customization) {
|
||||
canHelp = (mode.customization.help!==false);
|
||||
isShowMacros = (mode.customization.macros!==false);
|
||||
if (mode.customization) {
|
||||
canHelp = (mode.customization.help!==false);
|
||||
isShowMacros = (mode.customization.macros!==false);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in a new issue