[Libreoffice-commits] online.git: 3 commits - loleaflet/debug loleaflet/dist loleaflet/src
Pranav Kant
pranavk at collabora.com
Wed May 25 11:19:12 UTC 2016
dev/null |binary
loleaflet/debug/document/loleaflet.html | 8 +++---
loleaflet/dist/leaflet.css | 20 +++++----------
loleaflet/dist/toolbar/toolbar.js | 11 ++------
loleaflet/src/layer/marker/ProgressOverlay.js | 34 ++++++++++++++++++++++++++
5 files changed, 49 insertions(+), 24 deletions(-)
New commits:
commit 92aed1fffda2f7f50a78595022eec833855902b6
Author: Pranav Kant <pranavk at collabora.com>
Date: Wed May 25 16:47:32 2016 +0530
bccu#1825: Make 'Editing'/'Viewing' text also sensitive
Change-Id: Ice52dd5d7a459127df18307aad0b7d8f2ef5825e
diff --git a/loleaflet/dist/toolbar/toolbar.js b/loleaflet/dist/toolbar/toolbar.js
index 5d5cf7a..28176f4 100644
--- a/loleaflet/dist/toolbar/toolbar.js
+++ b/loleaflet/dist/toolbar/toolbar.js
@@ -130,8 +130,7 @@ $(function () {
{ type: 'html', id: 'right' },
{ type: 'html', id: 'modifiedstatuslabel', html: '<div id="modifiedstatuslabel" class="loleaflet-font"></div>' },
{ type: 'break' },
- { type: 'button', id: 'takeedit', img: 'edit', hint: _("Take edit lock (others can only view)")},
- { type: 'html', id: 'takeeditlabel', html: '<div id="takeeditlabel" class="loleaflet-font">' + _("VIEWING") + '</div>' },
+ { type: 'button', id: 'takeedit', img: 'edit', hint: _("Take edit lock (others can only view)"), caption: _('VIEWING')},
{ type: 'break' },
{ type: 'button', id: 'prev', img: 'prev', hint: _("Previous page") },
{ type: 'button', id: 'next', img: 'next', hint: _("Next page") },
@@ -840,14 +839,11 @@ map.on('editlock', function (e) {
var toolbar = w2ui['toolbar-down'];
if (e.value) {
toolbar.disable('takeedit');
- toolbar.set('takeedit', {hint: _('You are editing (others can only view)')});
-
- $('#takeeditlabel').html(_('EDITING'));
+ toolbar.set('takeedit', {hint: _('You are editing (others can only view)'), caption: _('EDITING')});
}
else {
toolbar.enable('takeedit');
- toolbar.set('takeedit', {hint: _('Take edit lock (others can only view)')});
- $('#takeeditlabel').html(_('VIEWING'));
+ toolbar.set('takeedit', {hint: _('Take edit lock (others can only view)'), caption: _('VIEWING')});
$('#tb_toolbar-down_item_takeedit')
.w2overlay({
class: 'loleaflet-font',
@@ -940,7 +936,6 @@ map.on('editlock', function (e) {
map.on('mouseup keypress', function(e) {
if (!map._editlock) {
- $('#takeeditlabel').html(_('VIEWING'));
$('#tb_toolbar-down_item_takeedit')
.w2overlay({
html: takeEditPopupMessage,
commit 410cbf49f756418bf57ad2e71ed5f2a17d37f639
Author: Pranav Kant <pranavk at collabora.com>
Date: Wed May 25 15:02:17 2016 +0530
loleaflet: Sync debug/document/loleaflet.html with dist/loleaflet
Useful for debugging.
Change-Id: Ifeda2d061fcd8d98837da061c696e082a84c2850
diff --git a/loleaflet/debug/document/loleaflet.html b/loleaflet/debug/document/loleaflet.html
index fd87656..500aa9d 100644
--- a/loleaflet/debug/document/loleaflet.html
+++ b/loleaflet/debug/document/loleaflet.html
@@ -28,11 +28,13 @@
<link rel="stylesheet" href="/loleaflet/%VERSION%/toolbar/evol.colorpicker.min.css">
<link rel="localizations" href="/loleaflet/%VERSION%/l10n/localizations.json" type="application/vnd.oftn.l10n+json"/>
<link rel="localizations" href="/loleaflet/%VERSION%/l10n/styles-localizations.json" type="application/vnd.oftn.l10n+json" />
+<link rel="localizations" href="/loleaflet/%VERSION%/l10n/uno-localizations.json" type="application/vnd.oftn.l10n+json" />
<style type="text/css"></style></head>
<body>
<script src="/loleaflet/%VERSION%/jquery/2.1.0/jquery.min.js"></script>
<script src="/loleaflet/%VERSION%/l10n/json2.min.js"></script>
<script src="/loleaflet/%VERSION%/l10n/l10n.min.js"></script>
+ <script>var _ = function (string) {return string.toLocaleString();};</script>
<script src="/loleaflet/%VERSION%/toolbar/w2ui.min.js"></script>
<script src="/loleaflet/%VERSION%/toolbar/select2.min.js"></script>
<script src="/loleaflet/%VERSION%/jqueryui/1.11.1/jquery-ui.min.js"></script>
@@ -47,7 +49,7 @@
<script src="/loleaflet/%VERSION%/dialog/vex.combined.min.js"></script>
<script src="/loleaflet/%VERSION%/branding.js"></script> <!-- logo onclick handler -->
<script>vex.defaultOptions.className = 'vex-theme-plain';</script>
- <script>var _ = function (string) {return string.toLocaleString();};</script>
+ <script src="/loleaflet/%VERSION%/errormessages.js"></script>
<!--The "controls" div holds map controls such as the Zoom button and
it's separated from the map in order to have the controls on the top
@@ -101,10 +103,10 @@
var timestamp = getParameterByName('timestamp');
var closebutton = getParameterByName('closebutton');
if (wopiSrc === '' && filePath === '') {
- vex.dialog.alert('Wrong WOPISrc, usage: WOPISrc=valid encoded URI, or file_path, usage: file_path=/path/to/doc/');
+ vex.dialog.alert(wrongwopisrc);
}
if (host === '') {
- vex.dialog.alert('The host URL is empty. The loolwsd server is probably misconfigured, please contact the administrator.');
+ vex.dialog.alert(emptyhosturl);
}
var docURL = wopiSrc !== '' ? wopiSrc : filePath;
commit f6ca0b08cbb80697263f7204ce438b3deeedd741
Author: Pranav Kant <pranavk at collabora.com>
Date: Tue May 24 22:37:08 2016 +0530
loleaflet: Replace gif spinner with html canvas
The gif spinner had a white background flashes in its frames, so
it always needed white background behind it. With this, we will
have no such restriction, can can have transparent background.
Change-Id: I1faffa326ae85114e52231cc4e33d84c7ac0675d
diff --git a/loleaflet/dist/images/spinner.gif b/loleaflet/dist/images/spinner.gif
deleted file mode 100644
index 3eb32ef..0000000
Binary files a/loleaflet/dist/images/spinner.gif and /dev/null differ
diff --git a/loleaflet/dist/leaflet.css b/loleaflet/dist/leaflet.css
index d986565..cdb3375 100644
--- a/loleaflet/dist/leaflet.css
+++ b/loleaflet/dist/leaflet.css
@@ -650,12 +650,6 @@ a.leaflet-control-buttons:hover:first-child {
margin: 0 auto;
}
-.leaflet-progress-layer {
- background: #fff;
- border: 2px solid #eee;
- padding: 10px;
-}
-
.leaflet-progress {
background: #ebebeb;
border-left: 1px solid transparent;
@@ -692,14 +686,14 @@ a.leaflet-control-buttons:hover:first-child {
}
.leaflet-progress-spinner {
- background-image: url(images/spinner.gif);
- background-color: white;
- background-repeat: no-repeat;
- background-position: center center;
- width: 100%;
+ width: 100%;
margin: 0 0 4px;
- height: 34px;
- }
+ text-align: center;
+ }
+
+.leaflet-progress-spinner-canvas {
+ position: static !important;
+ }
.leaflet-progress-label {
text-align: center;
diff --git a/loleaflet/src/layer/marker/ProgressOverlay.js b/loleaflet/src/layer/marker/ProgressOverlay.js
index 2b096c9..50c6fac 100644
--- a/loleaflet/src/layer/marker/ProgressOverlay.js
+++ b/loleaflet/src/layer/marker/ProgressOverlay.js
@@ -4,6 +4,10 @@
L.ProgressOverlay = L.Layer.extend({
+ options: {
+ spinnerSpeed: 1.5
+ },
+
initialize: function (latlng, size) {
this._latlng = L.latLng(latlng);
this._size = size;
@@ -23,6 +27,10 @@ L.ProgressOverlay = L.Layer.extend({
if (this._container) {
this.getPane().removeChild(this._container);
}
+
+ if (this._spinnerInterval) {
+ clearInterval(this._spinnerInterval);
+ }
},
update: function () {
@@ -38,6 +46,7 @@ L.ProgressOverlay = L.Layer.extend({
_initLayout: function () {
this._container = L.DomUtil.create('div', 'leaflet-progress-layer');
this._spinner = L.DomUtil.create('div', 'leaflet-progress-spinner', this._container);
+ this._spinnerCanvas = L.DomUtil.create('canvas', 'leaflet-progress-spinner-canvas', this._spinner);
this._label = L.DomUtil.create('div', 'leaflet-progress-label', this._container);
this._progress = L.DomUtil.create('div', 'leaflet-progress', this._container);
this._bar = L.DomUtil.create('span', '', this._progress);
@@ -47,11 +56,36 @@ L.ProgressOverlay = L.Layer.extend({
this._container.style.width = this._size.x + 'px';
+ this._initSpinner();
+
L.DomEvent
.disableClickPropagation(this._progress)
.disableScrollPropagation(this._container);
},
+ _initSpinner: function () {
+ this._spinnerCanvas.width = 50;
+ this._spinnerCanvas.height = 50;
+
+ var context = this._spinnerCanvas.getContext('2d');
+ context.lineWidth = 8;
+ context.strokeStyle = 'grey';
+ var x = this._spinnerCanvas.width / 2;
+ var y = this._spinnerCanvas.height / 2;
+ var radius = y - context.lineWidth / 2;
+ var self = this;
+ this._spinnerInterval = setInterval(function() {
+ context.clearRect(0, 0, x * 2, y * 2);
+ // Move to center
+ context.translate(x, y);
+ context.rotate(self.options.spinnerSpeed * Math.PI / 180);
+ context.translate(-x, -y);
+ context.beginPath();
+ context.arc(x, y, radius, 0, Math.PI * 1.3);
+ context.stroke();
+ }, 1);
+ },
+
_setPos: function (pos) {
L.DomUtil.setPosition(this._container, pos);
},
More information about the Libreoffice-commits
mailing list