Commit 0dc18375 authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

documentId в base

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@66341 954022d7-b5bf-4e40-9824-e11837661b57
parent 23c5b9c1
...@@ -19,6 +19,7 @@ function baseEditorsApi(name) { ...@@ -19,6 +19,7 @@ function baseEditorsApi(name) {
this.LoadedObject = null; this.LoadedObject = null;
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.advancedOptionsAction = c_oAscAdvancedOptionsAction.None; this.advancedOptionsAction = c_oAscAdvancedOptionsAction.None;
......
...@@ -1433,7 +1433,7 @@ CopyProcessor.prototype = ...@@ -1433,7 +1433,7 @@ CopyProcessor.prototype =
if(elementsContent.DocContent || (elementsContent.Drawings && elementsContent.Drawings.length) || (elementsContent.SlideObjects && elementsContent.SlideObjects.length)) if(elementsContent.DocContent || (elementsContent.Drawings && elementsContent.Drawings.length) || (elementsContent.SlideObjects && elementsContent.SlideObjects.length))
{ {
this.oPresentationWriter.WriteString2(documentId); this.oPresentationWriter.WriteString2(this.api.documentId);
this.oPresentationWriter.WriteDouble(presentation.Width); this.oPresentationWriter.WriteDouble(presentation.Width);
this.oPresentationWriter.WriteDouble(presentation.Height); this.oPresentationWriter.WriteDouble(presentation.Height);
} }
...@@ -2489,9 +2489,9 @@ function Editor_Paste_Exec(api, pastebin, nodeDisplay, onlyBinary) ...@@ -2489,9 +2489,9 @@ function Editor_Paste_Exec(api, pastebin, nodeDisplay, onlyBinary)
} }
function trimString( str ){ function trimString( str ){
return str.replace(/^\s+|\s+$/g, '') ; return str.replace(/^\s+|\s+$/g, '') ;
}; }
function sendImgUrls(api, images, callback, bExcel) { function sendImgUrls(api, images, callback, bExcel) {
var rData = {"id": bExcel ? api.documentId : documentId, "c": "imgurls", "vkey": bExcel ? api.documentVKey : documentVKey, "userid": bExcel ? api.documentUserId : documentUserId, "saveindex": g_oDocumentUrls.getMaxIndex(), "data": images}; var rData = {"id": api.documentId, "c": "imgurls", "vkey": bExcel ? api.documentVKey : documentVKey, "userid": bExcel ? api.documentUserId : documentUserId, "saveindex": g_oDocumentUrls.getMaxIndex(), "data": images};
if(!bExcel) if(!bExcel)
api.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.LoadImage); api.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.LoadImage);
else else
...@@ -3488,7 +3488,7 @@ PasteProcessor.prototype = ...@@ -3488,7 +3488,7 @@ PasteProcessor.prototype =
else else
master = presentation.slideMasters[0]; master = presentation.slideMasters[0];
if(documentId !== p_url) if(this.api.documentId !== p_url)
{ {
var layouts_count = stream.GetULong(); var layouts_count = stream.GetULong();
for(var i = 0; i < layouts_count; ++i) for(var i = 0; i < layouts_count; ++i)
......
...@@ -43,7 +43,6 @@ var editor; ...@@ -43,7 +43,6 @@ var editor;
this.wbModel = null; this.wbModel = null;
this.DocumentName = ""; this.DocumentName = "";
this.documentId = undefined;
this.documentUserId = undefined; this.documentUserId = undefined;
this.documentUrl = "null"; this.documentUrl = "null";
this.documentUrlChanges = null; this.documentUrlChanges = null;
......
"use strict"; "use strict";
var documentId = undefined;
var documentUserId = undefined; var documentUserId = undefined;
var documentUrl = 'null'; var documentUrl = 'null';
var documentUrlChanges = null; var documentUrlChanges = null;
...@@ -472,7 +471,7 @@ asc_docs_api.prototype._coAuthoringInit = function() { ...@@ -472,7 +471,7 @@ asc_docs_api.prototype._coAuthoringInit = function() {
if (!(window["NATIVE_EDITOR_ENJINE"] || offlineMode === documentUrl)) { if (!(window["NATIVE_EDITOR_ENJINE"] || offlineMode === documentUrl)) {
this.CoAuthoringApi.set_url(null); this.CoAuthoringApi.set_url(null);
} }
this.CoAuthoringApi.init(this.User, documentId, documentCallbackUrl, 'fghhfgsjdgfjs', c_oEditorId.Presentation, documentFormatSave); this.CoAuthoringApi.init(this.User, this.documentId, documentCallbackUrl, 'fghhfgsjdgfjs', c_oEditorId.Presentation, documentFormatSave);
// ToDo init other callbacks // ToDo init other callbacks
}; };
...@@ -647,7 +646,7 @@ asc_docs_api.prototype.asc_setDocInfo = function(c_DocInfo) { ...@@ -647,7 +646,7 @@ asc_docs_api.prototype.asc_setDocInfo = function(c_DocInfo) {
} }
if (this.DocInfo) { if (this.DocInfo) {
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(); documentUrl = this.DocInfo.get_Url();
documentTitle = this.DocInfo.get_Title(); documentTitle = this.DocInfo.get_Title();
...@@ -690,7 +689,7 @@ asc_docs_api.prototype.LoadDocument = function() { ...@@ -690,7 +689,7 @@ asc_docs_api.prototype.LoadDocument = function() {
if (offlineMode !== documentUrl) { 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": this.documentId,
"userid": documentUserId, "userid": documentUserId,
"format": documentFormat, "format": documentFormat,
"vkey": documentVKey, "vkey": documentVKey,
...@@ -1953,7 +1952,7 @@ asc_docs_api.prototype.put_ShowSnapLines = function(isShow) ...@@ -1953,7 +1952,7 @@ asc_docs_api.prototype.put_ShowSnapLines = function(isShow)
asc_docs_api.prototype.get_ShowSnapLines = function() asc_docs_api.prototype.get_ShowSnapLines = function()
{ {
return this.ShowSnapLines; return this.ShowSnapLines;
} };
asc_docs_api.prototype.put_ShowParaMarks = function(isShow){ asc_docs_api.prototype.put_ShowParaMarks = function(isShow){
this.ShowParaMarks = isShow; this.ShowParaMarks = isShow;
...@@ -2092,7 +2091,7 @@ asc_docs_api.prototype.ShapeApply = function(prop) ...@@ -2092,7 +2091,7 @@ asc_docs_api.prototype.ShapeApply = function(prop)
oApi.sync_EndAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.UploadImage); oApi.sync_EndAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.UploadImage);
}; };
var rData = { var rData = {
"id":documentId, "id":this.documentId,
"userid": documentUserId, "userid": documentUserId,
"vkey": documentVKey, "vkey": documentVKey,
"c":"imgurl", "c":"imgurl",
...@@ -2903,7 +2902,7 @@ asc_docs_api.prototype.ChangeArtImageFromFile = function() ...@@ -2903,7 +2902,7 @@ asc_docs_api.prototype.ChangeArtImageFromFile = function()
asc_docs_api.prototype.AddImage = function(){ asc_docs_api.prototype.AddImage = function(){
var t = this; var t = this;
ShowImageFileDialog(documentId, documentUserId, function (error, files) { ShowImageFileDialog(this.documentId, documentUserId, function (error, files) {
t._uploadCallback(error, files); t._uploadCallback(error, files);
}, function (error) { }, function (error) {
if (c_oAscError.ID.No !== error) if (c_oAscError.ID.No !== error)
...@@ -2917,7 +2916,7 @@ asc_docs_api.prototype._uploadCallback = function(error, files) { ...@@ -2917,7 +2916,7 @@ asc_docs_api.prototype._uploadCallback = function(error, files) {
t.sync_ErrorCallback(error, c_oAscError.Level.NoCritical); t.sync_ErrorCallback(error, c_oAscError.Level.NoCritical);
} else { } else {
t.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.UploadImage); t.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.UploadImage);
UploadImageFiles(files, documentId, documentUserId, function (error, url) { UploadImageFiles(files, this.documentId, documentUserId, function (error, url) {
if (c_oAscError.ID.No !== error) if (c_oAscError.ID.No !== error)
t.sync_ErrorCallback(error, c_oAscError.Level.NoCritical); t.sync_ErrorCallback(error, c_oAscError.Level.NoCritical);
else else
...@@ -2962,7 +2961,7 @@ asc_docs_api.prototype.AddImageUrl = function(url){ ...@@ -2962,7 +2961,7 @@ asc_docs_api.prototype.AddImageUrl = function(url){
else else
{ {
var rData = { var rData = {
"id":documentId, "id":this.documentId,
"userid": documentUserId, "userid": documentUserId,
"vkey": documentVKey, "vkey": documentVKey,
"c":"imgurl", "c":"imgurl",
...@@ -3065,7 +3064,7 @@ asc_docs_api.prototype.AddImageUrlActionCallback = function(_image) ...@@ -3065,7 +3064,7 @@ asc_docs_api.prototype.AddImageUrlActionCallback = function(_image)
this.WordControl.m_oLogicDocument.Add_FlowImage(_w, _h, src); this.WordControl.m_oLogicDocument.Add_FlowImage(_w, _h, src);
} }
} };
asc_docs_api.prototype.AddImageUrlAction = function(url){ asc_docs_api.prototype.AddImageUrlAction = function(url){
var _image = this.ImageLoader.LoadImage(url, 1); var _image = this.ImageLoader.LoadImage(url, 1);
...@@ -3179,7 +3178,7 @@ asc_docs_api.prototype.ImgApply = function(obj){ ...@@ -3179,7 +3178,7 @@ asc_docs_api.prototype.ImgApply = function(obj){
}; };
var rData = { var rData = {
"id":documentId, "id":this.documentId,
"userid": documentUserId, "userid": documentUserId,
"vkey": documentVKey, "vkey": documentVKey,
"c":"imgurl", "c":"imgurl",
...@@ -3205,7 +3204,7 @@ asc_docs_api.prototype.ChartApply = function(obj) ...@@ -3205,7 +3204,7 @@ asc_docs_api.prototype.ChartApply = function(obj)
} }
} }
this.WordControl.m_oLogicDocument.ChartApply(obj); this.WordControl.m_oLogicDocument.ChartApply(obj);
} };
asc_docs_api.prototype.set_Size = function(width, height){ asc_docs_api.prototype.set_Size = function(width, height){
}; };
...@@ -4993,7 +4992,7 @@ function _downloadAs(editor, filetype, actionType, options) ...@@ -4993,7 +4992,7 @@ function _downloadAs(editor, filetype, actionType, options)
var command = "save"; var command = "save";
var oAdditionalData = {}; var oAdditionalData = {};
oAdditionalData["c"] = command; oAdditionalData["c"] = command;
oAdditionalData["id"] = documentId; oAdditionalData["id"] = editor.documentId;
oAdditionalData["userid"] = documentUserId; oAdditionalData["userid"] = documentUserId;
oAdditionalData["vkey"] = documentVKey; oAdditionalData["vkey"] = documentVKey;
oAdditionalData["outputformat"] = filetype; oAdditionalData["outputformat"] = filetype;
......
"use strict"; "use strict";
var documentId = undefined;
var documentUserId = undefined; var documentUserId = undefined;
var documentUrl = 'null'; var documentUrl = 'null';
var documentUrlChanges = null; var documentUrlChanges = null;
...@@ -578,7 +577,7 @@ asc_docs_api.prototype.asc_setDocInfo = function(c_DocInfo) { ...@@ -578,7 +577,7 @@ asc_docs_api.prototype.asc_setDocInfo = function(c_DocInfo) {
} }
if (this.DocInfo) { if (this.DocInfo) {
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(); documentUrl = this.DocInfo.get_Url();
documentTitle = this.DocInfo.get_Title(); documentTitle = this.DocInfo.get_Title();
...@@ -623,7 +622,7 @@ asc_docs_api.prototype.LoadDocument = function(isVersionHistory) { ...@@ -623,7 +622,7 @@ asc_docs_api.prototype.LoadDocument = function(isVersionHistory) {
if (offlineMode !== documentUrl) { if (offlineMode !== documentUrl) {
var rData = { var rData = {
"c": 'open', "c": 'open',
"id": documentId, "id": this.documentId,
"userid": documentUserId, "userid": documentUserId,
"format": documentFormat, "format": documentFormat,
"vkey": documentVKey, "vkey": documentVKey,
...@@ -1237,7 +1236,7 @@ asc_docs_api.prototype._coAuthoringInit = function() { ...@@ -1237,7 +1236,7 @@ asc_docs_api.prototype._coAuthoringInit = function() {
if (!(window["NATIVE_EDITOR_ENJINE"] || offlineMode === documentUrl)) { if (!(window["NATIVE_EDITOR_ENJINE"] || offlineMode === documentUrl)) {
this.CoAuthoringApi.set_url(null); this.CoAuthoringApi.set_url(null);
} }
this.CoAuthoringApi.init(this.User, documentId, documentCallbackUrl, 'fghhfgsjdgfjs', c_oEditorId.Word, documentFormatSave); this.CoAuthoringApi.init(this.User, this.documentId, documentCallbackUrl, 'fghhfgsjdgfjs', c_oEditorId.Word, documentFormatSave);
}; };
// server disconnect // server disconnect
...@@ -1268,7 +1267,7 @@ asc_docs_api.prototype._coSpellCheckInit = function() { ...@@ -1268,7 +1267,7 @@ asc_docs_api.prototype._coSpellCheckInit = function() {
}; };
} }
this.SpellCheckApi.init(documentId); this.SpellCheckApi.init(this.documentId);
}; };
asc_docs_api.prototype.asc_getSpellCheckLanguages = function() { asc_docs_api.prototype.asc_getSpellCheckLanguages = function() {
...@@ -2129,7 +2128,7 @@ asc_docs_api.prototype.asc_setAdvancedOptions = function(idOption, option) { ...@@ -2129,7 +2128,7 @@ asc_docs_api.prototype.asc_setAdvancedOptions = function(idOption, option) {
// Проверяем тип состояния в данный момент // Проверяем тип состояния в данный момент
if (this.advancedOptionsAction === c_oAscAdvancedOptionsAction.Open) { if (this.advancedOptionsAction === c_oAscAdvancedOptionsAction.Open) {
var rData = { var rData = {
"id":documentId, "id":this.documentId,
"userid": documentUserId, "userid": documentUserId,
"format": documentFormat, "format": documentFormat,
"vkey": documentVKey, "vkey": documentVKey,
...@@ -4401,7 +4400,7 @@ asc_docs_api.prototype.ChangeShapeImageFromFile = function() ...@@ -4401,7 +4400,7 @@ asc_docs_api.prototype.ChangeShapeImageFromFile = function()
asc_docs_api.prototype.AddImage = function(){ asc_docs_api.prototype.AddImage = function(){
var t = this; var t = this;
ShowImageFileDialog(documentId, documentUserId, function(error, files){ ShowImageFileDialog(this.documentId, documentUserId, function(error, files){
t._uploadCallback(error, files); t._uploadCallback(error, files);
}, function (error) { }, function (error) {
if (c_oAscError.ID.No !== error) if (c_oAscError.ID.No !== error)
...@@ -4415,7 +4414,7 @@ asc_docs_api.prototype._uploadCallback = function(error, files){ ...@@ -4415,7 +4414,7 @@ asc_docs_api.prototype._uploadCallback = function(error, files){
t.sync_ErrorCallback(error, c_oAscError.Level.NoCritical); t.sync_ErrorCallback(error, c_oAscError.Level.NoCritical);
} else { } else {
t.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.UploadImage); t.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.UploadImage);
UploadImageFiles(files, documentId, documentUserId, function (error, url) { UploadImageFiles(files, this.documentId, documentUserId, function (error, url) {
if (c_oAscError.ID.No !== error) if (c_oAscError.ID.No !== error)
t.sync_ErrorCallback(error, c_oAscError.Level.NoCritical); t.sync_ErrorCallback(error, c_oAscError.Level.NoCritical);
else else
...@@ -4423,7 +4422,7 @@ asc_docs_api.prototype._uploadCallback = function(error, files){ ...@@ -4423,7 +4422,7 @@ asc_docs_api.prototype._uploadCallback = function(error, files){
t.sync_EndAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.UploadImage); t.sync_EndAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.UploadImage);
}); });
} }
} };
asc_docs_api.prototype.AddImageUrl2 = function(url) asc_docs_api.prototype.AddImageUrl2 = function(url)
{ {
this.AddImageUrl(getFullImageSrc2(url)); this.AddImageUrl(getFullImageSrc2(url));
...@@ -4440,7 +4439,7 @@ asc_docs_api.prototype.AddImageUrl = function(url, imgProp) ...@@ -4440,7 +4439,7 @@ asc_docs_api.prototype.AddImageUrl = function(url, imgProp)
else else
{ {
var rData = { var rData = {
"id": documentId, "id": this.documentId,
"userid": documentUserId, "userid": documentUserId,
"vkey": documentVKey, "vkey": documentVKey,
"c": "imgurl", "c": "imgurl",
...@@ -4756,7 +4755,7 @@ asc_docs_api.prototype.ImgApply = function(obj) ...@@ -4756,7 +4755,7 @@ asc_docs_api.prototype.ImgApply = function(obj)
if(sImageUrl){ if(sImageUrl){
var rData = { var rData = {
"id": documentId, "id": this.documentId,
"userid": documentUserId, "userid": documentUserId,
"vkey": documentVKey, "vkey": documentVKey,
"c": "imgurl", "c": "imgurl",
...@@ -6601,7 +6600,7 @@ function _downloadAs(editor, command, filetype, actionType, options, fCallbackRe ...@@ -6601,7 +6600,7 @@ function _downloadAs(editor, command, filetype, actionType, options, fCallbackRe
var dataContainer = {data: null, part: null, index: 0, count: 0}; var dataContainer = {data: null, part: null, index: 0, count: 0};
var oAdditionalData = {}; var oAdditionalData = {};
oAdditionalData["c"] = command; oAdditionalData["c"] = command;
oAdditionalData["id"] = documentId; oAdditionalData["id"] = editor.documentId;
oAdditionalData["userid"] = documentUserId; oAdditionalData["userid"] = documentUserId;
oAdditionalData["vkey"] = documentVKey; oAdditionalData["vkey"] = documentVKey;
oAdditionalData["outputformat"] = filetype; oAdditionalData["outputformat"] = filetype;
......
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