summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2018-11-09 13:55:50 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2018-11-09 13:56:02 +0100
commitc74c9e39c8821e02a51507cc9c811aaa2062237a (patch)
tree7479cae1314f4c1c61192c7b22394133a6026c94
parentbf9df8d2bdd032927559c771b2184e8db036e33f (diff)
Disable document signing via config settingsigning
It's not too easy to customize CSS, so move the top position of the document container to loleaflet.html, where it's convenient to handle this. JS can dynamically query if the menu item should be there, similar to the about dialog. Change-Id: I4b2799a41f8ad31e3a9b4983fd1947d2e0363a2b
-rw-r--r--loleaflet/css/loleaflet.css1
-rw-r--r--loleaflet/html/loleaflet.html.m44
-rw-r--r--loleaflet/src/control/Control.Menubar.js3
-rw-r--r--loolwsd.xml.in1
-rw-r--r--wsd/FileServer.cpp12
5 files changed, 18 insertions, 3 deletions
diff --git a/loleaflet/css/loleaflet.css b/loleaflet/css/loleaflet.css
index 539640ea5..38a87695a 100644
--- a/loleaflet/css/loleaflet.css
+++ b/loleaflet/css/loleaflet.css
@@ -2,7 +2,6 @@
border-top: 1px solid #B6B6B6;
background: #DFDFDF;
position: absolute;
- top: 100px;
bottom: 33px;
right: 0px;
left: 0px;
diff --git a/loleaflet/html/loleaflet.html.m4 b/loleaflet/html/loleaflet.html.m4
index 10ed38a8b..ab33d1301 100644
--- a/loleaflet/html/loleaflet.html.m4
+++ b/loleaflet/html/loleaflet.html.m4
@@ -103,7 +103,7 @@ ifelse(MOBILEAPP,[true],
</tr>
</table>
- <div id="document-signing-bar"></div>
+ <!--%DOCUMENT_SIGNING_DIV%-->
<input id="insertgraphic" type="file" style="position: fixed; top: -100em">
<input id="document-name-input" type="text" disabled="true"/>
@@ -114,7 +114,7 @@ ifelse(MOBILEAPP,[true],
<div id="spreadsheet-row-column-frame"></div>
- <div id="document-container">
+ <div id="document-container" style="top: <!--%DOCUMENT_CONTAINER_TOP%-->;">
<div id="map"></div>
</div>
<div id="spreadsheet-toolbar"></div>
diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js
index 37255c6ad..4dbae71f5 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -799,6 +799,9 @@ L.Control.Menubar = L.Control.extend({
if (menu[i].id === 'about' && (L.DomUtil.get('about-dialog') === null)) {
continue;
}
+ if (menu[i].id === 'signdocument' && (L.DomUtil.get('document-signing-bar') === null)) {
+ continue;
+ }
if (this._map._permission === 'readonly' && menu[i].type === 'menu') {
var found = false;
diff --git a/loolwsd.xml.in b/loolwsd.xml.in
index 54cda7e63..6842a782c 100644
--- a/loolwsd.xml.in
+++ b/loolwsd.xml.in
@@ -17,6 +17,7 @@
<num_prespawn_children desc="Number of child processes to keep started in advance and waiting for new clients." type="uint" default="1">1</num_prespawn_children>
<per_document desc="Document-specific settings, including LO Core settings.">
<max_concurrency desc="The maximum number of threads to use while processing a document." type="uint" default="4">4</max_concurrency>
+ <document_signing desc="If true show the document signing menu item." type="bool" default="false">false</document_signing>
<idle_timeout_secs desc="The maximum number of seconds before unloading an idle document. Defaults to 1 hour." type="uint" default="3600">3600</idle_timeout_secs>
<!-- Idle save and auto save are checked every 30 seconds -->
<idlesave_duration_secs desc="The number of idle seconds after which document, if modified, should be saved. Defaults to 30 seconds." type="uint" default="30">30</idlesave_duration_secs>
diff --git a/wsd/FileServer.cpp b/wsd/FileServer.cpp
index fde70d242..d56975470 100644
--- a/wsd/FileServer.cpp
+++ b/wsd/FileServer.cpp
@@ -638,6 +638,18 @@ void FileServerRequestHandler::preprocessFile(const HTTPRequest& request, Poco::
Poco::replaceInPlace(preprocess, std::string("<!--%BRANDING_CSS%-->"), brandCSS);
Poco::replaceInPlace(preprocess, std::string("<!--%BRANDING_JS%-->"), brandJS);
+ // Customization related to document signing.
+ std::string documentSigningDiv;
+ std::string documentContainerTop("70px");
+ const auto documentSigning = config.getBool("per_document.document_signing", false);
+ if (documentSigning)
+ {
+ documentSigningDiv = "<div id=\"document-signing-bar\"></div>";
+ documentContainerTop = "100px";
+ }
+ Poco::replaceInPlace(preprocess, std::string("<!--%DOCUMENT_SIGNING_DIV%-->"), documentSigningDiv);
+ Poco::replaceInPlace(preprocess, std::string("<!--%DOCUMENT_CONTAINER_TOP%-->"), documentContainerTop);
+
const auto loleafletLogging = config.getString("loleaflet_logging", "false");
Poco::replaceInPlace(preprocess, std::string("%LOLEAFLET_LOGGING%"), loleafletLogging);
const std::string outOfFocusTimeoutSecs= config.getString("per_view.out_of_focus_timeout_secs", "60");