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