Merge branch 'develop' into feature/sse-function-wizard

This commit is contained in:
Julia Radzhabova 2020-04-30 15:38:33 +03:00
commit c49cb88ddc
3536 changed files with 39170 additions and 6452 deletions

View file

@ -74,6 +74,9 @@ Common.Locale = new(function() {
var res = '';
if (l10n && scope && scope.name) {
res = l10n[scope.name + '.' + prop];
if ( !res && scope.default )
res = scope.default;
}
return res || (scope ? eval(scope.name).prototype[prop] : '');

View file

@ -313,7 +313,8 @@ define([
if (me.options.el) {
me.render();
}
} else if (me.options.parentEl)
me.render(me.options.parentEl);
},
render: function(parentEl) {

View file

@ -91,17 +91,17 @@ define([
me.currentDate = me.options.date || new Date();
me.btnPrev = new Common.UI.Button({
parentEl: me.cmpEl.find('#prev-arrow'),
cls: '',
iconCls: 'arrow-prev img-commonctrl'
});
me.btnPrev.render(me.cmpEl.find('#prev-arrow'));
me.btnPrev.on('click', _.bind(me.onClickPrev, me));
me.btnNext = new Common.UI.Button({
parentEl: me.cmpEl.find('#next-arrow'),
cls: '',
iconCls: 'arrow-next img-commonctrl'
});
me.btnNext.render(me.cmpEl.find('#next-arrow'));
me.btnNext.on('click', _.bind(me.onClickNext, me));
me.cmpEl.on('keydown', function(e) {

View file

@ -34,11 +34,12 @@ if (Common === undefined)
var Common = {};
define([
'common/main/lib/component/Button'
'common/main/lib/component/Button',
'common/main/lib/component/ThemeColorPalette'
], function () {
'use strict';
Common.UI.ColorButton = Common.UI.Button.extend({
Common.UI.ColorButton = Common.UI.Button.extend(_.extend({
options : {
hint: false,
enableToggle: false,
@ -49,25 +50,85 @@ define([
'<div class="btn-group" id="<%= id %>">',
'<button type="button" class="btn btn-color dropdown-toggle <%= cls %>" data-toggle="dropdown" style="<%= style %>">',
'<span>&nbsp;</span>',
'<span class="inner-box-caret"><i class="caret img-commonctrl"></i></span>',
'</button>',
'</div>'
].join('')),
initialize : function(options) {
if (!options.menu && options.menu !== false) {// menu==null or undefined
// set default menu
var me = this;
options.menu = me.getMenu(options);
me.on('render:after', function(btn) {
me.getPicker(options.color);
});
}
Common.UI.Button.prototype.initialize.call(this, options);
},
render: function(parentEl) {
Common.UI.Button.prototype.render.call(this, parentEl);
if (this.options.color!==undefined)
this.setColor(this.options.color);
},
onColorSelect: function(picker, color) {
this.setColor(color);
this.trigger('color:select', this, color);
},
setColor: function(color) {
var border_color, clr,
span = $(this.cmpEl).find('button span');
var span = $(this.cmpEl).find('button span:nth-child(1)');
this.color = color;
if ( color== 'transparent' ) {
border_color = '#BEBEBE';
clr = color;
span.addClass('color-transparent');
} else {
border_color = 'transparent';
clr = (typeof(color) == 'object') ? '#'+color.color : '#'+color;
span.removeClass('color-transparent');
span.toggleClass('color-transparent', color=='transparent');
span.css({'background-color': (color=='transparent') ? color : ((typeof(color) == 'object') ? '#'+color.color : '#'+color)});
},
getPicker: function(color) {
if (!this.colorPicker) {
this.colorPicker = new Common.UI.ThemeColorPalette({
el: this.cmpEl.find('#' + this.menu.id + '-color-menu'),
transparent: this.options.transparent,
value: color
});
this.colorPicker.on('select', _.bind(this.onColorSelect, this));
this.cmpEl.find('#' + this.menu.id + '-color-new').on('click', _.bind(this.addNewColor, this));
}
span.css({'background-color': clr, 'border-color': border_color});
}
});
return this.colorPicker;
},
getMenu: function(options) {
if (typeof this.menu !== 'object') {
options = options || this.options;
var id = Common.UI.getId(),
menu = new Common.UI.Menu({
id: id,
additionalAlign: options.additionalAlign,
items: (options.additionalItems ? options.additionalItems : []).concat([
{ template: _.template('<div id="' + id + '-color-menu" style="width: 169px; height: 220px; margin: 10px;"></div>') },
{ template: _.template('<a id="' + id + '-color-new" style="padding-left:12px;">' + this.textNewColor + '</a>') }
])
});
return menu;
}
return this.menu;
},
setMenu: function (m) {
m = m || this.getMenu();
Common.UI.Button.prototype.setMenu.call(this, m);
this.getPicker(this.options.color);
},
addNewColor: function() {
this.colorPicker && this.colorPicker.addNewColor((typeof(this.color) == 'object') ? this.color.color : this.color);
},
textNewColor: 'Add New Custom Color'
}, Common.UI.ColorButton || {}));
});

View file

@ -543,7 +543,7 @@ define([
this.checkInvisible(suppress);
} else if ( index >= (this.tabs.length - 1) || index == 'last') {
var tab = this.tabs[this.tabs.length-1].$el;
this.$bar.scrollLeft(this.$bar.scrollLeft() + (tab.position().left + parseInt(tab.css('width')) - this.$bar.width()) + 20);
this.$bar.scrollLeft(this.$bar.scrollLeft() + (tab.position().left + parseInt(tab.css('width')) - this.$bar.width()) + (this.$bar.width() > 400 ? 20 : 5));
this.checkInvisible(suppress);
} else {
var rightbound = this.$bar.width(),
@ -555,7 +555,7 @@ define([
right = tab.position().left + parseInt(tab.css('width'));
if (right > rightbound) {
this.$bar.scrollLeft(this.$bar.scrollLeft() + (right - rightbound) + 20);
this.$bar.scrollLeft(this.$bar.scrollLeft() + (right - rightbound) + (this.$bar.width() > 400 ? 20 : 5));
this.checkInvisible(suppress);
break;
}

View file

@ -201,9 +201,11 @@ define([
});
Common.NotificationCenter.on('document:ready', function () {
var maincontroller = webapp.getController('Main');
if ( maincontroller.api.asc_isReadOnly && maincontroller.api.asc_isReadOnly() ) {
maincontroller.warningDocumentIsLocked();
if ( config.isEdit ) {
var maincontroller = webapp.getController('Main');
if (maincontroller.api.asc_isReadOnly && maincontroller.api.asc_isReadOnly()) {
maincontroller.warningDocumentIsLocked();
}
}
});

View file

@ -830,6 +830,7 @@ Common.Utils.injectButtons = function($slots, id, iconCls, caption, lock, split,
/x-huge/.test(el.className) && (_cls += ' x-huge icon-top');
var button = new Common.UI.Button({
parentEl: $slots.eq(index),
id: id + index,
cls: _cls,
iconCls: iconCls,
@ -839,7 +840,7 @@ Common.Utils.injectButtons = function($slots, id, iconCls, caption, lock, split,
enableToggle: toggle || false,
lock: lock,
disabled: true
}).render( $slots.eq(index) );
});
btnsArr.add(button);
});
@ -852,6 +853,30 @@ Common.Utils.injectComponent = function ($slot, cmp) {
}
};
Common.Utils.warningDocumentIsLocked = function (opts) {
if ( opts.disablefunc )
opts.disablefunc(true);
var app = window.DE || window.PE || window.SSE;
var tip = new Common.UI.SynchronizeTip({
extCls : 'simple',
text : Common.Locale.get("warnFileLocked",{name:"Common.Translation", default:'Document is in use by another application. You can continue editing and save it as a copy.'}),
textLink : Common.Locale.get("txtContinueEditing",{name:app.nameSpace + ".Views.SignatureSettings", default:'Edit anyway'}),
placement : 'document'
});
tip.on({
'dontshowclick': function() {
if ( opts.disablefunc ) opts.disablefunc(false);
app.getController('Main').api.asc_setIsReadOnly(false);
this.close();
},
'closeclick': function() {
this.close();
}
});
tip.show();
};
jQuery.fn.extend({
elementById: function (id, parent) {
/**

View file

@ -109,14 +109,15 @@ define([
var templateTitleBox = '<section id="box-document-title">' +
'<div class="extra"></div>' +
'<div class="hedset">' +
'<div class="hedset" id="header-tools">' +
'<div class="btn-slot" id="slot-btn-dt-save"></div>' +
'<div class="btn-slot" id="slot-btn-dt-print"></div>' +
'<div class="btn-slot" id="slot-btn-dt-undo"></div>' +
'<div class="btn-slot" id="slot-btn-dt-redo"></div>' +
'</div>' +
'<div class="lr-separator"></div>' +
'<input type="text" id="title-doc-name" spellcheck="false" data-can-copy="false" style="pointer-events: none;" disabled="disabled">' +
'<div class="lr-separator">' +
'<input type="text" id="title-doc-name" spellcheck="false" data-can-copy="false" style="pointer-events: none;" disabled="disabled">' +
'</div>' +
'<label id="title-user-name" style="pointer-events: none;"></label>' +
'</section>';
@ -202,7 +203,19 @@ define([
}
}
function onAppShowed(config) {}
function onAppShowed(config) {
if ( this.labelDocName && this.labelDocName.get(0).id == 'title-doc-name'
&& this.labelDocName.is(':visible') )
{
var $tools = this.btnSave.$el.parent('#header-tools');
var _left_width = $tools.prev().outerWidth() + $tools.outerWidth();
var _right_width = this.labelUserName.outerWidth();
if ( _left_width < _right_width )
this.labelDocName.css('padding-left', _right_width - _left_width);
else this.labelDocName.css('padding-right', _left_width - _right_width);
}
}
function onAppReady(mode) {
appConfig = mode;
@ -513,7 +526,7 @@ define([
var $html = $(_.template(templateTitleBox)());
!!me.labelDocName && me.labelDocName.hide().off(); // hide document title if it was created in right box
me.labelDocName = $html.find('> #title-doc-name');
me.labelDocName = $html.find('#title-doc-name');
me.labelDocName.text = function (str) {this.val(str);}; // redefine text function to lock temporaly rename docuemnt option
me.labelDocName.text( me.documentCaption );

View file

@ -119,24 +119,12 @@ define([
});
this.btnColor = new Common.UI.ColorButton({
parentEl: $window.find('#id-dlg-list-color'),
style: "width:53px;",
menu : new Common.UI.Menu({
additionalAlign: this.menuAddAlign,
items: [
{ template: _.template('<div id="id-dlg-list-color-menu" style="width: 169px; height: 220px; margin: 10px;"></div>') },
{ template: _.template('<a id="id-dlg-list-color-new" style="padding-left:12px;">' + this.textNewColor + '</a>') }
]
})
additionalAlign: this.menuAddAlign
});
this.btnColor.on('render:after', function(btn) {
me.colors = new Common.UI.ThemeColorPalette({
el: $('#id-dlg-list-color-menu'),
transparent: false
});
me.colors.on('select', _.bind(me.onColorsSelect, me));
});
this.btnColor.render($window.find('#id-dlg-list-color'));
$('#id-dlg-list-color-new').on('click', _.bind(this.addNewColor, this, this.colors));
this.btnColor.on('color:select', _.bind(this.onColorsSelect, this));
this.colors = this.btnColor.getPicker();
this.spnStart = new Common.UI.MetricSpinner({
el : $window.find('#id-dlg-list-start'),
@ -172,12 +160,7 @@ define([
this.colors.updateColors(Common.Utils.ThemeColor.getEffectColors(), Common.Utils.ThemeColor.getStandartColors());
},
addNewColor: function(picker, btn) {
picker.addNewColor((typeof(btn.color) == 'object') ? btn.color.color : btn.color);
},
onColorsSelect: function(picker, color) {
this.btnColor.setColor(color);
onColorsSelect: function(btn, color) {
if (this._changedProps) {
this._changedProps.asc_putBulletColor(Common.Utils.ThemeColor.getRgbColor(color));
}
@ -271,7 +254,6 @@ define([
txtSize: 'Size',
txtColor: 'Color',
txtOfText: '% of text',
textNewColor: 'Add New Custom Color',
txtStart: 'Start at',
txtBullet: 'Bullet',
tipChange: 'Change bullet'

View file

@ -647,7 +647,8 @@ define([
}
}, this);
this.btnChat && this.btnChat.setDisabled(state);
this.btnCommentRemove && this.btnCommentRemove.setDisabled(state);
this.btnCommentRemove && this.btnCommentRemove.setDisabled(state || !Common.Utils.InternalSettings.get(this.appPrefix + "settings-livecomment"));
},
onLostEditRights: function() {

View file

@ -188,12 +188,12 @@ define([
this.cmbFontSize.setValue(this.font.size);
me.btnBold = new Common.UI.Button({
parentEl: $('#id-dlg-sign-bold'),
cls: 'btn-toolbar',
iconCls: 'btn-bold',
enableToggle: true,
hint: me.textBold
});
me.btnBold.render($('#id-dlg-sign-bold')) ;
me.btnBold.on('click', function(btn, e) {
if (me.signObject) {
me.signObject.setText(me.inputName.getValue(), me.font.name, me.font.size, me.font.italic, btn.pressed);
@ -202,12 +202,12 @@ define([
});
me.btnItalic = new Common.UI.Button({
parentEl: $('#id-dlg-sign-italic'),
cls: 'btn-toolbar',
iconCls: 'btn-italic',
enableToggle: true,
hint: me.textItalic
});
me.btnItalic.render($('#id-dlg-sign-italic')) ;
me.btnItalic.on('click', function(btn, e) {
if (me.signObject) {
me.signObject.setText(me.inputName.getValue(), me.font.name, me.font.size, btn.pressed, me.font.bold);

Binary file not shown.

After

Width:  |  Height:  |  Size: 285 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 466 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 494 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 171 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 335 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 512 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 550 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 395 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 647 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 958 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 178 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 508 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 421 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 396 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 497 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 291 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 283 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 177 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 468 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 492 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 572 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 342 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 264 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 334 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 184 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 277 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 184 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 251 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 344 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 303 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 208 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 584 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 324 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 354 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 319 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 295 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 320 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 302 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 458 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 261 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 286 B

Some files were not shown because too many files have changed in this diff Show more