remove-w2ui: convert TopToolbar to JSDialog

- reuse old code as much as possible
- font, fontsize, style are managed by old select2 wrapper
- move some commands to dispatcher

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I2fd1820b36f3c63a5fdcc482afbcc5ffe04e299f
pull/8668/head
Szymon Kłos 2024-03-27 22:08:02 +01:00 committed by Szymon Kłos
parent 46b49afc2a
commit ebff222073
27 changed files with 483 additions and 485 deletions

View File

@ -1,12 +1,6 @@
#toolbar-up.w2ui-toolbar {
left: 0;
right: 0;
padding-left: 9px;
padding-right: 0px;
text-align: center;
z-index: 999;
overflow: visible !important;
background-color: transparent;
#toolbar-up {
z-index: 11;
height: 38px;
}
#document-name-input-loading-bar {
@ -48,6 +42,7 @@
}
.ui-toolbar > div > div > .unotoolbutton,
.ui-toolbar > div > div > .menubutton,
.ui-toolbar > div > div > .ui-listbox-container,
.ui-toolbar > div > div > .ui-pushbutton,
.ui-toolbar > div > div .cool-font {
margin: auto 2px;
@ -70,6 +65,7 @@
#toolbar-down {
z-index: 11;
border-top: 1px solid var(--color-border);
padding: 4px 0px;
}
#toolbar-down:not(.mobile) {
background-color: var(--color-main-background);
@ -439,6 +435,9 @@ button.leaflet-control-search-next
}
/* select box */
.select2 span {
font-family: var(--cool-font);
}
.select2-results__option {
padding: 5px;
font-family: var(--cool-font);
@ -492,10 +491,10 @@ button.leaflet-control-search-next
.select2-container--default .select2-results__option[aria-disabled='true'] {
color: var(--color-border-lighter);
}
.styles-select {
#styles-input {
width: 150px !important;
}
#tb_editbar_item_fonts .select2-container{
#toolbar-up #fontnamecombobox .select2-container{
margin-left: 5px;
margin-right: 5px;
width: 150px !important;
@ -506,10 +505,10 @@ button.leaflet-control-search-next
line-height: 24px;
padding-right: 8px;
}
#tb_editbar_item_fontsizes .select2-container{
#toolbar-up #fontsizecombobox .select2-container{
min-width: 55px !important;
}
.fontsizes-select {
#fontsizecombobox-input {
width: 55px !important;
}
.evo-cp-wrap {

View File

@ -2145,7 +2145,8 @@ L.Control.JSDialogBuilder = L.Control.extend({
'downloadas-direct-pdf': 'exportdirectpdf',
'downloadas-epub': 'exportepub',
'languagestatusmenu': 'languagemenu',
'cancelsearch': 'cancel'
'cancelsearch': 'cancel',
'printoptions': 'print'
};
if (iconURLAliases[cleanName]) {
cleanName = iconURLAliases[cleanName];

View File

@ -74,7 +74,7 @@ L.Control.StatusBar = L.Control.extend({
return text;
},
_updateToolbarsVisibility: function(/*context*/) {
_updateToolbarsVisibility: function(context) {
var isReadOnly = this.map.isReadOnlyMode();
if (isReadOnly) {
this.enableItem('languagestatus', false);
@ -85,7 +85,7 @@ L.Control.StatusBar = L.Control.extend({
this.showItem('insertmode-container', true);
this.showItem('statusselectionmode-container', true);
}
// TODO window.updateVisibilityForToolbar(statusbar, context);
window.updateVisibilityForToolbar(this, context);
},
onContextChange: function(event) {
@ -93,7 +93,10 @@ L.Control.StatusBar = L.Control.extend({
},
callback: function (objectType, eventType, object, data, builder) {
if (object.id === 'zoom') {
if (object.id === 'search-input') {
// its handled by window.setupSearchInput
return;
} else if (object.id === 'zoom') {
var selected = this._generateZoomItems().filter((item) => { return item.id === data; });
if (selected.length)
this.map.setZoom(selected[0].scale, null, true /* animate? */);
@ -242,11 +245,8 @@ L.Control.StatusBar = L.Control.extend({
];
},
create: function() {
if (this.parentContainer.firstChild)
return;
var data = [
getToolItems() {
return [
{type: 'edit', id: 'search-input', placeholder: _('Search'), text: ''},
{type: 'customtoolitem', id: 'searchprev', command: 'searchprev', text: _UNO('.uno:UpSearch'), enabled: false},
{type: 'customtoolitem', id: 'searchnext', command: 'searchnext', text: _UNO('.uno:DownSearch'), enabled: false},
@ -279,9 +279,14 @@ L.Control.StatusBar = L.Control.extend({
{type: 'menubutton', id: 'zoom', text: '100', selected: 'zoom100', menu: this._generateZoomItems()},
{type: 'customtoolitem', id: 'zoomin', command: 'zoomin', text: _UNO('.uno:ZoomPlus')}
]);
},
create: function() {
if (this.parentContainer.firstChild)
return;
this.parentContainer.innerHTML = '';
this.builder.build(this.parentContainer, data);
this.builder.build(this.parentContainer, this.getToolItems());
this.onLanguagesUpdated();
window.setupSearchInput();
@ -367,6 +372,8 @@ L.Control.StatusBar = L.Control.extend({
this.parentContainer.style.display = 'none';
},
// TODO: make base class for toolbar components
// jscpd:ignore-start
enableItem(command, enable) {
this.builder.executeAction(this.parentContainer, {
'control_id': command,
@ -382,6 +389,7 @@ L.Control.StatusBar = L.Control.extend({
JSDialog.RefreshScrollables();
},
// jscpd:ignore-end
updateHtmlItem: function (id, text) {
this.builder.updateWidget(this.parentContainer, {

View File

@ -89,16 +89,10 @@ function onClick(e, id, item) {
app.dispatcher.dispatch(item.id);
}
else if (id === 'print') {
map.print();
app.dispatcher.dispatch('print');
}
else if (id === 'save') {
// Save only when not read-only.
if (!map.isReadOnlyMode()) {
map.fire('postMessage', {msgId: 'UI_Save', args: { source: 'toolbar' }});
if (!map._disableDefaultAction['UI_Save']) {
map.save(false /* An explicit save should terminate cell edit */, false /* An explicit save should save it again */);
}
}
app.dispatcher.dispatch('save');
}
else if (id === 'repair') {
app.socket.sendMessage('commandvalues command=.uno:DocumentRepair');
@ -115,9 +109,6 @@ function onClick(e, id, item) {
else if (id === 'present-in-window') {
map.fire('presentinwindow');
}
else if (id === 'insertannotation') {
map.insertComment();
}
else if (id === 'insertgraphic' || item.id === 'localgraphic') {
L.DomUtil.get('insertgraphic').click();
}
@ -145,12 +136,6 @@ function onClick(e, id, item) {
else if (id === 'close' || id === 'closemobile') {
map.uiManager.enterReadonlyOrClose();
}
else if (id === 'link') {
if (map.getDocType() == 'spreadsheet')
map.sendUnoCommand('.uno:HyperlinkDialog');
else
map.showHyperlinkDialog();
}
}
function _setBorders(left, right, bottom, top, horiz, vert, color) {
@ -929,6 +914,9 @@ function onWopiProps(e) {
function processStateChangedCommand(commandName, state) {
var toolbar = w2ui['editbar'];
if (!toolbar)
return;
var color, div;
if (!commandName)
@ -1273,7 +1261,8 @@ function updateVisibilityForToolbar(toolbar, context) {
var toShow = [];
var toHide = [];
toolbar.items.forEach(function(item) {
var items = toolbar.getToolItems ? toolbar.getToolItems() : toolbar.items;
items.forEach(function(item) {
if (window.ThisIsTheiOSApp && window.mode.isTablet() && item.iosapptablet === false) {
toHide.push(item.id);
}
@ -1300,8 +1289,8 @@ function updateVisibilityForToolbar(toolbar, context) {
window.app.console.log('explicitly hiding: ' + toHide);
window.app.console.log('explicitly showing: ' + toShow);
toHide.forEach(function(item) { toolbar.hide(item); });
toShow.forEach(function(item) { toolbar.show(item); });
toHide.forEach(function(item) { toolbar.showItem ? toolbar.showItem(item, false) : toolbar.hide(item); });
toShow.forEach(function(item) { toolbar.showItem ? toolbar.showItem(item, true) : toolbar.show(item); });
}
global.onClose = onClose;

View File

@ -12,15 +12,36 @@
* L.Control.TopToolbar
*/
/* global $ w2ui _ _UNO w2utils */
/* global $ JSDialog _ _UNO */
L.Control.TopToolbar = L.Control.extend({
options: {
stylesSelectValue: null,
fontsSelectValue: null
},
onAdd: function (map) {
this.map = map;
this.parentContainer = L.DomUtil.get('toolbar-up');
// In case it contains garbage
if (this.parentContainer) {
this.parentContainer.outerHTML = '';
this.parentContainer = null;
}
// Use original template as provided by server
$('#toolbar-logo').after(this.map.toolbarUpTemplate.cloneNode(true));
this.parentContainer = L.DomUtil.get('toolbar-up');
L.DomUtil.addClass(this.parentContainer, 'ui-toolbar');
this.builder = new L.control.jsDialogBuilder(
{
mobileWizard: this,
map: this.map,
cssClass: 'jsdialog',
noLabelsForUnoButtons: true,
callback: this.callback.bind(this)
});
this.create();
map.on('doclayerinit', this.onDocLayerInit, this);
@ -33,18 +54,16 @@ L.Control.TopToolbar = L.Control.extend({
map.on('updatetoolbarcommandvalues', this.updateCommandValues, this);
}
$(window).resize(function() {
if ($(window).width() !== map.getSize().x) {
var toolbar = w2ui['editbar'];
if (toolbar)
toolbar.resize();
}
});
// on mode switch NB -> Compact
if (map._docLoadedOnce)
this.onDocLayerInit();
},
onRemove: function() {
$().w2destroy('editbar');
L.DomUtil.get('toolbar-up').remove();
if (this.parentContainer) {
this.parentContainer.outerHTML = '';
this.parentContainer = null;
}
this.map.off('doclayerinit', this.onDocLayerInit, this);
this.map.off('updatepermission', this.onUpdatePermission, this);
@ -56,15 +75,13 @@ L.Control.TopToolbar = L.Control.extend({
}
},
onFontSizeSelect: function(e) {
this.map.applyFontSize(e.target.value);
this.map.focus();
},
callback: function(objectType, eventType, object, data, builder) {
if (object.id === 'fontnamecombobox' || object.id === 'fontsizecombobox' || object.id === 'styles') {
// managed by non-JSDialog code
return;
}
onFontSelect: function(e) {
var font = e.target.value;
this.map.applyFont(font);
this.map.focus();
this.builder._defaultCallbackHandler(objectType, eventType, object, data, builder);
},
onStyleSelect: function(e) {
@ -85,7 +102,7 @@ L.Control.TopToolbar = L.Control.extend({
},
onContextChange: function(event) {
window.updateVisibilityForToolbar(w2ui['editbar'], event.context);
window.updateVisibilityForToolbar(this, event.context);
},
// mobile:false means hide it both for normal Online used from a mobile phone browser, and in a mobile app on a mobile phone
@ -97,171 +114,105 @@ L.Control.TopToolbar = L.Control.extend({
// invisible means visibility:hidden
getToolItems: function() {
var that = this;
return [
{type: 'button', id: 'closemobile', img: 'closemobile', desktop: false, mobile: false, tablet: true, hidden: true},
{type: 'button', id: 'save', img: 'save', hint: _UNO('.uno:Save'), lockUno: '.uno:Save'},
{type: 'button', id: 'print', img: 'print', hint: _UNO('.uno:Print', 'text'), mobile: false, tablet: false, lockUno: '.uno:Print'},
{type: 'menu', id: 'print-options', img: 'print', hint: _UNO('.uno:Print', 'text'), mobile: false, tablet: false, lockUno: '.uno:Print',
items: [
{id: 'print-active-sheet', text: _('Active Sheet')},
{id: 'print-all-sheets', text: _('All Sheets')},
{type: 'customtoolitem', id: 'closemobile', desktop: false, mobile: false, tablet: true, visible: false},
{type: 'customtoolitem', id: 'save', command: 'save', text: _UNO('.uno:Save'), lockUno: '.uno:Save'},
{type: 'customtoolitem', id: 'print', command: 'print', text: _UNO('.uno:Print', 'text'), mobile: false, tablet: false, lockUno: '.uno:Print'},
{type: 'menubutton', id: 'printoptions', command: 'printoptions', noLabel: true, text: _UNO('.uno:Print', 'text'), mobile: false, tablet: false, lockUno: '.uno:Print',
menu: [
{id: 'print-active-sheet', action: 'print-active-sheet', text: _('Active Sheet')},
{id: 'print-all-sheets', action: 'print-all-sheets', text: _('All Sheets')},
]
},
{type: 'break', id: 'savebreak', mobile: false},
{type: 'button', id: 'undo', img: 'undo', hint: _UNO('.uno:Undo'), uno: 'Undo', disabled: true, mobile: false},
{type: 'button', id: 'redo', img: 'redo', hint: _UNO('.uno:Redo'), uno: 'Redo', disabled: true, mobile: false},
{type: 'break', id: 'redobreak', mobile: false, tablet: false,},
{type: 'button', id: 'formatpaintbrush', img: 'copyformat', hint: _UNO('.uno:FormatPaintbrush'), uno: 'FormatPaintbrush', mobile: false},
{type: 'button', id: 'reset', img: 'deleteformat', hint: _UNO('.uno:ResetAttributes', 'text'), hidden: true, uno: 'ResetAttributes', mobile: false},
{type: 'button', id: 'resetimpress', img: 'deleteformat', hint: _UNO('.uno:SetDefault', 'presentation', 'true'), hidden: true, uno: 'SetDefault', mobile: false},
{type: 'break', id: 'breakreset', invisible: true, mobile: false, tablet: false,},
{type: 'html', id: 'styles',
html: '<select id="styles-select" class="styles-select"><option>' + _('Default Style') + '</option></select>',
onRefresh: function (edata) {
if (!edata.item.html) {
edata.isCancelled = true;
} else {
$.extend(edata, { onComplete: function (e) {
$('#styles-select').select2();
e.item.html = undefined;
}});
}
}, hidden: true, desktop: true, mobile: false, tablet: false},
{type: 'html', id: 'fonts',
html: '<select id="fonts-select" class="fonts-select"><option>Carlito</option></select>',
onRefresh: function (edata) {
if (!edata.item.html) {
edata.isCancelled = true;
} else {
$.extend(edata, { onComplete: function (e) {
e.item.html = undefined;
}});
}
}, mobile: false},
{type: 'html', id: 'fontsizes',
html: '<select id="fontsizes-select" class="fontsizes-select">',
onRefresh: function (edata) {
if (!edata.item.html) {
edata.isCancelled = true;
} else {
$.extend(edata, { onComplete: function (e) {
e.item.html = undefined;
}});
}
}, mobile: false},
{type: 'break', id: 'breakfontsizes', invisible: true, mobile: false, tablet: false,},
{type: 'button', id: 'bold', img: 'bold', hint: _UNO('.uno:Bold'), uno: 'Bold'},
{type: 'button', id: 'italic', img: 'italic', hint: _UNO('.uno:Italic'), uno: 'Italic'},
{type: 'button', id: 'underline', img: 'underline', hint: _UNO('.uno:Underline'), uno: 'Underline'},
{type: 'button', id: 'strikeout', img: 'strikeout', hint: _UNO('.uno:Strikeout'), uno: 'Strikeout'},
{type: 'break', id: 'breakformatting'},
{type: 'drop', id: 'fontcolor', img: 'textcolor', hint: _UNO('.uno:FontColor'), overlay: { onShow : function() { window.showColorPicker('fontcolor'); }} , html: window.getColorPickerHTML('fontcolor'), lockUno: '.uno:FontColor'},
{type: 'drop', id: 'backcolor', img: 'backcolor', hint: _UNO('.uno:BackColor', 'text'), hidden: true, overlay: { onShow : function() { window.showColorPicker('backcolor'); }} , html: window.getColorPickerHTML('backcolor'), lockUno: '.uno:BackColor'},
{type: 'drop', id: 'backgroundcolor', img: 'backgroundcolor', hint: _UNO('.uno:BackgroundColor'), hidden: true, overlay: { onShow : function() { window.showColorPicker('backgroundcolor'); }} , html: window.getColorPickerHTML('backcolor'), lockUno: '.uno:BackgroundColor'},
{type: 'break' , id: 'breakcolor', mobile:false},
{type: 'button', id: 'leftpara', img: 'alignleft', hint: _UNO('.uno:LeftPara', '', true),
uno: {textCommand: 'LeftPara', objectCommand: 'ObjectAlignLeft'},
hidden: true, unosheet: 'AlignLeft', disabled: true},
{type: 'button', id: 'centerpara', img: 'alignhorizontal', hint: _UNO('.uno:CenterPara', '', true),
uno: {textCommand: 'CenterPara', objectCommand: 'AlignCenter'},
hidden: true, unosheet: 'AlignHorizontalCenter', disabled: true},
{type: 'button', id: 'rightpara', img: 'alignright', hint: _UNO('.uno:RightPara', '', true),
uno: {textCommand: 'RightPara', objectCommand: 'ObjectAlignRight'},
hidden: true, unosheet: 'AlignRight', disabled: true},
{type: 'button', id: 'justifypara', img: 'alignblock', hint: _UNO('.uno:JustifyPara', '', true), uno: 'JustifyPara', hidden: true, unosheet: '', disabled: true},
{type: 'break', id: 'breakpara', hidden: true},
{type: 'drop', id: 'setborderstyle', img: 'setborderstyle', hint: _('Borders'), hidden: true, html: window.getBorderStyleMenuHtml()},
{type: 'button', id: 'togglemergecells', img: 'togglemergecells', hint: _UNO('.uno:ToggleMergeCells', 'spreadsheet', true), hidden: true, uno: 'ToggleMergeCells', disabled: true},
{type: 'break', id: 'breakmergecells', hidden: true},
{type: 'menu', id: 'textalign', img: 'alignblock', hint: _UNO('.uno:TextAlign'), hidden: true, lockUno: '.uno:TextAlign',
items: [
{id: 'alignleft', text: _UNO('.uno:AlignLeft', 'spreadsheet', true), icon: 'alignleft', uno: 'AlignLeft'},
{id: 'alignhorizontalcenter', text: _UNO('.uno:AlignHorizontalCenter', 'spreadsheet', true), icon: 'alignhorizontal', uno: 'AlignHorizontalCenter'},
{id: 'alignright', text: _UNO('.uno:AlignRight', 'spreadsheet', true), icon: 'alignright', uno: 'AlignRight'},
{id: 'alignblock', text: _UNO('.uno:AlignBlock', 'spreadsheet', true), icon: 'alignblock', uno: 'AlignBlock'},
{type: 'break'},
{id: 'aligntop', text: _UNO('.uno:AlignTop', 'spreadsheet', true), icon: 'aligntop', uno: 'AlignTop'},
{id: 'alignvcenter', text: _UNO('.uno:AlignVCenter', 'spreadsheet', true), icon: 'alignvcenter', uno: 'AlignVCenter'},
{id: 'alignbottom', text: _UNO('.uno:AlignBottom', 'spreadsheet', true), icon: 'alignbottom', uno: 'AlignBottom'},
{type: 'separator', orientation: 'vertical', id: 'savebreak', mobile: false},
{type: 'toolitem', id: 'undo', text: _UNO('.uno:Undo'), command: '.uno:Undo', mobile: false},
{type: 'toolitem', id: 'redo', text: _UNO('.uno:Redo'), command: '.uno:Redo', mobile: false},
{type: 'separator', orientation: 'vertical', id: 'redobreak', mobile: false, tablet: false,},
{type: 'toolitem', id: 'formatpaintbrush', text: _UNO('.uno:FormatPaintbrush'), command: '.uno:FormatPaintbrush', mobile: false},
{type: 'toolitem', id: 'reset', text: _UNO('.uno:ResetAttributes', 'text'), visible: false, command: '.uno:ResetAttributes', mobile: false},
{type: 'toolitem', id: 'resetimpress', text: _UNO('.uno:SetDefault', 'presentation', 'true'), visible: false, command: '.uno:SetDefault', mobile: false},
{type: 'separator', orientation: 'vertical', id: 'breakreset', invisible: true, mobile: false, tablet: false,},
{type: 'listbox', id: 'styles', text: _('Default Style'), desktop: true, mobile: false, tablet: false},
{type: 'listbox', id: 'fontnamecombobox', text: 'Carlito', command: '.uno:CharFontName', mobile: false},
{type: 'listbox', id: 'fontsizecombobox', text: '12 pt', command: '.uno:FontHeight', mobile: false,},
{type: 'separator', orientation: 'vertical', id: 'breakfontsizes', invisible: true, mobile: false, tablet: false},
{type: 'toolitem', id: 'bold', text: _UNO('.uno:Bold'), command: '.uno:Bold'},
{type: 'toolitem', id: 'italic', text: _UNO('.uno:Italic'), command: '.uno:Italic'},
{type: 'toolitem', id: 'underline', text: _UNO('.uno:Underline'), command: '.uno:Underline'},
{type: 'toolitem', id: 'strikeout', text: _UNO('.uno:Strikeout'), command: '.uno:Strikeout'},
{type: 'separator', orientation: 'vertical', id: 'breakformatting'},
{type: 'colorlistbox', id: 'fontcolorwriter:ColorPickerMenu', command: '.uno:FontColor', text: _UNO('.uno:FontColor'), visible: false, lockUno: '.uno:FontColor'},
{type: 'colorlistbox', id: 'fontcolor:ColorPickerMenu', command: '.uno:Color', text: _UNO('.uno:FontColor'), lockUno: '.uno:FontColor'},
{type: 'colorlistbox', id: 'backcolor:ColorPickerMenu', command: '.uno:BackColor', text: _UNO('.uno:BackColor', 'text'), visible: false, lockUno: '.uno:BackColor'},
{type: 'colorlistbox', id: 'backgroundcolor:ColorPickerMenu', command: '.uno:BackgroundColor', text: _UNO('.uno:BackgroundColor'), visible: false, lockUno: '.uno:BackgroundColor'},
{type: 'separator', orientation: 'vertical' , id: 'breakcolor', mobile:false},
{type: 'toolitem', id: 'leftpara', command: '.uno:LeftPara', text: _UNO('.uno:LeftPara', '', true), visible: false},
{type: 'toolitem', id: 'centerpara', command: '.uno:CenterPara', text: _UNO('.uno:CenterPara', '', true), visible: false},
{type: 'toolitem', id: 'rightpara', command: '.uno:RightPara', text: _UNO('.uno:RightPara', '', true), visible: false},
{type: 'toolitem', id: 'justifypara', command: '.uno:JustifyPara', text: _UNO('.uno:JustifyPara', '', true), visible: false, unosheet: ''},
{type: 'separator', orientation: 'vertical', id: 'breakpara', visible: false},
{type: 'menubutton', id: 'setborderstyle:BorderStyleMenu', noLabel: true, command: '.uno:SetBorderStyle', text: _('Borders'), visible: false},
{type: 'toolitem', id: 'togglemergecells', text: _UNO('.uno:ToggleMergeCells', 'spreadsheet', true), visible: false, command: '.uno:ToggleMergeCells'},
{type: 'separator', orientation: 'vertical', id: 'breakmergecells', visible: false},
{type: 'menubutton', id: 'textalign', command: 'justifypara', noLabel: true, text: _UNO('.uno:TextAlign'), visible: false, lockUno: '.uno:TextAlign',
menu: [
{id: 'alignleft', text: _UNO('.uno:AlignLeft', 'spreadsheet', true), icon: 'alignleft', uno: '.uno:AlignLeft'},
{id: 'alignhorizontalcenter', text: _UNO('.uno:AlignHorizontalCenter', 'spreadsheet', true), icon: 'alignhorizontal', uno: '.uno:AlignHorizontalCenter'},
{id: 'alignright', text: _UNO('.uno:AlignRight', 'spreadsheet', true), icon: 'alignright', uno: '.uno:AlignRight'},
{id: 'alignblock', text: _UNO('.uno:AlignBlock', 'spreadsheet', true), icon: 'alignblock', uno: '.uno:AlignBlock'},
{type: 'separator'},
{id: 'aligntop', text: _UNO('.uno:AlignTop', 'spreadsheet', true), icon: 'aligntop', uno: '.uno:AlignTop'},
{id: 'alignvcenter', text: _UNO('.uno:AlignVCenter', 'spreadsheet', true), icon: 'alignvcenter', uno: '.uno:AlignVCenter'},
{id: 'alignbottom', text: _UNO('.uno:AlignBottom', 'spreadsheet', true), icon: 'alignbottom', uno: '.uno:AlignBottom'},
]},
{type: 'menu', id: 'linespacing', img: 'linespacing', hint: _UNO('.uno:FormatSpacingMenu'), hidden: true, lockUno: '.uno:FormatSpacingMenu',
items: [
{id: 'spacepara1', img: 'spacepara1', text: _UNO('.uno:SpacePara1'), uno: 'SpacePara1'},
{id: 'spacepara15', img: 'spacepara15', text: _UNO('.uno:SpacePara15'), uno: 'SpacePara15'},
{id: 'spacepara2', img: 'spacepara2', text: _UNO('.uno:SpacePara2'), uno: 'SpacePara2'},
{type: 'break'},
{id: 'paraspaceincrease', img: 'paraspaceincrease', text: _UNO('.uno:ParaspaceIncrease'), uno: 'ParaspaceIncrease'},
{id: 'paraspacedecrease', img: 'paraspacedecrease', text: _UNO('.uno:ParaspaceDecrease'), uno: 'ParaspaceDecrease'}
{type: 'menubutton', id: 'linespacing', command: 'linespacing', noLabel: true, text: _UNO('.uno:FormatSpacingMenu'), visible: false, lockUno: '.uno:FormatSpacingMenu',
menu: [
{id: 'spacepara1', text: _UNO('.uno:SpacePara1'), uno: '.uno:SpacePara1'},
{id: 'spacepara15', text: _UNO('.uno:SpacePara15'), uno: '.uno:SpacePara15'},
{id: 'spacepara2', text: _UNO('.uno:SpacePara2'), uno: '.uno:SpacePara2'},
{type: 'separator'},
{id: 'paraspaceincrease', text: _UNO('.uno:ParaspaceIncrease'), uno: '.uno:ParaspaceIncrease'},
{id: 'paraspacedecrease', text: _UNO('.uno:ParaspaceDecrease'), uno: '.uno:ParaspaceDecrease'}
],
onRefresh: function (event) {
var isChecked = function(command) {
var items = that.map['stateChangeHandler'];
var val = items.getItemValue(command);
if (val && (val === 'true' || val === true))
return true;
else
return false;
};
event.item.selected = null;
for (var i in event.item.items) {
var item = event.item.items[i];
item.checked = false;
if (item.id && item.id.indexOf('spacepara') !== -1) {
item.checked = isChecked('.uno:' + item.uno);
if (item.checked)
event.item.selected = item.id;
}
}
}},
{type: 'button', id: 'wraptext', img: 'wraptext', hint: _UNO('.uno:WrapText', 'spreadsheet', true), hidden: true, uno: 'WrapText', disabled: true},
{type: 'break', id: 'breakspacing', hidden: true},
{type: 'button', id: 'defaultnumbering', img: 'numbering', hint: _UNO('.uno:DefaultNumbering', '', true), hidden: true, uno: 'DefaultNumbering', disabled: true},
{type: 'button', id: 'defaultbullet', img: 'bullet', hint: _UNO('.uno:DefaultBullet', '', true), hidden: true, uno: 'DefaultBullet', disabled: true},
{type: 'break', id: 'breakbullet', hidden: true},
{type: 'button', id: 'incrementindent', img: 'incrementindent', hint: _UNO('.uno:IncrementIndent', '', true), uno: 'IncrementIndent', hidden: true, disabled: true},
{type: 'button', id: 'decrementindent', img: 'decrementindent', hint: _UNO('.uno:DecrementIndent', '', true), uno: 'DecrementIndent', hidden: true, disabled: true},
{type: 'break', id: 'breakindent', hidden: true},
{type: 'drop', id: 'conditionalformaticonset', img: 'conditionalformatdialog', hint: _UNO('.uno:ConditionalFormatMenu', 'spreadsheet', true), hidden: true, html: window.getConditionalFormatMenuHtml(), lockUno: '.uno:ConditionalFormatMenu'},
{type: 'button', id: 'sortascending', img: 'sortascending', hint: _UNO('.uno:SortAscending', 'spreadsheet', true), uno: 'SortAscending', disabled: true, hidden: true},
{type: 'button', id: 'sortdescending', img: 'sortdescending', hint: _UNO('.uno:SortDescending', 'spreadsheet', true), uno: 'SortDescending', disabled: true, hidden: true},
{type: 'break', id: 'breaksorting', hidden: true},
{type: 'button', id: 'numberformatcurrency', img: 'numberformatcurrency', hint: _UNO('.uno:NumberFormatCurrency', 'spreadsheet', true), hidden: true, uno: 'NumberFormatCurrency', disabled: true},
{type: 'button', id: 'numberformatpercent', img: 'numberformatpercent', hint: _UNO('.uno:NumberFormatPercent', 'spreadsheet', true), hidden: true, uno: 'NumberFormatPercent', disabled: true},
{type: 'button', id: 'numberformatdecdecimals', img: 'numberformatdecdecimals', hint: _UNO('.uno:NumberFormatDecDecimals', 'spreadsheet', true), hidden: true, uno: 'NumberFormatDecDecimals', disabled: true},
{type: 'button', id: 'numberformatincdecimals', img: 'numberformatincdecimals', hint: _UNO('.uno:NumberFormatIncDecimals', 'spreadsheet', true), hidden: true, uno: 'NumberFormatIncDecimals', disabled: true},
{type: 'break', id: 'break-number', hidden: true},
{type: 'drop', id: 'inserttable', img: 'inserttable', hint: _('Insert table'), hidden: true, html: window.getInsertTablePopupHtml(), lockUno: '.uno:InsertTable'},
{type: 'button', id: 'insertgraphic', img: 'insertgraphic', hint: _UNO('.uno:InsertGraphic', '', true), lockUno: '.uno:InsertGraphic'},
{type: 'button', id: 'insertremotegraphic', img: 'insertgraphic', hint: _UNO('.uno:InsertGraphic', '', true), hidden: true, lockUno: '.uno:InsertGraphic'},
{type: 'menu', id: 'menugraphic', img: 'insertgraphic', hint: _UNO('.uno:InsertGraphic', '', true), hidden: true, lockUno: '.uno:InsertGraphic',
items: [
{id: 'localgraphic', text: _('Insert Local Image')},
{id: 'remotegraphic', text: _UNO('.uno:InsertGraphic', '', true)},
]},
{type: 'button', id: 'insertobjectchart', img: 'insertobjectchart', hint: _UNO('.uno:InsertObjectChart', '', true), uno: 'InsertObjectChart'},
{type: 'drop', id: 'insertshapes', img: 'basicshapes_ellipse', hint: _('Insert shapes'), html: window.getShapesPopupHtml()},
{type: 'button', id: 'insertline', img: 'line', hint: _UNO('.uno:Line', '', true), uno: 'Line'},
{type: 'drop', id: 'insertconnectors', img: 'connectors_connector', hint: _('Insert connectors'), html: window.getShapesPopupHtml(), hidden: true},
{type: 'break', id: 'breakinsert', desktop: true},
{type: 'button', id: 'inserttextbox', img: 'text', hint: _UNO('.uno:Text', '', true), uno: 'Text?CreateDirectly:bool=true', hidden: true},
{type: 'button', id: 'insertannotation', img: 'annotation', hint: _UNO('.uno:InsertAnnotation', '', true), hidden: true, lockUno: '.uno:InsertAnnotation'},
{type: 'button', id: 'link', img: 'link', hint: _UNO('.uno:HyperlinkDialog', '', true), disabled: true, lockUno: '.uno:HyperlinkDialog'},
{type: 'button', id: 'insertsymbol', img: 'insertsymbol', hint: _UNO('.uno:InsertSymbol', '', true), uno: 'InsertSymbol'},
{type: 'spacer'},
{type: 'break', id: 'breaksidebar', hidden: true},
{type: 'button', id: 'edit', img: 'edit'},
{type: 'button', id: 'sidebar', img: 'sidebar_modify_page', hint: _UNO('.uno:Sidebar', '', true), uno: '.uno:SidebarDeck.PropertyDeck', hidden: true},
{type: 'button', id: 'modifypage', img: 'sidebar_modify_page', hint: _UNO('.uno:ModifyPage', 'presentation', true), uno: '.uno:ModifyPage', hidden: true},
{type: 'button', id: 'slidechangewindow', img: 'sidebar_slide_change', hint: _UNO('.uno:SlideChangeWindow', 'presentation', true), uno: '.uno:SlideChangeWindow', hidden: true},
{type: 'button', id: 'customanimation', img: 'sidebar_custom_animation', hint: _UNO('.uno:CustomAnimation', 'presentation', true), uno: '.uno:CustomAnimation', hidden: true},
{type: 'button', id: 'masterslidespanel', img: 'sidebar_master_slides', hint: _UNO('.uno:MasterSlidesPanel', 'presentation', true), uno: '.uno:MasterSlidesPanel', hidden: true},
{type: 'button', id: 'navigator', img: 'navigator', hint: _UNO('.uno:Navigator'), uno: '.uno:Navigator', hidden: true},
{type: 'button', id: 'fold', img: 'fold', hint: _('Hide Menu'), desktop: true, mobile: false, hidden: true},
{type: 'button', id: 'hamburger-tablet', img: 'fold', desktop: false, mobile: false, tablet: true, iosapptablet: false, hidden: true},
},
{type: 'toolitem', id: 'wraptextbutton', text: _UNO('.uno:WrapText', 'spreadsheet', true), visible: false, command: '.uno:WrapText'},
{type: 'separator', orientation: 'vertical', id: 'breakspacing', visible: false},
{type: 'toolitem', id: 'defaultnumbering', text: _UNO('.uno:DefaultNumbering', '', true), visible: false, command: '.uno:DefaultNumbering'},
{type: 'toolitem', id: 'defaultbullet', text: _UNO('.uno:DefaultBullet', '', true), visible: false, command: '.uno:DefaultBullet'},
{type: 'separator', orientation: 'vertical', id: 'breakbullet', visible: false},
{type: 'toolitem', id: 'incrementindent', text: _UNO('.uno:IncrementIndent', '', true), command: '.uno:IncrementIndent', visible: false},
{type: 'toolitem', id: 'decrementindent', text: _UNO('.uno:DecrementIndent', '', true), command: '.uno:DecrementIndent', visible: false},
{type: 'separator', orientation: 'vertical', id: 'breakindent', visible: false},
{type: 'menubutton', id: 'conditionalformatdialog:ConditionalFormatMenu', noLabel: true, text: _UNO('.uno:ConditionalFormatMenu', 'spreadsheet', true), visible: false, lockUno: '.uno:ConditionalFormatMenu'},
{type: 'toolitem', id: 'sortascending', text: _UNO('.uno:SortAscending', 'spreadsheet', true), command: '.uno:SortAscending', visible: false},
{type: 'toolitem', id: 'sortdescending', text: _UNO('.uno:SortDescending', 'spreadsheet', true), command: '.uno:SortDescending', visible: false},
{type: 'separator', orientation: 'vertical', id: 'breaksorting', visible: false},
{type: 'toolitem', id: 'numberformatcurrency', text: _UNO('.uno:NumberFormatCurrency', 'spreadsheet', true), visible: false, command: '.uno:NumberFormatCurrency'},
{type: 'toolitem', id: 'numberformatpercent', text: _UNO('.uno:NumberFormatPercent', 'spreadsheet', true), visible: false, command: '.uno:NumberFormatPercent'},
{type: 'toolitem', id: 'numberformatdecdecimals', text: _UNO('.uno:NumberFormatDecDecimals', 'spreadsheet', true), visible: false, command: '.uno:NumberFormatDecDecimals'},
{type: 'toolitem', id: 'numberformatincdecimals', text: _UNO('.uno:NumberFormatIncDecimals', 'spreadsheet', true), visible: false, command: '.uno:NumberFormatIncDecimals'},
{type: 'separator', orientation: 'vertical', id: 'break-number', visible: false},
{type: 'menubutton', id: 'inserttable:InsertTableMenu', command: 'inserttable', noLabel: true, text: _('Insert table'), visible: false, lockUno: '.uno:InsertTable'},
{type: 'menubutton', id: 'menugraphic:InsertImageMenu', noLabel: true, command: '.uno:InsertGraphic', text: _UNO('.uno:InsertGraphic', '', true), visible: false, lockUno: '.uno:InsertGraphic'},
{type: 'toolitem', id: 'insertobjectchart', text: _UNO('.uno:InsertObjectChart', '', true), command: '.uno:InsertObjectChart'},
{type: 'menubutton', id: 'insertshapes:InsertShapesMenu', command: '.uno:BasicShapes', noLabel: true, text: _('Insert shapes')},
{type: 'toolitem', id: 'insertline', text: _UNO('.uno:Line', '', true), command: '.uno:Line'},
{type: 'menubutton', id: 'insertconnectors:InsertConnectorsMenu', command: 'connector', noLabel: true, text: _('Insert connectors'), visible: false},
{type: 'separator', orientation: 'vertical', id: 'breakinsert', desktop: true},
{type: 'customtoolitem', id: 'inserttextbox', text: _UNO('.uno:Text', '', true), command: 'inserttextbox', visible: false},
{type: 'customtoolitem', id: 'insertannotation', text: _UNO('.uno:InsertAnnotation', '', true), visible: false, lockUno: '.uno:InsertAnnotation'},
{type: 'customtoolitem', id: 'inserthyperlink', command: 'inserthyperlink', text: _UNO('.uno:HyperlinkDialog', '', true), lockUno: '.uno:HyperlinkDialog'},
{type: 'toolitem', id: 'insertsymbol', text: _UNO('.uno:InsertSymbol', '', true), command: '.uno:InsertSymbol'},
{type: 'spacer', id: 'topspacer'},
{type: 'separator', orientation: 'vertical', id: 'breaksidebar', visible: false},
{type: 'toolitem', id: 'sidebar', text: _UNO('.uno:Sidebar', '', true), command: '.uno:SidebarDeck.PropertyDeck', visible: false},
{type: 'toolitem', id: 'modifypage', text: _UNO('.uno:ModifyPage', 'presentation', true), command: '.uno:ModifyPage', visible: false},
{type: 'toolitem', id: 'slidechangewindow', text: _UNO('.uno:SlideChangeWindow', 'presentation', true), command: '.uno:SlideChangeWindow', visible: false},
{type: 'toolitem', id: 'customanimation', text: _UNO('.uno:CustomAnimation', 'presentation', true), command: '.uno:CustomAnimation', visible: false},
{type: 'toolitem', id: 'masterslidespanel', text: _UNO('.uno:MasterSlidesPanel', 'presentation', true), command: '.uno:MasterSlidesPanel', visible: false},
{type: 'toolitem', id: 'navigator', text: _UNO('.uno:Navigator'), command: '.uno:Navigator', visible: false},
{type: 'customtoolitem', id: 'fold', text: _('Hide Menu'), desktop: true, mobile: false, visible: false},
{type: 'customtoolitem', id: 'hamburger-tablet', desktop: false, mobile: false, tablet: true, iosapptablet: false, visible: false},
];
},
@ -276,78 +227,67 @@ L.Control.TopToolbar = L.Control.extend({
}
},
enableItem(command, enable) {
this.builder.executeAction(this.parentContainer, {
'control_id': command,
'action_type': enable ? 'enable' : 'disable'
});
},
showItem(command, show) {
this.builder.executeAction(this.parentContainer, {
'control_id': command,
'action_type': show ? 'show' : 'hide'
});
JSDialog.RefreshScrollables();
},
create: function() {
$().w2destroy('editbar');
var toolbar = L.DomUtil.get('toolbar-up');
// In case it contains garbage
if (toolbar)
toolbar.remove();
// Use original template as provided by server
$('#toolbar-logo').after(this.map.toolbarUpTemplate.cloneNode(true));
toolbar = $('#toolbar-up');
var that = this;
toolbar.w2toolbar({
name: 'editbar',
items: this.getToolItems(),
onClick: function (e) {
window.onClick(e, e.target);
window.hideTooltip(this, e.target);
},
onRefresh: function(event) {
if (event.item && (event.target === 'styles' || event.target === 'fonts' || event.target === 'fontsizes'
|| event.item.invisible)) {
var toolItem = $(this.box).find('#tb_'+ this.name +'_item_'+ w2utils.escapeId(event.item.id));
if (this.parentContainer.firstChild)
return;
if (event.item.invisible === true) {
toolItem.css('visibility', 'hidden');
}
else if ((window.mode.isDesktop() && event.item.desktop == false)
|| (window.mode.isTablet() && event.item.tablet == false)) {
toolItem.css('display', 'none');
} else {
toolItem.css('display', '');
}
}
var items = this.getToolItems();
this.builder.build(this.parentContainer, items);
if (that.map.isRestrictedUser()) {
for (var i = 0; i < this.items.length; i++) {
var it = this.items[i];
that.map.hideRestrictedItems(it, $('#tb_editbar_item_'+ it.id)[0], $('#tb_editbar_item_'+ it.id)[0]);
}
}
JSDialog.MakeScrollable(this.parentContainer, this.parentContainer.querySelector('div'));
JSDialog.RefreshScrollables();
if (that.map.isLockedUser()) {
for (var i = 0; i < this.items.length; i++) {
var it = this.items[i];
that.map.disableLockedItem(it, $('#tb_editbar_item_'+ it.id)[0], $('#tb_editbar_item_'+ it.id)[0]);
}
}
if (this.map.isRestrictedUser()) {
for (var i = 0; i < items.length; i++) {
var it = items[i];
var item = $('#' + it.id)[0];
this.map.hideRestrictedItems(it, item, item);
}
});
this.map.uiManager.enableTooltip(toolbar);
}
toolbar.bind('touchstart', function() {
w2ui['editbar'].touchStarted = true;
});
if (this.map.isLockedUser()) {
for (var i = 0; i < items.length; i++) {
var it = items[i];
var item = $('#' + it.id)[0];
this.map.disableLockedItem(it, item, item);
}
}
this.map.createFontSelector('#fonts-select');
w2ui['editbar'].resize();
this.map.createFontSelector('#fontnamecombobox-input');
},
onDocLayerInit: function() {
var toolbarUp = w2ui['editbar'];
var docType = this.map.getDocType();
var data;
switch (docType) {
case 'spreadsheet':
if (toolbarUp) {
toolbarUp.show('reset', 'textalign', 'wraptext', 'breakspacing', 'insertannotation', 'conditionalformaticonset',
if (this.parentContainer) {
['reset', 'textalign', 'wraptextbutton', 'breakspacing', 'insertannotation', 'conditionalformatdialog',
'numberformatcurrency', 'numberformatpercent',
'numberformatincdecimals', 'numberformatdecdecimals', 'break-number', 'togglemergecells', 'breakmergecells',
'setborderstyle', 'sortascending', 'sortdescending', 'breaksorting', 'backgroundcolor', 'breaksidebar', 'sidebar', 'print-options');
toolbarUp.hide('print');
toolbarUp.remove('styles');
'setborderstyle', 'sortascending', 'sortdescending', 'breaksorting', 'backgroundcolor', 'breaksidebar', 'sidebar', 'printoptions'
].forEach((id) => {
this.showItem(id, true);
});
this.showItem('print', false);
this.showItem('styles', false);
}
$('#toolbar-wrapper').addClass('spreadsheet');
@ -358,107 +298,108 @@ L.Control.TopToolbar = L.Control.extend({
break;
case 'text':
if (toolbarUp) {
toolbarUp.show('reset', 'leftpara', 'centerpara', 'rightpara', 'justifypara', 'breakpara', 'linespacing',
if (this.parentContainer) {
['fontcolorwriter', 'reset', 'leftpara', 'centerpara', 'rightpara', 'justifypara', 'breakpara', 'linespacing',
'breakspacing', 'defaultbullet', 'defaultnumbering', 'breakbullet', 'incrementindent', 'decrementindent',
'breakindent', 'inserttable', 'insertannotation', 'backcolor', 'breaksidebar', 'sidebar');
toolbarUp.hide('print-options');
'breakindent', 'inserttable', 'insertannotation', 'backcolor', 'breaksidebar', 'sidebar'
].forEach((id) => {
this.showItem(id, true);
});
this.showItem('printoptions', false);
this.showItem('fontcolor', false);
}
break;
case 'presentation':
// Fill the style select box if not yet filled
if ($('#styles-select')[0] && $('#styles-select')[0].length === 1) {
data = [''];
if ($('#styles-input')[0] && $('#styles-input')[0].length === 1) {
var data = [''];
// Inserts a separator element
data = data.concat({text: '\u2500\u2500\u2500\u2500\u2500\u2500', disabled: true});
data = data.concat({text: '\u2500\u2500\u2500\u2500\u2500\u2500', enabled: false});
L.Styles.impressLayout.forEach(function(layout) {
data = data.concat({id: layout.id, text: _(layout.text)});
}, this);
$('#styles-select').select2({
$('#styles-input').select2({
data: data,
placeholder: _UNO('.uno:LayoutStatus', 'presentation')
});
$('#styles-select').on('select2:select', this.onStyleSelect.bind(this));
$('#styles-input').on('select2:select', this.onStyleSelect.bind(this));
}
if (toolbarUp) {
toolbarUp.show('resetimpress', 'breaksidebar', 'modifypage',
if (this.parentContainer) {
['resetimpress', 'breaksidebar', 'modifypage',
'leftpara', 'centerpara', 'rightpara', 'justifypara', 'breakpara', 'linespacing',
'breakspacing', 'defaultbullet', 'defaultnumbering', 'breakbullet', 'inserttextbox', 'inserttable', 'insertannotation', 'backcolor',
'breaksidebar', 'modifypage', 'slidechangewindow', 'customanimation', 'masterslidespanel', 'navigator');
toolbarUp.hide('print-options');
'breaksidebar', 'modifypage', 'slidechangewindow', 'customanimation', 'masterslidespanel', 'navigator'
].forEach((id) => {
this.showItem(id, true);
});
this.showItem('printoptions', false);
}
break;
case 'drawing':
if (toolbarUp) {
toolbarUp.show('leftpara', 'centerpara', 'rightpara', 'justifypara', 'breakpara', 'linespacing',
if (this.parentContainer) {
['leftpara', 'centerpara', 'rightpara', 'justifypara', 'breakpara', 'linespacing',
'breakspacing', 'defaultbullet', 'defaultnumbering', 'breakbullet', 'inserttextbox', 'inserttable', 'backcolor',
'breaksidebar', 'sidebar', 'insertconnectors');
toolbarUp.hide('print-options');
'breaksidebar', 'sidebar', 'insertconnectors'
].forEach((id) => {
this.showItem(id, true);
});
this.showItem('printoptions', false);
}
break;
}
window.updateVisibilityForToolbar(w2ui['editbar']);
window.updateVisibilityForToolbar(this);
if (toolbarUp)
toolbarUp.refresh();
this.map.createFontSizeSelector('#fontsizecombobox-input');
this.map.createFontSizeSelector('#fontsizes-select');
JSDialog.RefreshScrollables();
},
onUpdatePermission: function(e) {
if (e.perm === 'edit') {
// Enable list boxes
$('#styles-select').prop('disabled', false);
$('#fonts-select').prop('disabled', false);
$('#fontsizes-select').prop('disabled', false);
$('#styles-input').prop('disabled', false);
$('#fontnamecombobox-input').prop('disabled', false);
$('#fontsizecombobox-input').prop('disabled', false);
} else {
// Disable list boxes
$('#styles-select').prop('disabled', true);
$('#fonts-select').prop('disabled', true);
$('#fontsizes-select').prop('disabled', true);
$('#styles-input').prop('disabled', true);
$('#fontnamecombobox-input').prop('disabled', true);
$('#fontsizecombobox-input').prop('disabled', true);
}
},
onWopiProps: function(e) {
if (e.HideSaveOption) {
w2ui['editbar'].hide('save');
this.showItem('save', false);
}
if (e.HidePrintOption) {
w2ui['editbar'].hide('print');
this.showItem('print', false);
}
// On desktop we only have Save and Print buttons before the first
// splitter/break. Hide the splitter if we hid both save and print.
// TODO: Apply the same logic to mobile/tablet to avoid beginning with a splitter.
if (window.mode.isDesktop() && e.HideSaveOption && e.HidePrintOption) {
w2ui['editbar'].hide('savebreak');
this.showItem('savebreak', false);
}
if (w2ui['editbar']) {
if (e.EnableInsertRemoteImage && !e.DisableInsertLocalImage) {
w2ui['editbar'].hide('insertgraphic');
w2ui['editbar'].hide('insertremotegraphic');
w2ui['editbar'].show('menugraphic');
if (this.parentContainer) {
if (e.EnableInsertRemoteImage || !e.DisableInsertLocalImage) {
this.showItem('menugraphic', true);
} else {
w2ui['editbar'].hide('menugraphic');
if (e.EnableInsertRemoteImage) {
w2ui['editbar'].show('insertremotegraphic');
} else {
w2ui['editbar'].hide('insertremotegraphic');
}
if (e.DisableInsertLocalImage) {
w2ui['editbar'].hide('insertgraphic');
} else {
w2ui['editbar'].show('insertgraphic');
}
this.showItem('menugraphic', false);
}
}
},
// TODO: create dedicated widget for styles listbox
updateCommandValues: function(e) {
var data = [];
var commandValues;
@ -497,7 +438,7 @@ L.Control.TopToolbar = L.Control.extend({
if (topStyles.length > 0) {
// Inserts a separator element
data = data.concat({text: '\u2500\u2500\u2500\u2500\u2500\u2500', disabled: true});
data = data.concat({text: '\u2500\u2500\u2500\u2500\u2500\u2500', enabled: false});
topStyles.forEach(function (style) {
data = data.concat({id: style, text: L.Styles.styleMappings[style].toLocaleString()});
@ -506,7 +447,7 @@ L.Control.TopToolbar = L.Control.extend({
if (styles !== undefined && styles.length > 0) {
// Inserts a separator element
data = data.concat({text: '\u2500\u2500\u2500\u2500\u2500\u2500', disabled: true});
data = data.concat({text: '\u2500\u2500\u2500\u2500\u2500\u2500', enabled: false});
styles.forEach(function (style) {
var localeStyle;
@ -522,16 +463,13 @@ L.Control.TopToolbar = L.Control.extend({
}, this);
}
$('#styles-select').select2({
$('#styles-input').select2({
data: data,
placeholder: _('Style')
});
$('#styles-select').val(this.options.stylesSelectValue).trigger('change');
$('#styles-select').on('select2:select', this.onStyleSelect.bind(this));
$('#styles-input').val(this.options.stylesSelectValue).trigger('change');
$('#styles-input').on('select2:select', this.onStyleSelect.bind(this));
}
if (w2ui['editbar'])
w2ui['editbar'].resize();
},
processStateChangedCommand: function(commandName, state) {
@ -547,7 +485,7 @@ L.Control.TopToolbar = L.Control.extend({
return;
}
$('#styles-select option').each(function () {
$('#styles-input option').each(function () {
var value = this.value;
// For writer we get UI names; ideally we should be getting only programmatic ones
// For eg: 'Text body' vs 'Text Body'
@ -560,16 +498,13 @@ L.Control.TopToolbar = L.Control.extend({
});
if (!found) {
// we need to add the size
$('#styles-select')
$('#styles-input')
.append($('<option></option>')
.text(state));
}
this.options.stylesSelectValue = state;
$('#styles-select').val(state).trigger('change');
}
else if (commandName === '.uno:CharFontName') {
this.options.fontsSelectValue = state;
$('#styles-input').val(state).trigger('change');
}
window.processStateChangedCommand(commandName, state);

View File

@ -350,6 +350,9 @@ L.Map.include({
},
sendUnoCommand: function (command, json, force) {
if (command.indexOf('.uno:') < 0)
console.error('Trying to send uno command without prefix: "' + command + '"');
if ((command.startsWith('.uno:Sidebar') && !command.startsWith('.uno:SidebarShow')) ||
command.startsWith('.uno:SlideChangeWindow') || command.startsWith('.uno:CustomAnimation') ||
command.startsWith('.uno:MasterSlidesPanel') || command.startsWith('.uno:ModifyPage') ||

View File

@ -17,12 +17,38 @@ class Dispatcher {
private actionsMap: any = {};
private addGeneralCommands() {
this.actionsMap['save'] = function () {
// Save only when not read-only.
if (!app.map.isReadOnlyMode()) {
app.map.fire('postMessage', {
msgId: 'UI_Save',
args: { source: 'toolbar' },
});
if (!app.map._disableDefaultAction['UI_Save']) {
app.map.save(
false /* An explicit save should terminate cell edit */,
false /* An explicit save should save it again */,
);
}
}
};
this.actionsMap['print'] = function () {
app.map.print();
};
this.actionsMap['remotelink'] = function () {
app.map.fire('postMessage', { msgId: 'UI UI_PickLink' });
};
// TODO: deduplicate
this.actionsMap['hyperlinkdialog'] = function () {
app.map.showHyperlinkDialog();
};
this.actionsMap['inserthyperlink'] = () => {
if (app.map.getDocType() == 'spreadsheet')
app.map.sendUnoCommand('.uno:HyperlinkDialog');
else app.map.showHyperlinkDialog();
};
this.actionsMap['rev-history'] = function () {
app.map.openRevisionHistory();
};
@ -141,6 +167,13 @@ class Dispatcher {
if (app.map._docLayer._docType === 'text') app.map.goToPage('next');
else app.map.setPart('next');
};
this.actionsMap['inserttextbox'] = () => {
app.map.sendUnoCommand('.uno:Text?CreateDirectly:bool=true');
};
this.actionsMap['insertannotation'] = () => {
app.map.insertComment();
};
}
private addExportCommands() {
@ -339,6 +372,34 @@ class Dispatcher {
this.actionsMap['insertpage'] = function () {
app.map.insertPage();
};
this.actionsMap['leftpara'] = function () {
app.map.sendUnoCommand(
(window as any).getUNOCommand({
textCommand: '.uno:LeftPara',
objectCommand: '.uno:ObjectAlignLeft',
unosheet: '.uno:AlignLeft',
}),
);
};
this.actionsMap['centerpara'] = function () {
app.map.sendUnoCommand(
(window as any).getUNOCommand({
textCommand: '.uno:CenterPara',
objectCommand: '.uno:AlignCenter',
unosheet: '.uno:AlignHorizontalCenter',
}),
);
};
this.actionsMap['rightpara'] = function () {
app.map.sendUnoCommand(
(window as any).getUNOCommand({
textCommand: '.uno:RightPara',
objectCommand: '.uno:ObjectAlignRight',
unosheet: '.uno:AlignRight',
}),
);
};
}
private addZoteroCommands() {

View File

@ -8,10 +8,10 @@ var helper = require('./helper');
function showSidebar() {
cy.log('>> showSidebar - start');
cy.cGet('#tb_editbar_item_sidebar .w2ui-button').should('not.have.class', 'checked');
cy.cGet('#sidebar').should('not.have.class', 'selected');
cy.cGet('#sidebar-dock-wrapper').should('not.be.visible');
cy.cGet('#tb_editbar_item_sidebar .w2ui-button').click({force: true});
cy.cGet('#tb_editbar_item_sidebar .w2ui-button').should('have.class', 'checked');
cy.cGet('#sidebar').click({force: true});
cy.cGet('#sidebar').should('have.class', 'selected');
cy.cGet('#sidebar-dock-wrapper').should('be.visible');
cy.log('<< showSidebar - end');
@ -22,15 +22,27 @@ function showSidebar() {
function hideSidebar() {
cy.log('>> hideSidebar - start');
cy.cGet('#tb_editbar_item_sidebar .w2ui-button').should('have.class', 'checked');
cy.cGet('#sidebar').should('have.class', 'selected');
cy.cGet('#sidebar-dock-wrapper').should('be.visible');
cy.cGet('#tb_editbar_item_sidebar .w2ui-button').click({force: true});
cy.cGet('#tb_editbar_item_sidebar .w2ui-button').should('not.have.class', 'checked');
cy.cGet('#sidebar').click({force: true});
cy.cGet('#sidebar').should('not.have.class', 'selected');
cy.cGet('#sidebar-dock-wrapper').should('not.be.visible');
cy.log('<< hideSidebar - end');
}
function hideSidebarImpress() {
cy.log('>> hideSidebarImpress - start');
cy.cGet('#modifypage').should('have.class', 'selected');
cy.cGet('#sidebar-dock-wrapper').should('be.visible');
cy.cGet('#modifypage button').click({force: true});
cy.cGet('#modifypage').should('not.have.class', 'selected');
cy.cGet('#sidebar-dock-wrapper').should('not.be.visible');
cy.log('<< hideSidebarImpress - end');
}
// Make the status bar visible if it's hidden at the moment.
// We use the menu option under 'View' menu to make it visible.
function showStatusBarIfHidden() {
@ -56,7 +68,7 @@ function showStatusBarIfHidden() {
function showSidebarIfHidden() {
cy.log('>> showSidebarIfHidden - start');
cy.get('#tb_editbar_item_sidebar .w2ui-button')
cy.get('#sidebar')
.then(function(sidebarItem) {
if (!sidebarItem.hasClass('checked')) {
showSidebar();
@ -73,7 +85,7 @@ function showSidebarIfHidden() {
function hideSidebarIfVisible() {
cy.log('>> hideSidebarIfVisible - start');
cy.get('#tb_editbar_item_sidebar .w2ui-button')
cy.get('#sidebar')
.then(function(sidebarItem) {
if (sidebarItem.hasClass('checked')) {
hideSidebar();
@ -89,16 +101,6 @@ function hideSidebarIfVisible() {
// Select a color from colour palette widget used on top toolbar.
// Parameters:
// color - a hexadecimal color code without the '#' mark (e.g. 'FF011B')
function selectColorFromPaletteClassic(color) {
cy.log('>> selectColorFromPalette - start');
cy.cGet('.w2ui-overlay').should('be.visible');
cy.cGet('.w2ui-color [name="' + color + '"]').click();
cy.cGet('.w2ui-overlay').should('not.exist');
cy.log('<< selectColorFromPalette - end');
}
function selectColorFromPalette(color) {
cy.log('>> selectColorFromPalette - start');
@ -511,11 +513,11 @@ function setAccessibilityState(enable) {
module.exports.showSidebar = showSidebar;
module.exports.hideSidebar = hideSidebar;
module.exports.hideSidebarImpress = hideSidebarImpress;
module.exports.showStatusBarIfHidden = showStatusBarIfHidden;
module.exports.showSidebarIfHidden = showSidebarIfHidden;
module.exports.hideSidebarIfVisible = hideSidebarIfVisible;
module.exports.selectColorFromPalette = selectColorFromPalette;
module.exports.selectColorFromPaletteClassic = selectColorFromPaletteClassic;
module.exports.selectFromListbox = selectFromListbox;
module.exports.selectFromJSDialogListbox = selectFromJSDialogListbox;
module.exports.checkDialogAndClose = checkDialogAndClose;

View File

@ -6,9 +6,9 @@
function showSearchBar() {
cy.log('>> showSearchBar - start');
cy.cGet('#tb_editbar_item_showsearchbar').click();
cy.cGet('#tb_editbar_item_showsearchbar .w2ui-button').click();
cy.cGet('input#search-input').should('be.visible');
cy.cGet('#tb_editbar_item_bold').should('not.be.visible');
cy.cGet('#tb_editbar_item_bold .w2ui-button').should('not.be.visible');
cy.cGet('#tb_searchbar_item_searchprev').should('have.class', 'disabled');
cy.cGet('#tb_searchbar_item_searchnext').should('have.class', 'disabled');
cy.cGet('#tb_searchbar_item_cancelsearch').should('not.be.visible');
@ -110,7 +110,7 @@ function closeSearchBar() {
cy.cGet('#tb_searchbar_item_hidesearchbar').click();
cy.cGet('input#search-input').should('not.be.visible');
cy.cGet('#tb_editbar_item_bold').should('be.visible');
cy.cGet('#tb_editbar_item_bold .w2ui-button').should('be.visible');
cy.log('<< closeSearchBar - end');
}

View File

@ -99,8 +99,8 @@ describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'AutoFilter', function() {
it('Filter by color', function() {
// apply background color to some cells
calcHelper.selectCellsInRange('A2:A2');
cy.cGet('#tb_editbar_item_backgroundcolor').click();
desktopHelper.selectColorFromPaletteClassic('8E7CC3');
cy.cGet('#backgroundcolor .arrowbackground').click();
desktopHelper.selectColorFromPalette('8E7CC3');
calcHelper.openAutoFilterMenu();

View File

@ -11,7 +11,7 @@ describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Test jumping on large cell
helper.beforeAll(testFileName, 'calc');
desktopHelper.switchUIToCompact();
cy.cGet('#toolbar-up .w2ui-scroll-right').click();
cy.cGet('#tb_editbar_item_sidebar').click();
cy.cGet('#sidebar').click();
});
afterEach(function() {
@ -33,7 +33,7 @@ describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Test jumping on large cell
helper.beforeAll(testFileName, 'calc');
desktopHelper.switchUIToCompact();
cy.cGet('#toolbar-up .w2ui-scroll-right').click();
cy.cGet('#tb_editbar_item_sidebar').click();
cy.cGet('#sidebar').click();
});
afterEach(function() {

View File

@ -28,7 +28,7 @@ describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Delete Objects', function(
it('Delete Shapes', function() {
cy.cGet('#toolbar-up > .w2ui-scroll-right').click();
cy.cGet('#tb_editbar_item_insertshapes').click();
cy.cGet('#insertshapes').click();
cy.cGet('.col.w2ui-icon.symbolshapes').should($el => { expect(Cypress.dom.isDetached($el)).to.eq(false); }).click();
cy.cGet('.leaflet-control-buttons-disabled path.leaflet-interactive')
@ -44,7 +44,7 @@ describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Delete Objects', function(
it('Delete Chart' , function() {
cy.cGet('#toolbar-up > .w2ui-scroll-right').click();
//insert
cy.cGet('#tb_editbar_item_insertobjectchart').click();
cy.cGet('#insertobjectchart').click();
cy.cGet('.ui-pushbutton.jsdialog.button-primary').should($el => { expect(Cypress.dom.isDetached($el)).to.eq(false); }).click();
cy.cGet('.leaflet-control-buttons-disabled path.leaflet-interactive').should('exist');
//delete

View File

@ -10,7 +10,7 @@ describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Scroll through document',
helper.beforeAll(testFileName, 'calc');
desktopHelper.switchUIToCompact();
cy.cGet('#toolbar-up .w2ui-scroll-right').click();
cy.cGet('#tb_editbar_item_sidebar').click();
cy.cGet('#sidebar').click();
});
afterEach(function() {

View File

@ -25,8 +25,8 @@ describe(['tagdesktop'], 'Top toolbar tests.', function() {
}
it('Save.', { defaultCommandTimeout: 60000 }, function() {
cy.cGet('#tb_editbar_item_bold').click();
cy.cGet('#tb_editbar_item_save').click();
cy.cGet('#bold').click();
cy.cGet('#save').click();
helper.reload(testFileName, 'calc', true);
cy.log('reload happened');
@ -38,8 +38,8 @@ describe(['tagdesktop'], 'Top toolbar tests.', function() {
helper.typeIntoDocument('{downarrow}');
// Apply bold and try to clone it to the whole word.
cy.cGet('#tb_editbar_item_bold').click();
cy.cGet('#tb_editbar_item_formatpaintbrush').click();
cy.cGet('#bold').click();
cy.cGet('#toolbar-up #formatpaintbrush').click();
calcHelper.clickOnFirstCell(true,false);
@ -60,8 +60,8 @@ describe(['tagdesktop'], 'Top toolbar tests.', function() {
cy.stub(win, 'open').as('windowOpen');
});
cy.cGet('#tb_editbar_item_print-options .w2ui-tb-down').click();
cy.cGet('body').contains('.menu-text', 'Active Sheet').click();
cy.cGet('#toolbar-up #printoptions .arrowbackground').click();
cy.cGet('body').contains('.ui-combobox-entry', 'Active Sheet').click();
cy.get('@windowOpen').should('be.called');
});
@ -80,7 +80,7 @@ describe(['tagdesktop'], 'Top toolbar tests.', function() {
calcHelper.clickOnFirstCell();
cy.cGet('.w2ui-tb-image.w2ui-icon.wraptext').click();
cy.cGet('#toolbar-up .unoWrapText').click();
helper.typeIntoDocument('{enter}');
// We use the text position as indicator
@ -105,18 +105,18 @@ describe(['tagdesktop'], 'Top toolbar tests.', function() {
// Despite the selection is there, merge cells needs more time here.
cy.wait(1000);
cy.cGet('.w2ui-tb-image.w2ui-icon.togglemergecells').click();
cy.cGet('#toolbar-up #togglemergecells').click();
desktopHelper.checkDialogAndClose('Merge Cells');
});
it('Clear Direct formatting.', function() {
cy.cGet('#tb_editbar_item_bold').click();
cy.cGet('#bold').click();
calcHelper.selectEntireSheet();
cy.cGet('#copy-paste-container table td b').should('exist');
cy.cGet('#tb_editbar_item_reset').click();
cy.cGet('#reset').click();
calcHelper.selectEntireSheet();
@ -124,7 +124,7 @@ describe(['tagdesktop'], 'Top toolbar tests.', function() {
});
it('Apply font style.', function() {
cy.cGet('#tb_editbar_item_fonts').click();
cy.cGet('#toolbar-up #fontnamecombobox').click();
desktopHelper.selectFromListbox('Alef');
calcHelper.selectEntireSheet();
helper.waitUntilIdle('#copy-paste-container');
@ -132,46 +132,46 @@ describe(['tagdesktop'], 'Top toolbar tests.', function() {
});
it('Apply font size.', function() {
cy.cGet('#tb_editbar_item_fontsizes').click();
cy.cGet('#toolbar-up #fontsizecombobox').click();
desktopHelper.selectFromListbox('12');
calcHelper.selectEntireSheet();
cy.cGet('#copy-paste-container table td font').should('have.attr', 'size', '3');
});
it('Apply bold font.', function() {
cy.cGet('#tb_editbar_item_bold').click();
cy.cGet('#bold').click();
calcHelper.selectEntireSheet();
cy.cGet('#copy-paste-container table td b').should('exist');
});
it('Apply underline.', function() {
cy.cGet('#tb_editbar_item_underline').click();
cy.cGet('#underline').click();
calcHelper.selectEntireSheet();
cy.cGet('#copy-paste-container table td u').should('exist');
});
it('Apply italic.', function() {
cy.cGet('#tb_editbar_item_italic').click();
cy.cGet('#italic').click();
calcHelper.selectEntireSheet();
cy.cGet('#copy-paste-container table td i').should('exist');
});
it('Apply strikethrough.', function() {
cy.cGet('#tb_editbar_item_strikeout').click();
cy.cGet('#strikeout').click();
calcHelper.selectEntireSheet();
cy.cGet('#copy-paste-container table td s').should('exist');
});
it('Apply highlight color.', function() {
cy.cGet('#tb_editbar_item_backgroundcolor').click();
desktopHelper.selectColorFromPaletteClassic('8E7CC3');
cy.cGet('#backgroundcolor .arrowbackground').click();
desktopHelper.selectColorFromPalette('8E7CC3');
calcHelper.selectEntireSheet();
cy.cGet('#copy-paste-container table td').should('have.attr', 'bgcolor', '#8E7CC3');
});
it('Apply font color.', function() {
cy.cGet('#tb_editbar_item_fontcolor').click();
desktopHelper.selectColorFromPaletteClassic('FFF2CC');
cy.cGet('#fontcolor .arrowbackground').click();
desktopHelper.selectColorFromPalette('FFF2CC');
calcHelper.selectEntireSheet();
cy.cGet('#copy-paste-container table td font').should('have.attr', 'color', '#FFF2CC');
});
@ -179,7 +179,7 @@ describe(['tagdesktop'], 'Top toolbar tests.', function() {
it('Add/Delete decimal places', function() {
// Add decimal place
cy.cGet('#toolbar-up .w2ui-scroll-right').click();
cy.cGet('#tb_editbar_item_numberformatincdecimals').click();
cy.cGet('#numberformatincdecimals').click();
calcHelper.selectEntireSheet();
var regex = new RegExp(';0;0.0$');
@ -190,7 +190,7 @@ describe(['tagdesktop'], 'Top toolbar tests.', function() {
// Delete Decimal place
calcHelper.clickOnFirstCell();
cy.cGet('#tb_editbar_item_numberformatdecdecimals').click();
cy.cGet('#numberformatdecdecimals').click();
calcHelper.selectEntireSheet();
regex = new RegExp(';0;0$');
@ -200,7 +200,7 @@ describe(['tagdesktop'], 'Top toolbar tests.', function() {
});
it('Format as currency.', function() {
cy.cGet('#tb_editbar_item_numberformatcurrency').click();
cy.cGet('#numberformatcurrency').click();
calcHelper.selectEntireSheet();
@ -211,7 +211,7 @@ describe(['tagdesktop'], 'Top toolbar tests.', function() {
});
it('Format as Percent.', function() {
cy.cGet('#tb_editbar_item_numberformatpercent').click();
cy.cGet('#numberformatpercent').click();
calcHelper.selectEntireSheet();
@ -223,16 +223,16 @@ describe(['tagdesktop'], 'Top toolbar tests.', function() {
it('Apply left/right alignment', function() {
// Set right aligment first
cy.cGet('#tb_editbar_item_textalign .w2ui-tb-down').click();
cy.cGet('body').contains('.menu-text', 'Align Right').click();
cy.cGet('#textalign .arrowbackground').click();
cy.cGet('body').contains('.ui-combobox-entry', 'Align Right').click();
calcHelper.selectEntireSheet();
cy.cGet('#copy-paste-container table td').should('have.attr', 'align', 'right');
// Change alignment back
calcHelper.clickOnFirstCell();
cy.cGet('#tb_editbar_item_textalign .w2ui-tb-down').click();
cy.cGet('body').contains('.menu-text', 'Align Left').click({force: true}); // tooltip
cy.cGet('#textalign .arrowbackground').click();
cy.cGet('body').contains('.ui-combobox-entry', 'Align Left').click({force: true}); // tooltip
calcHelper.selectEntireSheet();
cy.cGet('#copy-paste-container table td').should('have.attr', 'align', 'left');
});

View File

@ -90,7 +90,7 @@ describe.skip(['tagdesktop'], 'Scroll through document, insert/delete items', fu
cy.cGet('#toolbar-up > .w2ui-scroll-right').click();
//Insert Shape
cy.cGet('#tb_editbar_item_insertshapes').click();
cy.cGet('#insertshapes').click();
cy.cGet('.col.w2ui-icon.symbolshapes').click();
checkIfItemSelectedAndVisible('Shape 1 (Shape)');
//delete
@ -98,7 +98,7 @@ describe.skip(['tagdesktop'], 'Scroll through document, insert/delete items', fu
checkIfItemNotExist('Shape 1 (Shape)');
//Insert Chart
cy.cGet('#tb_editbar_item_insertobjectchart').click();
cy.cGet('#insertobjectchart').click();
checkIfItemSelectedAndVisible('Object 4');
//delete
helper.typeIntoDocument('{del}');

View File

@ -12,7 +12,7 @@ describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Apply paragraph properties
testFileName = helper.beforeAll(origTestFileName, 'impress');
desktopHelper.switchUIToCompact();
cy.cGet('#toolbar-up > .w2ui-scroll-right').click();
cy.cGet('#tb_editbar_item_modifypage').click();
cy.cGet('#modifypage').click();
impressHelper.selectTextShapeInTheCenter();
});
@ -25,12 +25,12 @@ describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Apply paragraph properties
.should('have.attr', 'x', '1400');
impressHelper.selectTextOfShape();
cy.cGet('#tb_editbar_item_rightpara').click();
cy.cGet('#rightpara').click();
impressHelper.triggerNewSVGForShapeInTheCenter();
cy.cGet('.leaflet-pane.leaflet-overlay-pane g.Page .TextParagraph .TextPosition')
.should('have.attr', 'x', '23586');
cy.cGet('#tb_editbar_item_leftpara').click();
cy.cGet('#leftpara').click();
impressHelper.triggerNewSVGForShapeInTheCenter();
cy.cGet('.leaflet-pane.leaflet-overlay-pane g.Page .TextParagraph .TextPosition')
@ -42,7 +42,7 @@ describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Apply paragraph properties
.should('have.attr', 'x', '1400');
impressHelper.selectTextOfShape();
cy.cGet('#tb_editbar_item_centerpara').click();
cy.cGet('#centerpara').click();
impressHelper.triggerNewSVGForShapeInTheCenter();
cy.cGet('.leaflet-pane.leaflet-overlay-pane g.Page .TextParagraph .TextPosition')
@ -54,14 +54,14 @@ describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Apply paragraph properties
.should('have.attr', 'x', '1400');
impressHelper.selectTextOfShape();
cy.cGet('#tb_editbar_item_rightpara').click();
cy.cGet('#rightpara').click();
impressHelper.triggerNewSVGForShapeInTheCenter();
cy.cGet('.leaflet-pane.leaflet-overlay-pane g.Page .TextParagraph .TextPosition')
.should('have.attr', 'x', '23586');
impressHelper.selectTextOfShape();
cy.cGet('#tb_editbar_item_justifypara').click();
cy.cGet('#justifypara').click();
impressHelper.triggerNewSVGForShapeInTheCenter();
cy.cGet('.leaflet-pane.leaflet-overlay-pane g.Page .TextParagraph .TextPosition')
@ -74,7 +74,7 @@ describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Apply paragraph properties
.should('not.exist');
impressHelper.selectTextOfShape();
cy.cGet('#tb_editbar_item_defaultbullet').click();
cy.cGet('#defaultbullet').click();
impressHelper.triggerNewSVGForShapeInTheCenter();
cy.cGet('.leaflet-pane.leaflet-overlay-pane g.Page .BulletChars')
@ -87,7 +87,7 @@ describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Apply paragraph properties
.should('not.have.attr', 'ooo:numbering-type');
impressHelper.selectTextOfShape();
cy.cGet('#tb_editbar_item_defaultnumbering').click();
cy.cGet('#defaultnumbering').click();
impressHelper.triggerNewSVGForShapeInTheCenter();
cy.cGet('.leaflet-pane.leaflet-overlay-pane g.Page .SVGTextShape tspan')
@ -101,8 +101,8 @@ describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Apply paragraph properties
impressHelper.selectTextOfShape();
// Need to wait for click to work, not sure why
cy.wait(500);
cy.cGet('#tb_editbar_item_linespacing').click();
cy.cGet('body').contains('td','Increase Paragraph Spacing').click();
cy.cGet('#linespacing').click();
cy.cGet('#linespacing-dropdown .ui-combobox-entry').contains('Increase Paragraph Spacing').click();
impressHelper.triggerNewSVGForShapeInTheCenter();
@ -110,8 +110,8 @@ describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Apply paragraph properties
.should('have.attr', 'y', '6700');
impressHelper.selectTextOfShape();
cy.cGet('#tb_editbar_item_linespacing').click();
cy.cGet('body').contains('td','Decrease Paragraph Spacing').click();
cy.cGet('#linespacing').click();
cy.cGet('#linespacing-dropdown .ui-combobox-entry').contains('Decrease Paragraph Spacing').click();
impressHelper.triggerNewSVGForShapeInTheCenter();

View File

@ -31,7 +31,7 @@ describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Delete Objects', function(
cy.cGet('#toolbar-up > .w2ui-scroll-right').click();
cy.wait(1000);
//insert
cy.cGet('#tb_editbar_item_insertshapes').click();
cy.cGet('#insertshapes').click();
cy.cGet('.col.w2ui-icon.symbolshapes').should($el => { expect(Cypress.dom.isDetached($el)).to.eq(false); }).click();
cy.cGet('.leaflet-control-buttons-disabled path.leaflet-interactive').should('exist');
@ -43,7 +43,7 @@ describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Delete Objects', function(
it('Delete Chart' , function() {
cy.cGet('#toolbar-up > .w2ui-scroll-right').click();
//insert
cy.cGet('#tb_editbar_item_insertobjectchart').click();
cy.cGet('#insertobjectchart').click();
cy.cGet('.leaflet-control-buttons-disabled path.leaflet-interactive').should('exist');
//delete
helper.typeIntoDocument('{del}');

View File

@ -35,7 +35,7 @@ describe(['taga11yenabled'], 'Editable area - Basic typing and caret moving', fu
helper.beforeAll(testFileName, 'impress');
desktopHelper.switchUIToCompact();
cy.cGet('#toolbar-up > .w2ui-scroll-right').click();
cy.cGet('#tb_editbar_item_modifypage').click();
cy.cGet('#modifypage').click();
cy.cGet('div.clipboard').as('clipboard');
});
@ -162,4 +162,4 @@ describe(['taga11yenabled'], 'Editable area - Basic typing and caret moving', fu
ceHelper.checkHTMLContent('');
});
});
});

View File

@ -90,7 +90,7 @@ describe.skip(['tagdesktop'], 'Scroll through document, insert/delete items', fu
cy.cGet('#toolbar-up > .w2ui-scroll-right').click();
//Insert Shape
cy.cGet('#tb_editbar_item_insertshapes').click();
cy.cGet('#insertshapes').click();
cy.cGet('.col.w2ui-icon.symbolshapes').click();
checkIfItemSelectedAndVisible('Shape 3 (Shape)');
//delete
@ -98,7 +98,7 @@ describe.skip(['tagdesktop'], 'Scroll through document, insert/delete items', fu
checkIfItemNotExist('Shape 3 (Shape)');
//Insert Chart
cy.cGet('#tb_editbar_item_insertobjectchart').click();
cy.cGet('#insertobjectchart').click();
checkIfItemSelectedAndVisible('Object 4');
//delete
helper.typeIntoDocument('{del}');

View File

@ -16,7 +16,7 @@ describe.skip(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Open different file t
cy.cGet('#toolbar-up .w2ui-scroll-right').click();
cy.cGet('#tb_editbar_item_modifypage').click();
cy.cGet('#modifypage').click();
}
afterEach(function() {

View File

@ -10,7 +10,7 @@ describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Scroll through document',
helper.beforeAll(testFileName, 'impress');
desktopHelper.switchUIToCompact();
cy.cGet('#toolbar-up .w2ui-scroll-right').click();
cy.cGet('#tb_editbar_item_modifypage').click();
cy.cGet('#modifypage').click();
desktopHelper.selectZoomLevel('200');
});

View File

@ -17,10 +17,10 @@ describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Sidebar Tests', function()
});
it.skip('Switch to slide transition Deck', function() {
cy.cGet('#tb_editbar_item_slidechangewindow .w2ui-button').should('not.have.class', 'checked');
cy.cGet('#slidechangewindow .w2ui-button').should('not.have.class', 'checked');
cy.cGet('#layoutvalueset').should('be.visible');
cy.cGet('#tb_editbar_item_slidechangewindow .w2ui-button').click({force: true});
cy.cGet('#tb_editbar_item_slidechangewindow .w2ui-button').should('have.class', 'checked');
cy.cGet('#slidechangewindow .w2ui-button').click({force: true});
cy.cGet('#slidechangewindow .w2ui-button').should('have.class', 'checked');
cy.cGet('#layoutvalueset').should('not.exist');
cy.cGet('#transitions_iconswin').should('be.visible');
});

View File

@ -15,7 +15,7 @@ describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Top toolbar tests.', funct
if (Cypress.env('INTEGRATION') === 'nextcloud') {
desktopHelper.hideSidebarIfVisible();
} else {
desktopHelper.hideSidebar();
desktopHelper.hideSidebarImpress();
}
});
@ -25,7 +25,7 @@ describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Top toolbar tests.', funct
it('Apply bold on text shape.', function() {
impressHelper.selectTextShapeInTheCenter();
cy.cGet('#tb_editbar_item_bold').click();
cy.cGet('#bold').click();
impressHelper.triggerNewSVGForShapeInTheCenter();
@ -34,7 +34,7 @@ describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Top toolbar tests.', funct
it('Apply italic on text shape.', function() {
impressHelper.selectTextShapeInTheCenter();
cy.cGet('#tb_editbar_item_italic').click();
cy.cGet('#italic').click();
impressHelper.triggerNewSVGForShapeInTheCenter();
@ -43,7 +43,7 @@ describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Top toolbar tests.', funct
it('Apply underline on text shape.', function() {
impressHelper.selectTextShapeInTheCenter();
cy.cGet('#tb_editbar_item_underline').click();
cy.cGet('#underline').click();
impressHelper.triggerNewSVGForShapeInTheCenter();
@ -52,7 +52,7 @@ describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Top toolbar tests.', funct
it('Apply strikethrough on text shape.', function() {
impressHelper.selectTextShapeInTheCenter();
cy.cGet('#tb_editbar_item_strikeout').click();
cy.cGet('#strikeout').click();
impressHelper.triggerNewSVGForShapeInTheCenter();
@ -61,8 +61,8 @@ describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Top toolbar tests.', funct
it('Apply font color on text shape.', function() {
impressHelper.selectTextShapeInTheCenter();
cy.cGet('#tb_editbar_item_fontcolor').click();
desktopHelper.selectColorFromPaletteClassic('FF011B');
cy.cGet('#fontcolor .arrowbackground').click();
desktopHelper.selectColorFromPalette('FF011B');
impressHelper.triggerNewSVGForShapeInTheCenter();
@ -71,8 +71,8 @@ describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Top toolbar tests.', funct
it('Apply highlight color on text shape.', function() {
impressHelper.selectTextShapeInTheCenter();
cy.cGet('#tb_editbar_item_backcolor').click();
desktopHelper.selectColorFromPaletteClassic('FF9838');
cy.cGet('#backcolor .arrowbackground').click();
desktopHelper.selectColorFromPalette('FF9838');
impressHelper.triggerNewSVGForShapeInTheCenter();
@ -82,7 +82,7 @@ describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Top toolbar tests.', funct
it('Apply a selected font name on the text shape', function() {
impressHelper.selectTextShapeInTheCenter();
cy.cGet('#tb_editbar_item_fonts').click();
cy.cGet('#fontnamecombobox').click();
desktopHelper.selectFromListbox('Liberation Mono');
impressHelper.triggerNewSVGForShapeInTheCenter();
@ -92,7 +92,7 @@ describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Top toolbar tests.', funct
it('Apply a selected font size on the text shape', function() {
impressHelper.selectTextShapeInTheCenter();
cy.cGet('#tb_editbar_item_fontsizes').click();
cy.cGet('#fontsizecombobox').click();
desktopHelper.selectFromListbox('22');
impressHelper.triggerNewSVGForShapeInTheCenter();
@ -106,7 +106,7 @@ describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Top toolbar tests.', funct
cy.cGet('text tspan.TextPosition').should('have.attr', 'x', '1400');
// Set right alignment first
cy.cGet('#tb_editbar_item_rightpara').click();
cy.cGet('#rightpara').click();
impressHelper.triggerNewSVGForShapeInTheCenter();
@ -114,7 +114,7 @@ describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Top toolbar tests.', funct
// Set left alignment
impressHelper.selectTextOfShape();
cy.cGet('#tb_editbar_item_leftpara').click();
cy.cGet('#leftpara').click();
impressHelper.triggerNewSVGForShapeInTheCenter();

View File

@ -58,7 +58,7 @@ describe(['tagscreenshot'], 'Help dialog screenshot updation', function() {
it('Document repair', function() {
cy.cGet('#toolbar-up > .w2ui-scroll-right').click();
//insert
cy.cGet('#tb_editbar_item_insertshapes').click();
cy.cGet('#insertshapes').click();
cy.cGet('.col.w2ui-icon.symbolshapes').click();
cy.cGet('.leaflet-control-buttons-disabled path.leaflet-interactive').should('exist');
cy.cGet('#menu-editmenu').click();
@ -72,7 +72,7 @@ describe(['tagscreenshot'], 'Help dialog screenshot updation', function() {
hideSidebar();
cy.cGet('#toolbar-up > .w2ui-scroll-right').click();
cy.cGet('#tb_editbar_item_insertannotation').click();
cy.cGet('#insertannotation').click();
cy.cGet('#annotation-modify-textarea-new').type('comment added');
cy.cGet('#annotation-save-new').click(); // save button
cy.wait(1000);
@ -94,7 +94,7 @@ describe(['tagscreenshot'], 'Help dialog screenshot updation', function() {
hideSidebar();
cy.cGet('#toolbar-up > .w2ui-scroll-right').click();
cy.cGet('#tb_editbar_item_inserttable').click();
cy.cGet('#inserttable').click();
cy.cGet('.inserttable-grid > :nth-child(4) > :nth-child(4)').trigger('mouseover');
helper.waitUntilIdle('#inserttable-popup');
@ -113,7 +113,7 @@ describe(['tagscreenshot'], 'Help dialog screenshot updation', function() {
it('Insert special', function() {
cy.cGet('#toolbar-up > .w2ui-scroll-right').click();
cy.cGet('#tb_editbar_item_insertsymbol').click();
cy.cGet('#insertsymbol').click();
cy.cGet('#SpecialCharactersDialog').should('exist');
cy.cGet('#SpecialCharactersDialog').screenshot('special-character');
copyScreenshot('special-character.png');
@ -128,7 +128,7 @@ describe(['tagscreenshot'], 'Help dialog screenshot updation', function() {
cy.cGet('#toolbar-up > .w2ui-scroll-right').click();
//insert
cy.cGet('#tb_editbar_item_insertshapes').click();
cy.cGet('#insertshapes').click();
cy.cGet('.col.w2ui-icon.symbolshapes').click();
cy.cGet('.leaflet-control-buttons-disabled path.leaflet-interactive').should('exist');

View File

@ -11,7 +11,7 @@ describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Scroll through document',
desktopHelper.switchUIToCompact();
cy.cGet('#toolbar-up .w2ui-scroll-right').click();
cy.cGet('#tb_editbar_item_sidebar').click();
cy.cGet('#sidebar').click();
});
afterEach(function() {
@ -43,7 +43,7 @@ describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Scroll through document',
desktopHelper.selectZoomLevel('200');
//show horizontal scrollbar
cy.cGet('.leaflet-layer').click('bottom');
cy.wait(500);
cy.wait(1000);
helper.typeIntoDocument('{home}{end}{home}');
cy.cGet('#test-div-horizontal-scrollbar').should('have.text', '0');
helper.typeIntoDocument('{end}{home}{end}');

View File

@ -11,7 +11,7 @@ describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Track Changes', function (
cy.viewport(1400, 600);
testFileName = helper.beforeAll(origTestFileName, 'writer');
desktopHelper.switchUIToCompact();
cy.cGet('#tb_editbar_item_sidebar').click({force: true}); // Hide sidebar.
cy.cGet('#sidebar').click({force: true}); // Hide sidebar.
desktopHelper.selectZoomLevel('50');
});
@ -46,7 +46,7 @@ describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Track Changes', function (
it('Accept All', function () {
helper.typeIntoDocument('Hello World');
for (var n = 0; n < 2; n++) {
cy.cGet('#tb_editbar_item_insertannotation').click();
cy.cGet('#insertannotation').click();
cy.cGet('#annotation-modify-textarea-new').type('some text' + n);
cy.cGet('#annotation-save-new').click();
// Wait for animation
@ -54,7 +54,7 @@ describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Track Changes', function (
}
enableRecord();
cy.cGet('#tb_editbar_item_insertannotation').click();
cy.cGet('#insertannotation').click();
cy.cGet('#annotation-modify-textarea-new').type('some text2');
cy.cGet('#annotation-save-new').click();
cy.wait(500);
@ -86,7 +86,7 @@ describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Track Changes', function (
it('Reject All', function () {
helper.typeIntoDocument('Hello World');
for (var n = 0; n < 2; n++) {
cy.cGet('#tb_editbar_item_insertannotation').click();
cy.cGet('#insertannotation').click();
cy.cGet('#annotation-modify-textarea-new').type('some text' + n);
cy.cGet('#annotation-save-new').click();
// Wait for animation
@ -94,7 +94,7 @@ describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Track Changes', function (
}
enableRecord();
cy.cGet('#tb_editbar_item_insertannotation').click();
cy.cGet('#insertannotation').click();
cy.cGet('#annotation-modify-textarea-new').type('some text2');
cy.cGet('#annotation-save-new').click();
cy.wait(500);
@ -127,7 +127,7 @@ describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Track Changes', function (
it.skip('Comment Undo-Redo', function () {
for (var n = 0; n < 2; n++) {
cy.cGet('#tb_editbar_item_insertannotation').click();
cy.cGet('#insertannotation').click();
cy.cGet('#annotation-modify-textarea-new').type('some text' + n);
cy.cGet('#annotation-save-new').click();
// Wait for animation
@ -135,7 +135,7 @@ describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Track Changes', function (
}
enableRecord();
cy.cGet('#tb_editbar_item_insertannotation').click();
cy.cGet('#insertannotation').click();
cy.cGet('#annotation-modify-textarea-new').type('some text2');
cy.cGet('#annotation-save-new').click();
cy.wait(500);
@ -143,13 +143,13 @@ describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Track Changes', function (
cy.cGet('div.cool-annotation').should('have.length', 3);
// simple undo
cy.cGet('#tb_editbar_item_undo').click();
cy.cGet('#undo').click();
cy.cGet('#comment-container-3').should('not.exist');
cy.cGet('div.cool-annotation').should('have.length', 2);
// simple redo
cy.wait(500);
cy.cGet('#tb_editbar_item_redo').click();
cy.cGet('#redo').click();
// cy.wait(500);
cy.cGet('#map').focus();
helper.typeIntoDocument('{home}');
@ -162,14 +162,14 @@ describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Track Changes', function (
cy.cGet('body').contains('.context-menu-item', 'Remove').click();
cy.cGet('#comment-container-2').should('have.class','tracked-deleted-comment-show');
cy.cGet('div.cool-annotation').should('have.length', 3);
cy.cGet('#tb_editbar_item_undo').click();
cy.cGet('#undo').click();
cy.cGet('#comment-container-2').should('contain','some text1');
cy.cGet('#comment-container-2').should('not.have.class','tracked-deleted-comment-show');
cy.cGet('div.cool-annotation').should('have.length', 3);
// redo
cy.cGet('#tb_editbar_item_redo').click();
cy.cGet('#redo').click();
cy.wait(500);
cy.cGet('#comment-container-2').should('contain','some text1');

View File

@ -1,38 +1,38 @@
/* -*- js-indent-level: 8 -*- */
module.exports.list = {
fontColor: ['#Home #home-color .unoarrow', '#tb_editbar_item_fontcolor'],
fontName: ['#fontnamecombobox.notebookbar > .ui-combobox-button', '#tb_editbar_item_fonts'],
bold: ['#Bold', '#tb_editbar_item_bold'],
italic: ['#Italic', '#tb_editbar_item_italic'],
underline: ['#Underline', '#tb_editbar_item_underline'],
strikeout: ['#Strikeout', '#tb_editbar_item_strikeout'],
fontSize: ['#fontsizecombobox.notebookbar > .ui-combobox-button', '#tb_editbar_item_fontsizes'],
leftPara: ['#LeftPara', '#tb_editbar_item_leftpara'],
rightPara: ['#RightPara', '#tb_editbar_item_rightpara'],
centerPara: ['#CenterPara', '#tb_editbar_item_centerpara'],
justifyPara: ['#JustifyPara', '#tb_editbar_item_justifypara'],
lineSpacing: ['#LineSpacing', '#tb_editbar_item_linespacing'],
numberedList: ['#DefaultNumbering', '#tb_editbar_item_defaultnumbering'],
bulletList: ['#DefaultBullet', '#tb_editbar_item_defaultbullet'],
incrementIndent: ['#IncrementIndent', '#tb_editbar_item_incrementindent'],
decrementIndent: ['#DecrementIndent', '#tb_editbar_item_decrementindent'],
insertAnnotation: ['#InsertAnnotation', '#tb_editbar_item_insertannotation'],
insertTable: ['#InsertTable', '#tb_editbar_item_inserttable'],
insertGraphic: ['#InsertGraphic', '#tb_editbar_item_insertgraphic'],
clearFormat: ['#Home .unoResetAttributes', '#tb_editbar_item_reset'],
hyperLink: ['#HyperlinkDialog', '#tb_editbar_item_link'],
insertShape: ['#BasicShapes', '#tb_editbar_item_insertshapes'],
save: ['#Save', '#tb_editbar_item_save'],
print: ['#Print', '#tb_editbar_item_print'],
undo: ['#Undo', '#tb_editbar_item_undo'],
redo: ['#Redo', '#tb_editbar_item_redo'],
insertChart: ['#InsertObjectChart', '#tb_editbar_item_insertobjectchart'],
insertSymbol: ['#CharmapControl', '#tb_editbar_item_insertsymbol'],
formatBrush: ['#FormatPaintbrush', '#tb_editbar_item_formatpaintbrush'],
sidebar: ['.unospan-optionstoolboxdown.unoSidebar', '#tb_editbar_item_sidebar'],
backColor: ['#Home #home-back-color .unoarrow', '#tb_editbar_item_backcolor'],
borderStyle: ['#SetBorderStyle', '#tb_editbar_item_setborderstyle'],
backgroundColor: ['#Home #home-background-color .unoarrow','#tb_editbar_item_backgroundcolor'],
fontColor: ['#Home #home-color .unoarrow', '#toolbar-up [id^="fontcolor"]'],
fontName: ['#fontnamecombobox.notebookbar > .ui-combobox-button', '#toolbar-up #fontnamecombobox'],
bold: ['#Bold', '#toolbar-up #bold'],
italic: ['#Italic', '#toolbar-up #italic'],
underline: ['#Underline', '#toolbar-up #underline'],
strikeout: ['#Strikeout', '#toolbar-up #strikeout'],
fontSize: ['#fontsizecombobox.notebookbar > .ui-combobox-button', '#toolbar-up #fontsizecombobox'],
leftPara: ['#LeftPara', '#toolbar-up #leftpara'],
rightPara: ['#RightPara', '#toolbar-up #rightpara'],
centerPara: ['#CenterPara', '#toolbar-up #centerpara'],
justifyPara: ['#JustifyPara', '#toolbar-up #justifypara'],
lineSpacing: ['#LineSpacing', '#toolbar-up #linespacing'],
numberedList: ['#DefaultNumbering', '#toolbar-up #defaultnumbering'],
bulletList: ['#DefaultBullet', '#toolbar-up #defaultbullet'],
incrementIndent: ['#IncrementIndent', '#toolbar-up #incrementindent'],
decrementIndent: ['#DecrementIndent', '#toolbar-up #decrementindent'],
insertAnnotation: ['#InsertAnnotation', '#toolbar-up #insertannotation'],
insertTable: ['#InsertTable', '#toolbar-up #inserttable'],
insertGraphic: ['#InsertGraphic', '#toolbar-up #insertgraphic'],
clearFormat: ['#Home .unoResetAttributes', '#toolbar-up #reset'],
hyperLink: ['#HyperlinkDialog', '#toolbar-up #link'],
insertShape: ['#BasicShapes', '#toolbar-up #insertshapes'],
save: ['#Save', '#toolbar-up #save'],
print: ['#Print', '#toolbar-up #print'],
undo: ['#Undo', '#toolbar-up #undo'],
redo: ['#Redo', '#toolbar-up #redo'],
insertChart: ['#InsertObjectChart', '#toolbar-up #insertobjectchart'],
insertSymbol: ['#CharmapControl', '#toolbar-up #insertsymbol'],
formatBrush: ['#FormatPaintbrush', '#toolbar-up #formatpaintbrush'],
sidebar: ['.unospan-optionstoolboxdown.unoSidebar', '#toolbar-up #sidebar'],
backColor: ['#Home #home-back-color .unoarrow', '#toolbar-up #backcolor'],
borderStyle: ['#SetBorderStyle', '#toolbar-up #setborderstyle'],
backgroundColor: ['#Home #home-background-color .unoarrow','#toolbar-up #backgroundcolor'],
fileTab: ['#File-tab-label', '#menu-file'],
documentProperties: ['#SetDocumentProperties', '#menu-properties'],
};