Merge branch release/v6.3.0 into master

This commit is contained in:
papacarlo 2021-05-20 12:07:27 +00:00
commit ce6e4fe985
3276 changed files with 26652 additions and 12153 deletions

View file

@ -12,4 +12,7 @@ jobs:
- name: Build using grunt
run: |
npm install --prefix build
cd ..
git clone --branch=develop --depth=1 https://github.com/ONLYOFFICE/sdkjs.git
cd web-apps
grunt --level=ADVANCED --base build --gruntfile build/Gruntfile.js

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,
reviewGroups: ["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,
@ -149,7 +155,8 @@
macros: true // can run macros in document
plugins: true // can run plugins in document
macrosMode: 'warn' // warn about automatic macros, 'enable', 'disable', 'warn',
trackChanges: undefined // true/false - open editor with track changes mode on/off
trackChanges: undefined // true/false - open editor with track changes mode on/off,
hideRulers: false, // hide or show rulers on first loading (presentation or document editor)
},
plugins: {
autostart: ['asc.{FFE1F462-1EA2-4391-990D-4CC84940B754}'],
@ -390,7 +397,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|fb2))$/
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|xml))$/
.exec(_config.document.fileType);
if (!type) {
window.alert("The \"document.fileType\" parameter for the config object is invalid. Please correct it.");
@ -417,6 +424,11 @@
return false;
}
if (_config.editorConfig.user && _config.editorConfig.user.id && (typeof _config.editorConfig.user.id == 'number')) {
_config.editorConfig.user.id = _config.editorConfig.user.id.toString();
console.warn("The \"id\" parameter for the editorConfig.user object must be a string.");
}
_config.document.token = _config.token;
}
@ -638,6 +650,13 @@
});
};
var _setFavorite = function(data) {
_sendCommand({
command: 'setFavorite',
data: data
});
};
var _processMouse = function(evt) {
var r = iframe.getBoundingClientRect();
var data = {
@ -683,7 +702,8 @@
setSharingSettings : _setSharingSettings,
insertImage : _insertImage,
setMailMergeRecipients: _setMailMergeRecipients,
setRevisedFile : _setRevisedFile
setRevisedFile : _setRevisedFile,
setFavorite : _setFavorite
}
};
@ -860,10 +880,15 @@
if (config.editorConfig && config.editorConfig.customization && (config.editorConfig.customization.toolbar===false))
params += "&toolbar=false";
else if (config.document && config.document.permissions && (config.document.permissions.edit === false && config.document.permissions.fillForms ))
params += "&toolbar=true";
if (config.parentOrigin)
params += "&parentOrigin=" + config.parentOrigin;
if (config.editorConfig && config.editorConfig.customization && config.editorConfig.customization.uiTheme )
params += "&uitheme=" + config.editorConfig.customization.uiTheme;
return params;
}

View file

@ -102,6 +102,10 @@
return {
customization : {
goback: { url: "onlyoffice.com" }
, feedback: {
url: "https://helpdesk.onlyoffice.com/?desktop=true"
}
, uiTheme: urlParams["uitheme"]
},
mode : urlParams["mode"] || 'edit',
lang : urlParams["lang"] || 'en',

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

@ -211,7 +211,7 @@ define([
'</div>' +
'<div class="inner-box-caption">' +
'<span class="caption"><%= caption %></span>' +
'<i class="caret img-commonctrl"></i>' +
'<i class="caret"></i>' +
'</div>' +
'</button>' +
'</div>';
@ -226,7 +226,7 @@ define([
'<button type="button" class="btn <%= cls %> inner-box-caption dropdown-toggle" data-toggle="dropdown">' +
'<span class="btn-fixflex-vcenter">' +
'<span class="caption"><%= caption %></span>' +
'<i class="caret img-commonctrl"></i>' +
'<i class="caret"></i>' +
'</span>' +
'</button>' +
'</div>';
@ -271,7 +271,7 @@ define([
'<% applyicon() %>',
'<span class="caption"><%= caption %></span>',
'<span class="inner-box-caret">' +
'<i class="caret img-commonctrl"></i>' +
'<i class="caret"></i>' +
'</span>',
'</button>',
'</div>',
@ -282,7 +282,7 @@ define([
'<span class="caption"><%= caption %></span>',
'</button>',
'<button type="button" class="btn <%= cls %> dropdown-toggle" data-toggle="dropdown">',
'<i class="caret img-commonctrl"></i>',
'<i class="caret"></i>',
'<span class="sr-only"></span>',
'</button>',
'</div>',
@ -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

@ -44,16 +44,15 @@ define([
template :
_.template([
'<div id="calendar" class="calendar-box">',
'<div class="calendar-header">',
'<div class="top-row">',
'<div id="prev-arrow"><button type="button"><i class="arrow-prev img-commonctrl">&nbsp;</i></button></div>',
'<div class="title"></div>',
'<div id="next-arrow"><button type="button"><i class="arrow-next img-commonctrl">&nbsp;</i></button></div>',
'</div>',
'<div class="bottom-row">',
'</div>',
'</div>',
'<div class="calendar-content"></div>',
'<div class="calendar-header">',
'<div class="top-row">',
'<div id="prev-arrow"><button type="button"><i class="arrow-prev img-commonctrl"></i></button></div>',
'<div class="title"></div>',
'<div id="next-arrow"><button type="button"><i class="arrow-next img-commonctrl" /></button></div>',
'</div>',
'<div class="bottom-row"></div>',
'</div>',
'<div class="calendar-content"></div>',
'</div>'
].join('')),
@ -179,6 +178,7 @@ define([
year = _.isNumber(year) ? year : (me.currentDate ? me.currentDate.getFullYear() : new Date().getFullYear());
me._state = 2;
me.$el.removeClass('view-days view-months').addClass('view-years');
var firstYear = year,
lastYear = year;
@ -248,6 +248,7 @@ define([
me._state = 1;
me.currentDate = curDate;
me.$el.removeClass('view-years view-days').addClass('view-months');
// Number of year
me.topTitle = _.template([
@ -329,6 +330,7 @@ define([
curYear = curDate.getFullYear();
me.currentDate = curDate;
me.$el.removeClass('view-years view-months').addClass('view-days');
// Name month
me.topTitle = _.template([

View file

@ -41,16 +41,28 @@ define([
Common.UI.ColorButton = Common.UI.Button.extend(_.extend({
options : {
hint: false,
enableToggle: false,
visible: true
id : null,
hint : false,
enableToggle : false,
allowDepress : false,
toggleGroup : null,
cls : '',
iconCls : '',
caption : '',
menu : null,
disabled : false,
pressed : false,
split : false,
visible : true
},
template: _.template([
'<div class="btn-group" id="<%= id %>">',
'<button type="button" class="btn btn-color dropdown-toggle <%= cls %>" data-toggle="dropdown" style="<%= style %>">',
'<span>&nbsp;</span>',
'<span class="inner-box-caret"><i class="caret img-commonctrl"></i></span>',
'<span class="inner-box-caret">',
'<i class="caret"></i>',
'</span>',
'</button>',
'</div>'
].join('')),
@ -71,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;
@ -98,6 +116,11 @@ define([
});
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;
},
@ -105,13 +128,24 @@ define([
getMenu: function(options) {
if (typeof this.menu !== 'object') {
options = options || this.options;
var height = options.paletteHeight || 216;
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([
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>') }
])
@ -131,7 +165,46 @@ define([
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

@ -77,9 +77,14 @@ define([
Common.UI.ComboBorderSize = Common.UI.ComboBox.extend(_.extend({
template: _.template([
'<div class="input-group combobox combo-border-size input-group-nr <%= cls %>" id="<%= id %>" style="<%= style %>">',
'<div class="form-control" style="padding-top:2px; <%= style %>"></div>',
'<div class="form-control" style="<%= style %>">',
'<i class="image"></i>',
'<span class="text"></span>',
'</div>',
'<div style="display: table-cell;"></div>',
'<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"><span class="caret img-commonctrl"></span></button>',
'<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">',
'<span class="caret"></span>',
'</button>',
'<ul class="dropdown-menu <%= menuCls %>" style="<%= menuStyle %>" role="menu">',
'<% _.each(items, function(item) { %>',
'<li id="<%= item.id %>" data-value="<%= item.value %>"><a tabindex="-1" type="menuitem">',
@ -138,14 +143,15 @@ define([
updateFormControl: function(record) {
var formcontrol = $(this.el).find('.form-control');
var image = formcontrol.find('> .image');
var text = formcontrol.find('> .text');
if (record.get('value')>0) {
formcontrol[0].innerHTML = '';
formcontrol.removeClass('text').addClass('image');
formcontrol.css('background-position', '10px -' + record.get('offsety') + 'px');
image.css('background-position', '10px -' + record.get('offsety') + 'px').show();
text.hide();
} else {
formcontrol[0].innerHTML = this.txtNoBorders;
formcontrol.removeClass('image').addClass('text');
image.hide();
text.text(this.txtNoBorders).show();
}
},
@ -162,9 +168,7 @@ define([
this.updateFormControl(this._selectedItem);
$('#' + this._selectedItem.get('id'), $(this.el)).addClass('selected');
} else {
var formcontrol = $(this.el).find('.form-control');
formcontrol[0].innerHTML = '';
formcontrol.removeClass('image').addClass('text');
$(this.el).find('.form-control > .text').text("").show();
}
},
@ -175,7 +179,9 @@ define([
template: _.template([
'<span class="input-group combobox combo-border-size input-group-nr <%= cls %>" id="<%= id %>" style="<%= style %>">',
'<input type="text" class="form-control text">',
'<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"><span class="caret img-commonctrl"></span></button>',
'<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">',
'<span class="caret"></span>',
'</button>',
'<ul class="dropdown-menu <%= menuCls %>" style="<%= menuStyle %>" role="menu">',
'<% _.each(items, function(item) { %>',
'<li id="<%= item.id %>" data-value="<%= item.value %>"><a tabindex="-1" type="menuitem">',
@ -224,9 +230,13 @@ define([
Common.UI.ComboBorderType = Common.UI.ComboBorderSize.extend(_.extend({
template: _.template([
'<div class="input-group combobox combo-border-size input-group-nr <%= cls %>" id="<%= id %>" style="<%= style %>">',
'<div class="form-control" style="<%= style %>"></div>',
'<div class="form-control" style="<%= style %>">',
'<i class="image"></i>',
'</div>',
'<div style="display: table-cell;"></div>',
'<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"><span class="caret img-commonctrl"></span></button>',
'<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">',
'<span class="caret"></span>',
'</button>',
'<ul class="dropdown-menu <%= menuCls %>" style="<%= menuStyle %>" role="menu">',
'<% _.each(items, function(item) { %>',
'<li id="<%= item.id %>" data-value="<%= item.value %>"><a tabindex="-1" type="menuitem" style="padding: 2px 0 2px 10px;">',
@ -262,10 +272,8 @@ define([
},
updateFormControl: function(record) {
var formcontrol = $(this.el).find('.form-control');
formcontrol[0].innerHTML = '';
formcontrol.removeClass('text').addClass('image');
formcontrol.css('background-position', '10px -' + record.get('offsety') + 'px');
$(this.el).find('.form-control > .image')
.css('background-position', '10px -' + record.get('offsety') + 'px');
}
}, Common.UI.ComboBorderType || {}));
@ -275,7 +283,9 @@ define([
'<div class="form-control" style="padding:2px 14px 2px 3px; <%= style %> display: block;">',
'<div style="display: inline-block;overflow: hidden;width: 100%;height: 100%;"></div>',
'</div>',
'<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"><span class="caret img-commonctrl"></span></button>',
'<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">',
'<span class="caret"></span>',
'</button>',
'<ul class="dropdown-menu <%= menuCls %>" style="<%= menuStyle %>" role="menu">',
'<% _.each(items, function(item) { %>',
'<% if (item.value==-1) { %>',

View file

@ -93,7 +93,9 @@ define([
template: _.template([
'<span class="input-group combobox <%= cls %>" id="<%= id %>" style="<%= style %>">',
'<input type="text" class="form-control" spellcheck="false">',
'<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"><span class="caret img-commonctrl"></span></button>',
'<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">',
'<span class="caret"></span>',
'</button>',
'<ul class="dropdown-menu <%= menuCls %>" style="<%= menuStyle %>" role="menu">',
'<% _.each(items, function(item) { %>',
'<li id="<%= item.id %>" data-value="<%= item.value %>"><a tabindex="-1" type="menuitem"><%= scope.getDisplayValue(item) %></a></li>',
@ -360,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

@ -51,28 +51,44 @@ define([
Common.UI.ComboBoxFonts = Common.UI.ComboBox.extend((function() {
var iconWidth = 302,
iconHeight = Asc.FONT_THUMBNAIL_HEIGHT || 26,
isRetina = window.devicePixelRatio > 1,
thumbCanvas = document.createElement('canvas'),
thumbContext = thumbCanvas.getContext('2d'),
thumbPath = '../../../../sdkjs/common/Images/fonts_thumbnail.png',
thumbPath2x = '../../../../sdkjs/common/Images/fonts_thumbnail@2x.png',
thumbs = [
{ratio: 1, path: '../../../../sdkjs/common/Images/fonts_thumbnail.png', width: iconWidth, height: iconHeight},
{ratio: 1.5, path: '../../../../sdkjs/common/Images/fonts_thumbnail@1.5x.png', width: iconWidth * 1.5, height: iconHeight * 1.5},
{ratio: 2, path: '../../../../sdkjs/common/Images/fonts_thumbnail@2x.png', width: iconWidth * 2, height: iconHeight * 2}
],
thumbIdx = 0,
listItemHeight = 26,
spriteCols = 1;
spriteCols = 1,
applicationPixelRatio = Common.Utils.applicationPixelRatio();
if (typeof window['AscDesktopEditor'] === 'object') {
thumbPath = window['AscDesktopEditor'].getFontsSprite();
thumbPath2x = window['AscDesktopEditor'].getFontsSprite(true);
thumbs[0].path = window['AscDesktopEditor'].getFontsSprite('');
thumbs[1].path = window['AscDesktopEditor'].getFontsSprite('@1.5x');
thumbs[2].path = window['AscDesktopEditor'].getFontsSprite('@2x');
}
thumbCanvas.height = isRetina ? iconHeight * 2 : iconHeight;
thumbCanvas.width = isRetina ? iconWidth * 2 : iconWidth;
var bestDistance = Math.abs(applicationPixelRatio-thumbs[0].ratio);
var currentDistance = 0;
for (var i=1; i<thumbs.length; i++) {
currentDistance = Math.abs(applicationPixelRatio-thumbs[i].ratio);
if (currentDistance < (bestDistance - 0.0001))
{
bestDistance = currentDistance;
thumbIdx = i;
}
}
thumbCanvas.height = thumbs[thumbIdx].height;
thumbCanvas.width = thumbs[thumbIdx].width;
return {
template: _.template([
'<div class="input-group combobox fonts <%= cls %>" id="<%= id %>" style="<%= style %>">',
'<input type="text" class="form-control" spellcheck="false"> ',
'<div style="display: table-cell;"></div>',
'<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"><span class="caret img-commonctrl"></span></button>',
'<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"><span class="caret"></span></button>',
'<ul class="dropdown-menu <%= menuCls %>" style="<%= menuStyle %>" role="menu">',
'<li class="divider">',
'<% _.each(items, function(item) { %>',
@ -131,7 +147,7 @@ define([
if ($(e.target).closest('input').length) { // enter in input field
if (this.lastValue !== this._input.val())
this._input.trigger('change');
else
else
return true;
} else { // enter in dropdown list
$(e.target).click();
@ -279,13 +295,8 @@ define([
return img != null ? img[0].src : undefined;
}
if (isRetina) {
thumbContext.clearRect(0, 0, iconWidth * 2, iconHeight * 2);
thumbContext.drawImage(this.spriteThumbs, 0, -Asc.FONT_THUMBNAIL_HEIGHT * 2 * Math.floor(opts.imgidx/spriteCols));
} else {
thumbContext.clearRect(0, 0, iconWidth, iconHeight);
thumbContext.drawImage(this.spriteThumbs, 0, -Asc.FONT_THUMBNAIL_HEIGHT * Math.floor(opts.imgidx/spriteCols));
}
thumbContext.clearRect(0, 0, thumbs[thumbIdx].width, thumbs[thumbIdx].height);
thumbContext.drawImage(this.spriteThumbs, 0, -thumbs[thumbIdx].height * Math.floor(opts.imgidx/spriteCols));
return thumbCanvas.toDataURL();
},
@ -306,7 +317,7 @@ define([
if (callback) {
this.spriteThumbs = new Image();
this.spriteThumbs.onload = callback;
this.spriteThumbs.src = isRetina ? thumbPath2x : thumbPath;
this.spriteThumbs.src = thumbs[thumbIdx].path;
}
},
@ -314,7 +325,7 @@ define([
var me = this;
this.loadSprite(function() {
spriteCols = Math.floor(me.spriteThumbs.width / (isRetina ? iconWidth * 2 : iconWidth)) || 1;
spriteCols = Math.floor(me.spriteThumbs.width / (thumbs[thumbIdx].width)) || 1;
me.store.set(store.toJSON());
me.rendered = false;
@ -345,19 +356,20 @@ 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(name);
me.onApiChangeFontInternal(me.__name);
me.__nameId = null;
}, 100);
}
}
},
onApiChangeFontInternal: function(name) {
if (this.inFormControl) return;
this.__name = name;
if (this.getRawValue() !== name) {
var record = this.store.findWhere({
name: name
@ -382,6 +394,12 @@ define([
},
itemClicked: function (e) {
this.__name = undefined;
if (this.__nameId) {
clearTimeout(this.__nameId);
this.__nameId = undefined;
}
Common.UI.ComboBox.prototype.itemClicked.apply(this, arguments);
var el = $(e.target).closest('li');
@ -528,21 +546,16 @@ define([
var fontImage = document.createElement('canvas');
var context = fontImage.getContext('2d');
fontImage.height = isRetina ? iconHeight * 2 : iconHeight;
fontImage.width = isRetina ? iconWidth * 2 : iconWidth;
fontImage.height = thumbs[thumbIdx].height;
fontImage.width = thumbs[thumbIdx].width;
fontImage.style.width = iconWidth + 'px';
fontImage.style.height = iconHeight + 'px';
index = Math.floor(me.store.at(j).get('imgidx')/spriteCols);
if (isRetina) {
context.clearRect(0, 0, iconWidth * 2, iconHeight * 2);
context.drawImage(me.spriteThumbs, 0, -Asc.FONT_THUMBNAIL_HEIGHT * 2 * index);
} else {
context.clearRect(0, 0, iconWidth, iconHeight);
context.drawImage(me.spriteThumbs, 0, -Asc.FONT_THUMBNAIL_HEIGHT * index);
}
context.clearRect(0, 0, thumbs[thumbIdx].width, thumbs[thumbIdx].height);
context.drawImage(me.spriteThumbs, 0, -thumbs[thumbIdx].height * index);
me.tiles[j] = fontImage;
$(listItems[j]).get(0).appendChild(fontImage);

View file

@ -468,12 +468,12 @@ define([
setItemWidth: function(width) {
if (this.itemWidth != width)
this.itemWidth = window.devicePixelRatio > 1 ? width / 2 : width;
this.itemWidth = Common.Utils.applicationPixelRatio() > 1 ? width / 2 : width;
},
setItemHeight: function(height) {
if (this.itemHeight != height)
this.itemHeight = window.devicePixelRatio > 1 ? height / 2 : height;
this.itemHeight = Common.Utils.applicationPixelRatio() > 1 ? height / 2 : height;
},
removeTips: function() {

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)) {
@ -666,8 +671,8 @@ define([
if (rec) {
this._fromKeyDown = true;
this.selectRecord(rec);
this._fromKeyDown = false;
this.scrollToRecord(rec);
this._fromKeyDown = false;
}
}
} else {
@ -1114,8 +1119,8 @@ define([
if (rec) {
this._fromKeyDown = true;
this.selectRecord(rec);
this._fromKeyDown = false;
this.scrollToRecord(rec);
this._fromKeyDown = false;
}
}
} else {

View file

@ -74,7 +74,7 @@ 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;
@ -89,7 +89,7 @@ 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;

View file

@ -119,6 +119,37 @@ define([
focus: function() {
this.cmpEl && this.cmpEl.find('.listview').focus();
},
scrollToRecord: function (record, force) {
if (!this._fromKeyDown) {
Common.UI.DataView.prototype.scrollToRecord.call(this, record, force);
return;
}
if (!record) return;
var innerEl = $(this.el).find('.inner'),
innerHeight = innerEl.innerHeight(),
idx = _.indexOf(this.store.models, record),
div = (idx>=0 && this.dataViewItems.length>idx) ? $(this.dataViewItems[idx].el) : innerEl.find('#' + record.get('id'));
if (div.length<=0) return;
var div_top = div.position().top,
div_height = div.outerHeight(),
newpos;
if (force || div_top<0)
newpos = innerEl.scrollTop() + div_top;
else if (div_top+div_height>innerHeight)
newpos = innerEl.scrollTop() + div_top + div_height - innerHeight;
if (newpos!==undefined) {
if (this.scroller && this.allowScrollbar) {
this.scroller.scrollTop(newpos, 0);
} else {
innerEl.scrollTop(newpos);
}
}
}
}
})());

View file

@ -131,6 +131,8 @@ define([
// if (ownerEl.height()<1 || ownerEl.width()<1)
// loaderEl.css({visibility: 'hidden'});
loaderEl.css('min-width', $('.asc-loadmask-title', loaderEl).width() + 105);
if (ownerEl && ownerEl.closest('.asc-window.modal').length==0)
Common.util.Shortcuts.suspendEvents();
},500);
@ -158,7 +160,9 @@ define([
this.title = title;
if (this.ownerEl && this.ownerEl.ismasked && this.loaderEl){
$('.asc-loadmask-title', this.loaderEl).html(title);
var el = $('.asc-loadmask-title', this.loaderEl);
el.html(title);
this.loaderEl.css('min-width', el.width() + 105);
}
},

View file

@ -120,8 +120,8 @@ define([
template :
'<input type="text" class="form-control" spellcheck="false">' +
'<div class="spinner-buttons">' +
'<button type="button" class="spinner-up"><i class="img-commonctrl"></i></button>' +
'<button type="button" class="spinner-down"><i class="img-commonctrl"></i></button>' +
'<button type="button" class="spinner-up"><i class="arrow"></i></button>' +
'<button type="button" class="spinner-down"><i class="arrow"></i></button>' +
'</div>',
initialize : function(options) {

View file

@ -55,7 +55,7 @@ define([
values: [0, 100],
colorValues: ['#000000', '#ffffff'],
currentThumb: 0,
thumbTemplate: '<div class="thumb img-commonctrl" style="">' +
thumbTemplate: '<div class="thumb" style="">' +
'<div class="thumb-top"><div class="thumb-top-inner"></div></div>' +
'<div class="thumb-bottom"><div class="thumb-bottom-inner"></div></div>' +
'</div>'

View file

@ -89,12 +89,8 @@ define([
template : _.template([
'<div class="slider single-slider" style="">',
'<div class="track">',
'<div class="track-left img-commonctrl"></div>',
'<div class="track-center img-commonctrl"></div>',
'<div class="track-right img-commonctrl" style=""></div>',
'</div>',
'<div class="thumb img-commonctrl" style=""></div>',
'<div class="track"></div>',
'<div class="thumb" style=""></div>',
'<% if (this.options.enableKeyEvents) { %>',
'<input type="text" style="position: absolute; top:-10px; width: 1px; height: 1px;">',
'<% } %>',

View file

@ -43,7 +43,7 @@ define([
options : {
target : $(document.body),
text : '',
placement: 'right',
placement: 'right-bottom',
showLink: true
},
@ -53,7 +53,7 @@ define([
'<div class="tip-arrow <%= scope.placement %>"></div>',
'<div>',
'<div class="tip-text"><%= scope.text %></div>',
'<div class="close img-commonctrl"></div>',
'<div class="close"></div>',
'</div>',
'<% if ( scope.showLink ) { %>',
'<div class="show-link"><label><%= scope.textLink %></label></div>',
@ -96,6 +96,7 @@ define([
hide: function() {
if (this.cmpEl) this.cmpEl.hide();
this.trigger('hide');
},
close: function() {
@ -103,25 +104,45 @@ define([
},
applyPlacement: function () {
var showxy = this.target.offset(),
innerHeight = Common.Utils.innerHeight();
var showxy = this.target.offset();
if (this.placement=='target') {
this.cmpEl.css({top : showxy.top + 5 + 'px', left: showxy.left + 5 + 'px'});
return;
}
if (this.placement == 'document') {
// this.cmpEl.css('top', $('#editor_sdk').offset().top);
} else
if (this.placement == 'top')
this.cmpEl.css({bottom : innerHeight - showxy.top + 'px', right: Common.Utils.innerWidth() - showxy.left - this.target.width()/2 + 'px'});
else if (this.placement == 'target') {
this.cmpEl.css({top : (showxy.top+5) + 'px', left: (showxy.left+5) + 'px'});
} else {// left or right
var top = showxy.top + this.target.height()/2,
height = this.cmpEl.height();
if (top+height>innerHeight)
top = innerHeight - height;
if (this.placement == 'left')
this.cmpEl.css({top : top + 'px', right: Common.Utils.innerWidth() - showxy.left - 5 + 'px'});
else
this.cmpEl.css({top : top + 'px', left: showxy.left + this.target.width() + 'px'});
var placement = this.placement.split('-');
if (placement.length>0) {
var top, left, bottom, right;
var pos = placement[0];
if (pos=='top') {
bottom = Common.Utils.innerHeight() - showxy.top;
} else if (pos == 'bottom') {
top = showxy.top + this.target.height();
} else if (pos == 'left') {
right = Common.Utils.innerWidth() - showxy.left;
} else if (pos == 'right') {
left = showxy.left + this.target.width();
}
pos = placement[1];
if (pos=='top') {
bottom = Common.Utils.innerHeight() - showxy.top - this.target.height()/2;
} else if (pos == 'bottom') {
top = showxy.top + this.target.height()/2;
} else if (pos == 'left') {
right = Common.Utils.innerWidth() - showxy.left - this.target.width()/2;
} else if (pos == 'right') {
left = showxy.left + this.target.width()/2;
} else {
if (bottom!==undefined || top!==undefined)
left = showxy.left + (this.target.width() - this.cmpEl.width())/2;
else
top = showxy.top + (this.target.height() - this.cmpEl.height())/2;
}
top = (top!==undefined) ? (top + 'px') : 'auto';
bottom = (bottom!==undefined) ? (bottom + 'px') : 'auto';
left = (left!==undefined) ? (left + 'px') : 'auto';
right = (right!==undefined) ? (right + 'px') : 'auto';
this.cmpEl.css({top : top, left: left, right: right, bottom: bottom});
}
},

View file

@ -268,9 +268,15 @@ define([
});
tab.$el.children().on(
{dragstart: $.proxy(function (e) {
var event = e.originalEvent,
img = document.createElement('div');
event.dataTransfer.setDragImage(img, 0, 0);
var event = e.originalEvent;
if (!Common.Utils.isIE) {
var img = document.createElement('div');
event.dataTransfer.setDragImage(img, 0, 0);
} else {
this.bar.selectTabs.forEach(function (tab) {
tab.$el.find('span').prop('title', '');
});
}
event.dataTransfer.effectAllowed = 'move';
this.bar.trigger('tab:dragstart', event.dataTransfer, this.bar.selectTabs);
}, this),
@ -279,8 +285,14 @@ define([
if (!this.bar.isEditFormula) {
this.bar.$el.find('.mousemove').removeClass('mousemove right');
$(e.currentTarget).parent().addClass('mousemove');
var data = event.dataTransfer.getData("onlyoffice");
event.dataTransfer.dropEffect = data ? 'move' : 'none';
var data;
if (!Common.Utils.isIE) {
data = event.dataTransfer.getData('onlyoffice');
event.dataTransfer.dropEffect = data ? 'move' : 'none';
} else {
data = event.dataTransfer.getData('text');
event.dataTransfer.dropEffect = data === 'sheet' ? 'move' : 'none';
}
} else {
event.dataTransfer.dropEffect = 'none';
}
@ -356,8 +368,14 @@ define([
event.dataTransfer.effectAllowed = 'move';
}, this));
addEvent(this.$bar[0], 'dragenter', _.bind(function (event) {
var data = event.dataTransfer.getData("onlyoffice");
event.dataTransfer.dropEffect = (!this.isEditFormula && data) ? 'move' : 'none';
var data;
if (!Common.Utils.isIE) {
data = event.dataTransfer.getData('onlyoffice');
event.dataTransfer.dropEffect = (!this.isEditFormula && data) ? 'move' : 'none';
} else {
data = event.dataTransfer.getData('text');
event.dataTransfer.dropEffect = (data === 'sheet' && !this.isEditFormula) ? 'move' : 'none';
}
}, this));
addEvent(this.$bar[0], 'dragover', _.bind(function (event) {
if (event.preventDefault) {

View file

@ -417,7 +417,7 @@ define([
'</div>',
'</div>',
'<div style="position: absolute; left: 0; bottom: 0; width: <%=scope.tablePadding%>px; height: <%=scope.tablePadding%>px; border-top: 1pt dotted gray; border-right: 1pt dotted gray;"></div>',
'<div style="position: absolute; left: 0; bottom: 0; width: <%=scope.tablePadding%>px; height: <%=scope.tablePadding%>px; border-top: 1px dotted gray; border-right: 1px dotted gray;"></div>',
'<div style="position: absolute; left: <%=scope.tablePadding%>px; bottom: 0; right: <%=scope.tablePadding%>px; height: <%=scope.tablePadding%>px;">',
'<div id="<%=scope.id%>-table-bottom-border-selector" style="position: absolute; z-index: 1; height: <%=scope.tablePadding%>px; left: 0; right: 0; bottom: <%=scope.tablePadding * .5%>px;">',
'<table width="100%" height="100%">',
@ -430,7 +430,7 @@ define([
'</table>',
'</div>',
'</div>',
'<div style="position: absolute; bottom: 0; right: 0; width: <%=scope.tablePadding%>px; height: <%=scope.tablePadding%>px; border-top: 1pt dotted gray; border-left: 1pt dotted gray;"></div>',
'<div style="position: absolute; bottom: 0; right: 0; width: <%=scope.tablePadding%>px; height: <%=scope.tablePadding%>px; border-top: 1px dotted gray; border-left: 1px dotted gray;"></div>',
'</div>'
].join('')),
@ -677,10 +677,12 @@ define([
};
me.setTableColor = function(color) {
table_content.toggleClass('transparent', color == 'transparent');
table_content.css('background-color', (color == 'transparent' ) ? color : ('#'+color));
};
me.setCellsColor = function(color) {
!me.spacingMode && table_content.toggleClass('transparent', color == 'transparent');
cells_content.css('background-color', (color == 'transparent' ) ? color : ('#'+color));
};

View file

@ -64,7 +64,7 @@ define([
'<% 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>' +
'<% } else if (me.isSeparator(item)) { %> </div><div class="palette-color-separator" style="width:100%;height:1px;float:left;border-bottom: 1px solid #E0E0E0"></div><div style="padding: 12px;">' +
'<% } else if (me.isSeparator(item)) { %> </div><div class="divider" style="width:100%;float:left;"></div><div style="padding: 12px;">' +
'<% } else if (me.isColor(item)) { %> ' +
'<a class="palette-color color-<%=item%>" style="background:#<%=item%>" hidefocus="on">' +
'<em><span style="background:#<%=item%>;" unselectable="on">&#160;</span></em>' +

View file

@ -176,11 +176,11 @@ define([
'<div class="tree-caret img-commonctrl ' + '<% if (!isExpanded) { %>' + 'up' + '<% } %>' + '" style="margin-left: <%= level*16 %>px;"></div>',
'<% } %>',
'<% if (isNotHeader) { %>',
'<div class="name not-header"><%= name %></div>',
'<div class="name not-header"><%= Common.Utils.String.htmlEncode(name) %></div>',
'<% } else if (isEmptyItem) { %>',
'<div class="name empty">' + options.emptyItemText + '</div>',
'<% } else { %>',
'<div class="name"><%= name %></div>',
'<div class="name"><%= Common.Utils.String.htmlEncode(name) %></div>',
'<% } %>',
'</div>'
].join(''));

View file

@ -166,7 +166,7 @@ define([
'<div class="header">' +
'<div class="tools">' +
'<% if (closable!==false) %>' +
'<div class="tool close img-commonctrl"></div>' +
'<div class="tool close"></div>' +
'<% %>' +
'<% if (help===true) %>' +
'<div class="tool help">?</div>' +
@ -455,7 +455,7 @@ define([
if (!options.width) options.width = 'auto';
var template = '<div class="info-box">' +
'<% if (typeof iconCls !== "undefined") { %><div class="icon img-commonctrl <%= iconCls %>"></div><% } %>' +
'<% if (typeof iconCls !== "undefined") { %><div class="icon img-commonctrl img-colored <%= iconCls %>"></div><% } %>' +
'<div class="text" <% if (typeof iconCls == "undefined") { %> style="padding-left:10px;" <% } %>><span><%= msg %></span>' +
'<% if (dontshow) { %><div class="dont-show-checkbox"></div><% } %>' +
'</div>' +
@ -709,12 +709,14 @@ define([
mask.attr('counter', parseInt(mask.attr('counter'))+1);
mask.show();
} else {
var maskOpacity = $(':root').css('--modal-window-mask-opacity');
mask.css('opacity', 0);
mask.attr('counter', parseInt(mask.attr('counter'))+1);
mask.show();
setTimeout(function () {
mask.css(_getTransformation('0.2'));
mask.css(_getTransformation(maskOpacity));
}, 1);
}
@ -767,6 +769,9 @@ define([
'-o-transform': 'scale(1)',
'opacity': '1'
});
setTimeout(function () {
me.fireEvent('animate:after', me);
}, 210);
}, 1);
setTimeout(function () {
@ -777,6 +782,9 @@ define([
this.$window.css({opacity: 1});
this.$window.addClass('notransform');
this.fireEvent('show', this);
setTimeout(function () {
me.fireEvent('animate:after', me);
}, 10);
}
Common.NotificationCenter.trigger('window:show', this);
@ -801,11 +809,12 @@ define([
if ( hide_mask ) {
if (this.options.animate !== false) {
var maskOpacity = $(':root').css('--modal-window-mask-opacity');
mask.css(_getTransformation(0));
setTimeout(function () {
if (parseInt(mask.attr('counter'))<1) {
mask.css('opacity', '0.2');
mask.css('opacity', maskOpacity);
mask.hide();
mask.attr('counter', 0);
}
@ -841,11 +850,12 @@ define([
if ( hide_mask ) {
if (this.options.animate !== false) {
var maskOpacity = $(':root').css('--modal-window-mask-opacity');
mask.css(_getTransformation(0));
setTimeout(function () {
if (parseInt(mask.attr('counter'))<1) {
mask.css('opacity', '0.2');
mask.css('opacity', maskOpacity);
mask.hide();
mask.attr('counter', 0);
}

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;
@ -191,6 +190,7 @@ define([
this.api.asc_registerCallback('asc_onHideComment', _.bind(this.onApiHideComment, this));
this.api.asc_registerCallback('asc_onUpdateCommentPosition', _.bind(this.onApiUpdateCommentPosition, this));
this.api.asc_registerCallback('asc_onDocumentPlaceChanged', _.bind(this.onDocumentPlaceChanged, this));
this.api.asc_registerCallback('asc_onDeleteComment', _.bind(this.onDeleteComment, this)); // only for PE, when del or ctrl+x pressed
}
},
@ -217,7 +217,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 +238,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) {
@ -355,7 +355,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'));
@ -432,7 +432,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'));
@ -512,7 +512,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);
@ -777,6 +777,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'));
@ -802,7 +804,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)
}));
}
@ -1037,6 +1040,12 @@ define([
}
},
onDeleteComment: function (id, comment) {
if (this.api) {
this.api.asc_RemoveAllComments(!this.mode.canDeleteComments, true);// 1 param = true if remove only my comments, 2 param - remove current comments
}
},
// internal
updateComments: function (needRender, disableSort, loadText) {
@ -1242,6 +1251,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
});
@ -1278,7 +1288,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)
}));
}
}
@ -1308,7 +1319,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,
@ -1372,7 +1383,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))
@ -1439,7 +1450,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

@ -41,12 +41,15 @@ define([
], function () {
'use strict';
var native = window.AscDesktopEditor;
!!native && native.execCommand('webapps:features', JSON.stringify({
var features = {
version: '{{PRODUCT_VERSION}}',
eventloading: true,
titlebuttons: true
}));
titlebuttons: true,
uithemes: true
};
var native = window.desktop || window.AscDesktopEditor;
!!native && native.execCommand('webapps:features', JSON.stringify(features));
var Desktop = function () {
var config = {version:'{{PRODUCT_VERSION}}'};
@ -83,6 +86,9 @@ define([
$('.asc-window.modal').css('top', obj.skiptoparea);
Common.Utils.InternalSettings.set('window-inactive-area-top', obj.skiptoparea);
} else
if ( obj.lockthemes != undefined ) {
Common.UI.Themes.setAvailable(!obj.lockthemes);
}
} else
if (/editor:config/.test(cmd)) {
@ -115,6 +121,9 @@ define([
titlebuttons[obj.action].btn.click();
}
} else
if (/theme:changed/.test(cmd)) {
Common.UI.Themes.setTheme(param);
} else
if (/element:show/.test(cmd)) {
var _mr = /title:(?:(true|show)|(false|hide))/.exec(param);
if ( _mr ) {
@ -131,7 +140,7 @@ define([
}
}
native.execCommand('webapps:features', JSON.stringify({version: config.version, eventloading:true, titlebuttons:true}));
native.execCommand('webapps:features', JSON.stringify(features));
// hide mask for modal window
var style = document.createElement('style');
@ -193,8 +202,9 @@ define([
});
Common.NotificationCenter.on('app:face', function (mode) {
native.execCommand('webapps:features', JSON.stringify(
{version: config.version, eventloading:true, titlebuttons:true, viewmode:!mode.isEdit, crypted:mode.isCrypted} ));
features.viewmode = !mode.isEdit;
features.crypted = mode.isCrypted;
native.execCommand('webapps:features', JSON.stringify(features));
titlebuttons = {};
if ( mode.isEdit ) {
@ -235,6 +245,9 @@ define([
Common.NotificationCenter.on({
'modal:show': _onModalDialog.bind(this, 'open'),
'modal:close': _onModalDialog.bind(this, 'close')
, 'uitheme:changed' : function (name) {
native.execCommand("uitheme:changed", name);
}
});
}
},

View file

@ -56,6 +56,7 @@ define([
var createExternalEditor = function() {
!!customization && (customization.uiTheme = Common.localStorage.getItem("ui-theme", "theme-light"));
externalEditor = new DocsAPI.DocEditor('id-diagram-editor-placeholder', {
width : '100%',
height : '100%',
@ -242,6 +243,15 @@ define([
}
},
showExternalEditor: function () {
if ( externalEditor ) {
var value = Common.localStorage.getItem("ui-theme", "theme-light");
externalEditor.serviceCommand('theme:change', value);
}
this.diagramEditorView.show();
},
warningTitle: 'Warning',
warningText: 'The object is disabled because of editing by another user.',
textClose: 'Close',

View file

@ -102,6 +102,8 @@ define([
Common.Gateway.on('init', this.loadConfig.bind(this));
Common.NotificationCenter.on('app:face', this.onAppShowed.bind(this));
Common.NotificationCenter.on('uitheme:changed', this.updatePluginsButtons.bind(this));
Common.NotificationCenter.on('window:resize', this.updatePluginsButtons.bind(this));
},
loadConfig: function(data) {
@ -165,8 +167,9 @@ define([
return this;
},
setMode: function(mode) {
setMode: function(mode, api) {
this.appOptions = mode;
this.api = api;
this.customPluginsComplete = !this.appOptions.canBrandingExt;
if (this.appOptions.canBrandingExt)
this.getAppCustomPlugins(this.configPlugins);
@ -203,6 +206,7 @@ define([
plugin.set_Name(item.get('name'));
plugin.set_Guid(item.get('guid'));
plugin.set_BaseUrl(item.get('baseUrl'));
plugin.set_MinVersion(item.get('minVersion'));
var variations = item.get('variations'),
variationsArr = [];
@ -246,7 +250,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 +275,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++;
}
@ -283,6 +287,14 @@ define([
}
},
updatePluginsButtons: function() {
var storePlugins = this.getApplication().getCollection('Common.Collections.Plugins'),
me = this;
storePlugins.each(function(item){
me.panelPlugins.updatePluginIcons(item);
});
},
onSelectPlugin: function(picker, item, record, e){
var btn = $(e.target);
if (btn && btn.hasClass('plugin-caret')) {
@ -371,7 +383,8 @@ define([
isCustomWindow = variation.get_CustomWindow(),
arrBtns = variation.get_Buttons(),
newBtns = [],
size = variation.get_Size();
size = variation.get_Size(),
isModal = variation.get_Modal();
if (!size || size.length<2) size = [800, 600];
if (_.isArray(arrBtns)) {
@ -392,7 +405,8 @@ define([
frameId : frameId,
buttons: isCustomWindow ? undefined : newBtns,
toolcallback: _.bind(this.onToolClose, this),
help: !!help
help: !!help,
modal: isModal!==undefined ? isModal : true
});
me.pluginDlg.on({
'render:after': function(obj){
@ -500,7 +514,8 @@ define([
var me = this;
var pluginStore = this.getApplication().getCollection('Common.Collections.Plugins'),
isEdit = me.appOptions.isEdit,
editor = me.editor;
editor = me.editor,
apiVersion = me.api ? me.api.GetVersion() : undefined;
if ( pluginsdata instanceof Array ) {
var arr = [], arrUI = [],
lang = me.appOptions.lang.split(/[\-_]/)[0];
@ -539,7 +554,7 @@ define([
description: description,
index: variationsArr.length,
url: itemVar.url,
icons: itemVar.icons,
icons: itemVar.icons2 || itemVar.icons,
buttons: itemVar.buttons,
visible: visible,
help: itemVar.help
@ -554,6 +569,9 @@ define([
if (typeof item.nameLocale == 'object')
name = item.nameLocale[lang] || item.nameLocale['en'] || name || '';
if (pluginVisible)
pluginVisible = me.checkPluginVersion(apiVersion, item.minVersion);
arr.push(new Common.Models.Plugin({
name : name,
guid: item.guid,
@ -562,7 +580,8 @@ define([
currentVariation: 0,
visible: pluginVisible,
groupName: (item.group) ? item.group.name : '',
groupRank: (item.group) ? item.group.rank : 0
groupRank: (item.group) ? item.group.rank : 0,
minVersion: item.minVersion
}));
}
});
@ -599,6 +618,25 @@ define([
}
},
checkPluginVersion: function(apiVersion, pluginVersion) {
if (apiVersion && apiVersion!=='develop' && pluginVersion && typeof pluginVersion == 'string') {
var res = pluginVersion.match(/^([0-9]+)(?:.([0-9]+))?(?:.([0-9]+))?$/),
apires = apiVersion.match(/^([0-9]+)(?:.([0-9]+))?(?:.([0-9]+))?$/);
if (res && res.length>1 && apires && apires.length>1) {
for (var i=0; i<3; i++) {
var pluginVer = res[i+1] ? parseInt(res[i+1]) : 0,
apiVer = apires[i+1] ? parseInt(apires[i+1]) : 0;
if (pluginVer>apiVer)
return false;
if (pluginVer<apiVer)
return true;
}
}
}
return true;
},
getPlugins: function(pluginsData, fetchFunction) {
if (!pluginsData || pluginsData.length<1)
return Promise.resolve([]);

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;
@ -142,6 +132,8 @@ define([
this.api.asc_registerCallback('asc_onAuthParticipantsChanged', _.bind(this.onAuthParticipantsChanged, this));
this.api.asc_registerCallback('asc_onParticipantsChanged', _.bind(this.onAuthParticipantsChanged, this));
}
if (this.appConfig.canReview)
this.api.asc_registerCallback('asc_onOnTrackRevisionsChange', _.bind(this.onApiTrackRevisionsChange, this));
this.api.asc_registerCallback('asc_onAcceptChangesBeforeCompare',_.bind(this.onAcceptChangesBeforeCompare, this));
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect',_.bind(this.onCoAuthoringDisconnect, this));
@ -482,7 +474,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){
@ -565,17 +557,33 @@ define([
Common.NotificationCenter.trigger('edit:complete', this.view);
},
onTurnPreview: function(state) {
onTurnPreview: function(state, global, fromApi) {
if ( this.appConfig.isReviewOnly ) {
this.view.turnChanges(true);
} else
if ( this.appConfig.canReview ) {
state = (state == 'on');
state = (state=='off') ? false : state; // support of prev. version (on/off)
if (!!global) {
this.api.asc_SetLocalTrackRevisions(null);
this.api.asc_SetGlobalTrackRevisions(!!state);
} else
this.api.asc_SetLocalTrackRevisions(!!state);
}
},
Common.localStorage.setItem(this.view.appPrefix + "track-changes-" + (this.appConfig.fileKey || ''), state ? 1 : 0);
this.api.asc_SetTrackRevisions(state);
this.view.turnChanges(state);
onApiTrackRevisionsChange: function(localFlag, globalFlag, userId) {
if ( this.appConfig.isReviewOnly ) {
this.view.turnChanges(true);
} else
if ( this.appConfig.canReview ) {
var global = (localFlag===null),
state = global ? globalFlag : localFlag;
Common.Utils.InternalSettings.set(this.view.appPrefix + "track-changes", (state ? 0 : 1) + (global ? 2 : 0));
this.view.turnChanges(state, global);
if (userId && this.userCollection) {
var rec = this.userCollection.findOriginalUser(userId);
rec && this.showTips(Common.Utils.String.format(globalFlag ? this.textOnGlobal : this.textOffGlobal, Common.Utils.UserInfoParser.getParsedName(rec.get('username'))));
}
}
},
@ -774,15 +782,20 @@ define([
(new Promise(function (resolve) {
resolve();
})).then(function () {
function _setReviewStatus(state) {
me.view.turnChanges(state);
me.api.asc_SetTrackRevisions(state);
};
// function _setReviewStatus(state, global) {
// me.view.turnChanges(state, global);
// !global && me.api.asc_SetLocalTrackRevisions(state);
// Common.Utils.InternalSettings.set(me.view.appPrefix + "track-changes", (state ? 0 : 1) + (global ? 2 : 0));
// };
var trackChanges = typeof (me.appConfig.customization) == 'object' ? me.appConfig.customization.trackChanges : undefined;
var state = config.isReviewOnly || trackChanges===true || (trackChanges!==false) && Common.localStorage.getBool(me.view.appPrefix + "track-changes-" + (config.fileKey || ''));
if (config.isReviewOnly || trackChanges!==undefined)
me.api.asc_SetLocalTrackRevisions(config.isReviewOnly || trackChanges===true);
else
me.onApiTrackRevisionsChange(me.api.asc_GetLocalTrackRevisions(), me.api.asc_GetGlobalTrackRevisions());
me.api.asc_HaveRevisionsChanges() && me.view.markChanges(true);
_setReviewStatus(state);
// _setReviewStatus(state, global);
if ( typeof (me.appConfig.customization) == 'object' && (me.appConfig.customization.showReviewChanges==true) ) {
me.dlgChanges = (new Common.Views.ReviewChangesDialog({
@ -816,6 +829,41 @@ define([
}
},
showTips: function(strings) {
var me = this;
if (!strings.length) return;
if (typeof(strings)!='object') strings = [strings];
function showNextTip() {
var str_tip = strings.shift();
if (str_tip) {
me.tooltip.setTitle(str_tip);
me.tooltip.show();
me.tipTimeout = setTimeout(function () {
me.tooltip.hide();
}, 5000);
}
}
if (!this.tooltip) {
this.tooltip = new Common.UI.Tooltip({
owner: this.getApplication().getController('Toolbar').getView(),
hideonclick: true,
placement: 'bottom',
cls: 'main-info',
offset: 30
});
this.tooltip.on('tooltip:hide', function(cmp){
if (cmp==me.tooltip) {
clearTimeout(me.tipTimeout);
setTimeout(showNextTip, 300);
}
});
}
showNextTip();
},
applySettings: function(menu) {
this.view && this.view.turnSpelling( Common.localStorage.getBool(this.view.appPrefix + "settings-spellcheck", true) );
this.view && this.view.turnCoAuthMode( Common.localStorage.getBool(this.view.appPrefix + "settings-coauthmode", true) );
@ -976,7 +1024,11 @@ define([
textTitleComparison: 'Comparison Settings',
textShow: 'Show changes at',
textChar: 'Character level',
textWord: 'Word level'
textWord: 'Word level',
textOnGlobal: '{0} enabled Track Changes for everyone.',
textOffGlobal: '{0} disabled Track Changes for everyone.',
textOn: '{0} is now using Track Changes.',
textOff: '{0} is no longer using Track Changes.'
}, Common.Controllers.ReviewChanges || {}));
});

View file

@ -0,0 +1,283 @@
/**
* Created by Maxim.Kadushkin on 2/5/2021.
*/
define([
'core'
], function () {
'use strict';
Common.UI.Themes = new (function(locale) {
!locale && (locale = {});
var themes_map = {
'theme-light': {
text: locale.txtThemeLight || 'Light',
type: 'light'
},
'theme-classic-light': {
text: locale.txtThemeClassicLight || 'Classic Light',
type: 'light'
},
'theme-dark': {
text: locale.txtThemeDark || 'Dark',
type: 'dark'
},
}
var id_default_light_theme = 'theme-classic-light',
id_default_dark_theme = 'theme-dark';
var name_colors = [
"background-normal",
"background-toolbar",
"background-toolbar-additional",
"background-primary-dialog-button",
"background-tab-underline",
"background-notification-popover",
"background-notification-badge",
"background-scrim",
"background-loader",
"highlight-button-hover",
"highlight-button-pressed",
"highlight-button-pressed-hover",
"highlight-primary-dialog-button-hover",
"highlight-header-button-hover",
"highlight-header-button-pressed",
"highlight-toolbar-tab-underline",
"highlight-text-select",
"border-toolbar",
"border-divider",
"border-regular-control",
"border-toolbar-button-hover",
"border-preview-hover",
"border-preview-select",
"border-control-focus",
"border-color-shading",
"border-error",
"text-normal",
"text-normal-pressed",
"text-secondary",
"text-tertiary",
"text-link",
"text-link-hover",
"text-link-active",
"text-link-visited",
"text-inverse",
"text-toolbar-header",
"text-contrast-background",
"icon-normal",
"icon-normal-pressed",
"icon-inverse",
"icon-toolbar-header",
"icon-notification-badge",
"icon-contrast-popover",
"icon-success",
"canvas-background",
"canvas-content-background",
"canvas-page-border",
"canvas-ruler-background",
"canvas-ruler-margins-background",
"canvas-ruler-mark",
"canvas-ruler-handle-border",
"canvas-ruler-handle-border-disabled",
"canvas-high-contrast",
"canvas-high-contrast-disabled",
"canvas-cell-border",
"canvas-cell-title-border",
"canvas-cell-title-border-hover",
"canvas-cell-title-border-selected",
"canvas-cell-title-hover",
"canvas-cell-title-selected",
"canvas-dark-cell-title",
"canvas-dark-cell-title-hover",
"canvas-dark-cell-title-selected",
"canvas-dark-cell-title-border",
"canvas-dark-cell-title-border-hover",
"canvas-dark-cell-title-border-selected",
"canvas-scroll-thumb",
"canvas-scroll-thumb-hover",
"canvas-scroll-thumb-pressed",
"canvas-scroll-thumb-border",
"canvas-scroll-thumb-border-hover",
"canvas-scroll-thumb-border-pressed",
"canvas-scroll-arrow",
"canvas-scroll-arrow-hover",
"canvas-scroll-arrow-pressed",
"canvas-scroll-thumb-target",
"canvas-scroll-thumb-target-hover",
"canvas-scroll-thumb-target-pressed"
];
var get_current_theme_colors = function (colors) {
var out_object = {};
if ( !(Common.Utils.isIE10 || Common.Utils.isIE11) ) {
var style = getComputedStyle(document.body);
colors.forEach(function (item, index) {
out_object[item] = style.getPropertyValue('--' + item).trim()
})
}
return out_object;
}
var create_colors_css = function (id, colors) {
if ( !!colors && !!id ) {
var _css_array = [':root .', id, '{'];
for (var c in colors) {
_css_array.push('--', c, ':', colors[c], ';');
}
_css_array.push('}');
return _css_array.join('');
}
}
var write_theme_css = function (css) {
if ( !!css ) {
var style = document.createElement('style');
style.type = 'text/css';
style.innerHTML = css;
document.getElementsByTagName('head')[0].appendChild(style);
}
}
var parse_themes_object = function (obj) {
if ( !!obj.themes && obj.themes instanceof Array ) {
obj.themes.forEach(function (item) {
if ( !!item.id ) {
themes_map[item.id] = {text: item.name, type: item.type};
write_theme_css(create_colors_css(item.id, item.colors));
} else
if ( typeof item == 'string' ) {
get_themes_config(item)
}
});
} else
if ( obj.id ) {
themes_map[obj.id] = {text: obj.name, type: obj.type};
write_theme_css( create_colors_css(obj.id, obj.colors) );
}
}
var get_themes_config = function (url) {
fetch(url, {
method: 'get',
headers: {
'Accept': 'application/json',
},
}).then(function(response) {
if (!response.ok) {
throw new Error('server error');
}
return response.json();
}).then(function(response) {
if ( response.then ) {
// return response.json();
} else {
parse_themes_object(response);
/* to break promises chain */
throw new Error('loaded');
}
}).catch(function(e) {
if ( e.message == 'loaded' ) {
} else console.log('fetch error: ' + e);
});
}
var on_document_ready = function (el) {
// get_themes_config('../../common/main/resources/themes/themes.json')
}
return {
init: function (api) {
var me = this;
$(window).on('storage', function (e) {
if ( e.key == 'ui-theme' ) {
me.setTheme(e.originalEvent.newValue);
}
})
this.api = api;
var theme_name = Common.localStorage.getItem('ui-theme');
if ( !themes_map[theme_name] )
theme_name = id_default_light_theme;
if ( !$('body').hasClass(theme_name) ) {
$('body').addClass(theme_name);
}
var obj = get_current_theme_colors(name_colors);
obj.type = themes_map[theme_name].type;
obj.name = theme_name;
api.asc_setSkin(obj);
Common.NotificationCenter.on('document:ready', on_document_ready.bind(this));
},
available: function () {
return !Common.Utils.isIE && !this.locked;
},
setAvailable: function (value) {
this.locked = value;
},
map: function () {
return themes_map
},
get: function (id) {
return themes_map[id]
},
currentThemeId: function () {
return Common.localStorage.getItem('ui-theme') || id_default_light_theme;
},
defaultThemeId: function (type) {
return type == 'dark' ? id_default_dark_theme : id_default_light_theme;
},
defaultTheme: function (type) {
return themes_map[this.defaultThemeId(type)]
},
isDarkTheme: function () {
return themes_map[this.currentThemeId()].type == 'dark';
},
setTheme: function (id, force) {
if ( (this.currentThemeId() != id || force) && !!themes_map[id] ) {
var classname = document.body.className.replace(/theme-\w+\s?/, '');
document.body.className = classname;
$('body').addClass(id);
var obj = get_current_theme_colors(name_colors);
obj.type = themes_map[id].type;
obj.name = id;
this.api.asc_setSkin(obj);
Common.localStorage.setItem('ui-theme', id);
Common.NotificationCenter.trigger('uitheme:changed', id);
}
},
toggleTheme: function () {
this.setTheme( this.isDarkTheme() ? id_default_light_theme : id_default_dark_theme );
}
}
})(Common.UI.Themes);
});

View file

@ -65,6 +65,17 @@ function onDropDownKeyDown(e) {
$parent.trigger(afterEvent);
}
function checkFocusedItem(cmp, item) {
var innerHeight = cmp.innerHeight(),
padding = (innerHeight - cmp.height())/2,
pos = item.position().top,
itemHeight = item.outerHeight();
if (pos<0)
cmp.scrollTop(cmp.scrollTop() + pos - padding);
else if (pos+itemHeight>innerHeight)
cmp.scrollTop(cmp.scrollTop() + pos + itemHeight - innerHeight + padding);
}
function patchDropDownKeyDown(e) {
if (!/(38|40|27|37|39)/.test(e.keyCode)) return;
@ -128,6 +139,8 @@ function patchDropDownKeyDown(e) {
if ($parent.hasClass('dropdown-submenu') && $parent.hasClass('over'))
$parent.addClass('focused-submenu'); // for Safari. When focus go from parent menuItem to it's submenu don't hide this submenu
checkFocusedItem($this, $items.eq(index));
$items.eq(index).focus();
}
}

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

@ -61,7 +61,7 @@ define([
EditorsSupport: ["word", "cell", "slide"],
isVisual: false,
isCustomWindow: false,
isModal: false,
isModal: true,
isInsideMode: false,
initDataType: 0,
initData: "",

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,13 +69,11 @@
<div class="edit-ct">
<% if (editable) { %>
<div class="btn-edit img-commonctrl"></div>
<% } %>
<% if (removable) { %>
<div class="btn-delete img-commonctrl"></div>
<% } %>
<% if (resolved) { %>
<div class="btn-resolve-check img-commonctrl" data-toggle="tooltip"></div>
<% } else { %>
<div class="btn-resolve img-commonctrl" data-toggle="tooltip"></div>
<% } %>
<div class="btn-resolve <% if (resolved) print('comment-resolved') %>" data-toggle="tooltip"></div>
</div>
<% } %>

View file

@ -36,7 +36,9 @@
<div class="btns-reply-ct">
<% if (item.get("editable")) { %>
<div class="btn-edit img-commonctrl" data-value="<%=item.get("id")%>"></div>
<div class="btn-delete 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,13 +70,11 @@
<div class="edit-ct">
<% if (editable) { %>
<div class="btn-edit img-commonctrl"></div>
<% } %>
<% if (removable) { %>
<div class="btn-delete img-commonctrl"></div>
<% } %>
<% if (resolved) { %>
<div class="btn-resolve-check img-commonctrl" data-toggle="tooltip"></div>
<% } else { %>
<div class="btn-resolve img-commonctrl" data-toggle="tooltip"></div>
<% } %>
<div class="btn-resolve <% if (resolved) print('comment-resolved') %>" data-toggle="tooltip"></div>
</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,39 @@ 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',
textLineMarker: 'Line with markers',
textLineStackedMarker: 'Stacked line with markers',
textLineStackedPerMarker: '100% Stacked line with markers',
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',
textScatterSmoothMarker: 'Scatter with smooth lines and markers',
textScatterSmooth: 'Scatter with smooth lines',
textScatterLineMarker: 'Scatter with straight lines and markers',
textScatterLine: 'Scatter with straight lines',
textComboBarLine: 'Clustered column - line',
textComboBarLineSecondary: 'Clustered column - line on secondary axis',
textComboAreaBar: 'Stacked area - clustered column',
textComboCustom: 'Custom combination',
getChartGroupData: function(headername) {
return [
@ -438,39 +471,51 @@ define(function(){ 'use strict';
{id: 'menu-chart-group-pie', caption: this.textPie},
{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-scatter', caption: this.textPoint},
{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.lineNormalMarker, iconCls: 'line-normal-marker', tip: this.textLineMarker},
{ group: 'menu-chart-group-line', type: Asc.c_oAscChartTypeSettings.lineStackedMarker, iconCls: 'line-stack-marker', tip: this.textLineStackedMarker},
{ group: 'menu-chart-group-line', type: Asc.c_oAscChartTypeSettings.lineStackedPerMarker,iconCls: 'line-pstack-marker', tip: this.textLineStackedPerMarker},
{ 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-scatter', type: Asc.c_oAscChartTypeSettings.scatterSmoothMarker,iconCls: 'point-smooth-marker', tip: this.textScatterSmoothMarker},
{ group: 'menu-chart-group-scatter', type: Asc.c_oAscChartTypeSettings.scatterSmooth, iconCls: 'point-smooth', tip: this.textScatterSmooth},
{ group: 'menu-chart-group-scatter', type: Asc.c_oAscChartTypeSettings.scatterLineMarker, iconCls: 'point-line-marker', tip: this.textScatterLineMarker},
{ group: 'menu-chart-group-scatter', type: Asc.c_oAscChartTypeSettings.scatterLine, iconCls: 'point-line', tip: this.textScatterLine},
{ 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

@ -0,0 +1,41 @@
function checkScaling() {
var str_mq_150 = "screen and (-webkit-min-device-pixel-ratio: 1.5) and (-webkit-max-device-pixel-ratio: 1.9), " +
"screen and (min-resolution: 1.5dppx) and (max-resolution: 1.9dppx)";
if ( window.matchMedia(str_mq_150).matches ) {
document.body.classList.add('pixel-ratio__1_5');
}
if ( !window.matchMedia("screen and (-webkit-device-pixel-ratio: 1.5)," +
"screen and (-webkit-device-pixel-ratio: 1)," +
"screen and (-webkit-device-pixel-ratio: 2)").matches )
{
// don't add zoom for mobile devices
if (!(/android|avantgo|playbook|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent || navigator.vendor || window.opera)))
document.getElementsByTagName('html')[0].setAttribute('style', 'zoom: ' + (1 / window.devicePixelRatio) + ';');
}
}
checkScaling();
var params = (function() {
var e,
a = /\+/g, // Regex for replacing addition symbol with a space
r = /([^&=]+)=?([^&]*)/g,
d = function (s) { return decodeURIComponent(s.replace(a, " ")); },
q = window.location.search.substring(1),
urlParams = {};
while (e = r.exec(q))
urlParams[d(e[1])] = d(e[2]);
return urlParams;
})();
if ( !!params.uitheme && localStorage.getItem("ui-theme") != params.uitheme)
localStorage.setItem("ui-theme", params.uitheme);
var ui_theme_name = localStorage.getItem("ui-theme");
if ( !!ui_theme_name ) {
document.body.classList.add(ui_theme_name);
}

View file

@ -119,37 +119,51 @@ Common.Utils = _.extend(new(function() {
isMobile = /android|avantgo|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent || navigator.vendor || window.opera),
me = this,
checkSize = function() {
me.zoom = 1;
if (isChrome && !isOpera && !isMobile && document && document.firstElementChild && document.body) {
// делаем простую проверку
// считаем: 0 < window.devicePixelRatio < 2 => _devicePixelRatio = 1; zoom = window.devicePixelRatio / _devicePixelRatio;
// считаем: window.devicePixelRatio >= 2 => _devicePixelRatio = 2; zoom = window.devicePixelRatio / _devicePixelRatio;
if (window.devicePixelRatio > 0.1) {
if (window.devicePixelRatio < 1.99)
{
var _devicePixelRatio = 1;
me.zoom = window.devicePixelRatio / _devicePixelRatio;
}
else
{
var _devicePixelRatio = 2;
me.zoom = window.devicePixelRatio / _devicePixelRatio;
}
// chrome 54.x: zoom = "reset" - clear retina zoom (windows)
//document.firstElementChild.style.zoom = "reset";
document.firstElementChild.style.zoom = 1.0 / me.zoom; }
else
document.firstElementChild.style.zoom = "normal";
var scale = {};
if ( !!window.AscCommon && !!window.AscCommon.checkDeviceScale ) {
scale = window.AscCommon.checkDeviceScale();
AscCommon.correctApplicationScale(scale);
} else {
var str_mq_150 = "screen and (-webkit-min-device-pixel-ratio: 1.5) and (-webkit-max-device-pixel-ratio: 1.9), " +
"screen and (min-resolution: 1.5dppx) and (max-resolution: 1.9dppx)";
var str_mq_200 = "screen and (-webkit-min-device-pixel-ratio: 2), " +
"screen and (min-resolution: 2dppx), screen and (min-resolution: 192dpi)";
if ( window.matchMedia(str_mq_150).matches ) {
scale.devicePixelRatio = 1.5;
} else
if ( window.matchMedia(str_mq_200).matches )
scale.devicePixelRatio = 2;
else scale.devicePixelRatio = 1;
}
var $root = $(document.body);
if ( scale.devicePixelRatio < 1.5 ) {
$root.removeClass('pixel-ratio__1_5 pixel-ratio__2');
} else
if ( !(scale.devicePixelRatio < 1.5) && scale.devicePixelRatio < 2 ) {
$root.removeClass('pixel-ratio__2');
$root.addClass('pixel-ratio__1_5');
} else {
$root.addClass('pixel-ratio__2');
$root.removeClass('pixel-ratio__1_5');
}
me.zoom = scale.correct ? scale.zoom : 1;
me.innerWidth = window.innerWidth * me.zoom;
me.innerHeight = window.innerHeight * me.zoom;
me.applicationPixelRatio = scale.applicationPixelRatio || scale.devicePixelRatio;
};
me.zoom = 1;
me.applicationPixelRatio = 1;
me.innerWidth = window.innerWidth;
me.innerHeight = window.innerHeight;
checkSize();
$(window).on('resize', checkSize);
if ( isIE )
$(document.body).addClass('ie');
else {
checkSize();
$(window).on('resize', checkSize);
}
return {
checkSize: checkSize,
@ -216,6 +230,7 @@ Common.Utils = _.extend(new(function() {
documentSettingsType: documentSettingsType,
importTextType: importTextType,
zoom: function() {return me.zoom;},
applicationPixelRatio: function() {return me.applicationPixelRatio;},
topOffset: 0,
innerWidth: function() {return me.innerWidth;},
innerHeight: function() {return me.innerHeight;},
@ -714,6 +729,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;
};
@ -967,8 +983,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;
@ -994,6 +1014,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

@ -86,6 +86,8 @@ define([
var $window = this.getChild();
$window.find('.dlg-btn').on('click', _.bind(this.onDlgBtnClick, this));
this.on('animate:after', _.bind(this.onAnimateAfter, this));
this.btnsCategory = [];
_.each($window.find('.btn-category'), function(item, index) {
var btnEl = $(item);
@ -173,6 +175,10 @@ define([
if (this.storageName)
Common.localStorage.setItem(this.storageName, this.getActiveCategory());
Common.UI.Window.prototype.close.call(this, suppressevent);
},
onAnimateAfter: function() {
}
}, Common.Views.AdvancedSettingsWindow || {}));
});

View file

@ -77,7 +77,7 @@ define([
'<div class="user-name" data-can-copy="true">',
'<div class="color" style="display: inline-block; background-color: <% if (msg.get("usercolor")!==null) { %><%=msg.get("usercolor")%><% } else { %> #cfcfcf <% } %>; " ></div><%= scope.getUserName(msg.get("username")) %>',
'</div>',
'<label class="message user-select" data-can-copy="true"><%= msg.get("message") %></label>',
'<label class="message user-select" data-can-copy="true" tabindex="-1" oo_editor_input="true"><%= msg.get("message") %></label>',
'<% } %>',
'</li>'].join(''),

View file

@ -272,16 +272,8 @@ define([
me.fireEvent('comment:resolve', [commentId]);
readdresolves();
} else if (btn.hasClass('btn-resolve-check', false)) {
var tip = btn.data('bs.tooltip');
if (tip) tip.dontShow = true;
me.fireEvent('comment:resolve', [commentId]);
readdresolves();
} else if (!btn.hasClass('msg-reply') &&
!btn.hasClass('btn-resolve-check') &&
!btn.hasClass('btn-resolve')) {
var isTextSelected = false;
if (btn.hasClass('user-message')) {
@ -377,12 +369,12 @@ define([
}
var arr = [],
btns = $(view.el).find('.btn-resolve');
btns = $(view.el).find('.btn-resolve:not(.comment-resolved)');
btns.tooltip({title: me.textResolve, placement: 'cursor'});
btns.each(function(idx, item){
arr.push($(item).data('bs.tooltip').tip());
});
btns = $(view.el).find('.btn-resolve-check');
btns = $(view.el).find('.comment-resolved');
btns.tooltip({title: me.textOpenAgain, placement: 'cursor'});
btns.each(function(idx, item){
arr.push($(item).data('bs.tooltip').tip());

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) {
@ -214,13 +221,15 @@ define([
'</div>');
}
var $parent = this.labelDocName.parent();
var _left_width = $parent.position().left,
_right_width = $parent.next().outerWidth();
if (!config.isEdit || !config.customization || !config.customization.compactHeader) {
var $parent = this.labelDocName.parent();
var _left_width = $parent.position().left,
_right_width = $parent.next().outerWidth();
if ( _left_width < _right_width )
this.labelDocName.parent().css('padding-left', _right_width - _left_width);
else this.labelDocName.parent().css('padding-right', _left_width - _right_width);
if ( _left_width < _right_width )
this.labelDocName.parent().css('padding-left', _right_width - _left_width);
else this.labelDocName.parent().css('padding-right', _left_width - _right_width);
}
}
}
@ -232,6 +241,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 +290,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 +433,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 +500,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 +520,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 +637,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 +690,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;
@ -640,6 +717,18 @@ define([
if ( lock )
$btnUsers.addClass('disabled').attr('disabled', 'disabled'); else
$btnUsers.removeClass('disabled').attr('disabled', '');
} else if ( alias == 'rename-user' ) {
if (me.labelUserName) {
if ( lock ) {
me.labelUserName.removeClass('clickable');
me.labelUserName.addClass('disabled');
} else {
me.labelUserName.addClass('clickable');
me.labelUserName.removeClass('disabled');
}
} else if (me.btnUserName) {
me.btnUserName.setDisabled(lock);
}
} else {
var _lockButton = function (btn) {
if ( btn ) {
@ -691,7 +780,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

@ -87,7 +87,9 @@ define([
'<span class="input-group combobox <%= cls %> combo-langs" id="<%= id %>" style="<%= style %>">',
'<input type="text" class="form-control">',
'<span class="icon input-icon spellcheck-lang toolbar__icon btn-ic-docspell"></span>',
'<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"><span class="caret img-commonctrl"></span></button>',
'<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">',
'<span class="caret" />',
'</button>',
'<ul class="dropdown-menu <%= menuCls %>" style="<%= menuStyle %>" role="menu">',
'<% _.each(items, function(item) { %>',
'<li id="<%= item.id %>" data-value="<%= item.value %>">',

View file

@ -187,7 +187,7 @@ define([
'<div class="input-group combobox input-group-nr <%= cls %>" id="<%= id %>" style="<%= style %>">',
'<div class="form-control" style="padding-top:3px; line-height: 14px; cursor: pointer; <%= style %>"></div>',
'<div style="display: table-cell;"></div>',
'<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"><span class="caret img-commonctrl"></span></button>',
'<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"><span class="caret"></span></button>',
'<ul class="dropdown-menu <%= menuCls %>" style="<%= menuStyle %>" role="menu">'].concat(itemsTemplate).concat([
'</ul>',
'</div>'

View file

@ -99,6 +99,7 @@ define([
type: 'password',
allowBlank : false,
style : 'width: 100%;',
maxLength: 255,
validateOnBlur: false
});
this.repeatPwd = new Common.UI.InputField({
@ -106,6 +107,7 @@ define([
type: 'password',
allowBlank : false,
style : 'width: 100%;',
maxLength: 255,
validateOnBlur: false,
validation : function(value) {
return me.txtIncorrectPwd;
@ -114,13 +116,12 @@ define([
}
},
show: function() {
Common.UI.Window.prototype.show.apply(this, arguments);
getFocusedComponents: function() {
return [this.inputPwd, this.repeatPwd];
},
var me = this;
setTimeout(function(){
me.inputPwd.cmpEl.find('input').focus();
}, 500);
getDefaultFocusableComponent: function () {
return this.inputPwd;
},
onPrimary: function(event) {

View file

@ -151,7 +151,7 @@ define([
var modes = model.get('variations'),
guid = model.get('guid'),
icons = modes[model.get('currentVariation')].get('icons'),
_icon_url = model.get('baseUrl') + icons[((window.devicePixelRatio > 1) ? 1 : 0) + (icons.length>2 ? 2 : 0)],
_icon_url = model.get('baseUrl') + me.parseIcons(icons),
btn = new Common.UI.Button({
cls: 'btn-toolbar x-huge icon-top',
iconImg: _icon_url,
@ -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);
@ -250,6 +250,7 @@ define([
var _btn = model.get('button');
if (_btn) {
_btn.toggle(true);
this.updatePluginButton(model);
if (_btn.menu && _btn.menu.items.length>0) {
_btn.menu.items[0].setCaption(this.textStop);
}
@ -265,6 +266,7 @@ define([
var _btn = model.get('button');
if (_btn) {
_btn.toggle(false);
this.updatePluginButton(model);
if (_btn.menu && _btn.menu.items.length>0) {
_btn.menu.items[0].setCaption(this.textStart);
}
@ -280,6 +282,82 @@ define([
_onAppReady: function (mode) {
},
parseIcons: function(icons) {
if (icons.length && typeof icons[0] !== 'string') {
var theme = Common.UI.Themes.currentThemeId().toLowerCase(),
style = Common.UI.Themes.isDarkTheme() ? 'dark' : 'light',
idx = -1;
for (var i=0; i<icons.length; i++) {
if (icons[i].theme && icons[i].theme.toLowerCase() == theme) {
idx = i;
break;
}
}
if (idx<0)
for (var i=0; i<icons.length; i++) {
if (icons[i].style && icons[i].style.toLowerCase() == style) {
idx = i;
break;
}
}
(idx<0) && (idx = 0);
var ratio = Common.Utils.applicationPixelRatio()*100,
current = icons[idx],
bestDistance = 10000,
currentDistance = 0,
defUrl,
bestUrl;
for (var key in current) {
if (current.hasOwnProperty(key)) {
if (key=='default') {
defUrl = current[key];
} else if (!isNaN(parseInt(key))) {
currentDistance = Math.abs(ratio-parseInt(key));
if (currentDistance < (bestDistance - 0.01))
{
bestDistance = currentDistance;
bestUrl = current[key];
}
}
}
}
(bestDistance>0.01 && defUrl) && (bestUrl = defUrl);
return {
'normal': bestUrl['normal'],
'hover': bestUrl['hover'] || bestUrl['normal'],
'active': bestUrl['active'] || bestUrl['normal']
};
} else { // old version
var url = icons[((Common.Utils.applicationPixelRatio() > 1) ? 1 : 0) + (icons.length > 2 ? 2 : 0)];
return {
'normal': url,
'hover': url,
'active': url
};
}
},
updatePluginIcons: function(model) {
if (!model.get('visible'))
return null;
var modes = model.get('variations'),
icons = modes[model.get('currentVariation')].get('icons');
model.set('parsedIcons', this.parseIcons(icons));
this.updatePluginButton(model);
},
updatePluginButton: function(model) {
if (!model.get('visible'))
return null;
var btn = model.get('button');
if (btn && btn.cmpEl) {
btn.cmpEl.find(".inner-box-icon img").attr("src", model.get('baseUrl') + model.get('parsedIcons')[btn.isActive() ? 'active' : 'normal']);
}
},
createPluginButton: function (model) {
if (!model.get('visible'))
return null;
@ -289,8 +367,9 @@ define([
var modes = model.get('variations'),
guid = model.get('guid'),
icons = modes[model.get('currentVariation')].get('icons'),
icon_url = model.get('baseUrl') + icons[((window.devicePixelRatio > 1) ? 1 : 0) + (icons.length > 2 ? 2 : 0)];
parsedIcons = this.parseIcons(icons),
icon_url = model.get('baseUrl') + parsedIcons['normal'];
model.set('parsedIcons', parsedIcons);
var _menu_items = [];
_.each(model.get('variations'), function(variation, index) {
if (variation.get('visible'))

View file

@ -93,13 +93,6 @@ define([
'</div>' +
'</section>';
function _click_turnpreview(btn, e) {
if (this.appConfig.canReview) {
Common.NotificationCenter.trigger('reviewchanges:turn', btn.pressed ? 'on' : 'off');
Common.NotificationCenter.trigger('edit:complete');
}
};
function setEvents() {
var me = this;
@ -131,7 +124,36 @@ define([
}
this.btnsTurnReview.forEach(function (button) {
button.on('click', _click_turnpreview.bind(me));
button.on('click', function (btn, e) {
Common.NotificationCenter.trigger('reviewchanges:turn', btn.pressed);
Common.NotificationCenter.trigger('edit:complete');
});
!me.appConfig.isReviewOnly && button.menu.on('item:toggle', function (menu, item, state, e) {
if (!!state) {
if (item.value==2) // ON track changes for everyone
Common.UI.warning({
title: me.textWarnTrackChangesTitle,
msg: me.textWarnTrackChanges,
maxwidth: 600,
buttons: [{
value: 'enable',
caption: me.textEnable
}, 'cancel'],
primary: 'enable',
callback: function(btn){
if (btn == 'enable') {
Common.NotificationCenter.trigger('reviewchanges:turn', item.value==0 || item.value==2, item.value>1);
} else {
var old = Common.Utils.InternalSettings.get(me.appPrefix + "track-changes");
me.turnChanges(old==0 || old==2, old>1);
}
Common.NotificationCenter.trigger('edit:complete');
}
});
else
Common.NotificationCenter.trigger('reviewchanges:turn', item.value==0 || item.value==2, item.value>1);
}
});
});
}
if (this.appConfig.canViewReview) {
@ -225,6 +247,7 @@ define([
cls: 'btn-toolbar x-huge icon-top',
iconCls: 'toolbar__icon btn-ic-review',
caption: this.txtTurnon,
split: !this.appConfig.isReviewOnly,
enableToggle: true
});
this.btnsTurnReview = [this.btnTurnOn];
@ -356,6 +379,39 @@ define([
'<% } %></a>');
if ( config.canReview ) {
var idx = Common.Utils.InternalSettings.get(me.appPrefix + "track-changes");
!config.isReviewOnly && me.btnTurnOn.setMenu(
new Common.UI.Menu({items: [
{
caption: me.txtOn,
value: 0,
checkable: true,
checked: idx==0,
toggleGroup: 'menuTurnReviewTlb'
},
{
caption: me.txtOff,
value: 1,
checkable: true,
checked: idx==1,
toggleGroup: 'menuTurnReviewTlb'
},
{
caption: me.txtOnGlobal,
value: 2,
checkable: true,
checked: idx==2,
toggleGroup: 'menuTurnReviewTlb'
},
{
caption: me.txtOffGlobal,
value: 3,
checkable: true,
checked: idx==3,
toggleGroup: 'menuTurnReviewTlb'
}
]})
);
me.btnTurnOn.updateHint(me.tipReview);
if (!me.appConfig.canUseReviewPermissions) {
@ -457,7 +513,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 +521,7 @@ define([
value: 'my'
}
];
if (config.canEditComments)
if (config.canDeleteComments)
items.push({
caption: me.txtCommentRemAll,
value: 'all'
@ -551,7 +607,37 @@ define([
iconCls : 'toolbar__icon btn-ic-review',
hintAnchor : 'top',
hint : this.tipReview,
enableToggle: true
split : !this.appConfig.isReviewOnly,
enableToggle: true,
menu: this.appConfig.isReviewOnly ? false : new Common.UI.Menu({
menuAlign: 'bl-tl',
style: 'margin-top:-5px;',
items: [
{
caption: this.txtOn,
value: 0,
checkable: true,
toggleGroup: 'menuTurnReviewStb'
},
{
caption: this.txtOff,
value: 1,
checkable: true,
toggleGroup: 'menuTurnReviewStb'
},
{
caption: this.txtOnGlobal,
value: 2,
checkable: true,
toggleGroup: 'menuTurnReviewStb'
},
{
caption: this.txtOffGlobal,
value: 3,
checkable: true,
toggleGroup: 'menuTurnReviewStb'
}
]})
});
this.btnsTurnReview.push(button);
@ -587,11 +673,17 @@ define([
return Common.Utils.String.htmlEncode(Common.Utils.UserInfoParser.getParsedName(username));
},
turnChanges: function(state) {
turnChanges: function(state, global) {
this.btnsTurnReview.forEach(function(button) {
if ( button && button.pressed != state ) {
button.toggle(state, true);
}
if (button.menu) {
button.menu.items[0].setChecked(state && !global, true);
button.menu.items[1].setChecked(!state && !global, true);
button.menu.items[2].setChecked(state && !!global, true);
button.menu.items[3].setChecked(!state && !!global, true);
}
}, this);
},
@ -711,7 +803,14 @@ define([
txtCommentRemCurrent: 'Remove Current Comments',
txtCommentRemMyCurrent: 'Remove My Current Comments',
txtCommentRemMy: 'Remove My Comments',
txtCommentRemAll: 'Remove All Comments'
txtCommentRemAll: 'Remove All Comments',
txtOnGlobal: 'ON for me and everyone',
txtOffGlobal: 'OFF for me and everyone',
txtOn: 'ON for me',
txtOff: 'OFF for me',
textWarnTrackChangesTitle: 'Enable Track Changes for everyone?',
textWarnTrackChanges: 'Track Changes will be switched ON for all users with full access. The next time anyone opens the doc, Track Changes will remain enabled.',
textEnable: 'Enable'
}
}()), Common.Views.ReviewChanges || {}));

View file

@ -258,12 +258,12 @@ define([
}
var arr = [],
btns = $(view.el).find('.btn-resolve');
btns = $(view.el).find('.btn-resolve:not(.comment-resolved)');
btns.tooltip({title: me.textResolve, placement: 'cursor'});
btns.each(function (idx, item) {
arr.push($(item).data('bs.tooltip').tip());
});
btns = $(view.el).find('.btn-resolve-check');
btns = $(view.el).find('.comment-resolved');
btns.tooltip({title: me.textOpenAgain, placement: 'cursor'});
btns.each(function (idx, item) {
arr.push($(item).data('bs.tooltip').tip());
@ -451,14 +451,7 @@ define([
readdresolves();
} else if (btn.hasClass('btn-resolve', false)) {
var tip = btn.data('bs.tooltip');
if (tip) tip.dontShow = true;
me.fireEvent('comment:resolve', [commentId]);
readdresolves();
} else if (btn.hasClass('btn-resolve-check', false)) {
} else if (btn.hasClass('btn-resolve')) {
var tip = btn.data('bs.tooltip');
if (tip) tip.dontShow = true;

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 || {}));
});

View file

@ -0,0 +1,6 @@
<svg width="245" height="45" viewBox="0 0 245 45" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M64.7249 13.8022C62.4284 15.6827 61.3173 18.5757 61.3173 22.4089C61.3173 26.2422 62.4284 29.1352 64.7249 31.088C67.0213 33.0408 69.614 33.981 72.6512 33.981C75.6143 33.981 78.2812 33.0408 80.5035 31.088C82.7258 29.2075 83.837 26.3145 83.837 22.4813C83.837 18.5757 82.7258 15.755 80.5035 13.8022C78.2812 11.8494 75.6884 10.9092 72.6512 10.9092C69.614 10.9092 66.9472 11.8494 64.7249 13.8022ZM67.688 28.195C66.725 26.9654 66.2064 25.085 66.2064 22.4089C66.2064 19.8052 66.725 17.8524 67.688 16.7675C68.7251 15.538 69.8362 14.7424 71.0215 14.4531L71.0215 14.4531C71.3178 14.3808 71.6141 14.3085 71.8364 14.3085C72.0586 14.2362 72.2808 14.2362 72.5771 14.2362C72.7253 14.2362 72.8549 14.2542 72.9846 14.2723C73.1142 14.2904 73.2438 14.3085 73.392 14.3085C73.6142 14.3085 73.9105 14.3808 74.2069 14.4531C75.3921 14.7424 76.5033 15.538 77.4663 16.7675C78.4293 17.9971 78.9479 19.8775 78.9479 22.4813C78.9479 25.0126 78.4293 26.9654 77.4663 28.195C76.5033 29.4245 75.3921 30.2201 74.2069 30.5094C74.1561 30.5218 74.1075 30.5342 74.0604 30.5462L74.0601 30.5462L74.0601 30.5462C73.8321 30.6044 73.6375 30.654 73.392 30.654C73.0957 30.7264 72.8734 30.7264 72.5771 30.7264C72.466 30.7264 72.3364 30.7083 72.2067 30.6902C72.0771 30.6721 71.9475 30.654 71.8364 30.654C71.5909 30.654 71.3962 30.6044 71.1682 30.5462L71.168 30.5462L71.1676 30.5461C71.1206 30.5341 71.0721 30.5217 71.0215 30.5094C69.8362 30.2201 68.7251 29.4245 67.688 28.195ZM92.356 11.1262H86.2816V33.6918H90.9485V20.3839L90.8745 16.406H90.9485L92.1338 18.9374L100.134 33.6918H106.209V11.1262H101.542V24.3618L101.616 28.412H101.542L100.356 25.302L92.356 11.1262ZM111.024 11.1262H115.691V29.8585H124.876V33.6918H111.024V11.1262ZM127.395 11.1262H121.987L130.506 24.4341V33.6918H135.173V24.5064L143.544 11.1262H138.581L133.766 19.0097L133.025 20.6009H132.877L132.136 19.0097L127.395 11.1262ZM142.951 22.4089C142.951 18.5757 144.063 15.6827 146.359 13.8022C148.581 11.8494 151.248 10.9092 154.285 10.9092C157.323 10.9092 159.915 11.8494 162.138 13.8022C164.36 15.755 165.471 18.5757 165.471 22.4812C165.471 26.3145 164.36 29.2075 162.138 31.088C159.915 33.0408 157.248 33.981 154.285 33.981C151.248 33.981 148.655 33.0408 146.359 31.088C144.137 29.1352 142.951 26.2422 142.951 22.4089ZM147.841 22.4089C147.841 25.085 148.359 26.9654 149.322 28.195C150.359 29.4245 151.396 30.2201 152.656 30.5094C152.697 30.5196 152.738 30.5298 152.777 30.5398L152.802 30.5462C153.03 30.6044 153.225 30.654 153.471 30.654C153.582 30.654 153.711 30.6721 153.841 30.6902C153.971 30.7083 154.1 30.7264 154.211 30.7264C154.508 30.7264 154.73 30.7264 155.026 30.654C155.272 30.654 155.466 30.6044 155.694 30.5462L155.695 30.5461C155.742 30.5341 155.79 30.5217 155.841 30.5094C157.026 30.2201 158.137 29.4245 159.1 28.195C160.063 26.9654 160.582 25.0126 160.582 22.4812C160.582 19.8775 160.063 17.9971 159.1 16.7675C158.137 15.538 157.026 14.7424 155.841 14.4531C155.545 14.3808 155.248 14.3085 155.026 14.3085C154.878 14.3085 154.748 14.2904 154.619 14.2723C154.489 14.2542 154.359 14.2361 154.211 14.2361C153.915 14.2361 153.693 14.2362 153.471 14.3085C153.248 14.3085 152.952 14.3808 152.656 14.4531C151.47 14.7424 150.359 15.538 149.322 16.7675C148.359 17.8524 147.841 19.8052 147.841 22.4089ZM181.62 11.1262H168.73V33.6918H173.397V24.2171H181.25V20.3839H173.397V14.8871H181.62V11.1262ZM185.102 11.1262H197.991V14.8871H189.769V20.3839H197.621V24.2171H189.769V33.6918H185.102V11.1262ZM200.732 11.1262V33.6918H205.399V11.1262H200.732ZM225.963 11.6323V15.5379C225.148 15.2486 224.333 15.0316 223.444 14.887C222.555 14.7423 221.518 14.67 220.481 14.67C218.036 14.67 216.184 15.3932 214.851 16.9121C213.518 18.3586 212.851 20.239 212.851 22.4811C212.851 24.6509 213.443 26.459 214.703 27.9055C215.962 29.352 217.74 30.1476 220.036 30.1476C220.741 30.1476 221.445 30.0936 222.245 30.0323C222.37 30.0226 222.498 30.0128 222.629 30.003C223.592 29.8583 224.555 29.6413 225.592 29.2074L225.889 33.0406C225.74 33.113 225.518 33.1853 225.296 33.2576C225 33.33 224.703 33.4023 224.333 33.4746C223.95 33.568 223.506 33.6312 223 33.7033L223 33.7033C222.722 33.7428 222.426 33.785 222.111 33.8362C221.222 33.9086 220.333 33.9809 219.37 33.9809H218.999H218.629C215.962 33.8362 213.518 32.8237 211.295 31.0879C209.073 29.2797 207.962 26.459 207.962 22.6981C207.962 19.0095 209.073 16.1165 211.221 14.0914C213.369 12.0663 216.333 11.0537 219.962 11.0537C220.925 11.0537 221.814 11.0537 222.555 11.126C223.26 11.1886 223.91 11.3054 224.6 11.4295L224.601 11.4296C224.708 11.4488 224.816 11.4682 224.926 11.4877C225 11.5238 225.092 11.5419 225.185 11.56C225.277 11.5781 225.37 11.5962 225.444 11.6323C225.539 11.5862 225.633 11.5989 225.747 11.6141C225.811 11.6228 225.882 11.6323 225.963 11.6323ZM243.519 11.1262H229.667V33.6918H243.519V30.1478H234.408V23.7832H242.63V20.3116H234.408V14.6702H243.519V11.1262Z" fill="white"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M21.4402 44.448L1.28816 35.1797C-0.428493 34.3706 -0.428493 33.1201 1.28816 32.3845L8.30407 29.1479L21.3656 35.1797C23.0823 35.9889 25.8438 35.9889 27.4859 35.1797L40.5474 29.1479L47.5633 32.3845C49.2799 33.1936 49.2799 34.4441 47.5633 35.1797L27.4112 44.448C25.8438 45.1836 23.0823 45.1836 21.4402 44.448Z" fill="#FF6F3D"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M21.4402 33.0471L1.28816 23.7788C-0.428493 22.9696 -0.428493 21.7191 1.28816 20.9836L8.15479 17.8206L21.4402 23.9259C23.1569 24.735 25.9184 24.735 27.5605 23.9259L40.8459 17.8206L47.7125 20.9836C49.4292 21.7927 49.4292 23.0432 47.7125 23.7788L27.5605 33.0471C25.8438 33.8562 23.0822 33.8562 21.4402 33.0471Z" fill="#95C038"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M21.4396 21.9387L1.28749 12.6704C-0.429164 11.8612 -0.429164 10.6108 1.28749 9.87517L21.4396 0.606854C23.1562 -0.202285 25.9178 -0.202285 27.5598 0.606854L47.7119 9.87517C49.4285 10.6843 49.4285 11.9348 47.7119 12.6704L27.5598 21.9387C25.8432 22.6743 23.0816 22.6743 21.4396 21.9387Z" fill="#5DC0E8"/>
</svg>

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.3 KiB

View file

@ -0,0 +1,6 @@
<svg width="245" height="45" viewBox="0 0 245 45" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M64.7249 13.8022C62.4284 15.6827 61.3173 18.5757 61.3173 22.4089C61.3173 26.2422 62.4284 29.1352 64.7249 31.088C67.0213 33.0408 69.614 33.981 72.6512 33.981C75.6143 33.981 78.2812 33.0408 80.5035 31.088C82.7258 29.2075 83.837 26.3145 83.837 22.4813C83.837 18.5757 82.7258 15.755 80.5035 13.8022C78.2812 11.8494 75.6884 10.9092 72.6512 10.9092C69.614 10.9092 66.9472 11.8494 64.7249 13.8022ZM67.688 28.195C66.725 26.9654 66.2064 25.085 66.2064 22.4089C66.2064 19.8052 66.725 17.8524 67.688 16.7675C68.7251 15.538 69.8362 14.7424 71.0215 14.4531L71.0215 14.4531C71.3178 14.3808 71.6141 14.3085 71.8364 14.3085C72.0586 14.2362 72.2808 14.2362 72.5771 14.2362C72.7253 14.2362 72.8549 14.2542 72.9846 14.2723C73.1142 14.2904 73.2438 14.3085 73.392 14.3085C73.6142 14.3085 73.9105 14.3808 74.2069 14.4531C75.3921 14.7424 76.5033 15.538 77.4663 16.7675C78.4293 17.9971 78.9479 19.8775 78.9479 22.4813C78.9479 25.0126 78.4293 26.9654 77.4663 28.195C76.5033 29.4245 75.3921 30.2201 74.2069 30.5094C74.1561 30.5218 74.1075 30.5342 74.0604 30.5462L74.0601 30.5462L74.0601 30.5462C73.8321 30.6044 73.6375 30.654 73.392 30.654C73.0957 30.7264 72.8734 30.7264 72.5771 30.7264C72.466 30.7264 72.3364 30.7083 72.2067 30.6902C72.0771 30.6721 71.9475 30.654 71.8364 30.654C71.5909 30.654 71.3962 30.6044 71.1682 30.5462L71.168 30.5462L71.1676 30.5461C71.1206 30.5341 71.0721 30.5217 71.0215 30.5094C69.8362 30.2201 68.7251 29.4245 67.688 28.195ZM92.356 11.1262H86.2816V33.6918H90.9485V20.3839L90.8745 16.406H90.9485L92.1338 18.9374L100.134 33.6918H106.209V11.1262H101.542V24.3618L101.616 28.412H101.542L100.356 25.302L92.356 11.1262ZM111.024 11.1262H115.691V29.8585H124.876V33.6918H111.024V11.1262ZM127.395 11.1262H121.987L130.506 24.4341V33.6918H135.173V24.5064L143.544 11.1262H138.581L133.766 19.0097L133.025 20.6009H132.877L132.136 19.0097L127.395 11.1262ZM142.951 22.4089C142.951 18.5757 144.063 15.6827 146.359 13.8022C148.581 11.8494 151.248 10.9092 154.285 10.9092C157.323 10.9092 159.915 11.8494 162.138 13.8022C164.36 15.755 165.471 18.5757 165.471 22.4812C165.471 26.3145 164.36 29.2075 162.138 31.088C159.915 33.0408 157.248 33.981 154.285 33.981C151.248 33.981 148.655 33.0408 146.359 31.088C144.137 29.1352 142.951 26.2422 142.951 22.4089ZM147.841 22.4089C147.841 25.085 148.359 26.9654 149.322 28.195C150.359 29.4245 151.396 30.2201 152.656 30.5094C152.697 30.5196 152.738 30.5298 152.777 30.5398L152.802 30.5462C153.03 30.6044 153.225 30.654 153.471 30.654C153.582 30.654 153.711 30.6721 153.841 30.6902C153.971 30.7083 154.1 30.7264 154.211 30.7264C154.508 30.7264 154.73 30.7264 155.026 30.654C155.272 30.654 155.466 30.6044 155.694 30.5462L155.695 30.5461C155.742 30.5341 155.79 30.5217 155.841 30.5094C157.026 30.2201 158.137 29.4245 159.1 28.195C160.063 26.9654 160.582 25.0126 160.582 22.4812C160.582 19.8775 160.063 17.9971 159.1 16.7675C158.137 15.538 157.026 14.7424 155.841 14.4531C155.545 14.3808 155.248 14.3085 155.026 14.3085C154.878 14.3085 154.748 14.2904 154.619 14.2723C154.489 14.2542 154.359 14.2361 154.211 14.2361C153.915 14.2361 153.693 14.2362 153.471 14.3085C153.248 14.3085 152.952 14.3808 152.656 14.4531C151.47 14.7424 150.359 15.538 149.322 16.7675C148.359 17.8524 147.841 19.8052 147.841 22.4089ZM181.62 11.1262H168.73V33.6918H173.397V24.2171H181.25V20.3839H173.397V14.8871H181.62V11.1262ZM185.102 11.1262H197.991V14.8871H189.769V20.3839H197.621V24.2171H189.769V33.6918H185.102V11.1262ZM200.732 11.1262V33.6918H205.399V11.1262H200.732ZM225.963 11.6323V15.5379C225.148 15.2486 224.333 15.0316 223.444 14.887C222.555 14.7423 221.518 14.67 220.481 14.67C218.036 14.67 216.184 15.3932 214.851 16.9121C213.518 18.3586 212.851 20.239 212.851 22.4811C212.851 24.6509 213.443 26.459 214.703 27.9055C215.962 29.352 217.74 30.1476 220.036 30.1476C220.741 30.1476 221.445 30.0936 222.245 30.0323C222.37 30.0226 222.498 30.0128 222.629 30.003C223.592 29.8583 224.555 29.6413 225.592 29.2074L225.889 33.0406C225.74 33.113 225.518 33.1853 225.296 33.2576C225 33.33 224.703 33.4023 224.333 33.4746C223.95 33.568 223.506 33.6312 223 33.7033L223 33.7033C222.722 33.7428 222.426 33.785 222.111 33.8362C221.222 33.9086 220.333 33.9809 219.37 33.9809H218.999H218.629C215.962 33.8362 213.518 32.8237 211.295 31.0879C209.073 29.2797 207.962 26.459 207.962 22.6981C207.962 19.0095 209.073 16.1165 211.221 14.0914C213.369 12.0663 216.333 11.0537 219.962 11.0537C220.925 11.0537 221.814 11.0537 222.555 11.126C223.26 11.1886 223.91 11.3054 224.6 11.4295L224.601 11.4296C224.708 11.4488 224.816 11.4682 224.926 11.4877C225 11.5238 225.092 11.5419 225.185 11.56C225.277 11.5781 225.37 11.5962 225.444 11.6323C225.539 11.5862 225.633 11.5989 225.747 11.6141C225.811 11.6228 225.882 11.6323 225.963 11.6323ZM243.519 11.1262H229.667V33.6918H243.519V30.1478H234.408V23.7832H242.63V20.3116H234.408V14.6702H243.519V11.1262Z" fill="#333333"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M21.4402 44.448L1.28816 35.1797C-0.428493 34.3706 -0.428493 33.1201 1.28816 32.3845L8.30407 29.1479L21.3656 35.1797C23.0823 35.9889 25.8438 35.9889 27.4859 35.1797L40.5474 29.1479L47.5633 32.3845C49.2799 33.1936 49.2799 34.4441 47.5633 35.1797L27.4112 44.448C25.8438 45.1836 23.0823 45.1836 21.4402 44.448Z" fill="#FF6F3D"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M21.4402 33.0471L1.28816 23.7788C-0.428493 22.9696 -0.428493 21.7191 1.28816 20.9836L8.15479 17.8206L21.4402 23.9259C23.1569 24.735 25.9184 24.735 27.5605 23.9259L40.8459 17.8206L47.7125 20.9836C49.4292 21.7927 49.4292 23.0432 47.7125 23.7788L27.5605 33.0471C25.8438 33.8562 23.0822 33.8562 21.4402 33.0471Z" fill="#95C038"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M21.4396 21.9387L1.28749 12.6704C-0.429164 11.8612 -0.429164 10.6108 1.28749 9.87517L21.4396 0.606854C23.1562 -0.202285 25.9178 -0.202285 27.5598 0.606854L47.7119 9.87517C49.4285 10.6843 49.4285 11.9348 47.7119 12.6704L27.5598 21.9387C25.8432 22.6743 23.0816 22.6743 21.4396 21.9387Z" fill="#5DC0E8"/>
</svg>

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 254 B

After

Width:  |  Height:  |  Size: 201 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 275 B

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.3 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.4 KiB

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 KiB

After

Width:  |  Height:  |  Size: 8.8 KiB

View file

@ -1,8 +1,8 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 127" version="1.1" width="100" height="127">
<svg width="100" height="127" viewBox="0 0 100 127" fill="none" xmlns="http://www.w3.org/2000/svg">
<symbol id="svg-format-epub">
<path d="M95 23V119C95 119.796 94.6839 120.559 94.1213 121.121C93.5587 121.684 92.7956 122 92 122H8C7.20435 122 6.44129 121.684 5.87868 121.121C5.31607 120.559 5 119.796 5 119V8C5 7.20435 5.31607 6.44129 5.87868 5.87868C6.44129 5.31607 7.20435 5 8 5H77L95 23Z" fill="#5892B6"/>
<path opacity="0.2" d="M95 23H80C79.2044 23 78.4413 22.6839 77.8787 22.1213C77.3161 21.5587 77 20.7956 77 20V5L95 23Z" fill="black"/>
<path d="M40.3218 114H35.3882V105.434H40.3218V106.922H37.2046V108.803H40.105V110.291H37.2046V112.5H40.3218V114ZM43.9312 109.465H44.5288C45.0874 109.465 45.5054 109.355 45.7827 109.137C46.0601 108.914 46.1987 108.592 46.1987 108.17C46.1987 107.744 46.0815 107.43 45.8472 107.227C45.6167 107.023 45.2534 106.922 44.7573 106.922H43.9312V109.465ZM48.0327 108.105C48.0327 109.027 47.7437 109.732 47.1655 110.221C46.5913 110.709 45.7729 110.953 44.7104 110.953H43.9312V114H42.1147V105.434H44.8511C45.8901 105.434 46.6792 105.658 47.2183 106.107C47.7612 106.553 48.0327 107.219 48.0327 108.105ZM56.6226 105.434V110.977C56.6226 111.609 56.48 112.164 56.1948 112.641C55.9136 113.117 55.5054 113.482 54.9702 113.736C54.4351 113.99 53.8022 114.117 53.0718 114.117C51.9702 114.117 51.1147 113.836 50.5054 113.273C49.896 112.707 49.5913 111.934 49.5913 110.953V105.434H51.4019V110.678C51.4019 111.338 51.5347 111.822 51.8003 112.131C52.0659 112.439 52.5054 112.594 53.1187 112.594C53.7124 112.594 54.1421 112.439 54.4077 112.131C54.6772 111.818 54.812 111.33 54.812 110.666V105.434H56.6226ZM58.7202 105.434H61.3862C62.6011 105.434 63.4819 105.607 64.0288 105.955C64.5796 106.299 64.855 106.848 64.855 107.602C64.855 108.113 64.7339 108.533 64.4917 108.861C64.2534 109.189 63.9351 109.387 63.5366 109.453V109.512C64.0796 109.633 64.4702 109.859 64.7085 110.191C64.9507 110.523 65.0718 110.965 65.0718 111.516C65.0718 112.297 64.7886 112.906 64.2222 113.344C63.6597 113.781 62.894 114 61.9253 114H58.7202V105.434ZM60.5366 108.826H61.5913C62.0835 108.826 62.439 108.75 62.6577 108.598C62.8804 108.445 62.9917 108.193 62.9917 107.842C62.9917 107.514 62.8706 107.279 62.6284 107.139C62.3901 106.994 62.0112 106.922 61.4917 106.922H60.5366V108.826ZM60.5366 110.268V112.5H61.7202C62.2202 112.5 62.5894 112.404 62.8276 112.213C63.0659 112.021 63.1851 111.729 63.1851 111.334C63.1851 110.623 62.6772 110.268 61.6616 110.268H60.5366Z" fill="white"/>
<path d="M40.3217 114H35.3881V105.434H40.3217V106.922H37.2045V108.803H40.1049V110.291H37.2045V112.5H40.3217V114ZM43.9311 109.465H44.5287C45.0873 109.465 45.5053 109.355 45.7827 109.137C46.06 108.914 46.1987 108.592 46.1987 108.17C46.1987 107.744 46.0815 107.43 45.8471 107.227C45.6166 107.023 45.2534 106.922 44.7573 106.922H43.9311V109.465ZM48.0327 108.105C48.0327 109.027 47.7436 109.732 47.1655 110.221C46.5912 110.709 45.7729 110.953 44.7104 110.953H43.9311V114H42.1147V105.434H44.851C45.8901 105.434 46.6791 105.658 47.2182 106.107C47.7612 106.553 48.0327 107.219 48.0327 108.105ZM56.6225 105.434V110.977C56.6225 111.609 56.4799 112.164 56.1948 112.641C55.9135 113.117 55.5053 113.482 54.9702 113.736C54.435 113.99 53.8022 114.117 53.0717 114.117C51.9702 114.117 51.1147 113.836 50.5053 113.273C49.8959 112.707 49.5912 111.934 49.5912 110.953V105.434H51.4018V110.678C51.4018 111.338 51.5346 111.822 51.8002 112.131C52.0659 112.439 52.5053 112.594 53.1186 112.594C53.7123 112.594 54.142 112.439 54.4077 112.131C54.6772 111.818 54.812 111.33 54.812 110.666V105.434H56.6225ZM58.7202 105.434H61.3862C62.601 105.434 63.4819 105.607 64.0287 105.955C64.5795 106.299 64.8549 106.848 64.8549 107.602C64.8549 108.113 64.7338 108.533 64.4916 108.861C64.2534 109.189 63.935 109.387 63.5366 109.453V109.512C64.0795 109.633 64.4702 109.859 64.7084 110.191C64.9506 110.523 65.0717 110.965 65.0717 111.516C65.0717 112.297 64.7885 112.906 64.2221 113.344C63.6596 113.781 62.894 114 61.9252 114H58.7202V105.434ZM60.5366 108.826H61.5912C62.0834 108.826 62.4389 108.75 62.6577 108.598C62.8803 108.445 62.9916 108.193 62.9916 107.842C62.9916 107.514 62.8705 107.279 62.6284 107.139C62.3901 106.994 62.0112 106.922 61.4916 106.922H60.5366V108.826ZM60.5366 110.268V112.5H61.7202C62.2202 112.5 62.5893 112.404 62.8276 112.213C63.0659 112.021 63.185 111.729 63.185 111.334C63.185 110.623 62.6772 110.268 61.6616 110.268H60.5366Z" fill="white"/>
<path d="M49 84V49C49 49 40 43 25 42V75C25 75 42 76 49 84Z" fill="white"/>
<path d="M75 75V42C60 43 51 49 51 49V84C58 76 75 75 75 75Z" fill="white"/>
<path d="M77 47V79C77 79 62 79 50 87.3C38 79 23 79 23 79V47H20V82C20 82 33 80 50 88C67 80 80 82 80 82V47H77Z" fill="white"/>

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

View file

@ -0,0 +1,10 @@
<svg width="100" height="127" viewBox="0 0 100 127" fill="none" xmlns="http://www.w3.org/2000/svg">
<symbol id="svg-format-fb2">
<path d="M95 23V119C95 119.796 94.6839 120.559 94.1213 121.121C93.5587 121.684 92.7956 122 92 122H8C7.20435 122 6.44129 121.684 5.87868 121.121C5.31607 120.559 5 119.796 5 119V8C5 7.20435 5.31607 6.44129 5.87868 5.87868C6.44129 5.31607 7.20435 5 8 5H77L95 23Z" fill="#B07408"/>
<path opacity="0.2" d="M95 23H80C79.2044 23 78.4413 22.6839 77.8787 22.1213C77.3161 21.5587 77 20.7956 77 20V5L95 23Z" fill="black"/>
<path d="M41.8652 114H40.0781V105.434H44.9883V106.922H41.8652V109.131H44.7715V110.613H41.8652V114ZM46.6641 105.434H49.3301C50.5449 105.434 51.4258 105.607 51.9727 105.955C52.5234 106.299 52.7988 106.848 52.7988 107.602C52.7988 108.113 52.6777 108.533 52.4355 108.861C52.1973 109.189 51.8789 109.387 51.4805 109.453V109.512C52.0234 109.633 52.4141 109.859 52.6523 110.191C52.8945 110.523 53.0156 110.965 53.0156 111.516C53.0156 112.297 52.7324 112.906 52.166 113.344C51.6035 113.781 50.8379 114 49.8691 114H46.6641V105.434ZM48.4805 108.826H49.5352C50.0273 108.826 50.3828 108.75 50.6016 108.598C50.8242 108.445 50.9355 108.193 50.9355 107.842C50.9355 107.514 50.8145 107.279 50.5723 107.139C50.334 106.994 49.9551 106.922 49.4355 106.922H48.4805V108.826ZM48.4805 110.268V112.5H49.6641C50.1641 112.5 50.5332 112.404 50.7715 112.213C51.0098 112.021 51.1289 111.729 51.1289 111.334C51.1289 110.623 50.6211 110.268 49.6055 110.268H48.4805ZM60.1172 114H54.1289V112.74L56.2793 110.566C56.916 109.914 57.332 109.463 57.5273 109.213C57.7227 108.959 57.8633 108.725 57.9492 108.51C58.0352 108.295 58.0781 108.072 58.0781 107.842C58.0781 107.498 57.9824 107.242 57.791 107.074C57.6035 106.906 57.3516 106.822 57.0352 106.822C56.7031 106.822 56.3809 106.898 56.0684 107.051C55.7559 107.203 55.4297 107.42 55.0898 107.701L54.1055 106.535C54.5273 106.176 54.877 105.922 55.1543 105.773C55.4316 105.625 55.7344 105.512 56.0625 105.434C56.3906 105.352 56.7578 105.311 57.1641 105.311C57.6992 105.311 58.1719 105.408 58.582 105.604C58.9922 105.799 59.3105 106.072 59.5371 106.424C59.7637 106.775 59.877 107.178 59.877 107.631C59.877 108.025 59.8066 108.396 59.666 108.744C59.5293 109.088 59.3145 109.441 59.0215 109.805C58.7324 110.168 58.2207 110.686 57.4863 111.357L56.3848 112.395V112.477H60.1172V114Z" fill="white"/>
<path d="M49 84V49C49 49 40 43 25 42V75C25 75 42 76 49 84Z" fill="white"/>
<path d="M75 75V42C60 43 51 49 51 49V84C58 76 75 75 75 75Z" fill="white"/>
<path d="M77 47V79C77 79 62 79 50 87.3C38 79 23 79 23 79V47H20V82C20 82 33 80 50 88C67 80 80 82 80 82V47H77Z" fill="white"/>
</symbol>
</svg>

After

Width:  |  Height:  |  Size: 2.6 KiB

View file

@ -1,10 +1,10 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 127" version="1.1" width="100" height="127">
<symbol id="svg-format-html">
<svg width="100" height="127" viewBox="0 0 100 127" fill="none" xmlns="http://www.w3.org/2000/svg">
<symbol id="svg-format-html">
<path d="M95 23V119C95 119.796 94.6839 120.559 94.1213 121.121C93.5587 121.684 92.7956 122 92 122H8C7.20435 122 6.44129 121.684 5.87868 121.121C5.31607 120.559 5 119.796 5 119V8C5 7.20435 5.31607 6.44129 5.87868 5.87868C6.44129 5.31607 7.20435 5 8 5H77L95 23Z" fill="#7C9A34"/>
<path opacity="0.2" d="M95 23H80C79.2044 23 78.4413 22.6839 77.8787 22.1213C77.3161 21.5587 77 20.7956 77 20V5L95 23Z" fill="black"/>
<path d="M40.9877 114H39.1771V110.303H35.7845V114H33.9681V105.434H35.7845V108.791H39.1771V105.434H40.9877V114ZM46.4603 114H44.6439V106.945H42.3177V105.434H48.7865V106.945H46.4603V114ZM53.7318 114L51.6693 107.279H51.6166C51.6908 108.646 51.7279 109.559 51.7279 110.016V114H50.1049V105.434H52.5775L54.6049 111.984H54.64L56.7904 105.434H59.2631V114H57.5697V109.945C57.5697 109.754 57.5717 109.533 57.5756 109.283C57.5834 109.033 57.6107 108.369 57.6576 107.291H57.6049L55.3959 114H53.7318ZM61.4252 114V105.434H63.2416V112.5H66.7162V114H61.4252Z" fill="white"/>
<path d="M62 53V57.8L75.5 62.5L62 67.2V72L80 64.2V60.8L62 53Z" fill="white"/>
<path d="M40 75H45.5L59.5 50H54L40 75Z" fill="white"/>
<path d="M19 64.2L37 72V67.2L23.5 62.5L37 57.8V53L19 60.8V64.2Z" fill="white"/>
</symbol>
</symbol>
</svg>

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 727 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

View file

@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" width="85" height="20" fill="none">
<g fill-rule="evenodd" fill="#444"><path d="M20.211 7.003C19.395 7.655 19 8.658 19 9.987s.395 2.332 1.21 3.009S21.947 14 23.026 14c1.053 0 2-.326 2.79-1.003.79-.652 1.184-1.655 1.184-2.984 0-1.354-.395-2.332-1.184-3.009S24.105 6 23.026 6 21 6.326 20.211 7.003zm1.053 4.991c-.342-.426-.526-1.078-.526-2.006 0-.903.184-1.555.526-1.956.368-.426.763-.702 1.184-.803h0c.105-.025.211-.05.289-.05.079-.025.158-.025.263-.025h0a1.03 1.03 0 0 1 .145.013l.145.013c.079 0 .184.025.289.05.421.1.816.376 1.158.803s.526 1.103.526 1.981-.184 1.555-.526 1.981-.737.702-1.158.803l-.052.013c-.081.02-.15.037-.237.037-.105.025-.184.025-.29.025-.04 0-.085-.006-.132-.013h0l-.132-.013c-.087 0-.156-.017-.237-.037h0 0l-.052-.013c-.421-.1-.816-.376-1.184-.803zM30.134 6H28v8h1.639V9.282l-.026-1.41h.026l.416.897L32.866 14H35V6h-1.639v4.718l.026 1.41h-.026l-.416-1.077L30.134 6zm6.186 0H38v6.641h3.5V14h-5.18V6zm5.687 0H40l3.161 4.744V14h1.732v-3.256L48 6h-1.842l-1.787 2.821-.275.538h-.055l-.275-.538L42.007 6zM48 9.987c0-1.329.395-2.332 1.211-2.984C50 6.326 50.947 6 52.026 6s2 .326 2.79 1.003S56 8.658 56 10.013c0 1.329-.395 2.332-1.184 2.984-.79.677-1.737 1.003-2.79 1.003-1.079 0-2-.326-2.816-1.003C48.421 12.32 48 11.317 48 9.987zm1.737 0c0 .928.184 1.58.526 2.006.368.426.737.702 1.184.803.105.025.21.05.289.05.039 0 .086.006.132.013l.132.013c.105 0 .184 0 .289-.025.087 0 .156-.017.237-.037l.038-.009.014-.003c.421-.1.816-.376 1.158-.803s.526-1.103.526-1.981-.184-1.555-.526-1.981-.737-.702-1.158-.803c-.105-.025-.21-.05-.289-.05-.053 0-.099-.006-.145-.013L52 7.154c-.105 0-.184 0-.263.025-.079 0-.184.025-.289.05-.421.1-.816.376-1.184.803-.342.401-.526 1.053-.526 1.956zM62 6h-4.63v8H59v-3.359h2.871V9.282H59V7.359h3V6zm1.37 0H68v1.359h-3v1.923h2.871v1.359H65V14h-1.63V6zm6.13 0v8h1.638V6H69.5zm9 .202v1.363c-.273-.101-.546-.177-.843-.227a5.79 5.79 0 0 0-.967-.076c-.818 0-1.438.252-1.884.782-.446.505-.669 1.161-.669 1.943 0 .757.198 1.388.62 1.893s1.016.782 1.785.782c.236 0 .471-.019.739-.04h0l.129-.01c.322-.05.645-.126.992-.278l.099 1.338c-.05.025-.124.05-.198.076l-.322.076a4.65 4.65 0 0 1-.446.08h0l-.297.046-.917.05h-.248c-.893-.05-1.711-.404-2.455-1.009-.744-.631-1.116-1.615-1.116-2.927 0-1.287.372-2.297 1.091-3.003S75.302 6 76.517 6l.868.025c.236.022.454.063.684.106l.109.02c.025.013.056.019.087.025a.35.35 0 0 1 .087.025c.015-.016.04-.012.074-.007.021.003.046.007.074.007zM85 6h-5v8h5v-1.256h-3.336v-2.231h2.885V9.256h-2.885v-2H85V6z"/><path opacity=".5" d="M1.605 12.508l4.958 2.318c.503.229 1.348.229 1.874 0l4.936-2.307 1.188.557c.525.252.525.641 0 .87l-6.169 2.883c-.48.229-1.325.229-1.828 0L.394 13.945c-.526-.252-.526-.641 0-.87l1.21-.568z"/><path opacity=".75" d="M1.555 8.985l5.008 2.341c.503.229 1.348.229 1.874 0l5.008-2.341 1.161.544c.526.252.526.641 0 .87l-6.169 2.883c-.526.252-1.371.252-1.874 0L.394 10.398c-.526-.252-.526-.641 0-.87l1.161-.543z"/><path d="M6.563 9.825L.394 6.942c-.526-.252-.526-.641 0-.87l6.169-2.883c.525-.252 1.371-.252 1.874 0l6.169 2.883c.525.252.525.641 0 .87L8.437 9.825c-.526.229-1.371.229-1.874 0z"/>
</g><defs />
</svg>

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

View file

@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" width="85" height="20" fill="none">
<g fill-rule="evenodd" fill="#fff"><path d="M20.211 7.003C19.395 7.655 19 8.658 19 9.987s.395 2.332 1.21 3.009S21.947 14 23.026 14c1.053 0 2-.326 2.79-1.003.79-.652 1.184-1.655 1.184-2.984 0-1.354-.395-2.332-1.184-3.009S24.105 6 23.026 6 21 6.326 20.211 7.003zm1.053 4.991c-.342-.426-.526-1.078-.526-2.006 0-.903.184-1.555.526-1.956.368-.426.763-.702 1.184-.803h0c.105-.025.211-.05.289-.05.079-.025.158-.025.263-.025h0a1.03 1.03 0 0 1 .145.013l.145.013c.079 0 .184.025.289.05.421.1.816.376 1.158.803s.526 1.103.526 1.981-.184 1.555-.526 1.981-.737.702-1.158.803l-.052.013c-.081.02-.15.037-.237.037-.105.025-.184.025-.29.025-.04 0-.085-.006-.132-.013h0l-.132-.013c-.087 0-.156-.017-.237-.037h0 0l-.052-.013c-.421-.1-.816-.376-1.184-.803zM30.134 6H28v8h1.639V9.282l-.026-1.41h.026l.416.897L32.866 14H35V6h-1.639v4.718l.026 1.41h-.026l-.416-1.077L30.134 6zm6.186 0H38v6.641h3.5V14h-5.18V6zm5.687 0H40l3.161 4.744V14h1.732v-3.256L48 6h-1.842l-1.787 2.821-.275.538h-.055l-.275-.538L42.007 6zM48 9.987c0-1.329.395-2.332 1.211-2.984C50 6.326 50.947 6 52.026 6s2 .326 2.79 1.003S56 8.658 56 10.013c0 1.329-.395 2.332-1.184 2.984-.79.677-1.737 1.003-2.79 1.003-1.079 0-2-.326-2.816-1.003C48.421 12.32 48 11.317 48 9.987zm1.737 0c0 .928.184 1.58.526 2.006.368.426.737.702 1.184.803.105.025.21.05.289.05.039 0 .086.006.132.013l.132.013c.105 0 .184 0 .289-.025.087 0 .156-.017.237-.037l.038-.009.014-.003c.421-.1.816-.376 1.158-.803s.526-1.103.526-1.981-.184-1.555-.526-1.981-.737-.702-1.158-.803c-.105-.025-.21-.05-.289-.05-.053 0-.099-.006-.145-.013L52 7.154c-.105 0-.184 0-.263.025-.079 0-.184.025-.289.05-.421.1-.816.376-1.184.803-.342.401-.526 1.053-.526 1.956zM62 6h-4.63v8H59v-3.359h2.871V9.282H59V7.359h3V6zm1.37 0H68v1.359h-3v1.923h2.871v1.359H65V14h-1.63V6zm6.13 0v8h1.638V6H69.5zm9 .202v1.363c-.273-.101-.546-.177-.843-.227a5.79 5.79 0 0 0-.967-.076c-.818 0-1.438.252-1.884.782-.446.505-.669 1.161-.669 1.943 0 .757.198 1.388.62 1.893s1.016.782 1.785.782c.236 0 .471-.019.739-.04h0l.129-.01c.322-.05.645-.126.992-.278l.099 1.338c-.05.025-.124.05-.198.076l-.322.076a4.65 4.65 0 0 1-.446.08h0l-.297.046-.917.05h-.248c-.893-.05-1.711-.404-2.455-1.009-.744-.631-1.116-1.615-1.116-2.927 0-1.287.372-2.297 1.091-3.003S75.302 6 76.517 6l.868.025c.236.022.454.063.684.106l.109.02c.025.013.056.019.087.025a.35.35 0 0 1 .087.025c.015-.016.04-.012.074-.007.021.003.046.007.074.007zM85 6h-5v8h5v-1.256h-3.336v-2.231h2.885V9.256h-2.885v-2H85V6z"/><path opacity=".5" d="M1.605 12.508l4.958 2.318c.503.229 1.348.229 1.874 0l4.936-2.307 1.188.557c.525.252.525.641 0 .87l-6.169 2.883c-.48.229-1.325.229-1.828 0L.394 13.945c-.526-.252-.526-.641 0-.87l1.21-.568z"/><path opacity=".75" d="M1.555 8.985l5.008 2.341c.503.229 1.348.229 1.874 0l5.008-2.341 1.161.544c.526.252.526.641 0 .87l-6.169 2.883c-.526.252-1.371.252-1.874 0L.394 10.398c-.526-.252-.526-.641 0-.87l1.161-.543z"/><path d="M6.563 9.825L.394 6.942c-.526-.252-.526-.641 0-.87l6.169-2.883c.525-.252 1.371-.252 1.874 0l6.169 2.883c.525.252.525.641 0 .87L8.437 9.825c-.526.229-1.371.229-1.874 0z"/>
</g><defs />
</svg>

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 285 B

After

Width:  |  Height:  |  Size: 389 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 189 B

After

Width:  |  Height:  |  Size: 277 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 163 B

After

Width:  |  Height:  |  Size: 254 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 162 B

After

Width:  |  Height:  |  Size: 245 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 200 B

After

Width:  |  Height:  |  Size: 296 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 466 B

After

Width:  |  Height:  |  Size: 596 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 143 B

After

Width:  |  Height:  |  Size: 272 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 211 B

After

Width:  |  Height:  |  Size: 327 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 494 B

After

Width:  |  Height:  |  Size: 615 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 171 B

After

Width:  |  Height:  |  Size: 262 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 335 B

After

Width:  |  Height:  |  Size: 472 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 512 B

After

Width:  |  Height:  |  Size: 669 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 550 B

After

Width:  |  Height:  |  Size: 631 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 395 B

After

Width:  |  Height:  |  Size: 552 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 647 B

After

Width:  |  Height:  |  Size: 732 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 958 B

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 185 B

After

Width:  |  Height:  |  Size: 285 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 175 B

After

Width:  |  Height:  |  Size: 289 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 178 B

After

Width:  |  Height:  |  Size: 273 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 199 B

After

Width:  |  Height:  |  Size: 287 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 173 B

After

Width:  |  Height:  |  Size: 256 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 508 B

After

Width:  |  Height:  |  Size: 634 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 421 B

After

Width:  |  Height:  |  Size: 775 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 396 B

After

Width:  |  Height:  |  Size: 536 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 497 B

After

Width:  |  Height:  |  Size: 681 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 147 B

After

Width:  |  Height:  |  Size: 253 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 478 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 291 B

After

Width:  |  Height:  |  Size: 381 B

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