[Libreoffice-commits] online.git: loleaflet/css loleaflet/js

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Nov 19 11:17:19 UTC 2018


 loleaflet/css/loleaflet.css |    2 
 loleaflet/js/toolbar.js     |  392 ++++++++++++++++++++++++++++----------------
 2 files changed, 252 insertions(+), 142 deletions(-)

New commits:
commit eafed648964a023c9c92ad9dafcecf8bdae0758b
Author:     Henry Castro <hcastro at collabora.com>
AuthorDate: Thu Sep 27 15:02:46 2018 -0400
Commit:     Tor Lillqvist <tml at collabora.com>
CommitDate: Mon Nov 19 12:58:27 2018 +0200

    loleaflet: mobile: exchange toolbar positions
    
    Change-Id: I0cbae0d351cb2cc965379aa2d5f8cb345475a37c

diff --git a/loleaflet/css/loleaflet.css b/loleaflet/css/loleaflet.css
index 652f6ac5a..17cbb974f 100644
--- a/loleaflet/css/loleaflet.css
+++ b/loleaflet/css/loleaflet.css
@@ -91,14 +91,12 @@ body {
     }
     #document-container.spreadsheet-document {
 	top: 93px !important;
-	bottom: 36px !important;
     }
     #document-container.spreadsheet-document.readonly {
 	top: 50px !important;
     }
     #document-container {
 	top: 40px;
-	bottom: 0;
     }
     #spreadsheet-row-column-frame {
 	top: 73px !important;
diff --git a/loleaflet/js/toolbar.js b/loleaflet/js/toolbar.js
index df7f9cbf4..9155476a7 100644
--- a/loleaflet/js/toolbar.js
+++ b/loleaflet/js/toolbar.js
@@ -604,149 +604,265 @@ var fontsSelectValue;
 var fontsizesSelectValue;
 
 function createToolbar() {
-	var toolbar = $('#toolbar-up');
-	if (L.Browser.mobile && $('#main-menu').css('display') === 'none') {
-		toolbar.w2toolbar({
-			name: 'toolbar-up',
-			tooltip: 'bottom',
+	var toolItems = [
+		{type: 'menu', id: 'menu-wrap', caption: _('Textwrap'), mobile: false, items: [
+			{ text: _('No wrap'), id: 'wrap-WrapOff' },
+			{ text: _('Page wrap'), id: 'wrap-WrapOn' },
+			{ text: _('Wrap anchor only'), id: 'wrap-WrapAnchorOnly' },
+			{ text: _('Ideal wrap'), id: 'wrap-WrapIdeal' },
+			{ text: _('Left wrap'), id: 'wrap-WrapLeft' },
+			{ text: _('Right wrap'), id: 'wrap-WrapRight' },
+			{ text: _('Wrap through'), id: 'wrap-WrapThrough' }
+		]},
+		{type: 'button',  id: 'save', img: 'save', hint: _UNO('.uno:Save')},
+		{type: 'break', id: 'savebreak'},
+		{type: 'button',  id: 'undo',  img: 'undo', hint: _UNO('.uno:Undo'), uno: 'Undo', disabled: true},
+		{type: 'button',  id: 'redo',  img: 'redo', hint: _UNO('.uno:Redo'), uno: 'Redo', disabled: true},
+		{type: 'button',  id: 'repair', img: 'repair', hint: _('Document repair'), disabled: true},
+		{type: 'break'},
+		{type: 'html',   id: 'styles', html: '<select class="styles-select"></select>', mobile: false},
+		{type: 'html',   id: 'fonts', html: '<select class="fonts-select"></select>', mobile: false},
+		{type: 'html',   id: 'fontsizes', html: '<select class="fontsizes-select"></select>', mobile: false},
+		{type: 'break', mobile: false},
+		{type: 'button',  id: 'bold',  img: 'bold', hint: _UNO('.uno:Bold'), uno: 'Bold', disabled: true},
+		{type: 'button',  id: 'italic', img: 'italic', hint: _UNO('.uno:Italic'), uno: 'Italic', disabled: true},
+		{type: 'button',  id: 'underline',  img: 'underline', hint: _UNO('.uno:Underline'), uno: 'Underline', disabled: true},
+		{type: 'button',  id: 'strikeout', img: 'strikeout', hint: _UNO('.uno:Strikeout'), uno: 'Strikeout', disabled: true},
+		{type: 'break', id: 'formatbreak'},
+		{type: 'button',  id: 'insertfootnote', img: 'insertfootnote', hint: _UNO('.uno:InsertFootnote'), uno: 'InsertFootnote', mobile: false},
+		{type: 'break' , mobile:false},
+		{type: 'text-color',  id: 'fontcolor', hint: _UNO('.uno:FontColor')},
+		{type: 'color',  id: 'backcolor', hint: _UNO('.uno:BackgroundColor')},
+		{type: 'break'},
+		{type: 'button',  id: 'leftpara',  img: 'alignleft', hint: _UNO('.uno:LeftPara', '', true), uno: 'LeftPara', unosheet: 'AlignLeft', disabled: true},
+		{type: 'button',  id: 'centerpara',  img: 'alignhorizontal', hint: _UNO('.uno:CenterPara', '', true), uno: 'CenterPara', unosheet: 'AlignHorizontalCenter', disabled: true},
+		{type: 'button',  id: 'rightpara',  img: 'alignright', hint: _UNO('.uno:RightPara', '', true), uno: 'RightPara', unosheet: 'AlignRight', disabled: true},
+		{type: 'button',  id: 'justifypara',  img: 'alignblock', hint: _UNO('.uno:JustifyPara', '', true), uno: 'JustifyPara', unosheet: '', disabled: true},
+		{type: 'break',  id: 'wraptextseparator'},
+		{type: 'button',  id: 'wraptext',  img: 'wraptext', hint: _UNO('.uno:WrapText', 'spreadsheet', true), uno: 'WrapText', disabled: true},
+		{type: 'button',  id: 'togglemergecells',  img: 'togglemergecells', hint: _UNO('.uno:ToggleMergeCells', 'spreadsheet', true), uno: 'ToggleMergeCells', disabled: true},
+		{type: 'break',   id: 'break-toggle'},
+		{type: 'button',  id: 'numberformatcurrency',  img: 'numberformatcurrency', hint: _UNO('.uno:NumberFormatCurrency', 'spreadsheet', true), uno: 'NumberFormatCurrency', disabled: true},
+		{type: 'button',  id: 'numberformatpercent',  img: 'numberformatpercent', hint: _UNO('.uno:NumberFormatPercent', 'spreadsheet', true), uno: 'NumberFormatPercent', disabled: true},
+		{type: 'button',  id: 'numberformatdecimal',  img: 'numberformatdecimal', hint: _UNO('.uno:NumberFormatDecimal', 'spreadsheet', true), uno: 'NumberFormatDecimal', disabled: true},
+		{type: 'button',  id: 'numberformatdate',  img: 'numberformatdate', hint: _UNO('.uno:NumberFormatDate', 'spreadsheet', true), uno: 'NumberFormatDate', disabled: true},
+		{type: 'button',  id: 'numberformatincdecimals',  img: 'numberformatincdecimals', hint: _UNO('.uno:NumberFormatIncDecimals', 'spreadsheet', true), uno: 'NumberFormatIncDecimals', disabled: true},
+		{type: 'button',  id: 'numberformatdecdecimals',  img: 'numberformatdecdecimals', hint: _UNO('.uno:NumberFormatDecDecimals', 'spreadsheet', true), uno: 'NumberFormatDecDecimals', disabled: true},
+		{type: 'break',   id: 'break-number'},
+		{type: 'button',  id: 'sortascending',  img: 'sortascending', hint: _UNO('.uno:SortAscending', 'spreadsheet', true), uno: 'SortAscending', disabled: true},
+		{type: 'button',  id: 'sortdescending',  img: 'sortdescending', hint: _UNO('.uno:SortDescending', 'spreadsheet', true), uno: 'SortDescending', disabled: true},
+		{type: 'break',   id: 'break-align'},
+		{type: 'button',  id: 'defaultbullet',  img: 'bullet', hint: _UNO('.uno:DefaultBullet', '', true), uno: 'DefaultBullet', disabled: true},
+		{type: 'button',  id: 'defaultnumbering',  img: 'numbering', hint: _UNO('.uno:DefaultNumbering', '', true), uno: 'DefaultNumbering', disabled: true},
+		{type: 'break',   id: 'break-numbering'},
+		{type: 'button',  id: 'incrementindent',  img: 'incrementindent', hint: _UNO('.uno:IncrementIndent', '', true), uno: 'IncrementIndent', disabled: true},
+		{type: 'button',  id: 'decrementindent',  img: 'decrementindent', hint: _UNO('.uno:DecrementIndent', '', true), uno: 'DecrementIndent', disabled: true},
+		{type: 'break', id: 'incdecindent'},
+		{type: 'drop',  id: 'inserttable',  img: 'inserttable', hint: _('Insert table'), overlay: {onShow: insertTable},
+		 html: '<div id="inserttable-wrapper"><div id="inserttable-popup" class="inserttable-pop ui-widget ui-widget-content ui-corner-all"><div class="inserttable-grid"></div><div id="inserttable-status" class="loleaflet-font" style="padding: 5px;"><br/></div></div></div>'},
+		{type: 'drop',  id: 'setborderstyle',  img: 'setborderstyle', hint: _('Borders'),
+			html: '<table id="setborderstyle-grid"><tr><td class="w2ui-tb-image w2ui-icon frame01" onclick="setBorderStyle(1)"></td>' +
+			      '<td class="w2ui-tb-image w2ui-icon frame02" onclick="setBorderStyle(2)"></td><td class="w2ui-tb-image w2ui-icon frame03" onclick="setBorderStyle(3)"></td>' +
+			      '<td class="w2ui-tb-image w2ui-icon frame04" onclick="setBorderStyle(4)"></td></tr><tr><td class="w2ui-tb-image w2ui-icon frame05" onclick="setBorderStyle(5)"></td>' +
+			      '<td class="w2ui-tb-image w2ui-icon frame06" onclick="setBorderStyle(6)"></td><td class="w2ui-tb-image w2ui-icon frame07" onclick="setBorderStyle(7)"></td>' +
+			      '<td class="w2ui-tb-image w2ui-icon frame08" onclick="setBorderStyle(8)"></td></tr><tr><td class="w2ui-tb-image w2ui-icon frame09" onclick="setBorderStyle(9)"></td>' +
+			      '<td class="w2ui-tb-image w2ui-icon frame10" onclick="setBorderStyle(10)"></td><td class="w2ui-tb-image w2ui-icon frame11" onclick="setBorderStyle(11)"></td>' +
+			      '<td class="w2ui-tb-image w2ui-icon frame12" onclick="setBorderStyle(12)"></td></tr><tr>' +
+			      '<td colspan="4" class="w2ui-tb-image w2ui-icon frame13" onclick="setBorderStyle(0)"><div id="div-frame13">' + _('More...') + '</div></td></tr></table>'
+		},
+		{type: 'drop', id: 'conditionalformaticonset',  img: 'conditionalformatdialog', hint: _UNO('.uno:ConditionalFormatMenu', 'spreadsheet', true),
+			html: '<table id="conditionalformatmenu-grid"><tr>' +
+				  '<td class="w2ui-tb-image w2ui-icon iconset00" onclick="setConditionalFormatIconSet(0)"/><td class="w2ui-tb-image w2ui-icon iconset01" onclick="setConditionalFormatIconSet(1)"/><td class="w2ui-tb-image w2ui-icon iconset02" onclick="setConditionalFormatIconSet(2)"/></tr><tr>' +
+				  '<td class="w2ui-tb-image w2ui-icon iconset03" onclick="setConditionalFormatIconSet(3)"/><td class="w2ui-tb-image w2ui-icon iconset04" onclick="setConditionalFormatIconSet(4)"/><td class="w2ui-tb-image w2ui-icon iconset05" onclick="setConditionalFormatIconSet(5)"/></tr><tr>' +
+				  '<td class="w2ui-tb-image w2ui-icon iconset06" onclick="setConditionalFormatIconSet(6)"/><td class="w2ui-tb-image w2ui-icon iconset08" onclick="setConditionalFormatIconSet(8)"/><td class="w2ui-tb-image w2ui-icon iconset09" onclick="setConditionalFormatIconSet(9)"/></tr><tr>' + // iconset07 deliberately left out, see the .css for the reason
+				  '<td class="w2ui-tb-image w2ui-icon iconset10" onclick="setConditionalFormatIconSet(10)"/><td class="w2ui-tb-image w2ui-icon iconset11" onclick="setConditionalFormatIconSet(11)"/><td class="w2ui-tb-image w2ui-icon iconset12" onclick="setConditionalFormatIconSet(12)"/></tr><tr>' +
+				  '<td class="w2ui-tb-image w2ui-icon iconset13" onclick="setConditionalFormatIconSet(13)"/><td class="w2ui-tb-image w2ui-icon iconset14" onclick="setConditionalFormatIconSet(14)"/><td class="w2ui-tb-image w2ui-icon iconset15" onclick="setConditionalFormatIconSet(15)"/></tr><tr>' +
+				  '<td class="w2ui-tb-image w2ui-icon iconset16" onclick="setConditionalFormatIconSet(16)"/><td class="w2ui-tb-image w2ui-icon iconset17" onclick="setConditionalFormatIconSet(17)"/><td class="w2ui-tb-image w2ui-icon iconset18" onclick="setConditionalFormatIconSet(18)"/></tr><tr>' +
+				  '<td class="w2ui-tb-image w2ui-icon iconset19" onclick="setConditionalFormatIconSet(19)"/><td class="w2ui-tb-image w2ui-icon iconset20" onclick="setConditionalFormatIconSet(20)"/><td class="w2ui-tb-image w2ui-icon iconset21" onclick="setConditionalFormatIconSet(21)"/></tr></table>'
+		},
+		{type: 'drop',  id: 'insertshapes',  img: 'basicshapes_ellipse', hint: _('Insert shapes'), overlay: {onShow: insertShapes},
+		 html: '<div id="insertshape-wrapper"><div id="insertshape-popup" class="insertshape-pop ui-widget ui-widget-content ui-corner-all"><div class="insertshape-grid"></div></div></div>'},
+		{type: 'button',  id: 'insertobjectchart',  img: 'insertobjectchart', hint: _UNO('.uno:InsertObjectChart', '', true), uno: 'InsertObjectChart'},
+		{type: 'button',  id: 'insertannotation', img: 'annotation', hint: _UNO('.uno:InsertAnnotation', '', true)},
+		{type: 'button',  id: 'insertgraphic',  img: 'insertgraphic', hint: _UNO('.uno:InsertGraphic', '', true)},
+		{type: 'menu', id: 'menugraphic', img: 'insertgraphic', hint: _UNO('.uno:InsertGraphic', '', true), hidden: true,
 			items: [
-				{type: 'button',  id: 'doclogo', img: 'doclogo'},
-				{type: 'spacer'},
-				{type: 'button',  id: 'undo',  img: 'undo', hint: _UNO('.uno:Undo'), uno: 'Undo', disabled: true},
-				{type: 'button',  id: 'redo',  img: 'redo', hint: _UNO('.uno:Redo'), uno: 'Redo', disabled: true},
-				{type: 'button',  id: 'users',  img: 'users'},
-				{type: 'button',  id: 'callout',  img: 'callout'},
-			],
-			onClick: function (e) {
-				onClick(e, e.target);
-				hideTooltip(this, e.target);
-			}
-		});
+				{id: 'localgraphic', text: _('Insert Local Image'), icon: 'insertgraphic'},
+				{id: 'remotegraphic', text: _UNO('.uno:InsertGraphic', '', true), icon: 'insertgraphic'},
+			]},
+		{type: 'button',  id: 'specialcharacter', img: 'specialcharacter', hint: _UNO('.uno:InsertSymbol', '', true), uno: '.uno:InsertSymbol'}
+	];
+
+	if (L.Browser.mobile && $('#main-menu').css('display') === 'none') {
+		initMobileToolbar(toolItems);
+	} else {
+		initNormalToolbar(toolItems);
 	}
-	else {
-		toolbar.w2toolbar({
-			name: 'toolbar-up',
-			tooltip: 'bottom',
-			items: [
-				{type: 'menu', id: 'menu-wrap', caption: _('Textwrap'), mobile: false, items: [
-					{ text: _('No wrap'), id: 'wrap-WrapOff' },
-					{ text: _('Page wrap'), id: 'wrap-WrapOn' },
-					{ text: _('Wrap anchor only'), id: 'wrap-WrapAnchorOnly' },
-					{ text: _('Ideal wrap'), id: 'wrap-WrapIdeal' },
-					{ text: _('Left wrap'), id: 'wrap-WrapLeft' },
-					{ text: _('Right wrap'), id: 'wrap-WrapRight' },
-					{ text: _('Wrap through'), id: 'wrap-WrapThrough' }
-				]},
-				{type: 'button',  id: 'save', img: 'save', hint: _UNO('.uno:Save')},
-				{type: 'break', id: 'savebreak'},
-				{type: 'button',  id: 'undo',  img: 'undo', hint: _UNO('.uno:Undo'), uno: 'Undo', disabled: true},
-				{type: 'button',  id: 'redo',  img: 'redo', hint: _UNO('.uno:Redo'), uno: 'Redo', disabled: true},
-				{type: 'button',  id: 'repair', img: 'repair', hint: _('Document repair'), disabled: true},
-				{type: 'break'},
-				{type: 'html',   id: 'styles', html: '<select class="styles-select"></select>', mobile: false},
-				{type: 'html',   id: 'fonts', html: '<select class="fonts-select"></select>', mobile: false},
-				{type: 'html',   id: 'fontsizes', html: '<select class="fontsizes-select"></select>', mobile: false},
-				{type: 'break', mobile: false},
-				{type: 'button',  id: 'bold',  img: 'bold', hint: _UNO('.uno:Bold'), uno: 'Bold', disabled: true},
-				{type: 'button',  id: 'italic', img: 'italic', hint: _UNO('.uno:Italic'), uno: 'Italic', disabled: true},
-				{type: 'button',  id: 'underline',  img: 'underline', hint: _UNO('.uno:Underline'), uno: 'Underline', disabled: true},
-				{type: 'button',  id: 'strikeout', img: 'strikeout', hint: _UNO('.uno:Strikeout'), uno: 'Strikeout', disabled: true},
-				{type: 'break', id: 'formatbreak'},
-				{type: 'button',  id: 'insertfootnote', img: 'insertfootnote', hint: _UNO('.uno:InsertFootnote'), uno: 'InsertFootnote', mobile: false},
-				{type: 'break' , mobile:false},
-				{type: 'text-color',  id: 'fontcolor', hint: _UNO('.uno:FontColor')},
-				{type: 'color',  id: 'backcolor', hint: _UNO('.uno:BackgroundColor')},
-				{type: 'break'},
-				{type: 'button',  id: 'leftpara',  img: 'alignleft', hint: _UNO('.uno:LeftPara', '', true), uno: 'LeftPara', unosheet: 'AlignLeft', disabled: true},
-				{type: 'button',  id: 'centerpara',  img: 'alignhorizontal', hint: _UNO('.uno:CenterPara', '', true), uno: 'CenterPara', unosheet: 'AlignHorizontalCenter', disabled: true},
-				{type: 'button',  id: 'rightpara',  img: 'alignright', hint: _UNO('.uno:RightPara', '', true), uno: 'RightPara', unosheet: 'AlignRight', disabled: true},
-				{type: 'button',  id: 'justifypara',  img: 'alignblock', hint: _UNO('.uno:JustifyPara', '', true), uno: 'JustifyPara', unosheet: '', disabled: true},
-				{type: 'break',  id: 'wraptextseparator'},
-				{type: 'button',  id: 'wraptext',  img: 'wraptext', hint: _UNO('.uno:WrapText', 'spreadsheet', true), uno: 'WrapText', disabled: true},
-				{type: 'button',  id: 'togglemergecells',  img: 'togglemergecells', hint: _UNO('.uno:ToggleMergeCells', 'spreadsheet', true), uno: 'ToggleMergeCells', disabled: true},
-				{type: 'break',   id: 'break-toggle'},
-				{type: 'button',  id: 'numberformatcurrency',  img: 'numberformatcurrency', hint: _UNO('.uno:NumberFormatCurrency', 'spreadsheet', true), uno: 'NumberFormatCurrency', disabled: true},
-				{type: 'button',  id: 'numberformatpercent',  img: 'numberformatpercent', hint: _UNO('.uno:NumberFormatPercent', 'spreadsheet', true), uno: 'NumberFormatPercent', disabled: true},
-				{type: 'button',  id: 'numberformatdecimal',  img: 'numberformatdecimal', hint: _UNO('.uno:NumberFormatDecimal', 'spreadsheet', true), uno: 'NumberFormatDecimal', disabled: true},
-				{type: 'button',  id: 'numberformatdate',  img: 'numberformatdate', hint: _UNO('.uno:NumberFormatDate', 'spreadsheet', true), uno: 'NumberFormatDate', disabled: true},
-				{type: 'button',  id: 'numberformatincdecimals',  img: 'numberformatincdecimals', hint: _UNO('.uno:NumberFormatIncDecimals', 'spreadsheet', true), uno: 'NumberFormatIncDecimals', disabled: true},
-				{type: 'button',  id: 'numberformatdecdecimals',  img: 'numberformatdecdecimals', hint: _UNO('.uno:NumberFormatDecDecimals', 'spreadsheet', true), uno: 'NumberFormatDecDecimals', disabled: true},
-				{type: 'break',   id: 'break-number'},
-				{type: 'button',  id: 'sortascending',  img: 'sortascending', hint: _UNO('.uno:SortAscending', 'spreadsheet', true), uno: 'SortAscending', disabled: true},
-				{type: 'button',  id: 'sortdescending',  img: 'sortdescending', hint: _UNO('.uno:SortDescending', 'spreadsheet', true), uno: 'SortDescending', disabled: true},
-				{type: 'break',   id: 'break-align'},
-				{type: 'button',  id: 'defaultbullet',  img: 'bullet', hint: _UNO('.uno:DefaultBullet', '', true), uno: 'DefaultBullet', disabled: true},
-				{type: 'button',  id: 'defaultnumbering',  img: 'numbering', hint: _UNO('.uno:DefaultNumbering', '', true), uno: 'DefaultNumbering', disabled: true},
-				{type: 'break',   id: 'break-numbering'},
-				{type: 'button',  id: 'incrementindent',  img: 'incrementindent', hint: _UNO('.uno:IncrementIndent', '', true), uno: 'IncrementIndent', disabled: true},
-				{type: 'button',  id: 'decrementindent',  img: 'decrementindent', hint: _UNO('.uno:DecrementIndent', '', true), uno: 'DecrementIndent', disabled: true},
-				{type: 'break', id: 'incdecindent'},
-				{type: 'drop',  id: 'inserttable',  img: 'inserttable', hint: _('Insert table'), overlay: {onShow: insertTable},
-				 html: '<div id="inserttable-wrapper"><div id="inserttable-popup" class="inserttable-pop ui-widget ui-widget-content ui-corner-all"><div class="inserttable-grid"></div><div id="inserttable-status" class="loleaflet-font" style="padding: 5px;"><br/></div></div></div>'},
-				{type: 'drop',  id: 'setborderstyle',  img: 'setborderstyle', hint: _('Borders'),
-					html: '<table id="setborderstyle-grid"><tr><td class="w2ui-tb-image w2ui-icon frame01" onclick="setBorderStyle(1)"></td>' +
-					      '<td class="w2ui-tb-image w2ui-icon frame02" onclick="setBorderStyle(2)"></td><td class="w2ui-tb-image w2ui-icon frame03" onclick="setBorderStyle(3)"></td>' +
-					      '<td class="w2ui-tb-image w2ui-icon frame04" onclick="setBorderStyle(4)"></td></tr><tr><td class="w2ui-tb-image w2ui-icon frame05" onclick="setBorderStyle(5)"></td>' +
-					      '<td class="w2ui-tb-image w2ui-icon frame06" onclick="setBorderStyle(6)"></td><td class="w2ui-tb-image w2ui-icon frame07" onclick="setBorderStyle(7)"></td>' +
-					      '<td class="w2ui-tb-image w2ui-icon frame08" onclick="setBorderStyle(8)"></td></tr><tr><td class="w2ui-tb-image w2ui-icon frame09" onclick="setBorderStyle(9)"></td>' +
-					      '<td class="w2ui-tb-image w2ui-icon frame10" onclick="setBorderStyle(10)"></td><td class="w2ui-tb-image w2ui-icon frame11" onclick="setBorderStyle(11)"></td>' +
-					      '<td class="w2ui-tb-image w2ui-icon frame12" onclick="setBorderStyle(12)"></td></tr><tr>' +
-					      '<td colspan="4" class="w2ui-tb-image w2ui-icon frame13" onclick="setBorderStyle(0)"><div id="div-frame13">' + _('More...') + '</div></td></tr></table>'
-				},
-				{type: 'drop', id: 'conditionalformaticonset',  img: 'conditionalformatdialog', hint: _UNO('.uno:ConditionalFormatMenu', 'spreadsheet', true),
-					html: '<table id="conditionalformatmenu-grid"><tr>' +
-						  '<td class="w2ui-tb-image w2ui-icon iconset00" onclick="setConditionalFormatIconSet(0)"/><td class="w2ui-tb-image w2ui-icon iconset01" onclick="setConditionalFormatIconSet(1)"/><td class="w2ui-tb-image w2ui-icon iconset02" onclick="setConditionalFormatIconSet(2)"/></tr><tr>' +
-						  '<td class="w2ui-tb-image w2ui-icon iconset03" onclick="setConditionalFormatIconSet(3)"/><td class="w2ui-tb-image w2ui-icon iconset04" onclick="setConditionalFormatIconSet(4)"/><td class="w2ui-tb-image w2ui-icon iconset05" onclick="setConditionalFormatIconSet(5)"/></tr><tr>' +
-						  '<td class="w2ui-tb-image w2ui-icon iconset06" onclick="setConditionalFormatIconSet(6)"/><td class="w2ui-tb-image w2ui-icon iconset08" onclick="setConditionalFormatIconSet(8)"/><td class="w2ui-tb-image w2ui-icon iconset09" onclick="setConditionalFormatIconSet(9)"/></tr><tr>' + // iconset07 deliberately left out, see the .css for the reason
-						  '<td class="w2ui-tb-image w2ui-icon iconset10" onclick="setConditionalFormatIconSet(10)"/><td class="w2ui-tb-image w2ui-icon iconset11" onclick="setConditionalFormatIconSet(11)"/><td class="w2ui-tb-image w2ui-icon iconset12" onclick="setConditionalFormatIconSet(12)"/></tr><tr>' +
-						  '<td class="w2ui-tb-image w2ui-icon iconset13" onclick="setConditionalFormatIconSet(13)"/><td class="w2ui-tb-image w2ui-icon iconset14" onclick="setConditionalFormatIconSet(14)"/><td class="w2ui-tb-image w2ui-icon iconset15" onclick="setConditionalFormatIconSet(15)"/></tr><tr>' +
-						  '<td class="w2ui-tb-image w2ui-icon iconset16" onclick="setConditionalFormatIconSet(16)"/><td class="w2ui-tb-image w2ui-icon iconset17" onclick="setConditionalFormatIconSet(17)"/><td class="w2ui-tb-image w2ui-icon iconset18" onclick="setConditionalFormatIconSet(18)"/></tr><tr>' +
-						  '<td class="w2ui-tb-image w2ui-icon iconset19" onclick="setConditionalFormatIconSet(19)"/><td class="w2ui-tb-image w2ui-icon iconset20" onclick="setConditionalFormatIconSet(20)"/><td class="w2ui-tb-image w2ui-icon iconset21" onclick="setConditionalFormatIconSet(21)"/></tr></table>'
-				},
-				{type: 'drop',  id: 'insertshapes',  img: 'basicshapes_ellipse', hint: _('Insert shapes'), overlay: {onShow: insertShapes},
-				 html: '<div id="insertshape-wrapper"><div id="insertshape-popup" class="insertshape-pop ui-widget ui-widget-content ui-corner-all"><div class="insertshape-grid"></div></div></div>'},
-				{type: 'button',  id: 'insertobjectchart',  img: 'insertobjectchart', hint: _UNO('.uno:InsertObjectChart', '', true), uno: 'InsertObjectChart'},
-				{type: 'button',  id: 'insertannotation', img: 'annotation', hint: _UNO('.uno:InsertAnnotation', '', true)},
-				{type: 'button',  id: 'insertgraphic',  img: 'insertgraphic', hint: _UNO('.uno:InsertGraphic', '', true)},
-				{type: 'menu', id: 'menugraphic', img: 'insertgraphic', hint: _UNO('.uno:InsertGraphic', '', true), hidden: true,
-					items: [
-						{id: 'localgraphic', text: _('Insert Local Image'), icon: 'insertgraphic'},
-						{id: 'remotegraphic', text: _UNO('.uno:InsertGraphic', '', true), icon: 'insertgraphic'},
-					]},
-				{type: 'button',  id: 'specialcharacter', img: 'specialcharacter', hint: _UNO('.uno:InsertSymbol', '', true), uno: '.uno:InsertSymbol'}
-			],
-			onClick: function (e) {
-				onClick(e, e.target);
-				hideTooltip(this, e.target);
-			},
-			onRefresh: function() {
-				if (map.getDocType() === 'presentation') {
-					// Fill the style select box if not yet filled
-					if ($('.styles-select')[0] && $('.styles-select')[0].length === 0) {
-						var data = [''];
-						// Inserts a separator element
-						data = data.concat({text: '\u2500\u2500\u2500\u2500\u2500\u2500', disabled: true});
-
-						L.Styles.impressLayout.forEach(function(layout) {
-							data = data.concat({id: layout.id, text: _(layout.text)});
-						}, this);
-
-						$('.styles-select').select2({
-							data: data,
-							placeholder: _UNO('.uno:LayoutStatus', 'presentation')
-						});
-						$('.styles-select').on('select2:select', onStyleSelect);
-					}
+}
+
+function initMobileToolbar(toolItems) {
+	var toolbar = $('#toolbar-up');
+	toolbar.w2toolbar({
+		name: 'toolbar-down',
+		tooltip: 'bottom',
+		items: [
+			{type: 'button',  id: 'doclogo', img: 'doclogo'},
+			{type: 'spacer'},
+			{type: 'button',  id: 'undo',  img: 'undo', hint: _UNO('.uno:Undo'), uno: 'Undo', disabled: true},
+			{type: 'button',  id: 'redo',  img: 'redo', hint: _UNO('.uno:Redo'), uno: 'Redo', disabled: true},
+			{type: 'button',  id: 'users',  img: 'users'},
+			{type: 'button',  id: 'callout',  img: 'callout'},
+		],
+		onClick: function (e) {
+			onClick(e, e.target);
+			hideTooltip(this, e.target);
+		}
+	});
+	toolbar.bind('touchstart', function() {
+		w2ui['toolbar-down'].touchStarted = true;
+	});
+
+	toolbar = $('#formulabar');
+	toolbar.w2toolbar({
+		name: 'formulabar',
+		tooltip: 'bottom',
+		items: [
+			{type: 'html',  id: 'left'},
+			{type: 'html', id: 'address', html: '<input id="addressInput" type="text">'},
+			{type: 'break'},
+			{type: 'button',  id: 'sum',  img: 'autosum', hint: _('Sum')},
+			{type: 'button',  id: 'function',  img: 'equal', hint: _('Function')},
+			{type: 'button', hidden: true, id: 'cancelformula',  img: 'cancel', hint: _('Cancel')},
+			{type: 'button', hidden: true, id: 'acceptformula',  img: 'accepttrackedchanges', hint: _('Accept')},
+			{type: 'html', id: 'formula', html: '<input id="formulaInput" type="text">'}
+
+		],
+		onClick: function (e) {
+			onClick(e, e.target);
+			hideTooltip(this, e.target);
+		},
+		onRefresh: function() {
+			$('#addressInput').off('keyup', onAddressInput).on('keyup', onAddressInput);
+			$('#formulaInput').off('keyup', onFormulaInput).on('keyup', onFormulaInput);
+			$('#formulaInput').off('blur', onFormulaBarBlur).on('blur', onFormulaBarBlur);
+			$('#formulaInput').off('focus', onFormulaBarFocus).on('focus', onFormulaBarFocus);
+		}
+	});
+	toolbar.bind('touchstart', function() {
+		w2ui['formulabar'].touchStarted = true;
+	});
+
+	$(w2ui.formulabar.box).find('.w2ui-scroll-left, .w2ui-scroll-right').hide();
+	w2ui.formulabar.on('resize', function(target, e) {
+		e.isCancelled = true;
+	});
+
+	toolbar = $('#spreadsheet-toolbar')
+	toolbar.w2toolbar({
+		name: 'spreadsheet-toolbar',
+		tooltip: 'bottom',
+		items: [
+			{type: 'button',  id: 'firstrecord',  img: 'firstrecord', hidden: true, hint: _('First sheet')},
+			{type: 'button',  id: 'prevrecord',  img: 'prevrecord', hidden: true, hint: _('Previous sheet')},
+			{type: 'button',  id: 'nextrecord',  img: 'nextrecord', hidden: true, hint: _('Next sheet')},
+			{type: 'button',  id: 'lastrecord',  img: 'lastrecord', hidden: true, hint: _('Last sheet')},
+			{type: 'button',  id: 'insertsheet', img: 'insertsheet', hidden:true, hint: _('Insert sheet')}
+		],
+		onClick: function (e) {
+			onClick(e, e.target);
+			hideTooltip(this, e.target);
+		}
+	});
+	toolbar.bind('touchstart', function() {
+		w2ui['spreadsheet-toolbar'].touchStarted = true;
+	});
+
+	toolbar = $('#presentation-toolbar');
+	toolbar.w2toolbar({
+		name: 'presentation-toolbar',
+		tooltip: 'bottom',
+		items: []
+	});
+
+	toolbar = $('#toolbar-down');
+	toolbar.w2toolbar({
+		name: 'toolbar-up',
+		tooltip: 'top',
+		items: toolItems,
+		onClick: function (e) {
+			onClick(e, e.target);
+			hideTooltip(this, e.target);
+		},
+		onRefresh: function() {
+			if (map.getDocType() === 'presentation') {
+				// Fill the style select box if not yet filled
+				if ($('.styles-select')[0] && $('.styles-select')[0].length === 0) {
+					var data = [''];
+					// Inserts a separator element
+					data = data.concat({text: '\u2500\u2500\u2500\u2500\u2500\u2500', disabled: true});
+
+					L.Styles.impressLayout.forEach(function(layout) {
+						data = data.concat({id: layout.id, text: _(layout.text)});
+					}, this);
+
+					$('.styles-select').select2({
+						data: data,
+						placeholder: _UNO('.uno:LayoutStatus', 'presentation')
+					});
+					$('.styles-select').on('select2:select', onStyleSelect);
 				}
+			}
 
-				updateCommandValues();
+			updateCommandValues();
 
-				insertTable();
+			insertTable();
 
-				insertShapes();
+			insertShapes();
+		}
+	});
+
+	toolbar.bind('touchstart', function() {
+		w2ui['toolbar-up'].touchStarted = true;
+	});
+}
+
+function initNormalToolbar(toolItems) {
+	var toolbar = $('#toolbar-up');
+	toolbar.w2toolbar({
+		name: 'toolbar-up',
+		tooltip: 'bottom',
+		items: toolItems,
+		onClick: function (e) {
+			onClick(e, e.target);
+			hideTooltip(this, e.target);
+		},
+		onRefresh: function() {
+			if (map.getDocType() === 'presentation') {
+				// Fill the style select box if not yet filled
+				if ($('.styles-select')[0] && $('.styles-select')[0].length === 1) {
+					var data = [''];
+					// Inserts a separator element
+					data = data.concat({text: '\u2500\u2500\u2500\u2500\u2500\u2500', disabled: true});
+
+					L.Styles.impressLayout.forEach(function(layout) {
+						data = data.concat({id: layout.id, text: _(layout.text)});
+					}, this);
+
+					$('.styles-select').select2({
+						data: data,
+						placeholder: _UNO('.uno:LayoutStatus', 'presentation')
+					});
+					$('.styles-select').on('select2:select', onStyleSelect);
+				}
 			}
-		});
-	}
+
+			updateCommandValues();
+
+			insertTable();
+
+			insertShapes();
+		}
+	});
 
 	toolbar.bind('touchstart', function() {
 		w2ui['toolbar-up'].touchStarted = true;
@@ -1242,10 +1358,6 @@ function onWopiProps(e) {
 }
 
 function onDocLayerInit() {
-	if ($('#main-menu').css('display') === 'none') {
-		return;
-	}
-
 	var toolbarUp = w2ui['toolbar-up'];
 	var statusbar = w2ui['toolbar-down'];
 	var docType = map.getDocType();


More information about the Libreoffice-commits mailing list