Merge branch 'develop' into hotfix/v5.0.3

This commit is contained in:
Julia Radzhabova 2017-10-31 20:15:07 +03:00 committed by GitHub
commit c02389ab21
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
143 changed files with 6655 additions and 688 deletions

View file

@ -43,7 +43,8 @@
print: <can print>, // default = true print: <can print>, // default = true
rename: <can rename>, // default = false rename: <can rename>, // default = false
changeHistory: <can change history>, // default = false changeHistory: <can change history>, // default = false
comment: <can comment in view mode> // default = edit comment: <can comment in view mode> // default = edit,
modifyFilter: <can add, remove and save filter in the spreadsheet> // default = true
} }
}, },
editorConfig: { editorConfig: {
@ -170,7 +171,8 @@
'onAppReady': <application ready callback>, 'onAppReady': <application ready callback>,
'onBack': <back to folder callback>, 'onBack': <back to folder callback>,
'onError': <error callback>, 'onError': <error callback>,
'onDocumentReady': <document ready callback> 'onDocumentReady': <document ready callback>,
'onWarning': <warning callback>
} }
} }
*/ */
@ -506,9 +508,10 @@
}); });
}; };
var _downloadAs = function() { var _downloadAs = function(data) {
_sendCommand({ _sendCommand({
command: 'downloadAs' command: 'downloadAs',
data: data
}); });
}; };

View file

@ -80,8 +80,8 @@ if (Common === undefined) {
$me.trigger('processmailmerge', data); $me.trigger('processmailmerge', data);
}, },
'downloadAs': function() { 'downloadAs': function(data) {
$me.trigger('downloadas'); $me.trigger('downloadas', data);
}, },
'processMouse': function(data) { 'processMouse': function(data) {
@ -189,6 +189,16 @@ if (Common === undefined) {
}); });
}, },
reportWarning: function(code, description) {
_postMessage({
event: 'onWarning',
data: {
warningCode: code,
warningDescription: description
}
});
},
sendInfo: function(info) { sendInfo: function(info) {
_postMessage({ _postMessage({
event: 'onInfo', event: 'onInfo',

View file

@ -107,6 +107,13 @@ Common.Locale = new(function() {
} }
} }
catch (e) { catch (e) {
try {
xhrObj.open('GET', 'locale/en.json', false);
xhrObj.send('');
l10n = eval("(" + xhrObj.responseText + ")");
}
catch (e) {
}
} }
return { return {

View file

@ -160,8 +160,8 @@ define([
'</span>' + '</span>' +
'</button>' + '</button>' +
'<button type="button" class="btn <%= cls %> inner-box-caption dropdown-toggle" data-toggle="dropdown">' + '<button type="button" class="btn <%= cls %> inner-box-caption dropdown-toggle" data-toggle="dropdown">' +
'<span class="caption"><%= caption %></span>' +
'<span class="btn-fixflex-vcenter">' + '<span class="btn-fixflex-vcenter">' +
'<span class="caption"><%= caption %></span>' +
'<i class="caret img-commonctrl"></i>' + '<i class="caret img-commonctrl"></i>' +
'</span>' + '</span>' +
'</button>' + '</button>' +

View file

@ -99,10 +99,32 @@ define([
initialize : function(options) { initialize : function(options) {
Common.UI.BaseView.prototype.initialize.call(this, options); Common.UI.BaseView.prototype.initialize.call(this, options);
if (this.options.el)
this.render();
},
render: function (parentEl) {
var me = this, var me = this,
el = $(this.el); el = $(this.el);
if (!me.rendered) {
if (parentEl) {
this.setElement(parentEl, false);
parentEl.html(this.template({
labelText: this.options.labelText
}));
el = $(this.el);
} else {
el.html(this.template({
labelText: this.options.labelText
}));
}
this.render(); this.$chk = el.find('input[type=button]');
this.$label = el.find('label');
this.$chk.on('click', _.bind(this.onItemCheck, this));
}
this.rendered = true;
if (this.options.disabled) if (this.options.disabled)
this.setDisabled(this.options.disabled); this.setDisabled(this.options.disabled);
@ -111,20 +133,6 @@ define([
this.setValue(this.options.value, true); this.setValue(this.options.value, true);
// handle events // handle events
this.$chk.on('click', _.bind(this.onItemCheck, this));
},
render: function () {
var el = $(this.el);
el.html(this.template({
labelText: this.options.labelText
}));
this.$chk = el.find('input[type=button]');
this.$label = el.find('label');
this.rendered = true;
return this; return this;
}, },

View file

@ -113,6 +113,8 @@ define([
this._input.on('keyup', _.bind(this.onInputKeyUp, this)); this._input.on('keyup', _.bind(this.onInputKeyUp, this));
this._input.on('keydown', _.bind(this.onInputKeyDown, this)); this._input.on('keydown', _.bind(this.onInputKeyDown, this));
this._modalParents = this.cmpEl.closest('.asc-window');
return this; return this;
}, },
@ -319,6 +321,8 @@ define([
var name = (_.isFunction(font.get_Name) ? font.get_Name() : font.asc_getName()); var name = (_.isFunction(font.get_Name) ? font.get_Name() : font.asc_getName());
if (this.getRawValue() !== name) { if (this.getRawValue() !== name) {
if (this._modalParents.length > 0) return;
var record = this.store.findWhere({ var record = this.store.findWhere({
name: name name: name
}); });

View file

@ -233,6 +233,8 @@ define([
me.emptyText = me.options.emptyText || ''; me.emptyText = me.options.emptyText || '';
me.listenStoreEvents= (me.options.listenStoreEvents!==undefined) ? me.options.listenStoreEvents : true; me.listenStoreEvents= (me.options.listenStoreEvents!==undefined) ? me.options.listenStoreEvents : true;
me.allowScrollbar = (me.options.allowScrollbar!==undefined) ? me.options.allowScrollbar : true; me.allowScrollbar = (me.options.allowScrollbar!==undefined) ? me.options.allowScrollbar : true;
if (me.parentMenu)
me.parentMenu.options.restoreHeight = (me.options.restoreHeight>0);
me.rendered = false; me.rendered = false;
me.dataViewItems = []; me.dataViewItems = [];
if (me.options.keyMoveDirection=='vertical') if (me.options.keyMoveDirection=='vertical')
@ -471,6 +473,9 @@ define([
}); });
} }
if (this.disabled)
this.setDisabled(this.disabled);
this.attachKeyEvents(); this.attachKeyEvents();
this.lastSelectedRec = null; this.lastSelectedRec = null;
this._layoutParams = undefined; this._layoutParams = undefined;
@ -688,20 +693,19 @@ define([
var menuRoot = (this.parentMenu.cmpEl.attr('role') === 'menu') var menuRoot = (this.parentMenu.cmpEl.attr('role') === 'menu')
? this.parentMenu.cmpEl ? this.parentMenu.cmpEl
: this.parentMenu.cmpEl.find('[role=menu]'), : this.parentMenu.cmpEl.find('[role=menu]'),
docH = Common.Utils.innerHeight()-10,
innerEl = $(this.el).find('.inner').addBack().filter('.inner'), innerEl = $(this.el).find('.inner').addBack().filter('.inner'),
docH = Common.Utils.innerHeight(), parent = innerEl.parent(),
margins = parseInt(parent.css('margin-top')) + parseInt(parent.css('margin-bottom')) + parseInt(menuRoot.css('margin-top')),
paddings = parseInt(menuRoot.css('padding-top')) + parseInt(menuRoot.css('padding-bottom')),
menuH = menuRoot.outerHeight(), menuH = menuRoot.outerHeight(),
top = parseInt(menuRoot.css('top')); top = parseInt(menuRoot.css('top'));
if (menuH > docH) {
innerEl.css('max-height', (docH - parseInt(menuRoot.css('padding-top')) - parseInt(menuRoot.css('padding-bottom'))-5) + 'px');
if (this.allowScrollbar) this.scroller.update({minScrollbarLength : 40});
} else if ( innerEl.height() < this.options.restoreHeight ) {
innerEl.css('max-height', (Math.min(docH - parseInt(menuRoot.css('padding-top')) - parseInt(menuRoot.css('padding-bottom'))-5, this.options.restoreHeight)) + 'px');
menuH = menuRoot.outerHeight();
if (top + menuH > docH ) { if (top + menuH > docH ) {
menuRoot.css('top', 0); innerEl.css('max-height', (docH - top - paddings - margins) + 'px');
} if (this.allowScrollbar) this.scroller.update({minScrollbarLength : 40});
} else if ( top + menuH < docH && innerEl.height() < this.options.restoreHeight ) {
innerEl.css('max-height', (Math.min(docH - top - paddings - margins, this.options.restoreHeight)) + 'px');
if (this.allowScrollbar) this.scroller.update({minScrollbarLength : 40}); if (this.allowScrollbar) this.scroller.update({minScrollbarLength : 40});
} }
}, },

View file

@ -172,6 +172,7 @@ define([
}, this); }, this);
this.freeze = options.freeze; this.freeze && this.freezePanels(this.freeze); this.freeze = options.freeze; this.freeze && this.freezePanels(this.freeze);
Common.Gateway.on('processmouse', this.resize.eventStop);
}, },
doLayout: function() { doLayout: function() {
@ -298,6 +299,11 @@ define([
if (!this.resize.$el) return; if (!this.resize.$el) return;
var zoom = (e instanceof jQuery.Event) ? Common.Utils.zoom() : 1; var zoom = (e instanceof jQuery.Event) ? Common.Utils.zoom() : 1;
if (!(e instanceof jQuery.Event) && (e.pageY === undefined || e.pageX === undefined)) {
e.pageY = e.y;
e.pageX = e.x;
}
if (this.resize.type == 'vertical') { if (this.resize.type == 'vertical') {
var prop = 'height'; var prop = 'height';
var value = e.pageY*zoom - this.resize.inity; var value = e.pageY*zoom - this.resize.inity;

View file

@ -64,6 +64,7 @@ define([
onResetItems : function() { onResetItems : function() {
this.innerEl = null; this.innerEl = null;
Common.UI.DataView.prototype.onResetItems.call(this); Common.UI.DataView.prototype.onResetItems.call(this);
this.trigger('items:reset', this);
}, },
onAddItem: function(record, index) { onAddItem: function(record, index) {
@ -97,6 +98,16 @@ define([
this.listenTo(view, 'dblclick',this.onDblClickItem); this.listenTo(view, 'dblclick',this.onDblClickItem);
this.listenTo(view, 'select', this.onSelectItem); this.listenTo(view, 'select', this.onSelectItem);
if (record.get('tip')) {
var view_el = $(view.el);
view_el.attr('data-toggle', 'tooltip');
view_el.tooltip({
title : record.get('tip'),
placement : 'cursor',
zIndex : this.tipZIndex
});
}
if (!this.isSuspendEvents) if (!this.isSuspendEvents)
this.trigger('item:add', this, view, record); this.trigger('item:add', this, view, record);
} }

View file

@ -424,6 +424,9 @@ define([
onAfterShowMenu: function(e) { onAfterShowMenu: function(e) {
this.trigger('show:after', this, e); this.trigger('show:after', this, e);
if (this.options.restoreHeight && this.scroller)
this.scroller.update({minScrollbarLength : 40});
if (this.$el.find('> ul > .menu-scroll').length) { if (this.$el.find('> ul > .menu-scroll').length) {
var el = this.$el.find('li .checked')[0]; var el = this.$el.find('li .checked')[0];
if (el) { if (el) {
@ -465,14 +468,20 @@ define([
}, },
onScroll: function(item, e) { onScroll: function(item, e) {
if (this.fromKeyDown) { if (this.scroller) return;
var menuRoot = (this.cmpEl.attr('role') === 'menu') var menuRoot = (this.cmpEl.attr('role') === 'menu')
? this.cmpEl ? this.cmpEl
: this.cmpEl.find('[role=menu]'); : this.cmpEl.find('[role=menu]'),
scrollTop = menuRoot.scrollTop(),
menuRoot.find('.menu-scroll.top').css('top', menuRoot.scrollTop() + 'px'); top = menuRoot.find('.menu-scroll.top'),
menuRoot.find('.menu-scroll.bottom').css('bottom', (-menuRoot.scrollTop()) + 'px'); bottom = menuRoot.find('.menu-scroll.bottom');
if (this.fromKeyDown) {
top.css('top', scrollTop + 'px');
bottom.css('bottom', (-scrollTop) + 'px');
} }
top.toggleClass('disabled', scrollTop<1);
bottom.toggleClass('disabled', scrollTop + this.options.maxHeight > menuRoot[0].scrollHeight-1);
}, },
onItemClick: function(item, e) { onItemClick: function(item, e) {
@ -493,6 +502,8 @@ define([
}, },
onScrollClick: function(e) { onScrollClick: function(e) {
if (/disabled/.test(e.currentTarget.className)) return false;
this.scrollMenu(/top/.test(e.currentTarget.className)); this.scrollMenu(/top/.test(e.currentTarget.className));
return false; return false;
}, },
@ -562,11 +573,23 @@ define([
left = docW - menuW; left = docW - menuW;
} }
if (this.options.restoreHeight) {
if (typeof (this.options.restoreHeight) == "number") {
if (top + menuH > docH) {
menuRoot.css('max-height', (docH - top) + 'px');
menuH = menuRoot.outerHeight();
} else if ( top + menuH < docH && menuRoot.height() < this.options.restoreHeight ) {
menuRoot.css('max-height', (Math.min(docH - top, this.options.restoreHeight)) + 'px');
menuH = menuRoot.outerHeight();
}
}
} else {
if (top + menuH > docH) if (top + menuH > docH)
top = docH - menuH; top = docH - menuH;
if (top < 0) if (top < 0)
top = 0; top = 0;
}
if (this.options.additionalAlign) if (this.options.additionalAlign)
this.options.additionalAlign.call(this, menuRoot, left, top); this.options.additionalAlign.call(this, menuRoot, left, top);

View file

@ -92,6 +92,10 @@ define([
config.tabs = options.tabs; config.tabs = options.tabs;
$(document.body).on('click', onClickDocument.bind(this)); $(document.body).on('click', onClickDocument.bind(this));
Common.NotificationCenter.on('tab:visible', _.bind(function(action, visible){
this.setVisible(action, visible)
}, this));
}, },
afterRender: function() { afterRender: function() {
@ -108,6 +112,7 @@ define([
$scrollR.on('click', onScrollTabs.bind(this, 'right')); $scrollR.on('click', onScrollTabs.bind(this, 'right'));
$boxTabs.on('dblclick', '> .ribtab', onTabDblclick.bind(this)); $boxTabs.on('dblclick', '> .ribtab', onTabDblclick.bind(this));
$boxTabs.on('click', '> .ribtab', me.onTabClick.bind(this));
}, },
isTabActive: function(tag) { isTabActive: function(tag) {
@ -164,6 +169,12 @@ define([
// clearTimeout(optsFold.timer); // clearTimeout(optsFold.timer);
optsFold.$bar.removeClass('folded'); optsFold.$bar.removeClass('folded');
optsFold.$box.off(); optsFold.$box.off();
var active_panel = optsFold.$box.find('.panel.active');
if ( active_panel.length ) {
var tab = active_panel.data('tab');
me.$tabs.find('> a[data-tab=' + tab + ']').parent().toggleClass('active', true);
}
} }
}, },
@ -194,6 +205,18 @@ define([
} }
}, },
onTabClick: function (e) {
var _is_active = $(e.currentTarget).hasClass('active');
if ( _is_active ) {
if ( this.isFolded ) {
// this.collapse();
}
} else {
var tab = $(e.target).data('tab');
this.setTab(tab);
}
},
setTab: function (tab) { setTab: function (tab) {
if ( !tab ) { if ( !tab ) {
onShowFullviewPanel.call(this, false); onShowFullviewPanel.call(this, false);
@ -234,7 +257,7 @@ define([
return config.tabs[index].action; return config.tabs[index].action;
} }
var _tabTemplate = _.template('<li class="ribtab"><div class="tab-bg" /><a href="#" data-tab="<%= action %>" data-title="<%= caption %>"><%= caption %></a></li>'); var _tabTemplate = _.template('<li class="ribtab" style="display: none;"><div class="tab-bg" /><a href="#" data-tab="<%= action %>" data-title="<%= caption %>"><%= caption %></a></li>');
config.tabs[after + 1] = tab; config.tabs[after + 1] = tab;
var _after_action = _get_tab_action(after); var _after_action = _get_tab_action(after);
@ -269,13 +292,13 @@ define([
var _left_bound_ = Math.round($boxTabs.offset().left), var _left_bound_ = Math.round($boxTabs.offset().left),
_right_bound_ = Math.round(_left_bound_ + $boxTabs.width()); _right_bound_ = Math.round(_left_bound_ + $boxTabs.width());
var tab = this.$tabs.filter(':first:visible').get(0); var tab = this.$tabs.filter(':visible:first').get(0);
if ( !tab ) return false; if ( !tab ) return false;
var rect = tab.getBoundingClientRect(); var rect = tab.getBoundingClientRect();
if ( !(Math.round(rect.left) < _left_bound_) ) { if ( !(Math.round(rect.left) < _left_bound_) ) {
tab = this.$tabs.filter(':last:visible').get(0); tab = this.$tabs.filter(':visible:last').get(0);
rect = tab.getBoundingClientRect(); rect = tab.getBoundingClientRect();
if (!(Math.round(rect.right) > _right_bound_)) if (!(Math.round(rect.right) > _right_bound_))
@ -296,6 +319,11 @@ define([
} }
} }
} }
},
setVisible: function (tab, visible) {
if ( tab && this.$tabs )
this.$tabs.find('> a[data-tab=' + tab + ']').parent().css('display', visible ? '' : 'none');
} }
}; };
}())); }()));

View file

@ -343,6 +343,8 @@ define([
this.insert(-1, this.saved); this.insert(-1, this.saved);
delete this.saved; delete this.saved;
Common.Gateway.on('processmouse', _.bind(this.onProcessMouse, this));
this.rendered = true; this.rendered = true;
return this; return this;
}, },
@ -362,6 +364,14 @@ define([
} }
}, },
onProcessMouse: function(data) {
if (data.type == 'mouseup') {
var tab = this.getActive(true);
if (tab)
tab.mouseup();
}
},
add: function(tabs) { add: function(tabs) {
return this.insert(-1, tabs) > 0; return this.insert(-1, tabs) > 0;
}, },

View file

@ -146,6 +146,11 @@ define([
updateCustomColors: function() { updateCustomColors: function() {
var el = $(this.el); var el = $(this.el);
if (el) { if (el) {
var selected = el.find('a.' + this.selectedCls),
color = (selected.length>0 && /color-dynamic/.test(selected[0].className)) ? selected.attr('color') : undefined;
if (color) color = color.toUpperCase();
selected.removeClass(this.selectedCls);
var colors = Common.localStorage.getItem('asc.'+Common.localStorage.getId()+'.colors.custom'); var colors = Common.localStorage.getItem('asc.'+Common.localStorage.getId()+'.colors.custom');
colors = colors ? colors.split(',') : []; colors = colors ? colors.split(',') : [];
@ -156,6 +161,10 @@ define([
colorEl.find('span').css({ colorEl.find('span').css({
'background-color': '#'+colors[i] 'background-color': '#'+colors[i]
}); });
if (colors[i] == color) {
colorEl.addClass(this.selectedCls);
color = undefined; //select only first found color
}
} }
} }
}, },

View file

@ -57,6 +57,8 @@ define([
this.addListeners({ this.addListeners({
'Toolbar': { 'Toolbar': {
'render:before' : function (toolbar) { 'render:before' : function (toolbar) {
me.toolbar = toolbar;
var appOptions = me.getApplication().getController('Main').appOptions; var appOptions = me.getApplication().getController('Main').appOptions;
if ( appOptions.isEdit && !appOptions.isEditMailMerge && !appOptions.isEditDiagram ) { if ( appOptions.isEdit && !appOptions.isEditMailMerge && !appOptions.isEditDiagram ) {
@ -173,6 +175,8 @@ define([
arr.push(plugin); arr.push(plugin);
}); });
this.api.asc_pluginsRegister('', arr); this.api.asc_pluginsRegister('', arr);
if (this.toolbar && storePlugins.length>0)
this.toolbar.setVisible('plugins', true);
}, },
onAddPlugin: function (model) { onAddPlugin: function (model) {

View file

@ -76,7 +76,8 @@ define([
'reviewchange:delete': _.bind(this.onDeleteClick, this), 'reviewchange:delete': _.bind(this.onDeleteClick, this),
'reviewchange:preview': _.bind(this.onBtnPreviewClick, this), 'reviewchange:preview': _.bind(this.onBtnPreviewClick, this),
'reviewchanges:view': _.bind(this.onReviewViewClick, this), 'reviewchanges:view': _.bind(this.onReviewViewClick, this),
'lang:document': _.bind(this.onDocLanguage, this) 'lang:document': _.bind(this.onDocLanguage, this),
'collaboration:coauthmode': _.bind(this.onCoAuthMode, this)
}, },
'Common.Views.ReviewChangesDialog': { 'Common.Views.ReviewChangesDialog': {
'reviewchange:accept': _.bind(this.onAcceptClick, this), 'reviewchange:accept': _.bind(this.onAcceptClick, this),
@ -131,7 +132,7 @@ define([
SetDisabled: function(state) { SetDisabled: function(state) {
if (this.dlgChanges) if (this.dlgChanges)
this.dlgChanges.close(); this.dlgChanges.close();
this.view && this.view.SetDisabled(state); this.view && this.view.SetDisabled(state, this.langs);
}, },
onApiShowChange: function (sdkchange) { onApiShowChange: function (sdkchange) {
@ -487,7 +488,7 @@ define([
state = (state == 'on'); state = (state == 'on');
this.api.asc_SetTrackRevisions(state); this.api.asc_SetTrackRevisions(state);
Common.localStorage.setItem("de-track-changes", state ? 1 : 0); Common.localStorage.setItem(this.view.appPrefix + "track-changes", state ? 1 : 0);
this.view.turnChanges(state); this.view.turnChanges(state);
} }
@ -497,8 +498,9 @@ define([
state = (state == 'on'); state = (state == 'on');
this.view.turnSpelling(state); this.view.turnSpelling(state);
Common.localStorage.setItem("de-settings-spellcheck", state ? 1 : 0); Common.localStorage.setItem(this.view.appPrefix + "settings-spellcheck", state ? 1 : 0);
this.api.asc_setSpellCheck(state); this.api.asc_setSpellCheck(state);
Common.Utils.InternalSettings.set("de-settings-spellcheck", state);
}, },
onReviewViewClick: function(menu, item, e) { onReviewViewClick: function(menu, item, e) {
@ -519,6 +521,32 @@ define([
return this._state.previewMode; return this._state.previewMode;
}, },
onCoAuthMode: function(menu, item, e) {
Common.localStorage.setItem(this.view.appPrefix + "settings-coauthmode", item.value);
if (this.api) {
this.api.asc_SetFastCollaborative(item.value==1);
if (this.api.SetCollaborativeMarksShowType) {
var value = Common.localStorage.getItem(item.value ? this.view.appPrefix + "settings-showchanges-fast" : this.view.appPrefix + "settings-showchanges-strict");
if (value !== null)
this.api.SetCollaborativeMarksShowType(value == 'all' ? Asc.c_oAscCollaborativeMarksShowType.All :
value == 'none' ? Asc.c_oAscCollaborativeMarksShowType.None : Asc.c_oAscCollaborativeMarksShowType.LastChanges);
else
this.api.SetCollaborativeMarksShowType(item.value ? Asc.c_oAscCollaborativeMarksShowType.None : Asc.c_oAscCollaborativeMarksShowType.LastChanges);
}
value = Common.localStorage.getItem(this.view.appPrefix + "settings-autosave");
if (value===null && this.appConfig.customization && this.appConfig.customization.autosave===false)
value = 0;
value = (!item.value && value!==null) ? parseInt(value) : 1;
Common.localStorage.setItem(this.view.appPrefix + "settings-autosave", value);
this.api.asc_setAutoSaveGap(value);
}
Common.NotificationCenter.trigger('edit:complete', this.view);
},
disableEditing: function(disable) { disableEditing: function(disable) {
var app = this.getApplication(); var app = this.getApplication();
app.getController('RightMenu').getView('RightMenu').clearSelection(); app.getController('RightMenu').getView('RightMenu').clearSelection();
@ -536,6 +564,12 @@ define([
if (this.view) { if (this.view) {
this.view.$el.find('.no-group-mask').css('opacity', 1); this.view.$el.find('.no-group-mask').css('opacity', 1);
this.view.btnsDocLang && this.view.btnsDocLang.forEach(function(button) {
if ( button ) {
button.setDisabled(disable || this.langs.length<1);
}
}, this);
} }
}, },
@ -550,7 +584,7 @@ define([
onAppReady: function (config) { onAppReady: function (config) {
var me = this; var me = this;
if ( me.view && Common.localStorage.getBool("de-settings-spellcheck", true) ) if ( me.view && Common.localStorage.getBool(me.view.appPrefix + "settings-spellcheck", true) )
me.view.turnSpelling(true); me.view.turnSpelling(true);
if ( config.canReview ) { if ( config.canReview ) {
@ -571,7 +605,7 @@ define([
_setReviewStatus(false); _setReviewStatus(false);
} else { } else {
me.api.asc_HaveRevisionsChanges() && me.view.markChanges(true); me.api.asc_HaveRevisionsChanges() && me.view.markChanges(true);
_setReviewStatus(Common.localStorage.getBool("de-track-changes")); _setReviewStatus(Common.localStorage.getBool(me.view.appPrefix + "track-changes"));
} }
if ( typeof (me.appConfig.customization) == 'object' && (me.appConfig.customization.showReviewChanges==true) ) { if ( typeof (me.appConfig.customization) == 'object' && (me.appConfig.customization.showReviewChanges==true) ) {
@ -585,10 +619,19 @@ define([
} }
}); });
} }
if (me.view && me.view.btnChat) {
me.getApplication().getController('LeftMenu').leftMenu.btnChat.on('toggle', function(btn, state){
if (state !== me.view.btnChat.pressed)
me.view.turnChat(state);
});
}
}, },
applySettings: function(menu) { applySettings: function(menu) {
this.view && this.view.turnSpelling( Common.localStorage.getBool("de-settings-spellcheck", true) ); this.view && this.view.turnSpelling( Common.localStorage.getBool(this.view.appPrefix + "settings-spellcheck", true) );
this.view && this.view.turnCoAuthMode( Common.localStorage.getBool(this.view.appPrefix + "settings-coauthmode", true) );
}, },
synchronizeChanges: function() { synchronizeChanges: function() {
@ -599,7 +642,11 @@ define([
setLanguages: function (array) { setLanguages: function (array) {
this.langs = array; this.langs = array;
this.view.btnDocLang.setDisabled(this.langs.length<1); this.view && this.view.btnsDocLang && this.view.btnsDocLang.forEach(function(button) {
if ( button ) {
button.setDisabled(this.langs.length<1);
}
}, this);
}, },
onDocLanguage: function() { onDocLanguage: function() {
@ -624,6 +671,10 @@ define([
})).show(); })).show();
}, },
onLostEditRights: function() {
this.view && this.view.onLostEditRights();
},
textInserted: '<b>Inserted:</b>', textInserted: '<b>Inserted:</b>',
textDeleted: '<b>Deleted:</b>', textDeleted: '<b>Deleted:</b>',
textParaInserted: '<b>Paragraph Inserted</b> ', textParaInserted: '<b>Paragraph Inserted</b> ',

View file

@ -317,7 +317,7 @@
var deltaX = e.deltaX * e.deltaFactor || deprecatedDeltaX, var deltaX = e.deltaX * e.deltaFactor || deprecatedDeltaX,
deltaY = e.deltaY * e.deltaFactor || deprecatedDeltaY; deltaY = e.deltaY * e.deltaFactor || deprecatedDeltaY;
if (e && e.target && (e.target.type === 'textarea' || e.target.type === 'input')) { if (e && e.target && (e.target.type === 'textarea' && !e.target.hasAttribute('readonly') || e.target.type === 'input')) {
e.stopImmediatePropagation(); e.stopImmediatePropagation();
e.preventDefault(); e.preventDefault();

View file

@ -5,7 +5,7 @@
<div class="user-name"><%=scope.getUserName(username)%></div> <div class="user-name"><%=scope.getUserName(username)%></div>
<div class="user-date"><%=date%></div> <div class="user-date"><%=date%></div>
<% if (!editTextInPopover || hint) { %> <% if (!editTextInPopover || hint) { %>
<div class="user-message"><%=scope.pickLink(comment)%></div> <textarea readonly class="user-message user-select"><%=scope.pickLink(comment)%></textarea>
<% } else { %> <% } else { %>
<div class="inner-edit-ct"> <div class="inner-edit-ct">
<textarea class="msg-reply user-select" maxlength="maxCommLength"><%=comment%></textarea> <textarea class="msg-reply user-select" maxlength="maxCommLength"><%=comment%></textarea>
@ -27,7 +27,7 @@
<div class="user-name"><%=scope.getUserName(item.get("username"))%></div> <div class="user-name"><%=scope.getUserName(item.get("username"))%></div>
<div class="user-date"><%=item.get("date")%></div> <div class="user-date"><%=item.get("date")%></div>
<% if (!item.get("editTextInPopover")) { %> <% if (!item.get("editTextInPopover")) { %>
<div class="user-message"><%=scope.pickLink(item.get("reply"))%></div> <textarea readonly class="user-message user-select"><%=scope.pickLink(item.get("reply"))%></textarea>
<% if (!hint) { %> <% if (!hint) { %>
<div class="btns-reply-ct"> <div class="btns-reply-ct">
<% if (item.get("editable")) { %> <% if (item.get("editable")) { %>

View file

@ -125,6 +125,9 @@ define(['gateway'], function () {
setKeysFilter: function(value) { setKeysFilter: function(value) {
_filter = value; _filter = value;
}, },
getKeysFilter: function() {
return _filter;
},
itemExists: _getItemExists, itemExists: _getItemExists,
sync: _refresh, sync: _refresh,
save: _save save: _save

View file

@ -101,7 +101,9 @@ Common.Utils = _.extend(new(function() {
Shape : 5, Shape : 5,
Slide : 6, Slide : 6,
Chart : 7, Chart : 7,
MailMerge : 8 MailMerge : 8,
Signature : 9,
Pivot : 10
}, },
isMobile = /android|avantgo|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent || navigator.vendor || window.opera), isMobile = /android|avantgo|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent || navigator.vendor || window.opera),
me = this, me = this,
@ -700,7 +702,23 @@ Common.Utils.createXhr = function () {
} }
return xmlhttp; return xmlhttp;
};
Common.Utils.getConfigJson = function (url) {
if ( url ) {
try {
var xhrObj = Common.Utils.createXhr();
if ( xhrObj ) {
xhrObj.open('GET', url, false);
xhrObj.send('');
return JSON.parse(xhrObj.responseText);
} }
} catch (e) {}
}
return null;
};
Common.Utils.getConfigJson = function (url) { Common.Utils.getConfigJson = function (url) {
if ( url ) { if ( url ) {
@ -724,7 +742,7 @@ Common.Utils.asyncCall = function (callback, scope, args) {
})).then(function () { })).then(function () {
callback.call(scope, args); callback.call(scope, args);
}); });
} };
// Extend javascript String type // Extend javascript String type
String.prototype.strongMatch = function(regExp){ String.prototype.strongMatch = function(regExp){
@ -735,3 +753,19 @@ String.prototype.strongMatch = function(regExp){
return false; return false;
}; };
Common.Utils.InternalSettings = new(function() {
var settings = {};
var _get = function(name) {
return settings[name];
},
_set = function(name, value) {
settings[name] = value;
};
return {
get: _get,
set: _set
}
});

View file

@ -152,11 +152,11 @@ define([
}, },
getTextBox: function () { getTextBox: function () {
var text = $(this.el).find('textarea'); var text = $(this.el).find('textarea:not(.user-message)');
return (text && text.length) ? text : undefined; return (text && text.length) ? text : undefined;
}, },
setFocusToTextBox: function (blur) { setFocusToTextBox: function (blur) {
var text = $(this.el).find('textarea'); var text = $(this.el).find('textarea:not(.user-message)');
if (blur) { if (blur) {
text.blur(); text.blur();
} else { } else {
@ -169,15 +169,16 @@ define([
} }
}, },
getActiveTextBoxVal: function () { getActiveTextBoxVal: function () {
var text = $(this.el).find('textarea'); var text = $(this.el).find('textarea:not(.user-message)');
return (text && text.length) ? text.val().trim() : ''; return (text && text.length) ? text.val().trim() : '';
}, },
autoHeightTextBox: function () { autoHeightTextBox: function () {
var view = this, var view = this,
textBox = this.$el.find('textarea'), textBox = this.$el.find('textarea'),
domTextBox = null, domTextBox = null,
minHeight = 50, $domTextBox = null,
lineHeight = 0, lineHeight = 0,
minHeight = 50,
scrollPos = 0, scrollPos = 0,
oldHeight = 0, oldHeight = 0,
newHeight = 0; newHeight = 0;
@ -186,17 +187,17 @@ define([
scrollPos = $(view.scroller.el).scrollTop(); scrollPos = $(view.scroller.el).scrollTop();
if (domTextBox.scrollHeight > domTextBox.clientHeight) { if (domTextBox.scrollHeight > domTextBox.clientHeight) {
textBox.css({height: (domTextBox.scrollHeight + lineHeight) + 'px'}); $domTextBox.css({height: (domTextBox.scrollHeight + lineHeight) + 'px'});
parentView.calculateSizeOfContent(); parentView.calculateSizeOfContent();
} else { } else {
oldHeight = domTextBox.clientHeight; oldHeight = domTextBox.clientHeight;
if (oldHeight >= minHeight) { if (oldHeight >= minHeight) {
textBox.css({height: minHeight + 'px'}); $domTextBox.css({height: minHeight + 'px'});
if (domTextBox.scrollHeight > domTextBox.clientHeight) { if (domTextBox.scrollHeight > domTextBox.clientHeight) {
newHeight = Math.max(domTextBox.scrollHeight + lineHeight, minHeight); newHeight = Math.max(domTextBox.scrollHeight + lineHeight, minHeight);
textBox.css({height: newHeight + 'px'}); $domTextBox.css({height: newHeight + 'px'});
} }
parentView.calculateSizeOfContent(); parentView.calculateSizeOfContent();
@ -209,17 +210,23 @@ define([
view.autoScrollToEditButtons(); view.autoScrollToEditButtons();
} }
this.textBox = undefined;
if (textBox && textBox.length) { if (textBox && textBox.length) {
domTextBox = textBox.get(0); textBox.each(function(idx, item){
if (item) {
if (domTextBox) { domTextBox = item;
lineHeight = parseInt(textBox.css('lineHeight'), 10) * 0.25; $domTextBox = $(item);
var isEdited = !$domTextBox.hasClass('user-message');
lineHeight = isEdited ? parseInt($domTextBox.css('lineHeight'), 10) * 0.25 : 0;
minHeight = isEdited ? 50 : 24;
updateTextBoxHeight(); updateTextBoxHeight();
textBox.bind('input propertychange', updateTextBoxHeight) if (isEdited) {
$domTextBox.bind('input propertychange', updateTextBoxHeight);
view.textBox = $domTextBox;
} }
} }
});
this.textBox = textBox; }
}, },
clearTextBoxBind: function () { clearTextBoxBind: function () {
if (this.textBox) { if (this.textBox) {
@ -375,6 +382,7 @@ define([
t.fireEvent('comment:closeEditing'); t.fireEvent('comment:closeEditing');
readdresolves(); readdresolves();
this.autoHeightTextBox();
} else if (btn.hasClass('user-reply')) { } else if (btn.hasClass('user-reply')) {
t.fireEvent('comment:closeEditing'); t.fireEvent('comment:closeEditing');
@ -399,6 +407,7 @@ define([
t.fireEvent('comment:closeEditing'); t.fireEvent('comment:closeEditing');
readdresolves(); readdresolves();
this.autoHeightTextBox();
} }
} else if (btn.hasClass('btn-close', false)) { } else if (btn.hasClass('btn-close', false)) {
t.fireEvent('comment:closeEditing', [commentId]); t.fireEvent('comment:closeEditing', [commentId]);
@ -406,6 +415,7 @@ define([
t.fireEvent('comment:show', [commentId]); t.fireEvent('comment:show', [commentId]);
readdresolves(); readdresolves();
this.autoHeightTextBox();
} else if (btn.hasClass('btn-inner-edit', false)) { } else if (btn.hasClass('btn-inner-edit', false)) {
@ -427,6 +437,7 @@ define([
} }
readdresolves(); readdresolves();
this.autoHeightTextBox();
} else if (btn.hasClass('btn-inner-close', false)) { } else if (btn.hasClass('btn-inner-close', false)) {
if (record.get('dummy')) { if (record.get('dummy')) {
@ -438,11 +449,8 @@ define([
me.saveText(); me.saveText();
record.set('hideAddReply', false); record.set('hideAddReply', false);
this.getTextBox().val(me.textVal); this.getTextBox().val(me.textVal);
this.autoHeightTextBox();
} else { } else {
this.clearTextBoxBind(); this.clearTextBoxBind();
t.fireEvent('comment:closeEditing', [commentId]); t.fireEvent('comment:closeEditing', [commentId]);
} }
@ -453,6 +461,7 @@ define([
me.calculateSizeOfContent(); me.calculateSizeOfContent();
readdresolves(); readdresolves();
this.autoHeightTextBox();
} else if (btn.hasClass('btn-resolve', false)) { } else if (btn.hasClass('btn-resolve', false)) {
var tip = btn.data('bs.tooltip'); var tip = btn.data('bs.tooltip');
@ -461,6 +470,7 @@ define([
t.fireEvent('comment:resolve', [commentId]); t.fireEvent('comment:resolve', [commentId]);
readdresolves(); readdresolves();
this.autoHeightTextBox();
} else if (btn.hasClass('btn-resolve-check', false)) { } else if (btn.hasClass('btn-resolve-check', false)) {
var tip = btn.data('bs.tooltip'); var tip = btn.data('bs.tooltip');
if (tip) tip.dontShow = true; if (tip) tip.dontShow = true;
@ -468,20 +478,21 @@ define([
t.fireEvent('comment:resolve', [commentId]); t.fireEvent('comment:resolve', [commentId]);
readdresolves(); readdresolves();
this.autoHeightTextBox();
} }
} }
}); });
me.on({ me.on({
'show': function () { 'show': function () {
me.commentsView.autoHeightTextBox(); me.$window.find('textarea:not(.user-message)').keydown(function (event) {
me.$window.find('textarea').keydown(function (event) {
if (event.keyCode == Common.UI.Keys.ESC) { if (event.keyCode == Common.UI.Keys.ESC) {
me.hide(); me.hide();
} }
}); });
}, },
'animate:before': function () { 'animate:before': function () {
var text = me.$window.find('textarea'); me.commentsView.autoHeightTextBox();
var text = me.$window.find('textarea:not(.user-message)');
if (text && text.length) if (text && text.length)
text.focus(); text.focus();
} }
@ -889,11 +900,11 @@ define([
}, },
getTextBox: function () { getTextBox: function () {
var text = $(this.el).find('textarea'); var text = $(this.el).find('textarea:not(.user-message)');
return (text && text.length) ? text : undefined; return (text && text.length) ? text : undefined;
}, },
setFocusToTextBox: function () { setFocusToTextBox: function () {
var text = $(this.el).find('textarea'); var text = $(this.el).find('textarea:not(.user-message)');
if (text && text.length) { if (text && text.length) {
var val = text.val(); var val = text.val();
text.focus(); text.focus();
@ -902,7 +913,7 @@ define([
} }
}, },
getActiveTextBoxVal: function () { getActiveTextBoxVal: function () {
var text = $(this.el).find('textarea'); var text = $(this.el).find('textarea:not(.user-message)');
return (text && text.length) ? text.val().trim() : ''; return (text && text.length) ? text.val().trim() : '';
}, },
autoHeightTextBox: function () { autoHeightTextBox: function () {

View file

@ -70,7 +70,9 @@ define([
'</ul>'); '</ul>');
var templateRightBox = '<section>' + var templateRightBox = '<section>' +
'<section id="box-doc-name"><input type="text" id="rib-doc-name" spellcheck="false" data-can-copy="false"></input></section>' + '<section id="box-doc-name">' +
'<input type="text" id="rib-doc-name" spellcheck="false" data-can-copy="false"></input>' +
'</section>' +
'<a id="rib-save-status" class="status-label locked"><%= textSaveEnd %></a>' + '<a id="rib-save-status" class="status-label locked"><%= textSaveEnd %></a>' +
'<div class="hedset">' + '<div class="hedset">' +
'<div class="btn-slot" id="slot-hbtn-edit"></div>' + '<div class="btn-slot" id="slot-hbtn-edit"></div>' +
@ -394,12 +396,13 @@ define([
if ( this.labelDocName ) this.labelDocName.off(); if ( this.labelDocName ) this.labelDocName.off();
this.labelDocName = $html.find('#rib-doc-name'); this.labelDocName = $html.find('#rib-doc-name');
this.labelDocName.on({ // this.labelDocName.attr('maxlength', 50);
'keydown': onDocNameKeyDown.bind(this) this.labelDocName.text = function (text) {
}); this.val(text).attr('size', text.length);
}
if ( this.documentCaption ) { if ( this.documentCaption ) {
this.labelDocName.val( this.documentCaption ); this.labelDocName.text( this.documentCaption );
} }
if ( !_.isUndefined(this.options.canRename) ) { if ( !_.isUndefined(this.options.canRename) ) {
@ -497,8 +500,8 @@ define([
this.documentCaption = value; this.documentCaption = value;
this.isModified && (value += '*'); this.isModified && (value += '*');
if ( this.labelDocName ) { if ( this.labelDocName ) {
this.labelDocName.val( value ); this.labelDocName.text( value );
this.labelDocName.attr('size', value.length); // this.labelDocName.attr('size', value.length);
this.setCanRename(true); this.setCanRename(true);
} }
@ -516,7 +519,7 @@ define([
var _name = this.documentCaption; var _name = this.documentCaption;
changed && (_name += '*'); changed && (_name += '*');
this.labelDocName.val(_name); this.labelDocName.text(_name);
}, },
setCanBack: function (value) { setCanBack: function (value) {
@ -541,7 +544,16 @@ define([
title: me.txtRename, title: me.txtRename,
placement: 'cursor'} placement: 'cursor'}
); );
label.on({
'keydown': onDocNameKeyDown.bind(this),
'blur': function (e) {
}
});
} else { } else {
label.off();
label.attr('disabled', true); label.attr('disabled', true);
var tip = label.data('bs.tooltip'); var tip = label.data('bs.tooltip');
if ( tip ) { if ( tip ) {

View file

@ -412,30 +412,35 @@ define([
Common.Views.ReviewChanges = Common.UI.BaseView.extend(_.extend((function(){ Common.Views.ReviewChanges = Common.UI.BaseView.extend(_.extend((function(){
var template = var template =
'<section id="review-changes-panel" class="panel" data-tab="review">' + '<section id="review-changes-panel" class="panel" data-tab="review">' +
'<div class="group">' + '<div class="group no-group-mask">' +
'<span id="slot-set-lang" class="btn-slot text x-huge"></span>' + '<span id="slot-btn-sharing" class="btn-slot text x-huge"></span>' +
'<span id="slot-btn-coauthmode" class="btn-slot text x-huge"></span>' +
'</div>' + '</div>' +
'<div class="group no-group-mask" style="padding-left: 0;">' + '<div class="separator long sharing"/>' +
'<span id="slot-btn-spelling" class="btn-slot text x-huge"></span>' +
'</div>' +
'<div class="separator long comments"/>' +
'<div class="group">' + '<div class="group">' +
'<span class="btn-slot text x-huge slot-comment"></span>' + '<span class="btn-slot text x-huge slot-comment"></span>' +
'</div>' + '</div>' +
'<div class="separator long review"/>' + '<div class="separator long comments"/>' +
'<div class="group">' + '<div class="group">' +
'<span id="btn-review-on" class="btn-slot text x-huge"></span>' + '<span id="btn-review-on" class="btn-slot text x-huge"></span>' +
'</div>' + '</div>' +
'<div class="group no-group-mask" style="padding-left: 0;">' + '<div class="group no-group-mask" style="padding-left: 0;">' +
'<span id="btn-review-view" class="btn-slot text x-huge"></span>' + '<span id="btn-review-view" class="btn-slot text x-huge"></span>' +
'</div>' + '</div>' +
'<div class="separator long review"/>' + '<div class="group move-changes" style="padding-left: 0;">' +
'<div class="group move-changes">' +
'<span id="btn-change-prev" class="btn-slot text x-huge"></span>' + '<span id="btn-change-prev" class="btn-slot text x-huge"></span>' +
'<span id="btn-change-next" class="btn-slot text x-huge"></span>' + '<span id="btn-change-next" class="btn-slot text x-huge"></span>' +
'<span id="btn-change-accept" class="btn-slot text x-huge"></span>' + '<span id="btn-change-accept" class="btn-slot text x-huge"></span>' +
'<span id="btn-change-reject" class="btn-slot text x-huge"></span>' + '<span id="btn-change-reject" class="btn-slot text x-huge"></span>' +
'</div>' + '</div>' +
'<div class="separator long review"/>' +
'<div class="group no-group-mask">' +
'<span id="slot-btn-chat" class="btn-slot text x-huge"></span>' +
'</div>' +
'<div class="separator long chat"/>' +
'<div class="group no-group-mask">' +
'<span id="slot-btn-history" class="btn-slot text x-huge"></span>' +
'</div>' +
'</section>'; '</section>';
function setEvents() { function setEvents() {
@ -489,9 +494,27 @@ define([
}); });
}); });
this.btnDocLang.on('click', function (btn, e) { this.btnsDocLang.forEach(function(button) {
button.on('click', function (b, e) {
me.fireEvent('lang:document', this); me.fireEvent('lang:document', this);
}); });
});
this.btnSharing && this.btnSharing.on('click', function (btn, e) {
Common.NotificationCenter.trigger('collaboration:sharing');
});
this.btnCoAuthMode && this.btnCoAuthMode.menu.on('item:click', function (menu, item, e) {
me.fireEvent('collaboration:coauthmode', [menu, item]);
});
this.btnHistory && this.btnHistory.on('click', function (btn, e) {
Common.NotificationCenter.trigger('collaboration:history');
});
this.btnChat && this.btnChat.on('click', function (btn, e) {
me.fireEvent('collaboration:chat', [btn.pressed]);
});
} }
return { return {
@ -549,20 +572,45 @@ define([
}); });
} }
this.btnSetSpelling = new Common.UI.Button({ if (!!this.appConfig.sharingSettingsUrl && this.appConfig.sharingSettingsUrl.length && this._readonlyRights!==true) {
this.btnSharing = new Common.UI.Button({
cls: 'btn-toolbar x-huge icon-top', cls: 'btn-toolbar x-huge icon-top',
iconCls: 'btn-ic-docspell', iconCls: 'btn-ic-sharing',
caption: this.txtSpelling, caption: this.txtSharing
});
}
if (!this.appConfig.isOffline && this.appConfig.canCoAuthoring) {
this.btnCoAuthMode = new Common.UI.Button({
cls: 'btn-toolbar x-huge icon-top',
iconCls: 'btn-ic-coedit',
caption: this.txtCoAuthMode,
menu: true
});
}
this.btnsSpelling = [];
this.btnsDocLang = [];
if (this.appConfig.canUseHistory && !this.appConfig.isDisconnected) {
this.btnHistory = new Common.UI.Button({
cls: 'btn-toolbar x-huge icon-top',
iconCls: 'btn-ic-history',
caption: this.txtHistory
});
}
if (this.appConfig.canCoAuthoring && this.appConfig.canChat) {
this.btnChat = new Common.UI.Button({
cls: 'btn-toolbar x-huge icon-top',
iconCls: 'btn-ic-chat',
caption: this.txtChat,
enableToggle: true enableToggle: true
}); });
this.btnsSpelling = [this.btnSetSpelling]; }
this.btnDocLang = new Common.UI.Button({ var filter = Common.localStorage.getKeysFilter();
cls: 'btn-toolbar x-huge icon-top', this.appPrefix = (filter && filter.length) ? filter.split(',')[0] : '';
iconCls: 'btn-ic-doclang',
caption: this.txtDocLang,
disabled: true
});
Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this)); Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this));
}, },
@ -616,29 +664,39 @@ define([
); );
me.btnReject.updateHint([me.tipRejectCurrent, me.txtRejectChanges]); me.btnReject.updateHint([me.tipRejectCurrent, me.txtRejectChanges]);
var menuTemplate = _.template('<a id="<%= id %>" tabindex="-1" type="menuitem"><div><%= caption %></div>' +
'<% if (options.description !== null) { %><label style="display: block;color: #a5a5a5;cursor: pointer;white-space: normal;"><%= options.description %></label>' +
'<% } %></a>');
me.btnReviewView.setMenu( me.btnReviewView.setMenu(
new Common.UI.Menu({ new Common.UI.Menu({
cls: 'ppm-toolbar', cls: 'ppm-toolbar',
items: [ items: [
{ {
caption: me.txtMarkup, caption: me.txtMarkupCap,
checkable: true, checkable: true,
toggleGroup: 'menuReviewView', toggleGroup: 'menuReviewView',
checked: true, checked: true,
value: 'markup' value: 'markup',
template: menuTemplate,
description: me.txtMarkup
}, },
{ {
caption: me.txtFinal, caption: me.txtFinalCap,
checkable: true, checkable: true,
toggleGroup: 'menuReviewView', toggleGroup: 'menuReviewView',
checked: false, checked: false,
template: menuTemplate,
description: me.txtFinal,
value: 'final' value: 'final'
}, },
{ {
caption: me.txtOriginal, caption: me.txtOriginalCap,
checkable: true, checkable: true,
toggleGroup: 'menuReviewView', toggleGroup: 'menuReviewView',
checked: false, checked: false,
template: menuTemplate,
description: me.txtOriginal,
value: 'original' value: 'original'
} }
] ]
@ -647,20 +705,78 @@ define([
me.btnAccept.setDisabled(config.isReviewOnly); me.btnAccept.setDisabled(config.isReviewOnly);
me.btnReject.setDisabled(config.isReviewOnly); me.btnReject.setDisabled(config.isReviewOnly);
} else {
me.$el.find('.separator.review')
.hide()
.next('.group').hide();
} }
if ( !config.canComments || !config.canCoAuthoring) { me.btnSharing && me.btnSharing.updateHint(me.tipSharing);
$('.separator.comments', me.$el) me.btnHistory && me.btnHistory.updateHint(me.tipHistory);
.hide() me.btnChat && me.btnChat.updateHint(me.txtChat + Common.Utils.String.platformKey('Alt+Q'));
.next('.group').hide();
if (me.btnCoAuthMode) {
me.btnCoAuthMode.setMenu(
new Common.UI.Menu({
cls: 'ppm-toolbar',
style: 'max-width: 220px;',
items: [
{
caption: me.strFast,
checkable: true,
toggleGroup: 'menuCoauthMode',
checked: true,
template: menuTemplate,
description: me.strFastDesc,
value: 1
},
{
caption: me.strStrict,
checkable: true,
toggleGroup: 'menuCoauthMode',
checked: false,
template: menuTemplate,
description: me.strStrictDesc,
value: 0
}
]
}));
me.btnCoAuthMode.updateHint(me.tipCoAuthMode);
var value = Common.localStorage.getItem(me.appPrefix + "settings-coauthmode");
if (value===null && !Common.localStorage.itemExists(me.appPrefix + "settings-autosave") &&
config.customization && config.customization.autosave===false) {
value = 0; // use customization.autosave only when de-settings-coauthmode and de-settings-autosave are null
}
me.turnCoAuthMode((value===null || parseInt(value) == 1) && !(config.isDesktopApp && config.isOffline) && config.canCoAuthoring);
} }
me.btnDocLang.updateHint(me.tipSetDocLang); var separator_sharing = !(me.btnSharing || me.btnCoAuthMode) ? me.$el.find('.separator.sharing') : '.separator.sharing',
me.btnSetSpelling.updateHint(me.tipSetSpelling); separator_comments = !(config.canComments && config.canCoAuthoring) ? me.$el.find('.separator.comments') : '.separator.comments',
separator_review = !config.canReview ? me.$el.find('.separator.review') : '.separator.review',
separator_chat = !me.btnChat ? me.$el.find('.separator.chat') : '.separator.chat',
separator_last;
if (typeof separator_sharing == 'object')
separator_sharing.hide().prev('.group').hide();
else
separator_last = separator_sharing;
if (typeof separator_comments == 'object')
separator_comments.hide().prev('.group').hide();
else
separator_last = separator_comments;
if (typeof separator_review == 'object')
separator_review.hide().prevUntil('.separator.comments').hide();
else
separator_last = separator_review;
if (typeof separator_chat == 'object')
separator_chat.hide().prev('.group').hide();
else
separator_last = separator_chat;
if (!me.btnHistory && separator_last)
me.$el.find(separator_last).hide();
Common.NotificationCenter.trigger('tab:visible', 'review', true);
setEvents.call(me); setEvents.call(me);
}); });
@ -678,8 +794,10 @@ define([
this.btnReviewView.render(this.$el.find('#btn-review-view')); this.btnReviewView.render(this.$el.find('#btn-review-view'));
} }
this.btnSetSpelling.render(this.$el.find('#slot-btn-spelling')); this.btnSharing && this.btnSharing.render(this.$el.find('#slot-btn-sharing'));
this.btnDocLang.render(this.$el.find('#slot-set-lang')); this.btnCoAuthMode && this.btnCoAuthMode.render(this.$el.find('#slot-btn-coauthmode'));
this.btnHistory && this.btnHistory.render(this.$el.find('#slot-btn-history'));
this.btnChat && this.btnChat.render(this.$el.find('#slot-btn-chat'));
return this.$el; return this.$el;
}, },
@ -725,6 +843,17 @@ define([
}); });
this.btnsSpelling.push(button); this.btnsSpelling.push(button);
return button;
} else if (type == 'doclang' && parent == 'statusbar' ) {
button = new Common.UI.Button({
cls: 'btn-toolbar',
iconCls: 'btn-ic-doclang',
hintAnchor : 'top',
hint: this.tipSetDocLang,
disabled: true
});
this.btnsDocLang.push(button);
return button; return button;
} }
}, },
@ -758,17 +887,42 @@ define([
}, this); }, this);
}, },
SetDisabled: function (state) { turnCoAuthMode: function (fast) {
if (this.btnCoAuthMode) {
this.btnCoAuthMode.menu.items[0].setChecked(fast, true);
this.btnCoAuthMode.menu.items[1].setChecked(!fast, true);
}
},
turnChat: function (state) {
this.btnChat && this.btnChat.toggle(state, true);
},
SetDisabled: function (state, langs) {
this.btnsSpelling && this.btnsSpelling.forEach(function(button) { this.btnsSpelling && this.btnsSpelling.forEach(function(button) {
if ( button ) { if ( button ) {
button.setDisabled(state); button.setDisabled(state);
} }
}, this); }, this);
this.btnsDocLang && this.btnsDocLang.forEach(function(button) {
if ( button ) {
button.setDisabled(state || langs && langs.length<1);
}
}, this);
this.btnsTurnReview && this.btnsTurnReview.forEach(function(button) { this.btnsTurnReview && this.btnsTurnReview.forEach(function(button) {
if ( button ) { if ( button ) {
button.setDisabled(state); button.setDisabled(state);
} }
}, this); }, this);
this.btnChat && this.btnChat.setDisabled(state);
},
onLostEditRights: function() {
this._readonlyRights = true;
if (!this.rendered)
return;
this.btnSharing && this.btnSharing.setDisabled(true);
}, },
txtAccept: 'Accept', txtAccept: 'Accept',
@ -790,12 +944,26 @@ define([
txtAcceptChanges: 'Accept Changes', txtAcceptChanges: 'Accept Changes',
txtRejectChanges: 'Reject Changes', txtRejectChanges: 'Reject Changes',
txtView: 'Display Mode', txtView: 'Display Mode',
txtMarkup: 'All changes (Editing)', txtMarkup: 'Text with changes (Editing)',
txtFinal: 'All changes accepted (Preview)', txtFinal: 'All changes like accept (Preview)',
txtOriginal: 'All changes rejected (Preview)', txtOriginal: 'Text without changes (Preview)',
tipReviewView: 'Select the way you want the changes to be displayed', tipReviewView: 'Select the way you want the changes to be displayed',
tipAcceptCurrent: 'Accept current changes', tipAcceptCurrent: 'Accept current changes',
tipRejectCurrent: 'Reject current changes' tipRejectCurrent: 'Reject current changes',
txtSharing: 'Sharing',
tipSharing: 'Manage document access rights',
txtCoAuthMode: 'Co-editing Mode',
tipCoAuthMode: 'Set co-editing mode',
strFast: 'Fast',
strStrict: 'Strict',
txtHistory: 'Version History',
tipHistory: 'Show version history',
txtChat: 'Chat',
txtMarkupCap: 'Markup',
txtFinalCap: 'Final',
txtOriginalCap: 'Original',
strFastDesc: 'Real-time co-editing. All changes are saved automatically.',
strStrictDesc: 'Use the \'Save\' button to sync the changes you and others make.'
} }
}()), Common.Views.ReviewChanges || {})); }()), Common.Views.ReviewChanges || {}));

View file

@ -0,0 +1,347 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
/**
* SignDialog.js
*
* Created by Julia Radzhabova on 5/19/17
* Copyright (c) 2017 Ascensio System SIA. All rights reserved.
*
*/
if (Common === undefined)
var Common = {};
define([
'common/main/lib/util/utils',
'common/main/lib/component/InputField',
'common/main/lib/component/Window',
'common/main/lib/component/ComboBoxFonts'
], function () { 'use strict';
Common.Views.SignDialog = Common.UI.Window.extend(_.extend({
options: {
width: 350,
style: 'min-width: 350px;',
cls: 'modal-dlg'
},
initialize : function(options) {
_.extend(this.options, {
title: this.textTitle
}, options || {});
this.api = this.options.api;
this.signType = this.options.signType || 'invisible';
this.signSize = this.options.signSize || {width: 0, height: 0};
this.certificateId = null;
this.signObject = null;
this.fontStore = this.options.fontStore;
this.font = {
size: 11,
name: 'Arial',
bold: false,
italic: false
};
this.template = [
'<div class="box" style="height: ' + ((this.signType == 'invisible') ? '132px;' : '300px;') + '">',
'<div id="id-dlg-sign-invisible">',
'<div class="input-row">',
'<label>' + this.textPurpose + '</label>',
'</div>',
'<div id="id-dlg-sign-purpose" class="input-row"></div>',
'</div>',
'<div id="id-dlg-sign-visible">',
'<div class="input-row">',
'<label>' + this.textInputName + '</label>',
'</div>',
'<div id="id-dlg-sign-name" class="input-row" style="margin-bottom: 5px;"></div>',
'<div id="id-dlg-sign-fonts" class="input-row" style="display: inline-block;"></div>',
'<div id="id-dlg-sign-font-size" class="input-row" style="display: inline-block;margin-left: 3px;"></div>',
'<div id="id-dlg-sign-bold" style="display: inline-block;margin-left: 3px;"></div>','<div id="id-dlg-sign-italic" style="display: inline-block;margin-left: 3px;"></div>',
'<div class="input-row" style="margin-top: 10px;">',
'<label>' + this.textUseImage + '</label>',
'</div>',
'<button id="id-dlg-sign-image" class="btn btn-text-default" style="">' + this.textSelectImage + '</button>',
'<div class="input-row" style="margin-top: 10px;">',
'<label style="font-weight: bold;">' + this.textSignature + '</label>',
'</div>',
'<div style="border: 1px solid #cbcbcb;"><div id="signature-preview-img" style="width: 100%; height: 50px;position: relative;"></div></div>',
'</div>',
'<table style="margin-top: 30px;">',
'<tr>',
'<td><label style="font-weight: bold;margin-bottom: 3px;">' + this.textCertificate + '</label></td>' +
'<td rowspan="2" style="vertical-align: top; padding-left: 30px;"><button id="id-dlg-sign-change" class="btn btn-text-default" style="">' + this.textChange + '</button></td>',
'</tr>',
'<tr><td><div id="id-dlg-sign-certificate" style="max-width: 212px;overflow: hidden;"></td></tr>',
'</table>',
'</div>',
'<div class="footer center">',
'<button class="btn normal dlg-btn primary" result="ok" style="margin-right: 10px;">' + this.okButtonText + '</button>',
'<button class="btn normal dlg-btn" result="cancel">' + this.cancelButtonText + '</button>',
'</div>'
].join('');
this.templateCertificate = _.template([
'<label style="display: block;margin-bottom: 3px;"><%= Common.Utils.String.htmlEncode(name) %></label>',
'<label style="display: block;"><%= Common.Utils.String.htmlEncode(valid) %></label>'
].join(''));
this.options.tpl = _.template(this.template)(this.options);
Common.UI.Window.prototype.initialize.call(this, this.options);
},
render: function() {
Common.UI.Window.prototype.render.call(this);
var me = this,
$window = this.getChild();
me.inputPurpose = new Common.UI.InputField({
el : $('#id-dlg-sign-purpose'),
style : 'width: 100%;'
});
me.inputName = new Common.UI.InputField({
el : $('#id-dlg-sign-name'),
style : 'width: 100%;',
validateOnChange: true
}).on ('changing', _.bind(me.onChangeName, me));
me.cmbFonts = new Common.UI.ComboBoxFonts({
el : $('#id-dlg-sign-fonts'),
cls : 'input-group-nr',
style : 'width: 214px;',
menuCls : 'scrollable-menu',
menuStyle : 'min-width: 55px;max-height: 270px;',
store : new Common.Collections.Fonts(),
recent : 0,
hint : me.tipFontName
}).on('selected', function(combo, record) {
if (me.signObject) {
me.signObject.setText(me.inputName.getValue(), record.name, me.font.size, me.font.italic, me.font.bold);
}
me.font.name = record.name;
});
this.cmbFontSize = new Common.UI.ComboBox({
el: $('#id-dlg-sign-font-size'),
cls: 'input-group-nr',
style: 'width: 55px;',
menuCls : 'scrollable-menu',
menuStyle: 'min-width: 55px;max-height: 270px;',
hint: this.tipFontSize,
data: [
{ value: 8, displayValue: "8" },
{ value: 9, displayValue: "9" },
{ value: 10, displayValue: "10" },
{ value: 11, displayValue: "11" },
{ value: 12, displayValue: "12" },
{ value: 14, displayValue: "14" },
{ value: 16, displayValue: "16" },
{ value: 18, displayValue: "18" },
{ value: 20, displayValue: "20" },
{ value: 22, displayValue: "22" },
{ value: 24, displayValue: "24" },
{ value: 26, displayValue: "26" },
{ value: 28, displayValue: "28" },
{ value: 36, displayValue: "36" },
{ value: 48, displayValue: "48" },
{ value: 72, displayValue: "72" }
]
}).on('selected', function(combo, record) {
if (me.signObject) {
me.signObject.setText(me.inputName.getValue(), me.font.name, record.value, me.font.italic, me.font.bold);
}
me.font.size = record.value;
});
this.cmbFontSize.setValue(this.font.size);
me.btnBold = new Common.UI.Button({
cls: 'btn-toolbar',
iconCls: 'btn-bold',
enableToggle: true,
hint: me.textBold
});
me.btnBold.render($('#id-dlg-sign-bold')) ;
me.btnBold.on('click', function(btn, e) {
if (me.signObject) {
me.signObject.setText(me.inputName.getValue(), me.font.name, me.font.size, me.font.italic, btn.pressed);
}
me.font.bold = btn.pressed;
});
me.btnItalic = new Common.UI.Button({
cls: 'btn-toolbar',
iconCls: 'btn-italic',
enableToggle: true,
hint: me.textItalic
});
me.btnItalic.render($('#id-dlg-sign-italic')) ;
me.btnItalic.on('click', function(btn, e) {
if (me.signObject) {
me.signObject.setText(me.inputName.getValue(), me.font.name, me.font.size, btn.pressed, me.font.bold);
}
me.font.italic = btn.pressed;
});
me.btnSelectImage = new Common.UI.Button({
el: '#id-dlg-sign-image'
});
me.btnSelectImage.on('click', _.bind(me.onSelectImage, me));
me.btnChangeCertificate = new Common.UI.Button({
el: '#id-dlg-sign-change'
});
me.btnChangeCertificate.on('click', _.bind(me.onChangeCertificate, me));
me.cntCertificate = $('#id-dlg-sign-certificate');
me.cntVisibleSign = $('#id-dlg-sign-visible');
me.cntInvisibleSign = $('#id-dlg-sign-invisible');
(me.signType == 'visible') ? me.cntInvisibleSign.addClass('hidden') : me.cntVisibleSign.addClass('hidden');
$window.find('.dlg-btn').on('click', _.bind(me.onBtnClick, me));
$window.find('input').on('keypress', _.bind(me.onKeyPress, me));
me.afterRender();
},
show: function() {
Common.UI.Window.prototype.show.apply(this, arguments);
var me = this;
_.delay(function(){
((me.signType == 'visible') ? me.inputName : me.inputPurpose).cmpEl.find('input').focus();
},500);
},
hide: function() {
Common.UI.Window.prototype.hide.apply(this, arguments);
if (this.signObject)
this.signObject.destroy();
},
afterRender: function () {
if (this.api) {
this.api.asc_unregisterCallback('on_signature_defaultcertificate_ret', _.bind(this.onCertificateChanged, this));
this.api.asc_registerCallback('on_signature_defaultcertificate_ret', _.bind(this.onCertificateChanged, this));
this.api.asc_unregisterCallback('on_signature_selectsertificate_ret', _.bind(this.onCertificateChanged, this));
this.api.asc_registerCallback('on_signature_selectsertificate_ret', _.bind(this.onCertificateChanged, this));
this.api.asc_GetDefaultCertificate();
}
if (this.signType == 'visible') {
this.cmbFonts.fillFonts(this.fontStore);
this.cmbFonts.selectRecord(this.fontStore.findWhere({name: this.font.name}) || this.fontStore.at(0));
this.signObject = new AscCommon.CSignatureDrawer('signature-preview-img', this.api, this.signSize.width, this.signSize.height);
}
},
getSettings: function () {
var props = {};
props.certificateId = this.certificateId;
if (this.signType == 'invisible') {
props.purpose = this.inputPurpose.getValue();
} else {
props.images = this.signObject ? this.signObject.getImages() : [null, null];
}
return props;
},
onBtnClick: function(event) {
this._handleInput(event.currentTarget.attributes['result'].value);
},
onKeyPress: function(event) {
if (event.keyCode == Common.UI.Keys.RETURN) {
this._handleInput('ok');
return false;
}
},
_handleInput: function(state) {
if (this.options.handler) {
if (state == 'ok' && this.signObject && !this.signObject.isValid())
return;
this.options.handler.call(this, this, state);
}
this.close();
},
onChangeCertificate: function() {
this.api.asc_SelectCertificate();
},
onCertificateChanged: function(certificate) {
this.certificateId = certificate.id;
var date = certificate.date,
arr_date = (typeof date == 'string') ? date.split(' - ') : ['', ''];
this.cntCertificate.html(this.templateCertificate({name: certificate.name, valid: this.textValid.replace('%1', arr_date[0]).replace('%2', arr_date[1])}));
},
onSelectImage: function() {
if (!this.signObject) return;
this.signObject.selectImage();
this.inputName.setValue('');
},
onChangeName: function (input, value) {
if (!this.signObject) return;
this.signObject.setText(value, this.font.name, this.font.size, this.font.italic, this.font.bold);
},
textTitle: 'Sign Document',
textPurpose: 'Purpose for signing this document',
textCertificate: 'Certificate',
textValid: 'Valid from %1 to %2',
textChange: 'Change',
cancelButtonText: 'Cancel',
okButtonText: 'Ok',
textInputName: 'Input signer name',
textUseImage: 'or click \'Select Image\' to use a picture as signature',
textSelectImage: 'Select Image',
textSignature: 'Signature looks as',
tipFontName: 'Font Name',
tipFontSize: 'Font Size',
textBold: 'Bold',
textItalic: 'Italic'
}, Common.Views.SignDialog || {}))
});

View file

@ -0,0 +1,203 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
/**
* SignSettingsDialog.js
*
* Created by Julia Radzhabova on 5/19/17
* Copyright (c) 2017 Ascensio System SIA. All rights reserved.
*
*/
if (Common === undefined)
var Common = {};
define([
'common/main/lib/util/utils',
'common/main/lib/component/InputField',
'common/main/lib/component/CheckBox',
'common/main/lib/component/Window'
], function () { 'use strict';
Common.Views.SignSettingsDialog = Common.UI.Window.extend(_.extend({
options: {
width: 350,
style: 'min-width: 350px;',
cls: 'modal-dlg'
},
initialize : function(options) {
_.extend(this.options, {
title: this.textTitle
}, options || {});
this.template = [
'<div class="box" style="height: 260px;">',
'<div class="input-row">',
'<label>' + this.textInfo + '</label>',
'</div>',
'<div class="input-row">',
'<label>' + this.textInfoName + '</label>',
'</div>',
'<div id="id-dlg-sign-settings-name" class="input-row" style="margin-bottom: 5px;"></div>',
'<div class="input-row">',
'<label>' + this.textInfoTitle + '</label>',
'</div>',
'<div id="id-dlg-sign-settings-title" class="input-row" style="margin-bottom: 5px;"></div>',
'<div class="input-row">',
'<label>' + this.textInfoEmail + '</label>',
'</div>',
'<div id="id-dlg-sign-settings-email" class="input-row" style="margin-bottom: 10px;"></div>',
'<div class="input-row">',
'<label>' + this.textInstructions + '</label>',
'</div>',
'<textarea id="id-dlg-sign-settings-instructions" class="form-control" style="width: 100%;height: 35px;margin-bottom: 10px;resize: none;"></textarea>',
'<div id="id-dlg-sign-settings-date"></div>',
'</div>',
'<div class="footer center">',
'<button class="btn normal dlg-btn primary" result="ok" style="margin-right: 10px;">' + this.okButtonText + '</button>',
'<button class="btn normal dlg-btn" result="cancel">' + this.cancelButtonText + '</button>',
'</div>'
].join('');
this.options.tpl = _.template(this.template)(this.options);
this.api = this.options.api;
Common.UI.Window.prototype.initialize.call(this, this.options);
},
render: function() {
Common.UI.Window.prototype.render.call(this);
var me = this,
$window = this.getChild();
me.inputName = new Common.UI.InputField({
el : $('#id-dlg-sign-settings-name'),
style : 'width: 100%;'
});
me.inputTitle = new Common.UI.InputField({
el : $('#id-dlg-sign-settings-title'),
style : 'width: 100%;'
});
me.inputEmail = new Common.UI.InputField({
el : $('#id-dlg-sign-settings-email'),
style : 'width: 100%;'
});
me.textareaInstructions = this.$window.find('textarea');
me.textareaInstructions.keydown(function (event) {
if (event.keyCode == Common.UI.Keys.RETURN) {
event.stopPropagation();
}
});
this.chDate = new Common.UI.CheckBox({
el: $('#id-dlg-sign-settings-date'),
labelText: this.textShowDate
});
$window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this));
$window.find('input').on('keypress', _.bind(this.onKeyPress, this));
},
show: function() {
Common.UI.Window.prototype.show.apply(this, arguments);
var me = this;
_.delay(function(){
me.inputName.cmpEl.find('input').focus();
},500);
},
setSettings: function (props) {
if (props) {
var me = this;
// var value = props.asc_getSigner1();
// me.inputName.setValue(value ? value : '');
// value = props.asc_getSigner2();
// me.inputTitle.setValue(value ? value : '');
// value = props.asc_getEmail();
// me.inputEmail.setValue(value ? value : '');
// value = props.asc_getInstructions();
// me.textareaInstructions.val(value ? value : '');
// me.chDate.setValue(props.asc_getShowDate());
}
},
getSettings: function () {
var me = this,
props = new AscCommon.asc_CSignatureLine();
props.asc_setSigner1(me.inputName.getValue());
props.asc_setSigner2(me.inputTitle.getValue());
props.asc_setEmail(me.inputEmail.getValue());
props.asc_setInstructions(me.textareaInstructions.val());
props.asc_setShowDate(me.chDate.getValue()=='checked');
return props;
},
onBtnClick: function(event) {
this._handleInput(event.currentTarget.attributes['result'].value);
},
onKeyPress: function(event) {
if (event.keyCode == Common.UI.Keys.RETURN) {
this._handleInput('ok');
return false;
}
},
_handleInput: function(state) {
if (this.options.handler)
this.options.handler.call(this, this, state);
this.close();
},
textInfo: 'Signer Info',
textInfoName: 'Name',
textInfoTitle: 'Signer Title',
textInfoEmail: 'E-mail',
textInstructions: 'Instructions for Signer',
cancelButtonText: 'Cancel',
okButtonText: 'Ok',
txtEmpty: 'This field is required',
textAllowComment: 'Allow signer to add comment in the signature dialog',
textShowDate: 'Show sign date in signature line',
textTitle: 'Signature Settings'
}, Common.Views.SignSettingsDialog || {}))
});

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.7 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View file

@ -11,10 +11,10 @@
<polygon points="13,31 10,28 10,30 6,30 6,32 10,32 10,34 "/> <polygon points="13,31 10,28 10,30 6,30 6,32 10,32 10,34 "/>
</symbol> </symbol>
<symbol id="svg-btn-users" viewBox="0 0 20 20"> <symbol id="svg-btn-users" viewBox="0 0 20 20">
<path d="M16.469,14.184l-0.161-1.113c0.658-0.479,1.118-1.524,1.118-2.319c0-1.092-0.863-2.013-1.926-2.013c-1.063,0-1.925,0.868-1.925,1.961c0,0.795,0.46,1.766,1.118,2.242l-0.162,1.247c-0.461,0.039-0.863,0.108-1.214,0.215 <path fill="#FFFFFF" d="M7,3.999c1.103,0,2,0.897,2,2C9,7.103,8.103,8,7,8C5.897,8,5,7.103,5,5.999C5,4.896,5.897,3.999,7,3.999 M7,2.999c-1.657,0-3,1.344-3,3S5.343,9,7,9c1.657,0,3-1.345,3-3.001S8.657,2.999,7,2.999L7,2.999z"/>
c-0.886-1.419-2.496-2.061-3.997-2.226l-0.129-0.844c0.903-0.804,1.559-2.239,1.559-3.48c0-1.85-1.458-3.354-3.25-3.354S4.25,5.985,4.25,7.811c0,1.23,0.644,2.616,1.562,3.419l-0.135,0.952C3.459,12.427,1,13.705,1,17h18 <path fill="#FFFFFF" d="M7,11.666c4.185,0,4.909,2.268,5,2.642V16H2v-1.688C2.1,13.905,2.841,11.666,7,11.666 M7,10.666 c-5.477,0-6,3.545-6,3.545V17h12v-2.789C13,14.211,12.477,10.666,7,10.666L7,10.666z"/>
C19,16,18.387,14.345,16.469,14.184z M2.517,16c0.136-1.908,1.116-2.647,3.642-2.86l0.397-0.033l0.328-2.317L6.64,10.612C5.86,10.048,5.25,8.816,5.25,7.811C5.25,6.536,6.26,5.5,7.5,5.5s2.25,1.056,2.25,2.354c0,1.024-0.624,2.312-1.391,2.868L8.113,10.9 <circle fill="#FFFFFF" cx="14.5" cy="8.001" r="2.5"/>
l0.337,2.202l0.393,0.033c2.525,0.213,3.505,0.952,3.641,2.864H2.517z"/> <path fill="#FFFFFF" d="M14.5,11.863c-0.566,0-1.056,0.059-1.49,0.152c0.599,0.726,0.895,1.481,0.979,2.049L14,14.138V17h5v-2.263 C19,14.737,18.607,11.863,14.5,11.863z"/>
</symbol> </symbol>
<symbol id="svg-btn-download" viewBox="0 0 20 20"> <symbol id="svg-btn-download" viewBox="0 0 20 20">
<rect x="4" y="16" width="12" height="1"/> <rect x="4" y="16" width="12" height="1"/>

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

View file

@ -155,6 +155,9 @@
} }
.btn-fixflex-vcenter { .btn-fixflex-vcenter {
display: flex;
align-items: center;
.caret { .caret {
vertical-align: inherit; vertical-align: inherit;
} }

View file

@ -276,3 +276,14 @@
} }
} }
} }
.combo-pivot-template {
.combo-template(60px);
margin-top: -6px;
margin-bottom: -6px;
.view .dataview {
padding: 1px;
}
}

View file

@ -78,7 +78,7 @@
overflow: hidden; overflow: hidden;
color: @gray-darker; color: @gray-darker;
textarea { textarea:not(.user-message) {
width: 100%; width: 100%;
height: 50px; height: 50px;
resize: none; resize: none;
@ -172,6 +172,14 @@
} }
} }
textarea.user-message {
border: none;
resize: none;
width: 100%;
line-height: 15px;
cursor: text;
}
.user-reply { .user-reply {
color: @black; color: @black;
margin-top: 10px; margin-top: 10px;

View file

@ -66,6 +66,7 @@
background-color: @dropdown-bg; background-color: @dropdown-bg;
height: 16px; height: 16px;
width: 100%; width: 100%;
cursor: pointer;
&.top { &.top {
top: 0; top: 0;
@ -96,5 +97,10 @@
border-left: 3px solid transparent; border-left: 3px solid transparent;
} }
} }
&.disabled {
opacity: 0.3;
cursor: default;
}
} }
} }

View file

@ -100,8 +100,16 @@
border: 0 none; border: 0 none;
cursor: default; cursor: default;
&:focus { &:hover:not(:disabled) {
border: 1px solid @gray-dark;
background-color: rgba(255,255,255,0.2);
}
&:focus:not(:active) {
border: 1px solid @gray-dark;
cursor: text; cursor: text;
background-color: white;
color: @gray-deep;
} }
width: 100%; width: 100%;
} }
@ -217,7 +225,7 @@
.name { .name {
display: block; display: block;
padding-left: 16px; padding-left: 16px;
margin-top: -3px; margin-top: -5px;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
vertical-align: middle; vertical-align: middle;

View file

@ -28,7 +28,9 @@
border-style: solid; border-style: solid;
border-width: 1px 0; border-width: 1px 0;
border-top-color: #fafafa; border-top-color: #fafafa;
}
&:not(.disabled) > .item {
&:hover { &:hover {
background-color: @secondary; background-color: @secondary;
border-color: @secondary; border-color: @secondary;
@ -48,4 +50,11 @@
&.ps-container { &.ps-container {
overflow: hidden; overflow: hidden;
} }
&.disabled {
> .item {
cursor: default;
opacity: 0.5;
}
}
} }

View file

@ -224,6 +224,10 @@
width: 22px; width: 22px;
height: 22px; height: 22px;
} }
.checkbox-indeterminate {
margin-top: 3px;
}
} }
} }
@ -275,6 +279,10 @@
.button-normal-icon(~'x-huge .btn-ic-docspell', 12, @toolbar-big-icon-size); .button-normal-icon(~'x-huge .btn-ic-docspell', 12, @toolbar-big-icon-size);
.button-normal-icon(~'x-huge .btn-ic-review', 13, @toolbar-big-icon-size); .button-normal-icon(~'x-huge .btn-ic-review', 13, @toolbar-big-icon-size);
.button-normal-icon(~'x-huge .btn-ic-reviewview', 30, @toolbar-big-icon-size); .button-normal-icon(~'x-huge .btn-ic-reviewview', 30, @toolbar-big-icon-size);
.button-normal-icon(~'x-huge .btn-ic-sharing', 31, @toolbar-big-icon-size);
.button-normal-icon(~'x-huge .btn-ic-coedit', 32, @toolbar-big-icon-size);
.button-normal-icon(~'x-huge .btn-ic-chat', 33, @toolbar-big-icon-size);
.button-normal-icon(~'x-huge .btn-ic-history', 34, @toolbar-big-icon-size);
.button-normal-icon(review-save, 14, @toolbar-big-icon-size); .button-normal-icon(review-save, 14, @toolbar-big-icon-size);
.button-normal-icon(review-deny, 15, @toolbar-big-icon-size); .button-normal-icon(review-deny, 15, @toolbar-big-icon-size);
.button-normal-icon(review-next, 16, @toolbar-big-icon-size); .button-normal-icon(review-next, 16, @toolbar-big-icon-size);

View file

@ -398,6 +398,8 @@ var ApplicationController = new(function(){
}); });
} }
else { else {
Common.Gateway.reportWarning(id, message);
$('#id-critical-error-title').text(me.notcriticalErrorTitle); $('#id-critical-error-title').text(me.notcriticalErrorTitle);
$('#id-critical-error-message').text(message); $('#id-critical-error-message').text(message);
$('#id-critical-error-close').off(); $('#id-critical-error-close').off();

View file

@ -43,6 +43,8 @@
define([ define([
'core', 'core',
'common/main/lib/util/Shortcuts', 'common/main/lib/util/Shortcuts',
'common/main/lib/view/SignSettingsDialog',
'common/main/lib/view/SignDialog',
'documenteditor/main/app/view/LeftMenu', 'documenteditor/main/app/view/LeftMenu',
'documenteditor/main/app/view/FileMenu' 'documenteditor/main/app/view/FileMenu'
], function () { ], function () {
@ -85,7 +87,9 @@ define([
'saveas:format': _.bind(this.clickSaveAsFormat, this), 'saveas:format': _.bind(this.clickSaveAsFormat, this),
'settings:apply': _.bind(this.applySettings, this), 'settings:apply': _.bind(this.applySettings, this),
'create:new': _.bind(this.onCreateNew, this), 'create:new': _.bind(this.onCreateNew, this),
'recent:open': _.bind(this.onOpenRecent, this) 'recent:open': _.bind(this.onOpenRecent, this),
'signature:visible': _.bind(this.addVisibleSign, this),
'signature:invisible': _.bind(this.addInvisibleSign, this)
}, },
'Toolbar': { 'Toolbar': {
'file:settings': _.bind(this.clickToolbarSettings,this), 'file:settings': _.bind(this.clickToolbarSettings,this),
@ -99,11 +103,18 @@ define([
'search:replace': _.bind(this.onQueryReplace, this), 'search:replace': _.bind(this.onQueryReplace, this),
'search:replaceall': _.bind(this.onQueryReplaceAll, this), 'search:replaceall': _.bind(this.onQueryReplaceAll, this),
'search:highlight': _.bind(this.onSearchHighlight, this) 'search:highlight': _.bind(this.onSearchHighlight, this)
},
'Common.Views.ReviewChanges': {
'collaboration:chat': _.bind(this.onShowHideChat, this)
} }
}); });
Common.NotificationCenter.on('leftmenu:change', _.bind(this.onMenuChange, this)); Common.NotificationCenter.on('leftmenu:change', _.bind(this.onMenuChange, this));
Common.NotificationCenter.on('app:comment:add', _.bind(this.onAppAddComment, this)); Common.NotificationCenter.on('app:comment:add', _.bind(this.onAppAddComment, this));
Common.NotificationCenter.on('collaboration:history', _.bind(function () {
if ( !this.leftMenu.panelHistory.isVisible() )
this.clickMenuFileItem(null, 'history');
}, this));
}, },
onLaunch: function() { onLaunch: function() {
@ -267,7 +278,7 @@ define([
default: close_menu = false; default: close_menu = false;
} }
if (close_menu) { if (close_menu && menu) {
menu.hide(); menu.hide();
} }
}, },
@ -297,7 +308,16 @@ define([
applySettings: function(menu) { applySettings: function(menu) {
var value; var value;
this.api.SetTextBoxInputMode(Common.localStorage.getBool("de-settings-inputmode"));
value = Common.localStorage.getBool("de-settings-inputmode");
Common.Utils.InternalSettings.set("de-settings-inputmode", value);
this.api.SetTextBoxInputMode(value);
if (Common.Utils.isChrome) {
value = Common.localStorage.getBool("de-settings-inputsogou");
Common.Utils.InternalSettings.set("de-settings-inputsogou", value);
// window["AscInputMethod"]["SogouPinyin"] = value;
}
if (Common.Utils.isChrome) { if (Common.Utils.isChrome) {
value = Common.localStorage.getBool("de-settings-inputsogou"); value = Common.localStorage.getBool("de-settings-inputsogou");
@ -307,6 +327,7 @@ define([
/** coauthoring begin **/ /** coauthoring begin **/
if (this.mode.isEdit && !this.mode.isOffline && this.mode.canCoAuthoring) { if (this.mode.isEdit && !this.mode.isOffline && this.mode.canCoAuthoring) {
var fast_coauth = Common.localStorage.getBool("de-settings-coauthmode", true); var fast_coauth = Common.localStorage.getBool("de-settings-coauthmode", true);
Common.Utils.InternalSettings.set("de-settings-coauthmode", fast_coauth);
this.api.asc_SetFastCollaborative(fast_coauth); this.api.asc_SetFastCollaborative(fast_coauth);
value = Common.localStorage.getItem((fast_coauth) ? "de-settings-showchanges-fast" : "de-settings-showchanges-strict"); value = Common.localStorage.getItem((fast_coauth) ? "de-settings-showchanges-fast" : "de-settings-showchanges-strict");
@ -316,13 +337,21 @@ define([
case 'last': value = Asc.c_oAscCollaborativeMarksShowType.LastChanges; break; case 'last': value = Asc.c_oAscCollaborativeMarksShowType.LastChanges; break;
default: value = (fast_coauth) ? Asc.c_oAscCollaborativeMarksShowType.None : Asc.c_oAscCollaborativeMarksShowType.LastChanges; default: value = (fast_coauth) ? Asc.c_oAscCollaborativeMarksShowType.None : Asc.c_oAscCollaborativeMarksShowType.LastChanges;
} }
Common.Utils.InternalSettings.set((fast_coauth) ? "de-settings-showchanges-fast" : "de-settings-showchanges-strict", value);
this.api.SetCollaborativeMarksShowType(value); this.api.SetCollaborativeMarksShowType(value);
} }
(Common.localStorage.getBool("de-settings-livecomment", true)) ? this.api.asc_showComments(Common.localStorage.getBool("de-settings-resolvedcomment", true)) : this.api.asc_hideComments(); value = Common.localStorage.getBool("de-settings-livecomment", true);
Common.Utils.InternalSettings.set("de-settings-livecomment", value);
var resolved = Common.localStorage.getBool("de-settings-resolvedcomment", true);
Common.Utils.InternalSettings.set("de-settings-resolvedcomment", resolved);
if (this.mode.canComments && this.leftMenu.panelComments.isVisible())
value = resolved = true;
(value) ? this.api.asc_showComments(resolved) : this.api.asc_hideComments();
/** coauthoring end **/ /** coauthoring end **/
value = Common.localStorage.getItem("de-settings-fontrender"); value = Common.localStorage.getItem("de-settings-fontrender");
Common.Utils.InternalSettings.set("de-settings-fontrender", value);
switch (value) { switch (value) {
case '1': this.api.SetFontRenderingMode(1); break; case '1': this.api.SetFontRenderingMode(1); break;
case '2': this.api.SetFontRenderingMode(2); break; case '2': this.api.SetFontRenderingMode(2); break;
@ -330,13 +359,16 @@ define([
} }
if (this.mode.isEdit) { if (this.mode.isEdit) {
value = Common.localStorage.getItem("de-settings-autosave"); value = parseInt(Common.localStorage.getItem("de-settings-autosave"));
this.api.asc_setAutoSaveGap(parseInt(value)); Common.Utils.InternalSettings.set("de-settings-autosave", value);
this.api.asc_setAutoSaveGap(value);
this.api.asc_setSpellCheck(Common.localStorage.getBool("de-settings-spellcheck", true)); value = Common.localStorage.getBool("de-settings-spellcheck", true);
Common.Utils.InternalSettings.set("de-settings-spellcheck", value);
this.api.asc_setSpellCheck(value);
} }
this.api.put_ShowSnapLines(Common.localStorage.getBool("de-settings-showsnaplines", true)); this.api.put_ShowSnapLines(Common.Utils.InternalSettings.get("de-settings-showsnaplines"));
menu.hide(); menu.hide();
}, },
@ -527,8 +559,9 @@ define([
}, },
commentsShowHide: function(mode) { commentsShowHide: function(mode) {
var value = Common.localStorage.getBool("de-settings-livecomment", true), var value = Common.Utils.InternalSettings.get("de-settings-livecomment"),
resolved = Common.localStorage.getBool("de-settings-resolvedcomment", true); resolved = Common.Utils.InternalSettings.get("de-settings-resolvedcomment");
if (!value || !resolved) { if (!value || !resolved) {
(mode === 'show') ? this.api.asc_showComments(true) : ((value) ? this.api.asc_showComments(resolved) : this.api.asc_hideComments()); (mode === 'show') ? this.api.asc_showComments(true) : ((value) ? this.api.asc_showComments(resolved) : this.api.asc_hideComments());
} }
@ -676,6 +709,53 @@ define([
Common.Gateway.requestHistory(); Common.Gateway.requestHistory();
}, },
addVisibleSign: function(menu) {
var me = this,
win = new Common.Views.SignSettingsDialog({
handler: function(dlg, result) {
if (result == 'ok') {
me.api.asc_AddSignatureLine2(dlg.getSettings());
}
Common.NotificationCenter.trigger('edit:complete', me);
}
});
win.show();
menu.hide();
},
addInvisibleSign: function(menu) {
var me = this,
win = new Common.Views.SignDialog({
api: me.api,
signType: 'invisible',
handler: function (dlg, result) {
if (result == 'ok') {
var props = dlg.getSettings();
me.api.asc_Sign(props.certificateId);
}
Common.NotificationCenter.trigger('edit:complete', me);
}
});
win.show();
menu.hide();
},
onShowHideChat: function(state) {
if (this.mode.canCoAuthoring && this.mode.canChat && !this.mode.isLightVersion) {
if (state) {
Common.UI.Menu.Manager.hideAll();
this.leftMenu.showMenu('chat');
} else {
this.leftMenu.btnChat.toggle(false, true);
this.leftMenu.onBtnMenuClick(this.leftMenu.btnChat);
}
}
},
textNoTextFound : 'Text not found', textNoTextFound : 'Text not found',
newDocumentTitle : 'Unnamed document', newDocumentTitle : 'Unnamed document',
requestEditRightsText : 'Requesting editing rights...', requestEditRightsText : 'Requesting editing rights...',

View file

@ -119,6 +119,7 @@ define([
var value = Common.localStorage.getItem("de-settings-fontrender"); var value = Common.localStorage.getItem("de-settings-fontrender");
if (value === null) if (value === null)
window.devicePixelRatio > 1 ? value = '1' : '0'; window.devicePixelRatio > 1 ? value = '1' : '0';
Common.Utils.InternalSettings.set("de-settings-fontrender", value);
// Initialize api // Initialize api
@ -131,7 +132,18 @@ define([
'Diagram Title': this.txtDiagramTitle, 'Diagram Title': this.txtDiagramTitle,
'X Axis': this.txtXAxis, 'X Axis': this.txtXAxis,
'Y Axis': this.txtYAxis, 'Y Axis': this.txtYAxis,
'Your text here': this.txtArt 'Your text here': this.txtArt,
"Error! Bookmark not defined.": this.txtBookmarkError,
"above": this.txtAbove,
"below": this.txtBelow,
"on page ": this.txtOnPage,
"Header": this.txtHeader,
"Footer": this.txtFooter,
" -Section ": this.txtSection,
"First Page ": this.txtFirstPage,
"Even Page ": this.txtEvenPage,
"Odd Page ": this.txtOddPage,
"Same as Previous": this.txtSameAsPrev
}; };
styleNames.forEach(function(item){ styleNames.forEach(function(item){
translate[item] = me.translationTable[item] = me['txtStyle_' + item.replace(/ /g, '_')] || item; translate[item] = me.translationTable[item] = me['txtStyle_' + item.replace(/ /g, '_')] || item;
@ -370,10 +382,25 @@ define([
} }
}, },
onDownloadAs: function() { onDownloadAs: function(format) {
this._state.isFromGatewayDownloadAs = true; this._state.isFromGatewayDownloadAs = true;
var type = /^(?:(pdf|djvu|xps))$/.exec(this.document.fileType); var type = /^(?:(pdf|djvu|xps))$/.exec(this.document.fileType);
(type && typeof type[1] === 'string') ? this.api.asc_DownloadOrigin(true) : this.api.asc_DownloadAs(Asc.c_oAscFileType.DOCX, true); if (type && typeof type[1] === 'string')
this.api.asc_DownloadOrigin(true);
else {
var _format = (format && (typeof format == 'string')) ? Asc.c_oAscFileType[ format.toUpperCase() ] : null,
_supported = [
Asc.c_oAscFileType.TXT,
Asc.c_oAscFileType.ODT,
Asc.c_oAscFileType.DOCX,
Asc.c_oAscFileType.HTML,
Asc.c_oAscFileType.PDF
];
if ( !_format || _supported.indexOf(_format) < 0 )
_format = Asc.c_oAscFileType.DOCX;
this.api.asc_DownloadAs(_format, true);
}
}, },
onProcessMouse: function(data) { onProcessMouse: function(data) {
@ -766,10 +793,14 @@ define([
/** coauthoring begin **/ /** coauthoring begin **/
this.isLiveCommenting = Common.localStorage.getBool("de-settings-livecomment", true); this.isLiveCommenting = Common.localStorage.getBool("de-settings-livecomment", true);
this.isLiveCommenting ? this.api.asc_showComments(Common.localStorage.getBool("de-settings-resolvedcomment", true)) : this.api.asc_hideComments(); Common.Utils.InternalSettings.set("de-settings-livecomment", this.isLiveCommenting);
value = Common.localStorage.getBool("de-settings-resolvedcomment", true);
Common.Utils.InternalSettings.set("de-settings-resolvedcomment", value);
this.isLiveCommenting ? this.api.asc_showComments(value) : this.api.asc_hideComments();
/** coauthoring end **/ /** coauthoring end **/
value = Common.localStorage.getItem("de-settings-zoom"); value = Common.localStorage.getItem("de-settings-zoom");
Common.Utils.InternalSettings.set("de-settings-zoom", value);
var zf = (value!==null) ? parseInt(value) : (this.appOptions.customization && this.appOptions.customization.zoom ? parseInt(this.appOptions.customization.zoom) : 100); var zf = (value!==null) ? parseInt(value) : (this.appOptions.customization && this.appOptions.customization.zoom ? parseInt(this.appOptions.customization.zoom) : 100);
(zf == -1) ? this.api.zoomFitToPage() : ((zf == -2) ? this.api.zoomFitToWidth() : this.api.zoom(zf>0 ? zf : 100)); (zf == -1) ? this.api.zoomFitToPage() : ((zf == -2) ? this.api.zoomFitToWidth() : this.api.zoom(zf>0 ? zf : 100));
@ -779,9 +810,11 @@ define([
value = Common.localStorage.getItem("de-show-tableline"); value = Common.localStorage.getItem("de-show-tableline");
me.api.put_ShowTableEmptyLine((value!==null) ? eval(value) : true); me.api.put_ShowTableEmptyLine((value!==null) ? eval(value) : true);
me.api.asc_setSpellCheck(Common.localStorage.getBool("de-settings-spellcheck", true)); value = Common.localStorage.getBool("de-settings-spellcheck", true);
Common.Utils.InternalSettings.set("de-settings-spellcheck", value);
me.api.asc_setSpellCheck(value);
Common.localStorage.setBool("de-settings-showsnaplines", me.api.get_ShowSnapLines()); Common.Utils.InternalSettings.set("de-settings-showsnaplines", me.api.get_ShowSnapLines());
function checkWarns() { function checkWarns() {
if (!window['AscDesktopEditor']) { if (!window['AscDesktopEditor']) {
@ -805,11 +838,14 @@ define([
appHeader.setDocumentCaption(me.api.asc_getDocumentName()); appHeader.setDocumentCaption(me.api.asc_getDocumentName());
me.updateWindowTitle(true); me.updateWindowTitle(true);
me.api.SetTextBoxInputMode(Common.localStorage.getBool("de-settings-inputmode")); value = Common.localStorage.getBool("de-settings-inputmode");
Common.Utils.InternalSettings.set("de-settings-inputmode", value);
me.api.SetTextBoxInputMode(value);
if (Common.Utils.isChrome) { if (Common.Utils.isChrome) {
value = Common.localStorage.getBool("de-settings-inputsogou"); value = Common.localStorage.getBool("de-settings-inputsogou");
me.api.setInputParams({"SogouPinyin" : value}); me.api.setInputParams({"SogouPinyin" : value});
Common.Utils.InternalSettings.set("de-settings-inputsogou", value);
} }
/** coauthoring begin **/ /** coauthoring begin **/
@ -823,21 +859,23 @@ define([
me.api.asc_SetFastCollaborative(me._state.fastCoauth); me.api.asc_SetFastCollaborative(me._state.fastCoauth);
value = Common.localStorage.getItem((me._state.fastCoauth) ? "de-settings-showchanges-fast" : "de-settings-showchanges-strict"); value = Common.localStorage.getItem((me._state.fastCoauth) ? "de-settings-showchanges-fast" : "de-settings-showchanges-strict");
if (value !== null) if (value == null) value = me._state.fastCoauth ? 'none' : 'last';
me.api.SetCollaborativeMarksShowType(value == 'all' ? Asc.c_oAscCollaborativeMarksShowType.All : me.api.SetCollaborativeMarksShowType(value == 'all' ? Asc.c_oAscCollaborativeMarksShowType.All :
value == 'none' ? Asc.c_oAscCollaborativeMarksShowType.None : Asc.c_oAscCollaborativeMarksShowType.LastChanges); (value == 'none' ? Asc.c_oAscCollaborativeMarksShowType.None : Asc.c_oAscCollaborativeMarksShowType.LastChanges));
else Common.Utils.InternalSettings.set((me._state.fastCoauth) ? "de-settings-showchanges-fast" : "de-settings-showchanges-strict", value);
me.api.SetCollaborativeMarksShowType(me._state.fastCoauth ? Asc.c_oAscCollaborativeMarksShowType.None : Asc.c_oAscCollaborativeMarksShowType.LastChanges);
} else if (!me.appOptions.isEdit && me.appOptions.canComments) { } else if (!me.appOptions.isEdit && me.appOptions.canComments) {
me._state.fastCoauth = true; me._state.fastCoauth = true;
me.api.asc_SetFastCollaborative(me._state.fastCoauth); me.api.asc_SetFastCollaborative(me._state.fastCoauth);
me.api.SetCollaborativeMarksShowType(Asc.c_oAscCollaborativeMarksShowType.None); me.api.SetCollaborativeMarksShowType(Asc.c_oAscCollaborativeMarksShowType.None);
me.api.asc_setAutoSaveGap(1); me.api.asc_setAutoSaveGap(1);
Common.Utils.InternalSettings.set("de-settings-autosave", 1);
} else { } else {
me._state.fastCoauth = false; me._state.fastCoauth = false;
me.api.asc_SetFastCollaborative(me._state.fastCoauth); me.api.asc_SetFastCollaborative(me._state.fastCoauth);
me.api.SetCollaborativeMarksShowType(Asc.c_oAscCollaborativeMarksShowType.None); me.api.SetCollaborativeMarksShowType(Asc.c_oAscCollaborativeMarksShowType.None);
} }
Common.Utils.InternalSettings.set("de-settings-coauthmode", me._state.fastCoauth);
/** coauthoring end **/ /** coauthoring end **/
var application = me.getApplication(); var application = me.getApplication();
@ -877,11 +915,12 @@ define([
if (value===null && me.appOptions.customization && me.appOptions.customization.autosave===false) if (value===null && me.appOptions.customization && me.appOptions.customization.autosave===false)
value = 0; value = 0;
value = (!me._state.fastCoauth && value!==null) ? parseInt(value) : (me.appOptions.canCoAuthoring ? 1 : 0); value = (!me._state.fastCoauth && value!==null) ? parseInt(value) : (me.appOptions.canCoAuthoring ? 1 : 0);
Common.Utils.InternalSettings.set("de-settings-autosave", value);
me.api.asc_setAutoSaveGap(value); me.api.asc_setAutoSaveGap(value);
if (me.appOptions.canForcesave) {// use asc_setIsForceSaveOnUserSave only when customization->forcesave = true if (me.appOptions.canForcesave) {// use asc_setIsForceSaveOnUserSave only when customization->forcesave = true
me.appOptions.forcesave = Common.localStorage.getBool("de-settings-forcesave", me.appOptions.canForcesave); me.appOptions.forcesave = Common.localStorage.getBool("de-settings-forcesave", me.appOptions.canForcesave);
Common.Utils.InternalSettings.set("de-settings-forcesave", me.appOptions.forcesave);
me.api.asc_setIsForceSaveOnUserSave(me.appOptions.forcesave); me.api.asc_setIsForceSaveOnUserSave(me.appOptions.forcesave);
} }
@ -1015,6 +1054,7 @@ define([
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.trialMode = params.asc_getLicenseMode(); this.appOptions.trialMode = params.asc_getLicenseMode();
this.appOptions.canProtect = this.appOptions.isDesktopApp && this.api.asc_isSignaturesSupport();
if ( this.appOptions.isLightVersion ) { if ( this.appOptions.isLightVersion ) {
this.appOptions.canUseHistory = this.appOptions.canUseHistory =
@ -1135,6 +1175,7 @@ define([
var value = Common.localStorage.getItem('de-settings-unit'); var value = Common.localStorage.getItem('de-settings-unit');
value = (value!==null) ? parseInt(value) : Common.Utils.Metric.getDefaultMetric(); value = (value!==null) ? parseInt(value) : Common.Utils.Metric.getDefaultMetric();
Common.Utils.Metric.setCurrentMetric(value); Common.Utils.Metric.setCurrentMetric(value);
Common.Utils.InternalSettings.set("de-settings-unit", value);
me.api.asc_SetDocumentUnits((value==Common.Utils.Metric.c_MetricUnits.inch) ? Asc.c_oAscDocumentUnits.Inch : ((value==Common.Utils.Metric.c_MetricUnits.pt) ? Asc.c_oAscDocumentUnits.Point : Asc.c_oAscDocumentUnits.Millimeter)); me.api.asc_SetDocumentUnits((value==Common.Utils.Metric.c_MetricUnits.inch) ? Asc.c_oAscDocumentUnits.Inch : ((value==Common.Utils.Metric.c_MetricUnits.pt) ? Asc.c_oAscDocumentUnits.Point : Asc.c_oAscDocumentUnits.Millimeter));
me.api.asc_SetViewRulers(!Common.localStorage.getBool('de-hidden-rulers')); me.api.asc_SetViewRulers(!Common.localStorage.getBool('de-hidden-rulers'));
@ -1320,6 +1361,8 @@ define([
} }
} }
else { else {
Common.Gateway.reportWarning(id, config.msg);
config.title = this.notcriticalErrorTitle; config.title = this.notcriticalErrorTitle;
config.iconCls = 'warn'; config.iconCls = 'warn';
config.buttons = ['ok']; config.buttons = ['ok'];
@ -1330,6 +1373,20 @@ define([
this.api.asc_DownloadAs(); this.api.asc_DownloadAs();
else else
(this.appOptions.canDownload) ? this.getApplication().getController('LeftMenu').leftMenu.showMenu('file:saveas') : this.api.asc_DownloadOrigin(); (this.appOptions.canDownload) ? this.getApplication().getController('LeftMenu').leftMenu.showMenu('file:saveas') : this.api.asc_DownloadOrigin();
} else if (id == Asc.c_oAscError.ID.SplitCellMaxRows || id == Asc.c_oAscError.ID.SplitCellMaxCols || id == Asc.c_oAscError.ID.SplitCellRowsDivider) {
var me = this;
setTimeout(function(){
(new Common.Views.InsertTableDialog({
split: true,
handler: function(result, value) {
if (result == 'ok') {
if (me.api)
me.api.SplitCell(value.columns, value.rows);
}
me.onEditComplete();
}
})).show();
},10);
} }
this._state.lostEditingRights = false; this._state.lostEditingRights = false;
this.onEditComplete(); this.onEditComplete();
@ -1734,6 +1791,7 @@ define([
var value = Common.localStorage.getItem("de-settings-unit"); var value = Common.localStorage.getItem("de-settings-unit");
value = (value!==null) ? parseInt(value) : Common.Utils.Metric.getDefaultMetric(); value = (value!==null) ? parseInt(value) : Common.Utils.Metric.getDefaultMetric();
Common.Utils.Metric.setCurrentMetric(value); Common.Utils.Metric.setCurrentMetric(value);
Common.Utils.InternalSettings.set("de-settings-unit", value);
this.api.asc_SetDocumentUnits((value==Common.Utils.Metric.c_MetricUnits.inch) ? Asc.c_oAscDocumentUnits.Inch : ((value==Common.Utils.Metric.c_MetricUnits.pt) ? Asc.c_oAscDocumentUnits.Point : Asc.c_oAscDocumentUnits.Millimeter)); this.api.asc_SetDocumentUnits((value==Common.Utils.Metric.c_MetricUnits.inch) ? Asc.c_oAscDocumentUnits.Inch : ((value==Common.Utils.Metric.c_MetricUnits.pt) ? Asc.c_oAscDocumentUnits.Point : Asc.c_oAscDocumentUnits.Millimeter));
this.getApplication().getController('RightMenu').updateMetricUnit(); this.getApplication().getController('RightMenu').updateMetricUnit();
this.getApplication().getController('Toolbar').getView().updateMetricUnit(); this.getApplication().getController('Toolbar').getView().updateMetricUnit();
@ -1795,12 +1853,13 @@ define([
if (dontshow) window.localStorage.setItem("de-hide-try-undoredo", 1); if (dontshow) window.localStorage.setItem("de-hide-try-undoredo", 1);
if (btn == 'custom') { if (btn == 'custom') {
Common.localStorage.setItem("de-settings-coauthmode", 0); Common.localStorage.setItem("de-settings-coauthmode", 0);
Common.Utils.InternalSettings.set("de-settings-coauthmode", false);
this.api.asc_SetFastCollaborative(false); this.api.asc_SetFastCollaborative(false);
this._state.fastCoauth = false; this._state.fastCoauth = false;
Common.localStorage.setItem("de-settings-showchanges-strict", 'last'); Common.localStorage.setItem("de-settings-showchanges-strict", 'last');
this.api.SetCollaborativeMarksShowType(Asc.c_oAscCollaborativeMarksShowType.LastChanges); this.api.SetCollaborativeMarksShowType(Asc.c_oAscCollaborativeMarksShowType.LastChanges);
} }
this.fireEvent('editcomplete', this); this.onEditComplete();
}, this) }, this)
}); });
}, },
@ -1823,6 +1882,7 @@ define([
} }
if (this.appOptions.canForcesave) { if (this.appOptions.canForcesave) {
this.appOptions.forcesave = Common.localStorage.getBool("de-settings-forcesave", this.appOptions.canForcesave); this.appOptions.forcesave = Common.localStorage.getBool("de-settings-forcesave", this.appOptions.canForcesave);
Common.Utils.InternalSettings.set("de-settings-forcesave", this.appOptions.forcesave);
this.api.asc_setIsForceSaveOnUserSave(this.appOptions.forcesave); this.api.asc_setIsForceSaveOnUserSave(this.appOptions.forcesave);
} }
}, },
@ -1894,18 +1954,11 @@ define([
var pluginsData = (uiCustomize) ? plugins.UIpluginsData : plugins.pluginsData; var pluginsData = (uiCustomize) ? plugins.UIpluginsData : plugins.pluginsData;
if (!pluginsData || pluginsData.length<1) return; if (!pluginsData || pluginsData.length<1) return;
var arr = [], var arr = [];
baseUrl = _.isEmpty(plugins.url) ? "" : plugins.url;
if (baseUrl !== "")
console.warn("Obsolete: The url parameter is deprecated. Please check the documentation for new plugin connection configuration.");
pluginsData.forEach(function(item){ pluginsData.forEach(function(item){
item = baseUrl + item; // for compatibility with previous version of server, where plugins.url is used.
var value = Common.Utils.getConfigJson(item); var value = Common.Utils.getConfigJson(item);
if (value) { if (value) {
value.baseUrl = item.substring(0, item.lastIndexOf("config.json")); value.baseUrl = item.substring(0, item.lastIndexOf("config.json"));
value.oldVersion = (baseUrl !== "");
arr.push(value); arr.push(value);
} }
}); });
@ -1945,14 +1998,6 @@ define([
var visible = (isEdit || itemVar.isViewer) && _.contains(itemVar.EditorsSupport, 'word'); var visible = (isEdit || itemVar.isViewer) && _.contains(itemVar.EditorsSupport, 'word');
if ( visible ) pluginVisible = true; if ( visible ) pluginVisible = true;
var icons = itemVar.icons;
if (item.oldVersion) { // for compatibility with previouse version of server, where plugins.url is used.
icons = [];
itemVar.icons.forEach(function(icon){
icons.push(icon.substring(icon.lastIndexOf("\/")+1));
});
}
if (item.isUICustomizer ) { if (item.isUICustomizer ) {
visible && arrUI.push(item.baseUrl + itemVar.url); visible && arrUI.push(item.baseUrl + itemVar.url);
} else { } else {
@ -1960,8 +2005,8 @@ define([
model.set({ model.set({
index: variationsArr.length, index: variationsArr.length,
url: (item.oldVersion) ? (itemVar.url.substring(itemVar.url.lastIndexOf("\/") + 1) ) : itemVar.url, url: itemVar.url,
icons: icons, icons: itemVar.icons,
visible: visible visible: visible
}); });
@ -2121,8 +2166,18 @@ define([
txtStyle_Intense_Quote: 'Intense Quote', txtStyle_Intense_Quote: 'Intense Quote',
txtStyle_List_Paragraph: 'List Paragraph', txtStyle_List_Paragraph: 'List Paragraph',
saveTextText: 'Saving document...', saveTextText: 'Saving document...',
saveTitleText: 'Saving Document' saveTitleText: 'Saving Document',
txtBookmarkError: "Error! Bookmark not defined.",
txtAbove: "above",
txtBelow: "below",
txtOnPage: "on page ",
txtHeader: "Header",
txtFooter: "Footer",
txtSection: " -Section ",
txtFirstPage: "First Page ",
txtEvenPage: "Even Page ",
txtOddPage: "Odd Page ",
txtSameAsPrev: "Same as Previous"
} }
})(), DE.Controllers.Main || {})) })(), DE.Controllers.Main || {}))
}); });

View file

@ -79,6 +79,7 @@ define([
this._settings[Common.Utils.documentSettingsType.TextArt] = {panelId: "id-textart-settings", panel: rightMenu.textartSettings, btn: rightMenu.btnTextArt, hidden: 1, locked: false}; this._settings[Common.Utils.documentSettingsType.TextArt] = {panelId: "id-textart-settings", panel: rightMenu.textartSettings, btn: rightMenu.btnTextArt, hidden: 1, locked: false};
this._settings[Common.Utils.documentSettingsType.Chart] = {panelId: "id-chart-settings", panel: rightMenu.chartSettings, btn: rightMenu.btnChart, hidden: 1, locked: false}; this._settings[Common.Utils.documentSettingsType.Chart] = {panelId: "id-chart-settings", panel: rightMenu.chartSettings, btn: rightMenu.btnChart, hidden: 1, locked: false};
this._settings[Common.Utils.documentSettingsType.MailMerge] = {panelId: "id-mail-merge-settings", panel: rightMenu.mergeSettings, btn: rightMenu.btnMailMerge, hidden: 1, props: {}, locked: false}; this._settings[Common.Utils.documentSettingsType.MailMerge] = {panelId: "id-mail-merge-settings", panel: rightMenu.mergeSettings, btn: rightMenu.btnMailMerge, hidden: 1, props: {}, locked: false};
this._settings[Common.Utils.documentSettingsType.Signature] = {panelId: "id-signature-settings", panel: rightMenu.signatureSettings, btn: rightMenu.btnSignature, hidden: (rightMenu.signatureSettings) ? 0 : 1, props: {}, locked: false};
}, },
setApi: function(api) { setApi: function(api) {
@ -96,7 +97,7 @@ define([
var panel = this._settings[type].panel; var panel = this._settings[type].panel;
var props = this._settings[type].props; var props = this._settings[type].props;
if (props && panel) if (props && panel)
panel.ChangeSettings.call(panel, (type==Common.Utils.documentSettingsType.MailMerge) ? undefined : props); panel.ChangeSettings.call(panel, (type==Common.Utils.documentSettingsType.MailMerge || type==Common.Utils.documentSettingsType.Signature) ? undefined : props);
} else if (minimized && type==Common.Utils.documentSettingsType.MailMerge) { } else if (minimized && type==Common.Utils.documentSettingsType.MailMerge) {
this.rightmenu.mergeSettings.disablePreviewMode(); this.rightmenu.mergeSettings.disablePreviewMode();
} }
@ -112,13 +113,14 @@ define([
in_equation = false, in_equation = false,
needhide = true; needhide = true;
for (var i=0; i<this._settings.length; i++) { for (var i=0; i<this._settings.length; i++) {
if (i==Common.Utils.documentSettingsType.MailMerge) continue; if (i==Common.Utils.documentSettingsType.MailMerge || i==Common.Utils.documentSettingsType.Signature) continue;
if (this._settings[i]) { if (this._settings[i]) {
this._settings[i].hidden = 1; this._settings[i].hidden = 1;
this._settings[i].locked = false; this._settings[i].locked = false;
} }
} }
this._settings[Common.Utils.documentSettingsType.MailMerge].locked = false; this._settings[Common.Utils.documentSettingsType.MailMerge].locked = false;
this._settings[Common.Utils.documentSettingsType.Signature].locked = false;
var isChart = false; var isChart = false;
for (i=0; i<SelectedObjects.length; i++) for (i=0; i<SelectedObjects.length; i++)
@ -154,6 +156,8 @@ define([
this._settings[settingsType].locked = value.get_Locked(); this._settings[settingsType].locked = value.get_Locked();
if (!this._settings[Common.Utils.documentSettingsType.MailMerge].locked) // lock MailMerge-InsertField, если хотя бы один объект locked if (!this._settings[Common.Utils.documentSettingsType.MailMerge].locked) // lock MailMerge-InsertField, если хотя бы один объект locked
this._settings[Common.Utils.documentSettingsType.MailMerge].locked = value.get_Locked(); this._settings[Common.Utils.documentSettingsType.MailMerge].locked = value.get_Locked();
if (!this._settings[Common.Utils.documentSettingsType.Signature].locked) // lock Signature, если хотя бы один объект locked
this._settings[Common.Utils.documentSettingsType.Signature].locked = value.get_Locked();
} }
if ( this._settings[Common.Utils.documentSettingsType.Header].locked ) { // если находимся в locked header/footer, то считаем, что все элементы в нем тоже недоступны if ( this._settings[Common.Utils.documentSettingsType.Header].locked ) { // если находимся в locked header/footer, то считаем, что все элементы в нем тоже недоступны
@ -179,7 +183,7 @@ define([
currentactive = -1; currentactive = -1;
} else { } else {
if (pnl.btn.isDisabled()) pnl.btn.setDisabled(false); if (pnl.btn.isDisabled()) pnl.btn.setDisabled(false);
if (i!=Common.Utils.documentSettingsType.MailMerge) lastactive = i; if (i!=Common.Utils.documentSettingsType.MailMerge && i!=Common.Utils.documentSettingsType.Signature) lastactive = i;
if ( pnl.needShow ) { if ( pnl.needShow ) {
pnl.needShow = false; pnl.needShow = false;
priorityactive = i; priorityactive = i;
@ -204,7 +208,7 @@ define([
if (active !== undefined) { if (active !== undefined) {
this.rightmenu.SetActivePane(active, open); this.rightmenu.SetActivePane(active, open);
if (active!=Common.Utils.documentSettingsType.MailMerge) if (active!=Common.Utils.documentSettingsType.MailMerge && active!=Common.Utils.documentSettingsType.Signature)
this._settings[active].panel.ChangeSettings.call(this._settings[active].panel, this._settings[active].props); this._settings[active].panel.ChangeSettings.call(this._settings[active].panel, this._settings[active].props);
else else
this._settings[active].panel.ChangeSettings.call(this._settings[active].panel); this._settings[active].panel.ChangeSettings.call(this._settings[active].panel);
@ -336,6 +340,11 @@ define([
} }
this.rightmenu.chartSettings.disableControls(disabled); this.rightmenu.chartSettings.disableControls(disabled);
if (this.rightmenu.signatureSettings) {
this.rightmenu.signatureSettings.disableControls(disabled);
this.rightmenu.btnSignature.setDisabled(disabled);
}
if (disabled) { if (disabled) {
this.rightmenu.btnText.setDisabled(disabled); this.rightmenu.btnText.setDisabled(disabled);
this.rightmenu.btnTable.setDisabled(disabled); this.rightmenu.btnTable.setDisabled(disabled);
@ -343,7 +352,6 @@ define([
this.rightmenu.btnHeaderFooter.setDisabled(disabled); this.rightmenu.btnHeaderFooter.setDisabled(disabled);
this.rightmenu.btnShape.setDisabled(disabled); this.rightmenu.btnShape.setDisabled(disabled);
this.rightmenu.btnTextArt.setDisabled(disabled); this.rightmenu.btnTextArt.setDisabled(disabled);
this.rightmenu.btnChart.setDisabled(disabled); this.rightmenu.btnChart.setDisabled(disabled);
} else { } else {
var selectedElements = this.api.getSelectedElements(); var selectedElements = this.api.getSelectedElements();

View file

@ -99,6 +99,8 @@ define([
me.btnSpelling = review.getButton('spelling', 'statusbar'); me.btnSpelling = review.getButton('spelling', 'statusbar');
me.btnSpelling.render( me.statusbar.$layout.find('#btn-doc-spell') ); me.btnSpelling.render( me.statusbar.$layout.find('#btn-doc-spell') );
me.btnDocLang = review.getButton('doclang', 'statusbar');
me.btnDocLang.render( me.statusbar.$layout.find('#btn-doc-lang') );
} else { } else {
me.statusbar.$el.find('.el-edit, .el-review').hide(); me.statusbar.$el.find('.el-edit, .el-review').hide();
} }

View file

@ -581,6 +581,8 @@ define([
}, },
onApiPageSize: function(w, h) { onApiPageSize: function(w, h) {
var width = this._state.pgorient ? w : h,
height = this._state.pgorient ? h : w;
if (Math.abs(this._state.pgsize[0] - w) > 0.01 || if (Math.abs(this._state.pgsize[0] - w) > 0.01 ||
Math.abs(this._state.pgsize[1] - h) > 0.01) { Math.abs(this._state.pgsize[1] - h) > 0.01) {
this._state.pgsize = [w, h]; this._state.pgsize = [w, h];
@ -588,7 +590,7 @@ define([
this._clearChecked(this.toolbar.mnuPageSize); this._clearChecked(this.toolbar.mnuPageSize);
_.each(this.toolbar.mnuPageSize.items, function(item){ _.each(this.toolbar.mnuPageSize.items, function(item){
if (item.value && typeof(item.value) == 'object' && if (item.value && typeof(item.value) == 'object' &&
Math.abs(item.value[0] - w) < 0.01 && Math.abs(item.value[1] - h) < 0.01) { Math.abs(item.value[0] - width) < 0.01 && Math.abs(item.value[1] - height) < 0.01) {
item.setChecked(true); item.setChecked(true);
return false; return false;
} }
@ -656,7 +658,7 @@ define([
header_locked = pr.get_Locked(); header_locked = pr.get_Locked();
in_header = true; in_header = true;
} else if (type === Asc.c_oAscTypeSelectElement.Image) { } else if (type === Asc.c_oAscTypeSelectElement.Image) {
in_image = in_header = true; in_image = true;
image_locked = pr.get_Locked(); image_locked = pr.get_Locked();
if (pr && pr.get_ChartProperties()) if (pr && pr.get_ChartProperties())
in_chart = true; in_chart = true;
@ -726,7 +728,7 @@ define([
need_disable = toolbar.mnuPageNumCurrentPos.isDisabled() && toolbar.mnuPageNumberPosPicker.isDisabled(); need_disable = toolbar.mnuPageNumCurrentPos.isDisabled() && toolbar.mnuPageNumberPosPicker.isDisabled();
toolbar.mnuInsertPageNum.setDisabled(need_disable); toolbar.mnuInsertPageNum.setDisabled(need_disable);
need_disable = paragraph_locked || header_locked || in_header || in_equation && !btn_eq_state || this.api.asc_IsCursorInFootnote(); need_disable = paragraph_locked || header_locked || in_header || in_image || in_equation && !btn_eq_state || this.api.asc_IsCursorInFootnote();
toolbar.btnsPageBreak.disable(need_disable); toolbar.btnsPageBreak.disable(need_disable);
need_disable = paragraph_locked || header_locked || !can_add_image || in_equation; need_disable = paragraph_locked || header_locked || !can_add_image || in_equation;
@ -1371,9 +1373,9 @@ define([
me.api.put_Table(value.columns, value.rows); me.api.put_Table(value.columns, value.rows);
} }
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
Common.component.Analytics.trackEvent('ToolBar', 'Table'); Common.component.Analytics.trackEvent('ToolBar', 'Table');
} }
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
} }
})).show(); })).show();
} }
@ -2846,7 +2848,7 @@ define([
me.toolbar.render(_.extend({isCompactView: compactview}, config)); me.toolbar.render(_.extend({isCompactView: compactview}, config));
if ( config.isEdit ) { if ( config.isEdit ) {
var tab = {action: 'review', caption: me.toolbar.textTabReview}; var tab = {action: 'review', caption: me.toolbar.textTabCollaboration};
var $panel = DE.getController('Common.Controllers.ReviewChanges').createToolbarPanel(); var $panel = DE.getController('Common.Controllers.ReviewChanges').createToolbarPanel();
if ( $panel ) { if ( $panel ) {

View file

@ -8,6 +8,7 @@
<li id="fm-btn-save-desktop" class="fm-btn" /> <li id="fm-btn-save-desktop" class="fm-btn" />
<li id="fm-btn-print" class="fm-btn" /> <li id="fm-btn-print" class="fm-btn" />
<li id="fm-btn-rename" class="fm-btn" /> <li id="fm-btn-rename" class="fm-btn" />
<li id="fm-btn-protect" class="fm-btn" />
<li class="devider" /> <li class="devider" />
<li id="fm-btn-recent" class="fm-btn" /> <li id="fm-btn-recent" class="fm-btn" />
<li id="fm-btn-create" class="fm-btn" /> <li id="fm-btn-create" class="fm-btn" />
@ -30,4 +31,5 @@
<div id="panel-rights" class="content-box" /> <div id="panel-rights" class="content-box" />
<div id="panel-settings" class="content-box" /> <div id="panel-settings" class="content-box" />
<div id="panel-help" class="content-box" /> <div id="panel-help" class="content-box" />
<div id="panel-protect" class="content-box" />
</div> </div>

View file

@ -16,6 +16,8 @@
</div> </div>
<div id="id-textart-settings" class="settings-panel"> <div id="id-textart-settings" class="settings-panel">
</div> </div>
<div id="id-signature-settings" class="settings-panel">
</div>
</div> </div>
<div class="tool-menu-btns"> <div class="tool-menu-btns">
<div class="ct-btn-category arrow-left" /> <div class="ct-btn-category arrow-left" />
@ -27,5 +29,6 @@
<button id="id-right-menu-chart" class="btn btn-category arrow-left" content-target="id-chart-settings"><i class="icon img-toolbarmenu btn-menu-chart">&nbsp;</i></button> <button id="id-right-menu-chart" class="btn btn-category arrow-left" content-target="id-chart-settings"><i class="icon img-toolbarmenu btn-menu-chart">&nbsp;</i></button>
<button id="id-right-menu-textart" class="btn btn-category arrow-left" content-target="id-textart-settings"><i class="icon img-toolbarmenu btn-menu-textart">&nbsp;</i></button> <button id="id-right-menu-textart" class="btn btn-category arrow-left" content-target="id-textart-settings"><i class="icon img-toolbarmenu btn-menu-textart">&nbsp;</i></button>
<button id="id-right-menu-mail-merge" class="btn btn-category arrow-left hidden" content-target="id-mail-merge-settings"><i class="icon img-toolbarmenu btn-menu-mail-merge">&nbsp;</i></button> <button id="id-right-menu-mail-merge" class="btn btn-category arrow-left hidden" content-target="id-mail-merge-settings"><i class="icon img-toolbarmenu btn-menu-mail-merge">&nbsp;</i></button>
<button id="id-right-menu-signature" class="btn btn-category arrow-left hidden" content-target="id-signature-settings"><i class="icon img-toolbarmenu btn-menu-signature">&nbsp;</i></button>
</div> </div>
</div> </div>

View file

@ -0,0 +1,27 @@
<table cols="2">
<tr>
<td class="padding-large">
<label style="font-size: 18px;"><%= scope.strSignature %></label>
</td>
</tr>
<tr>
<td class="padding-small">
<button id="signature-invisible-sign" class="btn btn-text-default" style="width:100%;"><%= scope.strInvisibleSign %></button>
</td>
</tr>
<tr>
<td class="padding-large">
<button id="signature-visible-sign" class="btn btn-text-default" style="width:100%;"><%= scope.strVisibleSign %></button>
</td>
</tr>
<tr id="signature-requested-sign">
<td></td>
</tr>
<tr id="signature-valid-sign">
<td></td>
</tr>
<tr id="signature-invalid-sign">
<td></td>
</tr>
<tr class="finish-cell"></tr>
</table>

View file

@ -19,6 +19,7 @@
<div class="caret up img-commonctrl" /> <div class="caret up img-commonctrl" />
</div> </div>
</div> </div>
<span id="btn-doc-lang" class="el-edit"></span>
<span id="btn-doc-spell" class="el-edit"></span> <span id="btn-doc-spell" class="el-edit"></span>
<div class="separator short el-edit"></div> <div class="separator short el-edit"></div>
<div id="btn-doc-review" class="el-edit el-review" style="display: inline-block;"></div> <div id="btn-doc-review" class="el-edit el-review" style="display: inline-block;"></div>

View file

@ -49,6 +49,7 @@ define([
'common/main/lib/component/Menu', 'common/main/lib/component/Menu',
'common/main/lib/view/InsertTableDialog', 'common/main/lib/view/InsertTableDialog',
'common/main/lib/view/CopyWarningDialog', 'common/main/lib/view/CopyWarningDialog',
'common/main/lib/view/SignDialog',
'documenteditor/main/app/view/DropcapSettingsAdvanced', 'documenteditor/main/app/view/DropcapSettingsAdvanced',
'documenteditor/main/app/view/HyperlinkSettingsDialog', 'documenteditor/main/app/view/HyperlinkSettingsDialog',
'documenteditor/main/app/view/ParagraphSettingsAdvanced', 'documenteditor/main/app/view/ParagraphSettingsAdvanced',
@ -80,6 +81,7 @@ define([
me._currentMathObj = undefined; me._currentMathObj = undefined;
me._currentParaObjDisabled = false; me._currentParaObjDisabled = false;
me._isDisabled = false; me._isDisabled = false;
me._currentSignGuid = null;
var showPopupMenu = function(menu, value, event, docElement, eOpts){ var showPopupMenu = function(menu, value, event, docElement, eOpts){
if (!_.isUndefined(menu) && menu !== null){ if (!_.isUndefined(menu) && menu !== null){
@ -724,6 +726,36 @@ define([
me.mode.isEdit = false; me.mode.isEdit = false;
}; };
var onSignatureClick = function(guid, width, height) {
if (_.isUndefined(me.fontStore)) {
me.fontStore = new Common.Collections.Fonts();
var fonts = DE.getController('Toolbar').getView('Toolbar').cmbFontName.store.toJSON();
var arr = [];
_.each(fonts, function(font, index){
if (!font.cloneid) {
arr.push(_.clone(font));
}
});
me.fontStore.add(arr);
}
var win = new Common.Views.SignDialog({
api: me.api,
signType: 'visible',
fontStore: me.fontStore,
signSize: {width: width, height: height},
handler: function(dlg, result) {
if (result == 'ok') {
var props = dlg.getSettings();
me.api.asc_Sign(props.certificateId, guid, props.images[0], props.images[1]);
}
Common.NotificationCenter.trigger('edit:complete');
}
});
win.show();
};
var onTextLanguage = function(langid) { var onTextLanguage = function(langid) {
me._currLang.id = langid; me._currLang.id = langid;
}; };
@ -1528,6 +1560,7 @@ define([
this.api.asc_registerCallback('asc_onShowSpecialPasteOptions', _.bind(onShowSpecialPasteOptions, this)); this.api.asc_registerCallback('asc_onShowSpecialPasteOptions', _.bind(onShowSpecialPasteOptions, this));
this.api.asc_registerCallback('asc_onHideSpecialPasteOptions', _.bind(onHideSpecialPasteOptions, this)); this.api.asc_registerCallback('asc_onHideSpecialPasteOptions', _.bind(onHideSpecialPasteOptions, this));
this.api.asc_registerCallback('asc_onSignatureClick', _.bind(onSignatureClick, this));
} }
return this; return this;
@ -2318,10 +2351,9 @@ define([
if (me.api) { if (me.api) {
me.api.SplitCell(value.columns, value.rows); me.api.SplitCell(value.columns, value.rows);
} }
me.fireEvent('editcomplete', me);
Common.component.Analytics.trackEvent('DocumentHolder', 'Table'); Common.component.Analytics.trackEvent('DocumentHolder', 'Table');
} }
me.fireEvent('editcomplete', me);
} }
})).show(); })).show();
} }

View file

@ -168,6 +168,12 @@ define([
this.miSaveAs, this.miSaveAs,
this.miPrint, this.miPrint,
this.miRename, this.miRename,
new Common.UI.MenuItem({
el : $('#fm-btn-protect',this.el),
action : 'protect',
caption : this.btnProtectCaption,
canFocused: false
}),
this.miRecent, this.miRecent,
this.miNew, this.miNew,
new Common.UI.MenuItem({ new Common.UI.MenuItem({
@ -234,7 +240,8 @@ define([
applyMode: function() { applyMode: function() {
this.miPrint[this.mode.canPrint?'show':'hide'](); this.miPrint[this.mode.canPrint?'show':'hide']();
this.miRename[(this.mode.canRename && !this.mode.isDesktopApp) ?'show':'hide'](); this.miRename[(this.mode.canRename && !this.mode.isDesktopApp) ?'show':'hide']();
this.miRename.$el.find('+.devider')[!this.mode.isDisconnected?'show':'hide'](); this.items[7][(this.mode.canProtect) ?'show':'hide']();
this.items[7].$el.find('+.devider')[!this.mode.isDisconnected?'show':'hide']();
this.miRecent[this.mode.canOpenRecent?'show':'hide'](); this.miRecent[this.mode.canOpenRecent?'show':'hide']();
this.miNew[this.mode.canCreateNew?'show':'hide'](); this.miNew[this.mode.canCreateNew?'show':'hide']();
this.miNew.$el.find('+.devider')[this.mode.canCreateNew?'show':'hide'](); this.miNew.$el.find('+.devider')[this.mode.canCreateNew?'show':'hide']();
@ -270,8 +277,10 @@ define([
} }
} }
if (this.mode.isDesktopApp) { if (this.mode.canProtect) {
// this.$el.find('#fm-btn-back').hide(); // this.$el.find('#fm-btn-back').hide();
this.panels['protect'] = (new DE.Views.FileMenuPanels.ProtectDoc({menu:this})).render();
this.panels['protect'].setMode(this.mode);
} }
if (this.mode.canDownload) { if (this.mode.canDownload) {
@ -302,6 +311,7 @@ define([
setApi: function(api) { setApi: function(api) {
this.api = api; this.api = api;
this.panels['info'].setApi(api); this.panels['info'].setApi(api);
if (this.panels['protect']) this.panels['protect'].setApi(api);
}, },
loadDocument: function(data) { loadDocument: function(data) {
@ -360,6 +370,7 @@ define([
btnSaveAsCaption : 'Save as', btnSaveAsCaption : 'Save as',
textDownload : 'Download', textDownload : 'Download',
btnRenameCaption : 'Rename...', btnRenameCaption : 'Rename...',
btnCloseMenuCaption : 'Close Menu' btnCloseMenuCaption : 'Close Menu',
btnProtectCaption: 'Protect\\Sign'
}, DE.Views.FileMenu || {})); }, DE.Views.FileMenu || {}));
}); });

View file

@ -353,60 +353,55 @@ define([
}, },
updateSettings: function() { updateSettings: function() {
this.chInputMode.setValue(Common.localStorage.getBool("de-settings-inputmode")); this.chInputMode.setValue(Common.Utils.InternalSettings.get("de-settings-inputmode"));
Common.Utils.isChrome && this.chInputSogou.setValue(Common.localStorage.getBool("de-settings-inputsogou")); Common.Utils.isChrome && this.chInputSogou.setValue(Common.Utils.InternalSettings.get("de-settings-inputsogou"));
var value = Common.localStorage.getItem("de-settings-zoom"); var value = Common.Utils.InternalSettings.get("de-settings-zoom");
value = (value!==null) ? parseInt(value) : (this.mode.customization && this.mode.customization.zoom ? parseInt(this.mode.customization.zoom) : 100); value = (value!==null) ? parseInt(value) : (this.mode.customization && this.mode.customization.zoom ? parseInt(this.mode.customization.zoom) : 100);
var item = this.cmbZoom.store.findWhere({value: value}); var item = this.cmbZoom.store.findWhere({value: value});
this.cmbZoom.setValue(item ? parseInt(item.get('value')) : (value>0 ? value+'%' : 100)); this.cmbZoom.setValue(item ? parseInt(item.get('value')) : (value>0 ? value+'%' : 100));
/** coauthoring begin **/ /** coauthoring begin **/
this.chLiveComment.setValue(Common.localStorage.getBool("de-settings-livecomment", true)); this.chLiveComment.setValue(Common.Utils.InternalSettings.get("de-settings-livecomment"));
this.chResolvedComment.setValue(Common.localStorage.getBool("de-settings-resolvedcomment", true)); this.chResolvedComment.setValue(Common.Utils.InternalSettings.get("de-settings-resolvedcomment"));
value = Common.localStorage.getItem("de-settings-coauthmode"); var fast_coauth = Common.Utils.InternalSettings.get("de-settings-coauthmode");
if (value===null && !Common.localStorage.itemExists("de-settings-autosave") && item = this.cmbCoAuthMode.store.findWhere({value: fast_coauth ? 1 : 0});
this.mode.customization && this.mode.customization.autosave===false)
value = 0; // use customization.autosave only when de-settings-coauthmode and de-settings-autosave are null
var fast_coauth = (value===null || parseInt(value) == 1) && !(this.mode.isDesktopApp && this.mode.isOffline) && this.mode.canCoAuthoring;
item = this.cmbCoAuthMode.store.findWhere({value: parseInt(value)});
this.cmbCoAuthMode.setValue(item ? item.get('value') : 1); this.cmbCoAuthMode.setValue(item ? item.get('value') : 1);
this.lblCoAuthMode.text(item ? item.get('descValue') : this.strCoAuthModeDescFast); this.lblCoAuthMode.text(item ? item.get('descValue') : this.strCoAuthModeDescFast);
this.fillShowChanges(fast_coauth); this.fillShowChanges(fast_coauth);
value = Common.localStorage.getItem((fast_coauth) ? "de-settings-showchanges-fast" : "de-settings-showchanges-strict"); value = Common.Utils.InternalSettings.get((fast_coauth) ? "de-settings-showchanges-fast" : "de-settings-showchanges-strict");
item = this.cmbShowChanges.store.findWhere({value: value}); item = this.cmbShowChanges.store.findWhere({value: value});
this.cmbShowChanges.setValue(item ? item.get('value') : (fast_coauth) ? 'none' : 'last'); this.cmbShowChanges.setValue(item ? item.get('value') : (fast_coauth) ? 'none' : 'last');
/** coauthoring end **/ /** coauthoring end **/
value = Common.localStorage.getItem("de-settings-fontrender"); value = Common.Utils.InternalSettings.get("de-settings-fontrender");
item = this.cmbFontRender.store.findWhere({value: parseInt(value)}); item = this.cmbFontRender.store.findWhere({value: parseInt(value)});
this.cmbFontRender.setValue(item ? item.get('value') : (window.devicePixelRatio > 1 ? 1 : 0)); this.cmbFontRender.setValue(item ? item.get('value') : (window.devicePixelRatio > 1 ? 1 : 0));
value = Common.localStorage.getItem("de-settings-unit"); value = Common.Utils.InternalSettings.get("de-settings-unit");
item = this.cmbUnit.store.findWhere({value: parseInt(value)}); item = this.cmbUnit.store.findWhere({value: value});
this.cmbUnit.setValue(item ? parseInt(item.get('value')) : Common.Utils.Metric.getDefaultMetric()); this.cmbUnit.setValue(item ? parseInt(item.get('value')) : Common.Utils.Metric.getDefaultMetric());
this._oldUnits = this.cmbUnit.getValue(); this._oldUnits = this.cmbUnit.getValue();
value = Common.localStorage.getItem("de-settings-autosave"); value = Common.Utils.InternalSettings.get("de-settings-autosave");
if (value===null && this.mode.customization && this.mode.customization.autosave===false) this.chAutosave.setValue(value == 1);
value = 0;
this.chAutosave.setValue(fast_coauth || (value===null ? this.mode.canCoAuthoring : parseInt(value) == 1));
if (this.mode.canForcesave) if (this.mode.canForcesave)
this.chForcesave.setValue(Common.localStorage.getBool("de-settings-forcesave", this.mode.canForcesave)); this.chForcesave.setValue(Common.Utils.InternalSettings.get("de-settings-forcesave"));
this.chSpell.setValue(Common.localStorage.getBool("de-settings-spellcheck", true)); this.chSpell.setValue(Common.Utils.InternalSettings.get("de-settings-spellcheck"));
this.chAlignGuides.setValue(Common.localStorage.getBool("de-settings-showsnaplines", true)); this.chAlignGuides.setValue(Common.Utils.InternalSettings.get("de-settings-showsnaplines"));
}, },
applySettings: function() { applySettings: function() {
Common.localStorage.setItem("de-settings-inputmode", this.chInputMode.isChecked() ? 1 : 0); Common.localStorage.setItem("de-settings-inputmode", this.chInputMode.isChecked() ? 1 : 0);
Common.Utils.isChrome && Common.localStorage.setItem("de-settings-inputsogou", this.chInputSogou.isChecked() ? 1 : 0); Common.Utils.isChrome && Common.localStorage.setItem("de-settings-inputsogou", this.chInputSogou.isChecked() ? 1 : 0);
Common.localStorage.setItem("de-settings-zoom", this.cmbZoom.getValue()); Common.localStorage.setItem("de-settings-zoom", this.cmbZoom.getValue());
Common.Utils.InternalSettings.set("de-settings-zoom", Common.localStorage.getItem("de-settings-zoom"));
/** coauthoring begin **/ /** coauthoring begin **/
Common.localStorage.setItem("de-settings-livecomment", this.chLiveComment.isChecked() ? 1 : 0); Common.localStorage.setItem("de-settings-livecomment", this.chLiveComment.isChecked() ? 1 : 0);
Common.localStorage.setItem("de-settings-resolvedcomment", this.chResolvedComment.isChecked() ? 1 : 0); Common.localStorage.setItem("de-settings-resolvedcomment", this.chResolvedComment.isChecked() ? 1 : 0);
@ -421,7 +416,7 @@ define([
if (this.mode.canForcesave) if (this.mode.canForcesave)
Common.localStorage.setItem("de-settings-forcesave", this.chForcesave.isChecked() ? 1 : 0); Common.localStorage.setItem("de-settings-forcesave", this.chForcesave.isChecked() ? 1 : 0);
Common.localStorage.setItem("de-settings-spellcheck", this.chSpell.isChecked() ? 1 : 0); Common.localStorage.setItem("de-settings-spellcheck", this.chSpell.isChecked() ? 1 : 0);
Common.localStorage.setItem("de-settings-showsnaplines", this.chAlignGuides.isChecked() ? 1 : 0); Common.Utils.InternalSettings.set("de-settings-showsnaplines", this.chAlignGuides.isChecked());
Common.localStorage.save(); Common.localStorage.save();
if (this.menu) { if (this.menu) {
@ -875,6 +870,8 @@ define([
}); });
} }
Common.NotificationCenter.on('collaboration:sharing', _.bind(this.changeAccessRights, this));
return this; return this;
}, },
@ -1097,4 +1094,136 @@ define([
} }
} }
}); });
DE.Views.FileMenuPanels.ProtectDoc = Common.UI.BaseView.extend(_.extend({
el: '#panel-protect',
menu: undefined,
template: _.template([
'<label id="id-fms-lbl-sign-header" style="font-size: 18px;"><%= scope.strProtect %></label>',
'<button id="fms-btn-invisible-sign" class="btn btn-text-default" style="min-width:190px;"><%= scope.strInvisibleSign %></button>',
'<button id="fms-btn-visible-sign" class="btn btn-text-default" style="min-width:190px;"><%= scope.strVisibleSign %></button>',
'<div id="id-fms-requested-sign"></div>',
'<div id="id-fms-valid-sign"></div>',
'<div id="id-fms-invalid-sign"></div>'
].join('')),
initialize: function(options) {
Common.UI.BaseView.prototype.initialize.call(this,arguments);
this.menu = options.menu;
this.templateRequested = _.template([
'<label class="header <% if (signatures.length<1) { %>hidden<% } %>"><%= header %></label>',
'<table>',
'<% _.each(signatures, function(item) { %>',
'<tr>',
'<td><%= Common.Utils.String.htmlEncode(item) %></td>',
'</tr>',
'<% }); %>',
'</table>'
].join(''));
this.templateValid = _.template([
'<label class="header <% if (signatures.length<1) { %>hidden<% } %>"><%= header %></label>',
'<table>',
'<% _.each(signatures, function(item) { %>',
'<tr>',
'<td><%= Common.Utils.String.htmlEncode(item.name) %></td>',
'<td><%= Common.Utils.String.htmlEncode(item.date) %></td>',
'</tr>',
'<% }); %>',
'</table>'
].join(''));
},
render: function() {
$(this.el).html(this.template({scope: this}));
this.btnAddInvisibleSign = new Common.UI.Button({
el: '#fms-btn-invisible-sign'
});
this.btnAddInvisibleSign.on('click', _.bind(this.addInvisibleSign, this));
this.btnAddVisibleSign = new Common.UI.Button({
el: '#fms-btn-visible-sign'
});
this.btnAddVisibleSign.on('click', _.bind(this.addVisibleSign, this));
this.lblSignHeader = $('#id-fms-lbl-sign-header', this.$el);
this.cntRequestedSign = $('#id-fms-requested-sign');
this.cntValidSign = $('#id-fms-valid-sign');
this.cntInvalidSign = $('#id-fms-invalid-sign');
if (_.isUndefined(this.scroller)) {
this.scroller = new Common.UI.Scroller({
el: $(this.el),
suppressScrollX: true
});
}
return this;
},
show: function() {
Common.UI.BaseView.prototype.show.call(this,arguments);
this.updateSignatures();
},
setMode: function(mode) {
this.mode = mode;
if (!this.mode.isEdit) {
this.btnAddInvisibleSign.setVisible(false);
this.btnAddVisibleSign.setVisible(false);
this.lblSignHeader.html(this.strSignature);
}
},
setApi: function(o) {
this.api = o;
return this;
},
addInvisibleSign: function() {
if (this.menu)
this.menu.fireEvent('signature:invisible', [this.menu]);
},
addVisibleSign: function() {
if (this.menu)
this.menu.fireEvent('signature:visible', [this.menu]);
},
updateSignatures: function(){
var requested = this.api.asc_getRequestSignatures(),
requested_arr = [],
valid = this.api.asc_getSignatures(),
valid_arr = [], invalid_arr = [];
_.each(requested, function(item, index){
requested_arr.push(item.asc_getSigner1());
});
_.each(valid, function(item, index){
var sign = {name: item.asc_getSigner1(), date: '18/05/2017'};
(item.asc_getValid()==0) ? valid_arr.push(sign) : invalid_arr.push(sign);
});
this.cntRequestedSign.html(this.templateRequested({signatures: requested_arr, header: this.strRequested}));
this.cntValidSign.html(this.templateValid({signatures: valid_arr, header: this.strValid}));
this.cntInvalidSign.html(this.templateValid({signatures: invalid_arr, header: this.strInvalid}));
// this.cntRequestedSign.html(this.templateRequested({signatures: ['Hammish Mitchell', 'Someone Somewhere', 'Mary White', 'John Black'], header: this.strRequested}));
// this.cntValidSign.html(this.templateValid({signatures: [{name: 'Hammish Mitchell', date: '18/05/2017'}, {name: 'Someone Somewhere', date: '18/05/2017'}], header: this.strValid}));
// this.cntInvalidSign.html(this.templateValid({signatures: [{name: 'Mary White', date: '18/05/2017'}, {name: 'John Black', date: '18/05/2017'}], header: this.strInvalid}));
},
strProtect: 'Protect Document',
strInvisibleSign: 'Add invisible digital signature',
strVisibleSign: 'Add visible signature',
strRequested: 'Requested signatures',
strValid: 'Valid signatures',
strInvalid: 'Invalid signatures',
strSignature: 'Signature'
}, DE.Views.FileMenuPanels.ProtectDoc || {}));
}); });

View file

@ -173,8 +173,11 @@ define([
this.btnOriginalSize.on('click', _.bind(this.setOriginalSize, this)); this.btnOriginalSize.on('click', _.bind(this.setOriginalSize, this));
this.btnInsertFromFile.on('click', _.bind(function(btn){ this.btnInsertFromFile.on('click', _.bind(function(btn){
if (this._isFromFile) return;
this._isFromFile = true;
if (this.api) this.api.ChangeImageFromFile(); if (this.api) this.api.ChangeImageFromFile();
this.fireEvent('editcomplete', this); this.fireEvent('editcomplete', this);
this._isFromFile = false;
}, this)); }, this));
this.btnInsertFromUrl.on('click', _.bind(this.insertFromUrl, this)); this.btnInsertFromUrl.on('click', _.bind(this.insertFromUrl, this));
this.btnEditObject.on('click', _.bind(function(btn){ this.btnEditObject.on('click', _.bind(function(btn){

View file

@ -276,7 +276,7 @@ define([
} }
if (this.mode.canChat) { if (this.mode.canChat) {
this.panelChat['hide'](); this.panelChat['hide']();
this.btnChat.toggle(false, true); this.btnChat.toggle(false);
} }
} }
/** coauthoring end **/ /** coauthoring end **/

View file

@ -57,6 +57,7 @@ define([
'documenteditor/main/app/view/ShapeSettings', 'documenteditor/main/app/view/ShapeSettings',
'documenteditor/main/app/view/MailMergeSettings', 'documenteditor/main/app/view/MailMergeSettings',
'documenteditor/main/app/view/TextArtSettings', 'documenteditor/main/app/view/TextArtSettings',
'documenteditor/main/app/view/SignatureSettings',
'common/main/lib/component/Scroller' 'common/main/lib/component/Scroller'
], function (menuTemplate, $, _, Backbone) { ], function (menuTemplate, $, _, Backbone) {
'use strict'; 'use strict';
@ -194,6 +195,21 @@ define([
this.mergeSettings = new DE.Views.MailMergeSettings(); this.mergeSettings = new DE.Views.MailMergeSettings();
} }
if (mode && mode.canProtect) {
this.btnSignature = new Common.UI.Button({
hint: this.txtSignatureSettings,
asctype: Common.Utils.documentSettingsType.Signature,
enableToggle: true,
disabled: true,
toggleGroup: 'tabpanelbtnsGroup'
});
this._settings[Common.Utils.documentSettingsType.Signature] = {panel: "id-signature-settings", btn: this.btnSignature};
this.btnSignature.el = $('#id-right-menu-signature'); this.btnSignature.render().setVisible(true);
this.btnSignature.on('click', _.bind(this.onBtnMenuClick, this));
this.signatureSettings = new DE.Views.SignatureSettings();
}
if (_.isUndefined(this.scroller)) { if (_.isUndefined(this.scroller)) {
this.scroller = new Common.UI.Scroller({ this.scroller = new Common.UI.Scroller({
el: $(this.el).find('.right-panel'), el: $(this.el).find('.right-panel'),
@ -223,6 +239,7 @@ define([
this.shapeSettings.setApi(api).on('editcomplete', _.bind( fire, this)); this.shapeSettings.setApi(api).on('editcomplete', _.bind( fire, this));
this.textartSettings.setApi(api).on('editcomplete', _.bind( fire, this)); this.textartSettings.setApi(api).on('editcomplete', _.bind( fire, this));
if (this.mergeSettings) this.mergeSettings.setApi(api).on('editcomplete', _.bind( fire, this)); if (this.mergeSettings) this.mergeSettings.setApi(api).on('editcomplete', _.bind( fire, this));
if (this.signatureSettings) this.signatureSettings.setApi(api).on('editcomplete', _.bind( fire, this));
}, },
setMode: function(mode) { setMode: function(mode) {
@ -303,6 +320,7 @@ define([
txtShapeSettings: 'Shape Settings', txtShapeSettings: 'Shape Settings',
txtTextArtSettings: 'Text Art Settings', txtTextArtSettings: 'Text Art Settings',
txtChartSettings: 'Chart Settings', txtChartSettings: 'Chart Settings',
txtMailMergeSettings: 'Mail Merge Settings' txtMailMergeSettings: 'Mail Merge Settings',
txtSignatureSettings: 'Signature Settings'
}, DE.Views.RightMenu || {})); }, DE.Views.RightMenu || {}));
}); });

View file

@ -979,7 +979,8 @@ define([
// border colors // border colors
var stroke = shapeprops.get_stroke(), var stroke = shapeprops.get_stroke(),
strokeType = stroke.get_type(), strokeType = stroke.get_type(),
borderType; borderType,
update = (this._state.StrokeColor == 'transparent' && this.BorderColor.Color !== 'transparent'); // border color was changed for shape without line and then shape was reselected (or apply other settings)
if (stroke) { if (stroke) {
if ( strokeType == Asc.c_oAscStrokeType.STROKE_COLOR ) { if ( strokeType == Asc.c_oAscStrokeType.STROKE_COLOR ) {
@ -1005,7 +1006,7 @@ define([
type1 = typeof(this.BorderColor.Color); type1 = typeof(this.BorderColor.Color);
type2 = typeof(this._state.StrokeColor); type2 = typeof(this._state.StrokeColor);
if ( (type1 !== type2) || (type1=='object' && if ( update || (type1 !== type2) || (type1=='object' &&
(this.BorderColor.Color.effectValue!==this._state.StrokeColor.effectValue || this._state.StrokeColor.color.indexOf(this.BorderColor.Color.color)<0)) || (this.BorderColor.Color.effectValue!==this._state.StrokeColor.effectValue || this._state.StrokeColor.color.indexOf(this.BorderColor.Color.color)<0)) ||
(type1!='object' && (this._state.StrokeColor.indexOf(this.BorderColor.Color)<0 || typeof(this.btnBorderColor.color)=='object'))) { (type1!='object' && (this._state.StrokeColor.indexOf(this.BorderColor.Color)<0 || typeof(this.btnBorderColor.color)=='object'))) {
@ -1201,7 +1202,7 @@ define([
this.fillControls.push(this.btnInsertFromUrl); this.fillControls.push(this.btnInsertFromUrl);
this.btnInsertFromFile.on('click', _.bind(function(btn){ this.btnInsertFromFile.on('click', _.bind(function(btn){
if (this.api) this.api.ChangeShapeImageFromFile(); if (this.api) this.api.ChangeShapeImageFromFile(this.BlipFillType);
this.fireEvent('editcomplete', this); this.fireEvent('editcomplete', this);
}, this)); }, this));
this.btnInsertFromUrl.on('click', _.bind(this.insertFromUrl, this)); this.btnInsertFromUrl.on('click', _.bind(this.insertFromUrl, this));

View file

@ -0,0 +1,289 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
/**
* SignatureSettings.js
*
* Created by Julia Radzhabova on 5/24/17
* Copyright (c) 2017 Ascensio System SIA. All rights reserved.
*
*/
define([
'text!documenteditor/main/app/template/SignatureSettings.template',
'jquery',
'underscore',
'backbone',
'common/main/lib/component/Button',
'common/main/lib/view/SignDialog',
'common/main/lib/view/SignSettingsDialog'
], function (menuTemplate, $, _, Backbone) {
'use strict';
DE.Views.SignatureSettings = Backbone.View.extend(_.extend({
el: '#id-signature-settings',
// Compile our stats template
template: _.template(menuTemplate),
// Delegated events for creating new items, and clearing completed ones.
events: {
},
options: {
alias: 'SignatureSettings'
},
initialize: function () {
var me = this;
this._initSettings = true;
this._state = {
DisabledControls: false,
requestedSignatures: undefined,
validSignatures: undefined,
invalidSignatures: undefined
};
this._locked = false;
this.lockedControls = [];
this._noApply = false;
this._originalProps = null;
this.templateRequested = _.template([
'<td class="padding-large <% if (signatures.length<1) { %>hidden<% } %>">',
'<table class="<% if (signatures.length<1) { %>hidden<% } %>" style="width:100%">',
'<tr><td colspan="2" class="padding-large"><label class="header"><%= header %></label></td></tr>',
'<% _.each(signatures, function(item) { %>',
'<tr>',
'<td style="padding-bottom: 3px;"><label style="overflow: hidden; max-height: 15px;"><%= Common.Utils.String.htmlEncode(item.name) %></label></td>',
'<td style="padding: 0 5px; vertical-align: top; text-align: right;"><label class="link-solid signature-sign-link" data-value="<%= item.guid %>">' + this.strSign + '</label></td>',
'</tr>',
'<% }); %>',
'</table>',
'</td>'
].join(''));
this.templateValid = _.template([
'<td class="padding-large <% if (signatures.length<1) { %>hidden<% } %>"">',
'<table class="<% if (signatures.length<1) { %>hidden<% } %>" style="width:100%">',
'<tr><td colspan="2" class="padding-large"><label class="header"><%= header %></label></td></tr>',
'<% _.each(signatures, function(item) { %>',
'<tr>',
'<td><div style="overflow: hidden; max-height: 15px;"><%= Common.Utils.String.htmlEncode(item.name) %></div></td>',
'<td rowspan="2" style="padding: 0 5px; vertical-align: top; text-align: right;"><label class="link-solid signature-view-link" data-value="<%= item.guid %>">' + this.strView + '</label></td>',
'</tr>',
'<tr><td style="padding-bottom: 3px;"><%= Common.Utils.String.htmlEncode(item.date) %></td></tr>',
'<% }); %>',
'</table>',
'</td>'
].join(''));
this.render();
},
render: function () {
this.$el.html(this.template({
scope: this
}));
this.btnAddInvisibleSign = new Common.UI.Button({
el: this.$el.find('#signature-invisible-sign')
});
this.btnAddInvisibleSign.on('click', _.bind(this.addInvisibleSign, this));
this.lockedControls.push(this.btnAddInvisibleSign);
this.btnAddVisibleSign = new Common.UI.Button({
el: this.$el.find('#signature-visible-sign')
});
this.btnAddVisibleSign.on('click', _.bind(this.addVisibleSign, this));
this.lockedControls.push(this.btnAddVisibleSign);
this.cntRequestedSign = $('#signature-requested-sign');
this.cntValidSign = $('#signature-valid-sign');
this.cntInvalidSign = $('#signature-invalid-sign');
this.$el.on('click', '.signature-sign-link', _.bind(this.onSign, this));
this.$el.on('click', '.signature-view-link', _.bind(this.onViewSignature, this));
},
setApi: function(api) {
this.api = api;
if (this.api) {
this.api.asc_registerCallback('asc_onUpdateSignatures', _.bind(this.onUpdateSignatures, this));
}
return this;
},
createDelayedControls: function() {
this._initSettings = false;
},
ChangeSettings: function(props) {
if (this._initSettings)
this.createDelayedControls();
if (!this._state.requestedSignatures || !this._state.validSignatures || !this._state.invalidSignatures) {
this.onUpdateSignatures(this.api.asc_getSignatures(), this.api.asc_getRequestSignatures());
}
this.disableControls(this._locked);
},
setLocked: function (locked) {
this._locked = locked;
},
disableControls: function(disable) {
if (this._initSettings) return;
if (this._state.DisabledControls!==disable) {
this._state.DisabledControls = disable;
_.each(this.lockedControls, function(item) {
item.setDisabled(disable);
});
this.$linksSign.toggleClass('disabled', disable);
this.$linksView.toggleClass('disabled', disable);
}
},
setMode: function(mode) {
this.mode = mode;
},
onUpdateSignatures: function(valid, requested){
var me = this;
me._state.requestedSignatures = [];
me._state.validSignatures = [];
me._state.invalidSignatures = [];
_.each(requested, function(item, index){
me._state.requestedSignatures.push({name: item.asc_getSigner1(), guid: item.asc_getGuid()});
});
_.each(valid, function(item, index){
var sign = {name: item.asc_getSigner1(), guid: item.asc_getId(), date: '18/05/2017'};
(item.asc_getValid()==0) ? me._state.validSignatures.push(sign) : me._state.invalidSignatures.push(sign);
});
this.cntRequestedSign.html(this.templateRequested({signatures: me._state.requestedSignatures, header: this.strRequested}));
this.cntValidSign.html(this.templateValid({signatures: me._state.validSignatures, header: this.strValid}));
this.cntInvalidSign.html(this.templateValid({signatures: me._state.invalidSignatures, header: this.strInvalid}));
// this.cntRequestedSign.html(this.templateRequested({signatures: [{name: 'Hammish Mitchell', guid: '123'}, {name: 'Someone Somewhere', guid: '123'}, {name: 'Mary White', guid: '123'}, {name: 'John Black', guid: '123'}], header: this.strRequested}));
// this.cntValidSign.html(this.templateValid({signatures: [{name: 'Hammish Mitchell', guid: '123', date: '18/05/2017'}, {name: 'Someone Somewhere', guid: '345', date: '18/05/2017'}], header: this.strValid}));
// this.cntInvalidSign.html(this.templateValid({signatures: [{name: 'Mary White', guid: '111', date: '18/05/2017'}, {name: 'John Black', guid: '456', date: '18/05/2017'}], header: this.strInvalid}));
this.$linksSign = $('.signature-sign-link', this.$el);
this.$linksView = $('.signature-view-link', this.$el);
},
addVisibleSign: function(btn) {
var me = this,
win = new Common.Views.SignSettingsDialog({
handler: function(dlg, result) {
if (result == 'ok') {
me.api.asc_AddSignatureLine2(dlg.getSettings());
}
me.fireEvent('editcomplete', me);
}
});
win.show();
},
addInvisibleSign: function(btn) {
var me = this,
win = new Common.Views.SignDialog({
api: me.api,
signType: 'invisible',
handler: function(dlg, result) {
if (result == 'ok') {
var props = dlg.getSettings();
me.api.asc_Sign(props.certificateId);
}
me.fireEvent('editcomplete', me);
}
});
win.show();
},
onSign: function(event) {
var me = this,
target = $(event.currentTarget);
if (target.hasClass('disabled')) return;
if (_.isUndefined(me.fontStore)) {
me.fontStore = new Common.Collections.Fonts();
var fonts = DE.getController('Toolbar').getView('Toolbar').cmbFontName.store.toJSON();
var arr = [];
_.each(fonts, function(font, index){
if (!font.cloneid) {
arr.push(_.clone(font));
}
});
me.fontStore.add(arr);
}
var win = new Common.Views.SignDialog({
api: me.api,
signType: 'visible',
fontStore: me.fontStore,
handler: function(dlg, result) {
if (result == 'ok') {
var props = dlg.getSettings();
me.api.asc_Sign(props.certificateId, target.attr('data-value'), props.images[0], props.images[1]);
}
me.fireEvent('editcomplete', me);
}
});
win.show();
},
onViewSignature: function(event) {
var target = $(event.currentTarget);
if (target.hasClass('disabled')) return;
this.api.asc_ViewCertificate(target.attr('data-value'));
},
strSignature: 'Signature',
strInvisibleSign: 'Add invisible digital signature',
strVisibleSign: 'Add visible signature',
strRequested: 'Requested signatures',
strValid: 'Valid signatures',
strInvalid: 'Invalid signatures',
strSign: 'Sign',
strView: 'View'
}, DE.Views.SignatureSettings || {}));
});

View file

@ -243,8 +243,8 @@ define([
if (me.api) { if (me.api) {
me.api.SplitCell(value.columns, value.rows); me.api.SplitCell(value.columns, value.rows);
} }
me.fireEvent('editcomplete', me);
} }
me.fireEvent('editcomplete', me);
} }
})).show(); })).show();
}, },

View file

@ -672,7 +672,8 @@ define([
// border colors // border colors
var stroke = shapeprops.asc_getLine(), var stroke = shapeprops.asc_getLine(),
strokeType = (stroke) ? stroke.get_type() : null, strokeType = (stroke) ? stroke.get_type() : null,
borderType; borderType,
update = (this._state.StrokeColor == 'transparent' && this.BorderColor.Color !== 'transparent'); // border color was changed for shape without line and then shape was reselected (or apply other settings)
if (stroke) { if (stroke) {
if ( strokeType == Asc.c_oAscStrokeType.STROKE_COLOR ) { if ( strokeType == Asc.c_oAscStrokeType.STROKE_COLOR ) {
@ -697,7 +698,7 @@ define([
type1 = typeof(this.BorderColor.Color); type1 = typeof(this.BorderColor.Color);
type2 = typeof(this._state.StrokeColor); type2 = typeof(this._state.StrokeColor);
if ( (type1 !== type2) || (type1=='object' && if ( update || (type1 !== type2) || (type1=='object' &&
(this.BorderColor.Color.effectValue!==this._state.StrokeColor.effectValue || this._state.StrokeColor.color.indexOf(this.BorderColor.Color.color)<0)) || (this.BorderColor.Color.effectValue!==this._state.StrokeColor.effectValue || this._state.StrokeColor.color.indexOf(this.BorderColor.Color.color)<0)) ||
(type1!='object' && (this._state.StrokeColor.indexOf(this.BorderColor.Color)<0 || typeof(this.btnBorderColor.color)=='object'))) { (type1!='object' && (this._state.StrokeColor.indexOf(this.BorderColor.Color)<0 || typeof(this.btnBorderColor.color)=='object'))) {

View file

@ -893,8 +893,8 @@ define([
iconCls: 'btn-colorschemas', iconCls: 'btn-colorschemas',
menu: new Common.UI.Menu({ menu: new Common.UI.Menu({
items: [], items: [],
maxHeight: 600, maxHeight: 560,
restoreHeight: 600 restoreHeight: 560
}).on('show:before', function (mnu) { }).on('show:before', function (mnu) {
if (!this.scroller) { if (!this.scroller) {
this.scroller = new Common.UI.Scroller({ this.scroller = new Common.UI.Scroller({
@ -904,23 +904,6 @@ define([
alwaysVisibleY: true alwaysVisibleY: true
}); });
} }
}).on('show:after', function (btn, e) {
var mnu = $(this.el).find('.dropdown-menu '),
docH = $(document).height(),
menuH = mnu.outerHeight(),
top = parseInt(mnu.css('top'));
if (menuH > docH) {
mnu.css('max-height', (docH - parseInt(mnu.css('padding-top')) - parseInt(mnu.css('padding-bottom')) - 5) + 'px');
this.scroller.update({minScrollbarLength: 40});
} else if (mnu.height() < this.options.restoreHeight) {
mnu.css('max-height', (Math.min(docH - parseInt(mnu.css('padding-top')) - parseInt(mnu.css('padding-bottom')) - 5, this.options.restoreHeight)) + 'px');
menuH = mnu.outerHeight();
if (top + menuH > docH) {
mnu.css('top', 0);
}
this.scroller.update({minScrollbarLength: 40});
}
}) })
}); });
this.toolbarControls.push(this.btnColorSchemas); this.toolbarControls.push(this.btnColorSchemas);
@ -1189,17 +1172,6 @@ define([
this.needShowSynchTip = false; this.needShowSynchTip = false;
/** coauthoring end **/ /** coauthoring end **/
me.$tabs.parent().on('click', '.ribtab', function (e) {
var tab = $(e.target).data('tab');
if (tab == 'file') {
me.fireEvent('file:open');
} else
if ( me.isTabActive('file') )
me.fireEvent('file:close');
me.setTab(tab);
});
Common.NotificationCenter.on({ Common.NotificationCenter.on({
'window:resize': function() { 'window:resize': function() {
Common.UI.Mixtbar.prototype.onResize.apply(me, arguments); Common.UI.Mixtbar.prototype.onResize.apply(me, arguments);
@ -1225,6 +1197,21 @@ define([
return this; return this;
}, },
onTabClick: function (e) {
var tab = $(e.target).data('tab'),
me = this;
if ( !me.isTabActive(tab) ) {
if ( tab == 'file' ) {
me.fireEvent('file:open');
} else
if ( me.isTabActive('file') )
me.fireEvent('file:close');
}
Common.UI.Mixtbar.prototype.onTabClick.apply(me, arguments);
},
rendererComponents: function (html) { rendererComponents: function (html) {
var $host = $(html); var $host = $(html);
var _injectComponent = function (id, cmp) { var _injectComponent = function (id, cmp) {
@ -2161,8 +2148,8 @@ define([
if (this.mnuColorSchema == null) { if (this.mnuColorSchema == null) {
this.mnuColorSchema = new Common.UI.Menu({ this.mnuColorSchema = new Common.UI.Menu({
maxHeight: 600, maxHeight: 560,
restoreHeight: 600 restoreHeight: 560
}).on('show:before', function (mnu) { }).on('show:before', function (mnu) {
this.scroller = new Common.UI.Scroller({ this.scroller = new Common.UI.Scroller({
el: $(this.el).find('.dropdown-menu '), el: $(this.el).find('.dropdown-menu '),
@ -2520,7 +2507,8 @@ define([
capImgWrapping: 'Wrapping', capImgWrapping: 'Wrapping',
capBtnComment: 'Comment', capBtnComment: 'Comment',
textColumnsCustom: 'Custom Columns', textColumnsCustom: 'Custom Columns',
textSurface: 'Surface' textSurface: 'Surface',
textTabCollaboration: 'Collaboration'
} }
})(), DE.Views.Toolbar || {})); })(), DE.Views.Toolbar || {}));
}); });

View file

@ -207,10 +207,13 @@
"Common.Views.ReviewChanges.txtAcceptCurrent": "Accept Current Change", "Common.Views.ReviewChanges.txtAcceptCurrent": "Accept Current Change",
"Common.Views.ReviewChanges.txtClose": "Close", "Common.Views.ReviewChanges.txtClose": "Close",
"Common.Views.ReviewChanges.txtDocLang": "Language", "Common.Views.ReviewChanges.txtDocLang": "Language",
"Common.Views.ReviewChanges.txtFinal": "All changes accepted (Preview)", "Common.Views.ReviewChanges.txtFinal": "All changes like accept (Preview)",
"Common.Views.ReviewChanges.txtMarkup": "All changes (Editing)", "Common.Views.ReviewChanges.txtMarkup": "Text with changes (Editing)",
"Common.Views.ReviewChanges.txtNext": "Next", "Common.Views.ReviewChanges.txtNext": "Next",
"Common.Views.ReviewChanges.txtOriginal": "All changes rejected (Preview)", "Common.Views.ReviewChanges.txtOriginal": "Text without changes (Preview)",
"Common.Views.ReviewChanges.txtMarkupCap": "Markup",
"Common.Views.ReviewChanges.txtFinalCap": "Final",
"Common.Views.ReviewChanges.txtOriginalCap": "Original",
"Common.Views.ReviewChanges.txtPrev": "Previous", "Common.Views.ReviewChanges.txtPrev": "Previous",
"Common.Views.ReviewChanges.txtReject": "Reject", "Common.Views.ReviewChanges.txtReject": "Reject",
"Common.Views.ReviewChanges.txtRejectAll": "Reject All Changes", "Common.Views.ReviewChanges.txtRejectAll": "Reject All Changes",
@ -219,6 +222,16 @@
"Common.Views.ReviewChanges.txtSpelling": "Spell Checking", "Common.Views.ReviewChanges.txtSpelling": "Spell Checking",
"Common.Views.ReviewChanges.txtTurnon": "Track Changes", "Common.Views.ReviewChanges.txtTurnon": "Track Changes",
"Common.Views.ReviewChanges.txtView": "Display Mode", "Common.Views.ReviewChanges.txtView": "Display Mode",
"Common.Views.ReviewChanges.txtSharing": "Sharing",
"Common.Views.ReviewChanges.tipSharing": "Manage document access rights",
"Common.Views.ReviewChanges.txtCoAuthMode": "Co-editing Mode",
"Common.Views.ReviewChanges.tipCoAuthMode": "Set co-editing mode",
"Common.Views.ReviewChanges.strFast": "Fast",
"Common.Views.ReviewChanges.strStrict": "Strict",
"Common.Views.ReviewChanges.strFastDesc": "Real-time co-editing. All changes are saved automatically.",
"Common.Views.ReviewChanges.strStrictDesc": "Use the 'Save' button to sync the changes you and others make.",
"Common.Views.ReviewChanges.txtHistory": "Version History",
"Common.Views.ReviewChanges.tipHistory": "Show version history",
"Common.Views.ReviewChangesDialog.textTitle": "Review Changes", "Common.Views.ReviewChangesDialog.textTitle": "Review Changes",
"Common.Views.ReviewChangesDialog.txtAccept": "Accept", "Common.Views.ReviewChangesDialog.txtAccept": "Accept",
"Common.Views.ReviewChangesDialog.txtAcceptAll": "Accept All Changes", "Common.Views.ReviewChangesDialog.txtAcceptAll": "Accept All Changes",
@ -228,6 +241,32 @@
"Common.Views.ReviewChangesDialog.txtReject": "Reject", "Common.Views.ReviewChangesDialog.txtReject": "Reject",
"Common.Views.ReviewChangesDialog.txtRejectAll": "Reject All Changes", "Common.Views.ReviewChangesDialog.txtRejectAll": "Reject All Changes",
"Common.Views.ReviewChangesDialog.txtRejectCurrent": "Reject Current Change", "Common.Views.ReviewChangesDialog.txtRejectCurrent": "Reject Current Change",
"Common.Views.SignDialog.textTitle": "Sign Document",
"Common.Views.SignDialog.textPurpose": "Purpose for signing this document",
"Common.Views.SignDialog.textCertificate": "Certificate",
"Common.Views.SignDialog.textValid": "Valid from %1 to %2",
"Common.Views.SignDialog.textChange": "Change",
"Common.Views.SignDialog.cancelButtonText": "Cancel",
"Common.Views.SignDialog.okButtonText": "Ok",
"Common.Views.SignDialog.textInputName": "Input signer name",
"Common.Views.SignDialog.textUseImage": "or click 'Select Image' to use a picture as signature",
"Common.Views.SignDialog.textSelectImage": "Select Image",
"Common.Views.SignDialog.textSignature": "Signature looks as",
"Common.Views.SignDialog.tipFontName": "Font Name",
"Common.Views.SignDialog.tipFontSize": "Font Size",
"Common.Views.SignDialog.textBold": "Bold",
"Common.Views.SignDialog.textItalic": "Italic",
"Common.Views.SignSettingsDialog.textInfo": "Signer Info",
"Common.Views.SignSettingsDialog.textInfoName": "Name",
"Common.Views.SignSettingsDialog.textInfoTitle": "Signer Title",
"Common.Views.SignSettingsDialog.textInfoEmail": "E-mail",
"Common.Views.SignSettingsDialog.textInstructions": "Instructions for Signer",
"Common.Views.SignSettingsDialog.cancelButtonText": "Cancel",
"Common.Views.SignSettingsDialog.okButtonText": "Ok",
"Common.Views.SignSettingsDialog.txtEmpty": "This field is required",
"Common.Views.SignSettingsDialog.textAllowComment": "Allow signer to add comment in the signature dialog",
"Common.Views.SignSettingsDialog.textShowDate": "Show sign date in signature line",
"Common.Views.SignSettingsDialog.textTitle": "Signature Settings",
"DE.Controllers.LeftMenu.leavePageText": "All unsaved changes in this document will be lost.<br> Click \"Cancel\" then \"Save\" to save them. Click \"OK\" to discard all the unsaved changes.", "DE.Controllers.LeftMenu.leavePageText": "All unsaved changes in this document will be lost.<br> Click \"Cancel\" then \"Save\" to save them. Click \"OK\" to discard all the unsaved changes.",
"DE.Controllers.LeftMenu.newDocumentTitle": "Unnamed document", "DE.Controllers.LeftMenu.newDocumentTitle": "Unnamed document",
"DE.Controllers.LeftMenu.notcriticalErrorTitle": "Warning", "DE.Controllers.LeftMenu.notcriticalErrorTitle": "Warning",
@ -350,6 +389,17 @@
"DE.Controllers.Main.txtStyle_Title": "Title", "DE.Controllers.Main.txtStyle_Title": "Title",
"DE.Controllers.Main.txtXAxis": "X Axis", "DE.Controllers.Main.txtXAxis": "X Axis",
"DE.Controllers.Main.txtYAxis": "Y Axis", "DE.Controllers.Main.txtYAxis": "Y Axis",
"DE.Controllers.Main.txtBookmarkError": "Error! Bookmark not defined.",
"DE.Controllers.Main.txtAbove": "above",
"DE.Controllers.Main.txtBelow": "below",
"DE.Controllers.Main.txtOnPage": "on page ",
"DE.Controllers.Main.txtHeader": "Header",
"DE.Controllers.Main.txtFooter": "Footer",
"DE.Controllers.Main.txtSection": " -Section ",
"DE.Controllers.Main.txtFirstPage": "First Page ",
"DE.Controllers.Main.txtEvenPage": "Even Page ",
"DE.Controllers.Main.txtOddPage": "Odd Page ",
"DE.Controllers.Main.txtSameAsPrev": "Same as Previous",
"DE.Controllers.Main.unknownErrorText": "Unknown error.", "DE.Controllers.Main.unknownErrorText": "Unknown error.",
"DE.Controllers.Main.unsupportedBrowserErrorText ": "Your browser is not supported.", "DE.Controllers.Main.unsupportedBrowserErrorText ": "Your browser is not supported.",
"DE.Controllers.Main.uploadImageExtMessage": "Unknown image format.", "DE.Controllers.Main.uploadImageExtMessage": "Unknown image format.",
@ -963,6 +1013,7 @@
"DE.Views.FileMenu.btnSettingsCaption": "Advanced Settings...", "DE.Views.FileMenu.btnSettingsCaption": "Advanced Settings...",
"DE.Views.FileMenu.btnToEditCaption": "Edit Document", "DE.Views.FileMenu.btnToEditCaption": "Edit Document",
"DE.Views.FileMenu.textDownload": "Download", "DE.Views.FileMenu.textDownload": "Download",
"DE.Views.FileMenu.btnProtectCaption": "Protect\\Sign",
"DE.Views.FileMenuPanels.CreateNew.fromBlankText": "From Blank", "DE.Views.FileMenuPanels.CreateNew.fromBlankText": "From Blank",
"DE.Views.FileMenuPanels.CreateNew.fromTemplateText": "From Template", "DE.Views.FileMenuPanels.CreateNew.fromTemplateText": "From Template",
"DE.Views.FileMenuPanels.CreateNew.newDescriptionText": "Create a new blank text document which you will be able to style and format after it is created during the editing. Or choose one of the templates to start a document of a certain type or purpose where some styles have already been pre-applied.", "DE.Views.FileMenuPanels.CreateNew.newDescriptionText": "Create a new blank text document which you will be able to style and format after it is created during the editing. Or choose one of the templates to start a document of a certain type or purpose where some styles have already been pre-applied.",
@ -1029,6 +1080,13 @@
"DE.Views.HeaderFooterSettings.textBottomCenter": "Bottom center", "DE.Views.HeaderFooterSettings.textBottomCenter": "Bottom center",
"DE.Views.HeaderFooterSettings.textBottomLeft": "Bottom left", "DE.Views.HeaderFooterSettings.textBottomLeft": "Bottom left",
"DE.Views.HeaderFooterSettings.textBottomRight": "Bottom right", "DE.Views.HeaderFooterSettings.textBottomRight": "Bottom right",
"DE.Views.FileMenuPanels.ProtectDoc.strProtect": "Protect Document",
"DE.Views.FileMenuPanels.ProtectDoc.strInvisibleSign": "Add invisible digital signature",
"DE.Views.FileMenuPanels.ProtectDoc.strVisibleSign": "Add visible signature",
"DE.Views.FileMenuPanels.ProtectDoc.strRequested": "Requested signatures",
"DE.Views.FileMenuPanels.ProtectDoc.strValid": "Valid signatures",
"DE.Views.FileMenuPanels.ProtectDoc.strInvalid": "Invalid signatures",
"DE.Views.FileMenuPanels.ProtectDoc.strSignature": "Signature",
"DE.Views.HeaderFooterSettings.textDiffFirst": "Different first page", "DE.Views.HeaderFooterSettings.textDiffFirst": "Different first page",
"DE.Views.HeaderFooterSettings.textDiffOdd": "Different odd and even pages", "DE.Views.HeaderFooterSettings.textDiffOdd": "Different odd and even pages",
"DE.Views.HeaderFooterSettings.textHeaderFromBottom": "Footer from Bottom", "DE.Views.HeaderFooterSettings.textHeaderFromBottom": "Footer from Bottom",
@ -1307,6 +1365,7 @@
"DE.Views.RightMenu.txtShapeSettings": "Shape settings", "DE.Views.RightMenu.txtShapeSettings": "Shape settings",
"DE.Views.RightMenu.txtTableSettings": "Table settings", "DE.Views.RightMenu.txtTableSettings": "Table settings",
"DE.Views.RightMenu.txtTextArtSettings": "Text Art settings", "DE.Views.RightMenu.txtTextArtSettings": "Text Art settings",
"DE.Views.RightMenu.txtSignatureSettings": "Signature Settings",
"DE.Views.ShapeSettings.strBackground": "Background color", "DE.Views.ShapeSettings.strBackground": "Background color",
"DE.Views.ShapeSettings.strChange": "Change Autoshape", "DE.Views.ShapeSettings.strChange": "Change Autoshape",
"DE.Views.ShapeSettings.strColor": "Color", "DE.Views.ShapeSettings.strColor": "Color",
@ -1357,6 +1416,14 @@
"DE.Views.ShapeSettings.txtTight": "Tight", "DE.Views.ShapeSettings.txtTight": "Tight",
"DE.Views.ShapeSettings.txtTopAndBottom": "Top and bottom", "DE.Views.ShapeSettings.txtTopAndBottom": "Top and bottom",
"DE.Views.ShapeSettings.txtWood": "Wood", "DE.Views.ShapeSettings.txtWood": "Wood",
"DE.Views.SignatureSettings.strSignature": "Signature",
"DE.Views.SignatureSettings.strInvisibleSign": "Add invisible digital signature",
"DE.Views.SignatureSettings.strVisibleSign": "Add visible signature",
"DE.Views.SignatureSettings.strRequested": "Requested signatures",
"DE.Views.SignatureSettings.strValid": "Valid signatures",
"DE.Views.SignatureSettings.strInvalid": "Invalid signatures",
"DE.Views.SignatureSettings.strSign": "Sign",
"DE.Views.SignatureSettings.strView": "View",
"DE.Views.Statusbar.goToPageText": "Go to Page", "DE.Views.Statusbar.goToPageText": "Go to Page",
"DE.Views.Statusbar.pageIndexText": "Page {0} of {1}", "DE.Views.Statusbar.pageIndexText": "Page {0} of {1}",
"DE.Views.Statusbar.tipFitPage": "Fit to page", "DE.Views.Statusbar.tipFitPage": "Fit to page",
@ -1612,6 +1679,7 @@
"DE.Views.Toolbar.textTabInsert": "Insert", "DE.Views.Toolbar.textTabInsert": "Insert",
"DE.Views.Toolbar.textTabLayout": "Layout", "DE.Views.Toolbar.textTabLayout": "Layout",
"DE.Views.Toolbar.textTabReview": "Review", "DE.Views.Toolbar.textTabReview": "Review",
"DE.Views.Toolbar.textTabCollaboration": "Collaboration",
"DE.Views.Toolbar.textTitleError": "Error", "DE.Views.Toolbar.textTitleError": "Error",
"DE.Views.Toolbar.textToCurrent": "To current position", "DE.Views.Toolbar.textToCurrent": "To current position",
"DE.Views.Toolbar.textTop": "Top: ", "DE.Views.Toolbar.textTop": "Top: ",

View file

@ -350,6 +350,8 @@
"DE.Controllers.Main.txtStyle_Title": "Название", "DE.Controllers.Main.txtStyle_Title": "Название",
"DE.Controllers.Main.txtXAxis": "Ось X", "DE.Controllers.Main.txtXAxis": "Ось X",
"DE.Controllers.Main.txtYAxis": "Ось Y", "DE.Controllers.Main.txtYAxis": "Ось Y",
"DE.Controllers.Main.txtHeader": "Верхний колонтитул",
"DE.Controllers.Main.txtFooter": "Нижний колонтитул",
"DE.Controllers.Main.unknownErrorText": "Неизвестная ошибка.", "DE.Controllers.Main.unknownErrorText": "Неизвестная ошибка.",
"DE.Controllers.Main.unsupportedBrowserErrorText ": "Ваш браузер не поддерживается.", "DE.Controllers.Main.unsupportedBrowserErrorText ": "Ваш браузер не поддерживается.",
"DE.Controllers.Main.uploadImageExtMessage": "Неизвестный формат изображения.", "DE.Controllers.Main.uploadImageExtMessage": "Неизвестный формат изображения.",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 36 KiB

View file

@ -78,3 +78,31 @@ button.notify .btn-menu-comments {background-position: -0*@toolbar-icon-size -60
-o-transform: rotate(180deg); -o-transform: rotate(180deg);
transform: rotate(180deg); transform: rotate(180deg);
} }
#panel-protect {
#file-menu-panel & {
padding: 30px 30px;
}
button {
display: block;
width: auto;
margin-top: 20px;
}
label {
font: 12px tahoma, arial, verdana, sans-serif;
}
.header {
font-weight: bold;
margin: 30px 0 10px;
}
table {
td {
padding: 5px 5px;
}
}
}

View file

@ -105,6 +105,7 @@
/*menuTextArt*/ /*menuTextArt*/
.button-normal-icon(btn-menu-textart, 54, @toolbar-icon-size); .button-normal-icon(btn-menu-textart, 54, @toolbar-icon-size);
.button-normal-icon(btn-menu-signature, 78, @toolbar-icon-size);
.button-otherstates-icon2(btn-category, @toolbar-icon-size); .button-otherstates-icon2(btn-category, @toolbar-icon-size);

View file

@ -1,13 +1,9 @@
@tabs-bg-color: #4f6279; @tabs-bg-color: #4f6279;
#toolbar {
//z-index: 101;
}
.toolbar { .toolbar {
&:not(.cover) { &:not(.cover) {
z-index: 101; z-index: 1001;
} }
&.masked { &.masked {
@ -312,12 +308,6 @@
.button-normal-icon(mmerge-first, 74, @toolbar-icon-size); .button-normal-icon(mmerge-first, 74, @toolbar-icon-size);
//.button-normal-icon(btn-columns, 75, @toolbar-icon-size); //.button-normal-icon(btn-columns, 75, @toolbar-icon-size);
//.button-normal-icon(btn-pagemargins, 76, @toolbar-icon-size); //.button-normal-icon(btn-pagemargins, 76, @toolbar-icon-size);
//.button-normal-icon(btn-img-frwd, 83, @toolbar-icon-size);
//.button-normal-icon(btn-img-bkwd, 84, @toolbar-icon-size);
//.button-normal-icon(btn-img-wrap, 85, @toolbar-icon-size);
//.button-normal-icon(btn-img-group, 86, @toolbar-icon-size);
//.button-normal-icon(btn-img-align, 87, @toolbar-icon-size);
.button-normal-icon(btn-goback, 88, @toolbar-icon-size);
//.button-normal-icon(btn-insertimage, 17, @toolbar-icon-size); //.button-normal-icon(btn-insertimage, 17, @toolbar-icon-size);
//.button-normal-icon(btn-inserttable, 18, @toolbar-icon-size); //.button-normal-icon(btn-inserttable, 18, @toolbar-icon-size);
@ -327,12 +317,7 @@
//.button-normal-icon(btn-text, 46, @toolbar-icon-size); //.button-normal-icon(btn-text, 46, @toolbar-icon-size);
//.button-normal-icon(btn-insertequation, 53, @toolbar-icon-size); //.button-normal-icon(btn-insertequation, 53, @toolbar-icon-size);
//.button-normal-icon(btn-dropcap, 50, @toolbar-icon-size); //.button-normal-icon(btn-dropcap, 50, @toolbar-icon-size);
//.button-normal-icon(btn-ic-doclang, 67, @toolbar-icon-size); .button-normal-icon(btn-ic-doclang, 67, @toolbar-icon-size);
//.button-normal-icon(btn-notes, 78, @toolbar-icon-size);
//.button-normal-icon(review-prev, 79, @toolbar-icon-size);
//.button-normal-icon(review-next, 80, @toolbar-icon-size);
//.button-normal-icon(review-save, 81, @toolbar-icon-size);
//.button-normal-icon(review-deny, 82, @toolbar-icon-size);
@menu-icon-size: 22px; @menu-icon-size: 22px;
.menu-icon-normal(mnu-wrap-inline, 0, @menu-icon-size); .menu-icon-normal(mnu-wrap-inline, 0, @menu-icon-size);

View file

@ -849,6 +849,8 @@ define([
} }
} }
else { else {
Common.Gateway.reportWarning(id, config.msg);
config.title = this.notcriticalErrorTitle; config.title = this.notcriticalErrorTitle;
config.callback = _.bind(function(btn){ config.callback = _.bind(function(btn){
if (id == Asc.c_oAscError.ID.Warning && btn == 'ok' && (this.appOptions.canDownload || this.appOptions.canDownloadOrigin)) { if (id == Asc.c_oAscError.ID.Warning && btn == 'ok' && (this.appOptions.canDownload || this.appOptions.canDownloadOrigin)) {

View file

@ -88,8 +88,10 @@ var sdk_dev_scrpipts = [
"../../../../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/DocumentContentElementBase.js",
"../../../../sdkjs/word/Editor/ParagraphContentBase.js",
"../../../../sdkjs/word/Editor/Comments.js", "../../../../sdkjs/word/Editor/Comments.js",
"../../../../sdkjs/word/Editor/CommentsChanges.js", "../../../../sdkjs/word/Editor/CommentsChanges.js",
"../../../../sdkjs/word/Editor/Bookmarks.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/RevisionsChange.js",
@ -98,6 +100,8 @@ var sdk_dev_scrpipts = [
"../../../../sdkjs/word/Editor/Paragraph/ParaTextPrChanges.js", "../../../../sdkjs/word/Editor/Paragraph/ParaTextPrChanges.js",
"../../../../sdkjs/word/Editor/Paragraph/ParaDrawing.js", "../../../../sdkjs/word/Editor/Paragraph/ParaDrawing.js",
"../../../../sdkjs/word/Editor/Paragraph/ParaDrawingChanges.js", "../../../../sdkjs/word/Editor/Paragraph/ParaDrawingChanges.js",
"../../../../sdkjs/word/Editor/Paragraph/ComplexFieldInstruction.js",
"../../../../sdkjs/word/Editor/Paragraph/ComplexField.js",
"../../../../sdkjs/word/Editor/Paragraph.js", "../../../../sdkjs/word/Editor/Paragraph.js",
"../../../../sdkjs/word/Editor/ParagraphChanges.js", "../../../../sdkjs/word/Editor/ParagraphChanges.js",
"../../../../sdkjs/word/Editor/DocumentContentBase.js", "../../../../sdkjs/word/Editor/DocumentContentBase.js",
@ -110,7 +114,6 @@ var sdk_dev_scrpipts = [
"../../../../sdkjs/word/Editor/DrawingsController.js", "../../../../sdkjs/word/Editor/DrawingsController.js",
"../../../../sdkjs/word/Editor/HeaderFooterController.js", "../../../../sdkjs/word/Editor/HeaderFooterController.js",
"../../../../sdkjs/word/Editor/FlowObjects.js", "../../../../sdkjs/word/Editor/FlowObjects.js",
"../../../../sdkjs/word/Editor/ParagraphContentBase.js",
"../../../../sdkjs/word/Editor/Hyperlink.js", "../../../../sdkjs/word/Editor/Hyperlink.js",
"../../../../sdkjs/word/Editor/HyperlinkChanges.js", "../../../../sdkjs/word/Editor/HyperlinkChanges.js",
"../../../../sdkjs/word/Editor/Field.js", "../../../../sdkjs/word/Editor/Field.js",

View file

@ -496,6 +496,8 @@ var ApplicationController = new(function(){
}); });
} }
else { else {
Common.Gateway.reportWarning(id, message);
$('#id-critical-error-title').text(me.notcriticalErrorTitle); $('#id-critical-error-title').text(me.notcriticalErrorTitle);
$('#id-critical-error-message').text(message); $('#id-critical-error-message').text(message);
$('#id-critical-error-close').off(); $('#id-critical-error-close').off();

View file

@ -155,6 +155,7 @@ require([
/** coauthoring end **/ /** coauthoring end **/
,'Common.Controllers.Plugins' ,'Common.Controllers.Plugins'
,'Common.Controllers.ExternalDiagramEditor' ,'Common.Controllers.ExternalDiagramEditor'
,'Common.Controllers.ReviewChanges'
] ]
}); });
@ -185,6 +186,7 @@ require([
'common/main/lib/controller/Plugins', 'common/main/lib/controller/Plugins',
'presentationeditor/main/app/view/ChartSettings', 'presentationeditor/main/app/view/ChartSettings',
'common/main/lib/controller/ExternalDiagramEditor' 'common/main/lib/controller/ExternalDiagramEditor'
,'common/main/lib/controller/ReviewChanges'
], function() { ], function() {
app.start(); app.start();
}); });

View file

@ -43,6 +43,7 @@
define([ define([
'core', 'core',
'common/main/lib/util/Shortcuts', 'common/main/lib/util/Shortcuts',
'common/main/lib/view/SignDialog',
'presentationeditor/main/app/view/LeftMenu', 'presentationeditor/main/app/view/LeftMenu',
'presentationeditor/main/app/view/FileMenu' 'presentationeditor/main/app/view/FileMenu'
], function () { ], function () {
@ -83,7 +84,8 @@ define([
'saveas:format': _.bind(this.clickSaveAsFormat, this), 'saveas:format': _.bind(this.clickSaveAsFormat, this),
'settings:apply': _.bind(this.applySettings, this), 'settings:apply': _.bind(this.applySettings, this),
'create:new': _.bind(this.onCreateNew, this), 'create:new': _.bind(this.onCreateNew, this),
'recent:open': _.bind(this.onOpenRecent, this) 'recent:open': _.bind(this.onOpenRecent, this),
'signature:invisible': _.bind(this.addInvisibleSign, this)
}, },
'Toolbar': { 'Toolbar': {
'file:settings': _.bind(this.clickToolbarSettings,this), 'file:settings': _.bind(this.clickToolbarSettings,this),
@ -94,8 +96,12 @@ define([
'hide': _.bind(this.onSearchDlgHide, this), 'hide': _.bind(this.onSearchDlgHide, this),
'search:back': _.bind(this.onQuerySearch, this, 'back'), 'search:back': _.bind(this.onQuerySearch, this, 'back'),
'search:next': _.bind(this.onQuerySearch, this, 'next') 'search:next': _.bind(this.onQuerySearch, this, 'next')
},
'Common.Views.ReviewChanges': {
'collaboration:chat': _.bind(this.onShowHideChat, this)
} }
}); });
Common.NotificationCenter.on('leftmenu:change', _.bind(this.onMenuChange, this));
}, },
onLaunch: function() { onLaunch: function() {
@ -238,7 +244,15 @@ define([
}, },
applySettings: function(menu) { applySettings: function(menu) {
this.api.SetTextBoxInputMode(Common.localStorage.getBool("pe-settings-inputmode")); var value = Common.localStorage.getBool("pe-settings-inputmode");
Common.Utils.InternalSettings.set("pe-settings-inputmode", value);
this.api.SetTextBoxInputMode(value);
if (Common.Utils.isChrome) {
value = Common.localStorage.getBool("pe-settings-inputsogou");
Common.Utils.InternalSettings.set("pe-settings-inputsogou", value);
// window["AscInputMethod"]["SogouPinyin"] = value;
}
if (Common.Utils.isChrome) { if (Common.Utils.isChrome) {
value = Common.localStorage.getBool("pe-settings-inputsogou"); value = Common.localStorage.getBool("pe-settings-inputsogou");
@ -247,18 +261,23 @@ define([
/** coauthoring begin **/ /** coauthoring begin **/
if (this.mode.isEdit && !this.mode.isOffline && this.mode.canCoAuthoring) { if (this.mode.isEdit && !this.mode.isOffline && this.mode.canCoAuthoring) {
this.api.asc_SetFastCollaborative(Common.localStorage.getBool("pe-settings-coauthmode", true)); value = Common.localStorage.getBool("pe-settings-coauthmode", true);
Common.Utils.InternalSettings.set("pe-settings-coauthmode", value);
this.api.asc_SetFastCollaborative(value);
} }
/** coauthoring end **/ /** coauthoring end **/
if (this.mode.isEdit) { if (this.mode.isEdit) {
var value = Common.localStorage.getItem("pe-settings-autosave"); value = parseInt(Common.localStorage.getItem("pe-settings-autosave"));
this.api.asc_setAutoSaveGap(parseInt(value)); Common.Utils.InternalSettings.set("pe-settings-autosave", value);
this.api.asc_setAutoSaveGap(value);
this.api.asc_setSpellCheck(Common.localStorage.getBool("pe-settings-spellcheck", true)); value = Common.localStorage.getBool("pe-settings-spellcheck", true);
Common.Utils.InternalSettings.set("pe-settings-spellcheck", value);
this.api.asc_setSpellCheck(value);
} }
this.api.put_ShowSnapLines( Common.localStorage.getBool("pe-settings-showsnaplines") ); this.api.put_ShowSnapLines(Common.Utils.InternalSettings.get("pe-settings-showsnaplines"));
menu.hide(); menu.hide();
}, },
@ -545,6 +564,49 @@ define([
} }
}, },
addInvisibleSign: function(menu) {
var me = this,
win = new Common.Views.SignDialog({
api: me.api,
signType: 'invisible',
handler: function(dlg, result) {
if (result == 'ok') {
var props = dlg.getSettings();
me.api.asc_Sign(props.certificateId);
}
Common.NotificationCenter.trigger('edit:complete', me);
}
});
win.show();
menu.hide();
},
onMenuChange: function (value) {
if ('hide' === value) {
if (this.leftMenu.btnComments.isActive() && this.api) {
this.leftMenu.btnComments.toggle(false);
this.leftMenu.onBtnMenuClick(this.leftMenu.btnComments);
// focus to sdk
this.api.asc_enableKeyEvents(true);
}
}
},
onShowHideChat: function(state) {
if (this.mode.canCoAuthoring && this.mode.canChat && !this.mode.isLightVersion) {
if (state) {
Common.UI.Menu.Manager.hideAll();
this.leftMenu.showMenu('chat');
} else {
this.leftMenu.btnChat.toggle(false, true);
this.leftMenu.onBtnMenuClick(this.leftMenu.btnChat);
}
}
},
textNoTextFound : 'Text not found', textNoTextFound : 'Text not found',
newDocumentTitle : 'Unnamed document', newDocumentTitle : 'Unnamed document',
requestEditRightsText : 'Requesting editing rights...' requestEditRightsText : 'Requesting editing rights...'

View file

@ -142,7 +142,8 @@ define([
'Slide subtitle': this.txtSlideSubtitle, 'Slide subtitle': this.txtSlideSubtitle,
'Table': this.txtSldLtTTbl, 'Table': this.txtSldLtTTbl,
'Slide title': this.txtSlideTitle, 'Slide title': this.txtSlideTitle,
'Loading': this.txtLoading 'Loading': this.txtLoading,
'Click to add notes': this.txtAddNotes
} }
}); });
@ -357,8 +358,17 @@ define([
} }
}, },
onDownloadAs: function() { onDownloadAs: function(format) {
this.api.asc_DownloadAs(Asc.c_oAscFileType.PPTX, true); var _format = (format && (typeof format == 'string')) ? Asc.c_oAscFileType[ format.toUpperCase() ] : null,
_supported = [
Asc.c_oAscFileType.PPTX,
Asc.c_oAscFileType.ODP,
Asc.c_oAscFileType.PDF
];
if ( !_format || _supported.indexOf(_format) < 0 )
_format = Asc.c_oAscFileType.PPTX;
this.api.asc_DownloadAs(_format, true);
}, },
onProcessMouse: function(data) { onProcessMouse: function(data) {
@ -570,10 +580,13 @@ define([
me.onLongActionEnd(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument); me.onLongActionEnd(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument);
value = Common.localStorage.getItem("pe-settings-zoom"); value = Common.localStorage.getItem("pe-settings-zoom");
Common.Utils.InternalSettings.set("pe-settings-zoom", value);
var zf = (value!==null) ? parseInt(value) : (this.appOptions.customization && this.appOptions.customization.zoom ? parseInt(this.appOptions.customization.zoom) : -1); var zf = (value!==null) ? parseInt(value) : (this.appOptions.customization && this.appOptions.customization.zoom ? parseInt(this.appOptions.customization.zoom) : -1);
(zf == -1) ? this.api.zoomFitToPage() : ((zf == -2) ? this.api.zoomFitToWidth() : this.api.zoom(zf>0 ? zf : 100)); (zf == -1) ? this.api.zoomFitToPage() : ((zf == -2) ? this.api.zoomFitToWidth() : this.api.zoom(zf>0 ? zf : 100));
me.api.asc_setSpellCheck(Common.localStorage.getBool("pe-settings-spellcheck", true)); value = Common.localStorage.getBool("pe-settings-spellcheck", true);
Common.Utils.InternalSettings.set("pe-settings-spellcheck", value);
me.api.asc_setSpellCheck(value);
function checkWarns() { function checkWarns() {
if (!window['AscDesktopEditor']) { if (!window['AscDesktopEditor']) {
@ -597,11 +610,14 @@ define([
appHeader.setDocumentCaption( me.api.asc_getDocumentName() ); appHeader.setDocumentCaption( me.api.asc_getDocumentName() );
me.updateWindowTitle(true); me.updateWindowTitle(true);
me.api.SetTextBoxInputMode(Common.localStorage.getBool("pe-settings-inputmode")); value = Common.localStorage.getBool("pe-settings-inputmode");
Common.Utils.InternalSettings.set("pe-settings-inputmode", value);
me.api.SetTextBoxInputMode(value);
if (Common.Utils.isChrome) { if (Common.Utils.isChrome) {
value = Common.localStorage.getBool("pe-settings-inputsogou"); value = Common.localStorage.getBool("pe-settings-inputsogou");
me.api.setInputParams({"SogouPinyin" : value}); me.api.setInputParams({"SogouPinyin" : value});
Common.Utils.InternalSettings.set("pe-settings-inputsogou", value);
} }
/** coauthoring begin **/ /** coauthoring begin **/
@ -614,12 +630,16 @@ define([
me._state.fastCoauth = (value===null || parseInt(value) == 1); me._state.fastCoauth = (value===null || parseInt(value) == 1);
} else { } else {
me._state.fastCoauth = (!me.appOptions.isEdit && me.appOptions.canComments); me._state.fastCoauth = (!me.appOptions.isEdit && me.appOptions.canComments);
me._state.fastCoauth && me.api.asc_setAutoSaveGap(1); if (me._state.fastCoauth) {
me.api.asc_setAutoSaveGap(1);
Common.Utils.InternalSettings.set("pe-settings-autosave", 1);
}
} }
me.api.asc_SetFastCollaborative(me._state.fastCoauth); me.api.asc_SetFastCollaborative(me._state.fastCoauth);
Common.Utils.InternalSettings.set("pe-settings-coauthmode", me._state.fastCoauth);
/** coauthoring end **/ /** coauthoring end **/
Common.localStorage.setBool("pe-settings-showsnaplines", me.api.get_ShowSnapLines()); Common.Utils.InternalSettings.set("pe-settings-showsnaplines", me.api.get_ShowSnapLines());
var application = me.getApplication(); var application = me.getApplication();
var toolbarController = application.getController('Toolbar'), var toolbarController = application.getController('Toolbar'),
@ -660,9 +680,11 @@ define([
value = 0; value = 0;
value = (!me._state.fastCoauth && value!==null) ? parseInt(value) : (me.appOptions.canCoAuthoring ? 1 : 0); value = (!me._state.fastCoauth && value!==null) ? parseInt(value) : (me.appOptions.canCoAuthoring ? 1 : 0);
me.api.asc_setAutoSaveGap(value); me.api.asc_setAutoSaveGap(value);
Common.Utils.InternalSettings.set("pe-settings-autosave", value);
if (me.appOptions.canForcesave) {// use asc_setIsForceSaveOnUserSave only when customization->forcesave = true if (me.appOptions.canForcesave) {// use asc_setIsForceSaveOnUserSave only when customization->forcesave = true
me.appOptions.forcesave = Common.localStorage.getBool("pe-settings-forcesave", me.appOptions.canForcesave); me.appOptions.forcesave = Common.localStorage.getBool("pe-settings-forcesave", me.appOptions.canForcesave);
Common.Utils.InternalSettings.set("pe-settings-forcesave", me.appOptions.forcesave);
me.api.asc_setIsForceSaveOnUserSave(me.appOptions.forcesave); me.api.asc_setIsForceSaveOnUserSave(me.appOptions.forcesave);
} }
@ -786,6 +808,7 @@ define([
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.trialMode = params.asc_getLicenseMode(); this.appOptions.trialMode = params.asc_getLicenseMode();
this.appOptions.canProtect = this.appOptions.isDesktopApp && this.api.asc_isSignaturesSupport();
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';
@ -852,7 +875,8 @@ define([
application = this.getApplication(), application = this.getApplication(),
toolbarController = application.getController('Toolbar'), toolbarController = application.getController('Toolbar'),
rightmenuController = application.getController('RightMenu'), rightmenuController = application.getController('RightMenu'),
fontsControllers = application.getController('Common.Controllers.Fonts'); fontsControllers = application.getController('Common.Controllers.Fonts'),
reviewController = application.getController('Common.Controllers.ReviewChanges');
// me.getStore('SlideLayouts'); // me.getStore('SlideLayouts');
fontsControllers && fontsControllers.setApi(me.api); fontsControllers && fontsControllers.setApi(me.api);
@ -860,6 +884,8 @@ define([
rightmenuController && rightmenuController.setApi(me.api); rightmenuController && rightmenuController.setApi(me.api);
reviewController.setMode(me.appOptions).setConfig({config: me.editorConfig}, me.api);
var viewport = this.getApplication().getController('Viewport').getView('Viewport'); var viewport = this.getApplication().getController('Viewport').getView('Viewport');
viewport.applyEditorMode(); viewport.applyEditorMode();
@ -888,6 +914,7 @@ define([
var value = Common.localStorage.getItem('pe-settings-unit'); var value = Common.localStorage.getItem('pe-settings-unit');
value = (value!==null) ? parseInt(value) : Common.Utils.Metric.getDefaultMetric(); value = (value!==null) ? parseInt(value) : Common.Utils.Metric.getDefaultMetric();
Common.Utils.Metric.setCurrentMetric(value); Common.Utils.Metric.setCurrentMetric(value);
Common.Utils.InternalSettings.set("pe-settings-unit", value);
me.api.asc_SetDocumentUnits((value==Common.Utils.Metric.c_MetricUnits.inch) ? Asc.c_oAscDocumentUnits.Inch : ((value==Common.Utils.Metric.c_MetricUnits.pt) ? Asc.c_oAscDocumentUnits.Point : Asc.c_oAscDocumentUnits.Millimeter)); me.api.asc_SetDocumentUnits((value==Common.Utils.Metric.c_MetricUnits.inch) ? Asc.c_oAscDocumentUnits.Inch : ((value==Common.Utils.Metric.c_MetricUnits.pt) ? Asc.c_oAscDocumentUnits.Point : Asc.c_oAscDocumentUnits.Millimeter));
if (me.api.asc_SetViewRulers) me.api.asc_SetViewRulers(!Common.localStorage.getBool('pe-hidden-rulers', true)); if (me.api.asc_SetViewRulers) me.api.asc_SetViewRulers(!Common.localStorage.getBool('pe-hidden-rulers', true));
@ -1069,6 +1096,8 @@ define([
} }
} }
else { else {
Common.Gateway.reportWarning(id, config.msg);
config.title = this.notcriticalErrorTitle; config.title = this.notcriticalErrorTitle;
config.iconCls = 'warn'; config.iconCls = 'warn';
config.buttons = ['ok']; config.buttons = ['ok'];
@ -1076,6 +1105,20 @@ define([
if (id == Asc.c_oAscError.ID.Warning && btn == 'ok' && this.appOptions.canDownload) { if (id == Asc.c_oAscError.ID.Warning && btn == 'ok' && this.appOptions.canDownload) {
Common.UI.Menu.Manager.hideAll(); Common.UI.Menu.Manager.hideAll();
(this.appOptions.isDesktopApp && this.appOptions.isOffline) ? this.api.asc_DownloadAs() : this.getApplication().getController('LeftMenu').leftMenu.showMenu('file:saveas'); (this.appOptions.isDesktopApp && this.appOptions.isOffline) ? this.api.asc_DownloadAs() : this.getApplication().getController('LeftMenu').leftMenu.showMenu('file:saveas');
} else if (id == Asc.c_oAscError.ID.SplitCellMaxRows || id == Asc.c_oAscError.ID.SplitCellMaxCols || id == Asc.c_oAscError.ID.SplitCellRowsDivider) {
var me = this;
setTimeout(function(){
(new Common.Views.InsertTableDialog({
split: true,
handler: function(result, value) {
if (result == 'ok') {
if (me.api)
me.api.SplitCell(value.columns, value.rows);
}
me.onEditComplete();
}
})).show();
},10);
} }
this._state.lostEditingRights = false; this._state.lostEditingRights = false;
this.onEditComplete(); this.onEditComplete();
@ -1365,6 +1408,7 @@ define([
var value = Common.localStorage.getItem("pe-settings-unit"); var value = Common.localStorage.getItem("pe-settings-unit");
value = (value!==null) ? parseInt(value) : Common.Utils.Metric.getDefaultMetric(); value = (value!==null) ? parseInt(value) : Common.Utils.Metric.getDefaultMetric();
Common.Utils.Metric.setCurrentMetric(value); Common.Utils.Metric.setCurrentMetric(value);
Common.Utils.InternalSettings.set("pe-settings-unit", value);
this.api.asc_SetDocumentUnits((value==Common.Utils.Metric.c_MetricUnits.inch) ? Asc.c_oAscDocumentUnits.Inch : ((value==Common.Utils.Metric.c_MetricUnits.pt) ? Asc.c_oAscDocumentUnits.Point : Asc.c_oAscDocumentUnits.Millimeter)); this.api.asc_SetDocumentUnits((value==Common.Utils.Metric.c_MetricUnits.inch) ? Asc.c_oAscDocumentUnits.Inch : ((value==Common.Utils.Metric.c_MetricUnits.pt) ? Asc.c_oAscDocumentUnits.Point : Asc.c_oAscDocumentUnits.Millimeter));
this.getApplication().getController('RightMenu').updateMetricUnit(); this.getApplication().getController('RightMenu').updateMetricUnit();
}, },
@ -1532,6 +1576,7 @@ define([
if (btn == 'custom') { if (btn == 'custom') {
Common.localStorage.setItem("pe-settings-coauthmode", 0); Common.localStorage.setItem("pe-settings-coauthmode", 0);
this.api.asc_SetFastCollaborative(false); this.api.asc_SetFastCollaborative(false);
Common.Utils.InternalSettings.set("pe-settings-coauthmode", false);
this._state.fastCoauth = false; this._state.fastCoauth = false;
} }
this.onEditComplete(); this.onEditComplete();
@ -1557,6 +1602,7 @@ define([
} }
if (this.appOptions.canForcesave) { if (this.appOptions.canForcesave) {
this.appOptions.forcesave = Common.localStorage.getBool("pe-settings-forcesave", this.appOptions.canForcesave); this.appOptions.forcesave = Common.localStorage.getBool("pe-settings-forcesave", this.appOptions.canForcesave);
Common.Utils.InternalSettings.set("pe-settings-forcesave", this.appOptions.forcesave);
this.api.asc_setIsForceSaveOnUserSave(this.appOptions.forcesave); this.api.asc_setIsForceSaveOnUserSave(this.appOptions.forcesave);
} }
}, },
@ -1657,18 +1703,11 @@ define([
var pluginsData = (uiCustomize) ? plugins.UIpluginsData : plugins.pluginsData; var pluginsData = (uiCustomize) ? plugins.UIpluginsData : plugins.pluginsData;
if (!pluginsData || pluginsData.length<1) return; if (!pluginsData || pluginsData.length<1) return;
var arr = [], var arr = [];
baseUrl = _.isEmpty(plugins.url) ? "" : plugins.url;
if (baseUrl !== "")
console.warn("Obsolete: The url parameter is deprecated. Please check the documentation for new plugin connection configuration.");
pluginsData.forEach(function(item){ pluginsData.forEach(function(item){
item = baseUrl + item; // for compatibility with previouse version of server, where plugins.url is used.
var value = Common.Utils.getConfigJson(item); var value = Common.Utils.getConfigJson(item);
if (value) { if (value) {
value.baseUrl = item.substring(0, item.lastIndexOf("config.json")); value.baseUrl = item.substring(0, item.lastIndexOf("config.json"));
value.oldVersion = (baseUrl !== "");
arr.push(value); arr.push(value);
} }
}); });
@ -1708,14 +1747,6 @@ define([
var visible = (isEdit || itemVar.isViewer) && _.contains(itemVar.EditorsSupport, 'slide'); var visible = (isEdit || itemVar.isViewer) && _.contains(itemVar.EditorsSupport, 'slide');
if ( visible ) pluginVisible = true; if ( visible ) pluginVisible = true;
var icons = itemVar.icons;
if (item.oldVersion) { // for compatibility with previouse version of server, where plugins.url is used.
icons = [];
itemVar.icons.forEach(function(icon){
icons.push(icon.substring(icon.lastIndexOf("\/")+1));
});
}
if ( item.isUICustomizer ) { if ( item.isUICustomizer ) {
visible && arrUI.push(item.baseUrl + itemVar.url); visible && arrUI.push(item.baseUrl + itemVar.url);
} else { } else {
@ -1723,8 +1754,8 @@ define([
model.set({ model.set({
index: variationsArr.length, index: variationsArr.length,
url: (item.oldVersion) ? (itemVar.url.substring(itemVar.url.lastIndexOf("\/") + 1) ) : itemVar.url, url: itemVar.url,
icons: icons, icons: itemVar.icons,
visible: visible visible: visible
}); });
@ -1909,7 +1940,8 @@ define([
textChangesSaved: 'All changes saved', textChangesSaved: 'All changes saved',
saveTitleText: 'Saving Document', saveTitleText: 'Saving Document',
saveTextText: 'Saving document...', saveTextText: 'Saving document...',
txtLoading: 'Loading...' txtLoading: 'Loading...',
txtAddNotes: 'Click to add notes'
} }
})(), PE.Controllers.Main || {})) })(), PE.Controllers.Main || {}))
}); });

View file

@ -79,6 +79,7 @@ define([
this._settings[Common.Utils.documentSettingsType.Shape] = {panelId: "id-shape-settings", panel: rightMenu.shapeSettings, btn: rightMenu.btnShape, hidden: 1, locked: false}; this._settings[Common.Utils.documentSettingsType.Shape] = {panelId: "id-shape-settings", panel: rightMenu.shapeSettings, btn: rightMenu.btnShape, hidden: 1, locked: false};
this._settings[Common.Utils.documentSettingsType.TextArt] = {panelId: "id-textart-settings", panel: rightMenu.textartSettings, btn: rightMenu.btnTextArt, hidden: 1, locked: false}; this._settings[Common.Utils.documentSettingsType.TextArt] = {panelId: "id-textart-settings", panel: rightMenu.textartSettings, btn: rightMenu.btnTextArt, hidden: 1, locked: false};
this._settings[Common.Utils.documentSettingsType.Chart] = {panelId: "id-chart-settings", panel: rightMenu.chartSettings, btn: rightMenu.btnChart, hidden: 1, locked: false}; this._settings[Common.Utils.documentSettingsType.Chart] = {panelId: "id-chart-settings", panel: rightMenu.chartSettings, btn: rightMenu.btnChart, hidden: 1, locked: false};
this._settings[Common.Utils.documentSettingsType.Signature] = {panelId: "id-signature-settings", panel: rightMenu.signatureSettings, btn: rightMenu.btnSignature, hidden: (rightMenu.signatureSettings) ? 0 : 1, props: {}, locked: false};
}, },
setApi: function(api) { setApi: function(api) {
@ -97,7 +98,7 @@ define([
var panel = this._settings[type].panel; var panel = this._settings[type].panel;
var props = this._settings[type].props; var props = this._settings[type].props;
if (props && panel) if (props && panel)
panel.ChangeSettings.call(panel, props); panel.ChangeSettings.call(panel, (type==Common.Utils.documentSettingsType.Signature) ? undefined : props);
} }
Common.NotificationCenter.trigger('layout:changed', 'rightmenu'); Common.NotificationCenter.trigger('layout:changed', 'rightmenu');
this.rightmenu.fireEvent('editcomplete', this.rightmenu); this.rightmenu.fireEvent('editcomplete', this.rightmenu);
@ -109,12 +110,14 @@ define([
var needhide = true; var needhide = true;
for (var i=0; i<this._settings.length; i++) { for (var i=0; i<this._settings.length; i++) {
if (i==Common.Utils.documentSettingsType.Signature) continue;
if (this._settings[i]) { if (this._settings[i]) {
this._settings[i].hidden = 1; this._settings[i].hidden = 1;
this._settings[i].locked = undefined; this._settings[i].locked = undefined;
} }
} }
this._settings[Common.Utils.documentSettingsType.Slide].hidden = (SelectedObjects.length>0) ? 0 : 1; this._settings[Common.Utils.documentSettingsType.Slide].hidden = (SelectedObjects.length>0) ? 0 : 1;
this._settings[Common.Utils.documentSettingsType.Signature].locked = false;
for (i=0; i<SelectedObjects.length; i++) for (i=0; i<SelectedObjects.length; i++)
{ {
@ -152,7 +155,7 @@ define([
activePane = this.rightmenu.GetActivePane(); activePane = this.rightmenu.GetActivePane();
for (i=0; i<this._settings.length; i++) { for (i=0; i<this._settings.length; i++) {
var pnl = this._settings[i]; var pnl = this._settings[i];
if (pnl===undefined) continue; if (pnl===undefined || pnl.btn===undefined || pnl.panel===undefined) continue;
if ( pnl.hidden ) { if ( pnl.hidden ) {
if (!pnl.btn.isDisabled()) pnl.btn.setDisabled(true); if (!pnl.btn.isDisabled()) pnl.btn.setDisabled(true);
@ -160,7 +163,7 @@ define([
currentactive = -1; currentactive = -1;
} else { } else {
if (pnl.btn.isDisabled()) pnl.btn.setDisabled(false); if (pnl.btn.isDisabled()) pnl.btn.setDisabled(false);
if ( i!=Common.Utils.documentSettingsType.Slide ) if ( i!=Common.Utils.documentSettingsType.Slide && i!=Common.Utils.documentSettingsType.Signature)
lastactive = i; lastactive = i;
if ( pnl.needShow ) { if ( pnl.needShow ) {
pnl.needShow = false; pnl.needShow = false;
@ -190,7 +193,10 @@ define([
if (active !== undefined) { if (active !== undefined) {
this.rightmenu.SetActivePane(active, open); this.rightmenu.SetActivePane(active, open);
if (active!=Common.Utils.documentSettingsType.Signature)
this._settings[active].panel.ChangeSettings.call(this._settings[active].panel, this._settings[active].props); this._settings[active].panel.ChangeSettings.call(this._settings[active].panel, this._settings[active].props);
else
this._settings[active].panel.ChangeSettings.call(this._settings[active].panel);
} }
} }

View file

@ -208,6 +208,7 @@ define([
onBtnSpelling: function(d, b, e) { onBtnSpelling: function(d, b, e) {
Common.localStorage.setItem("pe-settings-spellcheck", d.pressed ? 1 : 0); Common.localStorage.setItem("pe-settings-spellcheck", d.pressed ? 1 : 0);
Common.Utils.InternalSettings.set("pe-settings-spellcheck", d.pressed);
this.api.asc_setSpellCheck(d.pressed); this.api.asc_setSpellCheck(d.pressed);
Common.NotificationCenter.trigger('edit:complete', this.statusbar); Common.NotificationCenter.trigger('edit:complete', this.statusbar);
}, },

View file

@ -166,8 +166,8 @@ define([
btn_id = cmp.closest('.btn-group').attr('id'); btn_id = cmp.closest('.btn-group').attr('id');
if (cmp.attr('id') != 'editor_sdk' && cmp_sdk.length<=0) { if (cmp.attr('id') != 'editor_sdk' && cmp_sdk.length<=0) {
if ( me.toolbar.btnsInsertText.pressed && !me.toolbar.btnsInsertText.contains(btn_id) || if ( me.toolbar.btnsInsertText.pressed() && !me.toolbar.btnsInsertText.contains(btn_id) ||
me.toolbar.btnsInsertShape.pressed && !me.toolbar.btnsInsertShape.contains(btn_id) ) me.toolbar.btnsInsertShape.pressed() && !me.toolbar.btnsInsertShape.contains(btn_id) )
{ {
me._isAddingShape = false; me._isAddingShape = false;
@ -176,7 +176,7 @@ define([
me.toolbar.btnsInsertText.toggle(false, true); me.toolbar.btnsInsertText.toggle(false, true);
Common.NotificationCenter.trigger('edit:complete', me.toolbar); Common.NotificationCenter.trigger('edit:complete', me.toolbar);
} else } else
if ( me.toolbar.btnsInsertShape.pressed && me.toolbar.btnsInsertShape.contains(btn_id) ) { if ( me.toolbar.btnsInsertShape.pressed() && me.toolbar.btnsInsertShape.contains(btn_id) ) {
_.defer(function(){ _.defer(function(){
me.api.StartAddShape('', false); me.api.StartAddShape('', false);
Common.NotificationCenter.trigger('edit:complete', me.toolbar); Common.NotificationCenter.trigger('edit:complete', me.toolbar);
@ -188,10 +188,10 @@ define([
this.onApiEndAddShape = function() { this.onApiEndAddShape = function() {
this.toolbar.fireEvent('insertshape', this.toolbar); this.toolbar.fireEvent('insertshape', this.toolbar);
if ( this.toolbar.btnsInsertShape.pressed ) if ( this.toolbar.btnsInsertShape.pressed() )
this.toolbar.btnsInsertShape.toggle(false, true); this.toolbar.btnsInsertShape.toggle(false, true);
if ( this.toolbar.btnsInsertText.pressed ) if ( this.toolbar.btnsInsertText.pressed() )
this.toolbar.btnsInsertText.toggle(false, true); this.toolbar.btnsInsertText.toggle(false, true);
$(document.body).off('mouseup', checkInsertAutoshape); $(document.body).off('mouseup', checkInsertAutoshape);
@ -1338,9 +1338,9 @@ define([
me.api.put_Table(value.columns, value.rows); me.api.put_Table(value.columns, value.rows);
} }
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
Common.component.Analytics.trackEvent('ToolBar', 'Table'); Common.component.Analytics.trackEvent('ToolBar', 'Table');
} }
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
} }
})).show(); })).show();
} }
@ -1384,12 +1384,12 @@ define([
if ( status == 'begin' ) { if ( status == 'begin' ) {
this._addAutoshape(true, 'textRect'); this._addAutoshape(true, 'textRect');
if ( !this.toolbar.btnsInsertText.pressed ) if ( !this.toolbar.btnsInsertText.pressed() )
this.toolbar.btnsInsertText.toggle(true, true); this.toolbar.btnsInsertText.toggle(true, true);
} else } else
this._addAutoshape(false, 'textRect'); this._addAutoshape(false, 'textRect');
if ( this.toolbar.btnsInsertShape.pressed ) if ( this.toolbar.btnsInsertShape.pressed() )
this.toolbar.btnsInsertShape.toggle(false, true); this.toolbar.btnsInsertShape.toggle(false, true);
Common.NotificationCenter.trigger('edit:complete', this.toolbar); Common.NotificationCenter.trigger('edit:complete', this.toolbar);
@ -1399,7 +1399,7 @@ define([
onInsertShape: function (type) { onInsertShape: function (type) {
var me = this; var me = this;
if ( type == 'menu:hide' ) { if ( type == 'menu:hide' ) {
if ( me.toolbar.btnsInsertShape.pressed && !me._isAddingShape ) { if ( me.toolbar.btnsInsertShape.pressed() && !me._isAddingShape ) {
me.toolbar.btnsInsertShape.toggle(false, true); me.toolbar.btnsInsertShape.toggle(false, true);
} }
me._isAddingShape = false; me._isAddingShape = false;
@ -1409,7 +1409,7 @@ define([
me._addAutoshape(true, type); me._addAutoshape(true, type);
me._isAddingShape = true; me._isAddingShape = true;
if ( me.toolbar.btnsInsertText.pressed ) if ( me.toolbar.btnsInsertText.pressed() )
me.toolbar.btnsInsertText.toggle(false, true); me.toolbar.btnsInsertText.toggle(false, true);
Common.NotificationCenter.trigger('edit:complete', me.toolbar); Common.NotificationCenter.trigger('edit:complete', me.toolbar);
@ -1423,7 +1423,7 @@ define([
me.toolbar.fireEvent('inserttextart', me.toolbar); me.toolbar.fireEvent('inserttextart', me.toolbar);
me.api.AddTextArt(data); me.api.AddTextArt(data);
if ( me.toolbar.btnsInsertShape.pressed ) if ( me.toolbar.btnsInsertShape.pressed() )
me.toolbar.btnsInsertShape.toggle(false, true); me.toolbar.btnsInsertShape.toggle(false, true);
Common.NotificationCenter.trigger('edit:complete', me.toolbar); Common.NotificationCenter.trigger('edit:complete', me.toolbar);
@ -1776,10 +1776,10 @@ define([
if (record) if (record)
me.api.asc_AddMath(record.get('data').equationType); me.api.asc_AddMath(record.get('data').equationType);
if (me.toolbar.btnsInsertText.pressed) { if (me.toolbar.btnsInsertText.pressed()) {
me.toolbar.btnsInsertText.toggle(false, true); me.toolbar.btnsInsertText.toggle(false, true);
} }
if (me.toolbar.btnsInsertShape.pressed) { if (me.toolbar.btnsInsertShape.pressed()) {
me.toolbar.btnsInsertShape.toggle(false, true); me.toolbar.btnsInsertShape.toggle(false, true);
} }
@ -2076,6 +2076,15 @@ define([
} }
me.toolbar.render(_.extend({compactview: compactview}, config)); me.toolbar.render(_.extend({compactview: compactview}, config));
if ( config.isEdit ) {
var tab = {action: 'review', caption: me.toolbar.textTabCollaboration};
var $panel = PE.getController('Common.Controllers.ReviewChanges').createToolbarPanel();
if ( $panel ) {
me.toolbar.addTab(tab, $panel, 3);
}
}
}, },
onAppReady: function (config) { onAppReady: function (config) {

View file

@ -8,6 +8,7 @@
<li id="fm-btn-save-desktop" class="fm-btn" /> <li id="fm-btn-save-desktop" class="fm-btn" />
<li id="fm-btn-print" class="fm-btn" /> <li id="fm-btn-print" class="fm-btn" />
<li id="fm-btn-rename" class="fm-btn" /> <li id="fm-btn-rename" class="fm-btn" />
<li id="fm-btn-protect" class="fm-btn" />
<li class="devider" /> <li class="devider" />
<li id="fm-btn-recent" class="fm-btn" /> <li id="fm-btn-recent" class="fm-btn" />
<li id="fm-btn-create" class="fm-btn" /> <li id="fm-btn-create" class="fm-btn" />
@ -29,4 +30,5 @@
<div id="panel-rights" class="content-box" /> <div id="panel-rights" class="content-box" />
<div id="panel-settings" class="content-box" /> <div id="panel-settings" class="content-box" />
<div id="panel-help" class="content-box" /> <div id="panel-help" class="content-box" />
<div id="panel-protect" class="content-box" />
</div> </div>

View file

@ -14,6 +14,8 @@
</div> </div>
<div id="id-textart-settings" class="settings-panel"> <div id="id-textart-settings" class="settings-panel">
</div> </div>
<div id="id-signature-settings" class="settings-panel">
</div>
</div> </div>
<div class="tool-menu-btns"> <div class="tool-menu-btns">
<div class="ct-btn-category arrow-left" /> <div class="ct-btn-category arrow-left" />
@ -24,5 +26,6 @@
<button id="id-right-menu-table" class="btn btn-category arrow-left" content-target="id-table-settings"><i class="icon img-toolbarmenu btn-menu-table">&nbsp;</i></button> <button id="id-right-menu-table" class="btn btn-category arrow-left" content-target="id-table-settings"><i class="icon img-toolbarmenu btn-menu-table">&nbsp;</i></button>
<button id="id-right-menu-chart" class="btn btn-category arrow-left" content-target="id-chart-settings"><i class="icon img-toolbarmenu btn-menu-chart">&nbsp;</i></button> <button id="id-right-menu-chart" class="btn btn-category arrow-left" content-target="id-chart-settings"><i class="icon img-toolbarmenu btn-menu-chart">&nbsp;</i></button>
<button id="id-right-menu-textart" class="btn btn-category arrow-left" content-target="id-textart-settings"><i class="icon img-toolbarmenu btn-menu-textart">&nbsp;</i></button> <button id="id-right-menu-textart" class="btn btn-category arrow-left" content-target="id-textart-settings"><i class="icon img-toolbarmenu btn-menu-textart">&nbsp;</i></button>
<button id="id-right-menu-signature" class="btn btn-category arrow-left hidden" content-target="id-signature-settings"><i class="icon img-toolbarmenu btn-menu-signature">&nbsp;</i></button>
</div> </div>
</div> </div>

View file

@ -0,0 +1,19 @@
<table cols="2">
<tr>
<td class="padding-large">
<label style="font-size: 18px;"><%= scope.strSignature %></label>
</td>
</tr>
<tr>
<td class="padding-large">
<button id="signature-invisible-sign" class="btn btn-text-default" style="width:100%;"><%= scope.strInvisibleSign %></button>
</td>
</tr>
<tr id="signature-valid-sign">
<td></td>
</tr>
<tr id="signature-invalid-sign">
<td></td>
</tr>
<tr class="finish-cell"></tr>
</table>

View file

@ -38,6 +38,7 @@ define([
'common/main/lib/util/utils', 'common/main/lib/util/utils',
'common/main/lib/component/Menu', 'common/main/lib/component/Menu',
'common/main/lib/view/CopyWarningDialog', 'common/main/lib/view/CopyWarningDialog',
'common/main/lib/view/SignDialog',
'presentationeditor/main/app/view/HyperlinkSettingsDialog', 'presentationeditor/main/app/view/HyperlinkSettingsDialog',
// 'common/main/lib/view/InsertTableDialog', // 'common/main/lib/view/InsertTableDialog',
'presentationeditor/main/app/view/ParagraphSettingsAdvanced', 'presentationeditor/main/app/view/ParagraphSettingsAdvanced',
@ -292,6 +293,10 @@ define([
$('ul.dropdown-menu', me.currentMenu.el).focus(); $('ul.dropdown-menu', me.currentMenu.el).focus();
} }
} }
if (key == Common.UI.Keys.ESC) {
Common.UI.Menu.Manager.hideAll();
Common.NotificationCenter.trigger('leftmenu:change', 'hide');
}
} }
}; };
@ -678,6 +683,36 @@ define([
} }
}; };
var onSignatureClick = function(guid, width, height) {
if (_.isUndefined(me.fontStore)) {
me.fontStore = new Common.Collections.Fonts();
var fonts = PE.getController('Toolbar').getView('Toolbar').cmbFontName.store.toJSON();
var arr = [];
_.each(fonts, function(font, index){
if (!font.cloneid) {
arr.push(_.clone(font));
}
});
me.fontStore.add(arr);
}
var win = new Common.Views.SignDialog({
api: me.api,
signType: 'visible',
fontStore: me.fontStore,
signSize: {width: width, height: height},
handler: function(dlg, result) {
if (result == 'ok') {
var props = dlg.getSettings();
me.api.asc_Sign(props.certificateId, guid, props.images[0], props.images[1]);
}
me.fireEvent('editcomplete', me);
}
});
win.show();
};
var onTextLanguage = function(langid) { var onTextLanguage = function(langid) {
me._currLang.id = langid; me._currLang.id = langid;
}; };
@ -1486,6 +1521,65 @@ define([
me._state.themeLock = false; me._state.themeLock = false;
}; };
var onShowSpecialPasteOptions = function(specialPasteShowOptions) {
var coord = specialPasteShowOptions.asc_getCellCoord(),
pasteContainer = me.cmpEl.find('#special-paste-container'),
pasteItems = specialPasteShowOptions.asc_getOptions();
// Prepare menu container
if (pasteContainer.length < 1) {
me._arrSpecialPaste = [];
me._arrSpecialPaste[Asc.c_oSpecialPasteProps.paste] = me.textPaste;
me._arrSpecialPaste[Asc.c_oSpecialPasteProps.keepTextOnly] = me.txtKeepTextOnly;
pasteContainer = $('<div id="special-paste-container" style="position: absolute;"><div id="id-document-holder-btn-special-paste"></div></div>');
me.cmpEl.append(pasteContainer);
me.btnSpecialPaste = new Common.UI.Button({
cls : 'btn-toolbar',
iconCls : 'btn-paste',
menu : new Common.UI.Menu({items: []})
});
me.btnSpecialPaste.render($('#id-document-holder-btn-special-paste')) ;
}
if (pasteItems.length>0) {
var menu = me.btnSpecialPaste.menu;
for (var i = 0; i < menu.items.length; i++) {
menu.removeItem(menu.items[i]);
i--;
}
var group_prev = -1;
_.each(pasteItems, function(menuItem, index) {
var mnu = new Common.UI.MenuItem({
caption: me._arrSpecialPaste[menuItem],
value: menuItem,
checkable: true,
toggleGroup : 'specialPasteGroup'
}).on('click', function(item, e) {
me.api.asc_SpecialPaste(item.value);
setTimeout(function(){menu.hide();}, 100);
});
menu.addItem(mnu);
});
(menu.items.length>0) && menu.items[0].setChecked(true, true);
}
if (coord.asc_getX()<0 || coord.asc_getY()<0) {
if (pasteContainer.is(':visible')) pasteContainer.hide();
} else {
var showPoint = [coord.asc_getX() + coord.asc_getWidth() + 3, coord.asc_getY() + coord.asc_getHeight() + 3];
pasteContainer.css({left: showPoint[0], top : showPoint[1]});
pasteContainer.show();
}
};
var onHideSpecialPasteOptions = function() {
var pasteContainer = me.cmpEl.find('#special-paste-container');
if (pasteContainer.is(':visible'))
pasteContainer.hide();
};
this.setApi = function(o) { this.setApi = function(o) {
me.api = o; me.api = o;
@ -1507,6 +1601,9 @@ define([
me.api.asc_registerCallback('asc_onDialogAddHyperlink', _.bind(onDialogAddHyperlink, me)); me.api.asc_registerCallback('asc_onDialogAddHyperlink', _.bind(onDialogAddHyperlink, me));
me.api.asc_registerCallback('asc_doubleClickOnChart', onDoubleClickOnChart); me.api.asc_registerCallback('asc_doubleClickOnChart', onDoubleClickOnChart);
me.api.asc_registerCallback('asc_onSpellCheckVariantsFound', _.bind(onSpellCheckVariantsFound, me)); me.api.asc_registerCallback('asc_onSpellCheckVariantsFound', _.bind(onSpellCheckVariantsFound, me));
me.api.asc_registerCallback('asc_onShowSpecialPasteOptions', _.bind(onShowSpecialPasteOptions, me));
me.api.asc_registerCallback('asc_onHideSpecialPasteOptions', _.bind(onHideSpecialPasteOptions, me));
} }
me.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(onCoAuthoringDisconnect, me)); me.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(onCoAuthoringDisconnect, me));
Common.NotificationCenter.on('api:disconnect', _.bind(onCoAuthoringDisconnect, me)); Common.NotificationCenter.on('api:disconnect', _.bind(onCoAuthoringDisconnect, me));
@ -1518,6 +1615,7 @@ define([
me.api.asc_registerCallback('asc_onUpdateThemeIndex', _.bind(onApiUpdateThemeIndex, me)); me.api.asc_registerCallback('asc_onUpdateThemeIndex', _.bind(onApiUpdateThemeIndex, me));
me.api.asc_registerCallback('asc_onLockDocumentTheme', _.bind(onApiLockDocumentTheme, me)); me.api.asc_registerCallback('asc_onLockDocumentTheme', _.bind(onApiLockDocumentTheme, me));
me.api.asc_registerCallback('asc_onUnLockDocumentTheme', _.bind(onApiUnLockDocumentTheme, me)); me.api.asc_registerCallback('asc_onUnLockDocumentTheme', _.bind(onApiUnLockDocumentTheme, me));
me.api.asc_registerCallback('asc_onSignatureClick', _.bind(onSignatureClick, me));
} }
return me; return me;
@ -1901,7 +1999,7 @@ define([
el : $('#id-docholder-menu-changeslide'), el : $('#id-docholder-menu-changeslide'),
parentMenu : mnuChangeSlide.menu, parentMenu : mnuChangeSlide.menu,
showLast: false, showLast: false,
restoreHeight: 300, // restoreHeight: 300,
style: 'max-height: 300px;', style: 'max-height: 300px;',
store : PE.getCollection('SlideLayouts'), store : PE.getCollection('SlideLayouts'),
itemTemplate: _.template([ itemTemplate: _.template([
@ -1935,7 +2033,7 @@ define([
me.slideThemeMenu = new Common.UI.DataView({ me.slideThemeMenu = new Common.UI.DataView({
el : $('#id-docholder-menu-changetheme'), el : $('#id-docholder-menu-changetheme'),
parentMenu : mnuChangeTheme.menu, parentMenu : mnuChangeTheme.menu,
restoreHeight: 300, // restoreHeight: 300,
style: 'max-height: 300px;', style: 'max-height: 300px;',
store : PE.getCollection('SlideThemes'), store : PE.getCollection('SlideThemes'),
itemTemplate: _.template([ itemTemplate: _.template([
@ -1982,9 +2080,9 @@ define([
if (me.api) { if (me.api) {
me.api.SplitCell(value.columns, value.rows); me.api.SplitCell(value.columns, value.rows);
} }
me.fireEvent('editcomplete', me);
Common.component.Analytics.trackEvent('DocumentHolder', 'Table Split'); Common.component.Analytics.trackEvent('DocumentHolder', 'Table Split');
} }
me.fireEvent('editcomplete', me);
} }
})).show(); })).show();
} }
@ -3281,7 +3379,10 @@ define([
langText: 'Select Language', langText: 'Select Language',
textUndo: 'Undo', textUndo: 'Undo',
txtSlideHide: 'Hide Slide', txtSlideHide: 'Hide Slide',
txtChangeTheme: 'Change Theme' txtChangeTheme: 'Change Theme',
txtKeepTextOnly: 'Keep text only',
txtPastePicture: 'Picture',
txtPasteSourceFormat: 'Keep Source formatting'
}, PE.Views.DocumentHolder || {})); }, PE.Views.DocumentHolder || {}));
}); });

View file

@ -227,10 +227,18 @@ define([
} }
} }
); );
this.previewControls = $(this.el).find('.preview-controls');
$(document).on("webkitfullscreenchange mozfullscreenchange fullscreenchange MSFullscreenChange",function(){ $(document).on("webkitfullscreenchange mozfullscreenchange fullscreenchange MSFullscreenChange",function(){
var fselem = (document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement ); var fselem = (document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement );
me.btnFullScreen.cmpEl.toggleClass('fullscreen', fselem !== undefined && fselem !== null); me.btnFullScreen.cmpEl.toggleClass('fullscreen', fselem !== undefined && fselem !== null);
setTimeout( function() {
me.previewControls.css('display', '');
me.$el.css('cursor', '');
},100);
if (Common.Utils.isIE) { // for tooltips in IE if (Common.Utils.isIE) { // for tooltips in IE
me.btnFullScreen.updateHint( fselem ? '' : me.txtFullScreen); me.btnFullScreen.updateHint( fselem ? '' : me.txtFullScreen);
me.btnPrev.updateHint( fselem ? '' : me.txtPrev); me.btnPrev.updateHint( fselem ? '' : me.txtPrev);
@ -242,18 +250,17 @@ define([
}); });
if (Common.Utils.isIE) { if (Common.Utils.isIE) {
el.find('.preview-controls').css('opacity', '0.4'); me.previewControls.css('opacity', '0.4');
} }
this.separatorFullScreen = el.find('.separator.fullscreen'); this.separatorFullScreen = el.find('.separator.fullscreen');
var controls = $(this.el).find('.preview-controls'); me.previewControls.on('mouseenter', function(e) {
controls.on('mouseenter', function(e) {
clearTimeout(me.timerMove); clearTimeout(me.timerMove);
controls.addClass('over'); me.previewControls.addClass('over');
}); });
controls.on('mouseleave', function(e) { me.previewControls.on('mouseleave', function(e) {
controls.removeClass('over'); me.previewControls.removeClass('over');
}); });
}, },
@ -274,18 +281,17 @@ define([
} }
var me = this; var me = this;
var controls = $(this.el).find('.preview-controls'); me.previewControls.css('display', 'none');
controls.css('display', 'none');
me.$el.css('cursor', 'none'); me.$el.css('cursor', 'none');
setTimeout(function(){ setTimeout(function(){
me.$el.on('mousemove', function() { me.$el.on('mousemove', function() {
clearTimeout(me.timerMove); clearTimeout(me.timerMove);
controls.css('display', ''); me.previewControls.css('display', '');
me.$el.css('cursor', ''); me.$el.css('cursor', '');
if (!controls.hasClass('over')) if (!me.previewControls.hasClass('over'))
me.timerMove = setTimeout(function () { me.timerMove = setTimeout(function () {
controls.css('display', 'none'); me.previewControls.css('display', 'none');
me.$el.css('cursor', 'none'); me.$el.css('cursor', 'none');
}, 3000); }, 3000);
@ -374,6 +380,8 @@ define([
fullScreen: function(element) { fullScreen: function(element) {
if (this.mode.isDesktopApp || Common.Utils.isIE11) return; if (this.mode.isDesktopApp || Common.Utils.isIE11) return;
if (element) { if (element) {
this.previewControls.css('display', 'none');
this.$el.css('cursor', 'none');
if(element.requestFullscreen) { if(element.requestFullscreen) {
element.requestFullscreen(); element.requestFullscreen();
} else if(element.webkitRequestFullscreen) { } else if(element.webkitRequestFullscreen) {
@ -388,6 +396,8 @@ define([
fullScreenCancel: function () { fullScreenCancel: function () {
if (this.mode.isDesktopApp || Common.Utils.isIE11) return; if (this.mode.isDesktopApp || Common.Utils.isIE11) return;
this.previewControls.css('display', 'none');
this.$el.css('cursor', 'none');
if(document.cancelFullScreen) { if(document.cancelFullScreen) {
document.cancelFullScreen(); document.cancelFullScreen();
} else if(document.webkitCancelFullScreen ) { } else if(document.webkitCancelFullScreen ) {

View file

@ -164,6 +164,12 @@ define([
this.miSaveAs, this.miSaveAs,
this.miPrint, this.miPrint,
this.miRename, this.miRename,
new Common.UI.MenuItem({
el : $('#fm-btn-protect',this.el),
action : 'protect',
caption : this.btnProtectCaption,
canFocused: false
}),
this.miRecent, this.miRecent,
this.miNew, this.miNew,
new Common.UI.MenuItem({ new Common.UI.MenuItem({
@ -228,7 +234,8 @@ define([
applyMode: function() { applyMode: function() {
this.miPrint[this.mode.canPrint?'show':'hide'](); this.miPrint[this.mode.canPrint?'show':'hide']();
this.miRename[(this.mode.canRename && !this.mode.isDesktopApp) ?'show':'hide'](); this.miRename[(this.mode.canRename && !this.mode.isDesktopApp) ?'show':'hide']();
this.miRename.$el.find('+.devider')[!this.mode.isDisconnected?'show':'hide'](); this.items[7][(this.mode.canProtect) ?'show':'hide']();
this.items[7].$el.find('+.devider')[!this.mode.isDisconnected?'show':'hide']();
this.miRecent[this.mode.canOpenRecent?'show':'hide'](); this.miRecent[this.mode.canOpenRecent?'show':'hide']();
this.miNew[this.mode.canCreateNew?'show':'hide'](); this.miNew[this.mode.canCreateNew?'show':'hide']();
this.miNew.$el.find('+.devider')[this.mode.canCreateNew?'show':'hide'](); this.miNew.$el.find('+.devider')[this.mode.canCreateNew?'show':'hide']();
@ -264,8 +271,10 @@ define([
} }
} }
if (this.mode.targetApp == 'desktop') { if (this.mode.canProtect) {
this.$el.find('#fm-btn-create, #fm-btn-back, #fm-btn-create+.devider').hide(); this.$el.find('#fm-btn-create, #fm-btn-back, #fm-btn-create+.devider').hide();
this.panels['protect'] = (new PE.Views.FileMenuPanels.ProtectDoc({menu:this})).render();
this.panels['protect'].setMode(this.mode);
} }
this.panels['help'].setLangConfig(this.mode.lang); this.panels['help'].setLangConfig(this.mode.lang);
@ -288,6 +297,7 @@ define([
setApi: function(api) { setApi: function(api) {
this.api = api; this.api = api;
if (this.panels['protect']) this.panels['protect'].setApi(api);
this.api.asc_registerCallback('asc_onDocumentName', _.bind(this.onDocumentName, this)); this.api.asc_registerCallback('asc_onDocumentName', _.bind(this.onDocumentName, this));
}, },
@ -354,6 +364,7 @@ define([
btnSettingsCaption : 'Advanced Settings...', btnSettingsCaption : 'Advanced Settings...',
btnSaveAsCaption : 'Save as', btnSaveAsCaption : 'Save as',
btnRenameCaption : 'Rename...', btnRenameCaption : 'Rename...',
btnCloseMenuCaption : 'Close Menu' btnCloseMenuCaption : 'Close Menu',
btnProtectCaption: 'Protect\\Sign'
}, PE.Views.FileMenu || {})); }, PE.Views.FileMenu || {}));
}); });

View file

@ -296,43 +296,36 @@ define([
}, },
updateSettings: function() { updateSettings: function() {
this.chSpell.setValue(Common.localStorage.getBool("pe-settings-spellcheck", true)); this.chSpell.setValue(Common.Utils.InternalSettings.get("pe-settings-spellcheck"));
this.chInputMode.setValue(Common.localStorage.getBool("pe-settings-inputmode")); this.chInputMode.setValue(Common.Utils.InternalSettings.get("pe-settings-inputmode"));
Common.Utils.isChrome && this.chInputSogou.setValue(Common.localStorage.getBool("pe-settings-inputsogou")); Common.Utils.isChrome && this.chInputSogou.setValue(Common.Utils.InternalSettings.get("pe-settings-inputsogou"));
var value = Common.localStorage.getItem("pe-settings-zoom"); var value = Common.Utils.InternalSettings.get("pe-settings-zoom");
value = (value!==null) ? parseInt(value) : (this.mode.customization && this.mode.customization.zoom ? parseInt(this.mode.customization.zoom) : -1); value = (value!==null) ? parseInt(value) : (this.mode.customization && this.mode.customization.zoom ? parseInt(this.mode.customization.zoom) : -1);
var item = this.cmbZoom.store.findWhere({value: value}); var item = this.cmbZoom.store.findWhere({value: value});
this.cmbZoom.setValue(item ? parseInt(item.get('value')) : (value>0 ? value+'%' : 100)); this.cmbZoom.setValue(item ? parseInt(item.get('value')) : (value>0 ? value+'%' : 100));
/** coauthoring begin **/ /** coauthoring begin **/
value = Common.localStorage.getItem("pe-settings-coauthmode"); var fast_coauth = Common.Utils.InternalSettings.get("pe-settings-coauthmode");
if (value===null && !Common.localStorage.itemExists("pe-settings-autosave") && item = this.cmbCoAuthMode.store.findWhere({value: fast_coauth ? 1 : 0});
this.mode.customization && this.mode.customization.autosave===false)
value = 0; // use customization.autosave only when pe-settings-coauthmode and pe-settings-autosave are null
var fast_coauth = (value===null || parseInt(value) == 1) && !(this.mode.isDesktopApp && this.mode.isOffline) && this.mode.canCoAuthoring;
item = this.cmbCoAuthMode.store.findWhere({value: parseInt(value)});
this.cmbCoAuthMode.setValue(item ? item.get('value') : 1); this.cmbCoAuthMode.setValue(item ? item.get('value') : 1);
this.lblCoAuthMode.text(item ? item.get('descValue') : this.strCoAuthModeDescFast); this.lblCoAuthMode.text(item ? item.get('descValue') : this.strCoAuthModeDescFast);
/** coauthoring end **/ /** coauthoring end **/
value = Common.localStorage.getItem("pe-settings-unit"); value = Common.Utils.InternalSettings.get("pe-settings-unit");
item = this.cmbUnit.store.findWhere({value: parseInt(value)}); item = this.cmbUnit.store.findWhere({value: value});
this.cmbUnit.setValue(item ? parseInt(item.get('value')) : Common.Utils.Metric.getDefaultMetric()); this.cmbUnit.setValue(item ? parseInt(item.get('value')) : Common.Utils.Metric.getDefaultMetric());
this._oldUnits = this.cmbUnit.getValue(); this._oldUnits = this.cmbUnit.getValue();
value = Common.localStorage.getItem("pe-settings-autosave"); value = Common.Utils.InternalSettings.get("pe-settings-autosave");
if (value===null && this.mode.customization && this.mode.customization.autosave===false) this.chAutosave.setValue(value == 1);
value = 0;
this.chAutosave.setValue(fast_coauth || (value===null ? this.mode.canCoAuthoring : parseInt(value) == 1));
if (this.mode.canForcesave) { if (this.mode.canForcesave) {
this.chForcesave.setValue(Common.localStorage.getBool("pe-settings-forcesave", this.mode.canForcesave)); this.chForcesave.setValue(Common.Utils.InternalSettings.get("pe-settings-forcesave"));
} }
this.chAlignGuides.setValue(Common.localStorage.getBool("pe-settings-showsnaplines", true)); this.chAlignGuides.setValue(Common.Utils.InternalSettings.get("pe-settings-showsnaplines"));
}, },
applySettings: function() { applySettings: function() {
@ -340,6 +333,7 @@ define([
Common.localStorage.setItem("pe-settings-inputmode", this.chInputMode.isChecked() ? 1 : 0); Common.localStorage.setItem("pe-settings-inputmode", this.chInputMode.isChecked() ? 1 : 0);
Common.Utils.isChrome && Common.localStorage.setItem("pe-settings-inputsogou", this.chInputSogou.isChecked() ? 1 : 0); Common.Utils.isChrome && Common.localStorage.setItem("pe-settings-inputsogou", this.chInputSogou.isChecked() ? 1 : 0);
Common.localStorage.setItem("pe-settings-zoom", this.cmbZoom.getValue()); Common.localStorage.setItem("pe-settings-zoom", this.cmbZoom.getValue());
Common.Utils.InternalSettings.set("pe-settings-zoom", Common.localStorage.getItem("pe-settings-zoom"));
/** coauthoring begin **/ /** coauthoring begin **/
if (this.mode.isEdit && !this.mode.isOffline && this.mode.canCoAuthoring) { if (this.mode.isEdit && !this.mode.isOffline && this.mode.canCoAuthoring) {
Common.localStorage.setItem("pe-settings-coauthmode", this.cmbCoAuthMode.getValue()); Common.localStorage.setItem("pe-settings-coauthmode", this.cmbCoAuthMode.getValue());
@ -349,7 +343,8 @@ define([
Common.localStorage.setItem("pe-settings-autosave", this.chAutosave.isChecked() ? 1 : 0); Common.localStorage.setItem("pe-settings-autosave", this.chAutosave.isChecked() ? 1 : 0);
if (this.mode.canForcesave) if (this.mode.canForcesave)
Common.localStorage.setItem("pe-settings-forcesave", this.chForcesave.isChecked() ? 1 : 0); Common.localStorage.setItem("pe-settings-forcesave", this.chForcesave.isChecked() ? 1 : 0);
Common.localStorage.setItem("pe-settings-showsnaplines", this.chAlignGuides.isChecked() ? 1 : 0); Common.Utils.InternalSettings.set("pe-settings-showsnaplines", this.chAlignGuides.isChecked());
Common.localStorage.save(); Common.localStorage.save();
if (this.menu) { if (this.menu) {
@ -670,6 +665,8 @@ define([
}); });
} }
Common.NotificationCenter.on('collaboration:sharing', _.bind(this.changeAccessRights, this));
return this; return this;
}, },
@ -866,4 +863,102 @@ define([
} }
} }
}); });
PE.Views.FileMenuPanels.ProtectDoc = Common.UI.BaseView.extend(_.extend({
el: '#panel-protect',
menu: undefined,
template: _.template([
'<label id="id-fms-lbl-sign-header" style="font-size: 18px;"><%= scope.strProtect %></label>',
'<button id="fms-btn-invisible-sign" class="btn btn-text-default" style="min-width:190px;"><%= scope.strInvisibleSign %></button>',
'<div id="id-fms-valid-sign"></div>',
'<div id="id-fms-invalid-sign"></div>'
].join('')),
initialize: function(options) {
Common.UI.BaseView.prototype.initialize.call(this,arguments);
this.menu = options.menu;
this.templateValid = _.template([
'<label class="header <% if (signatures.length<1) { %>hidden<% } %>"><%= header %></label>',
'<table>',
'<% _.each(signatures, function(item) { %>',
'<tr>',
'<td><%= Common.Utils.String.htmlEncode(item.name) %></td>',
'<td><%= Common.Utils.String.htmlEncode(item.date) %></td>',
'</tr>',
'<% }); %>',
'</table>'
].join(''));
},
render: function() {
$(this.el).html(this.template({scope: this}));
this.btnAddInvisibleSign = new Common.UI.Button({
el: '#fms-btn-invisible-sign'
});
this.btnAddInvisibleSign.on('click', _.bind(this.addInvisibleSign, this));
this.lblSignHeader = $('#id-fms-lbl-sign-header', this.$el);
this.cntValidSign = $('#id-fms-valid-sign');
this.cntInvalidSign = $('#id-fms-invalid-sign');
if (_.isUndefined(this.scroller)) {
this.scroller = new Common.UI.Scroller({
el: $(this.el),
suppressScrollX: true
});
}
return this;
},
show: function() {
Common.UI.BaseView.prototype.show.call(this,arguments);
this.updateSignatures();
},
setMode: function(mode) {
this.mode = mode;
if (!this.mode.isEdit) {
this.btnAddInvisibleSign.setVisible(false);
this.lblSignHeader.html(this.strSignature);
}
},
setApi: function(o) {
this.api = o;
return this;
},
addInvisibleSign: function() {
if (this.menu)
this.menu.fireEvent('signature:invisible', [this.menu]);
},
updateSignatures: function(){
var valid = this.api.asc_getSignatures(),
valid_arr = [], invalid_arr = [];
_.each(valid, function(item, index){
var sign = {name: item.asc_getSigner1(), date: '18/05/2017'};
(item.asc_getValid()==0) ? valid_arr.push(sign) : invalid_arr.push(sign);
});
this.cntValidSign.html(this.templateValid({signatures: valid_arr, header: this.strValid}));
this.cntInvalidSign.html(this.templateValid({signatures: invalid_arr, header: this.strInvalid}));
// this.cntValidSign.html(this.templateValid({signatures: [{name: 'Hammish Mitchell', date: '18/05/2017'}, {name: 'Someone Somewhere', date: '18/05/2017'}], header: this.strValid}));
// this.cntInvalidSign.html(this.templateValid({signatures: [{name: 'Mary White', date: '18/05/2017'}, {name: 'John Black', date: '18/05/2017'}], header: this.strInvalid}));
},
strProtect: 'Protect Document',
strInvisibleSign: 'Add invisible digital signature',
strValid: 'Valid signatures',
strInvalid: 'Invalid signatures',
strSignature: 'Signature'
}, PE.Views.FileMenuPanels.ProtectDoc || {}));
}); });

View file

@ -127,8 +127,11 @@ define([
this.btnOriginalSize.on('click', _.bind(this.setOriginalSize, this)); this.btnOriginalSize.on('click', _.bind(this.setOriginalSize, this));
this.btnInsertFromFile.on('click', _.bind(function(btn){ this.btnInsertFromFile.on('click', _.bind(function(btn){
if (this._isFromFile) return;
this._isFromFile = true;
if (this.api) this.api.ChangeImageFromFile(); if (this.api) this.api.ChangeImageFromFile();
this.fireEvent('editcomplete', this); this.fireEvent('editcomplete', this);
this._isFromFile = false;
}, this)); }, this));
this.btnInsertFromUrl.on('click', _.bind(this.insertFromUrl, this)); this.btnInsertFromUrl.on('click', _.bind(this.insertFromUrl, this));
this.btnEditObject.on('click', _.bind(function(btn){ this.btnEditObject.on('click', _.bind(function(btn){

View file

@ -282,7 +282,7 @@ define([
} }
if (this.mode.canChat) { if (this.mode.canChat) {
this.panelChat['hide'](); this.panelChat['hide']();
this.btnChat.toggle(false, true); this.btnChat.toggle(false);
} }
} }
/** coauthoring end **/ /** coauthoring end **/

View file

@ -56,6 +56,7 @@ define([
'presentationeditor/main/app/view/ShapeSettings', 'presentationeditor/main/app/view/ShapeSettings',
'presentationeditor/main/app/view/SlideSettings', 'presentationeditor/main/app/view/SlideSettings',
'presentationeditor/main/app/view/TextArtSettings', 'presentationeditor/main/app/view/TextArtSettings',
'presentationeditor/main/app/view/SignatureSettings',
'common/main/lib/component/Scroller' 'common/main/lib/component/Scroller'
], function (menuTemplate, $, _, Backbone) { ], function (menuTemplate, $, _, Backbone) {
'use strict'; 'use strict';
@ -143,7 +144,7 @@ define([
return this; return this;
}, },
render: function () { render: function (mode) {
var el = $(this.el); var el = $(this.el);
this.trigger('render:before', this); this.trigger('render:before', this);
@ -178,6 +179,21 @@ define([
this.shapeSettings = new PE.Views.ShapeSettings(); this.shapeSettings = new PE.Views.ShapeSettings();
this.textartSettings = new PE.Views.TextArtSettings(); this.textartSettings = new PE.Views.TextArtSettings();
if (mode && mode.canProtect) {
this.btnSignature = new Common.UI.Button({
hint: this.txtSignatureSettings,
asctype: Common.Utils.documentSettingsType.Signature,
enableToggle: true,
disabled: true,
toggleGroup: 'tabpanelbtnsGroup'
});
this._settings[Common.Utils.documentSettingsType.Signature] = {panel: "id-signature-settings", btn: this.btnSignature};
this.btnSignature.el = $('#id-right-menu-signature'); this.btnSignature.render().setVisible(true);
this.btnSignature.on('click', _.bind(this.onBtnMenuClick, this));
this.signatureSettings = new PE.Views.SignatureSettings();
}
if (_.isUndefined(this.scroller)) { if (_.isUndefined(this.scroller)) {
this.scroller = new Common.UI.Scroller({ this.scroller = new Common.UI.Scroller({
el: $(this.el).find('.right-panel'), el: $(this.el).find('.right-panel'),
@ -206,6 +222,7 @@ define([
this.tableSettings.setApi(api).on('editcomplete', _.bind( fire, this)); this.tableSettings.setApi(api).on('editcomplete', _.bind( fire, this));
this.shapeSettings.setApi(api).on('editcomplete', _.bind( fire, this)); this.shapeSettings.setApi(api).on('editcomplete', _.bind( fire, this));
this.textartSettings.setApi(api).on('editcomplete', _.bind( fire, this)); this.textartSettings.setApi(api).on('editcomplete', _.bind( fire, this));
if (this.signatureSettings) this.signatureSettings.setApi(api).on('editcomplete', _.bind( fire, this));
}, },
setMode: function(mode) { setMode: function(mode) {
@ -299,6 +316,7 @@ define([
txtShapeSettings: 'Shape Settings', txtShapeSettings: 'Shape Settings',
txtTextArtSettings: 'Text Art Settings', txtTextArtSettings: 'Text Art Settings',
txtSlideSettings: 'Slide Settings', txtSlideSettings: 'Slide Settings',
txtChartSettings: 'Chart Settings' txtChartSettings: 'Chart Settings',
txtSignatureSettings: 'Signature Settings'
}, PE.Views.RightMenu || {})); }, PE.Views.RightMenu || {}));
}); });

View file

@ -892,7 +892,8 @@ define([
// border colors // border colors
var stroke = props.get_stroke(), var stroke = props.get_stroke(),
strokeType = stroke.get_type(), strokeType = stroke.get_type(),
borderType; borderType,
update = (this._state.StrokeColor == 'transparent' && this.BorderColor.Color !== 'transparent'); // border color was changed for shape without line and then shape was reselected (or apply other settings)
if (stroke) { if (stroke) {
if ( strokeType == Asc.c_oAscStrokeType.STROKE_COLOR ) { if ( strokeType == Asc.c_oAscStrokeType.STROKE_COLOR ) {
@ -918,7 +919,7 @@ define([
type1 = typeof(this.BorderColor.Color); type1 = typeof(this.BorderColor.Color);
type2 = typeof(this._state.StrokeColor); type2 = typeof(this._state.StrokeColor);
if ( (type1 !== type2) || (type1=='object' && if ( update || (type1 !== type2) || (type1=='object' &&
(this.BorderColor.Color.effectValue!==this._state.StrokeColor.effectValue || this._state.StrokeColor.color.indexOf(this.BorderColor.Color.color)<0)) || (this.BorderColor.Color.effectValue!==this._state.StrokeColor.effectValue || this._state.StrokeColor.color.indexOf(this.BorderColor.Color.color)<0)) ||
(type1!='object' && (this._state.StrokeColor.indexOf(this.BorderColor.Color)<0 || typeof(this.btnBorderColor.color)=='object'))) { (type1!='object' && (this._state.StrokeColor.indexOf(this.BorderColor.Color)<0 || typeof(this.btnBorderColor.color)=='object'))) {
@ -1114,7 +1115,7 @@ define([
this.fillControls.push(this.btnInsertFromUrl); this.fillControls.push(this.btnInsertFromUrl);
this.btnInsertFromFile.on('click', _.bind(function(btn){ this.btnInsertFromFile.on('click', _.bind(function(btn){
if (this.api) this.api.ChangeShapeImageFromFile(); if (this.api) this.api.ChangeShapeImageFromFile(this.BlipFillType);
this.fireEvent('editcomplete', this); this.fireEvent('editcomplete', this);
}, this)); }, this));
this.btnInsertFromUrl.on('click', _.bind(this.insertFromUrl, this)); this.btnInsertFromUrl.on('click', _.bind(this.insertFromUrl, this));

View file

@ -0,0 +1,208 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
/**
* SignatureSettings.js
*
* Created by Julia Radzhabova on 5/24/17
* Copyright (c) 2017 Ascensio System SIA. All rights reserved.
*
*/
define([
'text!presentationeditor/main/app/template/SignatureSettings.template',
'jquery',
'underscore',
'backbone',
'common/main/lib/component/Button',
'common/main/lib/view/SignDialog'
], function (menuTemplate, $, _, Backbone) {
'use strict';
PE.Views.SignatureSettings = Backbone.View.extend(_.extend({
el: '#id-signature-settings',
// Compile our stats template
template: _.template(menuTemplate),
// Delegated events for creating new items, and clearing completed ones.
events: {
},
options: {
alias: 'SignatureSettings'
},
initialize: function () {
var me = this;
this._initSettings = true;
this._state = {
DisabledControls: false,
validSignatures: undefined,
invalidSignatures: undefined
};
this._locked = false;
this.lockedControls = [];
this._noApply = false;
this._originalProps = null;
this.templateValid = _.template([
'<td class="padding-large <% if (signatures.length<1) { %>hidden<% } %>"">',
'<table class="<% if (signatures.length<1) { %>hidden<% } %>" style="width:100%">',
'<tr><td colspan="2" class="padding-large"><label class="header"><%= header %></label></td></tr>',
'<% _.each(signatures, function(item) { %>',
'<tr>',
'<td><div style="overflow: hidden; max-height: 15px;"><%= Common.Utils.String.htmlEncode(item.name) %></div></td>',
'<td rowspan="2" style="padding: 0 5px; vertical-align: top; text-align: right;"><label class="link-solid signature-view-link" data-value="<%= item.guid %>">' + this.strView + '</label></td>',
'</tr>',
'<tr><td style="padding-bottom: 3px;"><%= Common.Utils.String.htmlEncode(item.date) %></td></tr>',
'<% }); %>',
'</table>',
'</td>'
].join(''));
this.render();
},
render: function () {
this.$el.html(this.template({
scope: this
}));
this.btnAddInvisibleSign = new Common.UI.Button({
el: this.$el.find('#signature-invisible-sign')
});
this.btnAddInvisibleSign.on('click', _.bind(this.addInvisibleSign, this));
this.lockedControls.push(this.btnAddInvisibleSign);
this.cntValidSign = $('#signature-valid-sign');
this.cntInvalidSign = $('#signature-invalid-sign');
this.$el.on('click', '.signature-view-link', _.bind(this.onViewSignature, this));
},
setApi: function(api) {
this.api = api;
if (this.api) {
this.api.asc_registerCallback('asc_onUpdateSignatures', _.bind(this.onUpdateSignatures, this));
}
return this;
},
createDelayedControls: function() {
this._initSettings = false;
},
ChangeSettings: function(props) {
if (this._initSettings)
this.createDelayedControls();
if (!this._state.validSignatures || !this._state.invalidSignatures) {
this.onUpdateSignatures(this.api.asc_getSignatures());
}
this.disableControls(this._locked);
},
setLocked: function (locked) {
this._locked = locked;
},
disableControls: function(disable) {
if (this._initSettings) return;
if (this._state.DisabledControls!==disable) {
this._state.DisabledControls = disable;
_.each(this.lockedControls, function(item) {
item.setDisabled(disable);
});
this.$linksSign.toggleClass('disabled', disable);
this.$linksView.toggleClass('disabled', disable);
}
},
setMode: function(mode) {
this.mode = mode;
},
onUpdateSignatures: function(valid){
var me = this;
me._state.validSignatures = [];
me._state.invalidSignatures = [];
_.each(valid, function(item, index){
var sign = {name: item.asc_getSigner1(), guid: item.asc_getId(), date: '18/05/2017'};
(item.asc_getValid()==0) ? me._state.validSignatures.push(sign) : me._state.invalidSignatures.push(sign);
});
this.cntValidSign.html(this.templateValid({signatures: me._state.validSignatures, header: this.strValid}));
this.cntInvalidSign.html(this.templateValid({signatures: me._state.invalidSignatures, header: this.strInvalid}));
// this.cntValidSign.html(this.templateValid({signatures: [{name: 'Hammish Mitchell', guid: '123', date: '18/05/2017'}, {name: 'Someone Somewhere', guid: '345', date: '18/05/2017'}], header: this.strValid}));
// this.cntInvalidSign.html(this.templateValid({signatures: [{name: 'Mary White', guid: '111', date: '18/05/2017'}, {name: 'John Black', guid: '456', date: '18/05/2017'}], header: this.strInvalid}));
this.$linksView = $('.signature-view-link', this.$el);
},
addInvisibleSign: function(btn) {
var me = this,
win = new Common.Views.SignDialog({
api: me.api,
signType: 'invisible',
handler: function(dlg, result) {
if (result == 'ok') {
var props = dlg.getSettings();
me.api.asc_Sign(props.certificateId);
}
me.fireEvent('editcomplete', me);
}
});
win.show();
},
onViewSignature: function(event) {
var target = $(event.currentTarget);
if (target.hasClass('disabled')) return;
this.api.asc_ViewCertificate(target.attr('data-value'));
},
strSignature: 'Signature',
strInvisibleSign: 'Add invisible digital signature',
strValid: 'Valid signatures',
strInvalid: 'Invalid signatures',
strView: 'View'
}, PE.Views.SignatureSettings || {}));
});

View file

@ -655,7 +655,7 @@ define([
el: $('#slide-button-from-file') el: $('#slide-button-from-file')
}); });
this.btnInsertFromFile.on('click', _.bind(function(btn){ this.btnInsertFromFile.on('click', _.bind(function(btn){
if (this.api) this.api.ChangeSlideImageFromFile(); if (this.api) this.api.ChangeSlideImageFromFile(this.BlipFillType);
this.fireEvent('editcomplete', this); this.fireEvent('editcomplete', this);
}, this)); }, this));
this.FillItems.push(this.btnInsertFromFile); this.FillItems.push(this.btnInsertFromFile);

View file

@ -224,6 +224,11 @@ define([
} }
}, },
onPrimary: function() {
this._handleInput('ok');
return false;
},
setSettings: function (type, pagewitdh, pageheight) { setSettings: function (type, pagewitdh, pageheight) {
this.spnWidth.setValue(Common.Utils.Metric.fnRecalcFromMM(pagewitdh), true); this.spnWidth.setValue(Common.Utils.Metric.fnRecalcFromMM(pagewitdh), true);
this.spnHeight.setValue(Common.Utils.Metric.fnRecalcFromMM(pageheight), true); this.spnHeight.setValue(Common.Utils.Metric.fnRecalcFromMM(pageheight), true);

View file

@ -107,6 +107,11 @@ define([
} }
}, },
onPrimary: function() {
this._handleInput('ok');
return false;
},
setSettings: function (loop) { setSettings: function (loop) {
this.chLoop.setValue(loop); this.chLoop.setValue(loop);
}, },

View file

@ -209,8 +209,8 @@ define([
if (me.api) { if (me.api) {
me.api.SplitCell(value.columns, value.rows); me.api.SplitCell(value.columns, value.rows);
} }
me.fireEvent('editcomplete', me);
} }
me.fireEvent('editcomplete', me);
} }
})).show(); })).show();
}, },

View file

@ -871,7 +871,8 @@ define([
// border colors // border colors
var stroke = shapeprops.asc_getLine(), var stroke = shapeprops.asc_getLine(),
strokeType = (stroke) ? stroke.get_type() : null, strokeType = (stroke) ? stroke.get_type() : null,
borderType; borderType,
update = (this._state.StrokeColor == 'transparent' && this.BorderColor.Color !== 'transparent'); // border color was changed for shape without line and then shape was reselected (or apply other settings)
if (stroke) { if (stroke) {
if ( strokeType == Asc.c_oAscStrokeType.STROKE_COLOR ) { if ( strokeType == Asc.c_oAscStrokeType.STROKE_COLOR ) {
@ -896,7 +897,7 @@ define([
type1 = typeof(this.BorderColor.Color); type1 = typeof(this.BorderColor.Color);
type2 = typeof(this._state.StrokeColor); type2 = typeof(this._state.StrokeColor);
if ( (type1 !== type2) || (type1=='object' && if ( update || (type1 !== type2) || (type1=='object' &&
(this.BorderColor.Color.effectValue!==this._state.StrokeColor.effectValue || this._state.StrokeColor.color.indexOf(this.BorderColor.Color.color)<0)) || (this.BorderColor.Color.effectValue!==this._state.StrokeColor.effectValue || this._state.StrokeColor.color.indexOf(this.BorderColor.Color.color)<0)) ||
(type1!='object' && (this._state.StrokeColor.indexOf(this.BorderColor.Color)<0 || typeof(this.btnBorderColor.color)=='object'))) { (type1!='object' && (this._state.StrokeColor.indexOf(this.BorderColor.Color)<0 || typeof(this.btnBorderColor.color)=='object'))) {
@ -1104,7 +1105,7 @@ define([
this.lockedControls.push(this.btnInsertFromUrl); this.lockedControls.push(this.btnInsertFromUrl);
this.btnInsertFromFile.on('click', _.bind(function(btn){ this.btnInsertFromFile.on('click', _.bind(function(btn){
if (this.api) this.api.ChangeArtImageFromFile(); if (this.api) this.api.ChangeArtImageFromFile(this.BlipFillType);
this.fireEvent('editcomplete', this); this.fireEvent('editcomplete', this);
}, this)); }, this));
this.btnInsertFromUrl.on('click', _.bind(this.insertFromUrl, this)); this.btnInsertFromUrl.on('click', _.bind(this.insertFromUrl, this));

View file

@ -610,8 +610,8 @@ define([
lock : [_set.themeLock, _set.slideDeleted, _set.lostConnect, _set.noSlides, _set.disableOnStart], lock : [_set.themeLock, _set.slideDeleted, _set.lostConnect, _set.noSlides, _set.disableOnStart],
menu : new Common.UI.Menu({ menu : new Common.UI.Menu({
items : [], items : [],
maxHeight : 600, maxHeight : 560,
restoreHeight: 600 restoreHeight: 560
}).on('show:before', function(mnu) { }).on('show:before', function(mnu) {
this.scroller = new Common.UI.Scroller({ this.scroller = new Common.UI.Scroller({
el: $(this.el).find('.dropdown-menu '), el: $(this.el).find('.dropdown-menu '),
@ -619,23 +619,6 @@ define([
minScrollbarLength : 40, minScrollbarLength : 40,
alwaysVisibleY: true alwaysVisibleY: true
}); });
}).on('show:after', function(btn, e) {
var mnu = $(this.el).find('.dropdown-menu '),
docH = Common.Utils.innerHeight(),
menuH = mnu.outerHeight(),
top = parseInt(mnu.css('top'));
if (menuH > docH) {
mnu.css('max-height', (docH - parseInt(mnu.css('padding-top')) - parseInt(mnu.css('padding-bottom'))-5) + 'px');
this.scroller.update({minScrollbarLength : 40});
} else if ( mnu.height() < this.options.restoreHeight ) {
mnu.css('max-height', (Math.min(docH - parseInt(mnu.css('padding-top')) - parseInt(mnu.css('padding-bottom'))-5, this.options.restoreHeight)) + 'px');
menuH = mnu.outerHeight();
if (top+menuH > docH) {
mnu.css('top', 0);
}
this.scroller.update({minScrollbarLength : 40});
}
}) })
}); });
me.slideOnlyControls.push(me.btnColorSchemas); me.slideOnlyControls.push(me.btnColorSchemas);
@ -932,16 +915,6 @@ define([
this.fireEvent('render:after', [this]); this.fireEvent('render:after', [this]);
Common.UI.Mixtbar.prototype.afterRender.call(this); Common.UI.Mixtbar.prototype.afterRender.call(this);
me.$tabs.parent().on('click', '.ribtab', function (e) {
var tab = $(e.target).data('tab');
if (tab == 'file') {
me.fireEvent('file:open');
} else
if ( me.isTabActive('file') )
me.fireEvent('file:close');
me.setTab(tab);
});
Common.NotificationCenter.on({ Common.NotificationCenter.on({
'window:resize': function() { 'window:resize': function() {
@ -956,6 +929,21 @@ define([
return this; return this;
}, },
onTabClick: function (e) {
var tab = $(e.target).data('tab'),
me = this;
if ( !me.isTabActive(tab) ) {
if ( tab == 'file' ) {
me.fireEvent('file:open');
} else
if ( me.isTabActive('file') )
me.fireEvent('file:close');
}
Common.UI.Mixtbar.prototype.onTabClick.apply(this, arguments);
},
rendererComponents: function (html) { rendererComponents: function (html) {
var $host = $(html); var $host = $(html);
var _injectComponent = function (id, cmp) { var _injectComponent = function (id, cmp) {
@ -1484,8 +1472,8 @@ define([
if (mnuColorSchema == null) { if (mnuColorSchema == null) {
mnuColorSchema = new Common.UI.Menu({ mnuColorSchema = new Common.UI.Menu({
maxHeight: 600, maxHeight: 560,
restoreHeight: 600 restoreHeight: 560
}).on('render:after', function (mnu) { }).on('render:after', function (mnu) {
this.scroller = new Common.UI.Scroller({ this.scroller = new Common.UI.Scroller({
el: $(this.el).find('.dropdown-menu '), el: $(this.el).find('.dropdown-menu '),
@ -1855,7 +1843,8 @@ define([
textTabHome: 'Home', textTabHome: 'Home',
textTabInsert: 'Insert', textTabInsert: 'Insert',
textSurface: 'Surface', textSurface: 'Surface',
textShowPresenterView: 'Show presenter view' textShowPresenterView: 'Show presenter view',
textTabCollaboration: 'Collaboration'
} }
}()), PE.Views.Toolbar || {})); }()), PE.Views.Toolbar || {}));
}); });

View file

@ -123,7 +123,7 @@ define([
}, },
applyEditorMode: function() { applyEditorMode: function() {
PE.getController('RightMenu').getView('RightMenu').render(); PE.getController('RightMenu').getView('RightMenu').render(this.mode);
if ( Common.localStorage.getBool('pe-hidden-status') ) if ( Common.localStorage.getBool('pe-hidden-status') )
PE.getController('Statusbar').getView('Statusbar').setVisible(false); PE.getController('Statusbar').getView('Statusbar').setVisible(false);

View file

@ -146,6 +146,7 @@ require([
/** coauthoring end **/ /** coauthoring end **/
,'Common.Controllers.Plugins' ,'Common.Controllers.Plugins'
,'Common.Controllers.ExternalDiagramEditor' ,'Common.Controllers.ExternalDiagramEditor'
,'Common.Controllers.ReviewChanges'
] ]
}); });
@ -176,6 +177,7 @@ require([
'common/main/lib/controller/Plugins', 'common/main/lib/controller/Plugins',
'presentationeditor/main/app/view/ChartSettings', 'presentationeditor/main/app/view/ChartSettings',
'common/main/lib/controller/ExternalDiagramEditor' 'common/main/lib/controller/ExternalDiagramEditor'
,'common/main/lib/controller/ReviewChanges'
], function() { ], function() {
window.compareVersions = true; window.compareVersions = true;
app.start(); app.start();

View file

@ -126,6 +126,71 @@
"Common.Views.RenameDialog.okButtonText": "Ok", "Common.Views.RenameDialog.okButtonText": "Ok",
"Common.Views.RenameDialog.textName": "File name", "Common.Views.RenameDialog.textName": "File name",
"Common.Views.RenameDialog.txtInvalidName": "The file name cannot contain any of the following characters: ", "Common.Views.RenameDialog.txtInvalidName": "The file name cannot contain any of the following characters: ",
"Common.Views.ReviewChanges.hintNext": "To next change",
"Common.Views.ReviewChanges.hintPrev": "To previous change",
"Common.Views.ReviewChanges.tipAcceptCurrent": "Accept current change",
"Common.Views.ReviewChanges.tipRejectCurrent": "Reject current change",
"Common.Views.ReviewChanges.tipReview": "Track changes",
"Common.Views.ReviewChanges.tipReviewView": "Select the mode you want the changes to be displayed",
"Common.Views.ReviewChanges.tipSetDocLang": "Set document language",
"Common.Views.ReviewChanges.tipSetSpelling": "Spell checking",
"Common.Views.ReviewChanges.txtAccept": "Accept",
"Common.Views.ReviewChanges.txtAcceptAll": "Accept All Changes",
"Common.Views.ReviewChanges.txtAcceptChanges": "Accept changes",
"Common.Views.ReviewChanges.txtAcceptCurrent": "Accept Current Change",
"Common.Views.ReviewChanges.txtClose": "Close",
"Common.Views.ReviewChanges.txtDocLang": "Language",
"Common.Views.ReviewChanges.txtFinal": "All changes like accept (Preview)",
"Common.Views.ReviewChanges.txtMarkup": "Text with changes (Editing)",
"Common.Views.ReviewChanges.txtNext": "Next",
"Common.Views.ReviewChanges.txtOriginal": "Text without changes (Preview)",
"Common.Views.ReviewChanges.txtMarkupCap": "Markup",
"Common.Views.ReviewChanges.txtFinalCap": "Final",
"Common.Views.ReviewChanges.txtOriginalCap": "Original",
"Common.Views.ReviewChanges.txtPrev": "Previous",
"Common.Views.ReviewChanges.txtReject": "Reject",
"Common.Views.ReviewChanges.txtRejectAll": "Reject All Changes",
"Common.Views.ReviewChanges.txtRejectChanges": "Reject changes",
"Common.Views.ReviewChanges.txtRejectCurrent": "Reject Current Change",
"Common.Views.ReviewChanges.txtSpelling": "Spell Checking",
"Common.Views.ReviewChanges.txtTurnon": "Track Changes",
"Common.Views.ReviewChanges.txtView": "Display Mode",
"Common.Views.ReviewChanges.txtSharing": "Sharing",
"Common.Views.ReviewChanges.tipSharing": "Manage document access rights",
"Common.Views.ReviewChanges.txtCoAuthMode": "Co-editing Mode",
"Common.Views.ReviewChanges.tipCoAuthMode": "Set co-editing mode",
"Common.Views.ReviewChanges.strFast": "Fast",
"Common.Views.ReviewChanges.strStrict": "Strict",
"Common.Views.ReviewChanges.strFastDesc": "Real-time co-editing. All changes are saved automatically.",
"Common.Views.ReviewChanges.strStrictDesc": "Use the 'Save' button to sync the changes you and others make.",
"Common.Views.ReviewChanges.txtHistory": "Version History",
"Common.Views.ReviewChanges.tipHistory": "Show version history",
"Common.Views.SignDialog.textTitle": "Sign Document",
"Common.Views.SignDialog.textPurpose": "Purpose for signing this document",
"Common.Views.SignDialog.textCertificate": "Certificate",
"Common.Views.SignDialog.textValid": "Valid from %1 to %2",
"Common.Views.SignDialog.textChange": "Change",
"Common.Views.SignDialog.cancelButtonText": "Cancel",
"Common.Views.SignDialog.okButtonText": "Ok",
"Common.Views.SignDialog.textInputName": "Input signer name",
"Common.Views.SignDialog.textUseImage": "or click 'Select Image' to use a picture as signature",
"Common.Views.SignDialog.textSelectImage": "Select Image",
"Common.Views.SignDialog.textSignature": "Signature looks as",
"Common.Views.SignDialog.tipFontName": "Font Name",
"Common.Views.SignDialog.tipFontSize": "Font Size",
"Common.Views.SignDialog.textBold": "Bold",
"Common.Views.SignDialog.textItalic": "Italic",
"Common.Views.SignSettingsDialog.textInfo": "Signer Info",
"Common.Views.SignSettingsDialog.textInfoName": "Name",
"Common.Views.SignSettingsDialog.textInfoTitle": "Signer Title",
"Common.Views.SignSettingsDialog.textInfoEmail": "E-mail",
"Common.Views.SignSettingsDialog.textInstructions": "Instructions for Signer",
"Common.Views.SignSettingsDialog.cancelButtonText": "Cancel",
"Common.Views.SignSettingsDialog.okButtonText": "Ok",
"Common.Views.SignSettingsDialog.txtEmpty": "This field is required",
"Common.Views.SignSettingsDialog.textAllowComment": "Allow signer to add comment in the signature dialog",
"Common.Views.SignSettingsDialog.textShowDate": "Show sign date in signature line",
"Common.Views.SignSettingsDialog.textTitle": "Signature Settings",
"PE.Controllers.LeftMenu.newDocumentTitle": "Unnamed presentation", "PE.Controllers.LeftMenu.newDocumentTitle": "Unnamed presentation",
"PE.Controllers.LeftMenu.requestEditRightsText": "Requesting editing rights...", "PE.Controllers.LeftMenu.requestEditRightsText": "Requesting editing rights...",
"PE.Controllers.LeftMenu.textNoTextFound": "The data you have been searching for could not be found. Please adjust your search options.", "PE.Controllers.LeftMenu.textNoTextFound": "The data you have been searching for could not be found. Please adjust your search options.",
@ -202,6 +267,7 @@
"PE.Controllers.Main.textTryUndoRedo": "The Undo/Redo functions are disabled for the Fast co-editing mode.<br>Click the 'Strict mode' button to switch to the Strict co-editing mode to edit the file without other users interference and send your changes only after you save them. You can switch between the co-editing modes using the editor Advanced settings.", "PE.Controllers.Main.textTryUndoRedo": "The Undo/Redo functions are disabled for the Fast co-editing mode.<br>Click the 'Strict mode' button to switch to the Strict co-editing mode to edit the file without other users interference and send your changes only after you save them. You can switch between the co-editing modes using the editor Advanced settings.",
"PE.Controllers.Main.titleLicenseExp": "License expired", "PE.Controllers.Main.titleLicenseExp": "License expired",
"PE.Controllers.Main.titleServerVersion": "Editor updated", "PE.Controllers.Main.titleServerVersion": "Editor updated",
"PE.Controllers.Main.txtAddNotes": "Click to add notes",
"PE.Controllers.Main.txtArt": "Your text here", "PE.Controllers.Main.txtArt": "Your text here",
"PE.Controllers.Main.txtBasicShapes": "Basic Shapes", "PE.Controllers.Main.txtBasicShapes": "Basic Shapes",
"PE.Controllers.Main.txtButtons": "Buttons", "PE.Controllers.Main.txtButtons": "Buttons",
@ -788,6 +854,9 @@
"PE.Views.DocumentHolder.txtUnderbar": "Bar under text", "PE.Views.DocumentHolder.txtUnderbar": "Bar under text",
"PE.Views.DocumentHolder.txtUngroup": "Ungroup", "PE.Views.DocumentHolder.txtUngroup": "Ungroup",
"PE.Views.DocumentHolder.vertAlignText": "Vertical Alignment", "PE.Views.DocumentHolder.vertAlignText": "Vertical Alignment",
"PE.Views.DocumentHolder.txtKeepTextOnly": "Keep text only",
"PE.Views.DocumentHolder.txtPastePicture": "Picture",
"PE.Views.DocumentHolder.txtPasteSourceFormat": "Keep Source formatting",
"PE.Views.DocumentPreview.goToSlideText": "Go to Slide", "PE.Views.DocumentPreview.goToSlideText": "Go to Slide",
"PE.Views.DocumentPreview.slideIndexText": "Slide {0} of {1}", "PE.Views.DocumentPreview.slideIndexText": "Slide {0} of {1}",
"PE.Views.DocumentPreview.txtClose": "Close slideshow", "PE.Views.DocumentPreview.txtClose": "Close slideshow",
@ -817,6 +886,7 @@
"PE.Views.FileMenu.btnSaveCaption": "Save", "PE.Views.FileMenu.btnSaveCaption": "Save",
"PE.Views.FileMenu.btnSettingsCaption": "Advanced Settings...", "PE.Views.FileMenu.btnSettingsCaption": "Advanced Settings...",
"PE.Views.FileMenu.btnToEditCaption": "Edit Presentation", "PE.Views.FileMenu.btnToEditCaption": "Edit Presentation",
"PE.Views.FileMenu.btnProtectCaption": "Protect\\Sign",
"PE.Views.FileMenuPanels.CreateNew.fromBlankText": "From Blank", "PE.Views.FileMenuPanels.CreateNew.fromBlankText": "From Blank",
"PE.Views.FileMenuPanels.CreateNew.fromTemplateText": "From Template", "PE.Views.FileMenuPanels.CreateNew.fromTemplateText": "From Template",
"PE.Views.FileMenuPanels.CreateNew.newDescriptionText": "Create a new blank presentation which you will be able to style and format after it is created during the editing. Or choose one of the templates to start a presentation of a certain type or purpose where some styles have already been pre-applied.", "PE.Views.FileMenuPanels.CreateNew.newDescriptionText": "Create a new blank presentation which you will be able to style and format after it is created during the editing. Or choose one of the templates to start a presentation of a certain type or purpose where some styles have already been pre-applied.",
@ -865,6 +935,11 @@
"PE.Views.FileMenuPanels.Settings.txtLast": "View Last", "PE.Views.FileMenuPanels.Settings.txtLast": "View Last",
"PE.Views.FileMenuPanels.Settings.txtPt": "Point", "PE.Views.FileMenuPanels.Settings.txtPt": "Point",
"PE.Views.FileMenuPanels.Settings.txtSpellCheck": "Spell Checking", "PE.Views.FileMenuPanels.Settings.txtSpellCheck": "Spell Checking",
"PE.Views.FileMenuPanels.ProtectDoc.strProtect": "Protect Document",
"PE.Views.FileMenuPanels.ProtectDoc.strInvisibleSign": "Add invisible digital signature",
"PE.Views.FileMenuPanels.ProtectDoc.strValid": "Valid signatures",
"PE.Views.FileMenuPanels.ProtectDoc.strInvalid": "Invalid signatures",
"PE.Views.FileMenuPanels.ProtectDoc.strSignature": "Signature",
"PE.Views.HyperlinkSettingsDialog.cancelButtonText": "Cancel", "PE.Views.HyperlinkSettingsDialog.cancelButtonText": "Cancel",
"PE.Views.HyperlinkSettingsDialog.okButtonText": "OK", "PE.Views.HyperlinkSettingsDialog.okButtonText": "OK",
"PE.Views.HyperlinkSettingsDialog.strDisplay": "Display", "PE.Views.HyperlinkSettingsDialog.strDisplay": "Display",
@ -964,6 +1039,7 @@
"PE.Views.RightMenu.txtSlideSettings": "Slide settings", "PE.Views.RightMenu.txtSlideSettings": "Slide settings",
"PE.Views.RightMenu.txtTableSettings": "Table settings", "PE.Views.RightMenu.txtTableSettings": "Table settings",
"PE.Views.RightMenu.txtTextArtSettings": "Text Art settings", "PE.Views.RightMenu.txtTextArtSettings": "Text Art settings",
"PE.Views.RightMenu.txtSignatureSettings": "Signature Settings",
"PE.Views.ShapeSettings.strBackground": "Background color", "PE.Views.ShapeSettings.strBackground": "Background color",
"PE.Views.ShapeSettings.strChange": "Change Autoshape", "PE.Views.ShapeSettings.strChange": "Change Autoshape",
"PE.Views.ShapeSettings.strColor": "Color", "PE.Views.ShapeSettings.strColor": "Color",
@ -1006,6 +1082,11 @@
"PE.Views.ShapeSettings.txtNoBorders": "No Line", "PE.Views.ShapeSettings.txtNoBorders": "No Line",
"PE.Views.ShapeSettings.txtPapyrus": "Papyrus", "PE.Views.ShapeSettings.txtPapyrus": "Papyrus",
"PE.Views.ShapeSettings.txtWood": "Wood", "PE.Views.ShapeSettings.txtWood": "Wood",
"PE.Views.SignatureSettings.strSignature": "Signature",
"PE.Views.SignatureSettings.strInvisibleSign": "Add invisible digital signature",
"PE.Views.SignatureSettings.strValid": "Valid signatures",
"PE.Views.SignatureSettings.strInvalid": "Invalid signatures",
"PE.Views.SignatureSettings.strView": "View",
"PE.Views.ShapeSettingsAdvanced.cancelButtonText": "Cancel", "PE.Views.ShapeSettingsAdvanced.cancelButtonText": "Cancel",
"PE.Views.ShapeSettingsAdvanced.okButtonText": "OK", "PE.Views.ShapeSettingsAdvanced.okButtonText": "OK",
"PE.Views.ShapeSettingsAdvanced.strColumns": "Columns", "PE.Views.ShapeSettingsAdvanced.strColumns": "Columns",
@ -1314,6 +1395,7 @@
"PE.Views.Toolbar.textTabFile": "File", "PE.Views.Toolbar.textTabFile": "File",
"PE.Views.Toolbar.textTabHome": "Home", "PE.Views.Toolbar.textTabHome": "Home",
"PE.Views.Toolbar.textTabInsert": "Insert", "PE.Views.Toolbar.textTabInsert": "Insert",
"PE.Views.Toolbar.textTabCollaboration": "Collaboration",
"PE.Views.Toolbar.textTitleError": "Error", "PE.Views.Toolbar.textTitleError": "Error",
"PE.Views.Toolbar.textUnderline": "Underline", "PE.Views.Toolbar.textUnderline": "Underline",
"PE.Views.Toolbar.textZoom": "Zoom", "PE.Views.Toolbar.textZoom": "Zoom",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 34 KiB

View file

@ -469,3 +469,31 @@
-o-transform: rotate(180deg); -o-transform: rotate(180deg);
transform: rotate(180deg); transform: rotate(180deg);
} }
#panel-protect {
#file-menu-panel & {
padding: 30px 30px;
}
button {
display: block;
width: auto;
margin-top: 20px;
}
label {
font: 12px tahoma, arial, verdana, sans-serif;
}
.header {
font-weight: bold;
margin: 30px 0 10px;
}
table {
td {
padding: 5px 5px;
}
}
}

View file

@ -26,6 +26,9 @@
/*menuTextArt*/ /*menuTextArt*/
.toolbar-btn-icon(btn-menu-textart, 57, @toolbar-icon-size); .toolbar-btn-icon(btn-menu-textart, 57, @toolbar-icon-size);
/**menuSignature*/
.toolbar-btn-icon(btn-menu-signature, 77, @toolbar-icon-size);
} }
} }

View file

@ -2,7 +2,7 @@
.toolbar { .toolbar {
&:not(.cover) { &:not(.cover) {
z-index: 101; z-index: 1001;
} }
&.masked { &.masked {
@ -353,3 +353,10 @@
display: inline-block; display: inline-block;
} }
} }
#special-paste-container {
position: absolute;
z-index: @zindex-dropdown - 20;
background-color: @gray-light;
border: 1px solid @gray;
}

View file

@ -803,6 +803,8 @@ define([
} }
} }
} else { } else {
Common.Gateway.reportWarning(id, config.msg);
config.title = this.notcriticalErrorTitle; config.title = this.notcriticalErrorTitle;
config.callback = _.bind(function(btn){ config.callback = _.bind(function(btn){
if (id == Asc.c_oAscError.ID.Warning && btn == 'ok' && (this.appOptions.canDownload || this.appOptions.canDownloadOrigin)) { if (id == Asc.c_oAscError.ID.Warning && btn == 'ok' && (this.appOptions.canDownload || this.appOptions.canDownloadOrigin)) {

View file

@ -121,6 +121,8 @@ var sdk_dev_scrpipts = [
"../../../../sdkjs/word/Editor/Paragraph/ParaTextPrChanges.js", "../../../../sdkjs/word/Editor/Paragraph/ParaTextPrChanges.js",
"../../../../sdkjs/word/Editor/Paragraph/ParaDrawing.js", "../../../../sdkjs/word/Editor/Paragraph/ParaDrawing.js",
"../../../../sdkjs/word/Editor/Paragraph/ParaDrawingChanges.js", "../../../../sdkjs/word/Editor/Paragraph/ParaDrawingChanges.js",
"../../../../sdkjs/word/Editor/Paragraph/ComplexFieldInstruction.js",
"../../../../sdkjs/word/Editor/Paragraph/ComplexField.js",
"../../../../sdkjs/word/Editor/Paragraph.js", "../../../../sdkjs/word/Editor/Paragraph.js",
"../../../../sdkjs/word/Editor/ParagraphChanges.js", "../../../../sdkjs/word/Editor/ParagraphChanges.js",
"../../../../sdkjs/word/Editor/DocumentContentBase.js", "../../../../sdkjs/word/Editor/DocumentContentBase.js",

View file

@ -404,6 +404,8 @@ var ApplicationController = new(function(){
}); });
} }
else { else {
Common.Gateway.reportWarning(id, message);
$('#id-critical-error-title').text(me.notcriticalErrorTitle); $('#id-critical-error-title').text(me.notcriticalErrorTitle);
$('#id-critical-error-message').text(message); $('#id-critical-error-message').text(message);
$('#id-critical-error-close').off(); $('#id-critical-error-close').off();

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