mirror of
https://github.com/ONLYOFFICE/web-apps.git
synced 2026-02-10 18:05:32 +08:00
level down
This commit is contained in:
@ -1,187 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Documents</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
|
||||
<meta name="description" content="">
|
||||
<meta name="author" content="">
|
||||
|
||||
<!-- debug begin -->
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="../../../../sdkjs/cell/css/main.css"/>
|
||||
<link rel="stylesheet/less" type="text/css" href="resources/less/application.less" />
|
||||
<link rel="stylesheet/less" type="text/css" href="resources/less/celleditor.less" />
|
||||
<!-- debug end -->
|
||||
|
||||
<!-- splash -->
|
||||
|
||||
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.6.1/html5shiv.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
|
||||
<body class="main-body">
|
||||
<!--<div id="loading-mask" class="loadmask">
|
||||
<div class="brendpanel">
|
||||
<div>
|
||||
<div class="brand-logo loading-logo">
|
||||
<img src="">
|
||||
</div>
|
||||
<div class="doc-title"></div>
|
||||
<div class="circle"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="placeholder">
|
||||
<div class="columns"></div>
|
||||
<div class="columns"></div>
|
||||
</div>
|
||||
</div>-->
|
||||
|
||||
<!-- debug begin -->
|
||||
<script type="text/javascript">var less=less||{};less.env='development';</script>
|
||||
<script src="../../../vendor/less/dist/less-2.7.1.js" type="text/javascript"></script>
|
||||
<!-- debug end -->
|
||||
|
||||
<script>
|
||||
var userAgent = navigator.userAgent.toLowerCase(),
|
||||
check = function(regex){ return regex.test(userAgent); };
|
||||
if (!check(/opera/) && (check(/msie/) || check(/trident/))) {
|
||||
var m = /msie (\d+\.\d+)/.exec(userAgent);
|
||||
if (m && parseFloat(m[1]) < 10.0) {
|
||||
document.write(
|
||||
'<div id="id-error-mask" class="errormask">',
|
||||
'<div class="error-body" align="center">',
|
||||
'<div id="id-error-mask-title" class="title">Your browser is not supported.</div>',
|
||||
'<div id="id-error-mask-text">Sorry, ONLYOFFICE Document is currently only supported in the latest versions of the Chrome, Firefox, Safari or Internet Explorer web browsers.</div>',
|
||||
'</div>',
|
||||
'</div>'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
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, '>');
|
||||
}
|
||||
|
||||
var params = getUrlParams(),
|
||||
lang = (params["lang"] || 'en').split(/[\-\_]/)[0];
|
||||
|
||||
window.frameEditorId = params["frameEditorId"];
|
||||
window.parentOrigin = params["parentOrigin"];
|
||||
</script>
|
||||
|
||||
<div class="viewer">
|
||||
<div class="layout-resizer befor" style="top: 20px; height: 4px; "></div>
|
||||
<div id="cell-editing-box">
|
||||
<div class="ce-group-name">
|
||||
<input id="ce-cell-name" class="aslabel form-control" type="text">
|
||||
<div id="ce-cell-name-menu" class="layout-item" style="height: 20px; top: 0px; border-left: none;"></div>
|
||||
</div>
|
||||
<div class="ce-group-content">
|
||||
<textarea id="ce-cell-content" class="form-control" spellcheck="false" rows="1" cols="20"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layout-resizer after" style="top: 20px; height: 4px; "></div>
|
||||
<div id="editor_sdk" class="sdk-view" style="overflow: hidden;" tabindex="-1"></div>
|
||||
<ul id="worksheets" class="worksheet-list"></ul>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="modal fade error" id="id-critical-error-dialog" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 id="id-critical-error-title"></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p id="id-critical-error-message"></p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button id="id-critical-error-close" class="btn btn-sm btn-primary" data-dismiss="modal" aria-hidden="true">Close</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="hyperlink-tooltip" data-toggle="tooltip" title="Press Ctrl and click the link" style="display:none;"></div>
|
||||
|
||||
<!--vendor-->
|
||||
<script type="text/javascript" src="../../../vendor/jquery/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="../../../vendor/jquery.browser/dist/jquery.browser.min.js"></script>
|
||||
<script type="text/javascript" src="../../../vendor/bootstrap/dist/js/bootstrap.js"></script>
|
||||
|
||||
<script type="text/javascript" src="../../../vendor/sockjs/sockjs.min.js"></script>
|
||||
<script type="text/javascript" src="../../../vendor/underscore/underscore-min.js"></script>
|
||||
<script type="text/javascript" src="../../../vendor/xregexp/xregexp-all-min.js"></script>
|
||||
<script type="text/javascript" src="../../../vendor/jszip/jszip.min.js"></script>
|
||||
<script type="text/javascript" src="../../../vendor/jszip-utils/jszip-utils.min.js"></script>
|
||||
|
||||
<script src="../../../vendor/requirejs/require.js"></script>
|
||||
<script>
|
||||
require.config({
|
||||
baseUrl: '../../'
|
||||
});
|
||||
</script>
|
||||
|
||||
<script type="text/javascript" src="../../../../sdkjs/develop/sdkjs/cell/scripts.js"></script>
|
||||
<script>
|
||||
window.sdk_scripts.forEach(function(item){
|
||||
document.write('<script type="text/javascript" src="' + item + '"><\/script>');
|
||||
});
|
||||
</script>
|
||||
|
||||
<!--application-->
|
||||
<script type="text/javascript" src="../../common/locale.js"></script>
|
||||
<script type="text/javascript" src="../../common/Gateway.js"></script>
|
||||
<script type="text/javascript" src="../../common/main/lib/util/LocalStorage.js"></script>
|
||||
<script type="text/javascript" src="../../common/main/lib/util/utils.js"></script>
|
||||
<script type="text/javascript" src="../../common/main/lib/view/LoadMask.js"></script>
|
||||
|
||||
<script type="text/javascript" src="../../common/main/lib/view/CellEditor.js"></script>
|
||||
<script type="text/javascript" src="../../common/main/lib/controller/CellEditor.js"></script>
|
||||
<script type="text/javascript" src="js/ApplicationView.js"></script>
|
||||
<script type="text/javascript" src="js/ApplicationController.js"></script>
|
||||
<script type="text/javascript" src="js/application.js"></script>
|
||||
<script type="text/javascript">
|
||||
var isBrowserSupported = function() {
|
||||
return ($.browser.msie && parseFloat($.browser.version) > 9) ||
|
||||
($.browser.chrome && parseFloat($.browser.version) > 7) ||
|
||||
($.browser.safari && parseFloat($.browser.version) > 4) ||
|
||||
($.browser.opera && parseFloat($.browser.version) > 10.4) ||
|
||||
($.browser.mozilla && parseFloat($.browser.version) > 3.9);
|
||||
};
|
||||
|
||||
if (!isBrowserSupported()){
|
||||
document.write(
|
||||
'<div id="id-error-mask" class="errormask">',
|
||||
'<div class="error-body" align="center">',
|
||||
'<div id="id-error-mask-title" class="title">Your browser is not supported.</div>',
|
||||
'<div id="id-error-mask-text">Sorry, ONLYOFFICE Document is currently only supported in the latest versions of the Chrome, Firefox, Safari or Internet Explorer web browsers.</div>',
|
||||
'</div>',
|
||||
'</div>'
|
||||
);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@ -1,460 +0,0 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2010-2019
|
||||
*
|
||||
* 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 20A-12 Ernesta Birznieka-Upisha
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
SSE.ApplicationController = new(function(){
|
||||
var me,
|
||||
api,
|
||||
config = {},
|
||||
docConfig = {},
|
||||
permissions = {},
|
||||
maxPages = 0,
|
||||
created = false;
|
||||
|
||||
var LoadingDocument = -256;
|
||||
|
||||
// Initialize analytics
|
||||
// -------------------------
|
||||
|
||||
// Common.Analytics.initialize('UA-12442749-13', 'Embedded Spreadsheet Editor');
|
||||
|
||||
|
||||
// Check browser
|
||||
// -------------------------
|
||||
|
||||
if (typeof isBrowserSupported !== 'undefined' && !isBrowserSupported()){
|
||||
//Common.Gateway.reportError(undefined, this.unsupportedBrowserErrorText);
|
||||
console.error( this.unsupportedBrowserErrorText);
|
||||
return;
|
||||
}
|
||||
|
||||
common.localStorage.setId('text');
|
||||
common.localStorage.setKeysFilter('sse-,asc.table');
|
||||
common.localStorage.sync();
|
||||
|
||||
// Handlers
|
||||
// -------------------------
|
||||
|
||||
function loadConfig(data) {
|
||||
config = $.extend(config, data.config);
|
||||
config.canBackToFolder = (config.canBackToFolder!==false) && config.customization && config.customization.goback &&
|
||||
(config.customization.goback.url || config.customization.goback.requestClose && config.canRequestClose);
|
||||
}
|
||||
|
||||
function loadDocument(data) {
|
||||
docConfig = data.doc;
|
||||
|
||||
if (docConfig) {
|
||||
permissions = $.extend(permissions, docConfig.permissions);
|
||||
|
||||
var _permissions = $.extend({}, docConfig.permissions),
|
||||
docInfo = new Asc.asc_CDocInfo(),
|
||||
_user = new Asc.asc_CUserInfo();
|
||||
|
||||
var canRenameAnonymous = !((typeof (config.customization) == 'object') && (typeof (config.customization.anonymous) == 'object') && (config.customization.anonymous.request===false)),
|
||||
guestName = (typeof (config.customization) == 'object') && (typeof (config.customization.anonymous) == 'object') &&
|
||||
(typeof (config.customization.anonymous.label) == 'string') && config.customization.anonymous.label.trim()!=='' ?
|
||||
common.utils.htmlEncode(config.customization.anonymous.label) : me.textGuest,
|
||||
value = canRenameAnonymous ? common.localStorage.getItem("guest-username") : null,
|
||||
user = common.utils.fillUserInfo(config.user, config.lang, value ? (value + ' (' + guestName + ')' ) : me.textAnonymous,
|
||||
common.localStorage.getItem("guest-id") || ('uid-' + Date.now()));
|
||||
user.anonymous && common.localStorage.setItem("guest-id", user.id);
|
||||
|
||||
_user.put_Id(user.id);
|
||||
_user.put_FullName(user.fullname);
|
||||
_user.put_IsAnonymousUser(user.anonymous);
|
||||
|
||||
docInfo.put_Id(docConfig.key);
|
||||
docInfo.put_Url(docConfig.url);
|
||||
docInfo.put_Title(docConfig.title);
|
||||
docInfo.put_Format(docConfig.fileType);
|
||||
docInfo.put_VKey(docConfig.vkey);
|
||||
docInfo.put_UserInfo(_user);
|
||||
docInfo.put_Token(docConfig.token);
|
||||
docInfo.put_Permissions(_permissions);
|
||||
docInfo.put_EncryptedInfo(config.encryptionKeys);
|
||||
docInfo.put_Lang(config.lang);
|
||||
docInfo.put_Mode(config.mode);
|
||||
|
||||
docInfo.asc_putIsEnabledMacroses(false);
|
||||
docInfo.asc_putIsEnabledPlugins(false);
|
||||
/*var enable = !config.customization || (config.customization.macros!==false);
|
||||
docInfo.asc_putIsEnabledMacroses(!!enable);
|
||||
enable = !config.customization || (config.customization.plugins!==false);
|
||||
docInfo.asc_putIsEnabledPlugins(!!enable);*/
|
||||
|
||||
if (api) {
|
||||
api.asc_registerCallback('asc_onGetEditorPermissions', onEditorPermissions);
|
||||
// api.asc_registerCallback('asc_onRunAutostartMacroses', onRunAutostartMacroses);
|
||||
api.asc_setDocInfo(docInfo);
|
||||
api.asc_getEditorPermissions(config.licenseUrl, config.customerId);
|
||||
api.asc_enableKeyEvents(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function setActiveWorkSheet(index) {
|
||||
var $box = $('#worksheets');
|
||||
$box.find('> li').removeClass('active');
|
||||
$box.find('#worksheet' + index).addClass('active');
|
||||
|
||||
api.asc_showWorksheet(index);
|
||||
}
|
||||
|
||||
function onSheetsChanged(){
|
||||
maxPages = api.asc_getWorksheetsCount();
|
||||
|
||||
var handleWorksheet = function(e){
|
||||
var $worksheet = $(this);
|
||||
var index = $worksheet.attr('id').match(/\d+$/);
|
||||
|
||||
if (index.length > 0) {
|
||||
index = parseInt(index[0]);
|
||||
|
||||
if (index > -1 && index < maxPages)
|
||||
setActiveWorkSheet(index);
|
||||
}
|
||||
};
|
||||
|
||||
var $box = $('#worksheets');
|
||||
$box.find('li').off();
|
||||
$box.empty();
|
||||
|
||||
var tpl = '<li id="worksheet{index}">{title}</li>';
|
||||
for (var i = 0; i < maxPages; i++) {
|
||||
var item = tpl.replace(/\{index}/, i).replace(/\{title}/,api.asc_getWorksheetName(i).replace(/\s/g,' '));
|
||||
$(item).appendTo($box).on('click', handleWorksheet);
|
||||
}
|
||||
|
||||
setActiveWorkSheet(api.asc_getActiveWorksheetIndex());
|
||||
}
|
||||
|
||||
function hidePreloader() {
|
||||
$('#loading-mask').fadeOut('slow');
|
||||
}
|
||||
|
||||
function onDocumentContentReady() {
|
||||
hidePreloader();
|
||||
onLongActionEnd(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument);
|
||||
api.asc_registerCallback('asc_onHyperlinkClick', common.utils.openLink);
|
||||
api.asc_registerCallback('asc_onStartAction', onLongActionBegin);
|
||||
|
||||
Common.Gateway.on('processmouse', onProcessMouse);
|
||||
Common.Gateway.on('downloadas', onDownloadAs);
|
||||
Common.Gateway.on('requestclose', onRequestClose);
|
||||
|
||||
|
||||
$('#editor_sdk').on('click', function(e) {
|
||||
if ( e.target.localName == 'canvas' ) {
|
||||
e.currentTarget.focus();
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('mousewheel', function (e) {
|
||||
if ((e.ctrlKey || e.metaKey) && !e.altKey) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
}
|
||||
});
|
||||
|
||||
Common.Gateway.documentReady();
|
||||
}
|
||||
|
||||
function onEditorPermissions(params) {
|
||||
api.asc_setAutoSaveGap(1);
|
||||
|
||||
onLongActionBegin(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument);
|
||||
|
||||
//api.asc_setViewMode(true);
|
||||
api.asc_LoadDocument();
|
||||
}
|
||||
|
||||
function onOpenDocument(progress) {
|
||||
var proc = (progress.asc_getCurrentFont() + progress.asc_getCurrentImage())/(progress.asc_getFontsCount() + progress.asc_getImagesCount());
|
||||
me.loadMask && me.loadMask.setTitle(me.textLoadingDocument + ': ' + common.utils.fixedDigits(Math.min(Math.round(proc*100), 100), 3, " ") + '%');
|
||||
}
|
||||
|
||||
function onLongActionBegin(type, id){
|
||||
var text = '';
|
||||
switch (id)
|
||||
{
|
||||
case LoadingDocument:
|
||||
text = me.textLoadingDocument + ' ';
|
||||
break;
|
||||
default:
|
||||
text = me.waitText;
|
||||
break;
|
||||
}
|
||||
|
||||
if (type == Asc.c_oAscAsyncActionType['BlockInteraction']) {
|
||||
if (!me.loadMask)
|
||||
me.loadMask = new common.view.LoadMask();
|
||||
me.loadMask.setTitle(text);
|
||||
me.loadMask.show();
|
||||
}
|
||||
}
|
||||
|
||||
function onLongActionEnd(type, id){
|
||||
if (type === Asc.c_oAscAsyncActionType.BlockInteraction) {
|
||||
switch (id) {
|
||||
case Asc.c_oAscAsyncAction.Open:
|
||||
if (api) {
|
||||
api.asc_Resize();
|
||||
var zf = (config.customization && config.customization.zoom ? parseInt(config.customization.zoom)/100 : 1);
|
||||
api.asc_setZoom(zf>0 ? zf : 1);
|
||||
}
|
||||
|
||||
onDocumentContentReady();
|
||||
onSheetsChanged();
|
||||
break;
|
||||
}
|
||||
|
||||
me.loadMask && me.loadMask.hide();
|
||||
}
|
||||
}
|
||||
|
||||
function onError(id, level, errData) {
|
||||
if (id == Asc.c_oAscError.ID.LoadingScriptError) {
|
||||
/*$('#id-critical-error-title').text(me.criticalErrorTitle);
|
||||
$('#id-critical-error-message').text(me.scriptLoadError);
|
||||
$('#id-critical-error-close').text(me.txtClose).off().on('click', function(){
|
||||
window.location.reload();
|
||||
});
|
||||
$('#id-critical-error-dialog').css('z-index', 20002).modal('show');*/
|
||||
console.error(me.scriptLoadError);
|
||||
return;
|
||||
}
|
||||
|
||||
hidePreloader();
|
||||
onLongActionEnd(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument);
|
||||
|
||||
var message;
|
||||
|
||||
switch (id)
|
||||
{
|
||||
case Asc.c_oAscError.ID.Unknown:
|
||||
message = me.unknownErrorText;
|
||||
break;
|
||||
|
||||
case Asc.c_oAscError.ID.ConvertationTimeout:
|
||||
message = me.convertationTimeoutText;
|
||||
break;
|
||||
|
||||
case Asc.c_oAscError.ID.ConvertationError:
|
||||
message = me.convertationErrorText;
|
||||
break;
|
||||
|
||||
case Asc.c_oAscError.ID.DownloadError:
|
||||
message = me.downloadErrorText;
|
||||
break;
|
||||
|
||||
case Asc.c_oAscError.ID.ConvertationPassword:
|
||||
message = me.errorFilePassProtect;
|
||||
break;
|
||||
|
||||
case Asc.c_oAscError.ID.UserDrop:
|
||||
message = me.errorUserDrop;
|
||||
break;
|
||||
|
||||
case Asc.c_oAscError.ID.ConvertationOpenLimitError:
|
||||
message = me.errorFileSizeExceed;
|
||||
break;
|
||||
|
||||
case Asc.c_oAscError.ID.UpdateVersion:
|
||||
message = me.errorUpdateVersionOnDisconnect;
|
||||
break;
|
||||
|
||||
case Asc.c_oAscError.ID.AccessDeny:
|
||||
message = me.errorAccessDeny;
|
||||
break;
|
||||
|
||||
case Asc.c_oAscError.ID.ForceSaveButton:
|
||||
case Asc.c_oAscError.ID.ForceSaveTimeout:
|
||||
message = me.errorForceSave;
|
||||
break;
|
||||
|
||||
case Asc.c_oAscError.ID.LoadingFontError:
|
||||
message = me.errorLoadingFont;
|
||||
break;
|
||||
|
||||
default:
|
||||
message = me.errorDefaultMessage.replace('%1', id);
|
||||
break;
|
||||
}
|
||||
|
||||
if (level == Asc.c_oAscError.Level.Critical) {
|
||||
|
||||
// report only critical errors
|
||||
//Common.Gateway.reportError(id, message);
|
||||
console.error(id,message);
|
||||
|
||||
/* $('#id-critical-error-title').text(me.criticalErrorTitle);
|
||||
$('#id-critical-error-message').html(message);
|
||||
$('#id-critical-error-close').text(me.txtClose).off().on('click', function(){
|
||||
window.location.reload();
|
||||
});*/
|
||||
}
|
||||
else {
|
||||
// Common.Gateway.reportWarning(id, message);
|
||||
console.warn(id,message);
|
||||
|
||||
/*$('#id-critical-error-title').text(me.notcriticalErrorTitle);
|
||||
$('#id-critical-error-message').html(message);
|
||||
$('#id-critical-error-close').text(me.txtClose).off().on('click', function(){
|
||||
$('#id-critical-error-dialog').modal('hide');
|
||||
});*/
|
||||
}
|
||||
|
||||
//$('#id-critical-error-dialog').modal('show');
|
||||
|
||||
//Common.Analytics.trackEvent('Internal Error', id.toString());
|
||||
}
|
||||
|
||||
function onExternalMessage(error) {
|
||||
if (error) {
|
||||
hidePreloader();
|
||||
$('#id-error-mask-title').text(me.criticalErrorTitle);
|
||||
$('#id-error-mask-text').text(error.msg);
|
||||
$('#id-error-mask').css('display', 'block');
|
||||
|
||||
//Common.Analytics.trackEvent('External Error');
|
||||
}
|
||||
}
|
||||
|
||||
function onProcessMouse(data) {
|
||||
if (data.type == 'mouseup') {
|
||||
var editor = document.getElementById('editor_sdk');
|
||||
if (editor) {
|
||||
var rect = editor.getBoundingClientRect();
|
||||
var event = window.event || arguments.callee.caller.arguments[0];
|
||||
api.asc_onMouseUp(event, data.x - rect.left, data.y - rect.top);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function onRequestClose() {
|
||||
Common.Gateway.requestClose();
|
||||
}
|
||||
|
||||
function onDownloadAs() {
|
||||
if ( permissions.download === false) {
|
||||
//Common.Gateway.reportError(Asc.c_oAscError.ID.AccessDeny, me.errorAccessDeny);
|
||||
console.error(Asc.c_oAscError.ID.AccessDeny, me.errorAccessDeny);
|
||||
return;
|
||||
}
|
||||
api.asc_DownloadAs(new Asc.asc_CDownloadOptions(Asc.c_oAscFileType.XLSX, true));
|
||||
}
|
||||
|
||||
|
||||
function onRunAutostartMacroses() {
|
||||
if (!config.customization || (config.customization.macros!==false))
|
||||
if (api) api.asc_runAutostartMacroses();
|
||||
}
|
||||
|
||||
function onBeforeUnload () {
|
||||
common.localStorage.save();
|
||||
}
|
||||
// Helpers
|
||||
// -------------------------
|
||||
|
||||
function onDocumentResize() {
|
||||
if (api) api.asc_Resize();
|
||||
}
|
||||
|
||||
function createController(){
|
||||
if (created)
|
||||
return me;
|
||||
|
||||
me = this;
|
||||
created = true;
|
||||
|
||||
// popover ui handlers
|
||||
|
||||
$(window).resize(function(){
|
||||
onDocumentResize();
|
||||
});
|
||||
window.onbeforeunload = onBeforeUnload;
|
||||
|
||||
api = new Asc.spreadsheet_api({
|
||||
'id-view': 'editor_sdk',
|
||||
'id-input' : 'ce-cell-content',
|
||||
'embedded' : true
|
||||
});
|
||||
|
||||
if (api){
|
||||
api.asc_registerCallback('asc_onEndAction', onLongActionEnd);
|
||||
api.asc_registerCallback('asc_onError', onError);
|
||||
api.asc_registerCallback('asc_onOpenDocumentProgress', onOpenDocument);
|
||||
api.asc_registerCallback('asc_onSheetsChanged', onSheetsChanged);
|
||||
api.asc_registerCallback('asc_onActiveSheetChanged', setActiveWorkSheet);
|
||||
|
||||
if(common.controller.CellEditor ) {
|
||||
common.controller.CellEditor.create();
|
||||
common.controller.CellEditor.setApi(api)
|
||||
common.controller.CellEditor.setMode(config);
|
||||
}
|
||||
// Initialize api gateway
|
||||
Common.Gateway.on('init', loadConfig);
|
||||
Common.Gateway.on('opendocument', loadDocument);
|
||||
Common.Gateway.on('showmessage', onExternalMessage);
|
||||
Common.Gateway.appReady();
|
||||
}
|
||||
|
||||
return me;
|
||||
}
|
||||
|
||||
return {
|
||||
create : createController,
|
||||
errorDefaultMessage : 'Error code: %1',
|
||||
unknownErrorText : 'Unknown error.',
|
||||
convertationTimeoutText : 'Conversion timeout exceeded.',
|
||||
convertationErrorText : 'Conversion failed.',
|
||||
downloadErrorText : 'Download failed.',
|
||||
criticalErrorTitle : 'Error',
|
||||
notcriticalErrorTitle : 'Warning',
|
||||
scriptLoadError: 'The connection is too slow, some of the components could not be loaded. Please reload the page.',
|
||||
errorFilePassProtect: 'The file is password protected and cannot be opened.',
|
||||
errorAccessDeny: 'You are trying to perform an action you do not have rights for.<br>Please contact your Document Server administrator.',
|
||||
errorUserDrop: 'The file cannot be accessed right now.',
|
||||
unsupportedBrowserErrorText: 'Your browser is not supported.',
|
||||
textOf: 'of',
|
||||
downloadTextText: 'Downloading spreadsheet...',
|
||||
waitText: 'Please, wait...',
|
||||
textLoadingDocument: 'Loading spreadsheet',
|
||||
txtClose: 'Close',
|
||||
errorFileSizeExceed: 'The file size exceeds the limitation set for your server.<br>Please contact your Document Server administrator for details.',
|
||||
errorUpdateVersionOnDisconnect: 'Internet connection has been restored, and the file version has been changed.<br>Before you can continue working, you need to download the file or copy its content to make sure nothing is lost, and then reload this page.',
|
||||
textGuest: 'Guest',
|
||||
textAnonymous: 'Anonymous',
|
||||
errorForceSave: "An error occurred while saving the file. Please use the 'Download as' option to save the file to your computer hard drive or try again later.",
|
||||
errorLoadingFont: 'Fonts are not loaded.<br>Please contact your Document Server administrator.'
|
||||
}
|
||||
})();
|
||||
@ -1,70 +0,0 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2010-2019
|
||||
*
|
||||
* 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 20A-12 Ernesta Birznieka-Upisha
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
|
||||
if (SSE === undefined) {
|
||||
var SSE = {};
|
||||
}
|
||||
|
||||
SSE.ApplicationView = new(function(){
|
||||
|
||||
var $btnTools;
|
||||
// Initialize view
|
||||
|
||||
function createView(){
|
||||
$btnTools = $('#box-tools button');
|
||||
|
||||
$btnTools.addClass('dropdown-toggle').attr('data-toggle', 'dropdown').attr('aria-expanded', 'true');
|
||||
$btnTools.parent().append(
|
||||
'<ul class="dropdown-menu pull-right">' +
|
||||
'</ul>');
|
||||
}
|
||||
|
||||
function getTools(name) {
|
||||
return $btnTools.parent().find(name);
|
||||
}
|
||||
|
||||
|
||||
return {
|
||||
create: createView
|
||||
, tools: {
|
||||
get: getTools
|
||||
},
|
||||
|
||||
txtDownload: 'Download',
|
||||
txtPrint: 'Print',
|
||||
txtShare: 'Share',
|
||||
txtEmbed: 'Embed',
|
||||
txtFullScreen: 'Full Screen',
|
||||
txtFileLocation: 'Open file location'
|
||||
}
|
||||
})();
|
||||
@ -1,42 +0,0 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2010-2019
|
||||
*
|
||||
* 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 20A-12 Ernesta Birznieka-Upisha
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
(function ($) {
|
||||
|
||||
$(function(){
|
||||
Common.Locale.apply(function() {
|
||||
SSE.ApplicationView.create();
|
||||
SSE.ApplicationController.create();
|
||||
});
|
||||
})
|
||||
|
||||
})(window.jQuery);
|
||||
@ -1,56 +0,0 @@
|
||||
// Common styles
|
||||
@import "../../../../common/main/resources/less/common.less";
|
||||
|
||||
// Worksheets
|
||||
// -------------------------
|
||||
.viewer {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.sdk-view {
|
||||
position: relative;
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
ul.worksheet-list {
|
||||
flex-grow: 0;
|
||||
flex-shrink: 0;
|
||||
margin: 0;
|
||||
padding: 0 9px;
|
||||
border-top: 1px solid #5A5A5A;
|
||||
border-bottom: 1px solid #BABABA;
|
||||
#gradient > .vertical(#B6B6B6, #CACACA);
|
||||
box-shadow: 0 4px 4px -4px #333 inset;
|
||||
|
||||
|
||||
li {
|
||||
float: left;
|
||||
cursor: pointer;
|
||||
list-style: none;
|
||||
margin: 0 2px 2px 3px;
|
||||
padding: 0 13px;
|
||||
color: #FFFFFF;
|
||||
#gradient > .vertical(#9A9A9A, #828282);
|
||||
box-shadow: 0 4px 4px -4px #333 inset;
|
||||
-webkit-border-bottom-right-radius: 4px;
|
||||
// -moz-border-radius-bottomright: 4px;
|
||||
border-bottom-right-radius: 4px;
|
||||
-webkit-border-bottom-left-radius: 4px;
|
||||
// -moz-border-radius-bottomleft: 4px;
|
||||
border-bottom-left-radius: 4px;
|
||||
|
||||
border-bottom: 1px solid #929292;
|
||||
border-top-color: transparent;
|
||||
|
||||
&.active {
|
||||
margin-top: -1px;
|
||||
padding: 0 12px;
|
||||
border: 1px solid #929292;
|
||||
border-top-color: transparent;
|
||||
background: #DDDDDD;
|
||||
color: #000;
|
||||
box-shadow: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,168 +0,0 @@
|
||||
// Common styles
|
||||
@import "../../../../common/main/resources/less/colors-table-ie-fix.less";
|
||||
@import "../../../../common/main/resources/less/variables.less";
|
||||
@import "../../../../common/main/resources/less/colors-table.less";
|
||||
@import "../../../../common/main/resources/less/asc-mixins.less";
|
||||
@import "../../../../common/main/resources/less/buttons.less";
|
||||
#cell-editing-box {
|
||||
border-bottom: solid @scaled-one-px-value-ie @border-toolbar-ie;
|
||||
border-bottom: solid @scaled-one-px-value @border-toolbar;
|
||||
border-left: solid @scaled-one-px-value-ie @border-toolbar-ie;
|
||||
border-left: solid @scaled-one-px-value @border-toolbar;
|
||||
min-height: 20px;
|
||||
background-color: @background-toolbar-ie;
|
||||
background-color: @background-toolbar;
|
||||
|
||||
.ce-group-name {
|
||||
float: left;
|
||||
height: 20px;
|
||||
background-color: @background-toolbar-ie;
|
||||
background-color: @background-toolbar;
|
||||
|
||||
#ce-cell-name {
|
||||
width: 100px;
|
||||
height: 19px;
|
||||
//height: calc(19px + (1px - 1px/var(--pixel-ratio-factor,1)));
|
||||
padding: 0px 19px 0 4px;
|
||||
vertical-align: top;
|
||||
display: inline-block;
|
||||
border: 0 none;
|
||||
border-right: @scaled-one-px-value-ie solid @border-toolbar-ie;
|
||||
border-right: @scaled-one-px-value solid @border-toolbar;
|
||||
transition: none;
|
||||
-webkit-transition: none;
|
||||
box-shadow: 0 @scaled-one-px-value-ie 0 0 @border-toolbar-ie;
|
||||
box-shadow: 0 @scaled-one-px-value 0 0 @border-toolbar;
|
||||
|
||||
&[disabled] {
|
||||
color: @border-preview-select-ie;
|
||||
color: @border-preview-select;
|
||||
opacity: 0.5;
|
||||
}
|
||||
}
|
||||
|
||||
#ce-cell-name-menu {
|
||||
display: inline-block;
|
||||
position: absolute;
|
||||
left: 80px;
|
||||
background-color: @background-toolbar-ie;
|
||||
background-color: @background-toolbar;
|
||||
|
||||
button {
|
||||
background-color: @background-normal-ie;
|
||||
background-color: @background-normal;
|
||||
height: 19px;
|
||||
|
||||
&.disabled {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
&:active:not(.disabled),
|
||||
&.active:not(.disabled){
|
||||
.caret {
|
||||
border-color: @icon-normal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.dropdown-menu a {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
}
|
||||
|
||||
#ce-func-label {
|
||||
height: 20px;
|
||||
margin-left: -3px;
|
||||
.border-radius(0);
|
||||
|
||||
&.disabled {
|
||||
opacity: 0.4;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&:not(.expanded) {
|
||||
#ce-func-label {
|
||||
border-bottom: @scaled-one-px-value-ie solid @border-toolbar-ie;
|
||||
border-bottom: @scaled-one-px-value solid @border-toolbar;
|
||||
}
|
||||
}
|
||||
|
||||
.ce-group-expand {
|
||||
float: right;
|
||||
//height: 20px;
|
||||
height: 100%;
|
||||
background-color: @background-normal-ie;
|
||||
background-color: @background-normal;
|
||||
}
|
||||
|
||||
.ce-group-content {
|
||||
margin: 0 2px 0 120px;
|
||||
height: 100%;
|
||||
border-left: @scaled-one-px-value-ie solid @border-toolbar-ie;
|
||||
border-left: @scaled-one-px-value solid @border-toolbar;
|
||||
#ce-cell-content {
|
||||
height: 100%;
|
||||
resize: none;
|
||||
min-height: 19px;
|
||||
border: 0 none;
|
||||
font-size: 12px;
|
||||
line-height: 18px;
|
||||
padding-bottom: 0;
|
||||
padding-top: 0;
|
||||
&[disabled] {
|
||||
color: @border-preview-select-ie;
|
||||
color: @border-preview-select;
|
||||
opacity: 0.5;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ce-cell-name, #ce-cell-content {
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
&+.layout-resizer {
|
||||
border-top: 0 none;
|
||||
border-bottom: 0 none;
|
||||
|
||||
&.move {
|
||||
border-top: @scaled-one-px-value-ie solid @border-toolbar-ie;
|
||||
border-top: @scaled-one-px-value solid @border-toolbar;
|
||||
border-bottom: @scaled-one-px-value-ie solid @border-toolbar-ie;
|
||||
border-bottom: @scaled-one-px-value solid @border-toolbar;
|
||||
opacity: 0.4;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ce-btn-expand {
|
||||
width: 16px;
|
||||
height: 18px;
|
||||
.border-radius(0);
|
||||
background: transparent;
|
||||
padding: 0 2px 0;
|
||||
|
||||
.caret {
|
||||
transition: transform .2s;
|
||||
border-color: @icon-normal;
|
||||
}
|
||||
|
||||
&.btn-collapse {
|
||||
.caret {
|
||||
transform: rotate(45deg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.layout-resizer {
|
||||
z-index: @zindex-dropdown - 10;
|
||||
background: @background-toolbar-ie;
|
||||
background: @background-toolbar;
|
||||
border: 0 none;
|
||||
|
||||
&.move {
|
||||
opacity: 0.4;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user