Commit 9684a873 authored by Oleg.Korshul's avatar Oleg.Korshul Committed by Alexander.Trofimov

saveAs

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@66845 954022d7-b5bf-4e40-9824-e11837661b57
parent f80aaed7
......@@ -133,12 +133,17 @@ window["DesktopOfflineAppDocumentApplyChanges"] = function(_changes)
/////////////////////////////////////////////////////////
//////////////// SAVE //////////////////////
/////////////////////////////////////////////////////////
window["Asc"]['spreadsheet_api'].prototype.asc_Save = function (isNoUserSave)
window["Asc"]['spreadsheet_api'].prototype.asc_Save = function (isNoUserSave, isSaveAs)
{
var t = this;
if (true !== isNoUserSave)
this.IsUserSave = true;
if (this.IsUserSave)
{
this.LastUserSavedIndex = History.UserSavedIndex;
}
if (true === this.canSave && !this.isLongAction())
{
var _isNaturalSave = this.IsUserSave;
......@@ -149,13 +154,12 @@ window["Asc"]['spreadsheet_api'].prototype.asc_Save = function (isNoUserSave)
this.CoAuthoringApi.onUnSaveLock();
if (_isNaturalSave === true)
window["DesktopOfflineAppDocumentStartSave"]();
window["DesktopOfflineAppDocumentStartSave"](isSaveAs);
}
};
window["Asc"]['spreadsheet_api'].asc_DownloadAs = function(typeFile, bIsDownloadEvent)
window["Asc"]['spreadsheet_api'].prototype.asc_DownloadAs = function(typeFile, bIsDownloadEvent)
{
window["Asc"]["editor"].sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.Save);
window["AscDesktopEditor"]["LocalFileSave"](true);
this.asc_Save(false, true);
};
window["Asc"]['spreadsheet_api'].prototype.asc_isOffline = function()
......@@ -163,9 +167,12 @@ window["Asc"]['spreadsheet_api'].prototype.asc_isOffline = function()
return true;
};
window["DesktopOfflineAppDocumentStartSave"] = function()
window["DesktopOfflineAppDocumentStartSave"] = function(isSaveAs)
{
window["Asc"]["editor"].sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.Save);
if (isSaveAs === true)
window["AscDesktopEditor"]["LocalFileSave"](true);
else
window["AscDesktopEditor"]["LocalFileSave"]();
};
window["DesktopOfflineAppDocumentEndSave"] = function(isCancel)
......@@ -173,6 +180,14 @@ window["DesktopOfflineAppDocumentEndSave"] = function(isCancel)
window["Asc"]["editor"].sync_EndAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.Save);
if (isCancel !== true)
DesktopOfflineUpdateLocalName(window["Asc"]["editor"]);
else
{
History.UserSavedIndex = window["Asc"]["editor"].LastUserSavedIndex;
window["Asc"]["editor"].onUpdateDocumentModified(History.Is_Modified(true));
}
window["Asc"]["editor"].LastUserSavedIndex = undefined;
};
window["Asc"]['spreadsheet_api'].prototype["asc_addImageDrawingObject"] = window["Asc"]['spreadsheet_api'].prototype.asc_addImageDrawingObject;
......
......@@ -93,11 +93,16 @@ window["DesktopOfflineAppDocumentApplyChanges"] = function(_changes)
/////////////////////////////////////////////////////////
//////////////// SAVE //////////////////////
/////////////////////////////////////////////////////////
asc_docs_api.prototype.asc_Save = function (isNoUserSave)
asc_docs_api.prototype.asc_Save = function (isNoUserSave, isSaveAs)
{
if (true !== isNoUserSave)
this.IsUserSave = true;
if (this.IsUserSave)
{
this.LastUserSavedIndex = History.UserSavedIndex;
}
if (true === this.canSave && !this.isLongAction())
{
var _isNaturalSave = this.IsUserSave;
......@@ -108,12 +113,15 @@ asc_docs_api.prototype.asc_Save = function (isNoUserSave)
this.CoAuthoringApi.onUnSaveLock();
if (_isNaturalSave === true)
window["DesktopOfflineAppDocumentStartSave"]();
window["DesktopOfflineAppDocumentStartSave"](isSaveAs);
}
};
window["DesktopOfflineAppDocumentStartSave"] = function()
window["DesktopOfflineAppDocumentStartSave"] = function(isSaveAs)
{
editor.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.Save);
if (isSaveAs === true)
window["AscDesktopEditor"]["LocalFileSave"](true);
else
window["AscDesktopEditor"]["LocalFileSave"]();
};
window["DesktopOfflineAppDocumentEndSave"] = function(isCancel)
......@@ -121,11 +129,17 @@ window["DesktopOfflineAppDocumentEndSave"] = function(isCancel)
editor.sync_EndAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.Save);
if (isCancel !== true)
DesktopOfflineUpdateLocalName(editor);
else
{
History.UserSavedIndex = editor.LastUserSavedIndex;
editor.UpdateInterfaceState();
}
editor.LastUserSavedIndex = undefined;
};
asc_docs_api.prototype.asc_DownloadAs = function(typeFile, bIsDownloadEvent)
{
editor.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.Save);
window["AscDesktopEditor"]["LocalFileSave"](true);
this.asc_Save(false, true);
};
asc_docs_api.prototype.AddImageUrl = function(url, imgProp)
......
......@@ -110,11 +110,16 @@ window["DesktopOfflineAppDocumentApplyChanges"] = function(_changes)
/////////////////////////////////////////////////////////
//////////////// SAVE //////////////////////
/////////////////////////////////////////////////////////
asc_docs_api.prototype.asc_Save = function (isNoUserSave)
asc_docs_api.prototype.asc_Save = function (isNoUserSave, isSaveAs)
{
if (true !== isNoUserSave)
this.IsUserSave = true;
if (this.IsUserSave)
{
this.LastUserSavedIndex = History.UserSavedIndex;
}
if (true === this.canSave && !this.isLongAction())
{
var _isNaturalSave = this.IsUserSave;
......@@ -125,12 +130,15 @@ asc_docs_api.prototype.asc_Save = function (isNoUserSave)
this.CoAuthoringApi.onUnSaveLock();
if (_isNaturalSave === true)
window["DesktopOfflineAppDocumentStartSave"]();
window["DesktopOfflineAppDocumentStartSave"](isSaveAs);
}
};
window["DesktopOfflineAppDocumentStartSave"] = function()
window["DesktopOfflineAppDocumentStartSave"] = function(isSaveAs)
{
editor.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.Save);
if (isSaveAs === true)
window["AscDesktopEditor"]["LocalFileSave"](true);
else
window["AscDesktopEditor"]["LocalFileSave"]();
};
window["DesktopOfflineAppDocumentEndSave"] = function(isCancel)
......@@ -138,11 +146,17 @@ window["DesktopOfflineAppDocumentEndSave"] = function(isCancel)
editor.sync_EndAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.Save);
if (isCancel !== true)
DesktopOfflineUpdateLocalName(editor);
else
{
History.UserSavedIndex = editor.LastUserSavedIndex;
editor.UpdateInterfaceState();
}
editor.LastUserSavedIndex = undefined;
};
asc_docs_api.prototype.asc_DownloadAs = function(typeFile, bIsDownloadEvent)
{
editor.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.Save);
window["AscDesktopEditor"]["LocalFileSave"](true);
this.asc_Save(false, true);
};
asc_docs_api.prototype.AddImageUrl = function(url, imgProp)
......
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