Commit d4bf4634 authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

documentUrl в base

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@66370 954022d7-b5bf-4e40-9824-e11837661b57
parent 1504ca52
...@@ -20,6 +20,7 @@ function baseEditorsApi(name) { ...@@ -20,6 +20,7 @@ function baseEditorsApi(name) {
this.DocumentType = 0; // 0 - empty, 1 - test, 2 - document (from json) this.DocumentType = 0; // 0 - empty, 1 - test, 2 - document (from json)
this.DocInfo = null; this.DocInfo = null;
this.documentId = undefined; this.documentId = undefined;
this.documentUrl = "null";
// Тип состояния на данный момент (сохранение, открытие или никакое) // Тип состояния на данный момент (сохранение, открытие или никакое)
this.advancedOptionsAction = c_oAscAdvancedOptionsAction.None; this.advancedOptionsAction = c_oAscAdvancedOptionsAction.None;
......
...@@ -44,7 +44,6 @@ var editor; ...@@ -44,7 +44,6 @@ var editor;
this.DocumentName = ""; this.DocumentName = "";
this.documentUserId = undefined; this.documentUserId = undefined;
this.documentUrl = "null";
this.documentUrlChanges = null; this.documentUrlChanges = null;
this.documentTitle = "null"; this.documentTitle = "null";
this.documentFormat = "null"; this.documentFormat = "null";
......
"use strict"; "use strict";
var documentUserId = undefined; var documentUserId = undefined;
var documentUrl = 'null';
var documentUrlChanges = null; var documentUrlChanges = null;
var documentTitle = 'null'; var documentTitle = 'null';
var documentTitleWithoutExtention = 'null'; var documentTitleWithoutExtention = 'null';
...@@ -468,7 +467,7 @@ asc_docs_api.prototype._coAuthoringInit = function() { ...@@ -468,7 +467,7 @@ asc_docs_api.prototype._coAuthoringInit = function() {
//в обычном серверном режиме портим ссылку, потому что CoAuthoring теперь имеет встроенный адрес //в обычном серверном режиме портим ссылку, потому что CoAuthoring теперь имеет встроенный адрес
//todo надо использовать проверку get_OfflineApp, но она инициализируется только после loadDocument //todo надо использовать проверку get_OfflineApp, но она инициализируется только после loadDocument
if (!(window["NATIVE_EDITOR_ENJINE"] || offlineMode === documentUrl)) { if (!(window["NATIVE_EDITOR_ENJINE"] || offlineMode === this.documentUrl)) {
this.CoAuthoringApi.set_url(null); this.CoAuthoringApi.set_url(null);
} }
this.CoAuthoringApi.init(this.User, this.documentId, documentCallbackUrl, 'fghhfgsjdgfjs', c_oEditorId.Presentation, documentFormatSave); this.CoAuthoringApi.init(this.User, this.documentId, documentCallbackUrl, 'fghhfgsjdgfjs', c_oEditorId.Presentation, documentFormatSave);
...@@ -648,7 +647,7 @@ asc_docs_api.prototype.asc_setDocInfo = function(c_DocInfo) { ...@@ -648,7 +647,7 @@ asc_docs_api.prototype.asc_setDocInfo = function(c_DocInfo) {
if (this.DocInfo) { if (this.DocInfo) {
this.documentId = this.DocInfo.get_Id(); this.documentId = this.DocInfo.get_Id();
documentUserId = this.DocInfo.get_UserId(); documentUserId = this.DocInfo.get_UserId();
documentUrl = this.DocInfo.get_Url(); this.documentUrl = this.DocInfo.get_Url();
documentTitle = this.DocInfo.get_Title(); documentTitle = this.DocInfo.get_Title();
documentFormat = this.DocInfo.get_Format(); documentFormat = this.DocInfo.get_Format();
documentCallbackUrl = this.DocInfo.get_CallbackUrl(); documentCallbackUrl = this.DocInfo.get_CallbackUrl();
...@@ -686,7 +685,7 @@ asc_docs_api.prototype.LoadDocument = function() { ...@@ -686,7 +685,7 @@ asc_docs_api.prototype.LoadDocument = function() {
// Меняем тип состояния (на открытие) // Меняем тип состояния (на открытие)
this.advancedOptionsAction = c_oAscAdvancedOptionsAction.Open; this.advancedOptionsAction = c_oAscAdvancedOptionsAction.Open;
if (offlineMode !== documentUrl) { if (offlineMode !== this.documentUrl) {
this.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.Open); this.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.Open);
var rData = { var rData = {
"id": this.documentId, "id": this.documentId,
...@@ -695,7 +694,7 @@ asc_docs_api.prototype.LoadDocument = function() { ...@@ -695,7 +694,7 @@ asc_docs_api.prototype.LoadDocument = function() {
"vkey": documentVKey, "vkey": documentVKey,
"editorid": c_oEditorId.Presentation, "editorid": c_oEditorId.Presentation,
"c": "open", "c": "open",
"url": documentUrl, "url": this.documentUrl,
"title": documentTitle, "title": documentTitle,
"embeddedfonts": this.isUseEmbeddedCutFonts, "embeddedfonts": this.isUseEmbeddedCutFonts,
"viewmode": this.isViewMode "viewmode": this.isViewMode
...@@ -704,7 +703,7 @@ asc_docs_api.prototype.LoadDocument = function() { ...@@ -704,7 +703,7 @@ asc_docs_api.prototype.LoadDocument = function() {
sendCommand2(this, null, rData); sendCommand2(this, null, rData);
} else { } else {
// ToDo убрать зависимость от this.FontLoader.fontFilesPath // ToDo убрать зависимость от this.FontLoader.fontFilesPath
documentUrl = this.FontLoader.fontFilesPath + "../PowerPoint/document/"; this.documentUrl = this.FontLoader.fontFilesPath + "../PowerPoint/document/";
this.DocInfo.put_OfflineApp(true); this.DocInfo.put_OfflineApp(true);
this._OfflineAppDocumentStartLoad(); this._OfflineAppDocumentStartLoad();
...@@ -905,7 +904,7 @@ asc_docs_api.prototype._OfflineAppDocumentStartLoad = function() { ...@@ -905,7 +904,7 @@ asc_docs_api.prototype._OfflineAppDocumentStartLoad = function() {
t._OfflineAppDocumentEndLoad(); t._OfflineAppDocumentEndLoad();
}; };
scriptElem.setAttribute('src', documentUrl + "editor.js"); scriptElem.setAttribute('src', this.documentUrl + "editor.js");
scriptElem.setAttribute('type', 'text/javascript'); scriptElem.setAttribute('type', 'text/javascript');
document.getElementsByTagName('head')[0].appendChild(scriptElem); document.getElementsByTagName('head')[0].appendChild(scriptElem);
}; };
...@@ -914,7 +913,7 @@ asc_docs_api.prototype._OfflineAppDocumentEndLoad = function() { ...@@ -914,7 +913,7 @@ asc_docs_api.prototype._OfflineAppDocumentEndLoad = function() {
if (undefined == window["editor_bin"]) if (undefined == window["editor_bin"])
return; return;
this.OpenDocument2(documentUrl, window["editor_bin"]); this.OpenDocument2(this.documentUrl, window["editor_bin"]);
//callback //callback
this.DocumentOrientation = (null == this.WordControl.m_oLogicDocument) ? true : !this.WordControl.m_oLogicDocument.Orientation; this.DocumentOrientation = (null == this.WordControl.m_oLogicDocument) ? true : !this.WordControl.m_oLogicDocument.Orientation;
}; };
...@@ -3625,7 +3624,7 @@ asc_docs_api.prototype.asyncFontsDocumentStartLoaded = function() ...@@ -3625,7 +3624,7 @@ asc_docs_api.prototype.asyncFontsDocumentStartLoaded = function()
for (var i in _loader_object.ImageMap) { for (var i in _loader_object.ImageMap) {
if(this.DocInfo.get_OfflineApp()) { if(this.DocInfo.get_OfflineApp()) {
var localUrl = _loader_object.ImageMap[i]; var localUrl = _loader_object.ImageMap[i];
g_oDocumentUrls.addImageUrl(localUrl, documentUrl + 'media/' + localUrl); g_oDocumentUrls.addImageUrl(localUrl, this.documentUrl + 'media/' + localUrl);
} }
++_count; ++_count;
} }
......
...@@ -14,8 +14,6 @@ asc_docs_api.prototype.asc_SetTrackRevisions = function(bTrack) ...@@ -14,8 +14,6 @@ asc_docs_api.prototype.asc_SetTrackRevisions = function(bTrack)
}; };
asc_docs_api.prototype.asc_IsTrackRevisions = function() asc_docs_api.prototype.asc_IsTrackRevisions = function()
{ {
if (this.isViewMode)
return false;
return this.WordControl.m_oLogicDocument.Is_TrackRevisions(); return this.WordControl.m_oLogicDocument.Is_TrackRevisions();
}; };
asc_docs_api.prototype.sync_BeginCatchRevisionsChanges = function() asc_docs_api.prototype.sync_BeginCatchRevisionsChanges = function()
......
"use strict"; "use strict";
var documentUserId = undefined; var documentUserId = undefined;
var documentUrl = 'null';
var documentUrlChanges = null; var documentUrlChanges = null;
var documentTitle = 'null'; var documentTitle = 'null';
var documentTitleWithoutExtention = 'null'; var documentTitleWithoutExtention = 'null';
...@@ -579,7 +578,7 @@ asc_docs_api.prototype.asc_setDocInfo = function(c_DocInfo) { ...@@ -579,7 +578,7 @@ asc_docs_api.prototype.asc_setDocInfo = function(c_DocInfo) {
if (this.DocInfo) { if (this.DocInfo) {
this.documentId = this.DocInfo.get_Id(); this.documentId = this.DocInfo.get_Id();
documentUserId = this.DocInfo.get_UserId(); documentUserId = this.DocInfo.get_UserId();
documentUrl = this.DocInfo.get_Url(); this.documentUrl = this.DocInfo.get_Url();
documentTitle = this.DocInfo.get_Title(); documentTitle = this.DocInfo.get_Title();
documentFormat = this.DocInfo.get_Format(); documentFormat = this.DocInfo.get_Format();
documentCallbackUrl = this.DocInfo.get_CallbackUrl(); documentCallbackUrl = this.DocInfo.get_CallbackUrl();
...@@ -619,7 +618,7 @@ asc_docs_api.prototype.LoadDocument = function(isVersionHistory) { ...@@ -619,7 +618,7 @@ asc_docs_api.prototype.LoadDocument = function(isVersionHistory) {
// Меняем тип состояния (на открытие) // Меняем тип состояния (на открытие)
this.advancedOptionsAction = c_oAscAdvancedOptionsAction.Open; this.advancedOptionsAction = c_oAscAdvancedOptionsAction.Open;
if (offlineMode !== documentUrl) { if (offlineMode !== this.documentUrl) {
var rData = { var rData = {
"c": 'open', "c": 'open',
"id": this.documentId, "id": this.documentId,
...@@ -627,7 +626,7 @@ asc_docs_api.prototype.LoadDocument = function(isVersionHistory) { ...@@ -627,7 +626,7 @@ asc_docs_api.prototype.LoadDocument = function(isVersionHistory) {
"format": documentFormat, "format": documentFormat,
"vkey": documentVKey, "vkey": documentVKey,
"editorid": c_oEditorId.Word, "editorid": c_oEditorId.Word,
"url": documentUrl, "url": this.documentUrl,
"title": documentTitle, "title": documentTitle,
"embeddedfonts": this.isUseEmbeddedCutFonts, "embeddedfonts": this.isUseEmbeddedCutFonts,
"viewmode": this.isViewMode "viewmode": this.isViewMode
...@@ -641,7 +640,7 @@ asc_docs_api.prototype.LoadDocument = function(isVersionHistory) { ...@@ -641,7 +640,7 @@ asc_docs_api.prototype.LoadDocument = function(isVersionHistory) {
sendCommand2(this, null, rData); sendCommand2(this, null, rData);
} else { } else {
// ToDo убрать зависимость от this.FontLoader.fontFilesPath // ToDo убрать зависимость от this.FontLoader.fontFilesPath
documentUrl = this.FontLoader.fontFilesPath + "../Word/document/"; this.documentUrl = this.FontLoader.fontFilesPath + "../Word/document/";
this.DocInfo.put_OfflineApp(true); this.DocInfo.put_OfflineApp(true);
this._OfflineAppDocumentStartLoad(); this._OfflineAppDocumentStartLoad();
...@@ -1233,7 +1232,7 @@ asc_docs_api.prototype._coAuthoringInit = function() { ...@@ -1233,7 +1232,7 @@ asc_docs_api.prototype._coAuthoringInit = function() {
}; };
//в обычном серверном режиме портим ссылку, потому что CoAuthoring теперь имеет встроенный адрес //в обычном серверном режиме портим ссылку, потому что CoAuthoring теперь имеет встроенный адрес
//todo надо использовать проверку get_OfflineApp, но она инициализируется только после loadDocument //todo надо использовать проверку get_OfflineApp, но она инициализируется только после loadDocument
if (!(window["NATIVE_EDITOR_ENJINE"] || offlineMode === documentUrl)) { if (!(window["NATIVE_EDITOR_ENJINE"] || offlineMode === this.documentUrl)) {
this.CoAuthoringApi.set_url(null); this.CoAuthoringApi.set_url(null);
} }
this.CoAuthoringApi.init(this.User, this.documentId, documentCallbackUrl, 'fghhfgsjdgfjs', c_oEditorId.Word, documentFormatSave); this.CoAuthoringApi.init(this.User, this.documentId, documentCallbackUrl, 'fghhfgsjdgfjs', c_oEditorId.Word, documentFormatSave);
...@@ -2134,7 +2133,7 @@ asc_docs_api.prototype.asc_setAdvancedOptions = function(idOption, option) { ...@@ -2134,7 +2133,7 @@ asc_docs_api.prototype.asc_setAdvancedOptions = function(idOption, option) {
"vkey": documentVKey, "vkey": documentVKey,
"editorid": c_oEditorId.Word, "editorid": c_oEditorId.Word,
"c":"reopen", "c":"reopen",
"url": documentUrl, "url": this.documentUrl,
"title": documentTitle, "title": documentTitle,
"codepage": option.asc_getCodePage(), "codepage": option.asc_getCodePage(),
"embeddedfonts": t.isUseEmbeddedCutFonts "embeddedfonts": t.isUseEmbeddedCutFonts
...@@ -5505,7 +5504,7 @@ asc_docs_api.prototype.asyncFontsDocumentStartLoaded = function() ...@@ -5505,7 +5504,7 @@ asc_docs_api.prototype.asyncFontsDocumentStartLoaded = function()
for (var i in _loader_object.ImageMap) { for (var i in _loader_object.ImageMap) {
if(this.DocInfo.get_OfflineApp()) { if(this.DocInfo.get_OfflineApp()) {
var localUrl = _loader_object.ImageMap[i]; var localUrl = _loader_object.ImageMap[i];
g_oDocumentUrls.addImageUrl(localUrl, documentUrl + 'media/' + localUrl); g_oDocumentUrls.addImageUrl(localUrl, this.documentUrl + 'media/' + localUrl);
} }
++_count; ++_count;
} }
...@@ -6513,7 +6512,7 @@ asc_docs_api.prototype._OfflineAppDocumentStartLoad = function() { ...@@ -6513,7 +6512,7 @@ asc_docs_api.prototype._OfflineAppDocumentStartLoad = function() {
t._OfflineAppDocumentEndLoad(); t._OfflineAppDocumentEndLoad();
}; };
scriptElem.setAttribute('src', documentUrl + "editor.js"); scriptElem.setAttribute('src', this.documentUrl + "editor.js");
scriptElem.setAttribute('type', 'text/javascript'); scriptElem.setAttribute('type', 'text/javascript');
document.getElementsByTagName('head')[0].appendChild(scriptElem); document.getElementsByTagName('head')[0].appendChild(scriptElem);
}; };
...@@ -6527,9 +6526,9 @@ asc_docs_api.prototype._OfflineAppDocumentEndLoad = function() { ...@@ -6527,9 +6526,9 @@ asc_docs_api.prototype._OfflineAppDocumentEndLoad = function() {
} }
if (bIsViewer) { if (bIsViewer) {
this.OpenDocument(documentUrl, sData); this.OpenDocument(this.documentUrl, sData);
} else { } else {
this.OpenDocument2(documentUrl, sData); this.OpenDocument2(this.documentUrl, sData);
} }
}; };
......
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