Skip to content

Commit

Permalink
Fixed a bug which prevented multiple canvases from supporting events
Browse files Browse the repository at this point in the history
  • Loading branch information
Caleb Evans committed Jan 8, 2013
1 parent 5949ad2 commit 365bfaf
Show file tree
Hide file tree
Showing 5 changed files with 154 additions and 130 deletions.
25 changes: 12 additions & 13 deletions README.md
@@ -1,21 +1,20 @@
# [jCanvas](http://calebevans.me/projects/jcanvas/) # [jCanvas](http://calebevans.me/projects/jcanvas/)
*Copyright 2012, Caleb Evans* *Copyright 2013, Caleb Evans*
*Licensed under the MIT license*

jCanvas is a jQuery plugin that makes the HTML5 canvas easy to work with.
jCanvas is a JavaScript library that makes the HTML5 canvas easy to work with.

## [Download](http://calebevans.me/projects/jcanvas/downloads.php) ## [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) ## [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) ## [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) ## [License](https://github.com/caleb531/jcanvas/blob/master/license.txt)


You've been warned... jCanvas is licensed under the MIT license.
43 changes: 25 additions & 18 deletions build/build.py
@@ -1,5 +1,4 @@
#!/usr/bin/env python # This script supports Python 2 and 3
# The following script supports Python 2 and 3


import datetime, sys, os, re import datetime, sys, os, re


Expand All @@ -8,38 +7,46 @@ def compress(source):
# Create path to minified file from source path # Create path to minified file from source path
minified = re.sub('(\.\w+)$', '.min\\1', source) minified = re.sub('(\.\w+)$', '.min\\1', source)


# Compress source file # Compress source file using Google Closure Compiler
os.system('java -jar closurecompiler.jar --js=' + source + ' --js_output_file ' + minified) 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 # Main function
def main(): def main():


# Inform user when build process has started
print('Running...') 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 # Get current date
now = datetime.datetime.now() now = datetime.datetime.now()

# Get jCanvas version from current date # Get jCanvas version from current date
version = now.strftime('%y.%m.%d') version = now.strftime('%y.%m.%d')


# Update source version source = '../jcanvas.js'
contents = re.sub(' v(\d+\.\d+\.\d+)', (' v' + version), contents, 1) readme = '../README.md'


# Write updated source to source file # Update version in source and readme files
f = open(source, 'w+') update_version(source, version)
f.write(contents)
f.close()


# Compress jCanvas source # Compress jCanvas source
compress(source) compress(source)


# Inform user when build process has finished
print('Done.') print('Done.')


# Initialize only when executed directly # Initialize only when executed directly
Expand Down

0 comments on commit 365bfaf

Please sign in to comment.