Skip to content

Commit b896668

Browse files
committed
Updated style to make future work easier
The style updates will help with making the app easier to potentially embed it into other sites
1 parent 17f1610 commit b896668

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

static/css/webapp.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,15 @@ body {
5353
border-color: #2D8B89;
5454
}
5555

56-
#image_display {
56+
#image-display {
5757
position: relative;
5858
}
5959

60-
#image_display img {
60+
#image-display img {
6161
max-width: 100%;
6262
}
6363

64-
#img_canvas {
64+
#image-canvas {
6565
position: absolute;
6666
left: 0;
6767
top: 0;

static/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,14 @@ <h1>MAX Object Detector</h1>
4949

5050
<div class="col-md-5">
5151

52-
<div id="file-upload" class="panel panel-default">
52+
<div id="image-upload" class="panel panel-default">
5353

5454
<div class="panel-heading">
5555
<div class="panel-title">Upload A Image</div>
5656
</div>
5757

5858
<div class="panel-body">
59-
<form id="img-upload" enctype="multipart/form-data">
59+
<form id="file-upload" enctype="multipart/form-data">
6060
<div class="form-group">
6161
<input id="file-input" type="file" name="file" accept=".png, .jpg, .jpeg, .gif" />
6262
</div>
@@ -76,7 +76,7 @@ <h1>MAX Object Detector</h1>
7676

7777
<div class="col-md-12">
7878

79-
<div id="image_display">
79+
<div id="image-display">
8080

8181
</div>
8282

static/js/webapp.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020
'use strict';
2121

2222
function render_boxes(boxes) {
23-
var img = $('#user_img');
23+
var img = $('#user-image');
2424
var width = img.width();
2525
var height = img.height();
26-
var can_html = '<canvas id="img_canvas" width="'
26+
var can_html = '<canvas id="image-canvas" width="'
2727
+ width + '" height="' + height + '"></canvas>';
28-
$('#image_display').append(can_html);
28+
$('#image-display').append(can_html);
2929

30-
var ctx = $('#img_canvas')[0].getContext('2d');
30+
var ctx = $('#image-canvas')[0].getContext('2d');
3131
var can = ctx.canvas;
3232
can.width = width;
3333
can.height = height;
@@ -66,7 +66,7 @@ function render_boxes(boxes) {
6666

6767
$(function() {
6868
// Image upload form submit functionality
69-
$('#img-upload').on('submit', function(event){
69+
$('#file-upload').on('submit', function(event){
7070
// Stop form from submitting normally
7171
event.preventDefault();
7272

@@ -79,12 +79,13 @@ $(function() {
7979
var reader = new FileReader();
8080
reader.onload = function(event) {
8181
var file_url = event.target.result;
82-
$('#image_display').html('<img id="user_img" src="' + file_url + '" />');
82+
var img_html = '<img id="user-image" src="' + file_url + '" />';
83+
$('#image-display').html(img_html);
8384
};
8485
reader.readAsDataURL(file);
8586

8687
if ($('#file-input').val() !== '') {
87-
$('#file-submit').text('Working...');
88+
$('#file-submit').text('Detecting...');
8889

8990
// Perform file upload
9091
$.ajax({

0 commit comments

Comments
 (0)