Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion webssh/static/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,17 @@ var wssh = {};
}
}());

const findFont = (src_list, familyName) => {
if (src_list === undefined) {
return undefined;
}
for (font of src_list) {
if (font.family === familyName) {
return font;
}
}
return undefined;
}

jQuery(function($){
var status = $('#status'),
Expand All @@ -46,7 +57,9 @@ jQuery(function($){
title_element = document.querySelector('title'),
form_id = '#connect',
debug = document.querySelector(form_id).noValidate,
custom_font = document.fonts ? document.fonts.values().next().value : undefined,
fonts = document.fonts,
custom_font_family_name = $("body").attr("data-wssh-custom-font-family-name") || "",
custom_font = findFont(fonts, custom_font_family_name),
default_fonts,
DISCONNECTED = 0,
CONNECTING = 1,
Expand Down
2 changes: 1 addition & 1 deletion webssh/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
{% end %}
</style>
</head>
<body>
<body {% if font.family %}data-wssh-custom-font-family-name="{{ font.family }}"{% end %}>
<div id="waiter" style="display: none"> Connecting ... </div>

<div class="container form-container" style="display: none">
Expand Down