Merge pull request #1146 from ONLYOFFICE/release/v6.5.0

Release/v6.5.0
This commit is contained in:
Julia Radzhabova 2021-09-01 15:22:49 +03:00 committed by GitHub
commit 38def0be24
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 329 additions and 123 deletions

View file

@ -873,7 +873,8 @@
path += app + "/";
path += (config.type === "mobile" || isSafari_mobile)
? "mobile"
: (config.type === "embedded")
: (config.type === "embedded" || (app=='documenteditor') && config.document && config.document.permissions && (config.document.permissions.fillForms===true) &&
(config.document.permissions.edit === false) && (config.document.permissions.review !== true) && (config.editorConfig.mode !== 'view'))
? "embed"
: "main";

View file

@ -81,12 +81,11 @@ define([
template: _.template([
'<div class="input-field" style="<%= style %>">',
'<input ',
'type="<%= type %>" ',
'type="text" ',
'name="<%= name %>" ',
'spellcheck="<%= spellcheck %>" ',
'class="form-control <%= cls %>" ',
'placeholder="<%= placeHolder %>" ',
'value="<%= value %>"',
'data-hint="<%= dataHint %>"',
'data-hint-direction="<%= dataHintDirection %>"',
'data-hint-offset="<%= dataHintOffset %>"',
@ -165,6 +164,8 @@ define([
this._input.on('keydown', _.bind(this.onKeyDown, this));
this._input.on('keyup', _.bind(this.onKeyUp, this));
if (this.validateOnChange) this._input.on('input', _.bind(this.onInputChanging, this));
if (this.type=='password') this._input.on('input', _.bind(this.checkPasswordType, this));
if (this.maxLength) this._input.attr('maxlength', this.maxLength);
}
@ -183,9 +184,20 @@ define([
me.rendered = true;
if (me.value)
me.setValue(me.value);
return this;
},
checkPasswordType: function(){
if (this._input.val() !== '') {
(this._input.attr('type') !== 'password') && this._input.attr('type', 'password');
} else {
this._input.attr('type', 'text');
}
},
_doChange: function(e, extra) {
// skip processing for internally-generated synthetic event
// to avoid double processing
@ -303,6 +315,8 @@ define([
if (this.rendered){
this._input.val(value);
}
(this.type=='password') && this.checkPasswordType();
},
getValue: function() {

View file

@ -203,34 +203,13 @@ define([
arr = [];
storePlugins.each(function(item){
var plugin = new Asc.CPlugin();
plugin.set_Name(item.get('name'));
plugin.set_Guid(item.get('guid'));
plugin.set_BaseUrl(item.get('baseUrl'));
plugin.set_MinVersion && plugin.set_MinVersion(item.get('minVersion'));
plugin.deserialize(item.attributes);
var variations = item.get('variations'),
variationsArr = [];
variations.forEach(function(itemVar){
var variation = new Asc.CPluginVariation();
variation.set_Description(itemVar.get('description'));
variation.set_Url(itemVar.get('url'));
variation.set_Icons(itemVar.get('icons'));
variation.set_Visual(itemVar.get('isVisual'));
variation.set_CustomWindow(itemVar.get('isCustomWindow'));
variation.set_System(itemVar.get('isSystem'));
variation.set_Viewer(itemVar.get('isViewer'));
variation.set_EditorsSupport(itemVar.get('EditorsSupport'));
variation.set_Modal(itemVar.get('isModal'));
variation.set_InsideMode(itemVar.get('isInsideMode'));
variation.set_InitDataType(itemVar.get('initDataType'));
variation.set_InitData(itemVar.get('initData'));
variation.set_UpdateOleOnResize(itemVar.get('isUpdateOleOnResize'));
variation.set_Buttons(itemVar.get('buttons'));
variation.set_Size(itemVar.get('size'));
variation.set_InitOnSelectionChanged(itemVar.get('initOnSelectionChanged'));
variation.set_Events(itemVar.get('events'));
variation.set_Help(itemVar.get('help'));
variation.deserialize(itemVar.attributes);
variationsArr.push(variation);
});

View file

@ -113,7 +113,7 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
var $window = this.getChild();
var me = this;
var panelAutoFormat = $window.find('#id-autocorrect-dialog-settings-' + this.appPrefix + 'autoformat');
var panelAutoFormat = $window.find('#id-autocorrect-dialog-settings-' + (this.appPrefix=='pe-' ? 'de-' : this.appPrefix) + 'autoformat');
// Math correct
this.chReplaceType = new Common.UI.CheckBox({
@ -358,7 +358,7 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
var checked = (field.getValue()==='checked');
Common.localStorage.setBool(me.appPrefix + "settings-autoformat-hyperlink", checked);
Common.Utils.InternalSettings.set(me.appPrefix + "settings-autoformat-hyperlink", checked);
me.api.asc_setAutoCorrectHyperlinks(checked);
me.api.asc_SetAutoCorrectHyperlinks(checked);
});
this.btnsCategory[0].on('click', _.bind(this.onMathCategoryClick, this, false));

View file

@ -202,20 +202,12 @@ define([
if (this.type == Common.Utils.importTextType.DRM) {
this.inputPwd = new Common.UI.InputField({
el: $('#id-password-txt'),
type: 'text',
type: 'password',
validateOnBlur: false,
validation : function(value) {
return me.txtIncorrectPwd;
}
});
this.$window.find('input').on('input', function(){
if ($(this).val() !== '') {
($(this).attr('type') !== 'password') && $(this).attr('type', 'password');
} else {
$(this).attr('type', 'text');
}
});
} else {
this.initCodePages();
if (this.preview) {

View file

@ -77,14 +77,12 @@
}
}
.icon {
.icon.warn {
float: left;
width: 40px;
height: 40px;
&.warn {
background: ~"url('@{common-image-const-path}/controls/warnings.svg#attention')" no-repeat center;
}
}
}
}

View file

@ -104,7 +104,7 @@ class ContextMenuController extends Component {
}
onApiOpenContextMenu(x, y) {
if ( !this.state.opened && $$('.dialog.modal-in, .popover.modal-in, .sheet-modal.modal-in, .popup.modal-in, #pe-preview, .add-comment-popup').length < 1) {
if ( !this.state.opened && $$('.dialog.modal-in, .popover.modal-in, .sheet-modal.modal-in, .popup.modal-in, #pe-preview, .add-comment-popup, .actions-modal.modal-in').length < 1) {
this.setState({
items: this.initMenuItems(),
extraItems: this.initExtraItems()

View file

@ -214,40 +214,7 @@ const PluginsController = inject('storeAppOptions')(observer(props => {
plugins.forEach(item => {
let plugin = new Asc.CPlugin();
plugin.set_Name(item['name']);
plugin.set_Guid(item['guid']);
plugin.set_BaseUrl(item['baseUrl']);
plugin.set_MinVersion && plugin.set_MinVersion(item['minVersion']);
let variations = item['variations'],
variationsArr = [];
variations.forEach(itemVar => {
let variation = new Asc.CPluginVariation();
variation.set_Description(itemVar['description']);
variation.set_Url(itemVar['url']);
variation.set_Icons(itemVar['icons']);
variation.set_Visual(itemVar['isVisual']);
variation.set_CustomWindow(itemVar['isCustomWindow']);
variation.set_System(itemVar['isSystem']);
variation.set_Viewer(itemVar['isViewer']);
variation.set_EditorsSupport(itemVar['EditorsSupport']);
variation.set_Modal(itemVar['isModal']);
variation.set_InsideMode(itemVar['isInsideMode']);
variation.set_InitDataType(itemVar['initDataType']);
variation.set_InitData(itemVar['initData']);
variation.set_UpdateOleOnResize(itemVar['isUpdateOleOnResize']);
variation.set_Buttons(itemVar['buttons']);
variation.set_Size(itemVar['size']);
variation.set_InitOnSelectionChanged(itemVar['initOnSelectionChanged']);
variation.set_Events(itemVar['events']);
variationsArr.push(variation);
});
plugin["set_Variations"](variationsArr);
plugin.deserialize(item);
arr.push(plugin);
});

View file

@ -2610,7 +2610,7 @@ define([
value = Common.localStorage.getBool("de-settings-autoformat-hyperlink", true);
Common.Utils.InternalSettings.set("de-settings-autoformat-hyperlink", value);
// me.api.asc_setAutoCorrectHyperlinks(value);
me.api.asc_SetAutoCorrectHyperlinks(value);
},
showRenameUserDialog: function() {

View file

@ -131,8 +131,8 @@ define([
this.rightmenu.fireEvent('editcomplete', this.rightmenu);
},
onFocusObject: function(SelectedObjects) {
if (!this.editMode)
onFocusObject: function(SelectedObjects, forceSignature) {
if (!this.editMode && !forceSignature)
return;
var open = this._initSettings ? !Common.localStorage.getBool("de-hide-right-settings", this.rightmenu.defaultHideRightMenu) : false;
@ -269,6 +269,7 @@ define([
if (priorityactive>-1) active = priorityactive;
else if (lastactive>=0 && currentactive<0) active = lastactive;
else if (currentactive>=0) active = currentactive;
else if (forceSignature && !this._settings[Common.Utils.documentSettingsType.Signature].hidden) active = Common.Utils.documentSettingsType.Signature;
else if (!this._settings[Common.Utils.documentSettingsType.MailMerge].hidden) active = Common.Utils.documentSettingsType.MailMerge;
if (active == undefined && open && lastactive>=0)
@ -423,8 +424,9 @@ define([
}
this.rightmenu.chartSettings.disableControls(disabled);
if (!allowSignature && this.rightmenu.signatureSettings) {
this.rightmenu.btnSignature.setDisabled(disabled);
if (this.rightmenu.signatureSettings) {
!allowSignature && this.rightmenu.btnSignature.setDisabled(disabled);
allowSignature && disabled && this.onFocusObject([], true); // force press signature button
}
if (disabled) {

View file

@ -1627,6 +1627,8 @@ define([
insertImage: function(data) { // gateway
if (data && (data.url || data.images)) {
data.url && console.log("Obsolete: The 'url' parameter of the 'insertImage' method is deprecated. Please use 'images' parameter instead.");
var arr = [];
if (data.images && data.images.length>0) {
for (var i=0; i<data.images.length; i++) {

View file

@ -400,7 +400,7 @@ define([
allowMerge: false,
allowSignature: true,
allowProtect: true,
rightMenu: {clear: disable && (DE.getController('RightMenu').rightmenu.GetActivePane() !== 'id-signature-settings'), disable: true},
rightMenu: {clear: false, disable: true},
statusBar: true,
leftMenu: {disable: false, previewMode: true},
fileMenu: false,

View file

@ -1,13 +1,16 @@
import React, {Component} from 'react';
import {DocumentSettings} from '../../view/settings/DocumentSettings';
import { inject, observer } from 'mobx-react';
import { withTranslation } from 'react-i18next';
import { f7 } from 'framework7-react';
class DocumentSettingsController extends Component {
constructor (props) {
super (props);
this.getMargins = this.getMargins.bind(this);
this.applyMargins = this.applyMargins.bind(this);
this.onFormatChange = this.onFormatChange.bind(this);
}
onPageOrientation (value){
@ -19,13 +22,22 @@ class DocumentSettingsController extends Component {
onFormatChange (value) {
const api = Common.EditorApi.get();
const storeDocumentSettings = this.props.storeDocumentSettings;
this.widthDocument = storeDocumentSettings.widthDocument;
this.heightDocument = storeDocumentSettings.heightDocument;
if (api) {
api.change_DocSize(value[0], value[1]);
this.getMargins();
}
}
getMargins() {
const api = Common.EditorApi.get();
const { t } = this.props;
const _t = t('Settings', {returnObjects: true});
if (api) {
this.localSectionProps = api.asc_GetSectionProps();
if (this.localSectionProps) {
@ -37,6 +49,20 @@ class DocumentSettingsController extends Component {
const left = this.localSectionProps.get_LeftMargin();
const right = this.localSectionProps.get_RightMargin();
let errorMsg;
if(top + bottom > this.maxMarginsH || left + right > this.maxMarginsW) {
if(top + bottom > this.maxMarginsH) {
errorMsg = _t.textMarginsH;
} else {
errorMsg = _t.textMarginsH;
}
f7.dialog.alert(errorMsg, _t.notcriticalErrorTitle);
api.change_DocSize(this.widthDocument, this.heightDocument);
return;
}
return {
top,
bottom,
@ -96,4 +122,4 @@ class DocumentSettingsController extends Component {
}
}
export default DocumentSettingsController;
export default inject("storeDocumentSettings")(observer(withTranslation()(DocumentSettingsController)));

View file

@ -2232,7 +2232,7 @@ define([
value = Common.localStorage.getBool("pe-settings-autoformat-hyperlink", true);
Common.Utils.InternalSettings.set("pe-settings-autoformat-hyperlink", value);
// me.api.asc_setAutoCorrectHyperlinks(value);
me.api.asc_SetAutoCorrectHyperlinks(value);
},
showRenameUserDialog: function() {

View file

@ -106,8 +106,8 @@ define([
this.rightmenu.fireEvent('editcomplete', this.rightmenu);
},
onFocusObject: function(SelectedObjects) {
if (!this.editMode)
onFocusObject: function(SelectedObjects, forceSignature) {
if (!this.editMode && !forceSignature)
return;
var open = this._initSettings ? !Common.localStorage.getBool("pe-hide-right-settings", this.rightmenu.defaultHideRightMenu) : false;
@ -194,6 +194,7 @@ define([
if (priorityactive>-1) active = priorityactive;
else if (currentactive>=0) active = currentactive;
else if (lastactive>=0) active = lastactive;
else if (forceSignature && !this._settings[Common.Utils.documentSettingsType.Signature].hidden) active = Common.Utils.documentSettingsType.Signature;
else active = Common.Utils.documentSettingsType.Slide;
if (active !== undefined) {
@ -226,8 +227,9 @@ define([
this.rightmenu.imageSettings.disableControls(disabled);
this.rightmenu.chartSettings.disableControls(disabled);
if (!allowSignature && this.rightmenu.signatureSettings) {
this.rightmenu.btnSignature.setDisabled(disabled);
if (this.rightmenu.signatureSettings) {
!allowSignature && this.rightmenu.btnSignature.setDisabled(disabled);
allowSignature && disabled && this.onFocusObject([], true); // force press signature button
}
if (disabled) {

View file

@ -1627,6 +1627,8 @@ define([
insertImage: function(data) { // gateway
if (data && (data.url || data.images)) {
data.url && console.log("Obsolete: The 'url' parameter of the 'insertImage' method is deprecated. Please use 'images' parameter instead.");
var arr = [];
if (data.images && data.images.length>0) {
for (var i=0; i<data.images.length; i++) {

View file

@ -350,7 +350,7 @@ define([
Common.NotificationCenter.trigger('editing:disable', disable, {
viewMode: disable,
allowSignature: true,
rightMenu: {clear: disable && (PE.getController('RightMenu').rightmenu.GetActivePane() !== 'id-signature-settings'), disable: true},
rightMenu: {clear: false, disable: true},
statusBar: true,
leftMenu: {disable: false, previewMode: true},
fileMenu: false,

View file

@ -2733,7 +2733,7 @@ define([
value = Common.localStorage.getBool("sse-settings-autoformat-hyperlink", true);
Common.Utils.InternalSettings.set("sse-settings-autoformat-hyperlink", value);
me.api.asc_setAutoCorrectHyperlinks(value);
me.api.asc_SetAutoCorrectHyperlinks(value);
},
showRenameUserDialog: function() {

View file

@ -168,14 +168,14 @@ define([
this.onFocusObject(SelectedObjects, cellInfo, formatTableInfo, sparkLineInfo, pivotInfo);
},
onFocusObject: function(SelectedObjects, cellInfo, formatTableInfo, sparkLineInfo, pivotInfo) {
if (!this.editMode)
onFocusObject: function(SelectedObjects, cellInfo, formatTableInfo, sparkLineInfo, pivotInfo, forceSignature) {
if (!this.editMode && !forceSignature)
return;
var isCellLocked = cellInfo.asc_getLocked() || this._state.wsProps['FormatCells'],
isTableLocked = (cellInfo.asc_getLockedTable()===true || !this.rightmenu.mode.canModifyFilter) || this._state.wsProps['FormatCells'],
isSparkLocked = (cellInfo.asc_getLockedSparkline()===true) || this._state.wsLock,
isPivotLocked = (cellInfo.asc_getLockedPivotTable()===true) || this._state.wsProps['PivotTables'];
var isCellLocked = cellInfo && cellInfo.asc_getLocked() || this._state.wsProps['FormatCells'],
isTableLocked = (cellInfo && cellInfo.asc_getLockedTable()===true || !this.rightmenu.mode.canModifyFilter) || this._state.wsProps['FormatCells'],
isSparkLocked = (cellInfo && cellInfo.asc_getLockedSparkline()===true) || this._state.wsLock,
isPivotLocked = (cellInfo && cellInfo.asc_getLockedPivotTable()===true) || this._state.wsProps['PivotTables'];
for (var i=0; i<this._settings.length; ++i) {
if (i==Common.Utils.documentSettingsType.Signature) continue;
@ -241,7 +241,7 @@ define([
this._settings[settingsType].hidden = 0;
}
if (SelectedObjects.length<=0) { // cell is selected
if (SelectedObjects.length<=0 && cellInfo) { // cell is selected
settingsType = Common.Utils.documentSettingsType.Cell;
this._settings[settingsType].props = cellInfo;
this._settings[settingsType].locked = isCellLocked;
@ -296,6 +296,7 @@ define([
if (priorityactive>-1) active = priorityactive;
else if (lastactive>=0 && currentactive<0) active = lastactive;
else if (currentactive>=0) active = currentactive;
else if (forceSignature && !this._settings[Common.Utils.documentSettingsType.Signature].hidden) active = Common.Utils.documentSettingsType.Signature;
if (active == undefined && this._openRightMenu && lastactive>=0)
active = lastactive;
@ -425,12 +426,9 @@ define([
this.rightmenu.cellSettings.disableControls(disabled);
this.rightmenu.slicerSettings.disableControls(disabled);
if (!allowSignature && this.rightmenu.signatureSettings) {
this.rightmenu.btnSignature.setDisabled(disabled);
}
if (!allowSignature && this.rightmenu.signatureSettings) {
this.rightmenu.btnSignature.setDisabled(disabled);
if (this.rightmenu.signatureSettings) {
!allowSignature && this.rightmenu.btnSignature.setDisabled(disabled);
allowSignature && disabled && this.onFocusObject([], undefined, undefined, undefined, undefined, true); // force press signature button
}
if (disabled) {

View file

@ -908,6 +908,8 @@ define([
insertImage: function(data) { // gateway
if (data && (data.url || data.images)) {
data.url && console.log("Obsolete: The 'url' parameter of the 'insertImage' method is deprecated. Please use 'images' parameter instead.");
var arr = [];
if (data.images && data.images.length>0) {
for (var i=0; i<data.images.length; i++) {

View file

@ -76,7 +76,6 @@ define([
});
Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this));
Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this));
Common.NotificationCenter.on('protect:sheet', _.bind(this.onSheetClick, this));
},
setConfig: function (data, api) {
@ -93,7 +92,6 @@ define([
this.api.asc_registerCallback('asc_onChangeProtectWorksheet',_.bind(this.onChangeProtectSheet, this));
this.api.asc_registerCallback('asc_onActiveSheetChanged', _.bind(this.onActiveSheetChanged, this));
this.api.asc_registerCallback('asc_onSelectionChanged', _.bind(this.onApiSelectionChanged, this));
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect',_.bind(this.onCoAuthoringDisconnect, this));
}
},
@ -352,10 +350,6 @@ define([
}
}
}
},
onCoAuthoringDisconnect: function() {
this.SetDisabled(true);
}
}, SSE.Controllers.WBProtection || {}));

View file

@ -397,7 +397,7 @@ define([
viewMode: disable,
allowSignature: true,
allowProtect: true,
rightMenu: {clear: disable && (SSE.getController('RightMenu').rightmenu.GetActivePane() !== 'id-signature-settings'), disable: true},
rightMenu: {clear: false, disable: true},
statusBar: true,
leftMenu: {disable: false, previewMode: true},
fileMenu: false,

View file

@ -23,10 +23,10 @@ const StatusbarController = inject('sheets', 'storeFocusObjects', 'users')(obser
api.asc_registerCallback('asc_onActiveSheetChanged', onApiActiveSheetChanged);
api.asc_registerCallback('asc_onHidePopMenu', onApiHideTabContextMenu);
api.asc_registerCallback('asc_onUpdateTabColor', onApiUpdateTabColor);
// api.asc_registerCallback('asc_onCoAuthoringDisconnect', onApiDisconnect);
api.asc_registerCallback('asc_onCoAuthoringDisconnect', onApiDisconnect);
});
Common.Notifications.on('document:ready', onApiSheetsChanged);
// Common.Notifications.on('api:disconnect', onApiDisconnect);
Common.Notifications.on('api:disconnect', onApiDisconnect);
});
const onApiDisconnect = () => {
@ -180,7 +180,7 @@ const Statusbar = inject('sheets', 'storeAppOptions', 'users')(observer(props =>
if (index == api.asc_getActiveWorksheetIndex()) {
if (!opened) {
if (isEdit && !sheets.isWorkbookLocked) {
if (isEdit && !isDisconnected) {
api.asc_closeCellEditor();
f7.popover.open('#idx-tab-context-menu-popover', target);
}

View file

@ -8,22 +8,23 @@ const viewStyle = {
height: 30
};
const StatusbarView = inject('storeAppOptions', 'sheets')(observer(props => {
const StatusbarView = inject('storeAppOptions', 'sheets', 'users')(observer(props => {
const { t } = useTranslation();
const _t = t('Statusbar', {returnObjects: true});
const isAndroid = Device.android;
const isPhone = Device.isPhone;
const {sheets, storeAppOptions} = props;
const {sheets, storeAppOptions, users} = props;
const allSheets = sheets.sheets;
const hiddenSheets = sheets.hiddenWorksheets();
const isWorkbookLocked = sheets.isWorkbookLocked;
// const isWorkbookLocked = sheets.isWorkbookLocked;
const isEdit = storeAppOptions.isEdit;
const isDisconnected = users.isDisconnected;
return (
<Fragment>
<View id="idx-statusbar" className="statusbar" style={viewStyle}>
<div id="idx-box-add-tab" className={`${isWorkbookLocked ? 'disabled' : ''}`}>
<Link href={false} id="idx-btn-addtab" className={`tab${isWorkbookLocked ? ' disabled' : ''}`} onClick={props.onAddTabClicked}>
<div id="idx-box-add-tab" className={`${isDisconnected ? 'disabled' : ''}`}>
<Link href={false} id="idx-btn-addtab" className={`tab${isDisconnected ? ' disabled' : ''}`} onClick={props.onAddTabClicked}>
<Icon className="icon icon-plus" />
</Link>
</div>

View file

@ -816,7 +816,7 @@ const PageVerticalAxis = props => {
<ListInput
label={_t.textMinimumValue}
type="number"
placeholder="Auto"
placeholder={_t.textAuto}
value={minValue}
onChange={e => props.onVerAxisMinValue(e.target.value)}
onInput={e => setMinValue(e.target.value)}
@ -826,7 +826,7 @@ const PageVerticalAxis = props => {
<ListInput
label={_t.textMaximumValue}
type="number"
placeholder="Auto"
placeholder={_t.textAuto}
value={maxValue}
onChange={e => props.onVerAxisMaxValue(e.target.value)}
onInput={e => setMaxValue(e.target.value)}

View file

@ -11,6 +11,7 @@ module.exports = function(grunt) {
' *\n' +
' * Version: <%= pkg.version %> (build:<%= pkg.build %>)\n' +
' */\n';
global.copyright = copyright;
let iconv_lite, encoding = process.env.SYSTEM_ENCODING;
grunt.log.writeln('platform: ' + process.platform.green);
@ -91,6 +92,8 @@ module.exports = function(grunt) {
addons.forEach((element,index,self) => self[index] = path.join('../..', element, '/build'));
addons = addons.filter(element => grunt.file.isDir(element));
require('./appforms')(grunt);
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-uglify');
@ -187,6 +190,8 @@ module.exports = function(grunt) {
if ( !!_extConfig && _extConfig.name == packageFile.name ) {
_merge(packageFile, _extConfig);
}
global.packageFile = packageFile;
} else grunt.log.error().writeln('Could not load config file'.red);
});
}
@ -537,7 +542,7 @@ module.exports = function(grunt) {
options: {
cwd: '../vendor/framework7-react',
},
cmd: 'npm i --include=dev',
cmd: 'npm i --include=dev --production=false',
},
}
});

80
build/appforms.js Normal file
View file

@ -0,0 +1,80 @@
module.exports = (grunt) => {
grunt.registerTask('forms-app-init', function() {
const packageFile = global.packageFile;
if ( !global.packageFile )
grunt.log.ok('no package file'.red);
else {
const config = require('./appforms.json');
if ( config ) {
//packageFile.tasks.deploy.push(...config.tasks.deploy);
packageFile.forms = config.forms;
}
}
grunt.initConfig({
pkg: packageFile,
clean: {
options: {
force: true
},
postbuild: packageFile.forms.clean.postbuild,
prebuild: packageFile.forms.clean.prebuild
},
requirejs: {
compile: {
options: packageFile.forms.js.requirejs.options
}
},
less: {
production: {
options: {
compress: true,
ieCompat: false,
modifyVars: packageFile.forms.less.vars,
plugins: [
new (require('less-plugin-clean-css'))()
]
},
files: {
"<%= pkg.forms.less.files.dest %>": packageFile.forms.less.files.src
}
}
},
concat: {
options: {
stripBanners: true,
banner: global.copyright
},
dist: {
src: [packageFile.forms.js.requirejs.options.out],
dest: packageFile.forms.js.requirejs.options.out
}
},
copy: {
localization: {
files: packageFile.forms.copy.localization
},
indexhtml: {
files: packageFile.forms.copy.indexhtml
}
},
inline: {
dist: {
src: `${packageFile.forms.copy.indexhtml.dest}/index.html`
}
}
});
});
grunt.registerTask('deploy-app-forms', ['forms-app-init', 'clean:prebuild', /*'imagemin',*/ 'less',
'requirejs', 'concat', 'copy', 'inline', /*'json-minify',*/
/*'replace:writeVersion',*/ /*'replace:prepareHelp',*/ 'clean:postbuild']);
}

140
build/appforms.json Normal file
View file

@ -0,0 +1,140 @@
{
"name": "documenteditor",
"version": "4.3.0",
"build": 1149,
"homepage": "http://www.onlyoffice.com",
"private": true,
"forms": {
"clean": {
"prebuild": [
"../deploy/web-apps/apps/documenteditor/forms"
],
"postbuild": [
"../deploy/web-apps/apps/documenteditor/forms/resources/img"
]
},
"js": {
"requirejs": {
"options": {
"name": "../apps/documenteditor/forms/app.js",
"out": "../deploy/web-apps/apps/documenteditor/forms/app.js",
"baseUrl": "../apps/",
"inlineText": true,
"findNestedDependencies": true,
"preserveLicenseComments": false,
"optimizeAllPluginResources": true,
"paths": {
"jquery": "../vendor/jquery/jquery",
"underscore": "../vendor/underscore/underscore",
"backbone": "../vendor/backbone/backbone",
"text": "../vendor/requirejs-text/text",
"bootstrap": "../vendor/bootstrap/dist/js/bootstrap",
"perfectscrollbar": "common/main/lib/mods/perfect-scrollbar",
"jmousewheel": "../vendor/perfect-scrollbar/src/jquery.mousewheel",
"xregexp": "empty:",
"sockjs": "empty:",
"jszip": "empty:",
"jszip-utils": "empty:",
"coapisettings": "empty:",
"allfonts": "empty:",
"sdk": "empty:",
"api": "empty:",
"core": "common/main/lib/core/application",
"notification": "common/main/lib/core/NotificationCenter",
"keymaster": "common/main/lib/core/keymaster",
"tip": "common/main/lib/util/Tip",
"analytics": "common/Analytics",
"gateway": "common/Gateway",
"locale": "common/locale",
"irregularstack": "common/IrregularStack"
},
"shim": {
"underscore": {
"exports": "_"
},
"backbone": {
"deps": [
"underscore",
"jquery"
],
"exports": "Backbone"
},
"bootstrap": {
"deps": [
"jquery"
]
},
"perfectscrollbar": {
"deps": [
"jmousewheel"
]
},
"notification": {
"deps": [
"backbone"
]
},
"core": {
"deps": [
"backbone",
"notification"
]
},
"sdk": {
"deps": [
"jquery",
"underscore",
"coapisettings",
"allfonts",
"xregexp",
"sockjs",
"jszip",
"jszip-utils"
]
},
"gateway": {
"deps": [
"jquery"
]
},
"analytics": {
"deps": [
"jquery"
]
}
}
}
}
},
"less": {
"files": {
"src": "../apps/documenteditor/forms/resources/less/application.less",
"dest": "../deploy/web-apps/apps/documenteditor/forms/resources/css/app.css"
},
"vars": {
"app-image-const-path": "'../img'",
"common-image-const-path": "'../img'",
"app-image-path": "'../../../../../deploy/web-apps/apps/documenteditor/forms/resources/img'",
"common-image-path": "'../../../../../deploy/web-apps/apps/documenteditor/forms/resources/img'"
}
},
"copy": {
"localization": [
{
"expand": true,
"cwd": "../apps/documenteditor/forms/locale/",
"src": "*",
"dest": "../deploy/web-apps/apps/documenteditor/forms/locale/"
}
],
"indexhtml": {
"../deploy/web-apps/apps/documenteditor/forms/index.html": "../apps/documenteditor/forms/index.html.deploy"
}
}
},
"tasks": {
"deploy": [
"deploy-app-forms"
]
}
}

View file

@ -368,6 +368,7 @@
"increment-build",
"deploy-app-main",
"deploy-app-mobile",
"deploy-app-forms",
"deploy-app-embed"
]
}