[build] apply tags to vary production info

This commit is contained in:
Maxim Kadushkin 2019-02-22 15:52:33 +03:00
parent b8ecbaf735
commit fb2ec72712
15 changed files with 84 additions and 36 deletions

View file

@ -53,10 +53,6 @@ define([
Common.UI.BaseView.prototype.initialize.call(this,arguments);
this.txtVersionNum = '{{PRODUCT_VERSION}}';
this.txtAscMail = 'support@onlyoffice.com';
this.txtAscTelNum = '+371 660-16425';
this.txtAscUrl = 'www.onlyoffice.com';
this.txtAscName = 'Ascensio System SIA';
this.template = _.template([
'<table id="id-about-licensor-logo" cols="1" style="width: 100%; margin-top: 20px;">',
@ -72,29 +68,29 @@ define([
'</table>',
'<table id="id-about-licensor-info" cols="3" style="width: 100%;" class="margin-bottom">',
'<tr>',
'<td colspan="3" align="center" style="padding: 20px 0 10px 0;"><label class="asc-about-companyname">' + this.txtAscName + '</label></td>',
'<td colspan="3" align="center" style="padding: 20px 0 10px 0;"><label class="asc-about-companyname"><%= publishername %></label></td>',
'</tr>',
'<tr>',
'<td colspan="3" align="center" class="padding-small">',
'<label class="asc-about-desc-name">' + this.txtAddress + '</label>',
'<label class="asc-about-desc">' + "20A-12 Ernesta Birznieka-Upisha street, Riga, Latvia, EU, LV-1050" + '</label>',
'<label class="asc-about-desc"><%= publisheraddr %></label>',
'</td>',
'</tr>',
'<tr>',
'<td colspan="3" align="center" class="padding-small">',
'<label class="asc-about-desc-name">' + this.txtMail + '</label>',
'<a href="mailto:'+ this.txtAscMail +'">' + this.txtAscMail + '</a>',
'<a href="mailto:<%= supportemail %>"><%= supportemail %></a>',
'</td>',
'</tr>',
'<tr>',
'<td colspan="3" align="center" class="padding-small">',
'<label class="asc-about-desc-name">' + this.txtTel + '</label>',
'<label class="asc-about-desc">' + this.txtAscTelNum + '</label>',
'<label class="asc-about-desc"><%= phonenum %></label>',
'</td>',
'</tr>',
'<tr>',
'<td colspan="3" align="center">',
'<a href="http:\/\/'+ this.txtAscUrl +'" target="_blank">' + this.txtAscUrl + '</a>',
'<a href="<%= publisherurl %>" target="_blank"><% print(publisherurl.replace(/https?:\\/{2}/, "")) %></a>',
'</td>',
'</tr>',
'</table>',
@ -143,11 +139,11 @@ define([
'<td style="width:50%;"><div class="separator horizontal short"/></td>',
'</tr>',
'<tr>',
'<td colspan="3" align="center" style="padding: 9px 0 10px;"><label class="asc-about-companyname">' + this.txtAscName + '</label></td>',
'<td colspan="3" align="center" style="padding: 9px 0 10px;"><label class="asc-about-companyname"><%= publishername %></label></td>',
'</tr>',
'<tr>',
'<td colspan="3" align="center">',
'<label class="asc-about-desc">' + this.txtAscUrl + '</label>',
'<label class="asc-about-desc"><% print(publisherurl.replace(/https?:\\/{2}/, "")) %></label>',
'</td>',
'</tr>',
'</table>'
@ -158,6 +154,11 @@ define([
render: function() {
var el = $(this.el);
el.html(this.template({
publishername: '{{PUBLISHER_NAME}}',
publisheraddr: '{{PUBLISHER_ADDRESS}}',
publisherurl: /^(?:https?:\/{2})?(\S+)/.exec('{{PUBLISHER_URL}}')[1],
supportemail: '{{SUPPORT_EMAIL}}',
phonenum: '{{PUBLISHER_PHONE}}',
scope: this
}));

View file

@ -215,7 +215,7 @@ define([
if ( me.logo )
me.logo.children(0).on('click', function (e) {
var _url = !!me.branding && !!me.branding.logo && (me.branding.logo.url!==undefined) ?
me.branding.logo.url : 'https://www.onlyoffice.com';
me.branding.logo.url : '{{PUBLISHER_URL}}';
if (_url) {
var newDocumentPage = window.open(_url);
newDocumentPage && newDocumentPage.focus();

View file

@ -315,6 +315,10 @@ define([
}
});
}
this.warnNoLicense = this.warnNoLicense.replace('%1', '{{COMPANY_NAME}}');
this.warnNoLicenseUsers = this.warnNoLicense.replace('%1', '{{COMPANY_NAME}}');
this.textNoLicenseTitle = this.textNoLicenseTitle.replace('%1', '{{COMPANY_NAME}}');
},
loadConfig: function(data) {
@ -1081,9 +1085,9 @@ define([
callback: function(btn) {
Common.localStorage.setItem("de-license-warning", now);
if (btn == 'buynow')
window.open('https://www.onlyoffice.com', "_blank");
window.open('{{PUBLISHER_URL}}', "_blank");
else if (btn == 'contact')
window.open('mailto:sales@onlyoffice.com', "_blank");
window.open('mailto:{{SALES_EMAIL}}', "_blank");
}
});
}
@ -1438,7 +1442,7 @@ define([
break;
case Asc.c_oAscError.ID.Warning:
config.msg = this.errorConnectToServer;
config.msg = this.errorConnectToServer.replace('%1', '<a href=\"{{API_URL_EDITING_CALLBACK}}\" target=\"_blank\">here</a>');
config.closable = false;
break;
@ -2330,13 +2334,13 @@ define([
sendMergeTitle: 'Sending Merge',
sendMergeText: 'Sending Merge...',
txtArt: 'Your text here',
errorConnectToServer: ' The document could not be saved. Please check connection settings or contact your administrator.<br>When you click the \'OK\' button, you will be prompted to download the document.<br><br>' +
'Find more information about connecting Document Server <a href=\"https://api.onlyoffice.com/editors/callback\" target=\"_blank\">here</a>',
errorConnectToServer: 'The document could not be saved. Please check connection settings or contact your administrator.<br>When you click the \'OK\' button, you will be prompted to download the document.<br><br>' +
'Find more information about connecting Document Server %1',
textTryUndoRedo: 'The Undo/Redo functions are disabled for the Fast co-editing mode.<br>Click the \'Strict mode\' button to switch to the Strict co-editing mode to edit the file without other users interference and send your changes only after you save them. You can switch between the co-editing modes using the editor Advanced settings.',
textStrict: 'Strict mode',
txtErrorLoadHistory: 'Loading history failed',
textBuyNow: 'Visit website',
textNoLicenseTitle: 'ONLYOFFICE connection limitation',
textNoLicenseTitle: '%1 connection limitation',
textContactUs: 'Contact sales',
errorViewerDisconnect: 'Connection is lost. You can still view the document,<br>but will not be able to download or print until the connection is restored.',
warnLicenseExp: 'Your license has expired.<br>Please update your license and refresh the page.',
@ -2387,8 +2391,8 @@ define([
txtNoTableOfContents: "No table of contents entries found.",
txtTableOfContents: "Table of Contents",
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.",
warnNoLicense: 'This version of ONLYOFFICE Editors has certain limitations for concurrent connections to the document server.<br>If you need more please consider purchasing a commercial license.',
warnNoLicenseUsers: 'This version of ONLYOFFICE Editors has certain limitations for concurrent users.<br>If you need more please consider purchasing a commercial license.',
warnNoLicense: 'This version of %1 editors has certain limitations for concurrent connections to the document server.<br>If you need more please consider purchasing a commercial license.',
warnNoLicenseUsers: 'This version of %1 editors has certain limitations for concurrent users.<br>If you need more please consider purchasing a commercial license.',
warnLicenseExceeded: 'The number of concurrent connections to the document server has been exceeded and the document will be opened for viewing only.<br>Please contact your administrator for more information.',
warnLicenseUsersExceeded: 'The number of concurrent users has been exceeded and the document will be opened for viewing only.<br>Please contact your administrator for more information.',
errorDataEncrypted: 'Encrypted changes have been received, they cannot be deciphered.',

View file

@ -79,7 +79,7 @@ define([
var config = this.mode.customization;
config && !!config.feedback && !!config.feedback.url ?
window.open(config.feedback.url) :
window.open('http://support.onlyoffice.com');
window.open('{{SUPPORT_URL}}');
}
}
},

View file

@ -613,13 +613,13 @@ define([
text: me.textBuyNow,
bold: true,
onClick: function() {
window.open('https://www.onlyoffice.com', "_blank");
window.open('{{PUBLISHER_URL}}', "_blank");
}
},
{
text: me.textContactUs,
onClick: function() {
window.open('mailto:sales@onlyoffice.com', "_blank");
window.open('mailto:{{SALES_EMAIL}}', "_blank");
}
}];
}

View file

@ -396,7 +396,7 @@ define([
},
onShowHelp: function () {
window.open('http://support.onlyoffice.com/', "_blank");
window.open('{{SUPPORT_URL}}', "_blank");
this.hideModal();
},

View file

@ -825,9 +825,9 @@ define([
callback: function(btn) {
Common.localStorage.setItem("pe-license-warning", now);
if (btn == 'buynow')
window.open('https://www.onlyoffice.com', "_blank");
window.open('{{PUBLISHER_URL}}', "_blank");
else if (btn == 'contact')
window.open('mailto:sales@onlyoffice.com', "_blank");
window.open('mailto:{{SALES_EMAIL}}', "_blank");
}
});
}

View file

@ -76,7 +76,7 @@ define([
var config = this.mode.customization;
config && !!config.feedback && !!config.feedback.url ?
window.open(config.feedback.url) :
window.open('http://support.onlyoffice.com');
window.open('{{SUPPORT_URL}}');
}
}
},

View file

@ -568,13 +568,13 @@ define([
text: me.textBuyNow,
bold: true,
onClick: function() {
window.open('https://www.onlyoffice.com', "_blank");
window.open('{{PUBLISHER_URL}}', "_blank");
}
},
{
text: me.textContactUs,
onClick: function() {
window.open('mailto:sales@onlyoffice.com', "_blank");
window.open('mailto:{{SALES_EMAIL}}', "_blank");
}
}];
}

View file

@ -180,7 +180,7 @@ define([
},
showHelp: function () {
window.open('http://support.onlyoffice.com/', "_blank");
window.open('{{SUPPORT_URL}}', "_blank");
PE.getController('Settings').hideModal();
},

View file

@ -852,9 +852,9 @@ define([
callback: function(btn) {
Common.localStorage.setItem("sse-license-warning", now);
if (btn == 'buynow')
window.open('https://www.onlyoffice.com', "_blank");
window.open('{{PUBLISHER_URL}}', "_blank");
else if (btn == 'contact')
window.open('mailto:sales@onlyoffice.com', "_blank");
window.open('mailto:{{SALES_EMAIL}}', "_blank");
}
});
}

View file

@ -67,7 +67,7 @@ define([
var config = this.mode.customization;
config && !!config.feedback && !!config.feedback.url ?
window.open(config.feedback.url) :
window.open('http://support.onlyoffice.com');
window.open('{{SUPPORT_URL}}');
}
}
},

View file

@ -582,13 +582,13 @@ define([
text: me.textBuyNow,
bold: true,
onClick: function() {
window.open('https://www.onlyoffice.com', "_blank");
window.open('{{PUBLISHER_URL}}', "_blank");
}
},
{
text: me.textContactUs,
onClick: function() {
window.open('mailto:sales@onlyoffice.com', "_blank");
window.open('mailto:{{SALES_EMAIL}}', "_blank");
}
}];
}

View file

@ -68,7 +68,7 @@ define([
'Settings': {
'page:show' : this.onPageShow
, 'settings:showhelp': function(e) {
window.open('http://support.onlyoffice.com/', "_blank");
window.open('{{SUPPORT_URL}}', "_blank");
this.hideModal();
}
}

View file

@ -184,6 +184,33 @@ module.exports = function(grunt) {
replacements: [{
from: /\{\{PRODUCT_VERSION\}\}/,
to: packageFile.version
},{
from: /\{\{SUPPORT_EMAIL\}\}/g,
to: 'support@onlyoffice.com'
},{
from: /\{\{SUPPORT_URL\}\}/g,
to: 'https://support.onlyoffice.com'
},{
from: /\{\{SALES_EMAIL\}\}/g,
to: 'sales@onlyoffice.com'
},{
from: /\{\{PUBLISHER_URL\}\}/g,
to: 'https://www.onlyoffice.com'
},{
from: /\{\{PUBLISHER_PHONE\}\}/,
to: '+371 660-16425'
},{
from: /\{\{PUBLISHER_NAME\}\}/g,
to: 'Ascensio System SIA'
},{
from: /\{\{PUBLISHER_ADDRESS\}\}/,
to: '20A-12 Ernesta Birznieka-Upisha street, Riga, Latvia, EU, LV-1050'
}, {
from: /\{\{API_URL_EDITING_CALLBACK\}\}/,
to: 'https://api.onlyoffice.com/editors/callback'
}, {
from: /\{\{COMPANY_NAME\}\}/,
to: 'ONLYOFFICE'
}]
},
prepareHelp: {
@ -260,6 +287,22 @@ module.exports = function(grunt) {
}
}
});
var extr = process.env['ASCREPLACE'];
if ( !!extr ) {
var replace = grunt.config.get('replace');
var pairs = extr.split(';');
for (var i in pairs) {
var v = pairs[i].split(':');
replace.writeVersion.replacements.push({
from: v[0],
to: v[1] || ''
});
}
grunt.config.set('replace', replace);
}
});
grunt.registerTask('deploy-reporter', function(){