adding style, implementing more UI hooks

pull/3/head
cTn 11 years ago
parent 3304bcf6f3
commit cf4151c3a2

@ -1,7 +1,48 @@
<style type="text/css">
.tab-firmware_flasher .info {
margin: 0 0 10px 0;
}
a.load_file {
display: block;
float: left;
padding: 0 10px 0 10px;
height: 20px;
line-height: 20px;
text-align: center;
font-weight: bold;
border: 1px solid silver;
background-color: #ececec;
}
a.load_file:hover {
background-color: #dedcdc;
}
a.flash_firmware {
display: block;
float: left;
margin: 0 0 0 10px;
padding: 0 10px 0 10px;
height: 20px;
line-height: 20px;
text-align: center;
font-weight: bold;
border: 1px solid silver;
background-color: #ececec;
}
a.flash_firmware:hover {
background-color: #dedcdc;
}
</style>
<div class="tab-firmware_flasher">
<div class="info">
<span>Path:</span><span class="path"></span><br />
<span>Size:</span><span class="size"></span>
</div>
<a class="load_file" href="#">Load Firmware</a>
<a class="flash_firmware" href="#">Flash Firmware</a>
</div>

@ -17,6 +17,7 @@ function tab_initialize_firmware_flasher() {
chrome.fileSystem.getDisplayPath(fileEntry, function(path) {
console.log('Loading file from: ' + path);
$('span.path').html(path);
fileEntry.file(function(file) {
var reader = new FileReader();
@ -30,6 +31,8 @@ function tab_initialize_firmware_flasher() {
intel_hex = e.target.result;
raw_hex = read_hex_file(intel_hex);
$('span.size').html((raw_hex.length / 1000) + ' kB');
};
reader.readAsText(file);
@ -37,5 +40,11 @@ function tab_initialize_firmware_flasher() {
});
});
});
$('a.flash_firmware').click(function() {
if (raw_hex != false) {
}
});
});
}
Loading…
Cancel
Save