loleaflet/Makefile                |    2 -
 loleaflet/dist/toolbar/toolbar.js |   44 +++++++++++++++++++++++++++++++-------
 loolwsd/configure.ac              |    2 -
 3 files changed, 38 insertions(+), 10 deletions(-)

New commits:
commit 277f86b7e9c669b876a7c5cfb830121c0f0bd201
Author: Andras Timar <[email protected]>
Date:   Wed Feb 24 14:13:56 2016 +0100

    loolwsd: bump version after tarball

diff --git a/loolwsd/configure.ac b/loolwsd/configure.ac
index adce958..274cf1c 100644
--- a/loolwsd/configure.ac
+++ b/loolwsd/configure.ac
@@ -3,7 +3,7 @@
 
 AC_PREREQ([2.69])
 
-AC_INIT([loolwsd], [1.5.4], [[email protected]])
+AC_INIT([loolwsd], [1.5.5], [[email protected]])
 
 AM_INIT_AUTOMAKE([1.11 silent-rules subdir-objects])
 
commit f35e13a936081d238e5613a0544e5e86da0d3d00
Author: Andras Timar <[email protected]>
Date:   Wed Feb 24 14:10:49 2016 +0100

    loolwsd: bump version before tarball

diff --git a/loolwsd/configure.ac b/loolwsd/configure.ac
index 7adecbe..adce958 100644
--- a/loolwsd/configure.ac
+++ b/loolwsd/configure.ac
@@ -3,7 +3,7 @@
 
 AC_PREREQ([2.69])
 
-AC_INIT([loolwsd], [1.5.3], [[email protected]])
+AC_INIT([loolwsd], [1.5.4], [[email protected]])
 
 AM_INIT_AUTOMAKE([1.11 silent-rules subdir-objects])
 
commit 2e6f40171048d161dfe7cc1e10bb998c0862de40
Author: Andras Timar <[email protected]>
Date:   Wed Feb 24 14:10:18 2016 +0100

    loleaflet: bump version after tarball

diff --git a/loleaflet/Makefile b/loleaflet/Makefile
index 112c79b..36ba743 100644
--- a/loleaflet/Makefile
+++ b/loleaflet/Makefile
@@ -3,7 +3,7 @@
 # ("micro") part: Between releases odd, even for releases (no other
 # changes inbetween).
 
-VERSION=1.5.4
+VERSION=1.5.5
 
 # Version number of the bundled 'draw' thing
 DRAW_VERSION=0.2.4
commit b66a5f7987f56fb42388001de8cda4ab8c5276bc
Author: Andras Timar <[email protected]>
Date:   Wed Feb 24 14:04:44 2016 +0100

    loleaflet: bump version before tarball

diff --git a/loleaflet/Makefile b/loleaflet/Makefile
index 58e7d39..112c79b 100644
--- a/loleaflet/Makefile
+++ b/loleaflet/Makefile
@@ -3,7 +3,7 @@
 # ("micro") part: Between releases odd, even for releases (no other
 # changes inbetween).
 
-VERSION=1.5.3
+VERSION=1.5.4
 
 # Version number of the bundled 'draw' thing
 DRAW_VERSION=0.2.4
commit ded88d5e4cb38256f29cf4b9912c2471b3a5d1b7
Author: Ozcan Esen <[email protected]>
Date:   Mon Feb 22 02:29:52 2016 +0200

    loleaflet: allow manually entered font sizes bccu#1354
    
    Change-Id: I137e6f3ad9fb84de6a9179f9d4e00ca4c10e9469
    Reviewed-on: https://gerrit.libreoffice.org/22605
    Reviewed-by: Andras Timar <[email protected]>
    Tested-by: Andras Timar <[email protected]>

diff --git a/loleaflet/dist/toolbar/toolbar.js 
b/loleaflet/dist/toolbar/toolbar.js
index b77c94c..53c620d 100644
--- a/loleaflet/dist/toolbar/toolbar.js
+++ b/loleaflet/dist/toolbar/toolbar.js
@@ -425,12 +425,20 @@ function updateFontSizeList (font) {
        data = 
data.concat(map.getToolbarCommandValues('.uno:CharFontName')[font]);
        $(".fontsizes-select").select2({
                data: data,
-               placeholder: _("Size")
+               placeholder: _("Size"),
+               //Allow manually entered font size.
+               createTag:function(query) {
+                       return {
+                               id: query.term,
+                               text: query.term,
+                               tag: true
+                       }
+               },
+               tags: true,
        });
-       $(".fontsizes-select option").each(function () {
-               value = this.value;
-               if (value == oldSize) {
-                       $(".fontsizes-select").val(value).trigger('change');
+       $(".fontsizes-select option").each(function (i, e) {
+               if ($(e).text() == oldSize) {
+                       $(".fontsizes-select").val(oldSize).trigger('change');
                        found = true;
                        return;
                }
@@ -442,6 +450,24 @@ function updateFontSizeList (font) {
                        .text(oldSize));
        }
        $(".fontsizes-select").val(oldSize).trigger('change');
+       sortFontSizes();
+}
+
+function sortFontSizes() {
+       var oldVal = $('.fontsizes-select').val();
+       var selectList = $('.fontsizes-select option');
+       selectList.sort(function (a,b){
+               a = parseFloat($(a).text() * 1);
+               b = parseFloat($(b).text() * 1);
+               if(a > b) {
+                   return 1;
+               } else if (a < b) {
+                   return -1;
+               }
+               return 0;
+       });
+       $('.fontsizes-select').html(selectList);
+       $('.fontsizes-select').val(oldVal).trigger('change');
 }
 
 function onFontSelect (e) {
@@ -453,6 +479,7 @@ function onFontSelect (e) {
 
 function onFontSizeSelect (e) {
        var size = e.target.value;
+       
$(e.target).find('option[data-select2-tag]').removeAttr('data-select2-tag');
        map.applyFontSize(size);
                fontcolor = map.getDocType() === 'text' ? 'FontColor' : 'Color';
                command[fontcolor] = {};
@@ -608,8 +635,8 @@ map.on('commandstatechanged', function (e) {
                if (state === '0') {
                        state = '';
                }
-               $(".fontsizes-select option").each(function () {
-                       if (e == state) {
+               $(".fontsizes-select option").each(function (i, e) {
+                       if ($(e).text() == state) {
                                found = true;
                                return;
                        }
@@ -618,9 +645,10 @@ map.on('commandstatechanged', function (e) {
                        // we need to add the size
                        $('.fontsizes-select')
                                .append($("<option></option>")
-                               .text(state));
+                               .text(state).val(state));
                }
                $(".fontsizes-select").val(state).trigger('change');
+               sortFontSizes();
        }
        else if (commandName === '.uno:FontColor' || commandName === 
'.uno:Color') {
                // confusingly, the .uno: command is named differently in 
Writer, Calc and Impress
_______________________________________________
Libreoffice-commits mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to