Commit b816fbf7 authored by Oleg Korshul's avatar Oleg Korshul

на Ctrl+P - песылаем евент asc_onPrint

parent 91ecd1a8
/*
*
* (c) Copyright Ascensio System Limited 2010-2016
*
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
* In accordance with Section 7(a) of the GNU GPL its Section 15 shall be amended to the effect that
* Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
*
* THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR
* FITNESS FOR A PARTICULAR PURPOSE. For more details, see GNU GPL at https://www.gnu.org/copyleft/gpl.html
*
* You can contact Ascensio System SIA by email at sales@onlyoffice.com
*
* The interactive user interfaces in modified source and object code versions of ONLYOFFICE must display
* Appropriate Legal Notices, as required under Section 5 of the GNU GPL version 3.
*
* Pursuant to Section 7  3(b) of the GNU GPL you must retain the original ONLYOFFICE logo which contains
* relevant author attributions when distributing the software. If the display of the logo in its graphic
* form is not reasonably feasible for technical reasons, you must include the words "Powered by ONLYOFFICE"
* in every copy of the program you distribute.
* Pursuant to Section 7  3(e) we decline to grant you any rights under trademark law for use of our trademarks.
*
*/
/*
*
* (c) Copyright Ascensio System Limited 2010-2016
*
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
* In accordance with Section 7(a) of the GNU GPL its Section 15 shall be amended to the effect that
* Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
*
* THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR
* FITNESS FOR A PARTICULAR PURPOSE. For more details, see GNU GPL at https://www.gnu.org/copyleft/gpl.html
*
* You can contact Ascensio System SIA by email at sales@onlyoffice.com
*
* The interactive user interfaces in modified source and object code versions of ONLYOFFICE must display
* Appropriate Legal Notices, as required under Section 5 of the GNU GPL version 3.
*
* Pursuant to Section 7  3(b) of the GNU GPL you must retain the original ONLYOFFICE logo which contains
* relevant author attributions when distributing the software. If the display of the logo in its graphic
* form is not reasonably feasible for technical reasons, you must include the words "Powered by ONLYOFFICE"
* in every copy of the program you distribute.
* Pursuant to Section 7  3(e) we decline to grant you any rights under trademark law for use of our trademarks.
*
*/
"use strict";
var g_fontManager = new CFontManager();
......@@ -5368,7 +5368,7 @@ function CThumbnailsManager()
{
if(global_keyboardEvent.CtrlKey)
{
this.m_oWordControl.m_oApi.asc_Print();
this.m_oWordControl.m_oApi.asc_PrintKey();
}
break;
}
......
......@@ -2600,7 +2600,7 @@ CPresentation.prototype =
}
else // Ctrl + P - print
{
this.DrawingDocument.m_oWordControl.m_oApi.asc_Print();
this.DrawingDocument.m_oWordControl.m_oApi.asc_PrintKey();
bRetValue = keydownresult_PreventAll;
}
}
......
/*
*
* (c) Copyright Ascensio System Limited 2010-2016
*
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
* In accordance with Section 7(a) of the GNU GPL its Section 15 shall be amended to the effect that
* Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
*
* THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR
* FITNESS FOR A PARTICULAR PURPOSE. For more details, see GNU GPL at https://www.gnu.org/copyleft/gpl.html
*
* You can contact Ascensio System SIA by email at sales@onlyoffice.com
*
* The interactive user interfaces in modified source and object code versions of ONLYOFFICE must display
* Appropriate Legal Notices, as required under Section 5 of the GNU GPL version 3.
*
* Pursuant to Section 7  3(b) of the GNU GPL you must retain the original ONLYOFFICE logo which contains
* relevant author attributions when distributing the software. If the display of the logo in its graphic
* form is not reasonably feasible for technical reasons, you must include the words "Powered by ONLYOFFICE"
* in every copy of the program you distribute.
* Pursuant to Section 7  3(e) we decline to grant you any rights under trademark law for use of our trademarks.
*
*/
/*
*
* (c) Copyright Ascensio System Limited 2010-2016
*
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
* In accordance with Section 7(a) of the GNU GPL its Section 15 shall be amended to the effect that
* Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
*
* THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR
* FITNESS FOR A PARTICULAR PURPOSE. For more details, see GNU GPL at https://www.gnu.org/copyleft/gpl.html
*
* You can contact Ascensio System SIA by email at sales@onlyoffice.com
*
* The interactive user interfaces in modified source and object code versions of ONLYOFFICE must display
* Appropriate Legal Notices, as required under Section 5 of the GNU GPL version 3.
*
* Pursuant to Section 7  3(b) of the GNU GPL you must retain the original ONLYOFFICE logo which contains
* relevant author attributions when distributing the software. If the display of the logo in its graphic
* form is not reasonably feasible for technical reasons, you must include the words "Powered by ONLYOFFICE"
* in every copy of the program you distribute.
* Pursuant to Section 7  3(e) we decline to grant you any rights under trademark law for use of our trademarks.
*
*/
"use strict";
var c_oSerFormat = {
......@@ -1068,6 +1068,14 @@ asc_docs_api.prototype.asc_Print = function(bIsDownloadEvent){
var options = {downloadType: bIsDownloadEvent ? DownloadType.Print: DownloadType.None};
_downloadAs(this, c_oAscFileType.PDF, c_oAscAsyncAction.Print, options);
};
asc_docs_api.prototype.asc_PrintKey = function(){
if (window["AscDesktopEditor"])
{
this.asc_Print();
return;
}
this.asc_fireCallback("asc_onPrint");
};
asc_docs_api.prototype.Undo = function(){
this.WordControl.m_oLogicDocument.Document_Undo();
};
......@@ -4737,9 +4745,9 @@ function _downloadAs(editor, filetype, actionType, options)
oAdditionalData["vkey"] = editor.documentVKey;
oAdditionalData["outputformat"] = filetype;
oAdditionalData["title"] = changeFileExtention(editor.documentTitle, getExtentionByFormat(filetype));
oAdditionalData["savetype"] = c_oAscSaveTypes.CompleteAll;
if (DownloadType.Print === options.downloadType) {
oAdditionalData["inline"] = 1;
oAdditionalData["savetype"] = c_oAscSaveTypes.CompleteAll;
if (DownloadType.Print === options.downloadType) {
oAdditionalData["inline"] = 1;
}
if(c_oAscFileType.PDF == filetype)
{
......
......@@ -3195,7 +3195,7 @@ function CDocMeta()
}
else if ( e.KeyCode == 80 && true === e.CtrlKey ) // Ctrl + P + ...
{
editor.asc_Print();
editor.asc_PrintKey();
bRetValue = true;
}
else if ( e.KeyCode == 83 && true === e.CtrlKey ) // Ctrl + S + ...
......
......@@ -11093,7 +11093,7 @@ CDocument.prototype =
}
else // Ctrl + P - print
{
this.DrawingDocument.m_oWordControl.m_oApi.asc_Print();
this.DrawingDocument.m_oWordControl.m_oApi.asc_PrintKey();
bRetValue = keydownresult_PreventAll;
}
}
......
......@@ -1761,6 +1761,15 @@ asc_docs_api.prototype.asc_Print = function(bIsDownloadEvent)
}
this._print(c_oAscAsyncAction.Print, bIsDownloadEvent ? DownloadType.Print: DownloadType.None);
};
asc_docs_api.prototype.asc_PrintKey = function(){
if (window["AscDesktopEditor"])
{
this.asc_Print();
return;
}
this.asc_fireCallback("asc_onPrint");
};
asc_docs_api.prototype._print = function(actionType, downloadType) {
var command;
var options = {isNoData: false, downloadType: downloadType};
......
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