Merge branch release/v6.0.0 into master

This commit is contained in:
papacarlo 2020-09-30 15:14:23 +00:00
commit 7f77bfb766
6863 changed files with 111478 additions and 26842 deletions

View file

@ -48,7 +48,8 @@
comment: <can comment in view mode> // default = edit,
modifyFilter: <can add, remove and save filter in the spreadsheet> // default = true
modifyContentControl: <can modify content controls in documenteditor> // default = true
fillForms: <can edit forms in view mode> // default = edit || review
fillForms: <can edit forms in view mode> // default = edit || review,
copy: <can copy data> // default = true
}
},
editorConfig: {
@ -75,14 +76,14 @@
{
title: 'document title',
url: 'document url',
folder: 'path to document'
folder: 'path to document',
},
...
],
templates: [
{
name: 'template name',
icon: 'template icon url',
title: 'template name', // name - is deprecated
image: 'template icon url',
url: 'http://...'
},
...
@ -133,7 +134,10 @@
spellcheck: true,
compatibleFeatures: false,
unit: 'cm' // cm, pt, inch,
mentionShare : true // customize tooltip for mention
mentionShare : true // customize tooltip for mention,
macros: true // can run macros in document
plugins: true // can run plugins in document
macrosMode: 'warn' // warn about automatic macros, 'enable', 'disable', 'warn'
},
plugins: {
autostart: ['asc.{FFE1F462-1EA2-4391-990D-4CC84940B754}'],
@ -212,7 +216,9 @@
_config.editorConfig.canRequestMailMergeRecipients = _config.events && !!_config.events.onRequestMailMergeRecipients;
_config.editorConfig.canRequestCompareFile = _config.events && !!_config.events.onRequestCompareFile;
_config.editorConfig.canRequestSharingSettings = _config.events && !!_config.events.onRequestSharingSettings;
_config.editorConfig.canRequestCreateNew = _config.events && !!_config.events.onRequestCreateNew;
_config.frameEditorId = placeholderId;
_config.parentOrigin = window.location.origin;
var onMouseUp = function (evt) {
_processMouse(evt);
@ -394,6 +400,10 @@
if (target && _checkConfigParams()) {
iframe = createIframe(_config);
if (iframe.src) {
var pathArray = iframe.src.split('/');
this.frameOrigin = pathArray[0] + '//' + pathArray[2];
}
target.parentNode && target.parentNode.replaceChild(iframe, target);
var _msgDispatcher = new MessageDispatcher(_onMessage, this);
}
@ -682,7 +692,7 @@
var _onMessage = function(msg) {
// TODO: check message origin
if (msg && window.JSON) {
if (msg && window.JSON && _scope.frameOrigin==msg.origin ) {
try {
var msg = window.JSON.parse(msg.data);
@ -762,7 +772,9 @@
if ( typeof(customization) == 'object' && ( customization.toolbarNoTabs ||
(config.editorConfig.targetApp!=='desktop') && (customization.loaderName || customization.loaderLogo))) {
index = "/index_loader.html";
}
} else if (config.editorConfig.mode == 'editdiagram' || config.editorConfig.mode == 'editmerge')
index = "/index_internal.html";
}
path += index;
return path;
@ -805,6 +817,9 @@
if (config.editorConfig && config.editorConfig.customization && (config.editorConfig.customization.toolbar===false))
params += "&toolbar=false";
if (config.parentOrigin)
params += "&parentOrigin=" + config.parentOrigin;
return params;
}

View file

@ -135,6 +135,8 @@ if (Common === undefined) {
var _onMessage = function(msg) {
// TODO: check message origin
if (msg.origin !== window.parentOrigin && msg.origin !== window.location.origin) return;
var data = msg.data;
if (Object.prototype.toString.apply(data) !== '[object String]' || !window.JSON) {
return;
@ -304,8 +306,8 @@ if (Common === undefined) {
_postMessage({event:'onRequestSendNotify', data: emails});
},
requestInsertImage: function () {
_postMessage({event:'onRequestInsertImage'});
requestInsertImage: function (command) {
_postMessage({event:'onRequestInsertImage', data: {c: command}});
},
requestMailMergeRecipients: function () {
@ -320,6 +322,10 @@ if (Common === undefined) {
_postMessage({event:'onRequestSharingSettings'});
},
requestCreateNew: function () {
_postMessage({event:'onRequestCreateNew'});
},
on: function(event, handler){
var localHandler = function(event, data){
handler.call(me, data)

View file

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

View file

@ -313,7 +313,8 @@ define([
if (me.options.el) {
me.render();
}
} else if (me.options.parentEl)
me.render(me.options.parentEl);
},
render: function(parentEl) {
@ -646,8 +647,14 @@ define([
oldCls = this.iconCls;
this.iconCls = cls;
btnIconEl.removeClass(oldCls);
btnIconEl.addClass(cls || '');
if (/svgicon/.test(this.iconCls)) {
var icon = /svgicon\s(\S+)/.exec(this.iconCls);
btnIconEl.find('use.zoom-int').attr('xlink:href', icon && icon.length>1 ? '#' + icon[1]: '');
btnIconEl.find('use.zoom-grit').attr('xlink:href', icon && icon.length>1 ? '#' + icon[1] + '-150' : '');
} else {
btnIconEl.removeClass(oldCls);
btnIconEl.addClass(cls || '');
}
},
changeIcon: function(opts) {

View file

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

View file

@ -95,7 +95,7 @@ define([
value : 'unchecked',
template : _.template('<label class="checkbox-indeterminate"><input id="<%= id %>" type="checkbox" class="checkbox__native">' +
'<label for="<%= id %>" class="checkbox__shape" /><span><%= labelText %></span></label>'),
'<label for="<%= id %>" class="checkbox__shape"></label><span><%= labelText %></span></label>'),
initialize : function(options) {
Common.UI.BaseView.prototype.initialize.call(this, options);

View file

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

View file

@ -142,7 +142,7 @@ define([
if (record.get('value')>0) {
formcontrol[0].innerHTML = '';
formcontrol.removeClass('text').addClass('image');
formcontrol.css('background-position', '0 -' + record.get('offsety') + 'px');
formcontrol.css('background-position', '10px -' + record.get('offsety') + 'px');
} else {
formcontrol[0].innerHTML = this.txtNoBorders;
formcontrol.removeClass('image').addClass('text');
@ -229,7 +229,7 @@ define([
'<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"><span class="caret img-commonctrl"></span></button>',
'<ul class="dropdown-menu <%= menuCls %>" style="<%= menuStyle %>" role="menu">',
'<% _.each(items, function(item) { %>',
'<li id="<%= item.id %>" data-value="<%= item.value %>"><a tabindex="-1" type="menuitem" style="padding: 2px 0;">',
'<li id="<%= item.id %>" data-value="<%= item.value %>"><a tabindex="-1" type="menuitem" style="padding: 2px 0 2px 10px;">',
'<span style="margin-top: 0;"></span>',
'<% if (item.offsety!==undefined) { %>',
'<img src="data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" align="left" style="background-position: 0 -<%= item.offsety %>px;">',
@ -265,7 +265,7 @@ define([
var formcontrol = $(this.el).find('.form-control');
formcontrol[0].innerHTML = '';
formcontrol.removeClass('text').addClass('image');
formcontrol.css('background-position', '0 -' + record.get('offsety') + 'px');
formcontrol.css('background-position', '10px -' + record.get('offsety') + 'px');
}
}, Common.UI.ComboBorderType || {}));

View file

@ -76,7 +76,7 @@ define([
'<li class="divider">',
'<% _.each(items, function(item) { %>',
'<li id="<%= item.id %>">',
'<a class="font-item" tabindex="-1" type="menuitem" style="height:<%=scope.getListItemHeight()%>px;"/>',
'<a class="font-item" tabindex="-1" type="menuitem" style="height:<%=scope.getListItemHeight()%>px;"></a>',
'</li>',
'<% }); %>',
'</ul>',
@ -344,7 +344,7 @@ define([
onApiChangeFontInternal: function(font) {
if (this.inFormControl) return;
var name = (_.isFunction(font.get_Name) ? font.get_Name() : font.asc_getName());
var name = (_.isFunction(font.get_Name) ? font.get_Name() : font.asc_getFontName());
if (this.getRawValue() !== name) {
var record = this.store.findWhere({
@ -380,7 +380,7 @@ define([
onInsertItem: function(item) {
$(this.el).find('ul').prepend(_.template([
'<li id="<%= item.id %>">',
'<a class="font-item" tabindex="-1" type="menuitem" style="height:<%=scope.getListItemHeight()%>px;"/>',
'<a class="font-item" tabindex="-1" type="menuitem" style="height:<%=scope.getListItemHeight()%>px;"></a>',
'</li>'
].join(''))({
item: item.attributes,

View file

@ -459,6 +459,13 @@ define([
this.menuPicker.selectByIndex(index);
},
selectRecord: function(record) {
if (!record)
this.fieldPicker.deselectAll();
this.menuPicker.selectRecord(record);
},
setItemWidth: function(width) {
if (this.itemWidth != width)
this.itemWidth = window.devicePixelRatio > 1 ? width / 2 : width;

View file

@ -575,8 +575,8 @@ define([
var div_top = div.offset().top,
div_first = $(this.dataViewItems[0].el),
div_first_top = (div_first.length>0) ? div_first[0].offsetTop : 0;
if (div_top < inner_top + div_first_top || div_top+div.outerHeight() > inner_top + innerEl.height()) {
div_first_top = (div_first.length>0) ? div_first[0].clientTop : 0;
if (div_top < inner_top + div_first_top || div_top+div.outerHeight()*0.9 > inner_top + div_first_top + innerEl.height()) {
if (this.scroller && this.allowScrollbar) {
this.scroller.scrollTop(innerEl.scrollTop() + div_top - inner_top - div_first_top, 0);
} else {

View file

@ -53,7 +53,8 @@ if (Common === undefined)
define([
'common/main/lib/component/BaseView',
'common/main/lib/component/Tooltip'
'common/main/lib/component/Tooltip',
'common/main/lib/component/Button'
], function () { 'use strict';
Common.UI.InputField = Common.UI.BaseView.extend((function() {
@ -87,7 +88,7 @@ define([
'placeholder="<%= placeHolder %>" ',
'value="<%= value %>"',
'>',
'<span class="input-error"/>',
'<span class="input-error"></span>',
'</div>'
].join('')),
@ -379,4 +380,136 @@ define([
}
}
})());
Common.UI.InputFieldBtn = Common.UI.InputField.extend((function() {
return {
options : {
id : null,
cls : '',
style : '',
value : '',
type : 'text',
name : '',
validation : null,
allowBlank : true,
placeHolder : '',
blankError : null,
spellcheck : false,
maskExp : '',
validateOnChange: false,
validateOnBlur: true,
disabled: false,
editable: true,
iconCls: 'btn-select-range',
btnHint: ''
},
template: _.template([
'<div class="input-field input-field-btn" style="<%= style %>">',
'<input ',
'type="<%= type %>" ',
'name="<%= name %>" ',
'spellcheck="<%= spellcheck %>" ',
'class="form-control <%= cls %>" ',
'placeholder="<%= placeHolder %>" ',
'value="<%= value %>"',
'>',
'<span class="input-error"></span>',
'<div class="select-button">' +
'<button type="button" class="btn btn-toolbar"><i class="icon toolbar__icon <%= iconCls %>"></i></button>' +
'</div>',
'</div>'
].join('')),
render : function(parentEl) {
var me = this;
if (!me.rendered) {
this.cmpEl = $(this.template({
id : this.id,
cls : this.cls,
style : this.style,
value : this.value,
type : this.type,
name : this.name,
placeHolder : this.placeHolder,
spellcheck : this.spellcheck,
iconCls : this.options.iconCls,
scope : me
}));
if (parentEl) {
this.setElement(parentEl, false);
parentEl.html(this.cmpEl);
} else {
this.$el.html(this.cmpEl);
}
} else {
this.cmpEl = this.$el;
}
if (!me.rendered) {
var el = this.cmpEl;
this._button = new Common.UI.Button({
el: this.cmpEl.find('button'),
hint: this.options.btnHint || ''
});
this._button.on('click', _.bind(this.onButtonClick, this));
this._input = this.cmpEl.find('input').addBack().filter('input');
if (this.editable) {
this._input.on('blur', _.bind(this.onInputChanged, this));
this._input.on('keypress', _.bind(this.onKeyPress, this));
this._input.on('keydown', _.bind(this.onKeyDown, this));
this._input.on('keyup', _.bind(this.onKeyUp, this));
if (this.validateOnChange) this._input.on('input', _.bind(this.onInputChanging, this));
if (this.maxLength) this._input.attr('maxlength', this.maxLength);
}
this.setEditable(this.editable);
if (this.disabled)
this.setDisabled(this.disabled);
if (this._input.closest('.asc-window').length>0)
var onModalClose = function() {
var errorTip = el.find('.input-error').data('bs.tooltip');
if (errorTip) errorTip.tip().remove();
Common.NotificationCenter.off({'modal:close': onModalClose});
};
Common.NotificationCenter.on({'modal:close': onModalClose});
}
me.rendered = true;
return this;
},
onButtonClick: function(btn, e) {
this.trigger('button:click', this, e);
},
setDisabled: function(disabled) {
this.disabled = disabled;
$(this.el).toggleClass('disabled', disabled);
disabled
? this._input.attr('disabled', true)
: this._input.removeAttr('disabled');
this._button.setDisabled(disabled);
},
setBtnDisabled: function(disabled) {
this._button.setDisabled(disabled);
},
updateBtnHint: function(hint) {
this.options.hint = hint;
if (!this.rendered) return;
this._button.updateHint(this.options.hint);
}
}
})());
});

View file

@ -68,10 +68,6 @@ define([
'use strict';
Common.UI.LoadMask = Common.UI.BaseView.extend((function() {
var ownerEl,
maskeEl,
loaderEl;
return {
options : {
cls : '',
@ -91,10 +87,17 @@ define([
Common.UI.BaseView.prototype.initialize.call(this, options);
this.template = this.options.template || this.template;
this.cls = this.options.cls;
this.style = this.options.style;
this.title = this.options.title;
this.owner = this.options.owner;
this.ownerEl = (this.options.owner instanceof Common.UI.BaseView) ? $(this.options.owner.el) : $(this.options.owner);
this.loaderEl = $(this.template({
id : this.id,
cls : this.options.cls,
style : this.options.style,
title : this.title
}));
this.maskeEl = $('<div class="asc-loadmask"></div>');
this.timerId = 0;
},
render: function() {
@ -102,66 +105,75 @@ define([
},
show: function(){
if (maskeEl || loaderEl)
return;
ownerEl = (this.owner instanceof Common.UI.BaseView) ? $(this.owner.el) : $(this.owner);
// if (maskeEl || loaderEl)
// return;
// The owner is already masked
if (ownerEl.hasClass('masked'))
var ownerEl = this.ownerEl,
loaderEl = this.loaderEl,
maskeEl = this.maskeEl;
if (!!ownerEl.ismasked)
return this;
ownerEl.ismasked = true;
var me = this;
if (me.title != me.options.title) {
me.options.title = me.title;
$('.asc-loadmask-title', loaderEl).html(me.title);
}
maskeEl = $('<div class="asc-loadmask"></div>');
loaderEl = $(this.template({
id : me.id,
cls : me.cls,
style : me.style,
title : me.title
}));
// show mask after 500 ms if it wont be hided
me.timerId = setTimeout(function () {
ownerEl.append(maskeEl);
ownerEl.append(loaderEl);
ownerEl.addClass('masked');
ownerEl.append(maskeEl);
ownerEl.append(loaderEl);
loaderEl.css({
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'
});
// if (ownerEl.height()<1 || ownerEl.width()<1)
// loaderEl.css({visibility: 'hidden'});
loaderEl.css({
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'
});
if (ownerEl.height()<1 || ownerEl.width()<1)
loaderEl.css({visibility: 'hidden'});
Common.util.Shortcuts.suspendEvents();
if (ownerEl && ownerEl.closest('.asc-window.modal').length==0)
Common.util.Shortcuts.suspendEvents();
},500);
return this;
},
hide: function() {
ownerEl && ownerEl.removeClass('masked');
maskeEl && maskeEl.remove();
loaderEl && loaderEl.remove();
maskeEl = null;
loaderEl = null;
Common.util.Shortcuts.resumeEvents();
var ownerEl = this.ownerEl;
if (this.timerId) {
clearTimeout(this.timerId);
this.timerId = 0;
}
if (ownerEl && ownerEl.ismasked) {
if (ownerEl.closest('.asc-window.modal').length==0 && !Common.Utils.ModalWindow.isVisible())
Common.util.Shortcuts.resumeEvents();
this.maskeEl && this.maskeEl.remove();
this.loaderEl && this.loaderEl.remove();
}
delete ownerEl.ismasked;
},
setTitle: function(title) {
this.title = title;
if (ownerEl && ownerEl.hasClass('masked') && loaderEl){
$('.asc-loadmask-title', loaderEl).html(title);
if (this.ownerEl && this.ownerEl.ismasked && this.loaderEl){
$('.asc-loadmask-title', this.loaderEl).html(title);
}
},
isVisible: function() {
return !_.isEmpty(loaderEl);
return !!this.ownerEl.ismasked;
},
updatePosition: function() {
if (ownerEl && ownerEl.hasClass('masked') && loaderEl){
var ownerEl = this.ownerEl,
loaderEl = this.loaderEl;
if (ownerEl && ownerEl.ismasked && loaderEl){
loaderEl.css({
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'

View file

@ -571,6 +571,8 @@ define([
}
}
} else {
var cg = Common.Utils.croppedGeometry();
docH = cg.height - 10;
if (top + menuH > docH) {
if (fixedAlign && typeof fixedAlign == 'string') { // how to align if menu height > window height
m = fixedAlign.match(/^([a-z]+)-([a-z]+)/);
@ -579,13 +581,18 @@ define([
top = docH - menuH;
}
if (top < 0)
top = 0;
if (top < cg.top)
top = cg.top;
}
if (this.options.additionalAlign)
this.options.additionalAlign.call(this, menuRoot, left, top);
else
menuRoot.css({left: Math.ceil(left), top: Math.ceil(top)});
else {
var _css = {left: Math.ceil(left), top: Math.ceil(top)};
if (!(menuH < docH)) _css['margin-top'] = 0;
menuRoot.css(_css);
}
},
clearAll: function() {

View file

@ -262,10 +262,10 @@ define([
this.lastValue = this.value;
if ( typeof value === 'undefined' || value === ''){
this.value = '';
} else if (this.options.allowAuto && (Math.abs(parseFloat(value)+1.)<0.0001 || value==this.options.autoText)) {
} else if (this.options.allowAuto && (Math.abs(Common.Utils.String.parseFloat(value)+1.)<0.0001 || value==this.options.autoText)) {
this.value = this.options.autoText;
} else {
var number = this._add(parseFloat(value), 0, (this.options.allowDecimal) ? 3 : 0);
var number = this._add(Common.Utils.String.parseFloat(value), 0, (this.options.allowDecimal) ? 3 : 0);
if ( typeof value === 'undefined' || isNaN(number)) {
number = this.oldValue;
showError = true;
@ -448,12 +448,12 @@ define([
var val = me.options.step;
if (me._fromKeyDown) {
val = this.getRawValue();
val = _.isEmpty(val) ? me.oldValue : parseFloat(val);
val = _.isEmpty(val) ? me.oldValue : Common.Utils.String.parseFloat(val);
} else if(me.getValue() !== '') {
if (me.options.allowAuto && me.getValue()==me.options.autoText) {
val = me.options.minValue-me.options.step;
} else
val = parseFloat(me.getValue());
val = Common.Utils.String.parseFloat(me.getValue());
if (isNaN(val))
val = this.oldValue;
} else {
@ -469,12 +469,12 @@ define([
var val = me.options.step;
if (me._fromKeyDown) {
val = this.getRawValue();
val = _.isEmpty(val) ? me.oldValue : parseFloat(val);
val = _.isEmpty(val) ? me.oldValue : Common.Utils.String.parseFloat(val);
} else if(me.getValue() !== '') {
if (me.options.allowAuto && me.getValue()==me.options.autoText) {
val = me.options.minValue;
} else
val = parseFloat(me.getValue());
val = Common.Utils.String.parseFloat(me.getValue());
if (isNaN(val))
val = this.oldValue;

View file

@ -61,7 +61,11 @@ define([
};
function onTabDblclick(e) {
this.fireEvent('change:compact', [$(e.target).data('tab')]);
var tab = $(e.currentTarget).find('> a[data-tab]').data('tab');
if ( this.dblclick_el == tab ) {
this.fireEvent('change:compact', [tab]);
this.dblclick_el = undefined;
}
}
function onShowFullviewPanel(state) {
@ -233,25 +237,35 @@ define([
onTabClick: function (e) {
var me = this;
var $target = $(e.currentTarget);
var tab = $target.find('> a[data-tab]').data('tab');
var islone = $target.hasClass('x-lone');
if ( me.isFolded ) {
if ( $target.hasClass('x-lone') ) {
me.collapse();
// me.fireEvent('')
} else
if ( $target.hasClass('active') ) {
me.collapse();
} else {
me.setTab(tab);
me.processPanelVisible(null, true);
}
if ($target.hasClass('x-lone')) {
me.isFolded && me.collapse();
} else {
if ( !$target.hasClass('active') && !islone ) {
if ( $target.hasClass('active') ) {
if (!me._timerSetTab) {
me.dblclick_el = tab;
if ( me.isFolded ) {
me.collapse();
setTimeout(function(){
me.dblclick_el = undefined;
}, 500);
}
}
} else {
me._timerSetTab = true;
setTimeout(function(){
me._timerSetTab = false;
}, 500);
me.setTab(tab);
me.processPanelVisible(null, true);
if ( !me.isFolded ) {
if ( me.dblclick_timer ) clearTimeout(me.dblclick_timer);
me.dblclick_timer = setTimeout(function () {
me.dblclick_el = tab;
delete me.dblclick_timer;
},500);
}
}
}
},
@ -286,6 +300,7 @@ define([
if ( $tp.length ) {
$tp.addClass('active');
}
this.fireEvent('tab:active', [tab]);
}
},
@ -365,20 +380,68 @@ define([
if ( $active && $active.length ) {
var _maxright = $active.parents('.box-controls').width();
var data = $active.data(),
_rightedge = data.rightedge;
_rightedge = data.rightedge,
_btns = data.buttons,
_flex = data.flex;
if ( !_rightedge ) {
_rightedge = $active.get(0).getBoundingClientRect().right;
}
if ( !_btns ) {
_btns = [];
_.each($active.find('.btn-slot .x-huge'), function(item) {
_btns.push($(item).closest('.btn-slot'));
});
data.buttons = _btns;
}
if (!_flex) {
_flex = [];
_.each($active.find('.group.flex'), function(item) {
var el = $(item);
_flex.push({el: el, width: el.attr('data-group-width') || el.attr('max-width')}); //save flex element and it's initial width
});
data.flex = _flex;
}
if ( _rightedge > _maxright ) {
if ( !$active.hasClass('compactwidth') ) {
$active.addClass('compactwidth');
data.rightedge = _rightedge;
if ( _rightedge > _maxright) {
if (_flex.length>0) {
for (var i=0; i<_flex.length; i++) {
var item = _flex[i].el;
if (item.outerWidth() > parseInt(item.css('min-width')))
return;
else
item.css('width', item.css('min-width'));
}
}
for (var i=_btns.length-1; i>=0; i--) {
var btn = _btns[i];
if ( !btn.hasClass('compactwidth') ) {
btn.addClass('compactwidth');
_rightedge = $active.get(0).getBoundingClientRect().right;
if (_rightedge <= _maxright)
break;
}
}
data.rightedge = _rightedge;
} else {
if ($active.hasClass('compactwidth')) {
$active.removeClass('compactwidth');
for (var i=0; i<_btns.length; i++) {
var btn = _btns[i];
if ( btn.hasClass('compactwidth') ) {
btn.removeClass('compactwidth');
_rightedge = $active.get(0).getBoundingClientRect().right;
if ( _rightedge > _maxright) {
btn.addClass('compactwidth');
_rightedge = $active.get(0).getBoundingClientRect().right;
break;
}
}
}
data.rightedge = _rightedge;
if (_flex.length>0 && $active.find('.btn-slot.compactwidth').length<1) {
for (var i=0; i<_flex.length; i++) {
var item = _flex[i];
item.el.css('width', item.width);
}
}
}
}
@ -406,8 +469,10 @@ define([
},
setVisible: function (tab, visible) {
if ( tab && this.$tabs )
if ( tab && this.$tabs ) {
this.$tabs.find('> a[data-tab=' + tab + ']').parent().css('display', visible ? '' : 'none');
this.onResize();
}
}
};
}()));

View file

@ -72,7 +72,7 @@ define([
rendered : false,
template : _.template('<label class="radiobox"><input type="radio" name="<%= name %>" id="<%= id %>" class="button__radiobox">' +
'<label for="<%= id %>" class="radiobox__shape" /><span><%= labelText %></span></label>'),
'<label for="<%= id %>" class="radiobox__shape"></label><span><%= labelText %></span></label>'),
initialize : function(options) {
Common.UI.BaseView.prototype.initialize.call(this, options);

View file

@ -52,7 +52,7 @@ define([
'<div class="asc-synchronizetip">',
'<div class="tip-arrow <%= scope.placement %>"></div>',
'<div>',
'<div class="tip-text" style="width: 260px;"><%= scope.text %></div>',
'<div class="tip-text"><%= scope.text %></div>',
'<div class="close img-commonctrl"></div>',
'</div>',
'<% if ( scope.showLink ) { %>',
@ -105,6 +105,10 @@ define([
applyPlacement: function () {
var showxy = this.target.offset(),
innerHeight = Common.Utils.innerHeight();
if (this.placement == 'document') {
// this.cmpEl.css('top', $('#editor_sdk').offset().top);
} else
if (this.placement == 'top')
this.cmpEl.css({bottom : innerHeight - showxy.top + 'px', right: Common.Utils.innerWidth() - showxy.left - this.target.width()/2 + 'px'});
else {// left or right
@ -124,7 +128,7 @@ define([
},
textDontShow : 'Don\'t show this message again',
textSynchronize : 'The document has been changed by another user.<br/>Please click to save your changes and reload the updates.'
textSynchronize : 'The document has been changed by another user.<br>Please click to save your changes and reload the updates.'
}
})(), Common.UI.SynchronizeTip || {}));
});

View file

@ -51,8 +51,9 @@ define([
this.active = false;
this.label = 'Tab';
this.cls = '';
this.template = _.template(['<li class="<% if(active){ %>active selected<% } %> <% if(cls.length){%><%= cls %><%}%>" data-label="<%- label %>">',
'<a title="<%- label %>"><%- label %></a>',
this.index = -1;
this.template = _.template(['<li class="list-item <% if(active){ %>active selected<% } %> <% if(cls.length){%><%= cls %><%}%>" data-label="<%- label %>">',
'<span title="<%- label %>" draggable="true" oo_editor_input="true" tabindex="-1" data-index="<%= index %>"><%- label %></span>',
'</li>'].join(''));
this.initialize.call(this, opts);
@ -124,7 +125,7 @@ define([
},
setCaption: function(text) {
this.$el.find('> a').text(text);
this.$el.find('> span').text(text);
}
});

View file

@ -142,8 +142,10 @@ define([
me.bar.$bar.scrollLeft(me.scrollLeft);
me.bar.scrollX = undefined;
}
me.bar.checkInvisible();
me.drag = undefined;
me.bar.trigger('tab:drop', this);
}
}
function dragMove (event) {
@ -187,6 +189,7 @@ define([
$(document).off('mouseup.tabbar');
$(document).off('mousemove.tabbar', dragMove);
});
this.bar.trigger('tab:drag', this.bar.selectTabs);
}
}
}
@ -219,10 +222,16 @@ define([
this.bar.trigger('tab:manual', this.bar, this.bar.tabs.indexOf(tab), tab);
} else {
tab.changeState();
if (this.bar.isEditFormula)
setTimeout(function(){
$('#ce-cell-content').focus();
var $cellContent = $('#ce-cell-content')[0];
$cellContent.selectionStart = $cellContent.selectionEnd = $cellContent.value.length;
}, 500);
}
}
}
!tab.disabled && Common.NotificationCenter.trigger('edit:complete', this.bar);
!tab.disabled && Common.NotificationCenter.trigger('edit:complete', 'tab');
}, this),
dblclick: $.proxy(function() {
this.trigger('tab:dblclick', this, this.tabs.indexOf(tab), tab);
@ -231,14 +240,82 @@ define([
this.trigger('tab:contextmenu', this, this.tabs.indexOf(tab), tab, this.selectTabs);
}, this.bar),
mousedown: $.proxy(function (e) {
if (this.bar.options.draggable && !_.isUndefined(dragHelper) && (3 !== e.which)) {
if (!tab.isLockTheDrag) {
if (!e.ctrlKey && !e.metaKey && !e.shiftKey) {
tab.changeState();
dragHelper.setHookTabs(e, this.bar, this.bar.selectTabs);
if ((3 !== e.which) && !e.ctrlKey && !e.metaKey && !e.shiftKey) {
var lockDrag = tab.isLockTheDrag;
this.bar.selectTabs.forEach(function (item) {
if (item.isLockTheDrag) {
lockDrag = true;
}
});
if (this.bar.selectTabs.length === this.bar.tabs.length || this.bar.tabs.length === 1 || this.bar.isEditFormula) {
lockDrag = true;
}
this.bar.$el.find('ul > li > span').attr('draggable', !lockDrag);
if (!lockDrag)
tab.changeState();
} else {
this.bar.$el.find('ul > li > span').attr('draggable', 'false');
}
if ($('#ce-cell-content').is(':focus'))
if (!this.bar.isEditFormula) {
$('#ce-cell-content').blur();
} else {
setTimeout(function () {
$('#ce-cell-content').focus();
}, 500)
}
}, this)
});
tab.$el.children().on(
{dragstart: $.proxy(function (e) {
var event = e.originalEvent,
img = document.createElement('div');
event.dataTransfer.setDragImage(img, 0, 0);
event.dataTransfer.effectAllowed = 'move';
this.bar.trigger('tab:dragstart', event.dataTransfer, this.bar.selectTabs);
}, this),
dragenter: $.proxy(function (e) {
var event = e.originalEvent;
if (!this.bar.isEditFormula) {
this.bar.$el.find('.mousemove').removeClass('mousemove right');
$(e.currentTarget).parent().addClass('mousemove');
var data = event.dataTransfer.getData("onlyoffice");
event.dataTransfer.dropEffect = data ? 'move' : 'none';
} else {
event.dataTransfer.dropEffect = 'none';
}
}, this),
dragover: $.proxy(function (e) {
var event = e.originalEvent;
if (event.preventDefault) {
event.preventDefault(); // Necessary. Allows us to drop.
}
if (!this.bar.isEditFormula) {
this.bar.$el.find('.mousemove').removeClass('mousemove right');
$(e.currentTarget).parent().addClass('mousemove');
} else {
event.dataTransfer.dropEffect = 'none';
}
return false;
}, this),
dragleave: $.proxy(function (e) {
$(e.currentTarget).parent().removeClass('mousemove right');
}, this),
dragend: $.proxy(function (e) {
var event = e.originalEvent;
if (event.dataTransfer.dropEffect === 'move') {
this.bar.trigger('tab:dragend', true);
} else {
this.bar.trigger('tab:dragend', false);
}
this.bar.$el.find('.mousemove').removeClass('mousemove right');
}, this),
drop: $.proxy(function (e) {
var event = e.originalEvent,
index = $(event.currentTarget).data('index');
this.bar.$el.find('.mousemove').removeClass('mousemove right');
this.bar.trigger('tab:drop', event.dataTransfer, index);
this.bar.isDrop = true;
}, this)
});
};
@ -255,7 +332,7 @@ define([
},
tabs: [],
template: _.template('<ul class="nav nav-tabs <%= placement %>" />'),
template: _.template('<ul id="statusbar_bottom" class="nav nav-tabs <%= placement %>"></ul>'),
selectTabs: [],
initialize : function (options) {
@ -275,6 +352,33 @@ define([
var eventname=(/Firefox/i.test(navigator.userAgent))? 'DOMMouseScroll' : 'mousewheel';
addEvent(this.$bar[0], eventname, _.bind(this._onMouseWheel,this));
addEvent(this.$bar[0], 'dragstart', _.bind(function (event) {
event.dataTransfer.effectAllowed = 'move';
}, this));
addEvent(this.$bar[0], 'dragenter', _.bind(function (event) {
var data = event.dataTransfer.getData("onlyoffice");
event.dataTransfer.dropEffect = (!this.isEditFormula && data) ? 'move' : 'none';
}, this));
addEvent(this.$bar[0], 'dragover', _.bind(function (event) {
if (event.preventDefault) {
event.preventDefault(); // Necessary. Allows us to drop.
}
event.dataTransfer.dropEffect = !this.isEditFormula ? 'move' : 'none';
!this.isEditFormula && this.tabs[this.tabs.length - 1].$el.addClass('mousemove right');
return false;
}, this));
addEvent(this.$bar[0], 'dragleave', _.bind(function (event) {
event.dataTransfer.dropEffect = 'none';
this.tabs[this.tabs.length - 1].$el.removeClass('mousemove right');
}, this));
addEvent(this.$bar[0], 'drop', _.bind(function (event) {
this.$el.find('.mousemove').removeClass('mousemove right');
if (this.isDrop === undefined) {
this.trigger('tab:drop', event.dataTransfer, 'last');
} else {
this.isDrop = undefined;
}
}, this));
this.manager = new StateManager({bar: this});
@ -459,19 +563,24 @@ define([
this.checkInvisible(suppress);
} else if ( index >= (this.tabs.length - 1) || index == 'last') {
var tab = this.tabs[this.tabs.length-1].$el;
this.$bar.scrollLeft(this.$bar.scrollLeft() + (tab.position().left + parseInt(tab.css('width')) - this.$bar.width()) + 1);
if (this.$bar.find('.separator-item').length === 0) {
this.$bar.append('<li class="separator-item"><span></span></li>');
}
this.$bar.scrollLeft(this.$bar.scrollLeft() + (tab.position().left + parseInt(tab.css('width')) - this.$bar.width()) + (this.$bar.width() > 400 ? 20 : 5));
this.checkInvisible(suppress);
} else {
if (!this.isTabVisible(this.tabs.length - 1) && this.$bar.find('.separator-item').length === 0) {
this.$bar.append('<li class="separator-item"><span></span></li>');
}
var rightbound = this.$bar.width(),
tab, right, left;
if (index == 'forward') {
for (var i = 0; i < this.tabs.length; i++) {
tab = this.tabs[i].$el;
right = tab.position().left + parseInt(tab.css('width'));
if (right > rightbound) {
this.$bar.scrollLeft(this.$bar.scrollLeft() + (right - rightbound) + 20);
this.$bar.scrollLeft(this.$bar.scrollLeft() + (right - rightbound) + (this.$bar.width() > 400 ? 20 : 5));
this.checkInvisible(suppress);
break;
}
@ -540,7 +649,7 @@ define([
//left = tab.position().left;
//right = left + tab.width();
return !(left < leftbound) && !(right - rightbound > 0.1);
return !(left < leftbound) && !(right - rightbound > 0.5);
}
return false;

View file

@ -264,6 +264,22 @@ define([
expandToLevel: function(expandLevel) {
this.store.expandToLevel(expandLevel);
this.scroller.update({minScrollbarLength: 40, alwaysVisibleY: this.scrollAlwaysVisible});
},
expandRecord: function(record) {
if (record) {
record.set('isExpanded', true);
this.store.expandSubItems(record);
this.scroller.update({minScrollbarLength: 40, alwaysVisibleY: this.scrollAlwaysVisible});
}
},
collapseRecord: function(record) {
if (record) {
record.set('isExpanded', false);
this.store.collapseSubItems(record);
this.scroller.update({minScrollbarLength: 40, alwaysVisibleY: this.scrollAlwaysVisible});
}
}
}
})());

View file

@ -136,7 +136,8 @@
var Common = {};
define([
'common/main/lib/component/BaseView'
'common/main/lib/component/BaseView',
'common/main/lib/component/CheckBox'
], function () {
'use strict';
@ -219,25 +220,34 @@ define([
}
}
function _centre() {
function _readDocumetGeometry() {
if (window.innerHeight == undefined) {
var main_width = document.documentElement.offsetWidth;
var main_height = document.documentElement.offsetHeight;
var width = document.documentElement.offsetWidth,
height = document.documentElement.offsetHeight;
} else {
main_width = Common.Utils.innerWidth();
main_height = Common.Utils.innerHeight();
width = Common.Utils.innerWidth();
height = Common.Utils.innerHeight();
}
height -= Common.Utils.InternalSettings.get('window-inactive-area-top');
return {width: width, height: height, top: Common.Utils.InternalSettings.get('window-inactive-area-top')};
}
function _centre() {
var main_geometry = _readDocumetGeometry(),
main_width = main_geometry.width,
main_height = main_geometry.height;
if (this.initConfig.height == 'auto') {
var win_height = parseInt(this.$window.find('.body').css('height'));
this.initConfig.header && (win_height += parseInt(this.$window.find('.header').css('height')));
} else
} else {
win_height = this.initConfig.height;
win_height > main_height && (win_height = main_height);
}
var win_width = (this.initConfig.width=='auto') ? parseInt(this.$window.find('.body').css('width')) : this.initConfig.width;
var top = Common.Utils.InternalSettings.get('window-inactive-area-top') +
Math.floor((parseInt(main_height) - parseInt(win_height)) / 2);
var top = main_geometry.top + Math.floor((parseInt(main_height) - parseInt(win_height)) / 2);
var left = Math.floor((parseInt(main_width) - parseInt(win_width)) / 2);
this.$window.css('left',left);
@ -245,18 +255,21 @@ define([
}
function _setVisible() {
if (window.innerHeight == undefined) {
var main_width = document.documentElement.offsetWidth;
var main_height = document.documentElement.offsetHeight;
} else {
main_width = Common.Utils.innerWidth();
main_height = Common.Utils.innerHeight();
}
var main_geometry = _readDocumetGeometry(),
main_width = main_geometry.width,
main_height = main_geometry.height;
if (this.getLeft() + this.getWidth() > main_width)
this.$window.css('left', main_width - this.getWidth());
if (this.getTop() + this.getHeight() > main_height)
this.$window.css('top', main_height - this.getHeight());
if (this.getTop() < main_geometry.top )
this.$window.css('top', main_geometry.top);
else
if (this.getTop() + this.getHeight() > main_height) {
if (main_height - this.getHeight() < 0)
this.$window.css('top', main_geometry.top);
else this.$window.css('top', main_geometry.top + main_height - this.getHeight());
}
}
function _getTransformation(end) {
@ -278,16 +291,15 @@ define([
this.dragging.initx = event.pageX*zoom - this.getLeft();
this.dragging.inity = event.pageY*zoom - this.getTop();
if (window.innerHeight == undefined) {
var main_width = document.documentElement.offsetWidth;
var main_height = document.documentElement.offsetHeight;
} else {
main_width = Common.Utils.innerWidth();
main_height = Common.Utils.innerHeight();
}
var main_geometry = _readDocumetGeometry(),
main_width = main_geometry.width,
main_height = main_geometry.height;
this.dragging.maxx = main_width - this.getWidth();
this.dragging.maxy = main_height - this.getHeight() + Common.Utils.InternalSettings.get('window-inactive-area-top');
this.dragging.maxy = main_height - this.getHeight();
if (this.dragging.maxy < 0)
this.dragging.maxy = 0;
this.dragging.maxy += main_geometry.top;
$(document).on('mousemove', this.binding.drag);
$(document).on('mouseup', this.binding.dragStop);
@ -345,9 +357,10 @@ define([
this.resizing.inith = this.getHeight();
this.resizing.type = [el.hasClass('left') ? -1 : (el.hasClass('right') ? 1 : 0), el.hasClass('top') ? -1 : (el.hasClass('bottom') ? 1 : 0)];
var main_width = (window.innerHeight == undefined) ? document.documentElement.offsetWidth : Common.Utils.innerWidth(),
main_height = (window.innerHeight == undefined) ? document.documentElement.offsetHeight : Common.Utils.innerHeight(),
maxwidth = (this.initConfig.maxwidth) ? this.initConfig.maxwidth : main_width,
var main_geometry = _readDocumetGeometry(),
main_width = main_geometry.width,
main_height = main_geometry.height;
var maxwidth = (this.initConfig.maxwidth) ? this.initConfig.maxwidth : main_width,
maxheight = (this.initConfig.maxheight) ? this.initConfig.maxheight : main_height;
this.resizing.minw = this.initConfig.minwidth;
@ -427,12 +440,12 @@ define([
if (!options.width) options.width = 'auto';
var template = '<div class="info-box">' +
'<% if (typeof iconCls !== "undefined") { %><div class="icon img-commonctrl <%= iconCls %>" /><% } %>' +
'<% if (typeof iconCls !== "undefined") { %><div class="icon img-commonctrl <%= iconCls %>"></div><% } %>' +
'<div class="text" <% if (typeof iconCls == "undefined") { %> style="padding-left:10px;" <% } %>><span><%= msg %></span>' +
'<% if (dontshow) { %><div class="dont-show-checkbox"></div><% } %>' +
'</div>' +
'</div>' +
'<% if (dontshow) { %><div class="separator horizontal" style="width: 100%;"/><% } %>';
'<% if (dontshow) { %><div class="separator horizontal" style="width: 100%;"></div><% } %>';
_.extend(options, {
cls: 'alert',
@ -495,7 +508,7 @@ define([
footer.find('.dlg-btn').on('click', onBtnClick);
chDontShow = new Common.UI.CheckBox({
el: win.$window.find('.dont-show-checkbox'),
labelText: win.textDontShow
labelText: options.textDontShow || win.textDontShow
});
autoSize(obj);
},
@ -508,13 +521,14 @@ define([
});
win.show();
return win;
};
Common.UI.error = function(options) {
options = options || {};
!options.title && (options.title = this.Window.prototype.textError);
Common.UI.alert(
return Common.UI.alert(
_.extend(options, {
iconCls: 'error'
})
@ -525,7 +539,7 @@ define([
options = options || {};
!options.title && (options.title = this.Window.prototype.textConfirmation);
Common.UI.alert(
return Common.UI.alert(
_.extend(options, {
iconCls: 'confirm'
})
@ -536,7 +550,7 @@ define([
options = options || {};
!options.title && (options.title = this.Window.prototype.textInformation);
Common.UI.alert(
return Common.UI.alert(
_.extend(options, {
iconCls: 'info'
})
@ -547,7 +561,7 @@ define([
options = options || {};
!options.title && (options.title = this.Window.prototype.textWarning);
Common.UI.alert(
return Common.UI.alert(
_.extend(options, {
iconCls: 'warn'
})
@ -595,7 +609,7 @@ define([
Common.UI.BaseView.prototype.initialize.call(this, this.initConfig);
},
render : function() {
render: function() {
var renderto = this.initConfig.renderTo || document.body;
$(renderto).append(
_.template(template)(this.initConfig)
@ -652,6 +666,22 @@ define([
this.initConfig.footerCls && this.$window.find('.footer').addClass(this.initConfig.footerCls);
this.menuAddAlign = function(menuRoot, left, top) {
var self = this;
if (!me.$window.hasClass('notransform')) {
me.$window.addClass('notransform');
menuRoot.addClass('hidden');
setTimeout(function() {
menuRoot.removeClass('hidden');
menuRoot.css({left: left, top: top});
self.options.additionalAlign = null;
}, 300);
} else {
menuRoot.css({left: left, top: top});
self.options.additionalAlign = null;
}
};
this.fireEvent('render:after',this);
return this;
},
@ -663,13 +693,12 @@ define([
mask.attr('counter', parseInt(mask.attr('counter'))+1);
mask.show();
} else {
var opacity = mask.css('opacity');
mask.css('opacity', 0);
mask.attr('counter', parseInt(mask.attr('counter'))+1);
mask.show();
setTimeout(function () {
mask.css(_getTransformation(opacity));
mask.css(_getTransformation('0.2'));
}, 1);
}
@ -755,12 +784,11 @@ define([
if ( hide_mask ) {
if (this.options.animate !== false) {
var opacity = mask.css('opacity');
mask.css(_getTransformation(0));
setTimeout(function () {
mask.css('opacity', opacity);
if (parseInt(mask.attr('counter'))<1) {
mask.css('opacity', '0.2');
mask.hide();
mask.attr('counter', 0);
}
@ -773,7 +801,7 @@ define([
}
}
Common.NotificationCenter.trigger('modal:close', this);
Common.NotificationCenter.trigger('modal:close', this, hide_mask && (parseInt(mask.attr('counter'))<1));
}
this.$window.remove();
@ -796,12 +824,11 @@ define([
if ( hide_mask ) {
if (this.options.animate !== false) {
var opacity = mask.css('opacity');
mask.css(_getTransformation(0));
setTimeout(function () {
mask.css('opacity', opacity);
if (parseInt(mask.attr('counter'))<1) {
mask.css('opacity', '0.2');
mask.hide();
mask.attr('counter', 0);
}
@ -813,7 +840,7 @@ define([
}
}
}
Common.NotificationCenter.trigger('modal:hide', this);
Common.NotificationCenter.trigger('modal:hide', this, hide_mask && (parseInt(mask.attr('counter'))<1));
}
this.$window.hide();
this.$window.removeClass('notransform');
@ -921,6 +948,13 @@ define([
this.$window.find('.resize-border').remove();
}
this.resizable = resizable;
} else {
if (resizable) {
(minSize && minSize.length>1) && (this.initConfig.minwidth = minSize[0]);
(minSize && minSize.length>1) && (this.initConfig.minheight = minSize[1]);
(maxSize && maxSize.length>1) && (this.initConfig.maxwidth = maxSize[0]);
(maxSize && maxSize.length>1) && (this.initConfig.maxheight = maxSize[1]);
}
}
},

View file

@ -200,6 +200,15 @@ define([
$('.toolbar').addClass('editor-native-color');
});
Common.NotificationCenter.on('document:ready', function () {
if ( config.isEdit ) {
var maincontroller = webapp.getController('Main');
if (maincontroller.api.asc_isReadOnly && maincontroller.api.asc_isReadOnly()) {
maincontroller.warningDocumentIsLocked();
}
}
});
Common.NotificationCenter.on('action:undocking', function (opts) {
native.execCommand('editor:event', JSON.stringify({action:'undocking', state: opts == 'dock' ? 'dock' : 'undock'}));
});
@ -267,7 +276,7 @@ define([
} else
if ( opts == 'create:new' ) {
if (config.createUrl == 'desktop://create.new') {
native.LocalFileCreate(!!window.SSE ? 2 : !!window.PE ? 1 : 0);
native.execCommand("create:new", !!window.SSE ? 'cell' : !!window.PE ? 'slide' : 'word');
return true;
}
}

View file

@ -99,7 +99,7 @@ define([
},this),
'show': _.bind(function(cmp){
var h = this.diagramEditorView.getHeight(),
innerHeight = Common.Utils.innerHeight();
innerHeight = Common.Utils.innerHeight() - Common.Utils.InternalSettings.get('window-inactive-area-top');
if (innerHeight>h && h<700 || innerHeight<h) {
h = Math.min(innerHeight, 700);
this.diagramEditorView.setHeight(h);

View file

@ -151,15 +151,17 @@ define([
setApi: function(api) {
this.api = api;
this.api.asc_registerCallback("asc_onPluginShow", _.bind(this.onPluginShow, this));
this.api.asc_registerCallback("asc_onPluginClose", _.bind(this.onPluginClose, this));
this.api.asc_registerCallback("asc_onPluginResize", _.bind(this.onPluginResize, this));
this.api.asc_registerCallback("asc_onPluginMouseUp", _.bind(this.onPluginMouseUp, this));
this.api.asc_registerCallback("asc_onPluginMouseMove", _.bind(this.onPluginMouseMove, this));
this.api.asc_registerCallback('asc_onPluginsReset', _.bind(this.resetPluginsList, this));
this.api.asc_registerCallback('asc_onPluginsInit', _.bind(this.onPluginsInit, this));
if (!this.appOptions.customization || (this.appOptions.customization.plugins!==false)) {
this.api.asc_registerCallback("asc_onPluginShow", _.bind(this.onPluginShow, this));
this.api.asc_registerCallback("asc_onPluginClose", _.bind(this.onPluginClose, this));
this.api.asc_registerCallback("asc_onPluginResize", _.bind(this.onPluginResize, this));
this.api.asc_registerCallback("asc_onPluginMouseUp", _.bind(this.onPluginMouseUp, this));
this.api.asc_registerCallback("asc_onPluginMouseMove", _.bind(this.onPluginMouseMove, this));
this.api.asc_registerCallback('asc_onPluginsReset', _.bind(this.resetPluginsList, this));
this.api.asc_registerCallback('asc_onPluginsInit', _.bind(this.onPluginsInit, this));
this.loadPlugins();
this.loadPlugins();
}
return this;
},

View file

@ -941,8 +941,8 @@ define([
textChart: 'Chart',
textShape: 'Shape',
textTableChanged: '<b>Table Settings Changed</b>',
textTableRowsAdd: '<b>Table Rows Added<b/>',
textTableRowsDel: '<b>Table Rows Deleted<b/>',
textTableRowsAdd: '<b>Table Rows Added</b>',
textTableRowsDel: '<b>Table Rows Deleted</b>',
textParaMoveTo: '<b>Moved:</b>',
textParaMoveFromUp: '<b>Moved Up:</b>',
textParaMoveFromDown: '<b>Moved Down:</b>',

View file

@ -29,7 +29,8 @@
',': 188, '.': 190, '/': 191,
'`': 192, '-': 189, '=': 187,
';': 186, '\'': 222,
'[': 219, ']': 221, '\\': 220
'[': 219, ']': 221, '\\': 220,
'ff-': 173, 'ff=': 61
},
code = function(x){
return _MAP[x] || x.toUpperCase().charCodeAt(0);

View file

@ -7,7 +7,7 @@
</div>
<div id="chat-options" class="layout-item">
<div id="chat-options-ct">
<textarea id="chat-msg-text" class="user-select" maxlength="<%=maxMsgLength%>"></textarea>
<textarea id="chat-msg-text" class="user-select textarea-control" maxlength="<%=maxMsgLength%>"></textarea>
<button id="chat-msg-btn-add" class="btn normal dlg-btn primary"><%=scope.textSend%></button>
</div>
</div>

View file

@ -14,7 +14,7 @@
<div class="user-message" data-can-copy="true"><%=scope.pickLink(comment)%></div>
<% } else { %>
<div class="inner-edit-ct">
<textarea class="msg-reply user-select" maxlength="maxCommLength"><%=comment%></textarea>
<textarea class="msg-reply user-select textarea-control" maxlength="maxCommLength"><%=comment%></textarea>
<button class="btn normal dlg-btn primary btn-inner-edit" id="id-comments-change">textEdit</button>
<button class="btn normal dlg-btn btn-inner-close">textCancel</button>
</div>
@ -42,7 +42,7 @@
<%}%>
<% } else { %>
<div class="inner-edit-ct">
<textarea class="msg-reply textarea-fix user-select" maxlength="maxCommLength"><%=item.get("reply")%></textarea>
<textarea class="msg-reply textarea-fix user-select textarea-control" maxlength="maxCommLength"><%=item.get("reply")%></textarea>
<button class="btn normal dlg-btn primary btn-inner-edit btn-fix" id="id-comments-change">textEdit</button>
<button class="btn normal dlg-btn btn-inner-close">textClose</button>
</div>
@ -81,7 +81,7 @@
<% if (showReply) { %>
<div class="reply-ct">
<textarea class="msg-reply user-select" placeholder="textAddReply" maxlength="maxCommLength"></textarea>
<textarea class="msg-reply user-select textarea-control" placeholder="textAddReply" maxlength="maxCommLength"></textarea>
<button class="btn normal dlg-btn primary btn-reply" id="id-comments-change">textReply</button>
<button class="btn normal dlg-btn btn-close">textClose</button>
</div>

View file

@ -1,11 +1,11 @@
<div id="comments-box" class="layout-ct vbox">
<div class="layout-item messages-ct"/>
<div class="layout-item messages-ct"></div>
<div class="layout-item add-link-ct">
<label class="btn new"><%=textAddCommentToDoc%></label>
</div>
<div style="display: none;" class="layout-item new-comment-ct">
<div class="inner-ct">
<textarea id="comment-msg-new" class="user-select" placeholder="<%=textEnterCommentHint%>" maxlength="<%=maxCommLength%>"/>
<textarea id="comment-msg-new" class="user-select textarea-control" placeholder="<%=textEnterCommentHint%>" maxlength="<%=maxCommLength%>"></textarea>
</div>
<button class="btn add normal dlg-btn primary"><%=textAddComment%></button>
<button class="btn cancel normal dlg-btn"><%=textCancel%></button>

View file

@ -99,11 +99,11 @@ Common.util = Common.util||{};
'modal:show': function(e){
window.key.suspend();
},
'modal:close': function(e) {
window.key.resume();
'modal:close': function(e, last) {
last && window.key.resume();
},
'modal:hide': function(e) {
window.key.resume();
'modal:hide': function(e, last) {
last && window.key.resume();
}
});
},

View file

@ -0,0 +1,34 @@
if ( !window.fetch ) {
var element = document.createElement('script');
element['src'] = '../../../vendor/fetch/fetch.umd.js';
document.getElementsByTagName('head')[0].appendChild(element);
if ( !window.Promise ) {
element = document.createElement('script');
element['src'] = '../../../vendor/es6-promise/es6-promise.auto.min.js';
document.getElementsByTagName('head')[0].appendChild(element);
}
if (typeof Object.assign != 'function') {
Object.assign = function(target) {
'use strict';
if (target == null) {
throw new TypeError('Cannot convert undefined or null to object');
}
target = Object(target);
for (var index = 1; index < arguments.length; index++) {
var source = arguments[index];
if (source != null) {
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
}
return target;
};
}
}

View file

@ -105,7 +105,8 @@ Common.Utils = _.extend(new(function() {
MailMerge : 8,
Signature : 9,
Pivot : 10,
Cell : 11
Cell : 11,
Slicer : 12
},
importTextType = {
DRM: 0,
@ -216,7 +217,9 @@ Common.Utils = _.extend(new(function() {
zoom: function() {return me.zoom;},
topOffset: 0,
innerWidth: function() {return me.innerWidth;},
innerHeight: function() {return me.innerHeight - Common.Utils.InternalSettings.get('window-inactive-area-top');}
innerHeight: function() {return me.innerHeight;},
croppedGeometry: function() {return {left:0, top: Common.Utils.InternalSettings.get('window-inactive-area-top'),
width: me.innerWidth, height: me.innerHeight - Common.Utils.InternalSettings.get('window-inactive-area-top')}}
}
})(), Common.Utils || {});
@ -586,6 +589,25 @@ Common.Utils.String = new (function() {
}
return Common.Utils.String.format(template, string);
},
parseFloat: function(string) {
(typeof string === 'string') && (string = string.replace(',', '.'));
return parseFloat(string)
},
encodeSurrogateChar: function(nUnicode) {
if (nUnicode < 0x10000)
{
return String.fromCharCode(nUnicode);
}
else
{
nUnicode = nUnicode - 0x10000;
var nLeadingChar = 0xD800 | (nUnicode >> 10);
var nTrailingChar = 0xDC00 | (nUnicode & 0x3FF);
return String.fromCharCode(nLeadingChar) + String.fromCharCode(nTrailingChar);
}
}
}
})();
@ -740,6 +762,8 @@ Common.Utils.loadConfig = function(url, callback) {
else return 'error';
}).then(function(json){
callback(json);
}).catch(function(e) {
callback('error');
});
};
@ -825,6 +849,7 @@ Common.Utils.injectButtons = function($slots, id, iconCls, caption, lock, split,
/x-huge/.test(el.className) && (_cls += ' x-huge icon-top');
var button = new Common.UI.Button({
parentEl: $slots.eq(index),
id: id + index,
cls: _cls,
iconCls: iconCls,
@ -834,7 +859,7 @@ Common.Utils.injectButtons = function($slots, id, iconCls, caption, lock, split,
enableToggle: toggle || false,
lock: lock,
disabled: true
}).render( $slots.eq(index) );
});
btnsArr.add(button);
});
@ -847,6 +872,30 @@ Common.Utils.injectComponent = function ($slot, cmp) {
}
};
Common.Utils.warningDocumentIsLocked = function (opts) {
if ( opts.disablefunc )
opts.disablefunc(true);
var app = window.DE || window.PE || window.SSE;
var tip = new Common.UI.SynchronizeTip({
extCls : 'simple',
text : Common.Locale.get("warnFileLocked",{name:"Common.Translation", default:'Document is in use by another application. You can continue editing and save it as a copy.'}),
textLink : Common.Locale.get("txtContinueEditing",{name:app.nameSpace + ".Views.SignatureSettings", default:'Edit anyway'}),
placement : 'document'
});
tip.on({
'dontshowclick': function() {
if ( opts.disablefunc ) opts.disablefunc(false);
app.getController('Main').api.asc_setIsReadOnly(false);
this.close();
},
'closeclick': function() {
this.close();
}
});
tip.show();
};
jQuery.fn.extend({
elementById: function (id, parent) {
/**
@ -896,3 +945,20 @@ Common.Utils.InternalSettings.set('window-inactive-area-top', 0);
Common.Utils.InternalSettings.set('toolbar-height-compact', Common.Utils.InternalSettings.get('toolbar-height-tabs'));
Common.Utils.InternalSettings.set('toolbar-height-normal', Common.Utils.InternalSettings.get('toolbar-height-tabs') + Common.Utils.InternalSettings.get('toolbar-height-controls'));
Common.Utils.ModalWindow = new(function() {
var count = 0;
return {
show: function() {
count++;
},
close: function() {
count--;
},
isVisible: function() {
return count>0;
}
}
})();

View file

@ -97,7 +97,7 @@ define([
'</table>',
'<table id="id-about-licensee-info" cols="1" style="width: 100%; margin-top: 20px;" class="hidden margin-bottom"><tbody>',
'<tr>',
'<td align="center" class="padding-small"><div id="id-about-company-logo"/></td>',
'<td align="center" class="padding-small"><div id="id-about-company-logo"></div></td>',
'</tr>',
'<tr>',
'<td align="center"><label class="asc-about-version">' + options.appName.toUpperCase() + '</label></td>',
@ -135,9 +135,9 @@ define([
'</table>',
'<table id="id-about-licensor-short" cols="1" style="width: 100%; margin-top: 31px;" class="hidden"><tbody>',
'<tr>',
'<td style="width:50%;"><div class="separator horizontal short left"/></td>',
'<td style="width:50%;"><div class="separator horizontal short left"></div></td>',
'<td align="center"><label class="asc-about-header">' + this.txtPoweredBy + '</label></td>',
'<td style="width:50%;"><div class="separator horizontal short"/></td>',
'<td style="width:50%;"><div class="separator horizontal short"></div></td>',
'</tr>',
'<tr>',
'<td colspan="3" align="center" style="padding: 9px 0 10px;"><label class="asc-about-companyname"><%= publishername %></label></td>',

View file

@ -62,10 +62,10 @@ define([
'<button class="btn btn-category" content-target="<%= item.panelId %>"><span class=""><%= item.panelCaption %></span></button>',
'<% }); %>',
'</div>',
'<div class="separator"/>',
'<div class="separator"></div>',
'<div class="content-panel" >' + _options.contentTemplate + '</div>',
'</div>',
'<div class="separator horizontal"/>'
'<div class="separator horizontal"></div>'
].join('');
_options.tpl = _.template(this.template)(_options);
@ -107,22 +107,6 @@ define([
this.content_panels = $window.find('.settings-panel');
if (this.btnsCategory.length>0)
this.btnsCategory[0].toggle(true, true);
me.menuAddAlign = function(menuRoot, left, top) {
var self = this;
if (!$window.hasClass('notransform')) {
$window.addClass('notransform');
menuRoot.addClass('hidden');
setTimeout(function() {
menuRoot.removeClass('hidden');
menuRoot.css({left: left, top: top});
self.options.additionalAlign = null;
}, 300);
} else {
menuRoot.css({left: left, top: top});
self.options.additionalAlign = null;
}
}
},
setHeight: function(height) {

View file

@ -0,0 +1,203 @@
/*
*
* (c) Copyright Ascensio System SIA 2010-2020
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
/**
* AutoCorrectDialog.js
*
* Created by Julia Radzhabova on 03.07.2020
* Copyright (c) 2020 Ascensio System SIA. All rights reserved.
*
*/
if (Common === undefined)
var Common = {};
define([
'common/main/lib/component/ListView',
'common/main/lib/component/Window'
], function () { 'use strict';
Common.Views.AutoCorrectDialog = Common.UI.Window.extend(_.extend({
options: {
width: 448,
cls: 'modal-dlg',
buttons: null
},
initialize : function(options) {
_.extend(this.options, {
title: this.textTitle
}, options || {});
this.template = [
'<div class="box">',
'<div id="symbol-table-pnl-special">',
'<table cols="1" style="width: 100%;">',
'<tr>',
'<td style="padding-bottom: 8px;">',
'<label style="font-weight: bold;">' + this.textMathCorrect + '</label>',
'</td>',
'</tr>',
'<tr>',
'<td>',
'<label style="width: 117px;">' + this.textReplace + '</label>',
'<label>' + this.textBy + '</label>',
'</td>',
'</tr>',
'<tr>',
'<td>',
'<div id="auto-correct-replace" style="height:22px;width: 115px;margin-right: 2px;display: inline-block;"></div>',
'<div id="auto-correct-by" style="height:22px;width: 299px;display: inline-block;"></div>',
'</td>',
'</tr>',
'<tr>',
'<td>',
'<div id="auto-correct-math-list" class="" style="width:100%; height: 254px;"></div>',
'</td>',
'</tr>',
'</table>',
'</div>',
'</div>',
'<div class="footer center">',
'<button class="btn normal dlg-btn" result="cancel" style="width: 86px;">' + this.closeButtonText + '</button>',
'</div>'
].join('');
this.options.tpl = _.template(this.template)(this.options);
this.props = this.options.props || [];
Common.UI.Window.prototype.initialize.call(this, this.options);
},
render: function() {
Common.UI.Window.prototype.render.call(this);
var $window = this.getChild();
var me = this;
// special
this.mathList = new Common.UI.ListView({
el: $window.find('#auto-correct-math-list'),
store: new Common.UI.DataViewStore(this.props.slice(0, 11)),
simpleAddMode: true,
template: _.template(['<div class="listview inner" style=""></div>'].join('')),
itemTemplate: _.template([
'<div id="<%= id %>" class="list-item" style="pointer-events:none;width: 100%;display:flex;">',
'<div style="min-width:110px;padding-right: 5px;"><%= replaced %></div>',
'<div style="flex-grow:1;font-family: Cambria Math;font-size:13px;"><%= by %></div>',
'</div>'
].join('')),
scrollAlwaysVisible: true
});
this.mathList.on('item:select', _.bind(this.onSelectMathItem, this));
this.inputReplace = new Common.UI.InputField({
el : $window.find('#auto-correct-replace'),
allowBlank : true,
validateOnChange : true,
validation : function () { return true; }
}).on ('changing', function (input, value) {
if (value.length) {
var store = me.mathList.store;
var _selectedItem = store.find(function(item) {
if ( item.get('replaced').indexOf(value) == 0) {
return true;
}
});
if (_selectedItem) {
me.mathList.selectRecord(_selectedItem, true);
me.mathList.scrollToRecord(_selectedItem);
} else {
me.mathList.deselectAll();
}
} else {
me.mathList.deselectAll();
}
});
this.inputReplace.cmpEl.find('input').on('keydown', function(event){
if (event.key == 'ArrowDown') {
var _selectedItem = me.mathList.getSelectedRec() || me.mathList.store.at(0);
if (_selectedItem) {
me.mathList.selectRecord(_selectedItem);
me.mathList.scrollToRecord(_selectedItem);
}
_.delay(function(){
me.mathList.cmpEl.find('.listview').focus();
},10);
}
});
this.inputBy = new Common.UI.InputField({
el : $window.find('#auto-correct-by'),
allowBlank : true,
validateOnChange : true,
validation : function () { return true; }
});
// this.inputBy.cmpEl.find('input').css('font-size', '13px');
$window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this));
},
onSelectMathItem: function(lisvView, itemView, record) {
this.inputReplace.setValue(record.get('replaced'));
this.inputBy.setValue(record.get('by'));
},
show: function() {
Common.UI.Window.prototype.show.apply(this, arguments);
var me = this;
_.delay(function(){
$('input', me.inputReplace.cmpEl).select().focus();
},100);
_.delay(function(){
me.mathList.store.reset(me.props);
},100);
},
onBtnClick: function(event) {
this.close();
},
onPrimary: function(event) {
return true;
},
textTitle: 'AutoCorrect',
textMathCorrect: 'Math AutoCorrect',
textReplace: 'Replace:',
textBy: 'By:'
}, Common.Views.AutoCorrectDialog || {}))
});

View file

@ -79,7 +79,7 @@ define([
'</div>',
'<div id="copy-warning-checkbox" style="margin-top: 20px; text-align: left;"></div>',
'</div>',
'<div class="separator horizontal"/>'
'<div class="separator horizontal"></div>'
].join('');
this.options.tpl = _.template(this.template)(this.options);

View file

@ -45,10 +45,11 @@ define([
Common.Views.ExternalDiagramEditor = Common.UI.Window.extend(_.extend({
initialize : function(options) {
var _options = {};
var _inner_height = Common.Utils.innerHeight() - Common.Utils.InternalSettings.get('window-inactive-area-top');
_.extend(_options, {
title: this.textTitle,
width: 910,
height: (Common.Utils.innerHeight()-700)<0 ? Common.Utils.innerHeight(): 700,
height: (_inner_height - 700)<0 ? _inner_height : 700,
cls: 'advanced-settings-dlg',
header: true,
toolclose: 'hide',
@ -59,7 +60,7 @@ define([
'<div id="id-diagram-editor-container" class="box" style="height:' + (_options.height-85) + 'px;">',
'<div id="id-diagram-editor-placeholder" style="width: 100%;height: 100%;"></div>',
'</div>',
'<div class="separator horizontal"/>',
'<div class="separator horizontal"></div>',
'<div class="footer" style="text-align: center;">',
'<button id="id-btn-diagram-editor-apply" class="btn normal dlg-btn primary custom" result="ok">' + this.textSave + '</button>',
'<button id="id-btn-diagram-editor-cancel" class="btn normal dlg-btn" result="cancel">' + this.textClose + '</button>',
@ -140,7 +141,7 @@ define([
this.$window.find('> .body').css('height', height-header_height);
this.$window.find('> .body > .box').css('height', height-85);
var top = (Common.Utils.innerHeight() - parseInt(height)) / 2;
var top = (Common.Utils.innerHeight() - Common.Utils.InternalSettings.get('window-inactive-area-top') - parseInt(height)) / 2;
var left = (Common.Utils.innerWidth() - parseInt(this.initConfig.width)) / 2;
this.$window.css('left',left);

View file

@ -59,7 +59,7 @@ define([
'<div id="id-merge-editor-container" class="box" style="height:' + (_options.height-85) + 'px;">',
'<div id="id-merge-editor-placeholder" style="width: 100%;height: 100%;"></div>',
'</div>',
'<div class="separator horizontal"/>',
'<div class="separator horizontal"></div>',
'<div class="footer" style="text-align: center;">',
'<button id="id-btn-merge-editor-apply" class="btn normal dlg-btn primary custom" result="ok">' + this.textSave + '</button>',
'<button id="id-btn-merge-editor-cancel" class="btn normal dlg-btn disabled" result="cancel">' + this.textClose + '</button>',

View file

@ -78,34 +78,36 @@ define([
'<label id="rib-doc-name" />' +
'</section>' +
'<a id="rib-save-status" class="status-label locked"><%= textSaveEnd %></a>' +
'<div class="hedset">' +
'<div class="btn-slot" id="slot-hbtn-edit"></div>' +
'<div class="btn-slot" id="slot-hbtn-print"></div>' +
'<div class="btn-slot" id="slot-hbtn-download"></div>' +
'</div>' +
'<div class="hedset">' +
// '<span class="btn-slot text" id="slot-btn-users"></span>' +
'<section id="tlb-box-users" class="box-cousers dropdown"">' +
'<div class="btn-users">' +
'<i class="icon toolbar__icon icon--inverse btn-users"></i>' +
'<label class="caption">&plus;</label>' +
'</div>' +
'<div class="cousers-menu dropdown-menu">' +
'<label id="tlb-users-menu-descr"><%= tipUsers %></label>' +
'<div class="cousers-list"></div>' +
'<label id="tlb-change-rights" class="link"><%= txtAccessRights %></label>' +
'</div>' +
'</section>'+
'</div>' +
'<div class="hedset">' +
'<div class="btn-slot" id="slot-btn-undock"></div>' +
'<div class="btn-slot" id="slot-btn-back"></div>' +
'<div class="btn-slot" id="slot-btn-options"></div>' +
'</div>' +
'<section style="display: inherit;">' +
'<div class="hedset">' +
'<div class="btn-slot" id="slot-hbtn-edit"></div>' +
'<div class="btn-slot" id="slot-hbtn-print"></div>' +
'<div class="btn-slot" id="slot-hbtn-download"></div>' +
'</div>' +
'<div class="hedset">' +
// '<span class="btn-slot text" id="slot-btn-users"></span>' +
'<section id="tlb-box-users" class="box-cousers dropdown"">' +
'<div class="btn-users">' +
'<i class="icon toolbar__icon icon--inverse btn-users"></i>' +
'<label class="caption">&plus;</label>' +
'</div>' +
'<div class="cousers-menu dropdown-menu">' +
'<label id="tlb-users-menu-descr"><%= tipUsers %></label>' +
'<div class="cousers-list"></div>' +
'<label id="tlb-change-rights" class="link"><%= txtAccessRights %></label>' +
'</div>' +
'</section>'+
'</div>' +
'<div class="hedset">' +
'<div class="btn-slot" id="slot-btn-undock"></div>' +
'<div class="btn-slot" id="slot-btn-back"></div>' +
'<div class="btn-slot" id="slot-btn-options"></div>' +
'</div>' +
'</section>' +
'</section>';
var templateLeftBox = '<section class="logo">' +
'<div id="header-logo"><i /></div>' +
'<div id="header-logo"><i></i></div>' +
'</section>';
var templateTitleBox = '<section id="box-document-title">' +
@ -117,7 +119,6 @@ define([
'<div class="btn-slot" id="slot-btn-dt-redo"></div>' +
'</div>' +
'<div class="lr-separator" id="id-box-doc-name">' +
// '<input type="text" id="title-doc-name" spellcheck="false" data-can-copy="false" style="pointer-events: none;" disabled="disabled">' +
'<label id="title-doc-name" />' +
'</div>' +
'<label id="title-user-name" style="pointer-events: none;"></label>' +
@ -206,11 +207,21 @@ define([
}
function onAppShowed(config) {
if ( config.isCrypted && this.labelDocName ) {
this.labelDocName.before(
'<div class="inner-box-icon crypted">' +
'<svg class="icon"><use xlink:href="#svg-icon-crypted"></use></svg>' +
'</div>');
if ( this.labelDocName ) {
if ( config.isCrypted ) {
this.labelDocName.before(
'<div class="inner-box-icon crypted">' +
'<svg class="icon"><use xlink:href="#svg-icon-crypted"></use></svg>' +
'</div>');
}
var $parent = this.labelDocName.parent();
var _left_width = $parent.position().left,
_right_width = $parent.next().outerWidth();
if ( _left_width < _right_width )
this.labelDocName.parent().css('padding-left', _right_width - _left_width);
else this.labelDocName.parent().css('padding-right', _left_width - _right_width);
}
}
@ -232,34 +243,36 @@ define([
}
});
onResetUsers(storeUsers);
if ( $panelUsers ) {
onResetUsers(storeUsers);
$panelUsers.on('shown.bs.dropdown', function () {
$userList.scroller && $userList.scroller.update({minScrollbarLength: 40, alwaysVisibleY: true});
});
$panelUsers.on('shown.bs.dropdown', function () {
$userList.scroller && $userList.scroller.update({minScrollbarLength: 40, alwaysVisibleY: true});
});
$panelUsers.find('.cousers-menu')
.on('click', function(e) { return false; });
$panelUsers.find('.cousers-menu')
.on('click', function(e) { return false; });
var editingUsers = storeUsers.getEditingCount();
$btnUsers.tooltip({
title: (editingUsers > 1 || editingUsers>0 && !appConfig.isEdit && !appConfig.isRestrictedEdit) ? me.tipViewUsers : me.tipAccessRights,
titleNorm: me.tipAccessRights,
titleExt: me.tipViewUsers,
placement: 'bottom',
html: true
});
var editingUsers = storeUsers.getEditingCount();
$btnUsers.tooltip({
title: (editingUsers > 1 || editingUsers>0 && !appConfig.isEdit && !appConfig.isRestrictedEdit) ? me.tipViewUsers : me.tipAccessRights,
titleNorm: me.tipAccessRights,
titleExt: me.tipViewUsers,
placement: 'bottom',
html: true
});
$btnUsers.on('click', onUsersClick.bind(me));
$btnUsers.on('click', onUsersClick.bind(me));
var $labelChangeRights = $panelUsers.find('#tlb-change-rights');
$labelChangeRights.on('click', function(e) {
$panelUsers.removeClass('open');
Common.NotificationCenter.trigger('collaboration:sharing');
});
var $labelChangeRights = $panelUsers.find('#tlb-change-rights');
$labelChangeRights.on('click', function(e) {
$panelUsers.removeClass('open');
Common.NotificationCenter.trigger('collaboration:sharing');
});
$labelChangeRights[(!mode.isOffline && (mode.sharingSettingsUrl && mode.sharingSettingsUrl.length || mode.canRequestSharingSettings))?'show':'hide']();
$panelUsers[(editingUsers > 1 || editingUsers > 0 && !appConfig.isEdit && !appConfig.isRestrictedEdit || !mode.isOffline && (mode.sharingSettingsUrl && mode.sharingSettingsUrl.length || mode.canRequestSharingSettings)) ? 'show' : 'hide']();
$labelChangeRights[(!mode.isOffline && (mode.sharingSettingsUrl && mode.sharingSettingsUrl.length || mode.canRequestSharingSettings))?'show':'hide']();
$panelUsers[(editingUsers > 1 || editingUsers > 0 && !appConfig.isEdit && !appConfig.isRestrictedEdit || !mode.isOffline && (mode.sharingSettingsUrl && mode.sharingSettingsUrl.length || mode.canRequestSharingSettings)) ? 'show' : 'hide']();
}
if ( $saveStatus ) {
$saveStatus.attr('data-width', me.textSaveExpander);
@ -476,6 +489,8 @@ define([
if ( me.documentCaption ) {
me.labelDocName.text(me.documentCaption);
}
} else {
$html.find('#rib-doc-name').hide();
}
if ( !_.isUndefined(this.options.canRename) ) {

View file

@ -53,8 +53,8 @@ define([
Common.Views.ListSettingsDialog = Common.UI.Window.extend(_.extend({
options: {
type: 0, // 0 - markers, 1 - numbers
width: 250,
height: 200,
width: 280,
height: 255,
style: 'min-width: 240px;',
cls: 'modal-dlg',
split: false,
@ -70,28 +70,59 @@ define([
this.template = [
'<div class="box">',
'<div class="input-row" style="margin-bottom: 10px;">',
'<label class="text" style="width: 70px;">' + this.txtSize + '</label><div id="id-dlg-list-size"></div><label class="text" style="margin-left: 10px;">' + this.txtOfText + '</label>',
'<div style="margin-bottom: 16px;">',
'<button type="button" class="btn btn-text-default auto" id="id-dlg-list-bullet" style="border-top-right-radius: 0;border-bottom-right-radius: 0;">', this.textBulleted,'</button>',
'<button type="button" class="btn btn-text-default auto" id="id-dlg-list-numbering" style="border-top-left-radius: 0;border-bottom-left-radius: 0;border-left-width: 0;margin-left: -1px;">', this.textNumbering,'</button>',
'</div>',
'<div style="margin-bottom: 10px;">',
'<label class="text" style="width: 70px;">' + this.txtColor + '</label><div id="id-dlg-list-color" style="display: inline-block;"></div>',
'<div style="height:120px;">',
'<table cols="3">',
'<tr>',
'<td style="padding-right: 5px;padding-bottom: 8px;min-width: 50px;">',
'<label class="text">' + this.txtType + '</label>',
'</td>',
'<td style="padding-right: 5px;padding-bottom: 8px;width: 100px;">',
'<div id="id-dlg-list-numbering-format" class="input-group-nr" style="width: 100px;"></div>',
'<div id="id-dlg-list-bullet-format" class="input-group-nr" style="width: 100px;"></div>',
'</td>',
'<td style="padding-bottom: 8px;"></td>',
'</tr>',
'<tr>',
'<td style="padding-right: 5px;padding-bottom: 8px;min-width: 50px;">',
'<label class="text">' + this.txtSize + '</label>',
'</td>',
'<td style="padding-right: 5px;padding-bottom: 8px;width: 100px;">',
'<div id="id-dlg-list-size"></div>',
'</td>',
'<td style="padding-bottom: 8px;">',
'<label class="text" style="white-space: nowrap;">' + this.txtOfText + '</label>',
'</td>',
'</tr>',
'<tr class="numbering">',
'<td style="padding-right: 5px;padding-bottom: 8px;min-width: 50px;">',
'<label class="text" style="white-space: nowrap;">' + this.txtStart + '</label>',
'</td>',
'<td style="padding-right: 5px;padding-bottom: 8px;width: 100px;">',
'<div id="id-dlg-list-start"></div>',
'</td>',
'<td style="padding-bottom: 8px;"></td>',
'</tr>',
'<tr>',
'<td style="padding-right: 5px;padding-bottom: 8px;min-width: 50px;">',
'<label class="text">' + this.txtColor + '</label>',
'</td>',
'<td style="padding-right: 5px;padding-bottom: 8px;width: 100px;">',
'<div id="id-dlg-list-color"></div>',
'</td>',
'<td style="padding-bottom: 8px;"></td>',
'</tr>',
'</table>',
'</div>',
'<% if (type == 0) { %>',
'<div class="input-row" style="margin-bottom: 10px;">',
'<label class="text" style="width: 70px;vertical-align: top;">' + this.txtBullet + '</label>',
'<button type="button" class="btn btn-text-default" id="id-dlg-list-edit" style="width:53px;display: inline-block;vertical-align: top;"></button>',
'</div>',
'<% } %>',
'<% if (type == 1) { %>',
'<div class="input-row" style="margin-bottom: 10px;">',
'<label class="text" style="width: 70px;">' + this.txtStart + '</label><div id="id-dlg-list-start"></div>',
'</div>',
'<% } %>',
'</div>'
].join('');
this.props = options.props;
this.options.tpl = _.template(this.template)(this.options);
this.color = '000000';
Common.UI.Window.prototype.initialize.call(this, this.options);
},
@ -103,26 +134,147 @@ define([
$window = this.getChild();
$window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this));
this.menuAddAlign = function(menuRoot, left, top) {
var self = this;
if (!$window.hasClass('notransform')) {
$window.addClass('notransform');
menuRoot.addClass('hidden');
setTimeout(function() {
menuRoot.removeClass('hidden');
menuRoot.css({left: left, top: top});
self.options.additionalAlign = null;
}, 300);
} else {
menuRoot.css({left: left, top: top});
self.options.additionalAlign = null;
me.btnBullet = new Common.UI.Button({
el: $('#id-dlg-list-bullet'),
enableToggle: true,
toggleGroup: 'list-type',
allowDepress: false,
pressed: true
});
me.btnBullet.on('click', _.bind(me.onListTypeClick, me, 0));
me.btnNumbering = new Common.UI.Button({
el: $('#id-dlg-list-numbering'),
enableToggle: true,
toggleGroup: 'list-type',
allowDepress: false
});
me.btnNumbering.on('click', _.bind(me.onListTypeClick, me, 1));
this.cmbNumFormat = new Common.UI.ComboBox({
el : $('#id-dlg-list-numbering-format'),
menuStyle : 'min-width: 100%;max-height: 183px;',
editable : false,
cls : 'input-group-nr',
data : [
{ displayValue: this.txtNone, value: -1 },
{ displayValue: 'A, B, C,...', value: 4 },
{ displayValue: 'a), b), c),...', value: 5 },
{ displayValue: 'a, b, c,...', value: 6 },
{ displayValue: '1, 2, 3,...', value: 1 },
{ displayValue: '1), 2), 3),...', value: 2 },
{ displayValue: 'I, II, III,...', value: 3 },
{ displayValue: 'i, ii, iii,...', value: 7 }
]
});
this.cmbNumFormat.on('selected', _.bind(function (combo, record) {
if (this._changedProps) {
this._changedProps.asc_putListType(1, record.value);
}
};
}, this));
this.cmbNumFormat.setValue(1);
var itemsTemplate =
[
'<% _.each(items, function(item) { %>',
'<li id="<%= item.id %>" data-value="<%= item.value %>"><a tabindex="-1" type="menuitem">',
'<%= item.displayValue %><% if (item.value === 0) { %><span style="font-family:<%=item.font%>;"><%=item.symbol%></span><% } %>',
'</a></li>',
'<% }); %>'
];
var template = [
'<div class="input-group combobox input-group-nr <%= cls %>" id="<%= id %>" style="<%= style %>">',
'<div class="form-control" style="padding-top:3px; line-height: 14px; cursor: pointer; <%= style %>"></div>',
'<div style="display: table-cell;"></div>',
'<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"><span class="caret img-commonctrl"></span></button>',
'<ul class="dropdown-menu <%= menuCls %>" style="<%= menuStyle %>" role="menu">'].concat(itemsTemplate).concat([
'</ul>',
'</div>'
]);
this.cmbBulletFormat = new Common.UI.ComboBoxCustom({
el : $('#id-dlg-list-bullet-format'),
menuStyle : 'min-width: 100%;max-height: 183px;',
style : "width: 100px;",
editable : false,
template : _.template(template.join('')),
itemsTemplate: _.template(itemsTemplate.join('')),
data : [
{ displayValue: this.txtNone, value: -1 },
{ displayValue: this.txtSymbol + ': ', value: 0, symbol: "•", font: 'Arial' },
{ displayValue: this.txtSymbol + ': ', value: 0, symbol: "o", font: 'Courier New' },
{ displayValue: this.txtSymbol + ': ', value: 0, symbol: "§", font: 'Wingdings' },
{ displayValue: this.txtSymbol + ': ', value: 0, symbol: "v", font: 'Wingdings' },
{ displayValue: this.txtSymbol + ': ', value: 0, symbol: "Ø", font: 'Wingdings' },
{ displayValue: this.txtSymbol + ': ', value: 0, symbol: "ü", font: 'Wingdings' },
{ displayValue: this.txtSymbol + ': ', value: 0, symbol: "w", font: 'Wingdings' },
{ displayValue: this.txtSymbol + ': ', value: 0, symbol: "", font: 'Arial' },
{ displayValue: this.txtNewBullet, value: 1 }
],
updateFormControl: function(record) {
var formcontrol = $(this.el).find('.form-control');
if (record) {
if (record.get('value')==0)
formcontrol[0].innerHTML = record.get('displayValue') + '<span style="font-family:' + (record.get('font') || 'Arial') + '">' + record.get('symbol') + '</span>';
else
formcontrol[0].innerHTML = record.get('displayValue');
} else
formcontrol[0].innerHTML = '';
}
});
var rec = this.cmbBulletFormat.store.at(1);
this.cmbBulletFormat.selectRecord(rec);
this.bulletProps = {symbol: rec.get('symbol'), font: rec.get('font')};
this.cmbBulletFormat.on('selected', _.bind(function (combo, record) {
if (record.value === 1) {
var me = this,
props = me.bulletProps,
handler = function(dlg, result, settings) {
if (result == 'ok') {
props.changed = true;
props.code = settings.code;
props.font = settings.font;
props.symbol = settings.symbol;
if (me._changedProps) {
me._changedProps.asc_putFont(props.font);
me._changedProps.asc_putSymbol(props.symbol);
}
}
var store = combo.store;
if (!store.findWhere({value: 0, symbol: props.symbol, font: props.font}))
store.add({ displayValue: me.txtSymbol + ': ', value: 0, symbol: props.symbol, font: props.font }, {at: store.length-1});
combo.setData(store.models);
combo.selectRecord(combo.store.findWhere({value: 0, symbol: props.symbol, font: props.font}));
},
win = new Common.Views.SymbolTableDialog({
api: me.options.api,
lang: me.options.interfaceLang,
modal: true,
type: 0,
font: props.font,
symbol: props.symbol,
handler: handler
});
win.show();
win.on('symbol:dblclick', handler);
} else if (record.value == -1) {
if (this._changedProps)
this._changedProps.asc_putListType(0, record.value);
} else {
this.bulletProps.changed = true;
this.bulletProps.code = record.code;
this.bulletProps.font = record.font;
this.bulletProps.symbol = record.symbol;
if (this._changedProps) {
this._changedProps.asc_putFont(this.bulletProps.font);
this._changedProps.asc_putSymbol(this.bulletProps.symbol);
}
}
}, this));
this.spnSize = new Common.UI.MetricSpinner({
el : $window.find('#id-dlg-list-size'),
step : 1,
width : 53,
width : 100,
value : 100,
defaultUnit : '',
maxValue : 400,
@ -130,34 +282,23 @@ define([
allowDecimal: false
}).on('change', function(field, newValue, oldValue, eOpts){
if (me._changedProps) {
me._changedProps.asc_putBulletSize(field.getNumberValue());
me._changedProps.asc_putSize(field.getNumberValue());
}
});
this.btnColor = new Common.UI.ColorButton({
style: "width:53px;",
menu : new Common.UI.Menu({
additionalAlign: this.menuAddAlign,
items: [
{ template: _.template('<div id="id-dlg-list-color-menu" style="width: 169px; height: 220px; margin: 10px;"></div>') },
{ template: _.template('<a id="id-dlg-list-color-new" style="padding-left:12px;">' + this.textNewColor + '</a>') }
]
})
parentEl: $window.find('#id-dlg-list-color'),
style: "width:45px;",
additionalAlign: this.menuAddAlign,
color: this.color
});
this.btnColor.on('render:after', function(btn) {
me.colors = new Common.UI.ThemeColorPalette({
el: $('#id-dlg-list-color-menu'),
transparent: false
});
me.colors.on('select', _.bind(me.onColorsSelect, me));
});
this.btnColor.render($window.find('#id-dlg-list-color'));
$('#id-dlg-list-color-new').on('click', _.bind(this.addNewColor, this, this.colors));
this.btnColor.on('color:select', _.bind(this.onColorsSelect, this));
this.colors = this.btnColor.getPicker();
this.spnStart = new Common.UI.MetricSpinner({
el : $window.find('#id-dlg-list-start'),
step : 1,
width : 53,
width : 100,
value : 1,
defaultUnit : '',
maxValue : 32767,
@ -165,16 +306,14 @@ define([
allowDecimal: false
}).on('change', function(field, newValue, oldValue, eOpts){
if (me._changedProps) {
me._changedProps.put_NumStartAt(field.getNumberValue());
me._changedProps.asc_putNumStartAt(field.getNumberValue());
}
});
this.btnEdit = new Common.UI.Button({
el: $window.find('#id-dlg-list-edit'),
hint: this.tipChange
});
this.btnEdit.on('click', _.bind(this.onEditBullet, this));
this.btnEdit.cmpEl.css({'font-size': '16px', 'line-height': '16px'});
me.numberingControls = $window.find('.numbering');
var el = $window.find('table tr:first() td:first()');
el.width(Math.max($window.find('.numbering .text').width(), el.width()));
this.afterRender();
},
@ -188,49 +327,47 @@ define([
this.colors.updateColors(Common.Utils.ThemeColor.getEffectColors(), Common.Utils.ThemeColor.getStandartColors());
},
addNewColor: function(picker, btn) {
picker.addNewColor((typeof(btn.color) == 'object') ? btn.color.color : btn.color);
},
onColorsSelect: function(picker, color) {
this.btnColor.setColor(color);
onColorsSelect: function(btn, color) {
this.color = color;
if (this._changedProps) {
this._changedProps.asc_putBulletColor(Common.Utils.ThemeColor.getRgbColor(color));
this._changedProps.asc_putColor(Common.Utils.ThemeColor.getRgbColor(color));
}
},
onEditBullet: function() {
var me = this,
props = me.bulletProps,
handler = function(dlg, result, settings) {
if (result == 'ok') {
props.changed = true;
props.code = settings.code;
props.font = settings.font;
props.symbol = settings.symbol;
props.font && me.btnEdit.cmpEl.css('font-family', props.font);
settings.symbol && me.btnEdit.setCaption(settings.symbol);
if (me._changedProps) {
me._changedProps.asc_putBulletFont(props.font);
me._changedProps.asc_putBulletSymbol(props.symbol);
}
}
},
win = new Common.Views.SymbolTableDialog({
api: me.options.api,
lang: me.options.interfaceLang,
modal: true,
type: 0,
font: props.font,
symbol: props.symbol,
handler: handler
});
win.show();
win.on('symbol:dblclick', handler);
onListTypeClick: function(type, btn, event) {
this.ShowHideElem(type);
},
ShowHideElem: function(value) {
this.numberingControls.toggleClass('hidden', value==0);
this.cmbNumFormat.setVisible(value==1);
this.cmbBulletFormat.setVisible(value==0);
},
_handleInput: function(state) {
if (this.options.handler) {
if (this.options.handler)
{
var type = this.btnBullet.pressed ? 0 : 1;
if (this.originalType == AscFormat.BULLET_TYPE_BULLET_NONE) {
this._changedProps = new Asc.asc_CBullet();
this._changedProps.asc_putColor(Common.Utils.ThemeColor.getRgbColor(this.color));
this._changedProps.asc_putSize(this.spnSize.getNumberValue());
}
if (this.originalType == AscFormat.BULLET_TYPE_BULLET_NONE ||
this.originalType == AscFormat.BULLET_TYPE_BULLET_CHAR && type==1 || this.originalType == AscFormat.BULLET_TYPE_BULLET_AUTONUM && type==0) { // changed list type
if (type==0) {//markers
if (this.cmbBulletFormat.getValue()==-1) {
this._changedProps.asc_putListType(0, -1);
} else {
this._changedProps.asc_putFont(this.bulletProps.font);
this._changedProps.asc_putSymbol(this.bulletProps.symbol);
}
} else {
this._changedProps.asc_putListType(1, this.cmbNumFormat.getValue());
this._changedProps.asc_putNumStartAt(this.spnStart.getNumberValue());
}
}
this.options.handler.call(this, state, this._changedProps);
}
this.close();
@ -247,49 +384,85 @@ define([
_setDefaults: function (props) {
if (props) {
this.spnSize.setValue(props.asc_getBulletSize() || '', true);
var value = props.get_NumStartAt();
this.spnStart.setValue(value || '', true);
this.spnStart.setDisabled(value===null);
var color = props.asc_getBulletColor();
if (color) {
if (color.get_type() == Asc.c_oAscColor.COLOR_TYPE_SCHEME) {
color = {color: Common.Utils.ThemeColor.getHexColor(color.get_r(), color.get_g(), color.get_b()), effectValue: color.get_value()};
} else {
color = Common.Utils.ThemeColor.getHexColor(color.get_r(), color.get_g(), color.get_b());
}
} else
color = 'transparent';
this.btnColor.setColor(color);
if ( typeof(color) == 'object' ) {
var isselected = false;
for (var i=0; i<10; i++) {
if ( Common.Utils.ThemeColor.ThemeValues[i] == color.effectValue ) {
this.colors.select(color,true);
isselected = true;
break;
}
}
if (!isselected) this.colors.clearSelection();
} else
this.colors.select(color,true);
var type = 0;
var bullet = props.asc_getBullet();
if (bullet) {
this.originalType = bullet.asc_getType();
if (this.type==0) {
this.bulletProps = {symbol: props.asc_getBulletSymbol(), font: props.asc_getBulletFont()};
this.bulletProps.font && this.btnEdit.cmpEl.css('font-family', this.bulletProps.font);
this.bulletProps.symbol && this.btnEdit.setCaption(this.bulletProps.symbol);
this.spnSize.setValue(bullet.asc_getSize() || '', true);
var color = bullet.asc_getColor();
if (color) {
if (color.get_type() == Asc.c_oAscColor.COLOR_TYPE_SCHEME) {
color = {color: Common.Utils.ThemeColor.getHexColor(color.get_r(), color.get_g(), color.get_b()), effectValue: color.get_value()};
} else {
color = Common.Utils.ThemeColor.getHexColor(color.get_r(), color.get_g(), color.get_b());
}
} else
color = 'transparent';
this.color = Common.Utils.ThemeColor.colorValue2EffectId(color);
this.btnColor.setColor(color);
if ( typeof(color) == 'object' ) {
var isselected = false;
for (var i=0; i<10; i++) {
if ( Common.Utils.ThemeColor.ThemeValues[i] == color.effectValue ) {
this.colors.select(color,true);
isselected = true;
break;
}
}
if (!isselected) this.colors.clearSelection();
} else
this.colors.select(color,true);
if (this.originalType == AscFormat.BULLET_TYPE_BULLET_NONE) {
this.cmbNumFormat.setValue(-1);
this.cmbBulletFormat.setValue(-1);
type = this.type;
} else if (this.originalType == AscFormat.BULLET_TYPE_BULLET_CHAR) {
var symbol = bullet.asc_getSymbol();
if (symbol) {
this.bulletProps = {symbol: symbol, font: bullet.asc_getFont()};
if (!this.cmbBulletFormat.store.findWhere({value: 0, symbol: this.bulletProps.symbol, font: this.bulletProps.font}))
this.cmbBulletFormat.store.add({ displayValue: this.txtSymbol + ': ', value: 0, symbol: this.bulletProps.symbol, font: this.bulletProps.font }, {at: this.cmbBulletFormat.store.length-1});
this.cmbBulletFormat.setData(this.cmbBulletFormat.store.models);
this.cmbBulletFormat.selectRecord(this.cmbBulletFormat.store.findWhere({value: 0, symbol: this.bulletProps.symbol, font: this.bulletProps.font}));
} else
this.cmbBulletFormat.setValue('');
this._changedProps = bullet;
type = 0;
} else if (this.originalType == AscFormat.BULLET_TYPE_BULLET_AUTONUM) {
var autonum = bullet.asc_getAutoNumType();
this.cmbNumFormat.setValue(autonum, '');
var value = bullet.asc_getNumStartAt();
this.spnStart.setValue(value || '', true);
this.spnStart.setDisabled(value===null);
this._changedProps = bullet;
type = 1;
}
} else {// different bullet types
this.cmbNumFormat.setValue(-1);
this.cmbBulletFormat.setValue(-1);
this._changedProps = new Asc.asc_CBullet();
type = this.type;
}
}
this._changedProps = new Asc.asc_CParagraphProperty();
(type == 1) ? this.btnNumbering.toggle(true) : this.btnBullet.toggle(true);
this.ShowHideElem(type);
},
txtTitle: 'List Settings',
txtSize: 'Size',
txtColor: 'Color',
txtOfText: '% of text',
textNewColor: 'Add New Custom Color',
txtStart: 'Start at',
txtBullet: 'Bullet',
tipChange: 'Change bullet'
textBulleted: 'Bulleted',
textNumbering: 'Numbered',
txtType: 'Type',
txtNone: 'None',
txtNewBullet: 'New bullet',
txtSymbol: 'Symbol'
}, Common.Views.ListSettingsDialog || {}))
});

View file

@ -84,7 +84,7 @@ define([
'<% if (type == Common.Utils.importTextType.DRM) { %>',
'<% if (warning) { %>',
'<div>',
'<div class="icon img-commonctrl warn"/>',
'<div class="icon img-commonctrl warn"></div>',
'<div style="padding-left: 50px;"><div style="font-size: 12px;">' + t.txtProtected+ '</div>',
'<label class="header" style="margin-top: 15px;">' + t.txtPassword + '</label>',
'<div id="id-password-txt" style="width: 290px;"></div></div>',
@ -104,7 +104,7 @@ define([
'</div>',
'</div>',
'<% } %>',
'<% if (type == Common.Utils.importTextType.CSV || type == Common.Utils.importTextType.Paste || type == Common.Utils.importTextType.Columns) { %>',
'<% if (type == Common.Utils.importTextType.CSV) { %>',
'<div style="display: inline-block; margin-bottom:15px;">',
'<label class="header">' + t.txtDelimiter + '</label>',
'<div>',
@ -113,6 +113,16 @@ define([
'</div>',
'</div>',
'<% } %>',
'<% if (type == Common.Utils.importTextType.Paste || type == Common.Utils.importTextType.Columns) { %>',
'<div style="display: inline-block; margin-bottom:15px;width: 100%;">',
'<label class="header">' + t.txtDelimiter + '</label>',
'<div>',
'<div id="id-delimiters-combo" class="input-group-nr" style="max-width: 100px;display: inline-block; vertical-align: middle;"></div>',
'<div id="id-delimiter-other" class="input-row" style="display: inline-block; vertical-align: middle;margin-left: 10px;"></div>',
'<button type="button" class="btn btn-text-default" id="id-delimiters-advanced" style="min-width:100px; display: inline-block;float:right;">' + t.txtAdvanced + '</button>',
'</div>',
'</div>',
'<% } %>',
'<% if (!!preview) { %>',
'<div style="">',
'<label class="header">' + t.txtPreview + '</label>',
@ -234,7 +244,10 @@ define([
if (!this.closable && this.type == Common.Utils.importTextType.TXT) { //save last encoding only for opening txt files
Common.localStorage.setItem("de-settings-open-encoding", encoding);
}
this.handler.call(this, state, encoding, delimiter, delimiterChar);
var decimal = this.separatorOptions ? this.separatorOptions.decimal : undefined,
thousands = this.separatorOptions ? this.separatorOptions.thousands : undefined;
this.handler.call(this, state, encoding, delimiter, delimiterChar, decimal, thousands);
}
}
@ -336,6 +349,13 @@ define([
this.inputDelimiter.setVisible(false);
if (this.preview)
this.inputDelimiter.on ('changing', _.bind(this.updatePreview, this));
if (this.type == Common.Utils.importTextType.Paste || this.type == Common.Utils.importTextType.Columns) {
this.btnAdvanced = new Common.UI.Button({
el: $('#id-delimiters-advanced')
});
this.btnAdvanced.on('click', _.bind(this.onAdvancedClick, this));
}
}
},
@ -355,7 +375,12 @@ define([
break;
case Common.Utils.importTextType.Paste:
case Common.Utils.importTextType.Columns:
this.api.asc_TextImport(new Asc.asc_CTextOptions(encoding, delimiter, delimiterChar), _.bind(this.previewCallback, this), this.type == Common.Utils.importTextType.Paste);
var options = new Asc.asc_CTextOptions(encoding, delimiter, delimiterChar);
if (this.separatorOptions) {
options.asc_setNumberDecimalSeparator(this.separatorOptions.decimal);
options.asc_setNumberGroupSeparator(this.separatorOptions.thousands);
}
this.api.asc_TextImport(options, _.bind(this.previewCallback, this), this.type == Common.Utils.importTextType.Paste);
break;
}
},
@ -444,6 +469,28 @@ define([
this.updatePreview();
},
onAdvancedClick: function() {
if (!SSE) return;
var me = this,
decimal = this.api.asc_getDecimalSeparator(),
thousands = this.api.asc_getGroupSeparator();
(new SSE.Views.AdvancedSeparatorDialog({
props: {
decimal: decimal,
thousands: thousands
},
handler: function(result, value) {
if (result == 'ok') {
me.separatorOptions = {
decimal: (value.decimal.length > 0) ? value.decimal : decimal,
thousands: (value.thousands.length > 0) ? value.thousands : thousands
};
}
}
})).show();
},
txtDelimiter : "Delimiter",
txtEncoding : "Encoding ",
txtSpace : "Space",
@ -458,7 +505,8 @@ define([
txtComma: 'Comma',
txtColon: 'Colon',
txtSemicolon: 'Semicolon',
txtProtected: 'Once you enter the password and open the file, the current password to the file will be reset.'
txtProtected: 'Once you enter the password and open the file, the current password to the file will be reset.',
txtAdvanced: 'Advanced'
}, Common.Views.OpenDialog || {}));
});

View file

@ -365,7 +365,7 @@ define([
'<div id="id-plugin-placeholder" style="width: 100%;height: 100%;"></div>',
'</div>',
'<% if ((typeof buttons !== "undefined") && _.size(buttons) > 0) { %>',
'<div class="separator horizontal"/>',
'<div class="separator horizontal"></div>',
'<% } %>'
].join('');

View file

@ -61,12 +61,12 @@ define([
'<span id="slot-btn-sharing" class="btn-slot text x-huge"></span>' +
'<span id="slot-btn-coauthmode" class="btn-slot text x-huge"></span>' +
'</div>' +
'<div class="separator long sharing"/>' +
'<div class="separator long sharing"></div>' +
'<div class="group">' +
'<span class="btn-slot text x-huge slot-comment"></span>' +
'<span class="btn-slot text x-huge" id="slot-comment-remove"></span>' +
'</div>' +
'<div class="separator long comments"/>' +
'<div class="separator long comments"></div>' +
'<div class="group">' +
'<span id="btn-review-on" class="btn-slot text x-huge"></span>' +
'</div>' +
@ -79,15 +79,15 @@ define([
'<span id="btn-change-accept" class="btn-slot text x-huge"></span>' +
'<span id="btn-change-reject" class="btn-slot text x-huge"></span>' +
'</div>' +
'<div class="separator long review"/>' +
'<div class="separator long review"></div>' +
'<div class="group">' +
'<span id="btn-compare" class="btn-slot text x-huge"></span>' +
'</div>' +
'<div class="separator long compare"/>' +
'<div class="separator long compare"></div>' +
'<div class="group no-group-mask">' +
'<span id="slot-btn-chat" class="btn-slot text x-huge"></span>' +
'</div>' +
'<div class="separator long chat"/>' +
'<div class="separator long chat"></div>' +
'<div class="group no-group-mask">' +
'<span id="slot-btn-history" class="btn-slot text x-huge"></span>' +
'</div>' +
@ -647,7 +647,8 @@ define([
}
}, this);
this.btnChat && this.btnChat.setDisabled(state);
this.btnCommentRemove && this.btnCommentRemove.setDisabled(state);
this.btnCommentRemove && this.btnCommentRemove.setDisabled(state || !Common.Utils.InternalSettings.get(this.appPrefix + "settings-livecomment"));
},
onLostEditRights: function() {

View file

@ -96,12 +96,12 @@
'<label class="link" id="search-label-replace" result="replaceshow">'+this.txtBtnReplace+'</label>',
'</div>',
'</div>',
'<div class="separator horizontal"/>',
'<div class="separator horizontal"></div>',
'<div class="footer right">',
'<button class="btn normal dlg-btn" result="replace">'+this.txtBtnReplace+'</button>',
'<button class="btn normal dlg-btn" result="replaceall" style="margin-left: 6px;">'+this.txtBtnReplaceAll+'</button>',
'<button class="btn normal dlg-btn iconic" result="back"><span class="icon img-commonctrl back" /></button>',
'<button class="btn normal dlg-btn iconic" result="next" style="margin-left: 6px;"><span class="icon img-commonctrl next" /></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>',
'</div>'
].join('');

View file

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

View file

@ -366,14 +366,24 @@ define([
options: {
resizable : true,
minwidth : 448,
minheight : 396,
minheight : 434,
width: 448,
height: 396,
height: 434,
cls: 'modal-dlg',
buttons: ['ok', 'cancel']
},
initialize : function(options) {
var config = {
resizable : true,
minwidth : 448,
minheight : 434,
width: 448,
height: 434,
cls: 'modal-dlg',
buttons: ['ok', 'cancel']
};
var filter = Common.localStorage.getKeysFilter();
this.appPrefix = (filter && filter.length) ? filter.split(',')[0] : '';
@ -385,70 +395,96 @@ define([
}
size = size ? JSON.parse(size) : [];
_.extend(this.options, {
this.options = _.extend(config, {
title: this.textTitle,
width : size[0] || 448,
height : size[1] || 396
height : size[1] || 434
}, options || {});
this.api = this.options.api;
this.type = this.options.type || 0; // 0 - close on OK, single adding symbol
this.special = this.options.special || false; // true - show special tab
this.showShortcutKey = this.options.showShortcutKey || false;
!this.special && (this.options.height -= 38);
!this.special && (this.options.minheight -= 38);
this.template = [
'<div class="box">',
'<table cols="2" style="width: 100%;max-width: 497px;">',
'<tr>',
'<td style="padding-right: 5px;padding-bottom: 8px;width: 50%;">',
'<label class="input-label">' + this.textFont + '</label>',
'<div id="symbol-table-cmb-fonts"></div>',
'</td>',
'<td style="padding-left: 5px;padding-bottom: 8px;">',
'<label class="input-label">' + this.textRange + '</label>',
'<div id="symbol-table-cmb-range"></div>',
'</td>',
'</tr>',
'</table>',
'<table cols="1" style="width: 100%;">',
'<tr>',
'<td style="padding-bottom: 16px;">',
'<div id="symbol-table-scrollable-div" style="position: relative;height:'+ (this.options.height-264) + 'px;">',
'<div style="width: 100%;">',
'<div id="id-preview">',
'<div>',
'<div style="position: absolute; top: 0;"><div id="id-preview-data" tabindex="0" oo_editor_input="true"></div></div>',
'<div style="margin-bottom: 16px;" class="'+ (this.special ? '' : 'hidden') +'">',
'<button type="button" class="btn btn-text-default auto" id="symbol-table-symbols" style="border-top-right-radius: 0;border-bottom-right-radius: 0;">', this.textSymbols,'</button>',
'<button type="button" class="btn btn-text-default auto" id="symbol-table-special" style="border-top-left-radius: 0;border-bottom-left-radius: 0;border-left-width: 0;margin-left: -1px;">', this.textSpecial,'</button>',
'</div>',
'<div id="symbol-table-pnl-symbols">',
'<table cols="2" style="width: 100%;max-width: 497px;">',
'<tr>',
'<td style="padding-right: 5px;padding-bottom: 8px;width: 50%;">',
'<label class="input-label">' + this.textFont + '</label>',
'<div id="symbol-table-cmb-fonts"></div>',
'</td>',
'<td style="padding-left: 5px;padding-bottom: 8px;">',
'<label class="input-label">' + this.textRange + '</label>',
'<div id="symbol-table-cmb-range"></div>',
'</td>',
'</tr>',
'</table>',
'<table cols="1" style="width: 100%;">',
'<tr>',
'<td style="padding-bottom: 16px;">',
'<div id="symbol-table-scrollable-div" style="position: relative;height:'+ (this.options.height-302 + 38*(this.special ? 0 : 1)) + 'px;">',
'<div style="width: 100%;">',
'<div id="id-preview">',
'<div>',
'<div style="position: absolute; top: 0;"><div id="id-preview-data" tabindex="0" oo_editor_input="true"></div></div>',
'</div>',
'</div>',
'</div>',
'</div>',
'</div>',
'</td>',
'</tr>',
'<tr>',
'<td style="padding-bottom: 16px;">',
'<label class="input-label">' + this.textRecent + '</label>',
'<div id="symbol-table-recent" tabindex="0" oo_editor_input="true" style="width: 100%;"></div>',
'</td>',
'</tr>',
'</table>',
'<table cols="2" style="width: 100%;max-width: 497px;">',
'<tr>',
'<td style="padding-right: 5px; width: 50%;">',
'<label class="input-label">' + this.textCode + '</label>',
'</td>',
'<td style="padding-left: 5px;">',
'</td>',
'</tr>',
'<tr>',
'<td style="padding-right: 5px;">',
'<div id="symbol-table-text-code" oo_editor_input="true"></div>',
'</td>',
'<td style="padding-left: 5px;">',
'<div id="symbol-table-label-font" style="overflow: hidden; text-overflow: ellipsis;white-space: nowrap;max-width: 160px;"></div>',
'</td>',
'</tr>',
'</table>',
'</td>',
'</tr>',
'<tr>',
'<td style="padding-bottom: 16px;">',
'<label class="input-label">' + this.textRecent + '</label>',
'<div id="symbol-table-recent" tabindex="0" oo_editor_input="true" style="width: 100%;"></div>',
'</td>',
'</tr>',
'</table>',
'<table cols="2" style="width: 100%;max-width: 497px;">',
'<tr>',
'<td style="padding-right: 5px; width: 50%;">',
'<label class="input-label">' + this.textCode + '</label>',
'</td>',
'<td style="padding-left: 5px;">',
'</td>',
'</tr>',
'<tr>',
'<td style="padding-right: 5px;">',
'<div id="symbol-table-text-code" oo_editor_input="true"></div>',
'</td>',
'<td style="padding-left: 5px;">',
'<div id="symbol-table-label-font" style="overflow: hidden; text-overflow: ellipsis;white-space: nowrap;max-width: 160px;"></div>',
'</td>',
'</tr>',
'</table>',
'</div>',
'<div id="symbol-table-pnl-special">',
'<table cols="1" style="width: 100%;">',
'<tr>',
'<td>',
'<label>' + this.textCharacter + '</label>',
'<label id="symbol-table-lbl-shortcut" style="float: right; width: 107px;">' + this.textShortcut + '</label>',
'</td>',
'</tr>',
'<tr>',
'<td>',
'<div id="symbol-table-special-list" class="no-borders" style="width:100%; height: '+ (this.options.height-156 + 38*(this.special ? 0 : 1)) + 'px;"></div>',
'</td>',
'</tr>',
'</table>',
'</div>',
'</div>'
].join('');
this.options.tpl = _.template(this.template)(this.options);
this.api = this.options.api;
this.type = this.options.type || 0; // 0 - close on OK, single adding symbol
var init = (aFontSelects.length<1);
init && this.initFonts();
@ -579,6 +615,25 @@ define([
var $border = $window.find('.resize-border');
$border.css({'background': 'none', 'border': 'none'});
this.btnSymbols = new Common.UI.Button({
el: $window.find('#symbol-table-symbols'),
enableToggle: true,
toggleGroup: 'hyperlink-type',
allowDepress: false,
pressed: true
});
this.btnSymbols.on('click', _.bind(this.onModeClick, this, false));
this.btnSpecial = new Common.UI.Button({
el: $window.find('#symbol-table-special'),
enableToggle: true,
toggleGroup: 'hyperlink-type',
allowDepress: false
});
this.btnSpecial.on('click', _.bind(this.onModeClick, this, true));
// symbols
this.cmbFonts = new Common.UI.ComboBox({
el : $window.find('#symbol-table-cmb-fonts'),
cls : 'input-group-nr',
@ -663,7 +718,51 @@ define([
this.boxPanel = $window.find('.box');
this.updateView(undefined, undefined, undefined, true);
// special
var data = [{symbol: '—', description: this.textEmDash, shortcutKey: 'Alt+Ctrl+Num -', code: '2014'},
{symbol: '', description: this.textEnDash, shortcutKey: '', code: '2013'},
{symbol: '', description: this.textNBHyphen, shortcutKey: 'Ctrl+Shift+_', code: '002D', special: {"NonBreakingHyphen":true}},
// {symbol: '', description: this.textSHyphen, shortcutKey: 'Alt+-', code: '00AD'},
{symbol: '', description: this.textEmSpace, shortcutKey: '', code: '2003'},
{symbol: '', description: this.textEnSpace, shortcutKey: '', code: '2002'},
{symbol: '', description: this.textQEmSpace, shortcutKey: '', code: '2005'},
{symbol: '°', description: this.textNBSpace, shortcutKey: 'Ctrl+Shift+Space', code: '00A0'},
{symbol: '©', description: this.textCopyright, shortcutKey: '', code: '00A9'},
{symbol: '®', description: this.textRegistered, shortcutKey: '', code: '00AE'},
{symbol: '™', description: this.textTradeMark, shortcutKey: '', code: '2122'},
{symbol: '§', description: this.textSection, shortcutKey: '', code: '00A7'},
{symbol: '¶', description: this.textPilcrow, shortcutKey: '', code: '00B6'},
{symbol: '…', description: this.textEllipsis, shortcutKey: '', code: '2026'},
{symbol: '', description: this.textSOQuote, shortcutKey: '', code: '2018'},
{symbol: '', description: this.textSCQuote, shortcutKey: '', code: '2019'},
{symbol: '‟', description: this.textDOQuote, shortcutKey: '', code: '201C'},
{symbol: '”', description: this.textDCQuote, shortcutKey: '', code: '201D'}
];
this.specialList = new Common.UI.ListView({
el: $window.find('#symbol-table-special-list'),
store: new Common.UI.DataViewStore(data),
simpleAddMode: true,
template: _.template(['<div class="listview inner" style=""></div>'].join('')),
itemTemplate: _.template([
'<div id="<%= id %>" class="list-item" style="pointer-events:none;width: 100%;display:flex;">',
'<div style="width:70px;text-align: center; padding-right: 5px;"><%= symbol %></div>',
'<div style="flex-grow:1;padding-right: 5px;"><%= description %></div>',
'<% if (' + this.showShortcutKey + ') { %>',
'<div style="width:100px;"><%= shortcutKey %></div>',
'<% } %>',
'</div>'
].join(''))
});
this.specialList.on('item:dblclick', _.bind(this.onDblClickSpecialItem, this))
.on('entervalue', _.bind(this.onDblClickSpecialItem, this));
this.specialList.selectByIndex(0);
this.lblShortCut = $window.find('#symbol-table-lbl-shortcut');
this.lblShortCut.toggleClass('hidden', !this.showShortcutKey);
$window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this));
this.symbolsPanel = $window.find('#symbol-table-pnl-symbols');
this.specialPanel = $window.find('#symbol-table-pnl-special');
},
show: function() {
@ -676,16 +775,17 @@ define([
$(document).on('keydown.' + this.cid, '#symbol-table-scrollable-div #id-preview-data, #symbol-table-recent', this.binding.keydownSymbols);
$(document).on('keypress.' + this.cid, '#symbol-table-scrollable-div #id-preview-data, #symbol-table-recent', this.binding.keypressSymbols);
var me = this;
_.delay(function(){
me.previewPanel.focus();
},50);
var special = this.special && !!Common.Utils.InternalSettings.get(this.appPrefix + "symbol-table-special");
special ? this.btnSpecial.toggle(true) : this.btnSymbols.toggle(true);
this.ShowHideElem(special);
},
close: function(suppressevent) {
$(document).off('keydown.' + this.cid, this.binding.keydownSymbols);
$(document).off('keypress.' + this.cid, this.binding.keypressSymbols);
this.special && Common.Utils.InternalSettings.set(this.appPrefix + "symbol-table-special", this.btnSpecial.isActive());
Common.UI.Window.prototype.close.apply(this, arguments);
},
@ -701,6 +801,11 @@ define([
return {font: sFont, symbol: this.encodeSurrogateChar(nCurrentSymbol), code: nCurrentSymbol, updateRecents: bUpdateRecents};
},
getSpecialSymbol: function() {
var rec = this.specialList.getSelectedRec();
return {font: undefined, symbol: this.encodeSurrogateChar(rec.get('code')), code: parseInt(rec.get('code'), 16), special: rec.get('special')};
},
onBtnClick: function(event) {
this._handleInput(event.currentTarget.attributes['result'].value);
},
@ -711,13 +816,14 @@ define([
},
_handleInput: function(state) {
var settings = this.getPasteSymbol(this.$window.find('.cell-selected').attr('id'));
var special = this.btnSpecial.isActive();
var settings = special ? this.getSpecialSymbol() : this.getPasteSymbol(this.$window.find('.cell-selected').attr('id'));
if (this.options.handler) {
this.options.handler.call(this, this, state, settings);
}
if (state=='ok') {
settings.updateRecents && this.checkRecent(nCurrentSymbol, settings.font);
settings.updateRecents && this.updateRecents();
!special && settings.updateRecents && this.checkRecent(nCurrentSymbol, settings.font);
!special && settings.updateRecents && this.updateRecents();
if (this.type)
return;
}
@ -950,6 +1056,15 @@ define([
}
},
onDblClickSpecialItem: function(e) {
if (!this.type)
this._handleInput('ok');
else {
var settings = this.getSpecialSymbol();
this.fireEvent('symbol:dblclick', this, 'ok', settings);
}
},
updateRecents: function(){
var oRecentsDiv = this.recentPanel;
oRecentsDiv.empty();
@ -1304,7 +1419,7 @@ define([
this.curSize = {resize: false, width: size[0], height: size[1]};
} else if (this.curSize.resize) {
this._preventUpdateScroll = false;
this.curSize.height = size[1] - 264;
this.curSize.height = size[1] - 302 + 38*(this.special ? 0 : 1);
var rows = Math.max(1, ((this.curSize.height/CELL_HEIGHT) >> 0)),
height = rows*CELL_HEIGHT;
@ -1315,6 +1430,9 @@ define([
this.updateView(undefined, undefined, undefined, true);
this.specialList.cmpEl.height(size[1] - 156 + 38*(this.special ? 0 : 1));
!this.special && (size[1] += 38);
var valJson = JSON.stringify(size);
Common.localStorage.setItem(this.appPrefix + 'settings-size-symbol-table', valJson);
Common.Utils.InternalSettings.set(this.appPrefix + 'settings-size-symbol-table', valJson);
@ -1330,7 +1448,7 @@ define([
this.curSize.resize = true;
this.curSize.width = size[0];
this.curSize.height = size[1] - 264;
this.curSize.height = size[1] - 302 + 38*(this.special ? 0 : 1);
var rows = Math.max(1, ((this.curSize.height/CELL_HEIGHT) >> 0)),
height = rows*CELL_HEIGHT;
@ -1339,14 +1457,53 @@ define([
this.previewPanel.css({'height': height + 'px'});
this.previewScrolled.css({'height': height + 'px'});
this.specialList.cmpEl.height(size[1] - 156 + 38*(this.special ? 0 : 1));
this.updateView(undefined, undefined, undefined, true);
}
},
onModeClick: function(special, btn, event) {
this.ShowHideElem(special);
},
ShowHideElem: function(special) {
this.symbolsPanel.toggleClass('hidden', special);
this.specialPanel.toggleClass('hidden', !special);
var me = this;
_.delay(function(){
special ? me.specialList.cmpEl.find('.listview').focus() : me.previewPanel.focus();
},50);
},
textTitle: 'Symbol',
textFont: 'Font',
textRange: 'Range',
textRecent: 'Recently used symbols',
textCode: 'Unicode HEX value'
textCode: 'Unicode HEX value',
textSymbols: 'Symbols',
textSpecial: 'Special characters',
textCharacter: 'Character',
textShortcut: 'Shortcut key',
textEmDash: 'Em Dash',
textEnDash: 'En Dash',
textNBHyphen: 'Non-breaking Hyphen',
textSHyphen: 'Soft Hyphen',
textEmSpace: 'Em Space',
textEnSpace: 'En Space',
textQEmSpace: '1/4 Em Space',
textNBSpace: 'No-break Space',
textCopyright: 'Copyright Sign',
textRegistered: 'Registered Sign',
textTradeMark: 'Trade Mark Sign',
textSection: 'Section Sign',
textPilcrow: 'Pilcrow Sign',
textEllipsis: 'Horizontal Ellipsis',
textSOQuote: 'Single Opening Quote',
textSCQuote: 'Single Closing Quote',
textDOQuote: 'Double Opening Quote',
textDCQuote: 'Double Closing Quote'
}, Common.Views.SymbolTableDialog || {}))
});

Binary file not shown.

Before

Width:  |  Height:  |  Size: 216 B

After

Width:  |  Height:  |  Size: 254 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 275 B

View file

@ -1,15 +1,10 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 127" version="1.1" width="100" height="127">
<svg fill="none" height="96" viewBox="0 0 96 96" width="96" xmlns="http://www.w3.org/2000/svg">
<symbol id="svg-format-blank">
<path d="M95 23V119C95 119.796 94.6839 120.559 94.1213 121.121C93.5587 121.684 92.7956 122 92 122H8C7.20435 122 6.44129 121.684 5.87868 121.121C5.31607 120.559 5 119.796 5 119V8C5 7.20435 5.31607 6.44129 5.87868 5.87868C6.44129 5.31607 7.20435 5 8 5H77L95 23Z" fill="white"/>
<path opacity="0.2" d="M77 5H8C7.20435 5 6.44129 5.31607 5.87868 5.87868C5.31607 6.44129 5 7.20435 5 8V119C5 119.796 5.31607 120.559 5.87868 121.121C6.44129 121.684 7.20435 122 8 122H92C92.7956 122 93.5587 121.684 94.1213 121.121C94.6839 120.559 95 119.796 95 119V23L77 5ZM94 119C94 119.53 93.7893 120.039 93.4142 120.414C93.0391 120.789 92.5304 121 92 121H8C7.46957 121 6.96086 120.789 6.58579 120.414C6.21071 120.039 6 119.53 6 119V8C6 7.46957 6.21071 6.96086 6.58579 6.58579C6.96086 6.21071 7.46957 6 8 6H76.59L77 6.41V20C77 20.7956 77.3161 21.5587 77.8787 22.1213C78.4413 22.6839 79.2044 23 80 23H93.59L94 23.41V119Z" fill="black"/>
<g opacity="0.2">
<path opacity="0.2" d="M75 86H50V88H75V86Z" fill="black"/>
<path opacity="0.2" d="M75 80H25V82H75V80Z" fill="black"/>
<path opacity="0.2" d="M75 74H25V76H75V74Z" fill="black"/>
<path opacity="0.2" d="M75 68H25V70H75V68Z" fill="black"/>
<path opacity="0.2" d="M75 62H25V64H75V62Z" fill="black"/>
<path opacity="0.2" d="M49 43H25V45H49V43Z" fill="black"/>
<path opacity="0.2" d="M44 37H25V39H44V37Z" fill="black"/>
</g>
<clipPath id="a">
<path d="m0 0h96v96h-96z"/>
</clipPath>
<g clip-path="url(#a)">
<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"/>
</g>
</symbol>
</svg>
</svg>

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 440 B

View file

@ -0,0 +1,14 @@
<svg width="100" height="127" viewBox="0 0 100 127" fill="none" xmlns="http://www.w3.org/2000/svg">
<symbol id="svg-format-jpg">
<g>
<path d="M95 22V118C95 118.796 94.6839 119.559 94.1213 120.121C93.5587 120.684 92.7956 121 92 121H8C7.20435 121 6.44129 120.684 5.87868 120.121C5.31607 119.559 5 118.796 5 118V7C5 6.20435 5.31607 5.44129 5.87868 4.87868C6.44129 4.31607 7.20435 4 8 4H77L95 22Z" fill="#7371D8"/>
<g>
<path d="M39.5801 115.52C39.1699 115.52 38.8125 115.477 38.5078 115.391V113.879C38.8203 113.957 39.1055 113.996 39.3633 113.996C39.7617 113.996 40.0469 113.871 40.2188 113.621C40.3906 113.375 40.4766 112.988 40.4766 112.461V104.434H42.293V112.449C42.293 113.449 42.0645 114.211 41.6074 114.734C41.1504 115.258 40.4746 115.52 39.5801 115.52Z" fill="white"/>
<path d="M46.2656 108.465H46.8633C47.4219 108.465 47.8398 108.355 48.1172 108.137C48.3945 107.914 48.5332 107.592 48.5332 107.17C48.5332 106.744 48.416 106.43 48.1816 106.227C47.9512 106.023 47.5879 105.922 47.0918 105.922H46.2656V108.465ZM50.3672 107.105C50.3672 108.027 50.0781 108.732 49.5 109.221C48.9258 109.709 48.1074 109.953 47.0449 109.953H46.2656V113H44.4492V104.434H47.1855C48.2246 104.434 49.0137 104.658 49.5527 105.107C50.0957 105.553 50.3672 106.219 50.3672 107.105Z" fill="white"/>
<path d="M55.2363 108.189H58.6348V112.631C58.084 112.811 57.5645 112.936 57.0762 113.006C56.5918 113.08 56.0957 113.117 55.5879 113.117C54.2949 113.117 53.3066 112.738 52.623 111.98C51.9434 111.219 51.6035 110.127 51.6035 108.705C51.6035 107.322 51.998 106.244 52.7871 105.471C53.5801 104.697 54.6777 104.311 56.0801 104.311C56.959 104.311 57.8066 104.486 58.623 104.838L58.0195 106.291C57.3945 105.979 56.7441 105.822 56.0684 105.822C55.2832 105.822 54.6543 106.086 54.1816 106.613C53.709 107.141 53.4727 107.85 53.4727 108.74C53.4727 109.67 53.6621 110.381 54.041 110.873C54.4238 111.361 54.9785 111.605 55.7051 111.605C56.084 111.605 56.4688 111.566 56.8594 111.488V109.701H55.2363V108.189Z" fill="white"/>
</g>
<path d="M56 51.869L73.183 79H27.7869L39.5 59.912L44.274 67.6919L45.113 69.059L45.9712 67.7039L56 51.869ZM36 51.5C36 53.9853 33.9853 56 31.5 56C29.0147 56 27 53.9853 27 51.5C27 49.0147 29.0147 47 31.5 47C33.9853 47 36 49.0147 36 51.5Z" fill="white" stroke="white" stroke-width="2"/>
<path opacity="0.2" d="M95 22H80C79.2044 22 78.4413 21.6839 77.8787 21.1213C77.3161 20.5587 77 19.7956 77 19V4L95 22Z" fill="black"/>
</g>
</symbol>
</svg>

After

Width:  |  Height:  |  Size: 2.4 KiB

View file

@ -0,0 +1,14 @@
<svg width="100" height="127" viewBox="0 0 100 127" fill="none" xmlns="http://www.w3.org/2000/svg">
<symbol id="svg-format-png">
<g>
<path d="M95 23V119C95 119.796 94.6839 120.559 94.1213 121.121C93.5587 121.684 92.7956 122 92 122H8C7.20435 122 6.44129 121.684 5.87868 121.121C5.31607 120.559 5 119.796 5 119V8C5 7.20435 5.31607 6.44129 5.87868 5.87868C6.44129 5.31607 7.20435 5 8 5H77L95 23Z" fill="#D871D6"/>
<g>
<path d="M39.8984 109.465H40.4961C41.0547 109.465 41.4727 109.355 41.75 109.137C42.0273 108.914 42.166 108.592 42.166 108.17C42.166 107.744 42.0488 107.43 41.8145 107.227C41.584 107.023 41.2207 106.922 40.7246 106.922H39.8984V109.465ZM44 108.105C44 109.027 43.7109 109.732 43.1328 110.221C42.5586 110.709 41.7402 110.953 40.6777 110.953H39.8984V114H38.082V105.434H40.8184C41.8574 105.434 42.6465 105.658 43.1855 106.107C43.7285 106.553 44 107.219 44 108.105Z" fill="white"/>
<path d="M53.2168 114H50.9082L47.1816 107.52H47.1289C47.2031 108.664 47.2402 109.48 47.2402 109.969V114H45.6172V105.434H47.9082L51.6289 111.85H51.6699C51.6113 110.736 51.582 109.949 51.582 109.488V105.434H53.2168V114Z" fill="white"/>
<path d="M58.6309 109.189H62.0293V113.631C61.4785 113.811 60.959 113.936 60.4707 114.006C59.9863 114.08 59.4902 114.117 58.9824 114.117C57.6895 114.117 56.7012 113.738 56.0176 112.98C55.3379 112.219 54.998 111.127 54.998 109.705C54.998 108.322 55.3926 107.244 56.1816 106.471C56.9746 105.697 58.0723 105.311 59.4746 105.311C60.3535 105.311 61.2012 105.486 62.0176 105.838L61.4141 107.291C60.7891 106.979 60.1387 106.822 59.4629 106.822C58.6777 106.822 58.0488 107.086 57.5762 107.613C57.1035 108.141 56.8672 108.85 56.8672 109.74C56.8672 110.67 57.0566 111.381 57.4355 111.873C57.8184 112.361 58.373 112.605 59.0996 112.605C59.4785 112.605 59.8633 112.566 60.2539 112.488V110.701H58.6309V109.189Z" fill="white"/>
</g>
<path d="M56 51.869L73.183 79H27.7869L39.5 59.912L44.274 67.6919L45.113 69.059L45.9712 67.7039L56 51.869ZM36 51.5C36 53.9853 33.9853 56 31.5 56C29.0147 56 27 53.9853 27 51.5C27 49.0147 29.0147 47 31.5 47C33.9853 47 36 49.0147 36 51.5Z" fill="white" stroke="white" stroke-width="2"/>
<path opacity="0.2" d="M95 23H80C79.2044 23 78.4413 22.6839 77.8787 22.1213C77.3161 21.5587 77 20.7956 77 20V5L95 23Z" fill="black"/>
</g>
</symbol>
</svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

View file

@ -0,0 +1,14 @@
<svg width="100" height="127" viewBox="0 0 100 127" fill="none" xmlns="http://www.w3.org/2000/svg">
<symbol id="svg-format-svg">
<g>
<path d="M95 23V119C95 119.796 94.6839 120.559 94.1213 121.121C93.5587 121.684 92.7956 122 92 122H8C7.20435 122 6.44129 121.684 5.87868 121.121C5.31607 120.559 5 119.796 5 119V8C5 7.20435 5.31607 6.44129 5.87868 5.87868C6.44129 5.31607 7.20435 5 8 5H77L95 23Z" fill="#507C8B"/>
<g>
<path d="M44.5801 111.621C44.5801 112.395 44.3008 113.004 43.7422 113.449C43.1875 113.895 42.4141 114.117 41.4219 114.117C40.5078 114.117 39.6992 113.945 38.9961 113.602V111.914C39.5742 112.172 40.0625 112.354 40.4609 112.459C40.8633 112.564 41.2305 112.617 41.5625 112.617C41.9609 112.617 42.2656 112.541 42.4766 112.389C42.6914 112.236 42.7988 112.01 42.7988 111.709C42.7988 111.541 42.752 111.393 42.6582 111.264C42.5645 111.131 42.4258 111.004 42.2422 110.883C42.0625 110.762 41.6934 110.568 41.1348 110.303C40.6113 110.057 40.2188 109.82 39.957 109.594C39.6953 109.367 39.4863 109.104 39.3301 108.803C39.1738 108.502 39.0957 108.15 39.0957 107.748C39.0957 106.99 39.3516 106.395 39.8633 105.961C40.3789 105.527 41.0898 105.311 41.9961 105.311C42.4414 105.311 42.8652 105.363 43.2676 105.469C43.6738 105.574 44.0977 105.723 44.5391 105.914L43.9531 107.326C43.4961 107.139 43.1172 107.008 42.8164 106.934C42.5195 106.859 42.2266 106.822 41.9375 106.822C41.5938 106.822 41.3301 106.902 41.1465 107.062C40.9629 107.223 40.8711 107.432 40.8711 107.689C40.8711 107.85 40.9082 107.99 40.9824 108.111C41.0566 108.229 41.1738 108.344 41.334 108.457C41.498 108.566 41.8828 108.766 42.4883 109.055C43.2891 109.438 43.8379 109.822 44.1348 110.209C44.4316 110.592 44.5801 111.062 44.5801 111.621Z" fill="white"/>
<path d="M51.0195 105.434H52.8535L49.9414 114H47.9609L45.0547 105.434H46.8887L48.5 110.531C48.5898 110.832 48.6816 111.184 48.7754 111.586C48.873 111.984 48.9336 112.262 48.957 112.418C49 112.059 49.1465 111.43 49.3965 110.531L51.0195 105.434Z" fill="white"/>
<path d="M57.1895 109.189H60.5879V113.631C60.0371 113.811 59.5176 113.936 59.0293 114.006C58.5449 114.08 58.0488 114.117 57.541 114.117C56.248 114.117 55.2598 113.738 54.5762 112.98C53.8965 112.219 53.5566 111.127 53.5566 109.705C53.5566 108.322 53.9512 107.244 54.7402 106.471C55.5332 105.697 56.6309 105.311 58.0332 105.311C58.9121 105.311 59.7598 105.486 60.5762 105.838L59.9727 107.291C59.3477 106.979 58.6973 106.822 58.0215 106.822C57.2363 106.822 56.6074 107.086 56.1348 107.613C55.6621 108.141 55.4258 108.85 55.4258 109.74C55.4258 110.67 55.6152 111.381 55.9941 111.873C56.377 112.361 56.9316 112.605 57.6582 112.605C58.0371 112.605 58.4219 112.566 58.8125 112.488V110.701H57.1895V109.189Z" fill="white"/>
</g>
<path d="M51 58.917C53.8377 58.441 56 55.973 56 53C56 49.6863 53.3137 47 50 47C46.6863 47 44 49.6863 44 53C44 55.973 46.1623 58.441 49 58.917V71.5858L39.8908 62.4765C40.5892 61.4957 41 60.2958 41 59C41 55.6863 38.3137 53 35 53C31.6863 53 29 55.6863 29 59C29 62.3137 31.6863 65 35 65C36.2958 65 37.4957 64.5892 38.4766 63.8907L48.5858 74H36.917C36.441 71.1623 33.973 69 31 69C27.6863 69 25 71.6863 25 75C25 75.3407 25.0284 75.6748 25.083 76H74.917C74.9716 75.6748 75 75.3407 75 75C75 71.6863 72.3137 69 69 69C66.027 69 63.559 71.1623 63.083 74H51.5563L61.6071 63.9492C62.5721 64.6121 63.7408 65 65 65C68.3137 65 71 62.3137 71 59C71 55.6863 68.3137 53 65 53C61.6863 53 59 55.6863 59 59C59 60.3323 59.4343 61.5633 60.169 62.5589L51 71.7279V58.917Z" fill="white"/>
<path opacity="0.2" d="M95 23H80C79.2044 23 78.4413 22.6839 77.8787 22.1213C77.3161 21.5587 77 20.7956 77 20V5L95 23Z" fill="black"/>
</g>
</symbol>
</svg>

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 285 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 466 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 494 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 171 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 335 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 512 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 550 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 395 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 647 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 958 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 178 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 508 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 421 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 396 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 497 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 291 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 283 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 177 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 468 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 492 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 572 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 342 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 264 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 B

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