Commit 406280f4 authored by Sergey.Konovalov's avatar Sergey.Konovalov

для offline работы

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@64522 954022d7-b5bf-4e40-9824-e11837661b57
parent b1dfa91b
...@@ -930,7 +930,11 @@ function DrawingObjects() { ...@@ -930,7 +930,11 @@ function DrawingObjects() {
for(i = 0; i < aImagesSync.length; ++i) for(i = 0; i < aImagesSync.length; ++i)
{ {
aImagesSync[i] = getFullImageSrc2(aImagesSync[i]); var localUrl = aImagesSync[i];
if(api.DocInfo["OfflineApp"]) {
g_oDocumentUrls.addImageUrl(localUrl, api.FontLoader.fontFilesPath + "../Excel/document/media/" + localUrl);
}
aImagesSync[i] = getFullImageSrc2(localUrl);
} }
// Загружаем все картинки листа // Загружаем все картинки листа
......
...@@ -1029,6 +1029,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -1029,6 +1029,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
// Назначим id-сами, если он не пришел (для открытия тестового документа) // Назначим id-сами, если он не пришел (для открытия тестового документа)
if (!this.documentId) if (!this.documentId)
this.documentId = '9876543210'; this.documentId = '9876543210';
this.DocInfo["OfflineApp"] = true;
this._OfflineAppDocumentStartLoad(fCallback); this._OfflineAppDocumentStartLoad(fCallback);
} else { } else {
var v = { var v = {
...@@ -1733,7 +1734,11 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -1733,7 +1734,11 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
} }
}; };
this._coAuthoringSetServerUrl(null); //в обычном серверном режиме портим ссылку, потому что CoAuthoring теперь имеет встроенный адрес
//todo надо использовать проверку get_OfflineApp
if(!(window["NATIVE_EDITOR_ENJINE"] || !this.documentId || !this.documentUrl)){
this._coAuthoringSetServerUrl(null);
}
this.CoAuthoringApi.init(t.User, t.documentId, t.documentCallbackUrl, 'fghhfgsjdgfjs', this.CoAuthoringApi.init(t.User, t.documentId, t.documentCallbackUrl, 'fghhfgsjdgfjs',
function(){}, c_oEditorId.Spreadsheet, t.documentFormatSave, t.asc_getViewerMode()); function(){}, c_oEditorId.Spreadsheet, t.documentFormatSave, t.asc_getViewerMode());
}; };
......
...@@ -546,9 +546,9 @@ ...@@ -546,9 +546,9 @@
var sUserNameAndId = "user_" + Math.floor ((Math.random() * 100) + 1); var sUserNameAndId = "user_" + Math.floor ((Math.random() * 100) + 1);
var offLineApp = 0; // 1; // NOTE: ONLY FOR TEST DESKTOP APPLICATION var offLineApp = 0; // 1; // NOTE: ONLY FOR TEST DESKTOP APPLICATION
var c_DocInfo;
if (!offLineApp) { if (!offLineApp) {
api.asc_LoadDocument({ c_DocInfo = {
"Id" : getURLParameter("key") ? decodeURIComponent(getURLParameter("key")) : "9876543210", "Id" : getURLParameter("key") ? decodeURIComponent(getURLParameter("key")) : "9876543210",
"Url" : getURLParameter("url") ? decodeURIComponent(getURLParameter("url")) : undefined, "Url" : getURLParameter("url") ? decodeURIComponent(getURLParameter("url")) : undefined,
"Title" : getURLParameter("title") ? decodeURIComponent(getURLParameter("title")).replace(new RegExp("\\+",'g')," ") : undefined, "Title" : getURLParameter("title") ? decodeURIComponent(getURLParameter("title")).replace(new RegExp("\\+",'g')," ") : undefined,
...@@ -558,9 +558,9 @@ ...@@ -558,9 +558,9 @@
"UserId" : sUserNameAndId, "UserId" : sUserNameAndId,
"UserName" : sUserNameAndId, "UserName" : sUserNameAndId,
"ChartEditor" : bChartEditor "ChartEditor" : bChartEditor
}); };
} else { } else {
api.asc_LoadDocument({ c_DocInfo = {
"Id" : getURLParameter("key") ? decodeURIComponent(getURLParameter("key")) : "9876543210", "Id" : getURLParameter("key") ? decodeURIComponent(getURLParameter("key")) : "9876543210",
"Url" : decodeURIComponent("file:///X:/AVS/Sources/TeamlabOffice/trunk/OfficeWeb/OfflineDocuments/Excel/test-native/"), "Url" : decodeURIComponent("file:///X:/AVS/Sources/TeamlabOffice/trunk/OfficeWeb/OfflineDocuments/Excel/test-native/"),
"Title" : getURLParameter("title") ? decodeURIComponent(getURLParameter("title")).replace(new RegExp("\\+",'g')," ") : undefined, "Title" : getURLParameter("title") ? decodeURIComponent(getURLParameter("title")).replace(new RegExp("\\+",'g')," ") : undefined,
...@@ -571,8 +571,11 @@ ...@@ -571,8 +571,11 @@
"UserName" : sUserNameAndId, "UserName" : sUserNameAndId,
"ChartEditor" : bChartEditor, "ChartEditor" : bChartEditor,
"OfflineApp" : true "OfflineApp" : true
}); };
} }
api.asc_setDocInfo(c_DocInfo);
api.asc_getEditorPermissions();
api.asc_LoadDocument();
$("#enableKE").data("state", true).click(function(){ $("#enableKE").data("state", true).click(function(){
var $this = $(this), s = $this.data("state"); var $this = $(this), s = $this.data("state");
......
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