Delete unused method "applyEditRights" from api.
This commit is contained in:
parent
00f8c80345
commit
ce8d332d32
|
@ -270,7 +270,7 @@
|
||||||
res;
|
res;
|
||||||
|
|
||||||
if (msg.event === 'onRequestEditRights' && !handler) {
|
if (msg.event === 'onRequestEditRights' && !handler) {
|
||||||
_applyEditRights(false, 'handler is\'n defined');
|
_applyEditRights(false, 'handler isn\'t defined');
|
||||||
} else if (msg.event === 'onInternalMessage' && msg.data && msg.data.type == 'localstorage') {
|
} else if (msg.event === 'onInternalMessage' && msg.data && msg.data.type == 'localstorage') {
|
||||||
_callLocalStorage(msg.data.data);
|
_callLocalStorage(msg.data.data);
|
||||||
} else {
|
} else {
|
||||||
|
@ -546,7 +546,6 @@
|
||||||
return {
|
return {
|
||||||
showError : _showError,
|
showError : _showError,
|
||||||
showMessage : _showMessage,
|
showMessage : _showMessage,
|
||||||
applyEditRights : _applyEditRights,
|
|
||||||
processSaveResult : _processSaveResult,
|
processSaveResult : _processSaveResult,
|
||||||
processRightsChange : _processRightsChange,
|
processRightsChange : _processRightsChange,
|
||||||
denyEditingRights : _denyEditingRights,
|
denyEditingRights : _denyEditingRights,
|
||||||
|
|
|
@ -708,65 +708,14 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
onApplyEditRights: function(data) {
|
onApplyEditRights: function(data) {
|
||||||
var application = this.getApplication();
|
this.getApplication().getController('Statusbar').setStatusCaption('');
|
||||||
application.getController('Statusbar').setStatusCaption('');
|
|
||||||
|
|
||||||
if (data) {
|
if (data && !data.allowed) {
|
||||||
if (data.allowed) {
|
|
||||||
data.requestrights = true;
|
|
||||||
this.appOptions.isEdit= true;
|
|
||||||
|
|
||||||
this.onLongActionBegin(Asc.c_oAscAsyncActionType['BlockInteraction'],ApplyEditRights);
|
|
||||||
|
|
||||||
var me = this;
|
|
||||||
setTimeout(function(){
|
|
||||||
me.applyModeCommonElements();
|
|
||||||
me.applyModeEditorElements();
|
|
||||||
me.api.asc_setViewMode(false);
|
|
||||||
|
|
||||||
var timer_rp = setInterval(function(){
|
|
||||||
clearInterval(timer_rp);
|
|
||||||
|
|
||||||
var toolbarController = application.getController('Toolbar'),
|
|
||||||
rightmenuController = application.getController('RightMenu'),
|
|
||||||
leftmenuController = application.getController('LeftMenu'),
|
|
||||||
documentHolderController = application.getController('DocumentHolder'),
|
|
||||||
fontsControllers = application.getController('Common.Controllers.Fonts');
|
|
||||||
|
|
||||||
leftmenuController.setMode(me.appOptions).createDelayedElements();
|
|
||||||
|
|
||||||
rightmenuController.createDelayedElements();
|
|
||||||
|
|
||||||
Common.NotificationCenter.trigger('layout:changed', 'main');
|
|
||||||
|
|
||||||
var timer_sl = setInterval(function(){
|
|
||||||
if (window.styles_loaded) {
|
|
||||||
clearInterval(timer_sl);
|
|
||||||
|
|
||||||
documentHolderController.getView('DocumentHolder').createDelayedElements();
|
|
||||||
documentHolderController.getView('DocumentHolder').changePosition();
|
|
||||||
me.loadLanguages();
|
|
||||||
|
|
||||||
var shapes = me.api.asc_getPropertyEditorShapes();
|
|
||||||
if (shapes)
|
|
||||||
me.fillAutoShapes(shapes[0], shapes[1]);
|
|
||||||
|
|
||||||
me.fillTextArt(me.api.asc_getTextArtPreviews());
|
|
||||||
me.updateThemeColors();
|
|
||||||
toolbarController.activateControls();
|
|
||||||
|
|
||||||
me.api.UpdateInterfaceState();
|
|
||||||
}
|
|
||||||
}, 50);
|
|
||||||
},50);
|
|
||||||
}, 100);
|
|
||||||
} else {
|
|
||||||
Common.UI.info({
|
Common.UI.info({
|
||||||
title: this.requestEditFailedTitleText,
|
title: this.requestEditFailedTitleText,
|
||||||
msg: data.message || this.requestEditFailedMessageText
|
msg: data.message || this.requestEditFailedMessageText
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
onDocumentContentReady: function() {
|
onDocumentContentReady: function() {
|
||||||
|
|
|
@ -510,68 +510,14 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
onApplyEditRights: function(data) {
|
onApplyEditRights: function(data) {
|
||||||
var application = this.getApplication();
|
this.getApplication().getController('Statusbar').setStatusCaption('');
|
||||||
application.getController('Statusbar').setStatusCaption('');
|
|
||||||
|
|
||||||
if (data) {
|
if (data && !data.allowed) {
|
||||||
if (data.allowed) {
|
|
||||||
data.requestrights = true;
|
|
||||||
this.appOptions.isEdit= true;
|
|
||||||
|
|
||||||
this.onLongActionBegin(Asc.c_oAscAsyncActionType['BlockInteraction'],ApplyEditRights);
|
|
||||||
|
|
||||||
var me = this;
|
|
||||||
setTimeout(function(){
|
|
||||||
me.applyModeCommonElements();
|
|
||||||
me.applyModeEditorElements('view');
|
|
||||||
me.api.asc_setViewMode(false);
|
|
||||||
|
|
||||||
var timer_rp = setInterval(function(){
|
|
||||||
clearInterval(timer_rp);
|
|
||||||
|
|
||||||
var toolbarController = application.getController('Toolbar'),
|
|
||||||
viewportController = application.getController('Viewport'),
|
|
||||||
rightmenuController = application.getController('RightMenu'),
|
|
||||||
leftmenuController = application.getController('LeftMenu'),
|
|
||||||
documentHolderController = application.getController('DocumentHolder'),
|
|
||||||
fontsControllers = application.getController('Common.Controllers.Fonts');
|
|
||||||
|
|
||||||
leftmenuController.setMode(me.appOptions).createDelayedElements();
|
|
||||||
|
|
||||||
rightmenuController.createDelayedElements();
|
|
||||||
|
|
||||||
Common.NotificationCenter.trigger('layout:changed', 'main');
|
|
||||||
|
|
||||||
var timer_sl = setInterval(function(){
|
|
||||||
if (window.styles_loaded) {
|
|
||||||
clearInterval(timer_sl);
|
|
||||||
|
|
||||||
documentHolderController.getView('DocumentHolder').createDelayedElements();
|
|
||||||
documentHolderController.getView('DocumentHolder').changePosition();
|
|
||||||
// me.getController('Common.controller.CommentsPopover').onDocumentContentReady();
|
|
||||||
// me.getController('Search').setMode({isEdit: me.modeEdit});
|
|
||||||
|
|
||||||
me.api.asc_registerCallback('asc_onFocusObject', _.bind(me.onFocusObject, me));
|
|
||||||
me.api.asc_registerCallback('asc_onUpdateLayout', _.bind(me.fillLayoutsStore, me)); // slide layouts loading
|
|
||||||
me.updateThemeColors();
|
|
||||||
var shapes = me.api.asc_getPropertyEditorShapes();
|
|
||||||
if (shapes)
|
|
||||||
me.fillAutoShapes(shapes[0], shapes[1]);
|
|
||||||
me.fillTextArt(me.api.asc_getTextArtPreviews());
|
|
||||||
toolbarController.activateControls();
|
|
||||||
|
|
||||||
me.api.UpdateInterfaceState();
|
|
||||||
}
|
|
||||||
}, 50);
|
|
||||||
},50);
|
|
||||||
}, 100);
|
|
||||||
} else {
|
|
||||||
Common.UI.info({
|
Common.UI.info({
|
||||||
title: this.requestEditFailedTitleText,
|
title: this.requestEditFailedTitleText,
|
||||||
msg: data.message || this.requestEditFailedMessageText
|
msg: data.message || this.requestEditFailedMessageText
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
onDocumentContentReady: function() {
|
onDocumentContentReady: function() {
|
||||||
|
|
|
@ -514,58 +514,12 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
onApplyEditRights: function(data) {
|
onApplyEditRights: function(data) {
|
||||||
if (data) {
|
if (data && !data.allowed) {
|
||||||
if (data.allowed) {
|
|
||||||
this.onLongActionBegin(Asc.c_oAscAsyncActionType['BlockInteraction'],ApplyEditRights);
|
|
||||||
this.appOptions.isEdit = true;
|
|
||||||
|
|
||||||
var me = this;
|
|
||||||
setTimeout(function(){
|
|
||||||
me.applyModeCommonElements();
|
|
||||||
me.applyModeEditorElements('view');
|
|
||||||
me.api.asc_setViewMode(false);
|
|
||||||
|
|
||||||
var application = me.getApplication();
|
|
||||||
var documentHolderController = application.getController('DocumentHolder');
|
|
||||||
|
|
||||||
application.getController('LeftMenu').setMode(me.appOptions).createDelayedElements();
|
|
||||||
Common.NotificationCenter.trigger('layout:changed', 'main');
|
|
||||||
|
|
||||||
var timer_sl = setInterval(function(){
|
|
||||||
if (window.styles_loaded) {
|
|
||||||
clearInterval(timer_sl);
|
|
||||||
|
|
||||||
documentHolderController.getView('DocumentHolder').createDelayedElements();
|
|
||||||
documentHolderController.resetApi();
|
|
||||||
|
|
||||||
application.getController('Toolbar').createDelayedElements();
|
|
||||||
application.getController('RightMenu').createDelayedElements();
|
|
||||||
application.getController('Statusbar').getView('Statusbar').update();
|
|
||||||
application.getController('CellEditor').setMode(me.appOptions);
|
|
||||||
|
|
||||||
me.api.asc_registerCallback('asc_onSaveUrl', _.bind(me.onSaveUrl, me));
|
|
||||||
me.api.asc_registerCallback('asc_onDocumentModifiedChanged', _.bind(me.onDocumentModifiedChanged, me));
|
|
||||||
me.api.asc_registerCallback('asc_onDocumentCanSaveChanged', _.bind(me.onDocumentCanSaveChanged, me));
|
|
||||||
me.api.asc_registerCallback('asc_onDownloadUrl', _.bind(me.onDownloadUrl, me));
|
|
||||||
var shapes = me.api.asc_getPropertyEditorShapes();
|
|
||||||
if (shapes)
|
|
||||||
me.fillAutoShapes(shapes[0], shapes[1]);
|
|
||||||
|
|
||||||
me.fillTextArt(me.api.asc_getTextArtPreviews());
|
|
||||||
me.updateThemeColors();
|
|
||||||
|
|
||||||
application.getController('FormulaDialog').setApi(me.api);
|
|
||||||
}
|
|
||||||
}, 50);
|
|
||||||
}, 50);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
Common.UI.info({
|
Common.UI.info({
|
||||||
title: this.requestEditFailedTitleText,
|
title: this.requestEditFailedTitleText,
|
||||||
msg: data.message || this.requestEditFailedMessageText
|
msg: data.message || this.requestEditFailedMessageText
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
onDocumentReady: function() {
|
onDocumentReady: function() {
|
||||||
|
|
|
@ -435,68 +435,6 @@ define([
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onApplyEditRights: function(data) {
|
|
||||||
// var application = this.getApplication();
|
|
||||||
// application.getController('Statusbar').setStatusCaption('');
|
|
||||||
//
|
|
||||||
// if (data) {
|
|
||||||
// if (data.allowed) {
|
|
||||||
// data.requestrights = true;
|
|
||||||
// this.appOptions.isEdit= true;
|
|
||||||
//
|
|
||||||
// this.onLongActionBegin(Asc.c_oAscAsyncActionType.BlockInteraction,ApplyEditRights);
|
|
||||||
//
|
|
||||||
// var me = this;
|
|
||||||
// setTimeout(function(){
|
|
||||||
// me.applyModeCommonElements();
|
|
||||||
// me.applyModeEditorElements();
|
|
||||||
// me.api.asc_setViewMode(false);
|
|
||||||
//
|
|
||||||
// var timer_rp = setInterval(function(){
|
|
||||||
// clearInterval(timer_rp);
|
|
||||||
//
|
|
||||||
// var toolbarController = application.getController('Toolbar'),
|
|
||||||
// rightmenuController = application.getController('RightMenu'),
|
|
||||||
// leftmenuController = application.getController('LeftMenu'),
|
|
||||||
// documentHolderController = application.getController('DocumentHolder'),
|
|
||||||
// fontsControllers = application.getController('Common.Controllers.Fonts');
|
|
||||||
//
|
|
||||||
// leftmenuController.setMode(me.appOptions).createDelayedElements();
|
|
||||||
//
|
|
||||||
// rightmenuController.createDelayedElements();
|
|
||||||
//
|
|
||||||
// Common.NotificationCenter.trigger('layout:changed', 'main');
|
|
||||||
//
|
|
||||||
// var timer_sl = setInterval(function(){
|
|
||||||
// if (window.styles_loaded) {
|
|
||||||
// clearInterval(timer_sl);
|
|
||||||
//
|
|
||||||
// documentHolderController.getView('DocumentHolder').createDelayedElements();
|
|
||||||
// documentHolderController.getView('DocumentHolder').changePosition();
|
|
||||||
// me.loadLanguages();
|
|
||||||
//
|
|
||||||
// var shapes = me.api.asc_getPropertyEditorShapes();
|
|
||||||
// if (shapes)
|
|
||||||
// me.fillAutoShapes(shapes[0], shapes[1]);
|
|
||||||
//
|
|
||||||
// me.fillTextArt(me.api.asc_getTextArtPreviews());
|
|
||||||
// me.updateThemeColors();
|
|
||||||
// toolbarController.activateControls();
|
|
||||||
//
|
|
||||||
// me.api.UpdateInterfaceState();
|
|
||||||
// }
|
|
||||||
// }, 50);
|
|
||||||
// },50);
|
|
||||||
// }, 100);
|
|
||||||
// } else {
|
|
||||||
// Common.UI.info({
|
|
||||||
// title: this.requestEditFailedTitleText,
|
|
||||||
// msg: data.message || this.requestEditFailedMessageText
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
},
|
|
||||||
|
|
||||||
onDocumentContentReady: function() {
|
onDocumentContentReady: function() {
|
||||||
if (this._isDocReady)
|
if (this._isDocReady)
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue