client options
This commit is contained in:
parent
e1eb6b5df1
commit
ec7147a9de
8 changed files with 38 additions and 32 deletions
|
|
@ -1,9 +1,9 @@
|
|||
window.ARGV = {}
|
||||
window.ENV = window.ENV || {}
|
||||
location.search.replace(/[?&]+([^=&]+)=([^&]*)/gi, (s,k,v)=>{
|
||||
ARGV[k]=v
|
||||
ENV[k]=v
|
||||
})
|
||||
|
||||
window.LANG = ARGV.lang === 'debug' ? 'debug' : (ARGV.lang || navigator.language || '').substr(0, 2).toLowerCase()
|
||||
window.LANG = ENV.lang === 'debug' ? 'debug' : (ENV.lang || navigator.language || '').substr(0, 2).toLowerCase()
|
||||
|
||||
window.PACKAGE = require('../../package.json')
|
||||
|
||||
|
|
@ -13,13 +13,13 @@ window.READ_ONLY = false
|
|||
window.GRIDWIDTH = 10
|
||||
|
||||
|
||||
window.CANVAS_FRAMERATE = parseFloat(ARGV.framerate || 60)
|
||||
window.CANVAS_SCALING = parseFloat(ARGV.forceHdpi) || ( ARGV.hdpi ? window.devicePixelRatio : 1 )
|
||||
window.INITIALZOOM = ARGV.zoom ? ARGV.zoom : 1
|
||||
window.CANVAS_FRAMERATE = parseFloat(ENV.framerate || 60)
|
||||
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')
|
||||
|
||||
window.DOUBLE_TAP_TIME = ARGV.doubletap ? ARGV.doubletap : 375
|
||||
window.DOUBLE_TAP_TIME = ENV.doubletap ? parseInt(ENV.doubletap) : 375
|
||||
|
||||
|
||||
window.JSON.parseFlex = require('json5').parse
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
require('./stacktrace')
|
||||
require('./globals')
|
||||
|
||||
var locales = require('./locales'),
|
||||
html = require('nanohtml')
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function(event) {
|
||||
|
||||
require('./globals')
|
||||
|
||||
var locales = require('./locales'),
|
||||
html = require('nanohtml')
|
||||
|
||||
DOM.get(document, '#osc-greeting-header')[0].appendChild(html`${PACKAGE.productName} <span class="version">v${PACKAGE.version}</span>`)
|
||||
|
||||
DOM.init()
|
||||
|
|
@ -23,7 +24,7 @@ document.addEventListener('DOMContentLoaded', function(event) {
|
|||
|
||||
document.title = TITLE
|
||||
|
||||
ipc.send('ready', {backupId: ARGV.backupId})
|
||||
ipc.send('ready', {backupId: ENV.backupId})
|
||||
|
||||
|
||||
}, 100)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue