[Libreoffice-commits] online.git: 3 commits - loleaflet/dist loleaflet/.gitignore loleaflet/Makefile loleaflet/src loolwsd/MasterProcessSession.cpp
Pranav Kant
pranavk at collabora.com
Thu Apr 14 09:38:35 UTC 2016
loleaflet/.gitignore | 1
loleaflet/Makefile | 6 ++---
loleaflet/dist/toolbar/toolbar.js | 36 -------------------------------
loleaflet/src/control/Control.Buttons.js | 20 -----------------
loolwsd/MasterProcessSession.cpp | 3 +-
5 files changed, 6 insertions(+), 60 deletions(-)
New commits:
commit d8c9128d35e520d7af909df9489aa81688a48c58
Author: Pranav Kant <pranavk at collabora.com>
Date: Thu Apr 14 15:06:32 2016 +0530
loleaflet: Let simple 'make' build and install plugins in dist/
... and 'make dist' just copy that over to its package directory.
Change-Id: Ifb3d59c3cdfde23f14bc64b5a358565279a57575
diff --git a/loleaflet/.gitignore b/loleaflet/.gitignore
index ddcd766..5153c38 100644
--- a/loleaflet/.gitignore
+++ b/loleaflet/.gitignore
@@ -11,6 +11,7 @@ component.json
_site
dist/*.js
dist/admin/*.js
+dist/plugins/
plugins/draw-0.2.4/dist/*.js
plugins/draw-0.2.4/npm-debug.log
coverage/
diff --git a/loleaflet/Makefile b/loleaflet/Makefile
index f12d273..025859d 100644
--- a/loleaflet/Makefile
+++ b/loleaflet/Makefile
@@ -11,14 +11,14 @@ DRAW_VERSION=0.2.4
all:
npm install
jake build
- cd plugins/draw-$(DRAW_VERSION) && jake build
+ rm -rf dist/plugins/draw-$(DRAW_VERSION) && mkdir -p dist/plugins/draw-$(DRAW_VERSION)
+ cd plugins/draw-$(DRAW_VERSION) && jake build && cp -ar dist ../../dist/plugins/draw-$(DRAW_VERSION)
.PHONY: dist
dist: all
rm -rf loleaflet-$(VERSION)
- mkdir -p loleaflet-$(VERSION)/dist/plugins/draw-$(DRAW_VERSION)
+ mkdir loleaflet-$(VERSION)
cp -ar dist loleaflet-$(VERSION)
- cp -ar plugins/draw-$(DRAW_VERSION)/dist loleaflet-$(VERSION)/dist/plugins/draw-$(DRAW_VERSION)
util/po2json.py po/*.po
mv po/*.json loleaflet-$(VERSION)/dist/l10n
util/po2json.py po/styles/*.po
commit 5d8e627ca4d28e2ad143507ee60ee00a5876e3f6
Author: Pranav Kant <pranavk at collabora.com>
Date: Thu Apr 14 13:35:41 2016 +0530
loolwsd: Allow 'downloadas' for all kinds of views
... irrespective of whether the editlock is taken or not.
Change-Id: I159f78fb4c58c973458ae2c5bc53e844de689e14
diff --git a/loolwsd/MasterProcessSession.cpp b/loolwsd/MasterProcessSession.cpp
index 9f3763a..f9bb7b1 100644
--- a/loolwsd/MasterProcessSession.cpp
+++ b/loolwsd/MasterProcessSession.cpp
@@ -390,7 +390,8 @@ bool MasterProcessSession::_handleInput(const char *buffer, int length)
_docBroker->tileCache().removeFile("status.txt");
}
- if (_kind == Kind::ToClient && !isEditLocked())
+ // Allow 'downloadas' for all kinds of views irrespective of editlock
+ if (_kind == Kind::ToClient && !isEditLocked() && tokens[0] != "downloadas")
{
std::string dummyFrame = "dummymsg";
forwardToPeer(dummyFrame.c_str(), dummyFrame.size());
commit 95b9674022a4b30118588e6beb01f9655b397183
Author: Pranav Kant <pranavk at collabora.com>
Date: Thu Apr 14 12:19:20 2016 +0530
loleaflet: Remove leftover code for enable editing/selection
Buttons are removed in e228817a8ceb174f491fd06dafa8240083613c9c
Change-Id: I3a4994d8e3c34ac49c466434d62264e86e11c3a1
diff --git a/loleaflet/dist/toolbar/toolbar.js b/loleaflet/dist/toolbar/toolbar.js
index dc5ae16..2021dd1 100644
--- a/loleaflet/dist/toolbar/toolbar.js
+++ b/loleaflet/dist/toolbar/toolbar.js
@@ -243,24 +243,6 @@ function onClick(id) {
map.setPart(id);
}
}
- else if (id === 'edit') {
- if (item.checked) {
- map.setPermission('view');
- }
- else {
- map.setPermission('edit');
- }
- }
- else if (id === 'select') {
- if (item.checked) {
- map.disableSelection();
- toolbar.uncheck(id);
- }
- else {
- map.enableSelection();
- toolbar.check(id);
- }
- }
else if (id === 'menu:file:saveas') {
var dialog = '<label for="url">URL</label>' +
'<input name="url" type="text" value=' + map._docLayer.options.doc + '/>' +
@@ -554,24 +536,6 @@ function onFormulaBarBlur() {
map.on('updatepermission', function (e) {
var toolbar = w2ui['toolbar-down'];
- if (e.perm === 'edit') {
- toolbar.uncheck('select');
- toolbar.disable('select');
- toolbar.check('edit');
- toolbar.enable('edit');
- }
- else if (e.perm === 'view') {
- toolbar.uncheck('select');
- toolbar.enable('select');
- toolbar.uncheck('edit');
- toolbar.enable('edit');
- }
- else if (e.perm === 'readonly') {
- toolbar.uncheck('select');
- toolbar.enable('select');
- toolbar.uncheck('edit');
- toolbar.disable('edit');
- }
formatButtons.forEach(function (id) {
if (e.perm === 'edit') {
toolbar.enable(id);
diff --git a/loleaflet/src/control/Control.Buttons.js b/loleaflet/src/control/Control.Buttons.js
index 9e93657..d2a9c76 100644
--- a/loleaflet/src/control/Control.Buttons.js
+++ b/loleaflet/src/control/Control.Buttons.js
@@ -31,8 +31,6 @@ L.Control.Buttons = L.Control.extend({
'saveas': {title: 'Save As', iconName: 'saveas.png'},
'undo': {title: 'Undo', uno: 'Undo', iconName: 'undo.png'},
'redo': {title: 'Redo', uno: 'Redo', iconName: 'redo.png'},
- 'edit': {title: 'Enable editing', iconName: 'edit.png'},
- 'selection': {title: 'Enable selection', iconName: 'selection.png'},
'presentation': {title: 'Present', iconName: 'presentation.png'}
};
var separator = ['alignleft', 'save', 'undo', 'bullet', 'edit', 'presentation'];
@@ -86,24 +84,6 @@ L.Control.Buttons = L.Control.extend({
this._map.toggleCommandState(button.uno);
}
}
- else if (id === 'edit' && !L.DomUtil.hasClass(button.el.firstChild, 'leaflet-control-buttons-disabled')) {
- if (this._map.getPermission() === 'edit') {
- this._map.setPermission('view');
- }
- else if (this._map.getPermission() === 'view') {
- this._map.setPermission('edit');
- }
- }
- else if (id === 'selection' && !L.DomUtil.hasClass(button.el.firstChild, 'leaflet-control-buttons-disabled')) {
- if (this._map.isSelectionEnabled()) {
- this._map.disableSelection();
- L.DomUtil.removeClass(button.el.firstChild, 'leaflet-control-buttons-active');
- }
- else {
- this._map.enableSelection();
- L.DomUtil.addClass(button.el.firstChild, 'leaflet-control-buttons-active');
- }
- }
else if (id === 'presentation') {
this._map.fire('fullscreen');
}
More information about the Libreoffice-commits
mailing list