[Mobile] Customize about page.
This commit is contained in:
parent
5dc3cb1187
commit
33f79ba24c
|
@ -616,6 +616,7 @@ define([
|
|||
me._state.licenseWarning = (licType===Asc.c_oLicenseResult.Connections) && me.appOptions.canEdit && me.editorConfig.mode !== 'view';
|
||||
|
||||
me.appOptions.canBranding = (licType === Asc.c_oLicenseResult.Success) && (typeof me.editorConfig.customization == 'object');
|
||||
me.appOptions.canBrandingExt = params.asc_getCanBranding() && (typeof me.editorConfig.customization == 'object');
|
||||
|
||||
me.applyModeCommonElements();
|
||||
me.applyModeEditorElements();
|
||||
|
|
|
@ -74,7 +74,8 @@ define([
|
|||
{ 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] }
|
||||
];
|
||||
],
|
||||
_licInfo;
|
||||
|
||||
return {
|
||||
models: [],
|
||||
|
@ -113,6 +114,8 @@ define([
|
|||
|
||||
setMode: function (mode) {
|
||||
this.getView('Settings').setMode(mode);
|
||||
if (mode.canBranding)
|
||||
_licInfo = mode.customization;
|
||||
},
|
||||
|
||||
initEvents: function () {
|
||||
|
@ -185,6 +188,7 @@ define([
|
|||
me.initPageInfo();
|
||||
} else if ('#settings-about-view' == pageId) {
|
||||
// About
|
||||
me.setLicInfo(_licInfo);
|
||||
} else {
|
||||
$('#settings-readermode input:checkbox').attr('checked', Common.SharedSettings.get('readerMode'));
|
||||
$('#settings-search').single('click', _.bind(me.onSearch, me));
|
||||
|
@ -224,6 +228,43 @@ define([
|
|||
}
|
||||
},
|
||||
|
||||
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;" />');
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// Handlers
|
||||
|
||||
onEditDocumet: function() {
|
||||
|
|
|
@ -430,16 +430,24 @@
|
|||
<div class="page-content">
|
||||
<div class="content-block">
|
||||
<div class="logo" style="display: inline-block; width: 100%; height: 55px;"></div>
|
||||
<div id="settings-about-logo" style="margin-top: 20px;display: none;"></div>
|
||||
</div>
|
||||
<div class="content-block">
|
||||
<h3>DOCUMENT EDITOR</h3>
|
||||
<h3><%= scope.textVersion %> {{PRODUCT_VERSION}}</h3>
|
||||
</div>
|
||||
<div class="content-block">
|
||||
<h3 id="settings-about-name" class="vendor">Ascensio System SIA</h3>
|
||||
<p><label><%= scope.textAddress %>:</label><a id="settings-about-address" class="external" href="#">Lubanas st. 125a-25, Riga, Latvia, EU, LV-1021</a></p>
|
||||
<p><label><%= scope.textEmail %>:</label><a id="settings-about-email" class="external" target="_blank" href="mailto:support@onlyoffice.com">support@onlyoffice.com</a></p>
|
||||
<p><label><%= scope.textTel %>:</label><a id="settings-about-tel" class="external" target="_blank" href="tel:+371 660-16425">+371 660-16425</a></p>
|
||||
<p><a id="settings-about-url" class="external" target="_blank" href="http://www.onlyoffice.com">www.onlyoffice.com</a></p>
|
||||
<p><label id="settings-about-info" style="display: none;"></label></p>
|
||||
</div>
|
||||
<div class="content-block" id="settings-about-licensor" style="display: none;">
|
||||
<div class="content-block-inner" style="padding-top:0; padding-bottom: 1px;"/>
|
||||
<p><label><%= scope.textPoweredBy %></label></p>
|
||||
<h3 class="vendor">Ascensio System SIA</h3>
|
||||
<p><label><%= scope.textAddress %>:</label><a class="external" href="#">Lubanas st. 125a-25, Riga, Latvia, EU, LV-1021</a></p>
|
||||
<p><label><%= scope.textEmail %>:</label><a class="external" target="_blank" href="mailto:support@onlyoffice.com">support@onlyoffice.com</a></p>
|
||||
<p><label><%= scope.textTel %>:</label><a class="external" target="_blank" href="tel:+371 660-16425">+371 660-16425</a></p>
|
||||
<p><a class="external" target="_blank" href="http://www.onlyoffice.com">www.onlyoffice.com</a></p>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -54,7 +54,8 @@ define([
|
|||
_canEdit = false,
|
||||
_canDownload = false,
|
||||
_canDownloadOrigin = false,
|
||||
_canReader = false;
|
||||
_canReader = false,
|
||||
_canAbout = true;
|
||||
|
||||
return {
|
||||
// el: '.view-main',
|
||||
|
@ -95,6 +96,10 @@ define([
|
|||
_canDownload = mode.canDownload;
|
||||
_canDownloadOrigin = mode.canDownloadOrigin;
|
||||
_canReader = !mode.isEdit && mode.canReader;
|
||||
|
||||
if (mode.customization && mode.canBrandingExt) {
|
||||
_canAbout = (mode.customization.about!==false);
|
||||
}
|
||||
},
|
||||
|
||||
rootLayout: function () {
|
||||
|
@ -117,6 +122,7 @@ define([
|
|||
}
|
||||
if (!_canDownload) $layour.find('#settings-download-as').hide();
|
||||
if (!_canDownloadOrigin) $layour.find('#settings-download').hide();
|
||||
if (!_canAbout) $layour.find('#settings-about').hide();
|
||||
|
||||
return $layour.html();
|
||||
}
|
||||
|
@ -245,7 +251,8 @@ define([
|
|||
textCustom: 'Custom',
|
||||
textCustomSize: 'Custom Size',
|
||||
textDocumentFormats: 'Document Formats',
|
||||
textOrientation: 'Orientation'
|
||||
textOrientation: 'Orientation',
|
||||
textPoweredBy: 'Powered by'
|
||||
|
||||
}
|
||||
})(), DE.Views.Settings || {}))
|
||||
|
|
|
@ -348,6 +348,7 @@
|
|||
"DE.Views.Settings.textPages": "Pages",
|
||||
"DE.Views.Settings.textParagraphs": "Paragraphs",
|
||||
"DE.Views.Settings.textPortrait": "Portrait",
|
||||
"DE.Views.Settings.textPoweredBy": "Powered by",
|
||||
"DE.Views.Settings.textReader": "Reader Mode",
|
||||
"DE.Views.Settings.textSettings": "Settings",
|
||||
"DE.Views.Settings.textSpaces": "Spaces",
|
||||
|
|
|
@ -574,6 +574,7 @@ define([
|
|||
me._state.licenseWarning = (licType===Asc.c_oLicenseResult.Connections) && me.appOptions.canEdit && me.editorConfig.mode !== 'view';
|
||||
|
||||
me.appOptions.canBranding = (licType === Asc.c_oLicenseResult.Success) && (typeof me.editorConfig.customization == 'object');
|
||||
me.appOptions.canBrandingExt = params.asc_getCanBranding() && (typeof me.editorConfig.customization == 'object');
|
||||
|
||||
me.applyModeCommonElements();
|
||||
me.applyModeEditorElements();
|
||||
|
|
|
@ -55,7 +55,8 @@ define([
|
|||
var rootView,
|
||||
inProgress,
|
||||
infoObj,
|
||||
modalView;
|
||||
modalView,
|
||||
_licInfo;
|
||||
|
||||
var _slideSizeArr = [
|
||||
[254, 190.5], [254, 143]
|
||||
|
@ -91,6 +92,8 @@ define([
|
|||
|
||||
setMode: function (mode) {
|
||||
this.getView('Settings').setMode(mode);
|
||||
if (mode.canBranding)
|
||||
_licInfo = mode.customization;
|
||||
},
|
||||
|
||||
initEvents: function () {
|
||||
|
@ -163,6 +166,46 @@ define([
|
|||
var me = this;
|
||||
if (pageId == '#settings-setup-view') {
|
||||
me.onApiPageSize(me.api.get_PresentationWidth(), me.api.get_PresentationHeight());
|
||||
} else if (pageId == '#settings-about-view') {
|
||||
// About
|
||||
me.setLicInfo(_licInfo);
|
||||
}
|
||||
},
|
||||
|
||||
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;" />');
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -232,16 +232,24 @@
|
|||
<div class="page-content">
|
||||
<div class="content-block">
|
||||
<div class="logo" style="display: inline-block; width: 100%; height: 55px;"></div>
|
||||
<div id="settings-about-logo" style="margin-top: 20px;display: none;"></div>
|
||||
</div>
|
||||
<div class="content-block">
|
||||
<h3>PRESENTATION EDITOR</h3>
|
||||
<h3><%= scope.textVersion %> {{PRODUCT_VERSION}}</h3>
|
||||
</div>
|
||||
<div class="content-block">
|
||||
<h3 id="settings-about-name" class="vendor">Ascensio System SIA</h3>
|
||||
<p><label><%= scope.textAddress %>:</label><a id="settings-about-address" class="external" href="#">Lubanas st. 125a-25, Riga, Latvia, EU, LV-1021</a></p>
|
||||
<p><label><%= scope.textEmail %>:</label><a id="settings-about-email" class="external" target="_blank" href="mailto:support@onlyoffice.com">support@onlyoffice.com</a></p>
|
||||
<p><label><%= scope.textTel %>:</label><a id="settings-about-tel" class="external" target="_blank" href="tel:+371 660-16425">+371 660-16425</a></p>
|
||||
<p><a id="settings-about-url" class="external" target="_blank" href="http://www.onlyoffice.com">www.onlyoffice.com</a></p>
|
||||
<p><label id="settings-about-info" style="display: none;"></label></p>
|
||||
</div>
|
||||
<div class="content-block" id="settings-about-licensor" style="display: none;">
|
||||
<div class="content-block-inner" style="padding-top:0; padding-bottom: 1px;"/>
|
||||
<p><label><%= scope.textPoweredBy %></label></p>
|
||||
<h3 class="vendor">Ascensio System SIA</h3>
|
||||
<p><label><%= scope.textAddress %>:</label><a class="external" href="#">Lubanas st. 125a-25, Riga, Latvia, EU, LV-1021</a></p>
|
||||
<p><label><%= scope.textEmail %>:</label><a class="external" target="_blank" href="mailto:support@onlyoffice.com">support@onlyoffice.com</a></p>
|
||||
<p><label><%= scope.textTel %>:</label><a class="external" target="_blank" href="tel:+371 660-16425">+371 660-16425</a></p>
|
||||
<p><a class="external" target="_blank" href="http://www.onlyoffice.com">www.onlyoffice.com</a></p>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -52,7 +52,8 @@ define([
|
|||
// private
|
||||
var isEdit,
|
||||
canEdit = false,
|
||||
canDownload = false;
|
||||
canDownload = false,
|
||||
canAbout = true;
|
||||
|
||||
return {
|
||||
// el: '.view-main',
|
||||
|
@ -96,6 +97,10 @@ define([
|
|||
isEdit = mode.isEdit;
|
||||
canEdit = !mode.isEdit && mode.canEdit && mode.canRequestEditRights;
|
||||
canDownload = mode.canDownload || mode.canDownloadOrigin;
|
||||
|
||||
if (mode.customization && mode.canBrandingExt) {
|
||||
canAbout = (mode.customization.about!==false);
|
||||
}
|
||||
},
|
||||
|
||||
rootLayout: function () {
|
||||
|
@ -115,6 +120,7 @@ define([
|
|||
.prop('checked', Common.SharedSettings.get('readerMode'));
|
||||
}
|
||||
if (!canDownload) $layour.find('#settings-download').hide();
|
||||
if (!canAbout) $layour.find('#settings-about').hide();
|
||||
|
||||
return $layour.html();
|
||||
}
|
||||
|
@ -211,7 +217,8 @@ define([
|
|||
textTel: 'tel',
|
||||
textSlideSize: 'Slide Size',
|
||||
mniSlideStandard: 'Standard (4:3)',
|
||||
mniSlideWide: 'Widescreen (16:9)'
|
||||
mniSlideWide: 'Widescreen (16:9)',
|
||||
textPoweredBy: 'Powered by'
|
||||
}
|
||||
})(), PE.Views.Settings || {}))
|
||||
});
|
|
@ -420,6 +420,7 @@
|
|||
"PE.Views.Settings.textFind": "Find",
|
||||
"PE.Views.Settings.textHelp": "Help",
|
||||
"PE.Views.Settings.textLoading": "Loading...",
|
||||
"PE.Views.Settings.textPoweredBy": "Powered by",
|
||||
"PE.Views.Settings.textPresentInfo": "Presentation Info",
|
||||
"PE.Views.Settings.textPresentSetup": "Presentation Setup",
|
||||
"PE.Views.Settings.textPresentTitle": "Presentation title",
|
||||
|
|
|
@ -51,7 +51,8 @@ define([
|
|||
var rootView,
|
||||
inProgress,
|
||||
infoObj,
|
||||
modalView;
|
||||
modalView,
|
||||
_licInfo;
|
||||
|
||||
return {
|
||||
models: [],
|
||||
|
@ -85,6 +86,8 @@ define([
|
|||
|
||||
setMode: function (mode) {
|
||||
this.getView('Settings').setMode(mode);
|
||||
if (mode.canBranding)
|
||||
_licInfo = mode.customization;
|
||||
},
|
||||
|
||||
initEvents: function () {
|
||||
|
@ -142,13 +145,58 @@ define([
|
|||
}
|
||||
},
|
||||
|
||||
onPageShow: function(view) {
|
||||
onPageShow: function(view, pageId) {
|
||||
var me = this;
|
||||
$('#settings-search').single('click', _.bind(me._onSearch, me));
|
||||
$('#settings-edit-document').single('click', _.bind(me._onEditDocument, me));
|
||||
$(modalView).find('.formats a').single('click', _.bind(me._onSaveFormat, me));
|
||||
me.initSettings(pageId);
|
||||
},
|
||||
|
||||
initSettings: function (pageId) {
|
||||
var me = this;
|
||||
if (pageId == '#settings-about-view') {
|
||||
// About
|
||||
me.setLicInfo(_licInfo);
|
||||
}
|
||||
},
|
||||
|
||||
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;" />');
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// API handlers
|
||||
|
||||
|
|
|
@ -270,16 +270,24 @@
|
|||
<div class="page-content">
|
||||
<div class="content-block">
|
||||
<div class="logo" style="display: inline-block; width: 100%; height: 55px;"></div>
|
||||
<div id="settings-about-logo" style="margin-top: 20px;display: none;"></div>
|
||||
</div>
|
||||
<div class="content-block">
|
||||
<h3>SPREADSHEET EDITOR</h3>
|
||||
<h3><%= scope.textVersion %> {{PRODUCT_VERSION}}</h3>
|
||||
</div>
|
||||
<div class="content-block">
|
||||
<h3 id="settings-about-name" class="vendor">Ascensio System SIA</h3>
|
||||
<p><label><%= scope.textAddress %>:</label><a id="settings-about-address" class="external" href="#">Lubanas st. 125a-25, Riga, Latvia, EU, LV-1021</a></p>
|
||||
<p><label><%= scope.textEmail %>:</label><a id="settings-about-email" class="external" target="_blank" href="mailto:support@onlyoffice.com">support@onlyoffice.com</a></p>
|
||||
<p><label><%= scope.textTel %>:</label><a id="settings-about-tel" class="external" target="_blank" href="tel:+371 660-16425">+371 660-16425</a></p>
|
||||
<p><a id="settings-about-url" class="external" target="_blank" href="http://www.onlyoffice.com">www.onlyoffice.com</a></p>
|
||||
<p><label id="settings-about-info" style="display: none;"></label></p>
|
||||
</div>
|
||||
<div class="content-block" id="settings-about-licensor" style="display: none;">
|
||||
<div class="content-block-inner" style="padding-top:0; padding-bottom: 1px;"/>
|
||||
<p><label><%= scope.textPoweredBy %></label></p>
|
||||
<h3 class="vendor">Ascensio System SIA</h3>
|
||||
<p><label><%= scope.textAddress %>:</label><a class="external" href="#">Lubanas st. 125a-25, Riga, Latvia, EU, LV-1021</a></p>
|
||||
<p><label><%= scope.textEmail %>:</label><a class="external" target="_blank" href="mailto:support@onlyoffice.com">support@onlyoffice.com</a></p>
|
||||
<p><label><%= scope.textTel %>:</label><a class="external" target="_blank" href="tel:+371 660-16425">+371 660-16425</a></p>
|
||||
<p><a class="external" target="_blank" href="http://www.onlyoffice.com">www.onlyoffice.com</a></p>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -51,7 +51,8 @@ define([
|
|||
// private
|
||||
var isEdit,
|
||||
canEdit = false,
|
||||
canDownload = false;
|
||||
canDownload = false,
|
||||
canAbout = true;
|
||||
|
||||
return {
|
||||
// el: '.view-main',
|
||||
|
@ -101,6 +102,10 @@ define([
|
|||
isEdit = mode.isEdit;
|
||||
canEdit = !mode.isEdit && mode.canEdit && mode.canRequestEditRights;
|
||||
canDownload = mode.canDownload || mode.canDownloadOrigin;
|
||||
|
||||
if (mode.customization && mode.canBrandingExt) {
|
||||
canAbout = (mode.customization.about!==false);
|
||||
}
|
||||
},
|
||||
|
||||
rootLayout: function () {
|
||||
|
@ -115,6 +120,7 @@ define([
|
|||
if (!canEdit) $layout.find('#settings-edit-document').hide();
|
||||
}
|
||||
if (!canDownload) $layout.find('#settings-download').hide();
|
||||
if (!canAbout) $layout.find('#settings-about').hide();
|
||||
|
||||
return $layout.html();
|
||||
}
|
||||
|
@ -141,7 +147,7 @@ define([
|
|||
content: $content.html()
|
||||
});
|
||||
|
||||
this.fireEvent('page:show', this);
|
||||
this.fireEvent('page:show', [this, templateId]);
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -203,7 +209,8 @@ define([
|
|||
textVersion: 'Version',
|
||||
textAddress: 'address',
|
||||
textEmail: 'email',
|
||||
textTel: 'tel'
|
||||
textTel: 'tel',
|
||||
textPoweredBy: 'Powered by'
|
||||
}
|
||||
})(), SSE.Views.Settings || {}))
|
||||
});
|
|
@ -456,6 +456,7 @@
|
|||
"SSE.Views.Settings.textFindAndReplace": "Find and Replace",
|
||||
"SSE.Views.Settings.textHelp": "Help",
|
||||
"SSE.Views.Settings.textLoading": "Loading...",
|
||||
"SSE.Views.Settings.textPoweredBy": "Powered by",
|
||||
"SSE.Views.Settings.textSettings": "Settings",
|
||||
"SSE.Views.Settings.textTel": "tel",
|
||||
"SSE.Views.Settings.textVersion": "Version",
|
||||
|
|
Loading…
Reference in a new issue