Commit 2a4bfed2 authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

Переделал определение режима offline. Для этого url-нужно передать _offline_

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@66154 954022d7-b5bf-4e40-9824-e11837661b57
parent 386e6b5a
......@@ -738,4 +738,6 @@ var changestype_2_Element_and_Type = 4; // Проверяем возмож
var changestype_2_ElementsArray_and_Type = 5; // Аналогично предыдущему, только идет массив элементов
var contentchanges_Add = 1;
var contentchanges_Remove = 2;
\ No newline at end of file
var contentchanges_Remove = 2;
var offlineMode = '_offline_';
\ No newline at end of file
......@@ -849,11 +849,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
// Меняем тип состояния (на открытие)
this.advancedOptionsAction = c_oAscAdvancedOptionsAction.Open;
if (!this.documentId || !this.documentUrl) {
// Назначим id-сами, если он не пришел (для открытия тестового документа)
if (!this.documentId) {
this.documentId = '9876543210';
}
if (offlineMode === this.documentUrl) {
this.DocInfo.asc_putOfflineApp(true);
this._OfflineAppDocumentStartLoad(fCallback);
} else {
......
......@@ -549,8 +549,8 @@
var c_DocInfo;
if (!offLineApp) {
c_DocInfo = {
"Id" : getURLParameter("key") ? decodeURIComponent(getURLParameter("key")) : "9876543210",
"Url" : getURLParameter("url") ? decodeURIComponent(getURLParameter("url")) : undefined,
"Id" : getURLParameter("key") ? decodeURIComponent(getURLParameter("key")) : "test_spreadsheet_id",
"Url" : getURLParameter("url") ? decodeURIComponent(getURLParameter("url")) : '_offline_',
"Title" : getURLParameter("title") ? decodeURIComponent(getURLParameter("title")).replace(new RegExp("\\+",'g')," ") : undefined,
"Format" : getURLParameter("filetype") ? decodeURIComponent(getURLParameter("filetype")) : undefined,
"VKey" : getURLParameter("vkey") ? decodeURIComponent(getURLParameter("vkey")) : undefined,
......
......@@ -777,7 +777,7 @@ asc_docs_api.prototype.LoadDocument = function() {
// Меняем тип состояния (на открытие)
this.advancedOptionsAction = c_oAscAdvancedOptionsAction.Open;
if (documentId) {
if (offlineMode !== documentUrl) {
this.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.Open);
var rData = {
"id": documentId,
......@@ -798,8 +798,6 @@ asc_docs_api.prototype.LoadDocument = function() {
documentUrl = this.FontLoader.fontFilesPath + "../PowerPoint/document/";
this.DocInfo.put_OfflineApp(true);
// For test create unique id
documentId = "test_presentation_id";
this._OfflineAppDocumentStartLoad();
}
this.sync_zoomChangeCallback(this.WordControl.m_nZoomValue, this.WordControl.m_nZoomType);
......
......@@ -3029,18 +3029,13 @@ $(document).ready(function(){
var sProtocol = window.location.protocol;
var sHost = window.location.host;
var documentOrigin = "";
if(sProtocol && "" != sProtocol)
documentOrigin = sProtocol + "//" + sHost;
else
documentOrigin = sHost;
var c_DocInfo = new CDocInfo ();
c_DocInfo.put_Id( getURLParameter("key") ?
decodeURIComponent(getURLParameter("key")) :
undefined );
'test_presentation_id' );
c_DocInfo.put_Url( getURLParameter("url") ?
decodeURIComponent(getURLParameter("url")) :
undefined );
'_offline_' );
c_DocInfo.put_Title( getURLParameter("title") ?
decodeURIComponent(getURLParameter("title")).replace(new RegExp("\\+",'g')," ") :
undefined );
......
......@@ -2247,18 +2247,13 @@ $(".colorWatch").mouseover(function(){
});
var sProtocol = window.location.protocol;
var sHost = window.location.host;
var documentOrigin = "";
if(sProtocol && "" != sProtocol)
documentOrigin = sProtocol + "//" + sHost;
else
documentOrigin = sHost;
var c_DocInfo = new CDocInfo ();
c_DocInfo.put_Id( getURLParameter("key") ?
decodeURIComponent(getURLParameter("key")) :
undefined );
'test_presentation_id' );
c_DocInfo.put_Url( getURLParameter("url") ?
decodeURIComponent(getURLParameter("url")) :
undefined );
'_offline_' );
c_DocInfo.put_Title( getURLParameter("title") ?
decodeURIComponent(getURLParameter("title")).replace(new RegExp("\\+",'g')," ") :
undefined );
......
......@@ -716,7 +716,7 @@ asc_docs_api.prototype.LoadDocument = function(isVersionHistory) {
// Меняем тип состояния (на открытие)
this.advancedOptionsAction = c_oAscAdvancedOptionsAction.Open;
if (documentId) {
if (offlineMode !== documentUrl) {
var rData = {
"c": 'open',
"id": documentId,
......@@ -741,8 +741,6 @@ asc_docs_api.prototype.LoadDocument = function(isVersionHistory) {
documentUrl = this.FontLoader.fontFilesPath + "../Word/document/";
this.DocInfo.put_OfflineApp(true);
// For test create unique id
documentId = "test_document_id";
this._OfflineAppDocumentStartLoad();
}
......
......@@ -4356,18 +4356,13 @@ $(".colorWatch").mouseover(function(){
var sProtocol = window.location.protocol;
var sHost = window.location.host;
var documentOrigin = "";
if(sProtocol && "" != sProtocol)
documentOrigin = sProtocol + "//" + sHost;
else
documentOrigin = sHost;
var c_DocInfo = new CDocInfo ();
c_DocInfo.put_Id( getURLParameter("key") ?
decodeURIComponent(getURLParameter("key")) :
undefined );
'test_document_id' );
c_DocInfo.put_Url( getURLParameter("url") ?
decodeURIComponent(getURLParameter("url")) :
undefined );
'_offline_' );
c_DocInfo.put_Title( getURLParameter("title") ?
decodeURIComponent(getURLParameter("title")).replace(new RegExp("\\+",'g')," ") :
undefined );
......
......@@ -170,18 +170,13 @@
var sProtocol = window.location.protocol;
var sHost = window.location.host;
var documentOrigin = "";
if(sProtocol && "" != sProtocol)
documentOrigin = sProtocol + "//" + sHost;
else
documentOrigin = sHost;
var c_DocInfo = new CDocInfo ();
c_DocInfo.put_Id( getURLParameter("key") ?
decodeURIComponent(getURLParameter("key")) :
undefined );
'test_document_id' );
c_DocInfo.put_Url( getURLParameter("key") ?
decodeURIComponent(getURLParameter("url")) :
undefined );
'_offline_' );
c_DocInfo.put_Title( getURLParameter("key") ?
decodeURIComponent(getURLParameter("title")).replace(new RegExp("\\+",'g')," ") :
undefined );
......
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