2016-11-11 13:24:21 +00:00
|
|
|
/*
|
|
|
|
*
|
2018-03-01 12:16:38 +00:00
|
|
|
* (c) Copyright Ascensio System Limited 2010-2018
|
2016-11-11 13:24:21 +00:00
|
|
|
*
|
|
|
|
* 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
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Settings.js
|
|
|
|
* Document Editor
|
|
|
|
*
|
|
|
|
* Created by Alexander Yuzhin on 10/7/16
|
2018-03-01 12:16:38 +00:00
|
|
|
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
|
2016-11-11 13:24:21 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
define([
|
|
|
|
'core',
|
2016-12-05 15:25:58 +00:00
|
|
|
'jquery',
|
|
|
|
'underscore',
|
|
|
|
'backbone',
|
2016-11-11 13:24:21 +00:00
|
|
|
'documenteditor/mobile/app/view/Settings'
|
2016-12-05 15:25:58 +00:00
|
|
|
], function (core, $, _, Backbone) {
|
2016-11-11 13:24:21 +00:00
|
|
|
'use strict';
|
|
|
|
|
2016-11-17 14:39:30 +00:00
|
|
|
DE.Controllers.Settings = Backbone.Controller.extend(_.extend((function() {
|
2016-11-11 13:24:21 +00:00
|
|
|
// private
|
|
|
|
var rootView,
|
|
|
|
inProgress,
|
|
|
|
infoObj,
|
2016-12-28 14:55:11 +00:00
|
|
|
modalView,
|
|
|
|
_isPortrait = false,
|
2017-04-11 11:05:56 +00:00
|
|
|
_pageSizesIndex = 0,
|
2016-12-28 14:55:11 +00:00
|
|
|
_pageSizesCurrent = [0, 0],
|
2017-01-24 11:43:31 +00:00
|
|
|
txtCm = Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.cm),
|
2016-12-28 14:55:11 +00:00
|
|
|
_pageSizes = [
|
2017-01-24 11:43:31 +00:00
|
|
|
{ caption: 'US Letter', subtitle: Common.Utils.String.format('21,59{0} x 27,94{0}', txtCm), value: [215.9, 279.4] },
|
|
|
|
{ caption: 'US Legal', subtitle: Common.Utils.String.format('21,59{0} x 35,56{0}', txtCm), value: [215.9, 355.6] },
|
|
|
|
{ caption: 'A4', subtitle: Common.Utils.String.format('21{0} x 29,7{0}', txtCm), value: [210, 297] },
|
2018-09-13 12:57:03 +00:00
|
|
|
{ caption: 'A5', subtitle: Common.Utils.String.format('14,8{0} x 21{0}', txtCm), value: [148, 210] },
|
|
|
|
{ caption: 'B5', subtitle: Common.Utils.String.format('17,6{0} x 25{0}', txtCm), value: [176, 250] },
|
2017-01-24 11:43:31 +00:00
|
|
|
{ caption: 'Envelope #10', subtitle: Common.Utils.String.format('10,48{0} x 24,13{0}', txtCm), value: [104.8, 241.3] },
|
2018-09-13 12:57:03 +00:00
|
|
|
{ caption: 'Envelope DL', subtitle: Common.Utils.String.format('11{0} x 22{0}', txtCm), value: [110, 220] },
|
|
|
|
{ caption: 'Tabloid', subtitle: Common.Utils.String.format('27,94{0} x 43,18{0}', txtCm), value: [279.4, 431.8] },
|
|
|
|
{ caption: 'A3', subtitle: Common.Utils.String.format('29,7{0} x 42{0}', txtCm), value: [297, 420] },
|
2017-01-24 11:43:31 +00:00
|
|
|
{ caption: 'Tabloid Oversize', subtitle: Common.Utils.String.format('30,48{0} x 45,71{0}', txtCm), value: [304.8, 457.1] },
|
|
|
|
{ caption: 'ROC 16K', subtitle: Common.Utils.String.format('19,68{0} x 27,3{0}', txtCm), value: [196.8, 273] },
|
|
|
|
{ caption: 'Envelope Choukei 3', subtitle: Common.Utils.String.format('11,99{0} x 23,49{0}', txtCm), value: [119.9, 234.9] },
|
|
|
|
{ caption: 'Super B/A3', subtitle: Common.Utils.String.format('33,02{0} x 48,25{0}', txtCm), value: [330.2, 482.5] }
|
2017-06-14 10:57:02 +00:00
|
|
|
],
|
|
|
|
_licInfo;
|
2016-11-11 13:24:21 +00:00
|
|
|
|
|
|
|
return {
|
|
|
|
models: [],
|
|
|
|
collections: [],
|
|
|
|
views: [
|
|
|
|
'Settings'
|
|
|
|
],
|
|
|
|
|
|
|
|
initialize: function () {
|
|
|
|
Common.SharedSettings.set('readerMode', false);
|
|
|
|
Common.NotificationCenter.on('settingscontainer:show', _.bind(this.initEvents, this));
|
|
|
|
|
|
|
|
this.addListeners({
|
|
|
|
'Settings': {
|
|
|
|
'page:show' : this.onPageShow
|
|
|
|
}
|
|
|
|
});
|
|
|
|
},
|
|
|
|
|
|
|
|
setApi: function (api) {
|
|
|
|
var me = this;
|
|
|
|
me.api = api;
|
|
|
|
|
2016-12-28 14:55:11 +00:00
|
|
|
me.api.asc_registerCallback('asc_onGetDocInfoStart', _.bind(me.onApiGetDocInfoStart, me));
|
|
|
|
me.api.asc_registerCallback('asc_onGetDocInfoStop', _.bind(me.onApiGetDocInfoEnd, me));
|
|
|
|
me.api.asc_registerCallback('asc_onDocInfo', _.bind(me.onApiDocInfo, me));
|
|
|
|
me.api.asc_registerCallback('asc_onGetDocInfoEnd', _.bind(me.onApiGetDocInfoEnd, me));
|
|
|
|
me.api.asc_registerCallback('asc_onDocumentName', _.bind(me.onApiDocumentName, me));
|
|
|
|
me.api.asc_registerCallback('asc_onDocSize', _.bind(me.onApiPageSize, me));
|
|
|
|
me.api.asc_registerCallback('asc_onPageOrient', _.bind(me.onApiPageOrient, me));
|
2016-11-11 13:24:21 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
onLaunch: function () {
|
|
|
|
this.createView('Settings').render();
|
|
|
|
},
|
|
|
|
|
|
|
|
setMode: function (mode) {
|
|
|
|
this.getView('Settings').setMode(mode);
|
2017-06-14 10:57:02 +00:00
|
|
|
if (mode.canBranding)
|
|
|
|
_licInfo = mode.customization;
|
2016-11-11 13:24:21 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
initEvents: function () {
|
|
|
|
},
|
|
|
|
|
|
|
|
rootView : function() {
|
|
|
|
return rootView;
|
|
|
|
},
|
|
|
|
|
|
|
|
showModal: function() {
|
2016-12-23 10:57:23 +00:00
|
|
|
uiApp.closeModal();
|
|
|
|
|
2016-11-11 13:24:21 +00:00
|
|
|
if (Common.SharedSettings.get('phone')) {
|
|
|
|
modalView = uiApp.popup(
|
2016-11-16 08:01:10 +00:00
|
|
|
'<div class="popup settings container-settings">' +
|
2016-11-11 13:24:21 +00:00
|
|
|
'<div class="content-block">' +
|
|
|
|
'<div class="view settings-root-view navbar-through">' +
|
|
|
|
this.getView('Settings').rootLayout() +
|
|
|
|
'</div>' +
|
|
|
|
'</div>' +
|
|
|
|
'</div>'
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
modalView = uiApp.popover(
|
2016-11-16 08:01:10 +00:00
|
|
|
'<div class="popover settings container-settings">' +
|
2016-11-11 13:24:21 +00:00
|
|
|
'<div class="popover-angle"></div>' +
|
|
|
|
'<div class="popover-inner">' +
|
|
|
|
'<div class="content-block">' +
|
|
|
|
'<div class="view popover-view settings-root-view navbar-through">' +
|
|
|
|
this.getView('Settings').rootLayout() +
|
|
|
|
'</div>' +
|
|
|
|
'</div>' +
|
|
|
|
'</div>' +
|
|
|
|
'</div>',
|
|
|
|
$$('#toolbar-settings')
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (Framework7.prototype.device.android === true) {
|
|
|
|
$$('.view.settings-root-view.navbar-through').removeClass('navbar-through').addClass('navbar-fixed');
|
|
|
|
$$('.view.settings-root-view .navbar').prependTo('.view.settings-root-view > .pages > .page');
|
|
|
|
}
|
|
|
|
|
|
|
|
rootView = uiApp.addView('.settings-root-view', {
|
2016-12-28 14:55:11 +00:00
|
|
|
dynamicNavbar: true,
|
|
|
|
domCache: true
|
2016-11-11 13:24:21 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
Common.NotificationCenter.trigger('settingscontainer:show');
|
|
|
|
this.onPageShow(this.getView('Settings'));
|
|
|
|
},
|
|
|
|
|
|
|
|
hideModal: function() {
|
|
|
|
if (modalView) {
|
|
|
|
uiApp.closeModal(modalView);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2016-12-28 14:55:11 +00:00
|
|
|
onPageShow: function(view, pageId) {
|
2016-11-11 13:24:21 +00:00
|
|
|
var me = this;
|
|
|
|
|
2016-12-28 14:55:11 +00:00
|
|
|
if ('#settings-document-view' == pageId) {
|
|
|
|
me.initPageDocumentSettings();
|
|
|
|
} else if ('#settings-document-formats-view' == pageId) {
|
|
|
|
me.getView('Settings').renderPageSizes(_pageSizes, _pageSizesIndex);
|
|
|
|
$('.page[data-page=settings-document-formats-view] input:radio[name=document-format]').single('change', _.bind(me.onFormatChange, me));
|
|
|
|
} else if ('#settings-download-view' == pageId) {
|
|
|
|
$(modalView).find('.formats a').single('click', _.bind(me.onSaveFormat, me));
|
|
|
|
} else if ('#settings-info-view' == pageId) {
|
|
|
|
me.initPageInfo();
|
|
|
|
} else if ('#settings-about-view' == pageId) {
|
|
|
|
// About
|
2017-06-14 10:57:02 +00:00
|
|
|
me.setLicInfo(_licInfo);
|
2016-12-28 14:55:11 +00:00
|
|
|
} else {
|
2017-01-24 12:35:15 +00:00
|
|
|
$('#settings-readermode input:checkbox').attr('checked', Common.SharedSettings.get('readerMode'));
|
2016-12-28 14:55:11 +00:00
|
|
|
$('#settings-search').single('click', _.bind(me.onSearch, me));
|
|
|
|
$('#settings-readermode input:checkbox').single('change', _.bind(me.onReaderMode, me));
|
|
|
|
$('#settings-help').single('click', _.bind(me.onShowHelp, me));
|
2017-06-01 10:28:13 +00:00
|
|
|
$('#settings-download').single('click', _.bind(me.onDownloadOrigin, me));
|
2016-12-28 14:55:11 +00:00
|
|
|
}
|
|
|
|
},
|
2016-11-11 13:24:21 +00:00
|
|
|
|
2016-12-28 14:55:11 +00:00
|
|
|
initPageDocumentSettings: function () {
|
|
|
|
var me = this,
|
|
|
|
$pageOrientation = $('.page[data-page=settings-document-view] input:radio[name=doc-orientation]'),
|
|
|
|
$pageSize = $('#settings-document-format');
|
2016-11-11 13:24:21 +00:00
|
|
|
|
2016-12-28 14:55:11 +00:00
|
|
|
// Init orientation
|
|
|
|
$pageOrientation.val([_isPortrait]);
|
|
|
|
$pageOrientation.single('change', _.bind(me.onOrientationChange, me));
|
2016-11-11 13:24:21 +00:00
|
|
|
|
2016-12-28 14:55:11 +00:00
|
|
|
// Init format
|
|
|
|
$pageSize.find('.item-title').text(_pageSizes[_pageSizesIndex]['caption']);
|
|
|
|
$pageSize.find('.item-subtitle').text(_pageSizes[_pageSizesIndex]['subtitle']);
|
2016-11-11 13:24:21 +00:00
|
|
|
},
|
|
|
|
|
2016-12-28 14:55:11 +00:00
|
|
|
initPageInfo: function () {
|
|
|
|
var me = this;
|
2016-11-11 13:24:21 +00:00
|
|
|
|
2016-12-28 14:55:11 +00:00
|
|
|
if (me.api) {
|
|
|
|
me.api.startGetDocInfo();
|
2016-11-11 13:24:21 +00:00
|
|
|
|
2016-12-28 14:55:11 +00:00
|
|
|
var document = Common.SharedSettings.get('document') || {},
|
|
|
|
info = document.info || {};
|
|
|
|
|
|
|
|
$('#settings-document-title').html(document.title ? document.title : me.unknownText);
|
|
|
|
$('#settings-document-autor').html(info.author ? info.author : me.unknownText);
|
|
|
|
$('#settings-document-date').html(info.created ? info.created : me.unknownText);
|
2016-11-11 13:24:21 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2017-06-14 10:57:02 +00:00
|
|
|
setLicInfo: function(data){
|
|
|
|
if (data && typeof data == 'object' && typeof(data.customer)=='object') {
|
|
|
|
$('.page[data-page=settings-about-view] .logo').hide();
|
|
|
|
$('#settings-about-tel').parent().hide();
|
|
|
|
$('#settings-about-licensor').show();
|
|
|
|
|
|
|
|
var customer = data.customer,
|
|
|
|
value = customer.name;
|
|
|
|
value && value.length ?
|
|
|
|
$('#settings-about-name').text(value) :
|
|
|
|
$('#settings-about-name').hide();
|
|
|
|
|
|
|
|
value = customer.address;
|
|
|
|
value && value.length ?
|
|
|
|
$('#settings-about-address').text(value) :
|
|
|
|
$('#settings-about-address').parent().hide();
|
|
|
|
|
|
|
|
(value = customer.mail) && value.length ?
|
|
|
|
$('#settings-about-email').attr('href', "mailto:"+value).text(value) :
|
|
|
|
$('#settings-about-email').parent().hide();
|
|
|
|
|
|
|
|
if ((value = customer.www) && value.length) {
|
|
|
|
var http = !/^https?:\/{2}/i.test(value) ? "http:\/\/" : '';
|
|
|
|
$('#settings-about-url').attr('href', http+value).text(value);
|
|
|
|
} else
|
|
|
|
$('#settings-about-url').hide();
|
|
|
|
|
|
|
|
if ((value = customer.info) && value.length) {
|
|
|
|
$('#settings-about-info').show().text(value);
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( (value = customer.logo) && value.length ) {
|
|
|
|
$('#settings-about-logo').show().html('<img src="'+value+'" style="max-width:216px; max-height: 35px;" />');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2016-12-28 14:55:11 +00:00
|
|
|
// Handlers
|
2016-11-11 13:24:21 +00:00
|
|
|
|
2016-12-28 14:55:11 +00:00
|
|
|
onSearch: function (e) {
|
2016-11-11 13:24:21 +00:00
|
|
|
var toolbarView = DE.getController('Toolbar').getView('Toolbar');
|
|
|
|
|
|
|
|
if (toolbarView) {
|
|
|
|
toolbarView.showSearch();
|
|
|
|
}
|
|
|
|
|
|
|
|
this.hideModal();
|
|
|
|
},
|
|
|
|
|
2016-12-28 14:55:11 +00:00
|
|
|
onReaderMode: function (e) {
|
2016-11-11 13:24:21 +00:00
|
|
|
var me = this;
|
|
|
|
|
|
|
|
Common.SharedSettings.set('readerMode', !Common.SharedSettings.get('readerMode'));
|
|
|
|
|
|
|
|
me.api && me.api.ChangeReaderMode();
|
|
|
|
|
|
|
|
if (Common.SharedSettings.get('phone')) {
|
|
|
|
_.defer(function () {
|
|
|
|
me.hideModal();
|
|
|
|
}, 1000);
|
|
|
|
}
|
|
|
|
|
|
|
|
Common.NotificationCenter.trigger('readermode:change', Common.SharedSettings.get('readerMode'));
|
|
|
|
},
|
|
|
|
|
2016-12-28 14:55:11 +00:00
|
|
|
onShowHelp: function () {
|
|
|
|
window.open('http://support.onlyoffice.com/', "_blank");
|
|
|
|
this.hideModal();
|
|
|
|
},
|
|
|
|
|
|
|
|
onSaveFormat: function(e) {
|
2016-11-11 13:24:21 +00:00
|
|
|
var me = this,
|
|
|
|
format = $(e.currentTarget).data('format');
|
|
|
|
|
|
|
|
if (format) {
|
|
|
|
if (format == Asc.c_oAscFileType.TXT) {
|
2016-11-17 10:39:19 +00:00
|
|
|
_.defer(function () {
|
2016-11-16 14:59:05 +00:00
|
|
|
uiApp.confirm(
|
|
|
|
me.warnDownloadAs,
|
|
|
|
me.notcriticalErrorTitle,
|
|
|
|
function () {
|
|
|
|
me.api.asc_DownloadAs(format);
|
|
|
|
}
|
|
|
|
);
|
2016-11-17 10:39:19 +00:00
|
|
|
});
|
2016-11-11 13:24:21 +00:00
|
|
|
} else {
|
2016-11-17 10:39:19 +00:00
|
|
|
_.defer(function () {
|
|
|
|
me.api.asc_DownloadAs(format);
|
|
|
|
});
|
2016-11-11 13:24:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
me.hideModal();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2017-06-01 10:28:13 +00:00
|
|
|
onDownloadOrigin: function(e) {
|
|
|
|
var me = this;
|
|
|
|
|
|
|
|
_.defer(function () {
|
|
|
|
me.api.asc_DownloadOrigin();
|
|
|
|
});
|
|
|
|
me.hideModal();
|
|
|
|
},
|
|
|
|
|
2016-12-28 14:55:11 +00:00
|
|
|
onFormatChange: function (e) {
|
|
|
|
var me = this,
|
|
|
|
rawValue = $(e.currentTarget).val(),
|
|
|
|
value = rawValue.split(',');
|
|
|
|
|
|
|
|
_.delay(function () {
|
|
|
|
me.api.change_DocSize(parseFloat(value[0]), parseFloat(value[1]));
|
|
|
|
}, 300);
|
|
|
|
},
|
|
|
|
|
|
|
|
onOrientationChange: function (e) {
|
|
|
|
var me = this,
|
|
|
|
value = $(e.currentTarget).val();
|
|
|
|
|
|
|
|
_.delay(function () {
|
|
|
|
me.api.change_PageOrient(value === 'true');
|
|
|
|
}, 300);
|
|
|
|
},
|
|
|
|
|
|
|
|
// API handlers
|
|
|
|
|
|
|
|
onApiGetDocInfoStart: function () {
|
|
|
|
var me = this;
|
|
|
|
inProgress = true;
|
|
|
|
infoObj = {
|
|
|
|
PageCount : 0,
|
|
|
|
WordsCount : 0,
|
|
|
|
ParagraphCount : 0,
|
|
|
|
SymbolsCount : 0,
|
|
|
|
SymbolsWSCount : 0
|
|
|
|
};
|
|
|
|
|
|
|
|
_.defer(function(){
|
|
|
|
if (!inProgress)
|
|
|
|
return;
|
|
|
|
|
|
|
|
$('#statistic-pages').html(me.txtLoading);
|
|
|
|
$('#statistic-words').html(me.txtLoading);
|
|
|
|
$('#statistic-paragraphs').html(me.txtLoading);
|
|
|
|
$('#statistic-symbols').html(me.txtLoading);
|
|
|
|
$('#statistic-spaces').html(me.txtLoading);
|
|
|
|
});
|
|
|
|
},
|
|
|
|
|
|
|
|
onApiGetDocInfoEnd: function() {
|
|
|
|
inProgress = false;
|
|
|
|
|
|
|
|
$('#statistic-pages').html(infoObj.PageCount);
|
|
|
|
$('#statistic-words').html(infoObj.WordsCount);
|
|
|
|
$('#statistic-paragraphs').html(infoObj.ParagraphCount);
|
|
|
|
$('#statistic-symbols').html(infoObj.SymbolsCount);
|
|
|
|
$('#statistic-spaces').html(infoObj.SymbolsWSCount);
|
|
|
|
},
|
|
|
|
|
|
|
|
onApiDocInfo: function(obj) {
|
|
|
|
if (obj) {
|
|
|
|
if (obj.get_PageCount() > -1)
|
|
|
|
infoObj.PageCount = obj.get_PageCount();
|
|
|
|
if (obj.get_WordsCount() > -1)
|
|
|
|
infoObj.WordsCount = obj.get_WordsCount();
|
|
|
|
if (obj.get_ParagraphCount() > -1)
|
|
|
|
infoObj.ParagraphCount = obj.get_ParagraphCount();
|
|
|
|
if (obj.get_SymbolsCount() > -1)
|
|
|
|
infoObj.SymbolsCount = obj.get_SymbolsCount();
|
|
|
|
if (obj.get_SymbolsWSCount() > -1)
|
|
|
|
infoObj.SymbolsWSCount = obj.get_SymbolsWSCount();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
onApiDocumentName: function(name) {
|
|
|
|
$('#settings-document-title').html(name ? name : '-');
|
|
|
|
},
|
|
|
|
|
|
|
|
onApiPageSize: function(w, h) {
|
2017-04-11 11:05:56 +00:00
|
|
|
if (!_isPortrait) {
|
|
|
|
var tempW = w; w = h; h = tempW;
|
|
|
|
}
|
|
|
|
|
2018-09-13 13:47:38 +00:00
|
|
|
if (Math.abs(_pageSizesCurrent[0] - w) > 0.1 ||
|
|
|
|
Math.abs(_pageSizesCurrent[1] - h) > 0.1) {
|
2016-12-28 14:55:11 +00:00
|
|
|
_pageSizesCurrent = [w, h];
|
|
|
|
|
|
|
|
_.find(_pageSizes, function(size, index) {
|
2018-09-13 13:47:38 +00:00
|
|
|
if (Math.abs(size.value[0] - w) < 0.1 && Math.abs(size.value[1] - h) < 0.1) {
|
2016-12-28 14:55:11 +00:00
|
|
|
_pageSizesIndex = index;
|
|
|
|
}
|
|
|
|
}, this);
|
|
|
|
}
|
|
|
|
|
|
|
|
this.initPageDocumentSettings();
|
|
|
|
},
|
|
|
|
|
|
|
|
onApiPageOrient: function(isPortrait) {
|
|
|
|
_isPortrait = isPortrait;
|
|
|
|
},
|
|
|
|
|
|
|
|
unknownText: 'Unknown',
|
2016-11-11 13:24:21 +00:00
|
|
|
txtLoading : 'Loading...',
|
|
|
|
notcriticalErrorTitle : 'Warning',
|
|
|
|
warnDownloadAs : 'If you continue saving in this format all features except the text will be lost.<br>Are you sure you want to continue?'
|
|
|
|
}
|
2016-11-17 14:39:30 +00:00
|
|
|
})(), DE.Controllers.Settings || {}))
|
|
|
|
});
|