Skip to content

Commit c9b628f

Browse files
author
Michael Bleigh
committed
Updating docs.
1 parent 40d11e1 commit c9b628f

File tree

2 files changed

+59
-2
lines changed

2 files changed

+59
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.DS_Store

index.html

Lines changed: 58 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
<html>
33
<head>
44
<title>Sketch.js - Simple Canvas-based Drawing for jQuery</title>
5-
<link href='http://fonts.googleapis.com/css?family=Yellowtail|Open+Sans:400italic,700italic,400,700' rel='stylesheet' type='text/css'>
65
<script src="http://code.jquery.com/jquery-latest.js"></script>
76
<script src='src/sketch.js'></script>
7+
<link href='http://fonts.googleapis.com/css?family=Yellowtail|Open+Sans:400italic,700italic,400,700' rel='stylesheet' type='text/css'/>
8+
89
<style type='text/css'>
910
body { font-family: "Open Sans", sans-serif; color: #444; }
1011
h1, h2, h3, h4 { font-family: Yellowtail; font-weight: normal; color: #06a; }
@@ -32,6 +33,7 @@
3233

3334
code { background: #cff; }
3435

36+
#colors_tools { margin-bottom: 10px; }
3537
#colors_tools a {
3638
border: 1px solid black; width: 30px; height: 30px; line-height: 30px; vertical-align: middle; text-align: center; text-decoration: none; display: inline-block; color: black; font-weight: bold;
3739
}
@@ -42,9 +44,33 @@
4244
<header>
4345
<h1>Sketch.js</h1>
4446
<p>Sketch.js is an easy-to-use jQuery plugin that allows you to create canvases
45-
upon which visitors can draw.</p>
47+
upon which visitors can draw. The code is partially inspired by <a href='http://www.williammalone.com/articles/create-html5-canvas-javascript-drawing-app/'>William Malone's drawing app tutorial</a>
48+
as well as <a href='http://canvaspaint.org'>CanvasPaint</a>.</p>
4649
</header>
4750

51+
<article class='info'>
52+
<h1>Documentation</h1>
53+
54+
<p>To use Sketch.js you will need to call the <code>.sketch()</code> plugin method
55+
on a single HTML 5 Canvas element.</p>
56+
57+
<pre class='source'>$('#mycanvas').sketch()</pre>
58+
59+
<p>This will automatically set up a sketch canvas upon which the user can
60+
draw using the mouse or touch events on supported devices.</p>
61+
62+
<h2>Options</h2>
63+
64+
<p>An options hash may be passed into the sketch function with the following properties:</p>
65+
66+
<pre class='source'>{
67+
toolLinks: true, // when true, automatically create tool links
68+
defaultTool: 'marker', // sets the default tool
69+
defaultColor: '#000000', // sets the default drawing color
70+
defaultSize: 5 // sets the default drawing size
71+
}</pre>
72+
</article>
73+
4874
<article class='example'>
4975
<h1>Simple Example</h1>
5076

@@ -85,6 +111,36 @@ <h1>Changing Color/Size</h1>
85111
</script>
86112
</div>
87113
</article>
114+
115+
<article class='info'>
116+
<h1>Compatibility</h1>
117+
118+
<p>Sketch.js has been tested on Chrome (OS X), Firefox (OS X), Safari (OS X),
119+
Android Browser (Honeycomb 3.1). It suffers significant performance degradation
120+
on mobile browsers due to general HTML5 Canvas performance issues.</p>
121+
122+
<h1>License</h1>
123+
124+
<p>Copyright (C) 2011 by Michael Bleigh and Intridea, Inc.</p>
125+
126+
<p>Permission is hereby granted, free of charge, to any person obtaining a copy
127+
of this software and associated documentation files (the "Software"), to deal
128+
in the Software without restriction, including without limitation the rights
129+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
130+
copies of the Software, and to permit persons to whom the Software is
131+
furnished to do so, subject to the following conditions:</p>
132+
133+
<p>The above copyright notice and this permission notice shall be included in
134+
all copies or substantial portions of the Software.</p>
135+
136+
<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
137+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
138+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
139+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
140+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
141+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
142+
THE SOFTWARE.</p>
143+
</article>
88144
</div>
89145
<script type='text/javascript'>
90146
var escapeHTML = function(s) {

0 commit comments

Comments
 (0)