Merge branch 'hotfix/v5.0.7' into develop

This commit is contained in:
Julia Radzhabova 2018-01-15 16:11:11 +03:00
commit 833f9fc1b1
42 changed files with 794 additions and 73 deletions

View file

@ -60,7 +60,7 @@ define([
height : '100%',
documentType: 'spreadsheet',
document : {
url : '_offline_',
url : '_chart_',
permissions : {
edit : true,
download: false

View file

@ -60,7 +60,7 @@ define([
height : '100%',
documentType: 'spreadsheet',
document : {
url : '_offline_',
url : '_chart_',
permissions : {
edit : true,
download: false

View file

@ -194,13 +194,22 @@ define([
if ( me.$toolbarPanelPlugins ) {
me.$toolbarPanelPlugins.empty();
var _group = $('<div class="group"></div>');
var _group = $('<div class="group"></div>'),
rank = -1;
collection.each(function (model) {
var new_rank = model.get('groupRank');
if (new_rank!==rank && rank>-1) {
_group.appendTo(me.$toolbarPanelPlugins);
$('<div class="separator long"></div>').appendTo(me.$toolbarPanelPlugins);
_group = $('<div class="group"></div>');
}
var btn = me.panelPlugins.createPluginButton(model);
if (btn) {
var $slot = $('<span class="slot"></span>').appendTo(_group);
btn.render($slot);
}
rank = new_rank;
});
_group.appendTo(me.$toolbarPanelPlugins);
}

View file

@ -84,7 +84,9 @@ define([
pluginObj: undefined,
allowSelected: false,
selected: false,
visible: true
visible: true,
groupName: '',
groupRank: 0
}
}
});

View file

@ -331,6 +331,11 @@ define([
return btn;
},
hide: function () {
Common.UI.BaseView.prototype.hide.call(this,arguments);
this.fireEvent('hide', this );
},
strPlugins: 'Plugins',
textLoading: 'Loading',
textStart: 'Start',

View file

@ -443,6 +443,12 @@ define([
'</div>' +
'</section>';
function _click_turnpreview(btn, e) {
if (this.appConfig.canReview) {
Common.NotificationCenter.trigger('reviewchanges:turn', btn.pressed ? 'on' : 'off');
}
};
function setEvents() {
var me = this;
@ -471,12 +477,6 @@ define([
me.fireEvent('reviewchange:reject', [menu, item]);
});
function _click_turnpreview(btn, e) {
if (me.appConfig.canReview) {
Common.NotificationCenter.trigger('reviewchanges:turn', btn.pressed ? 'on' : 'off');
}
};
this.btnsTurnReview.forEach(function (button) {
button.on('click', _click_turnpreview.bind(me));
Common.NotificationCenter.trigger('edit:complete', me);

View file

@ -76,3 +76,7 @@ input.error {
::-ms-clear {
display: none;
}
input[type="password"] {
font-size: 16px;
}

View file

@ -301,3 +301,4 @@
.button-normal-icon(btn-img-bkwd, 27, @toolbar-big-icon-size);
.button-normal-icon(btn-img-frwd, 28, @toolbar-big-icon-size);
.button-normal-icon(btn-img-wrap, 29, @toolbar-big-icon-size);
.button-normal-icon(btn-controls, 54, @toolbar-big-icon-size);

View file

@ -72,7 +72,8 @@ define([
'hide': _.bind(this.aboutShowHide, this, true)
},
'Common.Views.Plugins': {
'plugin:open': _.bind(this.onPluginOpen, this)
'plugin:open': _.bind(this.onPluginOpen, this),
'hide': _.bind(this.onHidePlugins, this)
},
'LeftMenu': {
'comments:show': _.bind(this.commentsShowHide, this, 'show'),
@ -404,6 +405,10 @@ define([
$(this.leftMenu.btnChat.el).blur();
Common.NotificationCenter.trigger('layout:changed', 'leftmenu');
},
onHidePlugins: function() {
Common.NotificationCenter.trigger('layout:changed', 'leftmenu');
},
/** coauthoring end **/
onQuerySearch: function(d, w, opts) {

View file

@ -215,6 +215,8 @@ define([
!/area_id/.test(e.target.id) && ($(e.target).parent().find(e.relatedTarget).length<1 || e.target.localName == 'textarea') /* Check if focus in combobox goes from input to it's menu button or menu items, or from comment editing area to Ok/Cancel button */
&& (e.relatedTarget.localName != 'input' || !/form-control/.test(e.relatedTarget.className)) /* Check if focus goes to text input with class "form-control" */
&& (e.relatedTarget.localName != 'textarea' || /area_id/.test(e.relatedTarget.id))) /* Check if focus goes to textarea, but not to "area_id" */ {
if (Common.Utils.isIE && e.originalEvent && e.originalEvent.target && /area_id/.test(e.originalEvent.target.id) && (e.originalEvent.target === e.originalEvent.srcElement))
return;
me.api.asc_enableKeyEvents(true);
if (/msg-reply/.test(e.target.className))
me.dontCloseDummyComment = false;
@ -678,7 +680,7 @@ define([
case Asc.c_oAscAsyncAction['ForceSaveButton']:
clearTimeout(this._state.timerSave);
force = true;
title = (!this.appOptions.isOffline) ? this.saveTitleText : '';
title = this.saveTitleText;
text = (!this.appOptions.isOffline) ? this.saveTextText : '';
break;
@ -903,6 +905,7 @@ define([
pluginsController.setApi(me.api);
me.requestPlugins('../../../../plugins.json');
me.api.asc_registerCallback('asc_onPluginsInit', _.bind(me.updatePluginsList, me));
me.api.asc_registerCallback('asc_onPluginsReset', _.bind(me.resetPluginsList, me));
documentHolderController.setApi(me.api);
documentHolderController.createDelayedElements();
@ -954,7 +957,6 @@ define([
me.fillTextArt(me.api.asc_getTextArtPreviews());
Common.NotificationCenter.trigger('document:ready', 'main');
me.applyLicense();
}
}, 50);
@ -1074,7 +1076,7 @@ define([
this.appOptions.forcesave = this.appOptions.canForcesave;
this.appOptions.canEditComments= this.appOptions.isOffline || !(typeof (this.editorConfig.customization) == 'object' && this.editorConfig.customization.commentAuthorOnly);
this.appOptions.trialMode = params.asc_getLicenseMode();
this.appOptions.canProtect = this.appOptions.isDesktopApp && this.api.asc_isSignaturesSupport();
this.appOptions.canProtect = this.appOptions.isEdit && this.appOptions.isDesktopApp && this.api.asc_isSignaturesSupport();
if ( this.appOptions.isLightVersion ) {
this.appOptions.canUseHistory =
@ -2042,15 +2044,27 @@ define([
baseUrl : item.baseUrl,
variations: variationsArr,
currentVariation: 0,
visible: pluginVisible
visible: pluginVisible,
groupName: (item.group) ? item.group.name : '',
groupRank: (item.group) ? item.group.rank : 0
}));
});
if ( uiCustomize!==false ) // from ui customizer in editor config or desktop event
this.UICustomizePlugins = arrUI;
if ( !uiCustomize ) {
if (pluginStore) pluginStore.add(arr);
if ( !uiCustomize && pluginStore) {
arr = pluginStore.models.concat(arr);
arr.sort(function(a, b){
var rank_a = a.get('groupRank'),
rank_b = b.get('groupRank');
if (rank_a < rank_b)
return (rank_a==0) ? 1 : -1;
if (rank_a > rank_b)
return (rank_b==0) ? -1 : 1;
return 0;
});
pluginStore.reset(arr);
this.appOptions.canPlugins = !pluginStore.isEmpty();
}
} else if (!uiCustomize){
@ -2062,6 +2076,10 @@ define([
if (!uiCustomize) this.getApplication().getController('LeftMenu').enablePlugins();
},
resetPluginsList: function() {
this.getApplication().getCollection('Common.Collections.Plugins').reset();
},
leavePageText: 'You have unsaved changes in this document. Click \'Stay on this Page\' then \'Save\' to save them. Click \'Leave this Page\' to discard all the unsaved changes.',
defaultTitleText: 'ONLYOFFICE Document Editor',
criticalErrorTitle: 'Error',

View file

@ -56,7 +56,8 @@ define([
'documenteditor/main/app/view/PageSizeDialog',
'documenteditor/main/app/view/NoteSettingsDialog',
'documenteditor/main/app/controller/PageLayout',
'documenteditor/main/app/view/CustomColumnsDialog'
'documenteditor/main/app/view/CustomColumnsDialog',
'documenteditor/main/app/view/ControlSettingsDialog'
], function () {
'use strict';
@ -283,6 +284,7 @@ define([
toolbar.btnInsertText.on('click', _.bind(this.onBtnInsertTextClick, this));
toolbar.btnInsertShape.menu.on('hide:after', _.bind(this.onInsertShapeHide, this));
toolbar.btnDropCap.menu.on('item:click', _.bind(this.onDropCapSelect, this));
toolbar.btnContentControls.menu.on('item:click', _.bind(this.onControlsSelect, this));
toolbar.mnuDropCapAdvanced.on('click', _.bind(this.onDropCapAdvancedClick, this));
toolbar.btnColumns.menu.on('item:click', _.bind(this.onColumnsSelect, this));
toolbar.btnPageOrient.menu.on('item:click', _.bind(this.onPageOrientSelect, this));
@ -642,7 +644,8 @@ define([
in_chart = false,
in_equation = false,
btn_eq_state = false,
in_image = false;
in_image = false,
in_control = false;
while (++i < selectedObjects.length) {
type = selectedObjects[i].get_ObjectType();
@ -688,6 +691,19 @@ define([
}, this);
}
in_control = this.api.asc_IsContentControl();
var control_props = in_control ? this.api.asc_GetContentControlProperties() : null,
lock_type = (in_control&&control_props) ? control_props.get_Lock() : Asc.c_oAscSdtLockType.Unlocked,
control_plain = (in_control&&control_props) ? (control_props.get_ContentControlType()==Asc.c_oAscSdtLevelType.Inline) : false;
(lock_type===undefined) && (lock_type = Asc.c_oAscSdtLockType.Unlocked);
if (!paragraph_locked && !header_locked) {
toolbar.btnContentControls.menu.items[0].setDisabled(control_plain || lock_type==Asc.c_oAscSdtLockType.SdtContentLocked || lock_type==Asc.c_oAscSdtLockType.ContentLocked);
toolbar.btnContentControls.menu.items[1].setDisabled(control_plain || lock_type==Asc.c_oAscSdtLockType.SdtContentLocked || lock_type==Asc.c_oAscSdtLockType.ContentLocked);
toolbar.btnContentControls.menu.items[3].setDisabled(!in_control || lock_type==Asc.c_oAscSdtLockType.SdtContentLocked || lock_type==Asc.c_oAscSdtLockType.SdtLocked);
toolbar.btnContentControls.menu.items[5].setDisabled(!in_control);
}
var need_text_disable = paragraph_locked || header_locked || in_chart;
if (this._state.textonlycontrolsdisable != need_text_disable) {
if (this._state.activated) this._state.textonlycontrolsdisable = need_text_disable;
@ -716,22 +732,22 @@ define([
this.onDropCap(drop_value);
}
need_disable = need_disable || !enable_dropcap || in_equation;
need_disable = need_disable || !enable_dropcap || in_equation || control_plain;
toolbar.btnDropCap.setDisabled(need_disable);
if ( !toolbar.btnDropCap.isDisabled() )
toolbar.mnuDropCapAdvanced.setDisabled(disable_dropcapadv);
need_disable = !can_add_table || header_locked || in_equation;
need_disable = !can_add_table || header_locked || in_equation || control_plain;
toolbar.btnInsertTable.setDisabled(need_disable);
need_disable = toolbar.mnuPageNumCurrentPos.isDisabled() && toolbar.mnuPageNumberPosPicker.isDisabled();
need_disable = toolbar.mnuPageNumCurrentPos.isDisabled() && toolbar.mnuPageNumberPosPicker.isDisabled() || control_plain;
toolbar.mnuInsertPageNum.setDisabled(need_disable);
need_disable = paragraph_locked || header_locked || in_header || in_image || 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() || in_control;
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 || control_plain;
toolbar.btnInsertImage.setDisabled(need_disable);
toolbar.btnInsertShape.setDisabled(need_disable);
toolbar.btnInsertText.setDisabled(need_disable);
@ -742,10 +758,10 @@ define([
this._state.in_chart = in_chart;
}
need_disable = in_chart && image_locked || !in_chart && need_disable;
need_disable = in_chart && image_locked || !in_chart && need_disable || control_plain;
toolbar.btnInsertChart.setDisabled(need_disable);
need_disable = paragraph_locked || header_locked || in_chart || !can_add_image&&!in_equation;
need_disable = paragraph_locked || header_locked || in_chart || !can_add_image&&!in_equation || control_plain;
toolbar.btnInsertEquation.setDisabled(need_disable);
need_disable = paragraph_locked || header_locked || in_equation;
@ -754,11 +770,11 @@ define([
toolbar.btnEditHeader.setDisabled(in_equation);
need_disable = paragraph_locked || in_equation || in_image || in_header;
need_disable = paragraph_locked || in_equation || in_image || in_header || control_plain;
if (need_disable !== toolbar.btnNotes.isDisabled())
toolbar.btnNotes.setDisabled(need_disable);
need_disable = paragraph_locked || header_locked || in_image;
need_disable = paragraph_locked || header_locked || in_image || control_plain;
if (need_disable != toolbar.btnColumns.isDisabled())
toolbar.btnColumns.setDisabled(need_disable);
@ -1669,6 +1685,39 @@ define([
}
},
onControlsSelect: function(menu, item) {
if (item.value == 'settings' || item.value == 'remove') {
if (this.api.asc_IsContentControl()) {
var props = this.api.asc_GetContentControlProperties();
if (props) {
var id = props.get_InternalId();
if (item.value == 'settings') {
var me = this;
(new DE.Views.ControlSettingsDialog({
props: props,
handler: function(result, value) {
if (result == 'ok') {
me.api.asc_SetContentControlProperties(value, id);
}
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
}
})).show();
} else {
this.api.asc_RemoveContentControlWrapper(id);
Common.component.Analytics.trackEvent('ToolBar', 'Remove Content Control');
}
}
}
} else {
this.api.asc_AddContentControl(item.value);
Common.component.Analytics.trackEvent('ToolBar', 'Add Content Control');
}
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
},
onColumnsSelect: function(menu, item) {
if (_.isUndefined(item.value))
return;

View file

@ -138,6 +138,10 @@
<div class="group">
<span class="btn-slot text x-huge" id="slot-btn-dropcap"></span>
</div>
<div class="separator long"></div>
<div class="group">
<span class="btn-slot text x-huge" id="slot-btn-controls"></span>
</div>
</section>
<section class="panel" data-tab="layout">
<div class="group">

View file

@ -0,0 +1,212 @@
/*
*
* (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
*
*/
/**
* ControlSettingsDialog.js.js
*
* Created by Julia Radzhabova on 12.12.2017
* Copyright (c) 2017 Ascensio System SIA. All rights reserved.
*
*/
define([
'common/main/lib/util/utils',
'common/main/lib/component/CheckBox',
'common/main/lib/component/InputField',
'common/main/lib/view/AdvancedSettingsWindow'
], function () { 'use strict';
DE.Views.ControlSettingsDialog = Common.Views.AdvancedSettingsWindow.extend(_.extend({
options: {
contentWidth: 300,
height: 275
},
initialize : function(options) {
var me = this;
_.extend(this.options, {
title: this.textTitle,
template: [
'<div class="box" style="height:' + (me.options.height - 85) + 'px;">',
'<div class="content-panel" style="padding: 0 5px;"><div class="inner-content">',
'<div class="settings-panel active">',
'<table cols="1" style="width: 100%;">',
'<tr>',
'<td class="padding-large">',
'<label class="input-label">', me.textName, '</label>',
'<div id="control-settings-txt-name"></div>',
'</td>',
'</tr>',
'<tr>',
'<td class="padding-large">',
'<label class="input-label">', me.textTag, '</label>',
'<div id="control-settings-txt-tag"></div>',
'</td>',
'</tr>',
'<tr>',
'<td class="padding-small">',
'<label class="header">', me.textLock, '</label>',
'</td>',
'</tr>',
'<tr>',
'<td class="padding-small">',
'<div id="control-settings-chb-lock-delete"></div>',
'</td>',
'</tr>',
'<tr>',
'<td class="padding-small">',
'<div id="control-settings-chb-lock-edit"></div>',
'</td>',
'</tr>',
'</table>',
'</div></div>',
'</div>',
'</div>',
'<div class="footer center">',
'<button class="btn normal dlg-btn primary" result="ok" style="margin-right: 10px;">' + me.okButtonText + '</button>',
'<button class="btn normal dlg-btn" result="cancel">' + me.cancelButtonText + '</button>',
'</div>'
].join('')
}, options);
this.handler = options.handler;
this.props = options.props;
Common.Views.AdvancedSettingsWindow.prototype.initialize.call(this, this.options);
},
render: function() {
Common.Views.AdvancedSettingsWindow.prototype.render.call(this);
var me = this;
this.txtName = new Common.UI.InputField({
el : $('#control-settings-txt-name'),
allowBlank : true,
validateOnChange: false,
validateOnBlur: false,
style : 'width: 100%;',
value : ''
});
this.txtTag = new Common.UI.InputField({
el : $('#control-settings-txt-tag'),
allowBlank : true,
validateOnChange: false,
validateOnBlur: false,
style : 'width: 100%;',
value : ''
});
this.chLockDelete = new Common.UI.CheckBox({
el: $('#control-settings-chb-lock-delete'),
labelText: this.txtLockDelete
});
this.chLockEdit = new Common.UI.CheckBox({
el: $('#control-settings-chb-lock-edit'),
labelText: this.txtLockEdit
});
this.afterRender();
},
afterRender: function() {
this._setDefaults(this.props);
},
show: function() {
Common.Views.AdvancedSettingsWindow.prototype.show.apply(this, arguments);
},
_setDefaults: function (props) {
if (props) {
var val = props.get_Alias();
this.txtName.setValue(val ? val : '');
val = props.get_Tag();
this.txtTag.setValue(val ? val : '');
val = props.get_Lock();
(val===undefined) && (val = Asc.c_oAscSdtLockType.Unlocked);
this.chLockDelete.setValue(val==Asc.c_oAscSdtLockType.SdtContentLocked || val==Asc.c_oAscSdtLockType.SdtLocked);
this.chLockEdit.setValue(val==Asc.c_oAscSdtLockType.SdtContentLocked || val==Asc.c_oAscSdtLockType.ContentLocked);
}
},
getSettings: function () {
var props = new AscCommon.CContentControlPr();
props.put_Alias(this.txtName.getValue());
props.put_Tag(this.txtTag.getValue());
var lock = Asc.c_oAscSdtLockType.Unlocked;
if (this.chLockDelete.getValue()=='checked' && this.chLockEdit.getValue()=='checked')
lock = Asc.c_oAscSdtLockType.SdtContentLocked;
else if (this.chLockDelete.getValue()=='checked')
lock = Asc.c_oAscSdtLockType.SdtLocked;
else if (this.chLockEdit.getValue()=='checked')
lock = Asc.c_oAscSdtLockType.ContentLocked;
props.put_Lock(lock);
return props;
},
onDlgBtnClick: function(event) {
var me = this;
var state = (typeof(event) == 'object') ? event.currentTarget.attributes['result'].value : event;
if (state == 'ok') {
this.handler && this.handler.call(this, state, this.getSettings());
}
this.close();
},
onPrimary: function() {
return true;
},
textTitle: 'Content Control Settings',
textName: 'Title',
textTag: 'Tag',
txtLockDelete: 'Content control cannot be deleted',
txtLockEdit: 'Contents cannot be edited',
textLock: 'Locking',
cancelButtonText: 'Cancel',
okButtonText: 'Ok'
}, DE.Views.ControlSettingsDialog || {}))
});

View file

@ -52,7 +52,8 @@ define([
'documenteditor/main/app/view/DropcapSettingsAdvanced',
'documenteditor/main/app/view/HyperlinkSettingsDialog',
'documenteditor/main/app/view/ParagraphSettingsAdvanced',
'documenteditor/main/app/view/TableSettingsAdvanced'
'documenteditor/main/app/view/TableSettingsAdvanced',
'documenteditor/main/app/view/ControlSettingsDialog'
], function ($, _, Backbone, gateway) { 'use strict';
DE.Views.DocumentHolder = Backbone.View.extend(_.extend({
@ -1793,6 +1794,28 @@ define([
me.fireEvent('editcomplete', me);
},
onControlsSelect: function(item, e) {
var props = this.api.asc_GetContentControlProperties();
if (props) {
if (item.value == 'settings') {
var me = this;
(new DE.Views.ControlSettingsDialog({
props: props,
handler: function (result, value) {
if (result == 'ok') {
me.api.asc_SetContentControlProperties(value, props.get_InternalId());
}
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
}
})).show();
} else if (item.value == 'remove') {
this.api.asc_RemoveContentControlWrapper(props.get_InternalId());
}
}
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
},
createDelayedElementsViewer: function() {
var me = this;
@ -2485,6 +2508,27 @@ define([
})
});
var menuTableRemoveControl = new Common.UI.MenuItem({
caption: me.textRemove,
value: 'remove'
}).on('click', _.bind(me.onControlsSelect, me));
var menuTableControlSettings = new Common.UI.MenuItem({
caption: me.textSettings,
value: 'settings'
}).on('click', _.bind(me.onControlsSelect, me));
var menuTableControl = new Common.UI.MenuItem({
caption: me.textContentControls,
menu : new Common.UI.Menu({
menuAlign: 'tl-tr',
items : [
menuTableRemoveControl,
menuTableControlSettings
]
})
});
/** coauthoring begin **/
var menuAddCommentTable = new Common.UI.MenuItem({
caption : me.addCommentText
@ -2744,6 +2788,14 @@ define([
} else
me.clearEquationMenu(false, 6);
menuEquationSeparatorInTable.setVisible(isEquation && eqlen>0);
var in_control = me.api.asc_IsContentControl();
menuTableControl.setVisible(in_control);
if (in_control) {
var control_props = me.api.asc_GetContentControlProperties(),
lock_type = (control_props) ? control_props.get_Lock() : Asc.c_oAscSdtLockType.Unlocked;
menuTableRemoveControl.setDisabled(lock_type==Asc.c_oAscSdtLockType.SdtContentLocked || lock_type==Asc.c_oAscSdtLockType.SdtLocked);
}
},
items: [
me.menuSpellCheckTable,
@ -2864,6 +2916,7 @@ define([
menuAddHyperlinkTable,
menuHyperlinkTable,
menuHyperlinkSeparator,
menuTableControl,
menuParagraphAdvancedInTable
]
}).on('hide:after', function(menu, e, isFromInputControl) {
@ -3119,6 +3172,21 @@ define([
caption : '--'
});
var menuParaRemoveControl = new Common.UI.MenuItem({
caption: me.textRemoveControl,
value: 'remove'
}).on('click', _.bind(me.onControlsSelect, me));
var menuParaControlSettings = new Common.UI.MenuItem(
{
caption: me.textEditControls,
value: 'settings'
}).on('click', _.bind(me.onControlsSelect, me));
var menuParaControlSeparator = new Common.UI.MenuItem({
caption : '--'
});
this.textMenu = new Common.UI.Menu({
initMenu: function(value){
var isInShape = (value.imgProps && value.imgProps.value && !_.isNull(value.imgProps.value.get_ShapeProperties()));
@ -3219,6 +3287,16 @@ define([
if (me.mode.canEditStyles && !isInChart) {
me.menuStyleUpdate.setCaption(me.updateStyleText.replace('%1', DE.getController('Main').translationTable[window.currentStyleName] || window.currentStyleName));
}
var in_control = me.api.asc_IsContentControl();
menuParaRemoveControl.setVisible(in_control);
menuParaControlSettings.setVisible(in_control);
menuParaControlSeparator.setVisible(in_control);
if (in_control) {
var control_props = me.api.asc_GetContentControlProperties(),
lock_type = (control_props) ? control_props.get_Lock() : Asc.c_oAscSdtLockType.Unlocked;
menuParaRemoveControl.setDisabled(lock_type==Asc.c_oAscSdtLockType.SdtContentLocked || lock_type==Asc.c_oAscSdtLockType.SdtLocked);
}
},
items: [
me.menuSpellPara,
@ -3233,6 +3311,9 @@ define([
menuParaPaste,
{ caption: '--' },
menuEquationSeparator,
menuParaRemoveControl,
menuParaControlSettings,
menuParaControlSeparator,
menuParagraphBreakBefore,
menuParagraphKeepLines,
menuParagraphVAlign,
@ -3551,7 +3632,12 @@ define([
strSetup: 'Signature Setup',
strDelete: 'Remove Signature',
txtOverwriteCells: 'Overwrite cells',
textNest: 'Nest table'
textNest: 'Nest table',
textContentControls: 'Content control',
textRemove: 'Remove',
textSettings: 'Settings',
textRemoveControl: 'Remove content control',
textEditControls: 'Content control settings'
}, DE.Views.DocumentHolder || {}));
});

View file

@ -280,7 +280,7 @@ define([
}
}
if (this.mode.isDesktopApp && this.mode.isOffline) {
if (this.mode.isEdit && this.mode.isDesktopApp && this.mode.isOffline) {
// this.$el.find('#fm-btn-back').hide();
this.panels['protect'] = (new DE.Views.FileMenuPanels.ProtectDoc({menu:this})).render();
this.panels['protect'].setMode(this.mode);
@ -378,6 +378,6 @@ define([
textDownload : 'Download',
btnRenameCaption : 'Rename...',
btnCloseMenuCaption : 'Close Menu',
btnProtectCaption: 'Protect\\Sign'
btnProtectCaption: 'Protect'
}, DE.Views.FileMenu || {}));
});

View file

@ -1251,7 +1251,7 @@ define([
},
strProtect: 'Protect Document',
strSignature: 'Signature',
strSignature: 'With Signature',
txtView: 'View signatures',
txtEdit: 'Edit document',
txtSigned: 'Valid signatures has been added to the document. The document is protected from editing.',
@ -1259,7 +1259,7 @@ define([
txtRequestedSignatures: 'This document needs to be signed.',
notcriticalErrorTitle: 'Warning',
txtEditWarning: 'Editing will remove the signatures from the document.<br>Are you sure you want to continue?',
strEncrypt: 'Password',
strEncrypt: 'With Password',
txtEncrypted: 'This document has been protected by password'
}, DE.Views.FileMenuPanels.ProtectDoc || {}));

View file

@ -168,10 +168,12 @@ define([
var me = this,
requestedSignatures = [],
validSignatures = [],
invalidSignatures = [];
invalidSignatures = [],
name_index = 1;
_.each(requested, function(item, index){
requestedSignatures.push({name: item.asc_getSigner1(), guid: item.asc_getGuid(), requested: true});
var name = item.asc_getSigner1();
requestedSignatures.push({name: (name !== "") ? name : (me.strSigner + " " + name_index++) , guid: item.asc_getGuid(), requested: true});
});
_.each(valid, function(item, index){
var item_date = item.asc_getDate();
@ -381,7 +383,8 @@ define([
txtContinueEditing: 'Edit anyway',
notcriticalErrorTitle: 'Warning',
txtEditWarning: 'Editing will remove the signatures from the document.<br>Are you sure you want to continue?',
strDelete: 'Remove Signature'
strDelete: 'Remove Signature',
strSigner: 'Signer'
}, DE.Views.SignatureSettings || {}));
});

View file

@ -608,6 +608,40 @@ define([
});
this.paragraphControls.push(this.btnDropCap);
this.btnContentControls = new Common.UI.Button({
id: 'tlbtn-controls',
cls: 'btn-toolbar x-huge icon-top',
iconCls: 'btn-controls',
caption: me.capBtnInsControls,
menu: new Common.UI.Menu({
cls: 'ppm-toolbar',
items: [
{
caption: this.textPlainControl,
iconCls: 'mnu-control-plain',
value: Asc.c_oAscSdtLevelType.Inline
},
{
caption: this.textRichControl,
iconCls: 'mnu-control-rich',
value: Asc.c_oAscSdtLevelType.Block
},
{caption: '--'},
{
caption: this.textRemoveControl,
iconCls: 'mnu-control-remove',
value: 'remove'
},
{caption: '--'},
{
caption: this.mniEditControls,
value: 'settings'
}
]
})
});
this.paragraphControls.push(this.btnContentControls);
this.btnColumns = new Common.UI.Button({
id: 'tlbtn-columns',
cls: 'btn-toolbar x-huge icon-top',
@ -1257,6 +1291,7 @@ define([
_injectComponent('#slot-btn-instext', this.btnInsertText);
_injectComponent('#slot-btn-instextart', this.btnInsertTextArt);
_injectComponent('#slot-btn-dropcap', this.btnDropCap);
_injectComponent('#slot-btn-controls', this.btnContentControls);
_injectComponent('#slot-btn-columns', this.btnColumns);
_injectComponent('#slot-btn-inshyperlink', this.btnInsertHyperlink);
_injectComponent('#slot-btn-editheader', this.btnEditHeader);
@ -1514,6 +1549,7 @@ define([
this.btnInsertShape.updateHint(this.tipInsertShape);
this.btnInsertEquation.updateHint(this.tipInsertEquation);
this.btnDropCap.updateHint(this.tipDropCap);
this.btnContentControls.updateHint(this.tipControls);
this.btnColumns.updateHint(this.tipColumns);
this.btnPageOrient.updateHint(this.tipPageOrient);
this.btnPageSize.updateHint(this.tipPageSize);
@ -2458,7 +2494,13 @@ define([
textColumnsCustom: 'Custom Columns',
textSurface: 'Surface',
textTabCollaboration: 'Collaboration',
textTabProtect: 'Protection'
textTabProtect: 'Protection',
capBtnInsControls: 'Content Control',
textRichControl: 'Rich text',
textPlainControl: 'Plain text',
textRemoveControl: 'Remove',
mniEditControls: 'Settings',
tipControls: 'Insert content control'
}
})(), DE.Views.Toolbar || {}));
});

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View file

@ -360,6 +360,10 @@
.menu-icon-normal(mnu-orient-portrait, 36, @menu-icon-size);
.menu-icon-normal(mnu-orient-landscape, 37, @menu-icon-size);
.menu-icon-normal(mnu-control-plain, 38, @menu-icon-size);
.menu-icon-normal(mnu-control-rich, 39, @menu-icon-size);
.menu-icon-normal(mnu-control-remove, 40, @menu-icon-size);
.menu-otherstates-icon(ppm-toolbar, @menu-icon-size);

View file

@ -64,7 +64,8 @@ define([
'click:users': _.bind(this.clickStatusbarUsers, this)
},
'Common.Views.Plugins': {
'plugin:open': _.bind(this.onPluginOpen, this)
'plugin:open': _.bind(this.onPluginOpen, this),
'hide': _.bind(this.onHidePlugins, this)
},
'Common.Views.About': {
'show': _.bind(this.aboutShowHide, this, false),
@ -319,6 +320,10 @@ define([
$(this.leftMenu.btnChat.el).blur();
Common.NotificationCenter.trigger('layout:changed', 'leftmenu');
},
onHidePlugins: function() {
Common.NotificationCenter.trigger('layout:changed', 'leftmenu');
},
/** coauthoring end **/
onQuerySearch: function(d, w, opts) {

View file

@ -199,6 +199,8 @@ define([
!/area_id/.test(e.target.id) && ($(e.target).parent().find(e.relatedTarget).length<1 || e.target.localName == 'textarea') /* Check if focus in combobox goes from input to it's menu button or menu items, or from comment editing area to Ok/Cancel button */
&& (e.relatedTarget.localName != 'input' || !/form-control/.test(e.relatedTarget.className)) /* Check if focus goes to text input with class "form-control" */
&& (e.relatedTarget.localName != 'textarea' || /area_id/.test(e.relatedTarget.id))) /* Check if focus goes to textarea, but not to "area_id" */ {
if (Common.Utils.isIE && e.originalEvent && e.originalEvent.target && /area_id/.test(e.originalEvent.target.id) && (e.originalEvent.target === e.originalEvent.srcElement))
return;
me.api.asc_enableKeyEvents(true);
if (/msg-reply/.test(e.target.className))
me.dontCloseDummyComment = false;
@ -472,7 +474,7 @@ define([
case Asc.c_oAscAsyncAction['ForceSaveButton']:
clearTimeout(this._state.timerSave);
force = true;
title = (!this.appOptions.isOffline) ? this.saveTitleText : '';
title = this.saveTitleText;
text = (!this.appOptions.isOffline) ? this.saveTextText : '';
break;
@ -665,6 +667,7 @@ define([
pluginsController.setApi(me.api);
me.requestPlugins('../../../../plugins.json');
me.api.asc_registerCallback('asc_onPluginsInit', _.bind(me.updatePluginsList, me));
me.api.asc_registerCallback('asc_onPluginsReset', _.bind(me.resetPluginsList, me));
documentHolderController.setApi(me.api);
documentHolderController.createDelayedElements();
@ -720,7 +723,6 @@ define([
me.api.UpdateInterfaceState();
Common.NotificationCenter.trigger('document:ready', 'main');
me.applyLicense();
}
}, 50);
@ -837,7 +839,7 @@ define([
this.appOptions.forcesave = this.appOptions.canForcesave;
this.appOptions.canEditComments= this.appOptions.isOffline || !(typeof (this.editorConfig.customization) == 'object' && this.editorConfig.customization.commentAuthorOnly);
this.appOptions.trialMode = params.asc_getLicenseMode();
this.appOptions.canProtect = this.appOptions.isDesktopApp && this.api.asc_isSignaturesSupport();
this.appOptions.canProtect = this.appOptions.isEdit && this.appOptions.isDesktopApp && this.api.asc_isSignaturesSupport();
this.appOptions.canBranding = (licType === Asc.c_oLicenseResult.Success) && (typeof this.editorConfig.customization == 'object');
if (this.appOptions.canBranding)
@ -1799,15 +1801,27 @@ define([
baseUrl : item.baseUrl,
variations: variationsArr,
currentVariation: 0,
visible: pluginVisible
visible: pluginVisible,
groupName: (item.group) ? item.group.name : '',
groupRank: (item.group) ? item.group.rank : 0
}));
});
if (uiCustomize!==false) // from ui customizer in editor config or desktop event
this.UICustomizePlugins = arrUI;
if ( !uiCustomize ) {
if (pluginStore) pluginStore.add(arr);
if ( !uiCustomize && pluginStore) {
arr = pluginStore.models.concat(arr);
arr.sort(function(a, b){
var rank_a = a.get('groupRank'),
rank_b = b.get('groupRank');
if (rank_a < rank_b)
return (rank_a==0) ? 1 : -1;
if (rank_a > rank_b)
return (rank_b==0) ? -1 : 1;
return 0;
});
pluginStore.reset(arr);
this.appOptions.canPlugins = !pluginStore.isEmpty();
}
} else if (!uiCustomize){
@ -1819,6 +1833,10 @@ define([
if (!uiCustomize) this.getApplication().getController('LeftMenu').enablePlugins();
},
resetPluginsList: function() {
this.getApplication().getCollection('Common.Collections.Plugins').reset();
},
// Translation
leavePageText: 'You have unsaved changes in this document. Click \'Stay on this Page\' then \'Save\' to save them. Click \'Leave this Page\' to discard all the unsaved changes.',
defaultTitleText: 'ONLYOFFICE Presentation Editor',

View file

@ -277,8 +277,10 @@ define([
if (this.mode.isDesktopApp && this.mode.isOffline) {
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);
if (this.mode.isEdit) {
this.panels['protect'] = (new PE.Views.FileMenuPanels.ProtectDoc({menu:this})).render();
this.panels['protect'].setMode(this.mode);
}
}
this.panels['help'].setLangConfig(this.mode.lang);
@ -373,6 +375,6 @@ define([
btnSaveAsCaption : 'Save as',
btnRenameCaption : 'Rename...',
btnCloseMenuCaption : 'Close Menu',
btnProtectCaption: 'Protect\\Sign'
btnProtectCaption: 'Protect'
}, PE.Views.FileMenu || {}));
});

View file

@ -1014,14 +1014,14 @@ define([
},
strProtect: 'Protect Presentation',
strSignature: 'Signature',
strSignature: 'With Signature',
txtView: 'View signatures',
txtEdit: 'Edit presentation',
txtSigned: 'Valid signatures has been added to the presentation. The presentation is protected from editing.',
txtSignedInvalid: 'Some of the digital signatures in presentation are invalid or could not be verified. The presentation is protected from editing.',
notcriticalErrorTitle: 'Warning',
txtEditWarning: 'Editing will remove the signatures from the presentation.<br>Are you sure you want to continue?',
strEncrypt: 'Password',
strEncrypt: 'With Password',
txtEncrypted: 'This presentation has been protected by password'
}, PE.Views.FileMenuPanels.ProtectDoc || {}));

View file

@ -471,6 +471,25 @@
}
}
}
#panel-protect {
label, span {
font-size: 12px;
}
padding: 30px 30px;
.header {
font-weight: bold;
margin: 30px 0 10px;
}
table {
td {
padding: 5px 0;
}
}
}
}
}

View file

@ -51,7 +51,8 @@ define([
'hide': _.bind(this.onHideChat, this)
},
'Common.Views.Plugins': {
'plugin:open': _.bind(this.onPluginOpen, this)
'plugin:open': _.bind(this.onPluginOpen, this),
'hide': _.bind(this.onHidePlugins, this)
},
'Common.Views.Header': {
'click:users': _.bind(this.clickStatusbarUsers, this)
@ -356,6 +357,10 @@ define([
$(this.leftMenu.btnChat.el).blur();
Common.NotificationCenter.trigger('layout:changed', 'leftmenu');
},
onHidePlugins: function() {
Common.NotificationCenter.trigger('layout:changed', 'leftmenu');
},
/** coauthoring end **/
onQuerySearch: function(d, w, opts) {

View file

@ -214,6 +214,8 @@ define([
!/area_id/.test(e.target.id) && ($(e.target).parent().find(e.relatedTarget).length<1 || e.target.localName == 'textarea') /* Check if focus in combobox goes from input to it's menu button or menu items, or from comment editing area to Ok/Cancel button */
&& (e.relatedTarget.localName != 'input' || !/form-control/.test(e.relatedTarget.className)) /* Check if focus goes to text input with class "form-control" */
&& (e.relatedTarget.localName != 'textarea' || /area_id/.test(e.relatedTarget.id))) /* Check if focus goes to textarea, but not to "area_id" */ {
if (Common.Utils.isIE && e.originalEvent && e.originalEvent.target && /area_id/.test(e.originalEvent.target.id) && (e.originalEvent.target === e.originalEvent.srcElement))
return;
me.api.asc_enableKeyEvents(true);
if (/msg-reply/.test(e.target.className))
me.dontCloseDummyComment = false;
@ -655,7 +657,8 @@ define([
pluginsController.setApi(me.api);
me.requestPlugins('../../../../plugins.json');
me.api.asc_registerCallback('asc_onPluginsInit', _.bind(me.updatePluginsList, me));
}
me.api.asc_registerCallback('asc_onPluginsReset', _.bind(me.resetPluginsList, me));
}
leftMenuView.disableMenu('all',false);
@ -732,7 +735,6 @@ define([
toolbarController.onApiCoAuthoringDisconnect();
Common.NotificationCenter.trigger('document:ready', 'main');
me.applyLicense();
}
}, 50);
@ -859,9 +861,8 @@ define([
this.appOptions.canChat = this.appOptions.canLicense && !this.appOptions.isOffline && !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.chat===false);
this.appOptions.canRename = !!this.permissions.rename;
this.appOptions.trialMode = params.asc_getLicenseMode();
this.appOptions.canProtect = this.appOptions.isDesktopApp && this.api.asc_isSignaturesSupport();
this.appOptions.canProtect = this.appOptions.isEdit && this.appOptions.isDesktopApp && this.api.asc_isSignaturesSupport();
this.appOptions.canModifyFilter = (this.permissions.modifyFilter!==false);
this.appOptions.canBranding = (licType === Asc.c_oLicenseResult.Success) && (typeof this.editorConfig.customization == 'object');
if (this.appOptions.canBranding)
this.headerView.setBranding(this.editorConfig.customization);
@ -1990,15 +1991,27 @@ define([
baseUrl : item.baseUrl,
variations: variationsArr,
currentVariation: 0,
visible: pluginVisible
visible: pluginVisible,
groupName: (item.group) ? item.group.name : '',
groupRank: (item.group) ? item.group.rank : 0
}));
});
if (uiCustomize!==false) // from ui customizer in editor config or desktop event
this.UICustomizePlugins = arrUI;
if (!uiCustomize) {
if (pluginStore) pluginStore.add(arr);
if ( !uiCustomize && pluginStore) {
arr = pluginStore.models.concat(arr);
arr.sort(function(a, b){
var rank_a = a.get('groupRank'),
rank_b = b.get('groupRank');
if (rank_a < rank_b)
return (rank_a==0) ? 1 : -1;
if (rank_a > rank_b)
return (rank_b==0) ? -1 : 1;
return 0;
});
pluginStore.reset(arr);
this.appOptions.canPlugins = !pluginStore.isEmpty();
}
} else if (!uiCustomize){
@ -2009,7 +2022,11 @@ define([
}
if (!uiCustomize) this.getApplication().getController('LeftMenu').enablePlugins();
},
resetPluginsList: function() {
this.getApplication().getCollection('Common.Collections.Plugins').reset();
},
leavePageText: 'You have unsaved changes in this document. Click \'Stay on this Page\' then \'Save\' to save them. Click \'Leave this Page\' to discard all the unsaved changes.',
criticalErrorTitle: 'Error',
notcriticalErrorTitle: 'Warning',

View file

@ -358,6 +358,10 @@ define([
this.rightmenu.btnSignature.setDisabled(disabled);
}
if (!allowSignature && this.rightmenu.signatureSettings) {
this.rightmenu.btnSignature.setDisabled(disabled);
}
if (disabled) {
this.rightmenu.btnText.setDisabled(disabled);
this.rightmenu.btnTable.setDisabled(disabled);

View file

@ -121,6 +121,9 @@ define([
bold: undefined,
italic: undefined,
underline: undefined,
strikeout: undefined,
subscript: undefined,
superscript: undefined,
wrap: undefined,
merge: undefined,
angle: undefined,
@ -248,6 +251,9 @@ define([
toolbar.btnBold.on('click', _.bind(this.onBold, this));
toolbar.btnItalic.on('click', _.bind(this.onItalic, this));
toolbar.btnUnderline.on('click', _.bind(this.onUnderline, this));
toolbar.btnStrikeout.on('click', _.bind(this.onStrikeout, this));
toolbar.btnSubscript.on('click', _.bind(this.onSubscript, this));
toolbar.btnSubscript.menu.on('item:click', _.bind(this.onSubscriptMenu, this));
toolbar.btnTextColor.on('click', _.bind(this.onTextColor, this));
toolbar.btnBackColor.on('click', _.bind(this.onBackColor, this));
toolbar.mnuTextColorPicker.on('select', _.bind(this.onTextColorSelect, this));
@ -464,6 +470,51 @@ define([
Common.component.Analytics.trackEvent('ToolBar', 'Underline');
},
onStrikeout: function(btn, e) {
this._state.strikeout = undefined;
if (this.api)
this.api.asc_setCellStrikeout(btn.pressed);
Common.NotificationCenter.trigger('edit:complete', this.toolbar, {restorefocus:true});
Common.component.Analytics.trackEvent('ToolBar', 'Strikeout');
},
onSubscriptMenu: function(menu, item) {
var btnSubscript = this.toolbar.btnSubscript,
iconEl = $('.icon', btnSubscript.cmpEl);
if (item.value == 'sub') {
this._state.subscript = undefined;
this.api.asc_setCellSubscript(item.checked);
} else {
this._state.superscript = undefined;
this.api.asc_setCellSuperscript(item.checked);
}
if (item.checked) {
iconEl.removeClass(btnSubscript.options.icls);
btnSubscript.options.icls = item.options.icls;
iconEl.addClass(btnSubscript.options.icls);
}
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
Common.component.Analytics.trackEvent('ToolBar', (item.value == 'sub') ? 'Subscript' : 'Superscript');
},
onSubscript: function(btn, e) {
var subscript = (btn.options.icls == 'btn-subscript');
if (subscript) {
this._state.subscript = undefined;
this.api.asc_setCellSubscript(btn.pressed);
} else {
this._state.superscript = undefined;
this.api.asc_setCellSuperscript(btn.pressed);
}
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
Common.component.Analytics.trackEvent('ToolBar', (subscript) ? 'Subscript' : 'Superscript');
},
onTextColor: function() {
this.toolbar.mnuTextColorPicker.trigger('select', this.toolbar.mnuTextColorPicker, this.toolbar.mnuTextColorPicker.currentColor, true);
},
@ -1650,7 +1701,7 @@ define([
toolbar.lockToolbar(SSE.enumLock.editFormula, is_formula,
{ array: [toolbar.cmbFontName, toolbar.cmbFontSize, toolbar.btnIncFontSize, toolbar.btnDecFontSize,
toolbar.btnBold, toolbar.btnItalic, toolbar.btnUnderline, toolbar.btnTextColor]});
toolbar.btnBold, toolbar.btnItalic, toolbar.btnUnderline, toolbar.btnStrikeout, toolbar.btnSubscript, toolbar.btnTextColor]});
toolbar.lockToolbar(SSE.enumLock.editText, is_text, {array:[toolbar.btnInsertFormula]});
}
this._state.coauthdisable = undefined;
@ -1708,6 +1759,37 @@ define([
toolbar.btnUnderline.toggle(val === true, true);
this._state.underline = val;
}
val = fontobj.asc_getStrikeout();
if (this._state.strikeout !== val) {
toolbar.btnStrikeout.toggle(val === true, true);
this._state.strikeout = val;
}
var subsc = fontobj.asc_getSubscript(),
supersc = fontobj.asc_getSuperscript();
if (this._state.subscript !== subsc || this._state.superscript !== supersc) {
var index = (supersc) ? 0 : (subsc ? 1 : -1),
btnSubscript = toolbar.btnSubscript;
btnSubscript.toggle(index>-1, true);
if (index < 0) {
this._clearChecked(btnSubscript.menu);
} else {
btnSubscript.menu.items[index].setChecked(true);
if (btnSubscript.rendered) {
var iconEl = $('.icon', btnSubscript.cmpEl);
if (iconEl) {
iconEl.removeClass(btnSubscript.options.icls);
btnSubscript.options.icls = btnSubscript.menu.items[index].options.icls;
iconEl.addClass(btnSubscript.options.icls);
}
}
}
this._state.subscript = subsc;
this._state.superscript = supersc;
}
}
/* read font size */
@ -1818,6 +1900,37 @@ define([
toolbar.btnUnderline.toggle(val === true, true);
this._state.underline = val;
}
val = fontobj.asc_getStrikeout();
if (this._state.strikeout !== val) {
toolbar.btnStrikeout.toggle(val === true, true);
this._state.strikeout = val;
}
var subsc = fontobj.asc_getSubscript(),
supersc = fontobj.asc_getSuperscript();
if (this._state.subscript !== subsc || this._state.superscript !== supersc) {
var index = (supersc) ? 0 : (subsc ? 1 : -1),
btnSubscript = toolbar.btnSubscript;
btnSubscript.toggle(index>-1, true);
if (index < 0) {
this._clearChecked(btnSubscript.menu);
} else {
btnSubscript.menu.items[index].setChecked(true);
if (btnSubscript.rendered) {
var iconEl = $('.icon', btnSubscript.cmpEl);
if (iconEl) {
iconEl.removeClass(btnSubscript.options.icls);
btnSubscript.options.icls = btnSubscript.menu.items[index].options.icls;
iconEl.addClass(btnSubscript.options.icls);
}
}
}
this._state.subscript = subsc;
this._state.superscript = supersc;
}
}
/* read font color */

View file

@ -56,6 +56,8 @@
<span class="btn-slot" id="slot-btn-bold"></span>
<span class="btn-slot" id="slot-btn-italic"></span>
<span class="btn-slot" id="slot-btn-underline"></span>
<span class="btn-slot" id="slot-btn-strikeout"></span>
<span class="btn-slot split" id="slot-btn-subscript"></span>
<span class="btn-slot split" id="slot-btn-fontcolor"></span>
<span class="btn-slot split" id="slot-btn-fillparag"></span>
<span class="btn-slot split" id="slot-btn-borders"></span>

View file

@ -266,7 +266,7 @@ define([
}
}
if (this.mode.isDesktopApp && this.mode.isOffline) {
if (this.mode.isEdit && this.mode.isDesktopApp && this.mode.isOffline) {
this.panels['protect'] = (new SSE.Views.FileMenuPanels.ProtectDoc({menu:this})).render();
this.panels['protect'].setMode(this.mode);
}
@ -355,6 +355,6 @@ define([
btnSaveAsCaption : 'Save as',
btnRenameCaption : 'Rename...',
btnCloseMenuCaption : 'Close Menu',
btnProtectCaption: 'Protect\\Sign'
btnProtectCaption: 'Protect'
}, SSE.Views.FileMenu || {}));
});

View file

@ -1479,7 +1479,7 @@ define([
},
strProtect: 'Protect Workbook',
strSignature: 'Signature',
strSignature: 'With Signature',
txtView: 'View signatures',
txtEdit: 'Edit workbook',
txtSigned: 'Valid signatures has been added to the workbook. The workbook is protected from editing.',
@ -1487,7 +1487,7 @@ define([
txtRequestedSignatures: 'This workbook needs to be signed.',
notcriticalErrorTitle: 'Warning',
txtEditWarning: 'Editing will remove the signatures from the workbook.<br>Are you sure you want to continue?',
strEncrypt: 'Password',
strEncrypt: 'With Password',
txtEncrypted: 'This workbook has been protected by password'
}, SSE.Views.FileMenuPanels.ProtectDoc || {}));

View file

@ -97,7 +97,8 @@ define([
if (xhrObj && lang) {
xhrObj.open('GET', 'resources/formula-lang/' + lang + '_desc.json', false);
xhrObj.send('');
if (xhrObj.status == 200)
if (xhrObj.status==200 ||
(xhrObj.status==0 && !!xhrObj.responseURL && xhrObj.responseURL.startsWith('file://')))
langDescJson[lang] = eval("(" + xhrObj.responseText + ")");
else {
xhrObj.open('GET', 'resources/formula-lang/en_desc.json', false);

View file

@ -196,6 +196,21 @@ define([
this.signatureSettings = new SSE.Views.SignatureSettings();
}
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 SSE.Views.SignatureSettings();
}
if (_.isUndefined(this.scroller)) {
this.scroller = new Common.UI.Scroller({
el: $(this.el).find('.right-panel'),

View file

@ -168,10 +168,12 @@ define([
var me = this,
requestedSignatures = [],
validSignatures = [],
invalidSignatures = [];
invalidSignatures = [],
name_index = 1;
_.each(requested, function(item, index){
requestedSignatures.push({name: item.asc_getSigner1(), guid: item.asc_getGuid(), requested: true});
var name = item.asc_getSigner1();
requestedSignatures.push({name: (name !== "") ? name : (me.strSigner + " " + name_index++) , guid: item.asc_getGuid(), requested: true});
});
_.each(valid, function(item, index){
var item_date = item.asc_getDate();
@ -381,7 +383,8 @@ define([
txtContinueEditing: 'Edit anyway',
notcriticalErrorTitle: 'Warning',
txtEditWarning: 'Editing will remove the signatures from the workbook.<br>Are you sure you want to continue?',
strDelete: 'Remove Signature'
strDelete: 'Remove Signature',
strSigner: 'Signer'
}, SSE.Views.SignatureSettings || {}));
});

View file

@ -412,6 +412,46 @@ define([
enableToggle: true
});
me.btnStrikeout = new Common.UI.Button({
id: 'id-toolbar-btn-strikeout',
cls: 'btn-toolbar',
iconCls: 'btn-strikeout',
lock : [_set.selImage, _set.editFormula, _set.selRange, _set.coAuth, _set.coAuthText, _set.lostConnect],
enableToggle: true
});
me.btnSubscript = new Common.UI.Button({
id : 'id-toolbar-btn-subscript',
cls : 'btn-toolbar',
iconCls : 'btn-subscript',
icls : 'btn-subscript',
split : true,
enableToggle: true,
lock : [_set.selImage, _set.editFormula, _set.selRange, _set.coAuth, _set.coAuthText, _set.lostConnect],
menu : new Common.UI.Menu({
items: [
{
caption : me.textSuperscript,
iconCls : 'mnu-text-superscript',
icls : 'btn-superscript',
checkable : true,
allowDepress: true,
toggleGroup : 'textsubscriptgroup',
value : 'super'
},
{
caption : me.textSubscript,
iconCls : 'mnu-text-subscript',
icls : 'btn-subscript',
checkable : true,
allowDepress: true,
toggleGroup : 'textsubscriptgroup',
value : 'sub'
}
]
})
});
me.mnuTextColorPicker = dummyCmp();
me.btnTextColor = new Common.UI.Button({
id : 'id-toolbar-btn-fontcolor',
@ -1184,7 +1224,7 @@ define([
me.lockControls = [
me.cmbFontName, me.cmbFontSize, me.btnIncFontSize, me.btnDecFontSize, me.btnBold,
me.btnItalic, me.btnUnderline, me.btnTextColor, me.btnHorizontalAlign, me.btnAlignLeft,
me.btnItalic, me.btnUnderline, me.btnStrikeout, me.btnSubscript, me.btnTextColor, me.btnHorizontalAlign, me.btnAlignLeft,
me.btnAlignCenter,me.btnAlignRight,me.btnAlignJust, me.btnVerticalAlign, me.btnAlignTop,
me.btnAlignMiddle, me.btnAlignBottom, me.btnWrap, me.btnTextOrient, me.btnBackColor,
me.btnMerge, me.btnInsertFormula, me.btnNamedRange, me.btnIncDecimal, me.btnInsertShape, me.btnInsertEquation,
@ -1199,7 +1239,7 @@ define([
var _temp_array = [me.cmbFontName, me.cmbFontSize, me.btnAlignLeft,me.btnAlignCenter,me.btnAlignRight,me.btnAlignJust,me.btnAlignTop,
me.btnAlignMiddle, me.btnAlignBottom, me.btnHorizontalAlign, me.btnVerticalAlign,
me.btnInsertImage, me.btnInsertText, me.btnInsertTextArt, me.btnInsertShape, me.btnInsertEquation, me.btnIncFontSize,
me.btnDecFontSize, me.btnBold, me.btnItalic, me.btnUnderline, me.btnTextColor, me.btnBackColor,
me.btnDecFontSize, me.btnBold, me.btnItalic, me.btnUnderline, me.btnStrikeout, me.btnSubscript, me.btnTextColor, me.btnBackColor,
me.btnInsertHyperlink, me.btnBorders, me.btnTextOrient, me.btnPercentStyle, me.btnCurrencyStyle, me.btnColorSchemas,
me.btnSettings, me.btnInsertFormula, me.btnNamedRange, me.btnDecDecimal, me.btnIncDecimal, me.cmbNumberFormat, me.btnWrap,
me.btnInsertChart, me.btnMerge, me.btnAddCell, me.btnDeleteCell, me.btnShowMode, me.btnPrint,
@ -1298,6 +1338,8 @@ define([
_injectComponent('#slot-btn-bold', this.btnBold);
_injectComponent('#slot-btn-italic', this.btnItalic);
_injectComponent('#slot-btn-underline', this.btnUnderline);
_injectComponent('#slot-btn-strikeout', this.btnStrikeout);
_injectComponent('#slot-btn-subscript', this.btnSubscript);
_injectComponent('#slot-btn-fontcolor', this.btnTextColor);
_injectComponent('#slot-btn-fillparag', this.btnBackColor);
_injectComponent('#slot-btn-borders', this.btnBorders);
@ -1366,6 +1408,8 @@ define([
_updateHint(this.btnBold, this.textBold + Common.Utils.String.platformKey('Ctrl+B'));
_updateHint(this.btnItalic, this.textItalic + Common.Utils.String.platformKey('Ctrl+I'));
_updateHint(this.btnUnderline, this.textUnderline + Common.Utils.String.platformKey('Ctrl+U'));
_updateHint(this.btnStrikeout, this.textStrikeout);
_updateHint(this.btnSubscript, this.textSubSuperscript);
_updateHint(this.btnTextColor, this.tipFontColor);
_updateHint(this.btnBackColor, this.tipPrColor);
_updateHint(this.btnBorders, this.tipBorders);
@ -1879,6 +1923,10 @@ define([
textBold: 'Bold',
textItalic: 'Italic',
textUnderline: 'Underline',
textStrikeout: 'Strikeout',
textSuperscript: 'Superscript',
textSubscript: 'Subscript',
textSubSuperscript: 'Subscript/Superscript',
tipFontName: 'Font Name',
tipFontSize: 'Font Size',
tipCellStyle: 'Cell Style',

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View file

@ -540,6 +540,25 @@
}
}
}
#panel-protect {
label, span {
font-size: 12px;
}
padding: 30px 30px;
.header {
font-weight: bold;
margin: 30px 0 10px;
}
table {
td {
padding: 5px 0;
}
}
}
}
}

View file

@ -332,7 +332,7 @@ button:active:not(.disabled) .btn-change-shape {background-position: -56px -
background-position: -150px -300px;
}
#table-combo-template .combo-dataview{
#table-combo-template .combo-dataview {
.combo-template(60px);
}

View file

@ -30,7 +30,7 @@
}
.font-attr-top {
width: 186px;
width: 243px;
> .btn-slot {
float: left;
@ -167,6 +167,9 @@
.toolbar-btn-icon(btn-named-range, 77, @toolbar-icon-size);
//.toolbar-btn-icon(btn-insertequation, 82, @toolbar-icon-size);
.toolbar-btn-icon(btn-strikeout, 84, @toolbar-icon-size);
.toolbar-btn-icon(btn-subscript, 85, @toolbar-icon-size);
.toolbar-btn-icon(btn-superscript, 86, @toolbar-icon-size);
@menu-icon-size: 22px;
.menu-btn-icon(mnu-align-center, 0, @menu-icon-size);
@ -206,6 +209,9 @@
//
.menu-btn-icon(mnu-border-diagup, 36, @menu-icon-size);
.menu-btn-icon(mnu-border-diagdown, 37, @menu-icon-size);
//
.menu-btn-icon(mnu-text-subscript, 38, @menu-icon-size);
.menu-btn-icon(mnu-text-superscript, 39, @menu-icon-size);
.username-tip {
background-color: #ee3525;
@ -247,7 +253,7 @@
}
#slot-field-fontname {
width: 91px;
width: 148px;
}
#slot-field-fontsize {