[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-4' - 7 commits - loleaflet/css loleaflet/js loleaflet/src test/httpwstest.cpp wsd/DocumentBroker.cpp wsd/Storage.cpp wsd/Storage.hpp
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Sat Dec 15 14:08:07 UTC 2018
loleaflet/css/loleaflet.css | 14 +-
loleaflet/css/spreadsheet.css | 19 ++-
loleaflet/css/toolbar.css | 2
loleaflet/js/toolbar.js | 173 +++++++++++++++++++++-------------
loleaflet/src/control/Control.Tabs.js | 16 +--
loleaflet/src/map/Map.js | 21 +---
loleaflet/src/map/handler/Map.WOPI.js | 3
test/httpwstest.cpp | 1
wsd/DocumentBroker.cpp | 1
wsd/Storage.cpp | 4
wsd/Storage.hpp | 10 +
11 files changed, 169 insertions(+), 95 deletions(-)
New commits:
commit 13b86d7b6439521b3a61f559699dd73e3988d7aa
Author: Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Thu Dec 13 16:24:07 2018 +0100
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Sat Dec 15 15:07:22 2018 +0100
Don't show 'null' in IE, Correct isArray test
Change-Id: Ic1a34aebc989dd2bf7ab55097f2edf77189883e8
(cherry picked from commit c5b98a7c896916fd23c963d5815441b2e9984aeb)
diff --git a/loleaflet/js/toolbar.js b/loleaflet/js/toolbar.js
index 90588b535..9ed53ec2a 100644
--- a/loleaflet/js/toolbar.js
+++ b/loleaflet/js/toolbar.js
@@ -882,9 +882,9 @@ function initMobileToolbar(toolItems) {
var showUserList = map['wopi'].HideUserList !== null &&
map['wopi'].HideUserList !== undefined &&
- !$.inArray('true', map['wopi'].HideUserList) &&
- ((window.mode.isMobile() && !$.inArray('mobile', map['wopi'].HideUserList)) ||
- (window.mode.isTablet() && !$.inArray('tablet', map['wopi'].HideUserList)));
+ $.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');
@@ -1256,8 +1256,8 @@ function initNormalToolbar(toolItems) {
var showInDesktop = map['wopi'].HideUserList !== null &&
map['wopi'].HideUserList !== undefined &&
- !$.inArray('true', map['wopi'].HideUserList) &&
- !$.inArray('desktop', map['wopi'].HideUserList);
+ $.inArray('true', map['wopi'].HideUserList) < 0 &&
+ $.inArray('desktop', map['wopi'].HideUserList) < 0;
if (this.get('userlist').hidden == true && showInDesktop) {
this.show('userlist');
this.show('userlistbreak');
diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index 25c2d7782..bad0ac53a 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -280,7 +280,7 @@ L.Map = L.Evented.extend({
this.updateModificationIndicator(this._lastmodtime);
// Replace menu button body with new content
- lastModButton.firstChild.innerHTML = null;
+ lastModButton.firstChild.innerHTML = '';
lastModButton.firstChild.appendChild(mainSpan);
}
},
@@ -292,7 +292,7 @@ L.Map = L.Evented.extend({
var special = [ 'bn_IN', 'hi_IN', 'id_ID', 'nb_NO', 'nn_NO', 'pt_BR', 'zh_CN', 'zh_TW'];
var locale = String.locale;
locale = locale.replace('-', '_');
- if (!$.inArray(locale, special)) {
+ if ($.inArray(locale, special) < 0) {
if (locale.indexOf('_') > 0) {
locale = locale.substring(0, locale.indexOf('_'));
}
commit 9b5a92cf6bb53ce99a13dc0e0f807ffcd77710e2
Author: Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Thu Dec 13 16:11:31 2018 +0100
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Sat Dec 15 15:07:18 2018 +0100
Replace 'includes' with 'jQuery.isArray'
Change-Id: Idf5a0bc9cbb6850164b21c90bcf98876bc62db68
(cherry picked from commit 45282b1d5944716f7b5733c99e87669900c4936a)
diff --git a/loleaflet/js/toolbar.js b/loleaflet/js/toolbar.js
index 13188614f..90588b535 100644
--- a/loleaflet/js/toolbar.js
+++ b/loleaflet/js/toolbar.js
@@ -882,9 +882,9 @@ function initMobileToolbar(toolItems) {
var showUserList = map['wopi'].HideUserList !== null &&
map['wopi'].HideUserList !== undefined &&
- !map['wopi'].HideUserList.includes('true') &&
- ((window.mode.isMobile() && !map['wopi'].HideUserList.includes('mobile')) ||
- (window.mode.isTablet() && !map['wopi'].HideUserList.includes('tablet')));
+ !$.inArray('true', map['wopi'].HideUserList) &&
+ ((window.mode.isMobile() && !$.inArray('mobile', map['wopi'].HideUserList)) ||
+ (window.mode.isTablet() && !$.inArray('tablet', map['wopi'].HideUserList)));
if (this.get('userlist').hidden == true && showUserList) {
this.show('userlist');
this.show('userlistbreak');
@@ -1256,8 +1256,8 @@ function initNormalToolbar(toolItems) {
var showInDesktop = map['wopi'].HideUserList !== null &&
map['wopi'].HideUserList !== undefined &&
- !map['wopi'].HideUserList.includes('true') &&
- !map['wopi'].HideUserList.includes('desktop');
+ !$.inArray('true', map['wopi'].HideUserList) &&
+ !$.inArray('desktop', map['wopi'].HideUserList);
if (this.get('userlist').hidden == true && showInDesktop) {
this.show('userlist');
this.show('userlistbreak');
diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index f6a3ee0ac..25c2d7782 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -292,7 +292,7 @@ L.Map = L.Evented.extend({
var special = [ 'bn_IN', 'hi_IN', 'id_ID', 'nb_NO', 'nn_NO', 'pt_BR', 'zh_CN', 'zh_TW'];
var locale = String.locale;
locale = locale.replace('-', '_');
- if (!special.includes(locale)) {
+ if (!$.inArray(locale, special)) {
if (locale.indexOf('_') > 0) {
locale = locale.substring(0, locale.indexOf('_'));
}
commit 26f50e9b66556d513bf2662bf413b6710d09e7cc
Author: Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Thu Dec 13 15:37:35 2018 +0100
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Sat Dec 15 15:07:15 2018 +0100
Fix typo in the timeago.js languages
Change-Id: I1776d749fc6a03f70279897285688deafbe71d59
(cherry picked from commit 41413542ceda3b92fd13b72a93e98c7aa2f772e5)
diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index 0e6e4ec48..f6a3ee0ac 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -289,15 +289,14 @@ L.Map = L.Evented.extend({
this._lastmodtime = newModificationTime;
if (this.lastModIndicator !== null && this.lastModIndicator !== undefined) {
// Get locale
- var special = [ 'bn_IN', 'hi_IN', 'id_ID', 'nb_NO', 'nn_NO', 'pt-BR', 'zh_CN', 'zh_TW'];
+ var special = [ 'bn_IN', 'hi_IN', 'id_ID', 'nb_NO', 'nn_NO', 'pt_BR', 'zh_CN', 'zh_TW'];
var locale = String.locale;
locale = locale.replace('-', '_');
if (!special.includes(locale)) {
if (locale.indexOf('_') > 0) {
- locale = locale.substring(0, locale.indexOf('_') - 1);
+ locale = locale.substring(0, locale.indexOf('_'));
}
}
-
// Real-time auto update
this.lastModIndicator.setAttribute('datetime', newModificationTime);
timeago().render(this.lastModIndicator, locale);
commit a9cc01eb4c9016251729fc56e45e826119f86055
Author: Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Dec 12 14:51:37 2018 +0100
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Sat Dec 15 15:07:10 2018 +0100
WOPI: Extend HideUserList property
Added "mobile" | "tablet" | "desktop" values support.
"," is used as a delimiter
Change-Id: Idfa4670f229725dfedfb2d55b622263cbcfd6fc2
(cherry picked from commit e2b464b2378e8c96523c81ed54e5de2a081d8836)
diff --git a/loleaflet/js/toolbar.js b/loleaflet/js/toolbar.js
index 0b2918571..13188614f 100644
--- a/loleaflet/js/toolbar.js
+++ b/loleaflet/js/toolbar.js
@@ -879,6 +879,19 @@ function initMobileToolbar(toolItems) {
this.show('prev');
this.show('next');
}
+
+ var showUserList = map['wopi'].HideUserList !== null &&
+ map['wopi'].HideUserList !== undefined &&
+ !map['wopi'].HideUserList.includes('true') &&
+ ((window.mode.isMobile() && !map['wopi'].HideUserList.includes('mobile')) ||
+ (window.mode.isTablet() && !map['wopi'].HideUserList.includes('tablet')));
+ 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) {
@@ -1241,13 +1254,16 @@ function initNormalToolbar(toolItems) {
$('#search-input').off('input', onSearch).on('input', onSearch);
$('#search-input').off('keydown', onSearchKeyDown).on('keydown', onSearchKeyDown);
- if (this.get('userlist').hidden == true && map['wopi'].HideUserList === false) {
+ var showInDesktop = map['wopi'].HideUserList !== null &&
+ map['wopi'].HideUserList !== undefined &&
+ !map['wopi'].HideUserList.includes('true') &&
+ !map['wopi'].HideUserList.includes('desktop');
+ if (this.get('userlist').hidden == true && showInDesktop) {
this.show('userlist');
this.show('userlistbreak');
- }
- else if (this.get('userlist').hidden == false && map['wopi'].HideUserList === true) {
- this.hide('userlist');
- this.hide('userlistbreak');
+ map.on('deselectuser', deselectUser);
+ map.on('addview', onAddView);
+ map.on('removeview', onRemoveView);
}
}
});
@@ -1262,12 +1278,6 @@ function initNormalToolbar(toolItems) {
toolbar.bind('touchstart', function() {
w2ui['actionbar'].touchStarted = true;
});
-
- if (map['wopi'].HideUserList === false) {
- map.on('deselectuser', deselectUser);
- map.on('addview', onAddView);
- map.on('removeview', onRemoveView);
- }
}
var userJoinedPopupMessage = '<div>' + _('%user has joined') + '</div>';
diff --git a/loleaflet/src/map/handler/Map.WOPI.js b/loleaflet/src/map/handler/Map.WOPI.js
index 088cea644..b0d5a7750 100644
--- a/loleaflet/src/map/handler/Map.WOPI.js
+++ b/loleaflet/src/map/handler/Map.WOPI.js
@@ -22,7 +22,7 @@ L.Map.WOPI = L.Handler.extend({
UserCanNotWriteRelative: true,
EnableInsertRemoteImage: false,
EnableShare: false,
- HideUserList: false,
+ HideUserList: null,
CallPythonScriptSource: null,
_appLoadedConditions: {
@@ -80,7 +80,8 @@ L.Map.WOPI = L.Handler.extend({
this.UserCanNotWriteRelative = !!wopiInfo['UserCanNotWriteRelative'];
this.EnableInsertRemoteImage = !!wopiInfo['EnableInsertRemoteImage'];
this.EnableShare = !!wopiInfo['EnableShare'];
- this.HideUserList = !!wopiInfo['HideUserList'];
+ if (wopiInfo['HideUserList'])
+ this.HideUserList = wopiInfo['HideUserList'].split(',');
this._map.fire('postMessage', {
msgId: 'App_LoadingStatus',
diff --git a/wsd/Storage.cpp b/wsd/Storage.cpp
index ef5c11d4b..ebb5acd42 100644
--- a/wsd/Storage.cpp
+++ b/wsd/Storage.cpp
@@ -498,7 +498,7 @@ std::unique_ptr<WopiStorage::WOPIFileInfo> WopiStorage::getWOPIFileInfo(const Au
bool userCanNotWriteRelative = true;
bool enableInsertRemoteImage = false;
bool enableShare = false;
- bool hideUserList = false;
+ std::string hideUserList("false");
WOPIFileInfo::TriState disableChangeTrackingRecord = WOPIFileInfo::TriState::Unset;
WOPIFileInfo::TriState disableChangeTrackingShow = WOPIFileInfo::TriState::Unset;
WOPIFileInfo::TriState hideChangeTrackingControls = WOPIFileInfo::TriState::Unset;
diff --git a/wsd/Storage.hpp b/wsd/Storage.hpp
index 2b926eb97..fd70515c4 100644
--- a/wsd/Storage.hpp
+++ b/wsd/Storage.hpp
@@ -324,7 +324,7 @@ public:
const bool userCanNotWriteRelative,
const bool enableInsertRemoteImage,
const bool enableShare,
- const bool hideUserList,
+ const std::string& hideUserList,
const TriState disableChangeTrackingShow,
const TriState disableChangeTrackingRecord,
const TriState hideChangeTrackingControls,
@@ -438,8 +438,10 @@ public:
bool _enableInsertRemoteImage;
/// If set to true, users can access the file share functionality
bool _enableShare;
- /// If set to true, user list on the status bar will be hidden
- bool _hideUserList;
+ /// If set to "true", user list on the status bar will be hidden
+ /// If set to "mobile" | "tablet" | "desktop", will be hidden on a specified device
+ /// (may be joint, delimited by commas eg. "mobile,tablet")
+ std::string _hideUserList;
/// If we should disable change-tracking visibility by default (meaningful at loading).
TriState _disableChangeTrackingShow;
/// If we should disable change-tracking ability by default (meaningful at loading).
commit 069ec7495e4ccee952547b4f3a773a8c4a9ed9b0
Author: Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Dec 12 11:05:31 2018 +0100
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Sat Dec 15 15:07:06 2018 +0100
WOPI: Added HideUserList to CheckFileInfo
Change-Id: Id0f9597d52fb339162a9ce4f622aa39694d1a25e
(cherry picked from commit f6266188822ffc2c300932cdbf2f4681f6cb4321)
diff --git a/loleaflet/js/toolbar.js b/loleaflet/js/toolbar.js
index f1d8c611f..0b2918571 100644
--- a/loleaflet/js/toolbar.js
+++ b/loleaflet/js/toolbar.js
@@ -1196,8 +1196,8 @@ function initNormalToolbar(toolItems) {
{type: 'html', id: 'left'},
{type: 'html', id: 'right'},
{type: 'html', id: 'modifiedstatuslabel', html: '<div id="modifiedstatuslabel" class="loleaflet-font"></div>', mobile:false},
- {type: 'break', id: 'modifiedstatuslabelbreak', mobile:false},
- {type: 'drop', id: 'userlist', hidden: true, text: _('No users'), html: '<div id="userlist_container"><table id="userlist_table"><tbody></tbody></table>' +
+ {type: 'break', id: 'modifiedstatuslabelbreak', mobile: false},
+ {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>' +
@@ -1207,7 +1207,7 @@ function initNormalToolbar(toolItems) {
'<p id="currently-msg">' + _('Current') + ' - <b><span id="current-editor"></span></b></p>' +
'</div>'
},
- {type: 'break', id: 'userlistbreak'},
+ {type: 'break', id: 'userlistbreak', hidden: true, mobile: false },
{type: 'button', id: 'prev', img: 'prev', hint: _UNO('.uno:PageUp', 'text')},
{type: 'button', id: 'next', img: 'next', hint: _UNO('.uno:PageDown', 'text')},
{type: 'break', id: 'prevnextbreak'},
@@ -1240,6 +1240,15 @@ function initNormalToolbar(toolItems) {
$('#tb_actionbar_item_userlist .w2ui-tb-caption').addClass('loleaflet-font');
$('#search-input').off('input', onSearch).on('input', onSearch);
$('#search-input').off('keydown', onSearchKeyDown).on('keydown', onSearchKeyDown);
+
+ if (this.get('userlist').hidden == true && map['wopi'].HideUserList === false) {
+ this.show('userlist');
+ this.show('userlistbreak');
+ }
+ else if (this.get('userlist').hidden == false && map['wopi'].HideUserList === true) {
+ this.hide('userlist');
+ this.hide('userlistbreak');
+ }
}
});
}
@@ -1253,6 +1262,12 @@ function initNormalToolbar(toolItems) {
toolbar.bind('touchstart', function() {
w2ui['actionbar'].touchStarted = true;
});
+
+ if (map['wopi'].HideUserList === false) {
+ map.on('deselectuser', deselectUser);
+ map.on('addview', onAddView);
+ map.on('removeview', onRemoveView);
+ }
}
var userJoinedPopupMessage = '<div>' + _('%user has joined') + '</div>';
@@ -1587,34 +1602,49 @@ function onDocLayerInit() {
if (!_inMobileMode()) {
statusbar.insert('left', [
- {type: 'break', id:'break1'},
- {type: 'html', id: 'StatusDocPos',
- html: '<div id="StatusDocPos" class="loleaflet-font" title="'+_('Number of Sheets')+ '" style="padding: 5px 5px;">  </div>' },
- {type: 'break', id:'break2'},
- {type: 'html', id: 'RowColSelCount',
- html: '<div id="RowColSelCount" class="loleaflet-font" title="'+_('Selected range of cells')+ '" style="padding: 5px 5px;">  </div>' },
- {type: 'break', id:'break3'},
- {type: 'html', id: 'InsertMode', mobile: false,
- html: '<div id="InsertMode" class="loleaflet-font" title="'+_('Entering text mode')+ '" style="padding: 5px 5px;">  </div>' },
- {type: 'break', id:'break4'},
- {type: 'html', id: 'LanguageStatus', mobile: false,
- html: '<div id="LanguageStatus" class="loleaflet-font" title="'+_('Text Language')+ '" style="padding: 5px 5px;">  </div>' },
- {type: 'break', id:'break5'},
- {type: 'html', id: 'StatusSelectionMode', mobile: false,
- html: '<div id="StatusSelectionMode" class="loleaflet-font" title="'+_('Selection Mode')+ '" style="padding: 5px 5px;">  </div>' },
- {type: 'break', id:'break8', mobile: false},
- {type: 'html', id: 'StateTableCell', mobile:false,
- html: '<div id="StateTableCell" class="loleaflet-font" title="'+_('Choice of functions')+ '" style="padding: 5px 5px;">  </div>' },
- {type: 'menu-check', id: 'StateTableCellMenu', caption: '', selected: ['2', '512'], items: [
- { id: '2', text: _('Average')},
- { id: '8', text: _('CountA')},
- { id: '4', text: _('Count')},
- { id: '16', text: _('Maximum')},
- { id: '32', text: _('Minimum')},
- { id: '512', text: _('Sum')},
- { id: '8192', text: _('Selection count')},
- { id: '1', text: _('None')}
- ]}
+ {type: 'break', id: 'break1'},
+ {
+ type: 'html', id: 'StatusDocPos',
+ html: '<div id="StatusDocPos" class="loleaflet-font" title="' + _('Number of Sheets') + '" style="padding: 5px 5px;">  </div>'
+ },
+ {type: 'break', id: 'break2'},
+ {
+ type: 'html', id: 'RowColSelCount',
+ html: '<div id="RowColSelCount" class="loleaflet-font" title="' + _('Selected range of cells') + '" style="padding: 5px 5px;">  </div>'
+ },
+ {type: 'break', id: 'break3'},
+ {
+ type: 'html', id: 'InsertMode', mobile: false,
+ html: '<div id="InsertMode" class="loleaflet-font" title="' + _('Entering text mode') + '" style="padding: 5px 5px;">  </div>'
+ },
+ {type: 'break', id: 'break4'},
+ {
+ type: 'html', id: 'LanguageStatus', mobile: false,
+ html: '<div id="LanguageStatus" class="loleaflet-font" title="' + _('Text Language') + '" style="padding: 5px 5px;">  </div>'
+ },
+ {type: 'break', id: 'break5'},
+ {
+ type: 'html', id: 'StatusSelectionMode', mobile: false,
+ html: '<div id="StatusSelectionMode" class="loleaflet-font" title="' + _('Selection Mode') + '" style="padding: 5px 5px;">  </div>'
+ },
+ {type: 'break', id: 'break8', mobile: false},
+ {
+ type: 'html', id: 'StateTableCell', mobile: false,
+ html: '<div id="StateTableCell" class="loleaflet-font" title="' + _('Choice of functions') + '" style="padding: 5px 5px;">  </div>'
+ },
+ {
+ type: 'menu-check', id: 'StateTableCellMenu', caption: '', selected: ['2', '512'], items: [
+ {id: '2', text: _('Average')},
+ {id: '8', text: _('CountA')},
+ {id: '4', text: _('Count')},
+ {id: '16', text: _('Maximum')},
+ {id: '32', text: _('Minimum')},
+ {id: '512', text: _('Sum')},
+ {id: '8192', text: _('Selection count')},
+ {id: '1', text: _('None')}
+ ]
+ },
+ {type: 'break', id: 'break8', mobile: false}
]);
$('#spreadsheet-toolbar').show();
@@ -1630,20 +1660,31 @@ function onDocLayerInit() {
if (!_inMobileMode()) {
statusbar.insert('left', [
{type: 'break', id: 'break1'},
- {type: 'html', id: 'StatePageNumber',
- html: '<div id="StatePageNumber" class="loleaflet-font" title="'+_('Number of Pages')+ '" style="padding: 5px 5px;">  </div>' },
- {type: 'break', id:'break2'},
- {type: 'html', id: 'StateWordCount', mobile: false,
- html: '<div id="StateWordCount" class="loleaflet-font" title="'+_('Word Counter')+ '" style="padding: 5px 5px;">  </div>' },
- {type: 'break', id:'break5', mobile: false},
- {type: 'html', id: 'InsertMode', mobile: false,
- html: '<div id="InsertMode" class="loleaflet-font" title="'+_('Entering text mode')+ '" style="padding: 5px 5px;">  </div>' },
- {type: 'break', id:'break6', mobile:false},
- {type: 'html', id: 'StatusSelectionMode', mobile: false,
- html: '<div id="StatusSelectionMode" class="loleaflet-font" title="'+_('Selection Mode')+ '" style="padding: 5px 5px;">  </div>' },
- {type: 'break', id:'break7', mobile:false},
- {type: 'html', id: 'LanguageStatus', mobile: false,
- html: '<div id="LanguageStatus" class="loleaflet-font" title="'+_('Text Language')+ '" style="padding: 5px 5px;">  </div>' }
+ {
+ type: 'html', id: 'StatePageNumber',
+ html: '<div id="StatePageNumber" class="loleaflet-font" title="' + _('Number of Pages') + '" style="padding: 5px 5px;">  </div>'
+ },
+ {type: 'break', id: 'break2'},
+ {
+ type: 'html', id: 'StateWordCount', mobile: false,
+ html: '<div id="StateWordCount" class="loleaflet-font" title="' + _('Word Counter') + '" style="padding: 5px 5px;">  </div>'
+ },
+ {type: 'break', id: 'break5', mobile: false},
+ {
+ type: 'html', id: 'InsertMode', mobile: false,
+ html: '<div id="InsertMode" class="loleaflet-font" title="' + _('Entering text mode') + '" style="padding: 5px 5px;">  </div>'
+ },
+ {type: 'break', id: 'break6', mobile: false},
+ {
+ type: 'html', id: 'StatusSelectionMode', mobile: false,
+ html: '<div id="StatusSelectionMode" class="loleaflet-font" title="' + _('Selection Mode') + '" style="padding: 5px 5px;">  </div>'
+ },
+ {type: 'break', id: 'break7', mobile: false},
+ {
+ type: 'html', id: 'LanguageStatus', mobile: false,
+ html: '<div id="LanguageStatus" class="loleaflet-font" title="' + _('Text Language') + '" style="padding: 5px 5px;">  </div>'
+ },
+ {type: 'break', id: 'break8', mobile: false}
]);
}
@@ -1664,7 +1705,8 @@ function onDocLayerInit() {
{
type: 'html', id: 'LanguageStatus', mobile: false,
html: '<div id="LanguageStatus" class="loleaflet-font" title="' + _('Text Language') + '" style="padding: 5px 5px;">  </div>'
- }
+ },
+ {type: 'break', id: 'break8', mobile: false}
]);
}
// FALLTHROUGH intended
diff --git a/loleaflet/src/map/handler/Map.WOPI.js b/loleaflet/src/map/handler/Map.WOPI.js
index 7120977d3..088cea644 100644
--- a/loleaflet/src/map/handler/Map.WOPI.js
+++ b/loleaflet/src/map/handler/Map.WOPI.js
@@ -22,6 +22,7 @@ L.Map.WOPI = L.Handler.extend({
UserCanNotWriteRelative: true,
EnableInsertRemoteImage: false,
EnableShare: false,
+ HideUserList: false,
CallPythonScriptSource: null,
_appLoadedConditions: {
@@ -79,6 +80,7 @@ L.Map.WOPI = L.Handler.extend({
this.UserCanNotWriteRelative = !!wopiInfo['UserCanNotWriteRelative'];
this.EnableInsertRemoteImage = !!wopiInfo['EnableInsertRemoteImage'];
this.EnableShare = !!wopiInfo['EnableShare'];
+ this.HideUserList = !!wopiInfo['HideUserList'];
this._map.fire('postMessage', {
msgId: 'App_LoadingStatus',
diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index 531cf9e74..2ea017bc2 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -552,6 +552,7 @@ bool DocumentBroker::load(const std::shared_ptr<ClientSession>& session, const s
wopiInfo->set("UserCanNotWriteRelative", wopifileinfo->getUserCanNotWriteRelative());
wopiInfo->set("EnableInsertRemoteImage", wopifileinfo->getEnableInsertRemoteImage());
wopiInfo->set("EnableShare", wopifileinfo->getEnableShare());
+ wopiInfo->set("HideUserList", wopifileinfo->_hideUserList);
if (wopifileinfo->getHideChangeTrackingControls() != WopiStorage::WOPIFileInfo::TriState::Unset)
wopiInfo->set("HideChangeTrackingControls", wopifileinfo->getHideChangeTrackingControls() == WopiStorage::WOPIFileInfo::TriState::True);
diff --git a/wsd/Storage.cpp b/wsd/Storage.cpp
index 11c658b65..ef5c11d4b 100644
--- a/wsd/Storage.cpp
+++ b/wsd/Storage.cpp
@@ -498,6 +498,7 @@ std::unique_ptr<WopiStorage::WOPIFileInfo> WopiStorage::getWOPIFileInfo(const Au
bool userCanNotWriteRelative = true;
bool enableInsertRemoteImage = false;
bool enableShare = false;
+ bool hideUserList = false;
WOPIFileInfo::TriState disableChangeTrackingRecord = WOPIFileInfo::TriState::Unset;
WOPIFileInfo::TriState disableChangeTrackingShow = WOPIFileInfo::TriState::Unset;
WOPIFileInfo::TriState hideChangeTrackingControls = WOPIFileInfo::TriState::Unset;
@@ -578,6 +579,7 @@ std::unique_ptr<WopiStorage::WOPIFileInfo> WopiStorage::getWOPIFileInfo(const Au
JsonUtil::findJSONValue(object, "UserCanNotWriteRelative", userCanNotWriteRelative);
JsonUtil::findJSONValue(object, "EnableInsertRemoteImage", enableInsertRemoteImage);
JsonUtil::findJSONValue(object, "EnableShare", enableShare);
+ JsonUtil::findJSONValue(object, "HideUserList", hideUserList);
bool booleanFlag = false;
if (JsonUtil::findJSONValue(object, "DisableChangeTrackingRecord", booleanFlag))
disableChangeTrackingRecord = (booleanFlag ? WOPIFileInfo::TriState::True : WOPIFileInfo::TriState::False);
@@ -606,7 +608,7 @@ std::unique_ptr<WopiStorage::WOPIFileInfo> WopiStorage::getWOPIFileInfo(const Au
postMessageOrigin, hidePrintOption, hideSaveOption, hideExportOption,
enableOwnerTermination, disablePrint, disableExport, disableCopy,
disableInactiveMessages, userCanNotWriteRelative, enableInsertRemoteImage, enableShare,
- disableChangeTrackingShow, disableChangeTrackingRecord,
+ hideUserList, disableChangeTrackingShow, disableChangeTrackingRecord,
hideChangeTrackingControls, callDuration}));
}
diff --git a/wsd/Storage.hpp b/wsd/Storage.hpp
index 77a2f675b..2b926eb97 100644
--- a/wsd/Storage.hpp
+++ b/wsd/Storage.hpp
@@ -324,6 +324,7 @@ public:
const bool userCanNotWriteRelative,
const bool enableInsertRemoteImage,
const bool enableShare,
+ const bool hideUserList,
const TriState disableChangeTrackingShow,
const TriState disableChangeTrackingRecord,
const TriState hideChangeTrackingControls,
@@ -345,6 +346,7 @@ public:
_userCanNotWriteRelative(userCanNotWriteRelative),
_enableInsertRemoteImage(enableInsertRemoteImage),
_enableShare(enableShare),
+ _hideUserList(hideUserList),
_disableChangeTrackingShow(disableChangeTrackingShow),
_disableChangeTrackingRecord(disableChangeTrackingRecord),
_hideChangeTrackingControls(hideChangeTrackingControls),
@@ -432,10 +434,12 @@ public:
bool _disableInactiveMessages;
/// If set to false, users can access the save-as functionality
bool _userCanNotWriteRelative;
- /// if set to true, users can access the insert remote image functionality
+ /// If set to true, users can access the insert remote image functionality
bool _enableInsertRemoteImage;
- /// if set to true, users can access the file share functionality
+ /// If set to true, users can access the file share functionality
bool _enableShare;
+ /// If set to true, user list on the status bar will be hidden
+ bool _hideUserList;
/// If we should disable change-tracking visibility by default (meaningful at loading).
TriState _disableChangeTrackingShow;
/// If we should disable change-tracking ability by default (meaningful at loading).
commit 6b0f703e7b55c4c03cbd0eaae142cd46e55a35b3
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Fri Dec 14 17:59:00 2018 +0100
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Sat Dec 15 15:06:58 2018 +0100
Handle Special character toolbar item state correctly
The toolbar item should have the same names as the UNO command in lower case.
Change-Id: I68264e7d58cca829084965fb5ea9686a85ccd9cd
(cherry picked from commit 209e1cd7eef466a75b3360b819078112720a47e6)
diff --git a/loleaflet/css/toolbar.css b/loleaflet/css/toolbar.css
index 53d5b7490..59aa34953 100644
--- a/loleaflet/css/toolbar.css
+++ b/loleaflet/css/toolbar.css
@@ -562,7 +562,7 @@ button.leaflet-control-search-next
.w2ui-icon.inserttable{ background: url('images/lc_inserttable.svg') no-repeat center !important; }
.w2ui-icon.insertgraphic{ background: url('images/lc_gallery.svg') no-repeat center !important; }
.w2ui-icon.link{ background: url('images/lc_inserthyperlink.svg') no-repeat center !important; }
-.w2ui-icon.specialcharacter{ background: url('images/lc_insertsymbol.svg') no-repeat center !important; }
+.w2ui-icon.insertsymbol{ background: url('images/lc_insertsymbol.svg') no-repeat center !important; }
.w2ui-icon.edit{ background: url('images/lc_editdoc.svg') no-repeat center !important; }
.w2ui-icon.fold{ background: url('images/fold.svg') no-repeat center !important; }
.w2ui-icon.unfold{ background: url('images/unfold.svg') no-repeat center !important; }
diff --git a/loleaflet/js/toolbar.js b/loleaflet/js/toolbar.js
index 2895ea858..f1d8c611f 100644
--- a/loleaflet/js/toolbar.js
+++ b/loleaflet/js/toolbar.js
@@ -829,7 +829,7 @@ function createToolbar() {
html: '<div id="insertshape-wrapper"><div id="insertshape-popup" class="insertshape-pop ui-widget ui-corner-all"><div class="insertshape-grid"></div></div></div>'},
{type: 'button', id: 'link', img: 'link', hint: _UNO('.uno:HyperlinkDialog'), uno: 'HyperlinkDialog', disabled: true},
- {type: 'button', id: 'specialcharacter', img: 'specialcharacter', hint: _UNO('.uno:InsertSymbol', '', true), uno: '.uno:InsertSymbol'},
+ {type: 'button', id: 'insertsymbol', img: 'insertsymbol', hint: _UNO('.uno:InsertSymbol', '', true), uno: 'InsertSymbol'},
{type: 'spacer'},
{type: 'button', id: 'edit', img: 'edit'},
{type: 'button', id: 'fold', img: 'fold', mobile: false},
diff --git a/test/httpwstest.cpp b/test/httpwstest.cpp
index d3427d2bd..e86bec22c 100644
--- a/test/httpwstest.cpp
+++ b/test/httpwstest.cpp
@@ -2152,6 +2152,7 @@ void HTTPWSTest::testStateUnoCommandImpress()
".uno:PageStatus=",
".uno:LayoutStatus=",
".uno:Context=",
+ ".uno:InsertSymbol=",
};
try
commit 7f14283d96f747f382a63a258a5e9e3e5d686a5f
Author: Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Tue Dec 11 00:26:17 2018 +0100
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Sat Dec 15 15:05:43 2018 +0100
Fix toolbars position
Change-Id: Ib48bc53ebb5230f198de27d80ecffd3e0c4eec2f
(cherry picked from commit 30c06fab3332fc19a0348b27bb9f5aa7bab9b570)
diff --git a/loleaflet/css/loleaflet.css b/loleaflet/css/loleaflet.css
index bda949c39..fefaab466 100644
--- a/loleaflet/css/loleaflet.css
+++ b/loleaflet/css/loleaflet.css
@@ -8,8 +8,12 @@
left: 0px;
}
+#document-container.tablet {
+ top: 41px;
+}
+
#document-container.readonly {
- top: 36px;
+ top: 41px;
}
#toolbar-wrapper.readonly {
@@ -61,7 +65,7 @@ body {
}
#presentation-controls-wrapper.readonly {
- top: 36px;
+ top: 41px;
}
#toolbar-wrapper {
@@ -113,16 +117,16 @@ body {
top: 103px !important;
}
#document-container.spreadsheet-document.readonly {
- top: 56px !important;
+ top: 61px !important;
}
#document-container {
- top: 40px;
+ top: 41px;
}
#spreadsheet-row-column-frame {
top: 83px !important;
}
#spreadsheet-row-column-frame.readonly {
- top: 36px !important;
+ top: 41px !important;
}
#toolbar-hamburger {
width: 41px;
diff --git a/loleaflet/css/spreadsheet.css b/loleaflet/css/spreadsheet.css
index e445069e7..8d39c9690 100644
--- a/loleaflet/css/spreadsheet.css
+++ b/loleaflet/css/spreadsheet.css
@@ -1,12 +1,19 @@
#document-container.spreadsheet-document {
border-top: 1px solid #B6B6B6;
- top: 136px;
+ top: 137px;
left: 50px;
bottom: 68px;
}
#document-container.spreadsheet-document.readonly {
- top: 56px;
+ top: 61px;
+}
+
+#document-container.spreadsheet-document.tablet {
+ border-top: 1px solid #B6B6B6;
+ top: 100px;
+ left: 50px;
+ bottom: 68px;
}
.spreadsheet-tabs-container {
@@ -62,12 +69,16 @@
position: absolute;
left: 0;
right: 0;
- top: 116px;
+ top: 117px;
bottom: 65px;
}
#spreadsheet-row-column-frame.readonly {
- top: 36px;
+ top: 41px;
+}
+
+#spreadsheet-row-column-frame.tablet {
+ top: 80px;
}
#spreadsheet-header-corner-container {
diff --git a/loleaflet/js/toolbar.js b/loleaflet/js/toolbar.js
index a25a87b0a..2895ea858 100644
--- a/loleaflet/js/toolbar.js
+++ b/loleaflet/js/toolbar.js
@@ -1702,24 +1702,17 @@ function onDocLayerInit() {
statusbar.refresh();
if (window.mode.isTablet()) {
- // calc tablet version needs one more row before folding the menu
- if (window.mode.isTablet() && map._docLayer._docType == 'spreadsheet') {
- var content = $('#document-container');
- if (content) {
- var diff = 59;
- var prevTop = content.css('top');
- if (prevTop) {
- prevTop = parseInt(prevTop.slice(0, -2)) + diff;
- }
- else {
- prevTop = 0 + diff;
- }
- content.css({'top': String(prevTop) + 'px'});
- }
- }
-
// Fold menubar by default
- map.toggleMenubar();
+ // FIXME: reuse toogleMenubar / use css
+ $('.main-nav').css({'display': 'none'});
+ $('#closebuttonwrapper').css({'display': 'none'});
+ var obj = $('.fold');
+ obj.removeClass('w2ui-icon fold');
+ obj.addClass('w2ui-icon unfold');
+ $('#document-container').addClass('tablet');
+ $('#spreadsheet-row-column-frame').addClass('tablet');
+ $('#presentation-controls-wrapper').css({'top': '41px'});
+
$('#tb_editbar_item_fonts').css({'display': 'none'});
$('#tb_editbar_item_fontsizes').css({'display': 'none'});
}
diff --git a/loleaflet/src/control/Control.Tabs.js b/loleaflet/src/control/Control.Tabs.js
index 6c9b8ae73..494d523c8 100644
--- a/loleaflet/src/control/Control.Tabs.js
+++ b/loleaflet/src/control/Control.Tabs.js
@@ -22,13 +22,15 @@ L.Control.Tabs = L.Control.extend({
$('.spreadsheet-tab').contextMenu(e.perm === 'edit');
}, 1000);
- if (e.perm === 'edit') {
- $('.spreadsheet-tabs-container').css('bottom', '33px');
- $('#spreadsheet-toolbar').css('bottom', '33px');
- }
- else {
- $('.spreadsheet-tabs-container').css('bottom', '0px');
- $('#spreadsheet-toolbar').css('bottom', '0px');
+ if (window.mode.isMobile() == true) {
+ if (e.perm === 'edit') {
+ $('.spreadsheet-tabs-container').css('bottom', '33px');
+ $('#spreadsheet-toolbar').css('bottom', '33px');
+ }
+ else {
+ $('.spreadsheet-tabs-container').css('bottom', '0px');
+ $('#spreadsheet-toolbar').css('bottom', '0px');
+ }
}
},
diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index 4e198e381..0e6e4ec48 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -1416,9 +1416,9 @@ L.Map = L.Evented.extend({
obj.removeClass('w2ui-icon unfold');
obj.addClass('w2ui-icon fold');
- moveObjectVertically($('#spreadsheet-row-column-frame'), 35);
- moveObjectVertically($('#document-container'), 35);
- moveObjectVertically($('#presentation-controls-wrapper'), 35);
+ moveObjectVertically($('#spreadsheet-row-column-frame'), 36);
+ moveObjectVertically($('#document-container'), 36);
+ moveObjectVertically($('#presentation-controls-wrapper'), 36);
}
else {
$('.main-nav').css({'display': 'none'});
@@ -1428,9 +1428,9 @@ L.Map = L.Evented.extend({
obj.removeClass('w2ui-icon fold');
obj.addClass('w2ui-icon unfold');
- moveObjectVertically($('#spreadsheet-row-column-frame'), -35);
- moveObjectVertically($('#document-container'), -35);
- moveObjectVertically($('#presentation-controls-wrapper'), -35);
+ moveObjectVertically($('#spreadsheet-row-column-frame'), -36);
+ moveObjectVertically($('#document-container'), -36);
+ moveObjectVertically($('#presentation-controls-wrapper'), -36);
}
}
});
More information about the Libreoffice-commits
mailing list