Commit Graph

482 Commits

Author SHA1 Message Date
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
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
Pierre Ossman 7f4a9eebc8 Export clipping state externally
So that UI can reflect if it is currently possible to drag the viewport
or not.
2022-12-27 12:50:57 +01:00
Samuel Mannehed 820b39c7d3 Reinstate outer div of noVNC_connect_button
There were two issues with removing the outer div of the connect button.

Firstly, rounded outlines don't work in WebKit browsers like Safari or
Epiphany (https://bugs.webkit.org/show_bug.cgi?id=20807) and this makes
the outline look completely square.

Secondly the code became too complex.

This reverts most of commit 05baf14256.
2022-12-23 13:44:58 +01:00
Samuel Mannehed 2b449b208e Get rid of WebKit's button top margin
It conflicts with our :active styling since it changes margin-top.
2022-12-23 13:44:57 +01:00
Samuel Mannehed 6e1d842850 Use an ICO file for favicons
The browsers have been choosing very poorly and have a lot of bugs when
it comes to favicons. Using an ICO makes many browsers choose better in
most cases. Most large websites use ICO files.

The icons in the ICO file needs to be ordered largest to the smallest
icon, and due to a Chrome bug we are limited to 8 icons. This
unfortunately means we couldn't fit one of the Android sizes. The 72x72
icon was removed since testing showed that it was used the least.
2022-12-23 09:05:12 +01:00
Samuel Mannehed 139f087187 Explicitly specify icon size instead of density
Instead of calculating a density that we hope results in the correct
size, we can specify what size we want. This is more robust and easier
to understand. This also allows us to simplify the Makefile quite a bit.

Note that Fedora's packaging of ImageMagick has a bug here:
https://bugzilla.redhat.com/show_bug.cgi?id=2140018
2022-12-23 09:05:12 +01:00
Samuel Mannehed 416e21151b Create specific apple-touch-icons
These icons shouldn't have any transparancy. Instead, we remove the
rounded corners and let iOS handle that.
2022-12-23 09:05:12 +01:00
Samuel Mannehed 9e9d5ef17d Simplify names of favicons
All of the icons are square, only providing the size in one direction is
enough. This change lets us avoid some unnecessary complexity in the
Makefile.
2022-12-22 16:50:11 +01:00
Samuel Mannehed c8d37ae8bd Provide up to date set of apple-touch-icons
Apple requires a different set of icons now-a-days. This change involves
removing the 76x76 icon and adding icons with the following sizes;
40, 58, 80, 87, 167 and 180.
2022-12-22 13:15:25 +01:00
Samuel Mannehed 9649b8ee25 Remove duplicate 48 icon from Android sizes
This size is already specified under BROWSER_SIZES.
2022-12-22 13:04:03 +01:00
Samuel Mannehed 034fd376ac Simplify icon variables by removing the filename
The filename is the same for all of these, lets break out that part to
simplify things.
2022-12-22 11:29:10 +01:00
Samuel Mannehed 99a9c03f3c Rename browser icon variable to reflect use
The other variables in the Makefile are named according to how the icons
are used, lets do the same for the variable for the browser icons.
2022-12-22 11:13:20 +01:00
Samuel Mannehed ec45911456 Don't show virtual keyboard button in webkit
Webkit browsers don't support Media Queries 4, which means we have to
use a slightly convoluted syntax when writing "@media not...". Otherwise
the "(any-pointer: coarse)" part evaluates as the device part of the
query.
2022-12-22 10:22:34 +01:00
Samuel Mannehed 4fb2d6c497 Add FIXME for virtual keyboard button on touch
The way we decide whether to show the keyboard button or not is not
ideal, let's add a FIXME for that.
2022-12-15 14:33:12 +01:00
Samuel Mannehed d8b3ec99fa Use "initial" for displaying handle touch area
Our intentions are clearer if we set "display" to "initial" rather than
"unset" when we want to enable the touch area for the control bar
handle.
2022-12-15 14:09:56 +01:00
Samuel Mannehed 05baf14256 Remove outer div from noVNC_connect_button
Instead of having an outer "box", we can use an outline on the button
itself to create this "platform". Since the outline isn't part of the
size of the element, it will appear wider than before, when compared to
the logo. To counteract that we remove the left and right padding from
the logo to make the entire noVNC_connect_dlg more narrow.

We also had to slightly adjust the :active style since we don't want the
entire "platform" to move when the button is clicked.
2022-12-15 10:44:27 +01:00
Samuel Mannehed f1550c69d9 Get rid of noVNC_touch in favor for @media queries
This commit removes our dependency on the class "noVNC_touch" which was
set by Javascript. Instead, we can use the CSS media query
"any-pointer: coarse", which means that any pointing device that isn't
accurate is available. In practice this seems to basically be equal to
that a touch screen is available.

This change lets us simplify the selectors in many cases as well, which
is a nice bonus.
2022-12-14 14:06:16 +01:00
Samuel Mannehed 6d7d45ba08 Ensure arrow doesn't change on disabled <select>
We can't just modify the CSS variable here, since that is also used in
the style for :disabled. We need to change the entire "background-image"
in order for :disabled to be able to override it.
2022-12-14 13:58:49 +01:00
Samuel Mannehed f983c78d17 Make connect button a regular <button>
It is a button, let the HTML element reflect that. And instead of
having the outer div being clickable, lets only make the inner one
work like a button. Because of that, this commit renames the outer div
to "connect_box" instead of "connect_button".

Note that we remove the disabled :hover-effect for touch on this button.
It doesn't make much difference since this button is one of a kind.
2022-12-14 13:28:27 +01:00
Samuel Mannehed 1ff035c330 Add comment explaining the handle touch area 2022-12-14 11:18:46 +01:00
Samuel Mannehed 333e075d7b Get rid of Chrome's blue touch tap highlight
When tapping our buttons using a touch screen in Chrome, we get an ugly
blue overlay. Let's remove this since we have our own :active styles.
2022-12-13 15:38:25 +01:00
Samuel Mannehed 6e1eec3025 Separate the disabling of :hover for touch
This is a corner case which shouldn't need to complicate things for the
regular usecases.
2022-12-13 15:23:31 +01:00
Samuel Mannehed 98364c3daa Use the same background gradient on all buttons
Before, we have had two different gradiant versions, one where the two
colors meet in the middle, and one where only the top part of the
element was the darker shade. This was easily missed. Let's standardize
on the latter alternative. This commit introduces a variable to make it
easier.
2022-12-13 14:43:03 +01:00
Samuel Mannehed 837cc75a8c Add FIXME for select:active on Firefox
The :active state is only active in Firefox during the click on the
<select>, not while the dropdown is opened, like in Chrome.
2022-12-13 14:01:24 +01:00
Samuel Mannehed d083ba269e Buttons shouldn't react to clicks when disabled
Counteract the border-width and margin set by :active in the rules for
:disabled buttons.
2022-12-12 15:35:36 +01:00
Samuel Mannehed 69c1d8a1b9 Add section comments to input.css
Makes stuff easier to find.
2022-12-12 15:32:07 +01:00
Samuel Mannehed b676122642 Simplify :focus-visible & :disabled selectors
Since these were the same for all <input> types now, we can omit the
type from the selector.
2022-12-12 15:31:00 +01:00
Samuel Mannehed 9107ae3a10 Share some properties between all input elements
Some properties, like 'font', 'appearance', and 'color' are shared
between all our input elements. Let's reflect that in our rules.
2022-12-12 15:31:00 +01:00
Samuel Mannehed 8c1b6e19c7 Combine rules for buttons in input.css
It was completely unnecessary that these two were separate, lets combine
them. The only difference was that the lower rule didn't apply for
<select>. That doesn't matter though, since padding-left and
padding-right are specifically set for <select> elements anyway.
2022-12-12 15:31:00 +01:00
Samuel Mannehed 3cf2bb9b59 Change arrow direction of active select button
When the select-dropdown is open, let's use an arrow pointing upwards
isntead. Note that we can't easily animate the change in
background-image.
2022-12-12 15:31:00 +01:00
Samuel Mannehed 80897091e0 Put all styling for selected buttons in one place
Let's not have the rules for noVNC_selected spread out.
2022-12-12 15:31:00 +01:00
Samuel Mannehed 36510f7d16 Clarify comment about hover state on touch devices 2022-12-12 15:31:00 +01:00
Samuel Mannehed cc703babcb Remove duplicate opacity for :disable
The control bar buttons can fall back on the :disable opacity from
input.css.
2022-12-12 15:31:00 +01:00
Samuel Mannehed da4f3f30ea Move workaround for Firefox bug to input.css
This applies to all input[type=image]:disabled elements, not only
control bar buttons.
2022-12-12 15:31:00 +01:00
Samuel Mannehed 654066f2c4 Be more specific for control bar button background
Use the more specific background-color, and background-image properties
when setting the state backgrounds for the control bar buttons. This way
we no longer pollute all background related properties. It makes things
easier if we need to replace them in some states in the future.
2022-12-12 15:31:00 +01:00
Samuel Mannehed 4050f0e248 Break out properties for disabled buttons
Instead of marking the hover selector with ":not(:disabled)" we can
break out this into its own section. This makes things easier to read.
In order to ensure the correct selector prioritization we also reorder
the file a bit.
2022-12-12 15:31:00 +01:00
Samuel Mannehed 629a6cacb9 Add styling for input[type=file] elements
The last remaining input element we didn't have styling for (aside from
input[type=hidden] which can't be shown).
2022-12-12 15:30:02 +01:00
Samuel Mannehed 63528570bc Respect standard font settings for buttons as well
This should not only be done for input, select and textareas.
2022-12-12 14:50:14 +01:00