Merge branch 'develop' into feature/colors-table

# Conflicts:
#	apps/common/main/resources/less/loadmask.less
#	apps/documenteditor/main/app/controller/Main.js
#	apps/documenteditor/main/app/view/FileMenuPanels.js
#	apps/documenteditor/main/resources/less/toolbar.less
#	apps/presentationeditor/main/app/controller/Main.js
#	apps/presentationeditor/main/app/controller/RightMenu.js
#	apps/presentationeditor/main/app/view/FileMenuPanels.js
#	apps/presentationeditor/main/app/view/SlideSettings.js
#	apps/spreadsheeteditor/main/app/controller/Main.js
#	apps/spreadsheeteditor/main/app/view/FileMenuPanels.js
#	apps/spreadsheeteditor/main/resources/less/toolbar.less
This commit is contained in:
Maxim Kadushkin 2021-02-06 13:52:51 +03:00
commit 5b57ee760b
5846 changed files with 82744 additions and 20597 deletions

View file

@ -24,10 +24,8 @@
key: 'key',
vkey: 'vkey',
info: {
author: 'author name', // must be deprecated, use owner instead
owner: 'owner name',
folder: 'path to document',
created: '<creation date>', // must be deprecated, use uploaded instead
uploaded: '<uploaded date>',
sharingSettings: [
{
@ -36,7 +34,8 @@
isLink: false
},
...
]
],
favorite: '<file is favorite>' // true/false/undefined (undefined - don't show fav. button)
},
permissions: {
edit: <can edit>, // default = true
@ -48,7 +47,10 @@
modifyFilter: <can add, remove and save filter in the spreadsheet> // default = true
modifyContentControl: <can modify content controls in documenteditor> // default = true
fillForms: <can edit forms in view mode> // default = edit || review,
copy: <can copy data> // default = true
copy: <can copy data> // default = true,
editCommentAuthorOnly: <can edit your own comments only> // default = false
deleteCommentAuthorOnly: <can delete your own comments only> // default = false,
reviewGroup: ["Group1", ""] // current user can accept/reject review changes made by users from Group1 and users without a group. [] - use groups, but can't change any group's changes
}
},
editorConfig: {
@ -124,6 +126,10 @@
"Group2": ["Group1", "Group2"] // users from Group2 can accept/reject review changes made by users from Group1 and Group2
"Group3": [""] // users from Group3 can accept/reject review changes made by users without a group
},
anonymous: { // set name for anonymous user
request: bool (default: true), // enable set name
label: string (default: "Guest") // postfix for user name
}
chat: true,
comments: true,
zoom: 100,
@ -135,7 +141,7 @@
statusBar: true,
autosave: true,
forcesave: false,
commentAuthorOnly: false,
commentAuthorOnly: false, // must be deprecated. use permissions.editCommentAuthorOnly and permissions.deleteCommentAuthorOnly instead
showReviewChanges: false,
help: true,
compactHeader: false,
@ -332,6 +338,8 @@
if ( msg ) {
if ( msg.type === "onExternalPluginMessage" ) {
_sendCommand(msg);
} else if (msg.type === "onExternalPluginMessageCallback") {
postMessage(window.parent, msg);
} else
if ( msg.frameEditorId == placeholderId ) {
var events = _config.events || {},
@ -388,7 +396,7 @@
if (typeof _config.document.fileType === 'string' && _config.document.fileType != '') {
_config.document.fileType = _config.document.fileType.toLowerCase();
var type = /^(?:(xls|xlsx|ods|csv|xlst|xlsy|gsheet|xlsm|xlt|xltm|xltx|fods|ots)|(pps|ppsx|ppt|pptx|odp|pptt|ppty|gslides|pot|potm|potx|ppsm|pptm|fodp|otp)|(doc|docx|doct|odt|gdoc|txt|rtf|pdf|mht|htm|html|epub|djvu|xps|docm|dot|dotm|dotx|fodt|ott))$/
var type = /^(?:(xls|xlsx|ods|csv|xlst|xlsy|gsheet|xlsm|xlt|xltm|xltx|fods|ots)|(pps|ppsx|ppt|pptx|odp|pptt|ppty|gslides|pot|potm|potx|ppsm|pptm|fodp|otp)|(doc|docx|doct|odt|gdoc|txt|rtf|pdf|mht|htm|html|epub|djvu|xps|docm|dot|dotm|dotx|fodt|ott|fb2))$/
.exec(_config.document.fileType);
if (!type) {
window.alert("The \"document.fileType\" parameter for the config object is invalid. Please correct it.");
@ -636,6 +644,13 @@
});
};
var _setFavorite = function(data) {
_sendCommand({
command: 'setFavorite',
data: data
});
};
var _processMouse = function(evt) {
var r = iframe.getBoundingClientRect();
var data = {
@ -681,7 +696,8 @@
setSharingSettings : _setSharingSettings,
insertImage : _insertImage,
setMailMergeRecipients: _setMailMergeRecipients,
setRevisedFile : _setRevisedFile
setRevisedFile : _setRevisedFile,
setFavorite : _setFavorite
}
};
@ -880,7 +896,7 @@
iframe.allowFullscreen = true;
iframe.setAttribute("allowfullscreen",""); // for IE11
iframe.setAttribute("onmousewheel",""); // for Safari on Mac
iframe.setAttribute("allow", "autoplay");
iframe.setAttribute("allow", "autoplay; camera; microphone; display-capture");
if (config.type == "mobile")
{

View file

@ -122,6 +122,10 @@ if (Common === undefined) {
'setRevisedFile': function(data) {
$me.trigger('setrevisedfile', data);
},
'setFavorite': function(data) {
$me.trigger('setfavorite', data);
}
};

View file

@ -659,7 +659,7 @@ define([
changeIcon: function(opts) {
var me = this;
if ( opts && (opts.curr || opts.next)) {
if ( opts && (opts.curr || opts.next) && me.$icon) {
!!opts.curr && (me.$icon.removeClass(opts.curr));
!!opts.next && !me.$icon.hasClass(opts.next) && (me.$icon.addClass(opts.next));

View file

@ -73,7 +73,7 @@ define([
var me = this;
options.menu = me.getMenu(options);
me.on('render:after', function(btn) {
me.getPicker(options.color);
me.getPicker(options.color, options.colors);
});
}
@ -83,16 +83,22 @@ define([
render: function(parentEl) {
Common.UI.Button.prototype.render.call(this, parentEl);
if (this.options.auto)
this.autocolor = (typeof this.options.auto == 'object') ? this.options.auto.color || '000000' : '000000';
if (this.options.color!==undefined)
this.setColor(this.options.color);
},
onColorSelect: function(picker, color) {
this.setColor(color);
this.setAutoColor(false);
this.trigger('color:select', this, color);
},
setColor: function(color) {
if (color == 'auto' && this.options.auto)
color = this.autocolor;
var span = $(this.cmpEl).find('button span:nth-child(1)');
this.color = color;
@ -100,15 +106,21 @@ define([
span.css({'background-color': (color=='transparent') ? color : ((typeof(color) == 'object') ? '#'+color.color : '#'+color)});
},
getPicker: function(color) {
getPicker: function(color, colors) {
if (!this.colorPicker) {
this.colorPicker = new Common.UI.ThemeColorPalette({
el: this.cmpEl.find('#' + this.menu.id + '-color-menu'),
transparent: this.options.transparent,
value: color
value: color,
colors: colors
});
this.colorPicker.on('select', _.bind(this.onColorSelect, this));
this.cmpEl.find('#' + this.menu.id + '-color-new').on('click', _.bind(this.addNewColor, this));
if (this.options.auto) {
this.cmpEl.find('#' + this.menu.id + '-color-auto').on('click', _.bind(this.onAutoColorSelect, this));
this.colorAuto = this.cmpEl.find('#' + this.menu.id + '-color-auto > a');
(color == 'auto') && this.setAutoColor(true);
}
}
return this.colorPicker;
},
@ -116,13 +128,25 @@ define([
getMenu: function(options) {
if (typeof this.menu !== 'object') {
options = options || this.options;
var id = Common.UI.getId(),
menu = new Common.UI.Menu({
var height = options.paletteHeight || 216,
id = Common.UI.getId(),
auto = [];
if (options.auto) {
this.autocolor = (typeof options.auto == 'object') ? options.auto.color || '000000' : '000000';
auto.push({
id: id + '-color-auto',
caption: (typeof options.auto == 'object') ? options.auto.caption || this.textAutoColor : this.textAutoColor,
template: _.template('<a tabindex="-1" type="menuitem"><span class="menu-item-icon color-auto" style="background-image: none; width: 12px; height: 12px; margin: 1px 7px 0 1px; background-color: #' + this.autocolor + ';"></span><%= caption %></a>')
});
auto.push({caption: '--'});
}
var menu = new Common.UI.Menu({
id: id,
cls: 'shifted-left',
additionalAlign: options.additionalAlign,
items: (options.additionalItems ? options.additionalItems : []).concat([
{ template: _.template('<div id="' + id + '-color-menu" style="width: 169px; height: 220px; margin: 10px;"></div>') },
items: (options.additionalItems ? options.additionalItems : []).concat(auto).concat([
{ template: _.template('<div id="' + id + '-color-menu" style="width: 169px; height:' + height + 'px; margin: 10px;"></div>') },
{ template: _.template('<a id="' + id + '-color-new" style="">' + this.textNewColor + '</a>') }
])
});
@ -134,14 +158,53 @@ define([
setMenu: function (m) {
m = m || this.getMenu();
Common.UI.Button.prototype.setMenu.call(this, m);
this.getPicker(this.options.color);
this.getPicker(this.options.color, this.options.colors);
},
addNewColor: function() {
this.colorPicker && this.colorPicker.addNewColor((typeof(this.color) == 'object') ? this.color.color : this.color);
},
textNewColor: 'Add New Custom Color'
onAutoColorSelect: function() {
this.setColor('auto');
this.setAutoColor(true);
this.colorPicker && this.colorPicker.clearSelection();
this.trigger('auto:select', this, this.autocolor);
},
setAutoColor: function(selected) {
if (!this.colorAuto) return;
if (selected && !this.colorAuto.hasClass('selected'))
this.colorAuto.addClass('selected');
else if (!selected && this.colorAuto.hasClass('selected'))
this.colorAuto.removeClass('selected');
},
isAutoColor: function() {
return this.colorAuto && this.colorAuto.hasClass('selected');
},
textNewColor: 'Add New Custom Color',
textAutoColor: 'Automatic'
}, Common.UI.ColorButton || {}));
Common.UI.ButtonColored = Common.UI.Button.extend(_.extend({
render: function(parentEl) {
Common.UI.Button.prototype.render.call(this, parentEl);
$('button:first-child', this.cmpEl).append( $('<div class="btn-color-value-line"></div>'));
this.colorEl = this.cmpEl.find('.btn-color-value-line');
},
setColor: function(color) {
if (this.colorEl) {
this.colorEl.css({'background-color': (color=='transparent') ? color : ((typeof(color) == 'object') ? '#'+color.color : '#'+color)});
this.colorEl.toggleClass('bordered', color=='transparent');
}
}
}, Common.UI.ButtonColored || {}));
});

View file

@ -305,6 +305,9 @@ define([
if ($list.hasClass('menu-absolute')) {
var offset = this.cmpEl.offset();
$list.css({left: offset.left, top: offset.top + this.cmpEl.outerHeight() + 2});
} else if ($list.hasClass('menu-aligned')) {
var offset = this.cmpEl.offset();
$list.toggleClass('show-top', offset.top + this.cmpEl.outerHeight() + $list.outerHeight() > Common.Utils.innerHeight());
}
},
@ -359,15 +362,15 @@ define([
return false;
}
else if (e.keyCode == Common.UI.Keys.RETURN && (this.editable || this.isMenuOpen())) {
var isopen = this.isMenuOpen();
$(e.target).click();
var me = this;
if (this.rendered) {
if (Common.Utils.isIE)
this._input.trigger('change', { onkeydown: true });
else
this._input.blur();
}
return false;
return !isopen;
}
else if (e.keyCode == Common.UI.Keys.ESC && this.isMenuOpen()) {
this._input.val(this.lastValue);

View file

@ -131,6 +131,8 @@ define([
if ($(e.target).closest('input').length) { // enter in input field
if (this.lastValue !== this._input.val())
this._input.trigger('change');
else
return true;
} else { // enter in dropdown list
$(e.target).click();
if (this.rendered) {
@ -343,10 +345,9 @@ define([
var me = this;
var name = (_.isFunction(font.get_Name) ? font.get_Name() : font.asc_getFontName());
if (this.__name !== name) {
this.__name = name;
if (!this.__nameId) {
this.__nameId = setTimeout(function () {
me.onApiChangeFontInternal(me.__name);
me.onApiChangeFontInternal(name);
me.__nameId = null;
}, 100);
}
@ -356,6 +357,7 @@ define([
onApiChangeFontInternal: function(name) {
if (this.inFormControl) return;
this.__name = name;
if (this.getRawValue() !== name) {
var record = this.store.findWhere({
name: name

View file

@ -200,11 +200,12 @@ define([
allowScrollbar: true,
scrollAlwaysVisible: false,
showLast: true,
useBSKeydown: false
useBSKeydown: false,
cls: ''
},
template: _.template([
'<div class="dataview inner" style="<%= style %>">',
'<div class="dataview inner <%= cls %>" style="<%= style %>">',
'<% _.each(groups, function(group) { %>',
'<% if (group.headername !== undefined) { %>',
'<div class="header-name"><%= group.headername %></div>',
@ -238,6 +239,7 @@ define([
me.useBSKeydown = me.options.useBSKeydown; // only with enableKeyEvents && parentMenu
me.showLast = me.options.showLast;
me.style = me.options.style || '';
me.cls = me.options.cls || '';
me.emptyText = me.options.emptyText || '';
me.listenStoreEvents= (me.options.listenStoreEvents!==undefined) ? me.options.listenStoreEvents : true;
me.allowScrollbar = (me.options.allowScrollbar!==undefined) ? me.options.allowScrollbar : true;
@ -267,7 +269,8 @@ define([
this.setElement(parentEl, false);
this.cmpEl = $(this.template({
groups: me.groups ? me.groups.toJSON() : null,
style: me.style
style: me.style,
cls: me.cls
}));
parentEl.html(this.cmpEl);
@ -275,7 +278,8 @@ define([
this.cmpEl = me.$el || $(this.el);
this.cmpEl.html(this.template({
groups: me.groups ? me.groups.toJSON() : null,
style: me.style
style: me.style,
cls: me.cls
}));
}
@ -454,7 +458,8 @@ define([
$(this.el).html(this.template({
groups: this.groups ? this.groups.toJSON() : null,
style: this.style
style: this.style,
cls: this.cls
}));
if (!_.isUndefined(this.scroller)) {

View file

@ -74,11 +74,11 @@ Common.UI.FocusManager = new(function() {
trapFirst.on('focus', function() {
if (current.hidden) return;
var fields = current.fields;
for (var i=0; i<fields.length; i++) {
for (var i=fields.length-1; i>=0; i--) {
var field = fields[i];
if ((field.cmp.isVisible ? field.cmp.isVisible() : field.cmp.is(':visible')) && !(field.cmp.isDisabled && field.cmp.isDisabled())) {
var el = (field.selector) ? (field.cmp.$el || $(field.cmp.el || field.cmp)).find(field.selector).addBack().filter(field.selector) : field.el;
el.focus();
el && setTimeout(function(){ el.focus(); }, 10);
break;
}
}
@ -89,11 +89,11 @@ Common.UI.FocusManager = new(function() {
trapLast.on('focus', function() {
if (current.hidden) return;
var fields = current.fields;
for (var i=fields.length-1; i>=0; i--) {
for (var i=0; i<fields.length; i++) {
var field = fields[i];
if ((field.cmp.isVisible ? field.cmp.isVisible() : field.cmp.is(':visible')) && !(field.cmp.isDisabled && field.cmp.isDisabled())) {
var el = (field.selector) ? (field.cmp.$el || $(field.cmp.el || field.cmp)).find(field.selector).addBack().filter(field.selector) : field.el;
el.focus();
el && setTimeout(function(){ el.focus(); }, 10);
break;
}
}

View file

@ -358,10 +358,10 @@ define([
return true;
},
showError: function(errors) {
showError: function(errors, isWarning) {
var me = this;
if (!_.isEmpty(errors)) {
me.cmpEl.addClass('error');
me.cmpEl.addClass(isWarning ? 'warning' : 'error');
var errorBadge = me.cmpEl.find('.input-error'),
modalParents = errorBadge.closest('.asc-window'),
@ -380,7 +380,12 @@ define([
}
} else {
me.cmpEl.removeClass('error');
me.cmpEl.removeClass('warning');
}
},
showWarning: function(errors) {
this.showError(errors, true);
}
}
})());

View file

@ -267,7 +267,8 @@ define([
me.dblclick_el = tab;
delete me.dblclick_timer;
},500);
}
} else
me.dblclick_el = tab;
}
}
},

View file

@ -161,11 +161,12 @@ define([
if (e.isDefaultPrevented())
return;
if (e.keyCode === Common.UI.Keys.RETURN)
this._doChange(e);
if (e.keyCode === Common.UI.Keys.RETURN) {
e.stopPropagation();
}
if (e.keyCode == Common.UI.Keys.ESC)
this.setValue(this.value);
if (e.keyCode==Common.UI.Keys.RETURN || e.keyCode==Common.UI.Keys.ESC)
if (e.keyCode==Common.UI.Keys.ESC)
this.trigger('inputleave', this);
},

View file

@ -60,7 +60,7 @@ define([
template :
_.template(
'<div style="padding: 12px;">' +
'<div style="padding: 8px 12px 12px;">' +
'<% var me = this; %>' +
'<% $(colors).each(function(num, item) { %>' +
'<% if (me.isBlankSeparator(item)) { %> <div class="palette-color-spacer" style="width:100%;height:8px;float:left;"></div>' +

View file

@ -606,7 +606,7 @@ define([
if (b.value !== undefined)
newBtns[b.value] = {text: b.caption, cls: 'custom' + ((b.primary || options.primary==b.value) ? ' primary' : '')};
} else {
newBtns[b] = {text: (b=='custom') ? options.customButtonText : arrBtns[b], cls: (options.primary==b) ? 'primary' : ''};
newBtns[b] = {text: (b=='custom') ? options.customButtonText : arrBtns[b], cls: (options.primary==b || _.indexOf(options.primary, b)>-1) ? 'primary' : ''};
if (b=='custom')
newBtns[b].cls += ' custom';
}

View file

@ -169,6 +169,7 @@ define([
}));
} else {
user.set({online: change.asc_getState()});
user.set({username: change.asc_getUserName()});
}
}
},

View file

@ -169,7 +169,6 @@ define([
if (data) {
this.currentUserId = data.config.user.id;
this.currentUserName = data.config.user.fullname;
this.sdkViewName = data['sdkviewname'] || this.sdkViewName;
this.hintmode = data['hintmode'] || false;
this.viewmode = data['viewmode'] || false;
@ -217,7 +216,7 @@ define([
comment.asc_putTime(this.utcDateToString(new Date()));
comment.asc_putOnlyOfficeTime(this.ooDateToString(new Date()));
comment.asc_putUserId(this.currentUserId);
comment.asc_putUserName(this.currentUserName);
comment.asc_putUserName(Common.Utils.UserInfoParser.getCurrentName());
comment.asc_putSolved(false);
if (!_.isUndefined(comment.asc_putDocumentFlag)) {
@ -238,7 +237,7 @@ define([
},
onRemoveComments: function (type) {
if (this.api) {
this.api.asc_RemoveAllComments(type=='my' || !this.mode.canEditComments, type=='current');// 1 param = true if remove only my comments, 2 param - remove current comments
this.api.asc_RemoveAllComments(type=='my' || !this.mode.canDeleteComments, type=='current');// 1 param = true if remove only my comments, 2 param - remove current comments
}
},
onResolveComment: function (uid) {
@ -291,7 +290,7 @@ define([
return false;
},
onShowComment: function (id, selected) {
onShowComment: function (id, selected, fromLeftPanelSelection) {
var comment = this.findComment(id);
if (comment) {
if (null !== comment.get('quote')) {
@ -319,10 +318,12 @@ define([
this.isSelectedComment = selected;
}
if (!fromLeftPanelSelection || !((0 === _.difference(this.uids, [id]).length) && (0 === _.difference([id], this.uids).length))) {
this.api.asc_selectComment(id);
this._dontScrollToComment = true;
this.api.asc_showComment(id,false);
}
}
} else {
if (this.hintmode) {
@ -353,7 +354,7 @@ define([
ascComment.asc_putTime(t.utcDateToString(new Date(comment.get('time'))));
ascComment.asc_putOnlyOfficeTime(t.ooDateToString(new Date(comment.get('time'))));
ascComment.asc_putUserId(t.currentUserId);
ascComment.asc_putUserName(t.currentUserName);
ascComment.asc_putUserName(Common.Utils.UserInfoParser.getCurrentName());
ascComment.asc_putSolved(comment.get('resolved'));
ascComment.asc_putGuid(comment.get('guid'));
ascComment.asc_putUserData(comment.get('userdata'));
@ -430,7 +431,7 @@ define([
if (reply.get('id') === replyId && !_.isUndefined(replyVal)) {
addReply.asc_putText(replyVal);
addReply.asc_putUserId(me.currentUserId);
addReply.asc_putUserName(me.currentUserName);
addReply.asc_putUserName(Common.Utils.UserInfoParser.getCurrentName());
} else {
addReply.asc_putText(reply.get('reply'));
addReply.asc_putUserId(reply.get('userid'));
@ -510,7 +511,7 @@ define([
addReply.asc_putTime(me.utcDateToString(new Date()));
addReply.asc_putOnlyOfficeTime(me.ooDateToString(new Date()));
addReply.asc_putUserId(me.currentUserId);
addReply.asc_putUserName(me.currentUserName);
addReply.asc_putUserName(Common.Utils.UserInfoParser.getCurrentName());
ascComment.asc_addReply(addReply);
@ -775,6 +776,8 @@ define([
comment.set('userdata', data.asc_getUserData());
comment.set('time', date.getTime());
comment.set('date', t.dateToLocaleTimeString(date));
comment.set('editable', t.mode.canEditComments || (data.asc_getUserId() == t.currentUserId));
comment.set('removable', t.mode.canDeleteComments || (data.asc_getUserId() == t.currentUserId));
replies = _.clone(comment.get('replys'));
@ -800,7 +803,8 @@ define([
editTextInPopover : false,
showReplyInPopover : false,
scope : t.view,
editable : t.mode.canEditComments || (data.asc_getReply(i).asc_getUserId() == t.currentUserId)
editable : t.mode.canEditComments || (data.asc_getReply(i).asc_getUserId() == t.currentUserId),
removable : t.mode.canDeleteComments || (data.asc_getReply(i).asc_getUserId() == t.currentUserId)
}));
}
@ -1240,6 +1244,7 @@ define([
hideAddReply : !_.isUndefined(this.hidereply) ? this.hidereply : (this.showPopover ? true : false),
scope : this.view,
editable : this.mode.canEditComments || (data.asc_getUserId() == this.currentUserId),
removable : this.mode.canDeleteComments || (data.asc_getUserId() == this.currentUserId),
hint : !this.mode.canComments,
groupName : (groupname && groupname.length>1) ? groupname[1] : null
});
@ -1276,7 +1281,8 @@ define([
editTextInPopover : false,
showReplyInPopover : false,
scope : this.view,
editable : this.mode.canEditComments || (data.asc_getReply(i).asc_getUserId() == this.currentUserId)
editable : this.mode.canEditComments || (data.asc_getReply(i).asc_getUserId() == this.currentUserId),
removable : this.mode.canDeleteComments || (data.asc_getReply(i).asc_getUserId() == this.currentUserId)
}));
}
}
@ -1306,7 +1312,7 @@ define([
time: date.getTime(),
date: this.dateToLocaleTimeString(date),
userid: this.currentUserId,
username: this.currentUserName,
username: Common.Utils.UserInfoParser.getCurrentName(),
usercolor: (user) ? user.get('color') : null,
editTextInPopover: true,
showReplyInPopover: false,
@ -1370,7 +1376,7 @@ define([
comment.asc_putTime(this.utcDateToString(new Date()));
comment.asc_putOnlyOfficeTime(this.ooDateToString(new Date()));
comment.asc_putUserId(this.currentUserId);
comment.asc_putUserName(this.currentUserName);
comment.asc_putUserName(Common.Utils.UserInfoParser.getCurrentName());
comment.asc_putSolved(false);
if (!_.isUndefined(comment.asc_putDocumentFlag))
@ -1437,7 +1443,7 @@ define([
for (i = 0; i < comments.length; ++i) {
comment = this.findComment(comments[i].asc_getId());
if (comment) {
comment.set('editTextInPopover', t.mode.canEditComments);// dont't edit comment when customization->commentAuthorOnly is true
comment.set('editTextInPopover', t.mode.canEditComments);// dont't edit comment when customization->commentAuthorOnly is true or when permissions.editCommentAuthorOnly is true
comment.set('hint', false);
this.popoverComments.push(comment);
}

View file

@ -139,6 +139,12 @@ define([
Common.Gateway.requestHistoryData(rev); // получаем url-ы для ревизий
}, 10);
} else {
var commentsController = this.getApplication().getController('Common.Controllers.Comments');
if (commentsController) {
commentsController.onApiHideComment();
commentsController.clearCollections();
}
var urlDiff = record.get('urlDiff'),
token = record.get('token'),
hist = new Asc.asc_CVersionHistory();
@ -152,11 +158,6 @@ define([
hist.asc_setServerVersion(this.currentServerVersion);
this.api.asc_showRevision(hist);
var commentsController = this.getApplication().getController('Common.Controllers.Comments');
if (commentsController) {
commentsController.onApiHideComment();
commentsController.clearCollections();
}
var reviewController = this.getApplication().getController('Common.Controllers.ReviewChanges');
if (reviewController)
reviewController.onApiShowChange();
@ -175,6 +176,12 @@ define([
};
Common.UI.alert(config);
} else {
var commentsController = this.getApplication().getController('Common.Controllers.Comments');
if (commentsController) {
commentsController.onApiHideComment();
commentsController.clearCollections();
}
var data = opts.data;
var historyStore = this.getApplication().getCollection('Common.Collections.HistoryVersions');
if (historyStore && data!==null) {
@ -210,11 +217,6 @@ define([
hist.asc_setServerVersion(this.currentServerVersion);
this.api.asc_showRevision(hist);
var commentsController = this.getApplication().getController('Common.Controllers.Comments');
if (commentsController) {
commentsController.onApiHideComment();
commentsController.clearCollections();
}
var reviewController = this.getApplication().getController('Common.Controllers.ReviewChanges');
if (reviewController)
reviewController.onApiShowChange();

View file

@ -246,7 +246,7 @@ define([
if (!btn) return;
var _group = $('> .group', me.$toolbarPanelPlugins);
var $slot = $('<span class="slot"></span>').appendTo(_group);
var $slot = $('<span class="btn-slot text x-huge"></span>').appendTo(_group);
btn.render($slot);
}
},
@ -271,7 +271,7 @@ define([
var btn = me.panelPlugins.createPluginButton(model);
if (btn) {
var $slot = $('<span class="slot"></span>').appendTo(_group);
var $slot = $('<span class="btn-slot text x-huge"></span>').appendTo(_group);
btn.render($slot);
rank_plugins++;
}
@ -644,23 +644,23 @@ define([
arr = [],
plugins = this.configPlugins,
warn = false;
if (plugins.plugins && plugins.plugins.length>0) {
if (plugins.plugins && plugins.plugins.length>0)
arr = plugins.plugins;
var val = plugins.config.autostart || plugins.config.autoStartGuid;
if (typeof (val) == 'string')
val = [val];
warn = !!plugins.config.autoStartGuid;
autostart = val || [];
}
plugins = this.serverPlugins;
if (plugins.plugins && plugins.plugins.length>0) {
if (plugins.plugins && plugins.plugins.length>0)
arr = arr.concat(plugins.plugins);
var val = plugins.config.autostart || plugins.config.autoStartGuid;
val = plugins.config.autostart || plugins.config.autoStartGuid;
if (typeof (val) == 'string')
val = [val];
(warn || plugins.config.autoStartGuid) && console.warn("Obsolete: The autoStartGuid parameter is deprecated. Please check the documentation for new plugin connection configuration.");
autostart = autostart.concat(val || []);
}
this.autostart = autostart;
this.parsePlugins(arr, false);
}

View file

@ -118,16 +118,6 @@ define([
if (data) {
this.currentUserId = data.config.user.id;
if (this.appConfig && this.appConfig.canUseReviewPermissions) {
var permissions = this.appConfig.customization.reviewPermissions,
arr = [],
groups = Common.Utils.UserInfoParser.getParsedGroups(data.config.user.fullname);
groups && groups.forEach(function(group) {
var item = permissions[group.trim()];
item && (arr = arr.concat(item));
});
this.currentUserGroups = arr;
}
this.sdkViewName = data['sdkviewname'] || this.sdkViewName;
}
return this;
@ -482,7 +472,7 @@ define([
checkUserGroups: function(username) {
var groups = Common.Utils.UserInfoParser.getParsedGroups(username);
return this.currentUserGroups && groups && (_.intersection(this.currentUserGroups, (groups.length>0) ? groups : [""]).length>0);
return Common.Utils.UserInfoParser.getCurrentGroups() && groups && (_.intersection(Common.Utils.UserInfoParser.getCurrentGroups(), (groups.length>0) ? groups : [""]).length>0);
},
getUserName: function(id){

View file

@ -79,7 +79,8 @@ define([
hide : false,
hint : false,
dummy : undefined,
editable : true
editable : true,
removable : true
}
});
Common.Models.Reply = Backbone.Model.extend({
@ -96,7 +97,8 @@ define([
editText : false,
editTextInPopover : false,
scope : null,
editable : true
editable : true,
removable : true
}
});
});

View file

@ -25,9 +25,9 @@
</tr>
<tr>
<td style="padding-bottom: 8px;">
<button type="button" class="btn btn-text-default auto" id="auto-correct-btn-reset" style="min-width: 86px;"><%= scope.textResetAll %></button>
<button type="button" class="btn btn-text-default auto" id="auto-correct-btn-delete" style="min-width: 86px;float: right;"><%= scope.textDelete %></button>
<button type="button" class="btn btn-text-default auto" id="auto-correct-btn-edit" style="min-width: 86px;float: right;margin-right:5px;"><%= scope.textAdd %></button>
<button type="button" class="btn btn-text-default auto" id="auto-correct-btn-reset" style="min-width: 80px;"><%= scope.textResetAll %></button>
<button type="button" class="btn btn-text-default auto" id="auto-correct-btn-delete" style="min-width: 80px;float: right;"><%= scope.textDelete %></button>
<button type="button" class="btn btn-text-default auto" id="auto-correct-btn-edit" style="min-width: 80px;float: right;margin-right:5px;"><%= scope.textAdd %></button>
</td>
</tr>
</table>

View file

@ -36,6 +36,8 @@
<div class="btns-reply-ct">
<% if (item.get("editable")) { %>
<div class="btn-edit img-commonctrl" data-value="<%=item.get("id")%>"></div>
<% } %>
<% if (item.get("removable")) { %>
<div class="btn-delete img-commonctrl" data-value="<%=item.get("id")%>"></div>
<% } %>
</div>
@ -67,6 +69,8 @@
<div class="edit-ct">
<% if (editable) { %>
<div class="btn-edit img-commonctrl"></div>
<% } %>
<% if (removable) { %>
<div class="btn-delete img-commonctrl"></div>
<% } %>
<div class="btn-resolve <% if (resolved) print('comment-resolved') %>" data-toggle="tooltip"></div>

View file

@ -36,6 +36,8 @@
<div class="btns-reply-ct">
<% if (item.get("editable")) { %>
<div class="btn-edit img-commonctrl" data-value="<%=item.get("id")%>"></div>
<%}%>
<% if (item.get("removable")) { %>
<div class="btn-delete img-commonctrl" data-value="<%=item.get("id")%>"></div>
<%}%>
</div>
@ -68,6 +70,8 @@
<div class="edit-ct">
<% if (editable) { %>
<div class="btn-edit img-commonctrl"></div>
<% } %>
<% if (removable) { %>
<div class="btn-delete img-commonctrl"></div>
<% } %>
<div class="btn-resolve <% if (resolved) print('comment-resolved') %>" data-toggle="tooltip"></div>

View file

@ -98,12 +98,19 @@ define(['gateway'], function () {
var value = _getItem(name);
defValue = defValue || false;
return (value!==null) ? (parseInt(value) != 0) : defValue;
}
};
var _getItemExists = function (name) {
var value = _getItem(name);
return value !== null;
}
};
var _removeItem = function(name) {
if (_lsAllowed)
localStorage.removeItem(name);
else
delete _store[name];
};
try {
var _lsAllowed = !!window.localStorage;
@ -122,6 +129,7 @@ define(['gateway'], function () {
getBool: _getItemAsBool,
setBool: _setItemAsBool,
setItem: _setItem,
removeItem: _removeItem,
setKeysFilter: function(value) {
_filter = value;
},

View file

@ -430,6 +430,32 @@ define(function(){ 'use strict';
textLineSpark: 'Line',
textColumnSpark: 'Column',
textWinLossSpark: 'Win/Loss',
textCombo: 'Combo',
textBarNormal: 'Clustered column',
textBarStacked: 'Stacked column',
textBarStackedPer: '100% Stacked column',
textBarNormal3d: '3-D Clustered column',
textBarStacked3d: '3-D Stacked column',
textBarStackedPer3d: '3-D 100% Stacked column',
textBarNormal3dPerspective: '3-D column',
textLineStacked: 'Stacked line',
textLineStackedPer: '100% Stacked line',
textLine3d: '3-D line',
textDoughnut: 'Doughnut',
textPie3d: '3-D pie',
textHBarNormal: 'Clustered bar',
textHBarStacked: 'Stacked bar',
textHBarStackedPer: '100% Stacked bar',
textHBarNormal3d: '3-D Clustered bar',
textHBarStacked3d: '3-D Stacked bar',
textHBarStackedPer3d: '3-D 100% Stacked bar',
textAreaStacked: 'Stacked area',
textAreaStackedPer: '100% Stacked area',
textScatter: 'Scatter',
textComboBarLine: 'Clustered column - line',
textComboBarLineSecondary: 'Clustered column - line on secondary axis',
textComboAreaBar: 'Stacked area - clustered column',
textComboCustom: 'Custom combination',
getChartGroupData: function(headername) {
return [
@ -439,38 +465,43 @@ define(function(){ 'use strict';
{id: 'menu-chart-group-hbar', caption: this.textBar},
{id: 'menu-chart-group-area', caption: this.textArea, inline: true},
{id: 'menu-chart-group-scatter', caption: this.textPoint, inline: true},
{id: 'menu-chart-group-stock', caption: this.textStock, inline: true}
{id: 'menu-chart-group-stock', caption: this.textStock, inline: true},
{id: 'menu-chart-group-combo', caption: this.textCombo}
// {id: 'menu-chart-group-surface', caption: this.textSurface}
];
},
getChartData: function() {
return [
{ group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barNormal, iconCls: 'column-normal'},
{ group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barStacked, iconCls: 'column-stack'},
{ group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barStackedPer, iconCls: 'column-pstack'},
{ group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barNormal3d, iconCls: 'column-3d-normal'},
{ group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barStacked3d, iconCls: 'column-3d-stack'},
{ group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barStackedPer3d, iconCls: 'column-3d-pstack'},
{ group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barNormal3dPerspective, iconCls: 'column-3d-normal-per'},
{ group: 'menu-chart-group-line', type: Asc.c_oAscChartTypeSettings.lineNormal, iconCls: 'line-normal'},
{ group: 'menu-chart-group-line', type: Asc.c_oAscChartTypeSettings.lineStacked, iconCls: 'line-stack'},
{ group: 'menu-chart-group-line', type: Asc.c_oAscChartTypeSettings.lineStackedPer, iconCls: 'line-pstack'},
{ group: 'menu-chart-group-line', type: Asc.c_oAscChartTypeSettings.line3d, iconCls: 'line-3d'},
{ group: 'menu-chart-group-pie', type: Asc.c_oAscChartTypeSettings.pie, iconCls: 'pie-normal'},
{ group: 'menu-chart-group-pie', type: Asc.c_oAscChartTypeSettings.doughnut, iconCls: 'pie-doughnut'},
{ group: 'menu-chart-group-pie', type: Asc.c_oAscChartTypeSettings.pie3d, iconCls: 'pie-3d-normal'},
{ group: 'menu-chart-group-hbar', type: Asc.c_oAscChartTypeSettings.hBarNormal, iconCls: 'bar-normal'},
{ group: 'menu-chart-group-hbar', type: Asc.c_oAscChartTypeSettings.hBarStacked, iconCls: 'bar-stack'},
{ group: 'menu-chart-group-hbar', type: Asc.c_oAscChartTypeSettings.hBarStackedPer, iconCls: 'bar-pstack'},
{ group: 'menu-chart-group-hbar', type: Asc.c_oAscChartTypeSettings.hBarNormal3d, iconCls: 'bar-3d-normal'},
{ group: 'menu-chart-group-hbar', type: Asc.c_oAscChartTypeSettings.hBarStacked3d, iconCls: 'bar-3d-stack'},
{ group: 'menu-chart-group-hbar', type: Asc.c_oAscChartTypeSettings.hBarStackedPer3d, iconCls: 'bar-3d-pstack'},
{ group: 'menu-chart-group-area', type: Asc.c_oAscChartTypeSettings.areaNormal, iconCls: 'area-normal'},
{ group: 'menu-chart-group-area', type: Asc.c_oAscChartTypeSettings.areaStacked, iconCls: 'area-stack'},
{ group: 'menu-chart-group-area', type: Asc.c_oAscChartTypeSettings.areaStackedPer, iconCls: 'area-pstack'},
{ group: 'menu-chart-group-scatter', type: Asc.c_oAscChartTypeSettings.scatter, iconCls: 'point-normal'},
{ group: 'menu-chart-group-stock', type: Asc.c_oAscChartTypeSettings.stock, iconCls: 'stock-normal'}
{ group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barNormal, iconCls: 'column-normal', tip: this.textBarNormal},
{ group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barStacked, iconCls: 'column-stack', tip: this.textBarStacked},
{ group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barStackedPer, iconCls: 'column-pstack', tip: this.textBarStackedPer},
{ group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barNormal3d, iconCls: 'column-3d-normal', tip: this.textBarNormal3d, is3d: true},
{ group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barStacked3d, iconCls: 'column-3d-stack', tip: this.textBarStacked3d, is3d: true},
{ group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barStackedPer3d, iconCls: 'column-3d-pstack', tip: this.textBarStackedPer3d, is3d: true},
{ group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barNormal3dPerspective, iconCls: 'column-3d-normal-per', tip: this.textBarNormal3dPerspective, is3d: true},
{ group: 'menu-chart-group-line', type: Asc.c_oAscChartTypeSettings.lineNormal, iconCls: 'line-normal', tip: this.textLine},
{ group: 'menu-chart-group-line', type: Asc.c_oAscChartTypeSettings.lineStacked, iconCls: 'line-stack', tip: this.textLineStacked},
{ group: 'menu-chart-group-line', type: Asc.c_oAscChartTypeSettings.lineStackedPer, iconCls: 'line-pstack', tip: this.textLineStackedPer},
{ group: 'menu-chart-group-line', type: Asc.c_oAscChartTypeSettings.line3d, iconCls: 'line-3d', tip: this.textLine3d, is3d: true},
{ group: 'menu-chart-group-pie', type: Asc.c_oAscChartTypeSettings.pie, iconCls: 'pie-normal', tip: this.textPie},
{ group: 'menu-chart-group-pie', type: Asc.c_oAscChartTypeSettings.doughnut, iconCls: 'pie-doughnut', tip: this.textDoughnut},
{ group: 'menu-chart-group-pie', type: Asc.c_oAscChartTypeSettings.pie3d, iconCls: 'pie-3d-normal', tip: this.textPie3d, is3d: true},
{ group: 'menu-chart-group-hbar', type: Asc.c_oAscChartTypeSettings.hBarNormal, iconCls: 'bar-normal', tip: this.textHBarNormal},
{ group: 'menu-chart-group-hbar', type: Asc.c_oAscChartTypeSettings.hBarStacked, iconCls: 'bar-stack', tip: this.textHBarStacked},
{ group: 'menu-chart-group-hbar', type: Asc.c_oAscChartTypeSettings.hBarStackedPer, iconCls: 'bar-pstack', tip: this.textHBarStackedPer},
{ group: 'menu-chart-group-hbar', type: Asc.c_oAscChartTypeSettings.hBarNormal3d, iconCls: 'bar-3d-normal', tip: this.textHBarNormal3d, is3d: true},
{ group: 'menu-chart-group-hbar', type: Asc.c_oAscChartTypeSettings.hBarStacked3d, iconCls: 'bar-3d-stack', tip: this.textHBarStacked3d, is3d: true},
{ group: 'menu-chart-group-hbar', type: Asc.c_oAscChartTypeSettings.hBarStackedPer3d, iconCls: 'bar-3d-pstack', tip: this.textHBarStackedPer3d, is3d: true},
{ group: 'menu-chart-group-area', type: Asc.c_oAscChartTypeSettings.areaNormal, iconCls: 'area-normal', tip: this.textArea},
{ group: 'menu-chart-group-area', type: Asc.c_oAscChartTypeSettings.areaStacked, iconCls: 'area-stack', tip: this.textAreaStacked},
{ group: 'menu-chart-group-area', type: Asc.c_oAscChartTypeSettings.areaStackedPer, iconCls: 'area-pstack', tip: this.textAreaStackedPer},
{ group: 'menu-chart-group-scatter', type: Asc.c_oAscChartTypeSettings.scatter, iconCls: 'point-normal', tip: this.textScatter},
{ group: 'menu-chart-group-stock', type: Asc.c_oAscChartTypeSettings.stock, iconCls: 'stock-normal', tip: this.textStock},
{ group: 'menu-chart-group-combo', type: Asc.c_oAscChartTypeSettings.comboBarLine, iconCls: 'combo-bar-line', tip: this.textComboBarLine},
{ group: 'menu-chart-group-combo', type: Asc.c_oAscChartTypeSettings.comboBarLineSecondary, iconCls: 'combo-bar-line-sec', tip: this.textComboBarLineSecondary},
{ group: 'menu-chart-group-combo', type: Asc.c_oAscChartTypeSettings.comboAreaBar, iconCls: 'combo-area-bar', tip: this.textComboAreaBar},
{ group: 'menu-chart-group-combo', type: Asc.c_oAscChartTypeSettings.comboCustom, iconCls: 'combo-custom', tip: this.textComboCustom}
// { group: 'menu-chart-group-surface', type: Asc.c_oAscChartTypeSettings.surfaceNormal, iconCls: 'surface-normal'},
// { group: 'menu-chart-group-surface', type: Asc.c_oAscChartTypeSettings.surfaceWireframe, iconCls: 'surface-wireframe'},
// { group: 'menu-chart-group-surface', type: Asc.c_oAscChartTypeSettings.contourNormal, iconCls: 'contour-normal'},

View file

@ -714,6 +714,7 @@ Common.Utils.fillUserInfo = function(info, lang, defname) {
!_user.id && (_user.id = ('uid-' + Date.now()));
_user.fullname = _.isEmpty(_user.name) ? defname : _user.name;
_user.group && (_user.fullname = (_user.group).toString() + Common.Utils.UserInfoParser.getSeparator() + _user.fullname);
_user.guest = _.isEmpty(_user.name);
return _user;
};
@ -879,23 +880,24 @@ Common.Utils.warningDocumentIsLocked = function (opts) {
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() {
Common.UI.warning({
msg: Common.Locale.get("warnFileLocked",{name:"Common.Translation", default: "You can't edit this file. Document is in use by another application."}),
buttons: [{
value: 'view',
caption: Common.Locale.get("warnFileLockedBtnView",{name:"Common.Translation", default: "Open for viewing"})
}, {
value: 'edit',
caption: Common.Locale.get("warnFileLockedBtnEdit",{name:"Common.Translation", default: "Create a copy"})
}],
primary: 'view',
callback: function(btn){
if (btn == 'edit') {
if ( opts.disablefunc ) opts.disablefunc(false);
app.getController('Main').api.asc_setIsReadOnly(false);
this.close();
},
'closeclick': function() {
this.close();
}
}
});
tip.show();
};
jQuery.fn.extend({
@ -966,8 +968,12 @@ Common.Utils.ModalWindow = new(function() {
})();
Common.Utils.UserInfoParser = new(function() {
var parse = false;
var separator = String.fromCharCode(160);
var parse = false,
separator = String.fromCharCode(160),
username = '',
usergroups,
reviewPermissions,
reviewGroups;
return {
setParser: function(value) {
parse = !!value;
@ -993,6 +999,36 @@ Common.Utils.UserInfoParser = new(function() {
return groups;
} else
return undefined;
},
setCurrentName: function(name) {
username = name;
this.setReviewPermissions(reviewGroups, reviewPermissions);
},
getCurrentName: function() {
return username;
},
setReviewPermissions: function(groups, permissions) {
if (groups) {
if (typeof groups == 'object' && groups.length>0)
usergroups = groups;
reviewGroups = groups;
} else if (permissions) {
var arr = [],
arrgroups = this.getParsedGroups(username);
arrgroups && arrgroups.forEach(function(group) {
var item = permissions[group.trim()];
item && (arr = arr.concat(item));
});
usergroups = arr;
reviewPermissions = permissions;
}
},
getCurrentGroups: function() {
return usergroups;
}
}
})();

View file

@ -133,8 +133,8 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
template: _.template(['<div class="listview inner" style=""></div>'].join('')),
itemTemplate: _.template([
'<div id="<%= id %>" class="list-item" style="pointer-events:none;width: 100%;display:flex;">',
'<div style="min-width:110px;padding-right: 5px;<% if (defaultDisabled) { %> font-style:italic; opacity: 0.5;<% } %>"><%= replaced %></div>',
'<div style="flex-grow:1;font-family: Cambria Math;font-size:13px;<% if (defaultDisabled) { %> font-style:italic; opacity: 0.5;<% } %>"><%= by %></div>',
'<div style="width:110px;padding-right: 5px;overflow: hidden;text-overflow: ellipsis;<% if (defaultDisabled) { %> font-style:italic; opacity: 0.5;<% } %>"><%= replaced %></div>',
'<div style="width:230px;overflow: hidden;text-overflow: ellipsis;flex-grow:1;font-family: Cambria Math;font-size:13px;<% if (defaultDisabled) { %> font-style:italic; opacity: 0.5;<% } %>"><%= by %></div>',
'</div>'
].join('')),
scrollAlwaysVisible: true,
@ -146,6 +146,7 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
el : $window.find('#auto-correct-replace'),
allowBlank : true,
validateOnChange : true,
maxLength : 31,
validation : function () { return true; }
}).on ('changing', function (input, value) {
var _selectedItem;
@ -186,6 +187,7 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
el : $window.find('#auto-correct-by'),
allowBlank : true,
validateOnChange : true,
maxLength : 255,
validation : function () { return true; }
}).on ('changing', function (input, value) {
me.updateControls();
@ -216,7 +218,7 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
simpleAddMode: false,
template: _.template(['<div class="listview inner" style=""></div>'].join('')),
itemTemplate: _.template([
'<div id="<%= id %>" class="list-item" style="<% if (defaultDisabled) { %> font-style:italic; opacity: 0.5;<% } %>"><%= value %></div>'
'<div id="<%= id %>" class="list-item" style="width: 340px;text-overflow: ellipsis;overflow: hidden;<% if (defaultDisabled) { %> font-style:italic; opacity: 0.5;<% } %>"><%= value %></div>'
].join('')),
scrollAlwaysVisible: true,
tabindex: 1
@ -227,6 +229,7 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
el : $window.find('#auto-correct-rec-find'),
allowBlank : true,
validateOnChange : true,
maxLength : 255,
validation : function () { return true; }
}).on ('changing', function (input, value) {
var _selectedItem;

View file

@ -283,7 +283,16 @@ define([
} else if (!btn.hasClass('msg-reply') &&
!btn.hasClass('btn-resolve-check') &&
!btn.hasClass('btn-resolve')) {
me.fireEvent('comment:show', [commentId, false]);
var isTextSelected = false;
if (btn.hasClass('user-message')) {
if (window.getSelection) {
var selection = window.getSelection();
isTextSelected = (selection.toString()!=='')
} else if (document.selection) {
isTextSelected = document.selection;
}
}
me.fireEvent('comment:show', [commentId, false, isTextSelected]);
}
}
},

View file

@ -78,7 +78,7 @@ define([
blankError : me.options.error ? me.options.error : me.textLabelError,
style : 'width: 100%;',
validateOnBlur: false,
validation : function(value) {
validation : me.options.validation || function(value) {
return value ? true : '';
}
});

View file

@ -125,6 +125,9 @@ define([
this.spinB.on('change', _.bind(this.showColor, this, null, true)).on('changing', _.bind(this.onChangingRGB, this, 3));
this.textColor.on('change', _.bind(this.onChangeMaskedField, this));
this.textColor.on('changed', _.bind(this.onChangedMaskedField, this));
this.textColor.$el.on('focus', function() {
setTimeout(function(){me.textColor.$el && me.textColor.$el.select();}, 1);
});
this.spinR.$el.find('input').attr('maxlength', 3);
this.spinG.$el.find('input').attr('maxlength', 3);
this.spinB.$el.find('input').attr('maxlength', 3);

View file

@ -98,8 +98,15 @@ define([
'</div>' +
'<div class="hedset">' +
'<div class="btn-slot" id="slot-btn-back"></div>' +
'<div class="btn-slot" id="slot-btn-favorite"></div>' +
'<div class="btn-slot" id="slot-btn-options"></div>' +
'</div>' +
'<div class="hedset">' +
'<div class="btn-slot" id="slot-btn-user-name"></div>' +
'<div class="btn-current-user hidden">' +
'<i class="icon toolbar__icon icon--inverse btn-user"></i>' +
'</div>' +
'</div>' +
'</section>' +
'</section>';
@ -118,7 +125,7 @@ define([
'<div class="lr-separator" id="id-box-doc-name">' +
'<label id="title-doc-name" />' +
'</div>' +
'<label id="title-user-name" style="pointer-events: none;"></label>' +
'<label id="title-user-name"></label>' +
'</section>';
function onResetUsers(collection, opts) {
@ -232,6 +239,14 @@ define([
Common.NotificationCenter.trigger('goback');
});
me.btnFavorite.on('click', function (e) {
// wait for setFavorite method
// me.options.favorite = !me.options.favorite;
// me.btnFavorite.changeIcon(me.options.favorite ? {next: 'btn-in-favorite'} : {curr: 'btn-in-favorite'});
// me.btnFavorite.updateHint(!me.options.favorite ? me.textAddFavorite : me.textRemoveFavorite);
Common.NotificationCenter.trigger('markfavorite', !me.options.favorite);
});
if ( me.logo )
me.logo.children(0).on('click', function (e) {
var _url = !!me.branding && !!me.branding.logo && (me.branding.logo.url!==undefined) ?
@ -273,6 +288,20 @@ define([
$panelUsers[(editingUsers > 1 || editingUsers > 0 && !appConfig.isEdit && !appConfig.isRestrictedEdit || !mode.isOffline && (mode.sharingSettingsUrl && mode.sharingSettingsUrl.length || mode.canRequestSharingSettings)) ? 'show' : 'hide']();
}
if (appConfig.user.guest && appConfig.canRenameAnonymous) {
if (me.labelUserName) {
me.labelUserName.addClass('clickable');
me.labelUserName.on('click', function (e) {
Common.NotificationCenter.trigger('user:rename');
});
} else if (me.btnUserName) {
me.btnUserName.on('click', function (e) {
Common.NotificationCenter.trigger('user:rename');
});
}
}
if ( me.btnPrint ) {
me.btnPrint.updateHint(me.tipPrint + Common.Utils.String.platformKey('Ctrl+P'));
me.btnPrint.on('click', function (e) {
@ -402,6 +431,12 @@ define([
me.mnuZoom = {options: {value: 100}};
me.btnFavorite = new Common.UI.Button({
id: 'btn-favorite',
cls: 'btn-header',
iconCls: 'toolbar__icon icon--inverse btn-favorite'
});
Common.NotificationCenter.on({
'app:ready': function(mode) {Common.Utils.asyncCall(onAppReady, me, mode);},
'app:face': function(mode) {Common.Utils.asyncCall(onAppShowed, me, mode);}
@ -463,6 +498,14 @@ define([
$html.find('#slot-btn-back').hide();
}
if ( this.options.favorite !== undefined && this.options.favorite!==null) {
me.btnFavorite.render($html.find('#slot-btn-favorite'));
me.btnFavorite.changeIcon(!!me.options.favorite ? {next: 'btn-in-favorite'} : {curr: 'btn-in-favorite'});
me.btnFavorite.updateHint(!me.options.favorite ? me.textAddFavorite : me.textRemoveFavorite);
} else {
$html.find('#slot-btn-favorite').hide();
}
if ( !config.isEdit ) {
if ( (config.canDownload || config.canDownloadOrigin) && !config.isOffline )
this.btnDownload = createTitleButton('toolbar__icon icon--inverse btn-download', $html.findById('#slot-hbtn-download'));
@ -475,6 +518,16 @@ define([
}
me.btnOptions.render($html.find('#slot-btn-options'));
if (!config.isEdit || config.customization && !!config.customization.compactHeader) {
if (config.user.guest && config.canRenameAnonymous)
me.btnUserName = createTitleButton('toolbar__icon icon--inverse btn-user', $html.findById('#slot-btn-user-name'));
else {
me.elUserName = $html.find('.btn-current-user');
me.elUserName.removeClass('hidden');
}
me.setUserName(me.options.userName);
}
$userList = $html.find('.cousers-list');
$panelUsers = $html.find('.box-cousers');
$btnUsers = $html.find('.btn-users');
@ -582,6 +635,19 @@ define([
return this.options.canBack;
},
setFavorite: function (value) {
this.options.favorite = value;
this.btnFavorite[value!==undefined && value!==null ? 'show' : 'hide']();
this.btnFavorite.changeIcon(!!value ? {next: 'btn-in-favorite'} : {curr: 'btn-in-favorite'});
this.btnFavorite.updateHint(!value ? this.textAddFavorite : this.textRemoveFavorite);
return this;
},
getFavorite: function () {
return this.options.favorite;
},
setCanRename: function (rename) {
rename = false;
@ -622,6 +688,15 @@ define([
} else this.labelUserName.hide();
} else {
this.options.userName = name;
if ( this.btnUserName ) {
this.btnUserName.updateHint(name);
} else if (this.elUserName) {
this.elUserName.tooltip({
title: name,
placement: 'cursor',
html: true
});
}
}
return this;
@ -691,7 +766,9 @@ define([
textHideLines: 'Hide Rulers',
textZoom: 'Zoom',
textAdvSettings: 'Advanced Settings',
tipViewSettings: 'View Settings'
tipViewSettings: 'View Settings',
textRemoveFavorite: 'Remove from Favorites',
textAddFavorite: 'Mark as favorite'
}
}(), Common.Views.Header || {}))
});

View file

@ -68,6 +68,7 @@ define([
preview : options.preview,
warning : options.warning,
codepages : options.codepages,
warningMsg : options.warningMsg,
width : width,
height : height,
header : true,
@ -85,7 +86,7 @@ define([
'<% if (warning) { %>',
'<div>',
'<div class="icon img-commonctrl warn"></div>',
'<div style="padding-left: 50px;"><div style="font-size: 12px;">' + t.txtProtected+ '</div>',
'<div style="padding-left: 50px;"><div style="font-size: 12px;">' + (typeof _options.warningMsg=='string' ? _options.warningMsg : t.txtProtected) + '</div>',
'<label class="header" style="margin-top: 15px;">' + t.txtPassword + '</label>',
'<div id="id-password-txt" style="width: 290px;"></div></div>',
'</div>',

View file

@ -162,7 +162,7 @@ define([
hint: model.get('name')
});
var $slot = $('<span class="slot"></span>').appendTo(_group);
var $slot = $('<span class="btn-slot text x-huge"></span>').appendTo(_group);
btn.render($slot);
model.set('button', btn);
@ -210,6 +210,7 @@ define([
this.iframePlugin.align = "top";
this.iframePlugin.frameBorder = 0;
this.iframePlugin.scrolling = "no";
this.iframePlugin.allow = "camera; microphone; display-capture";
this.iframePlugin.onload = _.bind(this._onLoad,this);
this.currentPluginFrame.append(this.iframePlugin);
@ -393,6 +394,7 @@ define([
iframe.align = "top";
iframe.frameBorder = 0;
iframe.scrolling = "no";
iframe.allow = "camera; microphone; display-capture";
iframe.onload = _.bind(this._onLoad,this);
var me = this;

View file

@ -457,7 +457,7 @@ define([
if (me.btnCommentRemove) {
var items = [
{
caption: config.canEditComments ? me.txtCommentRemCurrent : me.txtCommentRemMyCurrent,
caption: config.canDeleteComments ? me.txtCommentRemCurrent : me.txtCommentRemMyCurrent,
value: 'current'
},
{
@ -465,7 +465,7 @@ define([
value: 'my'
}
];
if (config.canEditComments)
if (config.canDeleteComments)
items.push({
caption: me.txtCommentRemAll,
value: 'all'

View file

@ -800,14 +800,17 @@ define([
},
getPasteSymbol: function(cellId) {
var bUpdateRecents = cellId[0] === 'c';
var bUpdateRecents = false;
var sFont;
if (cellId && cellId.length>0) {
bUpdateRecents = (cellId[0] === 'c');
if(bUpdateRecents){
sFont = aFontSelects[nCurrentFont].displayValue;
} else {
var nFontId = parseInt(cellId.split('_')[2]);
sFont = aFontSelects[nFontId].displayValue;
}
}
return {font: sFont, symbol: this.encodeSurrogateChar(nCurrentSymbol), code: nCurrentSymbol, updateRecents: bUpdateRecents};
},
@ -831,7 +834,7 @@ define([
}
var special = this.btnSpecial.isActive();
var settings = special ? this.getSpecialSymbol() : this.getPasteSymbol(this.$window.find('.cell-selected').attr('id'));
var settings = (state=='ok') ? (special ? this.getSpecialSymbol() : this.getPasteSymbol(this.$window.find('.cell-selected').attr('id'))) : {};
if (this.options.handler) {
this.options.handler.call(this, this, state, settings);
}

View file

@ -0,0 +1,134 @@
/*
*
* (c) Copyright Ascensio System SIA 2010-2020
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
/**
* UserNameDialog.js
*
* Created by Julia Radzhabova on 09.12.2020
* Copyright (c) 2020 Ascensio System SIA. All rights reserved.
*
*/
define([
'common/main/lib/component/Window',
'common/main/lib/component/InputField'
], function () { 'use strict';
Common.Views.UserNameDialog = Common.UI.Window.extend(_.extend({
options: {
width: 330,
header: false,
modal : false,
cls: 'modal-dlg',
buttons: ['ok', 'cancel']
},
initialize : function(options) {
_.extend(this.options, options || {});
this.template = [
'<div class="box">',
'<div style="margin-bottom: 2px;">' + (this.options.label ? this.options.label : this.textLabel) + '</div>',
'<div id="id-dlg-username-caption" class="input-row"></div>',
'<div id="id-dlg-username-chk-use" class="" style="margin-top: 10px;"></div>',
'</div>'
].join('');
this.options.tpl = _.template(this.template)(this.options);
Common.UI.Window.prototype.initialize.call(this, this.options);
},
render: function() {
Common.UI.Window.prototype.render.call(this);
var me = this;
me.inputLabel = new Common.UI.InputField({
el : $('#id-dlg-username-caption'),
allowBlank : true,
style : 'width: 100%;',
maxLength : 128,
validateOnBlur: false,
validation : me.options.validation || function(value) {
return value ? true : '';
}
});
me.inputLabel.setValue(this.options.value || '' );
me.chDontShow = new Common.UI.CheckBox({
el: $('#id-dlg-username-chk-use'),
labelText: this.textDontShow,
value: this.options.check
});
var $window = this.getChild();
$window.find('.btn').on('click', _.bind(this.onBtnClick, this));
},
show: function() {
Common.UI.Window.prototype.show.apply(this, arguments);
var me = this;
_.delay(function(){
me.getChild('input').focus();
},50);
},
onPrimary: function(event) {
this._handleInput('ok');
return false;
},
onBtnClick: function(event) {
this._handleInput(event.currentTarget.attributes['result'].value);
},
_handleInput: function(state) {
if (this.options.handler) {
if (state == 'ok') {
if (this.inputLabel.checkValidate() !== true) {
this.inputLabel.cmpEl.find('input').focus();
return;
}
}
this.options.handler.call(this, state, {input: this.inputLabel.getValue(), checkbox: this.chDontShow.getValue()=='checked'});
}
this.close();
},
textLabel: 'Label:',
textLabelError: 'Label must not be empty.',
textDontShow: 'Don\'t ask me again'
}, Common.Views.UserNameDialog || {}));
});

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.9 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 521 B

View file

Before

Width:  |  Height:  |  Size: 276 B

After

Width:  |  Height:  |  Size: 276 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 552 B

View file

Before

Width:  |  Height:  |  Size: 118 B

After

Width:  |  Height:  |  Size: 118 B

View file

Before

Width:  |  Height:  |  Size: 118 B

After

Width:  |  Height:  |  Size: 118 B

View file

Before

Width:  |  Height:  |  Size: 118 B

After

Width:  |  Height:  |  Size: 118 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 577 B

View file

Before

Width:  |  Height:  |  Size: 275 B

After

Width:  |  Height:  |  Size: 275 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 748 B

View file

Before

Width:  |  Height:  |  Size: 102 B

After

Width:  |  Height:  |  Size: 102 B

View file

Before

Width:  |  Height:  |  Size: 105 B

After

Width:  |  Height:  |  Size: 105 B

View file

Before

Width:  |  Height:  |  Size: 104 B

After

Width:  |  Height:  |  Size: 104 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 631 B

View file

Before

Width:  |  Height:  |  Size: 367 B

After

Width:  |  Height:  |  Size: 367 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 830 B

View file

Before

Width:  |  Height:  |  Size: 119 B

After

Width:  |  Height:  |  Size: 119 B

View file

Before

Width:  |  Height:  |  Size: 118 B

After

Width:  |  Height:  |  Size: 118 B

View file

Before

Width:  |  Height:  |  Size: 120 B

After

Width:  |  Height:  |  Size: 120 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 429 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 461 B

View file

Before

Width:  |  Height:  |  Size: 246 B

After

Width:  |  Height:  |  Size: 246 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 426 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 462 B

View file

Before

Width:  |  Height:  |  Size: 96 B

After

Width:  |  Height:  |  Size: 96 B

View file

Before

Width:  |  Height:  |  Size: 93 B

After

Width:  |  Height:  |  Size: 93 B

View file

Before

Width:  |  Height:  |  Size: 99 B

After

Width:  |  Height:  |  Size: 99 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 643 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 785 B

View file

Before

Width:  |  Height:  |  Size: 356 B

After

Width:  |  Height:  |  Size: 356 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 637 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1,009 B

View file

Before

Width:  |  Height:  |  Size: 118 B

After

Width:  |  Height:  |  Size: 118 B

View file

Before

Width:  |  Height:  |  Size: 120 B

After

Width:  |  Height:  |  Size: 120 B

View file

Before

Width:  |  Height:  |  Size: 120 B

After

Width:  |  Height:  |  Size: 120 B

View file

@ -109,6 +109,41 @@
<symbol id="chart-stock-normal" viewBox="0 0 40 40">
<path fill-rule="evenodd" clip-rule="evenodd" d="M8 7H7V20.5V34H34V33H8V7ZM23 12H22V16H20V20H22V24H23V20H25V16H23V12ZM13 27H11V20H13V16H14V20H16V27H14V31H13V27ZM31 11H29V18H31V22H32V18H34V11H32V7H31V11Z"/>
</symbol>
<symbol id="chart-combo-bar-line" viewBox="0 0 40 40">
<path opacity="0.4" fill-rule="evenodd" clip-rule="evenodd" d="M20 10H26V34H20V10ZM19 14H13V34H19V14ZM12 26H6V34H12V26ZM33 21H27V34H33V21Z" fill="#444444"/>
<path d="M5 26.5L15.5 16L23.5 24L32.5 15L33.5 16L23.5 26L15.5 18L6 27.5L5 26.5Z" fill="#444444"/>
<path d="M5 5H6V34H35V35H5V20.5V5Z" fill="#444444"/>
</symbol>
<symbol id="chart-combo-bar-line-sec" viewBox="0 0 40 40">
<path opacity="0.4" fill-rule="evenodd" clip-rule="evenodd" d="M20 10H26V34H20V10ZM19 14H13V34H19V14ZM12 26H6V34H12V26ZM33 21H27V34H33V21Z" fill="#444444"/>
<path d="M5 26.5L15.5 16L23.5 24L32.5 15L33.5 16L23.5 26L15.5 18L6 27.5L5 26.5Z" fill="#444444"/>
<path d="M5 5H6V34H35V35H5V20.5V5Z" fill="#444444"/>
<rect x="34" y="32" width="1" height="1" fill="#444444"/>
<rect x="34" y="30" width="1" height="1" fill="#444444"/>
<rect x="34" y="28" width="1" height="1" fill="#444444"/>
<rect x="34" y="26" width="1" height="1" fill="#444444"/>
<rect x="34" y="24" width="1" height="1" fill="#444444"/>
<rect x="34" y="22" width="1" height="1" fill="#444444"/>
<rect x="34" y="20" width="1" height="1" fill="#444444"/>
<rect x="34" y="18" width="1" height="1" fill="#444444"/>
<rect x="34" y="16" width="1" height="1" fill="#444444"/>
<rect x="34" y="14" width="1" height="1" fill="#444444"/>
<rect x="34" y="12" width="1" height="1" fill="#444444"/>
<rect x="34" y="10" width="1" height="1" fill="#444444"/>
<rect x="34" y="8" width="1" height="1" fill="#444444"/>
<rect x="34" y="6" width="1" height="1" fill="#444444"/>
</symbol>
<symbol id="chart-combo-area-bar" viewBox="0 0 40 40">
<path d="M5 5H6V34H35V35H5V20.5V5Z" fill="#444444"/>
<path opacity="0.4" d="M6 20.5L15.5 11L23.5 19L33 9.5V34H6V20.5Z" fill="#444444"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M19 19H13V34H19V19ZM12 27H6V34H12V27ZM20 23H26V34H20V23ZM33 26H27V34H33V26Z" fill="#444444"/>
</symbol>
<symbol id="chart-combo-custom" viewBox="0 0 40 40">
<path opacity="0.4" fill-rule="evenodd" clip-rule="evenodd" d="M26 10H20V34H24V33.5L26 31.5V10ZM33 24.5V21H27V30.5L33 24.5ZM13 14H19V34H13V14ZM6 26H12V34H6V26Z" fill="#444444"/>
<path d="M5 26.5L15.5 16L23.5 24L32.5 15L33.5 16L23.5 26L15.5 18L6 27.5L5 26.5Z" fill="#444444"/>
<path d="M5 5H6V34H24V35H5V20.5V5Z" fill="#444444"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M34 25L37 28L39 26V25L37 23H36L34 25ZM25 37V34L33 26L36 29L28 37H25Z" fill="#444444"/>
</symbol>
<symbol id="chart-spark-line" viewBox="0 0 40 40">
<path fill-rule="evenodd" clip-rule="evenodd" d="M9.86358 21.8725L15.7636 27.7725L20.7636 16.7725L25.682 21.691L31.6394 5.65181L33.5143 6.34819L26.4717 25.309L21.3901 20.2275L16.3901 31.2275L10.2901 25.1275L5.44232 33.5008L3.71148 32.4987L9.86358 21.8725Z"/>
</symbol>

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View file

@ -202,7 +202,7 @@
@common-controls-width: 100px;
.img-commonctrl,
.dropdown-menu li .checked:before, .input-error:before,
.dropdown-menu li .checked:before, .input-error:before, .input-warning:before,
.btn-toolbar .icon.img-commonctrl, .list-item div.checked:before
{
background-image: if(@icon-src-base64, data-uri(%("%s",'@{common-image-path}/@{common-controls}')), ~"url(@{common-image-const-path}/@{common-controls})");

View file

@ -188,7 +188,7 @@
&.x-huge {
@icon-size: 28px;
min-width: 45px;
min-width: 35px;
height: @x-huge-btn-height;
img {
@ -371,6 +371,10 @@
width: 14px;
height: 3px;
background-color: red;
&.bordered {
border: 1px solid @border-regular-control;
}
}
}
@ -598,6 +602,18 @@
}
}
// for color button auto color
.dropdown-menu {
li > a.selected,
li > a:hover {
span.color-auto {
outline: 1px solid #000;
border: 1px solid #fff;
}
}
}
.btn-options {
padding: 0;
margin:0;
@ -882,11 +898,11 @@ svg.icon {
only screen and (min-resolution: 144dpi),
only screen and (min-resolution: 240dpi) {
.@{class100} {
display: none;
//display: none;
}
.@{class150} {
display: block;
//display: block;
}
}

View file

@ -139,6 +139,11 @@
.dropdown-menu.menu-absolute {
position: fixed;
}
.dropdown-menu.show-top {
top: auto;
bottom: 100%;
}
}
.open > .combobox.combo-dataview-menu {

View file

@ -73,4 +73,9 @@
font-weight: bold;
cursor: default;
}
&.bordered {
border: 1px solid @input-border;
.border-radius(@border-radius-small);
}
}

View file

@ -194,6 +194,38 @@
}
}
.btn-current-user {
display: flex;
align-items: center;
height: 100%;
width: 40px;
padding: 0 10px;
.icon {
width: 20px;
height: 20px;
display: inline-block;
background-repeat: no-repeat;
padding: 0;
&.icon--inverse {
background-position-x: -20px;
}
}
svg.icon {
vertical-align: middle;
@media
only screen and (-webkit-min-device-pixel-ratio: 1.5),
only screen and (min-resolution: 1.5dppx),
only screen and (min-resolution: 144dpi) {
width:calc(~"28px/1.5");
height:calc(~"28px/1.5");
}
}
}
.cousers-menu {
position: fixed;
top: @height-tabs - 8px;
@ -399,6 +431,11 @@
height: 100%;
padding: 0 12px;
line-height: @height-title;
pointer-events: none;
&.clickable {
cursor: pointer;
pointer-events: auto;
}
}
.lr-separator {

View file

@ -64,6 +64,18 @@
display: block;
}
}
&.warning {
input:not([disabled]) + .input-error {
display: block;
}
.input-error {
&:before {
background-position: @input-warning-offset-x @input-warning-offset-y;
}
}
}
}
input:required:focus:invalid,

View file

@ -22,8 +22,8 @@
line-height: @loadmask-image-height;
border: none;
background-image: none;
background-color: rgba(0,0,0,.9);
color: @background-toolbar;
background-color: @background-loader;
color: @text-contrast-background;
.border-radius(@border-radius-large);
left: 50%;
@ -107,7 +107,7 @@
}
}
@keyframes slidein {
@keyframes rotation {
from {
transform: rotate(0);
}
@ -119,7 +119,7 @@
#loadmask-spinner {
animation-duration: .8s;
animation-name: slidein;
animation-name: rotation;
animation-iteration-count: infinite;
animation-timing-function: linear;
}

View file

@ -135,10 +135,6 @@
}
}
.slot:not(:first-child) {
margin-left: 2px;
}
.dropdown-menu {
min-width: 100px;
}

View file

@ -199,11 +199,11 @@
display: table-cell;
vertical-align: middle;
white-space: nowrap;
padding-left: 12px;
padding-left: 6px;
font-size: 0;
&:last-child {
padding-right: 12px;
padding-right: 6px;
}
}
@ -217,7 +217,7 @@
}
.separator {
margin-left: 12px;
margin-left: 6px;
&.close {
margin-left: 5px;
@ -241,6 +241,10 @@
width: 31px;
}
&.split-small {
width: 26px;
}
&.text {
width: auto;
}
@ -413,6 +417,16 @@
}
}
.btn-current-user {
.icon--inverse {
background-position-x: 0;
}
svg.icon {
fill: @icon-toolbar-header;
}
}
#rib-doc-name {
color: @text-normal;
}

View file

@ -771,6 +771,10 @@
@input-error-offset-x: -73px;
@input-error-offset-y: -170px;
// Input warning
@input-warning-offset-x: -57px;
@input-warning-offset-y: -170px;
// Spinner
@spinner-offset-x: -41px;
@spinner-offset-y: -187px;

View file

@ -161,21 +161,18 @@
z-index: @zindex-modal - 2;
}
&.alert {
min-height: 90px;
min-width: 230px;
.icon {
float: left;
width: 35px;
height: 35px;
margin: 0 0 0 10px;
&.warn {
width: 35px;
height: 32px;
background-position: @alerts-offset-x @alerts-offset-y - 105px;
}
&.error, &.info, &.confirm {
width: 35px;
height: 35px;
}
&.error {
background-position: @alerts-offset-x @alerts-offset-y - 0;
}
@ -189,6 +186,15 @@
}
}
&.alert {
.icon {
float: left;
margin: 0 0 0 10px;
}
min-height: 90px;
min-width: 230px;
.body {
.info-box {
padding: 20px 20px 20px 10px;

View file

@ -119,7 +119,7 @@ define([
if (mode && mode.canUseReviewPermissions) {
var permissions = mode.customization.reviewPermissions,
arr = [],
groups = Common.Utils.UserInfoParser.getParsedGroups(mode.user.fullname);
groups = Common.Utils.UserInfoParser.getParsedGroups(Common.Utils.UserInfoParser.getCurrentName());
groups && groups.forEach(function(group) {
var item = permissions[group.trim()];
item && (arr = arr.concat(item));
@ -264,14 +264,11 @@ define([
},
getUsersInfo: function() {
var me = this;
var usersArray = [];
_.each(editUsers, function(item){
var name = Common.Utils.UserInfoParser.getParsedName(item.asc_getUserName());
var fio = name.split(' ');
var initials = fio[0].substring(0, 1).toUpperCase();
if (fio.length > 1) {
initials += fio[fio.length - 1].substring(0, 1).toUpperCase();
}
var initials = me.getInitials(name);
if((item.asc_getState()!==false) && !item.asc_getView()) {
var userAttr = {
color: item.asc_getColor(),
@ -411,6 +408,7 @@ define([
}
!suppressEvent && this.initReviewingSettingsView();
DE.getController('Toolbar').setDisplayMode(displayMode);
DE.getController('DocumentHolder').setDisplayMode(displayMode);
},
@ -791,8 +789,11 @@ define([
getInitials: function(name) {
var fio = Common.Utils.UserInfoParser.getParsedName(name).split(' ');
var initials = fio[0].substring(0, 1).toUpperCase();
if (fio.length > 1) {
initials += fio[fio.length - 1].substring(0, 1).toUpperCase();
for (var i=fio.length-1; i>0; i--) {
if (fio[i][0]!=='(' && fio[i][0]!==')') {
initials += fio[i].substring(0, 1).toUpperCase();
break;
}
}
return initials;
},
@ -853,7 +854,7 @@ define([
}
} else {
$('.comment-resolve, .comment-menu, .add-reply, .reply-menu').removeClass('disabled');
if (this.showComments.length > 1) {
if (this.showComments && this.showComments.length > 1) {
$('.prev-comment, .next-comment').removeClass('disabled');
}
}
@ -865,7 +866,7 @@ define([
$('.comment-menu').single('click', _.buffered(this.initMenuComments, 100, this));
$('.reply-menu').single('click', _.buffered(this.initReplyMenu, 100, this));
$('.comment-resolve').single('click', _.bind(this.onClickResolveComment, this, false));
if (this.showComments.length === 1) {
if (this.showComments && this.showComments.length === 1) {
$('.prev-comment, .next-comment').addClass('disabled');
}
},
@ -892,6 +893,7 @@ define([
});
mainView.hideNavbar();
} else {
if (!me.openModal) {
me.modalViewComment = uiApp.popover(
'<div class="popover container-view-comment">' +
'<div class="popover-inner">' +
@ -902,7 +904,7 @@ define([
);
this.picker = $$(me.modalViewComment);
var $overlay = $('.modal-overlay');
me.openModal = true;
$$(this.picker).on('opened', function () {
$overlay.on('removeClass', function () {
if (!$overlay.hasClass('modal-overlay-visible')) {
@ -913,8 +915,10 @@ define([
$overlay.off('removeClass');
$overlay.removeClass('modal-overlay-visible');
$('.popover').remove();
me.openModal = false;
});
}
}
me.getView('Common.Views.Collaboration').renderViewComments(me.showComments, me.indexCurrentComment);
$('.prev-comment').single('click', _.bind(me.onViewPrevComment, me));
$('.next-comment').single('click', _.bind(me.onViewNextComment, me));
@ -923,7 +927,7 @@ define([
$('.reply-menu').single('click', _.buffered(me.initReplyMenu, 100, me));
$('.comment-resolve').single('click', _.bind(me.onClickResolveComment, me, false));
if (me.showComments.length === 1) {
if (me.showComments && me.showComments.length === 1) {
$('.prev-comment, .next-comment').addClass('disabled');
}
@ -1000,7 +1004,7 @@ define([
},
onViewPrevComment: function() {
if (this.showComments.length > 0) {
if (this.showComments && this.showComments.length > 0) {
if (this.indexCurrentComment - 1 < 0) {
this.indexCurrentComment = this.showComments.length - 1;
} else {
@ -1017,7 +1021,7 @@ define([
},
onViewNextComment: function() {
if (this.showComments.length > 0) {
if (this.showComments && this.showComments.length > 0) {
if (this.indexCurrentComment + 1 === this.showComments.length) {
this.indexCurrentComment = 0;
} else {
@ -1140,7 +1144,7 @@ define([
var me = this;
_.delay(function () {
var _menuItems = [];
_menuItems.push({
comment.editable && _menuItems.push({
caption: me.textEdit,
event: 'edit'
});
@ -1161,7 +1165,7 @@ define([
event: 'addreply'
});
}
_menuItems.push({
comment.removable && _menuItems.push({
caption: me.textDeleteComment,
event: 'delete',
color: 'red'
@ -1199,13 +1203,15 @@ define([
if (_.isNumber(idComment)) {
idComment = idComment.toString();
}
_.delay(function () {
var comment = this.findComment(idComment);
var reply = comment && comment.replys ? comment.replys[ind] : null;
reply && _.delay(function () {
var _menuItems = [];
_menuItems.push({
reply.editable && _menuItems.push({
caption: me.textEdit,
event: 'editreply'
});
_menuItems.push({
reply.removable && _menuItems.push({
caption: me.textDeleteReply,
event: 'deletereply',
color: 'red'
@ -1551,7 +1557,8 @@ define([
reply : data.asc_getReply(i).asc_getText(),
time : date.getTime(),
userInitials : this.getInitials(username),
editable : this.appConfig.canEditComments || (data.asc_getReply(i).asc_getUserId() == _userId)
editable : this.appConfig.canEditComments || (data.asc_getReply(i).asc_getUserId() == _userId),
removable : this.appConfig.canDeleteComments || (data.asc_getReply(i).asc_getUserId() == _userId)
});
}
}
@ -1580,7 +1587,8 @@ define([
replys : [],
groupName : (groupname && groupname.length>1) ? groupname[1] : null,
userInitials : this.getInitials(username),
editable : this.appConfig.canEditComments || (data.asc_getUserId() == _userId)
editable : this.appConfig.canEditComments || (data.asc_getUserId() == _userId),
removable : this.appConfig.canDeleteComments || (data.asc_getUserId() == _userId)
};
if (comment) {
var replies = this.readSDKReplies(data);
@ -1616,6 +1624,8 @@ define([
comment.quote = data.asc_getQuoteText();
comment.time = date.getTime();
comment.date = me.dateToLocaleTimeString(date);
comment.editable = me.appConfig.canEditComments || (data.asc_getUserId() == _userId);
comment.removable = me.appConfig.canDeleteComments || (data.asc_getUserId() == _userId);
replies = _.clone(comment.replys);
@ -1640,7 +1650,8 @@ define([
reply : data.asc_getReply(i).asc_getText(),
time : dateReply.getTime(),
userInitials : me.getInitials(username),
editable : me.appConfig.canEditComments || (data.asc_getUserId() == _userId)
editable : me.appConfig.canEditComments || (data.asc_getReply(i).asc_getUserId() == _userId),
removable : me.appConfig.canDeleteComments || (data.asc_getReply(i).asc_getUserId() == _userId)
});
}
comment.replys = replies;

View file

@ -175,7 +175,7 @@ define([
'<div class="item-inner">' +
'<div class="header-comment"><div class="comment-left">';
if (isAndroid) {
template += '<div class="initials-comment" style="background-color: ' + comment.usercolor + ';">' + comment.userInitials + '</div><div>';
template += '<div class="initials-comment" style="background-color: ' + (comment.usercolor ? comment.usercolor : '#cfcfcf') + ';">' + comment.userInitials + '</div><div>';
}
template += '<div class="user-name">' + me.getUserName(comment.username) + '</div>' +
'<div class="comment-date">' + comment.date + '</div>';
@ -183,7 +183,7 @@ define([
template += '</div>';
}
template += '</div>';
if (comment.editable && !me.viewmode) {
if (!me.viewmode) {
template += '<div class="comment-right">' +
'<div class="comment-resolve"><i class="icon icon-resolve-comment' + (comment.resolved ? ' check' : '') + '"></i></div>' +
'<div class="comment-menu"><i class="icon icon-menu-comment"></i></div>' +
@ -200,7 +200,7 @@ define([
'<div class="header-reply">' +
'<div class="reply-left">';
if (isAndroid) {
template += '<div class="initials-reply" style="background-color: ' + reply.usercolor + ';">' + reply.userInitials + '</div><div>'
template += '<div class="initials-reply" style="background-color: ' + (reply.usercolor ? reply.usercolor : '#cfcfcf') + ';">' + reply.userInitials + '</div><div>'
}
template += '<div class="user-name">' + me.getUserName(reply.username) + '</div>' +
'<div class="reply-date">' + reply.date + '</div>' +
@ -208,7 +208,7 @@ define([
if (isAndroid) {
template += '</div>';
}
if (reply.editable && !me.viewmode) {
if ((reply.editable || reply.removable) && !me.viewmode) {
template += '<div class="reply-menu"><i class="icon icon-menu-comment"></i></div>';
}
template += '</div>' +
@ -248,12 +248,12 @@ define([
'<li class="comment item-content" data-uid="<%= item.uid %>">',
'<div class="item-inner">',
'<div class="header-comment"><div class="comment-left">',
'<% if (android) { %><div class="initials-comment" style="background-color:<%= item.usercolor %> "> <%= item.userInitials %></div><div><% } %>',
'<% if (android) { %><div class="initials-comment" style="background-color:<% if (item.usercolor!==null) { %><%=item.usercolor%><% } else { %> #cfcfcf <% } %>;"> <%= item.userInitials %></div><div><% } %>',
'<div class="user-name"><%= scope.getUserName(item.username) %></div>',
'<div class="comment-date"><%= item.date %></div>',
'<% if (android) { %></div><% } %>',
'</div>',
'<% if (item.editable && !viewmode) { %>',
'<% if (!viewmode) { %>',
'<div class="comment-right">',
'<div class="comment-resolve"><i class="icon icon-resolve-comment <% if (item.resolved) { %> check <% } %>"></i></div>',
'<div class="comment-menu"><i class="icon icon-menu-comment"></i></div>',
@ -270,12 +270,12 @@ define([
'<li class="reply-item" data-ind="<%= reply.ind %>">',
'<div class="header-reply">',
'<div class="reply-left">',
'<% if (android) { %><div class="initials-reply" style="background-color: <%= reply.usercolor %>;"><%= reply.userInitials %></div><div><% } %>',
'<% if (android) { %><div class="initials-reply" style="background-color: <% if (reply.usercolor!==null) { %><%=reply.usercolor%><% } else { %> #cfcfcf <% } %>;"><%= reply.userInitials %></div><div><% } %>',
'<div class="user-name"><%= scope.getUserName(reply.username) %></div>',
'<div class="reply-date"><%= reply.date %></div>',
'</div>',
'<% if (android) { %></div><% } %>',
'<% if (reply.editable && !viewmode) { %>',
'<% if ((reply.editable || reply.removable) && !viewmode) { %>',
'<div class="reply-menu"><i class="icon icon-menu-comment"></i></div>',
'<% } %>',
'</div>',
@ -304,7 +304,7 @@ define([
var $pageEdit = $('.page-edit-comment .page-content');
var isAndroid = Framework7.prototype.device.android === true;
var template = '<div class="wrap-comment">' +
(isAndroid ? '<div class="header-comment"><div class="initials-comment" style="background-color: ' + comment.usercolor + ';">' + comment.userInitials + '</div><div>' : '') +
(isAndroid ? '<div class="header-comment"><div class="initials-comment" style="background-color: ' + (comment.usercolor ? comment.usercolor : '#cfcfcf') + ';">' + comment.userInitials + '</div><div>' : '') +
'<div class="user-name">' + this.getUserName(comment.username) + '</div>' +
'<div class="comment-date">' + comment.date + '</div>' +
(isAndroid ? '</div></div>' : '') +
@ -330,7 +330,7 @@ define([
var $pageEdit = $('.page-edit-reply .page-content');
var isAndroid = Framework7.prototype.device.android === true;
var template = '<div class="wrap-comment">' +
(isAndroid ? '<div class="header-comment"><div class="initials-comment" style="background-color: ' + reply.usercolor + ';">' + reply.userInitials + '</div><div>' : '') +
(isAndroid ? '<div class="header-comment"><div class="initials-comment" style="background-color: ' + (reply.usercolor ? reply.usercolor : '#cfcfcf') + ';">' + reply.userInitials + '</div><div>' : '') +
'<div class="user-name">' + this.getUserName(reply.username) + '</div>' +
'<div class="comment-date">' + reply.date + '</div>' +
(isAndroid ? '</div></div>' : '') +
@ -401,7 +401,7 @@ define([
'<div class="page-edit-comment">' +
'<div class="page-content">' +
'<div class="wrap-comment">' +
(isAndroid ? '<div class="header-comment"><div class="initials-comment" style="background-color: ' + comment.usercolor + ';">' + comment.userInitials + '</div><div>' : '') +
(isAndroid ? '<div class="header-comment"><div class="initials-comment" style="background-color: ' + (comment.usercolor ? comment.usercolor : '#cfcfcf') + ';">' + comment.userInitials + '</div><div>' : '') +
'<div class="user-name">' + this.getUserName(comment.username) + '</div>' +
'<div class="comment-date">' + comment.date + '</div>' +
(isAndroid ? '</div></div>' : '') +
@ -427,7 +427,7 @@ define([
'<div class="page add-comment">' +
'<div class="page-content">' +
'<div class="wrap-comment">' +
(isAndroid ? '<div class="header-comment"><div class="initials-comment" style="background-color: ' + reply.usercolor + ';">' + reply.userInitials + '</div><div>' : '') +
(isAndroid ? '<div class="header-comment"><div class="initials-comment" style="background-color: ' + (reply.usercolor ? reply.usercolor : '#cfcfcf') + ';">' + reply.userInitials + '</div><div>' : '') +
'<div class="user-name">' + this.getUserName(reply.username) + '</div>' +
'<div class="comment-date">' + reply.date + '</div>' +
(isAndroid ? '</div></div>' : '') +

View file

@ -1,5 +1,5 @@
{
"common.view.modals.txtCopy": "Másolás a vágólapra",
"common.view.modals.txtCopy": "Másolás vágólapra",
"common.view.modals.txtEmbed": "Beágyazás",
"common.view.modals.txtHeight": "Magasság",
"common.view.modals.txtShare": "Hivatkozás megosztása",
@ -26,5 +26,6 @@
"DE.ApplicationView.txtDownload": "Letöltés",
"DE.ApplicationView.txtEmbed": "Beágyazás",
"DE.ApplicationView.txtFullScreen": "Teljes képernyő",
"DE.ApplicationView.txtPrint": "Nyomtatás",
"DE.ApplicationView.txtShare": "Megosztás"
}

View file

@ -0,0 +1,31 @@
{
"common.view.modals.txtCopy": "ເກັບໄວ້ໃນຄຣິບບອດ",
"common.view.modals.txtEmbed": "ຝັງໄວ້",
"common.view.modals.txtHeight": "ລວງສູງ",
"common.view.modals.txtShare": "ແບ່ງປັນລິ້ງ",
"common.view.modals.txtWidth": "ລວງກວ້າງ",
"DE.ApplicationController.convertationErrorText": " ການປ່ຽນແປງບໍ່ສຳເລັດ.",
"DE.ApplicationController.convertationTimeoutText": "ໝົດເວລາການປ່ຽນແປງ.",
"DE.ApplicationController.criticalErrorTitle": "ຂໍ້ຜິດພາດ",
"DE.ApplicationController.downloadErrorText": "ດາວໂຫຼດບໍ່ສຳເລັດ.",
"DE.ApplicationController.downloadTextText": "ກຳລັງດາວໂຫຼດເອກະສານ",
"DE.ApplicationController.errorAccessDeny": "ທ່ານບໍ່ມີສິດຈະດຳເນີນການອັນນີ້. <br>ກະລຸນະຕິດຕໍ່ຜູ້ຄຸ້ມຄອງລົບຂອງທ່ານ",
"DE.ApplicationController.errorDefaultMessage": "ລະຫັດຂໍ້ຜິດພາດ: %1",
"DE.ApplicationController.errorFilePassProtect": "ມີລະຫັດປົກປ້ອງຟາຍນີ້ຈຶ່ງບໍ່ສາມາດເປີດໄດ້",
"DE.ApplicationController.errorFileSizeExceed": "ຂະໜາດຂອງຟາຍໃຫຍ່ກວ່າທີ່ກຳນົດໄວ້ໃນລະບົບ. <br>ກະລຸນະຕິດຕໍ່ຜູ້ຄຸ້ມຄອງລົບຂອງທ່ານ",
"DE.ApplicationController.errorUpdateVersionOnDisconnect": "ການເຊື່ອຕໍ່ອິນເຕີເນັດຫາກໍ່ກັບມາ, ແລະຟາຍເອກະສານໄດ້ມີການປ່ຽນແປງແລ້ວ. <b>ກ່ອນທີ່ທ່ານຈະດຳເນີການຕໍ່ໄປ, ທ່ານຕ້ອງໄດ້ດາວໂຫຼດຟາຍ ຫຼືສຳເນົາເນື້ອຫາ ເພື່ອປ້ອງການການສູນເສຍ, ແລະກໍ່ທຳການໂຫຼດໜ້າຄືນອີກຄັ້ງ.",
"DE.ApplicationController.errorUserDrop": "ບໍ່ສາມາດເຂົ້າເຖິງຟາຍໄດ້",
"DE.ApplicationController.notcriticalErrorTitle": "ເຕືອນ",
"DE.ApplicationController.scriptLoadError": "ການເຊື່ອມຕໍ່ອິນເຕີເນັດຊ້າເກີນໄປ, ບາງອົງປະກອບບໍ່ສາມາດໂຫຼດໄດ້. ກະລຸນາໂຫຼດໜ້ານີ້ຄືນໃໝ່",
"DE.ApplicationController.textLoadingDocument": "ກຳລັງໂຫຼດເອກະສານ",
"DE.ApplicationController.textOf": "ຂອງ",
"DE.ApplicationController.txtClose": " ປິດ",
"DE.ApplicationController.unknownErrorText": "ມີຂໍ້ຜິດພາດທີ່ບໍ່ຮູ້ສາເຫດ",
"DE.ApplicationController.unsupportedBrowserErrorText": "ບຣາວເຊີຂອງທ່ານບໍ່ສາມານຳໃຊ້ໄດ້",
"DE.ApplicationController.waitText": "ກະລຸນາລໍຖ້າ...",
"DE.ApplicationView.txtDownload": "ດາວໂຫຼດ",
"DE.ApplicationView.txtEmbed": "ຝັງໄວ້",
"DE.ApplicationView.txtFullScreen": "ເຕັມຈໍ",
"DE.ApplicationView.txtPrint": "ພິມ",
"DE.ApplicationView.txtShare": "ແບ່ງປັນ"
}

View file

@ -1,5 +1,6 @@
{
"common.view.modals.txtCopy": "Skopiuj do schowka",
"common.view.modals.txtEmbed": "Osadź",
"common.view.modals.txtHeight": "Wysokość",
"common.view.modals.txtShare": "Udostępnij link",
"common.view.modals.txtWidth": "Szerokość",
@ -23,6 +24,7 @@
"DE.ApplicationController.unsupportedBrowserErrorText": "Twoja przeglądarka nie jest wspierana.",
"DE.ApplicationController.waitText": "Proszę czekać...",
"DE.ApplicationView.txtDownload": "Pobierz",
"DE.ApplicationView.txtEmbed": "Osadź",
"DE.ApplicationView.txtFullScreen": "Pełny ekran",
"DE.ApplicationView.txtPrint": "Drukuj",
"DE.ApplicationView.txtShare": "Udostępnij"

View file

@ -26,5 +26,6 @@
"DE.ApplicationView.txtDownload": "Prenesi",
"DE.ApplicationView.txtEmbed": "Vdelano",
"DE.ApplicationView.txtFullScreen": "Celozaslonski",
"DE.ApplicationView.txtPrint": "Natisni",
"DE.ApplicationView.txtShare": "Deli"
}

View file

@ -13,18 +13,19 @@
"DE.ApplicationController.errorDefaultMessage": "错误代码:%1",
"DE.ApplicationController.errorFilePassProtect": "该文档受密码保护,无法被打开。",
"DE.ApplicationController.errorFileSizeExceed": "文件大小超出了为服务器设置的限制.<br>有关详细信息,请与文档服务器管理员联系。",
"DE.ApplicationController.errorUpdateVersionOnDisconnect": "网连接已还原文件版本已更改。.<br>在继续工作之前,需要下载文件或复制其内容以确保没有丢失任何内容,然后重新加载此页。",
"DE.ApplicationController.errorUpdateVersionOnDisconnect": "网络连接已恢复,文件版本已变更。<br>在继续工作之前,需要下载文件或复制其内容以避免丢失数据,然后刷新此页。",
"DE.ApplicationController.errorUserDrop": "该文件现在无法访问。",
"DE.ApplicationController.notcriticalErrorTitle": "警告",
"DE.ApplicationController.scriptLoadError": "连接速度过慢,部分组件无法被加载。请重新加载页面。",
"DE.ApplicationController.textLoadingDocument": "文件加载中…",
"DE.ApplicationController.textOf": "的",
"DE.ApplicationController.txtClose": "关闭",
"DE.ApplicationController.unknownErrorText": "示知错误",
"DE.ApplicationController.unsupportedBrowserErrorText": "你的浏览器不支持",
"DE.ApplicationController.unknownErrorText": "未知错误。",
"DE.ApplicationController.unsupportedBrowserErrorText": "您的浏览器不受支持",
"DE.ApplicationController.waitText": "请稍候...",
"DE.ApplicationView.txtDownload": "下载",
"DE.ApplicationView.txtEmbed": "嵌入",
"DE.ApplicationView.txtFullScreen": "全屏",
"DE.ApplicationView.txtPrint": "打印",
"DE.ApplicationView.txtShare": "共享"
}

View file

@ -69,7 +69,6 @@ define([
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect',_.bind(this.onCoAuthoringDisconnect, this));
Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this));
this.api.asc_registerCallback('asc_onChangeSpecialFormsGlobalSettings', _.bind(this.onChangeSpecialFormsGlobalSettings, this));
this.api.asc_registerCallback('asc_onSendThemeColors', _.bind(this.onSendThemeColors, this));
Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this));
// this.api.asc_registerCallback('asc_onShowContentControlsActions',_.bind(this.onShowContentControlsActions, this));
@ -90,7 +89,6 @@ define([
'forms:clear': this.onClearClick,
'forms:no-color': this.onNoControlsColor,
'forms:select-color': this.onSelectControlsColor,
'forms:open-color': this.onColorsShow,
'forms:mode': this.onModeClick
}
});
@ -145,36 +143,6 @@ define([
}
},
onSendThemeColors: function() {
this._needUpdateColors = true;
},
updateThemeColors: function() {
var updateColors = function(picker, defaultColorIndex) {
if (picker) {
var clr;
var effectcolors = Common.Utils.ThemeColor.getEffectColors();
for (var i = 0; i < effectcolors.length; i++) {
if (typeof(picker.currentColor) == 'object' &&
clr === undefined &&
picker.currentColor.effectId == effectcolors[i].effectId)
clr = effectcolors[i];
}
picker.updateColors(effectcolors, Common.Utils.ThemeColor.getStandartColors());
if (picker.currentColor === undefined) {
picker.currentColor = effectcolors[defaultColorIndex];
} else if ( clr!==undefined ) {
picker.currentColor = clr;
}
}
};
this.view && this.view.mnuFormsColorPicker && updateColors(this.view.mnuFormsColorPicker, 1);
this.onChangeSpecialFormsGlobalSettings();
},
onChangeSpecialFormsGlobalSettings: function() {
if (this.view && this.view.mnuFormsColorPicker) {
var clr = this.api.asc_GetSpecialFormsHighlightColor(),
@ -186,15 +154,10 @@ define([
this.view.mnuFormsColorPicker.selectByRGB(clr, true);
}
this.view.btnHighlight.currentColor = clr;
$('.btn-color-value-line', this.view.btnHighlight.cmpEl).css('background-color', clr ? '#' + clr : 'transparent');
this.view.btnHighlight.setColor(this.view.btnHighlight.currentColor || 'transparent');
}
},
onColorsShow: function(menu) {
this._needUpdateColors && this.updateThemeColors();
this._needUpdateColors = false;
},
onControlsSelect: function(type) {
if (!(this.toolbar.mode && this.toolbar.mode.canFeatureContentControl)) return;

View file

@ -78,14 +78,15 @@ define([
},
'DocumentHolder': {
'links:contents': this.onTableContents,
'links:update': this.onTableContentsUpdate
'links:update': this.onTableContentsUpdate,
'links:caption': this.onCaptionClick
}
});
},
onLaunch: function () {
this._state = {
prcontrolsdisable:undefined,
in_object: false
in_object: undefined
};
Common.Gateway.on('setactionlink', function (url) {
console.log('url with actions: ' + url);
@ -137,7 +138,8 @@ define([
in_equation = false,
in_image = false,
in_table = false,
frame_pr = null;
frame_pr = null,
object_type;
while (++i < selectedObjects.length) {
type = selectedObjects[i].get_ObjectType();
@ -151,14 +153,17 @@ define([
in_header = true;
} else if (type === Asc.c_oAscTypeSelectElement.Image) {
in_image = true;
object_type = type;
} else if (type === Asc.c_oAscTypeSelectElement.Math) {
in_equation = true;
object_type = type;
} else if (type === Asc.c_oAscTypeSelectElement.Table) {
in_table = true;
object_type = type;
}
}
this._state.prcontrolsdisable = paragraph_locked || header_locked;
this._state.in_object = in_image || in_table || in_equation;
this._state.in_object = object_type;
var control_props = this.api.asc_IsContentControl() ? this.api.asc_GetContentControlProperties() : null,
control_plain = (control_props) ? (control_props.get_ContentControlType()==Asc.c_oAscSdtLevelType.Inline) : false,
@ -325,7 +330,9 @@ define([
})).show();
break;
case 'settings':
var isEndNote = me.api.asc_IsCursorInEndnote();
var isEndNote = me.api.asc_IsCursorInEndnote(),
isFootNote = me.api.asc_IsCursorInFootnote();
isEndNote = (isEndNote || isFootNote) ? isEndNote : Common.Utils.InternalSettings.get("de-settings-note-last") || false;
(new DE.Views.NoteSettingsDialog({
api: me.api,
handler: function (result, settings) {
@ -336,10 +343,14 @@ define([
setTimeout(function() {
settings.isEndNote ? me.api.asc_AddEndnote(settings.custom) : me.api.asc_AddFootnote(settings.custom);
}, 1);
if (result == 'insert' || result == 'apply') {
Common.Utils.InternalSettings.set("de-settings-note-last", settings.isEndNote);
}
}
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
},
isEndNote: isEndNote,
hasSections: me.api.asc_GetSectionsCount()>1,
props: isEndNote ? me.api.asc_GetEndnoteProps() : me.api.asc_GetFootnoteProps()
})).show();
break;
@ -405,7 +416,7 @@ define([
onCaptionClick: function(btn) {
var me = this;
(new DE.Views.CaptionDialog({
isObject: this._state.in_object,
objectType: this._state.in_object,
handler: function (result, settings) {
if (result == 'ok') {
me.api.asc_AddObjectCaption(settings);

View file

@ -49,6 +49,7 @@ define([
'common/main/lib/controller/Fonts',
'common/main/lib/collection/TextArt',
'common/main/lib/view/OpenDialog',
'common/main/lib/view/UserNameDialog',
'common/main/lib/util/LocalStorage',
'documenteditor/main/app/collection/ShapeGroups',
'documenteditor/main/app/collection/EquationGroups'
@ -203,8 +204,11 @@ define([
Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this));
Common.NotificationCenter.on('goback', _.bind(this.goBack, this));
Common.NotificationCenter.on('markfavorite', _.bind(this.markFavorite, this));
Common.NotificationCenter.on('download:advanced', _.bind(this.onAdvancedOptions, this));
Common.NotificationCenter.on('showmessage', _.bind(this.onExternalMessage, this));
Common.NotificationCenter.on('showerror', _.bind(this.onError, this));
this.isShowOpenDialog = false;
@ -339,8 +343,19 @@ define([
loadConfig: function(data) {
this.editorConfig = $.extend(this.editorConfig, data.config);
this.appOptions.customization = this.editorConfig.customization;
this.appOptions.canRenameAnonymous = !((typeof (this.appOptions.customization) == 'object') && (typeof (this.appOptions.customization.anonymous) == 'object') && (this.appOptions.customization.anonymous.request===false));
this.appOptions.guestName = (typeof (this.appOptions.customization) == 'object') && (typeof (this.appOptions.customization.anonymous) == 'object') &&
(typeof (this.appOptions.customization.anonymous.label) == 'string') && this.appOptions.customization.anonymous.label.trim()!=='' ?
Common.Utils.String.htmlEncode(this.appOptions.customization.anonymous.label) : this.textGuest;
var value;
if (this.appOptions.canRenameAnonymous) {
value = Common.localStorage.getItem("guest-username");
Common.Utils.InternalSettings.set("guest-username", value);
Common.Utils.InternalSettings.set("save-guest-username", !!value);
}
this.editorConfig.user =
this.appOptions.user = Common.Utils.fillUserInfo(this.editorConfig.user, this.editorConfig.lang, this.textAnonymous);
this.appOptions.user = Common.Utils.fillUserInfo(this.editorConfig.user, this.editorConfig.lang, value ? (value + ' (' + this.appOptions.guestName + ')' ) : this.textAnonymous);
this.appOptions.isDesktopApp = this.editorConfig.targetApp == 'desktop';
this.appOptions.canCreateNew = this.editorConfig.canRequestCreateNew || !_.isEmpty(this.editorConfig.createUrl);
this.appOptions.canOpenRecent = this.editorConfig.recent !== undefined && !this.appOptions.isDesktopApp;
@ -356,7 +371,6 @@ define([
this.appOptions.saveAsUrl = this.editorConfig.saveAsUrl;
this.appOptions.canAnalytics = false;
this.appOptions.canRequestClose = this.editorConfig.canRequestClose;
this.appOptions.customization = this.editorConfig.customization;
this.appOptions.canBackToFolder = (this.editorConfig.canBackToFolder!==false) && (typeof (this.editorConfig.customization) == 'object') && (typeof (this.editorConfig.customization.goback) == 'object')
&& (!_.isEmpty(this.editorConfig.customization.goback.url) || this.editorConfig.customization.goback.requestClose && this.appOptions.canRequestClose);
this.appOptions.canBack = this.appOptions.canBackToFolder === true;
@ -374,6 +388,8 @@ define([
this.appOptions.canFeatureContentControl = !!this.api.asc_isSupportFeature("content-controls");
this.appOptions.mentionShare = !((typeof (this.appOptions.customization) == 'object') && (this.appOptions.customization.mentionShare==false));
this.appOptions.user.guest && this.appOptions.canRenameAnonymous && Common.NotificationCenter.on('user:rename', _.bind(this.showRenameUserDialog, this));
appHeader = this.getApplication().getController('Viewport').getView('Common.Views.Header');
appHeader.setCanBack(this.appOptions.canBackToFolder === true, (this.appOptions.canBackToFolder) ? this.editorConfig.customization.goback.text : '');
@ -389,7 +405,7 @@ define([
$('#editor-container').append('<div class="doc-placeholder">' + '<div class="line"></div>'.repeat(20) + '</div>');
}
var value = Common.localStorage.getItem("de-macros-mode");
value = Common.localStorage.getItem("de-macros-mode");
if (value === null) {
value = this.editorConfig.customization ? this.editorConfig.customization.macrosMode : 'warn';
value = (value == 'enable') ? 1 : (value == 'disable' ? 2 : 0);
@ -699,6 +715,18 @@ define([
}
},
markFavorite: function(favorite) {
if ( !Common.Controllers.Desktop.process('markfavorite') ) {
Common.Gateway.metaChange({
favorite: favorite
});
}
},
onSetFavorite: function(favorite) {
this.appOptions.canFavorite && appHeader.setFavorite(!!favorite);
},
onEditComplete: function(cmp) {
// this.getMainMenu().closeFullScaleMenu();
var application = this.getApplication(),
@ -1092,6 +1120,8 @@ define([
} else {
documentHolderController.getView().createDelayedElementsViewer();
Common.NotificationCenter.trigger('document:ready', 'main');
if (me.editorConfig.mode !== 'view') // if want to open editor, but viewer is loaded
me.applyLicense();
}
// TODO bug 43960
@ -1108,6 +1138,7 @@ define([
Common.Gateway.on('processmouse', _.bind(me.onProcessMouse, me));
Common.Gateway.on('refreshhistory', _.bind(me.onRefreshHistory, me));
Common.Gateway.on('downloadas', _.bind(me.onDownloadAs, me));
Common.Gateway.on('setfavorite', _.bind(me.onSetFavorite, me));
Common.Gateway.sendInfo({mode:me.appOptions.isEdit?'edit':'view'});
@ -1117,6 +1148,7 @@ define([
$('#editor-container').css('overflow', '');
$('.doc-placeholder').remove();
this.appOptions.user.guest && this.appOptions.canRenameAnonymous && (Common.Utils.InternalSettings.get("guest-username")===null) && this.showRenameUserDialog();
$('#header-logo').children(0).click(e => {
e.stopImmediatePropagation();
@ -1129,7 +1161,8 @@ define([
onLicenseChanged: function(params) {
var licType = params.asc_getLicenseType();
if (licType !== undefined && this.appOptions.canEdit && this.editorConfig.mode !== 'view' &&
(licType===Asc.c_oLicenseResult.Connections || licType===Asc.c_oLicenseResult.UsersCount || licType===Asc.c_oLicenseResult.ConnectionsOS || licType===Asc.c_oLicenseResult.UsersCountOS))
(licType===Asc.c_oLicenseResult.Connections || licType===Asc.c_oLicenseResult.UsersCount || licType===Asc.c_oLicenseResult.ConnectionsOS || licType===Asc.c_oLicenseResult.UsersCountOS
|| licType===Asc.c_oLicenseResult.SuccessLimit && (this.appOptions.trialMode & Asc.c_oLicenseMode.Limited) !== 0))
this._state.licenseType = licType;
if (this._isDocReady)
@ -1141,7 +1174,11 @@ define([
var license = this._state.licenseType,
buttons = ['ok'],
primary = 'ok';
if (license===Asc.c_oLicenseResult.Connections || license===Asc.c_oLicenseResult.UsersCount) {
if ((this.appOptions.trialMode & Asc.c_oLicenseMode.Limited) !== 0 &&
(license===Asc.c_oLicenseResult.SuccessLimit || license===Asc.c_oLicenseResult.ExpiredLimited || this.appOptions.permissionsLicense===Asc.c_oLicenseResult.SuccessLimit)) {
(license===Asc.c_oLicenseResult.ExpiredLimited) && this.getApplication().getController('LeftMenu').leftMenu.setLimitMode();// show limited hint
license = (license===Asc.c_oLicenseResult.ExpiredLimited) ? this.warnLicenseLimitedNoAccess : this.warnLicenseLimitedRenewed;
} else if (license===Asc.c_oLicenseResult.Connections || license===Asc.c_oLicenseResult.UsersCount) {
license = (license===Asc.c_oLicenseResult.Connections) ? this.warnLicenseExceeded : this.warnLicenseUsersExceeded;
} else {
license = (license===Asc.c_oLicenseResult.ConnectionsOS) ? this.warnNoLicense : this.warnNoLicenseUsers;
@ -1149,15 +1186,17 @@ define([
primary = 'buynow';
}
if (this._state.licenseType!==Asc.c_oLicenseResult.SuccessLimit && this.appOptions.isEdit) {
this.disableEditing(true);
Common.NotificationCenter.trigger('api:disconnect');
}
var value = Common.localStorage.getItem("de-license-warning");
value = (value!==null) ? parseInt(value) : 0;
var now = (new Date).getTime();
if (now - value > 86400000) {
Common.UI.info({
width: 500,
maxwidth: 500,
title: this.textNoLicenseTitle,
msg : license,
buttons: buttons,
@ -1204,6 +1243,8 @@ define([
});
return;
}
if (Asc.c_oLicenseResult.ExpiredLimited === licType)
this._state.licenseType = licType;
if ( this.onServerVersion(params.asc_getBuildVersion()) ) return;
@ -1212,6 +1253,7 @@ define([
if (params.asc_getRights() !== Asc.c_oRights.Edit)
this.permissions.edit = this.permissions.review = false;
this.appOptions.permissionsLicense = licType;
this.appOptions.canAnalytics = params.asc_getIsAnalyticsEnable();
this.appOptions.canLicense = (licType === Asc.c_oLicenseResult.Success || licType === Asc.c_oLicenseResult.SuccessLimit);
this.appOptions.isLightVersion = params.asc_getIsLight();
@ -1243,15 +1285,21 @@ define([
this.appOptions.buildVersion = params.asc_getBuildVersion();
this.appOptions.canForcesave = this.appOptions.isEdit && !this.appOptions.isOffline && (typeof (this.editorConfig.customization) == 'object' && !!this.editorConfig.customization.forcesave);
this.appOptions.forcesave = this.appOptions.canForcesave;
this.appOptions.canEditComments= this.appOptions.isOffline || !(typeof (this.editorConfig.customization) == 'object' && this.editorConfig.customization.commentAuthorOnly);
this.appOptions.canEditComments= this.appOptions.isOffline || !this.permissions.editCommentAuthorOnly;
this.appOptions.canDeleteComments= this.appOptions.isOffline || !this.permissions.deleteCommentAuthorOnly;
if ((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.commentAuthorOnly===true) {
console.log("Obsolete: The 'commentAuthorOnly' parameter of the 'customization' section is deprecated. Please use 'editCommentAuthorOnly' and 'deleteCommentAuthorOnly' parameters in the permissions instead.");
if (this.permissions.editCommentAuthorOnly===undefined && this.permissions.deleteCommentAuthorOnly===undefined)
this.appOptions.canEditComments = this.appOptions.canDeleteComments = this.appOptions.isOffline;
}
this.appOptions.trialMode = params.asc_getLicenseMode();
this.appOptions.isBeta = params.asc_getIsBeta();
this.appOptions.isSignatureSupport= this.appOptions.isEdit && this.appOptions.isDesktopApp && this.appOptions.isOffline && this.api.asc_isSignaturesSupport();
this.appOptions.isPasswordSupport = this.appOptions.isEdit && this.appOptions.isDesktopApp && this.appOptions.isOffline && this.api.asc_isProtectionSupport();
this.appOptions.isPasswordSupport = this.appOptions.isEdit && this.api.asc_isProtectionSupport();
this.appOptions.canProtect = (this.appOptions.isSignatureSupport || this.appOptions.isPasswordSupport);
this.appOptions.canEditContentControl = (this.permissions.modifyContentControl!==false);
this.appOptions.canHelp = !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.help===false);
this.appOptions.canFillForms = ((this.permissions.fillForms===undefined) ? this.appOptions.isEdit : this.permissions.fillForms) && (this.editorConfig.mode !== 'view');
this.appOptions.canFillForms = this.appOptions.canLicense && ((this.permissions.fillForms===undefined) ? this.appOptions.isEdit : this.permissions.fillForms) && (this.editorConfig.mode !== 'view');
this.appOptions.isRestrictedEdit = !this.appOptions.isEdit && (this.appOptions.canComments || this.appOptions.canFillForms);
if (this.appOptions.isRestrictedEdit && this.appOptions.canComments && this.appOptions.canFillForms) // must be one restricted mode, priority for filling forms
this.appOptions.canComments = false;
@ -1276,9 +1324,15 @@ define([
if (this.appOptions.canBranding)
appHeader.setBranding(this.editorConfig.customization);
this.appOptions.canUseReviewPermissions = this.appOptions.canLicense && this.editorConfig.customization && this.editorConfig.customization.reviewPermissions && (typeof (this.editorConfig.customization.reviewPermissions) == 'object');
this.appOptions.canFavorite = this.document.info && (this.document.info.favorite!==undefined && this.document.info.favorite!==null) && !this.appOptions.isOffline;
this.appOptions.canFavorite && appHeader.setFavorite(this.document.info.favorite);
this.appOptions.canUseReviewPermissions = this.appOptions.canLicense && (!!this.permissions.reviewGroup ||
this.editorConfig.customization && this.editorConfig.customization.reviewPermissions && (typeof (this.editorConfig.customization.reviewPermissions) == 'object'));
Common.Utils.UserInfoParser.setParser(this.appOptions.canUseReviewPermissions);
appHeader.setUserName(Common.Utils.UserInfoParser.getParsedName(this.appOptions.user.fullname));
Common.Utils.UserInfoParser.setCurrentName(this.appOptions.user.fullname);
this.appOptions.canUseReviewPermissions && Common.Utils.UserInfoParser.setReviewPermissions(this.permissions.reviewGroup, this.editorConfig.customization.reviewPermissions);
appHeader.setUserName(Common.Utils.UserInfoParser.getParsedName(Common.Utils.UserInfoParser.getCurrentName()));
this.appOptions.canRename && appHeader.setCanRename(true);
this.appOptions.canBrandingExt = params.asc_getCanBranding() && (typeof this.editorConfig.customization == 'object' || this.editorConfig.plugins);
@ -1322,6 +1376,7 @@ define([
this.api.asc_registerCallback('asc_onDownloadUrl', _.bind(this.onDownloadUrl, this));
this.api.asc_registerCallback('asc_onAuthParticipantsChanged', _.bind(this.onAuthParticipantsChanged, this));
this.api.asc_registerCallback('asc_onParticipantsChanged', _.bind(this.onAuthParticipantsChanged, this));
this.api.asc_registerCallback('asc_onConnectionStateChanged', _.bind(this.onUserConnection, this));
this.api.asc_registerCallback('asc_onDocumentModifiedChanged', _.bind(this.onDocumentModifiedChanged, this));
},
@ -1442,7 +1497,7 @@ define([
break;
case Asc.c_oAscError.ID.ConvertationSaveError:
config.msg = this.saveErrorText;
config.msg = (this.appOptions.isDesktopApp && this.appOptions.isOffline) ? this.saveErrorTextDesktop : this.saveErrorText;
break;
case Asc.c_oAscError.ID.DownloadError:
@ -1598,6 +1653,14 @@ define([
config.msg = this.errorCompare;
break;
case Asc.c_oAscError.ID.ComboSeriesError:
config.msg = this.errorComboSeries;
break;
case Asc.c_oAscError.ID.Password:
config.msg = this.errorSetPassword;
break;
default:
config.msg = (typeof id == 'string') ? id : this.errorDefaultMessage.replace('%1', id);
break;
@ -2094,7 +2157,8 @@ define([
title: Common.Views.OpenDialog.prototype.txtTitleProtected,
closeFile: me.appOptions.canRequestClose,
type: Common.Utils.importTextType.DRM,
warning: !(me.appOptions.isDesktopApp && me.appOptions.isOffline),
warning: !(me.appOptions.isDesktopApp && me.appOptions.isOffline) && (typeof advOptions == 'string'),
warningMsg: advOptions,
validatePwd: !!me._state.isDRM,
handler: function (result, value) {
me.isShowOpenDialog = false;
@ -2155,6 +2219,25 @@ define([
this._state.usersCount = length;
},
onUserConnection: function(change){
if (change && this.appOptions.user.guest && this.appOptions.canRenameAnonymous && (change.asc_getIdOriginal() == this.appOptions.user.id)) { // change name of the current user
var name = change.asc_getUserName();
if (name && name !== Common.Utils.UserInfoParser.getCurrentName() ) {
this._renameDialog && this._renameDialog.close();
Common.Utils.UserInfoParser.setCurrentName(name);
appHeader.setUserName(Common.Utils.UserInfoParser.getParsedName(name));
var idx1 = name.lastIndexOf('('),
idx2 = name.lastIndexOf(')'),
str = (idx1>0) && (idx1<idx2) ? name.substring(0, idx1-1) : '';
if (Common.localStorage.getItem("guest-username")!==null) {
Common.localStorage.setItem("guest-username", str);
}
Common.Utils.InternalSettings.set("guest-username", str);
}
}
},
applySettings: function() {
if (this.appOptions.isEdit && !this.appOptions.isOffline && this.appOptions.canCoAuthoring) {
var oldval = this._state.fastCoauth;
@ -2353,6 +2436,40 @@ define([
me.api.asc_SetAutoCorrectHyphensWithDash(value);
},
showRenameUserDialog: function() {
if (this._renameDialog) return;
var me = this;
this._renameDialog = new Common.Views.UserNameDialog({
label: this.textRenameLabel,
error: this.textRenameError,
value: Common.Utils.InternalSettings.get("guest-username") || '',
check: Common.Utils.InternalSettings.get("save-guest-username") || false,
validation: function(value) {
return value.length<128 ? true : me.textLongName;
},
handler: function(result, settings) {
if (result == 'ok') {
var name = settings.input ? settings.input + ' (' + me.appOptions.guestName + ')' : me.textAnonymous;
var _user = new Asc.asc_CUserInfo();
_user.put_FullName(name);
var docInfo = new Asc.asc_CDocInfo();
docInfo.put_UserInfo(_user);
me.api.asc_changeDocInfo(docInfo);
settings.checkbox ? Common.localStorage.setItem("guest-username", settings.input) : Common.localStorage.removeItem("guest-username");
Common.Utils.InternalSettings.set("guest-username", settings.input);
Common.Utils.InternalSettings.set("save-guest-username", settings.checkbox);
}
}
});
this._renameDialog.on('close', function() {
me._renameDialog = undefined;
});
this._renameDialog.show(Common.Utils.innerWidth() - this._renameDialog.options.width - 15, 30);
},
leavePageText: 'You have unsaved changes in this document. Click \'Stay on this Page\' then \'Save\' to save them. Click \'Leave this Page\' to discard all the unsaved changes.',
criticalErrorTitle: 'Error',
notcriticalErrorTitle: 'Warning',
@ -2706,7 +2823,16 @@ define([
txtEnterDate: 'Enter a date.',
txtTypeEquation: 'Type equation here.',
textHasMacros: 'The file contains automatic macros.<br>Do you want to run macros?',
textRemember: 'Remember my choice'
textRemember: 'Remember my choice',
warnLicenseLimitedRenewed: 'License needs to be renewed.<br>You have a limited access to document editing functionality.<br>Please contact your administrator to get full access',
warnLicenseLimitedNoAccess: 'License expired.<br>You have no access to document editing functionality.<br>Please contact your administrator.',
saveErrorTextDesktop: 'This file cannot be saved or created.<br>Possible reasons are: <br>1. The file is read-only. <br>2. The file is being edited by other users. <br>3. The disk is full or corrupted.',
errorComboSeries: 'To create a combination chart, select at least two series of data.',
errorSetPassword: 'Password could not be set.',
textRenameLabel: 'Enter a name to be used for collaboration',
textRenameError: 'User name must not be empty.',
textLongName: 'Enter a name that is less than 128 characters.',
textGuest: 'Guest'
}
})(), DE.Controllers.Main || {}))
});

View file

@ -139,6 +139,7 @@ define([
_.each(me.toolbar.btnImgWrapping.menu.items, function(item) {
item.setDisabled(notflow);
});
me.toolbar.btnImgWrapping.menu.items[8].setDisabled(!me.api.CanChangeWrapPolygon());
var control_props = me.api.asc_IsContentControl() ? this.api.asc_GetContentControlProperties() : null,
lock_type = (control_props) ? control_props.get_Lock() : Asc.c_oAscSdtLockType.Unlocked,
@ -210,6 +211,12 @@ define([
},
onClickMenuWrapping: function (menu, item, e) {
if (item.options.wrapType=='edit') {
this.api.StartChangeWrapPolygon();
this.toolbar.fireEvent('editcomplete', this.toolbar);
return;
}
var props = new Asc.asc_CImgProperty();
props.put_WrappingStyle(item.options.wrapType);

View file

@ -53,12 +53,15 @@ define([
initialize: function() {
this.editMode = true;
this._initSettings = true;
this.addListeners({
'RightMenu': {
'rightmenuclick': this.onRightMenuClick
}
});
Common.Utils.InternalSettings.set("de-rightpanel-active-form", 1);
},
onLaunch: function() {
@ -94,8 +97,29 @@ define([
this.editMode = mode.isEdit;
},
onRightMenuClick: function(menu, type, minimized) {
onRightMenuClick: function(menu, type, minimized, event) {
if (!minimized && this.editMode) {
if (event) { // user click event
if (!this._settings[Common.Utils.documentSettingsType.Form].hidden) {
if (type == Common.Utils.documentSettingsType.Form) {
if (!this._settings[Common.Utils.documentSettingsType.Paragraph].hidden)
Common.Utils.InternalSettings.set("de-rightpanel-active-para", 0);
if (!this._settings[Common.Utils.documentSettingsType.Image].hidden)
Common.Utils.InternalSettings.set("de-rightpanel-active-image", 0);
if (!this._settings[Common.Utils.documentSettingsType.Shape].hidden)
Common.Utils.InternalSettings.set("de-rightpanel-active-shape", 0);
} else if (type == Common.Utils.documentSettingsType.Paragraph) {
Common.Utils.InternalSettings.set("de-rightpanel-active-para", 2);
} else if (type == Common.Utils.documentSettingsType.Image) {
Common.Utils.InternalSettings.set("de-rightpanel-active-image", 2);
Common.Utils.InternalSettings.set("de-rightpanel-active-shape", 0);
} else if (type == Common.Utils.documentSettingsType.Shape) {
Common.Utils.InternalSettings.set("de-rightpanel-active-shape", 2);
Common.Utils.InternalSettings.set("de-rightpanel-active-image", 0);
}
}
}
var panel = this._settings[type].panel;
var props = this._settings[type].props;
if (props && panel)
@ -107,10 +131,13 @@ define([
this.rightmenu.fireEvent('editcomplete', this.rightmenu);
},
onFocusObject: function(SelectedObjects, open) {
onFocusObject: function(SelectedObjects) {
if (!this.editMode)
return;
var open = this._initSettings ? !Common.localStorage.getBool("de-hide-right-settings", this.rightmenu.defaultHideRightMenu) : false;
this._initSettings = false;
var can_add_table = false,
in_equation = false,
needhide = true;
@ -170,7 +197,7 @@ define([
this._settings[Common.Utils.documentSettingsType.Signature].locked = value.get_Locked();
}
if (control_props && control_props.get_FormPr()) {
if (control_props && control_props.get_FormPr() && this.rightmenu.formSettings) {
var spectype = control_props.get_SpecificType();
if (spectype==Asc.c_oAscContentControlSpecificType.CheckBox || spectype==Asc.c_oAscContentControlSpecificType.Picture ||
spectype==Asc.c_oAscContentControlSpecificType.ComboBox || spectype==Asc.c_oAscContentControlSpecificType.DropDownList || spectype==Asc.c_oAscContentControlSpecificType.None) {
@ -219,6 +246,26 @@ define([
if (!this.rightmenu.minimizedMode || open) {
var active;
if (priorityactive<0 && !this._settings[Common.Utils.documentSettingsType.Form].hidden &&
(!this._settings[Common.Utils.documentSettingsType.Paragraph].hidden || !this._settings[Common.Utils.documentSettingsType.Image].hidden
|| !this._settings[Common.Utils.documentSettingsType.Shape].hidden)) {
var imageactive = Common.Utils.InternalSettings.get("de-rightpanel-active-image") || 0,
shapeactive = Common.Utils.InternalSettings.get("de-rightpanel-active-shape") || 0,
paraactive = Common.Utils.InternalSettings.get("de-rightpanel-active-para") || 0,
formactive = Common.Utils.InternalSettings.get("de-rightpanel-active-form") || 0;
if (!this._settings[Common.Utils.documentSettingsType.Paragraph].hidden) {
priorityactive = (formactive>paraactive) ? Common.Utils.documentSettingsType.Form : Common.Utils.documentSettingsType.Paragraph;
} else if (!this._settings[Common.Utils.documentSettingsType.Paragraph].Image || !this._settings[Common.Utils.documentSettingsType.Shape].hidden) {
if (formactive>shapeactive && formactive>imageactive)
priorityactive = Common.Utils.documentSettingsType.Form;
else if (shapeactive>formactive && shapeactive>imageactive)
priorityactive = Common.Utils.documentSettingsType.Shape;
else
priorityactive = Common.Utils.documentSettingsType.Image;
}
}
if (priorityactive>-1) active = priorityactive;
else if (lastactive>=0 && currentactive<0) active = lastactive;
else if (currentactive>=0) active = currentactive;
@ -274,7 +321,6 @@ define([
this.rightmenu.tableSettings.UpdateThemeColors();
this.rightmenu.shapeSettings.UpdateThemeColors();
this.rightmenu.textartSettings.UpdateThemeColors();
this.rightmenu.formSettings && this.rightmenu.formSettings.UpdateThemeColors();
},
updateMetricUnit: function() {
@ -302,7 +348,7 @@ define([
// this.rightmenu.shapeSettings.createDelayedElements();
var selectedElements = this.api.getSelectedElements();
if (selectedElements.length>0) {
this.onFocusObject(selectedElements, !Common.localStorage.getBool("de-hide-right-settings", this.rightmenu.defaultHideRightMenu));
this.onFocusObject(selectedElements);
}
}
},
@ -362,7 +408,7 @@ define([
SetDisabled: function(disabled, allowMerge, allowSignature) {
this.setMode({isEdit: !disabled});
if (this.rightmenu) {
if (this.rightmenu && this.rightmenu.paragraphSettings) {
this.rightmenu.paragraphSettings.disableControls(disabled);
this.rightmenu.shapeSettings.disableControls(disabled);
this.rightmenu.textartSettings.disableControls(disabled);

View file

@ -260,6 +260,7 @@ define([
toolbar.btnPaste.on('click', _.bind(this.onCopyPaste, this, false));
toolbar.btnIncFontSize.on('click', _.bind(this.onIncrease, this));
toolbar.btnDecFontSize.on('click', _.bind(this.onDecrease, this));
toolbar.mnuChangeCase.on('item:click', _.bind(this.onChangeCase, this));
toolbar.btnBold.on('click', _.bind(this.onBold, this));
toolbar.btnItalic.on('click', _.bind(this.onItalic, this));
toolbar.btnUnderline.on('click', _.bind(this.onUnderline, this));
@ -1015,13 +1016,13 @@ define([
onChangeSdtGlobalSettings: function() {
var show = this.api.asc_GetGlobalContentControlShowHighlight();
this.toolbar.mnuNoControlsColor.setChecked(!show, true);
this.toolbar.mnuControlsColorPicker.clearSelection();
this.toolbar.mnuNoControlsColor && this.toolbar.mnuNoControlsColor.setChecked(!show, true);
this.toolbar.mnuControlsColorPicker && this.toolbar.mnuControlsColorPicker.clearSelection();
if (show){
var clr = this.api.asc_GetGlobalContentControlHighlightColor();
if (clr) {
clr = Common.Utils.ThemeColor.getHexColor(clr.get_r(), clr.get_g(), clr.get_b());
this.toolbar.mnuControlsColorPicker.selectByRGB(clr, true);
this.toolbar.mnuControlsColorPicker && this.toolbar.mnuControlsColorPicker.selectByRGB(clr, true);
}
}
},
@ -1321,8 +1322,8 @@ define([
}
} else {
value = Common.Utils.String.parseFloat(record.value);
value = value > 100
? 100
value = value > 300
? 300
: value < 1
? 1
: Math.floor((value+0.4)*2)/2;
@ -1337,6 +1338,12 @@ define([
}
},
onChangeCase: function(menu, item, e) {
if (this.api)
this.api.asc_ChangeTextCase(item.value);
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
},
onSelectBullets: function(btn, picker, itemView, record) {
var rawData = {},
isPickerSelect = _.isFunction(record.toJSON);
@ -1699,6 +1706,7 @@ define([
if (this.api && item.checked) {
var props = new Asc.CSectionLnNumType();
props.put_Restart(item.value==1 ? Asc.c_oAscLineNumberRestartType.Continuous : (item.value==2 ? Asc.c_oAscLineNumberRestartType.NewPage : Asc.c_oAscLineNumberRestartType.NewSection));
!!this.api.asc_GetLineNumbersProps() && props.put_CountBy(undefined);
this.api.asc_SetLineNumbersProps(Asc.c_oAscSectionApplyType.Current, props);
}
break;
@ -2049,11 +2057,12 @@ define([
}
if (chart) {
var props = new Asc.asc_CImgProperty();
var isCombo = (type==Asc.c_oAscChartTypeSettings.comboBarLine || type==Asc.c_oAscChartTypeSettings.comboBarLineSecondary ||
type==Asc.c_oAscChartTypeSettings.comboAreaBar || type==Asc.c_oAscChartTypeSettings.comboCustom);
if (isCombo && chart.getSeries().length<2) {
Common.NotificationCenter.trigger('showerror', Asc.c_oAscError.ID.ComboSeriesError, Asc.c_oAscError.Level.NoCritical);
} else
chart.changeType(type);
props.put_ChartProperties(chart);
this.api.ImgApply(props);
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
} else {
var controller = this.getApplication().getController('Common.Controllers.ExternalDiagramEditor');
@ -2373,7 +2382,7 @@ define([
this.api.put_TextColor(color);
this.toolbar.btnFontColor.currentColor = {color: color, isAuto: true};
$('.btn-color-value-line', this.toolbar.btnFontColor.cmpEl).css('background-color', '#000');
this.toolbar.btnFontColor.setColor('000');
this.toolbar.mnuFontColorPicker.clearSelection();
this.toolbar.mnuFontColorPicker.currentColor = {color: color, isAuto: true};
@ -2390,10 +2399,8 @@ define([
onSelectFontColor: function(picker, color) {
this._state.clrtext = this._state.clrtext_asccolor = undefined;
var clr = (typeof(color) == 'object') ? (color.isAuto ? '#000' : color.color) : color;
this.toolbar.btnFontColor.currentColor = color;
$('.btn-color-value-line', this.toolbar.btnFontColor.cmpEl).css('background-color', '#' + clr);
this.toolbar.btnFontColor.setColor((typeof(color) == 'object') ? (color.isAuto ? '000' : color.color) : color);
this.toolbar.mnuFontColorPicker.currentColor = color;
if (this.api)
@ -2405,10 +2412,8 @@ define([
onParagraphColorPickerSelect: function(picker, color) {
this._state.clrback = this._state.clrshd_asccolor = undefined;
var clr = (typeof(color) == 'object') ? color.color : color;
this.toolbar.btnParagraphColor.currentColor = color;
$('.btn-color-value-line', this.toolbar.btnParagraphColor.cmpEl).css('background-color', color!='transparent'?'#'+clr:clr);
this.toolbar.btnParagraphColor.setColor(color);
this.toolbar.mnuParagraphColorPicker.currentColor = color;
if (this.api) {
@ -2444,7 +2449,7 @@ define([
this._setMarkerColor('transparent', 'menu');
item.setChecked(true, true);
this.toolbar.btnHighlightColor.currentColor = 'transparent';
$('.btn-color-value-line', this.toolbar.btnHighlightColor.cmpEl).css('background-color', 'transparent');
this.toolbar.btnHighlightColor.setColor(this.toolbar.btnHighlightColor.currentColor);
},
onParagraphColor: function(shd) {
@ -2846,7 +2851,7 @@ define([
updateColors(this.toolbar.mnuFontColorPicker, 1);
if (this.toolbar.btnFontColor.currentColor===undefined || !this.toolbar.btnFontColor.currentColor.isAuto) {
this.toolbar.btnFontColor.currentColor = this.toolbar.mnuFontColorPicker.currentColor.color || this.toolbar.mnuFontColorPicker.currentColor;
$('.btn-color-value-line', this.toolbar.btnFontColor.cmpEl).css('background-color', '#' + this.toolbar.btnFontColor.currentColor);
this.toolbar.btnFontColor.setColor(this.toolbar.btnFontColor.currentColor);
}
if (this._state.clrtext_asccolor!==undefined) {
this._state.clrtext = undefined;
@ -2856,15 +2861,12 @@ define([
updateColors(this.toolbar.mnuParagraphColorPicker, 0);
this.toolbar.btnParagraphColor.currentColor = this.toolbar.mnuParagraphColorPicker.currentColor.color || this.toolbar.mnuParagraphColorPicker.currentColor;
$('.btn-color-value-line', this.toolbar.btnParagraphColor.cmpEl).css('background-color', '#' + this.toolbar.btnParagraphColor.currentColor);
this.toolbar.btnParagraphColor.setColor(this.toolbar.btnParagraphColor.currentColor);
if (this._state.clrshd_asccolor!==undefined) {
this._state.clrback = undefined;
this.onParagraphColor(this._state.clrshd_asccolor);
}
this._state.clrshd_asccolor = undefined;
updateColors(this.toolbar.mnuControlsColorPicker, 1);
this.onChangeSdtGlobalSettings();
},
_onInitEditorStyles: function(styles) {
@ -2917,8 +2919,7 @@ define([
me.toolbar.mnuHighlightTransparent.setChecked(false);
me.toolbar.btnHighlightColor.currentColor = strcolor;
$('.btn-color-value-line', me.toolbar.btnHighlightColor.cmpEl).css('background-color', '#' + strcolor);
me.toolbar.btnHighlightColor.setColor(me.toolbar.btnHighlightColor.currentColor);
me.toolbar.btnHighlightColor.toggle(true, true);
}
@ -3065,8 +3066,10 @@ define([
var tab = {action: 'review', caption: me.toolbar.textTabCollaboration};
var $panel = me.application.getController('Common.Controllers.ReviewChanges').createToolbarPanel();
if ( $panel )
if ( $panel ) {
me.toolbar.addTab(tab, $panel, 5);
me.toolbar.setVisible('review', config.isEdit || config.canViewReview || config.canCoAuthoring && config.canComments);
}
if ( config.isEdit ) {
me.toolbar.setMode(config);
@ -3105,6 +3108,7 @@ define([
me.toolbar.addTab(tab, $panel, 4);
me.toolbar.setVisible('forms', true);
Array.prototype.push.apply(me.toolbar.toolbarControls, forms.getView('FormsTab').getButtons());
me.onChangeSdtGlobalSettings();
}
}
},

View file

@ -42,7 +42,7 @@
<div id="chart-button-type" style=""></div>
</td>
</tr>
<tr>
<tr class="not-combined">
<td class="padding-small" colspan=2>
<div class="" id="chart-combo-style" style="width: 100%;"></div>
</td>
@ -54,7 +54,7 @@
</tr>
<tr>
<td class="padding-small" colspan=2>
<button type="button" class="btn btn-text-default" id="chart-button-edit-data" style="width:115px;"><%= scope.textEditData %></button>
<button type="button" class="btn btn-text-default auto" id="chart-button-edit-data" style="min-width:115px;"><%= scope.textEditData %></button>
</td>
</tr>
<tr>

View file

@ -79,7 +79,7 @@
</tr>
<tr style="vertical-align: top;">
<td class="padding-large">
<div id="form-list-list" style="height: 95px;margin-right: 5px;background-color: #fff;"></div>
<div id="form-list-list" style="width:162px; height: 95px;margin-right: 5px;background-color: #fff;"></div>
</td>
<td class="padding-large">
<div id="form-list-delete" style="margin-bottom: 5px;margin-left: 5px;"></div>

View file

@ -32,6 +32,39 @@
<div id="paragraph-checkbox-add-interval"></div>
</td>
</tr>
<tr>
<td class="padding-small" colspan=2>
<div class="separator horizontal"></div>
</td>
</tr>
<tr>
<td colspan=2>
<label class="header"><%= scope.strIndent %></label>
</td>
</tr>
<tr>
<td class="padding-small" width="50%">
<label class="input-label"><%= scope.strIndentsLeftText %></label>
<div id="paragraph-spin-indent-left"></div>
</td>
<td class="padding-small" width="50%">
<label class="input-label"><%= scope.strIndentsRightText %></label>
<div id="paragraph-spin-indent-right"></div>
</td>
</tr>
<tr>
<td colspan=2>
<label class="input-label"><%= scope.strIndentsSpecial %></label>
</td>
</tr>
<tr>
<td class="padding-small" width="50%">
<div id="paragraph-combo-special" style="width: 85px;"></div>
</td>
<td class="padding-small" width="50%">
<div id="paragraph-spin-special-by"></div>
</td>
</tr>
<tr class="text-only">
<td class="padding-small" colspan=2>
<div class="separator horizontal"></div>

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