Merge branch 'develop' into feature/forms-editor

This commit is contained in:
Julia Radzhabova 2021-08-27 12:50:11 +03:00 committed by GitHub
commit 0542c3610e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
528 changed files with 52082 additions and 36128 deletions

View file

@ -2,23 +2,21 @@
## web-apps ## web-apps
The frontend for [ONLYOFFICE Document Server][2]. Builds the program interface and allows the user create, edit, save and export text, spreadsheet and presentation documents using the common interface of a document editor. The frontend for [ONLYOFFICE Document Server][2] and [ONLYOFFICE Desktop Editors](https://github.com/ONLYOFFICE/DesktopEditors). Builds the program interface and allows the user create, edit, save and export text documents, spreadsheets, and presentations.
## Previous versions ## Previous versions
Until 2019-10-23 the repository was called web-apps-pro Until 2019-10-23 the repository was called web-apps-pro.
## Project Information ## Project information
Official website: [http://www.onlyoffice.org](http://onlyoffice.org "http://www.onlyoffice.org") Official website: [https://www.onlyoffice.com/](https://www.onlyoffice.com "https://www.onlyoffice.com")
Code repository: [https://github.com/ONLYOFFICE/web-apps](https://github.com/ONLYOFFICE/web-apps "https://github.com/ONLYOFFICE/web-apps") Code repository: [https://github.com/ONLYOFFICE/web-apps](https://github.com/ONLYOFFICE/web-apps "https://github.com/ONLYOFFICE/web-apps")
SaaS version: [http://www.onlyoffice.com](http://www.onlyoffice.com "http://www.onlyoffice.com") ## User feedback and support
## User Feedback and Support If you have any problems with or questions about [ONLYOFFICE Document Server][2], please visit our official forum: [dev.onlyoffice.org][1] or you can ask and answer ONLYOFFICE development questions on [Stack Overflow][3].
If you have any problems with or questions about [ONLYOFFICE Document Server][2], please visit our official forum to find answers to your questions: [dev.onlyoffice.org][1] or you can ask and answer ONLYOFFICE development questions on [Stack Overflow][3].
[1]: http://dev.onlyoffice.org [1]: http://dev.onlyoffice.org
[2]: https://github.com/ONLYOFFICE/DocumentServer [2]: https://github.com/ONLYOFFICE/DocumentServer

View file

@ -136,9 +136,10 @@
label: string (default: "Guest") // postfix for user name label: string (default: "Guest") // postfix for user name
}, },
review: { review: {
hideReviewDisplay: false // hide button Review mode, hideReviewDisplay: false, // hide button Review mode
hoverMode: false, // true - show review balloons on mouse move, not on click on text
showReviewChanges: false, showReviewChanges: false,
reviewDisplay: 'original', reviewDisplay: 'original', // original for viewer, markup for editor
trackChanges: undefined // true/false - open editor with track changes mode on/off, trackChanges: undefined // true/false - open editor with track changes mode on/off,
}, },
chat: true, chat: true,
@ -872,9 +873,9 @@
path += app + "/"; path += app + "/";
path += (config.type === "mobile" || isSafari_mobile) path += (config.type === "mobile" || isSafari_mobile)
? "mobile" ? "mobile"
: (config.type === "embedded") ? "embed" : (config.type === "embedded")
: (app=='documenteditor') && config.document && config.document.permissions && (config.document.permissions.fillForms===true) && ? "embed"
(config.document.permissions.edit === false) && (config.document.permissions.review !== true) && (config.editorConfig.mode !== 'view') ? "forms" : "main"; : "main";
var index = "/index.html"; var index = "/index.html";
if (config.editorConfig) { if (config.editorConfig) {

View file

@ -308,7 +308,7 @@ div {
} }
}; };
postMessageOrigin = fileInfo.PostMessageOrigin; postMessageOrigin = fileInfo.PostMessageOrigin || "*";
if (postMessageOrigin && (typeof postMessageOrigin === 'string') && postMessageOrigin.charAt(postMessageOrigin.length-1)=='/') if (postMessageOrigin && (typeof postMessageOrigin === 'string') && postMessageOrigin.charAt(postMessageOrigin.length-1)=='/')
postMessageOrigin = postMessageOrigin.substring(0, postMessageOrigin.length - 1); postMessageOrigin = postMessageOrigin.substring(0, postMessageOrigin.length - 1);
lang = config.editorConfig.lang; lang = config.editorConfig.lang;

View file

@ -203,12 +203,13 @@ if (window.Common === undefined) {
}); });
}, },
requestRestore: function(version, url) { requestRestore: function(version, url, fileType) {
_postMessage({ _postMessage({
event: 'onRequestRestore', event: 'onRequestRestore',
data: { data: {
version: version, version: version,
url: url url: url,
fileType: fileType
} }
}); });
}, },
@ -273,19 +274,23 @@ if (window.Common === undefined) {
_postMessage({ event: 'onOutdatedVersion' }); _postMessage({ event: 'onOutdatedVersion' });
}, },
downloadAs: function(url) { downloadAs: function(url, fileType) {
_postMessage({ _postMessage({
event: 'onDownloadAs', event: 'onDownloadAs',
data: url data: {
url: url,
fileType: fileType
}
}); });
}, },
requestSaveAs: function(url, title) { requestSaveAs: function(url, title, fileType) {
_postMessage({ _postMessage({
event: 'onRequestSaveAs', event: 'onRequestSaveAs',
data: { data: {
url: url, url: url,
title: title title: title,
fileType: fileType
} }
}); });
}, },

View file

@ -92,6 +92,14 @@
str = num.toString(); str = num.toString();
for (var i=str.length; i<digits; i++) strfill += fill; for (var i=str.length; i<digits; i++) strfill += fill;
return strfill + str; return strfill + str;
},
getKeyByValue: function(obj, value) {
for(var prop in obj) {
if(obj.hasOwnProperty(prop)) {
if(obj[prop] === value)
return prop;
}
}
} }
}; };
})(); })();

View file

@ -693,6 +693,7 @@
font-weight: bold; font-weight: bold;
font-size: 11px; font-size: 11px;
box-shadow: 0 6px 12px rgba(0,0,0,0.175); box-shadow: 0 6px 12px rgba(0,0,0,0.175);
max-width: 350px;
padding: 5px 12px; padding: 5px 12px;
white-space: pre-wrap; white-space: pre-wrap;

View file

@ -49,24 +49,28 @@ define([
'use strict'; 'use strict';
Common.UI.ComboBoxFonts = Common.UI.ComboBox.extend((function() { Common.UI.ComboBoxFonts = Common.UI.ComboBox.extend((function() {
var iconWidth = 302, var iconWidth = 300,
iconHeight = Asc.FONT_THUMBNAIL_HEIGHT || 26, iconHeight = Asc.FONT_THUMBNAIL_HEIGHT || 28,
thumbCanvas = document.createElement('canvas'), thumbCanvas = document.createElement('canvas'),
thumbContext = thumbCanvas.getContext('2d'), thumbContext = thumbCanvas.getContext('2d'),
thumbs = [ thumbs = [
{ratio: 1, path: '../../../../sdkjs/common/Images/fonts_thumbnail.png', width: iconWidth, height: iconHeight}, {ratio: 1, path: '../../../../sdkjs/common/Images/fonts_thumbnail.png', width: iconWidth, height: iconHeight},
{ratio: 1.25, path: '../../../../sdkjs/common/Images/fonts_thumbnail@1.25x.png', width: iconWidth * 1.25, height: iconHeight * 1.25},
{ratio: 1.5, path: '../../../../sdkjs/common/Images/fonts_thumbnail@1.5x.png', width: iconWidth * 1.5, height: iconHeight * 1.5}, {ratio: 1.5, path: '../../../../sdkjs/common/Images/fonts_thumbnail@1.5x.png', width: iconWidth * 1.5, height: iconHeight * 1.5},
{ratio: 1.75, path: '../../../../sdkjs/common/Images/fonts_thumbnail@1.75x.png', width: iconWidth * 1.75, height: iconHeight * 1.75},
{ratio: 2, path: '../../../../sdkjs/common/Images/fonts_thumbnail@2x.png', width: iconWidth * 2, height: iconHeight * 2} {ratio: 2, path: '../../../../sdkjs/common/Images/fonts_thumbnail@2x.png', width: iconWidth * 2, height: iconHeight * 2}
], ],
thumbIdx = 0, thumbIdx = 0,
listItemHeight = 26, listItemHeight = 28,
spriteCols = 1, spriteCols = 1,
applicationPixelRatio = Common.Utils.applicationPixelRatio(); applicationPixelRatio = Common.Utils.applicationPixelRatio();
if (typeof window['AscDesktopEditor'] === 'object') { if (typeof window['AscDesktopEditor'] === 'object') {
thumbs[0].path = window['AscDesktopEditor'].getFontsSprite(''); thumbs[0].path = window['AscDesktopEditor'].getFontsSprite('');
thumbs[1].path = window['AscDesktopEditor'].getFontsSprite('@1.5x'); thumbs[1].path = window['AscDesktopEditor'].getFontsSprite('@1.25x');
thumbs[2].path = window['AscDesktopEditor'].getFontsSprite('@2x'); thumbs[2].path = window['AscDesktopEditor'].getFontsSprite('@1.5x');
thumbs[3].path = window['AscDesktopEditor'].getFontsSprite('@1.75x');
thumbs[4].path = window['AscDesktopEditor'].getFontsSprite('@2x');
} }
var bestDistance = Math.abs(applicationPixelRatio-thumbs[0].ratio); var bestDistance = Math.abs(applicationPixelRatio-thumbs[0].ratio);

View file

@ -214,6 +214,9 @@ define([
me.trigger('render:after', me); me.trigger('render:after', me);
} }
if (this.disabled) {
this.setDisabled(!!this.disabled);
}
return this; return this;
}, },
@ -241,9 +244,10 @@ define([
onResize: function() { onResize: function() {
if (this.openButton) { if (this.openButton) {
var button = $('button', this.openButton.cmpEl); var button = $('button', this.openButton.cmpEl);
button && button.css({ var cntButton = $('.button', this.cmpEl);
width : $('.button', this.cmpEl).width(), button && cntButton.width() > 0 && button.css({
height: $('.button', this.cmpEl).height() width : cntButton.width(),
height: cntButton.height()
}); });
this.openButton.menu.hide(); this.openButton.menu.hide();

View file

@ -251,10 +251,17 @@ Common.UI.HintManager = new(function() {
}; };
var _getHints = function() { var _getHints = function() {
var docH = Common.Utils.innerHeight() - 20,
docW = Common.Utils.innerWidth() - 20,
topSection = _currentLevel !== 0 && $(_currentSection).length > 0 ? $(_currentSection).offset().top : 0,
bottomSection = _currentLevel !== 0 && $(_currentSection).length > 0 ? topSection + $(_currentSection).height() : docH;
if (_currentControls.length === 0) if (_currentControls.length === 0)
_getControls(); _getControls();
_currentControls.forEach(function(item, index) { _currentControls.forEach(function(item, index) {
if (!_isItemDisabled(item)) { if (!_isItemDisabled(item)) {
var leftBorder = 0,
rightBorder = docW;
if ($(_currentSection).prop('id') === 'toolbar' && ($(_currentSection).find('.toolbar-mask').length > 0 || item.closest('.group').find('.toolbar-group-mask').length > 0)) { if ($(_currentSection).prop('id') === 'toolbar' && ($(_currentSection).find('.toolbar-mask').length > 0 || item.closest('.group').find('.toolbar-group-mask').length > 0)) {
return; return;
} }
@ -264,6 +271,15 @@ Common.UI.HintManager = new(function() {
return; return;
} }
} }
if (_currentLevel === 0 && item.closest('.tabs.short').length > 0) {
var blockTabs = item.closest('.tabs.short');
leftBorder = blockTabs.offset().left;
rightBorder = leftBorder + blockTabs.width();
if (!item.hasClass('scroll')) {
leftBorder += 20;
rightBorder -= 20;
}
}
var hint = $('<div style="" class="hint-div">' + item.attr('data-hint-title') + '</div>'); var hint = $('<div style="" class="hint-div">' + item.attr('data-hint-title') + '</div>');
var direction = item.attr('data-hint-direction'); var direction = item.attr('data-hint-direction');
// exceptions // exceptions
@ -277,6 +293,12 @@ Common.UI.HintManager = new(function() {
item.attr('data-hint-direction', 'bottom'); item.attr('data-hint-direction', 'bottom');
} }
} }
var maxHeight = docH;
if ($('#file-menu-panel').is(':visible') && _currentLevel > 1 &&
($('.fms-flex-apply').is(':visible') || $('#fms-flex-apply').is(':visible')) &&
item.closest('.fms-flex-apply').length < 1 && item.closest('#fms-flex-apply').length < 1) {
maxHeight = docH - $('.fms-flex-apply').height();
}
var offsets = item.attr('data-hint-offset'); var offsets = item.attr('data-hint-offset');
var applyOffset = offsets === 'big' ? 6 : (offsets === 'medium' ? 4 : (offsets === 'small' ? 2 : 0)); var applyOffset = offsets === 'big' ? 6 : (offsets === 'medium' ? 4 : (offsets === 'small' ? 2 : 0));
if (applyOffset) { if (applyOffset) {
@ -298,32 +320,31 @@ Common.UI.HintManager = new(function() {
offsets = offsets ? item.attr('data-hint-offset').split(',').map(function (item) { return parseInt(item); }) : [0, 0]; offsets = offsets ? item.attr('data-hint-offset').split(',').map(function (item) { return parseInt(item); }) : [0, 0];
} }
var offset = item.offset(); var offset = item.offset();
if (direction === 'left-top') var top, left;
if (direction === 'left-top') {
top = offset.top - 10 + offsets[0];
left = offset.left - 10 + offsets[1];
} else if (direction === 'top') {
top = offset.top - 18 + offsets[0];
left = offset.left + (item.outerWidth() - 18) / 2 + offsets[1];
} else if (direction === 'right') {
top = offset.top + (item.outerHeight() - 18) / 2 + offsets[0];
left = offset.left + item.outerWidth() + offsets[1];
} else if (direction === 'left') {
top = offset.top + (item.outerHeight() - 18) / 2 + offsets[0];
left = offset.left - 18 + offsets[1];
} else {
top = offset.top + item.outerHeight() + offsets[0];
left = offset.left + (item.outerWidth() - 18) / 2 + offsets[1];
}
if (top < maxHeight && left < docW && top > topSection && top < bottomSection && left > leftBorder && left + 18 < rightBorder) {
hint.css({ hint.css({
top: offset.top - 10 + offsets[0], top: top,
left: offset.left - 10 + offsets[1] left: left
}); });
else if (direction === 'top') $(document.body).append(hint);
hint.css({ }
top: offset.top - 18 + offsets[0],
left: offset.left + (item.outerWidth() - 18) / 2 + offsets[1]
});
else if (direction === 'right')
hint.css({
top: offset.top + (item.outerHeight() - 18) / 2 + offsets[0],
left: offset.left + item.outerWidth() + offsets[1]
});
else if (direction === 'left')
hint.css({
top: offset.top + (item.outerHeight() - 18) / 2 + offsets[0],
left: offset.left - 18 + offsets[1]
});
else
hint.css({
top: offset.top + item.outerHeight() + offsets[0],
left: offset.left + (item.outerWidth() - 18) / 2 + offsets[1]
});
$(document.body).append(hint);
_currentHints.push(hint); _currentHints.push(hint);
} }
@ -350,7 +371,8 @@ Common.UI.HintManager = new(function() {
_lang = mode.lang; _lang = mode.lang;
_getAlphabetLetters(); _getAlphabetLetters();
}, },
'hints:clear': _clearHints 'hints:clear': _clearHints,
'window:resize': _clearHints
}); });
$('#editor_sdk').on('click', function () { $('#editor_sdk').on('click', function () {
_clearHints(); _clearHints();
@ -362,7 +384,7 @@ Common.UI.HintManager = new(function() {
if (e.keyCode == Common.UI.Keys.ALT && _isAlt) { if (e.keyCode == Common.UI.Keys.ALT && _isAlt) {
e.preventDefault(); e.preventDefault();
if (!_hintVisible) { if (!_hintVisible) {
$('input').blur(); // to change value in inputField $('input:focus').blur(); // to change value in inputField
_currentLevel = $('#file-menu-panel').is(':visible') ? 1 : 0; _currentLevel = $('#file-menu-panel').is(':visible') ? 1 : 0;
_setCurrentSection(); _setCurrentSection();
_showHints(); _showHints();
@ -441,7 +463,7 @@ Common.UI.HintManager = new(function() {
} }
} }
} }
if (curr.prop('id') === 'btn-goback' || curr.closest('.btn-slot').prop('id') === 'slot-btn-options' || curr.prop('id') === 'left-btn-thumbs') { if (curr.prop('id') === 'btn-goback' || curr.closest('.btn-slot').prop('id') === 'slot-btn-options' || curr.prop('id') === 'left-btn-thumbs' || curr.hasClass('scroll')) {
_resetToDefault(); _resetToDefault();
return; return;
} }

View file

@ -104,38 +104,44 @@ define([
return this; return this;
}, },
show: function(){ internalShowLoader: function() {
// if (maskeEl || loaderEl) this.ownerEl.append(this.loaderEl);
// return; this.loaderEl.css('min-width', $('.asc-loadmask-title', this.loaderEl).width() + 105);
if (this.ownerEl && this.ownerEl.closest('.asc-window.modal').length==0)
Common.util.Shortcuts.suspendEvents();
},
internalShowMask: function() {
if (!!this.ownerEl.ismasked) return;
this.ownerEl.ismasked = true;
this.ownerEl.append(this.maskeEl);
},
show: function(immediately){
this.internalShowMask();
// The owner is already masked // The owner is already masked
var ownerEl = this.ownerEl, if (!!this.ownerEl.hasloader)
loaderEl = this.loaderEl,
maskeEl = this.maskeEl;
if (!!ownerEl.ismasked)
return this; return this;
ownerEl.ismasked = true; this.ownerEl.hasloader = true;
var me = this; var me = this;
if (me.title != me.options.title) { if (me.title != me.options.title) {
me.options.title = me.title; me.options.title = me.title;
$('.asc-loadmask-title', loaderEl).html(me.title); $('.asc-loadmask-title', this.loaderEl).html(me.title);
} }
// show mask after 500 ms if it wont be hided if (immediately) {
me.timerId = setTimeout(function () { me.internalShowLoader();
ownerEl.append(maskeEl); } else if (!me.timerId) {
ownerEl.append(loaderEl); // show mask after 500 ms if it wont be hided
me.timerId = setTimeout(function () {
// if (ownerEl.height()<1 || ownerEl.width()<1) me.internalShowLoader();
// loaderEl.css({visibility: 'hidden'}); },500);
}
loaderEl.css('min-width', $('.asc-loadmask-title', loaderEl).width() + 105);
if (ownerEl && ownerEl.closest('.asc-window.modal').length==0)
Common.util.Shortcuts.suspendEvents();
},500);
return this; return this;
}, },
@ -146,20 +152,23 @@ define([
clearTimeout(this.timerId); clearTimeout(this.timerId);
this.timerId = 0; this.timerId = 0;
} }
if (ownerEl && ownerEl.ismasked) {
ownerEl && ownerEl.ismasked && this.maskeEl && this.maskeEl.remove();
delete ownerEl.ismasked;
if (ownerEl && ownerEl.hasloader) {
if (ownerEl.closest('.asc-window.modal').length==0 && !Common.Utils.ModalWindow.isVisible()) if (ownerEl.closest('.asc-window.modal').length==0 && !Common.Utils.ModalWindow.isVisible())
Common.util.Shortcuts.resumeEvents(); Common.util.Shortcuts.resumeEvents();
this.maskeEl && this.maskeEl.remove();
this.loaderEl && this.loaderEl.remove(); this.loaderEl && this.loaderEl.remove();
} }
delete ownerEl.ismasked; delete ownerEl.hasloader;
}, },
setTitle: function(title) { setTitle: function(title) {
this.title = title; this.title = title;
if (this.ownerEl && this.ownerEl.ismasked && this.loaderEl){ if (this.ownerEl && this.ownerEl.hasloader && this.loaderEl){
var el = $('.asc-loadmask-title', this.loaderEl); var el = $('.asc-loadmask-title', this.loaderEl);
el.html(title); el.html(title);
this.loaderEl.css('min-width', el.width() + 105); this.loaderEl.css('min-width', el.width() + 105);
@ -173,7 +182,7 @@ define([
updatePosition: function() { updatePosition: function() {
var ownerEl = this.ownerEl, var ownerEl = this.ownerEl,
loaderEl = this.loaderEl; loaderEl = this.loaderEl;
if (ownerEl && ownerEl.ismasked && loaderEl){ if (ownerEl && ownerEl.hasloader && loaderEl){
loaderEl.css({ loaderEl.css({
top : Math.round(ownerEl.height() / 2 - (loaderEl.height() + parseInt(loaderEl.css('padding-top')) + parseInt(loaderEl.css('padding-bottom'))) / 2) + 'px', top : Math.round(ownerEl.height() / 2 - (loaderEl.height() + parseInt(loaderEl.css('padding-top')) + parseInt(loaderEl.css('padding-bottom'))) / 2) + 'px',
left: Math.round(ownerEl.width() / 2 - (loaderEl.width() + parseInt(loaderEl.css('padding-left')) + parseInt(loaderEl.css('padding-right'))) / 2) + 'px' left: Math.round(ownerEl.width() / 2 - (loaderEl.width() + parseInt(loaderEl.css('padding-left')) + parseInt(loaderEl.css('padding-right'))) / 2) + 'px'

View file

@ -588,7 +588,7 @@ define([
if (this.options.additionalAlign) if (this.options.additionalAlign)
this.options.additionalAlign.call(this, menuRoot, left, top); this.options.additionalAlign.call(this, menuRoot, left, top);
else { else {
var _css = {left: Math.ceil(left), top: Math.ceil(top)}; var _css = {left: left, top: top};
if (!(menuH < docH)) _css['margin-top'] = 0; if (!(menuH < docH)) _css['margin-top'] = 0;
menuRoot.css(_css); menuRoot.css(_css);

View file

@ -93,7 +93,7 @@ define([
var _template_tabs = var _template_tabs =
'<section class="tabs">' + '<section class="tabs">' +
'<a class="scroll left"></a>' + '<a class="scroll left" data-hint="0" data-hint-direction="bottom" data-hint-offset="-7, 0" data-hint-title="V"></a>' +
'<ul>' + '<ul>' +
'<% for(var i in items) { %>' + '<% for(var i in items) { %>' +
'<% if (typeof items[i] == "object") { %>' + '<% if (typeof items[i] == "object") { %>' +
@ -105,7 +105,7 @@ define([
'<% } %>' + '<% } %>' +
'<% } %>' + '<% } %>' +
'</ul>' + '</ul>' +
'<a class="scroll right"></a>' + '<a class="scroll right" data-hint="0" data-hint-direction="bottom" data-hint-offset="-7, 0" data-hint-title="R"></a>' +
'</section>'; '</section>';
this.$layout = $(options.template({ this.$layout = $(options.template({

View file

@ -55,6 +55,8 @@ define([
values: [0, 100], values: [0, 100],
colorValues: ['#000000', '#ffffff'], colorValues: ['#000000', '#ffffff'],
currentThumb: 0, currentThumb: 0,
includeSnap: true,
intervalSnap: 5,
thumbTemplate: '<div class="thumb" style="">' + thumbTemplate: '<div class="thumb" style="">' +
'<div class="thumb-top"><div class="thumb-top-inner"></div></div>' + '<div class="thumb-top"><div class="thumb-top-inner"></div></div>' +
'<div class="thumb-bottom"><div class="thumb-bottom-inner"></div></div>' + '<div class="thumb-bottom"><div class="thumb-bottom-inner"></div></div>' +

View file

@ -82,13 +82,14 @@ define([
maxValue: 100, maxValue: 100,
step: 1, step: 1,
value: 100, value: 100,
enableKeyEvents: false enableKeyEvents: false,
direction: 'horizontal' // 'vertical'
}, },
disabled: false, disabled: false,
template : _.template([ template : _.template([
'<div class="slider single-slider" style="">', '<div class="slider single-slider <% if (this.options.direction === \'vertical\') { %>vertical<% } %>" style="">',
'<div class="track"></div>', '<div class="track"></div>',
'<div class="thumb" style=""></div>', '<div class="thumb" style=""></div>',
'<% if (this.options.enableKeyEvents) { %>', '<% if (this.options.enableKeyEvents) { %>',
@ -107,6 +108,7 @@ define([
me.maxValue = me.options.maxValue; me.maxValue = me.options.maxValue;
me.delta = 100/(me.maxValue - me.minValue); me.delta = 100/(me.maxValue - me.minValue);
me.step = me.options.step; me.step = me.options.step;
me.direction = me.options.direction;
if (me.options.el) { if (me.options.el) {
me.render(); me.render();
@ -133,7 +135,7 @@ define([
} }
this.cmpEl.find('.track-center').width(me.options.width - 14); this.cmpEl.find('.track-center').width(me.options.width - 14);
this.cmpEl.width(me.options.width); this.cmpEl[me.direction === 'vertical' ? 'height' : 'width'](me.options.width);
this.thumb = this.cmpEl.find('.thumb'); this.thumb = this.cmpEl.find('.thumb');
@ -141,7 +143,9 @@ define([
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
var pos = Math.max(0, Math.min(100, (Math.round((e.pageX*Common.Utils.zoom() - me.cmpEl.offset().left - me._dragstart) / me.width * 100)))); var pos = Math.max(0, Math.min(100, (Math.round((
me.direction === 'vertical' ? (e.pageY*Common.Utils.zoom() - me.cmpEl.offset().top) : (e.pageX*Common.Utils.zoom() - me.cmpEl.offset().left) - me._dragstart
) / me.width * 100))));
me.setThumbPosition(pos); me.setThumbPosition(pos);
me.lastValue = me.value; me.lastValue = me.value;
@ -162,7 +166,9 @@ define([
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
var pos = Math.max(0, Math.min(100, (Math.round((e.pageX*Common.Utils.zoom() - me.cmpEl.offset().left - me._dragstart) / me.width * 100)))); var pos = Math.max(0, Math.min(100, (Math.round((
me.direction === 'vertical' ? (e.pageY*Common.Utils.zoom() - me.cmpEl.offset().top) : (e.pageX*Common.Utils.zoom() - me.cmpEl.offset().left) - me._dragstart
) / me.width * 100))));
me.setThumbPosition(pos); me.setThumbPosition(pos);
me.lastValue = me.value; me.lastValue = me.value;
@ -174,7 +180,7 @@ define([
var onMouseDown = function (e) { var onMouseDown = function (e) {
if ( me.disabled ) return; if ( me.disabled ) return;
me._dragstart = e.pageX*Common.Utils.zoom() - me.thumb.offset().left - 7; me._dragstart = me.direction === 'vertical' ? (e.pageY*Common.Utils.zoom() - me.thumb.offset().top) : (e.pageX*Common.Utils.zoom() - me.thumb.offset().left) - 7;
me.thumb.addClass('active'); me.thumb.addClass('active');
$(document).on('mouseup', onMouseUp); $(document).on('mouseup', onMouseUp);
@ -187,7 +193,9 @@ define([
var onTrackMouseDown = function (e) { var onTrackMouseDown = function (e) {
if ( me.disabled ) return; if ( me.disabled ) return;
var pos = Math.max(0, Math.min(100, (Math.round((e.pageX*Common.Utils.zoom() - me.cmpEl.offset().left) / me.width * 100)))); var pos = Math.max(0, Math.min(100, (Math.round((
me.direction === 'vertical' ? (e.pageY*Common.Utils.zoom() - me.cmpEl.offset().top) : (e.pageX*Common.Utils.zoom() - me.cmpEl.offset().left)
) / me.width * 100))));
me.setThumbPosition(pos); me.setThumbPosition(pos);
me.lastValue = me.value; me.lastValue = me.value;
@ -245,8 +253,12 @@ define([
return this; return this;
}, },
setThumbPosition: function(x) { setThumbPosition: function(pos) {
this.thumb.css({left: x + '%'}); if (this.direction === 'vertical') {
this.thumb.css({top: pos + '%'});
} else {
this.thumb.css({left: pos + '%'});
}
}, },
setValue: function(value) { setValue: function(value) {
@ -273,6 +285,8 @@ define([
minValue: 0, minValue: 0,
maxValue: 100, maxValue: 100,
values: [0, 100], values: [0, 100],
includeSnap: false,
intervalSnap: undefined,
thumbTemplate: '<div class="thumb" style=""></div>' thumbTemplate: '<div class="thumb" style=""></div>'
}, },
@ -300,8 +314,9 @@ define([
me.minValue = me.options.minValue; me.minValue = me.options.minValue;
me.maxValue = me.options.maxValue; me.maxValue = me.options.maxValue;
me.delta = 100/(me.maxValue - me.minValue); me.delta = 100/(me.maxValue - me.minValue);
me.includeSnap = me.options.includeSnap;
me.intervalSnap = me.options.intervalSnap;
me.thumbs = []; me.thumbs = [];
if (me.options.el) { if (me.options.el) {
me.render(); me.render();
} }
@ -330,9 +345,38 @@ define([
el.find('.track-center').width(me.options.width - 14); el.find('.track-center').width(me.options.width - 14);
el.width(me.options.width); el.width(me.options.width);
var setCenters = function (index) {
if(!me.includeSnap) return;
var n = me.minValue;
var getX = function (position) {
return (0.01 * me.width * position + me.cmpEl.offset().left + me._dragstart)/Common.Utils.zoom();
};
me.centers = [];
_.each(me.thumbs, function (thumb, indexT) {
if ((indexT != index) && (n != thumb.position)) {
me.centers.push(getX((thumb.position - n) / 2 + n));
n = thumb.position;
}
});
if(n != me.maxValue) me.centers.push(getX((me.maxValue - n) / 2 + n));
};
var resetPageX = function (e) {
if(!me.includeSnap) return;
_.each(me.centers, function (x) {
if((e.pageX <= x + me.intervalSnap) && (e.pageX >= x - me.intervalSnap)) {
e.pageX = x;
return;
}
});
};
var onMouseUp = function (e) { var onMouseUp = function (e) {
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
resetPageX(e);
var index = e.data.index, var index = e.data.index,
lastValue = me.thumbs[index].value, lastValue = me.thumbs[index].value,
@ -375,6 +419,7 @@ define([
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
resetPageX(e);
var index = e.data.index, var index = e.data.index,
lastValue = me.thumbs[index].value, lastValue = me.thumbs[index].value,
@ -406,6 +451,7 @@ define([
thumb = me.thumbs[index].thumb; thumb = me.thumbs[index].thumb;
me._dragstart = e.pageX*Common.Utils.zoom() - thumb.offset().left - thumb.width()/2; me._dragstart = e.pageX*Common.Utils.zoom() - thumb.offset().left - thumb.width()/2;
setCenters(index);
me.setActiveThumb(index); me.setActiveThumb(index);
_.each(me.thumbs, function (item, idx) { _.each(me.thumbs, function (item, idx) {
@ -416,6 +462,7 @@ define([
$(document).on('mousemove', null, e.data, me.binding.onMouseMove); $(document).on('mousemove', null, e.data, me.binding.onMouseMove);
}; };
var onTrackMouseUp = function (e) { var onTrackMouseUp = function (e) {
if ( me.disabled || !_.isUndefined(me._dragstart) || me.thumbs.length > 9) return; if ( me.disabled || !_.isUndefined(me._dragstart) || me.thumbs.length > 9) return;

View file

@ -423,6 +423,7 @@ define([
this.setTabVisible('backward'); this.setTabVisible('backward');
} }
} }
Common.NotificationCenter.trigger('hints:clear');
}, },
onProcessMouse: function(data) { onProcessMouse: function(data) {
@ -686,6 +687,14 @@ define([
newHintTab.attr('data-hint-direction', 'top'); newHintTab.attr('data-hint-direction', 'top');
newHintTab.attr('data-hint-offset', 'medium'); newHintTab.attr('data-hint-offset', 'medium');
newHintTab.attr('data-hint-title', 'M'); newHintTab.attr('data-hint-title', 'M');
} },
getWidth: function() {
var width = 21;
this.tabs.forEach(function(tab){
width += tab.$el.width();
});
return width;
},
}); });
}); });

View file

@ -87,7 +87,7 @@ define([
'<% if (me.options.dynamiccolors!==undefined) { %>' + '<% if (me.options.dynamiccolors!==undefined) { %>' +
'<div class="palette-color-spacer" style="width:100%;height:8px;float:left;"></div><div style="padding: 12px;">' + '<div class="palette-color-spacer" style="width:100%;height:8px;float:left;"></div><div style="padding: 12px;">' +
'<% for (var i=0; i<me.options.dynamiccolors; i++) { %>' + '<% for (var i=0; i<me.options.dynamiccolors; i++) { %>' +
'<a class="color-dynamic-<%=i%> dynamic-empty-color" style="background:#ffffff" color="" idx="<%=idx++%>">' + '<a class="color-dynamic-<%=i%> dynamic-empty-color" color="" idx="<%=idx++%>">' +
'<em><span unselectable="on">&#160;</span></em></a>' + '<em><span unselectable="on">&#160;</span></em></a>' +
'<% } %>' + '<% } %>' +
'<% } %>' + '<% } %>' +

View file

@ -1222,7 +1222,8 @@ define([
renderTo : this.sdkViewName, renderTo : this.sdkViewName,
canRequestUsers: (this.mode) ? this.mode.canRequestUsers : undefined, canRequestUsers: (this.mode) ? this.mode.canRequestUsers : undefined,
canRequestSendNotify: (this.mode) ? this.mode.canRequestSendNotify : undefined, canRequestSendNotify: (this.mode) ? this.mode.canRequestSendNotify : undefined,
mentionShare: (this.mode) ? this.mode.mentionShare : true mentionShare: (this.mode) ? this.mode.mentionShare : true,
api: this.api
}); });
this.popover.setCommentsStore(this.popoverComments); this.popover.setCommentsStore(this.popoverComments);
} }

View file

@ -100,9 +100,10 @@ define([
this.panelHistory.$el.find('#history-list').css('padding-bottom', hasChanges ? '45px' : 0); this.panelHistory.$el.find('#history-list').css('padding-bottom', hasChanges ? '45px' : 0);
}, },
onDownloadUrl: function(url) { onDownloadUrl: function(url, fileType) {
if (this.isFromSelectRevision !== undefined) if (this.isFromSelectRevision !== undefined) {
Common.Gateway.requestRestore(this.isFromSelectRevision, url); Common.Gateway.requestRestore(this.isFromSelectRevision, url, fileType);
}
this.isFromSelectRevision = undefined; this.isFromSelectRevision = undefined;
}, },
@ -111,7 +112,7 @@ define([
var btn = $(e.target); var btn = $(e.target);
if (btn && btn.hasClass('revision-restore')) { if (btn && btn.hasClass('revision-restore')) {
if (record.get('isRevision')) if (record.get('isRevision'))
Common.Gateway.requestRestore(record.get('revision')); Common.Gateway.requestRestore(record.get('revision'), undefined, record.get('fileType'));
else { else {
this.isFromSelectRevision = record.get('revision'); this.isFromSelectRevision = record.get('revision');
var fileType = Asc.c_oAscFileType[(record.get('fileType') || '').toUpperCase()] || Asc.c_oAscFileType.DOCX; var fileType = Asc.c_oAscFileType[(record.get('fileType') || '').toUpperCase()] || Asc.c_oAscFileType.DOCX;
@ -136,9 +137,15 @@ define([
this.currentServerVersion = record.get('serverVersion'); this.currentServerVersion = record.get('serverVersion');
if ( _.isEmpty(url) || (urlGetTime - record.get('urlGetTime') > 5 * 60000)) { if ( _.isEmpty(url) || (urlGetTime - record.get('urlGetTime') > 5 * 60000)) {
_.delay(function() { var me = this;
Common.Gateway.requestHistoryData(rev); // получаем url-ы для ревизий if (!me.timerId) {
}, 10); me.timerId = setTimeout(function () {
me.timerId = 0;
},30000);
_.delay(function() {
Common.Gateway.requestHistoryData(rev); // получаем url-ы для ревизий
}, 10);
}
} else { } else {
var commentsController = this.getApplication().getController('Common.Controllers.Comments'); var commentsController = this.getApplication().getController('Common.Controllers.Comments');
if (commentsController) { if (commentsController) {
@ -168,6 +175,11 @@ define([
onSetHistoryData: function(opts) { onSetHistoryData: function(opts) {
if (!this.mode.canUseHistory) return; if (!this.mode.canUseHistory) return;
if (this.timerId) {
clearTimeout(this.timerId);
this.timerId = 0;
}
if (opts.data.error) { if (opts.data.error) {
var config = { var config = {
title: this.notcriticalErrorTitle, title: this.notcriticalErrorTitle,
@ -205,6 +217,7 @@ define([
rev.set('docIdPrev', docIdPrev, {silent: true}); rev.set('docIdPrev', docIdPrev, {silent: true});
} }
rev.set('token', token, {silent: true}); rev.set('token', token, {silent: true});
opts.data.fileType && rev.set('fileType', opts.data.fileType, {silent: true});
} }
} }
var hist = new Asc.asc_CVersionHistory(); var hist = new Asc.asc_CVersionHistory();
@ -217,6 +230,7 @@ define([
hist.asc_setIsRequested(true); hist.asc_setIsRequested(true);
hist.asc_setServerVersion(this.currentServerVersion); hist.asc_setServerVersion(this.currentServerVersion);
this.api.asc_showRevision(hist); this.api.asc_showRevision(hist);
this.currentRev = data.version;
var reviewController = this.getApplication().getController('Common.Controllers.ReviewChanges'); var reviewController = this.getApplication().getController('Common.Controllers.ReviewChanges');
if (reviewController) if (reviewController)

View file

@ -153,7 +153,6 @@ define([
var me = this, var me = this,
win = new Common.Views.PasswordDialog({ win = new Common.Views.PasswordDialog({
api: me.api, api: me.api,
signType: 'invisible',
handler: function(result, props) { handler: function(result, props) {
if (result == 'ok') { if (result == 'ok') {
me.api.asc_setCurrentPassword(props); me.api.asc_setCurrentPassword(props);

View file

@ -109,6 +109,7 @@ define([
Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this)); Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this));
Common.NotificationCenter.on('collaboration:sharing', this.changeAccessRights.bind(this)); Common.NotificationCenter.on('collaboration:sharing', this.changeAccessRights.bind(this));
Common.NotificationCenter.on('collaboration:sharingdeny', this.onLostEditRights.bind(this)); Common.NotificationCenter.on('collaboration:sharingdeny', this.onLostEditRights.bind(this));
Common.NotificationCenter.on('protect:wslock', _.bind(this.onChangeProtectSheet, this));
this.userCollection.on('reset', _.bind(this.onUpdateUsers, this)); this.userCollection.on('reset', _.bind(this.onUpdateUsers, this));
this.userCollection.on('add', _.bind(this.onUpdateUsers, this)); this.userCollection.on('add', _.bind(this.onUpdateUsers, this));
@ -131,8 +132,7 @@ define([
this.api.asc_registerCallback('asc_onUpdateRevisionsChangesPosition', _.bind(this.onApiUpdateChangePosition, this)); this.api.asc_registerCallback('asc_onUpdateRevisionsChangesPosition', _.bind(this.onApiUpdateChangePosition, this));
this.api.asc_registerCallback('asc_onAuthParticipantsChanged', _.bind(this.onAuthParticipantsChanged, this)); this.api.asc_registerCallback('asc_onAuthParticipantsChanged', _.bind(this.onAuthParticipantsChanged, this));
this.api.asc_registerCallback('asc_onParticipantsChanged', _.bind(this.onAuthParticipantsChanged, this)); this.api.asc_registerCallback('asc_onParticipantsChanged', _.bind(this.onAuthParticipantsChanged, this));
this.api.asc_registerCallback('asc_onBeginViewModeInReview', _.bind(this.onBeginViewModeInReview, this)); this.api.asc_registerCallback('asc_onChangeDisplayModeInReview', _.bind(this.onChangeDisplayModeInReview, this));
this.api.asc_registerCallback('asc_onEndViewModeInReview', _.bind(this.onEndViewModeInReview, this));
} }
if (this.appConfig.canReview) if (this.appConfig.canReview)
this.api.asc_registerCallback('asc_onOnTrackRevisionsChange', _.bind(this.onApiTrackRevisionsChange, this)); this.api.asc_registerCallback('asc_onOnTrackRevisionsChange', _.bind(this.onApiTrackRevisionsChange, this));
@ -163,7 +163,7 @@ define([
SetDisabled: function(state) { SetDisabled: function(state) {
if (this.dlgChanges) if (this.dlgChanges)
this.dlgChanges.close(); this.dlgChanges.close();
this.view && this.view.SetDisabled(state, this.langs); this.view && this.view.SetDisabled(state, this.langs, {comments: !!this._state.wsProps['Objects']});
this.setPreviewMode(state); this.setPreviewMode(state);
}, },
@ -181,7 +181,7 @@ define([
onApiShowChange: function (sdkchange) { onApiShowChange: function (sdkchange) {
if (this.getPopover()) { if (this.getPopover()) {
if (sdkchange && sdkchange.length>0) { if (!this.appConfig.reviewHoverMode && sdkchange && sdkchange.length>0) {
var i = 0, var i = 0,
changes = this.readSDKChange(sdkchange), changes = this.readSDKChange(sdkchange),
posX = sdkchange[0].get_X(), posX = sdkchange[0].get_X(),
@ -256,7 +256,8 @@ define([
if ((this.appConfig.canReview || this.appConfig.canViewReview) && _.isUndefined(this.popover)) { if ((this.appConfig.canReview || this.appConfig.canViewReview) && _.isUndefined(this.popover)) {
this.popover = Common.Views.ReviewPopover.prototype.getPopover({ this.popover = Common.Views.ReviewPopover.prototype.getPopover({
reviewStore : this.popoverChanges, reviewStore : this.popoverChanges,
renderTo : this.sdkViewName renderTo : this.sdkViewName,
api: this.api
}); });
this.popover.setReviewStore(this.popoverChanges); this.popover.setReviewStore(this.popoverChanges);
} }
@ -595,7 +596,10 @@ define([
onReviewViewClick: function(menu, item, e) { onReviewViewClick: function(menu, item, e) {
this.turnDisplayMode(item.value); this.turnDisplayMode(item.value);
!this.appConfig.canReview && Common.localStorage.setItem(this.view.appPrefix + "review-mode", item.value); if (!this.appConfig.isEdit && !this.appConfig.isRestrictedEdit)
Common.localStorage.setItem(this.view.appPrefix + "review-mode", item.value); // for viewer
else if (item.value=='markup' || item.value=='simple')
Common.localStorage.setItem(this.view.appPrefix + "review-mode-editor", item.value); // for editor save only markup modes
Common.NotificationCenter.trigger('edit:complete', this.view); Common.NotificationCenter.trigger('edit:complete', this.view);
}, },
@ -685,27 +689,40 @@ define([
turnDisplayMode: function(mode) { turnDisplayMode: function(mode) {
if (this.api) { if (this.api) {
if (mode === 'final') var type = Asc.c_oAscDisplayModeInReview.Edit;
this.api.asc_BeginViewModeInReview(true); switch (mode) {
else if (mode === 'original') case 'final':
this.api.asc_BeginViewModeInReview(false); type = Asc.c_oAscDisplayModeInReview.Final;
else break;
this.api.asc_EndViewModeInReview(); case 'original':
type = Asc.c_oAscDisplayModeInReview.Original;
break;
case 'simple':
type = Asc.c_oAscDisplayModeInReview.Simple;
break;
}
this.api.asc_SetDisplayModeInReview(type);
} }
this.disableEditing(mode == 'final' || mode == 'original'); this.disableEditing(mode == 'final' || mode == 'original');
this._state.previewMode = (mode == 'final' || mode == 'original'); this._state.previewMode = (mode == 'final' || mode == 'original');
}, },
onBeginViewModeInReview: function(mode) { onChangeDisplayModeInReview: function(type) {
this.disableEditing(true); this.disableEditing(type===Asc.c_oAscDisplayModeInReview.Final || type===Asc.c_oAscDisplayModeInReview.Original);
this.view && this.view.turnDisplayMode(mode ? 'final' : 'original'); var mode = 'markup';
this._state.previewMode = true; switch (type) {
}, case Asc.c_oAscDisplayModeInReview.Final:
mode = 'final';
onEndViewModeInReview: function() { break;
this.disableEditing(false); case Asc.c_oAscDisplayModeInReview.Original:
this.view && this.view.turnDisplayMode('markup'); mode = 'original';
this._state.previewMode = false; break;
case Asc.c_oAscDisplayModeInReview.Simple:
mode = 'simple';
break;
}
this.view && this.view.turnDisplayMode(mode);
this._state.previewMode = (type===Asc.c_oAscDisplayModeInReview.Final || type===Asc.c_oAscDisplayModeInReview.Original);
}, },
isPreviewChangesMode: function() { isPreviewChangesMode: function() {
@ -807,7 +824,15 @@ define([
me.onApiTrackRevisionsChange(me.api.asc_GetLocalTrackRevisions(), me.api.asc_GetGlobalTrackRevisions()); me.onApiTrackRevisionsChange(me.api.asc_GetLocalTrackRevisions(), me.api.asc_GetGlobalTrackRevisions());
me.api.asc_HaveRevisionsChanges() && me.view.markChanges(true); me.api.asc_HaveRevisionsChanges() && me.view.markChanges(true);
// _setReviewStatus(state, global); var val = Common.localStorage.getItem(me.view.appPrefix + "review-mode-editor");
if (val===null) {
val = me.appConfig.customization && me.appConfig.customization.review ? me.appConfig.customization.review.reviewDisplay : undefined;
!val && (val = me.appConfig.customization ? me.appConfig.customization.reviewDisplay : undefined);
val = /^(original|final|markup|simple)$/i.test(val) ? val.toLocaleLowerCase() : 'markup';
}
me.turnDisplayMode(val); // load display mode for all modes (viewer or editor)
me.view.turnDisplayMode(val);
if ( typeof (me.appConfig.customization) == 'object' && (me.appConfig.customization.review && me.appConfig.customization.review.showReviewChanges==true || if ( typeof (me.appConfig.customization) == 'object' && (me.appConfig.customization.review && me.appConfig.customization.review.showReviewChanges==true ||
(!me.appConfig.customization.review || me.appConfig.customization.review.showReviewChanges===undefined) && me.appConfig.customization.showReviewChanges==true) ) { (!me.appConfig.customization.review || me.appConfig.customization.review.showReviewChanges===undefined) && me.appConfig.customization.showReviewChanges==true) ) {
@ -823,14 +848,14 @@ define([
} else if (config.canViewReview) { } else if (config.canViewReview) {
config.canViewReview = (config.isEdit || me.api.asc_HaveRevisionsChanges(true)); // check revisions from all users config.canViewReview = (config.isEdit || me.api.asc_HaveRevisionsChanges(true)); // check revisions from all users
if (config.canViewReview) { if (config.canViewReview) {
var val = Common.localStorage.getItem(me.view.appPrefix + "review-mode"); var val = Common.localStorage.getItem(me.view.appPrefix + (config.isEdit || config.isRestrictedEdit ? "review-mode-editor" : "review-mode"));
if (val===null) { if (val===null) {
val = me.appConfig.customization && me.appConfig.customization.review ? me.appConfig.customization.review.reviewDisplay : undefined; val = me.appConfig.customization && me.appConfig.customization.review ? me.appConfig.customization.review.reviewDisplay : undefined;
!val && (val = me.appConfig.customization ? me.appConfig.customization.reviewDisplay : undefined); !val && (val = me.appConfig.customization ? me.appConfig.customization.reviewDisplay : undefined);
val = /^(original|final|markup)$/i.test(val) ? val.toLocaleLowerCase() : 'original'; val = /^(original|final|markup|simple)$/i.test(val) ? val.toLocaleLowerCase() : (config.isEdit || config.isRestrictedEdit ? 'markup' : 'original');
} }
me.turnDisplayMode((config.isEdit || config.isRestrictedEdit) ? 'markup' : val); // load display mode only in viewer me.turnDisplayMode(val);
me.view.turnDisplayMode((config.isEdit || config.isRestrictedEdit) ? 'markup' : val); me.view.turnDisplayMode(val);
} }
} }
@ -840,10 +865,19 @@ define([
me.view.turnChat(state); me.view.turnChat(state);
}); });
} }
me.onChangeProtectSheet();
if (me.view) { if (me.view) {
me.view.btnCommentRemove && me.view.btnCommentRemove.setDisabled(!Common.localStorage.getBool(me.view.appPrefix + "settings-livecomment", true)); me.view.btnCommentRemove && me.view.btnCommentRemove.setDisabled(!Common.localStorage.getBool(me.view.appPrefix + "settings-livecomment", true) || !!this._state.wsProps['Objects']);
me.view.btnCommentResolve && me.view.btnCommentResolve.setDisabled(!Common.localStorage.getBool(me.view.appPrefix + "settings-livecomment", true)); me.view.btnCommentResolve && me.view.btnCommentResolve.setDisabled(!Common.localStorage.getBool(me.view.appPrefix + "settings-livecomment", true) || !!this._state.wsProps['Objects']);
} }
var val = Common.localStorage.getItem(me.view.appPrefix + "settings-review-hover-mode");
if (val === null) {
val = me.appConfig.customization && me.appConfig.customization.review ? !!me.appConfig.customization.review.hoverMode : false;
} else
val = !!parseInt(val);
Common.Utils.InternalSettings.set(me.view.appPrefix + "settings-review-hover-mode", val);
me.appConfig.reviewHoverMode = val;
}, },
showTips: function(strings) { showTips: function(strings) {
@ -974,8 +1008,24 @@ define([
commentsShowHide: function(mode) { commentsShowHide: function(mode) {
if (!this.view) return; if (!this.view) return;
var value = Common.Utils.InternalSettings.get(this.view.appPrefix + "settings-livecomment"); var value = Common.Utils.InternalSettings.get(this.view.appPrefix + "settings-livecomment");
(value!==undefined) && this.view.btnCommentRemove && this.view.btnCommentRemove.setDisabled(mode != 'show' && !value); (value!==undefined) && this.view.btnCommentRemove && this.view.btnCommentRemove.setDisabled(mode != 'show' && !value || !!this._state.wsProps['Objects']);
(value!==undefined) && this.view.btnCommentResolve && this.view.btnCommentResolve.setDisabled(mode != 'show' && !value); (value!==undefined) && this.view.btnCommentResolve && this.view.btnCommentResolve.setDisabled(mode != 'show' && !value || !!this._state.wsProps['Objects']);
},
onChangeProtectSheet: function(props) {
if (!props) {
var wbprotect = this.getApplication().getController('WBProtection');
props = wbprotect ? wbprotect.getWSProps() : null;
}
this._state.wsProps = props ? props.wsProps : {};
this._state.wsLock = props ? props.wsLock : false;
if (!this.view) return;
var leftmenu = this.getApplication().getController('LeftMenu'),
isCommentsVisible = leftmenu && leftmenu.isCommentsVisible();
var value = Common.Utils.InternalSettings.get(this.view.appPrefix + "settings-livecomment");
(value!==undefined) && this.view.btnCommentRemove && this.view.btnCommentRemove.setDisabled(!isCommentsVisible && !value || !!this._state.wsProps['Objects']);
(value!==undefined) && this.view.btnCommentResolve && this.view.btnCommentResolve.setDisabled(!isCommentsVisible && !value || !!this._state.wsProps['Objects']);
}, },
textInserted: '<b>Inserted:</b>', textInserted: '<b>Inserted:</b>',

View file

@ -245,6 +245,16 @@ define([
this.api = api; this.api = api;
var theme_name = get_ui_theme_name(Common.localStorage.getItem('ui-theme')); var theme_name = get_ui_theme_name(Common.localStorage.getItem('ui-theme'));
if ( !theme_name ) {
if ( !(Common.Utils.isIE10 || Common.Utils.isIE11) )
for (var i of document.body.classList.entries()) {
if ( i[1].startsWith('theme-') && !i[1].startsWith('theme-type-') ) {
theme_name = i[1];
break;
}
}
}
if ( !themes_map[theme_name] ) if ( !themes_map[theme_name] )
theme_name = id_default_light_theme; theme_name = id_default_light_theme;
@ -286,7 +296,8 @@ define([
currentThemeId: function () { currentThemeId: function () {
var t = Common.localStorage.getItem('ui-theme') || Common.localStorage.getItem('ui-theme-id'); var t = Common.localStorage.getItem('ui-theme') || Common.localStorage.getItem('ui-theme-id');
return get_ui_theme_name(t) || id_default_light_theme; var id = get_ui_theme_name(t);
return !!themes_map[id] ? id : id_default_light_theme;
}, },
defaultThemeId: function (type) { defaultThemeId: function (type) {

View file

@ -316,6 +316,7 @@
var shouldPrevent = false; var shouldPrevent = false;
$this.bind('mousewheel' + eventClassName, function (e, deprecatedDelta, deprecatedDeltaX, deprecatedDeltaY) { $this.bind('mousewheel' + eventClassName, function (e, deprecatedDelta, deprecatedDeltaX, deprecatedDeltaY) {
Common.NotificationCenter.trigger('hints:clear');
var deltaX = e.deltaX * e.deltaFactor || deprecatedDeltaX, var deltaX = e.deltaX * e.deltaFactor || deprecatedDeltaX,
deltaY = e.deltaY * e.deltaFactor || deprecatedDeltaY; deltaY = e.deltaY * e.deltaFactor || deprecatedDeltaY;

View file

@ -42,7 +42,17 @@ var params = (function() {
return urlParams; return urlParams;
})(); })();
if ( !!params.uitheme && !localStorage.getItem("ui-theme-id") ) { var checkLocalStorage = (function () {
try {
var storage = window['localStorage'];
return true;
}
catch(e) {
return false;
}
})();
if ( !!params.uitheme && checkLocalStorage && !localStorage.getItem("ui-theme-id") ) {
// const _t = params.uitheme.match(/([\w-]+)/g); // const _t = params.uitheme.match(/([\w-]+)/g);
if ( params.uitheme == 'default-dark' ) if ( params.uitheme == 'default-dark' )
@ -54,11 +64,11 @@ if ( !!params.uitheme && !localStorage.getItem("ui-theme-id") ) {
localStorage.setItem("ui-theme-id", params.uitheme); localStorage.setItem("ui-theme-id", params.uitheme);
} }
var ui_theme_name = localStorage.getItem("ui-theme-id"); var ui_theme_name = checkLocalStorage ? localStorage.getItem("ui-theme-id") : undefined;
if ( !ui_theme_name ) { if ( !ui_theme_name ) {
if ( window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches ) { if ( window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches ) {
ui_theme_name = 'theme-dark'; ui_theme_name = 'theme-dark';
localStorage.setItem("ui-theme-id", ui_theme_name); checkLocalStorage && localStorage.setItem("ui-theme-id", ui_theme_name);
} }
} }
if ( !!ui_theme_name ) { if ( !!ui_theme_name ) {

View file

@ -1072,3 +1072,12 @@ Common.Utils.UserInfoParser = new(function() {
} }
} }
})(); })();
Common.Utils.getKeyByValue = function(obj, value) {
for(var prop in obj) {
if(obj.hasOwnProperty(prop)) {
if(obj[prop] === value)
return prop;
}
}
};

View file

@ -806,7 +806,7 @@ define([
tipUndo: 'Undo', tipUndo: 'Undo',
tipRedo: 'Redo', tipRedo: 'Redo',
textCompactView: 'Hide Toolbar', textCompactView: 'Hide Toolbar',
textHideStatusBar: 'Hide Status Bar', textHideStatusBar: 'Combine sheet and status bars',
textHideLines: 'Hide Rulers', textHideLines: 'Hide Rulers',
textZoom: 'Zoom', textZoom: 'Zoom',
textAdvSettings: 'Advanced Settings', textAdvSettings: 'Advanced Settings',

View file

@ -91,6 +91,8 @@ define([
}, options); }, options);
this.txtOpenFile = options.txtOpenFile || this.txtOpenFile;
this.template = options.template || [ this.template = options.template || [
'<div class="box" style="height:' + (_options.height - 85) + 'px;">', '<div class="box" style="height:' + (_options.height - 85) + 'px;">',
'<div class="content-panel" >', '<div class="content-panel" >',
@ -160,10 +162,10 @@ define([
'<div class="footer center">', '<div class="footer center">',
'<button class="btn normal dlg-btn primary" result="ok">' + t.okButtonText + '</button>', '<button class="btn normal dlg-btn primary" result="ok">' + t.okButtonText + '</button>',
'<% if (closeFile) { %>', '<% if (closeFile) { %>',
'<button class="btn normal dlg-btn" result="cancel" style="margin-left:10px;">' + t.closeButtonText + '</button>', '<button class="btn normal dlg-btn custom" result="cancel" style="margin-left:10px;">' + t.closeButtonText + '</button>',
'<% } %>', '<% } %>',
'<% if (closable) { %>', '<% if (closable) { %>',
'<button class="btn normal dlg-btn" result="cancel" style="margin-left:10px;">' + t.cancelButtonText + '</button>', '<button class="btn normal dlg-btn custom" result="cancel" style="margin-left:10px;">' + t.cancelButtonText + '</button>',
'<% } %>', '<% } %>',
'</div>' '</div>'
].join(''); ].join('');

View file

@ -64,13 +64,15 @@ define([
}, options); }, options);
this.handler = options.handler;
this.template = options.template || [ this.template = options.template || [
'<div class="box">', '<div class="box">',
'<div class="input-row" style="margin-bottom: 10px;">', '<div class="input-row" style="margin-bottom: 10px;">',
'<label>' + t.txtDescription + '</label>', '<label>' + t.txtDescription + '</label>',
'</div>', '</div>',
'<div class="input-row">', '<div class="input-row">',
'<label>' + t.txtPassword + '</label>', '<label>' + t.txtPassword + (t.passwordOptional ? ' (' + t.txtOptional + ')': '') + '</label>',
'</div>', '</div>',
'<div id="id-password-txt" class="input-row" style="margin-bottom: 5px;"></div>', '<div id="id-password-txt" class="input-row" style="margin-bottom: 5px;"></div>',
'<div class="input-row">', '<div class="input-row">',
@ -81,9 +83,6 @@ define([
'</div>' '</div>'
].join(''); ].join('');
this.handler = options.handler;
this.settings = options.settings;
_options.tpl = _.template(this.template)(_options); _options.tpl = _.template(this.template)(_options);
Common.UI.Window.prototype.initialize.call(this, _options); Common.UI.Window.prototype.initialize.call(this, _options);

View file

@ -121,7 +121,10 @@ define([
this.btnAddPwd = new Common.UI.Button({ this.btnAddPwd = new Common.UI.Button({
cls: 'btn-toolbar x-huge icon-top', cls: 'btn-toolbar x-huge icon-top',
iconCls: 'toolbar__icon btn-ic-protect', iconCls: 'toolbar__icon btn-ic-protect',
caption: this.txtEncrypt caption: this.txtEncrypt,
dataHint : '1',
dataHintDirection: 'bottom',
dataHintOffset: 'small'
}); });
this.btnsAddPwd.push(this.btnAddPwd); this.btnsAddPwd.push(this.btnAddPwd);
@ -130,7 +133,10 @@ define([
iconCls: 'toolbar__icon btn-ic-protect', iconCls: 'toolbar__icon btn-ic-protect',
caption: this.txtEncrypt, caption: this.txtEncrypt,
menu: true, menu: true,
visible: false visible: false,
dataHint : '1',
dataHintDirection: 'bottom',
dataHintOffset: 'small'
}); });
} }
if (this.appConfig.isSignatureSupport) { if (this.appConfig.isSignatureSupport) {
@ -138,7 +144,10 @@ define([
cls: 'btn-toolbar x-huge icon-top', cls: 'btn-toolbar x-huge icon-top',
iconCls: 'toolbar__icon btn-ic-signature', iconCls: 'toolbar__icon btn-ic-signature',
caption: this.txtSignature, caption: this.txtSignature,
menu: (this.appPrefix !== 'pe-') menu: (this.appPrefix !== 'pe-'),
dataHint : '1',
dataHintDirection: 'bottom',
dataHintOffset: 'small'
}); });
if (!this.btnSignature.menu) if (!this.btnSignature.menu)
this.btnsInvisibleSignature.push(this.btnSignature); this.btnsInvisibleSignature.push(this.btnSignature);

View file

@ -316,6 +316,15 @@ define([
template: menuTemplate, template: menuTemplate,
description: this.txtMarkup description: this.txtMarkup
}, },
{
caption: this.txtMarkupSimpleCap,
checkable: true,
toggleGroup: 'menuReviewView',
checked: false,
value: 'simple',
template: menuTemplate,
description: this.txtMarkupSimple
},
{ {
caption: this.txtFinalCap, caption: this.txtFinalCap,
checkable: true, checkable: true,
@ -798,12 +807,13 @@ define([
turnDisplayMode: function(mode) { turnDisplayMode: function(mode) {
if (this.btnReviewView) { if (this.btnReviewView) {
this.btnReviewView.menu.items[0].setChecked(mode=='markup', true); this.btnReviewView.menu.items[0].setChecked(mode=='markup', true);
this.btnReviewView.menu.items[1].setChecked(mode=='final', true); this.btnReviewView.menu.items[1].setChecked(mode=='simple', true);
this.btnReviewView.menu.items[2].setChecked(mode=='original', true); this.btnReviewView.menu.items[2].setChecked(mode=='final', true);
this.btnReviewView.menu.items[3].setChecked(mode=='original', true);
} }
}, },
SetDisabled: function (state, langs) { SetDisabled: function (state, langs, protectProps) {
this.btnsSpelling && this.btnsSpelling.forEach(function(button) { this.btnsSpelling && this.btnsSpelling.forEach(function(button) {
if ( button ) { if ( button ) {
button.setDisabled(state); button.setDisabled(state);
@ -821,8 +831,8 @@ define([
}, this); }, this);
// this.btnChat && this.btnChat.setDisabled(state); // this.btnChat && this.btnChat.setDisabled(state);
this.btnCommentRemove && this.btnCommentRemove.setDisabled(state || !Common.Utils.InternalSettings.get(this.appPrefix + "settings-livecomment")); this.btnCommentRemove && this.btnCommentRemove.setDisabled(state || !Common.Utils.InternalSettings.get(this.appPrefix + "settings-livecomment") || protectProps && protectProps.comments);
this.btnCommentResolve && this.btnCommentResolve.setDisabled(state || !Common.Utils.InternalSettings.get(this.appPrefix + "settings-livecomment")); this.btnCommentResolve && this.btnCommentResolve.setDisabled(state || !Common.Utils.InternalSettings.get(this.appPrefix + "settings-livecomment") || protectProps && protectProps.comments);
}, },
onLostEditRights: function() { onLostEditRights: function() {
@ -898,7 +908,9 @@ define([
txtOff: 'OFF for me', txtOff: 'OFF for me',
textWarnTrackChangesTitle: 'Enable Track Changes for everyone?', 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.', 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' textEnable: 'Enable',
txtMarkupSimpleCap: 'Simple Markup',
txtMarkupSimple: 'All changes (Editing)<br>Turn off balloons'
} }
}()), Common.Views.ReviewChanges || {})); }()), Common.Views.ReviewChanges || {}));

View file

@ -103,6 +103,7 @@ define([
this.canRequestUsers = options.canRequestUsers; this.canRequestUsers = options.canRequestUsers;
this.canRequestSendNotify = options.canRequestSendNotify; this.canRequestSendNotify = options.canRequestSendNotify;
this.mentionShare = options.mentionShare; this.mentionShare = options.mentionShare;
this.api = options.api;
this.externalUsers = []; this.externalUsers = [];
this._state = {commentsVisible: false, reviewVisible: false}; this._state = {commentsVisible: false, reviewVisible: false};
@ -737,7 +738,8 @@ define([
leftPos = Math.min(sdkBoundsLeft + posX + this.arrow.width, sdkBoundsLeft + this.sdkBounds.width - this.$window.outerWidth() - 25); leftPos = Math.min(sdkBoundsLeft + posX + this.arrow.width, sdkBoundsLeft + this.sdkBounds.width - this.$window.outerWidth() - 25);
leftPos = Math.max(sdkBoundsLeft + sdkPanelLeftWidth + this.arrow.width, leftPos); leftPos = Math.max(sdkBoundsLeft + sdkPanelLeftWidth + this.arrow.width, leftPos);
arrowView.removeClass('right').addClass('left'); arrowView.removeClass('right top bottom').addClass('left');
arrowView.css({left: ''});
if (!_.isUndefined(leftX)) { if (!_.isUndefined(leftX)) {
windowWidth = this.$window.outerWidth(); windowWidth = this.$window.outerWidth();
@ -784,7 +786,7 @@ define([
} }
} }
} }
if (!retainContent) if (!retainContent || this.isOverCursor())
this.calculateSizeOfContent(); this.calculateSizeOfContent();
}, },
calculateSizeOfContent: function (testVisible) { calculateSizeOfContent: function (testVisible) {
@ -804,6 +806,7 @@ define([
sdkPanelTop = '', sdkPanelTop = '',
sdkPanelHeight = 0, sdkPanelHeight = 0,
arrowPosY = 0, arrowPosY = 0,
arrowPosX = 0,
windowHeight = 0, windowHeight = 0,
outerHeight = 0, outerHeight = 0,
topPos = 0, topPos = 0,
@ -839,7 +842,46 @@ define([
outerHeight = Math.max(commentsView.outerHeight(), this.$window.outerHeight()); outerHeight = Math.max(commentsView.outerHeight(), this.$window.outerHeight());
if (sdkBoundsHeight <= outerHeight) { var movePos = this.isOverCursor();
if (movePos) {
var leftPos = parseInt(this.$window.css('left')) - this.arrow.width,
newTopDown = movePos[1][1] + sdkPanelHeight + this.arrow.width,// try move down
newTopUp = movePos[0][1] + sdkPanelHeight - this.arrow.width, // try move up
isMoveDown = false;
if (newTopDown + outerHeight>sdkBoundsTop + sdkBoundsHeight) {
var diffDown = sdkBoundsTop + sdkBoundsHeight - newTopDown;
if (newTopUp - outerHeight<sdkBoundsTop) {
var diffUp = newTopUp - sdkBoundsTop;
if (diffDown < diffUp * 0.9) {// magic)
this.$window.css({
maxHeight: diffUp + 'px',
top: sdkBoundsTop + 'px'
});
commentsView.css({height: diffUp - 3 + 'px'});
} else {
this.$window.css({
maxHeight: diffDown + 'px',
top: newTopDown + 'px'
});
isMoveDown = true;
commentsView.css({height: diffDown - 3 + 'px'});
}
} else
this.$window.css('top', newTopUp - outerHeight + 'px'); // move up
} else {
isMoveDown = true;
this.$window.css('top', newTopDown + 'px'); // move down
}
leftPos -= this.arrow.height;
this.$window.css('left', leftPos + 'px');
arrowPosX = movePos[isMoveDown ? 1 : 0][0];
arrowPosX = Math.max(0, arrowPosX - leftPos - this.arrow.height/2);
arrowPosX = Math.min(arrowPosX, this.$window.outerWidth() - this.arrow.height);
arrowView.css({top: '', left: arrowPosX + 'px'});
arrowView.toggleClass('top', isMoveDown);
arrowView.toggleClass('bottom', !isMoveDown);
arrowView.removeClass('left right');
} else if (sdkBoundsHeight <= outerHeight) {
this.$window.css({ this.$window.css({
maxHeight: sdkBoundsHeight - sdkPanelHeight + 'px', maxHeight: sdkBoundsHeight - sdkPanelHeight + 'px',
top: sdkBoundsTop + sdkPanelHeight + 'px' top: sdkBoundsTop + sdkPanelHeight + 'px'
@ -850,7 +892,9 @@ define([
// arrowPosY = Math.max(this.arrow.margin, this.arrowPosY - sdkPanelHeight - this.arrow.width); // arrowPosY = Math.max(this.arrow.margin, this.arrowPosY - sdkPanelHeight - this.arrow.width);
arrowPosY = Math.min(arrowPosY, sdkBoundsHeight - (sdkPanelHeight + this.arrow.margin + this.arrow.height)); arrowPosY = Math.min(arrowPosY, sdkBoundsHeight - (sdkPanelHeight + this.arrow.margin + this.arrow.height));
arrowView.css({top: arrowPosY + 'px'}); arrowView.css({top: arrowPosY + 'px', left: ''});
arrowView.removeClass('top bottom right');
arrowView.addClass('left');
this.scroller.scrollTop(scrollPos); this.scroller.scrollTop(scrollPos);
} else { } else {
@ -868,7 +912,9 @@ define([
arrowPosY = Math.max(this.arrow.margin, this.arrowPosY - (sdkBoundsHeight - outerHeight) - this.arrow.height); arrowPosY = Math.max(this.arrow.margin, this.arrowPosY - (sdkBoundsHeight - outerHeight) - this.arrow.height);
arrowPosY = Math.min(arrowPosY, outerHeight - this.arrow.margin - this.arrow.height); arrowPosY = Math.min(arrowPosY, outerHeight - this.arrow.margin - this.arrow.height);
arrowView.css({top: arrowPosY + 'px'}); arrowView.css({top: arrowPosY + 'px', left: ''});
arrowView.removeClass('top bottom right');
arrowView.addClass('left');
} }
} }
} }
@ -880,6 +926,27 @@ define([
this.scroller.update({minScrollbarLength: 40, alwaysVisibleY: true}); this.scroller.update({minScrollbarLength: 40, alwaysVisibleY: true});
} }
}, },
isOverCursor: function() {
if (!this.api.asc_GetSelectionBounds) return;
var p = this.api.asc_GetSelectionBounds(),
isCursor = Math.abs(p[0][0] - p[1][0])<0.1 && Math.abs(p[0][1] - p[1][1])<0.1 && Math.abs(p[2][0] - p[3][0])<0.1 && Math.abs(p[2][1] - p[3][1])<0.1,
sdkPanelLeft = $('#id_panel_left'),
sdkPanelLeftWidth = 0;
if (sdkPanelLeft.length)
sdkPanelLeftWidth = (sdkPanelLeft.css('display') !== 'none') ? sdkPanelLeft.width() : 0;
var x0 = p[0][0] + sdkPanelLeftWidth, y0 = p[0][1],
x1 = p[isCursor ? 2 : 1][0] + sdkPanelLeftWidth, y1 = p[isCursor ? 2 : 1][1];
var leftPos = parseInt(this.$window.css('left')) - this.arrow.width,
windowWidth = this.$window.outerWidth() + this.arrow.width;
if (x0>leftPos && x0<leftPos+windowWidth || x1>leftPos && x1<leftPos+windowWidth) {
var newDown = (y0>y1) ? [x0, y0] : [x1, y1],// try move down
newUp = (y0<y1) ? [x0, y0] : [x1, y1]; // try move up
return [newUp, newDown];
}
},
saveText: function (clear) { saveText: function (clear) {
if (this.commentsView && this.commentsView.cmpEl.find('.lock-area').length < 1) { if (this.commentsView && this.commentsView.cmpEl.find('.lock-area').length < 1) {
this.textVal = undefined; this.textVal = undefined;

View file

@ -99,7 +99,7 @@
'<div class="separator horizontal"></div>', '<div class="separator horizontal"></div>',
'<div class="footer right">', '<div class="footer right">',
'<button class="btn normal dlg-btn" result="replace">'+this.txtBtnReplace+'</button>', '<button class="btn normal dlg-btn" result="replace">'+this.txtBtnReplace+'</button>',
'<button class="btn normal dlg-btn" result="replaceall" style="margin-left: 6px;width: auto;">'+this.txtBtnReplaceAll+'</button>', '<button class="btn normal dlg-btn" result="replaceall" style="margin-left: 6px;width: auto;min-width: 100px;">'+this.txtBtnReplaceAll+'</button>',
'<button class="btn normal dlg-btn iconic" result="back"><span class="icon img-commonctrl back"></span></button>', '<button class="btn normal dlg-btn iconic" result="back"><span class="icon img-commonctrl back"></span></button>',
'<button class="btn normal dlg-btn iconic" result="next" style="margin-left: 6px;"><span class="icon img-commonctrl next"></span></button>', '<button class="btn normal dlg-btn iconic" result="next" style="margin-left: 6px;"><span class="icon img-commonctrl next"></span></button>',
'</div>' '</div>'

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 228 B

After

Width:  |  Height:  |  Size: 227 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 612 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.3 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 B

After

Width:  |  Height:  |  Size: 86 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 B

After

Width:  |  Height:  |  Size: 96 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 B

After

Width:  |  Height:  |  Size: 102 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 B

After

Width:  |  Height:  |  Size: 85 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 B

After

Width:  |  Height:  |  Size: 95 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 B

After

Width:  |  Height:  |  Size: 101 B

View file

@ -1,10 +1,12 @@
<svg fill="none" height="96" viewBox="0 0 96 96" width="96" xmlns="http://www.w3.org/2000/svg"> <svg fill="none" height="96" viewBox="0 0 96 96" width="96" xmlns="http://www.w3.org/2000/svg">
<symbol id="svg-format-blank"> <symbol id="svg-format-blank">
<clipPath id="a"> <g clip-path="url(#clip0)">
<path d="m0 0h96v96h-96z"/> <path d="M94 9.5C94.8284 9.5 95.5 10.1716 95.5 11L95.5 85C95.5 85.8284 94.8284 86.5 94 86.5L2 86.5C1.17157 86.5 0.499997 85.8284 0.499997 85L0.5 11C0.5 10.1716 1.17158 9.5 2 9.5L94 9.5Z" fill="white" stroke="#BFBFBF"/>
</clipPath> </g>
<g clip-path="url(#a)"> <defs>
<path d="m.499997 94 .000003-74c0-.8284.67157-1.5 1.5-1.5h92c.8284 0 1.5.6716 1.5 1.5v74c0 .8284-.6716 1.5-1.5 1.5h-92c-.82843 0-1.500003-.6716-1.500003-1.5z" fill="#fff" stroke="#bfbfbf"/> <clipPath id="clip0">
</g> <rect width="96" height="96" fill="white"/>
</clipPath>
</defs>
</symbol> </symbol>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 440 B

After

Width:  |  Height:  |  Size: 534 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 848 B

After

Width:  |  Height:  |  Size: 803 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 934 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 971 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1 KiB

View file

@ -4,7 +4,7 @@
(min-resolution: 1.25dppx) and (max-resolution: 1.4dppx), (min-resolution: 1.25dppx) and (max-resolution: 1.4dppx),
(min-resolution: 120dpi) and (max-resolution: 143dpi) (min-resolution: 120dpi) and (max-resolution: 143dpi)
{ {
.x-huge .toolbar__icon { .x-huge .toolbar__icon, .toolbar__icon.toolbar__icon-big {
background-image: url(resources/{{{escaped_image}}}); background-image: url(resources/{{{escaped_image}}});
background-size: {{scaled width 1.25}}px auto; background-size: {{scaled width 1.25}}px auto;
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 318 B

After

Width:  |  Height:  |  Size: 234 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 386 B

After

Width:  |  Height:  |  Size: 409 B

View file

@ -1,6 +1,9 @@
{{#spritesheet}} {{#spritesheet}}
.options__icon.options__icon-huge { .pixel-ratio__1_25 {
background-size: 80px auto; .options__icon.options__icon-huge {
background-size: var(--huge-icon-background-image-width) auto; background-image: url(resources/{{{escaped_image}}});
background-size: 80px auto;
background-size: var(--huge-icon-background-image-width) auto;
}
} }
{{/spritesheet}} {{/spritesheet}}

View file

@ -4,7 +4,7 @@
(min-resolution: 1.75dppx) and (max-resolution: 1.9dppx), (min-resolution: 1.75dppx) and (max-resolution: 1.9dppx),
(min-resolution: 168dpi) and (max-resolution: 191dpi) (min-resolution: 168dpi) and (max-resolution: 191dpi)
{ {
.x-huge .toolbar__icon { .x-huge .toolbar__icon, .toolbar__icon.toolbar__icon-big {
background-image: url(resources/{{{escaped_image}}}); background-image: url(resources/{{{escaped_image}}});
background-size: {{scaled width 1.75}}px auto; background-size: {{scaled width 1.75}}px auto;
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 436 B

After

Width:  |  Height:  |  Size: 342 B

View file

@ -1,6 +1,9 @@
{{#spritesheet}} {{#spritesheet}}
.options__icon.options__icon-huge { .pixel-ratio__1_75 {
background-size: 80px auto; .options__icon.options__icon-huge {
background-size: var(--huge-icon-background-image-width) auto; background-image: url(resources/{{{escaped_image}}});
background-size: 80px auto;
background-size: var(--huge-icon-background-image-width) auto;
}
} }
{{/spritesheet}} {{/spritesheet}}

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

View file

@ -100,6 +100,26 @@
.pixel-ratio__2 { .pixel-ratio__2 {
} }
.pixel-ratio__1_25 {
@ratio: 1.25;
@one-px: 1px / @ratio;
@two-px: 2px / @ratio;
--pixel-ratio-factor: @ratio;
--scaled-one-pixel: @one-px;
--scaled-two-pixel: @two-px;
}
.pixel-ratio__1_75 {
@ratio: 1.75;
@one-px: 1px / @ratio;
@two-px: 2px / @ratio;
--pixel-ratio-factor: @ratio;
--scaled-one-pixel: @one-px;
--scaled-two-pixel: @two-px;
}
} }
.button-normal-icon(@icon-class, @index, @icon-size, @normal-h-offset: 0px) { .button-normal-icon(@icon-class, @index, @icon-size, @normal-h-offset: 0px) {
@ -211,6 +231,53 @@
} }
} }
.background-ximage-all(@image, @w: auto, @h: auto, @repeat: no-repeat, @commonimage: true) {
.choose-image-path(@commonimage);
@imagepath: '@{path}/@{image}';
background-image: if(@icon-src-base64, data-uri(%("%s", '@{imagepath}')), ~"url(@{imagepath})");
background-repeat: @repeat;
@1d5ximage: replace(@imagepath, '\.png$', '@1.5x.png');
@1d75ximage: replace(@imagepath, '\.png$', '@1.75x.png');
@1d25ximage: replace(@imagepath, '\.png$', '@1.25x.png');
@2ximage: replace(@imagepath, '\.png$', '@2x.png');
@media only screen {
@media (-webkit-min-device-pixel-ratio: 1.25) and (-webkit-max-device-pixel-ratio: 1.49),
(min-resolution: 1.25dppx) and (max-resolution: 1.49dppx),
(min-resolution: 120dpi) and (max-resolution: 143dpi)
{
background-image: ~"url(@{1d25ximage})";
background-size: @w @h;
}
@media (-webkit-min-device-pixel-ratio: 1.5) and (-webkit-max-device-pixel-ratio: 1.74),
(min-resolution: 1.5dppx) and (max-resolution: 1.74dppx),
(min-resolution: 144dpi) and (max-resolution: 167dpi)
{
background-image: ~"url(@{1d5ximage})";
background-size: @w @h;
}
@media (-webkit-min-device-pixel-ratio: 1.75) and (-webkit-max-device-pixel-ratio: 1.9),
(min-resolution: 1.75dppx) and (max-resolution: 1.9dppx),
(min-resolution: 168dpi) and (max-resolution: 191dpi)
{
background-image: ~"url(@{1d75ximage})";
background-size: @w @h;
}
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 2dppx),
(min-resolution: 192dpi)
{
background-image: ~"url(@{2ximage})";
background-size: @w @h;
}
}
}
.img-commonctrl { .img-commonctrl {
&.img-colored { &.img-colored {
filter: none; filter: none;
@ -226,7 +293,9 @@
background-repeat: no-repeat; background-repeat: no-repeat;
filter: @component-normal-icon-filter; filter: @component-normal-icon-filter;
@1d25ximage: replace(@common-controls, '\.png$', '@1.25x.png');
@1d5ximage: replace(@common-controls, '\.png$', '@1.5x.png'); @1d5ximage: replace(@common-controls, '\.png$', '@1.5x.png');
@1d75ximage: replace(@common-controls, '\.png$', '@1.75x.png');
@2ximage: replace(@common-controls, '\.png$', '@2x.png'); @2ximage: replace(@common-controls, '\.png$', '@2x.png');
@media only screen { @media only screen {
@ -246,6 +315,16 @@
background-size: @common-controls-width auto; background-size: @common-controls-width auto;
} }
} }
.pixel-ratio__1_25 & {
background-image: ~"url(@{common-image-const-path}/@{1d25ximage})";
background-size: @common-controls-width auto;
}
.pixel-ratio__1_75 & {
background-image: ~"url(@{common-image-const-path}/@{1d75ximage})";
background-size: @common-controls-width auto;
}
} }
@img-colorpicker-width: 205px; @img-colorpicker-width: 205px;

View file

@ -700,8 +700,8 @@
li > a.selected, li > a.selected,
li > a:hover { li > a:hover {
span.color-auto { span.color-auto {
outline: @scaled-one-px-value-ie solid @border-regular-control-ie; outline: @scaled-one-px-value-ie solid @icon-normal-ie;
outline: @scaled-one-px-value solid @border-regular-control; outline: @scaled-one-px-value solid @icon-normal;
border: @scaled-one-px-value-ie solid @background-normal-ie; border: @scaled-one-px-value-ie solid @background-normal-ie;
border: @scaled-one-px-value solid @background-normal; border: @scaled-one-px-value solid @background-normal;
} }

View file

@ -45,6 +45,7 @@
--text-inverse: #fff; --text-inverse: #fff;
--text-toolbar-header: #fff; --text-toolbar-header: #fff;
--text-contrast-background: #fff; --text-contrast-background: #fff;
--text-alt-key-hint: #444;
--icon-normal: #444; --icon-normal: #444;
--icon-normal-pressed: #fff; --icon-normal-pressed: #fff;

View file

@ -46,6 +46,7 @@
--text-inverse: #333; --text-inverse: #333;
--text-toolbar-header: fade(#fff, 80%); --text-toolbar-header: fade(#fff, 80%);
--text-contrast-background: #fff; --text-contrast-background: #fff;
--text-alt-key-hint: #2a2a2a;
--icon-normal: fade(#fff, 80%); --icon-normal: fade(#fff, 80%);
--icon-normal-pressed: fade(#fff, 80%); --icon-normal-pressed: fade(#fff, 80%);

View file

@ -188,6 +188,7 @@
@text-inverse: var(--text-inverse); @text-inverse: var(--text-inverse);
@text-toolbar-header: var(--text-toolbar-header); @text-toolbar-header: var(--text-toolbar-header);
@text-contrast-background: var(--text-contrast-background); @text-contrast-background: var(--text-contrast-background);
@text-alt-key-hint: var(--text-alt-key-hint);
// Icon // Icon
// ------------------------- // -------------------------

View file

@ -27,6 +27,7 @@
width:60px; width:60px;
height:20px; height:20px;
background-color: transparent; background-color: transparent;
image-rendering: pixelated;
} }
} }
@ -37,16 +38,25 @@
display: inline-block; display: inline-block;
background-color: transparent; background-color: transparent;
margin: 0 0 0 -3px; margin: 0 0 0 -3px;
image-rendering: pixelated;
} }
img, .image { img, .image {
background: ~"url(@{common-image-const-path}/combo-border-size/BorderSize.png) no-repeat 0 0"; background: ~"url(@{common-image-const-path}/combo-border-size/BorderSize.png) no-repeat 0 0";
background-size: 60px auto; background-size: 60px auto;
.pixel-ratio__1_25 & {
background-image: ~"url(@{common-image-const-path}/combo-border-size/BorderSize@1.25x.png)";
}
.pixel-ratio__1_5 & { .pixel-ratio__1_5 & {
background-image: ~"url(@{common-image-const-path}/combo-border-size/BorderSize@1.5x.png)"; background-image: ~"url(@{common-image-const-path}/combo-border-size/BorderSize@1.5x.png)";
} }
.pixel-ratio__1_75 & {
background-image: ~"url(@{common-image-const-path}/combo-border-size/BorderSize@1.75x.png)";
}
.pixel-ratio__2 & { .pixel-ratio__2 & {
background-image: ~"url(@{common-image-const-path}/combo-border-size/BorderSize@2x.png)"; background-image: ~"url(@{common-image-const-path}/combo-border-size/BorderSize@2x.png)";
} }

View file

@ -99,7 +99,7 @@
} }
.item { .item {
padding: 3px; padding: 2px;
border: @scaled-one-px-value-ie solid @border-regular-control-ie; border: @scaled-one-px-value-ie solid @border-regular-control-ie;
border: @scaled-one-px-value solid @border-regular-control; border: @scaled-one-px-value solid @border-regular-control;
.box-shadow(none); .box-shadow(none);
@ -164,6 +164,11 @@
width: @combo-dataview-button-width; width: @combo-dataview-button-width;
height: @combo-dataview-height; height: @combo-dataview-height;
.btn-group, button {
width: 100%;
height: 100%;
}
button { button {
&.dropdown-toggle { &.dropdown-toggle {
padding: 0; padding: 0;

View file

@ -38,6 +38,8 @@
.btn { .btn {
border-left: 0; border-left: 0;
border-top-left-radius: 0;
border-bottom-left-radius: 0;
border-color: @border-regular-control-ie; border-color: @border-regular-control-ie;
border-color: @border-regular-control; border-color: @border-regular-control;
background-color: transparent; background-color: transparent;

View file

@ -472,7 +472,7 @@
width:100%; width:100%;
position: relative; position: relative;
overflow-y: hidden; overflow-y: hidden;
margin-bottom: 5px; //margin-bottom: 5px;
.dataview-ct.inner { .dataview-ct.inner {
overflow: visible; overflow: visible;
@ -482,24 +482,6 @@
.comments-arrow { .comments-arrow {
position: absolute; position: absolute;
overflow: hidden; overflow: hidden;
left: -10px;
top: 20px;
width: 10px;
height: 30px;
&.right {
left: 100%;
&:after {
left: -8px;
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
body.safari &,
body.chrome & {
box-shadow: none;
}
}
}
&:after { &:after {
content: ''; content: '';
@ -518,4 +500,53 @@
border: solid @scaled-one-px-value-ie @border-toolbar-ie; border: solid @scaled-one-px-value-ie @border-toolbar-ie;
border: solid @scaled-one-px-value @border-toolbar; border: solid @scaled-one-px-value @border-toolbar;
} }
&.left {
left: -10px;
top: 20px;
width: 10px;
height: 30px;
}
&.right {
left: 100%;
top: 20px;
width: 10px;
height: 30px;
&:after {
left: -8px;
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
body.safari &,
body.chrome & {
box-shadow: none;
}
}
}
&.top {
left: 20px;
top: -10px;
height: 10px;
width: 30px;
&:after {
top: 2px;
left: 5px;
}
}
&.bottom {
left: 20px;
top: auto;
bottom: -10px;
height: 10px;
width: 30px;
&:after {
top: -7px;
left: 5px;
}
}
} }

View file

@ -21,13 +21,13 @@
.dimension-picker-unhighlighted { .dimension-picker-unhighlighted {
//background: transparent repeat scroll 0 0; //background: transparent repeat scroll 0 0;
.background-ximage-v2('dimension-picker/dimension-unhighlighted.png', 18px); .background-ximage-all('dimension-picker/dimension-unhighlighted.png', 18px);
background-repeat: repeat; background-repeat: repeat;
} }
.dimension-picker div.dimension-picker-highlighted { .dimension-picker div.dimension-picker-highlighted {
//background: transparent repeat scroll 0 0; //background: transparent repeat scroll 0 0;
.background-ximage-v2('dimension-picker/dimension-highlighted.png', 18px); .background-ximage-all('dimension-picker/dimension-highlighted.png', 18px);
background-repeat: repeat; background-repeat: repeat;
} }

View file

@ -8,7 +8,7 @@
text-align: center; text-align: center;
background-color: @background-alt-key-hint-ie; background-color: @background-alt-key-hint-ie;
background-color: @background-alt-key-hint; background-color: @background-alt-key-hint;
color: @text-normal; color: @text-alt-key-hint;
font-size: 12px; font-size: 12px;
line-height: 18px; line-height: 18px;
padding: 0 4px; padding: 0 4px;

View file

@ -11,6 +11,8 @@
border: @track-height / 2 solid @border-regular-control-ie; border: @track-height / 2 solid @border-regular-control-ie;
border: @track-height / 2 solid @border-regular-control; border: @track-height / 2 solid @border-regular-control;
border-radius: @track-height / 2; border-radius: @track-height / 2;
background-color: @border-regular-control-ie;
background-color: @border-regular-control;
width: calc(100% + @track-height); width: calc(100% + @track-height);
margin-left: -@track-height / 2; margin-left: -@track-height / 2;
} }
@ -32,6 +34,28 @@
&.active { &.active {
} }
} }
&.vertical {
height: auto;
width: 18px;
padding-top: 0;
padding-left: 7px;
.track {
position: absolute;
@track-height: 4px;
height: calc(100% + @track-height);
width: @track-height;
margin-left: 0;
margin-top: -@track-height / 2;
}
.thumb {
@thumb-width: 12px;
top: auto;
left: 3px;
margin-left: 0;
margin-top: @thumb-width / -2;
}
}
} }
.thumb { .thumb {

View file

@ -39,7 +39,7 @@
.spinner-buttons { .spinner-buttons {
position: absolute; position: absolute;
top: 0; top: 0;
right: 1px; right: @scaled-one-px-value;
border-top: @scaled-one-px-value-ie solid transparent; border-top: @scaled-one-px-value-ie solid transparent;
border-top: @scaled-one-px-value solid transparent; border-top: @scaled-one-px-value solid transparent;
border-bottom: @scaled-one-px-value-ie solid transparent; border-bottom: @scaled-one-px-value-ie solid transparent;

View file

@ -39,11 +39,16 @@
} }
} }
.dynamic-empty-color em span { .dynamic-empty-color {
border:solid @scaled-one-px-value-ie @border-color-shading-ie;
border:solid @scaled-one-px-value @border-color-shading;
background: @background-normal-ie; background: @background-normal-ie;
background: @background-normal; background: @background-normal;
em span {
border: solid @scaled-one-px-value-ie @border-color-shading-ie;
border: solid @scaled-one-px-value @border-color-shading;
background: @background-normal-ie;
background: @background-normal;
}
} }
.color-transparent { .color-transparent {

View file

@ -239,6 +239,10 @@
&:not(:first-child) { &:not(:first-child) {
margin-top: 6px; margin-top: 6px;
} }
&.font-normal {
.font-size-normal();
}
} }
.separator { .separator {
@ -547,6 +551,12 @@
.icon { .icon {
width: 22px; width: 22px;
height: 22px; height: 22px;
.pixel-ratio__1_25 &,
.pixel-ratio__1_75 & {
width: 20px;
height: 20px;
}
} }
} }
} }
@ -580,7 +590,7 @@
border: @scaled-one-px-value solid @border-regular-control; border: @scaled-one-px-value solid @border-regular-control;
.equation-icon { .equation-icon {
.background-ximage-v2('toolbar/math.png', 1500px, @commonimage: true); .background-ximage-all('toolbar/math.png', 1500px, @commonimage: true);
opacity: @component-normal-icon-opacity; opacity: @component-normal-icon-opacity;
.theme-dark & { .theme-dark & {
@ -648,7 +658,8 @@
&, &:hover, &:focus { &, &:hover, &:focus {
background-color: @highlight-button-pressed-ie; background-color: @highlight-button-pressed-ie;
background-color: @highlight-button-pressed; background-color: @highlight-button-pressed;
color: @dropdown-link-active-color; color: @text-normal-ie;
color: @text-normal;
span.color { span.color {
border-color: @icon-normal-ie; border-color: @icon-normal-ie;
border-color: @icon-normal; border-color: @icon-normal;

View file

@ -11,7 +11,7 @@ const ThemeColors = ({ themeColors, onColorClick, curColor }) => {
{row.map((effect, index) => { {row.map((effect, index) => {
return( return(
<a key={`tc-${rowIndex}-${index}`} <a key={`tc-${rowIndex}-${index}`}
className={(curColor && curColor.color === effect.color && curColor.effectValue === effect.effectValue) ? 'active' : ''} className={(curColor && ((curColor.color === effect.color && curColor.effectValue === effect.effectValue) || (curColor === effect.color))) ? 'active' : ''}
style={{ background: `#${effect.color}`}} style={{ background: `#${effect.color}`}}
onClick={() => {onColorClick(effect.color, effect.effectId, effect.effectValue)}} onClick={() => {onColorClick(effect.color, effect.effectId, effect.effectValue)}}
></a> ></a>

View file

@ -150,8 +150,8 @@ class ContextMenuController extends Component {
this.setState({openedMore: false}); this.setState({openedMore: false});
} }
onMenuItemClick(action) { async onMenuItemClick(action) {
this.onApiHideContextMenu(); await this.onApiHideContextMenu();
if (action === 'showActionSheet') { if (action === 'showActionSheet') {
this.setState({openedMore: true}); this.setState({openedMore: true});

View file

@ -564,25 +564,37 @@ class ViewCommentsController extends Component {
this.onResolveComment(comment); this.onResolveComment(comment);
break; break;
case 'deleteComment': case 'deleteComment':
f7.dialog.confirm( f7.dialog.create({
_t.textMessageDeleteComment, title: _t.textDeleteComment,
_t.textDeleteComment, text: _t.textMessageDeleteComment,
() => { buttons: [
this.deleteComment(comment); {
} text: _t.textCancel
); },
{
text: _t.textOk,
onClick: () => this.deleteComment(comment)
}
]
}).open();
break; break;
case 'editReply': case 'editReply':
this.props.storeComments.openEditReply(true, comment, reply); this.props.storeComments.openEditReply(true, comment, reply);
break; break;
case 'deleteReply': case 'deleteReply':
f7.dialog.confirm( f7.dialog.create({
_t.textMessageDeleteReply, title: _t.textDeleteReply,
_t.textDeleteReply, text: _t.textMessageDeleteReply,
() => { buttons: [
this.deleteReply(comment, reply); {
} text: _t.textCancel
); },
{
text: _t.textOk,
onClick: () => this.deleteReply(comment, reply)
}
]
}).open();
break; break;
case 'addReply': case 'addReply':
this.props.storeComments.openAddReply(true, comment); this.props.storeComments.openAddReply(true, comment);

View file

@ -25,27 +25,29 @@ class InitReview extends Component {
api.asc_SetTrackRevisions(trackChanges); api.asc_SetTrackRevisions(trackChanges);
// Init display mode // Init display mode
if (!appOptions.canReview) {
const canViewReview = appOptions.isEdit || api.asc_HaveRevisionsChanges(true); const canViewReview = appOptions.canReview || appOptions.isEdit || api.asc_HaveRevisionsChanges(true);
if (!appOptions.canReview)
appOptions.setCanViewReview(canViewReview); appOptions.setCanViewReview(canViewReview);
if (canViewReview) { if (canViewReview) {
let viewReviewMode = LocalStorage.getItem("de-view-review-mode"); let viewReviewMode = (appOptions.isEdit || appOptions.isRestrictedEdit) ? null : LocalStorage.getItem("de-view-review-mode");
if (viewReviewMode === null) { if (viewReviewMode === null) {
viewReviewMode = appOptions.customization && appOptions.customization.review ? appOptions.customization.review.reviewDisplay : undefined; viewReviewMode = appOptions.customization && appOptions.customization.review ? appOptions.customization.review.reviewDisplay : undefined;
!viewReviewMode && (viewReviewMode = appOptions.customization ? appOptions.customization.reviewDisplay : undefined); !viewReviewMode && (viewReviewMode = appOptions.customization ? appOptions.customization.reviewDisplay : undefined);
viewReviewMode = /^(original|final|markup)$/i.test(viewReviewMode) ? viewReviewMode.toLocaleLowerCase() : 'original'; viewReviewMode = /^(original|final|markup|simple)$/i.test(viewReviewMode) ? viewReviewMode.toLocaleLowerCase() : ( appOptions.isEdit || appOptions.isRestrictedEdit ? 'markup' : 'original');
}
viewReviewMode = (appOptions.isEdit || appOptions.isRestrictedEdit) ? 'markup' : viewReviewMode;
const displayMode = viewReviewMode.toLocaleLowerCase();
if (displayMode === 'final') {
api.asc_BeginViewModeInReview(true);
} else if (displayMode === 'original') {
api.asc_BeginViewModeInReview(false);
} else {
api.asc_EndViewModeInReview();
}
props.storeReview.changeDisplayMode(displayMode);
} }
let displayMode = viewReviewMode.toLocaleLowerCase();
let type = Asc.c_oAscDisplayModeInReview.Edit;
switch (displayMode) {
case 'final':
type = Asc.c_oAscDisplayModeInReview.Final;
break;
case 'original':
type = Asc.c_oAscDisplayModeInReview.Original;
break;
}
api.asc_SetDisplayModeInReview(type);
props.storeReview.changeDisplayMode(displayMode);
} }
}); });
} }
@ -102,14 +104,17 @@ class Review extends Component {
onDisplayMode (mode) { onDisplayMode (mode) {
const api = Common.EditorApi.get(); const api = Common.EditorApi.get();
if (mode === 'final') { let type = Asc.c_oAscDisplayModeInReview.Edit;
api.asc_BeginViewModeInReview(true); switch (mode) {
} else if (mode === 'original') { case 'final':
api.asc_BeginViewModeInReview(false); type = Asc.c_oAscDisplayModeInReview.Final;
} else { break;
api.asc_EndViewModeInReview(); case 'original':
type = Asc.c_oAscDisplayModeInReview.Original;
break;
} }
!this.appConfig.canReview && LocalStorage.setItem("de-view-review-mode", mode); api.asc_SetDisplayModeInReview(type);
!this.appConfig.isEdit && !this.appConfig.isRestrictedEdit && LocalStorage.setItem("de-view-review-mode", mode);
this.props.storeReview.changeDisplayMode(mode); this.props.storeReview.changeDisplayMode(mode);
} }

View file

@ -203,26 +203,21 @@ class SearchView extends Component {
onEditorTouchStart(e) { onEditorTouchStart(e) {
this.startPoint = this.pointerPosition(e); this.startPoint = this.pointerPosition(e);
// console.log(this.startPoint);
} }
onEditorTouchEnd(e) { onEditorTouchEnd(e) {
const endPoint = this.pointerPosition(e); const endPoint = this.pointerPosition(e);
// console.log(endPoint);
if (this.searchbar.enabled) { if (this.searchbar.enabled) {
let distance; let distance;
if(this.startPoint) { if(this.startPoint) {
distance = (!!this.startPoint.x || !!this.startPoint.y) ? 0 : distance = (this.startPoint.x === undefined || this.startPoint.y === undefined) ? 0 :
Math.sqrt((endPoint.x -= this.startPoint.x) * endPoint.x + (endPoint.y -= this.startPoint.y) * endPoint.y); Math.sqrt((endPoint.x -= this.startPoint.x) * endPoint.x + (endPoint.y -= this.startPoint.y) * endPoint.y);
} else { } else {
distance = 0; distance = 0;
} }
// const distance = (this.startPoint === undefined || this.startPoint === undefined) ? 0 :
// Math.sqrt((endPoint.x -= this.startPoint.x) * endPoint.x + (endPoint.y -= this.startPoint.y) * endPoint.y);
if (distance < 1) { if (distance < 1) {
this.searchbar.disable(); this.searchbar.disable();
} }
@ -231,15 +226,10 @@ class SearchView extends Component {
pointerPosition(e) { pointerPosition(e) {
let out = {x:0, y:0}; let out = {x:0, y:0};
if ( e.type == 'touchstart' || e.type == 'touchend' ) { if ( e.type == 'pointerdown' || e.type == 'pointerup' || e.type == 'mousedown' || e.type == 'mouseup') {
const touch = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0];
out.x = touch.pageX;
out.y = touch.pageY;
} else if ( e.type == 'mousedown' || e.type == 'mouseup' ) {
out.x = e.pageX; out.x = e.pageX;
out.y = e.pageY; out.y = e.pageY;
} }
return out; return out;
} }

View file

@ -85,7 +85,7 @@ const routes = [
} }
]; ];
const PageCollaboration = inject('storeAppOptions')(observer(props => { const PageCollaboration = inject('storeAppOptions', 'users')(observer(props => {
const { t } = useTranslation(); const { t } = useTranslation();
const _t = t('Common.Collaboration', {returnObjects: true}); const _t = t('Common.Collaboration', {returnObjects: true});
const appOptions = props.storeAppOptions; const appOptions = props.storeAppOptions;
@ -102,9 +102,11 @@ const PageCollaboration = inject('storeAppOptions')(observer(props => {
} }
</Navbar> </Navbar>
<List> <List>
<ListItem link={'/users/'} title={_t.textUsers}> {props.users.editUsers.length > 0 &&
<Icon slot="media" icon="icon-users"></Icon> <ListItem link={'/users/'} title={_t.textUsers}>
</ListItem> <Icon slot="media" icon="icon-users"></Icon>
</ListItem>
}
{appOptions.canViewComments && {appOptions.canViewComments &&
<ListItem link='/comments/' title={_t.textComments}> <ListItem link='/comments/' title={_t.textComments}>
<Icon slot="media" icon="icon-insert-comment"></Icon> <Icon slot="media" icon="icon-insert-comment"></Icon>

View file

@ -628,10 +628,11 @@ const pickLink = (message) => {
} }
// View comments // View comments
const ViewComments = ({storeComments, storeAppOptions, onCommentMenuClick, onResolveComment, showComment}) => { const ViewComments = ({storeComments, storeAppOptions, onCommentMenuClick, onResolveComment, showComment, storeReview}) => {
const { t } = useTranslation(); const { t } = useTranslation();
const _t = t('Common.Collaboration', {returnObjects: true}); const _t = t('Common.Collaboration', {returnObjects: true});
const isAndroid = Device.android; const isAndroid = Device.android;
const displayMode = storeReview.displayMode;
const viewMode = !storeAppOptions.canComments; const viewMode = !storeAppOptions.canComments;
const comments = storeComments.groupCollectionFilter || storeComments.collectionComments; const comments = storeComments.groupCollectionFilter || storeComments.collectionComments;
@ -672,10 +673,13 @@ const ViewComments = ({storeComments, storeAppOptions, onCommentMenuClick, onRes
</div> </div>
{!viewMode && {!viewMode &&
<div className='right'> <div className='right'>
{comment.editable && <div className='comment-resolve' onClick={() => {onResolveComment(comment);}}><Icon icon={comment.resolved ? 'icon-resolve-comment check' : 'icon-resolve-comment'} /></div> } {(comment.editable && displayMode === 'markup') && <div className='comment-resolve' onClick={() => {onResolveComment(comment);}}><Icon icon={comment.resolved ? 'icon-resolve-comment check' : 'icon-resolve-comment'} /></div> }
<div className='comment-menu' {displayMode === 'markup' &&
onClick={() => {setComment(comment); openActionComment(true);}} <div className='comment-menu'
><Icon icon='icon-menu-comment'/></div> onClick={() => {setComment(comment); openActionComment(true);}}>
<Icon icon='icon-menu-comment'/>
</div>
}
</div> </div>
} }
</div> </div>
@ -734,13 +738,14 @@ const ViewComments = ({storeComments, storeAppOptions, onCommentMenuClick, onRes
) )
}; };
const _ViewComments = inject('storeComments', 'storeAppOptions')(observer(ViewComments)); const _ViewComments = inject('storeComments', 'storeAppOptions', "storeReview")(observer(ViewComments));
const CommentList = inject("storeComments", "storeAppOptions")(observer(({storeComments, storeAppOptions, onCommentMenuClick, onResolveComment}) => { const CommentList = inject("storeComments", "storeAppOptions", "storeReview")(observer(({storeComments, storeAppOptions, onCommentMenuClick, onResolveComment, storeReview}) => {
const { t } = useTranslation(); const { t } = useTranslation();
const _t = t('Common.Collaboration', {returnObjects: true}); const _t = t('Common.Collaboration', {returnObjects: true});
const isAndroid = Device.android; const isAndroid = Device.android;
const displayMode = storeReview.displayMode;
const viewMode = !storeAppOptions.canComments; const viewMode = !storeAppOptions.canComments;
const comments = storeComments.showComments; const comments = storeComments.showComments;
@ -801,10 +806,13 @@ const CommentList = inject("storeComments", "storeAppOptions")(observer(({storeC
</div> </div>
{!viewMode && {!viewMode &&
<div className='right'> <div className='right'>
{comment.editable && <div className='comment-resolve' onClick={() => {onResolveComment(comment);}}><Icon icon={comment.resolved ? 'icon-resolve-comment check' : 'icon-resolve-comment'}/></div>} {(comment.editable && displayMode === 'markup') && <div className='comment-resolve' onClick={() => {onResolveComment(comment);}}><Icon icon={comment.resolved ? 'icon-resolve-comment check' : 'icon-resolve-comment'}/></div>}
<div className='comment-menu' {displayMode === 'markup' &&
onClick={() => {openActionComment(true);}} <div className='comment-menu'
><Icon icon='icon-menu-comment'/></div> onClick={() => {openActionComment(true);}}>
<Icon icon='icon-menu-comment'/>
</div>
}
</div> </div>
} }
</div> </div>

View file

@ -189,6 +189,7 @@
} }
} }
.toolbar { .toolbar {
position: absolute;
border-radius: 0 0 var(--f7-popover-border-radius) var(--f7-popover-border-radius); border-radius: 0 0 var(--f7-popover-border-radius) var(--f7-popover-border-radius);
} }
} }
@ -227,3 +228,11 @@
text-align: center; text-align: center;
margin-top: 35px; margin-top: 35px;
} }
.actions-modal.modal-in {
z-index: 13700;
}
.actions-backdrop.backdrop-in {
z-index: 13600;
}

View file

@ -580,6 +580,14 @@
-ms-appearance: none; -ms-appearance: none;
appearance: none; appearance: none;
} }
// Fonts List
.font-item {
.item-content {
padding-left: 0;
}
}
} }

View file

@ -48,6 +48,11 @@
display: flex; display: flex;
justify-content: center; justify-content: center;
} }
&-inner {
background: var(--f7-navbar-bg-color);
background-image: var(--f7-navbar-bg-image, var(--f7-bars-bg-image));
background-color: var(--f7-navbar-bg-color, var(--f7-bars-bg-color));
}
} }
.page.page-with-subnavbar.page-with-logo { .page.page-with-subnavbar.page-with-logo {
@ -62,8 +67,13 @@
margin-bottom: 0; margin-bottom: 0;
margin-top: 8px; margin-top: 8px;
} }
.add-image {
ul:before, :after{
display: none;
}
}
.inputs-list { .inputs-list {
ul:after, :before{ ul:after {
display: none; display: none;
} }
} }
@ -545,4 +555,12 @@
} }
} }
} }
// Fonts List
.font-item {
.item-radio:not(.item-radio-icon-end) > .icon-radio {
margin-right: 0;
}
}
} }

View file

@ -257,6 +257,8 @@
margin-top: 14px; margin-top: 14px;
background-image: url(../img/themes/themes.png); background-image: url(../img/themes/themes.png);
display: block; display: block;
background-repeat: no-repeat;
background-size: cover;
} }
.item-theme.active:before { .item-theme.active:before {
content: ''; content: '';
@ -531,28 +533,44 @@
padding-left: 5px; padding-left: 5px;
padding-right: 5px; padding-right: 5px;
padding-top: 5px; padding-top: 5px;
} li.item-theme {
li { border: 0.5px solid #c8c7cc;
border: 0.5px solid #c8c7cc; padding: 2px;
padding: 2px; background-repeat: no-repeat;
background-repeat: no-repeat; width: 106px;
width: 106px; height: 56px;
height: 56px; margin-bottom: 10px;
margin-bottom: 10px; background-position: center;
background-position: center; .item-content {
} width: 100%;
.item-inner:after { height: 100%;
display: none; padding: 0;
} .item-inner {
.item-theme.active:before { width: 100%;
content: ''; height: 100%;
position: absolute; padding: 0;
width: 22px; &:after {
height: 22px; display: none;
right: 2px; }
bottom: 2px; .thumb {
z-index: 1; width: 100%;
.encoded-svg-background('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" viewBox="0 0 22 22" fill="#40865c"><g><circle fill="#fff" cx="11" cy="11" r="11"/><path d="M11,21A10,10,0,1,1,21,11,10,10,0,0,1,11,21h0ZM17.4,7.32L17.06,7a0.48,0.48,0,0,0-.67,0l-7,6.84L6.95,11.24a0.51,0.51,0,0,0-.59.08L6,11.66a0.58,0.58,0,0,0,0,.65l3.19,3.35a0.38,0.38,0,0,0,.39,0L17.4,8a0.48,0.48,0,0,0,0-.67h0Z"/></g></svg>'); height: 100%;
padding: 0;
background-size: contain;
}
}
}
&.active:before {
content: '';
position: absolute;
width: 22px;
height: 22px;
right: 2px;
bottom: 2px;
z-index: 1;
.encoded-svg-background('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" viewBox="0 0 22 22" fill="#40865c"><g><circle fill="#fff" cx="11" cy="11" r="11"/><path d="M11,21A10,10,0,1,1,21,11,10,10,0,0,1,11,21h0ZM17.4,7.32L17.06,7a0.48,0.48,0,0,0-.67,0l-7,6.84L6.95,11.24a0.51,0.51,0,0,0-.59.08L6,11.66a0.58,0.58,0,0,0,0,.65l3.19,3.35a0.38,0.38,0,0,0,.39,0L17.4,8a0.48,0.48,0,0,0,0-.67h0Z"/></g></svg>');
}
}
} }
} }
@ -836,6 +854,23 @@ input[type="number"]::-webkit-inner-spin-button {
overflow: hidden; overflow: hidden;
} }
// Statusbar
.statusbar .statusbar--box-tabs > ul > .locked a {
box-shadow: inset 0 2px red;
}
// Fonts List
.font-item {
.item-inner {
overflow: hidden;
&:after {
left: 16px;
}
}
}

View file

@ -50,7 +50,7 @@
.loadmask > .brendpanel .loading-logo > img { .loadmask > .brendpanel .loading-logo > img {
display: inline-block; display: inline-block;
max-width: 100px; max-width: 124px;
max-height: 20px; max-height: 20px;
margin-top: 2px; margin-top: 2px;
opacity: 0; opacity: 0;
@ -221,7 +221,7 @@
</div> </div>
</div> </div>
<div class="hyperlink-tooltip" data-toggle="tooltip" title="Press Ctrl and click the link" style="display:none;"></div> <div class="hyperlink-tooltip" data-toggle="tooltip" title="" style="display:none;"></div>
<!--vendor--> <!--vendor-->
<script type="text/javascript" src="../../../vendor/jquery/jquery.min.js"></script> <script type="text/javascript" src="../../../vendor/jquery/jquery.min.js"></script>

View file

@ -48,7 +48,7 @@
.loadmask > .brendpanel .loading-logo > img { .loadmask > .brendpanel .loading-logo > img {
display: inline-block; display: inline-block;
max-width: 100px; max-width: 124px;
max-height: 20px; max-height: 20px;
margin-top: 2px; margin-top: 2px;
opacity: 0; opacity: 0;
@ -213,7 +213,7 @@
</div> </div>
</div> </div>
<div class="hyperlink-tooltip" data-toggle="tooltip" title="Press Ctrl and click the link" style="display:none;"></div> <div class="hyperlink-tooltip" data-toggle="tooltip" title="" style="display:none;"></div>
<!--vendor--> <!--vendor-->
<script type="text/javascript" src="../../../vendor/jquery/jquery.min.js"></script> <script type="text/javascript" src="../../../vendor/jquery/jquery.min.js"></script>

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