[Libreoffice-commits] online.git: 2 commits - loleaflet/debug loleaflet/dist loleaflet/main.js loleaflet/src wsd/FileServer.cpp
Jan Holesovsky
kendy at collabora.com
Fri May 26 08:21:06 UTC 2017
loleaflet/debug/document/loleaflet.html | 1 -
loleaflet/dist/loleaflet.html | 15 ++++++++++++++-
loleaflet/main.js | 3 ---
loleaflet/src/control/Control.Menubar.js | 4 ++--
wsd/FileServer.cpp | 20 --------------------
5 files changed, 16 insertions(+), 27 deletions(-)
New commits:
commit 82704ed7779c6141308acbfcd8f8302a117c0378
Author: Jan Holesovsky <kendy at collabora.com>
Date: Fri May 26 10:18:05 2017 +0200
loleaflet: Let's not use a 'disableabout' param.
Instead, just disable the Help -> About choice if the 'about-dialog' div was
removed from loleaflet.html.
Change-Id: I997aa5489bcfbd02f56feb79bea14e92d3666bf2
diff --git a/loleaflet/debug/document/loleaflet.html b/loleaflet/debug/document/loleaflet.html
index f5462f84..33364cea 100644
--- a/loleaflet/debug/document/loleaflet.html
+++ b/loleaflet/debug/document/loleaflet.html
@@ -106,7 +106,6 @@
var permission = getParameterByName('permission') || 'edit';
var timestamp = getParameterByName('timestamp');
var closebutton = getParameterByName('closebutton');
- var disableAbout = getParameterByName('disableabout');
if (wopiSrc === '' && filePath === '') {
vex.dialog.alert(wrongwopisrc);
}
diff --git a/loleaflet/dist/loleaflet.html b/loleaflet/dist/loleaflet.html
index 0d587090..dfa03200 100644
--- a/loleaflet/dist/loleaflet.html
+++ b/loleaflet/dist/loleaflet.html
@@ -68,6 +68,7 @@
<div id="toolbar-down"></div>
+ <!-- Remove if you don't want the About dialog -->
<div id="about-dialog" style="display:none; text-align: center;">
<h1 id="product-name">LibreOffice Online</h1>
<hr/>
diff --git a/loleaflet/main.js b/loleaflet/main.js
index 2fb44b3d..48200cd9 100644
--- a/loleaflet/main.js
+++ b/loleaflet/main.js
@@ -75,8 +75,6 @@ var closebutton = getParameterByName('closebutton');
var revHistoryEnabled = getParameterByName('revisionhistory');
// Should the document go inactive or not
var alwaysActive = getParameterByName('alwaysactive');
-// Disable the about dialog
-var disableAbout = getParameterByName('disableabout');
// Loleaflet Debug mode
var debugMode = getParameterByName('debug');
if (wopiSrc === '' && filePath === '') {
@@ -90,7 +88,6 @@ if (host === '') {
// TODO: Get rid of these globals
global.closebutton = closebutton;
global.revHistoryEnabled = revHistoryEnabled;
-global.disableAbout = disableAbout;
global.title = title;
global.errorMessages = errorMessages;
var docURL, docParams;
diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js
index 29c64bbb..0b786615 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -2,7 +2,7 @@
* Control.Menubar
*/
-/* global $ _ map title vex revHistoryEnabled closebutton disableAbout*/
+/* global $ _ map title vex revHistoryEnabled closebutton */
L.Control.Menubar = L.Control.extend({
// TODO: Some mechanism to stop the need to copy duplicate menus (eg. Help)
options: {
@@ -541,7 +541,7 @@ L.Control.Menubar = L.Control.extend({
_createMenu: function(menu) {
var itemList = [];
for (var i in menu) {
- if (menu[i].id === 'about' && disableAbout) {
+ if (menu[i].id === 'about' && (L.DomUtil.get('about-dialog') === null)) {
continue;
}
commit 9aecf428f629a9ff33e6f7fd37d85a3023ac44d3
Author: Jan Holesovsky <kendy at collabora.com>
Date: Fri May 26 10:03:33 2017 +0200
Revert "wsd: enable option to remove About dialog elements"
The request was meant the other way around; let's just not present "About" in
the menu when there is no element with "about-dialog" id.
This reverts commit b9305d17ce5ecea66d5273de4a4bbc65d47a2b45.
diff --git a/loleaflet/dist/loleaflet.html b/loleaflet/dist/loleaflet.html
index 3a0974ff..0d587090 100644
--- a/loleaflet/dist/loleaflet.html
+++ b/loleaflet/dist/loleaflet.html
@@ -68,7 +68,19 @@
<div id="toolbar-down"></div>
- %ABOUT_DIALOG%
+ <div id="about-dialog" style="display:none; text-align: center;">
+ <h1 id="product-name">LibreOffice Online</h1>
+ <hr/>
+ <h3 id="product-string"></h3>
+ <p>
+ <h3>LOOLWSD</h3>
+ <div id="loolwsd-version"></div>
+ </p>
+ <p>
+ <h3>LOKit</h3>
+ <div id="lokit-version"></div>
+ </p>
+ </div>
<script>
window.host = '%HOST%';
diff --git a/wsd/FileServer.cpp b/wsd/FileServer.cpp
index ba4aedf8..18a82f5c 100644
--- a/wsd/FileServer.cpp
+++ b/wsd/FileServer.cpp
@@ -53,15 +53,6 @@ using Poco::Net::HTTPBasicCredentials;
using Poco::StreamCopier;
using Poco::Util::Application;
-static const std::string ABOUT_DIALOG =
- "<div id=\"about-dialog\" style=\"display:none; text-align: center;\">"
- "<h1 id=\"product-name\">LibreOffice Online</h1>"
- "<hr/>"
- "<h3 id=\"product-string\"></h3>"
- "<p><h3>LOOLWSD</h3><div id=\"loolwsd-version\"></div></p>"
- "<p><h3>LOKit</h3><div id=\"lokit-version\"></div></p>"
- "</div>";
-
std::map<std::string, std::pair<std::string, std::string>> FileServerRequestHandler::FileHash;
bool FileServerRequestHandler::isAdminLoggedIn(const HTTPRequest& request,
@@ -493,17 +484,6 @@ void FileServerRequestHandler::preprocessFile(const HTTPRequest& request, Poco::
}
}
- if (std::find_if(params.begin(), params.end(),
- [](const std::pair<std::string, std::string>& query)
- { return query.first == "disableabout" && !query.second.empty(); }) != params.end())
- {
- Poco::replaceInPlace(preprocess, std::string("%ABOUT_DIALOG%"), std::string());
- }
- else
- {
- Poco::replaceInPlace(preprocess, std::string("%ABOUT_DIALOG%"), ABOUT_DIALOG);
- }
-
Poco::replaceInPlace(preprocess, std::string("%ACCESS_TOKEN%"), escapedAccessToken);
Poco::replaceInPlace(preprocess, std::string("%ACCESS_TOKEN_TTL%"), std::to_string(tokenTtl));
Poco::replaceInPlace(preprocess, std::string("%HOST%"), host);
More information about the Libreoffice-commits
mailing list