loleaflet/src/layer/tile/TileLayer.js |   23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

New commits:
commit 7b94981b7d73626af6cdcab7ce694781b07b5e4a
Author:     Muhammet Kara <muhammet.k...@collabora.com>
AuthorDate: Mon Jan 13 09:24:29 2020 +0300
Commit:     Henry Castro <hcas...@collabora.com>
CommitDate: Mon Jan 13 23:15:52 2020 +0100

    Show hyperlink pop-up on cell selection
    
    Change-Id: I59f3301bd94c4d898ec2ff82fd91d3c611122d3a
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/86651
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Henry Castro <hcas...@collabora.com>

diff --git a/loleaflet/src/layer/tile/TileLayer.js 
b/loleaflet/src/layer/tile/TileLayer.js
index 8d31a7647..0d64ded2d 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -2843,6 +2843,29 @@ L.TileLayer = L.GridLayer.extend({
                        this._map.removeLayer(this._cellCursorMarker);
                }
                this._removeDropDownMarker();
+
+               //hyperlink pop-up from here
+               if (this._lastFormula && this._cellCursorMarker && 
this._lastFormula.substring(1, 10) == 'HYPERLINK')
+               {
+                       var formula = this._lastFormula;
+                       var targetURL = formula.substring(11, formula.length - 
1).split(',')[0];
+                       targetURL = targetURL.split('"').join('');
+                       targetURL = this._map.makeURLFromStr(targetURL);
+
+                       this._map.closePopup(this._map.hyperlinkPopup);
+                       this._map.hyperlinkPopup = null;
+                       if (targetURL) {
+                               this._map.hyperlinkPopup = new 
L.Popup({className: 'hyperlink-popup', closeButton: false, closeOnClick: false})
+                               .setContent('<a href="' + targetURL + '" 
target="_blank">' + targetURL + '</a>')
+                               
.setLatLng(this._cellCursorMarker._bounds._northEast)
+                               .openOn(this._map);
+                       }
+
+               }
+               else if (this._map.hyperlinkPopup)
+               {
+                       this._map.closePopup(this._map.hyperlinkPopup);
+               }
        },
 
        _onValidityListButtonMsg: function(textMsg) {
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to