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 @@
"../../Common/Build/License.js",
"../../Common/browser.js",
"../../Common/docscoapisettings.js",
"../../Common/docscoapicommon.js",
"../../Common/docscoapi.js",
"../../Common/apiCommon.js",
"../../Common/spellcheckapisettings.js",
"../../Common/spellcheckapi.js",
"../../Common/wordcopypaste.js",
"../../Common/spellCheckLanguage.js",
......
......@@ -16,7 +16,6 @@
"src": [
"../../Common/Build/License.js",
"../../Common/browser.js",
"../../Common/docscoapisettings.js",
"../../Common/docscoapicommon.js",
"../../Common/docscoapi.js",
"../../Common/downloaderfiles.js",
......
......@@ -34,7 +34,6 @@
"../../Common/downloaderfiles.js",
"../../Common/docscoapicommon.js",
"../../Common/docscoapi.js",
"../../Common/docscoapisettings.js",
"../../Common/wordcopypaste.js",
"../../Common/editorscommon.js",
"../../PowerPoint/Drawing/ThemeLoader.js",
......
......@@ -22,11 +22,9 @@
"src": [
"../../Common/Build/License.js",
"../../Common/browser.js",
"../../Common/docscoapisettings.js",
"../../Common/docscoapicommon.js",
"../../Common/docscoapi.js",
"../../Common/apiCommon.js",
"../../Common/spellcheckapisettings.js",
"../../Common/spellcheckapi.js",
"../../Common/wordcopypaste.js",
"../../Common/spellCheckLanguage.js",
......@@ -216,12 +214,13 @@
"src": "document/**",
"dest": "<%= pkg.menu_path %>/Word/"
},
"docscoapisettings": {
"apisettings": {
"expand": true,
"cwd": "../../Common/",
"src": [
"AllFonts.js",
"docscoapisettings.js",
"spellcheckapisettings.js",
"commonDefines.js",
"apiCommon.js",
"downloaderfiles.js",
......
......@@ -100,6 +100,9 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
this.isCoAuthoringEnable = true;
this.isDocumentCanSave = false; // Флаг, говорит о возможности сохранять документ (активна кнопка save или нет)
this.CoAuthoringUrl = ''; // Ссылка сервиса для совместного редактирования
this.SpellCheckUrl = ''; // Ссылка сервиса для проверки орфографии
this.VersionHistory = null; // Объект, который отвечает за точку в списке версий
// AutoSave
......@@ -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);
} else {
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";
var oSettings = JSON.parse(response.data);
//Set up coauthoring and spellcheker service
window.g_cAscCoAuthoringUrl = oSettings['g_cAscCoAuthoringUrl'];
window.g_cAscSpellCheckUrl = oSettings['g_cAscSpellCheckUrl'];
this.CoAuthoringUrl = oSettings['g_cAscCoAuthoringUrl'];
this.SpellCheckUrl = oSettings['g_cAscSpellCheckUrl'];
var oEditorPermissions = new asc_CAscEditorPermissions(oSettings);
......@@ -1511,23 +1517,17 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
spreadsheet_api.prototype._coAuthoringInit = function() {
var t = this;
if (undefined !== window['g_cAscCoAuthoringUrl'])
window.g_cAscCoAuthoringUrl = window['g_cAscCoAuthoringUrl'];
if (undefined !== window.g_cAscCoAuthoringUrl) {
//Turn off CoAuthoring feature if it disabled
if(!t.isCoAuthoringEnable)
window.g_cAscCoAuthoringUrl = "";
if (this.CoAuthoringUrl && this.isCoAuthoringEnable) {
// Если есть в настройках сервер, то выставляем его для соединения
t._coAuthoringSetServerUrl(window.g_cAscCoAuthoringUrl);
this._coAuthoringSetServerUrl(this.CoAuthoringUrl);
}
//Если User не задан, отключаем коавторинг.
if (null == t.User || null == t.User.asc_getId()) {
t.User = new asc.asc_CUser();
t.User.asc_setId("Unknown");
t.User.asc_setUserName("Unknown");
t._coAuthoringSetServerUrl("");
if (null == this.User || null == this.User.asc_getId()) {
this.User = new asc.asc_CUser();
this.User.asc_setId("Unknown");
this.User.asc_setUserName("Unknown");
this._coAuthoringSetServerUrl("");
}
this.collaborativeEditing = new asc_CCollaborativeEditing(/*handlers*/{
......@@ -3593,8 +3593,8 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
asc["editor"] = this;
window.g_cAscCoAuthoringUrl = "";
window.g_cAscSpellCheckUrl = "";
this.CoAuthoringUrl = '';
this.SpellCheckUrl = '';
this.User = new asc.asc_CUser();
this.User.asc_setId("TM");
......
......@@ -131,6 +131,9 @@ function asc_docs_api(name)
this.CoAuthoringApi.isPowerPoint = true;
this.isDocumentCanSave = false; // Флаг, говорит о возможности сохранять документ (активна кнопка save или нет)
this.CoAuthoringUrl = ''; // Ссылка сервиса для совместного редактирования
this.SpellCheckUrl = ''; // Ссылка сервиса для проверки орфографии
this.VersionHistory = null; // Объект, который отвечает за точку в списке версий
/**************************************/
// AutoSave
......@@ -258,15 +261,9 @@ asc_docs_api.prototype._coAuthoringInit = function () {
return; // Error
}
if(undefined !== window['g_cAscCoAuthoringUrl'])
window.g_cAscCoAuthoringUrl = window['g_cAscCoAuthoringUrl'];
if (undefined !== window.g_cAscCoAuthoringUrl) {
//Turn off CoAuthoring feature if it disabled
if(!this.isCoAuthoringEnable)
window.g_cAscCoAuthoringUrl = "";
if (this.CoAuthoringUrl && this.isCoAuthoringEnable)
this._coAuthoringSetServerUrl(this.CoAuthoringUrl);
this._coAuthoringSetServerUrl(window.g_cAscCoAuthoringUrl);
}
if (null == this.User || null == this.User.asc_getId()) {
this.User = new Asc.asc_CUser();
this.User.asc_setId("Unknown");
......@@ -742,7 +739,10 @@ asc_docs_api.prototype.asc_getEditorPermissions = function() {
sendCommand2(function (response) {t.asc_getEditorPermissionsCallback(response);}, _sendCommandCallback, rData);
} else {
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) {
var oSettings = JSON.parse(response["data"]);
//Set up coauthoring and spellcheker service
window.g_cAscCoAuthoringUrl = oSettings['g_cAscCoAuthoringUrl'];
window.g_cAscSpellCheckUrl = oSettings['g_cAscSpellCheckUrl'];
this.CoAuthoringUrl = oSettings['g_cAscCoAuthoringUrl'];
this.SpellCheckUrl = oSettings['g_cAscSpellCheckUrl'];
var asc_CAscEditorPermissions = window["Asc"].asc_CAscEditorPermissions;
var oEditorPermissions = new asc_CAscEditorPermissions(oSettings);
......@@ -839,8 +839,6 @@ asc_docs_api.prototype.LoadDocument = function(c_DocInfo)
{
window["AscDesktopEditor"]["SetDocumentName"](this.DocumentName);
}
var oThis = this;
if (this.DocInfo.get_OfflineApp() === true)
{
......@@ -848,8 +846,7 @@ asc_docs_api.prototype.LoadDocument = function(c_DocInfo)
return;
}
if (documentId)
{
if (documentId) {
this.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.Open);
var rData = {
"id" : documentId,
......@@ -868,7 +865,8 @@ asc_docs_api.prototype.LoadDocument = function(c_DocInfo)
}
else
{
documentUrl = "document/";
// ToDo убрать зависимость от this.FontLoader.fontFilesPath
documentUrl = this.FontLoader.fontFilesPath + "../PowerPoint/document/";
this.DocInfo.put_OfflineApp(true);
// For test create unique id
......@@ -5277,8 +5275,8 @@ window["asc_docs_api"].prototype["asc_nativeOpenFile"] = function(base64File, ve
{
this.DocumentUrl = "TeamlabNative";
window.g_cAscCoAuthoringUrl = "";
window.g_cAscSpellCheckUrl = "";
this.CoAuthoringUrl = '';
this.SpellCheckUrl = '';
this.User = new Asc.asc_CUser();
this.User.asc_setId("TM");
......
......@@ -424,6 +424,9 @@ function asc_docs_api(name)
// Spell Checking
this.SpellCheckApi = (window["AscDesktopEditor"] === undefined) ? new CSpellCheckApi() : new CSpellCheckApi_desktop();
this.isSpellCheckEnable = true;
this.CoAuthoringUrl = ''; // Ссылка сервиса для совместного редактирования
this.SpellCheckUrl = ''; // Ссылка сервиса для проверки орфографии
// Chart
this.chartTranslate = new asc_CChartTranslate();
......@@ -758,7 +761,10 @@ asc_docs_api.prototype.asc_getEditorPermissions = function() {
sendCommand2(function (response) {t.asc_getEditorPermissionsCallback(response);}, _sendCommandCallback, rData);
} else {
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) {
var oSettings = JSON.parse(response["data"]);
//Set up coauthoring and spellcheker service
window.g_cAscCoAuthoringUrl = oSettings['g_cAscCoAuthoringUrl'];
window.g_cAscSpellCheckUrl = oSettings['g_cAscSpellCheckUrl'];
this.CoAuthoringUrl = oSettings['g_cAscCoAuthoringUrl'];
this.SpellCheckUrl = oSettings['g_cAscSpellCheckUrl'];
var asc_CAscEditorPermissions = window["Asc"].asc_CAscEditorPermissions;
var oEditorPermissions = new asc_CAscEditorPermissions(oSettings);
......@@ -882,8 +888,6 @@ asc_docs_api.prototype.LoadDocument = function(c_DocInfo)
window["AscDesktopEditor"]["SetDocumentName"](this.DocumentName);
}
var oThis = this;
if (this.DocInfo.get_OfflineApp() === true)
{
this.OfflineAppDocumentStartLoad();
......@@ -1346,15 +1350,9 @@ asc_docs_api.prototype._coAuthoringInit = function()
return; // Error
}
if (undefined !== window['g_cAscCoAuthoringUrl'])
window.g_cAscCoAuthoringUrl = window['g_cAscCoAuthoringUrl'];
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);
}
if (this.CoAuthoringUrl && this.isCoAuthoringEnable)
this.CoAuthoringApi.set_url(this.CoAuthoringUrl);
//Если User не задан, отключаем коавторинг.
if (null == this.User || null == this.User.asc_getId()) {
this.User = new Asc.asc_CUser();
......@@ -1564,19 +1562,10 @@ asc_docs_api.prototype._coSpellCheckInit = function() {
if (!this.SpellCheckApi) {
return; // Error
}
if(undefined !== window['g_cAscSpellCheckUrl'])
window.g_cAscSpellCheckUrl = window['g_cAscSpellCheckUrl'];
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);
}
if (!window["AscDesktopEditor"]) {
if (this.SpellCheckUrl && this.isSpellCheckEnable)
this.SpellCheckApi.set_url(this.SpellCheckUrl);
this.SpellCheckApi.onSpellCheck = function (e) {
var incomeObject = JSON.parse(e);
......@@ -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() {
......@@ -7512,8 +7501,8 @@ window["asc_docs_api"].prototype["asc_nativeOpenFile"] = function(base64File, ve
{
this.DocumentUrl = "TeamlabNative";
window.g_cAscCoAuthoringUrl = "";
window.g_cAscSpellCheckUrl = "";
this.CoAuthoringUrl = '';
this.SpellCheckUrl = '';
this.User = new Asc.asc_CUser();
this.User.asc_setId("TM");
......
......@@ -115,10 +115,6 @@
<script type="text/javascript" src="../../OfficeWeb/Common/Shapes/Serialize.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>
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/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