Merge pull request #1195 from ONLYOFFICE/feature/sse-table-helper

Feature/sse table helper
This commit is contained in:
Julia Radzhabova 2021-09-22 22:04:25 +03:00 committed by GitHub
commit 75aa2d143e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 72 additions and 12 deletions

View file

@ -2425,8 +2425,14 @@ define([
i--; i--;
} }
funcarr.sort(function (a,b) { funcarr.sort(function (a,b) {
var aname = a.asc_getName(true).toLocaleUpperCase(), var atype = a.asc_getType(),
btype = b.asc_getType(),
aname = a.asc_getName(true).toLocaleUpperCase(),
bname = b.asc_getName(true).toLocaleUpperCase(); bname = b.asc_getName(true).toLocaleUpperCase();
if (atype === Asc.c_oAscPopUpSelectorType.TableThisRow) return -1;
if (btype === Asc.c_oAscPopUpSelectorType.TableThisRow) return 1;
if ((atype === Asc.c_oAscPopUpSelectorType.TableColumnName || btype === Asc.c_oAscPopUpSelectorType.TableColumnName) && atype !== btype)
return atype === Asc.c_oAscPopUpSelectorType.TableColumnName ? -1 : 1;
if (aname < bname) return -1; if (aname < bname) return -1;
if (aname > bname) return 1; if (aname > bname) return 1;
return 0; return 0;
@ -2435,24 +2441,50 @@ define([
var type = menuItem.asc_getType(), var type = menuItem.asc_getType(),
name = menuItem.asc_getName(true), name = menuItem.asc_getName(true),
origname = me.api.asc_getFormulaNameByLocale(name), origname = me.api.asc_getFormulaNameByLocale(name),
iconCls = 'btn-named-range'; iconCls = '',
caption = name,
hint = '';
switch (type) { switch (type) {
case Asc.c_oAscPopUpSelectorType.Func: case Asc.c_oAscPopUpSelectorType.Func:
iconCls = 'btn-function'; iconCls = 'menu__icon btn-function';
hint = (funcdesc && funcdesc[origname]) ? funcdesc[origname].d : '';
break; break;
case Asc.c_oAscPopUpSelectorType.Table: case Asc.c_oAscPopUpSelectorType.Table:
iconCls = 'btn-menu-table'; iconCls = 'menu__icon btn-menu-table';
break; break;
case Asc.c_oAscPopUpSelectorType.Slicer: case Asc.c_oAscPopUpSelectorType.Slicer:
iconCls = 'btn-slicer'; iconCls = 'menu__icon btn-slicer';
break;
case Asc.c_oAscPopUpSelectorType.Range:
iconCls = 'menu__icon btn-named-range';
break;
case Asc.c_oAscPopUpSelectorType.TableColumnName:
caption = '(...) ' + name;
break;
case Asc.c_oAscPopUpSelectorType.TableThisRow:
caption = name + ' - ' + me.txtThisRow;
hint = me.txtThisRowHint;
break;
case Asc.c_oAscPopUpSelectorType.TableAll:
hint = me.txtAllTableHint;
break;
case Asc.c_oAscPopUpSelectorType.TableData:
hint = me.txtDataTableHint;
break;
case Asc.c_oAscPopUpSelectorType.TableHeaders:
hint = me.txtHeadersTableHint;
break;
case Asc.c_oAscPopUpSelectorType.TableTotals:
hint = me.txtTotalsTableHint;
break; break;
} }
var mnu = new Common.UI.MenuItem({ var mnu = new Common.UI.MenuItem({
iconCls: 'menu__icon ' + iconCls , iconCls: iconCls,
caption: name, caption: caption,
hint : (funcdesc && funcdesc[origname]) ? funcdesc[origname].d : '' name: name,
hint: hint
}).on('click', function(item, e) { }).on('click', function(item, e) {
setTimeout(function(){ me.api.asc_insertInCell(item.caption, type, false ); }, 10); setTimeout(function(){ me.api.asc_insertInCell(item.options.name, type, false ); }, 10);
}); });
menu.addItem(mnu); menu.addItem(mnu);
}); });
@ -3989,7 +4021,13 @@ define([
textAutoCorrectSettings: 'AutoCorrect options', textAutoCorrectSettings: 'AutoCorrect options',
txtLockSort: 'Data is found next to your selection, but you do not have sufficient permissions to change those cells.<br>Do you wish to continue with the current selection?', txtLockSort: 'Data is found next to your selection, but you do not have sufficient permissions to change those cells.<br>Do you wish to continue with the current selection?',
txtRemoveWarning: 'Do you want to remove this signature?<br>It can\'t be undone.', txtRemoveWarning: 'Do you want to remove this signature?<br>It can\'t be undone.',
txtWarnUrl: 'Clicking this link can be harmful to your device and data.<br>Are you sure you want to continue?' txtWarnUrl: 'Clicking this link can be harmful to your device and data.<br>Are you sure you want to continue?',
txtThisRow: 'This Row',
txtThisRowHint: 'Choose only this row of the specified column',
txtAllTableHint: 'Returns the entire contents of the table or specified table columns including column headers, data and total rows',
txtDataTableHint: 'Returns the data cells of the table or specified table columns',
txtHeadersTableHint: 'Returns the column headers for the table or specified table columns',
txtTotalsTableHint: 'Returns the total rows for the table or specified table columns'
}, SSE.Controllers.DocumentHolder || {})); }, SSE.Controllers.DocumentHolder || {}));
}); });

View file

@ -146,7 +146,11 @@ define([
'Quarters': this.txtQuarters, 'Quarters': this.txtQuarters,
'Years': this.txtYears, 'Years': this.txtYears,
'%1 or %2': this.txtOr, '%1 or %2': this.txtOr,
'Qtr': this.txtQuarter 'Qtr': this.txtQuarter,
'All': this.txtAllTable,
'Data': this.txtDataTable,
'Headers': this.txtHeadersTable,
'Totals': this.txtTotalsTable
}; };
styleNames.forEach(function(item){ styleNames.forEach(function(item){
@ -3400,7 +3404,11 @@ define([
uploadDocFileCountMessage: 'No documents uploaded.', uploadDocFileCountMessage: 'No documents uploaded.',
errorLoadingFont: 'Fonts are not loaded.<br>Please contact your Document Server administrator.', errorLoadingFont: 'Fonts are not loaded.<br>Please contact your Document Server administrator.',
textNeedSynchronize: 'You have an updates', textNeedSynchronize: 'You have an updates',
textChangesSaved: 'All changes saved' textChangesSaved: 'All changes saved',
txtAllTable: 'All',
txtDataTable: 'Data',
txtHeadersTable: 'Headers',
txtTotalsTable: 'Totals'
} }
})(), SSE.Controllers.Main || {})) })(), SSE.Controllers.Main || {}))
}); });

View file

@ -590,6 +590,12 @@
"SSE.Controllers.DocumentHolder.txtUseTextImport": "Use text import wizard", "SSE.Controllers.DocumentHolder.txtUseTextImport": "Use text import wizard",
"SSE.Controllers.DocumentHolder.txtWidth": "Width", "SSE.Controllers.DocumentHolder.txtWidth": "Width",
"SSE.Controllers.DocumentHolder.txtWarnUrl": "Clicking this link can be harmful to your device and data.<br>Are you sure you want to continue?", "SSE.Controllers.DocumentHolder.txtWarnUrl": "Clicking this link can be harmful to your device and data.<br>Are you sure you want to continue?",
"SSE.Controllers.DocumentHolder.txtThisRow": "This Row",
"SSE.Controllers.DocumentHolder.txtThisRowHint": "Choose only this row of the specified column",
"SSE.Controllers.DocumentHolder.txtAllTableHint": "Returns the entire contents of the table or specified table columns including column headers, data and total rows",
"SSE.Controllers.DocumentHolder.txtDataTableHint": "Returns the data cells of the table or specified table columns",
"SSE.Controllers.DocumentHolder.txtHeadersTableHint": "Returns the column headers for the table or specified table columns",
"SSE.Controllers.DocumentHolder.txtTotalsTableHint": "Returns the total rows for the table or specified table columns",
"SSE.Controllers.FormulaDialog.sCategoryAll": "All", "SSE.Controllers.FormulaDialog.sCategoryAll": "All",
"SSE.Controllers.FormulaDialog.sCategoryCube": "Cube", "SSE.Controllers.FormulaDialog.sCategoryCube": "Cube",
"SSE.Controllers.FormulaDialog.sCategoryDatabase": "Database", "SSE.Controllers.FormulaDialog.sCategoryDatabase": "Database",
@ -1044,6 +1050,10 @@
"SSE.Controllers.Main.warnNoLicense": "You've reached the limit for simultaneous connections to %1 editors. This document will be opened for viewing only.<br>Contact %1 sales team for personal upgrade terms.", "SSE.Controllers.Main.warnNoLicense": "You've reached the limit for simultaneous connections to %1 editors. This document will be opened for viewing only.<br>Contact %1 sales team for personal upgrade terms.",
"SSE.Controllers.Main.warnNoLicenseUsers": "You've reached the user limit for %1 editors. Contact %1 sales team for personal upgrade terms.", "SSE.Controllers.Main.warnNoLicenseUsers": "You've reached the user limit for %1 editors. Contact %1 sales team for personal upgrade terms.",
"SSE.Controllers.Main.warnProcessRightsChange": "You have been denied the right to edit the file.", "SSE.Controllers.Main.warnProcessRightsChange": "You have been denied the right to edit the file.",
"SSE.Controllers.Main.txtAllTable": "All",
"SSE.Controllers.Main.txtDataTable": "Data",
"SSE.Controllers.Main.txtHeadersTable": "Headers",
"SSE.Controllers.Main.txtTotalsTable": "Totals",
"SSE.Controllers.Print.strAllSheets": "All Sheets", "SSE.Controllers.Print.strAllSheets": "All Sheets",
"SSE.Controllers.Print.textFirstCol": "First column", "SSE.Controllers.Print.textFirstCol": "First column",
"SSE.Controllers.Print.textFirstRow": "First row", "SSE.Controllers.Print.textFirstRow": "First row",

View file

@ -1041,6 +1041,10 @@
"SSE.Controllers.Main.warnNoLicense": "Вы достигли лимита на одновременные подключения к редакторам %1. Этот документ будет открыт на просмотр.<br>Напишите в отдел продаж %1, чтобы обсудить индивидуальные условия лицензирования.", "SSE.Controllers.Main.warnNoLicense": "Вы достигли лимита на одновременные подключения к редакторам %1. Этот документ будет открыт на просмотр.<br>Напишите в отдел продаж %1, чтобы обсудить индивидуальные условия лицензирования.",
"SSE.Controllers.Main.warnNoLicenseUsers": "Вы достигли лимита на одновременные подключения к редакторам %1.<br>Напишите в отдел продаж %1, чтобы обсудить индивидуальные условия лицензирования.", "SSE.Controllers.Main.warnNoLicenseUsers": "Вы достигли лимита на одновременные подключения к редакторам %1.<br>Напишите в отдел продаж %1, чтобы обсудить индивидуальные условия лицензирования.",
"SSE.Controllers.Main.warnProcessRightsChange": "Вам было отказано в праве на редактирование этого файла.", "SSE.Controllers.Main.warnProcessRightsChange": "Вам было отказано в праве на редактирование этого файла.",
"SSE.Controllers.Main.txtAllTable": "Все",
"SSE.Controllers.Main.txtDataTable": "Данные",
"SSE.Controllers.Main.txtHeadersTable": "Заголовки",
"SSE.Controllers.Main.txtTotalsTable": "Итоги",
"SSE.Controllers.Print.strAllSheets": "Все листы", "SSE.Controllers.Print.strAllSheets": "Все листы",
"SSE.Controllers.Print.textFirstCol": "Первый столбец", "SSE.Controllers.Print.textFirstCol": "Первый столбец",
"SSE.Controllers.Print.textFirstRow": "Первая строка", "SSE.Controllers.Print.textFirstRow": "Первая строка",