Commit 6c41e9f9 authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

Переделал работу с spellCheckUrl и coAuthoringUrl

Поправил в PP ссылку documentUrl для offline

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@63023 954022d7-b5bf-4e40-9824-e11837661b57
parent b7fa33f3
...@@ -14,11 +14,9 @@ ...@@ -14,11 +14,9 @@
"../../Common/Build/License.js", "../../Common/Build/License.js",
"../../Common/browser.js", "../../Common/browser.js",
"../../Common/docscoapisettings.js",
"../../Common/docscoapicommon.js", "../../Common/docscoapicommon.js",
"../../Common/docscoapi.js", "../../Common/docscoapi.js",
"../../Common/apiCommon.js", "../../Common/apiCommon.js",
"../../Common/spellcheckapisettings.js",
"../../Common/spellcheckapi.js", "../../Common/spellcheckapi.js",
"../../Common/wordcopypaste.js", "../../Common/wordcopypaste.js",
"../../Common/spellCheckLanguage.js", "../../Common/spellCheckLanguage.js",
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
"src": [ "src": [
"../../Common/Build/License.js", "../../Common/Build/License.js",
"../../Common/browser.js", "../../Common/browser.js",
"../../Common/docscoapisettings.js",
"../../Common/docscoapicommon.js", "../../Common/docscoapicommon.js",
"../../Common/docscoapi.js", "../../Common/docscoapi.js",
"../../Common/downloaderfiles.js", "../../Common/downloaderfiles.js",
......
...@@ -34,7 +34,6 @@ ...@@ -34,7 +34,6 @@
"../../Common/downloaderfiles.js", "../../Common/downloaderfiles.js",
"../../Common/docscoapicommon.js", "../../Common/docscoapicommon.js",
"../../Common/docscoapi.js", "../../Common/docscoapi.js",
"../../Common/docscoapisettings.js",
"../../Common/wordcopypaste.js", "../../Common/wordcopypaste.js",
"../../Common/editorscommon.js", "../../Common/editorscommon.js",
"../../PowerPoint/Drawing/ThemeLoader.js", "../../PowerPoint/Drawing/ThemeLoader.js",
......
...@@ -22,11 +22,9 @@ ...@@ -22,11 +22,9 @@
"src": [ "src": [
"../../Common/Build/License.js", "../../Common/Build/License.js",
"../../Common/browser.js", "../../Common/browser.js",
"../../Common/docscoapisettings.js",
"../../Common/docscoapicommon.js", "../../Common/docscoapicommon.js",
"../../Common/docscoapi.js", "../../Common/docscoapi.js",
"../../Common/apiCommon.js", "../../Common/apiCommon.js",
"../../Common/spellcheckapisettings.js",
"../../Common/spellcheckapi.js", "../../Common/spellcheckapi.js",
"../../Common/wordcopypaste.js", "../../Common/wordcopypaste.js",
"../../Common/spellCheckLanguage.js", "../../Common/spellCheckLanguage.js",
...@@ -216,12 +214,13 @@ ...@@ -216,12 +214,13 @@
"src": "document/**", "src": "document/**",
"dest": "<%= pkg.menu_path %>/Word/" "dest": "<%= pkg.menu_path %>/Word/"
}, },
"docscoapisettings": { "apisettings": {
"expand": true, "expand": true,
"cwd": "../../Common/", "cwd": "../../Common/",
"src": [ "src": [
"AllFonts.js", "AllFonts.js",
"docscoapisettings.js", "docscoapisettings.js",
"spellcheckapisettings.js",
"commonDefines.js", "commonDefines.js",
"apiCommon.js", "apiCommon.js",
"downloaderfiles.js", "downloaderfiles.js",
......
...@@ -100,6 +100,9 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -100,6 +100,9 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
this.isCoAuthoringEnable = true; this.isCoAuthoringEnable = true;
this.isDocumentCanSave = false; // Флаг, говорит о возможности сохранять документ (активна кнопка save или нет) this.isDocumentCanSave = false; // Флаг, говорит о возможности сохранять документ (активна кнопка save или нет)
this.CoAuthoringUrl = ''; // Ссылка сервиса для совместного редактирования
this.SpellCheckUrl = ''; // Ссылка сервиса для проверки орфографии
this.VersionHistory = null; // Объект, который отвечает за точку в списке версий this.VersionHistory = null; // Объект, который отвечает за точку в списке версий
// AutoSave // AutoSave
...@@ -600,6 +603,9 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -600,6 +603,9 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
sendCommand2(function (response) {t._onGetEditorPermissions(response);}, this.fCallbackSendCommand, rdata); sendCommand2(function (response) {t._onGetEditorPermissions(response);}, this.fCallbackSendCommand, rdata);
} else { } else {
this.handlers.trigger("asc_onGetEditorPermissions", new asc_CAscEditorPermissions()); this.handlers.trigger("asc_onGetEditorPermissions", new asc_CAscEditorPermissions());
// Фиктивно инициализируем
this.CoAuthoringUrl = window['g_cAscCoAuthoringUrl'] ? window['g_cAscCoAuthoringUrl'] : '';
this.SpellCheckUrl = window['g_cAscSpellCheckUrl'] ? window['g_cAscSpellCheckUrl'] : '';
} }
}; };
...@@ -1438,8 +1444,8 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -1438,8 +1444,8 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
var oSettings = JSON.parse(response.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']; this.CoAuthoringUrl = oSettings['g_cAscCoAuthoringUrl'];
window.g_cAscSpellCheckUrl = oSettings['g_cAscSpellCheckUrl']; this.SpellCheckUrl = oSettings['g_cAscSpellCheckUrl'];
var oEditorPermissions = new asc_CAscEditorPermissions(oSettings); var oEditorPermissions = new asc_CAscEditorPermissions(oSettings);
...@@ -1511,23 +1517,17 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -1511,23 +1517,17 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
spreadsheet_api.prototype._coAuthoringInit = function() { spreadsheet_api.prototype._coAuthoringInit = function() {
var t = this; var t = this;
if (undefined !== window['g_cAscCoAuthoringUrl']) if (this.CoAuthoringUrl && this.isCoAuthoringEnable) {
window.g_cAscCoAuthoringUrl = window['g_cAscCoAuthoringUrl'];
if (undefined !== window.g_cAscCoAuthoringUrl) {
//Turn off CoAuthoring feature if it disabled
if(!t.isCoAuthoringEnable)
window.g_cAscCoAuthoringUrl = "";
// Если есть в настройках сервер, то выставляем его для соединения // Если есть в настройках сервер, то выставляем его для соединения
t._coAuthoringSetServerUrl(window.g_cAscCoAuthoringUrl); this._coAuthoringSetServerUrl(this.CoAuthoringUrl);
} }
//Если User не задан, отключаем коавторинг. //Если User не задан, отключаем коавторинг.
if (null == t.User || null == t.User.asc_getId()) { if (null == this.User || null == this.User.asc_getId()) {
t.User = new asc.asc_CUser(); this.User = new asc.asc_CUser();
t.User.asc_setId("Unknown"); this.User.asc_setId("Unknown");
t.User.asc_setUserName("Unknown"); this.User.asc_setUserName("Unknown");
t._coAuthoringSetServerUrl(""); this._coAuthoringSetServerUrl("");
} }
this.collaborativeEditing = new asc_CCollaborativeEditing(/*handlers*/{ this.collaborativeEditing = new asc_CCollaborativeEditing(/*handlers*/{
...@@ -3593,8 +3593,8 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -3593,8 +3593,8 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
asc["editor"] = this; asc["editor"] = this;
window.g_cAscCoAuthoringUrl = ""; this.CoAuthoringUrl = '';
window.g_cAscSpellCheckUrl = ""; this.SpellCheckUrl = '';
this.User = new asc.asc_CUser(); this.User = new asc.asc_CUser();
this.User.asc_setId("TM"); this.User.asc_setId("TM");
......
...@@ -131,6 +131,9 @@ function asc_docs_api(name) ...@@ -131,6 +131,9 @@ function asc_docs_api(name)
this.CoAuthoringApi.isPowerPoint = true; this.CoAuthoringApi.isPowerPoint = true;
this.isDocumentCanSave = false; // Флаг, говорит о возможности сохранять документ (активна кнопка save или нет) this.isDocumentCanSave = false; // Флаг, говорит о возможности сохранять документ (активна кнопка save или нет)
this.CoAuthoringUrl = ''; // Ссылка сервиса для совместного редактирования
this.SpellCheckUrl = ''; // Ссылка сервиса для проверки орфографии
this.VersionHistory = null; // Объект, который отвечает за точку в списке версий this.VersionHistory = null; // Объект, который отвечает за точку в списке версий
/**************************************/ /**************************************/
// AutoSave // AutoSave
...@@ -258,15 +261,9 @@ asc_docs_api.prototype._coAuthoringInit = function () { ...@@ -258,15 +261,9 @@ asc_docs_api.prototype._coAuthoringInit = function () {
return; // Error return; // Error
} }
if(undefined !== window['g_cAscCoAuthoringUrl']) if (this.CoAuthoringUrl && this.isCoAuthoringEnable)
window.g_cAscCoAuthoringUrl = window['g_cAscCoAuthoringUrl']; this._coAuthoringSetServerUrl(this.CoAuthoringUrl);
if (undefined !== window.g_cAscCoAuthoringUrl) {
//Turn off CoAuthoring feature if it disabled
if(!this.isCoAuthoringEnable)
window.g_cAscCoAuthoringUrl = "";
this._coAuthoringSetServerUrl(window.g_cAscCoAuthoringUrl);
}
if (null == this.User || null == this.User.asc_getId()) { if (null == this.User || null == this.User.asc_getId()) {
this.User = new Asc.asc_CUser(); this.User = new Asc.asc_CUser();
this.User.asc_setId("Unknown"); this.User.asc_setId("Unknown");
...@@ -742,7 +739,10 @@ asc_docs_api.prototype.asc_getEditorPermissions = function() { ...@@ -742,7 +739,10 @@ asc_docs_api.prototype.asc_getEditorPermissions = function() {
sendCommand2(function (response) {t.asc_getEditorPermissionsCallback(response);}, _sendCommandCallback, rData); sendCommand2(function (response) {t.asc_getEditorPermissionsCallback(response);}, _sendCommandCallback, 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()); this.asc_fireCallback("asc_onGetEditorPermissions", new asc_CAscEditorPermissions());
// Фиктивно инициализируем
this.CoAuthoringUrl = window['g_cAscCoAuthoringUrl'] ? window['g_cAscCoAuthoringUrl'] : '';
this.SpellCheckUrl = window['g_cAscSpellCheckUrl'] ? window['g_cAscSpellCheckUrl'] : '';
} }
}; };
...@@ -759,8 +759,8 @@ asc_docs_api.prototype.asc_getEditorPermissionsCallback = function(response) { ...@@ -759,8 +759,8 @@ asc_docs_api.prototype.asc_getEditorPermissionsCallback = function(response) {
var oSettings = JSON.parse(response["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']; this.CoAuthoringUrl = oSettings['g_cAscCoAuthoringUrl'];
window.g_cAscSpellCheckUrl = oSettings['g_cAscSpellCheckUrl']; this.SpellCheckUrl = oSettings['g_cAscSpellCheckUrl'];
var asc_CAscEditorPermissions = window["Asc"].asc_CAscEditorPermissions; var asc_CAscEditorPermissions = window["Asc"].asc_CAscEditorPermissions;
var oEditorPermissions = new asc_CAscEditorPermissions(oSettings); var oEditorPermissions = new asc_CAscEditorPermissions(oSettings);
...@@ -840,16 +840,13 @@ asc_docs_api.prototype.LoadDocument = function(c_DocInfo) ...@@ -840,16 +840,13 @@ asc_docs_api.prototype.LoadDocument = function(c_DocInfo)
window["AscDesktopEditor"]["SetDocumentName"](this.DocumentName); window["AscDesktopEditor"]["SetDocumentName"](this.DocumentName);
} }
var oThis = this;
if (this.DocInfo.get_OfflineApp() === true) if (this.DocInfo.get_OfflineApp() === true)
{ {
this.OfflineAppDocumentStartLoad(); this.OfflineAppDocumentStartLoad();
return; return;
} }
if (documentId) if (documentId) {
{
this.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.Open); this.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.Open);
var rData = { var rData = {
"id" : documentId, "id" : documentId,
...@@ -868,7 +865,8 @@ asc_docs_api.prototype.LoadDocument = function(c_DocInfo) ...@@ -868,7 +865,8 @@ asc_docs_api.prototype.LoadDocument = function(c_DocInfo)
} }
else else
{ {
documentUrl = "document/"; // ToDo убрать зависимость от this.FontLoader.fontFilesPath
documentUrl = this.FontLoader.fontFilesPath + "../PowerPoint/document/";
this.DocInfo.put_OfflineApp(true); this.DocInfo.put_OfflineApp(true);
// For test create unique id // For test create unique id
...@@ -5277,8 +5275,8 @@ window["asc_docs_api"].prototype["asc_nativeOpenFile"] = function(base64File, ve ...@@ -5277,8 +5275,8 @@ window["asc_docs_api"].prototype["asc_nativeOpenFile"] = function(base64File, ve
{ {
this.DocumentUrl = "TeamlabNative"; this.DocumentUrl = "TeamlabNative";
window.g_cAscCoAuthoringUrl = ""; this.CoAuthoringUrl = '';
window.g_cAscSpellCheckUrl = ""; this.SpellCheckUrl = '';
this.User = new Asc.asc_CUser(); this.User = new Asc.asc_CUser();
this.User.asc_setId("TM"); this.User.asc_setId("TM");
......
...@@ -425,6 +425,9 @@ function asc_docs_api(name) ...@@ -425,6 +425,9 @@ function asc_docs_api(name)
this.SpellCheckApi = (window["AscDesktopEditor"] === undefined) ? new CSpellCheckApi() : new CSpellCheckApi_desktop(); this.SpellCheckApi = (window["AscDesktopEditor"] === undefined) ? new CSpellCheckApi() : new CSpellCheckApi_desktop();
this.isSpellCheckEnable = true; this.isSpellCheckEnable = true;
this.CoAuthoringUrl = ''; // Ссылка сервиса для совместного редактирования
this.SpellCheckUrl = ''; // Ссылка сервиса для проверки орфографии
// Chart // Chart
this.chartTranslate = new asc_CChartTranslate(); this.chartTranslate = new asc_CChartTranslate();
...@@ -758,7 +761,10 @@ asc_docs_api.prototype.asc_getEditorPermissions = function() { ...@@ -758,7 +761,10 @@ asc_docs_api.prototype.asc_getEditorPermissions = function() {
sendCommand2(function (response) {t.asc_getEditorPermissionsCallback(response);}, _sendCommandCallback, rData); sendCommand2(function (response) {t.asc_getEditorPermissionsCallback(response);}, _sendCommandCallback, 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()); this.asc_fireCallback("asc_onGetEditorPermissions", new asc_CAscEditorPermissions());
// Фиктивно инициализируем
this.CoAuthoringUrl = window['g_cAscCoAuthoringUrl'] ? window['g_cAscCoAuthoringUrl'] : '';
this.SpellCheckUrl = window['g_cAscSpellCheckUrl'] ? window['g_cAscSpellCheckUrl'] : '';
} }
} }
}; };
...@@ -784,8 +790,8 @@ asc_docs_api.prototype.asc_getEditorPermissionsCallback = function(response) { ...@@ -784,8 +790,8 @@ asc_docs_api.prototype.asc_getEditorPermissionsCallback = function(response) {
var oSettings = JSON.parse(response["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']; this.CoAuthoringUrl = oSettings['g_cAscCoAuthoringUrl'];
window.g_cAscSpellCheckUrl = oSettings['g_cAscSpellCheckUrl']; this.SpellCheckUrl = oSettings['g_cAscSpellCheckUrl'];
var asc_CAscEditorPermissions = window["Asc"].asc_CAscEditorPermissions; var asc_CAscEditorPermissions = window["Asc"].asc_CAscEditorPermissions;
var oEditorPermissions = new asc_CAscEditorPermissions(oSettings); var oEditorPermissions = new asc_CAscEditorPermissions(oSettings);
...@@ -882,8 +888,6 @@ asc_docs_api.prototype.LoadDocument = function(c_DocInfo) ...@@ -882,8 +888,6 @@ asc_docs_api.prototype.LoadDocument = function(c_DocInfo)
window["AscDesktopEditor"]["SetDocumentName"](this.DocumentName); window["AscDesktopEditor"]["SetDocumentName"](this.DocumentName);
} }
var oThis = this;
if (this.DocInfo.get_OfflineApp() === true) if (this.DocInfo.get_OfflineApp() === true)
{ {
this.OfflineAppDocumentStartLoad(); this.OfflineAppDocumentStartLoad();
...@@ -1346,15 +1350,9 @@ asc_docs_api.prototype._coAuthoringInit = function() ...@@ -1346,15 +1350,9 @@ asc_docs_api.prototype._coAuthoringInit = function()
return; // Error return; // Error
} }
if (undefined !== window['g_cAscCoAuthoringUrl']) if (this.CoAuthoringUrl && this.isCoAuthoringEnable)
window.g_cAscCoAuthoringUrl = window['g_cAscCoAuthoringUrl']; this.CoAuthoringApi.set_url(this.CoAuthoringUrl);
if (undefined !== window.g_cAscCoAuthoringUrl) {
//Turn off CoAuthoring feature if it disabled
if (!this.isCoAuthoringEnable)
window.g_cAscCoAuthoringUrl = "";
this.CoAuthoringApi.set_url(window.g_cAscCoAuthoringUrl);
}
//Если User не задан, отключаем коавторинг. //Если User не задан, отключаем коавторинг.
if (null == this.User || null == this.User.asc_getId()) { if (null == this.User || null == this.User.asc_getId()) {
this.User = new Asc.asc_CUser(); this.User = new Asc.asc_CUser();
...@@ -1565,18 +1563,9 @@ asc_docs_api.prototype._coSpellCheckInit = function() { ...@@ -1565,18 +1563,9 @@ asc_docs_api.prototype._coSpellCheckInit = function() {
return; // Error return; // Error
} }
if(undefined !== window['g_cAscSpellCheckUrl']) if (!window["AscDesktopEditor"]) {
window.g_cAscSpellCheckUrl = window['g_cAscSpellCheckUrl']; if (this.SpellCheckUrl && this.isSpellCheckEnable)
this.SpellCheckApi.set_url(this.SpellCheckUrl);
if (undefined === window["AscDesktopEditor"])
{
if(undefined !== window.g_cAscSpellCheckUrl) {
//Turn off SpellCheck feature if it disabled
if(!this.isSpellCheckEnable)
window.g_cAscSpellCheckUrl = "";
this.SpellCheckApi.set_url(window.g_cAscSpellCheckUrl);
}
this.SpellCheckApi.onSpellCheck = function (e) { this.SpellCheckApi.onSpellCheck = function (e) {
var incomeObject = JSON.parse(e); var incomeObject = JSON.parse(e);
...@@ -1584,7 +1573,7 @@ asc_docs_api.prototype._coSpellCheckInit = function() { ...@@ -1584,7 +1573,7 @@ asc_docs_api.prototype._coSpellCheckInit = function() {
}; };
} }
this.SpellCheckApi.init (documentId); this.SpellCheckApi.init(documentId);
}; };
asc_docs_api.prototype.asc_getSpellCheckLanguages = function() { asc_docs_api.prototype.asc_getSpellCheckLanguages = function() {
...@@ -7512,8 +7501,8 @@ window["asc_docs_api"].prototype["asc_nativeOpenFile"] = function(base64File, ve ...@@ -7512,8 +7501,8 @@ window["asc_docs_api"].prototype["asc_nativeOpenFile"] = function(base64File, ve
{ {
this.DocumentUrl = "TeamlabNative"; this.DocumentUrl = "TeamlabNative";
window.g_cAscCoAuthoringUrl = ""; this.CoAuthoringUrl = '';
window.g_cAscSpellCheckUrl = ""; this.SpellCheckUrl = '';
this.User = new Asc.asc_CUser(); this.User = new Asc.asc_CUser();
this.User.asc_setId("TM"); this.User.asc_setId("TM");
......
...@@ -116,10 +116,6 @@ ...@@ -116,10 +116,6 @@
<script type="text/javascript" src="../../OfficeWeb/Common/Shapes/SerializeWriter.js"></script> <script type="text/javascript" src="../../OfficeWeb/Common/Shapes/SerializeWriter.js"></script>
<script type="text/javascript" src="../../OfficeWeb/Word/Editor/SerializeCommon.js"></script> <script type="text/javascript" src="../../OfficeWeb/Word/Editor/SerializeCommon.js"></script>
<script>
window.g_cAscCoAuthoringUrl = "http://192.168.3.213:3000";
</script>
<script type="text/javascript" src="../../OfficeWeb/Common/docscoapisettings.js"></script> <script type="text/javascript" src="../../OfficeWeb/Common/docscoapisettings.js"></script>
<script type="text/javascript" src="../../OfficeWeb/Common/spellcheckapisettings.js"></script> <script type="text/javascript" src="../../OfficeWeb/Common/spellcheckapisettings.js"></script>
......
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