[Libreoffice-commits] online.git: loleaflet/Makefile.am loleaflet/src

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Mar 6 03:51:11 UTC 2019


 loleaflet/Makefile.am        |    3 +--
 loleaflet/src/core/Socket.js |    4 +++-
 2 files changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 1d801b833f76239e0b0f44d285e0dd57498cc9d1
Author:     Henry Castro <hcastro at collabora.com>
AuthorDate: Wed Feb 13 11:04:44 2019 -0400
Commit:     Henry Castro <hcastro at collabora.com>
CommitDate: Tue Mar 5 23:50:39 2019 -0400

    loleaflet: remove jquery.time ago
    
    use Date.toLocaleDateString that returns a string with a language sensitive
    representation of the date portion of this date
    
    Change-Id: Id2e207e5b4d0dbc8d82498567c97105052d70b90

diff --git a/loleaflet/Makefile.am b/loleaflet/Makefile.am
index 697877b67..d3e0160e0 100644
--- a/loleaflet/Makefile.am
+++ b/loleaflet/Makefile.am
@@ -232,7 +232,6 @@ NODE_MODULES_JS =\
 	node_modules/jquery-mousewheel/jquery.mousewheel.js \
 	node_modules/jquery-contextmenu/dist/jquery.contextMenu.js \
 	node_modules/smartmenus/dist/jquery.smartmenus.js \
-	node_modules/timeago/jquery.timeago.js \
 	node_modules/timeago.js/dist/timeago.min.js \
 	node_modules/timeago.js/dist/timeago.locales.min.js \
 	node_modules/autolinker/dist/Autolinker.js \
@@ -357,7 +356,7 @@ $(builddir)/dist/bundle.js: $(NODE_MODULES_JS_SRC) \
 		$(builddir)/build/dist/loleaflet-src.js \
 		$(srcdir)/js/toolbar.js \
 		$(srcdir)/js/main.js \
-		--source-map --output $@
+		--output $@
 endif
 
 $(builddir)/dist/loleaflet.html: $(srcdir)/html/loleaflet.html.m4 $(LOLEAFLET_HTML_DST) \
diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js
index 2009418af..68080b9fa 100644
--- a/loleaflet/src/core/Socket.js
+++ b/loleaflet/src/core/Socket.js
@@ -125,7 +125,9 @@ L.Socket = L.Class.extend({
 		if (parseInt(this._map.options.docParams.access_token_ttl) - Date.now() <= 0) {
 			expirymsg = errorMessages.sessionexpired;
 		}
-		var timerepr = $.timeago(parseInt(this._map.options.docParams.access_token_ttl)).replace(' ago', '');
+		var dateTime = new Date(parseInt(this._map.options.docParams.access_token_ttl));
+		var dateOptions = { year: 'numeric', month: 'short', day: 'numeric', hour: '2-digit', minute: '2-digit' };
+		var timerepr = dateTime.toLocaleDateString(String.locale, dateOptions);
 		this._map.fire('warn', {msg: expirymsg.replace('%time', timerepr)});
 
 		// If user still doesn't refresh the session, warn again periodically


More information about the Libreoffice-commits mailing list