Merge branch 'develop' into feature/mobile-comments

This commit is contained in:
JuliaSvinareva 2020-05-07 20:09:29 +03:00 committed by GitHub
commit 4bab80b0f7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3876 changed files with 69772 additions and 9771 deletions

View file

@ -74,15 +74,16 @@
recent: [ recent: [
{ {
title: 'document title', title: 'document title',
image: 'recent icon url',
url: 'document url', url: 'document url',
folder: 'path to document' folder: 'path to document',
}, },
... ...
], ],
templates: [ templates: [
{ {
name: 'template name', title: 'template name', // name - is deprecated
icon: 'template icon url', image: 'template icon url',
url: 'http://...' url: 'http://...'
}, },
... ...
@ -385,8 +386,6 @@
if (!_config.editorConfig.customization) _config.editorConfig.customization = {}; if (!_config.editorConfig.customization) _config.editorConfig.customization = {};
_config.editorConfig.customization.about = false; _config.editorConfig.customization.about = false;
_config.editorConfig.customization.compactHeader = false; _config.editorConfig.customization.compactHeader = false;
if ( window.AscDesktopEditor ) window.AscDesktopEditor.execCommand('webapps:events', 'loading');
} }
} }
})(); })();

View file

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

View file

@ -313,7 +313,8 @@ define([
if (me.options.el) { if (me.options.el) {
me.render(); me.render();
} } else if (me.options.parentEl)
me.render(me.options.parentEl);
}, },
render: function(parentEl) { render: function(parentEl) {
@ -646,8 +647,14 @@ define([
oldCls = this.iconCls; oldCls = this.iconCls;
this.iconCls = cls; this.iconCls = cls;
btnIconEl.removeClass(oldCls); if (/svgicon/.test(this.iconCls)) {
btnIconEl.addClass(cls || ''); 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) { changeIcon: function(opts) {

View file

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

View file

@ -34,11 +34,12 @@ if (Common === undefined)
var Common = {}; var Common = {};
define([ define([
'common/main/lib/component/Button' 'common/main/lib/component/Button',
'common/main/lib/component/ThemeColorPalette'
], function () { ], function () {
'use strict'; 'use strict';
Common.UI.ColorButton = Common.UI.Button.extend({ Common.UI.ColorButton = Common.UI.Button.extend(_.extend({
options : { options : {
hint: false, hint: false,
enableToggle: false, enableToggle: false,
@ -49,25 +50,85 @@ define([
'<div class="btn-group" id="<%= id %>">', '<div class="btn-group" id="<%= id %>">',
'<button type="button" class="btn btn-color dropdown-toggle <%= cls %>" data-toggle="dropdown" style="<%= style %>">', '<button type="button" class="btn btn-color dropdown-toggle <%= cls %>" data-toggle="dropdown" style="<%= style %>">',
'<span>&nbsp;</span>', '<span>&nbsp;</span>',
'<span class="inner-box-caret"><i class="caret img-commonctrl"></i></span>',
'</button>', '</button>',
'</div>' '</div>'
].join('')), ].join('')),
initialize : function(options) {
if (!options.menu && options.menu !== false) {// menu==null or undefined
// set default menu
var me = this;
options.menu = me.getMenu(options);
me.on('render:after', function(btn) {
me.getPicker(options.color);
});
}
Common.UI.Button.prototype.initialize.call(this, options);
},
render: function(parentEl) {
Common.UI.Button.prototype.render.call(this, parentEl);
if (this.options.color!==undefined)
this.setColor(this.options.color);
},
onColorSelect: function(picker, color) {
this.setColor(color);
this.trigger('color:select', this, color);
},
setColor: function(color) { setColor: function(color) {
var border_color, clr, var span = $(this.cmpEl).find('button span:nth-child(1)');
span = $(this.cmpEl).find('button span');
this.color = color; this.color = color;
if ( color== 'transparent' ) { span.toggleClass('color-transparent', color=='transparent');
border_color = '#BEBEBE'; span.css({'background-color': (color=='transparent') ? color : ((typeof(color) == 'object') ? '#'+color.color : '#'+color)});
clr = color; },
span.addClass('color-transparent');
} else { getPicker: function(color) {
border_color = 'transparent'; if (!this.colorPicker) {
clr = (typeof(color) == 'object') ? '#'+color.color : '#'+color; this.colorPicker = new Common.UI.ThemeColorPalette({
span.removeClass('color-transparent'); el: this.cmpEl.find('#' + this.menu.id + '-color-menu'),
transparent: this.options.transparent,
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) { if (record.get('value')>0) {
formcontrol[0].innerHTML = ''; formcontrol[0].innerHTML = '';
formcontrol.removeClass('text').addClass('image'); formcontrol.removeClass('text').addClass('image');
formcontrol.css('background-position', '0 -' + record.get('offsety') + 'px'); formcontrol.css('background-position', '10px -' + record.get('offsety') + 'px');
} else { } else {
formcontrol[0].innerHTML = this.txtNoBorders; formcontrol[0].innerHTML = this.txtNoBorders;
formcontrol.removeClass('image').addClass('text'); 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>', '<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">', '<ul class="dropdown-menu <%= menuCls %>" style="<%= menuStyle %>" role="menu">',
'<% _.each(items, function(item) { %>', '<% _.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>', '<span style="margin-top: 0;"></span>',
'<% if (item.offsety!==undefined) { %>', '<% if (item.offsety!==undefined) { %>',
'<img src="data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" align="left" style="background-position: 0 -<%= item.offsety %>px;">', '<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'); var formcontrol = $(this.el).find('.form-control');
formcontrol[0].innerHTML = ''; formcontrol[0].innerHTML = '';
formcontrol.removeClass('text').addClass('image'); 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 || {})); }, Common.UI.ComboBorderType || {}));

View file

@ -644,7 +644,7 @@ define([
} else { } else {
$(this.el).find('ul').html(_.template([ $(this.el).find('ul').html(_.template([
'<% _.each(items, function(item) { %>', '<% _.each(items, function(item) { %>',
'<li id="<%= item.id %>" data-value="<%= item.value %>"><a tabindex="-1" type="menuitem"><%= scope.getDisplayValue(item) %></a></li>', '<li id="<%= item.id %>" data-value="<%- item.value %>"><a tabindex="-1" type="menuitem"><%= scope.getDisplayValue(item) %></a></li>',
'<% }); %>' '<% }); %>'
].join(''))({ ].join(''))({
items: this.store.toJSON(), items: this.store.toJSON(),

View file

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

View file

@ -53,7 +53,8 @@ if (Common === undefined)
define([ define([
'common/main/lib/component/BaseView', 'common/main/lib/component/BaseView',
'common/main/lib/component/Tooltip' 'common/main/lib/component/Tooltip',
'common/main/lib/component/Button'
], function () { 'use strict'; ], function () { 'use strict';
Common.UI.InputField = Common.UI.BaseView.extend((function() { Common.UI.InputField = Common.UI.BaseView.extend((function() {
@ -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"/>',
'<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

@ -374,20 +374,67 @@ define([
if ( $active && $active.length ) { if ( $active && $active.length ) {
var _maxright = $active.parents('.box-controls').width(); var _maxright = $active.parents('.box-controls').width();
var data = $active.data(), var data = $active.data(),
_rightedge = data.rightedge; _rightedge = data.rightedge,
_btns = data.buttons,
_flex = data.flex;
if ( !_rightedge ) { if ( !_rightedge ) {
_rightedge = $active.get(0).getBoundingClientRect().right; _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) {
_flex.push($(item));
});
data.flex = _flex;
}
if ( _rightedge > _maxright ) { if ( _rightedge > _maxright) {
if ( !$active.hasClass('compactwidth') ) { if (_flex.length>0) {
$active.addClass('compactwidth'); for (var i=0; i<_flex.length; i++) {
data.rightedge = _rightedge; var item = _flex[i];
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 { } else {
if ($active.hasClass('compactwidth')) { for (var i=0; i<_btns.length; i++) {
$active.removeClass('compactwidth'); 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.css('width', item.css('max-width'));
}
} }
} }
} }

View file

@ -52,7 +52,7 @@ define([
'<div class="asc-synchronizetip">', '<div class="asc-synchronizetip">',
'<div class="tip-arrow <%= scope.placement %>"></div>', '<div class="tip-arrow <%= scope.placement %>"></div>',
'<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 class="close img-commonctrl"></div>',
'</div>', '</div>',
'<% if ( scope.showLink ) { %>', '<% if ( scope.showLink ) { %>',
@ -105,6 +105,10 @@ define([
applyPlacement: function () { applyPlacement: function () {
var showxy = this.target.offset(), var showxy = this.target.offset(),
innerHeight = Common.Utils.innerHeight(); innerHeight = Common.Utils.innerHeight();
if (this.placement == 'document') {
// this.cmpEl.css('top', $('#editor_sdk').offset().top);
} else
if (this.placement == 'top') if (this.placement == 'top')
this.cmpEl.css({bottom : innerHeight - showxy.top + 'px', right: Common.Utils.innerWidth() - showxy.left - this.target.width()/2 + 'px'}); this.cmpEl.css({bottom : innerHeight - showxy.top + 'px', right: Common.Utils.innerWidth() - showxy.left - this.target.width()/2 + 'px'});
else {// left or right else {// left or right

View file

@ -52,8 +52,8 @@ define([
this.label = 'Tab'; this.label = 'Tab';
this.cls = ''; this.cls = '';
this.index = -1; this.index = -1;
this.template = _.template(['<li class="<% if(active){ %>active selected<% } %> <% if(cls.length){%><%= cls %><%}%>" data-label="<%= label %>">', this.template = _.template(['<li class="<% 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>', '<span title="<%- label %>" draggable="true" oo_editor_input="true" tabindex="-1" data-index="<%= index %>"><%- label %></span>',
'</li>'].join('')); '</li>'].join(''));
this.initialize.call(this, opts); this.initialize.call(this, opts);

View file

@ -142,6 +142,7 @@ define([
me.bar.$bar.scrollLeft(me.scrollLeft); me.bar.$bar.scrollLeft(me.scrollLeft);
me.bar.scrollX = undefined; me.bar.scrollX = undefined;
} }
me.bar.checkInvisible();
me.drag = undefined; me.drag = undefined;
me.bar.trigger('tab:drop', this); me.bar.trigger('tab:drop', this);
@ -542,7 +543,7 @@ define([
this.checkInvisible(suppress); this.checkInvisible(suppress);
} else if ( index >= (this.tabs.length - 1) || index == 'last') { } else if ( index >= (this.tabs.length - 1) || index == 'last') {
var tab = this.tabs[this.tabs.length-1].$el; var tab = this.tabs[this.tabs.length-1].$el;
this.$bar.scrollLeft(this.$bar.scrollLeft() + (tab.position().left + parseInt(tab.css('width')) - this.$bar.width()) + 1); this.$bar.scrollLeft(this.$bar.scrollLeft() + (tab.position().left + parseInt(tab.css('width')) - this.$bar.width()) + (this.$bar.width() > 400 ? 20 : 5));
this.checkInvisible(suppress); this.checkInvisible(suppress);
} else { } else {
var rightbound = this.$bar.width(), var rightbound = this.$bar.width(),
@ -554,7 +555,7 @@ define([
right = tab.position().left + parseInt(tab.css('width')); right = tab.position().left + parseInt(tab.css('width'));
if (right > rightbound) { if (right > rightbound) {
this.$bar.scrollLeft(this.$bar.scrollLeft() + (right - rightbound) + 20); this.$bar.scrollLeft(this.$bar.scrollLeft() + (right - rightbound) + (this.$bar.width() > 400 ? 20 : 5));
this.checkInvisible(suppress); this.checkInvisible(suppress);
break; break;
} }

View file

@ -219,24 +219,34 @@ define([
} }
} }
function _centre() { function _readDocumetGeometry() {
if (window.innerHeight == undefined) { if (window.innerHeight == undefined) {
var main_width = document.documentElement.offsetWidth; var width = document.documentElement.offsetWidth,
var main_height = document.documentElement.offsetHeight; height = document.documentElement.offsetHeight;
} else { } else {
main_width = Common.Utils.innerWidth(); width = Common.Utils.innerWidth();
main_height = Common.Utils.innerHeight(); 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') { if (this.initConfig.height == 'auto') {
var win_height = parseInt(this.$window.find('.body').css('height')); var win_height = parseInt(this.$window.find('.body').css('height'));
this.initConfig.header && (win_height += parseInt(this.$window.find('.header').css('height'))); this.initConfig.header && (win_height += parseInt(this.$window.find('.header').css('height')));
} else } else {
win_height = this.initConfig.height; 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 win_width = (this.initConfig.width=='auto') ? parseInt(this.$window.find('.body').css('width')) : this.initConfig.width;
var 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); var left = Math.floor((parseInt(main_width) - parseInt(win_width)) / 2);
this.$window.css('left',left); this.$window.css('left',left);
@ -244,18 +254,21 @@ define([
} }
function _setVisible() { function _setVisible() {
if (window.innerHeight == undefined) { var main_geometry = _readDocumetGeometry(),
var main_width = document.documentElement.offsetWidth; main_width = main_geometry.width,
var main_height = document.documentElement.offsetHeight; main_height = main_geometry.height;
} else {
main_width = Common.Utils.innerWidth();
main_height = Common.Utils.innerHeight();
}
if (this.getLeft() + this.getWidth() > main_width) if (this.getLeft() + this.getWidth() > main_width)
this.$window.css('left', main_width - this.getWidth()); 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) { function _getTransformation(end) {
@ -277,16 +290,15 @@ define([
this.dragging.initx = event.pageX*zoom - this.getLeft(); this.dragging.initx = event.pageX*zoom - this.getLeft();
this.dragging.inity = event.pageY*zoom - this.getTop(); this.dragging.inity = event.pageY*zoom - this.getTop();
if (window.innerHeight == undefined) { var main_geometry = _readDocumetGeometry(),
var main_width = document.documentElement.offsetWidth; main_width = main_geometry.width,
var main_height = document.documentElement.offsetHeight; main_height = main_geometry.height;
} else {
main_width = Common.Utils.innerWidth();
main_height = Common.Utils.innerHeight();
}
this.dragging.maxx = main_width - this.getWidth(); this.dragging.maxx = main_width - this.getWidth();
this.dragging.maxy = main_height - this.getHeight(); 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('mousemove', this.binding.drag);
$(document).on('mouseup', this.binding.dragStop); $(document).on('mouseup', this.binding.dragStop);
@ -311,10 +323,11 @@ define([
if (this.dragging.enabled) { if (this.dragging.enabled) {
var zoom = (event instanceof jQuery.Event) ? Common.Utils.zoom() : 1, var zoom = (event instanceof jQuery.Event) ? Common.Utils.zoom() : 1,
left = event.pageX*zoom - this.dragging.initx, left = event.pageX*zoom - this.dragging.initx,
top = event.pageY*zoom - this.dragging.inity; top = event.pageY*zoom - this.dragging.inity,
topedge = Common.Utils.InternalSettings.get('window-inactive-area-top');
left < 0 ? (left = 0) : left > this.dragging.maxx && (left = this.dragging.maxx); left < 0 ? (left = 0) : left > this.dragging.maxx && (left = this.dragging.maxx);
top < 0 ? (top = 0) : top > this.dragging.maxy && (top = this.dragging.maxy); top < topedge ? (top = topedge) : top > this.dragging.maxy && (top = this.dragging.maxy);
this.$window.css({left: left, top: top}); this.$window.css({left: left, top: top});
} }
@ -343,9 +356,10 @@ define([
this.resizing.inith = this.getHeight(); 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)]; 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(), var main_geometry = _readDocumetGeometry(),
main_height = (window.innerHeight == undefined) ? document.documentElement.offsetHeight : Common.Utils.innerHeight(), main_width = main_geometry.width,
maxwidth = (this.initConfig.maxwidth) ? this.initConfig.maxwidth : main_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; maxheight = (this.initConfig.maxheight) ? this.initConfig.maxheight : main_height;
this.resizing.minw = this.initConfig.minwidth; this.resizing.minw = this.initConfig.minwidth;
@ -594,7 +608,7 @@ define([
Common.UI.BaseView.prototype.initialize.call(this, this.initConfig); Common.UI.BaseView.prototype.initialize.call(this, this.initConfig);
}, },
render : function() { render: function() {
var renderto = this.initConfig.renderTo || document.body; var renderto = this.initConfig.renderTo || document.body;
$(renderto).append( $(renderto).append(
_.template(template)(this.initConfig) _.template(template)(this.initConfig)
@ -651,6 +665,22 @@ define([
this.initConfig.footerCls && this.$window.find('.footer').addClass(this.initConfig.footerCls); 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); this.fireEvent('render:after',this);
return this; return this;
}, },

View file

@ -41,10 +41,16 @@ define([
], function () { ], function () {
'use strict'; 'use strict';
var native = window.AscDesktopEditor;
!!native && native.execCommand('webapps:features', JSON.stringify({
version: '{{PRODUCT_VERSION}}',
eventloading: true,
titlebuttons: true
}));
var Desktop = function () { var Desktop = function () {
var config = {version:'{{PRODUCT_VERSION}}'}; var config = {version:'{{PRODUCT_VERSION}}'};
var app = window.AscDesktopEditor, var webapp = window.DE || window.PE || window.SSE;
webapp = window.DE || window.PE || window.SSE;
var titlebuttons; var titlebuttons;
var btnsave_icons = { var btnsave_icons = {
'btn-save': 'save', 'btn-save': 'save',
@ -52,7 +58,7 @@ define([
'btn-synch': 'synch' }; 'btn-synch': 'synch' };
if ( !!app ) { if ( !!native ) {
window.on_native_message = function (cmd, param) { window.on_native_message = function (cmd, param) {
if (/^style:change/.test(cmd)) { if (/^style:change/.test(cmd)) {
var obj = JSON.parse(param); var obj = JSON.parse(param);
@ -81,6 +87,13 @@ define([
Common.NotificationCenter.trigger('app:config', {canUndock:true}); Common.NotificationCenter.trigger('app:config', {canUndock:true});
} }
} }
if (_.isNumber(obj.skiptoparea)) {
if ( $('.asc-window.modal').length && $('.asc-window.modal').position().top < obj.skiptoparea )
$('.asc-window.modal').css('top', obj.skiptoparea);
Common.Utils.InternalSettings.set('window-inactive-area-top', obj.skiptoparea);
}
} else } else
if (/window:status/.test(cmd)) { if (/window:status/.test(cmd)) {
var obj = JSON.parse(param); var obj = JSON.parse(param);
@ -104,7 +117,7 @@ define([
} }
} }
app.execCommand('editor:config', JSON.stringify(opts)); native.execCommand('editor:config', JSON.stringify(opts));
} else } else
if ( !config.callback_editorconfig ) { if ( !config.callback_editorconfig ) {
config.callback_editorconfig = function() { config.callback_editorconfig = function() {
@ -128,14 +141,19 @@ define([
} }
}; };
window.on_native_message('editor:config', 'request');
if ( !!window.native_message_cmd ) { if ( !!window.native_message_cmd ) {
for ( var c in window.native_message_cmd ) { for ( var c in window.native_message_cmd ) {
window.on_native_message(c, window.native_message_cmd[c]); window.on_native_message(c, window.native_message_cmd[c]);
} }
} }
// app.execCommand('window:features', {version: config.version, action: 'request'}); native.execCommand('webapps:features', JSON.stringify({version: config.version, eventloading:true, titlebuttons:true}));
app.execCommand('webapps:features', {version: config.version, eventloading:true, titlebuttons:true});
// hide mask for modal window
var style = document.createElement('style');
style.appendChild(document.createTextNode('.modals-mask{opacity:0 !important;}'));
document.getElementsByTagName('head')[0].appendChild(style);
} }
var _serializeHeaderButton = function(action, config) { var _serializeHeaderButton = function(action, config) {
@ -143,31 +161,30 @@ define([
action: action, action: action,
icon: config.icon || undefined, icon: config.icon || undefined,
hint: config.btn.options.hint, hint: config.btn.options.hint,
disabled: config.disabled disabled: config.btn.isDisabled()
}; };
}; };
var _onTitleButtonDisabled = function (action, e, status) { var _onTitleButtonDisabled = function (action, e, status) {
titlebuttons[action].disabled = status;
var _buttons = {}; var _buttons = {};
_buttons[action] = status; _buttons[action] = status;
app.execCommand('title:button', JSON.stringify({disabled: _buttons})); native.execCommand('title:button', JSON.stringify({disabled: _buttons}));
}; };
var _onSaveIconChanged = function (e, opts) { var _onSaveIconChanged = function (e, opts) {
app.execCommand('title:button', JSON.stringify({'icon:changed': {'save': btnsave_icons[opts.next]}})); native.execCommand('title:button', JSON.stringify({'icon:changed': {'save': btnsave_icons[opts.next]}}));
}; };
var _onModalDialog = function (status) { var _onModalDialog = function (status) {
if ( status == 'open' ) { if ( status == 'open' ) {
app.execCommand('title:button', JSON.stringify({disabled: {'all':true}})); native.execCommand('title:button', JSON.stringify({disabled: {'all':true}}));
} else { } else {
var _buttons = {}; var _buttons = {};
for (var i in titlebuttons) { for (var i in titlebuttons) {
_buttons[i] = titlebuttons[i].disabled; _buttons[i] = titlebuttons[i].btn.isDisabled();
} }
app.execCommand('title:button', JSON.stringify({'disabled': _buttons})); native.execCommand('title:button', JSON.stringify({'disabled': _buttons}));
} }
}; };
@ -178,13 +195,22 @@ define([
if ( config.isDesktopApp ) { if ( config.isDesktopApp ) {
Common.NotificationCenter.on('app:ready', function (opts) { Common.NotificationCenter.on('app:ready', function (opts) {
_.extend(config, opts); _.extend(config, opts);
!!app && app.execCommand('doc:onready', ''); !!native && native.execCommand('doc:onready', '');
$('.toolbar').addClass('editor-native-color'); $('.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) { Common.NotificationCenter.on('action:undocking', function (opts) {
app.execCommand('editor:event', JSON.stringify({action:'undocking', state: opts == 'dock' ? 'dock' : 'undock'})); native.execCommand('editor:event', JSON.stringify({action:'undocking', state: opts == 'dock' ? 'dock' : 'undock'}));
}); });
Common.NotificationCenter.on('app:face', function (mode) { Common.NotificationCenter.on('app:face', function (mode) {
@ -192,32 +218,37 @@ define([
Common.NotificationCenter.trigger('app:config', {canUndock: true}); Common.NotificationCenter.trigger('app:config', {canUndock: true});
} }
var header = webapp.getController('Viewport').getView('Common.Views.Header');
titlebuttons = {}; titlebuttons = {};
if ( !!header.btnSave ) { if ( !mode.isEdit ) {
titlebuttons['save'] = {btn: header.btnSave, disabled:false}; native.execCommand('webapps:features', JSON.stringify(
{version: config.version, eventloading:true, titlebuttons:true, viewmode:true} ));
} else {
var header = webapp.getController('Viewport').getView('Common.Views.Header');
if (!!header.btnSave) {
titlebuttons['save'] = {btn: header.btnSave};
var iconname = /\s?([^\s]+)$/.exec(titlebuttons.save.btn.$icon.attr('class')); var iconname = /\s?([^\s]+)$/.exec(titlebuttons.save.btn.$icon.attr('class'));
!!iconname && iconname.length && (titlebuttons.save.icon = btnsave_icons[iconname]); !!iconname && iconname.length && (titlebuttons.save.icon = btnsave_icons[iconname]);
} }
if ( !!header.btnPrint ) if (!!header.btnPrint)
titlebuttons['print'] = {btn: header.btnPrint, disabled:false}; titlebuttons['print'] = {btn: header.btnPrint};
if ( !!header.btnUndo ) if (!!header.btnUndo)
titlebuttons['undo'] = {btn: header.btnUndo, disabled:false}; titlebuttons['undo'] = {btn: header.btnUndo};
if ( !!header.btnRedo ) if (!!header.btnRedo)
titlebuttons['redo'] = {btn: header.btnRedo, disabled:false}; titlebuttons['redo'] = {btn: header.btnRedo};
for (var i in titlebuttons) { for (var i in titlebuttons) {
titlebuttons[i].btn.options.signals = ['disabled']; titlebuttons[i].btn.options.signals = ['disabled'];
titlebuttons[i].btn.on('disabled', _onTitleButtonDisabled.bind(this, i)); titlebuttons[i].btn.on('disabled', _onTitleButtonDisabled.bind(this, i));
} }
if (!!titlebuttons.save) { if (!!titlebuttons.save) {
titlebuttons.save.btn.options.signals.push('icon:changed'); titlebuttons.save.btn.options.signals.push('icon:changed');
titlebuttons.save.btn.on('icon:changed', _onSaveIconChanged.bind(this)); titlebuttons.save.btn.on('icon:changed', _onSaveIconChanged.bind(this));
}
} }
if ( !!config.callback_editorconfig ) { if ( !!config.callback_editorconfig ) {
@ -233,19 +264,19 @@ define([
} }
}, },
process: function (opts) { process: function (opts) {
if ( config.isDesktopApp && !!app ) { if ( config.isDesktopApp && !!native ) {
if ( opts == 'goback' ) { if ( opts == 'goback' ) {
app.execCommand('go:folder', native.execCommand('go:folder',
config.isOffline ? 'offline' : config.customization.goback.url); config.isOffline ? 'offline' : config.customization.goback.url);
return true; return true;
} else } else
if ( opts == 'preloader:hide' ) { if ( opts == 'preloader:hide' ) {
app.execCommand('editor:onready', ''); native.execCommand('editor:onready', '');
return true; return true;
} else } else
if ( opts == 'create:new' ) { if ( opts == 'create:new' ) {
if (config.createUrl == 'desktop://create.new') { if (config.createUrl == 'desktop://create.new') {
app.LocalFileCreate(!!window.SSE ? 2 : !!window.PE ? 1 : 0); native.LocalFileCreate(!!window.SSE ? 2 : !!window.PE ? 1 : 0);
return true; return true;
} }
} }
@ -254,8 +285,8 @@ define([
return false; return false;
}, },
requestClose: function () { requestClose: function () {
if ( config.isDesktopApp && !!app ) { if ( config.isDesktopApp && !!native ) {
app.execCommand('editor:event', JSON.stringify({action:'close', url: config.customization.goback.url})); native.execCommand('editor:event', JSON.stringify({action:'close', url: config.customization.goback.url}));
} }
} }
}; };

View file

@ -99,7 +99,7 @@ define([
},this), },this),
'show': _.bind(function(cmp){ 'show': _.bind(function(cmp){
var h = this.diagramEditorView.getHeight(), 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) { if (innerHeight>h && h<700 || innerHeight<h) {
h = Math.min(innerHeight, 700); h = Math.min(innerHeight, 700);
this.diagramEditorView.setHeight(h); this.diagramEditorView.setHeight(h);

View file

@ -7,7 +7,7 @@
</div> </div>
<div id="chat-options" class="layout-item"> <div id="chat-options" class="layout-item">
<div id="chat-options-ct"> <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> <button id="chat-msg-btn-add" class="btn normal dlg-btn primary"><%=scope.textSend%></button>
</div> </div>
</div> </div>

View file

@ -14,7 +14,7 @@
<div class="user-message" data-can-copy="true"><%=scope.pickLink(comment)%></div> <div class="user-message" data-can-copy="true"><%=scope.pickLink(comment)%></div>
<% } else { %> <% } else { %>
<div class="inner-edit-ct"> <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 primary btn-inner-edit" id="id-comments-change">textEdit</button>
<button class="btn normal dlg-btn btn-inner-close">textCancel</button> <button class="btn normal dlg-btn btn-inner-close">textCancel</button>
</div> </div>
@ -42,7 +42,7 @@
<%}%> <%}%>
<% } else { %> <% } else { %>
<div class="inner-edit-ct"> <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 primary btn-inner-edit btn-fix" id="id-comments-change">textEdit</button>
<button class="btn normal dlg-btn btn-inner-close">textClose</button> <button class="btn normal dlg-btn btn-inner-close">textClose</button>
</div> </div>
@ -81,7 +81,7 @@
<% if (showReply) { %> <% if (showReply) { %>
<div class="reply-ct"> <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 primary btn-reply" id="id-comments-change">textReply</button>
<button class="btn normal dlg-btn btn-close">textClose</button> <button class="btn normal dlg-btn btn-close">textClose</button>
</div> </div>

View file

@ -5,7 +5,7 @@
</div> </div>
<div style="display: none;" class="layout-item new-comment-ct"> <div style="display: none;" class="layout-item new-comment-ct">
<div class="inner-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%>"/>
</div> </div>
<button class="btn add normal dlg-btn primary"><%=textAddComment%></button> <button class="btn add normal dlg-btn primary"><%=textAddComment%></button>
<button class="btn cancel normal dlg-btn"><%=textCancel%></button> <button class="btn cancel normal dlg-btn"><%=textCancel%></button>

View file

@ -214,6 +214,7 @@ Common.Utils = _.extend(new(function() {
documentSettingsType: documentSettingsType, documentSettingsType: documentSettingsType,
importTextType: importTextType, importTextType: importTextType,
zoom: function() {return me.zoom;}, zoom: function() {return me.zoom;},
topOffset: 0,
innerWidth: function() {return me.innerWidth;}, innerWidth: function() {return me.innerWidth;},
innerHeight: function() {return me.innerHeight;} innerHeight: function() {return me.innerHeight;}
} }
@ -829,6 +830,7 @@ Common.Utils.injectButtons = function($slots, id, iconCls, caption, lock, split,
/x-huge/.test(el.className) && (_cls += ' x-huge icon-top'); /x-huge/.test(el.className) && (_cls += ' x-huge icon-top');
var button = new Common.UI.Button({ var button = new Common.UI.Button({
parentEl: $slots.eq(index),
id: id + index, id: id + index,
cls: _cls, cls: _cls,
iconCls: iconCls, iconCls: iconCls,
@ -838,7 +840,7 @@ Common.Utils.injectButtons = function($slots, id, iconCls, caption, lock, split,
enableToggle: toggle || false, enableToggle: toggle || false,
lock: lock, lock: lock,
disabled: true disabled: true
}).render( $slots.eq(index) ); });
btnsArr.add(button); btnsArr.add(button);
}); });
@ -851,6 +853,30 @@ Common.Utils.injectComponent = function ($slot, cmp) {
} }
}; };
Common.Utils.warningDocumentIsLocked = function (opts) {
if ( opts.disablefunc )
opts.disablefunc(true);
var app = window.DE || window.PE || window.SSE;
var tip = new Common.UI.SynchronizeTip({
extCls : 'simple',
text : Common.Locale.get("warnFileLocked",{name:"Common.Translation", default:'Document is in use by another application. You can continue editing and save it as a copy.'}),
textLink : Common.Locale.get("txtContinueEditing",{name:app.nameSpace + ".Views.SignatureSettings", default:'Edit anyway'}),
placement : 'document'
});
tip.on({
'dontshowclick': function() {
if ( opts.disablefunc ) opts.disablefunc(false);
app.getController('Main').api.asc_setIsReadOnly(false);
this.close();
},
'closeclick': function() {
this.close();
}
});
tip.show();
};
jQuery.fn.extend({ jQuery.fn.extend({
elementById: function (id, parent) { elementById: function (id, parent) {
/** /**
@ -896,6 +922,24 @@ Common.Utils.InternalSettings.set('toolbar-height-tabs', 32);
Common.Utils.InternalSettings.set('toolbar-height-tabs-top-title', 28); Common.Utils.InternalSettings.set('toolbar-height-tabs-top-title', 28);
Common.Utils.InternalSettings.set('toolbar-height-controls', 67); Common.Utils.InternalSettings.set('toolbar-height-controls', 67);
Common.Utils.InternalSettings.set('document-title-height', 28); Common.Utils.InternalSettings.set('document-title-height', 28);
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-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.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

@ -107,22 +107,6 @@ define([
this.content_panels = $window.find('.settings-panel'); this.content_panels = $window.find('.settings-panel');
if (this.btnsCategory.length>0) if (this.btnsCategory.length>0)
this.btnsCategory[0].toggle(true, true); 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) { setHeight: function(height) {

View file

@ -45,10 +45,11 @@ define([
Common.Views.ExternalDiagramEditor = Common.UI.Window.extend(_.extend({ Common.Views.ExternalDiagramEditor = Common.UI.Window.extend(_.extend({
initialize : function(options) { initialize : function(options) {
var _options = {}; var _options = {};
var _inner_height = Common.Utils.innerHeight() - Common.Utils.InternalSettings.get('window-inactive-area-top');
_.extend(_options, { _.extend(_options, {
title: this.textTitle, title: this.textTitle,
width: 910, width: 910,
height: (Common.Utils.innerHeight()-700)<0 ? Common.Utils.innerHeight(): 700, height: (_inner_height - 700)<0 ? _inner_height : 700,
cls: 'advanced-settings-dlg', cls: 'advanced-settings-dlg',
header: true, header: true,
toolclose: 'hide', toolclose: 'hide',
@ -140,11 +141,11 @@ define([
this.$window.find('> .body').css('height', height-header_height); this.$window.find('> .body').css('height', height-header_height);
this.$window.find('> .body > .box').css('height', height-85); 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; var left = (Common.Utils.innerWidth() - parseInt(this.initConfig.width)) / 2;
this.$window.css('left',left); this.$window.css('left',left);
this.$window.css('top',top); this.$window.css('top', Common.Utils.InternalSettings.get('window-inactive-area-top') + top);
} }
}, },

View file

@ -109,14 +109,15 @@ define([
var templateTitleBox = '<section id="box-document-title">' + var templateTitleBox = '<section id="box-document-title">' +
'<div class="extra"></div>' + '<div class="extra"></div>' +
'<div class="hedset">' + '<div class="hedset" id="header-tools">' +
'<div class="btn-slot" id="slot-btn-dt-save"></div>' + '<div class="btn-slot" id="slot-btn-dt-save"></div>' +
'<div class="btn-slot" id="slot-btn-dt-print"></div>' + '<div class="btn-slot" id="slot-btn-dt-print"></div>' +
'<div class="btn-slot" id="slot-btn-dt-undo"></div>' + '<div class="btn-slot" id="slot-btn-dt-undo"></div>' +
'<div class="btn-slot" id="slot-btn-dt-redo"></div>' + '<div class="btn-slot" id="slot-btn-dt-redo"></div>' +
'</div>' + '</div>' +
'<div class="lr-separator"></div>' + '<div class="lr-separator">' +
'<input type="text" id="title-doc-name" spellcheck="false" data-can-copy="false" style="pointer-events: none;" disabled="disabled">' + '<input type="text" id="title-doc-name" spellcheck="false" data-can-copy="false" style="pointer-events: none;" disabled="disabled">' +
'</div>' +
'<label id="title-user-name" style="pointer-events: none;"></label>' + '<label id="title-user-name" style="pointer-events: none;"></label>' +
'</section>'; '</section>';
@ -202,7 +203,19 @@ define([
} }
} }
function onAppShowed(config) {} function onAppShowed(config) {
if ( this.labelDocName && this.labelDocName.get(0).id == 'title-doc-name'
&& this.labelDocName.is(':visible') )
{
var $tools = this.btnSave.$el.parent('#header-tools');
var _left_width = $tools.prev().outerWidth() + $tools.outerWidth();
var _right_width = this.labelUserName.outerWidth();
if ( _left_width < _right_width )
this.labelDocName.css('padding-left', _right_width - _left_width);
else this.labelDocName.css('padding-right', _left_width - _right_width);
}
}
function onAppReady(mode) { function onAppReady(mode) {
appConfig = mode; appConfig = mode;
@ -471,6 +484,8 @@ define([
if ( me.documentCaption ) { if ( me.documentCaption ) {
me.labelDocName.text(me.documentCaption); me.labelDocName.text(me.documentCaption);
} }
} else {
$html.find('#rib-doc-name').hide();
} }
if ( !_.isUndefined(this.options.canRename) ) { if ( !_.isUndefined(this.options.canRename) ) {
@ -511,7 +526,7 @@ define([
var $html = $(_.template(templateTitleBox)()); var $html = $(_.template(templateTitleBox)());
!!me.labelDocName && me.labelDocName.hide().off(); // hide document title if it was created in right box !!me.labelDocName && me.labelDocName.hide().off(); // hide document title if it was created in right box
me.labelDocName = $html.find('> #title-doc-name'); me.labelDocName = $html.find('#title-doc-name');
me.labelDocName.text = function (str) {this.val(str);}; // redefine text function to lock temporaly rename docuemnt option me.labelDocName.text = function (str) {this.val(str);}; // redefine text function to lock temporaly rename docuemnt option
me.labelDocName.text( me.documentCaption ); me.labelDocName.text( me.documentCaption );

View file

@ -103,22 +103,6 @@ define([
$window = this.getChild(); $window = this.getChild();
$window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this)); $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;
}
};
this.spnSize = new Common.UI.MetricSpinner({ this.spnSize = new Common.UI.MetricSpinner({
el : $window.find('#id-dlg-list-size'), el : $window.find('#id-dlg-list-size'),
step : 1, step : 1,
@ -135,24 +119,12 @@ define([
}); });
this.btnColor = new Common.UI.ColorButton({ this.btnColor = new Common.UI.ColorButton({
parentEl: $window.find('#id-dlg-list-color'),
style: "width:53px;", style: "width:53px;",
menu : new Common.UI.Menu({ additionalAlign: this.menuAddAlign
additionalAlign: this.menuAddAlign,
items: [
{ template: _.template('<div id="id-dlg-list-color-menu" style="width: 169px; height: 220px; margin: 10px;"></div>') },
{ template: _.template('<a id="id-dlg-list-color-new" style="padding-left:12px;">' + this.textNewColor + '</a>') }
]
})
}); });
this.btnColor.on('render:after', function(btn) { this.btnColor.on('color:select', _.bind(this.onColorsSelect, this));
me.colors = new Common.UI.ThemeColorPalette({ this.colors = this.btnColor.getPicker();
el: $('#id-dlg-list-color-menu'),
transparent: false
});
me.colors.on('select', _.bind(me.onColorsSelect, me));
});
this.btnColor.render($window.find('#id-dlg-list-color'));
$('#id-dlg-list-color-new').on('click', _.bind(this.addNewColor, this, this.colors));
this.spnStart = new Common.UI.MetricSpinner({ this.spnStart = new Common.UI.MetricSpinner({
el : $window.find('#id-dlg-list-start'), el : $window.find('#id-dlg-list-start'),
@ -188,12 +160,7 @@ define([
this.colors.updateColors(Common.Utils.ThemeColor.getEffectColors(), Common.Utils.ThemeColor.getStandartColors()); this.colors.updateColors(Common.Utils.ThemeColor.getEffectColors(), Common.Utils.ThemeColor.getStandartColors());
}, },
addNewColor: function(picker, btn) { onColorsSelect: function(btn, color) {
picker.addNewColor((typeof(btn.color) == 'object') ? btn.color.color : btn.color);
},
onColorsSelect: function(picker, color) {
this.btnColor.setColor(color);
if (this._changedProps) { if (this._changedProps) {
this._changedProps.asc_putBulletColor(Common.Utils.ThemeColor.getRgbColor(color)); this._changedProps.asc_putBulletColor(Common.Utils.ThemeColor.getRgbColor(color));
} }
@ -287,7 +254,6 @@ define([
txtSize: 'Size', txtSize: 'Size',
txtColor: 'Color', txtColor: 'Color',
txtOfText: '% of text', txtOfText: '% of text',
textNewColor: 'Add New Custom Color',
txtStart: 'Start at', txtStart: 'Start at',
txtBullet: 'Bullet', txtBullet: 'Bullet',
tipChange: 'Change bullet' tipChange: 'Change bullet'

View file

@ -59,7 +59,7 @@ define([
width = 414; width = 414;
height = 277; height = 277;
} else { } else {
width = (options.type !== Common.Utils.importTextType.DRM) ? 340 : (options.warning ? 370 : 262); width = (options.type !== Common.Utils.importTextType.DRM) ? 340 : (options.warning ? 420 : 262);
height = (options.type == Common.Utils.importTextType.CSV || options.type == Common.Utils.importTextType.Paste || options.type == Common.Utils.importTextType.Columns) ? 190 : (options.warning ? 187 : 147); height = (options.type == Common.Utils.importTextType.CSV || options.type == Common.Utils.importTextType.Paste || options.type == Common.Utils.importTextType.Columns) ? 190 : (options.warning ? 187 : 147);
} }
@ -87,7 +87,7 @@ define([
'<div class="icon img-commonctrl warn"/>', '<div class="icon img-commonctrl warn"/>',
'<div style="padding-left: 50px;"><div style="font-size: 12px;">' + t.txtProtected+ '</div>', '<div style="padding-left: 50px;"><div style="font-size: 12px;">' + t.txtProtected+ '</div>',
'<label class="header" style="margin-top: 15px;">' + t.txtPassword + '</label>', '<label class="header" style="margin-top: 15px;">' + t.txtPassword + '</label>',
'<div id="id-password-txt" style="width: 240px;"></div></div>', '<div id="id-password-txt" style="width: 290px;"></div></div>',
'</div>', '</div>',
'<% } else { %>', '<% } else { %>',
'<div>', '<div>',

View file

@ -647,7 +647,8 @@ define([
} }
}, this); }, this);
this.btnChat && this.btnChat.setDisabled(state); this.btnChat && this.btnChat.setDisabled(state);
this.btnCommentRemove && this.btnCommentRemove.setDisabled(state);
this.btnCommentRemove && this.btnCommentRemove.setDisabled(state || !Common.Utils.InternalSettings.get(this.appPrefix + "settings-livecomment"));
}, },
onLostEditRights: function() { onLostEditRights: function() {

View file

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

View file

@ -366,14 +366,24 @@ define([
options: { options: {
resizable : true, resizable : true,
minwidth : 448, minwidth : 448,
minheight : 396, minheight : 434,
width: 448, width: 448,
height: 396, height: 434,
cls: 'modal-dlg', cls: 'modal-dlg',
buttons: ['ok', 'cancel'] buttons: ['ok', 'cancel']
}, },
initialize : function(options) { 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(); var filter = Common.localStorage.getKeysFilter();
this.appPrefix = (filter && filter.length) ? filter.split(',')[0] : ''; this.appPrefix = (filter && filter.length) ? filter.split(',')[0] : '';
@ -385,70 +395,96 @@ define([
} }
size = size ? JSON.parse(size) : []; size = size ? JSON.parse(size) : [];
_.extend(this.options, { this.options = _.extend(config, {
title: this.textTitle, title: this.textTitle,
width : size[0] || 448, width : size[0] || 448,
height : size[1] || 396 height : size[1] || 434
}, options || {}); }, 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 = [ this.template = [
'<div class="box">', '<div class="box">',
'<table cols="2" style="width: 100%;max-width: 497px;">', '<div style="margin-bottom: 16px;" class="'+ (this.special ? '' : 'hidden') +'">',
'<tr>', '<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>',
'<td style="padding-right: 5px;padding-bottom: 8px;width: 50%;">', '<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>',
'<label class="input-label">' + this.textFont + '</label>', '</div>',
'<div id="symbol-table-cmb-fonts"></div>', '<div id="symbol-table-pnl-symbols">',
'</td>', '<table cols="2" style="width: 100%;max-width: 497px;">',
'<td style="padding-left: 5px;padding-bottom: 8px;">', '<tr>',
'<label class="input-label">' + this.textRange + '</label>', '<td style="padding-right: 5px;padding-bottom: 8px;width: 50%;">',
'<div id="symbol-table-cmb-range"></div>', '<label class="input-label">' + this.textFont + '</label>',
'</td>', '<div id="symbol-table-cmb-fonts"></div>',
'</tr>', '</td>',
'</table>', '<td style="padding-left: 5px;padding-bottom: 8px;">',
'<table cols="1" style="width: 100%;">', '<label class="input-label">' + this.textRange + '</label>',
'<tr>', '<div id="symbol-table-cmb-range"></div>',
'<td style="padding-bottom: 16px;">', '</td>',
'<div id="symbol-table-scrollable-div" style="position: relative;height:'+ (this.options.height-264) + 'px;">', '</tr>',
'<div style="width: 100%;">', '</table>',
'<div id="id-preview">', '<table cols="1" style="width: 100%;">',
'<div>', '<tr>',
'<div style="position: absolute; top: 0;"><div id="id-preview-data" tabindex="0" oo_editor_input="true"></div></div>', '<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>',
'</div>', '</div>',
'</div>', '</td>',
'</td>', '</tr>',
'</tr>', '<tr>',
'<tr>', '<td style="padding-bottom: 16px;">',
'<td style="padding-bottom: 16px;">', '<label class="input-label">' + this.textRecent + '</label>',
'<label class="input-label">' + this.textRecent + '</label>', '<div id="symbol-table-recent" tabindex="0" oo_editor_input="true" style="width: 100%;"></div>',
'<div id="symbol-table-recent" tabindex="0" oo_editor_input="true" style="width: 100%;"></div>', '</td>',
'</td>', '</tr>',
'</tr>', '</table>',
'</table>', '<table cols="2" style="width: 100%;max-width: 497px;">',
'<table cols="2" style="width: 100%;max-width: 497px;">', '<tr>',
'<tr>', '<td style="padding-right: 5px; width: 50%;">',
'<td style="padding-right: 5px; width: 50%;">', '<label class="input-label">' + this.textCode + '</label>',
'<label class="input-label">' + this.textCode + '</label>', '</td>',
'</td>', '<td style="padding-left: 5px;">',
'<td style="padding-left: 5px;">', '</td>',
'</td>', '</tr>',
'</tr>', '<tr>',
'<tr>', '<td style="padding-right: 5px;">',
'<td style="padding-right: 5px;">', '<div id="symbol-table-text-code" oo_editor_input="true"></div>',
'<div id="symbol-table-text-code" oo_editor_input="true"></div>', '</td>',
'</td>', '<td style="padding-left: 5px;">',
'<td style="padding-left: 5px;">', '<div id="symbol-table-label-font" style="overflow: hidden; text-overflow: ellipsis;white-space: nowrap;max-width: 160px;"></div>',
'<div id="symbol-table-label-font" style="overflow: hidden; text-overflow: ellipsis;white-space: nowrap;max-width: 160px;"></div>', '</td>',
'</td>', '</tr>',
'</tr>', '</table>',
'</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>' '</div>'
].join(''); ].join('');
this.options.tpl = _.template(this.template)(this.options); 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); var init = (aFontSelects.length<1);
init && this.initFonts(); init && this.initFonts();
@ -579,6 +615,25 @@ define([
var $border = $window.find('.resize-border'); var $border = $window.find('.resize-border');
$border.css({'background': 'none', 'border': 'none'}); $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({ this.cmbFonts = new Common.UI.ComboBox({
el : $window.find('#symbol-table-cmb-fonts'), el : $window.find('#symbol-table-cmb-fonts'),
cls : 'input-group-nr', cls : 'input-group-nr',
@ -663,7 +718,51 @@ define([
this.boxPanel = $window.find('.box'); this.boxPanel = $window.find('.box');
this.updateView(undefined, undefined, undefined, true); 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: '2011'},
{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: 'Alt+Ctrl+C', code: '00A9'},
{symbol: '®', description: this.textRegistered, shortcutKey: 'Alt+Ctrl+R', code: '00AE'},
{symbol: '™', description: this.textTradeMark, shortcutKey: 'Alt+Ctrl+T', code: '2122'},
{symbol: '§', description: this.textSection, shortcutKey: '', code: '00A7'},
{symbol: '¶', description: this.textPilcrow, shortcutKey: '', code: '00B6'},
{symbol: '…', description: this.textEllipsis, shortcutKey: 'Alt+Ctrl+.', 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)); $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() { 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('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); $(document).on('keypress.' + this.cid, '#symbol-table-scrollable-div #id-preview-data, #symbol-table-recent', this.binding.keypressSymbols);
var me = this; var special = this.special && !!Common.Utils.InternalSettings.get(this.appPrefix + "symbol-table-special");
_.delay(function(){ special ? this.btnSpecial.toggle(true) : this.btnSymbols.toggle(true);
me.previewPanel.focus(); this.ShowHideElem(special);
},50);
}, },
close: function(suppressevent) { close: function(suppressevent) {
$(document).off('keydown.' + this.cid, this.binding.keydownSymbols); $(document).off('keydown.' + this.cid, this.binding.keydownSymbols);
$(document).off('keypress.' + this.cid, this.binding.keypressSymbols); $(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); Common.UI.Window.prototype.close.apply(this, arguments);
}, },
@ -701,6 +801,11 @@ define([
return {font: sFont, symbol: this.encodeSurrogateChar(nCurrentSymbol), code: nCurrentSymbol, updateRecents: bUpdateRecents}; 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)};
},
onBtnClick: function(event) { onBtnClick: function(event) {
this._handleInput(event.currentTarget.attributes['result'].value); this._handleInput(event.currentTarget.attributes['result'].value);
}, },
@ -711,13 +816,14 @@ define([
}, },
_handleInput: function(state) { _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) { if (this.options.handler) {
this.options.handler.call(this, this, state, settings); this.options.handler.call(this, this, state, settings);
} }
if (state=='ok') { if (state=='ok') {
settings.updateRecents && this.checkRecent(nCurrentSymbol, settings.font); !special && settings.updateRecents && this.checkRecent(nCurrentSymbol, settings.font);
settings.updateRecents && this.updateRecents(); !special && settings.updateRecents && this.updateRecents();
if (this.type) if (this.type)
return; 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(){ updateRecents: function(){
var oRecentsDiv = this.recentPanel; var oRecentsDiv = this.recentPanel;
oRecentsDiv.empty(); oRecentsDiv.empty();
@ -1304,7 +1419,7 @@ define([
this.curSize = {resize: false, width: size[0], height: size[1]}; this.curSize = {resize: false, width: size[0], height: size[1]};
} else if (this.curSize.resize) { } else if (this.curSize.resize) {
this._preventUpdateScroll = false; 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)), var rows = Math.max(1, ((this.curSize.height/CELL_HEIGHT) >> 0)),
height = rows*CELL_HEIGHT; height = rows*CELL_HEIGHT;
@ -1315,6 +1430,9 @@ define([
this.updateView(undefined, undefined, undefined, true); 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); var valJson = JSON.stringify(size);
Common.localStorage.setItem(this.appPrefix + 'settings-size-symbol-table', valJson); Common.localStorage.setItem(this.appPrefix + 'settings-size-symbol-table', valJson);
Common.Utils.InternalSettings.set(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.resize = true;
this.curSize.width = size[0]; 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)), var rows = Math.max(1, ((this.curSize.height/CELL_HEIGHT) >> 0)),
height = rows*CELL_HEIGHT; height = rows*CELL_HEIGHT;
@ -1339,14 +1457,53 @@ define([
this.previewPanel.css({'height': height + 'px'}); this.previewPanel.css({'height': height + 'px'});
this.previewScrolled.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); 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', textTitle: 'Symbol',
textFont: 'Font', textFont: 'Font',
textRange: 'Range', textRange: 'Range',
textRecent: 'Recently used symbols', 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 || {})) }, 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

Binary file not shown.

After

Width:  |  Height:  |  Size: 285 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 466 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 494 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 171 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 335 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 512 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 550 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 395 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 647 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 958 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 178 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 508 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 421 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 396 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 497 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 291 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 283 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 177 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 468 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 492 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 572 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 342 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 264 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 334 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 184 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 277 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 184 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 251 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 344 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 303 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 B

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