Commit 301fa348 authored by Alexander.Trofimov's avatar Alexander.Trofimov

Поправил вызов asc_getEditorPermissionsCallback

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@60727 954022d7-b5bf-4e40-9824-e11837661b57
parent befa39f0
...@@ -701,28 +701,28 @@ asc_docs_api.prototype.sync_ChangeLastSelectedElement = function(type, obj) ...@@ -701,28 +701,28 @@ asc_docs_api.prototype.sync_ChangeLastSelectedElement = function(type, obj)
{ {
this.SelectedObjectsStack[this.SelectedObjectsStack.length] = new CSelectedObject( type, oUnkTypeObj ); this.SelectedObjectsStack[this.SelectedObjectsStack.length] = new CSelectedObject( type, oUnkTypeObj );
} }
} };
asc_docs_api.prototype.Init = function() asc_docs_api.prototype.Init = function()
{ {
this.WordControl.Init(); this.WordControl.Init();
} };
asc_docs_api.prototype.asc_getEditorPermissions = function() asc_docs_api.prototype.asc_getEditorPermissions = function() {
{
if (this.DocInfo && this.DocInfo.get_Id()) { if (this.DocInfo && this.DocInfo.get_Id()) {
var rData = { var rData = {
"c" : "getsettings", "c": "getsettings",
"id" : this.DocInfo.get_Id(), "id": this.DocInfo.get_Id(),
"userid" : this.DocInfo.get_UserId(), "userid": this.DocInfo.get_UserId(),
"format" : this.DocInfo.get_Format(), "format": this.DocInfo.get_Format(),
"vkey" : this.DocInfo.get_VKey(), "vkey": this.DocInfo.get_VKey(),
"editorid" : c_oEditorId.Presentation "editorid": c_oEditorId.Presentation
}; };
sendCommand( this, this.asc_getEditorPermissionsCallback, rData ); var t = this;
sendCommand(this, function (response) {t.asc_getEditorPermissionsCallback(response);}, rData);
} else { } else {
var asc_CAscEditorPermissions = window["Asc"].asc_CAscEditorPermissions; var asc_CAscEditorPermissions = window["Asc"].asc_CAscEditorPermissions;
editor.asc_fireCallback("asc_onGetEditorPermissions", new asc_CAscEditorPermissions()); editor.asc_fireCallback("asc_onGetEditorPermissions", new asc_CAscEditorPermissions());
} }
}; };
...@@ -734,9 +734,9 @@ asc_docs_api.prototype.asc_getLicense = function () { ...@@ -734,9 +734,9 @@ asc_docs_api.prototype.asc_getLicense = function () {
sendCommand(this, function (response) {t._onGetLicense(response);}, rdata); sendCommand(this, function (response) {t._onGetLicense(response);}, rdata);
}; };
asc_docs_api.prototype.asc_getEditorPermissionsCallback = function(incomeObject) { asc_docs_api.prototype.asc_getEditorPermissionsCallback = function(response) {
if (null != incomeObject && "getsettings" == incomeObject["type"]) { if (null != response && "getsettings" == response["type"]) {
var oSettings = JSON.parse(incomeObject["data"]); var oSettings = JSON.parse(response["data"]);
//Set up coauthoring and spellcheker service //Set up coauthoring and spellcheker service
window.g_cAscCoAuthoringUrl = oSettings['g_cAscCoAuthoringUrl']; window.g_cAscCoAuthoringUrl = oSettings['g_cAscCoAuthoringUrl'];
......
...@@ -862,30 +862,27 @@ asc_docs_api.prototype.Init = function() ...@@ -862,30 +862,27 @@ asc_docs_api.prototype.Init = function()
{ {
this.WordControl.Init(); this.WordControl.Init();
}; };
asc_docs_api.prototype.asc_getEditorPermissions = function() asc_docs_api.prototype.asc_getEditorPermissions = function() {
{ if (undefined != window['qtDocBridge']) {
if (undefined != window['qtDocBridge'])
{
// set permissions // set permissions
//var asc_CAscEditorPermissions = window["Asc"].asc_CAscEditorPermissions; //var asc_CAscEditorPermissions = window["Asc"].asc_CAscEditorPermissions;
//editor.asc_fireCallback("asc_onGetEditorPermissions", new asc_CAscEditorPermissions()); //editor.asc_fireCallback("asc_onGetEditorPermissions", new asc_CAscEditorPermissions());
} } else {
else
{
if (this.DocInfo && this.DocInfo.get_Id()) { if (this.DocInfo && this.DocInfo.get_Id()) {
var rData = { var rData = {
"c" : "getsettings", "c": "getsettings",
"id" : this.DocInfo.get_Id(), "id": this.DocInfo.get_Id(),
"userid" : this.DocInfo.get_UserId(), "userid": this.DocInfo.get_UserId(),
"format" : this.DocInfo.get_Format(), "format": this.DocInfo.get_Format(),
"vkey" : this.DocInfo.get_VKey(), "vkey": this.DocInfo.get_VKey(),
"editorid" : c_oEditorId.Word "editorid": c_oEditorId.Word
}; };
sendCommand( this, this.asc_getEditorPermissionsCallback, rData ); var t = this;
sendCommand(this, function (response) {t.asc_getEditorPermissionsCallback(response);}, rData);
} else { } else {
var asc_CAscEditorPermissions = window["Asc"].asc_CAscEditorPermissions; var asc_CAscEditorPermissions = window["Asc"].asc_CAscEditorPermissions;
editor.asc_fireCallback("asc_onGetEditorPermissions", new asc_CAscEditorPermissions()); editor.asc_fireCallback("asc_onGetEditorPermissions", new asc_CAscEditorPermissions());
} }
} }
}; };
...@@ -906,9 +903,9 @@ asc_docs_api.prototype.asc_getLicense = function () ...@@ -906,9 +903,9 @@ asc_docs_api.prototype.asc_getLicense = function ()
} }
}; };
asc_docs_api.prototype.asc_getEditorPermissionsCallback = function(incomeObject) { asc_docs_api.prototype.asc_getEditorPermissionsCallback = function(response) {
if (null != incomeObject && "getsettings" == incomeObject["type"]) { if (null != response && "getsettings" == response["type"]) {
var oSettings = JSON.parse(incomeObject["data"]); var oSettings = JSON.parse(response["data"]);
//Set up coauthoring and spellcheker service //Set up coauthoring and spellcheker service
window.g_cAscCoAuthoringUrl = oSettings['g_cAscCoAuthoringUrl']; window.g_cAscCoAuthoringUrl = oSettings['g_cAscCoAuthoringUrl'];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment