[PE] Add asc_onReplaceAll event
This commit is contained in:
parent
40d8352177
commit
522adc4261
|
@ -139,6 +139,7 @@ define([
|
|||
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(this.onApiServerDisconnect, this));
|
||||
Common.NotificationCenter.on('api:disconnect', _.bind(this.onApiServerDisconnect, this));
|
||||
this.api.asc_registerCallback('asc_onDownloadUrl', _.bind(this.onDownloadUrl, this));
|
||||
this.api.asc_registerCallback('asc_onReplaceAll', _.bind(this.onApiTextReplaced, this));
|
||||
/** coauthoring begin **/
|
||||
if (this.mode.canCoAuthoring) {
|
||||
if (this.mode.canChat)
|
||||
|
@ -452,6 +453,17 @@ define([
|
|||
// this.api.asc_selectSearchingResults(false);
|
||||
},
|
||||
|
||||
onApiTextReplaced: function(found,replaced) {
|
||||
var me = this;
|
||||
if (found) {
|
||||
!(found - replaced > 0) ?
|
||||
Common.UI.info( {msg: Common.Utils.String.format(this.textReplaceSuccess, replaced)} ) :
|
||||
Common.UI.warning( {msg: Common.Utils.String.format(this.textReplaceSkipped, found-replaced)} );
|
||||
} else {
|
||||
Common.UI.info({msg: this.textNoTextFound});
|
||||
}
|
||||
},
|
||||
|
||||
onApiServerDisconnect: function(enableDownload) {
|
||||
this.mode.isEdit = false;
|
||||
this.leftMenu.close();
|
||||
|
@ -670,6 +682,8 @@ define([
|
|||
newDocumentTitle : 'Unnamed document',
|
||||
requestEditRightsText : 'Requesting editing rights...',
|
||||
notcriticalErrorTitle: 'Warning',
|
||||
txtUntitled: 'Untitled'
|
||||
txtUntitled: 'Untitled',
|
||||
textReplaceSuccess : 'Search has been done. {0} occurrences have been replaced',
|
||||
textReplaceSkipped : 'The replacement has been made. {0} occurrences were skipped.'
|
||||
}, PE.Controllers.LeftMenu || {}));
|
||||
});
|
|
@ -238,6 +238,8 @@
|
|||
"PE.Controllers.LeftMenu.requestEditRightsText": "Requesting editing rights...",
|
||||
"PE.Controllers.LeftMenu.textNoTextFound": "The data you have been searching for could not be found. Please adjust your search options.",
|
||||
"PE.Controllers.LeftMenu.txtUntitled": "Untitled",
|
||||
"PE.Controllers.LeftMenu.textReplaceSkipped": "The replacement has been made. {0} occurrences were skipped.",
|
||||
"PE.Controllers.LeftMenu.textReplaceSuccess": "The search has been done. Occurrences replaced: {0}",
|
||||
"PE.Controllers.Main.applyChangesTextText": "Loading data...",
|
||||
"PE.Controllers.Main.applyChangesTitleText": "Loading Data",
|
||||
"PE.Controllers.Main.convertationTimeoutText": "Conversion timeout exceeded.",
|
||||
|
|
Loading…
Reference in a new issue