[Libreoffice-commits] online.git: loleaflet/js
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Tue Mar 5 12:57:57 UTC 2019
loleaflet/js/toolbar.js | 180 ------------------------------------------------
1 file changed, 180 deletions(-)
New commits:
commit db5d847d82b9a433099409070a2ed2cd88696b34
Author: Henry Castro <hcastro at collabora.com>
AuthorDate: Tue Jan 15 16:13:37 2019 -0400
Commit: Henry Castro <hcastro at collabora.com>
CommitDate: Tue Mar 5 08:57:15 2019 -0400
loleaflet: remove initMobileToolbar function
Change-Id: Ia99879fe8986e19d41a7add2be649b100bfb2f5d
diff --git a/loleaflet/js/toolbar.js b/loleaflet/js/toolbar.js
index 51fb07db0..ecabe1bb4 100644
--- a/loleaflet/js/toolbar.js
+++ b/loleaflet/js/toolbar.js
@@ -816,192 +816,12 @@ function createToolbar() {
if (_inMobileMode()) {
$('#mobile-edit-button').show();
- initMobileToolbar(toolItems);
} else {
$('#toolbar-down').show();
initNormalToolbar(toolItems);
}
}
-function initMobileToolbar(toolItems) {
- var toolbar = $('#toolbar-up');
- toolbar.w2toolbar({
- name: 'actionbar',
- tooltip: 'bottom',
- items: [
- {type: 'button', id: 'closemobile', img: 'closemobile'},
- {type: 'spacer'},
- {type: 'button', id: 'prev', img: 'prev', hint: _UNO('.uno:PageUp', 'text'), hidden: true},
- {type: 'button', id: 'next', img: 'next', hint: _UNO('.uno:PageDown', 'text'), hidden: true},
- {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: 'fullscreen', img: 'fullscreen', hint: _UNO('.uno:FullScreen', 'text')},
- {type: 'drop', id: 'userlist', img: 'users', hidden: true, html: '<div id="userlist_container"><table id="userlist_table"><tbody></tbody></table>' +
- '<hr><table class="loleaflet-font" id="editor-btn">' +
- '<tr>' +
- '<td><input type="checkbox" name="alwaysFollow" id="follow-checkbox" onclick="editorUpdate(event)"></td>' +
- '<td>' + _('Always follow the editor') + '</td>' +
- '</tr>' +
- '</table>' +
- '<p id="currently-msg">' + _('Current') + ' - <b><span id="current-editor"></span></b></p>' +
- '</div>'
- },
- ],
- onClick: function (e) {
- onClick(e, e.target);
- hideTooltip(this, e.target);
- },
- onRefresh: function() {
- var showUserList = map['wopi'].HideUserList !== null &&
- map['wopi'].HideUserList !== undefined &&
- $.inArray('true', map['wopi'].HideUserList) < 0 &&
- ((window.mode.isMobile() && $.inArray('mobile', map['wopi'].HideUserList) < 0) ||
- (window.mode.isTablet() && $.inArray('tablet', map['wopi'].HideUserList) < 0));
- if (this.get('userlist').hidden == true && showUserList) {
- this.show('userlist');
- this.show('userlistbreak');
- map.on('deselectuser', deselectUser);
- map.on('addview', onAddView);
- map.on('removeview', onRemoveView);
- }
- }
- });
- toolbar.bind('touchstart', function(e) {
- w2ui['actionbar'].touchStarted = true;
- var touchEvent = e.originalEvent;
- if (touchEvent && touchEvent.touches.length > 1) {
- L.DomEvent.preventDefault(e);
- }
- });
-
- toolbar = $('#formulabar');
- toolbar.w2toolbar({
- name: 'formulabar',
- tooltip: 'bottom',
- hidden: true,
- 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(e) {
- w2ui['formulabar'].touchStarted = true;
- var touchEvent = e.originalEvent;
- if (touchEvent && touchEvent.touches.length > 1) {
- L.DomEvent.preventDefault(e);
- }
- });
-
- $(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',
- hidden: true,
- items: [
- {type: 'button', id: 'firstrecord', img: 'firstrecord', hint: _('First sheet')},
- {type: 'button', id: 'prevrecord', img: 'prevrecord', hint: _('Previous sheet')},
- {type: 'button', id: 'nextrecord', img: 'nextrecord', hint: _('Next sheet')},
- {type: 'button', id: 'lastrecord', img: 'lastrecord', hint: _('Last sheet')},
- {type: 'button', id: 'insertsheet', img: 'insertsheet', hint: _('Insert sheet')}
- ],
- onClick: function (e) {
- onClick(e, e.target);
- hideTooltip(this, e.target);
- }
- });
- toolbar.bind('touchstart', function(e) {
- w2ui['spreadsheet-toolbar'].touchStarted = true;
- var touchEvent = e.originalEvent;
- if (touchEvent && touchEvent.touches.length > 1) {
- L.DomEvent.preventDefault(e);
- }
- });
-
- toolbar = $('#presentation-toolbar');
- toolbar.w2toolbar({
- name: 'presentation-toolbar',
- tooltip: 'bottom',
- hidden: true,
- items: []
- });
-
- toolbar = $('#toolbar-down');
- toolbar.w2toolbar({
- name: 'editbar',
- tooltip: 'top',
- items: toolItems,
- onClick: function (e) {
- onClick(e, e.target);
- hideTooltip(this, e.target);
- },
- onRefresh: function(edata) {
- if (edata.target === 'styles' || edata.target === 'fonts' || edata.target === 'fontsizes') {
- var toolItem = $(this.box).find('#tb_'+ this.name +'_item_'+ w2utils.escapeId(edata.item.id));
- if (edata.item.hidden) {
- toolItem.css('display', 'none');
- } else {
- toolItem.css('display', '');
- }
- updateCommandValues(edata.target);
- }
-
- if (edata.target === 'editbar' && 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);
- }
- }
-
- if (edata.target === 'inserttable')
- insertTable();
-
- if (edata.target === 'insertshapes')
- insertShapes();
- }
- });
-
- toolbar.bind('touchstart', function(e) {
- w2ui['editbar'].touchStarted = true;
- var touchEvent = e.originalEvent;
- if (touchEvent && touchEvent.touches.length > 1) {
- L.DomEvent.preventDefault(e);
- }
- });
-}
-
function initNormalToolbar(toolItems) {
var toolbar = $('#toolbar-up');
toolbar.w2toolbar({
More information about the Libreoffice-commits
mailing list