Refactoring

This commit is contained in:
OVSharova 2021-09-16 01:35:51 +03:00
parent cb4e35774c
commit bef78882d0
12 changed files with 152 additions and 456 deletions

View file

@ -86,7 +86,6 @@
@import "../../../../common/main/resources/less/combobox.less";
@import "../../../../common/main/resources/less/window.less";
@import "../../../../common/main/resources/less/spinner.less";
@import "../../../../common/main/resources/less/loadmask.less";
@import "../../../../common/main/resources/less/checkbox.less";
@import "../../../../common/main/resources/less/radiobox.less";
@import "../../../../common/main/resources/less/dataview.less";

View file

@ -86,7 +86,6 @@
@import "../../../../common/main/resources/less/combobox.less";
@import "../../../../common/main/resources/less/window.less";
@import "../../../../common/main/resources/less/spinner.less";
@import "../../../../common/main/resources/less/loadmask.less";
@import "../../../../common/main/resources/less/checkbox.less";
@import "../../../../common/main/resources/less/radiobox.less";
@import "../../../../common/main/resources/less/dataview.less";

View file

@ -86,7 +86,6 @@
@import "../../../../common/main/resources/less/combobox.less";
@import "../../../../common/main/resources/less/window.less";
@import "../../../../common/main/resources/less/spinner.less";
@import "../../../../common/main/resources/less/loadmask.less";
@import "../../../../common/main/resources/less/checkbox.less";
@import "../../../../common/main/resources/less/radiobox.less";
@import "../../../../common/main/resources/less/dataview.less";

View file

@ -37,13 +37,6 @@
common.utils = new(function(){
return {
openLink: function(url) {
if (url) {
var newDocumentPage = window.open(url, '_blank');
if (newDocumentPage)
newDocumentPage.focus();
}
},
htmlEncode: function(value) {
return $('<div/>').text(value).html();
},
@ -56,22 +49,6 @@
_user.group && (_user.fullname = (_user.group).toString() + AscCommon.UserInfoParser.getSeparator() + _user.fullname);
_user.guest = !_user.name;
return _user;
},
fixedDigits: function(num, digits, fill) {
(fill===undefined) && (fill = '0');
var strfill = "",
str = num.toString();
for (var i=str.length; i<digits; i++) strfill += fill;
return strfill + str;
},
getKeyByValue: function(obj, value) {
for(var prop in obj) {
if(obj.hasOwnProperty(prop)) {
if(obj[prop] === value)
return prop;
}
}
}
};
})();

View file

@ -52,9 +52,6 @@
@import "../../../../../vendor/bootstrap/less/utilities.less";
@import "../../../../../vendor/bootstrap/less/responsive-utilities.less";
@import "loadmask.less";
@toolbarBorderColor: #dbdbdb;
@toolbarBorderShadowColor: #FAFAFA;
@toolbarTopColor: #F7F7F7;

View file

@ -1,74 +0,0 @@
@loadmask-zindex: 10000;
@loadmask-image-height: 28px;
@loadmask-image-width: 28px;
@loadmask-small-image-height: 20px;
@loadmask-small-image-width: 20px;
@background-loader-ie: fade(#000, 65%);
@background-loader: fade(#181818, 90%);
@text-contrast-background-ie: #fff;
@text-contrast-background: #fff;
.asc-loadmask {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
zoom: 1;
background-color: transparent;
z-index: @loadmask-zindex;
}
.asc-loadmask-body {
position: absolute;
z-index: @loadmask-zindex + 1;
padding: 24px;
line-height: @loadmask-image-height;
border: none;
background-image: none;
background-color: @background-loader-ie;
background-color: @background-loader;
color: @text-contrast-background-ie;
color: @text-contrast-background;
border-radius: 6px;
left: 50%;
top: 50%;
transform: translate(-50%);
& > div {
display: inline-block;
vertical-align: middle;
}
/* .asc-loadmask-image {
background-image: ~"url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyOCAyOCI+PGNpcmNsZSBjeD0iMTQiIGN5PSIxNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjZmZmIiBzdHJva2Utd2lkdGg9IjEuNSIgcj0iMTAuMjUiIHN0cm9rZS1kYXNoYXJyYXk9IjE2MCUsIDQwJSIgLz48L3N2Zz4=)";
height: 28px;
width: 28px;
float: left;
margin-left: 8px;
}*/
.asc-loadmask-title {
font-size: 13px;
margin: 0 8px 0 12px;
white-space: pre-wrap;
}
}
@keyframes rotation {
from {
transform: rotate(0);
}
to {
transform: rotate(360deg);
}
}
#loadmask-spinner {
animation-duration: .8s;
animation-name: rotation;
animation-iteration-count: infinite;
animation-timing-function: linear;
}

View file

@ -38,7 +38,6 @@ DE.ApplicationController = new(function(){
permissions = {},
created = false,
appOptions = {},
_submitFail, $submitedTooltip,
bodyWidth = 0;
var LoadingDocument = -256;
@ -47,7 +46,6 @@ DE.ApplicationController = new(function(){
// -------------------------
if (typeof isBrowserSupported !== 'undefined' && !isBrowserSupported()){
//Common.Gateway.reportError(undefined, this.unsupportedBrowserErrorText);
console.error(this.unsupportedBrowserErrorText);
return;
}
@ -122,24 +120,15 @@ DE.ApplicationController = new(function(){
function onLongActionBegin(type, id) {
if (type == Asc.c_oAscAsyncActionType['BlockInteraction']) {
/*if (!me.loadMask)
me.loadMask = new common.view.LoadMask();
me.loadMask.show();*/
console.log('Action begin');
}
}
function onLongActionEnd(type, id){
//me.loadMask && me.loadMask.hide();
console.log('Action end');
}
function hidePreloader() {
$('#loading-mask').fadeOut('slow');
}
function onDocumentContentReady() {
//hidePreloader();
onLongActionEnd(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument);
var zf = (config.customization && config.customization.zoom ? parseInt(config.customization.zoom) : -2);
@ -147,15 +136,13 @@ DE.ApplicationController = new(function(){
api.asc_registerCallback('asc_onStartAction', onLongActionBegin);
api.asc_registerCallback('asc_onEndAction', onLongActionEnd);
api.asc_registerCallback('asc_onHyperlinkClick', common.utils.openLink);
Common.Gateway.on('processmouse', onProcessMouse);
Common.Gateway.on('downloadas', onDownloadAs);
//Common.Gateway.on('processmouse', onProcessMouse);
//Common.Gateway.on('downloadas', onDownloadAs);
Common.Gateway.on('requestclose', onRequestClose);
var downloadAs = function(format){
/*var downloadAs = function(format){
api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format));
};
};*/
// TODO: add asc_hasRequiredFields to sdk
Common.Gateway.documentReady();
@ -177,25 +164,12 @@ DE.ApplicationController = new(function(){
api.Resize();
}
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, " ") + '%');
//console.log('onOpenDocument');
}
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.criticalErrorTitle,me.scriptLoadError);
return;
}
//hidePreloader();
onLongActionEnd(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument);
var message;
@ -240,8 +214,6 @@ DE.ApplicationController = new(function(){
case Asc.c_oAscError.ID.Submit:
message = me.errorSubmit;
/*_submitFail = true;
$submitedTooltip && $submitedTooltip.hide();*/
break;
case Asc.c_oAscError.ID.EditingError:
@ -263,36 +235,16 @@ DE.ApplicationController = new(function(){
}
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');
}
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');*/
console.error(error.msg);
}
}
@ -324,11 +276,6 @@ DE.ApplicationController = new(function(){
if (api) api.asc_DownloadAs(new Asc.asc_CDownloadOptions(Asc.c_oAscFileType.DOCX, false));
}
function onRunAutostartMacroses() {
if (!config.customization || (config.customization.macros!==false))
if (api) api.asc_runAutostartMacroses();
}
function onBeforeUnload () {
common.localStorage.save();
}

View file

@ -44,7 +44,6 @@ PE.ApplicationController = new(function(){
// -------------------------
if (typeof isBrowserSupported !== 'undefined' && !isBrowserSupported()){
//Common.Gateway.reportError(undefined, this.unsupportedBrowserErrorText);
console.error(this.unsupportedBrowserErrorText);
return;
}
@ -58,8 +57,6 @@ PE.ApplicationController = new(function(){
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) {
@ -95,16 +92,8 @@ PE.ApplicationController = new(function(){
docInfo.put_Permissions(_permissions);
docInfo.put_EncryptedInfo(config.encryptionKeys);
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(true);
@ -114,50 +103,27 @@ PE.ApplicationController = new(function(){
}
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();*/
console.log('Action begin');
}
}
function onLongActionEnd(){
//me.loadMask && me.loadMask.hide();
console.log('Action end');
}
function hidePreloader() {
$('#loading-mask').fadeOut('slow');
}
function onDocumentContentReady() {
api.ShowThumbnails(true);
//hidePreloader();
onLongActionEnd(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument);
api.asc_registerCallback('asc_onHyperlinkClick', common.utils.openLink);
api.asc_registerCallback('asc_onStartAction', onLongActionBegin);
api.asc_registerCallback('asc_onEndAction', onLongActionEnd);
// api.asc_registerCallback('asc_onEndDemonstration', onPlayStop);
//.asc_registerCallback('asc_onDemonstrationSlideChanged', onPlaySlideChanged);
Common.Gateway.on('processmouse', onProcessMouse);
Common.Gateway.on('downloadas', onDownloadAs);
//Common.Gateway.on('processmouse', onProcessMouse);
//Common.Gateway.on('downloadas', onDownloadAs);
Common.Gateway.on('requestclose', onRequestClose);
$('#editor_sdk').on('click', function(e) {
@ -176,50 +142,12 @@ PE.ApplicationController = new(function(){
api.Resize();
}
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, " ") + '%');
}
/* var isplaymode;
function onPlayStart(e) {
if ( !isplaymode ) {
$('#box-preview').show();
api.StartDemonstration('id-preview', currentPage);
} else {
isplaymode == 'play' ?
api.DemonstrationPause() : api.DemonstrationPlay();
}
isplaymode != 'play' ? ($('#btn-play button').addClass('pause'), isplaymode = 'play') :
($('#btn-play button').removeClass('pause'), isplaymode = 'pause');
}
function onPlayStop() {
isplaymode = undefined;
$('#page-number').val(currentPage + 1);
//$('#btn-play button').removeClass('pause');
$('#box-preview').hide();
}
function onPlaySlideChanged(number) {
if ( number++ < maxPages)
$('#page-number').val(number);
}*/
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;
@ -280,39 +208,16 @@ PE.ApplicationController = new(function(){
// report only critical errors
console.error(id,message);
/*Common.Gateway.reportError(id, message);
$('#id-crical-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 {
console.warn(id,message);
/*Common.Gateway.reportWarning(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');*/
console.error(error.msg);
//Common.Analytics.trackEvent('External Error');
}
}
@ -335,18 +240,12 @@ PE.ApplicationController = new(function(){
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;
}
if (api) api.asc_DownloadAs(new Asc.asc_CDownloadOptions(Asc.c_oAscFileType.PPTX, false));
}
function onRunAutostartMacroses() {
if (!config.customization || (config.customization.macros!==false))
if (api) api.asc_runAutostartMacroses();
}
function onBeforeUnload () {
common.localStorage.save();
}
@ -383,7 +282,6 @@ PE.ApplicationController = new(function(){
api.asc_registerCallback('asc_onError', onError);
api.asc_registerCallback('asc_onDocumentContentReady', onDocumentContentReady);
//api.asc_registerCallback('asc_onOpenDocumentProgress', onOpenDocument);
// Initialize api gateway
Common.Gateway.on('init', loadConfig);

View file

@ -1,185 +1,167 @@
<!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="">
<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 -->
<!-- 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 -->
<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 -->
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.6.1/html5shiv.js"></script>
<![endif]-->
</head>
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.6.1/html5shiv.js"></script>
<![endif]-->
</head>
<body class="main-body">
<body class="main-body">
<!--<div id="loading-mask" class="loadmask">
<div class="brendpanel">
<div>
<div class="brand-logo loading-logo">
<img src="">
<!-- 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, '&quot;')
.replace(/'/g, '&#39;')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;');
}
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="doc-title"></div>
<div class="circle"></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>
<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, '&quot;')
.replace(/'/g, '&#39;')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;');
}
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 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>
</div>
<div class="hyperlink-tooltip" data-toggle="tooltip" title="Press Ctrl and click the link" style="display:none;"></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>
<!--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 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 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>
<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/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>
<!--application-->
<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="js/CellEditorView.js"></script>
<script type="text/javascript" src="js/CellEditorController.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);
};
<script type="text/javascript" src="js/CellEditorView.js"></script>
<script type="text/javascript" src="js/CellEditorController.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>
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>

View file

@ -182,7 +182,6 @@ SSE.ApplicationController = new(function(){
}
function onLongActionBegin(type, id){
if (type == Asc.c_oAscAsyncActionType['BlockInteraction']) {
console.log('Action begin');
}

View file

@ -36,30 +36,10 @@ if (SSE === undefined) {
}
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>');*/
}
return {
create: createView,
txtDownload: 'Download',
txtPrint: 'Print',
txtShare: 'Share',
txtEmbed: 'Embed',
txtFullScreen: 'Full Screen',
txtFileLocation: 'Open file location'
create: createView
}
})();

View file

@ -100,16 +100,9 @@ SSE.CellEditorController = new(function(){
function setPreviewMode(mode) {
if (this.viewmode === mode) return;
this.viewmode = mode;
editor.cell.nameDisabled(mode && !(mode.isEdit && !mode.isEditDiagram && !mode.isEditMailMerge));
}
return {
create: createController,
setApi: setApi,
setPreviewMode: setPreviewMode
setApi: setApi
}
})();