Permalink
Browse files

Get the recorder into a working state again.

  • Loading branch information...
1 parent 2c4fba0 commit ca12ca8679246cae7d08787900c96cf2b811a0cd @jeresig jeresig committed Jan 23, 2012
Showing with 25 additions and 33 deletions.
  1. +2 −2 js/canvas.js
  2. +2 −8 js/record-ui.js
  3. +21 −23 record.html
View
@@ -30,14 +30,14 @@ var Canvas = {
mousedown: function( e ) {
// Left mouse button
if ( e.button === 0 ) {
- Canvas.startLine( e.layerX, e.layerY );
+ Canvas.startLine( e.offsetX, e.offsetY );
e.preventDefault();
}
},
mousemove: function( e ) {
- Canvas.drawLine( e.layerX, e.layerY );
+ Canvas.drawLine( e.offsetX, e.offsetY );
},
mouseup: Canvas.endLine
View
@@ -7,7 +7,7 @@ $(function(){
Canvas.init();
// Set up toolbar buttons
- $(".ui-button").buttonize();
+ $(document).buttonize();
// Set up color button handling
$(".toolbar a.color").each(function() {
@@ -130,10 +130,4 @@ $(function(){
});
loadAudio();
-});
-
-Record.handlers.test = function( e ) {
- Record.pausePlayback();
- Canvas.endDraw();
- $("#tests").accordion({ active: e.pos });
-};
+});
View
@@ -16,39 +16,37 @@
</head>
<body>
<div class="toolbar ui-widget-header ui-corner-all">
- <a href="" id="record"><span class="ui-icon-video"></span></a>
- <a href="" id="save" class="ui-state-disabled"><span class="ui-icon-disk"></span></a>
- <div class="space"></div>
- <a href="" id="test" class="ui-state-disabled"><span class="ui-icon-flag"></span></a>
+ <a href="" id="record" class="ui-button">
+ <span class="ui-icon-video"></span>
+ <span class="ui-button-text">Record</span>
+ </a>
+ <a href="" id="save" class="ui-button ui-state-disabled">
+ <span class="ui-icon-disk"></span>
+ <span class="ui-button-text">Save</span>
+ </a>
</div>
<div class="toolbar ui-widget-header ui-corner-all">
- <a href="" id="draw"><span class="ui-icon-pencil"></span></a>
- <a href="" id="clear"><span class="ui-icon-cancel"></span></a>
+ <a href="" id="draw" class="ui-button">
+ <span class="ui-icon-pencil"></span>
+ </a>
+ <a href="" id="clear" class="ui-button">
+ <span class="ui-icon-cancel"></span>
+ </a>
<div class="space"></div>
- <a href="" class="color" id="black"><span></span></a>
- <a href="" class="color" id="red"><span></span></a>
- <a href="" class="color" id="orange"><span></span></a>
- <a href="" class="color" id="green"><span></span></a>
- <a href="" class="color" id="blue"><span></span></a>
- <a href="" class="color" id="lightblue"><span></span></a>
- <a href="" class="color" id="violet"><span></span></a>
+ <a href="" class="ui-button color" id="black"><span></span></a>
+ <a href="" class="ui-button color" id="red"><span></span></a>
+ <a href="" class="ui-button color" id="orange"><span></span></a>
+ <a href="" class="ui-button color" id="green"><span></span></a>
+ <a href="" class="ui-button color" id="blue"><span></span></a>
+ <a href="" class="ui-button color" id="lightblue"><span></span></a>
+ <a href="" class="ui-button color" id="violet"><span></span></a>
</div>
<div id="canvas-editor">
<div id="editor"></div>
<canvas id="canvas" width="640" height="360"></canvas>
<div id="tests"></div>
</div>
<script type="text/html" id="form-tmpl">
- <h3><a href='#'>Exercise</a></h3>
- <div>
- <form action="" method="POST">
- <input type="text" placeholder="Title" name="test" /><br/>
- <textarea name="desc" placeholder="Description"></textarea><br/>
- <textarea name="validate" placeholder="Validation"></textarea>
- </form>
- </div>
- </script>
- <script type="text/html" id="form-tmpl">
<h3><a href='#' class='title'>Exercise</a></h3>
<div>
<p class="desc">Exercise description.</p>

0 comments on commit ca12ca8

Please sign in to comment.