Skip to content

Tidy up, refactor, add Travis #501

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
May 15, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion MIT-LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2010-2014 James Hall, https://github.com/MrRio/jsPDF
Copyright (c) 2010-2015 James Hall, https://github.com/MrRio/jsPDF

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
all:
npm install
npm install -g uglify-js
bower install
./build.sh
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

**Generate PDF files in client-side JavaScript.**

You can [catch me on twitter](http://twitter.com/MrRio): [@MrRio](http://twitter.com/MrRio) or head over to [my company's website](http://snapshotmedia.co.uk) for consultancy.
You can [catch me on twitter](http://twitter.com/MrRio): [@MrRio](http://twitter.com/MrRio) or head over to [my company's website](http://parall.ax) for consultancy.

## Creating your first document

Expand All @@ -25,6 +25,20 @@ doc.save('Test.pdf');
git clone --recursive git://github.com/MrRio/jsPDF.git
```

## Building

To build, simply run the 'make' command. This will fetch all npm and bower deps, then compile minified JS files.

## Running locally

Due to certain restrictions that local files have, you'll need to run a web server. Just run:

```
npm start
```

You can then access the site at localhost:8000

## Credits

Big thanks to Daniel Dotsenko from [Willow Systems Corporation](http://willow-systems.com) for making huge contributions to the codebase.
Expand Down
6 changes: 3 additions & 3 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jspdf",
"version": "1.1.134",
"version": "1.1.135",
"homepage": "https://github.com/mrrio/jspdf",
"description": "PDF Document creation from JavaScript",
"main": "dist/jspdf.min.js",
Expand All @@ -17,8 +17,8 @@
"libs",
"CNAME",
"jspdf.js",
"jspdf.PLUGINTEMPLATE.js",
"jspdf.plugin.*",
"examples/jspdf.PLUGINTEMPLATE.js",
"plugins/*",
"todo.txt",
"wscript.py",
"build.sh",
Expand Down
28 changes: 28 additions & 0 deletions bower.json.bak
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "jspdf",
"version": "1.1.140",
"homepage": "https://github.com/mrrio/jspdf",
"description": "PDF Document creation from JavaScript",
"main": "dist/jspdf.min.js",
"moduleType": [
"amd",
"globals"
],
"keywords": [
"pdf"
],
"license": "MIT",
"ignore": [
"**/.*",
"libs",
"CNAME",
"jspdf.js",
"examples/jspdf.PLUGINTEMPLATE.js",
"plugins/*",
"todo.txt",
"wscript.py",
"build.sh",
"test",
"tools"
]
}
10 changes: 5 additions & 5 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@
#
# Build script for jsPDF
# (c) 2014 Diego Casorran
# (c) 2015 James Hall
#

output=dist/jspdf.min.js
options="-m -c --wrap --stats"
version="`python -c 'import time;t=time.gmtime(time.time());print("1.%d.%d" % (t[0] - 2014, t[7]))'`"
libs="`find libs/* -maxdepth 2 -type f | grep .js$ | grep -v -E '(\.min|BlobBuilder\.js$|Downloadify|demo|deps|test)'`"
files="jspdf.js jspdf.plugin*js"
files="jspdf.js plugins/*js"
build=`date +%Y-%m-%dT%H:%M`
commit=`git rev-parse --short=10 HEAD`
whoami=`whoami`

# Update submodules
git submodule foreach git pull origin master

echo ${version}
echo "Building version ${version}"

# Update Bower
#cat ./bower.json \
# | sed "s/\"1\.0\.0\"/\"${version}\"/" >bower.json
sed -i.bak "s/\"version\": \"(.*)\"/\"${version}\"/" bower.json

# Fix conflict with adler32 & FileSaver
adler1="libs/adler32cs.js/adler32cs.js"
Expand Down Expand Up @@ -49,7 +49,7 @@ for fn in ${files} ${libs}; do
| sed -e 'H;${x;s/\s*@preserve/ /g;p;};d' \
| sed -e 's/\s*===\+//' \
| grep -v *global > ${output}.x

if test "x$fn" = "xjspdf.js"; then
cat ${output}.x \
| sed s/\${versionID}/${version}-git\ Built\ on\ ${build}/ \
Expand Down
Loading