Merge pull request #34 from DeionSi/update-packages
Update packages and many small fixes
This commit is contained in:
commit
98e7d7252a
|
@ -2346,12 +2346,7 @@ input, select, textarea {
|
||||||
}
|
}
|
||||||
|
|
||||||
select {
|
select {
|
||||||
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' preserveAspectRatio='none' viewBox='0 0 40 40'%3E%3Cpath d='M9.4,12.3l10.4,10.4l10.4-10.4c0.2-0.2,0.5-0.4,0.9-0.4c0.3,0,0.6,0.1,0.9,0.4l3.3,3.3c0.2,0.2,0.4,0.5,0.4,0.9 c0,0.4-0.1,0.6-0.4,0.9L20.7,31.9c-0.2,0.2-0.5,0.4-0.9,0.4c-0.3,0-0.6-0.1-0.9-0.4L4.3,17.3c-0.2-0.2-0.4-0.5-0.4-0.9 c0-0.4,0.1-0.6,0.4-0.9l3.3-3.3c0.2-0.2,0.5-0.4,0.9-0.4S9.1,12.1,9.4,12.3z' fill='rgba(255, 255, 255, 0.15)' /%3E%3C/svg%3E");
|
|
||||||
background-size: 1.25rem;
|
|
||||||
background-repeat: no-repeat;
|
|
||||||
background-position: calc(100% - 1rem) center;
|
|
||||||
height: 20.75em;
|
height: 20.75em;
|
||||||
padding-right: 2.75em;
|
|
||||||
padding-top: 0.75em;
|
padding-top: 0.75em;
|
||||||
padding-bottom: 0.75em;
|
padding-bottom: 0.75em;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
|
@ -2359,7 +2354,7 @@ input, select, textarea {
|
||||||
|
|
||||||
select option {
|
select option {
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
background: #312450;
|
background: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
select:focus::-ms-value {
|
select:focus::-ms-value {
|
||||||
|
@ -2375,13 +2370,6 @@ input, select, textarea {
|
||||||
background: #022b3a;
|
background: #022b3a;
|
||||||
}
|
}
|
||||||
|
|
||||||
.select5 option {
|
|
||||||
color: #ffffff;
|
|
||||||
background: #022b3a;
|
|
||||||
padding-top: 4px;
|
|
||||||
padding-left: 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.select1 {
|
.select1 {
|
||||||
height: 1.75em;
|
height: 1.75em;
|
||||||
width: 12em;
|
width: 12em;
|
||||||
|
@ -3221,40 +3209,20 @@ input, select, textarea {
|
||||||
|
|
||||||
/* Wrapper */
|
/* Wrapper */
|
||||||
|
|
||||||
|
div.wrapper {
|
||||||
|
padding-top: 3.5em;
|
||||||
|
}
|
||||||
|
|
||||||
.wrapper {
|
.wrapper {
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wrapper > .inner {
|
.wrapper > .inner {
|
||||||
padding: 5em 5em 3em 5em ;
|
padding: 1em 3em;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
width: 75em;
|
width: 75em;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (max-width: 1680px) {
|
|
||||||
|
|
||||||
.wrapper > .inner {
|
|
||||||
padding: 4em 4em 2em 4em ;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@media screen and (max-width: 1280px) {
|
|
||||||
|
|
||||||
.wrapper > .inner {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@media screen and (max-width: 736px) {
|
|
||||||
|
|
||||||
.wrapper > .inner {
|
|
||||||
padding: 3em 2em 1em 2em ;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.wrapper.alt {
|
.wrapper.alt {
|
||||||
background-color: #261c3e;
|
background-color: #261c3e;
|
||||||
}
|
}
|
||||||
|
@ -3898,33 +3866,13 @@ input, select, textarea {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (max-width: 736px) {
|
|
||||||
|
|
||||||
#sidebar {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Sponsor bar */
|
/* Sponsor bar */
|
||||||
#sponsor {
|
#sponsor {
|
||||||
padding: 2.5em 2.5em 0.5em 2.5em ;
|
|
||||||
background: #EE6C4D;
|
background: #EE6C4D;
|
||||||
color: #FFFFFF;
|
color: #FFFFFF;
|
||||||
cursor: default;
|
cursor: default;
|
||||||
height: 7em;
|
|
||||||
height: 0;
|
|
||||||
left: 0;
|
|
||||||
overflow-x: auto;
|
|
||||||
overflow-y: auto;
|
|
||||||
position: relative;
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
top: 3.5em;
|
|
||||||
width: 18em;
|
|
||||||
z-index: 10000;
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 0;
|
|
||||||
line-height: 3.5em;
|
|
||||||
transition-property:height;
|
transition-property:height;
|
||||||
transition-duration:1s;
|
transition-duration:1s;
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -19,10 +19,6 @@
|
||||||
xsmall: [ null, '480px' ]
|
xsmall: [ null, '480px' ]
|
||||||
});
|
});
|
||||||
|
|
||||||
// Hack: Enable IE flexbox workarounds.
|
|
||||||
if (browser.name == 'ie')
|
|
||||||
$body.addClass('is-ie');
|
|
||||||
|
|
||||||
// Play initial animations on page load.
|
// Play initial animations on page load.
|
||||||
$window.on('load', function() {
|
$window.on('load', function() {
|
||||||
window.setTimeout(function() {
|
window.setTimeout(function() {
|
||||||
|
@ -115,7 +111,7 @@
|
||||||
|
|
||||||
// Scrolly.
|
// Scrolly.
|
||||||
$('.scrolly').scrolly({
|
$('.scrolly').scrolly({
|
||||||
speed: 1000,
|
speed: 200,
|
||||||
offset: function() {
|
offset: function() {
|
||||||
|
|
||||||
// If <=large, >small, and sidebar is present, use its height as the offset.
|
// If <=large, >small, and sidebar is present, use its height as the offset.
|
||||||
|
|
115
index.html
115
index.html
|
@ -11,7 +11,6 @@
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<link rel="stylesheet" href="assets/css/main.css" />
|
<link rel="stylesheet" href="assets/css/main.css" />
|
||||||
|
|
||||||
<script src="renderer.js" ></script>
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
|
@ -21,10 +20,11 @@
|
||||||
<nav>
|
<nav>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="#loader">Choose Firmware</a></li>
|
<li><a href="#loader">Choose Firmware</a></li>
|
||||||
<li><a href="#details">Firmware Details</a></li>
|
<li style="display: none;"><a href="#details">Firmware Details</a></li>
|
||||||
<li><a href="#port">Choose Port</a></li>
|
<li><a href="#port">Choose Port</a></li>
|
||||||
<li><a href="#progress">Progress</a></li>
|
<li><a href="#progress">Progress</a></li>
|
||||||
<li><a href="#basetunes">Base Tunes</a></li>
|
<li><a href="#basetunes">Base Tunes</a></li>
|
||||||
|
<li style="display: none;"><a href="#basetunewarning">Base Tunes</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
|
@ -34,7 +34,7 @@
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
|
|
||||||
<!-- Choose Version -->
|
<!-- Choose Version -->
|
||||||
<section id="loader" class="wrapper style1 fullscreen fade-up" style="height: 100vh;">
|
<section id="loader" class="wrapper style1" style="height: 100vh;">
|
||||||
<div class="inner">
|
<div class="inner">
|
||||||
<div style="display: none; text-align: center;" id="update_text"><a href="" id="update_url" target="_blank">A new version is available. Click here to download</a></div>
|
<div style="display: none; text-align: center;" id="update_text"><a href="" id="update_url" target="_blank">A new version is available. Click here to download</a></div>
|
||||||
<center><img src="assets/speeduino logo_white.png" width="235"/></center>
|
<center><img src="assets/speeduino logo_white.png" width="235"/></center>
|
||||||
|
@ -44,12 +44,12 @@
|
||||||
<span class="icon fa-spinner" style="position: absolute; left: 48%; top: 42%;" id="fwVersionsSpinner"></span>
|
<span class="icon fa-spinner" style="position: absolute; left: 48%; top: 42%;" id="fwVersionsSpinner"></span>
|
||||||
<select name="firmwares" class="select" id="versionsSelect" size="10" width="20" onClick="refreshBasetunes();"></select>
|
<select name="firmwares" class="select" id="versionsSelect" size="10" width="20" onClick="refreshBasetunes();"></select>
|
||||||
<ul class="actions">
|
<ul class="actions">
|
||||||
<li><input type='button' id="btnChoosePort" value="Choose Port" onclick="window.location.href='#port';" /></li>
|
<li><input type='button' id="btnChoosePort" value="Choose Port" /></li>
|
||||||
</ul>
|
</ul>
|
||||||
<p>Other actions:</p>
|
<p>Other actions:</p>
|
||||||
<ul class="actions">
|
<ul class="actions">
|
||||||
<li><input type='button' id="btnDetails" value="View Firmware Notes" onclick="refreshDetails();" /></li>
|
<li><input type='button' id="btnDetails" value="View Firmware Notes" /></li>
|
||||||
<li><input type='button' value="Get Base Tune" id="btnBasetune" onclick="window.location.href='#basetunes';" /></li>
|
<li><input type='button' value="Get Base Tune" id="btnBasetune" /></li>
|
||||||
</ul>
|
</ul>
|
||||||
</p>
|
</p>
|
||||||
<div id="error"></div>
|
<div id="error"></div>
|
||||||
|
@ -58,32 +58,32 @@
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<!-- Firmware details -->
|
<!-- Firmware details -->
|
||||||
<section id="details" class="wrapper style1-alt spotlights" style="display: none; height: 100vh;">
|
<section id="details" class="wrapper style1-alt" style="height: 100vh;">
|
||||||
<div class="inner">
|
<div class="inner">
|
||||||
<h1>Firmware Notes</h1>
|
<h2>Firmware Notes</h2>
|
||||||
|
|
||||||
<div class="features major" >
|
<div class="features major" >
|
||||||
<h2><div id="detailsHeading" style="padding-left: 0.55em;" ></div></h2>
|
<h2><div id="detailsHeading" style="padding-left: 0.55em;" ></div></h2>
|
||||||
<div id="detailsText" style="padding-left: 0.9em; padding-right: 0.9em; overflow-y: scroll; height: 50vh;"></div>
|
<div id="detailsText" style="padding-left: 0.9em; padding-right: 0.9em; overflow-y: scroll; height: 50vh;"></div>
|
||||||
</div>
|
</div>
|
||||||
<ul class="actions">
|
<ul class="actions">
|
||||||
<li><input type='button' value="Get Base Tune" id="btnBasetune" onclick="window.location.href='#basetunes';" /></li>
|
<li><input type='button' value="Get Base Tune" id="btnBasetune" /></li>
|
||||||
<li><input type='button' id="btnDetails" value="Change Version" onclick="window.location.href='#loader';" /></li>
|
<li><input type='button' id="btnLoader" value="Change Version" /></li>
|
||||||
<li><input type='button' id="btnChoosePort" value="Install" onclick="window.location.href='#port';" /></li>
|
<li><input type='button' id="btnChoosePort" value="Install" /></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<!-- Choose Port -->
|
<!-- Choose Port -->
|
||||||
<section id="port" class="wrapper style2 fullscreen fade-up" style="height: 100vh;">
|
<section id="port" class="wrapper style2" style="height: 100vh;">
|
||||||
<div class="inner">
|
<div class="inner">
|
||||||
<h1>Select Serial Port</h1>
|
<h2>Select Serial Port</h2>
|
||||||
<p>Available Ports:
|
<p>Available Ports:
|
||||||
<select name="ports" class="select" id="portsSelect" size="10" width="20"></select>
|
<select name="ports" class="select" id="portsSelect" size="10" width="20"></select>
|
||||||
<ul class="actions">
|
<ul class="actions">
|
||||||
<!-- <li><input type='button' value="Install Serial Drivers" onclick="installDrivers();" /></li> -->
|
<!-- <li><input type='button' value="Install Serial Drivers" onclick="installDrivers();" /></li> -->
|
||||||
<li><input type='button' value="Refresh" onclick="refreshSerialPorts();" /></li>
|
<li><input type='button' value="Refresh" onclick="refreshSerialPorts();" /></li>
|
||||||
<li><input type='button' value="Upload" id="btnInstall" onclick="uploadFW();" /></li>
|
<li><input type='button' value="Upload" id="btnInstall" /></li>
|
||||||
</ul>
|
</ul>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
@ -92,22 +92,30 @@
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<!-- Progress -->
|
<!-- Progress -->
|
||||||
<section id="progress" class="wrapper style3 fade-up" style="height: 100vh;">
|
<section id="progress" class="wrapper style3" style="height: 100vh;">
|
||||||
<!-- Sponsor bar -->
|
|
||||||
|
<!-- Sponsor bar -->
|
||||||
|
<div class="features" id="sponsorbox" style="display: none;">
|
||||||
<section id="sponsor">
|
<section id="sponsor">
|
||||||
<div class="inner">
|
<span class="icon major fa-heart"></span>
|
||||||
<p><center><a href="https://github.com/sponsors/noisymime" target="_blank">Speeduino is a volunteer run project. Click here if you're interested in supporting Speeduino's development</a><br /><span class="icon major fa-heart"></span></center></p>
|
<p><center>
|
||||||
</div>
|
<a href="https://github.com/sponsors/noisymime" target="_blank">Speeduino is a volunteer run project. Click here if you're interested in supporting Speeduino's development</a>
|
||||||
|
</center>
|
||||||
|
</p>
|
||||||
</section>
|
</section>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="inner">
|
<div class="inner">
|
||||||
|
|
||||||
<h2>Progress</h2>
|
<h2>Progress</h2>
|
||||||
|
|
||||||
<div class="features">
|
<div class="features">
|
||||||
<section>
|
<section>
|
||||||
<span class="icon major fa-pause" id="progressSpinner"></span>
|
<span class="icon major fa-pause" id="progressSpinner"></span>
|
||||||
<p>
|
<p>
|
||||||
<strong>Current Status:</strong>
|
<strong>Current Status:</strong>
|
||||||
<span id="statusText"></span><span id="burnPercent"></span><br />
|
<span id="statusText"></span><span id="burnPercent"></span><br />
|
||||||
<span id="iniFileText" style="display: none;">TunerStudio definition file: <a id="iniFileLink" onClick="openFileMgr();" ><span id="iniFileLocation"></span></a></span></span>
|
<span id="iniFileText" style="display: none;">TunerStudio definition file: <a id="iniFileLink"><span id="iniFileLocation"></span></a></span></span>
|
||||||
</p>
|
</p>
|
||||||
</section>
|
</section>
|
||||||
<section id="terminalSection" style="display: none;">
|
<section id="terminalSection" style="display: none;">
|
||||||
|
@ -117,36 +125,20 @@
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
<ul class="actions">
|
<ul class="actions">
|
||||||
<li><input type='button' id="btnChoosePort" value="Choose Port" onclick="window.location.href='#port';" /></li>
|
<li><input type='button' id="btnChoosePort" value="Choose Port" /></li>
|
||||||
<li><input type='button' value="Burn again" id="btnReinstall" onclick="uploadFW();" /></li>
|
<li><input type='button' value="Burn again" id="btnReinstall" /></li>
|
||||||
<li><input type='button' value="Get Base Tune" id="btnBasetune" onclick="window.location.href='#basetunes';" /></li>
|
<li><input type='button' value="Get Base Tune" id="btnBasetune" /></li>
|
||||||
</ul>
|
</ul>
|
||||||
<ul class="actions">
|
<ul class="actions">
|
||||||
<li><input type='button' value="Exit" id="btnExit" onclick="quit();" /></li>
|
<li><input type='button' value="Exit" id="btnExit" /></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<!-- Firmware details -->
|
|
||||||
<section id="details" class="wrapper style1-alt spotlights" style="display: none; height: 100vh;">
|
|
||||||
<div class="inner">
|
|
||||||
<h1>Firmware Notes</h1>
|
|
||||||
|
|
||||||
<div class="features major" >
|
|
||||||
<h2><div id="detailsHeading" style="padding-left: 0.55em;" ></div></h2>
|
|
||||||
<div id="detailsText" style="padding-left: 0.9em; padding-right: 0.9em; overflow-y: auto; height: 50vh;"></div>
|
|
||||||
</div>
|
|
||||||
<ul class="actions">
|
|
||||||
<li><input type='button' id="btnDetails" value="Change Version" onclick="window.location.href='#loader';" /></li>
|
|
||||||
<li><input type='button' id="btnChoosePort" value="Install" onclick="window.location.href='#port';" /></li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<!-- Base Tune download -->
|
<!-- Base Tune download -->
|
||||||
<section id="basetunes" class="wrapper style4 fullscreen fade-up" style="height: 100vh;">
|
<section id="basetunes" class="wrapper style4" style="height: 100vh;">
|
||||||
<div class="inner">
|
<div class="inner">
|
||||||
<h2 style="margin: 0;">Base Tunes</h1>
|
<h2 style="margin: 0;">Base Tunes</h2>
|
||||||
<p style="font-size: 12px;">
|
<p style="font-size: 12px;">
|
||||||
Tune Author: <select id="basetunesAuthor" class="select1" onChange="refreshBasetunesFilters()" ></select>
|
Tune Author: <select id="basetunesAuthor" class="select1" onChange="refreshBasetunesFilters()" ></select>
|
||||||
Make: <select id="basetunesMake" class="select1" onChange="refreshBasetunesFilters()" ></select>
|
Make: <select id="basetunesMake" class="select1" onChange="refreshBasetunesFilters()" ></select>
|
||||||
|
@ -155,35 +147,62 @@
|
||||||
<p>
|
<p>
|
||||||
Available Tunes
|
Available Tunes
|
||||||
<span class="icon fa-spinner" style="position: absolute; left: 48%; top: 42%;" id="baseTuneSpinner"></span>
|
<span class="icon fa-spinner" style="position: absolute; left: 48%; top: 42%;" id="baseTuneSpinner"></span>
|
||||||
<select name="basetunes" class="select5" id="basetunesSelect" size="10" width="20" onChange="refreshBasetunesDescription()"></select>
|
<select name="basetunes" id="basetunesSelect" size="10" width="20" onChange="refreshBasetunesDescription()"></select>
|
||||||
<div class="features major" >
|
<div class="features major" >
|
||||||
<div id="tuneDetailsText" style="padding-left: 0.9em; padding-right: 0.9em; padding-top: 0.1em; overflow-y: auto; height: 17vh; font-size: 14px;"></div>
|
<div id="tuneDetailsText" style="padding-left: 0.9em; padding-right: 0.9em; padding-top: 0.1em; overflow-y: auto; height: 17vh; font-size: 14px;"></div>
|
||||||
</div>
|
</div>
|
||||||
<ul class="actions">
|
<ul class="actions">
|
||||||
<li><input type='button' id="btnDownloadBasetune" value="Download tune" onclick="showBasetuneWarning();" /></li>
|
<li><input type='button' id="btnDownloadBasetune" value="Download tune" /></li>
|
||||||
<li><input type='button' value="Exit" id="btnExit" onclick="quit();" /></li>
|
<li><input type='button' value="Exit" id="btnExit" /></li>
|
||||||
</ul>
|
</ul>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
</div>
|
<!-- Base tune warning -->
|
||||||
|
<section id="basetunewarning" class="wrapper style5" style="height: 100vh;">
|
||||||
|
<div class="inner">
|
||||||
|
|
||||||
|
<h1 style="text-align: center; width: 100%;">WARNING</h1>
|
||||||
|
<div class="features major">
|
||||||
|
|
||||||
|
<p style="text-align: center; width: 100%;">Base tunes are intended as a starting point ONLY. They will require changes in order to work correctly with your engine!</p>
|
||||||
|
<center><span class="icon fa-exclamation major" id="warningIcon"></span></center>
|
||||||
|
<p style="text-align: center; width: 100%;">Take note of the board that has been used in this tune. If you are not using this board you need to change this setting immediately:</p>
|
||||||
|
<p style="text-align: center; width: 100%;">
|
||||||
|
<span class="icon fa-arrow-right" id="emphasisIcon"></span>
|
||||||
|
<span style="font-weight: bold;" id="tuneBoard"></span>
|
||||||
|
<span class="icon fa-arrow-left" id="emphasisIcon"></span>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<ul class="actions modal">
|
||||||
|
<li><input type='button' id="btnDownloadConfirm" value="Download" onclick="downloadBasetune();" /></li>
|
||||||
|
<li><input type='button' id="btnDownloadCancel" value="Cancel" /></li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Footer -->
|
<!-- Footer -->
|
||||||
<footer id="footer" class="wrapper style1-alt">
|
<footer id="footer" class="wrapper style1-alt">
|
||||||
<div class="inner">
|
<div class="inner">
|
||||||
<ul class="menu">
|
<ul class="menu">
|
||||||
<li>© Josh Stewart. All rights reserved.</li><li>Design: <a href="http://html5up.net">HTML5 UP</a></li><li>Version: 0.0.3</li>
|
<li>© Josh Stewart. All rights reserved.</li><li>Design: <a href="http://html5up.net" target="_blank">HTML5 UP</a></li><li>Version: 0.0.3</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<!-- Scripts -->
|
<!-- Scripts -->
|
||||||
<script>window.$ = window.jQuery = require('./assets/js/jquery.min.js');</script>
|
<script>window.$ = window.jQuery = require('jquery');</script>
|
||||||
<script src="assets/js/jquery.scrollex.min.js"></script>
|
<script src="assets/js/jquery.scrollex.min.js"></script>
|
||||||
<script src="assets/js/jquery.scrolly.min.js"></script>
|
<script src="assets/js/jquery.scrolly.min.js"></script>
|
||||||
<script src="assets/js/skel.min.js"></script>
|
<script src="assets/js/skel.min.js"></script>
|
||||||
|
<script src="assets/js/breakpoints.min.js"></script>
|
||||||
<script src="assets/js/util.js"></script>
|
<script src="assets/js/util.js"></script>
|
||||||
<script src="assets/js/main.js"></script>
|
<script src="assets/js/main.js"></script>
|
||||||
|
<script src="renderer.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
37
main.js
37
main.js
|
@ -1,6 +1,5 @@
|
||||||
const { app, BrowserWindow, ipcMain } = require('electron')
|
const { app, BrowserWindow, ipcMain, shell } = require('electron')
|
||||||
const {download} = require('electron-dl')
|
const {download} = require('electron-dl')
|
||||||
const {spawn} = require('child_process');
|
|
||||||
const {execFile} = require('child_process');
|
const {execFile} = require('child_process');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
@ -23,10 +22,18 @@ function createWindow ()
|
||||||
backgroundColor: '#312450',
|
backgroundColor: '#312450',
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
nodeIntegration: true,
|
nodeIntegration: true,
|
||||||
enableRemoteModule: true,
|
contextIsolation: false,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Open links in external browser
|
||||||
|
win.webContents.setWindowOpenHandler(({ url }) => {
|
||||||
|
if (url.startsWith('https:')) {
|
||||||
|
shell.openExternal(url);
|
||||||
|
}
|
||||||
|
return { action: 'deny' };
|
||||||
|
});
|
||||||
|
|
||||||
// auto hide menu bar (Win, Linux)
|
// auto hide menu bar (Win, Linux)
|
||||||
win.setMenuBarVisibility(false);
|
win.setMenuBarVisibility(false);
|
||||||
win.setAutoHideMenuBar(true);
|
win.setAutoHideMenuBar(true);
|
||||||
|
@ -50,11 +57,6 @@ function createWindow ()
|
||||||
win = null
|
win = null
|
||||||
})
|
})
|
||||||
|
|
||||||
//This forces any links that have a target of _blank to open in a browser rather than Electron window
|
|
||||||
win.webContents.on('new-window', function(e, url) {
|
|
||||||
e.preventDefault();
|
|
||||||
require('electron').shell.openExternal(url);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Required for newer versions of Electron to work with serialport
|
//Required for newer versions of Electron to work with serialport
|
||||||
|
@ -87,7 +89,8 @@ app.on('activate', () => {
|
||||||
ipcMain.on('download', (e, args) => {
|
ipcMain.on('download', (e, args) => {
|
||||||
filename = args.url.substring(args.url.lastIndexOf('/')+1);
|
filename = args.url.substring(args.url.lastIndexOf('/')+1);
|
||||||
dlDir = app.getPath('downloads');
|
dlDir = app.getPath('downloads');
|
||||||
fullFile = dlDir + "/" + filename;
|
const path = require('node:path');
|
||||||
|
fullFile = path.join(dlDir, filename);
|
||||||
|
|
||||||
//Special case for handling the build that is from master. This is ALWAYS downloaded as there's no way of telling when it was last updated.
|
//Special case for handling the build that is from master. This is ALWAYS downloaded as there's no way of telling when it was last updated.
|
||||||
if(filename.includes("master"))
|
if(filename.includes("master"))
|
||||||
|
@ -171,7 +174,6 @@ ipcMain.on('uploadFW', (e, args) => {
|
||||||
var execArgs = ['-v', '-patmega2560', '-C', configName, '-cwiring', '-b 115200', '-P', args.port, '-D', '-U', hexFile];
|
var execArgs = ['-v', '-patmega2560', '-C', configName, '-cwiring', '-b 115200', '-P', args.port, '-D', '-U', hexFile];
|
||||||
|
|
||||||
console.log(executableName);
|
console.log(executableName);
|
||||||
//const child = spawn(executableName, execArgs);
|
|
||||||
const child = execFile(executableName, execArgs);
|
const child = execFile(executableName, execArgs);
|
||||||
|
|
||||||
child.stdout.on('data', (data) => {
|
child.stdout.on('data', (data) => {
|
||||||
|
@ -305,3 +307,18 @@ ipcMain.on('uploadFW', (e, args) => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
ipcMain.handle('getAppVersion', async (e) => {
|
||||||
|
return app.getVersion();
|
||||||
|
});
|
||||||
|
|
||||||
|
ipcMain.handle('quit-app', () => {
|
||||||
|
app.quit();
|
||||||
|
});
|
||||||
|
|
||||||
|
ipcMain.handle('show-ini', (event, location) => {
|
||||||
|
if (location.endsWith('.ini'))
|
||||||
|
{
|
||||||
|
shell.showItemInFolder(location); // This function needs to be executed in main.js to bring file explorer to foreground
|
||||||
|
}
|
||||||
|
});
|
File diff suppressed because it is too large
Load Diff
21
package.json
21
package.json
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"name": "SpeedyLoader",
|
"name": "speedyloader",
|
||||||
"version": "1.5.2",
|
"version": "1.5.2",
|
||||||
"description": "Speeduino universal firmware loader",
|
"description": "Speeduino universal firmware loader",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
|
@ -24,18 +24,17 @@
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/speeduino/SpeedyLoader",
|
"homepage": "https://github.com/speeduino/SpeedyLoader",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"electron": "^11.2.0",
|
"@electron/rebuild": "^3.2.10",
|
||||||
"electron-packager": "^15.2.0",
|
"electron": "^22.0.1",
|
||||||
"electron-rebuild": "^2.3.4"
|
"electron-packager": "^17.1.1"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"electron-dl": "^3.2.1",
|
"@serialport/bindings-cpp": "^10.8.0",
|
||||||
"json5": "^2.2.0",
|
"electron-dl": "^3.5.0",
|
||||||
"marked": "^0.7.0",
|
"jquery": "^3.6.3",
|
||||||
"request": "^2.88.0",
|
"marked": "^4.2.5",
|
||||||
"semver": "^6.1.3",
|
"semver": "^7.3.8",
|
||||||
"serialport": "^9.0.4",
|
"usb": "^2.6.0"
|
||||||
"usb": "^1.6.5"
|
|
||||||
},
|
},
|
||||||
"build": {
|
"build": {
|
||||||
"appId": "SpeedyLoader",
|
"appId": "SpeedyLoader",
|
||||||
|
|
337
renderer.js
337
renderer.js
|
@ -1,8 +1,6 @@
|
||||||
const serialport = require('serialport')
|
const serialport = require('@serialport/bindings-cpp')
|
||||||
const usb = require('usb')
|
const usb = require('usb')
|
||||||
const JSON5 = require('json5')
|
|
||||||
const {ipcRenderer} = require("electron")
|
const {ipcRenderer} = require("electron")
|
||||||
const {remote} = require('electron')
|
|
||||||
const { shell } = require('electron')
|
const { shell } = require('electron')
|
||||||
|
|
||||||
var basetuneList = [];
|
var basetuneList = [];
|
||||||
|
@ -39,17 +37,17 @@ function getTeensyVersion(id)
|
||||||
|
|
||||||
function refreshSerialPorts()
|
function refreshSerialPorts()
|
||||||
{
|
{
|
||||||
serialport.list().then(ports => {
|
serialport.autoDetect().list().then(ports => {
|
||||||
console.log('Serial ports found: ', ports);
|
console.log('Serial ports found: ', ports);
|
||||||
|
|
||||||
if (ports.length === 0) {
|
if (ports.length === 0) {
|
||||||
document.getElementById('serialDetectError').textContent = 'No ports discovered'
|
document.getElementById('serialDetectError').textContent = 'No ports discovered'
|
||||||
}
|
}
|
||||||
|
|
||||||
select = document.getElementById('portsSelect');
|
const select = document.getElementById('portsSelect');
|
||||||
|
|
||||||
//Clear the current options
|
//Clear the current options
|
||||||
for (i = 0; i <= select.options.length; i++)
|
while (select.options.length)
|
||||||
{
|
{
|
||||||
select.remove(0); //Always 0 index (As each time an item is removed, everything shuffles up 1 place)
|
select.remove(0); //Always 0 index (As each time an item is removed, everything shuffles up 1 place)
|
||||||
}
|
}
|
||||||
|
@ -127,35 +125,28 @@ function refreshDetails()
|
||||||
var version = selectElement.options[selectElement.selectedIndex].value;
|
var version = selectElement.options[selectElement.selectedIndex].value;
|
||||||
var url = "https://api.github.com/repos/noisymime/speeduino/releases/tags/" + version;
|
var url = "https://api.github.com/repos/noisymime/speeduino/releases/tags/" + version;
|
||||||
|
|
||||||
|
document.getElementById('detailsText').innerHTML = "";
|
||||||
document.getElementById('detailsHeading').innerHTML = version;
|
document.getElementById('detailsHeading').innerHTML = version;
|
||||||
|
|
||||||
var request = require('request');
|
fetch(url)
|
||||||
const options = {
|
.then((response) => {
|
||||||
url: url,
|
if (response.ok) {
|
||||||
headers: {
|
return response.json();
|
||||||
'User-Agent': 'request'
|
|
||||||
}
|
}
|
||||||
};
|
return Promise.reject(response);
|
||||||
|
})
|
||||||
|
.then((result) => {
|
||||||
|
console.log(result);
|
||||||
|
|
||||||
request.get(options, function (error, response, body) {
|
//Need to convert the Markdown that comes from Github to HTML
|
||||||
if (!error ) {
|
var myMarked = require('marked');
|
||||||
|
document.getElementById('detailsText').innerHTML = myMarked.parse(result.body);
|
||||||
console.log(body);
|
document.getElementById('detailsHeading').innerHTML = version + " - " + result.name;
|
||||||
var result = JSON.parse(body);
|
})
|
||||||
|
.catch((error) => {
|
||||||
// Continue with your processing here.
|
console.log('Could not download details.', error);
|
||||||
textField = document.getElementById('detailsText');
|
|
||||||
|
|
||||||
//Need to convert the Markdown that comes from Github to HTML
|
|
||||||
var myMarked = require('marked');
|
|
||||||
textField.innerHTML = myMarked(result.body);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
//Finally, make the details section visible
|
|
||||||
document.getElementById('details').style.display = "inline";
|
|
||||||
//And jump to it
|
|
||||||
window.location.href = "#details";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function refreshAvailableFirmwares()
|
function refreshAvailableFirmwares()
|
||||||
|
@ -168,61 +159,61 @@ function refreshAvailableFirmwares()
|
||||||
ChoosePortButton.disabled = true;
|
ChoosePortButton.disabled = true;
|
||||||
basetuneButton.disabled = true;
|
basetuneButton.disabled = true;
|
||||||
|
|
||||||
var request = require('request');
|
const select = document.getElementById('versionsSelect');
|
||||||
request.get('https://speeduino.com/fw/versions', {timeout: 20000}, function (error, response, body)
|
|
||||||
{
|
|
||||||
select = document.getElementById('versionsSelect');
|
|
||||||
if (!error && response.statusCode == 200) {
|
|
||||||
|
|
||||||
var lines = body.split('\n');
|
fetch('https://speeduino.com/fw/versions', { signal: AbortSignal.timeout(5000) } )
|
||||||
// Continue with your processing here.
|
.then((response) => {
|
||||||
|
if (response.ok) {
|
||||||
for(var i = 0;i < lines.length;i++)
|
return response.text();
|
||||||
{
|
|
||||||
var newOption = document.createElement('option');
|
|
||||||
newOption.value = lines[i];
|
|
||||||
newOption.innerHTML = lines[i];
|
|
||||||
select.appendChild(newOption);
|
|
||||||
}
|
|
||||||
select.selectedIndex = 0;
|
|
||||||
|
|
||||||
//Remove the loading spinner
|
|
||||||
loadingSpinner = document.getElementById("fwVersionsSpinner");
|
|
||||||
loadingSpinner.style.display = "none";
|
|
||||||
|
|
||||||
refreshBasetunes();
|
|
||||||
|
|
||||||
//Re-enable the buttons
|
|
||||||
DetailsButton.disabled = false;
|
|
||||||
ChoosePortButton.disabled = false;
|
|
||||||
basetuneButton.disabled = false;
|
|
||||||
}
|
}
|
||||||
else if(error)
|
return Promise.reject(response);
|
||||||
|
})
|
||||||
|
.then((result) => {
|
||||||
|
var lines = result.split('\n');
|
||||||
|
// Continue with your processing here.
|
||||||
|
|
||||||
|
for(var i = 0;i < lines.length;i++)
|
||||||
{
|
{
|
||||||
console.log("Error retrieving available firmwares: " + error);
|
|
||||||
var newOption = document.createElement('option');
|
var newOption = document.createElement('option');
|
||||||
if(error.code === 'ETIMEDOUT')
|
newOption.value = lines[i];
|
||||||
{
|
newOption.innerHTML = lines[i];
|
||||||
newOption.value = "Connection timed out";
|
|
||||||
newOption.innerHTML = "Connection timed out";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
newOption.value = "Cannot retrieve firmware list";
|
|
||||||
newOption.innerHTML = "Cannot retrieve firmware list. Check internet connection and restart";
|
|
||||||
}
|
|
||||||
select.appendChild(newOption);
|
select.appendChild(newOption);
|
||||||
|
|
||||||
//Remove the loading spinner
|
|
||||||
loadingSpinner = document.getElementById("fwVersionsSpinner");
|
|
||||||
loadingSpinner.style.display = "none";
|
|
||||||
}
|
}
|
||||||
else if(response.statusCode == 404)
|
select.selectedIndex = 0;
|
||||||
|
|
||||||
|
//Remove the loading spinner
|
||||||
|
loadingSpinner = document.getElementById("fwVersionsSpinner");
|
||||||
|
loadingSpinner.style.display = "none";
|
||||||
|
|
||||||
|
refreshBasetunes();
|
||||||
|
|
||||||
|
//Re-enable the buttons
|
||||||
|
DetailsButton.disabled = false;
|
||||||
|
ChoosePortButton.disabled = false;
|
||||||
|
basetuneButton.disabled = false;
|
||||||
|
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.log("Error retrieving available firmwares. ", error);
|
||||||
|
|
||||||
|
var newOption = document.createElement('option');
|
||||||
|
if(error.code === 'ETIMEDOUT')
|
||||||
{
|
{
|
||||||
|
newOption.value = "Connection timed out";
|
||||||
|
newOption.innerHTML = "Connection timed out";
|
||||||
}
|
}
|
||||||
}
|
else
|
||||||
);
|
{
|
||||||
|
newOption.value = "Cannot retrieve firmware list";
|
||||||
|
newOption.innerHTML = "Cannot retrieve firmware list. Check internet connection and restart";
|
||||||
|
}
|
||||||
|
select.appendChild(newOption);
|
||||||
|
|
||||||
|
//Remove the loading spinner
|
||||||
|
loadingSpinner = document.getElementById("fwVersionsSpinner");
|
||||||
|
loadingSpinner.style.display = "none";
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function refreshBasetunes()
|
function refreshBasetunes()
|
||||||
|
@ -235,26 +226,27 @@ function refreshBasetunes()
|
||||||
//var url = "https://speeduino.com/fw/basetunes.json";
|
//var url = "https://speeduino.com/fw/basetunes.json";
|
||||||
var url = "https://github.com/speeduino/Tunes/raw/main/index.json";
|
var url = "https://github.com/speeduino/Tunes/raw/main/index.json";
|
||||||
|
|
||||||
var request = require('request');
|
fetch(url)
|
||||||
const options = {
|
.then((response) => {
|
||||||
url: url,
|
if (response.ok) {
|
||||||
headers: {
|
return response.json();
|
||||||
'User-Agent': 'request'
|
|
||||||
}
|
}
|
||||||
};
|
return Promise.reject(response);
|
||||||
|
})
|
||||||
|
.then((result) => {
|
||||||
|
|
||||||
request.get(options, function (error, response, body) {
|
basetuneList = result;
|
||||||
if (!error )
|
|
||||||
{
|
|
||||||
basetuneList = JSON5.parse(body);
|
|
||||||
|
|
||||||
//Remove the loading spinner
|
//Remove the loading spinner
|
||||||
loadingSpinner = document.getElementById("baseTuneSpinner");
|
loadingSpinner = document.getElementById("baseTuneSpinner");
|
||||||
loadingSpinner.style.display = "none";
|
loadingSpinner.style.display = "none";
|
||||||
|
|
||||||
refreshBasetunes();
|
refreshBasetunes();
|
||||||
}
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.log('Could not download base tune list.', error);
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -325,7 +317,7 @@ function refreshBasetunes()
|
||||||
function refreshBasetunesFilters()
|
function refreshBasetunesFilters()
|
||||||
{
|
{
|
||||||
//Get the display list object
|
//Get the display list object
|
||||||
var select = document.getElementById('basetunesSelect');
|
const select = document.getElementById('basetunesSelect');
|
||||||
|
|
||||||
//Get the currently selected Author
|
//Get the currently selected Author
|
||||||
selectElement = document.getElementById('basetunesAuthor');
|
selectElement = document.getElementById('basetunesAuthor');
|
||||||
|
@ -361,7 +353,6 @@ function refreshBasetunesFilters()
|
||||||
//console.log("Tune url: " + url);
|
//console.log("Tune url: " + url);
|
||||||
//console.log("Found a valid tune: " + basetuneList[tune].displayName);
|
//console.log("Found a valid tune: " + basetuneList[tune].displayName);
|
||||||
var newOption = document.createElement('option');
|
var newOption = document.createElement('option');
|
||||||
newOption.style.background = "#022b3a";
|
|
||||||
newOption.dataset.filename = basetuneList[tune].filename;
|
newOption.dataset.filename = basetuneList[tune].filename;
|
||||||
newOption.dataset.make = basetuneList[tune].make;
|
newOption.dataset.make = basetuneList[tune].make;
|
||||||
newOption.dataset.description = basetuneList[tune].description;
|
newOption.dataset.description = basetuneList[tune].description;
|
||||||
|
@ -439,38 +430,6 @@ function downloadIni()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function showBasetuneWarning()
|
|
||||||
{
|
|
||||||
let mainWindow = remote.BrowserWindow.getFocusedWindow();
|
|
||||||
warningWindow = new remote.BrowserWindow({ width: 550, height: 380, modal: true, parent: mainWindow, show: false })
|
|
||||||
|
|
||||||
var select = document.getElementById('basetunesSelect');
|
|
||||||
selectedTune = select.options[select.selectedIndex];
|
|
||||||
|
|
||||||
// auto hide menu bar (Win, Linux)
|
|
||||||
warningWindow.setMenuBarVisibility(false);
|
|
||||||
warningWindow.setAutoHideMenuBar(true);
|
|
||||||
|
|
||||||
// remove completely when app is packaged (Win, Linux)
|
|
||||||
if (remote.app.isPackaged) {
|
|
||||||
warningWindow.removeMenu();
|
|
||||||
}
|
|
||||||
|
|
||||||
board = selectedTune.dataset.board
|
|
||||||
warningWindow.loadURL(`file://${__dirname}/warning.html?board=` + board);
|
|
||||||
|
|
||||||
warningWindow.once('ready-to-show', () => {
|
|
||||||
warningWindow.show();
|
|
||||||
})
|
|
||||||
|
|
||||||
warningWindow.on('close', () => {
|
|
||||||
warningWindow = null;
|
|
||||||
downloadBasetune();
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function downloadBasetune()
|
function downloadBasetune()
|
||||||
{
|
{
|
||||||
console.log("downloading");
|
console.log("downloading");
|
||||||
|
@ -487,6 +446,9 @@ function downloadBasetune()
|
||||||
url: DLurl,
|
url: DLurl,
|
||||||
properties: {directory: "downloads"}
|
properties: {directory: "downloads"}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const baseTuneLink = document.querySelectorAll('a[href="#basetunes"]');
|
||||||
|
baseTuneLink[0].click();
|
||||||
}
|
}
|
||||||
|
|
||||||
//Installing the Windows drivers
|
//Installing the Windows drivers
|
||||||
|
@ -499,8 +461,6 @@ function installDrivers()
|
||||||
|
|
||||||
function uploadFW()
|
function uploadFW()
|
||||||
{
|
{
|
||||||
//Jump to the progress section
|
|
||||||
window.location.href = "#progress";
|
|
||||||
|
|
||||||
//Start the spinner
|
//Start the spinner
|
||||||
var spinner = document.getElementById('progressSpinner');
|
var spinner = document.getElementById('progressSpinner');
|
||||||
|
@ -549,7 +509,7 @@ function uploadFW()
|
||||||
console.log("Using port: " + uploadPort);
|
console.log("Using port: " + uploadPort);
|
||||||
|
|
||||||
//Show the sponsor banner
|
//Show the sponsor banner
|
||||||
document.getElementById('sponsor').style.height = "7em"
|
document.getElementById('sponsorbox').style.display = "block"
|
||||||
|
|
||||||
//Begin the upload
|
//Begin the upload
|
||||||
if(uploadBoard.includes("TEENSY"))
|
if(uploadBoard.includes("TEENSY"))
|
||||||
|
@ -593,7 +553,7 @@ function uploadFW()
|
||||||
statusText.innerHTML = "Upload to Speeduino failed";
|
statusText.innerHTML = "Upload to Speeduino failed";
|
||||||
|
|
||||||
//Hide the donation bar as it makes the terminal go offscreen
|
//Hide the donation bar as it makes the terminal go offscreen
|
||||||
document.getElementById('sponsor').style.height = 0;
|
document.getElementById('sponsorbox').style.display = "none"
|
||||||
|
|
||||||
//Mke the terminal/error section visible
|
//Mke the terminal/error section visible
|
||||||
document.getElementById('terminalSection').style.display = "block";
|
document.getElementById('terminalSection').style.display = "block";
|
||||||
|
@ -609,59 +569,43 @@ function uploadFW()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Opens a native file manager window at the location of the downloaded ini file
|
async function checkForUpdates()
|
||||||
function openFileMgr()
|
|
||||||
{
|
{
|
||||||
var location = document.getElementById('iniFileLocation').innerHTML
|
//Adds the current version number to the Titlebar
|
||||||
if (location != "")
|
let current_version = await ipcRenderer.invoke("getAppVersion");
|
||||||
{
|
document.getElementById('title').innerHTML = "Speeduino Universal Firmware Loader (v" + current_version + ")"
|
||||||
shell.showItemInFolder(location);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function quit()
|
|
||||||
{
|
|
||||||
let w = remote.getCurrentWindow();
|
|
||||||
w.close();
|
|
||||||
}
|
|
||||||
|
|
||||||
function checkForUpdates()
|
|
||||||
{
|
|
||||||
var url = "https://api.github.com/repos/speeduino/SpeedyLoader/releases/latest";
|
var url = "https://api.github.com/repos/speeduino/SpeedyLoader/releases/latest";
|
||||||
|
|
||||||
//document.getElementById('detailsHeading').innerHTML = version;
|
//document.getElementById('detailsHeading').innerHTML = version;
|
||||||
|
|
||||||
var request = require('request');
|
|
||||||
const options = {
|
|
||||||
url: url,
|
|
||||||
headers: {
|
|
||||||
'User-Agent': 'request'
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
request.get(options, function (error, response, body) {
|
fetch(url)
|
||||||
if (!error )
|
.then((response) => {
|
||||||
|
if (response.ok) {
|
||||||
|
return response.json();
|
||||||
|
}
|
||||||
|
return Promise.reject(response);
|
||||||
|
})
|
||||||
|
.then((result) => {
|
||||||
|
|
||||||
|
latest_version = result.tag_name.substring(1);
|
||||||
|
console.log("Latest version: " + latest_version);
|
||||||
|
|
||||||
|
var semver = require('semver');
|
||||||
|
if(semver.gt(latest_version, current_version))
|
||||||
{
|
{
|
||||||
var result = JSON.parse(body);
|
//New version has been found
|
||||||
latest_version = result.tag_name.substring(1);
|
document.getElementById('update_url').setAttribute("href", result.html_url);
|
||||||
console.log("Latest version: " + latest_version);
|
document.getElementById('update_text').style.display = "block";
|
||||||
|
|
||||||
var semver = require('semver');
|
|
||||||
if(semver.gt(latest_version, remote.app.getVersion()))
|
|
||||||
{
|
|
||||||
//New version has been found
|
|
||||||
document.getElementById('update_url').setAttribute("href", result.html_url);
|
|
||||||
document.getElementById('update_text').style.display = "block";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.log('Could not get latest version.', error);
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
window.onload = function () {
|
window.onload = function () {
|
||||||
//Adds the current version number to the Titlebar
|
|
||||||
document.getElementById('title').innerHTML = "Speeduino Universal Firmware Loader (v" + remote.app.getVersion() + ")"
|
|
||||||
|
|
||||||
refreshAvailableFirmwares();
|
refreshAvailableFirmwares();
|
||||||
refreshBasetunes();
|
refreshBasetunes();
|
||||||
refreshSerialPorts();
|
refreshSerialPorts();
|
||||||
|
@ -669,3 +613,58 @@ window.onload = function () {
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$(function(){
|
||||||
|
|
||||||
|
// Button handlers
|
||||||
|
$(document).on('click', '#btnChoosePort', function(event) {
|
||||||
|
$("[href='#port']").trigger('click');
|
||||||
|
});
|
||||||
|
|
||||||
|
$(document).on('click', '#btnBasetune', function(event) {
|
||||||
|
$("[href='#basetunes']").trigger('click');
|
||||||
|
});
|
||||||
|
|
||||||
|
$(document).on('click', '#btnLoader', function(event) {
|
||||||
|
$("[href='#loader']").trigger('click');
|
||||||
|
});
|
||||||
|
|
||||||
|
$(document).on('click', '#btnDetails', function(event) {
|
||||||
|
refreshDetails();
|
||||||
|
$("[href='#details']").trigger('click');
|
||||||
|
});
|
||||||
|
|
||||||
|
$(document).on('click', '#btnInstall', function(event) {
|
||||||
|
$("[href='#progress']").trigger('click');
|
||||||
|
uploadFW();
|
||||||
|
});
|
||||||
|
|
||||||
|
$(document).on('click', '#btnReinstall', function(event) {
|
||||||
|
$("[href='#progress']").trigger('click');
|
||||||
|
uploadFW();
|
||||||
|
});
|
||||||
|
|
||||||
|
$(document).on('click', '#btnDownloadBasetune', function(event) {
|
||||||
|
const select = document.getElementById('basetunesSelect');
|
||||||
|
const selectedTune = select.options[select.selectedIndex];
|
||||||
|
document.getElementById("tuneBoard").innerHTML = selectedTune.dataset.board;
|
||||||
|
|
||||||
|
$("[href='#basetunewarning']").trigger('click');
|
||||||
|
});
|
||||||
|
|
||||||
|
$(document).on('click', '#btnDownloadCancel', function(event) {
|
||||||
|
$("[href='#basetunes']").trigger('click');
|
||||||
|
});
|
||||||
|
|
||||||
|
$(document).on('click', '#btnExit', function(event) {
|
||||||
|
ipcRenderer.invoke('quit-app');
|
||||||
|
});
|
||||||
|
|
||||||
|
$(document).on('click', '#iniFileLink', function(event) {
|
||||||
|
var location = document.getElementById('iniFileLocation').innerHTML
|
||||||
|
if (location != "")
|
||||||
|
{
|
||||||
|
ipcRenderer.invoke('show-ini', location);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
35
warning.html
35
warning.html
|
@ -1,35 +0,0 @@
|
||||||
<html>
|
|
||||||
<link rel="stylesheet" href="assets/css/main.css" />
|
|
||||||
<script>
|
|
||||||
function updateBoard()
|
|
||||||
{
|
|
||||||
board = (location.search.split('board=')[1]||'').split('&')[0]
|
|
||||||
document.getElementById("tuneBoard").innerHTML = decodeURI(board);
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<body onload="updateBoard()">
|
|
||||||
|
|
||||||
<!-- Choose Version -->
|
|
||||||
<section id="loader" class="wrapper style5 fullscreen fade-up" style="padding: 0; margin: 0;">
|
|
||||||
|
|
||||||
<!--<h1>Firmware Loader</h1>-->
|
|
||||||
<div class="inner" style="padding: 0; margin: 0;">
|
|
||||||
<p><h1 class="modal" style="margin: 0;">WARNING</h1></p>
|
|
||||||
</div>
|
|
||||||
<div class="features major modal" style="margin-left: 15px; margin-right: 15px; padding-top: 1; padding-bottom: 1; margin-bottom: 8px;">
|
|
||||||
|
|
||||||
<div style="padding-left: .9em; padding-right: 0.9em; overflow-y: auto; ">
|
|
||||||
<p style="margin-bottom: 5;">Base tunes are intended as a starting point ONLY. They will require changes in order to work correctly with your engine</p>
|
|
||||||
<center><span class="icon fa-exclamation major" style="margin: 0; justify-content: center;" id="warningIcon"></span></center>
|
|
||||||
<p >Take note of the board that has been used in this tune. If you are not using this board you will to change this setting immediately: <br /><span class="icon fa-arrow-right" style="margin: 0; justify-content: center;" id="emphasisIcon"></span> <span style="font-weight: bold;" id="tuneBoard"></span> <span class="icon fa-arrow-left" style="margin: 0; justify-content: center;" id="emphasisIcon"></span></p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<ul class="actions modal">
|
|
||||||
<li><input type='button' id="btnDownloadConfirm" value="Download" onclick="window.close();" /></li>
|
|
||||||
</ul>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
Loading…
Reference in New Issue