Skip to content

Commit

Permalink
First prototype for issue #52
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesread committed Jun 12, 2013
1 parent 9ae1585 commit 227fd67
Show file tree
Hide file tree
Showing 3 changed files with 700 additions and 0 deletions.
66 changes: 66 additions & 0 deletions rh6pd-webJsInterface/var/carDamage/carDamage.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<html>
<head>
<title>Car Damage</title>
<style type = "text/css">
div#carContainer {
text-align: center;
}

div.defectSelector {
position: absolute;
background-color: LimeGreen;
border: 1px solid black;
cursor: pointer;
}
</style>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
<script type = "text/javascript">
function defectSelector(x, y, id) {
this.el = $('<div>No Damage</div>');
this.el.css('left', x + 'px');
this.el.css('top', y + 'px');
this.el.addClass('defectSelector')
this.text = "???";

$('div#carContainer').append(this.el);

function click() {
var sel = $(this);

switch (sel.text()) {
case 'Major':
sel.text('None');
sel.css('background-color', 'LimeGreen');
break;
case 'Minor':
sel.text('Major');
sel.css('background-color', 'Salmon');
break;
case 'None':
default:
sel.text('Minor')
sel.css('background-color', 'orange');
}
}

this.el.click(click);
}
</script>
</head>
<body>

<div id = "carContainer">
<img src = "carDamage.png" />
</div>
<script type = "text/javascript">
new defectSelector(150, 200, "bonet");
new defectSelector(600, 200, "door1");
new defectSelector(800, 200, "door1");
new defectSelector(1200, 200, "boot");

new defectSelector(800, 700, "roof");


</script>
</body>
</html>
Binary file added rh6pd-webJsInterface/var/carDamage/carDamage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 227fd67

Please sign in to comment.