Skip to content

Commit

Permalink
Merge pull request 'fix/sse-rtl' (#73) from fix/sse-rtl into release/…
Browse files Browse the repository at this point in the history
…v8.2.0
  • Loading branch information
trofim24 committed Oct 9, 2024
2 parents 9f77ecd + 674f375 commit da56a11
Show file tree
Hide file tree
Showing 54 changed files with 188 additions and 7 deletions.
4 changes: 4 additions & 0 deletions apps/spreadsheeteditor/main/app/controller/LeftMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,10 @@ define([
Common.Utils.InternalSettings.set("sse-settings-r1c1", value);
this.api.asc_setR1C1Mode(value);

value = Common.localStorage.getBool("sse-settings-smooth-scroll");
Common.Utils.InternalSettings.set("sse-settings-smooth-scroll", value);
this.api.asc_SetSmoothScrolling(value);

var fast_coauth = Common.Utils.InternalSettings.get("sse-settings-coauthmode");
if (this.mode.isEdit && !this.mode.isOffline && this.mode.canCoAuthoring) {
if (this.mode.canChangeCoAuthoring) {
Expand Down
4 changes: 4 additions & 0 deletions apps/spreadsheeteditor/main/app/controller/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -1010,6 +1010,10 @@ define([
/** spellcheck settings end **/
}

value = Common.localStorage.getBool("sse-settings-smooth-scroll", true);
Common.Utils.InternalSettings.set("sse-settings-smooth-scroll", value);
this.api.asc_SetSmoothScrolling(value);

me.api.asc_registerCallback('asc_onStartAction', _.bind(me.onLongActionBegin, me));
me.api.asc_registerCallback('asc_onConfirmAction', _.bind(me.onConfirmAction, me));
me.api.asc_registerCallback('asc_onActiveSheetChanged', _.bind(me.onActiveSheetChanged, me));
Expand Down
23 changes: 18 additions & 5 deletions apps/spreadsheeteditor/main/app/controller/Toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -476,8 +476,10 @@ define([
button.on('click', _.bind(me.onEditHeaderClick, me, undefined));
});
toolbar.btnPrintTitles.on('click', _.bind(this.onPrintTitlesClick, this));
toolbar.chPrintGridlines.on('change', _.bind(this.onPrintGridlinesChange, this));
toolbar.chPrintHeadings.on('change', _.bind(this.onPrintHeadingsChange, this));
toolbar.chPrintGridlines.on('change', _.bind(this.onPrintGridlinesChange, this));
toolbar.chPrintHeadings.on('change', _.bind(this.onPrintHeadingsChange, this));
toolbar.btnRtlSheet.on('click', _.bind(this.onRtlSheetClick, this));

if (toolbar.btnCondFormat.rendered) {
toolbar.btnCondFormat.menu.on('show:before', _.bind(this.onShowBeforeCondFormat, this, this.toolbar, 'toolbar'));
}
Expand Down Expand Up @@ -2639,14 +2641,16 @@ define([

var currentSheet = this.api.asc_getActiveWorksheetIndex(),
props = this.api.asc_getPageOptions(currentSheet),
opt = props.asc_getPageSetup();
opt = props.asc_getPageSetup(),
params = this.api.asc_getSheetViewSettings();

this.onApiPageOrient(opt.asc_getOrientation());
this.onApiPageSize(opt.asc_getWidth(), opt.asc_getHeight());
this.onApiPageMargins(props.asc_getPageMargins());
this.onChangeScaleSettings(opt.asc_getFitToWidth(),opt.asc_getFitToHeight(),opt.asc_getScale());
this.onApiGridLines(props.asc_getGridLines());
this.onApiHeadings(props.asc_getHeadings());
this.onApiRtlSheet(params.asc_getRightToLeft());

this.api.asc_isLayoutLocked(currentSheet) ? this.onApiLockDocumentProps(currentSheet) : this.onApiUnLockDocumentProps(currentSheet);
this.toolbar.lockToolbar(Common.enumLock.printAreaLock, this.api.asc_isPrintAreaLocked(currentSheet), {array: [this.toolbar.btnPrintArea]});
Expand All @@ -2666,6 +2670,10 @@ define([
this.toolbar.chPrintHeadings.setValue(checked, true);
},

onApiRtlSheet: function (checked) {
this.toolbar.btnRtlSheet.toggle(!!checked, true);
},

onApiPageSize: function(w, h) {
if (this._state.pgorient===undefined) return;

Expand Down Expand Up @@ -4925,12 +4933,17 @@ define([
},

onPrintGridlinesChange: function (field, value) {
this.api.asc_SetPrintGridlines(value === 'checked');
this.api && this.api.asc_SetPrintGridlines(value === 'checked');
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
},

onPrintHeadingsChange: function (field, value) {
this.api.asc_SetPrintHeadings(value === 'checked');
this.api && this.api.asc_SetPrintHeadings(value === 'checked');
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
},

onRtlSheetClick: function (btn) {
this.api && this.api.asc_setRightToLeft(btn.pressed);
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
},

Expand Down
4 changes: 4 additions & 0 deletions apps/spreadsheeteditor/main/app/template/Toolbar.template
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,10 @@
<span class="btn-slot text x-huge" id="slot-btn-printtitles"></span>
</div>
<div class="separator long"></div>
<div class="group">
<span class="btn-slot text x-huge" id="slot-btn-rtl-sheet"></span>
</div>
<div class="separator long invisible"></div>
<div class="group small">
<div class="elset">
<span class="btn-slot text" id="slot-chk-print-gridlines"></span>
Expand Down
15 changes: 14 additions & 1 deletion apps/spreadsheeteditor/main/app/view/FileMenuPanels.js
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,10 @@ define([], function () {
'<tr>',
'<td colspan="2"><div id="fms-chb-use-alt-key"></div></td>',
'</tr>',
'<tr class="ui-rtl">',
'<tr>',
'<td colspan="2"><div id="fms-chb-smooth-scroll"></div></td>',
'</tr>',
'<tr class="ui-rtl">',
'<td colspan="2"><div id="fms-chb-rtl-ui" style="display: inline-block;"></div><span class="beta-hint">Beta</span></td>',
'</tr>',
/*'<tr class="quick-print">',
Expand Down Expand Up @@ -479,6 +482,14 @@ define([], function () {
});
(Common.Utils.isIE || Common.Utils.isMac && Common.Utils.isGecko) && this.chUseAltKey.$el.parent().parent().hide();

this.chSmoothScroll = new Common.UI.CheckBox({
el: $markup.findById('#fms-chb-smooth-scroll'),
labelText: this.strSmoothScroll,
dataHint: '2',
dataHintDirection: 'left',
dataHintOffset: 'small'
});

this.chScreenReader = new Common.UI.CheckBox({
el: $markup.findById('#fms-chb-scrn-reader'),
labelText: this.txtScreenReader,
Expand Down Expand Up @@ -1038,6 +1049,7 @@ define([], function () {
this.chLiveComment.setValue(Common.Utils.InternalSettings.get("sse-settings-livecomment"));
this.chResolvedComment.setValue(Common.Utils.InternalSettings.get("sse-settings-resolvedcomment"));
this.chR1C1Style.setValue(Common.Utils.InternalSettings.get("sse-settings-r1c1"));
this.chSmoothScroll.setValue(!Common.Utils.InternalSettings.get("sse-settings-smooth-scroll"));

var fast_coauth = Common.Utils.InternalSettings.get("sse-settings-coauthmode");
this.rbCoAuthModeFast.setValue(fast_coauth);
Expand Down Expand Up @@ -1209,6 +1221,7 @@ define([], function () {
}
/** coauthoring end **/
Common.localStorage.setItem("sse-settings-r1c1", this.chR1C1Style.isChecked() ? 1 : 0);
Common.localStorage.setItem("sse-settings-smooth-scroll", this.chSmoothScroll.isChecked() ? 0 : 1);
Common.localStorage.setItem("sse-settings-fontrender", this.cmbFontRender.getValue());
var item = this.cmbFontRender.store.findWhere({value: 'custom'});
Common.localStorage.setItem("sse-settings-cachemode", item && !item.get('checked') ? 0 : 1);
Expand Down
15 changes: 14 additions & 1 deletion apps/spreadsheeteditor/main/app/view/Toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -2164,6 +2164,17 @@ define([
dataHintOffset: 'small'
});

me.btnRtlSheet = new Common.UI.Button({
cls: 'btn-toolbar x-huge icon-top',
iconCls: 'toolbar__icon btn-sheet-rtl',
lock: [_set.selRange, _set.selRangeEdit, _set.sheetLock, _set.lostConnect, _set.coAuth, _set.editCell],
caption: this.textRtlSheet + ' (Beta)',
enableToggle: true,
dataHint: '1',
dataHintDirection: 'bottom',
dataHintOffset: 'small'
});

me.btnImgAlign = new Common.UI.Button({
cls: 'btn-toolbar x-huge icon-top',
iconCls: 'toolbar__icon btn-img-align',
Expand Down Expand Up @@ -2232,7 +2243,7 @@ define([
me.btnCopy, me.btnPaste, me.btnCut, me.btnSelectAll, me.btnReplace, me.listStyles, me.btnPrint,
/*me.btnSave,*/ me.btnClearStyle, me.btnCopyStyle,
me.btnPageMargins, me.btnPageSize, me.btnPageOrient, me.btnPrintArea, me.btnPageBreak, me.btnPrintTitles, me.btnImgAlign, me.btnImgBackward, me.btnImgForward, me.btnImgGroup, me.btnScale,
me.chPrintGridlines, me.chPrintHeadings, me.btnVisibleArea, me.btnVisibleAreaClose, me.btnTextFormatting, me.btnHorizontalAlign, me.btnVerticalAlign
me.chPrintGridlines, me.chPrintHeadings, me.btnRtlSheet, me.btnVisibleArea, me.btnVisibleAreaClose, me.btnTextFormatting, me.btnHorizontalAlign, me.btnVerticalAlign
];

_.each(me.lockControls.concat([me.btnSave]), function(cmp) {
Expand Down Expand Up @@ -2435,6 +2446,7 @@ define([
_injectComponent('#slot-btn-printtitles', this.btnPrintTitles);
_injectComponent('#slot-chk-print-gridlines', this.chPrintGridlines);
_injectComponent('#slot-chk-print-headings', this.chPrintHeadings);
_injectComponent('#slot-btn-rtl-sheet', this.btnRtlSheet);
_injectComponent('#slot-img-align', this.btnImgAlign);
_injectComponent('#slot-img-group', this.btnImgGroup);
_injectComponent('#slot-img-movefrwd', this.btnImgForward);
Expand Down Expand Up @@ -2538,6 +2550,7 @@ define([
_updateHint(this.btnTextFormatting, this.tipTextFormatting);
_updateHint(this.btnHorizontalAlign, this.tipHAlighOle);
_updateHint(this.btnVerticalAlign, this.tipVAlighOle);
_updateHint(this.btnRtlSheet, this.tipRtlSheet + ' (Beta)');
this.btnsEditHeader.forEach(function (btn) {
_updateHint(btn, me.tipEditHeader);
});
Expand Down
3 changes: 3 additions & 0 deletions apps/spreadsheeteditor/main/locale/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -4490,6 +4490,9 @@
"SSE.Views.WBProtection.txtSheetUnlockTitle": "فك حماية الورقة",
"SSE.Views.WBProtection.txtWBUnlockDescription": "أدخل كلمة سر لفك تشفير المصنف",
"SSE.Views.WBProtection.txtWBUnlockTitle": "فك حماية المصنف",
"SSE.Views.FileMenuPanels.MainSettingsGeneral.strSmoothScroll": "Snapped to the grid while scrolling",
"SSE.Views.Toolbar.tipRtlSheet": "Switch the sheet direction so that the first column is on the right side",
"SSE.Views.Toolbar.textRtlSheet": "Sheet Right-to-left",
"SSE.Views.ChartSettingsDlg.textShowEquation": "Display equation on chart",
"SSE.Views.ChartSettingsDlg.textTrendlineOptions": "Trendline options"
}
3 changes: 3 additions & 0 deletions apps/spreadsheeteditor/main/locale/az.json
Original file line number Diff line number Diff line change
Expand Up @@ -4490,6 +4490,9 @@
"SSE.Views.WBProtection.txtSheetUnlockTitle": "Vərəqin qorumasını ləğv et",
"SSE.Views.WBProtection.txtWBUnlockDescription": "İş kitabının mühafizəsini ləğv etmək üçün parol daxil edin",
"SSE.Views.WBProtection.txtWBUnlockTitle": "İş kitabının qorumasını ləğv et",
"SSE.Views.FileMenuPanels.MainSettingsGeneral.strSmoothScroll": "Snapped to the grid while scrolling",
"SSE.Views.Toolbar.tipRtlSheet": "Switch the sheet direction so that the first column is on the right side",
"SSE.Views.Toolbar.textRtlSheet": "Sheet Right-to-left",
"SSE.Views.ChartSettingsDlg.textShowEquation": "Display equation on chart",
"SSE.Views.ChartSettingsDlg.textTrendlineOptions": "Trendline options"
}
3 changes: 3 additions & 0 deletions apps/spreadsheeteditor/main/locale/be.json
Original file line number Diff line number Diff line change
Expand Up @@ -4490,6 +4490,9 @@
"SSE.Views.WBProtection.txtSheetUnlockTitle": "Зняць абарону аркуша",
"SSE.Views.WBProtection.txtWBUnlockDescription": "Каб зняць абарону кнігі, увядзіце пароль",
"SSE.Views.WBProtection.txtWBUnlockTitle": "Зняць абарону працоўнай кнігі",
"SSE.Views.FileMenuPanels.MainSettingsGeneral.strSmoothScroll": "Snapped to the grid while scrolling",
"SSE.Views.Toolbar.tipRtlSheet": "Switch the sheet direction so that the first column is on the right side",
"SSE.Views.Toolbar.textRtlSheet": "Sheet Right-to-left",
"SSE.Views.ChartSettingsDlg.textShowEquation": "Display equation on chart",
"SSE.Views.ChartSettingsDlg.textTrendlineOptions": "Trendline options"
}
3 changes: 3 additions & 0 deletions apps/spreadsheeteditor/main/locale/bg.json
Original file line number Diff line number Diff line change
Expand Up @@ -4490,6 +4490,9 @@
"SSE.Views.WBProtection.txtSheetUnlockTitle": "Unprotect sheet",
"SSE.Views.WBProtection.txtWBUnlockDescription": "Enter a password to unprotect workbook",
"SSE.Views.WBProtection.txtWBUnlockTitle": "Unprotect workbook",
"SSE.Views.FileMenuPanels.MainSettingsGeneral.strSmoothScroll": "Snapped to the grid while scrolling",
"SSE.Views.Toolbar.tipRtlSheet": "Switch the sheet direction so that the first column is on the right side",
"SSE.Views.Toolbar.textRtlSheet": "Sheet Right-to-left",
"SSE.Views.ChartSettingsDlg.textShowEquation": "Display equation on chart",
"SSE.Views.ChartSettingsDlg.textTrendlineOptions": "Trendline options"
}
3 changes: 3 additions & 0 deletions apps/spreadsheeteditor/main/locale/ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -4490,6 +4490,9 @@
"SSE.Views.WBProtection.txtSheetUnlockTitle": "Desprotegeix el full",
"SSE.Views.WBProtection.txtWBUnlockDescription": "Introdueix una contrasenya per desprotegir el llibre",
"SSE.Views.WBProtection.txtWBUnlockTitle": "Desprotegeix el llibre de treball",
"SSE.Views.FileMenuPanels.MainSettingsGeneral.strSmoothScroll": "Snapped to the grid while scrolling",
"SSE.Views.Toolbar.tipRtlSheet": "Switch the sheet direction so that the first column is on the right side",
"SSE.Views.Toolbar.textRtlSheet": "Sheet Right-to-left",
"SSE.Views.ChartSettingsDlg.textShowEquation": "Display equation on chart",
"SSE.Views.ChartSettingsDlg.textTrendlineOptions": "Trendline options"
}
3 changes: 3 additions & 0 deletions apps/spreadsheeteditor/main/locale/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -4490,6 +4490,9 @@
"SSE.Views.WBProtection.txtSheetUnlockTitle": "Zrušit zabezpečení listu",
"SSE.Views.WBProtection.txtWBUnlockDescription": "Vložte heslo pro přístup k sešitu",
"SSE.Views.WBProtection.txtWBUnlockTitle": "Zrušit zabezpečení sešitu",
"SSE.Views.FileMenuPanels.MainSettingsGeneral.strSmoothScroll": "Snapped to the grid while scrolling",
"SSE.Views.Toolbar.tipRtlSheet": "Switch the sheet direction so that the first column is on the right side",
"SSE.Views.Toolbar.textRtlSheet": "Sheet Right-to-left",
"SSE.Views.ChartSettingsDlg.textShowEquation": "Display equation on chart",
"SSE.Views.ChartSettingsDlg.textTrendlineOptions": "Trendline options"
}
3 changes: 3 additions & 0 deletions apps/spreadsheeteditor/main/locale/da.json
Original file line number Diff line number Diff line change
Expand Up @@ -4490,6 +4490,9 @@
"SSE.Views.WBProtection.txtSheetUnlockTitle": "Fjern beskyttelse af ark",
"SSE.Views.WBProtection.txtWBUnlockDescription": "Indtast en adgangskode for at fjerne beskyttelsen af ​​projektmappen",
"SSE.Views.WBProtection.txtWBUnlockTitle": "ubeskyt projektmappe",
"SSE.Views.FileMenuPanels.MainSettingsGeneral.strSmoothScroll": "Snapped to the grid while scrolling",
"SSE.Views.Toolbar.tipRtlSheet": "Switch the sheet direction so that the first column is on the right side",
"SSE.Views.Toolbar.textRtlSheet": "Sheet Right-to-left",
"SSE.Views.ChartSettingsDlg.textShowEquation": "Display equation on chart",
"SSE.Views.ChartSettingsDlg.textTrendlineOptions": "Trendline options"
}
3 changes: 3 additions & 0 deletions apps/spreadsheeteditor/main/locale/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -4490,6 +4490,9 @@
"SSE.Views.WBProtection.txtSheetUnlockTitle": "Liste entschützen",
"SSE.Views.WBProtection.txtWBUnlockDescription": "Zum Entschützen der Arbeitsmappe bitte Kennwort eingeben",
"SSE.Views.WBProtection.txtWBUnlockTitle": "Arbeitsmappe entschützen",
"SSE.Views.FileMenuPanels.MainSettingsGeneral.strSmoothScroll": "Snapped to the grid while scrolling",
"SSE.Views.Toolbar.tipRtlSheet": "Switch the sheet direction so that the first column is on the right side",
"SSE.Views.Toolbar.textRtlSheet": "Sheet Right-to-left",
"SSE.Views.ChartSettingsDlg.textShowEquation": "Display equation on chart",
"SSE.Views.ChartSettingsDlg.textTrendlineOptions": "Trendline options"
}
3 changes: 3 additions & 0 deletions apps/spreadsheeteditor/main/locale/el.json
Original file line number Diff line number Diff line change
Expand Up @@ -4490,6 +4490,9 @@
"SSE.Views.WBProtection.txtSheetUnlockTitle": "Άρση προστασίας φύλλου",
"SSE.Views.WBProtection.txtWBUnlockDescription": "Εισάγετε συνθηματικό για άρση προστασίας βιβλίου εργασίας",
"SSE.Views.WBProtection.txtWBUnlockTitle": "Άρση προστασίας βιβλίου εργασίας",
"SSE.Views.FileMenuPanels.MainSettingsGeneral.strSmoothScroll": "Snapped to the grid while scrolling",
"SSE.Views.Toolbar.tipRtlSheet": "Switch the sheet direction so that the first column is on the right side",
"SSE.Views.Toolbar.textRtlSheet": "Sheet Right-to-left",
"SSE.Views.ChartSettingsDlg.textShowEquation": "Display equation on chart",
"SSE.Views.ChartSettingsDlg.textTrendlineOptions": "Trendline options"
}
3 changes: 3 additions & 0 deletions apps/spreadsheeteditor/main/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2698,6 +2698,7 @@
"SSE.Views.FileMenuPanels.MainSettingsGeneral.strUnit": "Unit of measurement",
"SSE.Views.FileMenuPanels.MainSettingsGeneral.strUseSeparatorsBasedOnRegionalSettings": "Use separators based on regional settings",
"SSE.Views.FileMenuPanels.MainSettingsGeneral.strZoom": "Default Zoom value",
"SSE.Views.FileMenuPanels.MainSettingsGeneral.strSmoothScroll": "Snapped to the grid while scrolling",
"SSE.Views.FileMenuPanels.MainSettingsGeneral.text10Minutes": "Every 10 minutes",
"SSE.Views.FileMenuPanels.MainSettingsGeneral.text30Minutes": "Every 30 minutes",
"SSE.Views.FileMenuPanels.MainSettingsGeneral.text5Minutes": "Every 5 minutes",
Expand Down Expand Up @@ -4371,6 +4372,8 @@
"SSE.Views.Toolbar.txtTime": "Time",
"SSE.Views.Toolbar.txtUnmerge": "Unmerge cells",
"SSE.Views.Toolbar.txtYen": "¥ Yen",
"SSE.Views.Toolbar.tipRtlSheet": "Switch the sheet direction so that the first column is on the right side",
"SSE.Views.Toolbar.textRtlSheet": "Sheet Right-to-left",
"SSE.Views.Top10FilterDialog.textType": "Show",
"SSE.Views.Top10FilterDialog.txtBottom": "Bottom",
"SSE.Views.Top10FilterDialog.txtBy": "by",
Expand Down
3 changes: 3 additions & 0 deletions apps/spreadsheeteditor/main/locale/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -4490,6 +4490,9 @@
"SSE.Views.WBProtection.txtSheetUnlockTitle": "Desproteger hoja",
"SSE.Views.WBProtection.txtWBUnlockDescription": "Introduzca una contraseña para quitarle la protección al libro",
"SSE.Views.WBProtection.txtWBUnlockTitle": "Desproteger libro",
"SSE.Views.FileMenuPanels.MainSettingsGeneral.strSmoothScroll": "Snapped to the grid while scrolling",
"SSE.Views.Toolbar.tipRtlSheet": "Switch the sheet direction so that the first column is on the right side",
"SSE.Views.Toolbar.textRtlSheet": "Sheet Right-to-left",
"SSE.Views.ChartSettingsDlg.textShowEquation": "Display equation on chart",
"SSE.Views.ChartSettingsDlg.textTrendlineOptions": "Trendline options"
}
3 changes: 3 additions & 0 deletions apps/spreadsheeteditor/main/locale/eu.json
Original file line number Diff line number Diff line change
Expand Up @@ -4490,6 +4490,9 @@
"SSE.Views.WBProtection.txtSheetUnlockTitle": "Kendu babesa orriari",
"SSE.Views.WBProtection.txtWBUnlockDescription": "Idatzi pasahitza laneko liburuari babesa kentzeko",
"SSE.Views.WBProtection.txtWBUnlockTitle": "Kendu babesa laneko liburuari",
"SSE.Views.FileMenuPanels.MainSettingsGeneral.strSmoothScroll": "Snapped to the grid while scrolling",
"SSE.Views.Toolbar.tipRtlSheet": "Switch the sheet direction so that the first column is on the right side",
"SSE.Views.Toolbar.textRtlSheet": "Sheet Right-to-left",
"SSE.Views.ChartSettingsDlg.textShowEquation": "Display equation on chart",
"SSE.Views.ChartSettingsDlg.textTrendlineOptions": "Trendline options"
}
Loading

0 comments on commit da56a11

Please sign in to comment.