Commit Graph

37 Commits

Author SHA1 Message Date
Pierre Ossman
7f5b51acf3 Consistently use "sentence case" style
Try to be more consistent in how we capitalize things. Both the "Title
Case" and "Sentence case" styles are popular, so either would work.
Google and Mozilla both prefer "Sentence case", so let's follow them.
2024-11-27 14:40:40 +01:00
Samuel Mannehed
a30f609de4 Don't crash if we can't use localStorage
Our settings are not a fatal requirement, we can fall back on the
default values if they can't be accessed. A scenario where we've seen
this happen is when cookies are disabled in the browser. It seems
localStorage is disabled along with cookies in these settings.

So, lets log a message about the failure and otherwise silently
continue in this case.

Fixes issue #1577.
2023-07-13 14:35:07 +02:00
Pierre Ossman
05b6d2ad67 Fix typos in query variable comment 2023-05-10 12:25:46 +02:00
Pierre Ossman
2a21bee245 Revert broken Add support for URL fragment parameters
This is a revert of the code changes in commit
f796b05e42 as it served no functional
purpose.

Fragments were already respected for setting parameters, via a different
function. Thus it is unclear what that commit tried to fix. It also
complicated things by mixing the document location with the window
location.

The comment changes are useful, though, so those are kept.
2023-05-10 12:25:46 +02:00
Pierre Ossman
262a90b0e0 Consistently use "first" indentation
We already enforced this for most things, so let's fix up the last few
variants as well.
2022-12-27 12:50:57 +01:00
Samuel Mannehed
f69d55c02f Fix parsing of query string variables
This space that was added here was added to the parsed value of the
query variable. This broke any comparisons with the value, for example
"myvar=true" resulted in a value of "true ".

This was broken by f796b05e42

The commit also adds unit tests for webutil.getConfigVar() that will
detect problems like this in the future.
2021-09-08 15:37:42 +02:00
yatru
f796b05e42 Add support for URL fragment parameters
Passing parameters as part of the fragment could be considered
benifical from a security or privacy standpoint when compared to query
string parameters. The URL fragment parameters are not sent to the
server.
2021-09-01 14:49:37 +02:00
Pierre Ossman
6cd9bacf8b Use Fetch API for getting JSON data
We no longer need to support Internet Explorer so we can use a more
proper API here.
2020-12-04 16:43:44 +01:00
Pierre Ossman
273acf3e89 Remove unused injectParamIfMissing()
It should have been removed in 58fc267b2b
with the caller.
2020-12-04 16:43:04 +01:00
Samuel Mannehed
756af5b44c Standardize on camelCase in App 2020-05-31 23:37:29 +02:00
Samuel Mannehed
a7fe079f81 Standardize on camelCase in Logging 2020-05-31 23:37:29 +02:00
Samuel Mannehed
412d93060d Update copyright to 2019 for modified files 2019-09-30 15:35:33 +02:00
Juanjo Diaz
1c9b904d1a Remove callbacks from UI in favour of promises 2019-02-27 10:18:59 +02:00
Solly Ross
84586c0f17 Change copyright header (#1138)
* Change copyright header

This updates the copyright header to say "The noVNC Authors".  People
who previously had copyright listings are now under the AUTHORS file.
2018-10-09 12:15:35 +02:00
Pierre Ossman
2c5491e131 Enforce space after function name 2018-09-06 17:34:15 +02:00
Pierre Ossman
4a16dc51a8 Enforce no trailing whitespace 2018-09-06 17:12:45 +02:00
Juanjo Diaz
651c23ece3 Use fat arrow functions const foo = () => { ... }; for callbacks
and any other function that is passed around and it's not a top level function
2018-07-12 19:06:57 +02:00
Juanjo Diaz
2b5f94fa6a Prefer const/let over var 2018-05-24 00:27:09 +03:00
Juanjo Diaz
8727f598c2 Add eslint and fix reported issues 2018-05-24 00:25:44 +03:00
Andrew Webster
e0750f9b2c Use localstorage only to initialize settings map
This only reads from localstorage in order to initialize the settings
map.  After initializaton, reads will return the value from the map.

When writing a value, the settings map and the local storage
are updated, unless the setting is a default value or derived from
the query string.

This has a few advantages:
 1. Saved settings will not be overridden by settings specified in
the query string.  This means a setting could be temporarily changed
using the query string, but once removed from the query string, the
setting would return back to what the user selected.
 2. Default values will not be saved.  If a user has always used
the default value for a setting, then they can move to a new version
with different defaults without clearing localstorage.
 3. Changes made to localstorage in a session running in a different
window will not affect the settings in the current window (until
the page is refreshed).

Regarding eraseSetting:

It is possible that another tab could change the value, leading
to an unexpected value change in the tab that deletes.  However,
this function is currently unused, so this will be evaluted if
and when it used.
2018-02-13 10:22:21 -05:00
Juanjo Diaz
9e1bd410aa Remove jshint comments 2018-01-31 07:38:29 -08:00
Juanjo Diaz
a003535941 Remove console statements 2018-01-30 08:53:38 -08:00
Giannis Kosmas
eb533b2b00 Add missing quotes 2017-10-06 14:15:22 +03:00
Pierre Ossman
858ea4a774 Avoid use of 'let' and 'const'
They are not supported on older browsers, e.g. iOS 9.
2017-06-02 15:41:37 +02:00
Samuel Mannehed
c464f47e96 Remove trailing whitespace 2017-05-13 01:56:24 +02:00
Solly Ross
6d6f0db0da Refactor ES6 module structure/split up Util
This commit restructures many of the ES6 modules, splitting them
up to actual export multiple functions instead of a single object.

It also splits up Util into multiple sub-modules, to make it easier
to maintain.

Finally, localisation is renamed to localization.
2017-03-21 17:39:05 -04:00
Solly Ross
6e744119f8 Remove WebUtil.load_scripts
The only remaining user of WebUtil.load_scripts was for loading
localisation.  Instead, we now load the localization information
over XHR as a JSON blob.
2017-03-07 11:11:29 -05:00
Solly Ross
2a7c6d20ab Load translations over XHR
This commit causes translations to be loaded over XHR instead of
the import system.
2017-03-07 11:11:29 -05:00
Solly Ross
bc35b1d27e Remove WebUtil.dirObj
`WebUtil.dirObj` wasn't being used anywhere, so this removes it.
2017-03-07 11:11:29 -05:00
Solly Ross
3ae0bb0968 Uncomment ES6 module syntax
This removes the special comment part of the ES6 module syntax,
opting to enable ES6 module syntax by default.

It also appends `.js` to all import paths to better support in-browser
loading.
2017-02-26 16:30:37 -05:00
Pierre Ossman
86d15a4929 Use setCapture() polyfill everywhere
This makes sure we get consistent behaviour across all browsers.
2017-02-09 15:51:22 +01:00
Pierre Ossman
340d9d66cc Remove alternative style sheets
Anyone with basic knowledge of CSS will easily figure out how to
customise the appearance of the UI, so remove the burden of having
to maintain these extra style sheets.
2017-01-04 15:05:01 +01:00
Pierre Ossman
3cdc603aa4 Use gettext .po files for translations
This allows the same workflow as most other projects for translations.
2016-11-17 20:42:08 +01:00
Samuel Mannehed
a93cda3a36 Move app-specific location of language files
The core directory should only contain core API code that isn't
specific to an application.
2016-10-28 14:30:14 +02:00
Samuel Mannehed
04b399e27d Allow moving the controlbar handle
This also adds emulation of Element.setCapture() as only Firefox
and Internet Explorer/Edge currently supports it.
2016-09-23 14:39:21 +02:00
Solly Ross
72bdd06ea2 Clean up Util
This commit removes unused code from Util, and moves the script-loading
functionality to WebUtil.
2016-09-16 15:49:52 -04:00
Solly Ross
ae510306b5 Enable noVNC to become Browserifiable
This commit restructures noVNC, splitting it into the core directory
and the app directory, with the former containing core noVNC parts,
and the latter containing parts specific to the application.
2016-09-16 15:49:51 -04:00