Commit Graph

520 Commits

Author SHA1 Message Date
Samuel Mannehed deb76f97cd Add some sane default CSS for textareas 2025-01-23 15:40:52 +01:00
Samuel Mannehed f0ec3d62b5 Avoid 2 borders when focus-visible on text inputs
By having the focus-visible outline overlapping the regular border
things look a bit more sane on text input elements.
2025-01-23 15:40:52 +01:00
Samuel Mannehed 91cd920266 Keep CSS for different input elements together
By moving the CSS for select buttons to the bottom, we keep a more
logical ordering of the elements.
2025-01-23 15:40:52 +01:00
Samuel Mannehed 1c45fd8547 Capitalize CSS section headings
Makes them easier to distinguish from regular comments.
2025-01-23 15:40:52 +01:00
Samuel Mannehed d8199859d3 Support 'disabled' attribute on labels
Note that the :disabled selector only works on inputs, buttons and the
like.

The current method of applying .noVNC_disabled to the settings
labels is still used. This support is added mostly for completeness.

Note that when a label wraps an input, only the label should have the
disabled attribute. Otherwise the effect applies twice to the input.
2025-01-23 15:40:52 +01:00
Samuel Mannehed e092f06d01 Move general :disabled rules to common top section
Start with general stuff, followed by specific things.
2025-01-23 15:40:52 +01:00
Samuel Mannehed ee08032fe7 Put specific :disabled rules with its element
It makes more sense to group rules per element type.
2025-01-23 15:40:52 +01:00
Samuel Mannehed 30d46a00fa Fix :disabled styling of file-selector-button
By applying the rule to the button within the input, we effectively
applied the opacity twice - making the button almost disappear. Applying
the opacity to the input element is enough.
2025-01-23 15:40:52 +01:00
Samuel Mannehed 33a2548fcb Make buttons flat by removing borders
Gives a more clean look that fits well with the new checkboxes and
radios. The old border was mostly used to contribute to a 3d-effect,
that was used for :active. That :active-styling has been replaced by
activation levels.
2025-01-23 15:40:40 +01:00
Samuel Mannehed 017888c9a8 Rework how buttons react to :hover and :active
Instead of having two different types of effects (hover had a different
color, and active had a 3d-effect simulating a pressed button), we now
have an increasing activation-level. That means the button goes a bit
dark for hover, and then even darker when pressed.

There is also a variant that goes lighter for each activation level,
that can be used when the initial color is dark.

With this change, we can get rid of special :hover and :active styling
for the connect button and the control bar buttons. We can use the same
activation level principle for all buttons.
2025-01-23 15:39:19 +01:00
Samuel Mannehed 7fdcc66d2c Add indeterminate styling to checkboxes and radios
This is used when the control is neither checked or unchecked.
2025-01-23 15:39:19 +01:00
Samuel Mannehed 633b4c266d Redesign checkboxes and radiobuttons
Makes them bigger and gets rid of their borders. The change also allowed
for some shared styling between them.
2025-01-23 15:39:19 +01:00
Samuel Mannehed e1208b0939 Redesign select dropdown arrow
Makes it more of a "V"-shape rather than a triangle, suits better in the
new spacier select-buttons.
2025-01-23 15:39:19 +01:00
Samuel Mannehed 3f29c9d993 Differentiate buttons from text inputs
By making buttons grey with bold text, they are easy to distinguish from
text inputs.
2025-01-23 15:39:19 +01:00
Samuel Mannehed e9b48ae409 Get rid of gradients on buttons and inputs
Lets make things more flat and modern.
2025-01-23 15:39:19 +01:00
Samuel Mannehed ca270efcc3 Standardize on 6px or 12px border-radius
This results in a few things becoming slighly more rounded, for example
the controlbar, the settings panel and buttons/inputs. Increased
rounding gives a more friendly feel.
2025-01-23 15:38:57 +01:00
Samuel Mannehed 7603ced54e Create CSS variables for common noVNC-colors 2025-01-13 08:32:19 +01:00
Samuel Mannehed 72cac2ef6a Add margin between label and input in noVNC_panel
To make stuff feel less cramped, lets add some margin here.

As of comitting this, it only affects the logging-level select dropdown
in the settings, but this is a general rule of thumb. It doesn't apply
to checkboxes or radios since they have a margin by default, and their
label to the left.
2025-01-11 23:20:33 +01:00
Samuel Mannehed bf245da7b7 Increase padding of buttons and inputs
Gives them a more modern and spacious look.
2025-01-11 23:02:37 +01:00
Samuel Mannehed 4bbed1dc12 Standardize on 4 space-indentation in CSS files
This is what we use in every other file in noVNC. It also much more
common for a CSS file in general. By standardizing on 4 spaces we can
avoid indentation mistakes.
2025-01-11 17:51:02 +01:00
NNN1590 52392ec150
Update Japanese translation 2024-12-14 15:59:01 +09:00
Pierre Ossman 7335bb440d Also adjust to "sentence case" in translations
This would have resolved itself automatically on the next translation
update, but this commit will reduce unnecessary noise in that change.
2024-11-27 16:04:18 +01:00
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
dim5x 88a5a59629 Fix typos in Russian translation 2024-11-02 04:38:57 +03:00
Pierre Ossman ed1fef4fc3 Merge branch 'ui_init' of github.com:CendioOssman/noVNC 2024-10-09 13:12:33 +02:00
Pierre Ossman 438e5b3608 Make it easier for downstream to modify settings
Expose a simple and stable API to override default settings, and force
settings that users shouldn't be able to change.
2024-10-03 16:08:53 +02:00
Pierre Ossman bbb6a5b938 Fix host and port via query string
We need to call initSetting() even if we don't have any interesting
default to set, as that is what checks if values have been provided as a
query string.

Fixes 96c76f7.
2024-08-19 14:01:00 +02:00
Pierre Ossman 84897fd110 Handle disabling settings without label 2024-08-08 15:59:59 +02:00
Pierre Ossman c6606a5caf Merge UI startup in to a single routine
Makes it easier to see how things are connected.
2024-08-08 15:59:58 +02:00
Pierre Ossman 9334c68241 Handle all settings via UI.getSetting()
Makes sure everything behaves the same way, even if there is no visible
UI for a settings.
2024-08-08 15:00:48 +02:00
Pierre Ossman 96c76f7709 Allow relative WebSocket URLs
This can be very useful if you have multiple instances of noVNC, and you
want to redirect them to different VNC servers.

The new default settings will have the same behaviour as before for
systems where noVNC is deployed in the root web folder.
2024-08-08 14:53:42 +02:00
Pierre Ossman 074fa1a40f Let browser construct URL string for us
Likely a lot safer for corner cases than us trying to figure this out
ourselves.
2024-08-08 14:40:04 +02:00
Pierre Ossman aaadec4f13 Update json files for new translations 2024-06-18 14:03:30 +02:00
Pierre Ossman 7f364a173d Update Swedish translation 2024-06-18 14:02:34 +02:00
Pierre Ossman 1a62eb7d3e Don't include missing translation in .js
It just adds size and confusion. Instead, omit any lines where no
translation is available.
2024-06-18 14:01:40 +02:00
Samuel Mannehed e75938bebc Make non-HTTPS message more harsh
As browsers are placing more and more new functionality as
secure-context only, we need to prepare users for more problems. I find
it likely that we will disable non-HTTPS connections in the future.
2024-02-02 16:51:21 +01:00
Pierre Ossman 9ac632deee Handle immediate connection errors
The browser might throw an exception right away if there is something it
doesn't like with our connect attempt. E.g. using a non-TLS WebSocket
from a TLS web page.
2023-12-05 11:30:30 +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 a565ae559f Merge branches 'l10n' and 'fragment' of github.com:CendioOssman/noVNC 2023-05-10 13:23:34 +02:00
Pierre Ossman 0374b4c0fc Handle translation loading in translation class
Let's try to keep as much as possible of the translation handling in a
single place for clarity.
2023-05-10 13:11:51 +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 a4453c9a26 Special case English translation fallback
We should not be listing this in LINGUAS as that gives the impression
that English has en explicit translation. Instead, it is a special case
that the code needs to be explicitly aware of.

This reverts 9a06058 in favour of a more robust fix.
2023-04-05 12:46:17 +02:00
Mathis Marcotte 9a06058f66 Added english to list of supported languages 2023-03-27 14:23:09 +00:00
Samuel Mannehed 8decca7353 Use unitless numbers for line-height values
Using <length> type values for line-height can give unexpected
inheritance behaviors. If using <length> values, the inherited
line-height on children is calculated using the font-size of the parent.
What we want is for the line-height of children to be calculated using
it's own font-size.

By instead using a unitless number, we get the behavior we want. Note
that this bug has no effects right now since no children to any of the
related elements have different font-sizes.
2023-03-23 11:06:03 +01:00
Samuel Mannehed 4558104196 Properly center the checkbox checkmark
Using a flexbox we can easily center the checkmark without using hard
coded positions.
2023-03-23 11:06:03 +01:00
Pierre Ossman 51677f5c70 Update json files for new translations 2023-01-20 13:57:20 +01:00
Samuel Mannehed 5b7d2a622e Fix positioning of checkbox checkmark
Changing the ::after element to be displayed as 'block' lets it be
positioned using relative. This means we can remove the confusing
"position: relative" from the checkbox.
2023-01-02 14:46:33 +01:00
Pierre Ossman 022fc8c374 Improve whitespace handling in translations
The HTML source will include line breaks and indentation that is only
for source formatting, and will not be displayed.
2022-12-27 15:39:11 +01:00
Pierre Ossman 5de478d6e7 Restrict forced panning to known bad platforms
Let's not punish systems that implement overlay scrollbars in a
functional way. The only current example is Firefox on Windows 11 and on
Linux.
2022-12-27 12:50:57 +01:00