Permalink
Browse files

Fixed a bug which prevented multiple canvases from supporting events

  • Loading branch information...
1 parent 5949ad2 commit 365bfafe7c2f0287c27f7ff940041d668805e14c @caleb531 committed Jan 8, 2013
Showing with 154 additions and 130 deletions.
  1. +12 −13 README.md
  2. +25 −18 build/build.py
  3. +68 −51 jcanvas.js
  4. +47 −47 jcanvas.min.js
  5. +2 −1 license.txt
View
@@ -1,21 +1,20 @@
-# [jCanvas](http://calebevans.me/projects/jcanvas/)
-*Copyright 2012, Caleb Evans*
-*Licensed under the MIT license*
-
-jCanvas is a JavaScript library that makes the HTML5 canvas easy to work with.
-
+# [jCanvas](http://calebevans.me/projects/jcanvas/)
+*Copyright 2013, Caleb Evans*
+
+jCanvas is a jQuery plugin that makes the HTML5 canvas easy to work with.
+
## [Download](http://calebevans.me/projects/jcanvas/downloads.php)
-jCanvas requires jQuery 1.4 or newer.
-
+jCanvas requires jQuery 1.4 or newer, and supports both desktop and mobile browsers.
+
## [Documentation](http://calebevans.me/projects/jcanvas/downloads.php)
-Please read the documentation before emailing me any questions you may have.
-
+Please read the documentation before emailing me any questions you may have. If something in the documentation doesn't make sense, feel free to [email me](mailto:calebevans.me@gmail.com) for clarification.
+
## [Support](http://calebevans.me/projects/jcanvas/support.php)
-Frequently asked questions, license questions, and more.
-
+Where to find help regarding jCanvas.
+
## [License](https://github.com/caleb531/jcanvas/blob/master/license.txt)
-You've been warned...
+jCanvas is licensed under the MIT license.
View
@@ -1,5 +1,4 @@
-#!/usr/bin/env python
-# The following script supports Python 2 and 3
+# This script supports Python 2 and 3
import datetime, sys, os, re
@@ -8,38 +7,46 @@ def compress(source):
# Create path to minified file from source path
minified = re.sub('(\.\w+)$', '.min\\1', source)
- # Compress source file
- os.system('java -jar closurecompiler.jar --js=' + source + ' --js_output_file ' + minified)
+ # Compress source file using Google Closure Compiler
+ os.system('java -jar closurecompiler.jar --js ' + source + ' --js_output_file ' + minified + ' --compilation_level SIMPLE_OPTIMIZATIONS')
+
+# Update version in given source file
+def update_version(source, version):
+ # Open source file for reading and writing
+ f = open(source, 'r+')
+ # Read contents from source file
+ contents = f.read()
+ f.close()
+
+ # Update source version
+ contents = re.sub(' v([\d\.]+)', (' v' + version), contents, 1)
+
+ # Write updated source to source file
+ f = open(source, 'w+')
+ f.write(contents)
+ f.close()
# Main function
def main():
+ # Inform user when build process has started
print('Running...')
- # Get jCanvas source file
- source = '../jcanvas.js'
- f = open(source, 'r+')
- # Read contents of source file
- contents = f.read()
- f.close()
-
# Get current date
now = datetime.datetime.now()
-
# Get jCanvas version from current date
version = now.strftime('%y.%m.%d')
- # Update source version
- contents = re.sub(' v(\d+\.\d+\.\d+)', (' v' + version), contents, 1)
+ source = '../jcanvas.js'
+ readme = '../README.md'
- # Write updated source to source file
- f = open(source, 'w+')
- f.write(contents)
- f.close()
+ # Update version in source and readme files
+ update_version(source, version)
# Compress jCanvas source
compress(source)
+ # Inform user when build process has finished
print('Done.')
# Initialize only when executed directly
Oops, something went wrong.

0 comments on commit 365bfaf

Please sign in to comment.