mirror of
https://github.com/ONLYOFFICE/web-apps.git
synced 2026-04-07 14:06:16 +08:00
Refactoring
This commit is contained in:
@ -152,14 +152,14 @@
|
||||
</script>
|
||||
|
||||
<!--application-->
|
||||
<script type="text/javascript" src="../../unit-tests/common/locale.js"></script>
|
||||
<script type="text/javascript" src="../../unit-tests/common/Gateway.js"></script>
|
||||
<script type="text/javascript" src="../../unit-tests/common/main/lib/util/LocalStorage.js"></script>
|
||||
<script type="text/javascript" src="../../unit-tests/common/main/lib/util/utils.js"></script>
|
||||
<script type="text/javascript" src="../../unit-tests/common/main/lib/view/LoadMask.js"></script>
|
||||
<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="../../unit-tests/common/main/lib/view/CellEditor.js"></script>
|
||||
<script type="text/javascript" src="../../unit-tests/common/main/lib/controller/CellEditor.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>
|
||||
|
||||
@ -35,14 +35,9 @@ SSE.ApplicationController = new(function(){
|
||||
api,
|
||||
config = {},
|
||||
docConfig = {},
|
||||
embedConfig = {},
|
||||
permissions = {},
|
||||
maxPages = 0,
|
||||
created = false,
|
||||
iframePrint = null;
|
||||
var $ttEl,
|
||||
$tooltip,
|
||||
ttOffset = [6, -15];
|
||||
created = false;
|
||||
|
||||
var LoadingDocument = -256;
|
||||
|
||||
@ -56,7 +51,7 @@ SSE.ApplicationController = new(function(){
|
||||
// -------------------------
|
||||
|
||||
if (typeof isBrowserSupported !== 'undefined' && !isBrowserSupported()){
|
||||
Common.Gateway.reportError(undefined, this.unsupportedBrowserErrorText);
|
||||
//Common.Gateway.reportError(undefined, this.unsupportedBrowserErrorText);
|
||||
console.error( this.unsupportedBrowserErrorText);
|
||||
return;
|
||||
}
|
||||
@ -70,21 +65,6 @@ SSE.ApplicationController = new(function(){
|
||||
|
||||
function loadConfig(data) {
|
||||
config = $.extend(config, data.config);
|
||||
embedConfig = $.extend(embedConfig, data.config.embedded);
|
||||
|
||||
//common.controller.modals.init(embedConfig);
|
||||
|
||||
// Docked toolbar
|
||||
/*if (embedConfig.toolbarDocked === 'bottom') {
|
||||
$('#toolbar').addClass('bottom');
|
||||
$('.viewer').addClass('bottom');
|
||||
$('#box-tools').removeClass('dropdown').addClass('dropup');
|
||||
ttOffset[1] = -40;
|
||||
} else {
|
||||
$('#toolbar').addClass('top');
|
||||
$('.viewer').addClass('top');
|
||||
}*/
|
||||
|
||||
config.canBackToFolder = (config.canBackToFolder!==false) && config.customization && config.customization.goback &&
|
||||
(config.customization.goback.url || config.customization.goback.requestClose && config.canRequestClose);
|
||||
}
|
||||
@ -138,10 +118,6 @@ SSE.ApplicationController = new(function(){
|
||||
api.asc_getEditorPermissions(config.licenseUrl, config.customerId);
|
||||
api.asc_enableKeyEvents(false);
|
||||
}
|
||||
|
||||
embedConfig.docTitle = docConfig.title;
|
||||
/* labelDocName = $('#title-doc-name');
|
||||
labelDocName.text(embedConfig.docTitle || '')*/
|
||||
}
|
||||
}
|
||||
|
||||
@ -181,19 +157,6 @@ SSE.ApplicationController = new(function(){
|
||||
setActiveWorkSheet(api.asc_getActiveWorksheetIndex());
|
||||
}
|
||||
|
||||
function onDownloadUrl(url, fileType) {
|
||||
Common.Gateway.downloadAs(url, fileType);
|
||||
}
|
||||
|
||||
function onPrint() {
|
||||
if ( permissions.print!==false )
|
||||
api.asc_Print(new Asc.asc_CDownloadOptions(null, true));
|
||||
}
|
||||
|
||||
function onPrintUrl(url) {
|
||||
common.utils.dialogPrint(url, api);
|
||||
}
|
||||
|
||||
function hidePreloader() {
|
||||
$('#loading-mask').fadeOut('slow');
|
||||
}
|
||||
@ -201,11 +164,7 @@ SSE.ApplicationController = new(function(){
|
||||
function onDocumentContentReady() {
|
||||
hidePreloader();
|
||||
onLongActionEnd(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument);
|
||||
api.asc_registerCallback('asc_onMouseMove', onApiMouseMove);
|
||||
api.asc_registerCallback('asc_onHyperlinkClick', common.utils.openLink);
|
||||
api.asc_registerCallback('asc_onDownloadUrl', onDownloadUrl);
|
||||
//api.asc_registerCallback('asc_onPrint', onPrint);
|
||||
api.asc_registerCallback('asc_onPrintUrl', onPrintUrl);
|
||||
api.asc_registerCallback('asc_onStartAction', onLongActionBegin);
|
||||
|
||||
Common.Gateway.on('processmouse', onProcessMouse);
|
||||
@ -213,33 +172,6 @@ SSE.ApplicationController = new(function(){
|
||||
Common.Gateway.on('requestclose', onRequestClose);
|
||||
|
||||
|
||||
|
||||
var ismodalshown = false;
|
||||
$(document.body).on('show.bs.modal', '.modal',
|
||||
function(e) {
|
||||
ismodalshown = true;
|
||||
api.asc_enableKeyEvents(false);
|
||||
}
|
||||
).on('hidden.bs.modal', '.modal',
|
||||
function(e) {
|
||||
ismodalshown = false;
|
||||
api.asc_enableKeyEvents(true);
|
||||
}
|
||||
).on('hidden.bs.dropdown', '.dropdown',
|
||||
function(e) {
|
||||
if ( !ismodalshown )
|
||||
api.asc_enableKeyEvents(true);
|
||||
}
|
||||
).on('blur', 'input, textarea',
|
||||
function(e) {
|
||||
if ( !ismodalshown ) {
|
||||
if (!/area_id/.test(e.target.id) ) {
|
||||
api.asc_enableKeyEvents(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
$('#editor_sdk').on('click', function(e) {
|
||||
if ( e.target.localName == 'canvas' ) {
|
||||
e.currentTarget.focus();
|
||||
@ -274,9 +206,6 @@ SSE.ApplicationController = new(function(){
|
||||
var text = '';
|
||||
switch (id)
|
||||
{
|
||||
case Asc.c_oAscAsyncAction['Print']:
|
||||
text = me.downloadTextText;
|
||||
break;
|
||||
case LoadingDocument:
|
||||
text = me.textLoadingDocument + ' ';
|
||||
break;
|
||||
@ -444,49 +373,6 @@ SSE.ApplicationController = new(function(){
|
||||
api.asc_DownloadAs(new Asc.asc_CDownloadOptions(Asc.c_oAscFileType.XLSX, true));
|
||||
}
|
||||
|
||||
function onApiMouseMove(array) {
|
||||
if ( array.length ) {
|
||||
var ttdata;
|
||||
for (var i = array.length; i > 0; i--) {
|
||||
if (array[i-1].asc_getType() == Asc.c_oAscMouseMoveType.Hyperlink) {
|
||||
ttdata = array[i - 1];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ttdata ) {
|
||||
if (!$ttEl) {
|
||||
$ttEl = $('.hyperlink-tooltip');
|
||||
$ttEl.tooltip({'container': 'body', 'trigger': 'manual'});
|
||||
$ttEl.on('shown.bs.tooltip', function(e) {
|
||||
$tooltip = $ttEl.data('bs.tooltip').tip();
|
||||
|
||||
$tooltip.css({
|
||||
left: $ttEl.ttpos[0] + ttOffset[0],
|
||||
top: $ttEl.ttpos[1] + ttOffset[1]
|
||||
});
|
||||
|
||||
$tooltip.find('.tooltip-arrow').css({left: 10});
|
||||
});
|
||||
}
|
||||
|
||||
if (!$tooltip) {
|
||||
$ttEl.ttpos = [ttdata.asc_getX(), ttdata.asc_getY()];
|
||||
$ttEl.tooltip('show');
|
||||
} else {
|
||||
$tooltip.css({
|
||||
left: ttdata.asc_getX() + ttOffset[0],
|
||||
top: ttdata.asc_getY() + ttOffset[1]
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if ( $tooltip ) {
|
||||
$tooltip.tooltip('hide');
|
||||
$tooltip = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function onRunAutostartMacroses() {
|
||||
if (!config.customization || (config.customization.macros!==false))
|
||||
|
||||
@ -1,25 +0,0 @@
|
||||
{
|
||||
"SSE.ApplicationController.errorDefaultMessage": "Error code: %1",
|
||||
"SSE.ApplicationController.unknownErrorText": "Unknown error.",
|
||||
"SSE.ApplicationController.convertationTimeoutText": "Conversion timeout exceeded.",
|
||||
"SSE.ApplicationController.convertationErrorText": "Conversion failed.",
|
||||
"SSE.ApplicationController.downloadErrorText": "Download failed.",
|
||||
"SSE.ApplicationController.criticalErrorTitle": "Error",
|
||||
"SSE.ApplicationController.notcriticalErrorTitle": "Warning",
|
||||
"SSE.ApplicationController.scriptLoadError": "The connection is too slow, some of the components could not be loaded. Please reload the page.",
|
||||
"SSE.ApplicationController.errorFilePassProtect": "The file is password protected and cannot be opened.",
|
||||
"SSE.ApplicationController.errorAccessDeny": "You are trying to perform an action you do not have rights for.<br>Please contact your Document Server administrator.",
|
||||
"SSE.ApplicationController.errorUserDrop": "The file cannot be accessed right now.",
|
||||
"SSE.ApplicationController.unsupportedBrowserErrorText": "Your browser is not supported.",
|
||||
"SSE.ApplicationController.textOf": "of",
|
||||
"SSE.ApplicationController.downloadTextText": "Downloading spreadsheet...",
|
||||
"SSE.ApplicationController.waitText": "Please, wait...",
|
||||
"SSE.ApplicationController.textLoadingDocument": "Loading spreadsheet",
|
||||
"SSE.ApplicationController.txtClose": "Close",
|
||||
"SSE.ApplicationController.errorFileSizeExceed": "The file size exceeds the limitation set for your server.<br>Please contact your Document Server administrator for details.",
|
||||
"SSE.ApplicationController.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.",
|
||||
"SSE.ApplicationController.textGuest": "Guest",
|
||||
"SSE.ApplicationController.textAnonymous": "Anonymous",
|
||||
"SSE.ApplicationController.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.",
|
||||
"SSE.ApplicationController.errorLoadingFont": "Fonts are not loaded.<br>Please contact your Document Server administrator."
|
||||
}
|
||||
@ -1,5 +1,5 @@
|
||||
// Common styles
|
||||
@import "../../../../unit-tests/common/main/resources/less/common.less";
|
||||
@import "../../../../common/main/resources/less/common.less";
|
||||
|
||||
// Worksheets
|
||||
// -------------------------
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
// Common styles
|
||||
@import "../../../../unit-tests/common/main/resources/less/colors-table-ie-fix.less";
|
||||
@import "../../../../unit-tests/common/main/resources/less/variables.less";
|
||||
@import "../../../../unit-tests/common/main/resources/less/colors-table.less";
|
||||
@import "../../../../unit-tests/common/main/resources/less/asc-mixins.less";
|
||||
@import "../../../../unit-tests/common/main/resources/less/buttons.less";
|
||||
@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;
|
||||
|
||||
Reference in New Issue
Block a user