Commit graph

33 commits

Author SHA1 Message Date
Ophir LOJKINE
a6eba9b293 Fix #107 2020-07-27 12:11:27 +02:00
finnboeger
57a02c42d6
Improve compatibility with Internet Explorer (#63)
* include promise polyfill

* remove es6

* add viewBox to every icon

* change self closing to explicitly closing tags

* replace window.scroll.. with document.documentElement.scroll..

* verify document.activeElement.blur() is a function before calling

* fix visuals of color chooser (colorpicker still sometimes buggy)

* do not attach to mouseleave event in IE

* attempt removal with usecapture true in IE as well, this fixes the tool switching issue

* fix text tool for IE

* fix cursor for IE

* change curMode to boolean and rename to 'active'

* replace minified canvascolor with unminified code

* replace if else structure with switch statement

* compile polyfill for each browser individually

* remove static polyfills from board.js

* Fix broken js reference

* Fix unused variable and empty console log

* Allow serving non-minified polyfills for easier debugging

* Add proper caching for polyfill.js

This request is on the critical path, we should try to make it fast

* Include more polyfills

All the DOM polyfills were missing

* Update dependencies

* Add missing polyfill

Our custom polyfill was deleted, but the one from polyfill-library hadn't been added

* Remove feature detection for Node.contains

We now have the function in the polyfills

* Update polyfill caching logic

* Remove content-Length header

Co-authored-by: @lovasoa
2020-05-05 12:01:46 +02:00
finnboeger
fce694df28
Add a cursor (#46)
* Added cursors

* Prepare cursor code for future settings to toggle cursors on or off.
Let cursor be the color the person has currently selected

* fix cursor on mobile (still won't display it in most cases as there is no hover on mobile but at least it won't throw errors)

* use correct size for cursor

* throttle cursor update rate to dramatically improve performance by eliminating congestion

* fix remote cursor size on desktop

* show own cursor by default and renove offset

* use svg as mouse cursor for pencil to be able to apply a reduced opacity to it and view our cursor

* don't throttle local cursor

* throttle local cursor at an independent higher rate. This could be made user adjustable for low power devices

* remove let and const from client-side code

* get emit count and emit count period from configuration

* reduce network cursor updates a lot to prevent instantly getting banned with the current defaults

* prevent eraser from deleting cursors

* use group inside of svg as drawing area and only delete elements inside it with the eraser

* use transform: translate to move cursors around instead of manipulating x and y directly

* fix: add socket ids to cursor messages

* fix incorrect remote cursor scaling and make local cursor visible again after it has been moved after being hidden due to inactivity

* create cursors in a proper fashion and keep them in a separate group

* scaling has been fixed in a1a5580

* move duplicated cursor creation code to function

* show cursors above content

* pass some of ther server configuration through to the client

* fix bug introduced in a833ce9

* allocate at most half of the allowed traffic to cursor updates

* remove debugging leftover

* use feature detection instead of ua sniffing

Co-Authored-By: Ophir LOJKINE <ophir.lojkine@auto-grid.com>

* fix regression where local cursor color was not updated on color change

* Define the cursor as a tool

* Remove the cursor tool from the UI

* Throttle remote cursor updates, not local ones

* Do not increment notification count on cursor move

* Use only one pencil icon

Use the same image for the pencil icon in the menu
and the pencil cursor that appears while drawing

* Add a test for the new cursor feature

* only stop drawing remote cursor when using some tools and always draw local cursor

* increase idle period before hiding cursor

* change idle duration back and set whether a cursor should be sent when using a tool in the respective tool

Co-authored-by: Robert Beach <rdbeach@gmail.com>
Co-authored-by: Ophir LOJKINE <ophir.lojkine@auto-grid.com>
Co-authored-by: ophir <pere.jobs@gmail.com>
2020-05-02 06:13:48 +02:00
finnboeger
4d065216bd
Improve text tool (#45)
Make the text field of the text tool appear at the position where the text will be written.

* improved Text tool

* ignore layers for now

* only assert value is not null or undefined / allow 0 as value

* remove unused layer code

* Reformat text.js

Co-authored-by: Robert Beach <rdbeach@gmail.com>
Co-authored-by: @finnboeger
2020-04-27 12:48:35 +02:00
ophir
fc51f0dc0b Optimize icons to make them smaller 2020-04-26 11:53:14 +02:00
Ophir LOJKINE
6baab81f63 Better tool icons 2020-04-26 00:45:42 +02:00
Ophir LOJKINE
fa5c5f0969 Fix input type in text tool 2019-06-24 00:55:14 +02:00
Ophir LOJKINE
3151651f45 Close text edition field when "escape" is pressed 2019-06-22 21:03:02 +02:00
Ophir LOJKINE
205a17902b Added keyboard shortcuts 2019-06-22 20:54:20 +02:00
ophir
32c0020dca Add support for transparency
Closes #5
2018-12-02 13:18:29 +01:00
ophir
4a1474ad9a Limit the size of text 2018-11-29 01:03:40 +01:00
Ophir LOJKINE
b69898a9a6 Avoid flashing text input on page load 2018-11-27 15:46:24 +01:00
Ophir LOJKINE
3c9bfcbfbf Reformat code in tools 2018-11-27 15:35:51 +01:00
Ophir LOJKINE
43370fac3d Update existing text with the Text tool 2015-07-20 09:49:32 +02:00
Ophir LOJKINE
e944fc3946 Remove dependency to font-awesome
Use Unicode icons instead
2015-07-15 15:28:18 +02:00
Ophir LOJKINE
fd9657304f Add straight line tool 2014-07-22 00:45:21 +02:00
Ophir LOJKINE
70b1519205 Bug corrections 2013-12-26 02:50:00 +01:00
Ophir LOJKINE
2257ba473a Add tool icons 2013-12-14 13:45:55 +01:00
Ophir LOJKINE
fd35a486b8 Rework the way the server stores data to make it handle updates and deletions more intelligentlty.
Some work was done on the client-side too, and board loading should now be much faster.
2013-12-07 04:46:31 +01:00
Ophir LOJKINE
2c75908461 Hopefully correct a bug where text was not saved. This bug occured at least on firefox for mobile. 2013-12-06 22:39:43 +01:00
Ophir LOJKINE
374ea859b1 My hands are typing words.
Update a constant
2013-12-03 20:42:52 +01:00
Ophir LOJKINE
b08d6d35f1 Rename 'field' to 'id' in messages. 2013-12-03 20:34:49 +01:00
Ophir LOJKINE
e75a7d34aa Log errors with console.error instead of console.log 2013-12-03 20:26:56 +01:00
Ophir LOJKINE
2ae4b14710 Change text font to Arial. 2013-11-19 18:45:15 +01:00
Ophir LOJKINE
34aca4919b Print the text with the same font on every browser. 2013-11-18 16:56:53 +01:00
Ophir LOJKINE
cd1a18589a Remove the 'delete' instruction. It was only an overhead. 2013-11-10 17:39:44 +01:00
Ophir LOJKINE
b276a7f1e7 Custom mouse cursors for every tools 2013-11-10 17:21:05 +01:00
Ophir LOJKINE
47a8445d0c Make the text field visible during text edition. 2013-11-10 14:38:00 +01:00
Ophir LOJKINE
89e706d87d Remove now unnecessary styling information. 2013-11-10 12:36:28 +01:00
Ophir LOJKINE
1728d5863b Add licensing information to javascript files. 2013-11-10 11:41:35 +01:00
Ophir LOJKINE
205e796f42 Text tool: Use SVG <text> instead of HTML <span>.
The text can now be overriden by the pencil, and can't be edited anymore.
2013-11-10 02:56:27 +01:00
Ophir LOJKINE
6888c33e49 GUI improvements:
Make a beautiful tool menu.
Choose a standard font for the text tool: Arial.
2013-10-13 12:52:01 +02:00
Ophir LOJKINE
b557375a08 Improve tool architecture, and add a new tool, to write text. 2013-10-07 00:43:00 +02:00