Add back old OO
110
www/common/onlyoffice/v1/sdkjs/cell/css/main-mobile.css
Normal file
@@ -0,0 +1,110 @@
|
|||||||
|
@charset "UTF-8";
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Worksheet canvas
|
||||||
|
* --------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ws-canvas-outer {
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ws-canvas {
|
||||||
|
border: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ws-canvas-overlay, #ws-canvas-graphic, #ws-canvas-graphic-overlay {
|
||||||
|
border: 0;
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Worksheet scroll bars
|
||||||
|
* --------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ws-v-scrollbar {
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
width: 19px;
|
||||||
|
top: -1px;
|
||||||
|
bottom: 18px;
|
||||||
|
overflow: hidden;
|
||||||
|
z-index: 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ws-v-scroll-helper {
|
||||||
|
width: 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ws-h-scrollbar {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
height: 19px;
|
||||||
|
left: 0;
|
||||||
|
right: 18px;
|
||||||
|
overflow: hidden;
|
||||||
|
z-index: 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ws-h-scroll-helper {
|
||||||
|
height: 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ws-scrollbar-corner {
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
width: 18px;
|
||||||
|
height: 18px;
|
||||||
|
background-color: #DCE2E8;
|
||||||
|
border: 0;
|
||||||
|
z-index: 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Scrollbars common */
|
||||||
|
|
||||||
|
#ws-v-scrollbar .jspVerticalBar,
|
||||||
|
#ws-h-scrollbar .jspHorizontalBar,
|
||||||
|
#ws-v-scrollbar .jspTrack,
|
||||||
|
#ws-h-scrollbar .jspTrack {
|
||||||
|
background-color: #DCE2E8;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ws-v-scrollbar .jspDrag,
|
||||||
|
#ws-h-scrollbar .jspDrag {
|
||||||
|
background-color: #C0C0C0;
|
||||||
|
}
|
||||||
|
#ws-v-scrollbar .jspDrag.jspHover,
|
||||||
|
#ws-v-scrollbar .jspDrag.jspActive,
|
||||||
|
#ws-h-scrollbar .jspDrag.jspHover,
|
||||||
|
#ws-h-scrollbar .jspDrag.jspActive {
|
||||||
|
background-color: #808080;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Vertical scrollbar */
|
||||||
|
|
||||||
|
#ws-v-scrollbar .jspVerticalBar {
|
||||||
|
width: 7px;
|
||||||
|
border-left: 1px solid #C1C6CC;
|
||||||
|
}
|
||||||
|
#ws-v-scrollbar .jspTrack {
|
||||||
|
width: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Horizontal scrollbar */
|
||||||
|
|
||||||
|
#ws-h-scrollbar .jspHorizontalBar {
|
||||||
|
height: 7px;
|
||||||
|
border-top: 1px solid #C1C6CC;
|
||||||
|
}
|
||||||
|
#ws-h-scrollbar .jspTrack {
|
||||||
|
height: 8px;
|
||||||
|
}
|
||||||
156
www/common/onlyoffice/v1/sdkjs/cell/css/main.css
Normal file
@@ -0,0 +1,156 @@
|
|||||||
|
@charset "UTF-8";
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Worksheet canvas
|
||||||
|
* --------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ws-canvas-outer {
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
right: 14px;
|
||||||
|
bottom: 14px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ws-canvas {
|
||||||
|
border: 0;
|
||||||
|
-webkit-user-select: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ws-canvas-overlay, #ws-canvas-graphic, #ws-canvas-graphic-overlay {
|
||||||
|
-webkit-user-select: none;
|
||||||
|
border: 0;
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Worksheet scroll bars
|
||||||
|
* --------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ws-v-scrollbar {
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
width: 14px;
|
||||||
|
top: 0px;
|
||||||
|
bottom: 14px;
|
||||||
|
overflow: hidden;
|
||||||
|
z-index: 10;
|
||||||
|
background-color: #f1f1f1;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ws-v-scroll-helper {
|
||||||
|
width: 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ws-h-scrollbar {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
height: 14px;
|
||||||
|
left: 0px;
|
||||||
|
right: 14px;
|
||||||
|
overflow: hidden;
|
||||||
|
z-index: 10;
|
||||||
|
background-color: #f1f1f1;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ws-h-scroll-helper {
|
||||||
|
height: 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ws-scrollbar-corner {
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
width: 14px;
|
||||||
|
height: 14px;
|
||||||
|
background-color: #F4F4F4;
|
||||||
|
border: 0;
|
||||||
|
z-index: 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Scrollbars common */
|
||||||
|
|
||||||
|
#ws-v-scrollbar .jspVerticalBar,
|
||||||
|
#ws-h-scrollbar .jspHorizontalBar,
|
||||||
|
#ws-v-scrollbar .jspTrack,
|
||||||
|
#ws-h-scrollbar .jspTrack {
|
||||||
|
background-color: #DCE2E8;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ws-v-scrollbar .jspDrag,
|
||||||
|
#ws-h-scrollbar .jspDrag {
|
||||||
|
background-color: #C0C0C0;
|
||||||
|
}
|
||||||
|
#ws-v-scrollbar .jspDrag.jspHover,
|
||||||
|
#ws-v-scrollbar .jspDrag.jspActive,
|
||||||
|
#ws-h-scrollbar .jspDrag.jspHover,
|
||||||
|
#ws-h-scrollbar .jspDrag.jspActive {
|
||||||
|
background-color: #808080;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Vertical scrollbar */
|
||||||
|
|
||||||
|
#ws-v-scrollbar .jspVerticalBar {
|
||||||
|
width: 7px;
|
||||||
|
border-left: 1px solid #C1C6CC;
|
||||||
|
}
|
||||||
|
#ws-v-scrollbar .jspTrack {
|
||||||
|
width: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Horizontal scrollbar */
|
||||||
|
|
||||||
|
#ws-h-scrollbar .jspHorizontalBar {
|
||||||
|
height: 7px;
|
||||||
|
border-top: 1px solid #C1C6CC;
|
||||||
|
}
|
||||||
|
#ws-h-scrollbar .jspTrack {
|
||||||
|
height: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Cell editor
|
||||||
|
* --------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ce-canvas-outer {
|
||||||
|
position: absolute;
|
||||||
|
border: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ce-canvas,
|
||||||
|
#ce-canvas-overlay {
|
||||||
|
border: 0;
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ce-cursor {
|
||||||
|
position: absolute;
|
||||||
|
background-color: #000;
|
||||||
|
width: 1px;
|
||||||
|
height: 11pt;
|
||||||
|
cursor: text;
|
||||||
|
}
|
||||||
|
|
||||||
|
#apiPopUpSelector {
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
#apiPopUpList {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
max-height: 210px;
|
||||||
|
overflow: hidden;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
#apiPopUpList li {
|
||||||
|
max-width: 500px;
|
||||||
|
}
|
||||||
32687
www/common/onlyoffice/v1/sdkjs/cell/sdk-all-min.js
vendored
Normal file
567962
www/common/onlyoffice/v1/sdkjs/cell/sdk-all.js
Normal file
115
www/common/onlyoffice/v1/sdkjs/common/AllFonts.js
Normal file
|
After Width: | Height: | Size: 363 B |
|
After Width: | Height: | Size: 672 B |
|
After Width: | Height: | Size: 358 B |
|
After Width: | Height: | Size: 650 B |
@@ -0,0 +1,17 @@
|
|||||||
|
plus.png
|
||||||
|
x:6 y:6
|
||||||
|
|
||||||
|
plus_2x.png
|
||||||
|
x:12 y:12
|
||||||
|
|
||||||
|
plus_copy.png
|
||||||
|
x:6 y:12
|
||||||
|
|
||||||
|
plus_copy_2x.png
|
||||||
|
x:12 y:25
|
||||||
|
|
||||||
|
text_copy.png
|
||||||
|
x:2 y:11
|
||||||
|
|
||||||
|
text_copy_2x.png
|
||||||
|
x:5 y:23
|
||||||
BIN
www/common/onlyoffice/v1/sdkjs/common/Images/fonts_thumbnail.png
Normal file
|
After Width: | Height: | Size: 46 KiB |
|
After Width: | Height: | Size: 102 KiB |
BIN
www/common/onlyoffice/v1/sdkjs/common/Images/marker_format.cur
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
www/common/onlyoffice/v1/sdkjs/common/Images/marker_format.png
Normal file
|
After Width: | Height: | Size: 132 B |
|
After Width: | Height: | Size: 4.8 KiB |
|
After Width: | Height: | Size: 161 B |
BIN
www/common/onlyoffice/v1/sdkjs/common/Images/plus.cur
Normal file
|
After Width: | Height: | Size: 902 B |
BIN
www/common/onlyoffice/v1/sdkjs/common/Images/plus.png
Normal file
|
After Width: | Height: | Size: 176 B |
BIN
www/common/onlyoffice/v1/sdkjs/common/Images/plus_2x.cur
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
www/common/onlyoffice/v1/sdkjs/common/Images/plus_2x.png
Normal file
|
After Width: | Height: | Size: 201 B |
BIN
www/common/onlyoffice/v1/sdkjs/common/Images/plus_copy.cur
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
www/common/onlyoffice/v1/sdkjs/common/Images/plus_copy.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
www/common/onlyoffice/v1/sdkjs/common/Images/plus_copy_2x.cur
Normal file
|
After Width: | Height: | Size: 7.3 KiB |
BIN
www/common/onlyoffice/v1/sdkjs/common/Images/plus_copy_2x.png
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
www/common/onlyoffice/v1/sdkjs/common/Images/select_cell.cur
Normal file
|
After Width: | Height: | Size: 502 B |
BIN
www/common/onlyoffice/v1/sdkjs/common/Images/select_cell.png
Normal file
|
After Width: | Height: | Size: 110 B |
BIN
www/common/onlyoffice/v1/sdkjs/common/Images/select_cell_2x.cur
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
www/common/onlyoffice/v1/sdkjs/common/Images/select_cell_2x.png
Normal file
|
After Width: | Height: | Size: 149 B |
BIN
www/common/onlyoffice/v1/sdkjs/common/Images/select_column.cur
Normal file
|
After Width: | Height: | Size: 542 B |
BIN
www/common/onlyoffice/v1/sdkjs/common/Images/select_column.png
Normal file
|
After Width: | Height: | Size: 107 B |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 145 B |
BIN
www/common/onlyoffice/v1/sdkjs/common/Images/select_row.cur
Normal file
|
After Width: | Height: | Size: 530 B |
BIN
www/common/onlyoffice/v1/sdkjs/common/Images/select_row.png
Normal file
|
After Width: | Height: | Size: 107 B |
BIN
www/common/onlyoffice/v1/sdkjs/common/Images/select_row_2x.cur
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
www/common/onlyoffice/v1/sdkjs/common/Images/select_row_2x.png
Normal file
|
After Width: | Height: | Size: 141 B |
BIN
www/common/onlyoffice/v1/sdkjs/common/Images/table_move.png
Normal file
|
After Width: | Height: | Size: 118 B |
BIN
www/common/onlyoffice/v1/sdkjs/common/Images/table_move_2x.png
Normal file
|
After Width: | Height: | Size: 166 B |
BIN
www/common/onlyoffice/v1/sdkjs/common/Images/text_copy.cur
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
www/common/onlyoffice/v1/sdkjs/common/Images/text_copy.png
Normal file
|
After Width: | Height: | Size: 131 B |
BIN
www/common/onlyoffice/v1/sdkjs/common/Images/text_copy_2x.cur
Normal file
|
After Width: | Height: | Size: 6.0 KiB |
BIN
www/common/onlyoffice/v1/sdkjs/common/Images/text_copy_2x.png
Normal file
|
After Width: | Height: | Size: 200 B |
8996
www/common/onlyoffice/v1/sdkjs/common/Native/jquery_native.js
vendored
Normal file
856
www/common/onlyoffice/v1/sdkjs/common/Native/native.js
Normal file
@@ -0,0 +1,856 @@
|
|||||||
|
/*
|
||||||
|
* (c) Copyright Ascensio System SIA 2010-2018
|
||||||
|
*
|
||||||
|
* This program is a free software product. You can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||||
|
* version 3 as published by the Free Software Foundation. In accordance with
|
||||||
|
* Section 7(a) of the GNU AGPL 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
|
||||||
|
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||||
|
*
|
||||||
|
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
|
||||||
|
* EU, LV-1021.
|
||||||
|
*
|
||||||
|
* The interactive user interfaces in modified source and object code versions
|
||||||
|
* of the Program must display Appropriate Legal Notices, as required under
|
||||||
|
* Section 5 of the GNU AGPL version 3.
|
||||||
|
*
|
||||||
|
* Pursuant to Section 7(b) of the License you must retain the original Product
|
||||||
|
* logo when distributing the program. Pursuant to Section 7(e) we decline to
|
||||||
|
* grant you any rights under trademark law for use of our trademarks.
|
||||||
|
*
|
||||||
|
* All the Product's GUI elements, including illustrations and icon sets, as
|
||||||
|
* well as technical writing content are licensed under the terms of the
|
||||||
|
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
|
||||||
|
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
var editor = undefined;
|
||||||
|
var window = {};
|
||||||
|
var navigator = {};
|
||||||
|
navigator.userAgent = "chrome";
|
||||||
|
window.navigator = navigator;
|
||||||
|
window.location = {};
|
||||||
|
|
||||||
|
window.location.protocol = "";
|
||||||
|
window.location.host = "";
|
||||||
|
window.location.href = "";
|
||||||
|
window.location.pathname = "";
|
||||||
|
|
||||||
|
window.NATIVE_EDITOR_ENJINE = true;
|
||||||
|
window.NATIVE_EDITOR_ENJINE_SYNC_RECALC = true;
|
||||||
|
|
||||||
|
var document = {};
|
||||||
|
window.document = document;
|
||||||
|
|
||||||
|
window["Asc"] = {};
|
||||||
|
var Asc = window["Asc"];
|
||||||
|
|
||||||
|
window["AscFonts"] = {};
|
||||||
|
var AscFonts = window["AscFonts"];
|
||||||
|
|
||||||
|
window["AscCommon"] = {};
|
||||||
|
var AscCommon = window["AscCommon"];
|
||||||
|
|
||||||
|
window["AscFormat"] = {};
|
||||||
|
var AscFormat = window["AscFormat"];
|
||||||
|
|
||||||
|
window["AscDFH"] = {};
|
||||||
|
var AscDFH = window["AscDFH"];
|
||||||
|
|
||||||
|
window["AscCH"] = {};
|
||||||
|
var AscCH = window["AscCH"];
|
||||||
|
|
||||||
|
window["AscCommonExcel"] = {};
|
||||||
|
var AscCommonExcel = window["AscCommonExcel"];
|
||||||
|
|
||||||
|
window["AscCommonWord"] = {};
|
||||||
|
var AscCommonWord = window["AscCommonWord"];
|
||||||
|
|
||||||
|
window["AscCommonSlide"] = {};
|
||||||
|
var AscCommonSlide = window["AscCommonSlide"];
|
||||||
|
|
||||||
|
function ConvertJSC_Array(_array)
|
||||||
|
{
|
||||||
|
var _len = _array.length;
|
||||||
|
var ret = new Uint8Array(_len);
|
||||||
|
for (var i = 0; i < _len; i++)
|
||||||
|
ret[i] = _array.getAt(i);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
function Image()
|
||||||
|
{
|
||||||
|
this.src = "";
|
||||||
|
this.onload = function ()
|
||||||
|
{
|
||||||
|
};
|
||||||
|
this.onerror = function ()
|
||||||
|
{
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function _image_data()
|
||||||
|
{
|
||||||
|
this.data = null;
|
||||||
|
this.length = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
function native_pattern_fill()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
native_pattern_fill.prototype =
|
||||||
|
{
|
||||||
|
setTransform: function (transform)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
function native_gradient_fill()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
native_gradient_fill.prototype =
|
||||||
|
{
|
||||||
|
addColorStop: function (offset, color)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
function native_context2d(parent)
|
||||||
|
{
|
||||||
|
this.canvas = parent;
|
||||||
|
|
||||||
|
this.globalAlpha = 0;
|
||||||
|
this.globalCompositeOperation = "";
|
||||||
|
this.fillStyle = "";
|
||||||
|
this.strokeStyle = "";
|
||||||
|
|
||||||
|
this.lineWidth = 0;
|
||||||
|
this.lineCap = 0;
|
||||||
|
this.lineJoin = 0;
|
||||||
|
this.miterLimit = 0;
|
||||||
|
this.shadowOffsetX = 0;
|
||||||
|
this.shadowOffsetY = 0;
|
||||||
|
this.shadowBlur = 0;
|
||||||
|
this.shadowColor = 0;
|
||||||
|
this.font = "";
|
||||||
|
this.textAlign = 0;
|
||||||
|
this.textBaseline = 0;
|
||||||
|
}
|
||||||
|
native_context2d.prototype =
|
||||||
|
{
|
||||||
|
save: function ()
|
||||||
|
{
|
||||||
|
},
|
||||||
|
restore: function ()
|
||||||
|
{
|
||||||
|
},
|
||||||
|
|
||||||
|
scale: function (x, y)
|
||||||
|
{
|
||||||
|
},
|
||||||
|
rotate: function (angle)
|
||||||
|
{
|
||||||
|
},
|
||||||
|
translate: function (x, y)
|
||||||
|
{
|
||||||
|
},
|
||||||
|
transform: function (m11, m12, m21, m22, dx, dy)
|
||||||
|
{
|
||||||
|
},
|
||||||
|
setTransform: function (m11, m12, m21, m22, dx, dy)
|
||||||
|
{
|
||||||
|
},
|
||||||
|
|
||||||
|
createLinearGradient: function (x0, y0, x1, y1)
|
||||||
|
{
|
||||||
|
return new native_gradient_fill();
|
||||||
|
},
|
||||||
|
createRadialGradient: function (x0, y0, r0, x1, y1, r1)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
createPattern: function (image, repetition)
|
||||||
|
{
|
||||||
|
return new native_pattern_fill();
|
||||||
|
},
|
||||||
|
|
||||||
|
clearRect: function (x, y, w, h)
|
||||||
|
{
|
||||||
|
},
|
||||||
|
fillRect: function (x, y, w, h)
|
||||||
|
{
|
||||||
|
},
|
||||||
|
strokeRect: function (x, y, w, h)
|
||||||
|
{
|
||||||
|
},
|
||||||
|
|
||||||
|
beginPath: function ()
|
||||||
|
{
|
||||||
|
},
|
||||||
|
closePath: function ()
|
||||||
|
{
|
||||||
|
},
|
||||||
|
moveTo: function (x, y)
|
||||||
|
{
|
||||||
|
},
|
||||||
|
lineTo: function (x, y)
|
||||||
|
{
|
||||||
|
},
|
||||||
|
quadraticCurveTo: function (cpx, cpy, x, y)
|
||||||
|
{
|
||||||
|
},
|
||||||
|
bezierCurveTo: function (cp1x, cp1y, cp2x, cp2y, x, y)
|
||||||
|
{
|
||||||
|
},
|
||||||
|
arcTo: function (x1, y1, x2, y2, radius)
|
||||||
|
{
|
||||||
|
},
|
||||||
|
rect: function (x, y, w, h)
|
||||||
|
{
|
||||||
|
},
|
||||||
|
arc: function (x, y, radius, startAngle, endAngle, anticlockwise)
|
||||||
|
{
|
||||||
|
},
|
||||||
|
|
||||||
|
fill: function ()
|
||||||
|
{
|
||||||
|
},
|
||||||
|
stroke: function ()
|
||||||
|
{
|
||||||
|
},
|
||||||
|
clip: function ()
|
||||||
|
{
|
||||||
|
},
|
||||||
|
isPointInPath: function (x, y)
|
||||||
|
{
|
||||||
|
},
|
||||||
|
drawFocusRing: function (element, xCaret, yCaret, canDrawCustom)
|
||||||
|
{
|
||||||
|
},
|
||||||
|
|
||||||
|
fillText: function (text, x, y, maxWidth)
|
||||||
|
{
|
||||||
|
},
|
||||||
|
strokeText: function (text, x, y, maxWidth)
|
||||||
|
{
|
||||||
|
},
|
||||||
|
measureText: function (text)
|
||||||
|
{
|
||||||
|
},
|
||||||
|
|
||||||
|
drawImage: function (img_elem, dx_or_sx, dy_or_sy, dw_or_sw, dh_or_sh, dx, dy, dw, dh)
|
||||||
|
{
|
||||||
|
},
|
||||||
|
|
||||||
|
createImageData: function (imagedata_or_sw, sh)
|
||||||
|
{
|
||||||
|
var _data = new _image_data();
|
||||||
|
_data.length = imagedata_or_sw * sh * 4;
|
||||||
|
_data.data = (typeof(Uint8Array) != 'undefined') ? new Uint8Array(_data.length) : new Array(_data.length);
|
||||||
|
return _data;
|
||||||
|
},
|
||||||
|
getImageData: function (sx, sy, sw, sh)
|
||||||
|
{
|
||||||
|
},
|
||||||
|
putImageData: function (image_data, dx, dy, dirtyX, dirtyY, dirtyWidth, dirtyHeight)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
function native_canvas()
|
||||||
|
{
|
||||||
|
this.id = "";
|
||||||
|
this.width = 300;
|
||||||
|
this.height = 150;
|
||||||
|
|
||||||
|
this.nodeType = 1;
|
||||||
|
}
|
||||||
|
native_canvas.prototype =
|
||||||
|
{
|
||||||
|
getContext: function (type)
|
||||||
|
{
|
||||||
|
if (type == "2d")
|
||||||
|
return new native_context2d(this);
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
|
||||||
|
toDataUrl: function (type)
|
||||||
|
{
|
||||||
|
return "";
|
||||||
|
},
|
||||||
|
|
||||||
|
addEventListener: function ()
|
||||||
|
{
|
||||||
|
},
|
||||||
|
|
||||||
|
attr: function ()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var _null_object = {};
|
||||||
|
_null_object.length = 0;
|
||||||
|
_null_object.nodeType = 1;
|
||||||
|
_null_object.offsetWidth = 1;
|
||||||
|
_null_object.offsetHeight = 1;
|
||||||
|
_null_object.clientWidth = 1;
|
||||||
|
_null_object.clientHeight = 1;
|
||||||
|
_null_object.scrollWidth = 1;
|
||||||
|
_null_object.scrollHeight = 1;
|
||||||
|
_null_object.style = {};
|
||||||
|
_null_object.documentElement = _null_object;
|
||||||
|
_null_object.body = _null_object;
|
||||||
|
_null_object.ownerDocument = _null_object;
|
||||||
|
_null_object.defaultView = _null_object;
|
||||||
|
|
||||||
|
_null_object.addEventListener = function ()
|
||||||
|
{
|
||||||
|
};
|
||||||
|
_null_object.setAttribute = function ()
|
||||||
|
{
|
||||||
|
};
|
||||||
|
_null_object.getElementsByTagName = function ()
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
};
|
||||||
|
_null_object.appendChild = function ()
|
||||||
|
{
|
||||||
|
};
|
||||||
|
_null_object.removeChild = function ()
|
||||||
|
{
|
||||||
|
};
|
||||||
|
_null_object.insertBefore = function ()
|
||||||
|
{
|
||||||
|
};
|
||||||
|
_null_object.childNodes = [];
|
||||||
|
_null_object.parent = _null_object;
|
||||||
|
_null_object.parentNode = _null_object;
|
||||||
|
_null_object.find = function ()
|
||||||
|
{
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
_null_object.appendTo = function ()
|
||||||
|
{
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
_null_object.css = function ()
|
||||||
|
{
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
_null_object.width = function ()
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
};
|
||||||
|
_null_object.height = function ()
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
};
|
||||||
|
_null_object.attr = function ()
|
||||||
|
{
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
_null_object.prop = function ()
|
||||||
|
{
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
_null_object.val = function ()
|
||||||
|
{
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
_null_object.remove = function ()
|
||||||
|
{
|
||||||
|
};
|
||||||
|
_null_object.getComputedStyle = function ()
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
};
|
||||||
|
_null_object.getContext = function (type)
|
||||||
|
{
|
||||||
|
if (type == "2d")
|
||||||
|
return new native_context2d(this);
|
||||||
|
return null;
|
||||||
|
};
|
||||||
|
|
||||||
|
window._null_object = _null_object;
|
||||||
|
|
||||||
|
document.createElement = function (type)
|
||||||
|
{
|
||||||
|
if (type && type.toLowerCase)
|
||||||
|
{
|
||||||
|
if (type.toLowerCase() == "canvas")
|
||||||
|
return new native_canvas();
|
||||||
|
}
|
||||||
|
|
||||||
|
return _null_object;
|
||||||
|
};
|
||||||
|
|
||||||
|
function _return_empty_html_element()
|
||||||
|
{
|
||||||
|
return _null_object;
|
||||||
|
};
|
||||||
|
|
||||||
|
document.createDocumentFragment = _return_empty_html_element;
|
||||||
|
document.getElementsByTagName = function (tag)
|
||||||
|
{
|
||||||
|
var ret = [];
|
||||||
|
if ("head" == tag)
|
||||||
|
ret.push(_null_object);
|
||||||
|
return ret;
|
||||||
|
};
|
||||||
|
document.insertBefore = function ()
|
||||||
|
{
|
||||||
|
};
|
||||||
|
document.appendChild = function ()
|
||||||
|
{
|
||||||
|
};
|
||||||
|
document.removeChild = function ()
|
||||||
|
{
|
||||||
|
};
|
||||||
|
document.getElementById = function ()
|
||||||
|
{
|
||||||
|
return _null_object;
|
||||||
|
};
|
||||||
|
document.createComment = function ()
|
||||||
|
{
|
||||||
|
return undefined;
|
||||||
|
};
|
||||||
|
|
||||||
|
document.documentElement = _null_object;
|
||||||
|
document.body = _null_object;
|
||||||
|
|
||||||
|
var native = (typeof native === undefined) ? undefined : native;
|
||||||
|
if (!native)
|
||||||
|
{
|
||||||
|
if (typeof NativeEngine === "undefined")
|
||||||
|
{
|
||||||
|
native = CreateNativeEngine();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
native = NativeEngine;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
window.native = native;
|
||||||
|
|
||||||
|
function GetNativeEngine()
|
||||||
|
{
|
||||||
|
return window.native;
|
||||||
|
}
|
||||||
|
|
||||||
|
var native_renderer = null;
|
||||||
|
var Api = null;
|
||||||
|
var _api = null;
|
||||||
|
|
||||||
|
function NativeOpenFileData(data, version, xlsx_file_path)
|
||||||
|
{
|
||||||
|
window.NATIVE_DOCUMENT_TYPE = window.native.GetEditorType();
|
||||||
|
|
||||||
|
if (window.NATIVE_DOCUMENT_TYPE == "presentation" || window.NATIVE_DOCUMENT_TYPE == "document")
|
||||||
|
{
|
||||||
|
_api = new window["Asc"]["asc_docs_api"]({});
|
||||||
|
_api.asc_nativeOpenFile(data, version);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_api = new window["Asc"]["spreadsheet_api"]({});
|
||||||
|
_api.asc_nativeOpenFile(data, version, undefined, xlsx_file_path);
|
||||||
|
}
|
||||||
|
Api = _api;
|
||||||
|
}
|
||||||
|
|
||||||
|
function NativeOpenFile()
|
||||||
|
{
|
||||||
|
var doc_bin = window.native.GetFileString(window.native.GetFilePath());
|
||||||
|
window.NATIVE_DOCUMENT_TYPE = window.native.GetEditorType();
|
||||||
|
|
||||||
|
if (window.NATIVE_DOCUMENT_TYPE == "presentation" || window.NATIVE_DOCUMENT_TYPE == "document")
|
||||||
|
{
|
||||||
|
_api = new window["Asc"]["asc_docs_api"]("");
|
||||||
|
|
||||||
|
_api.asc_nativeOpenFile(doc_bin);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_api = new window["Asc"]["spreadsheet_api"]();
|
||||||
|
_api.asc_nativeOpenFile(doc_bin);
|
||||||
|
}
|
||||||
|
Api = _api;
|
||||||
|
}
|
||||||
|
|
||||||
|
function NativeOpenFile2(_params)
|
||||||
|
{
|
||||||
|
window["CreateMainTextMeasurerWrapper"]();
|
||||||
|
|
||||||
|
window.g_file_path = "native_open_file";
|
||||||
|
window.NATIVE_DOCUMENT_TYPE = window.native.GetEditorType();
|
||||||
|
var doc_bin = window.native.GetFileString(window.g_file_path);
|
||||||
|
if (window.NATIVE_DOCUMENT_TYPE == "presentation" || window.NATIVE_DOCUMENT_TYPE == "document")
|
||||||
|
{
|
||||||
|
_api = new window["Asc"]["asc_docs_api"]("");
|
||||||
|
|
||||||
|
if (undefined !== _api.Native_Editor_Initialize_Settings)
|
||||||
|
{
|
||||||
|
_api.Native_Editor_Initialize_Settings(_params);
|
||||||
|
}
|
||||||
|
|
||||||
|
_api.asc_nativeOpenFile(doc_bin);
|
||||||
|
|
||||||
|
if (_api.NativeAfterLoad)
|
||||||
|
_api.NativeAfterLoad();
|
||||||
|
|
||||||
|
// ToDo get_PropertyThemeColorSchemes method removed, now the only Event!!!!
|
||||||
|
/*if (_api.__SendThemeColorScheme)
|
||||||
|
_api.__SendThemeColorScheme();
|
||||||
|
|
||||||
|
if (_api.get_PropertyThemeColorSchemes)
|
||||||
|
{
|
||||||
|
var schemes = _api.get_PropertyThemeColorSchemes();
|
||||||
|
if (schemes)
|
||||||
|
{
|
||||||
|
var st = global_memory_stream_menu;
|
||||||
|
st["ClearNoAttack"]();
|
||||||
|
AscCommon.asc_WriteColorSchemes(schemes, st);
|
||||||
|
window["native"]["OnCallMenuEvent"](2404, st); // ASC_MENU_EVENT_TYPE_COLOR_SCHEMES
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_api = new window["Asc"]["spreadsheet_api"]();
|
||||||
|
_api.asc_nativeOpenFile(doc_bin);
|
||||||
|
}
|
||||||
|
|
||||||
|
Api = _api;
|
||||||
|
}
|
||||||
|
|
||||||
|
function NativeCalculateFile()
|
||||||
|
{
|
||||||
|
_api.asc_nativeCalculateFile();
|
||||||
|
}
|
||||||
|
|
||||||
|
function NativeApplyChangesData(data, isFull)
|
||||||
|
{
|
||||||
|
if (window.NATIVE_DOCUMENT_TYPE == "presentation" || window.NATIVE_DOCUMENT_TYPE == "document")
|
||||||
|
{
|
||||||
|
_api.asc_nativeApplyChanges2(data, isFull);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_api.asc_nativeApplyChanges2(data, isFull);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function NativeApplyChanges()
|
||||||
|
{
|
||||||
|
if (window.NATIVE_DOCUMENT_TYPE == "presentation" || window.NATIVE_DOCUMENT_TYPE == "document")
|
||||||
|
{
|
||||||
|
var __changes = [];
|
||||||
|
var _count_main = window.native.GetCountChanges();
|
||||||
|
for (var i = 0; i < _count_main; i++)
|
||||||
|
{
|
||||||
|
var _changes_file = window.native.GetChangesFile(i);
|
||||||
|
var _changes = JSON.parse(window.native.GetFileString(_changes_file));
|
||||||
|
|
||||||
|
for (var j = 0; j < _changes.length; j++)
|
||||||
|
{
|
||||||
|
__changes.push(_changes[j]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_api.asc_nativeApplyChanges(__changes);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var __changes = [];
|
||||||
|
var _count_main = window.native.GetCountChanges();
|
||||||
|
for (var i = 0; i < _count_main; i++)
|
||||||
|
{
|
||||||
|
var _changes_file = window.native.GetChangesFile(i);
|
||||||
|
var _changes = JSON.parse(window.native.GetFileString(_changes_file));
|
||||||
|
|
||||||
|
for (var j = 0; j < _changes.length; j++)
|
||||||
|
{
|
||||||
|
__changes.push(_changes[j]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_api.asc_nativeApplyChanges(__changes);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function NativeGetFileString()
|
||||||
|
{
|
||||||
|
return _api.asc_nativeGetFile();
|
||||||
|
}
|
||||||
|
function NativeGetFileData()
|
||||||
|
{
|
||||||
|
return _api.asc_nativeGetFileData();
|
||||||
|
}
|
||||||
|
function NativeGetFileDataHtml()
|
||||||
|
{
|
||||||
|
if (_api.asc_nativeGetHtml)
|
||||||
|
return _api.asc_nativeGetHtml();
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
function NativeStartMailMergeByList(database)
|
||||||
|
{
|
||||||
|
if (_api.asc_StartMailMergeByList)
|
||||||
|
return _api.asc_StartMailMergeByList(database);
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
function NativePreviewMailMergeResult(index)
|
||||||
|
{
|
||||||
|
if (_api.asc_PreviewMailMergeResult)
|
||||||
|
return _api.asc_PreviewMailMergeResult(index);
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
function NativeGetMailMergeFiledValue(index, name)
|
||||||
|
{
|
||||||
|
if (_api.asc_GetMailMergeFiledValue)
|
||||||
|
return _api.asc_GetMailMergeFiledValue(index, name);
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetNativeCountPages()
|
||||||
|
{
|
||||||
|
return _api.asc_nativePrintPagesCount();
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetNativeFileDataPDF(_param)
|
||||||
|
{
|
||||||
|
return _api.asc_nativeGetPDF(_param);
|
||||||
|
}
|
||||||
|
|
||||||
|
window.memory1 = null;
|
||||||
|
window.memory2 = null;
|
||||||
|
|
||||||
|
function GetNativePageBase64(pageIndex)
|
||||||
|
{
|
||||||
|
if (null == window.memory1)
|
||||||
|
window.memory1 = CreateNativeMemoryStream();
|
||||||
|
else
|
||||||
|
window.memory1.ClearNoAttack();
|
||||||
|
|
||||||
|
if (null == window.memory2)
|
||||||
|
window.memory2 = CreateNativeMemoryStream();
|
||||||
|
else
|
||||||
|
window.memory2.ClearNoAttack();
|
||||||
|
|
||||||
|
if (native_renderer == null)
|
||||||
|
{
|
||||||
|
native_renderer = _api.asc_nativeCheckPdfRenderer(window.memory1, window.memory2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
window.memory1.ClearNoAttack();
|
||||||
|
window.memory2.ClearNoAttack();
|
||||||
|
}
|
||||||
|
|
||||||
|
_api.asc_nativePrint(native_renderer, pageIndex);
|
||||||
|
return window.memory1;
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetNativePageMeta(pageIndex)
|
||||||
|
{
|
||||||
|
return _api.GetNativePageMeta(pageIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetNativeId()
|
||||||
|
{
|
||||||
|
return window.native.GetFileId();
|
||||||
|
}
|
||||||
|
|
||||||
|
// для работы с таймерами
|
||||||
|
window.NativeSupportTimeouts = false;
|
||||||
|
window.NativeTimeoutObject = {};
|
||||||
|
|
||||||
|
function clearTimeout(_id)
|
||||||
|
{
|
||||||
|
if (!window.NativeSupportTimeouts)
|
||||||
|
return;
|
||||||
|
|
||||||
|
window.NativeTimeoutObject["" + _id] = undefined;
|
||||||
|
window.native["ClearTimeout"](_id);
|
||||||
|
}
|
||||||
|
function setTimeout(func, interval)
|
||||||
|
{
|
||||||
|
if (!window.NativeSupportTimeouts)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var _id = window.native["GenerateTimeoutId"](interval);
|
||||||
|
window.NativeTimeoutObject["" + _id] = func;
|
||||||
|
return _id;
|
||||||
|
}
|
||||||
|
|
||||||
|
window.native.Call_TimeoutFire = function (_id)
|
||||||
|
{
|
||||||
|
if (!window.NativeSupportTimeouts)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var _prop = "" + _id;
|
||||||
|
var _func = window.NativeTimeoutObject[_prop];
|
||||||
|
window.NativeTimeoutObject[_prop] = undefined;
|
||||||
|
|
||||||
|
if (!_func)
|
||||||
|
return;
|
||||||
|
|
||||||
|
_func.call(null);
|
||||||
|
_func = null;
|
||||||
|
};
|
||||||
|
|
||||||
|
function clearInterval(_id)
|
||||||
|
{
|
||||||
|
if (!window.NativeSupportTimeouts)
|
||||||
|
return;
|
||||||
|
|
||||||
|
window.NativeTimeoutObject["" + _id] = undefined;
|
||||||
|
window.native["ClearTimeout"](_id);
|
||||||
|
}
|
||||||
|
function setInterval(func, interval)
|
||||||
|
{
|
||||||
|
if (!window.NativeSupportTimeouts)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var _intervalFunc = function ()
|
||||||
|
{
|
||||||
|
func.call(null);
|
||||||
|
setTimeout(func, interval);
|
||||||
|
};
|
||||||
|
|
||||||
|
var _id = window.native["GenerateTimeoutId"](interval);
|
||||||
|
window.NativeTimeoutObject["" + _id] = _intervalFunc;
|
||||||
|
return _id;
|
||||||
|
}
|
||||||
|
|
||||||
|
window.clearTimeout = clearTimeout;
|
||||||
|
window.setTimeout = setTimeout;
|
||||||
|
window.clearInterval = clearInterval;
|
||||||
|
window.setInterval = setInterval;
|
||||||
|
|
||||||
|
var console = {
|
||||||
|
log: function (param)
|
||||||
|
{
|
||||||
|
window.native.ConsoleLog(param);
|
||||||
|
},
|
||||||
|
time: function (param)
|
||||||
|
{
|
||||||
|
},
|
||||||
|
timeEnd: function (param)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
window["NativeCorrectImageUrlOnPaste"] = function (url)
|
||||||
|
{
|
||||||
|
return window["native"]["CorrectImageUrlOnPaste"](url);
|
||||||
|
};
|
||||||
|
window["NativeCorrectImageUrlOnCopy"] = function (url)
|
||||||
|
{
|
||||||
|
return window["native"]["CorrectImageUrlOnCopy"](url);
|
||||||
|
};
|
||||||
|
|
||||||
|
var global_memory_stream_menu = CreateNativeMemoryStream();
|
||||||
|
|
||||||
|
// HTML page interface
|
||||||
|
window.native.Call_OnUpdateOverlay = function (param)
|
||||||
|
{
|
||||||
|
return _api.Call_OnUpdateOverlay(param);
|
||||||
|
};
|
||||||
|
|
||||||
|
window.native.Call_OnMouseDown = function (e)
|
||||||
|
{
|
||||||
|
return _api.Call_OnMouseDown(e);
|
||||||
|
};
|
||||||
|
window.native.Call_OnMouseUp = function (e)
|
||||||
|
{
|
||||||
|
return _api.Call_OnMouseUp(e);
|
||||||
|
};
|
||||||
|
window.native.Call_OnMouseMove = function (e)
|
||||||
|
{
|
||||||
|
return _api.Call_OnMouseMove(e);
|
||||||
|
};
|
||||||
|
window.native.Call_OnCheckMouseDown = function (e)
|
||||||
|
{
|
||||||
|
return _api.Call_OnCheckMouseDown(e);
|
||||||
|
};
|
||||||
|
|
||||||
|
window.native.Call_OnKeyDown = function (e)
|
||||||
|
{
|
||||||
|
return _api.Call_OnKeyDown(e);
|
||||||
|
};
|
||||||
|
window.native.Call_OnKeyPress = function (e)
|
||||||
|
{
|
||||||
|
return _api.Call_OnKeyPress(e);
|
||||||
|
};
|
||||||
|
window.native.Call_OnKeyUp = function (e)
|
||||||
|
{
|
||||||
|
return _api.Call_OnKeyUp(e);
|
||||||
|
};
|
||||||
|
window.native.Call_OnKeyboardEvent = function (e)
|
||||||
|
{
|
||||||
|
return _api.Call_OnKeyboardEvent(e);
|
||||||
|
};
|
||||||
|
|
||||||
|
window.native.Call_CalculateResume = function ()
|
||||||
|
{
|
||||||
|
return _api.Call_CalculateResume();
|
||||||
|
};
|
||||||
|
|
||||||
|
window.native.Call_TurnOffRecalculate = function ()
|
||||||
|
{
|
||||||
|
return _api.Call_TurnOffRecalculate();
|
||||||
|
};
|
||||||
|
window.native.Call_TurnOnRecalculate = function ()
|
||||||
|
{
|
||||||
|
return _api.Call_TurnOnRecalculate();
|
||||||
|
};
|
||||||
|
|
||||||
|
window.native.Call_CheckTargetUpdate = function ()
|
||||||
|
{
|
||||||
|
return _api.Call_CheckTargetUpdate();
|
||||||
|
};
|
||||||
|
window.native.Call_Common = function (type, param)
|
||||||
|
{
|
||||||
|
return _api.Call_Common(type, param);
|
||||||
|
};
|
||||||
|
|
||||||
|
window.native.Call_HR_Tabs = function (arrT, arrP)
|
||||||
|
{
|
||||||
|
return _api.Call_HR_Tabs(arrT, arrP);
|
||||||
|
};
|
||||||
|
window.native.Call_HR_Pr = function (_indent_left, _indent_right, _indent_first)
|
||||||
|
{
|
||||||
|
return _api.Call_HR_Pr(_indent_left, _indent_right, _indent_first);
|
||||||
|
};
|
||||||
|
window.native.Call_HR_Margins = function (_margin_left, _margin_right)
|
||||||
|
{
|
||||||
|
return _api.Call_HR_Margins(_margin_left, _margin_right);
|
||||||
|
};
|
||||||
|
window.native.Call_HR_Table = function (_params, _cols, _margins, _rows)
|
||||||
|
{
|
||||||
|
return _api.Call_HR_Table(_params, _cols, _margins, _rows);
|
||||||
|
};
|
||||||
|
|
||||||
|
window.native.Call_VR_Margins = function (_top, _bottom)
|
||||||
|
{
|
||||||
|
return _api.Call_VR_Margins(_top, _bottom);
|
||||||
|
};
|
||||||
|
window.native.Call_VR_Header = function (_header_top, _header_bottom)
|
||||||
|
{
|
||||||
|
return _api.Call_VR_Header(_header_top, _header_bottom);
|
||||||
|
};
|
||||||
|
window.native.Call_VR_Table = function (_params, _cols, _margins, _rows)
|
||||||
|
{
|
||||||
|
return _api.Call_VR_Table(_params, _cols, _margins, _rows);
|
||||||
|
};
|
||||||
|
|
||||||
|
window.native.Call_Menu_Event = function (type, _params)
|
||||||
|
{
|
||||||
|
return _api.Call_Menu_Event(type, _params);
|
||||||
|
};
|
||||||
35121
www/common/onlyoffice/v1/sdkjs/slide/sdk-all-min.js
vendored
Normal file
499502
www/common/onlyoffice/v1/sdkjs/slide/sdk-all.js
Normal file
108
www/common/onlyoffice/v1/sdkjs/slide/themes/Themes.js
Normal file
BIN
www/common/onlyoffice/v1/sdkjs/slide/themes/theme1/blank.pptx
Normal file
33
www/common/onlyoffice/v1/sdkjs/slide/themes/theme1/theme.js
Normal file
BIN
www/common/onlyoffice/v1/sdkjs/slide/themes/theme10/corner.pptx
Normal file
33
www/common/onlyoffice/v1/sdkjs/slide/themes/theme10/theme.js
Normal file
33
www/common/onlyoffice/v1/sdkjs/slide/themes/theme11/theme.js
Normal file
BIN
www/common/onlyoffice/v1/sdkjs/slide/themes/theme11/tort.pptx
Normal file
BIN
www/common/onlyoffice/v1/sdkjs/slide/themes/theme2/basic.pptx
Normal file
33
www/common/onlyoffice/v1/sdkjs/slide/themes/theme2/theme.js
Normal file
BIN
www/common/onlyoffice/v1/sdkjs/slide/themes/theme3/classic.pptx
Normal file
|
After Width: | Height: | Size: 131 KiB |
|
After Width: | Height: | Size: 163 KiB |
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 540 KiB |
33
www/common/onlyoffice/v1/sdkjs/slide/themes/theme3/theme.js
Normal file
BIN
www/common/onlyoffice/v1/sdkjs/slide/themes/theme4/official.pptx
Normal file
33
www/common/onlyoffice/v1/sdkjs/slide/themes/theme4/theme.js
Normal file
|
After Width: | Height: | Size: 24 KiB |
33
www/common/onlyoffice/v1/sdkjs/slide/themes/theme5/theme.js
Normal file
BIN
www/common/onlyoffice/v1/sdkjs/slide/themes/theme6/lines.pptx
Normal file
|
After Width: | Height: | Size: 40 KiB |
|
After Width: | Height: | Size: 36 KiB |
33
www/common/onlyoffice/v1/sdkjs/slide/themes/theme6/theme.js
Normal file
BIN
www/common/onlyoffice/v1/sdkjs/slide/themes/theme7/office.pptx
Normal file
33
www/common/onlyoffice/v1/sdkjs/slide/themes/theme7/theme.js
Normal file
|
After Width: | Height: | Size: 384 KiB |
|
After Width: | Height: | Size: 128 KiB |
|
After Width: | Height: | Size: 362 KiB |
BIN
www/common/onlyoffice/v1/sdkjs/slide/themes/theme8/safari.pptx
Normal file
33
www/common/onlyoffice/v1/sdkjs/slide/themes/theme8/theme.js
Normal file
BIN
www/common/onlyoffice/v1/sdkjs/slide/themes/theme9/dotted.pptx
Normal file
33
www/common/onlyoffice/v1/sdkjs/slide/themes/theme9/theme.js
Normal file
|
After Width: | Height: | Size: 704 B |
|
After Width: | Height: | Size: 837 B |
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1001 B |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 870 B |
37352
www/common/onlyoffice/v1/sdkjs/word/sdk-all-min.js
vendored
Normal file
494214
www/common/onlyoffice/v1/sdkjs/word/sdk-all.js
Normal file
736
www/common/onlyoffice/v1/web-apps/apps/api/documents/api.js
Normal file
@@ -0,0 +1,736 @@
|
|||||||
|
/**
|
||||||
|
* Copyright (c) Ascensio System SIA 2013. All rights reserved
|
||||||
|
*
|
||||||
|
* http://www.onlyoffice.com
|
||||||
|
*/
|
||||||
|
|
||||||
|
;(function(DocsAPI, window, document, undefined) {
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
# Full #
|
||||||
|
|
||||||
|
config = {
|
||||||
|
type: 'desktop or mobile',
|
||||||
|
width: '100% by default',
|
||||||
|
height: '100% by default',
|
||||||
|
documentType: 'text' | 'spreadsheet' | 'presentation',
|
||||||
|
document: {
|
||||||
|
title: 'document title',
|
||||||
|
url: 'document url'
|
||||||
|
fileType: 'document file type',
|
||||||
|
options: <advanced options>,
|
||||||
|
key: 'key',
|
||||||
|
vkey: 'vkey',
|
||||||
|
info: {
|
||||||
|
author: 'author name',
|
||||||
|
folder: 'path to document',
|
||||||
|
created: '<creation date>',
|
||||||
|
sharingSettings: [
|
||||||
|
{
|
||||||
|
user: 'user name',
|
||||||
|
permissions: '<permissions>',
|
||||||
|
isLink: false
|
||||||
|
},
|
||||||
|
...
|
||||||
|
]
|
||||||
|
},
|
||||||
|
permissions: {
|
||||||
|
edit: <can edit>, // default = true
|
||||||
|
download: <can download>, // default = true
|
||||||
|
reader: <can view in readable mode>,
|
||||||
|
review: <can review>, // default = edit
|
||||||
|
print: <can print>, // default = true
|
||||||
|
rename: <can rename>, // default = false
|
||||||
|
changeHistory: <can change history>, // default = false
|
||||||
|
comment: <can comment in view mode> // default = edit
|
||||||
|
}
|
||||||
|
},
|
||||||
|
editorConfig: {
|
||||||
|
mode: 'view or edit',
|
||||||
|
lang: <language code>,
|
||||||
|
location: <location>,
|
||||||
|
canCoAuthoring: <can coauthoring documents>,
|
||||||
|
canBackToFolder: <can return to folder> - deprecated. use "customization.goback" parameter,
|
||||||
|
createUrl: 'create document url',
|
||||||
|
sharingSettingsUrl: 'document sharing settings url',
|
||||||
|
fileChoiceUrl: 'mail merge sources url',
|
||||||
|
callbackUrl: <url for connection between sdk and portal>,
|
||||||
|
mergeFolderUrl: 'folder for saving merged file',
|
||||||
|
licenseUrl: <url for license>,
|
||||||
|
customerId: <customer id>,
|
||||||
|
|
||||||
|
user: {
|
||||||
|
id: 'user id',
|
||||||
|
name: 'user name'
|
||||||
|
},
|
||||||
|
recent: [
|
||||||
|
{
|
||||||
|
title: 'document title',
|
||||||
|
url: 'document url',
|
||||||
|
folder: 'path to document'
|
||||||
|
},
|
||||||
|
...
|
||||||
|
],
|
||||||
|
templates: [
|
||||||
|
{
|
||||||
|
name: 'template name',
|
||||||
|
icon: 'template icon url',
|
||||||
|
url: 'http://...'
|
||||||
|
},
|
||||||
|
...
|
||||||
|
],
|
||||||
|
customization: {
|
||||||
|
logo: {
|
||||||
|
image: url,
|
||||||
|
imageEmbedded: url,
|
||||||
|
url: http://...
|
||||||
|
},
|
||||||
|
backgroundColor: 'header background color',
|
||||||
|
textColor: 'header text color',
|
||||||
|
customer: {
|
||||||
|
name: 'SuperPuper',
|
||||||
|
address: 'New-York, 125f-25',
|
||||||
|
mail: 'support@gmail.com',
|
||||||
|
www: 'www.superpuper.com',
|
||||||
|
info: 'Some info',
|
||||||
|
logo: ''
|
||||||
|
},
|
||||||
|
about: true,
|
||||||
|
feedback: {
|
||||||
|
visible: false,
|
||||||
|
url: http://...
|
||||||
|
},
|
||||||
|
goback: {
|
||||||
|
url: 'http://...',
|
||||||
|
text: 'Go to London'
|
||||||
|
},
|
||||||
|
chat: true,
|
||||||
|
comments: true,
|
||||||
|
zoom: 100,
|
||||||
|
compactToolbar: false,
|
||||||
|
leftMenu: true,
|
||||||
|
rightMenu: true,
|
||||||
|
toolbar: true,
|
||||||
|
header: true,
|
||||||
|
statusBar: true,
|
||||||
|
autosave: true,
|
||||||
|
forcesave: false,
|
||||||
|
commentAuthorOnly: false,
|
||||||
|
showReviewChanges: false
|
||||||
|
},
|
||||||
|
plugins: {
|
||||||
|
autoStartGuid: 'asc.{FFE1F462-1EA2-4391-990D-4CC84940B754}',
|
||||||
|
url: '../../../../sdkjs-plugins/',
|
||||||
|
pluginsData: [
|
||||||
|
"helloworld/config.json",
|
||||||
|
"chess/config.json",
|
||||||
|
"speech/config.json",
|
||||||
|
"clipart/config.json",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
events: {
|
||||||
|
'onReady': <application ready callback>, // deprecated
|
||||||
|
'onAppReady': <application ready callback>,
|
||||||
|
'onBack': <back to folder callback>,
|
||||||
|
'onDocumentStateChange': <document state changed callback>
|
||||||
|
'onDocumentReady': <document ready callback>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Embedded #
|
||||||
|
|
||||||
|
config = {
|
||||||
|
type: 'embedded',
|
||||||
|
width: '100% by default',
|
||||||
|
height: '100% by default',
|
||||||
|
documentType: 'text' | 'spreadsheet' | 'presentation',
|
||||||
|
document: {
|
||||||
|
title: 'document title',
|
||||||
|
url: 'document url',
|
||||||
|
fileType: 'document file type',
|
||||||
|
key: 'key',
|
||||||
|
vkey: 'vkey'
|
||||||
|
},
|
||||||
|
editorConfig: {
|
||||||
|
licenseUrl: <url for license>,
|
||||||
|
customerId: <customer id>,
|
||||||
|
autostart: 'document', // action for app's autostart. for presentations default value is 'player'
|
||||||
|
embedded: {
|
||||||
|
embedUrl: 'url',
|
||||||
|
fullscreenUrl: 'url',
|
||||||
|
saveUrl: 'url',
|
||||||
|
shareUrl: 'url',
|
||||||
|
toolbarDocked: 'top or bottom'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
events: {
|
||||||
|
'onReady': <application ready callback>, // deprecated
|
||||||
|
'onAppReady': <application ready callback>,
|
||||||
|
'onBack': <back to folder callback>,
|
||||||
|
'onError': <error callback>,
|
||||||
|
'onDocumentReady': <document ready callback>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
// TODO: allow several instances on one page simultaneously
|
||||||
|
|
||||||
|
DocsAPI.DocEditor = function(placeholderId, config) {
|
||||||
|
var _self = this,
|
||||||
|
_config = config || {};
|
||||||
|
|
||||||
|
extend(_config, DocsAPI.DocEditor.defaultConfig);
|
||||||
|
_config.editorConfig.canUseHistory = _config.events && !!_config.events.onRequestHistory;
|
||||||
|
_config.editorConfig.canHistoryClose = _config.events && !!_config.events.onRequestHistoryClose;
|
||||||
|
_config.editorConfig.canHistoryRestore = _config.events && !!_config.events.onRequestRestore;
|
||||||
|
_config.editorConfig.canSendEmailAddresses = _config.events && !!_config.events.onRequestEmailAddresses;
|
||||||
|
_config.editorConfig.canRequestEditRights = _config.events && !!_config.events.onRequestEditRights;
|
||||||
|
_config.frameEditorId = placeholderId;
|
||||||
|
|
||||||
|
_config.events && !!_config.events.onReady && console.log("Obsolete: The onReady event is deprecated. Please use onAppReady instead.");
|
||||||
|
_config.events && (_config.events.onAppReady = _config.events.onAppReady || _config.events.onReady);
|
||||||
|
|
||||||
|
var onMouseUp = function (evt) {
|
||||||
|
_processMouse(evt);
|
||||||
|
};
|
||||||
|
|
||||||
|
var _attachMouseEvents = function() {
|
||||||
|
if (window.addEventListener) {
|
||||||
|
window.addEventListener("mouseup", onMouseUp, false)
|
||||||
|
} else if (window.attachEvent) {
|
||||||
|
window.attachEvent("onmouseup", onMouseUp);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var _detachMouseEvents = function() {
|
||||||
|
if (window.removeEventListener) {
|
||||||
|
window.removeEventListener("mouseup", onMouseUp, false)
|
||||||
|
} else if (window.detachEvent) {
|
||||||
|
window.detachEvent("onmouseup", onMouseUp);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var _onAppReady = function() {
|
||||||
|
if (_config.type === 'mobile') {
|
||||||
|
document.body.onfocus = function(e) {
|
||||||
|
setTimeout(function(){
|
||||||
|
iframe.contentWindow.focus();
|
||||||
|
|
||||||
|
_sendCommand({
|
||||||
|
command: 'resetFocus',
|
||||||
|
data: {}
|
||||||
|
})
|
||||||
|
}, 10);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
_attachMouseEvents();
|
||||||
|
|
||||||
|
if (_config.editorConfig) {
|
||||||
|
_init(_config.editorConfig);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_config.document) {
|
||||||
|
_openDocument(_config.document);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var _callLocalStorage = function(data) {
|
||||||
|
if (data.cmd == 'get') {
|
||||||
|
if (data.keys && data.keys.length) {
|
||||||
|
var af = data.keys.split(','), re = af[0];
|
||||||
|
for (i = 0; ++i < af.length;)
|
||||||
|
re += '|' + af[i];
|
||||||
|
|
||||||
|
re = new RegExp(re); k = {};
|
||||||
|
for (i in localStorage)
|
||||||
|
if (re.test(i)) k[i] = localStorage[i];
|
||||||
|
} else {
|
||||||
|
k = localStorage;
|
||||||
|
}
|
||||||
|
|
||||||
|
_sendCommand({
|
||||||
|
command: 'internalCommand',
|
||||||
|
data: {
|
||||||
|
type: 'localstorage',
|
||||||
|
keys: k
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else
|
||||||
|
if (data.cmd == 'set') {
|
||||||
|
var k = data.keys, i;
|
||||||
|
for (i in k) {
|
||||||
|
localStorage.setItem(i, k[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var _onMessage = function(msg) {
|
||||||
|
if ( msg ) {
|
||||||
|
if ( msg.type === "onExternalPluginMessage" ) {
|
||||||
|
_sendCommand(msg);
|
||||||
|
} else
|
||||||
|
if ( msg.frameEditorId == placeholderId ) {
|
||||||
|
var events = _config.events || {},
|
||||||
|
handler = events[msg.event],
|
||||||
|
res;
|
||||||
|
|
||||||
|
if (msg.event === 'onRequestEditRights' && !handler) {
|
||||||
|
_applyEditRights(false, 'handler isn\'t defined');
|
||||||
|
} else if (msg.event === 'onInternalMessage' && msg.data && msg.data.type == 'localstorage') {
|
||||||
|
_callLocalStorage(msg.data.data);
|
||||||
|
} else {
|
||||||
|
if (msg.event === 'onAppReady') {
|
||||||
|
_onAppReady();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (handler && typeof handler == "function") {
|
||||||
|
res = handler.call(_self, {target: _self, data: msg.data});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var _checkConfigParams = function() {
|
||||||
|
if (_config.document) {
|
||||||
|
if (!_config.document.url || ((typeof _config.document.fileType !== 'string' || _config.document.fileType=='') &&
|
||||||
|
(typeof _config.documentType !== 'string' || _config.documentType==''))) {
|
||||||
|
window.alert("One or more required parameter for the config object is not set");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
var appMap = {
|
||||||
|
'text': 'docx',
|
||||||
|
'text-pdf': 'pdf',
|
||||||
|
'spreadsheet': 'xlsx',
|
||||||
|
'presentation': 'pptx'
|
||||||
|
}, app;
|
||||||
|
|
||||||
|
if (typeof _config.documentType === 'string' && _config.documentType != '') {
|
||||||
|
app = appMap[_config.documentType.toLowerCase()];
|
||||||
|
if (!app) {
|
||||||
|
window.alert("The \"documentType\" parameter for the config object is invalid. Please correct it.");
|
||||||
|
return false;
|
||||||
|
} else if (typeof _config.document.fileType !== 'string' || _config.document.fileType == '') {
|
||||||
|
_config.document.fileType = app;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof _config.document.fileType === 'string' && _config.document.fileType != '') {
|
||||||
|
var type = /^(?:(xls|xlsx|ods|csv|xlst|xlsy|gsheet|xlsm|xlt|xltm|xltx|fods|ots)|(pps|ppsx|ppt|pptx|odp|pptt|ppty|gslides|pot|potm|potx|ppsm|pptm|fodp|otp)|(doc|docx|doct|odt|gdoc|txt|rtf|pdf|mht|htm|html|epub|djvu|xps|docm|dot|dotm|dotx|fodt|ott))$/
|
||||||
|
.exec(_config.document.fileType);
|
||||||
|
if (!type) {
|
||||||
|
window.alert("The \"document.fileType\" parameter for the config object is invalid. Please correct it.");
|
||||||
|
return false;
|
||||||
|
} else if (typeof _config.documentType !== 'string' || _config.documentType == ''){
|
||||||
|
if (typeof type[1] === 'string') _config.documentType = 'spreadsheet'; else
|
||||||
|
if (typeof type[2] === 'string') _config.documentType = 'presentation'; else
|
||||||
|
if (typeof type[3] === 'string') _config.documentType = 'text';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var type = /^(?:(pdf|djvu|xps))$/.exec(_config.document.fileType);
|
||||||
|
if (type && typeof type[1] === 'string') {
|
||||||
|
_config.editorConfig.canUseHistory = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!_config.document.title || _config.document.title=='')
|
||||||
|
_config.document.title = 'Unnamed.' + _config.document.fileType;
|
||||||
|
|
||||||
|
if (!_config.document.key) {
|
||||||
|
_config.document.key = 'xxxxxxxxxxxxxxxxxxxx'.replace(/[x]/g, function (c) {var r = Math.random() * 16 | 0; return r.toString(16);});
|
||||||
|
} else if (typeof _config.document.key !== 'string') {
|
||||||
|
window.alert("The \"document.key\" parameter for the config object must be string. Please correct it.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
_config.document.token = _config.token;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
var result = /[\?\&]placement=(\w+)&?/.exec(window.location.search);
|
||||||
|
if (!!result && result.length) {
|
||||||
|
if (result[1] == 'desktop') {
|
||||||
|
_config.editorConfig.targetApp = result[1];
|
||||||
|
_config.editorConfig.canBackToFolder = false;
|
||||||
|
_config.editorConfig.canUseHistory = false;
|
||||||
|
if (!_config.editorConfig.customization) _config.editorConfig.customization = {};
|
||||||
|
_config.editorConfig.customization.about = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
|
||||||
|
var target = document.getElementById(placeholderId),
|
||||||
|
iframe;
|
||||||
|
|
||||||
|
if (target && _checkConfigParams()) {
|
||||||
|
iframe = createIframe(_config);
|
||||||
|
target.parentNode && target.parentNode.replaceChild(iframe, target);
|
||||||
|
var _msgDispatcher = new MessageDispatcher(_onMessage, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
cmd = {
|
||||||
|
command: 'commandName',
|
||||||
|
data: <command specific data>
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
var _destroyEditor = function(cmd) {
|
||||||
|
var target = document.createElement("div");
|
||||||
|
target.setAttribute('id', placeholderId);
|
||||||
|
|
||||||
|
if (iframe) {
|
||||||
|
_msgDispatcher && _msgDispatcher.unbindEvents();
|
||||||
|
_detachMouseEvents();
|
||||||
|
iframe.parentNode && iframe.parentNode.replaceChild(target, iframe);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var _sendCommand = function(cmd) {
|
||||||
|
if (iframe && iframe.contentWindow)
|
||||||
|
postMessage(iframe.contentWindow, cmd);
|
||||||
|
};
|
||||||
|
|
||||||
|
var _init = function(editorConfig) {
|
||||||
|
_sendCommand({
|
||||||
|
command: 'init',
|
||||||
|
data: {
|
||||||
|
config: editorConfig
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
var _openDocument = function(doc) {
|
||||||
|
_sendCommand({
|
||||||
|
command: 'openDocument',
|
||||||
|
data: {
|
||||||
|
doc: doc
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
var _showMessage = function(title, msg) {
|
||||||
|
msg = msg || title;
|
||||||
|
_sendCommand({
|
||||||
|
command: 'showMessage',
|
||||||
|
data: {
|
||||||
|
msg: msg
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
var _applyEditRights = function(allowed, message) {
|
||||||
|
_sendCommand({
|
||||||
|
command: 'applyEditRights',
|
||||||
|
data: {
|
||||||
|
allowed: allowed,
|
||||||
|
message: message
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
var _processSaveResult = function(result, message) {
|
||||||
|
_sendCommand({
|
||||||
|
command: 'processSaveResult',
|
||||||
|
data: {
|
||||||
|
result: result,
|
||||||
|
message: message
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// TODO: remove processRightsChange, use denyEditingRights
|
||||||
|
var _processRightsChange = function(enabled, message) {
|
||||||
|
_sendCommand({
|
||||||
|
command: 'processRightsChange',
|
||||||
|
data: {
|
||||||
|
enabled: enabled,
|
||||||
|
message: message
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
var _denyEditingRights = function(message) {
|
||||||
|
_sendCommand({
|
||||||
|
command: 'processRightsChange',
|
||||||
|
data: {
|
||||||
|
enabled: false,
|
||||||
|
message: message
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
var _refreshHistory = function(data, message) {
|
||||||
|
_sendCommand({
|
||||||
|
command: 'refreshHistory',
|
||||||
|
data: {
|
||||||
|
data: data,
|
||||||
|
message: message
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
var _setHistoryData = function(data, message) {
|
||||||
|
_sendCommand({
|
||||||
|
command: 'setHistoryData',
|
||||||
|
data: {
|
||||||
|
data: data,
|
||||||
|
message: message
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
var _setEmailAddresses = function(data) {
|
||||||
|
_sendCommand({
|
||||||
|
command: 'setEmailAddresses',
|
||||||
|
data: {
|
||||||
|
data: data
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
var _processMailMerge = function(enabled, message) {
|
||||||
|
_sendCommand({
|
||||||
|
command: 'processMailMerge',
|
||||||
|
data: {
|
||||||
|
enabled: enabled,
|
||||||
|
message: message
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
var _downloadAs = function() {
|
||||||
|
_sendCommand({
|
||||||
|
command: 'downloadAs'
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
var _processMouse = function(evt) {
|
||||||
|
var r = iframe.getBoundingClientRect();
|
||||||
|
var data = {
|
||||||
|
type: evt.type,
|
||||||
|
x: evt.x - r.left,
|
||||||
|
y: evt.y - r.top,
|
||||||
|
event: evt
|
||||||
|
};
|
||||||
|
|
||||||
|
_sendCommand({
|
||||||
|
command: 'processMouse',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
var _serviceCommand = function(command, data) {
|
||||||
|
_sendCommand({
|
||||||
|
command: 'internalCommand',
|
||||||
|
data: {
|
||||||
|
command: command,
|
||||||
|
data: data
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
return {
|
||||||
|
showMessage : _showMessage,
|
||||||
|
processSaveResult : _processSaveResult,
|
||||||
|
processRightsChange : _processRightsChange,
|
||||||
|
denyEditingRights : _denyEditingRights,
|
||||||
|
refreshHistory : _refreshHistory,
|
||||||
|
setHistoryData : _setHistoryData,
|
||||||
|
setEmailAddresses : _setEmailAddresses,
|
||||||
|
processMailMerge : _processMailMerge,
|
||||||
|
downloadAs : _downloadAs,
|
||||||
|
serviceCommand : _serviceCommand,
|
||||||
|
attachMouseEvents : _attachMouseEvents,
|
||||||
|
detachMouseEvents : _detachMouseEvents,
|
||||||
|
destroyEditor : _destroyEditor
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
DocsAPI.DocEditor.defaultConfig = {
|
||||||
|
type: 'desktop',
|
||||||
|
width: '100%',
|
||||||
|
height: '100%',
|
||||||
|
editorConfig: {
|
||||||
|
lang: 'en',
|
||||||
|
canCoAuthoring: true,
|
||||||
|
customization: {
|
||||||
|
about: true,
|
||||||
|
feedback: false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
DocsAPI.DocEditor.version = function() {
|
||||||
|
return '0.0.0';
|
||||||
|
};
|
||||||
|
|
||||||
|
MessageDispatcher = function(fn, scope) {
|
||||||
|
var _fn = fn,
|
||||||
|
_scope = scope || window,
|
||||||
|
eventFn = function(msg) {
|
||||||
|
_onMessage(msg);
|
||||||
|
};
|
||||||
|
|
||||||
|
var _bindEvents = function() {
|
||||||
|
if (window.addEventListener) {
|
||||||
|
window.addEventListener("message", eventFn, false)
|
||||||
|
}
|
||||||
|
else if (window.attachEvent) {
|
||||||
|
window.attachEvent("onmessage", eventFn);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var _unbindEvents = function() {
|
||||||
|
if (window.removeEventListener) {
|
||||||
|
window.removeEventListener("message", eventFn, false)
|
||||||
|
}
|
||||||
|
else if (window.detachEvent) {
|
||||||
|
window.detachEvent("onmessage", eventFn);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var _onMessage = function(msg) {
|
||||||
|
// TODO: check message origin
|
||||||
|
if (msg && window.JSON) {
|
||||||
|
|
||||||
|
try {
|
||||||
|
var msg = window.JSON.parse(msg.data);
|
||||||
|
if (_fn) {
|
||||||
|
_fn.call(_scope, msg);
|
||||||
|
}
|
||||||
|
} catch(e) {}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
_bindEvents.call(this);
|
||||||
|
|
||||||
|
return {
|
||||||
|
unbindEvents: _unbindEvents
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
function getBasePath() {
|
||||||
|
var scripts = document.getElementsByTagName('script'),
|
||||||
|
match;
|
||||||
|
|
||||||
|
for (var i = scripts.length - 1; i >= 0; i--) {
|
||||||
|
match = scripts[i].src.match(/(.*)api\/documents\/api.js/i);
|
||||||
|
if (match) {
|
||||||
|
return match[1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
function getExtensionPath() {
|
||||||
|
if ("undefined" == typeof(extensionParams) || null == extensionParams["url"])
|
||||||
|
return null;
|
||||||
|
return extensionParams["url"] + "apps/";
|
||||||
|
}
|
||||||
|
|
||||||
|
function getAppPath(config) {
|
||||||
|
var extensionPath = getExtensionPath(),
|
||||||
|
path = extensionPath ? extensionPath : getBasePath(),
|
||||||
|
appMap = {
|
||||||
|
'text': 'documenteditor',
|
||||||
|
'text-pdf': 'documenteditor',
|
||||||
|
'spreadsheet': 'spreadsheeteditor',
|
||||||
|
'presentation': 'presentationeditor'
|
||||||
|
},
|
||||||
|
app = appMap['text'];
|
||||||
|
|
||||||
|
if (typeof config.documentType === 'string') {
|
||||||
|
app = appMap[config.documentType.toLowerCase()];
|
||||||
|
} else
|
||||||
|
if (!!config.document && typeof config.document.fileType === 'string') {
|
||||||
|
var type = /^(?:(xls|xlsx|ods|csv|xlst|xlsy|gsheet|xlsm|xlt|xltm|xltx)|(pps|ppsx|ppt|pptx|odp|pptt|ppty|gslides|pot|potm|potx|ppsm|pptm))$/
|
||||||
|
.exec(config.document.fileType);
|
||||||
|
if (type) {
|
||||||
|
if (typeof type[1] === 'string') app = appMap['spreadsheet']; else
|
||||||
|
if (typeof type[2] === 'string') app = appMap['presentation'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
path += app + "/";
|
||||||
|
path += config.type === "mobile"
|
||||||
|
? "mobile"
|
||||||
|
: config.type === "embedded"
|
||||||
|
? "embed"
|
||||||
|
: "main";
|
||||||
|
path += "/index.html";
|
||||||
|
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getAppParameters(config) {
|
||||||
|
var params = "?_dc=0";
|
||||||
|
|
||||||
|
if (config.editorConfig && config.editorConfig.lang)
|
||||||
|
params += "&lang=" + config.editorConfig.lang;
|
||||||
|
|
||||||
|
if (config.editorConfig && config.editorConfig.targetApp!=='desktop') {
|
||||||
|
if ( (typeof(config.editorConfig.customization) == 'object') && config.editorConfig.customization.loaderName) {
|
||||||
|
if (config.editorConfig.customization.loaderName !== 'none') params += "&customer=" + config.editorConfig.customization.loaderName;
|
||||||
|
} else
|
||||||
|
params += "&customer=ONLYOFFICE";
|
||||||
|
if ( (typeof(config.editorConfig.customization) == 'object') && config.editorConfig.customization.loaderLogo) {
|
||||||
|
if (config.editorConfig.customization.loaderLogo !== '') params += "&logo=" + config.editorConfig.customization.loaderLogo;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (config.frameEditorId)
|
||||||
|
params += "&frameEditorId=" + config.frameEditorId;
|
||||||
|
|
||||||
|
return params;
|
||||||
|
}
|
||||||
|
|
||||||
|
function createIframe(config) {
|
||||||
|
var iframe = document.createElement("iframe");
|
||||||
|
|
||||||
|
iframe.src = getAppPath(config) + getAppParameters(config);
|
||||||
|
iframe.width = config.width;
|
||||||
|
iframe.height = config.height;
|
||||||
|
iframe.align = "top";
|
||||||
|
iframe.frameBorder = 0;
|
||||||
|
iframe.name = "frameEditor";
|
||||||
|
iframe.allowFullscreen = true;
|
||||||
|
iframe.setAttribute("allowfullscreen",""); // for IE11
|
||||||
|
iframe.setAttribute("onmousewheel",""); // for Safari on Mac
|
||||||
|
return iframe;
|
||||||
|
}
|
||||||
|
|
||||||
|
function postMessage(wnd, msg) {
|
||||||
|
if (wnd && wnd.postMessage && window.JSON) {
|
||||||
|
// TODO: specify explicit origin
|
||||||
|
wnd.postMessage(window.JSON.stringify(msg), "*");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function extend(dest, src) {
|
||||||
|
for (var prop in src) {
|
||||||
|
if (src.hasOwnProperty(prop)) {
|
||||||
|
if (typeof dest[prop] === 'undefined') {
|
||||||
|
dest[prop] = src[prop];
|
||||||
|
} else
|
||||||
|
if (typeof dest[prop] === 'object' &&
|
||||||
|
typeof src[prop] === 'object') {
|
||||||
|
extend(dest[prop], src[prop])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return dest;
|
||||||
|
}
|
||||||
|
|
||||||
|
})(window.DocsAPI = window.DocsAPI || {}, window, document);
|
||||||
|
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>ONLYOFFICE Documents</title>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="description" content="" />
|
||||||
|
<meta name="keywords" content="" />
|
||||||
|
<style type="text/css"></style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<script type="text/javascript" src="../../../vendor/jquery/jquery.min.js"></script>
|
||||||
|
<script type="text/javascript" src="../../../vendor/sockjs/sockjs.min.js"></script>
|
||||||
|
<script type="text/javascript" src="../../../vendor/xregexp/xregexp-all-min.js"></script>
|
||||||
|
<script type="text/javascript" src="../../../../sdkjs/common/AllFonts.js"></script>
|
||||||
|
<script type="text/javascript" src="../../../../sdkjs/word/sdk-all-min.js"></script>
|
||||||
|
<script type="text/javascript" src="../../../../sdkjs/word/sdk-all.js"></script>
|
||||||
|
<div id="editor_sdk">
|
||||||
|
<script type="text/javascript">
|
||||||
|
window['AscNotLoadAllScript'] = true;
|
||||||
|
var editor = new Asc.asc_docs_api({
|
||||||
|
'id-view' : 'editor_sdk'
|
||||||
|
});
|
||||||
|
editor.LoadFontsFromServer();
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
346
www/common/onlyoffice/v1/web-apps/apps/api/documents/index.html
Normal file
@@ -0,0 +1,346 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>ONLYOFFICE Documents</title>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=IE8"/>
|
||||||
|
<meta name="description" content="" />
|
||||||
|
<meta name="keywords" content="" />
|
||||||
|
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
|
||||||
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||||
|
<meta name="apple-touch-fullscreen" content="yes">
|
||||||
|
|
||||||
|
<style type="text/css">
|
||||||
|
html {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
height: 100%;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wrap {
|
||||||
|
position:absolute;
|
||||||
|
left:0;
|
||||||
|
top:0;
|
||||||
|
right:0;
|
||||||
|
bottom:0;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="wrap">
|
||||||
|
<div id="placeholder"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript" src="api.js"></script>
|
||||||
|
<script>
|
||||||
|
(function() {
|
||||||
|
|
||||||
|
// Url parameters
|
||||||
|
|
||||||
|
var urlParams = getUrlParams(),
|
||||||
|
cfg = getEditorConfig(urlParams),
|
||||||
|
doc = getDocumentData(urlParams);
|
||||||
|
|
||||||
|
// Document Editor
|
||||||
|
|
||||||
|
var docEditor = new DocsAPI.DocEditor('placeholder', {
|
||||||
|
type: urlParams['type'],
|
||||||
|
width: '100%',
|
||||||
|
height: '100%',
|
||||||
|
documentType: urlParams['doctype'] || 'text',
|
||||||
|
document: doc,
|
||||||
|
editorConfig: cfg,
|
||||||
|
events: {
|
||||||
|
'onReady': onDocEditorReady,
|
||||||
|
'onDocumentStateChange': onDocumentStateChange,
|
||||||
|
'onRequestEditRights': onRequestEditRights,
|
||||||
|
'onRequestHistory': onRequestHistory,
|
||||||
|
'onRequestHistoryData': onRequestHistoryData,
|
||||||
|
'onRequestEmailAddresses': onRequestEmailAddresses,
|
||||||
|
'onRequestStartMailMerge': onRequestStartMailMerge,
|
||||||
|
'onRequestHistoryClose': onRequestHistoryClose,
|
||||||
|
'onError': onError
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Document Editor event handlers
|
||||||
|
|
||||||
|
function onRequestEmailAddresses() {
|
||||||
|
docEditor.setEmailAddresses({emailAddresses: ['aaa@mail.ru'], createEmailAccountUrl: 'http://ya.ru'});
|
||||||
|
}
|
||||||
|
|
||||||
|
function onRequestHistory() {
|
||||||
|
docEditor.refreshHistory({
|
||||||
|
'currentVersion': 3,
|
||||||
|
'history': [
|
||||||
|
{
|
||||||
|
'user': {
|
||||||
|
id: '8952d4ee-e8a5-42bf-86f0-6cd77801ec15',
|
||||||
|
name: 'Татьяна Щербакова'
|
||||||
|
},
|
||||||
|
'changes': null,
|
||||||
|
'created': '1/18/2015 6:38 PM',
|
||||||
|
'version': 1,
|
||||||
|
'versionGroup': 1,
|
||||||
|
'key': 'wyX9AwRq_677SWKjhfk='
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'user': {
|
||||||
|
id: '8952d4ee-e8a5-42bf-86f0-6cd77801ec15',
|
||||||
|
name: 'Татьяна Щербакова'
|
||||||
|
},
|
||||||
|
'changes': [
|
||||||
|
{
|
||||||
|
'user': {
|
||||||
|
id: '8952d4ee-e8a5-42bf-86f0-6cd77801ec15',
|
||||||
|
name: 'Татьяна Щербакова'
|
||||||
|
},
|
||||||
|
'created': '1/19/2015 6:30 PM'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'user': {
|
||||||
|
'id': '8952d4ee-e8a5-42bf-11f0-6cd77801ec15',
|
||||||
|
'name': 'Александр Трофимов'
|
||||||
|
},
|
||||||
|
'created': '1/19/2015 6:32 PM'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'user': {
|
||||||
|
id: '8952d4ee-e8a5-42bf-86f0-6cd77801ec15',
|
||||||
|
name: 'Татьяна Щербакова'
|
||||||
|
},
|
||||||
|
'created': '1/19/2015 6:38 PM'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
'created': '2/19/2015 6:38 PM',
|
||||||
|
'version': 2,
|
||||||
|
'versionGroup': 1,
|
||||||
|
'key': 'wyX9AwRq_677SWKjhfk='
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'user': {
|
||||||
|
id: '895255ee-e8a5-42bf-86f0-6cd77801ec15',
|
||||||
|
name: 'Me'
|
||||||
|
},
|
||||||
|
'changes': null,
|
||||||
|
'created': '2/21/2015 6:38 PM',
|
||||||
|
'version': 3,
|
||||||
|
'versionGroup': 2,
|
||||||
|
'key': 'wyX9AwRq_677SWKjhfk='
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'user': {
|
||||||
|
id: '8952d4ee-e8a5-42bf-11f0-6cd77801ec15',
|
||||||
|
name: 'Александр Трофимов'
|
||||||
|
},
|
||||||
|
'changes': null,
|
||||||
|
'created': '2/22/2015 6:37 PM',
|
||||||
|
'version': 4,
|
||||||
|
'versionGroup': 3,
|
||||||
|
'key': 'wyX9AwRq_677SWKjhfk='
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'user': {
|
||||||
|
id: '8952d4ee-e8a5-42bf-11f0-6cd33801ec15',
|
||||||
|
name: 'Леонид Орлов'
|
||||||
|
},
|
||||||
|
'changes': null,
|
||||||
|
'created': '2/24/2015 6:29 PM',
|
||||||
|
'version': 5,
|
||||||
|
'versionGroup': 3,
|
||||||
|
'key': 'wyX9AwRq_677SWKjhfk='
|
||||||
|
}]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function onRequestHistoryData(revision) {
|
||||||
|
docEditor.setHistoryData(
|
||||||
|
{
|
||||||
|
'version': revision.data,
|
||||||
|
'url': 'http://isa2',
|
||||||
|
'urlDiff': 'http://isa2',
|
||||||
|
'changesUrl': 'http://isa2'
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function onRequestStartMailMerge() {
|
||||||
|
docEditor.processMailMerge(true, 'some error message');
|
||||||
|
}
|
||||||
|
|
||||||
|
function onRequestHistoryClose() {
|
||||||
|
// reload page
|
||||||
|
}
|
||||||
|
|
||||||
|
function onDocEditorReady(event) {
|
||||||
|
if (event.target) {
|
||||||
|
//console.log('Ready! Editor: ', event.target);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function onDocumentStateChange(event) {
|
||||||
|
var isModified = event.data;
|
||||||
|
//console.log(isModified);
|
||||||
|
}
|
||||||
|
|
||||||
|
function onRequestEditRights(event) {
|
||||||
|
// occurs whenever the user tryes to enter edit mode
|
||||||
|
docEditor.applyEditRights(true, "Someone is editing this document right now. Please try again later.");
|
||||||
|
}
|
||||||
|
|
||||||
|
function onError(event) {
|
||||||
|
// critical error happened
|
||||||
|
// examine event.data.errorCode and event.data.errorDescription for details
|
||||||
|
}
|
||||||
|
|
||||||
|
function onDownloadAs(event) {
|
||||||
|
// return url of downloaded doc
|
||||||
|
// console.log(event.data);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// helpers
|
||||||
|
|
||||||
|
function getUrlParams() {
|
||||||
|
var e,
|
||||||
|
a = /\+/g, // Regex for replacing addition symbol with a space
|
||||||
|
r = /([^&=]+)=?([^&]*)/g,
|
||||||
|
d = function (s) { return decodeURIComponent(s.replace(a, " ")); },
|
||||||
|
q = window.location.search.substring(1),
|
||||||
|
urlParams = {};
|
||||||
|
|
||||||
|
while (e = r.exec(q))
|
||||||
|
urlParams[d(e[1])] = d(e[2]);
|
||||||
|
|
||||||
|
return urlParams;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getDocumentData(urlParams) {
|
||||||
|
return {
|
||||||
|
key: urlParams["key"],
|
||||||
|
url: urlParams["url"] || '_offline_',
|
||||||
|
title: urlParams["title"],
|
||||||
|
fileType: urlParams["filetype"],
|
||||||
|
vkey: urlParams["vkey"],
|
||||||
|
permissions: {
|
||||||
|
edit: true,
|
||||||
|
download: true,
|
||||||
|
reader: true
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function getEditorConfig(urlParams) {
|
||||||
|
return {
|
||||||
|
mode : urlParams["mode"] || 'edit',
|
||||||
|
lang : urlParams["lang"] || 'en',
|
||||||
|
canCoAuthoring : true,
|
||||||
|
createUrl : 'http://www.example.com/create',
|
||||||
|
|
||||||
|
user: {
|
||||||
|
id: urlParams["userid"] || 'uid-901', firstname: urlParams["userfname"] || 'Mitchell', lastname: urlParams["userlname"] || 'Hamish'
|
||||||
|
},
|
||||||
|
recent : [
|
||||||
|
{title: 'Memory.docx', url: 'http://onlyoffice.com', folder: 'Document Editor'},
|
||||||
|
{title: 'Description.doc', url: 'http://onlyoffice.com', folder: 'Document Editor'},
|
||||||
|
{title: 'DocEditor_right.xsl', url: 'http://onlyoffice.com', folder: 'Spreadsheet Editor'},
|
||||||
|
{title: 'api.rtf', url: 'http://onlyoffice.com', folder: 'Unnamed folder'}
|
||||||
|
],
|
||||||
|
// templates : [
|
||||||
|
// {name: 'Contracts', icon: '../../api/documents/resources/templates/contracts.png', url: 'http://...'},
|
||||||
|
// {name: 'Letter', icon: '../../api/documents/resources/templates/letter.png', url: 'http://...'},
|
||||||
|
// {name: 'List', icon: '../../api/documents/resources/templates/list.png', url: 'http://...'},
|
||||||
|
// {name: 'Plan', icon: '../../api/documents/resources/templates/plan.png', url: 'http://...'}
|
||||||
|
// ],
|
||||||
|
embedded : {
|
||||||
|
embedUrl : 'http://onlyoffice.com/embed',
|
||||||
|
fullscreenUrl : 'http://onlyoffice.com/fullscreen',
|
||||||
|
saveUrl : 'http://onlyoffice.com/download',
|
||||||
|
shareUrl : 'http://tl.com/72b4la97',
|
||||||
|
toolbarDocked : 'top'
|
||||||
|
}
|
||||||
|
,customization: {
|
||||||
|
// logo: {
|
||||||
|
// image: 'https://dylnrgbh910l3.cloudfront.net/studio/tag/i8.8.237/skins/default/images/onlyoffice_logo/editor_logo_general.png', // default size 86 x 20
|
||||||
|
// imageEmbedded: 'https://d2hw9csky753gb.cloudfront.net/studio/tag/i8.8.237/skins/default/images/onlyoffice_logo/editor_embedded_logo.png', // default size 124 x 20
|
||||||
|
// url: 'http://...'
|
||||||
|
// },
|
||||||
|
// backgroundColor: '#ffffff',
|
||||||
|
// textColor: '#ff0000',
|
||||||
|
// customer: {
|
||||||
|
// name: 'SuperPuper',
|
||||||
|
// address: 'New-York, 125f-25',
|
||||||
|
// mail: 'support@gmail.com',
|
||||||
|
// www: 'www.superpuper.com',
|
||||||
|
// info: 'Some info',
|
||||||
|
// logo: 'https://img.imgsmail.ru/r/default/portal/0.1.29/logo.png' // default size 216 x 35
|
||||||
|
// },
|
||||||
|
// goback: {text: 'Go To London', url: 'http://...'},
|
||||||
|
about: true,
|
||||||
|
feedback: true
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
// Mobile version
|
||||||
|
|
||||||
|
function isMobile(){
|
||||||
|
var prefixes = {
|
||||||
|
ios: 'i(?:Pad|Phone|Pod)(?:.*)CPU(?: iPhone)? OS ',
|
||||||
|
android: '(Android |HTC_|Silk/)',
|
||||||
|
blackberry: 'BlackBerry(?:.*)Version\/',
|
||||||
|
rimTablet: 'RIM Tablet OS ',
|
||||||
|
webos: '(?:webOS|hpwOS)\/',
|
||||||
|
bada: 'Bada\/'
|
||||||
|
},
|
||||||
|
i, prefix, match;
|
||||||
|
|
||||||
|
for (i in prefixes){
|
||||||
|
if (prefixes.hasOwnProperty(i)) {
|
||||||
|
prefix = prefixes[i];
|
||||||
|
|
||||||
|
if (navigator.userAgent.match(new RegExp('(?:'+prefix+')([^\\s;]+)')))
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
var fixSize = function() {
|
||||||
|
var wrapEl = document.getElementById('wrap');
|
||||||
|
if (wrapEl){
|
||||||
|
wrapEl.style.height = screen.availHeight + 'px';
|
||||||
|
window.scrollTo(0, -1);
|
||||||
|
wrapEl.style.height = window.innerHeight + 'px';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var fixIpadLandscapeIos7 = function() {
|
||||||
|
if (navigator.userAgent.match(/iPad;.*CPU.*OS 7_\d/i)) {
|
||||||
|
var wrapEl = document.getElementById('wrap');
|
||||||
|
if (wrapEl){
|
||||||
|
wrapEl.style.position = "fixed";
|
||||||
|
wrapEl.style.bottom = 0;
|
||||||
|
wrapEl.style.width = "100%";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
if (isMobile()){
|
||||||
|
window.addEventListener('load', fixSize);
|
||||||
|
window.addEventListener('resize', fixSize);
|
||||||
|
|
||||||
|
fixIpadLandscapeIos7();
|
||||||
|
}
|
||||||
|
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
After Width: | Height: | Size: 4.3 KiB |
|
After Width: | Height: | Size: 4.5 KiB |
|
After Width: | Height: | Size: 4.2 KiB |
|
After Width: | Height: | Size: 4.6 KiB |
@@ -0,0 +1,290 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>ONLYOFFICE Document Editor</title>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=IE8"/>
|
||||||
|
<meta name="description" content="" />
|
||||||
|
<meta name="keywords" content="" />
|
||||||
|
<link rel="icon" href="resources/img/favicon.ico" type="image/x-icon" />
|
||||||
|
|
||||||
|
<!-- splash -->
|
||||||
|
|
||||||
|
<style type="text/css">
|
||||||
|
.loadmask {
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
position: absolute;
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
border: none;
|
||||||
|
background-color: #f4f4f4;
|
||||||
|
z-index: 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
.loader-page {
|
||||||
|
width: 100%;
|
||||||
|
height: 170px;
|
||||||
|
bottom: 42%;
|
||||||
|
position: absolute;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.loader-logo {
|
||||||
|
max-height: 160px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.loader-page-romb {
|
||||||
|
width: 40px;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.loader-page-text {
|
||||||
|
width: 100%;
|
||||||
|
bottom: 42%;
|
||||||
|
position: absolute;
|
||||||
|
text-align: center;
|
||||||
|
color: #888;
|
||||||
|
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||||
|
line-height: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.loader-page-text-loading {
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.loader-page-text-customer {
|
||||||
|
font-size: 16px;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.romb {
|
||||||
|
width: 40px;
|
||||||
|
height: 40px;
|
||||||
|
-webkit-transform: rotate(135deg) skew(20deg, 20deg);
|
||||||
|
-moz-transform: rotate(135deg) skew(20deg, 20deg);
|
||||||
|
-ms-transform: rotate(135deg) skew(20deg, 20deg);
|
||||||
|
-o-transform: rotate(135deg) skew(20deg, 20deg);
|
||||||
|
position: absolute;
|
||||||
|
background: red;
|
||||||
|
border-radius: 6px;
|
||||||
|
-webkit-animation: movedown 3s infinite ease;
|
||||||
|
-moz-animation: movedown 3s infinite ease;
|
||||||
|
-ms-animation: movedown 3s infinite ease;
|
||||||
|
-o-animation: movedown 3s infinite ease;
|
||||||
|
animation: movedown 3s infinite ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
#blue {
|
||||||
|
z-index: 3;
|
||||||
|
background: #55bce6;
|
||||||
|
-webkit-animation-name: blue;
|
||||||
|
-moz-animation-name: blue;
|
||||||
|
-ms-animation-name: blue;
|
||||||
|
-o-animation-name: blue;
|
||||||
|
animation-name: blue;
|
||||||
|
}
|
||||||
|
|
||||||
|
#red {
|
||||||
|
z-index:1;
|
||||||
|
background: #de7a59;
|
||||||
|
-webkit-animation-name: red;
|
||||||
|
-moz-animation-name: red;
|
||||||
|
-ms-animation-name: red;
|
||||||
|
-o-animation-name: red;
|
||||||
|
animation-name: red;
|
||||||
|
}
|
||||||
|
|
||||||
|
#green {
|
||||||
|
z-index: 2;
|
||||||
|
background: #a1cb5c;
|
||||||
|
-webkit-animation-name: green;
|
||||||
|
-moz-animation-name: green;
|
||||||
|
-ms-animation-name: green;
|
||||||
|
-o-animation-name: green;
|
||||||
|
animation-name: green;
|
||||||
|
}
|
||||||
|
|
||||||
|
@-webkit-keyframes red {
|
||||||
|
0% { top:120px; background: #de7a59; }
|
||||||
|
10% { top:120px; background: #F2CBBF; }
|
||||||
|
14% { background: #f4f4f4; top:120px; }
|
||||||
|
15% { background: #f4f4f4; top:0;}
|
||||||
|
20% { background: #E6E4E4; }
|
||||||
|
30% { background: #D2D2D2; }
|
||||||
|
40% { top:120px; }
|
||||||
|
100% { top:120px; background: #de7a59; }
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes red {
|
||||||
|
0% { top:120px; background: #de7a59; }
|
||||||
|
10% { top:120px; background: #F2CBBF; }
|
||||||
|
14% { background: #f4f4f4; top:120px; }
|
||||||
|
15% { background: #f4f4f4; top:0; }
|
||||||
|
20% { background: #E6E4E4; }
|
||||||
|
30% { background: #D2D2D2; }
|
||||||
|
40% { top:120px; }
|
||||||
|
100% { top:120px; background: #de7a59; }
|
||||||
|
}
|
||||||
|
|
||||||
|
@-webkit-keyframes green {
|
||||||
|
0% { top:110px; background: #a1cb5c; opacity:1; }
|
||||||
|
10% { top:110px; background: #CBE0AC; opacity:1; }
|
||||||
|
14% { background: #f4f4f4; top:110px; opacity:1; }
|
||||||
|
15% { background: #f4f4f4; top:0; opacity:1; }
|
||||||
|
20% { background: #f4f4f4; top:0; opacity:0; }
|
||||||
|
25% { background: #EFEFEF; top:0; opacity:1; }
|
||||||
|
30% { background:#E6E4E4; }
|
||||||
|
70% { top:110px; }
|
||||||
|
100% { top:110px; background: #a1cb5c; }
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes green {
|
||||||
|
0% { top:110px; background: #a1cb5c; opacity:1; }
|
||||||
|
10% { top:110px; background: #CBE0AC; opacity:1; }
|
||||||
|
14% { background: #f4f4f4; top:110px; opacity:1; }
|
||||||
|
15% { background: #f4f4f4; top:0; opacity:1; }
|
||||||
|
20% { background: #f4f4f4; top:0; opacity:0; }
|
||||||
|
25% { background: #EFEFEF; top:0; opacity:1; }
|
||||||
|
30% { background:#E6E4E4; }
|
||||||
|
70% { top:110px; }
|
||||||
|
100% { top:110px; background: #a1cb5c; }
|
||||||
|
}
|
||||||
|
|
||||||
|
@-webkit-keyframes blue {
|
||||||
|
0% { top:100px; background: #55bce6; opacity:1; }
|
||||||
|
10% { top:100px; background: #BFE8F8; opacity:1; }
|
||||||
|
14% { background: #f4f4f4; top:100px; opacity:1; }
|
||||||
|
15% { background: #f4f4f4; top:0; opacity:1; }
|
||||||
|
20% { background: #f4f4f4; top:0; opacity:0; }
|
||||||
|
25% { background: #f4f4f4; top:0; opacity:0; }
|
||||||
|
45% { background: #EFEFEF; top:0; opacity:0,2; }
|
||||||
|
100% { top:100px; background: #55bce6; }
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes blue {
|
||||||
|
0% { top:100px; background: #55bce6; opacity:1; }
|
||||||
|
10% { top:100px; background: #BFE8F8; opacity:1; }
|
||||||
|
14% { background: #f4f4f4; top:100px; opacity:1; }
|
||||||
|
15% { background: #f4f4f4; top:0; opacity:1; }
|
||||||
|
20% { background: #f4f4f4; top:0; opacity:0; }
|
||||||
|
25% { background: #f4f4f4; top:0; opacity:0; }
|
||||||
|
45% { background: #EFEFEF; top:0; opacity:0,2; }
|
||||||
|
100% { top:100px; background: #55bce6; }
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
var userAgent = navigator.userAgent.toLowerCase(),
|
||||||
|
check = function(regex){ return regex.test(userAgent); },
|
||||||
|
stopLoading = false;
|
||||||
|
if (!check(/opera/) && (check(/msie/) || check(/trident/))) {
|
||||||
|
var m = /msie (\d+\.\d+)/.exec(userAgent);
|
||||||
|
if (m && parseFloat(m[1]) < 9.0) {
|
||||||
|
document.write('<div class="app-error-panel">' +
|
||||||
|
'<div class="message-block">' +
|
||||||
|
'<div class="message-inner">' +
|
||||||
|
'<div class="title">Your browser is not supported.</div>' +
|
||||||
|
'<div class="text">Sorry, Document Editor is currently only supported in the latest versions of the Chrome, Firefox, Safari or Internet Explorer web browsers.</div>' +
|
||||||
|
'</div>' +
|
||||||
|
'</div></div>');
|
||||||
|
stopLoading = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getUrlParams() {
|
||||||
|
var e,
|
||||||
|
a = /\+/g, // Regex for replacing addition symbol with a space
|
||||||
|
r = /([^&=]+)=?([^&]*)/g,
|
||||||
|
d = function (s) { return decodeURIComponent(s.replace(a, " ")); },
|
||||||
|
q = window.location.search.substring(1),
|
||||||
|
urlParams = {};
|
||||||
|
|
||||||
|
while (e = r.exec(q))
|
||||||
|
urlParams[d(e[1])] = d(e[2]);
|
||||||
|
|
||||||
|
return urlParams;
|
||||||
|
}
|
||||||
|
|
||||||
|
function encodeUrlParam(str) {
|
||||||
|
return str.replace(/&/g, '&')
|
||||||
|
.replace(/"/g, '"')
|
||||||
|
.replace(/'/g, ''')
|
||||||
|
.replace(/</g, '<')
|
||||||
|
.replace(/>/g, '>');
|
||||||
|
}
|
||||||
|
|
||||||
|
var params = getUrlParams(),
|
||||||
|
lang = (params["lang"] || 'en').split(/[\-\_]/)[0],
|
||||||
|
customer = params["customer"] ? ('<div class="loader-page-text-customer">' + encodeUrlParam(params["customer"]) + '</div>') : '',
|
||||||
|
margin = (customer !== '') ? 50 : 20,
|
||||||
|
loading = 'Loading...',
|
||||||
|
logo = params["logo"] ? ((params["logo"] !== 'none') ? ('<img src="' + encodeUrlParam(params["logo"]) + '" class="loader-logo" />') : '') : null;
|
||||||
|
|
||||||
|
window.frameEditorId = params["frameEditorId"];
|
||||||
|
|
||||||
|
if ( lang == 'de') loading = 'Ladevorgang...';
|
||||||
|
else if ( lang == 'es') loading = 'Cargando...';
|
||||||
|
else if ( lang == 'fr') loading = 'Chargement en cours...';
|
||||||
|
else if ( lang == 'it') loading = 'Caricamento in corso...';
|
||||||
|
else if ( lang == 'pt') loading = 'Carregando...';
|
||||||
|
else if ( lang == 'ru') loading = 'Загрузка...';
|
||||||
|
else if ( lang == 'sl') loading = 'Nalaganje...';
|
||||||
|
else if ( lang == 'tr') loading = 'Yükleniyor...';
|
||||||
|
|
||||||
|
if ( !stopLoading )
|
||||||
|
document.write(
|
||||||
|
'<div id="loading-mask" class="loadmask">' +
|
||||||
|
'<div class="loader-page" style="margin-bottom: ' + margin + 'px;' + ((logo!==null) ? 'height: auto;' : '') + '">' +
|
||||||
|
((logo!==null) ? logo :
|
||||||
|
'<div class="loader-page-romb">' +
|
||||||
|
'<div class="romb" id="blue"></div>' +
|
||||||
|
'<div class="romb" id="green"></div>' +
|
||||||
|
'<div class="romb" id="red"></div>' +
|
||||||
|
'</div>') +
|
||||||
|
'</div>' +
|
||||||
|
'<div class="loader-page-text">' + customer +
|
||||||
|
'<div class="loader-page-text-loading">' + loading + '</div>' +
|
||||||
|
'</div>' +
|
||||||
|
'</div>');
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<link rel="stylesheet" type="text/css" href="../../../apps/documenteditor/main/resources/css/app.css">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
window.requireTimeourError = function(){
|
||||||
|
var reqerr;
|
||||||
|
|
||||||
|
if ( lang == 'de') reqerr = 'Die Verbindung ist zu langsam, einige Komponenten konnten nicht geladen werden. Aktualisieren Sie bitte die Seite.';
|
||||||
|
else if ( lang == 'es') reqerr = 'La conexión es muy lenta, algunos de los componentes no han podido cargar. Por favor recargue la página.';
|
||||||
|
else if ( lang == 'fr') reqerr = 'La connexion est trop lente, certains des composants n\'ons pas pu être chargé. Veuillez recharger la page.';
|
||||||
|
else if ( lang == 'ru') reqerr = 'Слишком медленное соединение, не удается загрузить некоторые компоненты. Пожалуйста, обновите страницу.';
|
||||||
|
else reqerr = 'The connection is too slow, some of the components could not be loaded. Please reload the page.';
|
||||||
|
|
||||||
|
return reqerr;
|
||||||
|
};
|
||||||
|
|
||||||
|
var requireTimeoutID = setTimeout(function(){
|
||||||
|
window.alert(window.requireTimeourError());
|
||||||
|
window.location.reload();
|
||||||
|
}, 30000);
|
||||||
|
|
||||||
|
var require = {
|
||||||
|
waitSeconds: 30,
|
||||||
|
callback: function(){
|
||||||
|
clearTimeout(requireTimeoutID);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
<div id="viewport"></div>
|
||||||
|
<script data-main="app" src="../../../vendor/requirejs/require.js"></script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||