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