Browse Source

Merge pull request #12228 from LameLemon/alt-title

Added alt and title tags for WebUI footer
adaptive-webui-19844
Mike Tzou 5 years ago committed by GitHub
parent
commit
4d99328b8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      src/webui/www/private/index.html
  2. 29
      src/webui/www/private/scripts/client.js

8
src/webui/www/private/index.html

@ -218,13 +218,13 @@
<td class="statusBarSeparator"></td> <td class="statusBarSeparator"></td>
<td id="DHTNodes"></td> <td id="DHTNodes"></td>
<td class="statusBarSeparator"></td> <td class="statusBarSeparator"></td>
<td><img id="connectionStatus" alt="Connection Status" src="images/skin/firewalled.svg" style="height: 1.5em;" /></td> <td><img id="connectionStatus" alt="QBT_TR(Connection status)QBT_TR[CONTEXT=MainWindow]" title="QBT_TR(Connection status)QBT_TR[CONTEXT=MainWindow]" src="images/skin/firewalled.svg" style="height: 1.5em;" /></td>
<td class="statusBarSeparator"></td> <td class="statusBarSeparator"></td>
<td style="cursor:pointer;"><img id="alternativeSpeedLimits" alt="QBT_TR(Alternative speed limits)QBT_TR[CONTEXT=MainWindow]" src="images/slow_off.svg" style="height: 1em;"/></td> <td style="cursor:pointer;"><img id="alternativeSpeedLimits" alt="QBT_TR(Alternative speed limits)QBT_TR[CONTEXT=MainWindow]" title="QBT_TR(Alternative speed limits)QBT_TR[CONTEXT=MainWindow]" src="images/slow_off.svg" style="height: 1em;"/></td>
<td class="statusBarSeparator"></td> <td class="statusBarSeparator"></td>
<td class="speedLabel"><img src="images/skin/download.svg" alt="" style="height: 1.4em; padding-right: 5px; margin-bottom: -4px;"><span id="DlInfos"></span></td> <td class="speedLabel"><img src="images/skin/download.svg" alt="QBT_TR(Download speed icon)QBT_TR[CONTEXT=MainWindow]" style="height: 1.4em; padding-right: 5px; margin-bottom: -4px;"><span id="DlInfos"></span></td>
<td class="statusBarSeparator"></td> <td class="statusBarSeparator"></td>
<td class="speedLabel"><img src="images/skin/seeding.svg" alt="" style="height: 1.4em; padding-right: 5px; margin-bottom: -3px;"><span id="UpInfos"></span></td> <td class="speedLabel"><img src="images/skin/seeding.svg" alt="QBT_TR(Upload speed icon)QBT_TR[CONTEXT=MainWindow]" style="height: 1.4em; padding-right: 5px; margin-bottom: -3px;"><span id="UpInfos"></span></td>
</tr> </tr>
</table> </table>
</div> </div>

29
src/webui/www/private/scripts/client.js

@ -643,12 +643,23 @@ window.addEvent('load', function() {
$('TotalQueuedSize').set('html', window.qBittorrent.Misc.friendlyUnit(serverState.total_queued_size, false)); $('TotalQueuedSize').set('html', window.qBittorrent.Misc.friendlyUnit(serverState.total_queued_size, false));
} }
if (serverState.connection_status == "connected") switch (serverState.connection_status) {
case 'connected': {
$('connectionStatus').src = 'images/skin/connected.svg'; $('connectionStatus').src = 'images/skin/connected.svg';
else if (serverState.connection_status == "firewalled") $('connectionStatus').alt = 'QBT_TR(Connection status: Connected)QBT_TR[CONTEXT=MainWindow]';
}
break;
case 'firewalled': {
$('connectionStatus').src = 'images/skin/firewalled.svg'; $('connectionStatus').src = 'images/skin/firewalled.svg';
else $('connectionStatus').alt = 'QBT_TR(Connection status: Firewalled)QBT_TR[CONTEXT=MainWindow]';
}
break;
default: {
$('connectionStatus').src = 'images/skin/disconnected.svg'; $('connectionStatus').src = 'images/skin/disconnected.svg';
$('connectionStatus').alt = 'QBT_TR(Connection status: Disconnected)QBT_TR[CONTEXT=MainWindow]';
}
break;
}
if (queueing_enabled != serverState.queueing) { if (queueing_enabled != serverState.queueing) {
queueing_enabled = serverState.queueing; queueing_enabled = serverState.queueing;
@ -681,10 +692,14 @@ window.addEvent('load', function() {
}; };
const updateAltSpeedIcon = function(enabled) { const updateAltSpeedIcon = function(enabled) {
if (enabled) if (enabled) {
$('alternativeSpeedLimits').src = "images/slow.svg"; $('alternativeSpeedLimits').src = 'images/slow.svg';
else $('alternativeSpeedLimits').alt = 'QBT_TR(Alternative speed limits: On)QBT_TR[CONTEXT=MainWindow]';
$('alternativeSpeedLimits').src = "images/slow_off.svg"; }
else {
$('alternativeSpeedLimits').src = 'images/slow_off.svg';
$('alternativeSpeedLimits').alt = 'QBT_TR(Alternative speed limits: Off)QBT_TR[CONTEXT=MainWindow]';
}
}; };
$('alternativeSpeedLimits').addEvent('click', function() { $('alternativeSpeedLimits').addEvent('click', function() {

Loading…
Cancel
Save