1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-14 03:49:53 +03:00

Added an new connect button

This commit is contained in:
skaman82 2015-10-23 22:57:55 +02:00
parent d15dbca994
commit d2c14f15ec
5 changed files with 100 additions and 10 deletions

View file

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 18.1.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 141.7 141.7" enable-background="new 0 0 141.7 141.7" xml:space="preserve">
<g>
<g>
<path fill="#FFFFFF" d="M59.1,20.5h9v6.8h-9V20.5z M72.5,27.3h9v-6.8h-9V27.3z M89.4,40h9.2v39.5h-0.1c0,0.7,0.1,1.5,0.1,2.3
c0,18.3-12.5,28.6-27.9,28.6s-27.8-10.4-27.8-28.6c0-0.7,0.1-1.5,0.1-2.3h-0.1V40H52V12.1h37.4V40z M56.5,40h28.5V16.5H56.5V40z
M77.5,74l9.8-9.8c0.7-0.7,0.7-1.8,0-2.5l-3.4-3.4c-0.7-0.7-1.8-0.7-2.5,0l-9.8,9.8l-9.9-9.9c-0.7-0.7-1.8-0.7-2.5,0l-3.4,3.4
c-0.7,0.7-0.7,1.8,0,2.5l9.8,9.9l-9.8,9.8c-0.7,0.7-0.7,1.8,0,2.5l3.4,3.4c0.7,0.7,1.8,0.7,2.5,0l9.8-9.8l9.8,9.8
c0.7,0.7,1.8,0.7,2.5,0l3.4-3.4c0.7-0.7,0.7-1.8,0-2.5L77.5,74z"/>
</g>
<rect x="66.2" y="104.9" fill="#FFFFFF" width="9" height="36.8"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1,015 B

View file

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 18.1.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 141.7 141.7" enable-background="new 0 0 141.7 141.7" xml:space="preserve">
<g>
<g>
<path fill="#FFFFFF" d="M59.1,21.5h9v6.8h-9V21.5z M72.5,28.3h9v-6.8h-9V28.3z M89.4,41h9.2v39.5h-0.1c0,0.7,0.1,1.5,0.1,2.3
c0,18.3-12.5,28.6-27.9,28.6s-27.8-10.4-27.8-28.6c0-0.7,0.1-1.5,0.1-2.3h-0.1V41H52V13.1h37.4V41z M56.5,41h28.5V17.5H56.5V41z"
/>
</g>
<rect x="66.2" y="105.9" fill="#FFFFFF" width="9" height="36.8"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 714 B

View file

@ -41,7 +41,8 @@ $(document).ready(function () {
// lock port select & baud while we are connecting / connected
$('div#port-picker #port, div#port-picker #baud, div#port-picker #delay').prop('disabled', true);
$('div#port-picker a.connect').text(chrome.i18n.getMessage('connecting'));
$('div#port-picker a.connect_state').text(chrome.i18n.getMessage('connecting'));
serial.connect(selected_port, {bitrate: selected_baud}, onOpen);
} else {
@ -69,8 +70,8 @@ $(document).ready(function () {
if (!GUI.auto_connect) $('div#port-picker #baud').prop('disabled', false);
// reset connect / disconnect button
$(this).text(chrome.i18n.getMessage('connect'));
$(this).removeClass('active');
$('div#port-picker a.connect').removeClass('active');
$('div#port-picker a.connect_state').text(chrome.i18n.getMessage('connect'));
// reset active sensor indicators
sensor_status(0);
@ -220,7 +221,7 @@ function onOpen(openInfo) {
console.log('Failed to open serial port');
GUI.log(chrome.i18n.getMessage('serialPortOpenFail'));
$('div#port-picker a.connect').text(chrome.i18n.getMessage('connect'));
$('div#port-picker a.connect_state').text(chrome.i18n.getMessage('connect'));
$('div#port-picker a.connect').removeClass('active');
// unlock port select & baud
@ -233,7 +234,8 @@ function onOpen(openInfo) {
function onConnect() {
GUI.timeout_remove('connecting'); // kill connecting timer
$('div#port-picker a.connect').text(chrome.i18n.getMessage('disconnect')).addClass('active');
$('a.connect_state').text(chrome.i18n.getMessage('disconnect')).addClass('active');
$('div#port-picker a.connect').addClass('active');
$('#tabs ul.mode-disconnected').hide();
$('#tabs ul.mode-connected').show();

View file

@ -811,5 +811,63 @@ dialog {
margin-left:3px;
}
/* END */
/* note */
.connect_contols {
position:absolute;
left:585px;
top:19px;
height:70px;
width:60px;
}
.connect_b {
float:left;
}
.connect_b a {
height:50px;
width:50px;
border-radius:100px;
box-shadow:0px 1px 2px rgba(0, 0, 0, 0.35);
float:left;
margin-left: 5px;
margin-bottom:7px;
}
.connect_b a.connect {
background-color:#e60000;
border:1px solid #fe0000;
background-image:url(images/icons/cf_icon_usb1_white.svg);
background-repeat:no-repeat;
background-size:44px;
background-position:center 6px;
}
.connect_b a.connect.active {
background-color:#56ac1d;
border:1px solid #5bbb1b;
}
.connect_state {
float:left;
height:20px;
width:100%;
text-align:center;
color:#fff;
font-size:12px;
font-family: 'open_sansregular', Arial;
text-shadow:0px 1px rgba(0, 0, 0, 0.25);
}

View file

@ -125,8 +125,10 @@
<input class="auto_connect" type="checkbox" />
<span class="auto_connect" i18n="autoConnect"></span>
</label>
<a class="connect" href="#" i18n="connect" style="color:#FFFFFF;"></a>
<div class="connect_contols">
<div class="connect_b"><a class="connect" href="#"></a></div>
<a class="connect_state" i18n="connect"></a>
</div>
</div>
</div>