Update for DE

This commit is contained in:
OVSharova 2022-02-14 05:56:29 +03:00
parent 7e59e1bfcc
commit d239ff5831
2 changed files with 178 additions and 125 deletions

View file

@ -232,93 +232,110 @@ define([
template: _.template([
'<div class="flex-settings">',
'<table style="margin: 30px 0 0;"><tbody>',
/** coauthoring begin **/
'<tr class="comments">',
'<td class="left"><label><%= scope.txtLiveComment %></label></td>',
'<td class="right"><div id="fms-chb-live-comment"></div></td>',
'</tr>','<tr class="divider comments"></tr>',
'<tr class="comments">',
'<td class="left"></td>',
'<td class="right"><div id="fms-chb-resolved-comment"></div></td>',
'</tr>','<tr class="divider comments"></tr>',
/** coauthoring end **/
'<tr class="view-review">',
'<td class="left"><label><%= scope.strReviewHover %></label></td>',
'<td class="right"><span id="fms-cmb-review-hover"></span></td>',
'</tr>','<tr class="divider view-review"></tr>',
'<tr class="edit spellcheck">',
'<td class="left"><label><%= scope.txtSpellCheck %></label></td>',
'<td class="right"><div id="fms-chb-spell-check"></div></td>',
'</tr>','<tr class="divider edit spellcheck"></tr>',
'<tr class="edit">',
'<td class="left"><label><%= scope.txtProofing %></label></td>',
'<td class="right"><button type="button" class="btn btn-text-default" id="fms-btn-auto-correct" style="width:auto; display: inline-block;padding-right: 10px;padding-left: 10px;" data-hint="2" data-hint-direction="bottom" data-hint-offset="medium"><%= scope.txtAutoCorrect %></button></div></td>',
'</tr>','<tr class="divider edit"></tr>',
'<tr class="edit">',
'<td class="left"><label><%= scope.txtInput %></label></td>',
'<td class="right"><div id="fms-chb-input-mode"></div></td>',
'</tr>','<tr class="divider edit"></tr>',
'<tr class="edit">',
'<td class="left"><label><%= scope.textAlignGuides %></label></td>',
'<td class="right"><span id="fms-chb-align-guides"></span></td>',
'</tr>','<tr class="divider edit"></tr>',
'<tr class="edit">',
'<td class="left"><label><%= scope.textCompatible %></label></td>',
'<td class="right"><span id="fms-chb-compatible"></span></td>',
'</tr>','<tr class="divider edit"></tr>',
'<td class="left"><label><%= scope.txtEditingSaving %></label></td>',
'</tr>',
'<tr class="autosave">',
'<td class="left"><label id="fms-lbl-autosave"><%= scope.textAutoSave %></label></td>',
'<td class="right"><span id="fms-chb-autosave"></span></td>',
'</tr>','<tr class="divider autosave"></tr>',
'<tr class="forcesave">',
'<td class="left"><label id="fms-lbl-forcesave"><%= scope.textForceSave %></label></td>',
'<td class="right"><span id="fms-chb-forcesave"></span></td>',
'</tr>','<tr class="divider forcesave"></tr>',
/** coauthoring begin **/
'</tr>',
'<tr class="edit">',
'<td class="right"><div id="fms-chb-paste-settings"></div></td>',
'</tr>',
'<tr class="edit">',
'<td class="right"><span id="fms-chb-compatible"></span></td>',
'</tr>',
'<tr class="edit">',
'<td class="left"><label><%= scope.txtCollaboration %></label></td>',
'</tr>',
'<tr class="coauth changes-mode">',
'<td class="left"><label><%= scope.strCoAuthMode %></label></td>',
'<td class="right">',
'<div><div id="fms-cmb-coauth-mode" style="display: inline-block; margin-right: 15px;vertical-align: middle;"></div>',
'<label id="fms-lbl-coauth-mode" style="vertical-align: middle;"><%= scope.strCoAuthModeDescFast %></label></div></td>',
'</tr>','<tr class="divider coauth changes-mode"></tr>',
'<tr class="coauth changes-show">',
'</tr>',
'<tr class="coauth changes-mode">',
'<td class="right" style="display: flex;"><div id="fms-rb-coauth-mode-fast" ></div>',
'<span><label><%= scope.strFast %></label><br>',
'<label>Real-time co-editing. All changes are saved automatically</label></span></div></div>',
'</td>',
'</tr>',
'<tr class="coauth changes-mode">',
'<td class="right" style="display: flex;"><div id="fms-rb-coauth-mode-strict"></div>',
'<span><label><%= scope.strStrict %></label><br>',
'<label>Use the \'Save\' button to sync the changes you and others make</label></span>',
'</div></td>',
'</tr>',
'<tr class="view-review">',
'<td class="left"><label><%= scope.txtShowTrackChanges %></label></td>',
'</tr>',
'<tr class="view-review">',
'<td class="right"><div id="fms-rb-show-track-ballons"></div></td>',
'</tr>',
'<tr class="view-review">',
'<td class="right"><div id="fms-rb-show-track-tooltips"></div></td>',
'</tr>',
'<tr class="edit">',
'<td class="left"><label><%= scope.strShowChanges %></label></td>',
'<td class="right"><span id="fms-cmb-show-changes"></span></td>',
'</tr>','<tr class="divider coauth changes-show"></tr>',
/** coauthoring end **/
'</tr>',
'<tr class="edit show-changes">',
'<td class="right"><div id="fms-rb-show-changes-none"></div></td>',
'</tr>',
'<tr class="edit show-changes">',
'<td class="right"><div id="fms-rb-show-changes-all"></div></td>',
'</tr>',
'<tr class="edit show-changes">',
'<td class="right"><div id="fms-rb-show-changes-last"></div></td>',
'</tr>',
'<tr class="comments">',
'<td class="right"><div id="fms-chb-live-comment"></div></td>',
'</tr>',
'<tr class="comments">',
'<td class="right"><div id="fms-chb-resolved-comment"></div></td>',
'</tr>',
'<tr class="edit">',
'<td class="left"><label><%= scope.txtProofing %></label></td>',
'</tr>',
'<tr class="edit spellcheck">',
'<td class="right"><div id="fms-chb-spell-check"></div></td>',
'</tr>',
'<tr class="edit">',
'<td class="right"><button type="button" class="btn btn-text-default" id="fms-btn-auto-correct" style="width:auto; display: inline-block;padding-right: 10px;padding-left: 10px;" data-hint="2" data-hint-direction="bottom" data-hint-offset="medium"><%= scope.txtAutoCorrect %></button></div></td>',
'</tr>',
'<tr class="edit">',
'<td class="left"><label><%= scope.txtWorkspace %></label></td>',
'</tr>',
'<tr class="edit">',
'<td class="right"><span id="fms-chb-align-guides"></span></td>',
'</tr>',
'<tr class="edit">',
'<td class="right"><div id="fms-chb-input-mode"></div></td>',
'</tr>',
'</tbody></table>',
'<table style="margin: 30px 0 0;"><tbody>',
'<tr class="themes">',
'<td class="left"><label><%= scope.strTheme %></label></td>',
'<td class="right">',
'<div><div id="fms-cmb-theme" style="display: inline-block; margin-right: 15px;vertical-align: middle;"></div>',
'<div id="fms-chb-dark-mode" style="display: inline-block; vertical-align: middle;margin-top: 2px;"></div></div></td>',
'</tr>','<tr class="divider"></tr>',
'<tr>',
'<td class="left"><label><%= scope.strZoom %></label></td>',
'<td class="right"><div id="fms-cmb-zoom" class="input-group-nr"></div></td>',
'</tr>','<tr class="divider"></tr>',
'<tr>',
'<td class="left"><label><%= scope.strFontRender %></label></td>',
'<td class="right"><span id="fms-cmb-font-render"></span></td>',
'</tr>','<tr class="divider"></tr>',
'</tr>',
'<tr class="edit">',
'<td class="left"><label><%= scope.strUnit %></label></td>',
'<td class="right"><span id="fms-cmb-unit"></span></td>',
'</tr>','<tr class="divider edit"></tr>',
'<tr class="edit">',
'<td class="left"><label><%= scope.strPaste %></label></td>',
'<td class="right"><div id="fms-chb-paste-settings"></div></td>',
'</tr>','<tr class="divider edit"></tr>',
'</tr>',
'<tr>',
'<td class="left"><label><%= scope.strZoom %></label></td>',
'<td class="right"><div id="fms-cmb-zoom" class="input-group-nr"></div></td>',
'</tr>',
'<tr>',
'<td class="left"><label><%= scope.strFontRender %></label></td>',
'<td class="right"><span id="fms-cmb-font-render"></span></td>',
'</tr>',
'<tr class="macros">',
'<td class="left"><label><%= scope.strMacrosSettings %></label></td>',
'<td class="right">',
'<div><div id="fms-cmb-macros" style="display: inline-block; margin-right: 15px;vertical-align: middle;"></div>',
'<label id="fms-lbl-macros" style="vertical-align: middle;"><%= scope.txtWarnMacrosDesc %></label></div></td>',
'</tr>','<tr class="divider macros"></tr>',
'<tr class="fms-btn-apply">',
'<td class="left"></td>',
'<td class="right" style="padding-top:15px; padding-bottom: 15px;"><button class="btn normal dlg-btn primary" data-hint="2" data-hint-direction="bottom" data-hint-offset="medium"><%= scope.okButtonText %></button></td>',
'</tr>',
'</tbody></table>',
'</div>',
'<div class="fms-flex-apply hidden">',
'<table style="margin: 10px 0;"><tbody>',
@ -342,7 +359,7 @@ define([
this.chInputMode = new Common.UI.CheckBox({
el: $markup.findById('#fms-chb-input-mode'),
labelText: this.strInputMode,
labelText: this.txtHieroglyphs,
dataHint: '2',
dataHintDirection: 'left',
dataHintOffset: 'small'
@ -370,7 +387,7 @@ define([
this.chSpell = new Common.UI.CheckBox({
el: $markup.findById('#fms-chb-spell-check'),
labelText: this.strSpellCheckMode,
labelText: this.txtSpellCheck,
dataHint: '2',
dataHintDirection: 'left',
dataHintOffset: 'small'
@ -386,14 +403,14 @@ define([
this.chAutosave = new Common.UI.CheckBox({
el: $markup.findById('#fms-chb-autosave'),
labelText: this.strAutosave,
labelText: this.textAutoSave,
dataHint: '2',
dataHintDirection: 'left',
dataHintOffset: 'small'
}).on('change', function(field, newValue, oldValue, eOpts){
if (field.getValue()!=='checked' && me.cmbCoAuthMode.getValue()) {
me.cmbCoAuthMode.setValue(0);
me.onSelectCoAuthMode(me.cmbCoAuthMode.getSelectedRecord());
if (field.getValue()!=='checked' && me.rbCoAuthModeFast.getValue()) {
me.rbCoAuthModeStrict.setValue(true);
me.onChangeCoAuthMode(me.rbCoAuthModeFast.getValue()?1:0);
}
});
this.lblAutosave = $markup.findById('#fms-lbl-autosave');
@ -408,7 +425,7 @@ define([
this.chAlignGuides = new Common.UI.CheckBox({
el: $markup.findById('#fms-chb-align-guides'),
labelText: this.strAlignGuides,
labelText: this.textAlignGuides,
dataHint: '2',
dataHintDirection: 'left',
dataHintOffset: 'small'
@ -444,40 +461,72 @@ define([
});
/** coauthoring begin **/
this.cmbShowChanges = new Common.UI.ComboBox({
el : $markup.findById('#fms-cmb-show-changes'),
style : 'width: 160px;',
editable : false,
cls : 'input-group-nr',
data : [
{ value: 'none', displayValue: this.txtNone },
{ value: 'all', displayValue: this.txtAll },
{ value: 'last', displayValue: this.txtLast }
],
this.rbCoAuthModeFast = new Common.UI.RadioBox({
el :$markup.findById('#fms-rb-coauth-mode-fast'),
name : 'coauth-mode',
dataHint: '2',
dataHintDirection: 'bottom',
dataHintOffset: 'big'
dataHintDirection: 'left',
dataHintOffset: 'small'
});
this.rbCoAuthModeFast.on('change', function(){
me.chAutosave.setValue(1);
me.onChangeCoAuthMode(1);
});
this.cmbCoAuthMode = new Common.UI.ComboBox({
el : $markup.findById('#fms-cmb-coauth-mode'),
style : 'width: 160px;',
editable : false,
cls : 'input-group-nr',
data : [
{ value: 1, displayValue: this.strFast, descValue: this.strCoAuthModeDescFast},
{ value: 0, displayValue: this.strStrict, descValue: this.strCoAuthModeDescStrict }
],
this.rbCoAuthModeStrict = new Common.UI.RadioBox({
el :$markup.findById('#fms-rb-coauth-mode-strict'),
name : 'coauth-mode',
dataHint: '2',
dataHintDirection: 'bottom',
dataHintOffset: 'big'
}).on('selected', function(combo, record) {
if (record.value == 1 && (me.chAutosave.getValue()!=='checked'))
me.chAutosave.setValue(1);
me.onSelectCoAuthMode(record);
dataHintDirection: 'left',
dataHintOffset: 'small'
});
this.rbCoAuthModeStrict.on('change', _.bind(this.onChangeCoAuthMode, this,0));
this.rbChangesBallons = new Common.UI.RadioBox({
el :$markup.findById('#fms-rb-show-track-ballons'),
name : 'show-track-changes',
labelText : this.txtChangesBalloons,
dataHint: '2',
dataHintDirection: 'left',
dataHintOffset: 'small'
});
this.rbChangesTip = new Common.UI.RadioBox({
el :$markup.findById('#fms-rb-show-track-tooltips'),
name : 'show-track-changes',
labelText : this.txtChangesTip
});
this.rbShowChangesNone = new Common.UI.RadioBox({
el :$markup.findById('#fms-rb-show-changes-none'),
name : 'show-changes',
labelText : this.txtNone,
dataHint: '2',
dataHintDirection: 'left',
dataHintOffset: 'small'
});
this.rbShowChangesAll = new Common.UI.RadioBox({
el :$markup.findById('#fms-rb-show-changes-all'),
name : 'show-changes',
labelText : this.txtAll,
dataHint: '2',
dataHintDirection: 'left',
dataHintOffset: 'small'
});
this.rbShowChangesLast = new Common.UI.RadioBox({
el :$markup.findById('#fms-rb-show-changes-last'),
name : 'show-changes',
labelText : this.txtLast,
dataHint: '2',
dataHintDirection: 'left',
dataHintOffset: 'small'
});
this.lblCoAuthMode = $markup.findById('#fms-lbl-coauth-mode');
/** coauthoring end **/
var itemsTemplate =
@ -625,7 +674,7 @@ define([
updateScroller: function() {
if (this.scroller) {
Common.UI.Menu.Manager.hideAll();
var scrolled = this.$el.height()< this.pnlTable.height() + 25 + this.pnlApply.height();
var scrolled = this.$el.height()< this.pnlTable.parent().height() + 25 + this.pnlApply.height();
this.pnlApply.toggleClass('hidden', !scrolled);
this.trApply.toggleClass('hidden', scrolled);
this.pnlSettings.css('overflow', scrolled ? 'hidden' : 'visible');
@ -679,15 +728,15 @@ define([
this.chResolvedComment.setValue(Common.Utils.InternalSettings.get("de-settings-resolvedcomment"));
var fast_coauth = Common.Utils.InternalSettings.get("de-settings-coauthmode");
item = this.cmbCoAuthMode.store.findWhere({value: fast_coauth ? 1 : 0});
this.cmbCoAuthMode.setValue(item ? item.get('value') : 1);
this.lblCoAuthMode.text(item ? item.get('descValue') : this.strCoAuthModeDescFast);
this.rbCoAuthModeFast.setValue(fast_coauth);
this.rbCoAuthModeStrict.setValue(!fast_coauth);
this.fillShowChanges(fast_coauth);
value = Common.Utils.InternalSettings.get((fast_coauth) ? "de-settings-showchanges-fast" : "de-settings-showchanges-strict");
item = this.cmbShowChanges.store.findWhere({value: value});
this.cmbShowChanges.setValue(item ? item.get('value') : (fast_coauth) ? 'none' : 'last');
this.rbShowChangesNone.setValue(value=='none');
this.rbShowChangesLast.setValue(value=='last');
this.rbShowChangesAll.setValue(value=='all');
/** coauthoring end **/
value = Common.Utils.InternalSettings.get("de-settings-fontrender");
@ -737,8 +786,8 @@ define([
if (this.mode.canViewReview) {
value = Common.Utils.InternalSettings.get("de-settings-review-hover-mode");
item = this.cmbReviewHover.store.findWhere({value: value});
this.cmbReviewHover.setValue(item ? item.get('value') : false);
this.rbChangesTip.setValue(value);
this.rbChangesBallons.setValue(!value);
}
},
@ -754,8 +803,9 @@ define([
Common.localStorage.setItem("de-settings-livecomment", this.chLiveComment.isChecked() ? 1 : 0);
Common.localStorage.setItem("de-settings-resolvedcomment", this.chResolvedComment.isChecked() ? 1 : 0);
if (this.mode.isEdit && !this.mode.isOffline && this.mode.canCoAuthoring) {
this.mode.canChangeCoAuthoring && Common.localStorage.setItem("de-settings-coauthmode", this.cmbCoAuthMode.getValue());
Common.localStorage.setItem(this.cmbCoAuthMode.getValue() ? "de-settings-showchanges-fast" : "de-settings-showchanges-strict", this.cmbShowChanges.getValue());
this.mode.canChangeCoAuthoring && Common.localStorage.setItem("de-settings-coauthmode", this.rbCoAuthModeFast.getValue() ? 1 : 0 );
Common.localStorage.setItem(this.rbCoAuthModeFast.getValue() ? "de-settings-showchanges-fast" : "de-settings-showchanges-strict",
this.rbShowChangesNone.getValue()?'none':this.rbShowChangesLast.getValue()?'last':'all');
}
/** coauthoring end **/
Common.localStorage.setItem("de-settings-fontrender", this.cmbFontRender.getValue());
@ -776,7 +826,7 @@ define([
Common.Utils.InternalSettings.set("de-macros-mode", this.cmbMacros.getValue());
if (this.mode.canViewReview) {
var val = this.cmbReviewHover.getValue();
var val = this.rbChangesTip.getValue();
Common.localStorage.setBool("de-settings-review-hover-mode", val);
Common.Utils.InternalSettings.set("de-settings-review-hover-mode", val);
this.mode.reviewHoverMode = val;
@ -795,17 +845,15 @@ define([
},
fillShowChanges: function(fastmode) {
if ( fastmode && this.cmbShowChanges.store.length==3 || !fastmode && this.cmbShowChanges.store.length==2) {
var arr = [{ value: 'none', displayValue: this.txtNone }, { value: 'all', displayValue: this.txtAll }];
if (!fastmode) arr.push({ value: 'last', displayValue: this.txtLast});
this.cmbShowChanges.store.reset(arr);
}
this.rbShowChangesLast.setVisible(!fastmode);
},
onSelectCoAuthMode: function(record) {
this.lblCoAuthMode.text(record.descValue);
this.fillShowChanges(record.value == 1);
this.cmbShowChanges.setValue((record.value == 1) ? 'none' : 'last');
onChangeCoAuthMode: function (val){
this.fillShowChanges(val == 1);
this.rbShowChangesNone.setValue(val == 1);
this.rbShowChangesLast.setValue(val == 0);
},
onFontRenderSelected: function(combo, record) {
@ -882,7 +930,12 @@ define([
strReviewHover: 'Track Changes Display',
txtChangesTip: 'Show by hover in tooltips',
txtChangesBalloons: 'Show by click in balloons',
txtDarkMode: 'Turn on document dark mode'
txtDarkMode: 'Turn on document dark mode',
txtEditingSaving: 'Editing and saving',
txtCollaboration: 'Collaboration',
txtShowTrackChanges: 'Show track changes',
txtWorkspace: 'Workspace',
txtHieroglyphs: 'Hieroglyphs'
}, DE.Views.FileMenuPanels.Settings || {}));
DE.Views.FileMenuPanels.RecentFiles = Common.UI.BaseView.extend({

View file

@ -124,13 +124,13 @@
#panel-settings {
table {
width: 100%;
tr {
td {
padding: 5px 10px;
&.left {
text-align: right;
//text-align: right;
width: 30%;
label {