Added onWarning event to api.
This commit is contained in:
parent
58d129ac79
commit
22580a02cb
|
@ -170,7 +170,8 @@
|
||||||
'onAppReady': <application ready callback>,
|
'onAppReady': <application ready callback>,
|
||||||
'onBack': <back to folder callback>,
|
'onBack': <back to folder callback>,
|
||||||
'onError': <error callback>,
|
'onError': <error callback>,
|
||||||
'onDocumentReady': <document ready callback>
|
'onDocumentReady': <document ready callback>,
|
||||||
|
'onWarning': <warning callback>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -189,6 +189,16 @@ if (Common === undefined) {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
reportWarning: function(code, description) {
|
||||||
|
_postMessage({
|
||||||
|
event: 'onWarning',
|
||||||
|
data: {
|
||||||
|
warningCode: code,
|
||||||
|
warningDescription: description
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
sendInfo: function(info) {
|
sendInfo: function(info) {
|
||||||
_postMessage({
|
_postMessage({
|
||||||
event: 'onInfo',
|
event: 'onInfo',
|
||||||
|
|
|
@ -391,6 +391,8 @@ var ApplicationController = new(function(){
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
Common.Gateway.reportWarning(id, message);
|
||||||
|
|
||||||
$('#id-critical-error-title').text(me.notcriticalErrorTitle);
|
$('#id-critical-error-title').text(me.notcriticalErrorTitle);
|
||||||
$('#id-critical-error-message').text(message);
|
$('#id-critical-error-message').text(message);
|
||||||
$('#id-critical-error-close').off();
|
$('#id-critical-error-close').off();
|
||||||
|
|
|
@ -1331,6 +1331,8 @@ define([
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
Common.Gateway.reportWarning(id, config.msg);
|
||||||
|
|
||||||
config.title = this.notcriticalErrorTitle;
|
config.title = this.notcriticalErrorTitle;
|
||||||
config.iconCls = 'warn';
|
config.iconCls = 'warn';
|
||||||
config.buttons = ['ok'];
|
config.buttons = ['ok'];
|
||||||
|
|
|
@ -842,6 +842,8 @@ define([
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
Common.Gateway.reportWarning(id, config.msg);
|
||||||
|
|
||||||
config.title = this.notcriticalErrorTitle;
|
config.title = this.notcriticalErrorTitle;
|
||||||
config.callback = _.bind(function(btn){
|
config.callback = _.bind(function(btn){
|
||||||
if (id == Asc.c_oAscError.ID.Warning && btn == 'ok' && (this.appOptions.canDownload || this.appOptions.canDownloadOrigin)) {
|
if (id == Asc.c_oAscError.ID.Warning && btn == 'ok' && (this.appOptions.canDownload || this.appOptions.canDownloadOrigin)) {
|
||||||
|
|
|
@ -495,6 +495,8 @@ var ApplicationController = new(function(){
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
Common.Gateway.reportWarning(id, message);
|
||||||
|
|
||||||
$('#id-critical-error-title').text(me.notcriticalErrorTitle);
|
$('#id-critical-error-title').text(me.notcriticalErrorTitle);
|
||||||
$('#id-critical-error-message').text(message);
|
$('#id-critical-error-message').text(message);
|
||||||
$('#id-critical-error-close').off();
|
$('#id-critical-error-close').off();
|
||||||
|
|
|
@ -1085,6 +1085,8 @@ define([
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
Common.Gateway.reportWarning(id, config.msg);
|
||||||
|
|
||||||
config.title = this.notcriticalErrorTitle;
|
config.title = this.notcriticalErrorTitle;
|
||||||
config.iconCls = 'warn';
|
config.iconCls = 'warn';
|
||||||
config.buttons = ['ok'];
|
config.buttons = ['ok'];
|
||||||
|
|
|
@ -802,6 +802,8 @@ define([
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Common.Gateway.reportWarning(id, config.msg);
|
||||||
|
|
||||||
config.title = this.notcriticalErrorTitle;
|
config.title = this.notcriticalErrorTitle;
|
||||||
config.callback = _.bind(function(btn){
|
config.callback = _.bind(function(btn){
|
||||||
if (id == Asc.c_oAscError.ID.Warning && btn == 'ok' && (this.appOptions.canDownload || this.appOptions.canDownloadOrigin)) {
|
if (id == Asc.c_oAscError.ID.Warning && btn == 'ok' && (this.appOptions.canDownload || this.appOptions.canDownloadOrigin)) {
|
||||||
|
|
|
@ -403,6 +403,8 @@ var ApplicationController = new(function(){
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
Common.Gateway.reportWarning(id, message);
|
||||||
|
|
||||||
$('#id-critical-error-title').text(me.notcriticalErrorTitle);
|
$('#id-critical-error-title').text(me.notcriticalErrorTitle);
|
||||||
$('#id-critical-error-message').text(message);
|
$('#id-critical-error-message').text(message);
|
||||||
$('#id-critical-error-close').off();
|
$('#id-critical-error-close').off();
|
||||||
|
|
|
@ -1242,6 +1242,8 @@ define([
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Common.Gateway.reportWarning(id, config.msg);
|
||||||
|
|
||||||
config.title = this.notcriticalErrorTitle;
|
config.title = this.notcriticalErrorTitle;
|
||||||
config.iconCls = 'warn';
|
config.iconCls = 'warn';
|
||||||
config.buttons = ['ok'];
|
config.buttons = ['ok'];
|
||||||
|
|
|
@ -941,6 +941,8 @@ define([
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
Common.Gateway.reportWarning(id, config.msg);
|
||||||
|
|
||||||
config.title = this.notcriticalErrorTitle;
|
config.title = this.notcriticalErrorTitle;
|
||||||
// config.iconCls = 'warn';
|
// config.iconCls = 'warn';
|
||||||
// config.buttons = ['ok'];
|
// config.buttons = ['ok'];
|
||||||
|
|
Loading…
Reference in a new issue