Merge branch 'develop' into feature/special_paste_word

This commit is contained in:
Julia Radzhabova 2017-04-07 10:39:29 +03:00
commit 6f0a3c33e5
103 changed files with 1214 additions and 511 deletions

10
.travis.yml Normal file
View file

@ -0,0 +1,10 @@
dist: trusty
language: node_js
node_js:
- '6'
before_install: npm install -g grunt-cli
before_script:
- cd build
script:
- npm install
- grunt --level=ADVANCED

View file

@ -50,7 +50,6 @@
lang: <language code>, lang: <language code>,
location: <location>, location: <location>,
canCoAuthoring: <can coauthoring documents>, canCoAuthoring: <can coauthoring documents>,
canAutosave: <can autosave documents>,
canBackToFolder: <can return to folder> - deprecated. use "customization.goback" parameter, canBackToFolder: <can return to folder> - deprecated. use "customization.goback" parameter,
createUrl: 'create document url', createUrl: 'create document url',
sharingSettingsUrl: 'document sharing settings url', sharingSettingsUrl: 'document sharing settings url',
@ -113,6 +112,7 @@
rightMenu: true, rightMenu: true,
toolbar: true, toolbar: true,
header: true, header: true,
statusBar: true,
autosave: true, autosave: true,
forcesave: false, forcesave: false,
commentAuthorOnly: false commentAuthorOnly: false
@ -131,8 +131,7 @@
events: { events: {
'onReady': <document ready callback>, 'onReady': <document ready callback>,
'onBack': <back to folder callback>, 'onBack': <back to folder callback>,
'onDocumentStateChange': <document state changed callback>, 'onDocumentStateChange': <document state changed callback>
'onSave': <save request callback>
} }
} }
@ -280,9 +279,6 @@
if (handler) { if (handler) {
res = handler.call(_self, {target: _self, data: msg.data}); res = handler.call(_self, {target: _self, data: msg.data});
if (msg.event === 'onSave' && res !== false) {
_processSaveResult(true);
}
} }
} }
} }

View file

@ -65,7 +65,6 @@
'onRequestEmailAddresses': onRequestEmailAddresses, 'onRequestEmailAddresses': onRequestEmailAddresses,
'onRequestStartMailMerge': onRequestStartMailMerge, 'onRequestStartMailMerge': onRequestStartMailMerge,
'onRequestHistoryClose': onRequestHistoryClose, 'onRequestHistoryClose': onRequestHistoryClose,
'onSave': onDocumentSave,
'onError': onError 'onError': onError
} }
}); });
@ -195,12 +194,6 @@
docEditor.applyEditRights(true, "Someone is editing this document right now. Please try again later."); docEditor.applyEditRights(true, "Someone is editing this document right now. Please try again later.");
} }
function onDocumentSave(event) {
var url = event.data;
// if you want to async save process return false
// and call api.processSaveResult when ready
}
function onError(event) { function onError(event) {
// critical error happened // critical error happened
// examine event.data.errorCode and event.data.errorDescription for details // examine event.data.errorCode and event.data.errorDescription for details

View file

@ -142,13 +142,6 @@ if (Common === undefined) {
_postMessage({ event: 'onReady' }); _postMessage({ event: 'onReady' });
}, },
save: function(url) {
_postMessage({
event: 'onSave',
data: url
});
},
requestEditRights: function() { requestEditRights: function() {
_postMessage({ event: 'onRequestEditRights' }); _postMessage({ event: 'onRequestEditRights' });
}, },

View file

@ -331,7 +331,7 @@ define([
$(document).off('mouseup', onMouseUp); $(document).off('mouseup', onMouseUp);
}; };
var onAfterHideMenu = function(e) { var onAfterHideMenu = function(e, isFromInputControl) {
me.cmpEl.find('.dropdown-toggle').blur(); me.cmpEl.find('.dropdown-toggle').blur();
if (me.cmpEl.hasClass('active') !== me.pressed) if (me.cmpEl.hasClass('active') !== me.pressed)
me.cmpEl.trigger('button.internal.active', [me.pressed]); me.cmpEl.trigger('button.internal.active', [me.pressed]);
@ -416,14 +416,16 @@ define([
setDisabled: function(disabled) { setDisabled: function(disabled) {
if (this.rendered && this.disabled != disabled) { if (this.rendered && this.disabled != disabled) {
var el = this.cmpEl, var el = this.cmpEl,
isGroup = el.hasClass('btn-group'); isGroup = el.hasClass('btn-group'),
me = this;
disabled = (disabled===true); disabled = (disabled===true);
if (disabled !== el.hasClass('disabled')) { if (disabled !== el.hasClass('disabled')) {
var decorateBtn = function(button) { var decorateBtn = function(button) {
button.toggleClass('disabled', disabled); button.toggleClass('disabled', disabled);
(disabled) ? button.attr({disabled: disabled}) : button.removeAttr('disabled'); if (!me.options.allowMouseEventsOnDisabled)
(disabled) ? button.attr({disabled: disabled}) : button.removeAttr('disabled');
}; };
decorateBtn(el); decorateBtn(el);

View file

@ -294,10 +294,10 @@ define([
e.preventDefault(); e.preventDefault();
}, },
onAfterHideMenu: function(e) { onAfterHideMenu: function(e, isFromInputControl) {
this.cmpEl.find('.dropdown-toggle').blur(); this.cmpEl.find('.dropdown-toggle').blur();
this.trigger('hide:after', this, e); this.trigger('hide:after', this, e, isFromInputControl);
Common.NotificationCenter.trigger('menu:hide'); Common.NotificationCenter.trigger('menu:hide', this, isFromInputControl);
}, },
onAfterKeydownMenu: function(e) { onAfterKeydownMenu: function(e) {

View file

@ -59,7 +59,8 @@ define([
enableKeyEvents : false, enableKeyEvents : false,
beforeOpenHandler : null, beforeOpenHandler : null,
additionalMenuItems : null, additionalMenuItems : null,
showLast: true showLast: true,
minWidth: -1
}, },
template: _.template([ template: _.template([
@ -85,6 +86,8 @@ define([
this.rootWidth = 0; this.rootWidth = 0;
this.rootHeight = 0; this.rootHeight = 0;
this.rendered = false; this.rendered = false;
this.needFillComboView = false;
this.minWidth = this.options.minWidth;
this.fieldPicker = new Common.UI.DataView({ this.fieldPicker = new Common.UI.DataView({
cls: 'field-picker', cls: 'field-picker',
@ -209,11 +212,13 @@ define([
}, },
checkSize: function() { checkSize: function() {
if (this.cmpEl) { if (this.cmpEl && this.cmpEl.is(':visible')) {
var me = this, var me = this,
width = this.cmpEl.width(), width = this.cmpEl.width(),
height = this.cmpEl.height(); height = this.cmpEl.height();
if (width < this.minWidth) return;
if (this.rootWidth != width || this.rootHeight != height) { if (this.rootWidth != width || this.rootHeight != height) {
this.rootWidth = width; this.rootWidth = width;
this.rootHeight = height; this.rootHeight = height;
@ -304,10 +309,10 @@ define([
} }
}, },
onAfterHideMenu: function(e) { onAfterHideMenu: function(e, isFromInputControl) {
this.menuPicker.selectedBeforeHideRec = this.menuPicker.getSelectedRec()[0]; // for DataView - onKeyDown - Return key this.menuPicker.selectedBeforeHideRec = this.menuPicker.getSelectedRec()[0]; // for DataView - onKeyDown - Return key
(this.showLast) ? this.menuPicker.showLastSelected() : this.menuPicker.deselectAll(); (this.showLast) ? this.menuPicker.showLastSelected() : this.menuPicker.deselectAll();
this.trigger('hide:after', this, e); this.trigger('hide:after', this, e, isFromInputControl);
}, },
onFieldPickerSelect: function(picker, item, record) { onFieldPickerSelect: function(picker, item, record) {
@ -315,6 +320,7 @@ define([
}, },
onMenuPickerSelect: function(picker, item, record, fromKeyDown) { onMenuPickerSelect: function(picker, item, record, fromKeyDown) {
this.needFillComboView = this.disabled;
if (this.disabled || fromKeyDown===true) return; if (this.disabled || fromKeyDown===true) return;
this.fillComboView(record, false); this.fillComboView(record, false);
@ -375,6 +381,17 @@ define([
this.cmpEl.toggleClass('disabled', disabled); this.cmpEl.toggleClass('disabled', disabled);
$('button', this.openButton.cmpEl).toggleClass('disabled', disabled); $('button', this.openButton.cmpEl).toggleClass('disabled', disabled);
this.fieldPicker.setDisabled(disabled); this.fieldPicker.setDisabled(disabled);
if (this.needFillComboView && !disabled) {
var picker = this.menuPicker;
if (picker) {
var record = picker.getSelectedRec();
if (record) {
record = record[0];
this.fillComboView(record || picker.store.at(0), false);
}
}
}
}, },
isDisabled: function() { isDisabled: function() {
@ -383,6 +400,8 @@ define([
fillComboView: function(record, forceSelect, forceFill) { fillComboView: function(record, forceSelect, forceFill) {
if (!_.isUndefined(record) && record instanceof Backbone.Model){ if (!_.isUndefined(record) && record instanceof Backbone.Model){
this.needFillComboView = false;
var me = this, var me = this,
store = me.menuPicker.store, store = me.menuPicker.store,
fieldPickerEl = $(me.fieldPicker.el); fieldPickerEl = $(me.fieldPicker.el);
@ -405,7 +424,7 @@ define([
var indexRec = store.indexOf(record), var indexRec = store.indexOf(record),
countRec = store.length, countRec = store.length,
maxViewCount = Math.floor((fieldPickerEl.width()) / (me.itemWidth + (me.itemMarginLeft || 0) + (me.itemMarginRight || 0) + (me.itemPaddingLeft || 0) + (me.itemPaddingRight || 0) + maxViewCount = Math.floor(Math.max(fieldPickerEl.width(), me.minWidth) / (me.itemWidth + (me.itemMarginLeft || 0) + (me.itemMarginRight || 0) + (me.itemPaddingLeft || 0) + (me.itemPaddingRight || 0) +
(me.itemBorderLeft || 0) + (me.itemBorderRight || 0))), (me.itemBorderLeft || 0) + (me.itemBorderRight || 0))),
newStyles = []; newStyles = [];

View file

@ -439,9 +439,9 @@ define([
e.preventDefault(); e.preventDefault();
}, },
onAfterHideMenu: function(e) { onAfterHideMenu: function(e, isFromInputControl) {
this.trigger('hide:after', this, e); this.trigger('hide:after', this, e, isFromInputControl);
Common.NotificationCenter.trigger('menu:hide', this); Common.NotificationCenter.trigger('menu:hide', this, isFromInputControl);
}, },
onAfterKeydownMenu: function(e) { onAfterKeydownMenu: function(e) {

View file

@ -63,7 +63,10 @@ define([
'<div class="slider multi-slider-gradient">', '<div class="slider multi-slider-gradient">',
'<div class="track"></div>', '<div class="track"></div>',
'<% _.each(items, function(item) { %>', '<% _.each(items, function(item) { %>',
'<div class="thumb img-commonctrl" style=""></div>', '<div class="thumb img-commonctrl" style="">',
'<div class="thumb-top"></div>',
'<div class="thumb-bottom"></div>',
'</div>',
'<% }); %>', '<% }); %>',
'</div>' '</div>'
].join('')), ].join('')),
@ -98,6 +101,7 @@ define([
me.thumbs[i].thumb.on('dblclick', null, function() { me.thumbs[i].thumb.on('dblclick', null, function() {
me.trigger('thumbdblclick', me); me.trigger('thumbdblclick', me);
}); });
me.thumbs[i].thumbcolor = me.thumbs[i].thumb.find('> div');
} }
if (me.styleStr!=='') { if (me.styleStr!=='') {
@ -118,6 +122,7 @@ define([
setColorValue: function(color, index) { setColorValue: function(color, index) {
var ind = (index!==undefined) ? index : this.currentThumb; var ind = (index!==undefined) ? index : this.currentThumb;
this.colorValues[ind] = color; this.colorValues[ind] = color;
this.thumbs[ind].thumbcolor.css('background-color', color);
this.changeGradientStyle(); this.changeGradientStyle();
}, },
@ -145,6 +150,18 @@ define([
} }
style = Common.Utils.String.format('linear-gradient(to right, {0} {1}%, {2} {3}%)', this.colorValues[0], this.getValue(0), this.colorValues[1], this.getValue(1)); style = Common.Utils.String.format('linear-gradient(to right, {0} {1}%, {2} {3}%)', this.colorValues[0], this.getValue(0), this.colorValues[1], this.getValue(1));
this.trackEl.css('background', style); this.trackEl.css('background', style);
},
sortThumbs: function() {
var recalc_indexes = Common.UI.MultiSlider.prototype.sortThumbs.call(this),
new_colors = [],
me = this;
_.each (recalc_indexes, function(recalc_index) {
new_colors.push(me.colorValues[recalc_index]);
});
this.colorValues = new_colors;
this.trigger('sortthumbs', me, recalc_indexes);
return recalc_indexes;
} }
}); });
}); });

View file

@ -338,16 +338,21 @@ define([
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
var index = e.data, var index = e.data.index,
lastValue = me.thumbs[index].value, lastValue = me.thumbs[index].value,
minValue = (index-1<0) ? 0 : me.thumbs[index-1].position, minValue = (index-1<0) ? 0 : me.thumbs[index-1].position,
maxValue = (index+1<me.thumbs.length) ? me.thumbs[index+1].position : 100, maxValue = (index+1<me.thumbs.length) ? me.thumbs[index+1].position : 100,
pos = Math.max(minValue, Math.min(maxValue, (Math.round((e.pageX*Common.Utils.zoom() - me.cmpEl.offset().left - me._dragstart) / me.width * 100)))), position = Math.round((e.pageX*Common.Utils.zoom() - me.cmpEl.offset().left - me._dragstart) / me.width * 100),
need_sort = position < minValue || position > maxValue,
pos = Math.max(0, Math.min(100, position)),
value = pos/me.delta + me.minValue; value = pos/me.delta + me.minValue;
me.setThumbPosition(index, pos); me.setThumbPosition(index, pos);
me.thumbs[index].value = value; me.thumbs[index].value = value;
if (need_sort)
me.sortThumbs();
$(document).off('mouseup', onMouseUp); $(document).off('mouseup', onMouseUp);
$(document).off('mousemove', onMouseMove); $(document).off('mousemove', onMouseMove);
@ -362,16 +367,21 @@ define([
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
var index = e.data, var index = e.data.index,
lastValue = me.thumbs[index].value, lastValue = me.thumbs[index].value,
minValue = (index-1<0) ? 0 : me.thumbs[index-1].position, minValue = (index-1<0) ? 0 : me.thumbs[index-1].position,
maxValue = (index+1<me.thumbs.length) ? me.thumbs[index+1].position : 100, maxValue = (index+1<me.thumbs.length) ? me.thumbs[index+1].position : 100,
pos = Math.max(minValue, Math.min(maxValue, (Math.round((e.pageX*Common.Utils.zoom() - me.cmpEl.offset().left - me._dragstart) / me.width * 100)))), position = Math.round((e.pageX*Common.Utils.zoom() - me.cmpEl.offset().left - me._dragstart) / me.width * 100),
need_sort = position < minValue || position > maxValue,
pos = Math.max(0, Math.min(100, position)),
value = pos/me.delta + me.minValue; value = pos/me.delta + me.minValue;
me.setThumbPosition(index, pos); me.setThumbPosition(index, pos);
me.thumbs[index].value = value; me.thumbs[index].value = value;
if (need_sort)
me.sortThumbs();
if (Math.abs(value-lastValue)>0.001) if (Math.abs(value-lastValue)>0.001)
me.trigger('change', me, value, lastValue); me.trigger('change', me, value, lastValue);
}; };
@ -379,7 +389,7 @@ define([
var onMouseDown = function (e) { var onMouseDown = function (e) {
if ( me.disabled ) return; if ( me.disabled ) return;
var index = e.data, var index = e.data.index,
thumb = me.thumbs[index].thumb; thumb = me.thumbs[index].thumb;
me._dragstart = e.pageX*Common.Utils.zoom() - thumb.offset().left - thumb.width()/2; me._dragstart = e.pageX*Common.Utils.zoom() - thumb.offset().left - thumb.width()/2;
@ -389,8 +399,8 @@ define([
(index == idx) ? item.thumb.css('z-index', 500) : item.thumb.css('z-index', ''); (index == idx) ? item.thumb.css('z-index', 500) : item.thumb.css('z-index', '');
}); });
$(document).on('mouseup', null, index, onMouseUp); $(document).on('mouseup', null, e.data, onMouseUp);
$(document).on('mousemove', null, index, onMouseMove); $(document).on('mousemove', null, e.data, onMouseMove);
}; };
var onTrackMouseDown = function (e) { var onTrackMouseDown = function (e) {
@ -441,7 +451,7 @@ define([
index: index index: index
}); });
me.setValue(index, me.options.values[index]); me.setValue(index, me.options.values[index]);
thumb.on('mousedown', null, index, onMouseDown); thumb.on('mousedown', null, me.thumbs[index], onMouseDown);
}); });
me.setActiveThumb(0, true); me.setActiveThumb(0, true);
@ -489,6 +499,18 @@ define([
if (disabled !== this.disabled) if (disabled !== this.disabled)
this.cmpEl.toggleClass('disabled', disabled); this.cmpEl.toggleClass('disabled', disabled);
this.disabled = disabled; this.disabled = disabled;
},
sortThumbs: function() {
this.thumbs.sort(function(a, b) {
return (a.position - b.position);
});
var recalc_indexes = [];
_.each (this.thumbs, function(thumb, index) {
recalc_indexes.push(thumb.index);
thumb.index = index;
});
return recalc_indexes;
} }
}); });
}); });

View file

@ -186,13 +186,13 @@ function getParent($this) {
return $parent && $parent.length ? $parent : $this.parent(); return $parent && $parent.length ? $parent : $this.parent();
} }
function clearMenus() { function clearMenus(isFromInputControl) {
$('.dropdown-toggle').each(function (e) { $('.dropdown-toggle').each(function (e) {
var $parent = ($(this)).parent(); var $parent = ($(this)).parent();
if (!$parent.hasClass('open')) return; if (!$parent.hasClass('open')) return;
$parent.trigger(e = $.Event('hide.bs.dropdown')); $parent.trigger(e = $.Event('hide.bs.dropdown'));
if (e.isDefaultPrevented()) return; if (e.isDefaultPrevented()) return;
$parent.removeClass('open').trigger('hidden.bs.dropdown'); $parent.removeClass('open').trigger('hidden.bs.dropdown', isFromInputControl);
}) })
} }
@ -217,7 +217,7 @@ $(document)
function onDropDownClick(e) { function onDropDownClick(e) {
if (e.which == 1 || e.which == undefined) if (e.which == 1 || e.which == undefined)
clearMenus(); clearMenus(/form-control/.test(e.target.className));
} }
if (!!clickDefHandler) { if (!!clickDefHandler) {

View file

@ -1,7 +1,6 @@
<div id="header-container"> <div id="header-container">
<div id="header-logo"></div> <div id="header-logo"></div>
<div id="header-caption"><div><%= headerCaption %></div></div> <div id="header-caption"><div><%= headerCaption %></div></div>
<div id="header-developer" class="hidden"><div><%= headerDeveloper %></div></div>
<div id="header-documentcaption"><div><%= documentCaption %></div></div> <div id="header-documentcaption"><div><%= documentCaption %></div></div>
<div id="header-back" style="display: <%= canBack ? 'table-cell' : 'none' %>;"><div><%= textBack %></div></div> <div id="header-back" style="display: <%= canBack ? 'table-cell' : 'none' %>;"><div><%= textBack %></div></div>
</div> </div>

View file

@ -54,7 +54,6 @@ define([
options : { options : {
branding: {}, branding: {},
headerCaption: 'Default Caption', headerCaption: 'Default Caption',
headerDeveloper: 'DEVELOPER MODE',
documentCaption: '', documentCaption: '',
canBack: false canBack: false
}, },
@ -79,16 +78,15 @@ define([
this.options = this.options ? _({}).extend(this.options, options) : options; this.options = this.options ? _({}).extend(this.options, options) : options;
this.headerCaption = this.options.headerCaption; this.headerCaption = this.options.headerCaption;
this.headerDeveloper = this.txtHeaderDeveloper;
this.documentCaption = this.options.documentCaption; this.documentCaption = this.options.documentCaption;
this.canBack = this.options.canBack; this.canBack = this.options.canBack;
this.branding = this.options.customization; this.branding = this.options.customization;
this.isModified = false;
}, },
render: function () { render: function () {
$(this.el).html(this.template({ $(this.el).html(this.template({
headerCaption : this.headerCaption, headerCaption : this.headerCaption,
headerDeveloper : this.headerDeveloper,
documentCaption : Common.Utils.String.htmlEncode(this.documentCaption), documentCaption : Common.Utils.String.htmlEncode(this.documentCaption),
canBack : this.canBack, canBack : this.canBack,
textBack : this.textBack textBack : this.textBack
@ -158,14 +156,18 @@ define([
return this.headerCaption; return this.headerCaption;
}, },
setDocumentCaption: function(value, applyOnly) { setDocumentCaption: function(value, isModified) {
if (_.isUndefined(applyOnly)) { if (isModified !== undefined)
this.documentCaption = value; this.isModified = isModified;
}
this.documentCaption = value;
if (!value) if (!value)
value = ''; value = '';
if (this.isModified)
value = value + '*';
var dc = $('#header-documentcaption div'); var dc = $('#header-documentcaption div');
if (dc) if (dc)
dc.html(Common.Utils.String.htmlEncode(value)); dc.html(Common.Utils.String.htmlEncode(value));
@ -223,10 +225,6 @@ define([
} }
}, },
setDeveloperMode: function(mode) {
$('#header-developer').toggleClass('hidden', !mode);
},
setCanRename: function(rename) { setCanRename: function(rename) {
var dc = $('#header-documentcaption div'); var dc = $('#header-documentcaption div');
if (rename) { if (rename) {
@ -257,7 +255,6 @@ define([
textBack: 'Go to Documents', textBack: 'Go to Documents',
openNewTabText: 'Open in New Tab', openNewTabText: 'Open in New Tab',
txtHeaderDeveloper: 'DEVELOPER MODE',
txtRename: 'Rename' txtRename: 'Rename'
}, Common.Views.Header || {})) }, Common.Views.Header || {}))
}); });

View file

@ -295,7 +295,7 @@
height: 20px; height: 20px;
line-height: @line-height-base; line-height: @line-height-base;
background-color: #EE3525; background-color: #EE3525;
margin: 18px 25px; margin: 10px 18px;
padding: 2px 10px; padding: 2px 10px;
color: #fff; color: #fff;
overflow: hidden; overflow: hidden;

View file

@ -46,34 +46,6 @@
} }
} }
#header-developer {
background-color: #ffb400;
padding-left: 15px + @app-header-height / 3;
& > div {
position: relative;
background-color: #ffb400;
color: #6e4e00 !important;
padding-right: 15px;
cursor: default;
z-index: 1;
white-space: nowrap;
height: @app-header-height;
line-height: @app-header-height;
&:after {
content: '';
position: absolute;
top: 0;
right: -@app-header-height / 2;
width: @app-header-height / 2;
height: @app-header-height;
border-top: @app-header-height / 2 solid transparent;
border-left: @app-header-height / 3 solid #ffb400;
border-bottom: @app-header-height / 2 solid transparent;
}
}
}
#header-documentcaption { #header-documentcaption {
width: 100%; width: 100%;
max-width: 100px; max-width: 100px;

View file

@ -4,10 +4,41 @@
.thumb { .thumb {
top: 18px; top: 18px;
background-position: @multislide-thumb-offset-x @multislide-thumb-offset-y; background: none;
&.active { .thumb-top {
background-position: @multislide-thumb-offset-x @multislide-thumb-offset-y - 30px; position: absolute;
top: 2px;
left: 2px;
width: 9px;
height: 9px;
background-color: #ffffff;
-moz-transform: rotate(45deg);
-ms-transform: rotate(45deg);
-webkit-transform: rotate(45deg);
-o-transform: rotate(45deg);
transform: rotate(45deg);
border-top: solid 1px @gray-darker;
border-left: solid 1px @gray-darker;
border-radius: 0 3px;
box-sizing: content-box;
}
.thumb-bottom {
position: absolute;
top: 6px;
left: 1px;
width: 10px;
height: 8px;
background-color: #ffffff;
border: solid 1px @gray-darker;
border-top: none;
border-radius: 2px;
box-sizing: content-box;
}
&.active .thumb-bottom {
border-bottom-width: 2px;
} }
} }

View file

@ -120,6 +120,11 @@ define([
row = -1, row = -1,
standartColors = Common.Utils.ThemeColor.getStandartColors(); standartColors = Common.Utils.ThemeColor.getStandartColors();
// Disable duplicate
if ($(me.el).find('.list-block.color-palette').length > 0) {
return
}
_.each(Common.Utils.ThemeColor.getEffectColors(), function(effect, index) { _.each(Common.Utils.ThemeColor.getEffectColors(), function(effect, index) {
if (0 == index % me.options.themecolors) { if (0 == index % me.options.themecolors) {
themeColors.push([]); themeColors.push([]);

View file

@ -174,6 +174,8 @@ define([
if (this.mode.canUseHistory) if (this.mode.canUseHistory)
this.leftMenu.setOptionsPanel('history', this.getApplication().getController('Common.Controllers.History').getView('Common.Views.History')); this.leftMenu.setOptionsPanel('history', this.getApplication().getController('Common.Controllers.History').getView('Common.Views.History'));
this.mode.isTrial && this.leftMenu.setDeveloperMode(true);
Common.util.Shortcuts.resumeEvents(); Common.util.Shortcuts.resumeEvents();
return this; return this;
}, },
@ -184,6 +186,7 @@ define([
this.leftMenu.setOptionsPanel('plugins', this.getApplication().getController('Common.Controllers.Plugins').getView('Common.Views.Plugins')); this.leftMenu.setOptionsPanel('plugins', this.getApplication().getController('Common.Controllers.Plugins').getView('Common.Views.Plugins'));
} else } else
this.leftMenu.btnPlugins.hide(); this.leftMenu.btnPlugins.hide();
this.mode.isTrial && this.leftMenu.setDeveloperMode(true);
}, },
clickMenuFileItem: function(menu, action, isopts) { clickMenuFileItem: function(menu, action, isopts) {

View file

@ -69,7 +69,8 @@ define([
toolbar: '#viewport #toolbar', toolbar: '#viewport #toolbar',
leftMenu: '#viewport #left-menu, #viewport #id-toolbar-full-placeholder-btn-settings, #viewport #id-toolbar-short-placeholder-btn-settings', leftMenu: '#viewport #left-menu, #viewport #id-toolbar-full-placeholder-btn-settings, #viewport #id-toolbar-short-placeholder-btn-settings',
rightMenu: '#viewport #right-menu', rightMenu: '#viewport #right-menu',
header: '#viewport #header' header: '#viewport #header',
statusBar: '#statusbar'
}; };
Common.localStorage.setId('text'); Common.localStorage.setId('text');
@ -103,7 +104,7 @@ define([
weakCompare : function(obj1, obj2){return obj1.type === obj2.type;} weakCompare : function(obj1, obj2){return obj1.type === obj2.type;}
}); });
this._state = {isDisconnected: false, usersCount: 1, fastCoauth: true, startModifyDocument: true, lostEditingRights: false, licenseWarning: false}; this._state = {isDisconnected: false, usersCount: 1, fastCoauth: true, lostEditingRights: false, licenseWarning: false};
// Initialize viewport // Initialize viewport
@ -168,6 +169,8 @@ define([
if (!/area_id/.test(e.target.id)) { if (!/area_id/.test(e.target.id)) {
if (/msg-reply/.test(e.target.className)) if (/msg-reply/.test(e.target.className))
me.dontCloseDummyComment = true; me.dontCloseDummyComment = true;
else if (/chat-msg-text/.test(e.target.id))
me.dontCloseChat = true;
} }
}); });
@ -180,6 +183,8 @@ define([
me.api.asc_enableKeyEvents(true); me.api.asc_enableKeyEvents(true);
if (/msg-reply/.test(e.target.className)) if (/msg-reply/.test(e.target.className))
me.dontCloseDummyComment = false; me.dontCloseDummyComment = false;
else if (/chat-msg-text/.test(e.target.id))
me.dontCloseChat = false;
} }
} }
}).on('dragover', function(e) { }).on('dragover', function(e) {
@ -218,14 +223,23 @@ define([
}, },
'menu:show': function(e){ 'menu:show': function(e){
}, },
'menu:hide': function(e){ 'menu:hide': function(e, isFromInputControl){
if (!me.isModalShowed) if (!me.isModalShowed && !isFromInputControl)
me.api.asc_enableKeyEvents(true); me.api.asc_enableKeyEvents(true);
}, },
'edit:complete': _.bind(me.onEditComplete, me) 'edit:complete': _.bind(me.onEditComplete, me)
}); });
this.initNames(); //for shapes this.initNames(); //for shapes
Common.util.Shortcuts.delegateShortcuts({
shortcuts: {
'command+s,ctrl+s': _.bind(function (e) {
e.preventDefault();
e.stopPropagation();
}, this)
}
});
} }
}, },
@ -574,14 +588,9 @@ define([
if (id==Asc.c_oAscAsyncAction['Save'] || id==Asc.c_oAscAsyncAction['ForceSaveButton']) { if (id==Asc.c_oAscAsyncAction['Save'] || id==Asc.c_oAscAsyncAction['ForceSaveButton']) {
if (this._state.fastCoauth && this._state.usersCount>1) { if (this._state.fastCoauth && this._state.usersCount>1) {
var me = this; var me = this;
if (me._state.timerSave===undefined) me._state.timerSave = setTimeout(function () {
me._state.timerSave = setInterval(function(){ me.getApplication().getController('Statusbar').setStatusCaption(me.textChangesSaved, false, 3000);
if ((new Date()) - me._state.isSaving>500) { }, 500);
clearInterval(me._state.timerSave);
me.getApplication().getController('Statusbar').setStatusCaption(me.textChangesSaved, false, 3000);
me._state.timerSave = undefined;
}
}, 500);
} else } else
this.getApplication().getController('Statusbar').setStatusCaption(this.textChangesSaved, false, 3000); this.getApplication().getController('Statusbar').setStatusCaption(this.textChangesSaved, false, 3000);
} else } else
@ -596,7 +605,7 @@ define([
if ( type == Asc.c_oAscAsyncActionType.BlockInteraction && if ( type == Asc.c_oAscAsyncActionType.BlockInteraction &&
(!this.getApplication().getController('LeftMenu').dlgSearch || !this.getApplication().getController('LeftMenu').dlgSearch.isVisible()) && (!this.getApplication().getController('LeftMenu').dlgSearch || !this.getApplication().getController('LeftMenu').dlgSearch.isVisible()) &&
!( id == Asc.c_oAscAsyncAction['ApplyChanges'] && this.dontCloseDummyComment ) ) { !( id == Asc.c_oAscAsyncAction['ApplyChanges'] && (this.dontCloseDummyComment || this.dontCloseChat)) ) {
// this.onEditComplete(this.loadMask); //если делать фокус, то при принятии чужих изменений, заканчивается свой композитный ввод // this.onEditComplete(this.loadMask); //если делать фокус, то при принятии чужих изменений, заканчивается свой композитный ввод
this.api.asc_enableKeyEvents(true); this.api.asc_enableKeyEvents(true);
} }
@ -613,7 +622,7 @@ define([
case Asc.c_oAscAsyncAction['Save']: case Asc.c_oAscAsyncAction['Save']:
case Asc.c_oAscAsyncAction['ForceSaveButton']: case Asc.c_oAscAsyncAction['ForceSaveButton']:
this._state.isSaving = new Date(); clearTimeout(this._state.timerSave);
force = true; force = true;
title = this.saveTitleText; title = this.saveTitleText;
text = this.saveTextText; text = this.saveTextText;
@ -965,7 +974,7 @@ define([
this.appOptions.canUseHistory = this.appOptions.canLicense && !this.appOptions.isLightVersion && this.editorConfig.canUseHistory && this.appOptions.canCoAuthoring && !this.appOptions.isDesktopApp; this.appOptions.canUseHistory = this.appOptions.canLicense && !this.appOptions.isLightVersion && this.editorConfig.canUseHistory && this.appOptions.canCoAuthoring && !this.appOptions.isDesktopApp;
this.appOptions.canHistoryClose = this.editorConfig.canHistoryClose; this.appOptions.canHistoryClose = this.editorConfig.canHistoryClose;
this.appOptions.canHistoryRestore= this.editorConfig.canHistoryRestore && !!this.permissions.changeHistory; this.appOptions.canHistoryRestore= this.editorConfig.canHistoryRestore && !!this.permissions.changeHistory;
this.appOptions.canUseMailMerge= this.appOptions.canLicense && this.appOptions.canEdit && !this.appOptions.isDesktopApp; this.appOptions.canUseMailMerge= this.appOptions.canLicense && this.appOptions.canEdit && /*!this.appOptions.isDesktopApp*/ !this.appOptions.isOffline;
this.appOptions.canSendEmailAddresses = this.appOptions.canLicense && this.editorConfig.canSendEmailAddresses && this.appOptions.canEdit && this.appOptions.canCoAuthoring; this.appOptions.canSendEmailAddresses = this.appOptions.canLicense && this.editorConfig.canSendEmailAddresses && this.appOptions.canEdit && this.appOptions.canCoAuthoring;
this.appOptions.canComments = (licType === Asc.c_oLicenseResult.Success || licType === Asc.c_oLicenseResult.SuccessLimit) && !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.comments===false); this.appOptions.canComments = (licType === Asc.c_oLicenseResult.Success || licType === Asc.c_oLicenseResult.SuccessLimit) && !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.comments===false);
this.appOptions.canChat = (licType === Asc.c_oLicenseResult.Success || licType === Asc.c_oLicenseResult.SuccessLimit) && !this.appOptions.isOffline && !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.chat===false); this.appOptions.canChat = (licType === Asc.c_oLicenseResult.Success || licType === Asc.c_oLicenseResult.SuccessLimit) && !this.appOptions.isOffline && !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.chat===false);
@ -976,6 +985,7 @@ define([
this.appOptions.canForcesave = this.appOptions.isEdit && !this.appOptions.isOffline && (typeof (this.editorConfig.customization) == 'object' && !!this.editorConfig.customization.forcesave); this.appOptions.canForcesave = this.appOptions.isEdit && !this.appOptions.isOffline && (typeof (this.editorConfig.customization) == 'object' && !!this.editorConfig.customization.forcesave);
this.appOptions.forcesave = this.appOptions.canForcesave; this.appOptions.forcesave = this.appOptions.canForcesave;
this.appOptions.canEditComments= this.appOptions.isOffline || !(typeof (this.editorConfig.customization) == 'object' && this.editorConfig.customization.commentAuthorOnly); this.appOptions.canEditComments= this.appOptions.isOffline || !(typeof (this.editorConfig.customization) == 'object' && this.editorConfig.customization.commentAuthorOnly);
this.appOptions.isTrial = params.asc_getTrial();
var type = /^(?:(pdf|djvu|xps))$/.exec(this.document.fileType); var type = /^(?:(pdf|djvu|xps))$/.exec(this.document.fileType);
this.appOptions.canDownloadOrigin = !this.appOptions.nativeApp && this.permissions.download !== false && (type && typeof type[1] === 'string'); this.appOptions.canDownloadOrigin = !this.appOptions.nativeApp && this.permissions.download !== false && (type && typeof type[1] === 'string');
@ -988,7 +998,6 @@ define([
if (this.appOptions.canBranding) if (this.appOptions.canBranding)
headerView.setBranding(this.editorConfig.customization); headerView.setBranding(this.editorConfig.customization);
params.asc_getTrial() && headerView.setDeveloperMode(true);
this.appOptions.canRename && headerView.setCanRename(true); this.appOptions.canRename && headerView.setCanRename(true);
this.appOptions.canBrandingExt = params.asc_getCanBranding() && (typeof this.editorConfig.customization == 'object' || this.editorConfig.plugins); this.appOptions.canBrandingExt = params.asc_getCanBranding() && (typeof this.editorConfig.customization == 'object' || this.editorConfig.plugins);
@ -1106,7 +1115,6 @@ define([
me.api.asc_registerCallback('asc_onDocumentModifiedChanged', _.bind(me.onDocumentModifiedChanged, me)); me.api.asc_registerCallback('asc_onDocumentModifiedChanged', _.bind(me.onDocumentModifiedChanged, me));
me.api.asc_registerCallback('asc_onDocumentCanSaveChanged', _.bind(me.onDocumentCanSaveChanged, me)); me.api.asc_registerCallback('asc_onDocumentCanSaveChanged', _.bind(me.onDocumentCanSaveChanged, me));
me.api.asc_registerCallback('asc_onSaveUrl', _.bind(me.onSaveUrl, me));
/** coauthoring begin **/ /** coauthoring begin **/
me.api.asc_registerCallback('asc_onCollaborativeChanges', _.bind(me.onCollaborativeChanges, me)); me.api.asc_registerCallback('asc_onCollaborativeChanges', _.bind(me.onCollaborativeChanges, me));
me.api.asc_registerCallback('asc_OnTryUndoInFastCollaborative',_.bind(me.onTryUndoInFastCollaborative, me)); me.api.asc_registerCallback('asc_OnTryUndoInFastCollaborative',_.bind(me.onTryUndoInFastCollaborative, me));
@ -1259,6 +1267,10 @@ define([
config.msg = this.errorAccessDeny; config.msg = this.errorAccessDeny;
break; break;
case Asc.c_oAscError.ID.UplImageUrl:
config.msg = this.errorBadImageUrl;
break;
default: default:
config.msg = this.errorDefaultMessage.replace('%1', id); config.msg = this.errorDefaultMessage.replace('%1', id);
break; break;
@ -1355,33 +1367,32 @@ define([
title = headerView.getDocumentCaption() + ' - ' + title; title = headerView.getDocumentCaption() + ' - ' + title;
if (isModified) { if (isModified) {
if (!_.isUndefined(title) && (!this._state.fastCoauth || this._state.usersCount<2 )) { clearTimeout(this._state.timerCaption);
if (!_.isUndefined(title)) {
title = '* ' + title; title = '* ' + title;
headerView.setDocumentCaption(headerView.getDocumentCaption() + '*', true); headerView.setDocumentCaption(headerView.getDocumentCaption(), true);
} }
} else { } else {
headerView.setDocumentCaption(headerView.getDocumentCaption()); if (this._state.fastCoauth && this._state.usersCount>1) {
this._state.timerCaption = setTimeout(function () {
headerView.setDocumentCaption(headerView.getDocumentCaption(), false);
}, 500);
} else
headerView.setDocumentCaption(headerView.getDocumentCaption(), false);
} }
if (window.document.title != title) if (window.document.title != title)
window.document.title = title; window.document.title = title;
if (!this._state.fastCoauth || this._state.usersCount<2 ) { Common.Gateway.setDocumentModified(isModified);
Common.Gateway.setDocumentModified(isModified); if (isModified && (!this._state.fastCoauth || this._state.usersCount<2))
if (isModified) this.getApplication().getController('Statusbar').setStatusCaption('', true);
this.getApplication().getController('Statusbar').setStatusCaption('', true);
} else if ( this._state.startModifyDocument!==undefined && this._state.startModifyDocument === isModified){
Common.Gateway.setDocumentModified(isModified);
this._state.startModifyDocument = (this._state.startModifyDocument) ? !this._state.startModifyDocument : undefined;
}
this._state.isDocModified = isModified; this._state.isDocModified = isModified;
} }
}, },
onDocumentModifiedChanged: function() { onDocumentModifiedChanged: function() {
if (this._state.fastCoauth && this._state.usersCount>1 && this._state.startModifyDocument===undefined ) return;
var isModified = this.api.asc_isDocumentCanSave(); var isModified = this.api.asc_isDocumentCanSave();
if (this._state.isDocModified !== isModified) { if (this._state.isDocModified !== isModified) {
Common.Gateway.setDocumentModified(this.api.isDocumentModified()); Common.Gateway.setDocumentModified(this.api.isDocumentModified());
@ -1467,10 +1478,6 @@ define([
$('#loading-mask').hide().remove(); $('#loading-mask').hide().remove();
}, },
onSaveUrl: function(url) {
Common.Gateway.save(url);
},
onDownloadUrl: function(url) { onDownloadUrl: function(url) {
if (this._state.isFromGatewayDownloadAs) if (this._state.isFromGatewayDownloadAs)
Common.Gateway.downloadAs(url); Common.Gateway.downloadAs(url);
@ -2122,7 +2129,8 @@ define([
errorAccessDeny: 'You are trying to perform an action you do not have rights for.<br>Please contact your Document Server administrator.', errorAccessDeny: 'You are trying to perform an action you do not have rights for.<br>Please contact your Document Server administrator.',
titleServerVersion: 'Editor updated', titleServerVersion: 'Editor updated',
errorServerVersion: 'The editor version has been updated. The page will be reloaded to apply the changes.', errorServerVersion: 'The editor version has been updated. The page will be reloaded to apply the changes.',
textChangesSaved: 'All changes saved' textChangesSaved: 'All changes saved',
errorBadImageUrl: 'Image url is incorrect'
} }
})(), DE.Controllers.Main || {})) })(), DE.Controllers.Main || {}))
}); });

View file

@ -672,7 +672,7 @@ define([
toolbar.mnuInsertPageNum.setDisabled(need_disable); toolbar.mnuInsertPageNum.setDisabled(need_disable);
} }
need_disable = paragraph_locked || header_locked || in_header || in_equation && !btn_eq_state; need_disable = paragraph_locked || header_locked || in_header || in_equation && !btn_eq_state || this.api.asc_IsCursorInFootnote();
if (need_disable != toolbar.btnInsertPageBreak.isDisabled()) { if (need_disable != toolbar.btnInsertPageBreak.isDisabled()) {
toolbar.btnInsertPageBreak.setDisabled(need_disable); toolbar.btnInsertPageBreak.setDisabled(need_disable);
} }

View file

@ -166,7 +166,7 @@ define([
if (this._isChartStylesChanged) { if (this._isChartStylesChanged) {
if (rec) if (rec)
this.cmbChartStyle.fillComboView(this.cmbChartStyle.menuPicker.getSelectedRec(),true); this.cmbChartStyle.fillComboView(this.cmbChartStyle.menuPicker.getSelectedRec()[0],true);
else else
this.cmbChartStyle.fillComboView(this.cmbChartStyle.menuPicker.store.at(0), true); this.cmbChartStyle.fillComboView(this.cmbChartStyle.menuPicker.store.at(0), true);
} }

View file

@ -2199,8 +2199,8 @@ define([
{ caption: '--' }, { caption: '--' },
menuImageAdvanced menuImageAdvanced
] ]
}).on('hide:after', function(menu) { }).on('hide:after', function(menu, e, isFromInputControl) {
me.fireEvent('editcomplete', me); if (!isFromInputControl) me.fireEvent('editcomplete', me);
me.currentMenu = null; me.currentMenu = null;
}); });
@ -2767,13 +2767,13 @@ define([
menuHyperlinkSeparator, menuHyperlinkSeparator,
menuParagraphAdvancedInTable menuParagraphAdvancedInTable
] ]
}).on('hide:after', function(menu) { }).on('hide:after', function(menu, e, isFromInputControl) {
if (me.suppressEditComplete) { if (me.suppressEditComplete) {
me.suppressEditComplete = false; me.suppressEditComplete = false;
return; return;
} }
me.fireEvent('editcomplete', me); if (!isFromInputControl) me.fireEvent('editcomplete', me);
me.currentMenu = null; me.currentMenu = null;
}); });
@ -3146,13 +3146,13 @@ define([
menuStyleSeparator, menuStyleSeparator,
menuStyle menuStyle
] ]
}).on('hide:after', function(menu, e) { }).on('hide:after', function(menu, e, isFromInputControl) {
if (me.suppressEditComplete) { if (me.suppressEditComplete) {
me.suppressEditComplete = false; me.suppressEditComplete = false;
return; return;
} }
me.fireEvent('editcomplete', me); if (!isFromInputControl) me.fireEvent('editcomplete', me);
me.currentMenu = null; me.currentMenu = null;
}); });
@ -3178,8 +3178,8 @@ define([
items: [ items: [
menuEditHeaderFooter menuEditHeaderFooter
] ]
}).on('hide:after', function(menu) { }).on('hide:after', function(menu, e, isFromInputControl) {
me.fireEvent('editcomplete', me); if (!isFromInputControl) me.fireEvent('editcomplete', me);
me.currentMenu = null; me.currentMenu = null;
}); });

View file

@ -358,6 +358,24 @@ define([
Common.NotificationCenter.trigger('layout:changed', 'history'); Common.NotificationCenter.trigger('layout:changed', 'history');
}, },
setDeveloperMode: function(mode) {
if ( !this.$el.is(':visible') ) return;
if (!this.developerHint) {
this.developerHint = $('<div id="developer-hint">' + this.txtDeveloper + '</div>').appendTo(this.$el);
this.devHeight = this.developerHint.outerHeight();
$(window).on('resize', _.bind(this.onWindowResize, this));
}
this.developerHint.toggleClass('hidden', !mode);
var lastbtn = this.$el.find('button.btn-category:visible:last-of-type');
this.minDevPosition = lastbtn.offset().top - lastbtn.offsetParent().offset().top + lastbtn.height() + 20;
this.onWindowResize();
},
onWindowResize: function() {
this.developerHint.css('top', Math.max((this.$el.height()-this.devHeight)/2, this.minDevPosition));
},
/** coauthoring begin **/ /** coauthoring begin **/
tipComments : 'Comments', tipComments : 'Comments',
tipChat : 'Chat', tipChat : 'Chat',
@ -366,6 +384,7 @@ define([
tipSupport : 'Feedback & Support', tipSupport : 'Feedback & Support',
tipFile : 'File', tipFile : 'File',
tipSearch : 'Search', tipSearch : 'Search',
tipPlugins : 'Plugins' tipPlugins : 'Plugins',
txtDeveloper: 'DEVELOPER MODE'
}, DE.Views.LeftMenu || {})); }, DE.Views.LeftMenu || {}));
}); });

View file

@ -457,8 +457,8 @@ define([
this.mnuColorPicker.updateColors(Common.Utils.ThemeColor.getEffectColors(), Common.Utils.ThemeColor.getStandartColors()); this.mnuColorPicker.updateColors(Common.Utils.ThemeColor.getEffectColors(), Common.Utils.ThemeColor.getStandartColors());
}, },
onHideMenus: function(e){ onHideMenus: function(menu, e, isFromInputControl){
this.fireEvent('editcomplete', this); if (!isFromInputControl) this.fireEvent('editcomplete', this);
}, },
setLocked: function (locked) { setLocked: function (locked) {

View file

@ -79,42 +79,48 @@ define([
asctype: Common.Utils.documentSettingsType.Paragraph, asctype: Common.Utils.documentSettingsType.Paragraph,
enableToggle: true, enableToggle: true,
disabled: true, disabled: true,
toggleGroup: 'tabpanelbtnsGroup' toggleGroup: 'tabpanelbtnsGroup',
allowMouseEventsOnDisabled: true
}); });
this.btnTable = new Common.UI.Button({ this.btnTable = new Common.UI.Button({
hint: this.txtTableSettings, hint: this.txtTableSettings,
asctype: Common.Utils.documentSettingsType.Table, asctype: Common.Utils.documentSettingsType.Table,
enableToggle: true, enableToggle: true,
disabled: true, disabled: true,
toggleGroup: 'tabpanelbtnsGroup' toggleGroup: 'tabpanelbtnsGroup',
allowMouseEventsOnDisabled: true
}); });
this.btnImage = new Common.UI.Button({ this.btnImage = new Common.UI.Button({
hint: this.txtImageSettings, hint: this.txtImageSettings,
asctype: Common.Utils.documentSettingsType.Image, asctype: Common.Utils.documentSettingsType.Image,
enableToggle: true, enableToggle: true,
disabled: true, disabled: true,
toggleGroup: 'tabpanelbtnsGroup' toggleGroup: 'tabpanelbtnsGroup',
allowMouseEventsOnDisabled: true
}); });
this.btnHeaderFooter = new Common.UI.Button({ this.btnHeaderFooter = new Common.UI.Button({
hint: this.txtHeaderFooterSettings, hint: this.txtHeaderFooterSettings,
asctype: Common.Utils.documentSettingsType.Header, asctype: Common.Utils.documentSettingsType.Header,
enableToggle: true, enableToggle: true,
disabled: true, disabled: true,
toggleGroup: 'tabpanelbtnsGroup' toggleGroup: 'tabpanelbtnsGroup',
allowMouseEventsOnDisabled: true
}); });
this.btnChart = new Common.UI.Button({ this.btnChart = new Common.UI.Button({
hint: this.txtChartSettings, hint: this.txtChartSettings,
asctype: Common.Utils.documentSettingsType.Chart, asctype: Common.Utils.documentSettingsType.Chart,
enableToggle: true, enableToggle: true,
disabled: true, disabled: true,
toggleGroup: 'tabpanelbtnsGroup' toggleGroup: 'tabpanelbtnsGroup',
allowMouseEventsOnDisabled: true
}); });
this.btnShape = new Common.UI.Button({ this.btnShape = new Common.UI.Button({
hint: this.txtShapeSettings, hint: this.txtShapeSettings,
asctype: Common.Utils.documentSettingsType.Shape, asctype: Common.Utils.documentSettingsType.Shape,
enableToggle: true, enableToggle: true,
disabled: true, disabled: true,
toggleGroup: 'tabpanelbtnsGroup' toggleGroup: 'tabpanelbtnsGroup',
allowMouseEventsOnDisabled: true
}); });
this.btnTextArt = new Common.UI.Button({ this.btnTextArt = new Common.UI.Button({
@ -122,7 +128,8 @@ define([
asctype: Common.Utils.documentSettingsType.TextArt, asctype: Common.Utils.documentSettingsType.TextArt,
enableToggle: true, enableToggle: true,
disabled: true, disabled: true,
toggleGroup: 'tabpanelbtnsGroup' toggleGroup: 'tabpanelbtnsGroup',
allowMouseEventsOnDisabled: true
}); });
this._settings = []; this._settings = [];

View file

@ -1341,6 +1341,18 @@ define([
this.sldrGradient.on('thumbdblclick', function(cmp){ this.sldrGradient.on('thumbdblclick', function(cmp){
me.btnGradColor.cmpEl.find('button').dropdown('toggle'); me.btnGradColor.cmpEl.find('button').dropdown('toggle');
}); });
this.sldrGradient.on('sortthumbs', function(cmp, recalc_indexes){
var colors = [],
currentIdx;
_.each (recalc_indexes, function(recalc_index, index) {
colors.push(me.GradColor.colors[recalc_index]);
if (me.GradColor.currentIdx == recalc_index)
currentIdx = index;
});
me.OriginalFillType = null;
me.GradColor.colors = colors;
me.GradColor.currentIdx = currentIdx;
});
this.fillControls.push(this.sldrGradient); this.fillControls.push(this.sldrGradient);
this.cmbBorderSize = new Common.UI.ComboBorderSizeEditable({ this.cmbBorderSize = new Common.UI.ComboBorderSizeEditable({

View file

@ -276,6 +276,8 @@ define([
this.panelUsers = $('#status-users-ct', this.el); this.panelUsers = $('#status-users-ct', this.el);
this.panelUsers.on('shown.bs.dropdown', function () { this.panelUsers.on('shown.bs.dropdown', function () {
me.panelUsersList.scroller.update({minScrollbarLength : 40, alwaysVisibleY: true}); me.panelUsersList.scroller.update({minScrollbarLength : 40, alwaysVisibleY: true});
var tip = me.panelUsersBlock.data('bs.tooltip');
if (tip) tip.hide();
}); });
this.panelUsersBlock = this.panelUsers.find('#status-users-block'); this.panelUsersBlock = this.panelUsers.find('#status-users-block');

View file

@ -430,7 +430,7 @@ define([
if (this._initSettings) if (this._initSettings)
this.createDelayedElements(); this.createDelayedElements();
this.disableControls(this._locked); this.disableControls(this._locked); // need to update combodataview after disabled state
if (props ) if (props )
{ {
@ -461,7 +461,7 @@ define([
if (this._isTemplatesChanged) { if (this._isTemplatesChanged) {
if (rec) if (rec)
this.cmbTableTemplate.fillComboView(this.cmbTableTemplate.menuPicker.getSelectedRec(),true); this.cmbTableTemplate.fillComboView(this.cmbTableTemplate.menuPicker.getSelectedRec()[0],true);
else else
this.cmbTableTemplate.fillComboView(this.cmbTableTemplate.menuPicker.store.at(0), true); this.cmbTableTemplate.fillComboView(this.cmbTableTemplate.menuPicker.store.at(0), true);
} }

View file

@ -916,6 +916,18 @@ define([
this.sldrGradient.on('thumbdblclick', function(cmp){ this.sldrGradient.on('thumbdblclick', function(cmp){
me.btnGradColor.cmpEl.find('button').dropdown('toggle'); me.btnGradColor.cmpEl.find('button').dropdown('toggle');
}); });
this.sldrGradient.on('sortthumbs', function(cmp, recalc_indexes){
var colors = [],
currentIdx;
_.each (recalc_indexes, function(recalc_index, index) {
colors.push(me.GradColor.colors[recalc_index]);
if (me.GradColor.currentIdx == recalc_index)
currentIdx = index;
});
me.OriginalFillType = null;
me.GradColor.colors = colors;
me.GradColor.currentIdx = currentIdx;
});
this.lockedControls.push(this.sldrGradient); this.lockedControls.push(this.sldrGradient);
this.cmbBorderSize = new Common.UI.ComboBorderSizeEditable({ this.cmbBorderSize = new Common.UI.ComboBorderSizeEditable({

View file

@ -1206,7 +1206,9 @@ define([
); );
if (this.mode.isDesktopApp || this.mode.canBrandingExt && this.mode.customization && this.mode.customization.header===false) if (this.mode.isDesktopApp || this.mode.canBrandingExt && this.mode.customization && this.mode.customization.header===false)
this.mnuitemHideTitleBar.hide(); this.mnuitemHideTitleBar.hide();
if (this.mode.canBrandingExt && this.mode.customization && this.mode.customization.statusBar===false)
this.mnuitemHideStatusBar.hide();
this.btnMarkers.setMenu( this.btnMarkers.setMenu(
new Common.UI.Menu({ new Common.UI.Menu({
items: [ items: [

View file

@ -141,7 +141,7 @@
"Common.Views.ExternalMergeEditor.textTitle": "Mail Merge Recipients", "Common.Views.ExternalMergeEditor.textTitle": "Mail Merge Recipients",
"Common.Views.Header.openNewTabText": "Open in New Tab", "Common.Views.Header.openNewTabText": "Open in New Tab",
"Common.Views.Header.textBack": "Go to Documents", "Common.Views.Header.textBack": "Go to Documents",
"Common.Views.Header.txtHeaderDeveloper": "DEVELOPER MODE", "del_Common.Views.Header.txtHeaderDeveloper": "DEVELOPER MODE",
"Common.Views.Header.txtRename": "Rename", "Common.Views.Header.txtRename": "Rename",
"Common.Views.History.textCloseHistory": "Close History", "Common.Views.History.textCloseHistory": "Close History",
"Common.Views.History.textHide": "Collapse", "Common.Views.History.textHide": "Collapse",
@ -301,6 +301,7 @@
"DE.Controllers.Main.titleServerVersion": "Editor updated", "DE.Controllers.Main.titleServerVersion": "Editor updated",
"DE.Controllers.Main.errorServerVersion": "The editor version has been updated. The page will be reloaded to apply the changes.", "DE.Controllers.Main.errorServerVersion": "The editor version has been updated. The page will be reloaded to apply the changes.",
"DE.Controllers.Main.textChangesSaved": "All changes saved", "DE.Controllers.Main.textChangesSaved": "All changes saved",
"DE.Controllers.Main.errorBadImageUrl": "Image URL is incorrect",
"DE.Controllers.Statusbar.textHasChanges": "New changes have been tracked", "DE.Controllers.Statusbar.textHasChanges": "New changes have been tracked",
"DE.Controllers.Statusbar.textTrackChanges": "The document is opened with the Track Changes mode enabled", "DE.Controllers.Statusbar.textTrackChanges": "The document is opened with the Track Changes mode enabled",
"DE.Controllers.Statusbar.zoomText": "Zoom {0}%", "DE.Controllers.Statusbar.zoomText": "Zoom {0}%",
@ -1089,6 +1090,7 @@
"DE.Views.LeftMenu.tipSearch": "Search", "DE.Views.LeftMenu.tipSearch": "Search",
"DE.Views.LeftMenu.tipSupport": "Feedback & Support", "DE.Views.LeftMenu.tipSupport": "Feedback & Support",
"DE.Views.LeftMenu.tipTitles": "Titles", "DE.Views.LeftMenu.tipTitles": "Titles",
"DE.Views.LeftMenu.txtDeveloper": "DEVELOPER MODE",
"DE.Views.MailMergeEmailDlg.cancelButtonText": "Cancel", "DE.Views.MailMergeEmailDlg.cancelButtonText": "Cancel",
"DE.Views.MailMergeEmailDlg.filePlaceholder": "PDF", "DE.Views.MailMergeEmailDlg.filePlaceholder": "PDF",
"DE.Views.MailMergeEmailDlg.okButtonText": "Send", "DE.Views.MailMergeEmailDlg.okButtonText": "Send",

View file

@ -430,3 +430,19 @@ button.notify .btn-menu-comments {background-position: -0*@toolbar-icon-size -60
font: 12px tahoma, arial, verdana, sans-serif; font: 12px tahoma, arial, verdana, sans-serif;
} }
} }
#developer-hint {
position: absolute;
left: 0;
padding: 12px 0;
background-color: #ffb400;
color: #6e4e00 !important;
white-space: nowrap;
line-height: @app-header-height;
writing-mode: vertical-rl;
-moz-transform: rotate(180deg);
-ms-transform: rotate(180deg);
-webkit-transform: rotate(180deg);
-o-transform: rotate(180deg);
transform: rotate(180deg);
}

View file

@ -394,6 +394,7 @@
color: #ffffff; color: #ffffff;
font: 11px arial; font: 11px arial;
white-space: nowrap; white-space: nowrap;
letter-spacing: 1px;
} }
#id-toolbar-menu-auto-fontcolor > a.selected { #id-toolbar-menu-auto-fontcolor > a.selected {

View file

@ -161,7 +161,7 @@ define([
}, },
onApiShowPopMenu: function(posX, posY) { onApiShowPopMenu: function(posX, posY) {
if ($('.popover.settings, .popup.settings, .picker-modal.settings, .modal.modal-in').length > 0) { if ($('.popover.settings, .popup.settings, .picker-modal.settings, .modal.modal-in, .actions-modal').length > 0) {
return; return;
} }

View file

@ -79,7 +79,6 @@ define([
isDisconnected : false, isDisconnected : false,
usersCount : 1, usersCount : 1,
fastCoauth : true, fastCoauth : true,
startModifyDocument : true,
lostEditingRights : false, lostEditingRights : false,
licenseWarning : false licenseWarning : false
}; };
@ -313,14 +312,9 @@ define([
me.setLongActionView(action) me.setLongActionView(action)
} else { } else {
if (me._state.fastCoauth && me._state.usersCount>1 && id==Asc.c_oAscAsyncAction['Save']) { if (me._state.fastCoauth && me._state.usersCount>1 && id==Asc.c_oAscAsyncAction['Save']) {
if (me._state.timerSave===undefined) // me._state.timerSave = setTimeout(function () {
me._state.timerSave = setInterval(function(){ //console.debug('End long action');
if ((new Date()) - me._state.isSaving>500) { // }, 500);
clearInterval(me._state.timerSave);
//console.debug('End long action');
me._state.timerSave = undefined;
}
}, 500);
} else { } else {
// console.debug('End long action'); // console.debug('End long action');
} }
@ -353,7 +347,7 @@ define([
break; break;
case Asc.c_oAscAsyncAction['Save']: case Asc.c_oAscAsyncAction['Save']:
me._state.isSaving = new Date(); // clearTimeout(this._state.timerSave);
title = me.saveTitleText; title = me.saveTitleText;
text = me.saveTextText; text = me.saveTextText;
break; break;
@ -677,7 +671,6 @@ define([
me.api.asc_registerCallback('asc_onDocumentModifiedChanged', _.bind(me.onDocumentModifiedChanged, me)); me.api.asc_registerCallback('asc_onDocumentModifiedChanged', _.bind(me.onDocumentModifiedChanged, me));
me.api.asc_registerCallback('asc_onDocumentCanSaveChanged', _.bind(me.onDocumentCanSaveChanged, me)); me.api.asc_registerCallback('asc_onDocumentCanSaveChanged', _.bind(me.onDocumentCanSaveChanged, me));
me.api.asc_registerCallback('asc_onSaveUrl', _.bind(me.onSaveUrl, me));
/** coauthoring begin **/ /** coauthoring begin **/
me.api.asc_registerCallback('asc_onCollaborativeChanges', _.bind(me.onCollaborativeChanges, me)); me.api.asc_registerCallback('asc_onCollaborativeChanges', _.bind(me.onCollaborativeChanges, me));
me.api.asc_registerCallback('asc_OnTryUndoInFastCollaborative',_.bind(me.onTryUndoInFastCollaborative, me)); me.api.asc_registerCallback('asc_OnTryUndoInFastCollaborative',_.bind(me.onTryUndoInFastCollaborative, me));
@ -817,6 +810,10 @@ define([
config.msg = this.errorConnectToServer; config.msg = this.errorConnectToServer;
break; break;
case Asc.c_oAscError.ID.UplImageUrl:
config.msg = this.errorBadImageUrl;
break;
default: default:
config.msg = this.errorDefaultMessage.replace('%1', id); config.msg = this.errorDefaultMessage.replace('%1', id);
break; break;
@ -879,21 +876,12 @@ define([
if (window.document.title != title) if (window.document.title != title)
window.document.title = title; window.document.title = title;
if (!this._state.fastCoauth || this._state.usersCount<2 ) Common.Gateway.setDocumentModified(isModified);
Common.Gateway.setDocumentModified(isModified);
else if ( this._state.startModifyDocument!==undefined && this._state.startModifyDocument === isModified){
Common.Gateway.setDocumentModified(isModified);
this._state.startModifyDocument = (this._state.startModifyDocument) ? !this._state.startModifyDocument : undefined;
}
this._state.isDocModified = isModified; this._state.isDocModified = isModified;
} }
}, },
onDocumentModifiedChanged: function() { onDocumentModifiedChanged: function() {
if (this._state.fastCoauth && this._state.usersCount > 1 && this._state.startModifyDocument===undefined )
return;
var isModified = this.api.asc_isDocumentCanSave(); var isModified = this.api.asc_isDocumentCanSave();
if (this._state.isDocModified !== isModified) { if (this._state.isDocModified !== isModified) {
Common.Gateway.setDocumentModified(this.api.isDocumentModified()); Common.Gateway.setDocumentModified(this.api.isDocumentModified());
@ -929,10 +917,6 @@ define([
$('#loading-mask').hide().remove(); $('#loading-mask').hide().remove();
}, },
onSaveUrl: function(url) {
Common.Gateway.save(url);
},
onDownloadUrl: function(url) { onDownloadUrl: function(url) {
if (this._state.isFromGatewayDownloadAs) { if (this._state.isFromGatewayDownloadAs) {
Common.Gateway.downloadAs(url); Common.Gateway.downloadAs(url);
@ -1231,7 +1215,8 @@ define([
textClose: 'Close', textClose: 'Close',
textDone: 'Done', textDone: 'Done',
titleServerVersion: 'Editor updated', titleServerVersion: 'Editor updated',
errorServerVersion: 'The editor version has been updated. The page will be reloaded to apply the changes.' errorServerVersion: 'The editor version has been updated. The page will be reloaded to apply the changes.',
errorBadImageUrl: 'Image url is incorrect'
} }
})(), DE.Controllers.Main || {})) })(), DE.Controllers.Main || {}))
}); });

View file

@ -117,7 +117,7 @@ define([
text: '', text: '',
afterText: afterText:
'<div class="content-block">' + '<div class="content-block">' +
'<div class="row">' + '<div class="row no-gutter" style="text-align: center;">' +
'<div class="col-50">' + me.textColumns + '</div>' + '<div class="col-50">' + me.textColumns + '</div>' +
'<div class="col-50">' + me.textRows + '</div>' + '<div class="col-50">' + me.textRows + '</div>' +
'</div>' + '</div>' +
@ -152,9 +152,12 @@ define([
rotateEffect: true, rotateEffect: true,
value: [3, 3], value: [3, 3],
cols: [{ cols: [{
textAlign: 'left', textAlign: 'center',
width: '100%',
values: [1,2,3,4,5,6,7,8,9,10] values: [1,2,3,4,5,6,7,8,9,10]
}, { }, {
textAlign: 'center',
width: '100%',
values: [1,2,3,4,5,6,7,8,9,10] values: [1,2,3,4,5,6,7,8,9,10]
}] }]
}); });

View file

@ -40,12 +40,13 @@
</div> </div>
<div class="page" id="addimage-url"> <div class="page" id="addimage-url">
<div class="page-content"> <div class="page-content">
<div class="content-block-title"><%= scope.textAddress %></div> <% if (!android) { %><div class="content-block-title"><%= scope.textAddress %></div><% } %>
<div class="list-block"> <div class="list-block">
<ul> <ul>
<li> <li>
<div id="addimage-link-url" class="item-content"> <div id="addimage-link-url" class="item-content">
<div class="item-inner"> <div class="item-inner">
<% if (android) { %><div class="item-title label"><%= scope.textAddress %></div><% } %>
<div class="item-input"> <div class="item-input">
<input type="url" placeholder="<%= scope.textImageURL %>"> <input type="url" placeholder="<%= scope.textImageURL %>">
</div> </div>

View file

@ -69,6 +69,7 @@
"DE.Controllers.Main.errorUsersExceed": "The number of users was exceeded", "DE.Controllers.Main.errorUsersExceed": "The number of users was exceeded",
"DE.Controllers.Main.errorViewerDisconnect": "Connection is lost. You can still view the document,<br>but will not be able to download until the connection is restored.", "DE.Controllers.Main.errorViewerDisconnect": "Connection is lost. You can still view the document,<br>but will not be able to download until the connection is restored.",
"DE.Controllers.Main.leavePageText": "You have unsaved changes in this document. Click 'Stay on this Page' to await the autosave of the document. Click 'Leave this Page' to discard all the unsaved changes.", "DE.Controllers.Main.leavePageText": "You have unsaved changes in this document. Click 'Stay on this Page' to await the autosave of the document. Click 'Leave this Page' to discard all the unsaved changes.",
"DE.Controllers.Main.errorBadImageUrl": "Image URL is incorrect",
"DE.Controllers.Main.loadFontsTextText": "Loading data...", "DE.Controllers.Main.loadFontsTextText": "Loading data...",
"DE.Controllers.Main.loadFontsTitleText": "Loading Data", "DE.Controllers.Main.loadFontsTitleText": "Loading Data",
"DE.Controllers.Main.loadFontTextText": "Loading data...", "DE.Controllers.Main.loadFontTextText": "Loading data...",

View file

@ -19,9 +19,10 @@ var sdk_dev_scrpipts = [
"../../../../sdkjs/common/AdvancedOptions.js", "../../../../sdkjs/common/AdvancedOptions.js",
"../../../../sdkjs/common/FontsFreeType/font_engine.js", "../../../../sdkjs/common/FontsFreeType/font_engine.js",
"../../../../sdkjs/common/FontsFreeType/FontFile.js", "../../../../sdkjs/common/FontsFreeType/FontFile.js",
"../../../../sdkjs/common/FontsFreeType/font_map.js", "../../../../sdkjs/common/FontsFreeType/font_map.js",
"../../../../sdkjs/common/FontsFreeType/FontManager.js", "../../../../sdkjs/common/FontsFreeType/FontManager.js",
"../../../../sdkjs/word/Editor/FontClassification.js", "../../../../sdkjs/word/Editor/FontClassification.js",
"../../../../sdkjs/common/FontsFreeType/character.js",
"../../../../sdkjs/common/Drawings/Metafile.js", "../../../../sdkjs/common/Drawings/Metafile.js",
"../../../../sdkjs/common/FontsFreeType/TextMeasurer.js", "../../../../sdkjs/common/FontsFreeType/TextMeasurer.js",
"../../../../sdkjs/common/Drawings/WorkEvents.js", "../../../../sdkjs/common/Drawings/WorkEvents.js",
@ -86,10 +87,13 @@ var sdk_dev_scrpipts = [
"../../../../sdkjs/word/Editor/GraphicObjects/GraphicPage.js", "../../../../sdkjs/word/Editor/GraphicObjects/GraphicPage.js",
"../../../../sdkjs/word/Editor/GraphicObjects/WrapManager.js", "../../../../sdkjs/word/Editor/GraphicObjects/WrapManager.js",
"../../../../sdkjs/word/Editor/CollaborativeEditing.js", "../../../../sdkjs/word/Editor/CollaborativeEditing.js",
"../../../../sdkjs/word/Editor/DocumentContentElementBase.js",
"../../../../sdkjs/word/Editor/StructuredDocumentTags/BlockLevel.js",
"../../../../sdkjs/word/Editor/Comments.js", "../../../../sdkjs/word/Editor/Comments.js",
"../../../../sdkjs/word/Editor/CommentsChanges.js", "../../../../sdkjs/word/Editor/CommentsChanges.js",
"../../../../sdkjs/word/Editor/Styles.js", "../../../../sdkjs/word/Editor/Styles.js",
"../../../../sdkjs/word/Editor/StylesChanges.js", "../../../../sdkjs/word/Editor/StylesChanges.js",
"../../../../sdkjs/word/Editor/RevisionsChange.js",
"../../../../sdkjs/word/Editor/ParagraphContent.js", "../../../../sdkjs/word/Editor/ParagraphContent.js",
"../../../../sdkjs/word/Editor/Paragraph/ParaTextPr.js", "../../../../sdkjs/word/Editor/Paragraph/ParaTextPr.js",
"../../../../sdkjs/word/Editor/Paragraph/ParaTextPrChanges.js", "../../../../sdkjs/word/Editor/Paragraph/ParaTextPrChanges.js",

View file

@ -166,6 +166,7 @@ define([
this.leftMenu.btnChat.hide(); this.leftMenu.btnChat.hide();
this.leftMenu.btnComments.hide(); this.leftMenu.btnComments.hide();
} }
this.mode.isTrial && this.leftMenu.setDeveloperMode(true);
/** coauthoring end **/ /** coauthoring end **/
Common.util.Shortcuts.resumeEvents(); Common.util.Shortcuts.resumeEvents();
this.leftMenu.btnThumbs.toggle(true); this.leftMenu.btnThumbs.toggle(true);
@ -178,6 +179,7 @@ define([
this.leftMenu.setOptionsPanel('plugins', this.getApplication().getController('Common.Controllers.Plugins').getView('Common.Views.Plugins')); this.leftMenu.setOptionsPanel('plugins', this.getApplication().getController('Common.Controllers.Plugins').getView('Common.Views.Plugins'));
} else } else
this.leftMenu.btnPlugins.hide(); this.leftMenu.btnPlugins.hide();
this.mode.isTrial && this.leftMenu.setDeveloperMode(true);
}, },
clickMenuFileItem: function(menu, action, isopts) { clickMenuFileItem: function(menu, action, isopts) {

View file

@ -69,7 +69,8 @@ define([
toolbar: '#viewport #toolbar', toolbar: '#viewport #toolbar',
leftMenu: '#viewport #left-menu, #viewport #id-toolbar-full-placeholder-btn-settings, #viewport #id-toolbar-short-placeholder-btn-settings', leftMenu: '#viewport #left-menu, #viewport #id-toolbar-full-placeholder-btn-settings, #viewport #id-toolbar-short-placeholder-btn-settings',
rightMenu: '#viewport #right-menu', rightMenu: '#viewport #right-menu',
header: '#viewport #header' header: '#viewport #header',
statusBar: '#statusbar'
}; };
Common.localStorage.setId('presentation'); Common.localStorage.setId('presentation');
@ -97,7 +98,7 @@ define([
onLaunch: function() { onLaunch: function() {
var me = this; var me = this;
this._state = {isDisconnected: false, usersCount: 1, fastCoauth: true, startModifyDocument: true, lostEditingRights: false, licenseWarning: false}; this._state = {isDisconnected: false, usersCount: 1, fastCoauth: true, lostEditingRights: false, licenseWarning: false};
window.storagename = 'presentation'; window.storagename = 'presentation';
@ -158,6 +159,8 @@ define([
if (!/area_id/.test(e.target.id)) { if (!/area_id/.test(e.target.id)) {
if (/msg-reply/.test(e.target.className)) if (/msg-reply/.test(e.target.className))
me.dontCloseDummyComment = true; me.dontCloseDummyComment = true;
else if (/chat-msg-text/.test(e.target.id))
me.dontCloseChat = true;
} }
}); });
@ -170,6 +173,8 @@ define([
me.api.asc_enableKeyEvents(true); me.api.asc_enableKeyEvents(true);
if (/msg-reply/.test(e.target.className)) if (/msg-reply/.test(e.target.className))
me.dontCloseDummyComment = false; me.dontCloseDummyComment = false;
else if (/chat-msg-text/.test(e.target.id))
me.dontCloseChat = false;
} }
} }
}).on('dragover', function(e) { }).on('dragover', function(e) {
@ -208,14 +213,22 @@ define([
}, },
'menu:show': function(e){ 'menu:show': function(e){
}, },
'menu:hide': function(e){ 'menu:hide': function(e, isFromInputControl){
if (!me.isModalShowed) if (!me.isModalShowed && !isFromInputControl)
me.api.asc_enableKeyEvents(true); me.api.asc_enableKeyEvents(true);
}, },
'edit:complete': _.bind(me.onEditComplete, me) 'edit:complete': _.bind(me.onEditComplete, me)
}); });
this.initNames(); this.initNames();
Common.util.Shortcuts.delegateShortcuts({
shortcuts: {
'command+s,ctrl+s': _.bind(function (e) {
e.preventDefault();
e.stopPropagation();
}, this)
}
});
} }
}, },
@ -388,14 +401,9 @@ define([
if (id==Asc.c_oAscAsyncAction['Save'] || id==Asc.c_oAscAsyncAction['ForceSaveButton']) { if (id==Asc.c_oAscAsyncAction['Save'] || id==Asc.c_oAscAsyncAction['ForceSaveButton']) {
if (this._state.fastCoauth && this._state.usersCount>1) { if (this._state.fastCoauth && this._state.usersCount>1) {
var me = this; var me = this;
if (me._state.timerSave===undefined) me._state.timerSave = setTimeout(function () {
me._state.timerSave = setInterval(function(){ me.getApplication().getController('Statusbar').setStatusCaption(me.textChangesSaved, false, 3000);
if ((new Date()) - me._state.isSaving>500) { }, 500);
clearInterval(me._state.timerSave);
me.getApplication().getController('Statusbar').setStatusCaption(me.textChangesSaved, false, 3000);
me._state.timerSave = undefined;
}
}, 500);
} else } else
this.getApplication().getController('Statusbar').setStatusCaption(this.textChangesSaved, false, 3000); this.getApplication().getController('Statusbar').setStatusCaption(this.textChangesSaved, false, 3000);
} else } else
@ -408,7 +416,7 @@ define([
if ((id==Asc.c_oAscAsyncAction['Save'] || id==Asc.c_oAscAsyncAction['ForceSaveButton']) && (!this._state.fastCoauth || this._state.usersCount<2)) if ((id==Asc.c_oAscAsyncAction['Save'] || id==Asc.c_oAscAsyncAction['ForceSaveButton']) && (!this._state.fastCoauth || this._state.usersCount<2))
this.synchronizeChanges(); this.synchronizeChanges();
if (type == Asc.c_oAscAsyncActionType.BlockInteraction && !((id == Asc.c_oAscAsyncAction['LoadDocumentFonts'] || id == Asc.c_oAscAsyncAction['ApplyChanges']) && this.dontCloseDummyComment )) { if (type == Asc.c_oAscAsyncActionType.BlockInteraction && !((id == Asc.c_oAscAsyncAction['LoadDocumentFonts'] || id == Asc.c_oAscAsyncAction['ApplyChanges']) && (this.dontCloseDummyComment || this.dontCloseChat))) {
this.onEditComplete(this.loadMask); this.onEditComplete(this.loadMask);
this.api.asc_enableKeyEvents(true); this.api.asc_enableKeyEvents(true);
} }
@ -425,7 +433,7 @@ define([
case Asc.c_oAscAsyncAction['Save']: case Asc.c_oAscAsyncAction['Save']:
case Asc.c_oAscAsyncAction['ForceSaveButton']: case Asc.c_oAscAsyncAction['ForceSaveButton']:
this._state.isSaving = new Date(); clearTimeout(this._state.timerSave);
force = true; force = true;
title = this.saveTitleText; title = this.saveTitleText;
text = this.saveTextText; text = this.saveTextText;
@ -742,6 +750,7 @@ define([
this.appOptions.canForcesave = this.appOptions.isEdit && !this.appOptions.isOffline && (typeof (this.editorConfig.customization) == 'object' && !!this.editorConfig.customization.forcesave); this.appOptions.canForcesave = this.appOptions.isEdit && !this.appOptions.isOffline && (typeof (this.editorConfig.customization) == 'object' && !!this.editorConfig.customization.forcesave);
this.appOptions.forcesave = this.appOptions.canForcesave; this.appOptions.forcesave = this.appOptions.canForcesave;
this.appOptions.canEditComments= this.appOptions.isOffline || !(typeof (this.editorConfig.customization) == 'object' && this.editorConfig.customization.commentAuthorOnly); this.appOptions.canEditComments= this.appOptions.isOffline || !(typeof (this.editorConfig.customization) == 'object' && this.editorConfig.customization.commentAuthorOnly);
this.appOptions.isTrial = params.asc_getTrial();
this._state.licenseWarning = (licType===Asc.c_oLicenseResult.Connections) && this.appOptions.canEdit && this.editorConfig.mode !== 'view'; this._state.licenseWarning = (licType===Asc.c_oLicenseResult.Connections) && this.appOptions.canEdit && this.editorConfig.mode !== 'view';
@ -750,7 +759,6 @@ define([
if (this.appOptions.canBranding) if (this.appOptions.canBranding)
headerView.setBranding(this.editorConfig.customization); headerView.setBranding(this.editorConfig.customization);
params.asc_getTrial() && headerView.setDeveloperMode(true);
this.appOptions.canRename && headerView.setCanRename(true); this.appOptions.canRename && headerView.setCanRename(true);
this.appOptions.canBrandingExt = params.asc_getCanBranding() && (typeof this.editorConfig.customization == 'object' || this.editorConfig.plugins); this.appOptions.canBrandingExt = params.asc_getCanBranding() && (typeof this.editorConfig.customization == 'object' || this.editorConfig.plugins);
@ -866,7 +874,6 @@ define([
me.api.asc_registerCallback('asc_onChangeObjectLock', _.bind(me._onChangeObjectLock, me)); me.api.asc_registerCallback('asc_onChangeObjectLock', _.bind(me._onChangeObjectLock, me));
me.api.asc_registerCallback('asc_onDocumentModifiedChanged', _.bind(me.onDocumentModifiedChanged, me)); me.api.asc_registerCallback('asc_onDocumentModifiedChanged', _.bind(me.onDocumentModifiedChanged, me));
me.api.asc_registerCallback('asc_onDocumentCanSaveChanged', _.bind(me.onDocumentCanSaveChanged, me)); me.api.asc_registerCallback('asc_onDocumentCanSaveChanged', _.bind(me.onDocumentCanSaveChanged, me));
me.api.asc_registerCallback('asc_onSaveUrl', _.bind(me.onSaveUrl, me));
/** coauthoring begin **/ /** coauthoring begin **/
me.api.asc_registerCallback('asc_onCollaborativeChanges', _.bind(me.onCollaborativeChanges, me)); me.api.asc_registerCallback('asc_onCollaborativeChanges', _.bind(me.onCollaborativeChanges, me));
me.api.asc_registerCallback('asc_OnTryUndoInFastCollaborative',_.bind(me.onTryUndoInFastCollaborative, me)); me.api.asc_registerCallback('asc_OnTryUndoInFastCollaborative',_.bind(me.onTryUndoInFastCollaborative, me));
@ -1011,6 +1018,10 @@ define([
config.msg = this.errorAccessDeny; config.msg = this.errorAccessDeny;
break; break;
case Asc.c_oAscError.ID.UplImageUrl:
config.msg = this.errorBadImageUrl;
break;
default: default:
config.msg = this.errorDefaultMessage.replace('%1', id); config.msg = this.errorDefaultMessage.replace('%1', id);
break; break;
@ -1110,25 +1121,26 @@ define([
title = headerView.getDocumentCaption() + ' - ' + title; title = headerView.getDocumentCaption() + ' - ' + title;
if (isModified) { if (isModified) {
if (!_.isUndefined(title) && (!this._state.fastCoauth || this._state.usersCount<2 )) { clearTimeout(this._state.timerCaption);
if (!_.isUndefined(title)) {
title = '* ' + title; title = '* ' + title;
headerView.setDocumentCaption(headerView.getDocumentCaption() + '*', true); headerView.setDocumentCaption(headerView.getDocumentCaption(), true);
} }
} else { } else {
headerView.setDocumentCaption(headerView.getDocumentCaption()); if (this._state.fastCoauth && this._state.usersCount>1) {
this._state.timerCaption = setTimeout(function () {
headerView.setDocumentCaption(headerView.getDocumentCaption(), false);
}, 500);
} else
headerView.setDocumentCaption(headerView.getDocumentCaption(), false);
} }
if (window.document.title != title) if (window.document.title != title)
window.document.title = title; window.document.title = title;
if (!this._state.fastCoauth || this._state.usersCount<2 ) { Common.Gateway.setDocumentModified(isModified);
Common.Gateway.setDocumentModified(isModified); if (isModified && (!this._state.fastCoauth || this._state.usersCount<2))
if (isModified) this.getApplication().getController('Statusbar').setStatusCaption('', true);
this.getApplication().getController('Statusbar').setStatusCaption('', true);
} else if ( this._state.startModifyDocument!==undefined && this._state.startModifyDocument === isModified){
Common.Gateway.setDocumentModified(isModified);
this._state.startModifyDocument = (this._state.startModifyDocument) ? !this._state.startModifyDocument : undefined;
}
this._state.isDocModified = isModified; this._state.isDocModified = isModified;
} }
@ -1138,8 +1150,6 @@ define([
}, },
onDocumentModifiedChanged: function() { onDocumentModifiedChanged: function() {
if (this._state.fastCoauth && this._state.usersCount>1 && this._state.startModifyDocument===undefined ) return;
var isModified = this.api.asc_isDocumentCanSave(); var isModified = this.api.asc_isDocumentCanSave();
if (this._state.isDocModified !== isModified) { if (this._state.isDocModified !== isModified) {
Common.Gateway.setDocumentModified(this.api.isDocumentModified()); Common.Gateway.setDocumentModified(this.api.isDocumentModified());
@ -1217,10 +1227,6 @@ define([
$('#loading-mask').hide().remove(); $('#loading-mask').hide().remove();
}, },
onSaveUrl: function(url) {
Common.Gateway.save(url);
},
onDownloadUrl: function(url) { onDownloadUrl: function(url) {
Common.Gateway.downloadAs(url); Common.Gateway.downloadAs(url);
}, },
@ -1911,7 +1917,8 @@ define([
errorAccessDeny: 'You are trying to perform an action you do not have rights for.<br>Please contact your Document Server administrator.', errorAccessDeny: 'You are trying to perform an action you do not have rights for.<br>Please contact your Document Server administrator.',
titleServerVersion: 'Editor updated', titleServerVersion: 'Editor updated',
errorServerVersion: 'The editor version has been updated. The page will be reloaded to apply the changes.', errorServerVersion: 'The editor version has been updated. The page will be reloaded to apply the changes.',
textChangesSaved: 'All changes saved' textChangesSaved: 'All changes saved',
errorBadImageUrl: 'Image url is incorrect'
} }
})(), PE.Controllers.Main || {})) })(), PE.Controllers.Main || {}))
}); });

View file

@ -697,11 +697,11 @@ define([
}, },
onApiLockDocumentTheme: function() { onApiLockDocumentTheme: function() {
this.toolbar.lockToolbar(PE.enumLock.themeLock, true, {array: [this.toolbar.btnColorSchemas]}); this.toolbar.lockToolbar(PE.enumLock.themeLock, true, {array: [this.toolbar.btnColorSchemas, this.toolbar.listTheme]});
}, },
onApiUnLockDocumentTheme: function() { onApiUnLockDocumentTheme: function() {
this.toolbar.lockToolbar(PE.enumLock.themeLock, false, {array: [this.toolbar.btnColorSchemas]}); this.toolbar.lockToolbar(PE.enumLock.themeLock, false, {array: [this.toolbar.btnColorSchemas, this.toolbar.listTheme]});
}, },
onApiCoAuthoringDisconnect: function(disableDownload) { onApiCoAuthoringDisconnect: function(disableDownload) {
@ -872,7 +872,7 @@ define([
if (this.api && this.api.asc_isDocumentCanSave) { if (this.api && this.api.asc_isDocumentCanSave) {
var isModified = this.api.asc_isDocumentCanSave(); var isModified = this.api.asc_isDocumentCanSave();
var isSyncButton = $('.btn-icon', this.toolbar.btnSave.cmpEl).hasClass('btn-synch'); var isSyncButton = $('.btn-icon', this.toolbar.btnSave.cmpEl).hasClass('btn-synch');
if (!isModified && !isSyncButton) if (!isModified && !isSyncButton && !this.toolbar.mode.forcesave)
return; return;
this.api.asc_Save(); this.api.asc_Save();

View file

@ -149,7 +149,7 @@ define([
if (this._isChartStylesChanged) { if (this._isChartStylesChanged) {
if (rec) if (rec)
this.cmbChartStyle.fillComboView(this.cmbChartStyle.menuPicker.getSelectedRec(),true); this.cmbChartStyle.fillComboView(this.cmbChartStyle.menuPicker.getSelectedRec()[0],true);
else else
this.cmbChartStyle.fillComboView(this.cmbChartStyle.menuPicker.store.at(0), true); this.cmbChartStyle.fillComboView(this.cmbChartStyle.menuPicker.store.at(0), true);
} }

View file

@ -1683,13 +1683,13 @@ define([
{caption: '--'}, {caption: '--'},
mnuPreview mnuPreview
] ]
}).on('hide:after', function(menu) { }).on('hide:after', function(menu, e, isFromInputControl) {
if (me.suppressEditComplete) { if (me.suppressEditComplete) {
me.suppressEditComplete = false; me.suppressEditComplete = false;
return; return;
} }
me.fireEvent('editcomplete', me); if (!isFromInputControl) me.fireEvent('editcomplete', me);
me.currentMenu = null; me.currentMenu = null;
}).on('render:after', function(cmp) { }).on('render:after', function(cmp) {
me.slideLayoutMenu = new Common.UI.DataView({ me.slideLayoutMenu = new Common.UI.DataView({
@ -2425,13 +2425,13 @@ define([
menuAddHyperlinkPara, menuAddHyperlinkPara,
menuHyperlinkPara menuHyperlinkPara
] ]
}).on('hide:after', function(menu) { }).on('hide:after', function(menu, e, isFromInputControl) {
if (me.suppressEditComplete) { if (me.suppressEditComplete) {
me.suppressEditComplete = false; me.suppressEditComplete = false;
return; return;
} }
me.fireEvent('editcomplete', me); if (!isFromInputControl) me.fireEvent('editcomplete', me);
me.currentMenu = null; me.currentMenu = null;
}); });
@ -2591,13 +2591,13 @@ define([
menuAddHyperlinkTable, menuAddHyperlinkTable,
menuHyperlinkTable menuHyperlinkTable
] ]
}).on('hide:after', function(menu) { }).on('hide:after', function(menu, e, isFromInputControl) {
if (me.suppressEditComplete) { if (me.suppressEditComplete) {
me.suppressEditComplete = false; me.suppressEditComplete = false;
return; return;
} }
me.fireEvent('editcomplete', me); if (!isFromInputControl) me.fireEvent('editcomplete', me);
me.currentMenu = null; me.currentMenu = null;
}); });
@ -2654,13 +2654,13 @@ define([
menuAddCommentImg menuAddCommentImg
/** coauthoring end **/ /** coauthoring end **/
] ]
}).on('hide:after', function(menu) { }).on('hide:after', function(menu, e, isFromInputControl) {
if (me.suppressEditComplete) { if (me.suppressEditComplete) {
me.suppressEditComplete = false; me.suppressEditComplete = false;
return; return;
} }
me.fireEvent('editcomplete', me); if (!isFromInputControl) me.fireEvent('editcomplete', me);
me.currentMenu = null; me.currentMenu = null;
}); });

View file

@ -373,6 +373,25 @@ define([
return this; return this;
}, },
setDeveloperMode: function(mode) {
if ( !this.$el.is(':visible') ) return;
if (!this.developerHint) {
this.developerHint = $('<div id="developer-hint">' + this.txtDeveloper + '</div>').appendTo(this.$el);
this.devHeight = this.developerHint.outerHeight();
$(window).on('resize', _.bind(this.onWindowResize, this));
}
this.developerHint.toggleClass('hidden', !mode);
var lastbtn = this.$el.find('button.btn-category:visible:last-of-type');
this.minDevPosition = lastbtn.offset().top - lastbtn.offsetParent().offset().top + lastbtn.height() + 20;
this.onWindowResize();
},
onWindowResize: function() {
this.developerHint.css('top', Math.max((this.$el.height()-this.devHeight)/2, this.minDevPosition));
},
/** coauthoring begin **/ /** coauthoring begin **/
tipComments : 'Comments', tipComments : 'Comments',
tipChat : 'Chat', tipChat : 'Chat',
@ -382,6 +401,7 @@ define([
tipFile : 'File', tipFile : 'File',
tipSearch : 'Search', tipSearch : 'Search',
tipSlides: 'Slides', tipSlides: 'Slides',
tipPlugins : 'Plugins' tipPlugins : 'Plugins',
txtDeveloper: 'DEVELOPER MODE'
}, PE.Views.LeftMenu || {})); }, PE.Views.LeftMenu || {}));
}); });

View file

@ -355,8 +355,8 @@ define([
} }
}, },
onHideMenus: function(e){ onHideMenus: function(menu, e, isFromInputControl){
this.fireEvent('editcomplete', this); if (!isFromInputControl) this.fireEvent('editcomplete', this);
}, },
setLocked: function (locked) { setLocked: function (locked) {

View file

@ -78,42 +78,48 @@ define([
asctype: Common.Utils.documentSettingsType.Paragraph, asctype: Common.Utils.documentSettingsType.Paragraph,
enableToggle: true, enableToggle: true,
disabled: true, disabled: true,
toggleGroup: 'tabpanelbtnsGroup' toggleGroup: 'tabpanelbtnsGroup',
allowMouseEventsOnDisabled: true
}); });
this.btnTable = new Common.UI.Button({ this.btnTable = new Common.UI.Button({
hint: this.txtTableSettings, hint: this.txtTableSettings,
asctype: Common.Utils.documentSettingsType.Table, asctype: Common.Utils.documentSettingsType.Table,
enableToggle: true, enableToggle: true,
disabled: true, disabled: true,
toggleGroup: 'tabpanelbtnsGroup' toggleGroup: 'tabpanelbtnsGroup',
allowMouseEventsOnDisabled: true
}); });
this.btnImage = new Common.UI.Button({ this.btnImage = new Common.UI.Button({
hint: this.txtImageSettings, hint: this.txtImageSettings,
asctype: Common.Utils.documentSettingsType.Image, asctype: Common.Utils.documentSettingsType.Image,
enableToggle: true, enableToggle: true,
disabled: true, disabled: true,
toggleGroup: 'tabpanelbtnsGroup' toggleGroup: 'tabpanelbtnsGroup',
allowMouseEventsOnDisabled: true
}); });
this.btnSlide = new Common.UI.Button({ this.btnSlide = new Common.UI.Button({
hint: this.txtSlideSettings, hint: this.txtSlideSettings,
asctype: Common.Utils.documentSettingsType.Slide, asctype: Common.Utils.documentSettingsType.Slide,
enableToggle: true, enableToggle: true,
disabled: true, disabled: true,
toggleGroup: 'tabpanelbtnsGroup' toggleGroup: 'tabpanelbtnsGroup',
allowMouseEventsOnDisabled: true
}); });
this.btnChart = new Common.UI.Button({ this.btnChart = new Common.UI.Button({
hint: this.txtChartSettings, hint: this.txtChartSettings,
asctype: Common.Utils.documentSettingsType.Chart, asctype: Common.Utils.documentSettingsType.Chart,
enableToggle: true, enableToggle: true,
disabled: true, disabled: true,
toggleGroup: 'tabpanelbtnsGroup' toggleGroup: 'tabpanelbtnsGroup',
allowMouseEventsOnDisabled: true
}); });
this.btnShape = new Common.UI.Button({ this.btnShape = new Common.UI.Button({
hint: this.txtShapeSettings, hint: this.txtShapeSettings,
asctype: Common.Utils.documentSettingsType.Shape, asctype: Common.Utils.documentSettingsType.Shape,
enableToggle: true, enableToggle: true,
disabled: true, disabled: true,
toggleGroup: 'tabpanelbtnsGroup' toggleGroup: 'tabpanelbtnsGroup',
allowMouseEventsOnDisabled: true
}); });
this.btnTextArt = new Common.UI.Button({ this.btnTextArt = new Common.UI.Button({
@ -121,7 +127,8 @@ define([
asctype: Common.Utils.documentSettingsType.TextArt, asctype: Common.Utils.documentSettingsType.TextArt,
enableToggle: true, enableToggle: true,
disabled: true, disabled: true,
toggleGroup: 'tabpanelbtnsGroup' toggleGroup: 'tabpanelbtnsGroup',
allowMouseEventsOnDisabled: true
}); });
this._settings = []; this._settings = [];

View file

@ -1234,6 +1234,18 @@ define([
this.sldrGradient.on('thumbdblclick', function(cmp){ this.sldrGradient.on('thumbdblclick', function(cmp){
me.btnGradColor.cmpEl.find('button').dropdown('toggle'); me.btnGradColor.cmpEl.find('button').dropdown('toggle');
}); });
this.sldrGradient.on('sortthumbs', function(cmp, recalc_indexes){
var colors = [],
currentIdx;
_.each (recalc_indexes, function(recalc_index, index) {
colors.push(me.GradColor.colors[recalc_index]);
if (me.GradColor.currentIdx == recalc_index)
currentIdx = index;
});
me.OriginalFillType = null;
me.GradColor.colors = colors;
me.GradColor.currentIdx = currentIdx;
});
this.fillControls.push(this.sldrGradient); this.fillControls.push(this.sldrGradient);
this.cmbBorderSize = new Common.UI.ComboBorderSizeEditable({ this.cmbBorderSize = new Common.UI.ComboBorderSizeEditable({

View file

@ -755,6 +755,18 @@ define([
this.sldrGradient.on('thumbdblclick', function(cmp){ this.sldrGradient.on('thumbdblclick', function(cmp){
me.btnGradColor.cmpEl.find('button').dropdown('toggle'); me.btnGradColor.cmpEl.find('button').dropdown('toggle');
}); });
this.sldrGradient.on('sortthumbs', function(cmp, recalc_indexes){
var colors = [],
currentIdx;
_.each (recalc_indexes, function(recalc_index, index) {
colors.push(me.GradColor.colors[recalc_index]);
if (me.GradColor.currentIdx == recalc_index)
currentIdx = index;
});
me.OriginalFillType = null;
me.GradColor.colors = colors;
me.GradColor.currentIdx = currentIdx;
});
this.FillItems.push(this.sldrGradient); this.FillItems.push(this.sldrGradient);
}, },

View file

@ -175,6 +175,8 @@ define([
this.panelUsers = $('#status-users-ct', this.el); this.panelUsers = $('#status-users-ct', this.el);
this.panelUsers.on('shown.bs.dropdown', function () { this.panelUsers.on('shown.bs.dropdown', function () {
me.panelUsersList.scroller.update({minScrollbarLength : 40, alwaysVisibleY: true}); me.panelUsersList.scroller.update({minScrollbarLength : 40, alwaysVisibleY: true});
var tip = me.panelUsersBlock.data('bs.tooltip');
if (tip) tip.hide();
}); });
this.panelUsersBlock = this.panelUsers.find('#status-users-block'); this.panelUsersBlock = this.panelUsers.find('#status-users-block');

View file

@ -357,7 +357,7 @@ define([
if (this._initSettings) if (this._initSettings)
this.createDelayedElements(); this.createDelayedElements();
this.disableControls(this._locked); this.disableControls(this._locked); // need to update combodataview after disabled state
if (props ) if (props )
{ {
@ -376,7 +376,7 @@ define([
if (this._isTemplatesChanged) { if (this._isTemplatesChanged) {
if (rec) if (rec)
this.cmbTableTemplate.fillComboView(this.cmbTableTemplate.menuPicker.getSelectedRec(),true); this.cmbTableTemplate.fillComboView(this.cmbTableTemplate.menuPicker.getSelectedRec()[0],true);
else else
this.cmbTableTemplate.fillComboView(this.cmbTableTemplate.menuPicker.store.at(0), true); this.cmbTableTemplate.fillComboView(this.cmbTableTemplate.menuPicker.store.at(0), true);
} }

View file

@ -1224,6 +1224,18 @@ define([
this.sldrGradient.on('thumbdblclick', function(cmp){ this.sldrGradient.on('thumbdblclick', function(cmp){
me.btnGradColor.cmpEl.find('button').dropdown('toggle'); me.btnGradColor.cmpEl.find('button').dropdown('toggle');
}); });
this.sldrGradient.on('sortthumbs', function(cmp, recalc_indexes){
var colors = [],
currentIdx;
_.each (recalc_indexes, function(recalc_index, index) {
colors.push(me.GradColor.colors[recalc_index]);
if (me.GradColor.currentIdx == recalc_index)
currentIdx = index;
});
me.OriginalFillType = null;
me.GradColor.colors = colors;
me.GradColor.currentIdx = currentIdx;
});
this.lockedControls.push(this.sldrGradient); this.lockedControls.push(this.sldrGradient);
this.cmbBorderSize = new Common.UI.ComboBorderSizeEditable({ this.cmbBorderSize = new Common.UI.ComboBorderSizeEditable({

View file

@ -855,7 +855,7 @@ define([
enableKeyEvents: true, enableKeyEvents: true,
itemHeight : 38, itemHeight : 38,
hint: this.tipSlideTheme, hint: this.tipSlideTheme,
lock: [_set.lostConnect, _set.noSlides], lock: [_set.themeLock, _set.lostConnect, _set.noSlides],
beforeOpenHandler: function(e) { beforeOpenHandler: function(e) {
var cmp = this, var cmp = this,
menu = cmp.openButton.menu, menu = cmp.openButton.menu,
@ -1159,6 +1159,8 @@ define([
); );
if (this.mode.isDesktopApp || this.mode.canBrandingExt && this.mode.customization && this.mode.customization.header===false) if (this.mode.isDesktopApp || this.mode.canBrandingExt && this.mode.customization && this.mode.customization.header===false)
this.mnuitemHideTitleBar.hide(); this.mnuitemHideTitleBar.hide();
if (this.mode.canBrandingExt && this.mode.customization && this.mode.customization.statusBar===false)
this.mnuitemHideStatusBar.hide();
this.mnuZoomOut = new Common.UI.Button({ this.mnuZoomOut = new Common.UI.Button({
el : $('#id-menu-zoom-out'), el : $('#id-menu-zoom-out'),

View file

@ -80,7 +80,7 @@
"Common.Views.ExternalDiagramEditor.textTitle": "Chart Editor", "Common.Views.ExternalDiagramEditor.textTitle": "Chart Editor",
"Common.Views.Header.openNewTabText": "Open in New Tab", "Common.Views.Header.openNewTabText": "Open in New Tab",
"Common.Views.Header.textBack": "Go to Documents", "Common.Views.Header.textBack": "Go to Documents",
"Common.Views.Header.txtHeaderDeveloper": "DEVELOPER MODE", "del_Common.Views.Header.txtHeaderDeveloper": "DEVELOPER MODE",
"Common.Views.Header.txtRename": "Rename", "Common.Views.Header.txtRename": "Rename",
"Common.Views.ImageFromUrlDialog.cancelButtonText": "Cancel", "Common.Views.ImageFromUrlDialog.cancelButtonText": "Cancel",
"Common.Views.ImageFromUrlDialog.okButtonText": "OK", "Common.Views.ImageFromUrlDialog.okButtonText": "OK",
@ -248,6 +248,7 @@
"PE.Controllers.Main.titleServerVersion": "Editor updated", "PE.Controllers.Main.titleServerVersion": "Editor updated",
"PE.Controllers.Main.errorServerVersion": "The editor version has been updated. The page will be reloaded to apply the changes.", "PE.Controllers.Main.errorServerVersion": "The editor version has been updated. The page will be reloaded to apply the changes.",
"PE.Controllers.Main.textChangesSaved": "All changes saved", "PE.Controllers.Main.textChangesSaved": "All changes saved",
"PE.Controllers.Main.errorBadImageUrl": "Image URL is incorrect",
"PE.Controllers.Statusbar.zoomText": "Zoom {0}%", "PE.Controllers.Statusbar.zoomText": "Zoom {0}%",
"PE.Controllers.Toolbar.confirmAddFontName": "The font you are going to save is not available on the current device.<br>The text style will be displayed using one of the system fonts, the saved font will be used when it is available.<br>Do you want to continue?", "PE.Controllers.Toolbar.confirmAddFontName": "The font you are going to save is not available on the current device.<br>The text style will be displayed using one of the system fonts, the saved font will be used when it is available.<br>Do you want to continue?",
"PE.Controllers.Toolbar.textAccent": "Accents", "PE.Controllers.Toolbar.textAccent": "Accents",
@ -875,6 +876,7 @@
"PE.Views.LeftMenu.tipSlides": "Slides", "PE.Views.LeftMenu.tipSlides": "Slides",
"PE.Views.LeftMenu.tipSupport": "Feedback & Support", "PE.Views.LeftMenu.tipSupport": "Feedback & Support",
"PE.Views.LeftMenu.tipTitles": "Titles", "PE.Views.LeftMenu.tipTitles": "Titles",
"PE.Views.LeftMenu.txtDeveloper": "DEVELOPER MODE",
"PE.Views.ParagraphSettings.strLineHeight": "Line Spacing", "PE.Views.ParagraphSettings.strLineHeight": "Line Spacing",
"PE.Views.ParagraphSettings.strParagraphSpacing": "Paragraph Spacing", "PE.Views.ParagraphSettings.strParagraphSpacing": "Paragraph Spacing",
"PE.Views.ParagraphSettings.strSpacingAfter": "After", "PE.Views.ParagraphSettings.strSpacingAfter": "After",

View file

@ -451,4 +451,20 @@
} }
} }
} }
}
#developer-hint {
position: absolute;
left: 0;
padding: 12px 0;
background-color: #ffb400;
color: #6e4e00 !important;
white-space: nowrap;
line-height: @app-header-height;
writing-mode: vertical-rl;
-moz-transform: rotate(180deg);
-ms-transform: rotate(180deg);
-webkit-transform: rotate(180deg);
-o-transform: rotate(180deg);
transform: rotate(180deg);
} }

View file

@ -386,6 +386,7 @@
color: #ffffff; color: #ffffff;
font: 11px arial; font: 11px arial;
white-space: nowrap; white-space: nowrap;
letter-spacing: 1px;
} }
.item-equation { .item-equation {

View file

@ -163,7 +163,7 @@ define([
}, },
onApiShowPopMenu: function(posX, posY) { onApiShowPopMenu: function(posX, posY) {
if (_isPopMenuHidden || $('.popover.settings, .popup.settings, .picker-modal.settings, .modal-in').length > 0) if (_isPopMenuHidden || $('.popover.settings, .popup.settings, .picker-modal.settings, .modal-in, .actions-modal').length > 0)
return; return;
var me = this, var me = this,
@ -193,7 +193,7 @@ define([
newDocumentPage.focus(); newDocumentPage.focus();
} }
} else } else
this.api.openInternalLink(url); this.api.asc_GoToInternalHyperlink(url);
}, },
_initMenu: function (stack) { _initMenu: function (stack) {

View file

@ -79,7 +79,6 @@ define([
isDisconnected : false, isDisconnected : false,
usersCount : 1, usersCount : 1,
fastCoauth : true, fastCoauth : true,
startModifyDocument : true,
lostEditingRights : false, lostEditingRights : false,
licenseWarning : false licenseWarning : false
}; };
@ -303,14 +302,9 @@ define([
me.setLongActionView(action) me.setLongActionView(action)
} else { } else {
if (me._state.fastCoauth && me._state.usersCount>1 && id==Asc.c_oAscAsyncAction['Save']) { if (me._state.fastCoauth && me._state.usersCount>1 && id==Asc.c_oAscAsyncAction['Save']) {
if (me._state.timerSave===undefined) // me._state.timerSave = setTimeout(function () {
me._state.timerSave = setInterval(function(){ //console.debug('End long action');
if ((new Date()) - me._state.isSaving>500) { // }, 500);
clearInterval(me._state.timerSave);
//console.debug('End long action');
me._state.timerSave = undefined;
}
}, 500);
} else { } else {
// console.debug('End long action'); // console.debug('End long action');
} }
@ -343,7 +337,7 @@ define([
break; break;
case Asc.c_oAscAsyncAction['Save']: case Asc.c_oAscAsyncAction['Save']:
me._state.isSaving = new Date(); // clearTimeout(me._state.timerSave);
title = me.saveTitleText; title = me.saveTitleText;
text = me.saveTextText; text = me.saveTextText;
break; break;
@ -637,7 +631,6 @@ define([
me.api.asc_registerCallback('asc_onChangeObjectLock', _.bind(me._onChangeObjectLock, me)); me.api.asc_registerCallback('asc_onChangeObjectLock', _.bind(me._onChangeObjectLock, me));
me.api.asc_registerCallback('asc_onDocumentModifiedChanged', _.bind(me.onDocumentModifiedChanged, me)); me.api.asc_registerCallback('asc_onDocumentModifiedChanged', _.bind(me.onDocumentModifiedChanged, me));
me.api.asc_registerCallback('asc_onDocumentCanSaveChanged', _.bind(me.onDocumentCanSaveChanged, me)); me.api.asc_registerCallback('asc_onDocumentCanSaveChanged', _.bind(me.onDocumentCanSaveChanged, me));
me.api.asc_registerCallback('asc_onSaveUrl', _.bind(me.onSaveUrl, me));
/** coauthoring begin **/ /** coauthoring begin **/
me.api.asc_registerCallback('asc_onCollaborativeChanges', _.bind(me.onCollaborativeChanges, me)); me.api.asc_registerCallback('asc_onCollaborativeChanges', _.bind(me.onCollaborativeChanges, me));
me.api.asc_registerCallback('asc_OnTryUndoInFastCollaborative',_.bind(me.onTryUndoInFastCollaborative, me)); me.api.asc_registerCallback('asc_OnTryUndoInFastCollaborative',_.bind(me.onTryUndoInFastCollaborative, me));
@ -769,6 +762,10 @@ define([
config.msg = this.errorConnectToServer; config.msg = this.errorConnectToServer;
break; break;
case Asc.c_oAscError.ID.UplImageUrl:
config.msg = this.errorBadImageUrl;
break;
default: default:
config.msg = this.errorDefaultMessage.replace('%1', id); config.msg = this.errorDefaultMessage.replace('%1', id);
break; break;
@ -830,21 +827,12 @@ define([
if (window.document.title != title) if (window.document.title != title)
window.document.title = title; window.document.title = title;
if (!this._state.fastCoauth || this._state.usersCount<2 ) Common.Gateway.setDocumentModified(isModified);
Common.Gateway.setDocumentModified(isModified);
else if ( this._state.startModifyDocument!==undefined && this._state.startModifyDocument === isModified){
Common.Gateway.setDocumentModified(isModified);
this._state.startModifyDocument = (this._state.startModifyDocument) ? !this._state.startModifyDocument : undefined;
}
this._state.isDocModified = isModified; this._state.isDocModified = isModified;
} }
}, },
onDocumentModifiedChanged: function() { onDocumentModifiedChanged: function() {
if (this._state.fastCoauth && this._state.usersCount > 1 && this._state.startModifyDocument===undefined )
return;
var isModified = this.api.asc_isDocumentCanSave(); var isModified = this.api.asc_isDocumentCanSave();
if (this._state.isDocModified !== isModified) { if (this._state.isDocModified !== isModified) {
Common.Gateway.setDocumentModified(this.api.isDocumentModified()); Common.Gateway.setDocumentModified(this.api.isDocumentModified());
@ -889,10 +877,6 @@ define([
$('#loading-mask').hide().remove(); $('#loading-mask').hide().remove();
}, },
onSaveUrl: function(url) {
Common.Gateway.save(url);
},
onDownloadUrl: function(url) { onDownloadUrl: function(url) {
if (this._state.isFromGatewayDownloadAs) { if (this._state.isFromGatewayDownloadAs) {
Common.Gateway.downloadAs(url); Common.Gateway.downloadAs(url);
@ -1233,7 +1217,8 @@ define([
textClose: 'Close', textClose: 'Close',
textDone: 'Done', textDone: 'Done',
titleServerVersion: 'Editor updated', titleServerVersion: 'Editor updated',
errorServerVersion: 'The editor version has been updated. The page will be reloaded to apply the changes.' errorServerVersion: 'The editor version has been updated. The page will be reloaded to apply the changes.',
errorBadImageUrl: 'Image url is incorrect'
} }
})(), PE.Controllers.Main || {})) })(), PE.Controllers.Main || {}))
}); });

View file

@ -103,7 +103,7 @@ define([
var name = layout.get_Name(); var name = layout.get_Name();
_layouts.push({ _layouts.push({
imageUrl : layout.get_Image(), imageUrl : layout.get_Image(),
title : (name !== '') ? name : me.layoutNames[layout.getType()], title : (name !== '') ? name : PE.getController('Main').layoutNames[layout.getType()],
itemWidth : layout.get_Width(), itemWidth : layout.get_Width(),
itemHeight : layout.get_Height(), itemHeight : layout.get_Height(),
idx : layout.getIndex() idx : layout.getIndex()

View file

@ -104,7 +104,7 @@ define([
text: '', text: '',
afterText: afterText:
'<div class="content-block">' + '<div class="content-block">' +
'<div class="row">' + '<div class="row no-gutter" style="text-align: center;">' +
'<div class="col-50">' + me.textColumns + '</div>' + '<div class="col-50">' + me.textColumns + '</div>' +
'<div class="col-50">' + me.textRows + '</div>' + '<div class="col-50">' + me.textRows + '</div>' +
'</div>' + '</div>' +
@ -139,9 +139,12 @@ define([
rotateEffect: true, rotateEffect: true,
value: [3, 3], value: [3, 3],
cols: [{ cols: [{
textAlign: 'left', textAlign: 'center',
width: '100%',
values: [1,2,3,4,5,6,7,8,9,10] values: [1,2,3,4,5,6,7,8,9,10]
}, { }, {
textAlign: 'center',
width: '100%',
values: [1,2,3,4,5,6,7,8,9,10] values: [1,2,3,4,5,6,7,8,9,10]
}] }]
}); });

View file

@ -40,12 +40,13 @@
</div> </div>
<div class="page" id="addimage-url"> <div class="page" id="addimage-url">
<div class="page-content"> <div class="page-content">
<div class="content-block-title"><%= scope.textAddress %></div> <% if (!android) { %><div class="content-block-title"><%= scope.textAddress %></div><% } %>
<div class="list-block"> <div class="list-block">
<ul> <ul>
<li> <li>
<div id="addimage-link-url" class="item-content"> <div id="addimage-link-url" class="item-content">
<div class="item-inner"> <div class="item-inner">
<% if (android) { %><div class="item-title label"><%= scope.textAddress %></div><% } %>
<div class="item-input"> <div class="item-input">
<input type="url" placeholder="<%= scope.textImageURL %>"> <input type="url" placeholder="<%= scope.textImageURL %>">
</div> </div>

View file

@ -83,6 +83,7 @@
"PE.Controllers.Main.errorUsersExceed": "The number of users was exceeded", "PE.Controllers.Main.errorUsersExceed": "The number of users was exceeded",
"PE.Controllers.Main.errorViewerDisconnect": "Connection is lost. You can still view the document,<br>but will not be able to download or print until the connection is restored.", "PE.Controllers.Main.errorViewerDisconnect": "Connection is lost. You can still view the document,<br>but will not be able to download or print until the connection is restored.",
"PE.Controllers.Main.leavePageText": "You have unsaved changes in this document. Click 'Stay on this Page' to await the autosave of the document. Click 'Leave this Page' to discard all the unsaved changes.", "PE.Controllers.Main.leavePageText": "You have unsaved changes in this document. Click 'Stay on this Page' to await the autosave of the document. Click 'Leave this Page' to discard all the unsaved changes.",
"PE.Controllers.Main.errorBadImageUrl": "Image URL is incorrect",
"PE.Controllers.Main.loadFontsTextText": "Loading data...", "PE.Controllers.Main.loadFontsTextText": "Loading data...",
"PE.Controllers.Main.loadFontsTitleText": "Loading Data", "PE.Controllers.Main.loadFontsTitleText": "Loading Data",
"PE.Controllers.Main.loadFontTextText": "Loading data...", "PE.Controllers.Main.loadFontTextText": "Loading data...",

View file

@ -77,6 +77,8 @@ var sdk_dev_scrpipts = [
"../../../../sdkjs/cell/model/CellInfo.js", "../../../../sdkjs/cell/model/CellInfo.js",
"../../../../sdkjs/cell/view/DrawingObjectsController.js", "../../../../sdkjs/cell/view/DrawingObjectsController.js",
"../../../../sdkjs/slide/Drawing/ThemeLoader.js", "../../../../sdkjs/slide/Drawing/ThemeLoader.js",
"../../../../sdkjs/word/Editor/DocumentContentElementBase.js",
"../../../../sdkjs/word/Editor/StructuredDocumentTags/BlockLevel.js",
"../../../../sdkjs/word/Editor/Serialize2.js", "../../../../sdkjs/word/Editor/Serialize2.js",
"../../../../sdkjs/word/Editor/Numbering.js", "../../../../sdkjs/word/Editor/Numbering.js",
"../../../../sdkjs/word/Editor/NumberingChanges.js", "../../../../sdkjs/word/Editor/NumberingChanges.js",
@ -96,6 +98,7 @@ var sdk_dev_scrpipts = [
"../../../../sdkjs/word/Editor/SectionsChanges.js", "../../../../sdkjs/word/Editor/SectionsChanges.js",
"../../../../sdkjs/word/Editor/Styles.js", "../../../../sdkjs/word/Editor/Styles.js",
"../../../../sdkjs/word/Editor/StylesChanges.js", "../../../../sdkjs/word/Editor/StylesChanges.js",
"../../../../sdkjs/word/Editor/RevisionsChange.js",
"../../../../sdkjs/slide/Editor/Format/StylesPrototype.js", "../../../../sdkjs/slide/Editor/Format/StylesPrototype.js",
"../../../../sdkjs/word/Drawing/Graphics.js", "../../../../sdkjs/word/Drawing/Graphics.js",
"../../../../sdkjs/word/Drawing/ShapeDrawer.js", "../../../../sdkjs/word/Drawing/ShapeDrawer.js",

View file

@ -47,6 +47,7 @@ define([
'spreadsheeteditor/main/app/view/DocumentHolder', 'spreadsheeteditor/main/app/view/DocumentHolder',
'spreadsheeteditor/main/app/view/HyperlinkSettingsDialog', 'spreadsheeteditor/main/app/view/HyperlinkSettingsDialog',
'spreadsheeteditor/main/app/view/ParagraphSettingsAdvanced', 'spreadsheeteditor/main/app/view/ParagraphSettingsAdvanced',
'spreadsheeteditor/main/app/view/ImageSettingsAdvanced',
'spreadsheeteditor/main/app/view/SetValueDialog', 'spreadsheeteditor/main/app/view/SetValueDialog',
'spreadsheeteditor/main/app/view/AutoFilterDialog' 'spreadsheeteditor/main/app/view/AutoFilterDialog'
], function () { ], function () {
@ -184,6 +185,7 @@ define([
view.pmiTextAdvanced.on('click', _.bind(me.onTextAdvanced, me)); view.pmiTextAdvanced.on('click', _.bind(me.onTextAdvanced, me));
view.mnuShapeAdvanced.on('click', _.bind(me.onShapeAdvanced, me)); view.mnuShapeAdvanced.on('click', _.bind(me.onShapeAdvanced, me));
view.mnuChartEdit.on('click', _.bind(me.onChartEdit, me)); view.mnuChartEdit.on('click', _.bind(me.onChartEdit, me));
view.mnuImgAdvanced.on('click', _.bind(me.onImgAdvanced, me));
var documentHolderEl = view.cmpEl; var documentHolderEl = view.cmpEl;
@ -688,6 +690,25 @@ define([
})).show(); })).show();
}, },
onImgAdvanced: function(item) {
var me = this;
(new SSE.Views.ImageSettingsAdvanced({
imageProps : item.imageInfo,
api : me.api,
handler : function(result, value) {
if (result == 'ok') {
if (me.api) {
me.api.asc_setGraphicObjectProps(value.imageProps);
Common.component.Analytics.trackEvent('DocumentHolder', 'Apply advanced image settings');
}
}
Common.NotificationCenter.trigger('edit:complete', me);
}
})).show();
},
onChartEdit: function(item) { onChartEdit: function(item) {
var me = this; var me = this;
var win, props; var win, props;
@ -805,7 +826,7 @@ define([
linkstr = props.asc_getHyperlinkUrl() + '<br><b>' + me.textCtrlClick + '</b>'; linkstr = props.asc_getHyperlinkUrl() + '<br><b>' + me.textCtrlClick + '</b>';
} }
} else { } else {
linkstr = props.asc_getTooltip() || (props.asc_getSheet() + '!' + props.asc_getRange()); linkstr = props.asc_getTooltip() || (props.asc_getLocation());
} }
if (hyperlinkTip.ref && hyperlinkTip.ref.isVisible()) { if (hyperlinkTip.ref && hyperlinkTip.ref.isVisible()) {
@ -1213,9 +1234,10 @@ define([
documentHolder.mnuChartEdit.chartInfo = elValue; documentHolder.mnuChartEdit.chartInfo = elValue;
ischartmenu = true; ischartmenu = true;
has_chartprops = true; has_chartprops = true;
} } else {
else documentHolder.mnuImgAdvanced.imageInfo = elValue;
isimagemenu = true; isimagemenu = true;
}
} }
} }
@ -1227,8 +1249,10 @@ define([
documentHolder.mnuChartEdit.setDisabled(isObjLocked); documentHolder.mnuChartEdit.setDisabled(isObjLocked);
documentHolder.pmiImgCut.setDisabled(isObjLocked); documentHolder.pmiImgCut.setDisabled(isObjLocked);
documentHolder.pmiImgPaste.setDisabled(isObjLocked); documentHolder.pmiImgPaste.setDisabled(isObjLocked);
documentHolder.mnuImgAdvanced.setVisible(isimagemenu && !isshapemenu && !ischartmenu);
documentHolder.mnuImgAdvanced.setDisabled(isObjLocked);
if (showMenu) this.showPopupMenu(documentHolder.imgMenu, {}, event); if (showMenu) this.showPopupMenu(documentHolder.imgMenu, {}, event);
documentHolder.mnuShapeSeparator.setVisible(documentHolder.mnuShapeAdvanced.isVisible() || documentHolder.mnuChartEdit.isVisible()); documentHolder.mnuShapeSeparator.setVisible(documentHolder.mnuShapeAdvanced.isVisible() || documentHolder.mnuChartEdit.isVisible() || documentHolder.mnuImgAdvanced.isVisible());
} else if (istextshapemenu || istextchartmenu) { } else if (istextshapemenu || istextchartmenu) {
if (!showMenu && !documentHolder.textInShapeMenu.isVisible()) return; if (!showMenu && !documentHolder.textInShapeMenu.isVisible()) return;

View file

@ -174,6 +174,7 @@ define([
this.leftMenu.btnChat.hide(); this.leftMenu.btnChat.hide();
this.leftMenu.btnComments.hide(); this.leftMenu.btnComments.hide();
} }
this.mode.isTrial && this.leftMenu.setDeveloperMode(true);
/** coauthoring end **/ /** coauthoring end **/
Common.util.Shortcuts.resumeEvents(); Common.util.Shortcuts.resumeEvents();
if (!this.mode.isEditMailMerge && !this.mode.isEditDiagram) if (!this.mode.isEditMailMerge && !this.mode.isEditDiagram)
@ -187,6 +188,7 @@ define([
this.leftMenu.setOptionsPanel('plugins', this.getApplication().getController('Common.Controllers.Plugins').getView('Common.Views.Plugins')); this.leftMenu.setOptionsPanel('plugins', this.getApplication().getController('Common.Controllers.Plugins').getView('Common.Views.Plugins'));
} else } else
this.leftMenu.btnPlugins.hide(); this.leftMenu.btnPlugins.hide();
this.mode.isTrial && this.leftMenu.setDeveloperMode(true);
}, },
clickMenuFileItem: function(menu, action, isopts) { clickMenuFileItem: function(menu, action, isopts) {

View file

@ -74,7 +74,8 @@ define([
toolbar: '#viewport #toolbar', toolbar: '#viewport #toolbar',
leftMenu: '#viewport #left-menu, #viewport #id-toolbar-full-placeholder-btn-settings, #viewport #id-toolbar-short-placeholder-btn-settings', leftMenu: '#viewport #left-menu, #viewport #id-toolbar-full-placeholder-btn-settings, #viewport #id-toolbar-short-placeholder-btn-settings',
rightMenu: '#viewport #right-menu', rightMenu: '#viewport #right-menu',
header: '#viewport #header' header: '#viewport #header',
statusBar: '#statusbar'
}; };
Common.localStorage.setId('table'); Common.localStorage.setId('table');
@ -102,7 +103,7 @@ define([
onLaunch: function() { onLaunch: function() {
// $(document.body).css('position', 'absolute'); // $(document.body).css('position', 'absolute');
this._state = {isDisconnected: false, usersCount: 1, fastCoauth: true, startModifyDocument: true, lostEditingRights: false, licenseWarning: false}; this._state = {isDisconnected: false, usersCount: 1, fastCoauth: true, lostEditingRights: false, licenseWarning: false};
if (!Common.Utils.isBrowserSupported()){ if (!Common.Utils.isBrowserSupported()){
Common.Utils.showBrowserRestriction(); Common.Utils.showBrowserRestriction();
@ -166,6 +167,8 @@ define([
if (e && e.target && !/area_id/.test(e.target.id)) { if (e && e.target && !/area_id/.test(e.target.id)) {
if (/msg-reply/.test(e.target.className)) if (/msg-reply/.test(e.target.className))
me.dontCloseDummyComment = true; me.dontCloseDummyComment = true;
else if (/chat-msg-text/.test(e.target.id))
me.dontCloseChat = true;
} }
}); });
@ -180,6 +183,8 @@ define([
me.api.asc_enableKeyEvents(true); me.api.asc_enableKeyEvents(true);
if (/msg-reply/.test(e.target.className)) if (/msg-reply/.test(e.target.className))
me.dontCloseDummyComment = false; me.dontCloseDummyComment = false;
else if (/chat-msg-text/.test(e.target.id))
me.dontCloseChat = false;
} }
} }
}).on('dragover', function(e) { }).on('dragover', function(e) {
@ -217,8 +222,8 @@ define([
}, },
'menu:show': function(e){ 'menu:show': function(e){
}, },
'menu:hide': function(menu){ 'menu:hide': function(menu, isFromInputControl){
if (!me.isModalShowed && (!menu || !menu.cmpEl.hasClass('from-cell-edit'))) { if (!me.isModalShowed && (!menu || !menu.cmpEl.hasClass('from-cell-edit')) && !isFromInputControl) {
me.api.asc_InputClearKeyboardElement(); me.api.asc_InputClearKeyboardElement();
me.api.asc_enableKeyEvents(true); me.api.asc_enableKeyEvents(true);
} }
@ -425,12 +430,12 @@ define([
this.setLongActionView(action); this.setLongActionView(action);
} else { } else {
if (this.loadMask) { if (this.loadMask) {
if (this.loadMask.isVisible() && !this.dontCloseDummyComment) if (this.loadMask.isVisible() && !this.dontCloseDummyComment && !this.dontCloseChat)
this.api.asc_enableKeyEvents(true); this.api.asc_enableKeyEvents(true);
this.loadMask.hide(); this.loadMask.hide();
} }
if (type == Asc.c_oAscAsyncActionType.BlockInteraction && !( (id == Asc.c_oAscAsyncAction['LoadDocumentFonts'] || id == Asc.c_oAscAsyncAction['ApplyChanges']) && this.dontCloseDummyComment )) if (type == Asc.c_oAscAsyncActionType.BlockInteraction && !( (id == Asc.c_oAscAsyncAction['LoadDocumentFonts'] || id == Asc.c_oAscAsyncAction['ApplyChanges']) && (this.dontCloseDummyComment || this.dontCloseChat) ))
this.onEditComplete(this.loadMask, {restorefocus:true}); this.onEditComplete(this.loadMask, {restorefocus:true});
} }
}, },
@ -649,7 +654,6 @@ define([
rightmenuController.createDelayedElements(); rightmenuController.createDelayedElements();
me.api.asc_registerCallback('asc_onSaveUrl', _.bind(me.onSaveUrl, me));
me.api.asc_registerCallback('asc_onDocumentModifiedChanged', _.bind(me.onDocumentModifiedChanged, me)); me.api.asc_registerCallback('asc_onDocumentModifiedChanged', _.bind(me.onDocumentModifiedChanged, me));
me.api.asc_registerCallback('asc_onDocumentCanSaveChanged', _.bind(me.onDocumentCanSaveChanged, me)); me.api.asc_registerCallback('asc_onDocumentCanSaveChanged', _.bind(me.onDocumentCanSaveChanged, me));
me.api.asc_registerCallback('asc_OnTryUndoInFastCollaborative',_.bind(me.onTryUndoInFastCollaborative, me)); me.api.asc_registerCallback('asc_OnTryUndoInFastCollaborative',_.bind(me.onTryUndoInFastCollaborative, me));
@ -760,6 +764,7 @@ define([
this.appOptions.canComments = (licType === Asc.c_oLicenseResult.Success || licType === Asc.c_oLicenseResult.SuccessLimit) && !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.comments===false); this.appOptions.canComments = (licType === Asc.c_oLicenseResult.Success || licType === Asc.c_oLicenseResult.SuccessLimit) && !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.comments===false);
this.appOptions.canChat = (licType === Asc.c_oLicenseResult.Success || licType === Asc.c_oLicenseResult.SuccessLimit) && !this.appOptions.isOffline && !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.chat===false); this.appOptions.canChat = (licType === Asc.c_oLicenseResult.Success || licType === Asc.c_oLicenseResult.SuccessLimit) && !this.appOptions.isOffline && !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.chat===false);
this.appOptions.canRename = !!this.permissions.rename; this.appOptions.canRename = !!this.permissions.rename;
this.appOptions.isTrial = params.asc_getTrial();
this.appOptions.canBranding = (licType === Asc.c_oLicenseResult.Success) && (typeof this.editorConfig.customization == 'object'); this.appOptions.canBranding = (licType === Asc.c_oLicenseResult.Success) && (typeof this.editorConfig.customization == 'object');
if (this.appOptions.canBranding) if (this.appOptions.canBranding)
@ -769,7 +774,6 @@ define([
if (this.appOptions.canBrandingExt) if (this.appOptions.canBrandingExt)
this.updatePlugins(this.plugins, true); this.updatePlugins(this.plugins, true);
params.asc_getTrial() && this.headerView.setDeveloperMode(true);
this.appOptions.canRename && this.headerView.setCanRename(true); this.appOptions.canRename && this.headerView.setCanRename(true);
} }
@ -1043,6 +1047,16 @@ define([
config.closable = true; config.closable = true;
break; break;
case Asc.c_oAscError.ID.FrmlOperandExpected:
config.msg = this.errorOperandExpected;
config.closable = true;
break;
case Asc.c_oAscError.ID.FrmlWrongReferences:
config.msg = this.errorFrmlWrongReferences;
config.closable = true;
break;
case Asc.c_oAscError.ID.UnexpectedGuid: case Asc.c_oAscError.ID.UnexpectedGuid:
config.msg = this.errorUnexpectedGuid; config.msg = this.errorUnexpectedGuid;
break; break;
@ -1067,10 +1081,6 @@ define([
config.msg = this.errorDataRange; config.msg = this.errorDataRange;
break; break;
case Asc.c_oAscError.ID.FrmlOperandExpected:
config.msg = this.errorOperandExpected;
break;
case Asc.c_oAscError.ID.VKeyEncrypt: case Asc.c_oAscError.ID.VKeyEncrypt:
config.msg = this.errorToken; config.msg = this.errorToken;
break; break;
@ -1156,10 +1166,6 @@ define([
config.msg = this.errorOpenWarning; config.msg = this.errorOpenWarning;
break; break;
case Asc.c_oAscError.ID.FrmlWrongReferences:
config.msg = this.errorFrmlWrongReferences;
break;
case Asc.c_oAscError.ID.CopyMultiselectAreaError: case Asc.c_oAscError.ID.CopyMultiselectAreaError:
config.msg = this.errorCopyMultiselectArea; config.msg = this.errorCopyMultiselectArea;
break; break;
@ -1271,24 +1277,26 @@ define([
title = this.headerView.getDocumentCaption() + ' - ' + title; title = this.headerView.getDocumentCaption() + ' - ' + title;
if (change) { if (change) {
if (!_.isUndefined(title) && (!this._state.fastCoauth || this._state.usersCount<2 )) { clearTimeout(this._state.timerCaption);
if (!_.isUndefined(title)) {
title = '* ' + title; title = '* ' + title;
this.headerView.setDocumentCaption(this.headerView.getDocumentCaption() + '*', true); this.headerView.setDocumentCaption(this.headerView.getDocumentCaption(), true);
} }
} else { } else {
this.headerView.setDocumentCaption(this.headerView.getDocumentCaption()); if (this._state.fastCoauth && this._state.usersCount>1) {
var me = this;
this._state.timerCaption = setTimeout(function () {
me.headerView.setDocumentCaption(me.headerView.getDocumentCaption(), false);
}, 500);
} else
this.headerView.setDocumentCaption(this.headerView.getDocumentCaption(), false);
} }
if (window.document.title != title) if (window.document.title != title)
window.document.title = title; window.document.title = title;
if (!this._state.fastCoauth || this._state.usersCount<2 ) Common.Gateway.setDocumentModified(change);
Common.Gateway.setDocumentModified(change);
else if ( this._state.startModifyDocument!==undefined && this._state.startModifyDocument === change){
Common.Gateway.setDocumentModified(change);
this._state.startModifyDocument = (this._state.startModifyDocument) ? !this._state.startModifyDocument : undefined;
}
this._state.isDocModified = change; this._state.isDocModified = change;
} }
}, },
@ -1297,8 +1305,6 @@ define([
}, },
onDocumentModifiedChanged: function(change) { onDocumentModifiedChanged: function(change) {
if (this._state.fastCoauth && this._state.usersCount>1 && this._state.startModifyDocument===undefined ) return;
this.updateWindowTitle(change); this.updateWindowTitle(change);
Common.Gateway.setDocumentModified(change); Common.Gateway.setDocumentModified(change);
@ -1360,10 +1366,6 @@ define([
$('#loading-mask').hide().remove(); $('#loading-mask').hide().remove();
}, },
onSaveUrl: function(url) {
Common.Gateway.save(url);
},
onDownloadUrl: function(url) { onDownloadUrl: function(url) {
Common.Gateway.downloadAs(url); Common.Gateway.downloadAs(url);
}, },
@ -2057,7 +2059,7 @@ define([
errorFileVKey: 'External error.<br>Incorrect securety key. Please, contact support.', errorFileVKey: 'External error.<br>Incorrect securety key. Please, contact support.',
errorStockChart: 'Incorrect row order. To build a stock chart place the data on the sheet in the following order:<br> opening price, max price, min price, closing price.', errorStockChart: 'Incorrect row order. To build a stock chart place the data on the sheet in the following order:<br> opening price, max price, min price, closing price.',
errorDataRange: 'Incorrect data range.', errorDataRange: 'Incorrect data range.',
errorOperandExpected: 'Operand expected', errorOperandExpected: 'The entered function syntax is not correct. Please check if you are missing one of the parentheses - \'(\' or \')\'.',
errorKeyEncrypt: 'Unknown key descriptor', errorKeyEncrypt: 'Unknown key descriptor',
errorKeyExpire: 'Key descriptor expired', errorKeyExpire: 'Key descriptor expired',
errorUsersExceed: 'Count of users was exceed', errorUsersExceed: 'Count of users was exceed',

View file

@ -307,7 +307,7 @@ define([
if (this.api) { if (this.api) {
var isModified = this.api.asc_isDocumentCanSave(); var isModified = this.api.asc_isDocumentCanSave();
var isSyncButton = $('.btn-icon', this.toolbar.btnSave.cmpEl).hasClass('btn-synch'); var isSyncButton = $('.btn-icon', this.toolbar.btnSave.cmpEl).hasClass('btn-synch');
if (!isModified && !isSyncButton) if (!isModified && !isSyncButton && !this.toolbar.mode.forcesave)
return; return;
this.api.asc_Save(); this.api.asc_Save();
@ -608,7 +608,7 @@ define([
if (me.api) { if (me.api) {
var merged = me.api.asc_getCellInfo().asc_getFlags().asc_getMerge(); var merged = me.api.asc_getCellInfo().asc_getFlags().asc_getMerge();
if (!merged && me.api.asc_mergeCellsDataLost(item.value)) { if ((merged !== Asc.c_oAscMergeOptions.Merge) && me.api.asc_mergeCellsDataLost(item.value)) {
Common.UI.warning({ Common.UI.warning({
msg: me.warnMergeLostData, msg: me.warnMergeLostData,
buttons: ['yes', 'no'], buttons: ['yes', 'no'],
@ -1308,8 +1308,13 @@ define([
shortcuts: { shortcuts: {
'command+l,ctrl+l': function(e) { 'command+l,ctrl+l': function(e) {
if (me.editMode && !me._state.multiselect) { if (me.editMode && !me._state.multiselect) {
if (!me.api.asc_getCellInfo().asc_getFormatTableInfo()) var formattableinfo = me.api.asc_getCellInfo().asc_getFormatTableInfo();
me._setTableFormat(me.toolbar.mnuTableTemplatePicker.store.at(23).get('name')); if (!formattableinfo) {
if (_.isUndefined(me.toolbar.mnuTableTemplatePicker))
me.onApiInitTableTemplates(me.api.asc_getTablePictures(formattableinfo));
var store = me.getCollection('TableTemplates');
me._setTableFormat(store.at(23).get('name'));
}
} }
return false; return false;
@ -1935,7 +1940,7 @@ define([
val = info.asc_getFlags().asc_getMerge(); val = info.asc_getFlags().asc_getMerge();
if (this._state.merge !== val) { if (this._state.merge !== val) {
toolbar.btnMerge.toggle(val===true, true); toolbar.btnMerge.toggle(val===Asc.c_oAscMergeOptions.Merge, true);
this._state.merge = val; this._state.merge = val;
} }
@ -2564,8 +2569,23 @@ define([
if (me._state.tablename) if (me._state.tablename)
me.api.asc_changeAutoFilter(me._state.tablename, Asc.c_oAscChangeFilterOptions.style, fmtname); me.api.asc_changeAutoFilter(me._state.tablename, Asc.c_oAscChangeFilterOptions.style, fmtname);
else else {
me.api.asc_addAutoFilter(fmtname, dlg.getSettings()); var settings = dlg.getSettings();
if (settings.selectionType == Asc.c_oAscSelectionType.RangeMax || settings.selectionType == Asc.c_oAscSelectionType.RangeRow ||
settings.selectionType == Asc.c_oAscSelectionType.RangeCol)
Common.UI.warning({
title: me.textLongOperation,
msg: me.warnLongOperation,
buttons: ['ok', 'cancel'],
callback: function(btn) {
if (btn == 'ok')
setTimeout(function() { me.api.asc_addAutoFilter(fmtname, settings.range)}, 1);
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
}
});
else
me.api.asc_addAutoFilter(fmtname, settings.range);
}
} }
Common.NotificationCenter.trigger('edit:complete', me.toolbar); Common.NotificationCenter.trigger('edit:complete', me.toolbar);
@ -2577,14 +2597,30 @@ define([
win.show(); win.show();
win.setSettings({ win.setSettings({
api : me.api api : me.api,
selectionType: me.api.asc_getCellInfo().asc_getFlags().asc_getSelectionType()
}); });
} else { } else {
me._state.filter = undefined; me._state.filter = undefined;
if (me._state.tablename) if (me._state.tablename)
me.api.asc_changeAutoFilter(me._state.tablename, Asc.c_oAscChangeFilterOptions.style, fmtname); me.api.asc_changeAutoFilter(me._state.tablename, Asc.c_oAscChangeFilterOptions.style, fmtname);
else else {
me.api.asc_addAutoFilter(fmtname); var selectionType = me.api.asc_getCellInfo().asc_getFlags().asc_getSelectionType();
if (selectionType == Asc.c_oAscSelectionType.RangeMax || selectionType == Asc.c_oAscSelectionType.RangeRow ||
selectionType == Asc.c_oAscSelectionType.RangeCol)
Common.UI.warning({
title: me.textLongOperation,
msg: me.warnLongOperation,
buttons: ['ok', 'cancel'],
callback: function(btn) {
if (btn == 'ok')
setTimeout(function() { me.api.asc_addAutoFilter(fmtname)}, 1);
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
}
});
else
me.api.asc_addAutoFilter(fmtname);
}
} }
} }
}, },
@ -3017,7 +3053,9 @@ define([
txtExpandSort: 'The data next to the selection will not be sorted. Do you want to expand the selection to include the adjacent data or continue with sorting the currently selected cells only?', txtExpandSort: 'The data next to the selection will not be sorted. Do you want to expand the selection to include the adjacent data or continue with sorting the currently selected cells only?',
txtExpand: 'Expand and sort', txtExpand: 'Expand and sort',
txtSorting: 'Sorting', txtSorting: 'Sorting',
txtSortSelected: 'Sort selected' txtSortSelected: 'Sort selected',
textLongOperation: 'Long operation',
warnLongOperation: 'The operation you are about to perform might take rather much time to complete.<br>Are you sure you want to continue?'
}, SSE.Controllers.Toolbar || {})); }, SSE.Controllers.Toolbar || {}));
}); });

View file

@ -335,35 +335,35 @@
<!--<div id="spark-dlg-radio-single" style="display: block;"></div>--> <!--<div id="spark-dlg-radio-single" style="display: block;"></div>-->
<!--</div>--> <!--</div>-->
<table cols="2" style="width: 100%;"> <table cols="2" style="width: 100%;">
<tr> <!--<tr>-->
<td colspan=2 > <!--<td colspan=2 >-->
<label class="header"><%= scope.textDataRange %></label> <!--<label class="header"><%= scope.textDataRange %></label>-->
</td> <!--</td>-->
</tr> <!--</tr>-->
<tr> <!--<tr>-->
<td class="padding-small" width="200"> <!--<td class="padding-small" width="200">-->
<div id="spark-dlg-txt-range" class="input-row" style="margin-right: 10px;"></div> <!--<div id="spark-dlg-txt-range" class="input-row" style="margin-right: 10px;"></div>-->
</td> <!--</td>-->
<td class="padding-small" style="text-align: right;"> <!--<td class="padding-small" style="text-align: right;">-->
<button type="button" class="btn btn-text-default" id="spark-dlg-btn-data" style="min-width: 100px;"><%= scope.textSelectData %></button> <!--<button type="button" class="btn btn-text-default" id="spark-dlg-btn-data" style="min-width: 100px;"><%= scope.textSelectData %></button>-->
</td> <!--</td>-->
</tr> <!--</tr>-->
<tr> <!--<tr>-->
<td colspan=2 > <!--<td colspan=2 >-->
<label class="header"><%= scope.textLocationRange %></label> <!--<label class="header"><%= scope.textLocationRange %></label>-->
</td> <!--</td>-->
</tr> <!--</tr>-->
<tr> <!--<tr>-->
<td class="padding-large" width="200"> <!--<td class="padding-large" width="200">-->
<div id="spark-dlg-txt-location" class="input-row" style="margin-right: 10px;"></div> <!--<div id="spark-dlg-txt-location" class="input-row" style="margin-right: 10px;"></div>-->
</td> <!--</td>-->
<td class="padding-large" style="text-align: right;"> <!--<td class="padding-large" style="text-align: right;">-->
<button type="button" class="btn btn-text-default" id="spark-dlg-btn-location-data" style="min-width: 100px;"><%= scope.textSelectData %></button> <!--<button type="button" class="btn btn-text-default" id="spark-dlg-btn-location-data" style="min-width: 100px;"><%= scope.textSelectData %></button>-->
</td> <!--</td>-->
</tr> <!--</tr>-->
<tr> <!--<tr>-->
<td colspan=2 class="padding-large"></td> <!--<td colspan=2 class="padding-large"></td>-->
</tr> <!--</tr>-->
<tr> <tr>
<td colspan=2 class="padding-small"> <td colspan=2 class="padding-small">
<label class="header"><%= scope.textEmptyCells %></label> <label class="header"><%= scope.textEmptyCells %></label>

View file

@ -748,10 +748,12 @@ define([
itemTemplate: _.template([ itemTemplate: _.template([
'<div>', '<div>',
'<label class="checkbox-indeterminate" style="position:absolute;">', '<label class="checkbox-indeterminate" style="position:absolute;">',
'<% if (!check) { %>', '<% if (check=="indeterminate") { %>',
'<input type="button" class="img-commonctrl"/>', '<input type="button" class="indeterminate img-commonctrl"/>',
'<% } else { %>', '<% } else if (check) { %>',
'<input type="button" class="checked img-commonctrl"/>', '<input type="button" class="checked img-commonctrl"/>',
'<% } else { %>',
'<input type="button" class="img-commonctrl"/>',
'<% } %>', '<% } %>',
'</label>', '</label>',
'<div id="<%= id %>" class="list-item" style="pointer-events:none;margin-left:20px;display:inline-block;width: 185px;"><%= Common.Utils.String.htmlEncode(value) %></div>', '<div id="<%= id %>" class="list-item" style="pointer-events:none;margin-left:20px;display:inline-block;width: 185px;"><%= Common.Utils.String.htmlEncode(value) %></div>',
@ -1035,6 +1037,18 @@ define([
} else { } else {
record.set('check', check); record.set('check', check);
idxs[parseInt(record.get('throughIndex'))] = check; idxs[parseInt(record.get('throughIndex'))] = check;
var selectAllState = check;
for (var i=0; i< this.cells.length; i++) {
var cell = this.cells.at(i);
if ('1' == cell.get('groupid') && cell.get('check') !== check) {
selectAllState = 'indeterminate';
break;
}
}
this.checkCellTrigerBlock = true;
this.cells.at(0).set('check', selectAllState);
this.checkCellTrigerBlock = undefined;
} }
this.btnOk.setDisabled(false); this.btnOk.setDisabled(false);
@ -1182,7 +1196,8 @@ define([
isnumber, value, isnumber, value,
index = 0, throughIndex = 2, index = 0, throughIndex = 2,
applyfilter = true, applyfilter = true,
haveUnselectedCell = false, selectAllState = false,
selectedCells = 0,
arr = [], arrEx = [], arr = [], arrEx = [],
idxs = (me.filter) ? me.filteredIndexes : me.throughIndexes; idxs = (me.filter) ? me.filteredIndexes : me.throughIndexes;
@ -1212,9 +1227,7 @@ define([
check : idxs[throughIndex], check : idxs[throughIndex],
throughIndex : throughIndex throughIndex : throughIndex
})); }));
if (!idxs[throughIndex]) { if (idxs[throughIndex]) selectedCells++;
haveUnselectedCell = true;
}
} else { } else {
arrEx.push(new Common.UI.DataViewModel({ arrEx.push(new Common.UI.DataViewModel({
cellvalue : value cellvalue : value
@ -1224,6 +1237,9 @@ define([
++throughIndex; ++throughIndex;
}); });
if (selectedCells==arr.length) selectAllState = true;
else if (selectedCells>0) selectAllState = 'indeterminate';
if (me.filter || idxs[0]==undefined) if (me.filter || idxs[0]==undefined)
idxs[0] = true; idxs[0] = true;
if (!me.filter || arr.length>0) if (!me.filter || arr.length>0)
@ -1255,7 +1271,7 @@ define([
if (this.cells.length) { if (this.cells.length) {
this.checkCellTrigerBlock = true; this.checkCellTrigerBlock = true;
this.cells.at(0).set('check', !haveUnselectedCell); this.cells.at(0).set('check', selectAllState);
this.checkCellTrigerBlock = undefined; this.checkCellTrigerBlock = undefined;
} }
this.btnOk.setDisabled(this.cells.length<1); this.btnOk.setDisabled(this.cells.length<1);

View file

@ -136,7 +136,7 @@ define([
}, },
onApiRangeChanged: function(info) { onApiRangeChanged: function(info) {
this.inputRange.setValue(info); this.inputRange.setValue(info.asc_getName());
if (this.inputRange.cmpEl.hasClass('error')) if (this.inputRange.cmpEl.hasClass('error'))
this.inputRange.cmpEl.removeClass('error'); this.inputRange.cmpEl.removeClass('error');
}, },

View file

@ -181,7 +181,7 @@ define([
if (this._isChartStylesChanged) { if (this._isChartStylesChanged) {
if (rec) if (rec)
this.cmbChartStyle.fillComboView(this.cmbChartStyle.menuPicker.getSelectedRec(),true); this.cmbChartStyle.fillComboView(this.cmbChartStyle.menuPicker.getSelectedRec()[0],true);
else else
this.cmbChartStyle.fillComboView(this.cmbChartStyle.menuPicker.store.at(0), true); this.cmbChartStyle.fillComboView(this.cmbChartStyle.menuPicker.store.at(0), true);
} }
@ -925,6 +925,7 @@ define([
{ {
chartSettings: props, chartSettings: props,
imageSettings: (me.isChart) ? me._originalProps : null, imageSettings: (me.isChart) ? me._originalProps : null,
sparklineStyles: me.sparklineStyles,
isChart: me.isChart, isChart: me.isChart,
api: me.api, api: me.api,
handler: function(result, value) { handler: function(result, value) {
@ -1109,6 +1110,7 @@ define([
if (styles && styles.length>1){ if (styles && styles.length>1){
var stylesStore = this.cmbSparkStyle.menuPicker.store, var stylesStore = this.cmbSparkStyle.menuPicker.store,
selectedIdx = styles[styles.length-1]; selectedIdx = styles[styles.length-1];
this.sparklineStyles = styles;
if (stylesStore.length == styles.length-1) { if (stylesStore.length == styles.length-1) {
var data = stylesStore.models; var data = stylesStore.models;
for (var i=0; i<styles.length-1; i++) { for (var i=0; i<styles.length-1; i++) {

View file

@ -91,6 +91,7 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
this.api = this.options.api; this.api = this.options.api;
this.chartSettings = this.options.chartSettings; this.chartSettings = this.options.chartSettings;
this.imageSettings = this.options.imageSettings; this.imageSettings = this.options.imageSettings;
this.sparklineStyles = this.options.sparklineStyles;
this.isChart = this.options.isChart; this.isChart = this.options.isChart;
this.vertAxisProps = null; this.vertAxisProps = null;
this.horAxisProps = null; this.horAxisProps = null;
@ -819,7 +820,8 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
itemHeight: 50, itemHeight: 50,
menuMaxHeight: 272, menuMaxHeight: 272,
enableKeyEvents: true, enableKeyEvents: true,
cls: 'combo-spark-style' cls: 'combo-spark-style',
minWidth: 190
}); });
this.cmbSparkStyle.render($('#spark-dlg-combo-style')); this.cmbSparkStyle.render($('#spark-dlg-combo-style'));
this.cmbSparkStyle.openButton.menu.cmpEl.css({ this.cmbSparkStyle.openButton.menu.cmpEl.css({
@ -844,7 +846,7 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
labelText: this.textSingle, labelText: this.textSingle,
name: 'asc-radio-sparkline' name: 'asc-radio-sparkline'
}); });
*/
this.txtSparkDataRange = new Common.UI.InputField({ this.txtSparkDataRange = new Common.UI.InputField({
el : $('#spark-dlg-txt-range'), el : $('#spark-dlg-txt-range'),
name : 'range', name : 'range',
@ -872,6 +874,7 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
el: $('#spark-dlg-btn-location-data') el: $('#spark-dlg-btn-location-data')
}); });
this.btnSelectLocationData.on('click', _.bind(this.onSelectLocationData, this)); this.btnSelectLocationData.on('click', _.bind(this.onSelectLocationData, this));
*/
this._arrEmptyCells = [ this._arrEmptyCells = [
{ value: Asc.c_oAscEDispBlanksAs.Gap, displayValue: this.textGaps }, { value: Asc.c_oAscEDispBlanksAs.Gap, displayValue: this.textGaps },
@ -1382,7 +1385,7 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
if (record) if (record)
this.btnSparkType.setIconCls('item-chartlist ' + record.get('iconCls')); this.btnSparkType.setIconCls('item-chartlist ' + record.get('iconCls'));
this.updateSparkStyles(props.asc_getStyles()); this.updateSparkStyles((this.sparklineStyles) ? this.sparklineStyles : props.asc_getStyles());
if (this._state.SparkType !== Asc.c_oAscSparklineType.Line) if (this._state.SparkType !== Asc.c_oAscSparklineType.Line)
this._arrEmptyCells.pop(); this._arrEmptyCells.pop();
@ -1402,6 +1405,7 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
this.spnSparkMinValue.setValue((props.asc_getManualMin() !== null) ? props.asc_getManualMin() : '', true); this.spnSparkMinValue.setValue((props.asc_getManualMin() !== null) ? props.asc_getManualMin() : '', true);
this.spnSparkMaxValue.setValue((props.asc_getManualMax() !== null) ? props.asc_getManualMax() : '', true); this.spnSparkMaxValue.setValue((props.asc_getManualMax() !== null) ? props.asc_getManualMax() : '', true);
/*
var value = props.asc_getDataRanges(); var value = props.asc_getDataRanges();
if (value && value.length==2) { if (value && value.length==2) {
this.txtSparkDataRange.setValue((value[0]) ? value[0] : ''); this.txtSparkDataRange.setValue((value[0]) ? value[0] : '');
@ -1425,6 +1429,7 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
return (isvalid==Asc.c_oAscError.ID.DataRangeError) ? me.textInvalidRange : true; return (isvalid==Asc.c_oAscError.ID.DataRangeError) ? me.textInvalidRange : true;
}; };
} }
*/
this._changedProps = new Asc.sparklineGroup(); this._changedProps = new Asc.sparklineGroup();
this._noApply = false; this._noApply = false;

View file

@ -418,6 +418,10 @@ define([
caption : me.advancedShapeText caption : me.advancedShapeText
}); });
me.mnuImgAdvanced = new Common.UI.MenuItem({
caption : me.advancedImgText
});
me.mnuChartEdit = new Common.UI.MenuItem({ me.mnuChartEdit = new Common.UI.MenuItem({
caption : me.chartText caption : me.chartText
}); });
@ -469,7 +473,8 @@ define([
me.mnuUnGroupImg, me.mnuUnGroupImg,
me.mnuShapeSeparator, me.mnuShapeSeparator,
me.mnuChartEdit, me.mnuChartEdit,
me.mnuShapeAdvanced me.mnuShapeAdvanced,
me.mnuImgAdvanced
] ]
}); });
@ -680,17 +685,17 @@ define([
textFreezePanes: 'Freeze Panes', textFreezePanes: 'Freeze Panes',
textUnFreezePanes: 'Unfreeze Panes', textUnFreezePanes: 'Unfreeze Panes',
txtSelect: 'Select', txtSelect: 'Select',
selectRowText : 'Select Row', selectRowText : 'Row',
selectColumnText : 'Select Entire Column', selectColumnText : 'Entire Column',
selectDataText : 'Select Column Data', selectDataText : 'Column Data',
selectTableText : 'Select Table', selectTableText : 'Table',
insertRowAboveText : 'Insert Row Above', insertRowAboveText : 'Row Above',
insertRowBelowText : 'Insert Row Below', insertRowBelowText : 'Row Below',
insertColumnLeftText : 'Insert Column Left', insertColumnLeftText : 'Column Left',
insertColumnRightText : 'Insert Column Right', insertColumnRightText : 'Column Right',
deleteRowText : 'Delete Row', deleteRowText : 'Row',
deleteColumnText : 'Delete Column', deleteColumnText : 'Column',
deleteTableText : 'Delete Table', deleteTableText : 'Table',
txtFilter: 'Filter', txtFilter: 'Filter',
txtFilterValue: 'Filter by Selected cell\'s value', txtFilterValue: 'Filter by Selected cell\'s value',
txtFilterCellColor: 'Filter by cell\'s color', txtFilterCellColor: 'Filter by cell\'s color',
@ -706,7 +711,8 @@ define([
txtSparklines: 'Sparklines', txtSparklines: 'Sparklines',
txtClearSparklines: 'Clear Selected Sparklines', txtClearSparklines: 'Clear Selected Sparklines',
txtClearSparklineGroups: 'Clear Selected Sparkline Groups', txtClearSparklineGroups: 'Clear Selected Sparkline Groups',
txtShowComment: 'Show Comment' txtShowComment: 'Show Comment',
advancedImgText: 'Image Advanced Settings'
}, SSE.Views.DocumentHolder || {})); }, SSE.Views.DocumentHolder || {}));
}); });

View file

@ -288,13 +288,16 @@ define([
this.cmbType.selectRecord(selectedItem); this.cmbType.selectRecord(selectedItem);
else if (props.formatInfo.asc_getType() == Asc.c_oAscNumFormatType.Fraction) else if (props.formatInfo.asc_getType() == Asc.c_oAscNumFormatType.Fraction)
this.cmbType.setValue(this.txtCustom); this.cmbType.setValue(this.txtCustom);
else if (props.formatInfo.asc_getType() == Asc.c_oAscNumFormatType.Time)
this.cmbType.setValue(this.api.asc_getLocaleExample(props.format, 1.534));
else else
this.cmbType.setValue(this.api.asc_getLocaleExample(props.format), 37973); this.cmbType.setValue(this.api.asc_getLocaleExample(props.format, 38822));
} }
this.Format = props.format; this.Format = props.format;
this.lblExample.text(this.api.asc_getLocaleExample(this.Format));
} }
// for fraction - if props.format not in cmbType - setValue(this.txtCustom) // for fraction - if props.format not in cmbType - setValue(this.txtCustom)
// for date/time - if props.format not in cmbType - setValue(this.api.asc_getLocaleExample(props.format, 37973)) // for date/time - if props.format not in cmbType - setValue(this.api.asc_getLocaleExample(props.format, 38822))
// for cmbNegative - if props.format not in cmbNegative - setValue(this.api.asc_getLocaleExample(props.format)) // for cmbNegative - if props.format not in cmbNegative - setValue(this.api.asc_getLocaleExample(props.format))
} }
}, },
@ -439,7 +442,7 @@ define([
var formatsarr = this.api.asc_getFormatCells(info), var formatsarr = this.api.asc_getFormatCells(info),
data = [], data = [],
exampleVal = (record.value == Asc.c_oAscNumFormatType.Date) ? 37973 : ((record.value == Asc.c_oAscNumFormatType.Time) ? 0.123 : parseFloat("-1234.12345678901234567890")); exampleVal = (record.value == Asc.c_oAscNumFormatType.Date) ? 38822 : ((record.value == Asc.c_oAscNumFormatType.Time) ? 1.534 : parseFloat("-1234.12345678901234567890"));
formatsarr.forEach(function(item) { formatsarr.forEach(function(item) {
data.push({value: item, displayValue: me.api.asc_getLocaleExample(item, exampleVal)}); data.push({value: item, displayValue: me.api.asc_getLocaleExample(item, exampleVal)});
}); });

View file

@ -339,6 +339,25 @@ define([
return this; return this;
}, },
setDeveloperMode: function(mode) {
if ( !this.$el.is(':visible') ) return;
if (!this.developerHint) {
this.developerHint = $('<div id="developer-hint">' + this.txtDeveloper + '</div>').appendTo(this.$el);
this.devHeight = this.developerHint.outerHeight();
$(window).on('resize', _.bind(this.onWindowResize, this));
}
this.developerHint.toggleClass('hidden', !mode);
var lastbtn = this.$el.find('button.btn-category:visible:last-of-type');
this.minDevPosition = lastbtn.offset().top - lastbtn.offsetParent().offset().top + lastbtn.height() + 20;
this.onWindowResize();
},
onWindowResize: function() {
this.developerHint.css('top', Math.max((this.$el.height()-this.devHeight)/2, this.minDevPosition));
},
/** coauthoring begin **/ /** coauthoring begin **/
tipComments : 'Comments', tipComments : 'Comments',
tipChat : 'Chat', tipChat : 'Chat',
@ -347,6 +366,7 @@ define([
tipSupport : 'Feedback & Support', tipSupport : 'Feedback & Support',
tipFile : 'File', tipFile : 'File',
tipSearch : 'Search', tipSearch : 'Search',
tipPlugins : 'Plugins' tipPlugins : 'Plugins',
txtDeveloper: 'DEVELOPER MODE'
}, SSE.Views.LeftMenu || {})); }, SSE.Views.LeftMenu || {}));
}); });

View file

@ -364,8 +364,8 @@ define([
} }
}, },
onHideMenus: function(e){ onHideMenus: function(menu, e, isFromInputControl){
Common.NotificationCenter.trigger('edit:complete', this); if (!isFromInputControl) Common.NotificationCenter.trigger('edit:complete', this);
}, },
setLocked: function (locked) { setLocked: function (locked) {

View file

@ -77,28 +77,32 @@ define([
asctype: Common.Utils.documentSettingsType.Paragraph, asctype: Common.Utils.documentSettingsType.Paragraph,
enableToggle: true, enableToggle: true,
disabled: true, disabled: true,
toggleGroup: 'tabpanelbtnsGroup' toggleGroup: 'tabpanelbtnsGroup',
allowMouseEventsOnDisabled: true
}); });
this.btnImage = new Common.UI.Button({ this.btnImage = new Common.UI.Button({
hint: this.txtImageSettings, hint: this.txtImageSettings,
asctype: Common.Utils.documentSettingsType.Image, asctype: Common.Utils.documentSettingsType.Image,
enableToggle: true, enableToggle: true,
disabled: true, disabled: true,
toggleGroup: 'tabpanelbtnsGroup' toggleGroup: 'tabpanelbtnsGroup',
allowMouseEventsOnDisabled: true
}); });
this.btnChart = new Common.UI.Button({ this.btnChart = new Common.UI.Button({
hint: this.txtChartSettings, hint: this.txtChartSettings,
asctype: Common.Utils.documentSettingsType.Chart, asctype: Common.Utils.documentSettingsType.Chart,
enableToggle: true, enableToggle: true,
disabled: true, disabled: true,
toggleGroup: 'tabpanelbtnsGroup' toggleGroup: 'tabpanelbtnsGroup',
allowMouseEventsOnDisabled: true
}); });
this.btnShape = new Common.UI.Button({ this.btnShape = new Common.UI.Button({
hint: this.txtShapeSettings, hint: this.txtShapeSettings,
asctype: Common.Utils.documentSettingsType.Shape, asctype: Common.Utils.documentSettingsType.Shape,
enableToggle: true, enableToggle: true,
disabled: true, disabled: true,
toggleGroup: 'tabpanelbtnsGroup' toggleGroup: 'tabpanelbtnsGroup',
allowMouseEventsOnDisabled: true
}); });
this.btnTextArt = new Common.UI.Button({ this.btnTextArt = new Common.UI.Button({
@ -106,7 +110,8 @@ define([
asctype: Common.Utils.documentSettingsType.TextArt, asctype: Common.Utils.documentSettingsType.TextArt,
enableToggle: true, enableToggle: true,
disabled: true, disabled: true,
toggleGroup: 'tabpanelbtnsGroup' toggleGroup: 'tabpanelbtnsGroup',
allowMouseEventsOnDisabled: true
}); });
this.btnTable = new Common.UI.Button({ this.btnTable = new Common.UI.Button({
@ -114,7 +119,8 @@ define([
asctype: Common.Utils.documentSettingsType.Table, asctype: Common.Utils.documentSettingsType.Table,
enableToggle: true, enableToggle: true,
disabled: true, disabled: true,
toggleGroup: 'tabpanelbtnsGroup' toggleGroup: 'tabpanelbtnsGroup',
allowMouseEventsOnDisabled: true
}); });
this._settings = []; this._settings = [];

View file

@ -1258,6 +1258,18 @@ define([
this.sldrGradient.on('thumbdblclick', function(cmp){ this.sldrGradient.on('thumbdblclick', function(cmp){
me.btnGradColor.cmpEl.find('button').dropdown('toggle'); me.btnGradColor.cmpEl.find('button').dropdown('toggle');
}); });
this.sldrGradient.on('sortthumbs', function(cmp, recalc_indexes){
var colors = [],
currentIdx;
_.each (recalc_indexes, function(recalc_index, index) {
colors.push(me.GradColor.colors[recalc_index]);
if (me.GradColor.currentIdx == recalc_index)
currentIdx = index;
});
me.OriginalFillType = null;
me.GradColor.colors = colors;
me.GradColor.currentIdx = currentIdx;
});
this.fillControls.push(this.sldrGradient); this.fillControls.push(this.sldrGradient);
this.cmbBorderSize = new Common.UI.ComboBorderSizeEditable({ this.cmbBorderSize = new Common.UI.ComboBorderSizeEditable({

View file

@ -189,6 +189,8 @@ define([
this.panelUsers = $('#status-users-ct', this.el); this.panelUsers = $('#status-users-ct', this.el);
this.panelUsers.on('shown.bs.dropdown', function () { this.panelUsers.on('shown.bs.dropdown', function () {
me.panelUsersList.scroller.update({minScrollbarLength : 40, alwaysVisibleY: true}); me.panelUsersList.scroller.update({minScrollbarLength : 40, alwaysVisibleY: true});
var tip = me.panelUsersBlock.data('bs.tooltip');
if (tip) tip.hide();
}); });
this.panelUsersBlock = this.panelUsers.find('#status-users-block'); this.panelUsersBlock = this.panelUsers.find('#status-users-block');

View file

@ -74,6 +74,7 @@ define([
this.options.tpl = _.template(this.template, this.options); this.options.tpl = _.template(this.template, this.options);
this.checkRangeType = Asc.c_oAscSelectionDialogType.FormatTable; this.checkRangeType = Asc.c_oAscSelectionDialogType.FormatTable;
this.selectionType = Asc.c_oAscSelectionType.RangeCells;
Common.UI.Window.prototype.initialize.call(this, this.options); Common.UI.Window.prototype.initialize.call(this, this.options);
}, },
@ -129,6 +130,8 @@ define([
} }
if (settings.title) if (settings.title)
me.setTitle(settings.title); me.setTitle(settings.title);
if (settings.selectionType)
me.selectionType = settings.selectionType;
me.api.asc_unregisterCallback('asc_onSelectionRangeChanged', _.bind(me.onApiRangeChanged, me)); me.api.asc_unregisterCallback('asc_onSelectionRangeChanged', _.bind(me.onApiRangeChanged, me));
me.api.asc_registerCallback('asc_onSelectionRangeChanged', _.bind(me.onApiRangeChanged, me)); me.api.asc_registerCallback('asc_onSelectionRangeChanged', _.bind(me.onApiRangeChanged, me));
@ -145,15 +148,16 @@ define([
if (this.checkRangeType == Asc.c_oAscSelectionDialogType.FormatTable) { if (this.checkRangeType == Asc.c_oAscSelectionDialogType.FormatTable) {
var options = this.api.asc_getAddFormatTableOptions(this.inputRange.getValue()); var options = this.api.asc_getAddFormatTableOptions(this.inputRange.getValue());
options.asc_setIsTitle(this.cbTitle.checked); options.asc_setIsTitle(this.cbTitle.checked);
return options; return { selectionType: this.selectionType, range: options};
} else } else
return this.inputRange.getValue(); return { selectionType: this.selectionType, range: this.inputRange.getValue()};
}, },
onApiRangeChanged: function(info) { onApiRangeChanged: function(info) {
this.inputRange.setValue(info); this.inputRange.setValue(info.asc_getName());
if (this.inputRange.cmpEl.hasClass('error')) if (this.inputRange.cmpEl.hasClass('error'))
this.inputRange.cmpEl.removeClass('error'); this.inputRange.cmpEl.removeClass('error');
this.selectionType = info.asc_getType();
}, },
isRangeValid: function() { isRangeValid: function() {

View file

@ -325,7 +325,7 @@ define([
if (this._initSettings) if (this._initSettings)
this.createDelayedControls(); this.createDelayedControls();
this.disableControls(this._locked); this.disableControls(this._locked); // need to update combodataview after disabled state
if (props )//formatTableInfo if (props )//formatTableInfo
{ {
@ -405,7 +405,7 @@ define([
if (this._isTemplatesChanged) { if (this._isTemplatesChanged) {
if (rec) if (rec)
this.cmbTableTemplate.fillComboView(this.cmbTableTemplate.menuPicker.getSelectedRec(),true); this.cmbTableTemplate.fillComboView(this.cmbTableTemplate.menuPicker.getSelectedRec()[0],true);
else else
this.cmbTableTemplate.fillComboView(this.cmbTableTemplate.menuPicker.store.at(0), true); this.cmbTableTemplate.fillComboView(this.cmbTableTemplate.menuPicker.store.at(0), true);
} }
@ -444,6 +444,7 @@ define([
self.cmbTableTemplate.menuPicker.scroller.update({alwaysVisibleY: true}); self.cmbTableTemplate.menuPicker.scroller.update({alwaysVisibleY: true});
}); });
this.lockedControls.push(this.cmbTableTemplate); this.lockedControls.push(this.cmbTableTemplate);
if (this._locked) this.cmbTableTemplate.setDisabled(this._locked);
} }
var count = self.cmbTableTemplate.menuPicker.store.length; var count = self.cmbTableTemplate.menuPicker.store.length;
@ -477,10 +478,25 @@ define([
var handlerDlg = function(dlg, result) { var handlerDlg = function(dlg, result) {
if (result == 'ok') { if (result == 'ok') {
me.api.asc_setSelectionDialogMode(Asc.c_oAscSelectionDialogType.None); me.api.asc_setSelectionDialogMode(Asc.c_oAscSelectionDialogType.None);
me.api.asc_changeTableRange(me._state.TableName, dlg.getSettings());
var settings = dlg.getSettings();
if (settings.selectionType == Asc.c_oAscSelectionType.RangeMax || settings.selectionType == Asc.c_oAscSelectionType.RangeRow ||
settings.selectionType == Asc.c_oAscSelectionType.RangeCol)
Common.UI.warning({
title: me.textLongOperation,
msg: me.warnLongOperation,
buttons: ['ok', 'cancel'],
callback: function(btn) {
if (btn == 'ok')
setTimeout(function() { me.api.asc_changeTableRange(me._state.TableName, settings.range)}, 1);
Common.NotificationCenter.trigger('edit:complete', me);
}
});
else
me.api.asc_changeTableRange(me._state.TableName, settings.range);
} }
Common.NotificationCenter.trigger('edit:complete', me.toolbar); Common.NotificationCenter.trigger('edit:complete', me);
}; };
var win = new SSE.Views.TableOptionsDialog({ var win = new SSE.Views.TableOptionsDialog({
handler: handlerDlg handler: handlerDlg
@ -544,7 +560,9 @@ define([
notcriticalErrorTitle : 'Warning', notcriticalErrorTitle : 'Warning',
textReservedName : 'The name you are trying to use is already referenced in cell formulas. Please use some other name.', textReservedName : 'The name you are trying to use is already referenced in cell formulas. Please use some other name.',
textAdvanced: 'Show advanced settings', textAdvanced: 'Show advanced settings',
textConvertRange: 'Convert to range' textConvertRange: 'Convert to range',
textLongOperation: 'Long operation',
warnLongOperation: 'The operation you are about to perform might take rather much time to complete.<br>Are you sure you want to continue?'
}, SSE.Views.TableSettings || {})); }, SSE.Views.TableSettings || {}));
}); });

View file

@ -1228,6 +1228,18 @@ define([
this.sldrGradient.on('thumbdblclick', function(cmp){ this.sldrGradient.on('thumbdblclick', function(cmp){
me.btnGradColor.cmpEl.find('button').dropdown('toggle'); me.btnGradColor.cmpEl.find('button').dropdown('toggle');
}); });
this.sldrGradient.on('sortthumbs', function(cmp, recalc_indexes){
var colors = [],
currentIdx;
_.each (recalc_indexes, function(recalc_index, index) {
colors.push(me.GradColor.colors[recalc_index]);
if (me.GradColor.currentIdx == recalc_index)
currentIdx = index;
});
me.OriginalFillType = null;
me.GradColor.colors = colors;
me.GradColor.currentIdx = currentIdx;
});
this.lockedControls.push(this.sldrGradient); this.lockedControls.push(this.sldrGradient);
this.cmbBorderSize = new Common.UI.ComboBorderSizeEditable({ this.cmbBorderSize = new Common.UI.ComboBorderSizeEditable({

View file

@ -392,7 +392,7 @@ define([
}, },
{ {
caption : me.txtUnmerge, caption : me.txtUnmerge,
value : Asc.c_oAscMergeOptions.Unmerge value : Asc.c_oAscMergeOptions.None
} }
] ]
}) })
@ -1551,10 +1551,10 @@ define([
{ id: 'menu-chart-group-hbar', caption: me.textBar }, { id: 'menu-chart-group-hbar', caption: me.textBar },
{ id: 'menu-chart-group-area', caption: me.textArea, inline: true }, { id: 'menu-chart-group-area', caption: me.textArea, inline: true },
{ id: 'menu-chart-group-scatter', caption: me.textPoint, inline: true }, { id: 'menu-chart-group-scatter', caption: me.textPoint, inline: true },
{ id: 'menu-chart-group-stock', caption: me.textStock, inline: true }, { id: 'menu-chart-group-stock', caption: me.textStock, inline: true }
{ id: 'menu-chart-group-sparkcolumn', inline: true, headername: me.textSparks }, // ,{ id: 'menu-chart-group-sparkcolumn', inline: true, headername: me.textSparks },
{ id: 'menu-chart-group-sparkline', inline: true }, // { id: 'menu-chart-group-sparkline', inline: true },
{ id: 'menu-chart-group-sparkwin', inline: true } // { id: 'menu-chart-group-sparkwin', inline: true }
]), ]),
store: new Common.UI.DataViewStore([ store: new Common.UI.DataViewStore([
{ group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barNormal, allowSelected: true, iconCls: 'column-normal', selected: true}, { group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barNormal, allowSelected: true, iconCls: 'column-normal', selected: true},
@ -1581,10 +1581,10 @@ define([
{ group: 'menu-chart-group-area', type: Asc.c_oAscChartTypeSettings.areaStacked, allowSelected: true, iconCls: 'area-stack'}, { group: 'menu-chart-group-area', type: Asc.c_oAscChartTypeSettings.areaStacked, allowSelected: true, iconCls: 'area-stack'},
{ group: 'menu-chart-group-area', type: Asc.c_oAscChartTypeSettings.areaStackedPer, allowSelected: true, iconCls: 'area-pstack'}, { group: 'menu-chart-group-area', type: Asc.c_oAscChartTypeSettings.areaStackedPer, allowSelected: true, iconCls: 'area-pstack'},
{ group: 'menu-chart-group-scatter', type: Asc.c_oAscChartTypeSettings.scatter, allowSelected: true, iconCls: 'point-normal'}, { group: 'menu-chart-group-scatter', type: Asc.c_oAscChartTypeSettings.scatter, allowSelected: true, iconCls: 'point-normal'},
{ group: 'menu-chart-group-stock', type: Asc.c_oAscChartTypeSettings.stock, allowSelected: true, iconCls: 'stock-normal'}, { group: 'menu-chart-group-stock', type: Asc.c_oAscChartTypeSettings.stock, allowSelected: true, iconCls: 'stock-normal'}
{ group: 'menu-chart-group-sparkcolumn', type: Asc.c_oAscSparklineType.Column, allowSelected: true, iconCls: 'spark-column', tip: me.textColumnSpark}, // ,{ group: 'menu-chart-group-sparkcolumn', type: Asc.c_oAscSparklineType.Column, allowSelected: true, iconCls: 'spark-column', tip: me.textColumnSpark},
{ group: 'menu-chart-group-sparkline', type: Asc.c_oAscSparklineType.Line, allowSelected: true, iconCls: 'spark-line', tip: me.textLineSpark}, // { group: 'menu-chart-group-sparkline', type: Asc.c_oAscSparklineType.Line, allowSelected: true, iconCls: 'spark-line', tip: me.textLineSpark},
{ group: 'menu-chart-group-sparkwin', type: Asc.c_oAscSparklineType.Stacked, allowSelected: true, iconCls: 'spark-win', tip: me.textWinLossSpark} // { group: 'menu-chart-group-sparkwin', type: Asc.c_oAscSparklineType.Stacked, allowSelected: true, iconCls: 'spark-win', tip: me.textWinLossSpark}
]), ]),
itemTemplate: _.template('<div id="<%= id %>" class="item-chartlist <%= iconCls %>"></div>') itemTemplate: _.template('<div id="<%= id %>" class="item-chartlist <%= iconCls %>"></div>')
}); });

View file

@ -74,7 +74,7 @@
"Common.Views.DocumentAccessDialog.textTitle": "Sharing Settings", "Common.Views.DocumentAccessDialog.textTitle": "Sharing Settings",
"Common.Views.Header.openNewTabText": "Open in New Tab", "Common.Views.Header.openNewTabText": "Open in New Tab",
"Common.Views.Header.textBack": "Go to Documents", "Common.Views.Header.textBack": "Go to Documents",
"Common.Views.Header.txtHeaderDeveloper": "DEVELOPER MODE", "del_Common.Views.Header.txtHeaderDeveloper": "DEVELOPER MODE",
"Common.Views.Header.txtRename": "Rename", "Common.Views.Header.txtRename": "Rename",
"Common.Views.ImageFromUrlDialog.cancelButtonText": "Cancel", "Common.Views.ImageFromUrlDialog.cancelButtonText": "Cancel",
"Common.Views.ImageFromUrlDialog.okButtonText": "OK", "Common.Views.ImageFromUrlDialog.okButtonText": "OK",
@ -702,6 +702,8 @@
"SSE.Controllers.Toolbar.txtSymbol_xsi": "Xi", "SSE.Controllers.Toolbar.txtSymbol_xsi": "Xi",
"SSE.Controllers.Toolbar.txtSymbol_zeta": "Zeta", "SSE.Controllers.Toolbar.txtSymbol_zeta": "Zeta",
"SSE.Controllers.Toolbar.warnMergeLostData": "Only the data from the upper-left cell will remain in the merged cell. <br>Are you sure you want to continue?", "SSE.Controllers.Toolbar.warnMergeLostData": "Only the data from the upper-left cell will remain in the merged cell. <br>Are you sure you want to continue?",
"SSE.Controllers.Toolbar.textLongOperation": "Long operation",
"SSE.Controllers.Toolbar.warnLongOperation": "The operation you are about to perform might take rather much time to complete.<br>Are you sure you want to continue?",
"SSE.Views.AutoFilterDialog.btnCustomFilter": "Custom Filter", "SSE.Views.AutoFilterDialog.btnCustomFilter": "Custom Filter",
"SSE.Views.AutoFilterDialog.cancelButtonText": "Cancel", "SSE.Views.AutoFilterDialog.cancelButtonText": "Cancel",
"SSE.Views.AutoFilterDialog.okButtonText": "OK", "SSE.Views.AutoFilterDialog.okButtonText": "OK",
@ -934,27 +936,28 @@
"SSE.Views.DigitalFilterDialog.textUse2": "Use * to present any series of character", "SSE.Views.DigitalFilterDialog.textUse2": "Use * to present any series of character",
"SSE.Views.DigitalFilterDialog.txtTitle": "Custom Filter", "SSE.Views.DigitalFilterDialog.txtTitle": "Custom Filter",
"SSE.Views.DocumentHolder.advancedShapeText": "Shape Advanced Settings", "SSE.Views.DocumentHolder.advancedShapeText": "Shape Advanced Settings",
"SSE.Views.DocumentHolder.advancedImgText": "Image Advanced Settings",
"SSE.Views.DocumentHolder.bottomCellText": "Align Bottom", "SSE.Views.DocumentHolder.bottomCellText": "Align Bottom",
"SSE.Views.DocumentHolder.centerCellText": "Align Center", "SSE.Views.DocumentHolder.centerCellText": "Align Center",
"SSE.Views.DocumentHolder.chartText": "Chart Advanced Settings", "SSE.Views.DocumentHolder.chartText": "Chart Advanced Settings",
"SSE.Views.DocumentHolder.deleteColumnText": "Delete Column", "SSE.Views.DocumentHolder.deleteColumnText": "Column",
"SSE.Views.DocumentHolder.deleteRowText": "Delete Row", "SSE.Views.DocumentHolder.deleteRowText": "Row",
"SSE.Views.DocumentHolder.deleteTableText": "Delete Table", "SSE.Views.DocumentHolder.deleteTableText": "Table",
"SSE.Views.DocumentHolder.direct270Text": "Rotate at 270°", "SSE.Views.DocumentHolder.direct270Text": "Rotate at 270°",
"SSE.Views.DocumentHolder.direct90Text": "Rotate at 90°", "SSE.Views.DocumentHolder.direct90Text": "Rotate at 90°",
"SSE.Views.DocumentHolder.directHText": "Horizontal", "SSE.Views.DocumentHolder.directHText": "Horizontal",
"SSE.Views.DocumentHolder.directionText": "Text Direction", "SSE.Views.DocumentHolder.directionText": "Text Direction",
"SSE.Views.DocumentHolder.editChartText": "Edit Data", "SSE.Views.DocumentHolder.editChartText": "Edit Data",
"SSE.Views.DocumentHolder.editHyperlinkText": "Edit Hyperlink", "SSE.Views.DocumentHolder.editHyperlinkText": "Edit Hyperlink",
"SSE.Views.DocumentHolder.insertColumnLeftText": "Insert Column Left", "SSE.Views.DocumentHolder.insertColumnLeftText": "Column Left",
"SSE.Views.DocumentHolder.insertColumnRightText": "Insert Column Right", "SSE.Views.DocumentHolder.insertColumnRightText": "Column Right",
"SSE.Views.DocumentHolder.insertRowAboveText": "Insert Row Above", "SSE.Views.DocumentHolder.insertRowAboveText": "Row Above",
"SSE.Views.DocumentHolder.insertRowBelowText": "Insert Row Below", "SSE.Views.DocumentHolder.insertRowBelowText": "Row Below",
"SSE.Views.DocumentHolder.removeHyperlinkText": "Remove Hyperlink", "SSE.Views.DocumentHolder.removeHyperlinkText": "Remove Hyperlink",
"SSE.Views.DocumentHolder.selectColumnText": "Select Entire Column", "SSE.Views.DocumentHolder.selectColumnText": "Entire Column",
"SSE.Views.DocumentHolder.selectDataText": "Select Column Data", "SSE.Views.DocumentHolder.selectDataText": "Column Data",
"SSE.Views.DocumentHolder.selectRowText": "Select Row", "SSE.Views.DocumentHolder.selectRowText": "Row",
"SSE.Views.DocumentHolder.selectTableText": "Select Table", "SSE.Views.DocumentHolder.selectTableText": "Table",
"SSE.Views.DocumentHolder.textArrangeBack": "Send to Background", "SSE.Views.DocumentHolder.textArrangeBack": "Send to Background",
"SSE.Views.DocumentHolder.textArrangeBackward": "Move Backward", "SSE.Views.DocumentHolder.textArrangeBackward": "Move Backward",
"SSE.Views.DocumentHolder.textArrangeForward": "Move Forward", "SSE.Views.DocumentHolder.textArrangeForward": "Move Forward",
@ -1193,6 +1196,7 @@
"SSE.Views.LeftMenu.tipPlugins": "Plugins", "SSE.Views.LeftMenu.tipPlugins": "Plugins",
"SSE.Views.LeftMenu.tipSearch": "Search", "SSE.Views.LeftMenu.tipSearch": "Search",
"SSE.Views.LeftMenu.tipSupport": "Feedback & Support", "SSE.Views.LeftMenu.tipSupport": "Feedback & Support",
"SSE.Views.LeftMenu.txtDeveloper": "DEVELOPER MODE",
"SSE.Views.MainSettingsPrint.okButtonText": "Save", "SSE.Views.MainSettingsPrint.okButtonText": "Save",
"SSE.Views.MainSettingsPrint.strBottom": "Bottom", "SSE.Views.MainSettingsPrint.strBottom": "Bottom",
"SSE.Views.MainSettingsPrint.strLandscape": "Landscape", "SSE.Views.MainSettingsPrint.strLandscape": "Landscape",
@ -1481,6 +1485,8 @@
"SSE.Views.TableSettings.textTemplate": "Select From Template", "SSE.Views.TableSettings.textTemplate": "Select From Template",
"SSE.Views.TableSettings.textTotal": "Total", "SSE.Views.TableSettings.textTotal": "Total",
"SSE.Views.TableSettings.textConvertRange": "Convert to range", "SSE.Views.TableSettings.textConvertRange": "Convert to range",
"SSE.Views.TableSettings.textLongOperation": "Long operation",
"SSE.Views.TableSettings.warnLongOperation": "The operation you are about to perform might take rather much time to complete.<br>Are you sure you want to continue?",
"SSE.Views.TableSettingsAdvanced.cancelButtonText": "Cancel", "SSE.Views.TableSettingsAdvanced.cancelButtonText": "Cancel",
"SSE.Views.TableSettingsAdvanced.okButtonText": "Ok", "SSE.Views.TableSettingsAdvanced.okButtonText": "Ok",
"SSE.Views.TableSettingsAdvanced.textAlt": "Alternative Text", "SSE.Views.TableSettingsAdvanced.textAlt": "Alternative Text",

View file

@ -12,6 +12,16 @@
.border-values { .border-values {
border: 1px solid @input-border; border: 1px solid @input-border;
.item {
&.selected {
background-color: @secondary;
border-color: @secondary;
color: @gray-deep;
border-style: solid;
border-width: 1px 0;
}
}
} }
.body { .body {

View file

@ -516,4 +516,20 @@
} }
} }
} }
}
#developer-hint {
position: absolute;
left: 0;
padding: 12px 0;
background-color: #ffb400;
color: #6e4e00 !important;
white-space: nowrap;
line-height: @app-header-height;
writing-mode: vertical-rl;
-moz-transform: rotate(180deg);
-ms-transform: rotate(180deg);
-webkit-transform: rotate(180deg);
-o-transform: rotate(180deg);
transform: rotate(180deg);
} }

View file

@ -238,6 +238,7 @@
font: 11px arial; font: 11px arial;
pointer-events: none; pointer-events: none;
white-space: nowrap; white-space: nowrap;
letter-spacing: 1px;
} }
#id-toolbar-btn-num-format button .caption { #id-toolbar-btn-num-format button .caption {

View file

@ -61,9 +61,15 @@ define([
}, },
initialize: function() { initialize: function() {
var me = this;
this.addListeners({ this.addListeners({
'CellEditor': { 'CellEditor': {
'function:click': this.onInsertFunction.bind(this) 'function:click': this.onInsertFunction.bind(this),
'function:hint': function (name, type) {
setTimeout(function(){
me.api.asc_insertFormula(name, type, false);
}, 0);
}
} }
// 'Viewport': { // 'Viewport': {
// 'layout:resizedrag': _.bind(this.onLayoutResize, this) // 'layout:resizedrag': _.bind(this.onLayoutResize, this)
@ -77,6 +83,7 @@ define([
// this.api.isCEditorFocused = false; // this.api.isCEditorFocused = false;
this.api.asc_registerCallback('asc_onSelectionNameChanged', _.bind(this.onApiCellSelection, this)); this.api.asc_registerCallback('asc_onSelectionNameChanged', _.bind(this.onApiCellSelection, this));
this.api.asc_registerCallback('asc_onEditCell', _.bind(this.onApiEditCell, this)); this.api.asc_registerCallback('asc_onEditCell', _.bind(this.onApiEditCell, this));
this.api.asc_registerCallback('asc_onFormulaCompleteMenu', _.bind(this.onFormulaCompleteMenu, this));
// this.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(this.onApiDisconnect,this)); // this.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(this.onApiDisconnect,this));
// Common.NotificationCenter.on('api:disconnect', _.bind(this.onApiDisconnect, this)); // Common.NotificationCenter.on('api:disconnect', _.bind(this.onApiDisconnect, this));
// Common.NotificationCenter.on('cells:range', _.bind(this.onCellsRange, this)); // Common.NotificationCenter.on('cells:range', _.bind(this.onCellsRange, this));
@ -176,6 +183,15 @@ define([
button: '#ce-function' button: '#ce-function'
}); });
} }
},
onFormulaCompleteMenu: function(funcarr) {
if ( funcarr && funcarr.length ) {
this.editor.resetFunctionsHint(funcarr);
!this.editor.$boxfuncs.hasClass('.opened') && this.editor.$boxfuncs.addClass('opened');
} else {
this.editor.$boxfuncs.removeClass('opened');
}
} }
}); });
}); });

View file

@ -127,7 +127,7 @@ define([
} }
break; break;
case 'unmerge': case 'unmerge':
me.api.asc_mergeCells(Asc.c_oAscMergeOptions.Unmerge); me.api.asc_mergeCells(Asc.c_oAscMergeOptions.None);
break; break;
case 'hide': case 'hide':
me.api[info.asc_getFlags().asc_getSelectionType() == Asc.c_oAscSelectionType.RangeRow ? 'asc_hideRows' : 'asc_hideColumns'](); me.api[info.asc_getFlags().asc_getSelectionType() == Asc.c_oAscSelectionType.RangeRow ? 'asc_hideRows' : 'asc_hideColumns']();
@ -182,7 +182,7 @@ define([
onApiShowPopMenu: function(posX, posY) { onApiShowPopMenu: function(posX, posY) {
if ( !_isEdit ) return; if ( !_isEdit ) return;
if ($('.popover.settings, .popup.settings, .picker-modal.settings, .modal-in').length > 0) { if ($('.popover.settings, .popup.settings, .picker-modal.settings, .modal-in, .actions-modal').length > 0) {
return; return;
} }
@ -278,12 +278,13 @@ define([
event: 'edit' event: 'edit'
}); });
(cellinfo.asc_getFlags().asc_getMerge() == Asc.c_oAscMergeOptions.None) &&
menuItems.push({ menuItems.push({
caption: me.menuMerge, caption: me.menuMerge,
event: 'merge' event: 'merge'
}); });
cellinfo.asc_getFlags().asc_getMerge() && (cellinfo.asc_getFlags().asc_getMerge() == Asc.c_oAscMergeOptions.Merge) &&
menuItems.push({ menuItems.push({
caption: me.menuUnmerge, caption: me.menuUnmerge,
event: 'unmerge' event: 'unmerge'

View file

@ -80,7 +80,6 @@ define([
isDisconnected : false, isDisconnected : false,
usersCount : 1, usersCount : 1,
fastCoauth : true, fastCoauth : true,
startModifyDocument : true,
lostEditingRights : false, lostEditingRights : false,
licenseWarning : false licenseWarning : false
}; };
@ -306,15 +305,9 @@ define([
me.setLongActionView(action) me.setLongActionView(action)
} else { } else {
if (me._state.fastCoauth && me._state.usersCount>1 && id==Asc.c_oAscAsyncAction['Save']) { if (me._state.fastCoauth && me._state.usersCount>1 && id==Asc.c_oAscAsyncAction['Save']) {
var me = me; // me._state.timerSave = setTimeout(function () {
if (me._state.timerSave===undefined) //console.debug('End long action');
me._state.timerSave = setInterval(function(){ // }, 500);
if ((new Date()) - me._state.isSaving>500) {
clearInterval(me._state.timerSave);
// console.debug('End long action');
me._state.timerSave = undefined;
}
}, 500);
} else { } else {
// console.debug('End long action'); // console.debug('End long action');
} }
@ -347,7 +340,7 @@ define([
break; break;
case Asc.c_oAscAsyncAction['Save']: case Asc.c_oAscAsyncAction['Save']:
me._state.isSaving = new Date(); // clearTimeout(me._state.timerSave);
title = me.saveTitleText; title = me.saveTitleText;
text = me.saveTextText; text = me.saveTextText;
break; break;
@ -653,7 +646,6 @@ define([
me.api.asc_registerCallback('asc_onDocumentModifiedChanged', _.bind(me.onDocumentModifiedChanged, me)); me.api.asc_registerCallback('asc_onDocumentModifiedChanged', _.bind(me.onDocumentModifiedChanged, me));
me.api.asc_registerCallback('asc_onDocumentCanSaveChanged', _.bind(me.onDocumentCanSaveChanged, me)); me.api.asc_registerCallback('asc_onDocumentCanSaveChanged', _.bind(me.onDocumentCanSaveChanged, me));
me.api.asc_registerCallback('asc_onSaveUrl', _.bind(me.onSaveUrl, me));
/** coauthoring begin **/ /** coauthoring begin **/
me.api.asc_registerCallback('asc_onCollaborativeChanges', _.bind(me.onCollaborativeChanges, me)); me.api.asc_registerCallback('asc_onCollaborativeChanges', _.bind(me.onCollaborativeChanges, me));
me.api.asc_registerCallback('asc_OnTryUndoInFastCollaborative',_.bind(me.onTryUndoInFastCollaborative, me)); me.api.asc_registerCallback('asc_OnTryUndoInFastCollaborative',_.bind(me.onTryUndoInFastCollaborative, me));
@ -794,6 +786,7 @@ define([
case Asc.c_oAscError.ID.FrmlOperandExpected: case Asc.c_oAscError.ID.FrmlOperandExpected:
config.msg = this.errorOperandExpected; config.msg = this.errorOperandExpected;
config.closable = true;
break; break;
case Asc.c_oAscError.ID.VKeyEncrypt: case Asc.c_oAscError.ID.VKeyEncrypt:
@ -883,6 +876,7 @@ define([
case Asc.c_oAscError.ID.FrmlWrongReferences: case Asc.c_oAscError.ID.FrmlWrongReferences:
config.msg = this.errorFrmlWrongReferences; config.msg = this.errorFrmlWrongReferences;
config.closable = true;
break; break;
case Asc.c_oAscError.ID.CopyMultiselectAreaError: case Asc.c_oAscError.ID.CopyMultiselectAreaError:
@ -973,21 +967,12 @@ define([
if (window.document.title != title) if (window.document.title != title)
window.document.title = title; window.document.title = title;
if (!this._state.fastCoauth || this._state.usersCount<2 ) Common.Gateway.setDocumentModified(isModified);
Common.Gateway.setDocumentModified(isModified);
else if ( this._state.startModifyDocument!==undefined && this._state.startModifyDocument === isModified){
Common.Gateway.setDocumentModified(isModified);
this._state.startModifyDocument = (this._state.startModifyDocument) ? !this._state.startModifyDocument : undefined;
}
this._state.isDocModified = isModified; this._state.isDocModified = isModified;
} }
}, },
onDocumentModifiedChanged: function() { onDocumentModifiedChanged: function() {
if (this._state.fastCoauth && this._state.usersCount > 1 && this._state.startModifyDocument===undefined )
return;
var isModified = this.api.asc_isDocumentCanSave(); var isModified = this.api.asc_isDocumentCanSave();
if (this._state.isDocModified !== isModified) { if (this._state.isDocModified !== isModified) {
Common.Gateway.setDocumentModified(this.api.asc_isDocumentModified()); Common.Gateway.setDocumentModified(this.api.asc_isDocumentModified());
@ -1023,10 +1008,6 @@ define([
$('#loading-mask').hide().remove(); $('#loading-mask').hide().remove();
}, },
onSaveUrl: function(url) {
Common.Gateway.save(url);
},
onDownloadUrl: function(url) { onDownloadUrl: function(url) {
if (this._state.isFromGatewayDownloadAs) { if (this._state.isFromGatewayDownloadAs) {
Common.Gateway.downloadAs(url); Common.Gateway.downloadAs(url);

View file

@ -87,6 +87,7 @@ define([
_.defer(function () { _.defer(function () {
var editorLang = SSE.getController("Main").editorConfig.lang; var editorLang = SSE.getController("Main").editorConfig.lang;
editorLang = (editorLang ? editorLang : 'en').split("-")[0].toLowerCase();
var localizationFunctions = function(data) { var localizationFunctions = function(data) {
fc = data; fc = data;
@ -107,6 +108,8 @@ define([
functions = {}, functions = {},
editorLang = SSE.getController("Main").editorConfig.lang; editorLang = SSE.getController("Main").editorConfig.lang;
editorLang = (editorLang ? editorLang : 'en').split("-")[0].toLowerCase();
var localizationFunctionsDesc = function (data) { var localizationFunctionsDesc = function (data) {
var jsonDesc = {}, var jsonDesc = {},
view = me.getView('AddFunction'); view = me.getView('AddFunction');

View file

@ -82,12 +82,13 @@
<div id="addother-imagefromurl"> <div id="addother-imagefromurl">
<div class="page" id="addimage-fromurl" data-page="addimage-url"> <div class="page" id="addimage-fromurl" data-page="addimage-url">
<div class="page-content"> <div class="page-content">
<div class="content-block-title"><%= scope.textAddress %></div> <% if (!android) { %><div class="content-block-title"><%= scope.textAddress %></div><% } %>
<div class="list-block"> <div class="list-block">
<ul> <ul>
<li> <li>
<div id="addimage-link-url" class="item-content"> <div id="addimage-link-url" class="item-content">
<div class="item-inner"> <div class="item-inner">
<% if (android) { %><div class="item-title label"><%= scope.textAddress %></div><% } %>
<div class="item-input"> <div class="item-input">
<input type="url" placeholder="<%= scope.textImageURL %>"> <input type="url" placeholder="<%= scope.textImageURL %>">
</div> </div>

View file

@ -11,4 +11,7 @@
<div class="ce-group group-expand"> <div class="ce-group group-expand">
<button id="ce-btn-expand" type="button" class="btn"><span class="caret"></span></button> <button id="ce-btn-expand" type="button" class="btn"><span class="caret"></span></button>
</div> </div>
<div class="ce-group group-functions-list">
<ul class="func-list"></ul>
</div>
</div> </div>

View file

@ -47,7 +47,6 @@ define([
'use strict'; 'use strict';
SSE.Views.CellEditor = Backbone.View.extend({ SSE.Views.CellEditor = Backbone.View.extend({
el: '.pages > .page', el: '.pages > .page',
template: _.template(template), template: _.template(template),
@ -58,6 +57,9 @@ define([
} }
}, },
touch: {},
tplHintItem: _.template('<li><a><%= caption %></a></li>'),
initialize: function (options) { initialize: function (options) {
}, },
@ -67,8 +69,17 @@ define([
this.$cellname = $('#ce-cell-name', this.el); this.$cellname = $('#ce-cell-name', this.el);
this.$btnexpand = $('#ce-btn-expand', this.el); this.$btnexpand = $('#ce-btn-expand', this.el);
this.$boxfuncs = $('.group-functions-list', this.el);
this.$listfuncs = $('.func-list', this.$boxfuncs);
// this.$btnfunc = $('#ce-function', this.el); // this.$btnfunc = $('#ce-function', this.el);
this.$listfuncs.on({
'touchstart': this.onTouchStart.bind(this),
'touchmove': this.onTouchMove.bind(this),
'touchend': this.onTouchEnd.bind(this)
});
return this; return this;
}, },
@ -91,10 +102,90 @@ define([
// Common.NotificationCenter.trigger('edit:complete', this.editor, {restorefocus:true}); // Common.NotificationCenter.trigger('edit:complete', this.editor, {restorefocus:true});
}, },
clearFunctionsHint: function () {
this.$listfuncs.find('li').off('click');
this.$listfuncs.empty();
this.$listfuncs.scrollLeft(0);
},
cellNameDisabled: function(disabled){ cellNameDisabled: function(disabled){
// (disabled) ? this.$cellname.attr('disabled', 'disabled') : this.$cellname.removeAttr('disabled'); // (disabled) ? this.$cellname.attr('disabled', 'disabled') : this.$cellname.removeAttr('disabled');
// this.$btnfunc.toggleClass('disabled', disabled); // this.$btnfunc.toggleClass('disabled', disabled);
// this.btnNamedRanges.setDisabled(disabled); // this.btnNamedRanges.setDisabled(disabled);
},
resetFunctionsHint: function(funcarr) {
this.clearFunctionsHint();
var me = this;
var onhintclick = function(name, type, e) {
this.fireEvent('function:hint', [name, type]);
};
var items = [];
_.each(funcarr, function(func, index) {
var $item = $(me.tplHintItem({
caption: func.asc_getName()
}));
$item.on('click', onhintclick.bind(me, func.asc_getName(), func.asc_getType()));
items.push($item);
});
this.$listfuncs.append(items);
},
hasHiddenFunctionsHint: function() {
var _left_bound_ = this.$boxfuncs.offset().left,
_right_bound_ = _left_bound_ + this.$boxfuncs.width();
var $items = this.$listfuncs.find('li');
var rect = $items.first().get(0).getBoundingClientRect();
if ( !(rect.left < _left_bound_) ) {
rect = $items.last().get(0).getBoundingClientRect();
if ( !(rect.right > _right_bound_) )
return false;
}
return true;
},
onTouchStart: function(e) {
if ( this.hasHiddenFunctionsHint() ) {
var touches = e.originalEvent.changedTouches;
this.touch.startx = touches[0].clientX;
this.touch.scrollx = this.$listfuncs.scrollLeft();
this.touch.timer = setTimeout(function () {
// touch.longtouch = true;
}, 500);
e.preventDefault();
}
},
onTouchMove: function(e) {
if ( this.touch.startx !== undefined ) {
var touches = e.originalEvent.changedTouches;
if ( this.touch.longtouch ) {}
else {
if ( this.touch.timer ) clearTimeout(this.touch.timer), delete this.touch.timer;
this.$listfuncs.scrollLeft(this.touch.scrollx + (this.touch.startx - touches[0].clientX));
}
e.preventDefault();
}
},
onTouchEnd: function(e) {
if ( this.touch.startx !== undefined ) {
this.touch.longtouch = false;
delete this.touch.startx;
e.preventDefault();
}
} }
}); });
}); });

View file

@ -188,6 +188,11 @@ define([
var me = this; var me = this;
$('.settings .sortdown').single('click', function (e) {me.fireEvent('insert:sort',['down']);}); $('.settings .sortdown').single('click', function (e) {me.fireEvent('insert:sort',['down']);});
$('.settings .sortup').single('click', function (e) {me.fireEvent('insert:sort',['up']);}); $('.settings .sortup').single('click', function (e) {me.fireEvent('insert:sort',['up']);});
// temporary hidden
// TODO: make filter's options menu
$('.settings #other-chb-insfilter').parents('.list-block').hide();
$('.settings #other-chb-insfilter input:checkbox').single('change', function (e) { $('.settings #other-chb-insfilter input:checkbox').single('change', function (e) {
var $checkbox = $(e.currentTarget); var $checkbox = $(e.currentTarget);
me.fireEvent('insert:filter', [$checkbox.is(':checked')]); me.fireEvent('insert:filter', [$checkbox.is(':checked')]);

View file

@ -283,7 +283,8 @@
"SSE.Views.AddOther.textInsert": "Einfügen", "SSE.Views.AddOther.textInsert": "Einfügen",
"SSE.Views.AddOther.textInsertImage": "Bild einfügen", "SSE.Views.AddOther.textInsertImage": "Bild einfügen",
"SSE.Views.AddOther.textLink": "Link", "SSE.Views.AddOther.textLink": "Link",
"SSE.Views.AddOther.textSort": "Sortieren und Filtern", "SSE.Views.AddOther.textSortOrig": "Sortieren und Filtern",
"SSE.Views.AddOther.textSort": "Sortieren",
"SSE.Views.EditCell.textAccounting": "Rechnungswesen", "SSE.Views.EditCell.textAccounting": "Rechnungswesen",
"SSE.Views.EditCell.textAlignBottom": "Unten ausrichten", "SSE.Views.EditCell.textAlignBottom": "Unten ausrichten",
"SSE.Views.EditCell.textAlignCenter": "Zentriert ausrichten", "SSE.Views.EditCell.textAlignCenter": "Zentriert ausrichten",

View file

@ -285,7 +285,8 @@
"SSE.Views.AddOther.textInsert": "Insert", "SSE.Views.AddOther.textInsert": "Insert",
"SSE.Views.AddOther.textInsertImage": "Insert Image", "SSE.Views.AddOther.textInsertImage": "Insert Image",
"SSE.Views.AddOther.textLink": "Link", "SSE.Views.AddOther.textLink": "Link",
"SSE.Views.AddOther.textSort": "Sort and Filter", "SSE.Views.AddOther.textSortOrig": "Sort and Filter",
"SSE.Views.AddOther.textSort": "Sort",
"SSE.Views.EditCell.textAccounting": "Accounting", "SSE.Views.EditCell.textAccounting": "Accounting",
"SSE.Views.EditCell.textAlignBottom": "Align Bottom", "SSE.Views.EditCell.textAlignBottom": "Align Bottom",
"SSE.Views.EditCell.textAlignCenter": "Align Center", "SSE.Views.EditCell.textAlignCenter": "Align Center",

View file

@ -283,6 +283,7 @@
"SSE.Views.AddOther.textInsert": "Insérer", "SSE.Views.AddOther.textInsert": "Insérer",
"SSE.Views.AddOther.textInsertImage": "Insérer une image", "SSE.Views.AddOther.textInsertImage": "Insérer une image",
"SSE.Views.AddOther.textLink": "Lien", "SSE.Views.AddOther.textLink": "Lien",
"SSE.Views.AddOther.textSortOrig": "Trier",
"SSE.Views.AddOther.textSort": "Trier et filtrer", "SSE.Views.AddOther.textSort": "Trier et filtrer",
"SSE.Views.EditCell.textAccounting": "Comptabilité", "SSE.Views.EditCell.textAccounting": "Comptabilité",
"SSE.Views.EditCell.textAlignBottom": "Aligner en bas", "SSE.Views.EditCell.textAlignBottom": "Aligner en bas",

View file

@ -283,7 +283,8 @@
"SSE.Views.AddOther.textInsert": "Вставить", "SSE.Views.AddOther.textInsert": "Вставить",
"SSE.Views.AddOther.textInsertImage": "Вставить изображение", "SSE.Views.AddOther.textInsertImage": "Вставить изображение",
"SSE.Views.AddOther.textLink": "Ссылка", "SSE.Views.AddOther.textLink": "Ссылка",
"SSE.Views.AddOther.textSort": "Сортировка и фильтрация", "SSE.Views.AddOther.textSortOrig": "Сортировка и фильтрация",
"SSE.Views.AddOther.textSort": "Сортировка",
"SSE.Views.EditCell.textAccounting": "Финансовый", "SSE.Views.EditCell.textAccounting": "Финансовый",
"SSE.Views.EditCell.textAlignBottom": "По нижнему краю", "SSE.Views.EditCell.textAlignBottom": "По нижнему краю",
"SSE.Views.EditCell.textAlignCenter": "По центру", "SSE.Views.EditCell.textAlignCenter": "По центру",

File diff suppressed because one or more lines are too long

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