configure.ac | 20 ++++++------ ios/Mobile/Info.plist.in | 2 - ios/config.h.in | 2 + loleaflet/Makefile.am | 2 - loleaflet/html/loleaflet.html.m4 | 2 + loleaflet/js/jquery.mCustomScrollbar.js | 27 +++++++++++------ loleaflet/plugins/path-transform/src/Path.Transform.js | 26 ++++++++++++++-- loleaflet/src/control/Control.Scroll.js | 5 ++- loleaflet/src/core/Socket.js | 15 +++++---- loleaflet/src/layer/tile/TileLayer.js | 10 ++---- loleaflet/src/layer/tile/WriterTileLayer.js | 7 +++- loleaflet/src/map/Map.js | 9 +++++ wsd/LOOLWSD.cpp | 3 + 13 files changed, 93 insertions(+), 37 deletions(-)
New commits: commit a83d10b57713f6144db93a9dc3ef3e5711382e80 Author: Marco Cecchetti <mrcek...@gmail.com> AuthorDate: Mon Mar 4 20:36:45 2019 +0100 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Wed May 1 21:54:20 2019 +0200 leaflet: after resizing a shape, dragging cursor with mouse pans view The problem was in Path.Transform._apply executed at scale/rotate end which enabled map dragging unconditionally. Change-Id: Id42dc7de397a2ca2774f9d31a698c32b5e1c8514 Reviewed-on: https://gerrit.libreoffice.org/70559 Reviewed-by: Henry Castro <hcas...@collabora.com> Tested-by: Henry Castro <hcas...@collabora.com> diff --git a/loleaflet/plugins/path-transform/src/Path.Transform.js b/loleaflet/plugins/path-transform/src/Path.Transform.js index f7efd72cc..3ea9ddaab 100644 --- a/loleaflet/plugins/path-transform/src/Path.Transform.js +++ b/loleaflet/plugins/path-transform/src/Path.Transform.js @@ -282,6 +282,7 @@ L.Handler.PathTransform = L.Handler.extend({ var matrix = this._matrix.clone(); var angle = this._angle; var scale = this._scale.clone(); + var moved = this._handleDragged; this._transformGeometries(); @@ -299,7 +300,11 @@ L.Handler.PathTransform = L.Handler.extend({ this._updateHandlers(); - map.dragging.enable(); + if (this._mapDraggingWasEnabled) { + if (moved) L.DomEvent._fakeStop({ type: 'click' }); + map.dragging.enable(); + } + this._path.fire('transformed', { matrix: matrix, scale: scale, @@ -576,7 +581,12 @@ L.Handler.PathTransform = L.Handler.extend({ _onRotateStart: function(evt) { var map = this._map; - map.dragging.disable(); + this._handleDragged = false; + this._mapDraggingWasEnabled = false; + if (map.dragging.enabled()) { + map.dragging.disable(); + this._mapDraggingWasEnabled = true; + } this._originMarker = null; this._rotationOriginPt = map.latLngToLayerPoint(this._getRotationOrigin()); @@ -604,6 +614,8 @@ L.Handler.PathTransform = L.Handler.extend({ var previous = this._rotationStart; var origin = this._rotationOriginPt; + this._handleDragged = true; + // rotation step angle this._angle = Math.atan2(pos.y - origin.y, pos.x - origin.x) - Math.atan2(previous.y - origin.y, previous.x - origin.x); @@ -649,7 +661,12 @@ L.Handler.PathTransform = L.Handler.extend({ var marker = evt.target; var map = this._map; - map.dragging.disable(); + this._handleDragged = false; + this._mapDraggingWasEnabled = false; + if (map.dragging.enabled()) { + map.dragging.disable(); + this._mapDraggingWasEnabled = true; + } this._activeMarker = marker; @@ -688,6 +705,9 @@ L.Handler.PathTransform = L.Handler.extend({ _onScale: function(evt) { var originPoint = this._originMarker._point; var ratioX, ratioY; + + this._handleDragged = true; + if (this.options.uniformScaling) { ratioX = originPoint.distanceTo(evt.layerPoint) / this._initialDist; ratioY = ratioX; commit de348d2f9624b85470a389e0c1efc38a801c3539 Author: Szymon Kłos <szymon.k...@collabora.com> AuthorDate: Wed Mar 13 18:05:14 2019 +0100 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Wed May 1 21:53:27 2019 +0200 Show progressbar centered in the mobile When Online was embodied in the nextcloud app (Android) the progressbar was moved into top-left corner. During a loading all functions to get container or browser size were returning (0,0). This hack assumed that webview size is almost equal to the mobile screen size. Change-Id: I0fff53639a3baa88b57d91bf671e00ad8c71180d Reviewed-on: https://gerrit.libreoffice.org/69219 Reviewed-by: Jan Holesovsky <ke...@collabora.com> Tested-by: Jan Holesovsky <ke...@collabora.com> diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js index 6f213dd9d..4aad141c5 100644 --- a/loleaflet/src/map/Map.js +++ b/loleaflet/src/map/Map.js @@ -108,7 +108,14 @@ L.Map = L.Evented.extend({ } this._addLayers(this.options.layers); this._socket = L.socket(this); - this._progressBar = L.progressOverlay(this.getCenter(), L.point(150, 25)); + + var center = this.getCenter(); + if (L.Browser.mobile) { + var doubledProgressHeight = 200; + var size = new L.point(screen.width, screen.height - doubledProgressHeight); + center = this.layerPointToLatLng(size._divideBy(2)); + } + this._progressBar = L.progressOverlay(center, new L.point(150, 25)); if (L.Browser.mobile) { this._clipboardContainer = L.control.mobileInput().addTo(this); commit ef640bf25fefc0619439901fc96a8fcdd307c7b7 Author: Szymon Kłos <szymon.k...@collabora.com> AuthorDate: Thu Apr 11 13:32:24 2019 +0200 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Wed May 1 21:52:38 2019 +0200 Prevent view from jumping on zoom in/out on mobile Change-Id: I29262d518d61a4a06d66271033c958e56ff16a2b Reviewed-on: https://gerrit.libreoffice.org/70592 Reviewed-by: Tor Lillqvist <t...@collabora.com> Tested-by: Tor Lillqvist <t...@collabora.com> diff --git a/loleaflet/js/jquery.mCustomScrollbar.js b/loleaflet/js/jquery.mCustomScrollbar.js index 442b20504..2785ec65c 100644 --- a/loleaflet/js/jquery.mCustomScrollbar.js +++ b/loleaflet/js/jquery.mCustomScrollbar.js @@ -284,6 +284,11 @@ and dependencies (minified). */ updateOnContentResize:true, /* + prevent from updating view position after content resize to avoid jumping on mobile devices + values: boolean + */ + jumpOnContentResize:true, + /* auto-update scrollbars each time each image inside the element is fully loaded values: "auto", boolean */ @@ -561,31 +566,37 @@ and dependencies (minified). var to=[Math.abs(mCSB_container[0].offsetTop),Math.abs(mCSB_container[0].offsetLeft)]; if(o.axis!=="x"){ /* y/yx axis */ if(!d.overflowed[0]){ /* y scrolling is not required */ - _resetContentPosition.call(this); /* reset content position */ + if(o.advanced.jumpOnContentResize) + _resetContentPosition.call(this); /* reset content position */ if(o.axis==="y"){ _unbindEvents.call(this); - }else if(o.axis==="yx" && d.overflowed[1]){ + }else if(o.axis==="yx" && d.overflowed[1] && o.advanced.jumpOnContentResize){ _scrollTo($this,to[1].toString(),{dir:"x",dur:0,overwrite:"none"}); } - }else if(mCSB_dragger[0].height()>mCSB_dragger[0].parent().height()){ + }else if(mCSB_dragger[0].height()>mCSB_dragger[0].parent().height() + && o.advanced.jumpOnContentResize){ _resetContentPosition.call(this); /* reset content position */ }else{ /* y scrolling is required */ - _scrollTo($this,to[0].toString(),{dir:"y",dur:0,overwrite:"none"}); + if(o.advanced.jumpOnContentResize) + _scrollTo($this,to[0].toString(),{dir:"y",dur:0,overwrite:"none"}); d.contentReset.y=null; } } if(o.axis!=="y"){ /* x/yx axis */ if(!d.overflowed[1]){ /* x scrolling is not required */ - _resetContentPosition.call(this); /* reset content position */ + if(o.advanced.jumpOnContentResize) + _resetContentPosition.call(this); /* reset content position */ if(o.axis==="x"){ _unbindEvents.call(this); - }else if(o.axis==="yx" && d.overflowed[0]){ + }else if(o.axis==="yx" && d.overflowed[0] && o.advanced.jumpOnContentResize){ _scrollTo($this,to[0].toString(),{dir:"y",dur:0,overwrite:"none"}); } }else if(mCSB_dragger[1].width()>mCSB_dragger[1].parent().width()){ - _resetContentPosition.call(this); /* reset content position */ + if(o.advanced.jumpOnContentResize) + _resetContentPosition.call(this); /* reset content position */ }else{ /* x scrolling is required */ - _scrollTo($this,to[1].toString(),{dir:"x",dur:0,overwrite:"none"}); + if(o.advanced.jumpOnContentResize) + _scrollTo($this,to[1].toString(),{dir:"x",dur:0,overwrite:"none"}); d.contentReset.x=null; } } diff --git a/loleaflet/src/control/Control.Scroll.js b/loleaflet/src/control/Control.Scroll.js index e8df36eb8..adb85d55b 100644 --- a/loleaflet/src/control/Control.Scroll.js +++ b/loleaflet/src/control/Control.Scroll.js @@ -31,7 +31,10 @@ L.Control.Scroll = L.Control.extend({ axis: 'yx', theme: 'minimal-dark', scrollInertia: 0, - advanced:{autoExpandHorizontalScroll: true}, /* weird bug, it should be false */ + advanced:{ + autoExpandHorizontalScroll: true, /* weird bug, it should be false */ + jumpOnContentResize: false /* prevent from jumping on a mobile devices */ + }, callbacks:{ onScrollStart: function() { control._map.fire('closepopup'); commit 6f484bd35bd059a6b93c80c26421dbe4b5be5ca8 Author: Jan Holesovsky <ke...@collabora.com> AuthorDate: Sat Mar 30 19:12:19 2019 +0100 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Wed May 1 21:51:46 2019 +0200 Use the app name more generally, not only on iOS. Preparation for using it on Android too. Change-Id: Iee7778b2625a02a98daff5df87c39f4ab1d18144 Reviewed-on: https://gerrit.libreoffice.org/70651 Reviewed-by: Tor Lillqvist <t...@collabora.com> Tested-by: Tor Lillqvist <t...@collabora.com> diff --git a/configure.ac b/configure.ac index dace37db4..5f60b3d23 100644 --- a/configure.ac +++ b/configure.ac @@ -69,10 +69,6 @@ AC_ARG_ENABLE([iosapp], to be copied to a Mac where the iOS app is being built, *or* in a tree where you will build the iOS app.])) -AC_ARG_WITH([iosapp-name], - AS_HELP_STRING([--with-iosapp-name=<name>], - [Set the user-visible name of the iOS app you build. Default "Mobile".])) - AC_ARG_WITH([iosapp-appicon], AS_HELP_STRING([--with-iosapp-appicon=<path>], [Point to a directory containing an icon set to use instead of the default empty one.])) @@ -88,6 +84,10 @@ AC_ARG_ENABLE([gtkapp], to work similarly to the iOS app, from the JavaScript and the pseudo WebSocket message plumbing point of view. See gtk/README.])) +AC_ARG_WITH([app-name], + AS_HELP_STRING([--with-app-name=<name>], + [Set the user-visible name of the app you build.])) + AC_ARG_ENABLE([seccomp], AS_HELP_STRING([--disable-seccomp], [Disable use of linux/seccomp.h header when kernel on target system does not support it. @@ -224,15 +224,18 @@ if test -z "$anonym_msg"; then anonym_msg="no anonymization of usernames or filenames" fi +APP_NAME="LOOL" +if test -n "$with_app_name"; then + APP_NAME="$with_app_name" +fi +AC_DEFINE_UNQUOTED([APP_NAME],["$APP_NAME"],[The user-visible name of the app you build.]) +AC_SUBST(APP_NAME) + ENABLE_IOSAPP= -MOBILE_APP_NAME="Mobile" IOSAPP_BUNDLE_VERSION= if test "$enable_iosapp" = "yes"; then ENABLE_IOSAPP=true - if test -n "$with_iosapp_name"; then - MOBILE_APP_NAME="$with_iosapp_name" - fi if test -f BUNDLE-VERSION; then IOSAPP_BUNDLE_VERSION=$(cat BUNDLE-VERSION) @@ -287,7 +290,6 @@ if test "$enable_iosapp" = "yes"; then fi AC_SUBST(ENABLE_IOSAPP) AM_CONDITIONAL([ENABLE_IOSAPP], [test "$ENABLE_IOSAPP" = "true"]) -AC_SUBST(MOBILE_APP_NAME) AC_SUBST(IOSAPP_BUNDLE_VERSION) ENABLE_GTKAPP= diff --git a/ios/Mobile/Info.plist.in b/ios/Mobile/Info.plist.in index 5dd1931e1..cb16bde94 100644 --- a/ios/Mobile/Info.plist.in +++ b/ios/Mobile/Info.plist.in @@ -34,7 +34,7 @@ <key>CFBundleDevelopmentRegion</key> <string>$(DEVELOPMENT_LANGUAGE)</string> <key>CFBundleDisplayName</key> - <string>@MOBILE_APP_NAME@</string> + <string>@APP_NAME@</string> <key>CFBundleDocumentTypes</key> <array> <!-- Document sub-types are listed in order ODF, OOXML, MSO, other --> diff --git a/ios/config.h.in b/ios/config.h.in index 18ca58e4e..c1f501fe9 100644 --- a/ios/config.h.in +++ b/ios/config.h.in @@ -1,6 +1,8 @@ /* config.h. Manually edited from config.h.in. */ /* config.h.in. Generated from configure.ac by autoheader. */ +#define APP_NAME "@APP_NAME@" + /* Whether to disable SECCOMP */ #define DISABLE_SECCOMP 1 diff --git a/loleaflet/Makefile.am b/loleaflet/Makefile.am index 2732e1928..258801b0e 100644 --- a/loleaflet/Makefile.am +++ b/loleaflet/Makefile.am @@ -244,7 +244,7 @@ $(builddir)/dist/loleaflet.html: $(srcdir)/html/loleaflet.html.m4 $(LOLEAFLET_HT @m4 -E -DDEBUG=$(ENABLE_DEBUG) \ -DIOSAPP=$(ENABLE_IOSAPP) \ -DGTKAPP=$(ENABLE_GTKAPP) \ - -DMOBILEAPPNAME="$(MOBILE_APP_NAME)" \ + -DMOBILEAPPNAME="$(APP_NAME)" \ -DLOLEAFLET_CSS="$(subst $(SPACE),$(COMMA),$(LOLEAFLET_CSS_M4))" \ -DLOLEAFLET_JS="$(subst $(SPACE),$(COMMA),$(GLOBAL_JS) $(NODE_MODULES_JS) \ $(call LOLEAFLET_JS,$(srcdir)/build/build.js) \ diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp index 9227f6f3f..4e7437d52 100644 --- a/wsd/LOOLWSD.cpp +++ b/wsd/LOOLWSD.cpp @@ -2792,6 +2792,9 @@ private: // Hint to encourage use on mobile devices capabilities->set("hasMobileSupport", true); + // Set the product name + capabilities->set("productName", APP_NAME); + std::ostringstream ostrJSON; capabilities->stringify(ostrJSON); return ostrJSON.str(); commit b59e3ea3533a2819c1f8e93e121144e0e84ef290 Author: Ashod Nakashian <ashod.nakash...@collabora.co.uk> AuthorDate: Sat Mar 30 12:15:09 2019 -0400 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Wed May 1 21:51:10 2019 +0200 leaflet: suppress empty error messages This also adds support to suppress errors by setting their message to blank. Change-Id: I2baabd121afb59c48e950b139f984c64d1720512 Reviewed-on: https://gerrit.libreoffice.org/70032 Reviewed-by: Michael Meeks <michael.me...@collabora.com> Tested-by: Michael Meeks <michael.me...@collabora.com> diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js index 85c459c0f..b21a3b496 100644 --- a/loleaflet/src/core/Socket.js +++ b/loleaflet/src/core/Socket.js @@ -547,12 +547,15 @@ L.Socket = L.Class.extend({ return; } - // Parse the storage url as link - var tmpLink = document.createElement('a'); - tmpLink.href = this._map.options.doc; - // Insert the storage server address to be more friendly - storageError = storageError.replace('%storageserver', tmpLink.host); - this._map.fire('warn', {msg: storageError}); + // Skip empty errors (and allow for suppressing errors by making them blank). + if (storageError != '') { + // Parse the storage url as link + var tmpLink = document.createElement('a'); + tmpLink.href = this._map.options.doc; + // Insert the storage server address to be more friendly + storageError = storageError.replace('%storageserver', tmpLink.host); + this._map.fire('warn', {msg: storageError}); + } return; } commit c5fa950608e2368835ff2f6e70c9e6dc8eb19535 Author: Andras Timar <andras.ti...@collabora.com> AuthorDate: Wed Apr 3 16:26:51 2019 +0200 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Wed May 1 21:50:22 2019 +0200 [cp] add copyright notice to About Box Change-Id: I51c2c5e7c2b0cf232b8a2f2dbcb3b9f3f04737ea Reviewed-on: https://gerrit.libreoffice.org/70205 Reviewed-by: Michael Meeks <michael.me...@collabora.com> Tested-by: Michael Meeks <michael.me...@collabora.com> diff --git a/loleaflet/html/loleaflet.html.m4 b/loleaflet/html/loleaflet.html.m4 index 736dd26a9..bc16fb254 100644 --- a/loleaflet/html/loleaflet.html.m4 +++ b/loleaflet/html/loleaflet.html.m4 @@ -4,6 +4,7 @@ dnl# foreachq(x, `item_1, item_2, ..., item_n', stmt) dnl# quoted list, alternate improved version define([foreachq],[ifelse([$2],[],[],[pushdef([$1])_$0([$1],[$3],[],$2)popdef([$1])])])dnl define([_foreachq],[ifelse([$#],[3],[],[define([$1],[$4])$2[]$0([$1],[$2],shift(shift(shift($@))))])])dnl +define(_YEAR_,esyscmd(date +%Y|tr -d '\n')) <!DOCTYPE html> <!-- saved from url=(0054)http://leafletjs.com/examples/quick-start-example.html --> <html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> @@ -146,6 +147,7 @@ ifelse(MOBILEAPP,[true], <div id="loolwsd-version"></div> <h3>LOKit</h3> <div id="lokit-version"></div> + <p>Copyright _YEAR_, Collabora Productivity Limited.</p> </div> <script> commit b374ad3ffbbc7af7e929be7f6a13a9c4cf2ce10e Author: Szymon Kłos <szymon.k...@collabora.com> AuthorDate: Wed Mar 20 09:34:19 2019 +0100 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Wed May 1 21:49:25 2019 +0200 Avoid syntax errors while paring command results Change-Id: I7d778fd62aeb32c8304afb90c21aafd83379c170 diff --git a/loleaflet/src/layer/tile/WriterTileLayer.js b/loleaflet/src/layer/tile/WriterTileLayer.js index f7bca842b..ece0ddfa4 100644 --- a/loleaflet/src/layer/tile/WriterTileLayer.js +++ b/loleaflet/src/layer/tile/WriterTileLayer.js @@ -54,7 +54,12 @@ L.WriterTileLayer = L.TileLayer.extend({ }, _onCommandValuesMsg: function (textMsg) { - var values = JSON.parse(textMsg.substring(textMsg.indexOf('{'))); + var braceIndex = textMsg.indexOf('{'); + if (braceIndex < 0) { + return; + } + + var values = JSON.parse(textMsg.substring(braceIndex)); if (!values) { return; } commit 930ec1b5b3ebdd73c5afa55c96ac0b43052a9a1b Author: Szymon Kłos <szymon.k...@collabora.com> AuthorDate: Sat Mar 23 14:51:27 2019 +0100 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Wed May 1 21:49:10 2019 +0200 Make all pages accessible after zooming After zooming scrollbar was updated and scroll position was incorrect what caused first pages not accessible. Regression was introduced by: ffd7151443ee360c7764aaa77f9e7fe5f5d64eee Second problem was jumping to the cursor during zooming. Solution was to not update the cursors on zooming start. Change-Id: I0891799b03ed4eccb211ee43eb30e546317a90fc Reviewed-on: https://gerrit.libreoffice.org/69606 Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> Tested-by: Szymon Kłos <szymon.k...@collabora.com> diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js index 643a9ba06..f39102829 100644 --- a/loleaflet/src/layer/tile/TileLayer.js +++ b/loleaflet/src/layer/tile/TileLayer.js @@ -1593,14 +1593,12 @@ L.TileLayer = L.GridLayer.extend({ _onZoomStart: function () { this._isZooming = true; - this._onUpdateCursor(); - this.updateAllViewCursors(); }, _onZoomEnd: function () { this._isZooming = false; - this._onUpdateCursor(); + this._onUpdateCursor(null, true); this.updateAllViewCursors(); }, @@ -1624,16 +1622,16 @@ L.TileLayer = L.GridLayer.extend({ }, // Update cursor layer (blinking cursor). - _onUpdateCursor: function (scroll) { + _onUpdateCursor: function (scroll, zoom) { var cursorPos = this._visibleCursor.getNorthWest(); var docLayer = this._map._docLayer; - if ((scroll !== false) && !this._map.getBounds().contains(this._visibleCursor) && this._isCursorVisible) { + if ((!zoom && scroll !== false) && !this._map.getBounds().contains(this._visibleCursor) && this._isCursorVisible) { var center = this._map.project(cursorPos); center = center.subtract(this._map.getSize().divideBy(2)); center.x = Math.round(center.x < 0 ? 0 : center.x); center.y = Math.round(center.y < 0 ? 0 : center.y); - if (!(this._selectionHandles.start && this._selectionHandles.start.isDragged) && + if (!zoom && !(this._selectionHandles.start && this._selectionHandles.start.isDragged) && !(this._selectionHandles.end && this._selectionHandles.end.isDragged) && !(docLayer._followEditor || docLayer._followUser)) { if (window.ThisIsAMobileApp) { _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits