[Spice-devel] [spice-html5][PATCH v2 11/13] resize_helper, no message box case

2019-02-14 Thread Cédric Bosdonnat
The resize_handler need to check for the existence of the message box before computing it's size. --- src/resize.js | 21 - 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/resize.js b/src/resize.js index 32282fd..c8d87d9 100644 --- a/src/resize.js +++

[Spice-devel] [spice-html5][PATCH v2 13/13] More reliable mouse position reporting

2019-02-14 Thread Cédric Bosdonnat
Depending on the structure of the page, the computed mouse position was not correct. Typically the case happend when there is no offset between the canvas and the view area, but an offset on the view area. The MouseEvent.offsetX and offsetY functions are now widely enough spread to use them and

[Spice-devel] [spice-html5][PATCH v2 05/13] Expose all needed pieces in main.js

2019-02-14 Thread Cédric Bosdonnat
We don't want the users to rely on anything else than main.js. All the helper functions from the other files are thus imported in main and exported there too. This way all the user needs to import is: import * as SpiceHtml5 from './main.js'; --- main.js | 9 - spice.html

[Spice-devel] [spice-html5][PATCH v2 02/13] dos2unix sha1.js

2019-02-14 Thread Cédric Bosdonnat
--- thirdparty/sha1.js | 692 ++--- 1 file changed, 346 insertions(+), 346 deletions(-) diff --git a/thirdparty/sha1.js b/thirdparty/sha1.js index 8118cb4..363c83d 100644 --- a/thirdparty/sha1.js +++ b/thirdparty/sha1.js @@ -1,346 +1,346 @@ -/* - * A

[Spice-devel] [spice-html5][PATCH v2 12/13] resize_helper: round sizes down

2019-02-14 Thread Cédric Bosdonnat
If we round up, we may end up with a display slightly bigger than what the window can have, thus adding scroll bars. When rounding down we avoid this problems. --- src/resize.js | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/resize.js b/src/resize.js index

[Spice-devel] [spice-html5][PATCH v2 01/13] CSS: don't force the background color or inputs

2019-02-14 Thread Cédric Bosdonnat
When forcing the background of the input fields, this makes them unreadable for dark themed browsers. --- spice.css | 1 - 1 file changed, 1 deletion(-) diff --git a/spice.css b/spice.css index ee1b2f3..4c61cb3 100644 --- a/spice.css +++ b/spice.css @@ -36,7 +36,6 @@ body #login input {

[Spice-devel] [spice-html5][PATCH v2 06/13] Prepare publishing on npmjs

2019-02-14 Thread Cédric Bosdonnat
Add package.json needed to publish on npmjs. --- package.json | 21 + 1 file changed, 21 insertions(+) create mode 100644 package.json diff --git a/package.json b/package.json new file mode 100644 index 000..21a8b63 --- /dev/null +++ b/package.json @@ -0,0 +1,21 @@ +{ +

[Spice-devel] [spice-html5][PATCH v2 07/13] Move sources into their own folder

2019-02-14 Thread Cédric Bosdonnat
To add some more order to the folder, move the JS files into their own src folder. --- package.json| 2 +- spice.html | 2 +- spice_auto.html |

[Spice-devel] [spice-html5][PATCH v2 09/13] Prompt password in spice_auto.html

2019-02-14 Thread Cédric Bosdonnat
In case the user didn't provide any password, we want to prompt him for it. Try once and if we get an permission denied error, then ask the password and retry to connect. --- spice_auto.html | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/spice_auto.html

[Spice-devel] [spice-html5][PATCH v2 10/13] Document onsuccess callback

2019-02-14 Thread Cédric Bosdonnat
--- src/main.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main.js b/src/main.js index be73828..4a37b55 100644 --- a/src/main.js +++ b/src/main.js @@ -56,6 +56,8 @@ import { resize_helper, handle_resize } from './resize.js'; ** onagent (optional) If given, a function

[Spice-devel] [spice-html5][PATCH v2 04/13] Remove duplicated enums

2019-02-14 Thread Cédric Bosdonnat
--- enums.js | 7 --- 1 file changed, 7 deletions(-) diff --git a/enums.js b/enums.js index 9d31148..db13584 100644 --- a/enums.js +++ b/enums.js @@ -320,13 +320,6 @@ export var Constants = { LZ_IMAGE_TYPE_XXXA: 10, - QUIC_IMAGE_TYPE_INVALID : 0, - QUIC_IMAGE_TYPE_GRAY: 1, -

[Spice-devel] [spice-html5][PATCH v2 08/13] Fix disconnect() code

2019-02-14 Thread Cédric Bosdonnat
The disconnect() function were not checking the existence of the file transfer area element, leading to stop the disconnect() before its end. --- spice.html | 4 +++- spice_auto.html | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/spice.html b/spice.html index

[Spice-devel] [spice-html5][PATCH v2 00/13] Prepare submission for npmjs

2019-02-14 Thread Cédric Bosdonnat
am fails to apply the patch here while git apply does the work like a charm. All whitespaces should be fixed now. Cédric Bosdonnat (13): CSS: don't force the background color or inputs dos2unix sha1.js Introduce ES6 modules Remove duplicated enums Expose all needed pieces in main.js

[Spice-devel] [spice-html5][PATCH 10/12] resize_helper, no message box case

2019-02-11 Thread Cédric Bosdonnat
The resize_handler need to check for the existence of the message box before computing it's size. --- src/resize.js | 21 - 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/resize.js b/src/resize.js index 32282fd..c8d87d9 100644 --- a/src/resize.js +++

[Spice-devel] [spice-html5][PATCH 11/12] resize_helper: round sizes down

2019-02-11 Thread Cédric Bosdonnat
If we round up, we may end up with a display slightly bigger than what the window can have, thus adding scroll bars. When rounding down we avoid this problems. --- src/resize.js | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/resize.js b/src/resize.js index

[Spice-devel] [spice-html5][PATCH 12/12] More reliable mouse position reporting

2019-02-11 Thread Cédric Bosdonnat
Depending on the structure of the page, the computed mouse position was not correct. Typically the case happend when there is no offset between the canvas and the view area, but an offset on the view area. The MouseEvent.offsetX and offsetY functions are now widely enough spread to use them and

[Spice-devel] [spice-html5][PATCH 09/12] Document onsuccess callback

2019-02-11 Thread Cédric Bosdonnat
--- src/main.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main.js b/src/main.js index be73828..4a37b55 100644 --- a/src/main.js +++ b/src/main.js @@ -56,6 +56,8 @@ import { resize_helper, handle_resize } from './resize.js'; ** onagent (optional) If given, a function

[Spice-devel] [spice-html5][PATCH 05/12] Prepare publishing on npmjs

2019-02-11 Thread Cédric Bosdonnat
Add package.json needed to publish on npmjs. --- package.json | 21 + 1 file changed, 21 insertions(+) create mode 100644 package.json diff --git a/package.json b/package.json new file mode 100644 index 000..21a8b63 --- /dev/null +++ b/package.json @@ -0,0 +1,21 @@ +{ +

[Spice-devel] [spice-html5][PATCH 08/12] Prompt password in spice_auto.html

2019-02-11 Thread Cédric Bosdonnat
In case the user didn't provide any password, we want to prompt him for it. Try once and if we get an permission denied error, then ask the password and retry to connect. --- spice_auto.html | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/spice_auto.html

[Spice-devel] [spice-html5][PATCH 06/12] Move sources into their own folder

2019-02-11 Thread Cédric Bosdonnat
To add some more order to the folder, move the JS files into their own src folder. --- package.json| 2 +- spice.html | 1 - spice_auto.html | 2

[Spice-devel] [spice-html5][PATCH 07/12] Fix disconnect() code

2019-02-11 Thread Cédric Bosdonnat
The disconnect() function were not checking the existence of the file transfer area element, leading to stop the disconnect() before its end. --- spice.html | 4 +++- spice_auto.html | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/spice.html b/spice.html index

[Spice-devel] [spice-html5][PATCH 03/12] Remove duplicated enums

2019-02-11 Thread Cédric Bosdonnat
--- enums.js | 7 --- 1 file changed, 7 deletions(-) diff --git a/enums.js b/enums.js index 9d31148..db13584 100644 --- a/enums.js +++ b/enums.js @@ -320,13 +320,6 @@ export var Constants = { LZ_IMAGE_TYPE_XXXA: 10, - QUIC_IMAGE_TYPE_INVALID : 0, - QUIC_IMAGE_TYPE_GRAY: 1, -

[Spice-devel] [spice-html5][PATCH 04/12] Expose all needed pieces in main.js

2019-02-11 Thread Cédric Bosdonnat
We don't want the users to rely on anything else than main.js. All the helper functions from the other files are thus imported in main and exported there too. This way all the user needs to import is: import * as SpiceHtml5 from './main.js'; --- main.js | 9 - spice.html

[Spice-devel] [spice-html5][PATCH 00/12] Prepare for npmjs publication

2019-02-11 Thread Cédric Bosdonnat
Hi Jeremy, all, Here is the series that moves everything into a module and avoid cluttering the global namespace. This also includes some fixes for bugs I found while integrating in a third party website. Cédric Bosdonnat (12): CSS: don't force the background color or inputs Introduce ES6

[Spice-devel] [spice-html5][PATCH 01/12] CSS: don't force the background color or inputs

2019-02-11 Thread Cédric Bosdonnat
When forcing the background of the input fields, this makes them unreadable for dark themed browsers. --- spice.css | 1 - 1 file changed, 1 deletion(-) diff --git a/spice.css b/spice.css index ee1b2f3..4c61cb3 100644 --- a/spice.css +++ b/spice.css @@ -36,7 +36,6 @@ body #login input {

[Spice-devel] [PATCH v5] Check too long password

2015-06-04 Thread Cédric Bosdonnat
Make sure that the password length is under the maximum lenght. If not report it as an authentication failure with an adapted message. --- Diff to v4 * Applied teuf's feedback gtk/spice-channel.c | 77 + 1 file changed, 48 insertions(+), 29

[Spice-devel] [PATCH v4] Check too long password

2015-06-03 Thread Cédric Bosdonnat
Make sure that the password lenght is under the maximum lenght. If not report it as an authentication failure with an adapted message. --- Diff to v3: * Removed the checks on the server side and the corresponding code here * Removed the new error code to reuse

[Spice-devel] [PATCH v2] Add password length check

2015-06-03 Thread Cédric Bosdonnat
Don't allow setting a too long password. --- Diff to v1: only kept the admin/user password setting check server/reds.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/reds.c b/server/reds.c index 6d70b68..5579109 100644 --- a/server/reds.c +++ b/server/reds.c @@ -3503,6 +3503,8 @@

[Spice-devel] [PATCH v3] Report invalid password as a special auth error

2015-06-01 Thread Cédric Bosdonnat
Provide a special authentication error message for too long passwords. Also check for too long passwords before sending them over the wire. --- Diff to v2: * Make spice_channel_send_spice_ticket return TRUE / FALSE to indicate success gtk/spice-channel.c | 74

[Spice-devel] [PATCH v2] Report invalid password as a special auth error

2015-05-27 Thread Cédric Bosdonnat
Provide a special authentication error message for too long passwords. Also check for too long passwords before sending them over the wire. --- Diff to v1: * Added a check in spice_channel_send_spice_ticket * moved spice_channel_failed_authentication before spice_channel_send_spice_ticket

[Spice-devel] [PATCH] Report invalid password as a special auth error

2015-05-22 Thread Cédric Bosdonnat
Provide a special authentication error message for too long passwords. --- Note: this patch needs a pending one for spice-common. submodule will need to be updated. gtk/spice-channel.c | 18 ++ gtk/spice-client.h | 2 ++ 2 files changed, 16 insertions(+), 4 deletions(-) diff

[Spice-devel] [PATCH] Add password length checks

2015-05-22 Thread Cédric Bosdonnat
Don't allow setting a too long password. Also send a specific error if the user provides a too long password for client to be able to tell the user about it. --- Note: This patch needs a pending one in spice-common, submodule will need to be updated. server/reds.c | 7 +++ 1 file changed,

[Spice-devel] [PATCH] Add INVALID_PASSWORD link error

2015-05-22 Thread Cédric Bosdonnat
This link error reports too long password error, to have proper error reporting rather than having an undefined behavior in such a case. --- Note: commits using this one in spice and spice-gtk will follow. spice.proto | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

[Spice-devel] [PATCH] Report invalid password as a special auth error

2015-05-22 Thread Cédric Bosdonnat
Provide a special authentication error message for too long passwords. --- Note that this patch depends on a pending patch in spice-common. gtk/spice-channel.c | 18 ++ gtk/spice-client.h | 2 ++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git