client-options: make them case-insensitive & fix typo in docs

This commit is contained in:
bordun 2021-06-23 22:35:52 +02:00
parent 7528f702aa
commit 638244d6c0
5 changed files with 7 additions and 7 deletions

View file

@ -5,7 +5,7 @@ Client options can be set either with the server's `--client-options` option, or
|----|----|----|----|
| hdpi | 1 / 0 | 0 | enable high resolution canvas |
| forceHdpi | number | 0 | force canvas scaling (ignore `hdpi`) |
| doubletab | number | 375 | sets the double tap/click time threshold in milliseconds |
| doubleTap | number | 375 | sets the double tap/click time threshold in milliseconds |
| zoom | number | 1 | sets the initial zoom |
| framerate | number | 60 | limit canvas drawing framerate |
| desyncCanvas | number | 0 | set to 1 to enable desynchronized canvas (may improve rendering performances) |
@ -13,7 +13,7 @@ Client options can be set either with the server's `--client-options` option, or
| consoleLength | number | 300 | sets the maximum number of log messages in the client's console |
| id | string | *random_id* | client's unique id (use with caution: two clients should never have the same id) |
| usePercents | 1 / 0 | 0 | sets the editor's "relative units" option |
| nofocus | 1 / 0 | 0 | (built-in client only) prevent the client window from taking focus unless a text input or a dropdown is clicked |
| noFocus | 1 / 0 | 0 | (built-in client only) prevent the client window from taking focus unless a text input or a dropdown is clicked |
Example:

View file

@ -155,7 +155,7 @@ class Editor {
this.idClipboard = data.idClipboard
})
this.usePercents = !!ENV.usePercents
this.usePercents = !!ENV.usepercents
this.enabled = false
this.grid = true

View file

@ -1,7 +1,7 @@
window.IP = window.IP || ''
window.ENV = window.ENV || {}
location.search.replace(/[?&]+([^=&]+)=([^&]*)/gi, (s,k,v)=>{
ENV[k]=v
ENV[k]=v.toLowerCase()
})
window.LANG = ENV.lang === 'debug' ? 'debug' : (ENV.lang || navigator.language || '').substr(0, 2).toLowerCase()
@ -18,7 +18,7 @@ window.GRIDWIDTH = GRIDWIDTH_CSS
window.ELECTRON_NOGPU = false
window.CANVAS_FRAMERATE = parseFloat(ENV.framerate || 60)
window.CANVAS_SCALING = parseFloat(ENV.forceHdpi) || ( ENV.hdpi ? window.devicePixelRatio : 1 )
window.CANVAS_SCALING = parseFloat(ENV.forcehdpi) || ( ENV.hdpi ? window.devicePixelRatio : 1 )
window.INITIALZOOM = ENV.zoom ? parseFloat(ENV.zoom) : 1
window.PXSCALE = INITIALZOOM
document.documentElement.style.setProperty('font-size', PXSCALE + 'px')

View file

@ -27,7 +27,7 @@ class UiConsole extends UiSidePanel {
})
this.length = 0
this.maxLength = ENV.consoleLength || 300
this.maxLength = ENV.consolelength || 300
this.history = ['']
this.cursor = 0

View file

@ -12,7 +12,7 @@ class Canvas extends Widget {
this.canvas = DOM.get(this.container, 'canvas')[0]
this.ctx = this.canvas.getContext('2d',{
desynchronized: !ELECTRON_NOGPU && ENV.desyncCanvas ? true : false,
desynchronized: !ELECTRON_NOGPU && ENV.desynccanvas ? true : false,
alpha: true
})