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 = ''; var res = '';
if (l10n && scope && scope.name) { if (l10n && scope && scope.name) {
res = l10n[scope.name + '.' + prop]; res = l10n[scope.name + '.' + prop];
if ( !res && scope.default )
res = scope.default;
} }
return res || (scope ? eval(scope.name).prototype[prop] : ''); return res || (scope ? eval(scope.name).prototype[prop] : '');

View file

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

View file

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

View file

@ -34,11 +34,12 @@ if (Common === undefined)
var Common = {}; var Common = {};
define([ define([
'common/main/lib/component/Button' 'common/main/lib/component/Button',
'common/main/lib/component/ThemeColorPalette'
], function () { ], function () {
'use strict'; 'use strict';
Common.UI.ColorButton = Common.UI.Button.extend({ Common.UI.ColorButton = Common.UI.Button.extend(_.extend({
options : { options : {
hint: false, hint: false,
enableToggle: false, enableToggle: false,
@ -49,25 +50,85 @@ define([
'<div class="btn-group" id="<%= id %>">', '<div class="btn-group" id="<%= id %>">',
'<button type="button" class="btn btn-color dropdown-toggle <%= cls %>" data-toggle="dropdown" style="<%= style %>">', '<button type="button" class="btn btn-color dropdown-toggle <%= cls %>" data-toggle="dropdown" style="<%= style %>">',
'<span>&nbsp;</span>', '<span>&nbsp;</span>',
'<span class="inner-box-caret"><i class="caret img-commonctrl"></i></span>',
'</button>', '</button>',
'</div>' '</div>'
].join('')), ].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) { setColor: function(color) {
var border_color, clr, var span = $(this.cmpEl).find('button span:nth-child(1)');
span = $(this.cmpEl).find('button span');
this.color = color; this.color = color;
if ( color== 'transparent' ) { span.toggleClass('color-transparent', color=='transparent');
border_color = '#BEBEBE'; span.css({'background-color': (color=='transparent') ? color : ((typeof(color) == 'object') ? '#'+color.color : '#'+color)});
clr = color; },
span.addClass('color-transparent');
} else { getPicker: function(color) {
border_color = 'transparent'; if (!this.colorPicker) {
clr = (typeof(color) == 'object') ? '#'+color.color : '#'+color; this.colorPicker = new Common.UI.ThemeColorPalette({
span.removeClass('color-transparent'); el: this.cmpEl.find('#' + this.menu.id + '-color-menu'),
} transparent: this.options.transparent,
span.css({'background-color': clr, 'border-color': border_color}); value: color
}
}); });
this.colorPicker.on('select', _.bind(this.onColorSelect, this));
this.cmpEl.find('#' + this.menu.id + '-color-new').on('click', _.bind(this.addNewColor, this));
}
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); this.checkInvisible(suppress);
} else if ( index >= (this.tabs.length - 1) || index == 'last') { } else if ( index >= (this.tabs.length - 1) || index == 'last') {
var tab = this.tabs[this.tabs.length-1].$el; 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); this.checkInvisible(suppress);
} else { } else {
var rightbound = this.$bar.width(), var rightbound = this.$bar.width(),
@ -555,7 +555,7 @@ define([
right = tab.position().left + parseInt(tab.css('width')); right = tab.position().left + parseInt(tab.css('width'));
if (right > rightbound) { 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); this.checkInvisible(suppress);
break; break;
} }

View file

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

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'); /x-huge/.test(el.className) && (_cls += ' x-huge icon-top');
var button = new Common.UI.Button({ var button = new Common.UI.Button({
parentEl: $slots.eq(index),
id: id + index, id: id + index,
cls: _cls, cls: _cls,
iconCls: iconCls, iconCls: iconCls,
@ -839,7 +840,7 @@ Common.Utils.injectButtons = function($slots, id, iconCls, caption, lock, split,
enableToggle: toggle || false, enableToggle: toggle || false,
lock: lock, lock: lock,
disabled: true disabled: true
}).render( $slots.eq(index) ); });
btnsArr.add(button); 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({ jQuery.fn.extend({
elementById: function (id, parent) { elementById: function (id, parent) {
/** /**

View file

@ -109,14 +109,15 @@ define([
var templateTitleBox = '<section id="box-document-title">' + var templateTitleBox = '<section id="box-document-title">' +
'<div class="extra"></div>' + '<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-save"></div>' +
'<div class="btn-slot" id="slot-btn-dt-print"></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-undo"></div>' +
'<div class="btn-slot" id="slot-btn-dt-redo"></div>' + '<div class="btn-slot" id="slot-btn-dt-redo"></div>' +
'</div>' + '</div>' +
'<div class="lr-separator"></div>' + '<div class="lr-separator">' +
'<input type="text" id="title-doc-name" spellcheck="false" data-can-copy="false" style="pointer-events: none;" disabled="disabled">' + '<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>' + '<label id="title-user-name" style="pointer-events: none;"></label>' +
'</section>'; '</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) { function onAppReady(mode) {
appConfig = mode; appConfig = mode;
@ -513,7 +526,7 @@ define([
var $html = $(_.template(templateTitleBox)()); var $html = $(_.template(templateTitleBox)());
!!me.labelDocName && me.labelDocName.hide().off(); // hide document title if it was created in right box !!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 = function (str) {this.val(str);}; // redefine text function to lock temporaly rename docuemnt option
me.labelDocName.text( me.documentCaption ); me.labelDocName.text( me.documentCaption );

View file

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

View file

@ -647,7 +647,8 @@ define([
} }
}, this); }, this);
this.btnChat && this.btnChat.setDisabled(state); 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() { onLostEditRights: function() {

View file

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