Skip to content

Commit e0da47f

Browse files
committed
Merge pull request #501 from MrRio/feature-refactor
Tidy up, refactor, add Travis
2 parents 53f2f29 + a30a119 commit e0da47f

39 files changed

+801
-535
lines changed

MIT-LICENSE.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2010-2014 James Hall, https://github.com/MrRio/jsPDF
1+
Copyright (c) 2010-2015 James Hall, https://github.com/MrRio/jsPDF
22

33
Permission is hereby granted, free of charge, to any person obtaining
44
a copy of this software and associated documentation files (the

Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
all:
2+
npm install
3+
npm install -g uglify-js
24
bower install
35
./build.sh

README.md

+15-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

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

7-
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.
7+
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.
88

99
## Creating your first document
1010

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

28+
## Building
29+
30+
To build, simply run the 'make' command. This will fetch all npm and bower deps, then compile minified JS files.
31+
32+
## Running locally
33+
34+
Due to certain restrictions that local files have, you'll need to run a web server. Just run:
35+
36+
```
37+
npm start
38+
```
39+
40+
You can then access the site at localhost:8000
41+
2842
## Credits
2943

3044
Big thanks to Daniel Dotsenko from [Willow Systems Corporation](http://willow-systems.com) for making huge contributions to the codebase.

bower.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jspdf",
3-
"version": "1.1.134",
3+
"version": "1.1.135",
44
"homepage": "https://github.com/mrrio/jspdf",
55
"description": "PDF Document creation from JavaScript",
66
"main": "dist/jspdf.min.js",
@@ -17,8 +17,8 @@
1717
"libs",
1818
"CNAME",
1919
"jspdf.js",
20-
"jspdf.PLUGINTEMPLATE.js",
21-
"jspdf.plugin.*",
20+
"examples/jspdf.PLUGINTEMPLATE.js",
21+
"plugins/*",
2222
"todo.txt",
2323
"wscript.py",
2424
"build.sh",

bower.json.bak

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"name": "jspdf",
3+
"version": "1.1.140",
4+
"homepage": "https://github.com/mrrio/jspdf",
5+
"description": "PDF Document creation from JavaScript",
6+
"main": "dist/jspdf.min.js",
7+
"moduleType": [
8+
"amd",
9+
"globals"
10+
],
11+
"keywords": [
12+
"pdf"
13+
],
14+
"license": "MIT",
15+
"ignore": [
16+
"**/.*",
17+
"libs",
18+
"CNAME",
19+
"jspdf.js",
20+
"examples/jspdf.PLUGINTEMPLATE.js",
21+
"plugins/*",
22+
"todo.txt",
23+
"wscript.py",
24+
"build.sh",
25+
"test",
26+
"tools"
27+
]
28+
}

build.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,25 @@
22
#
33
# Build script for jsPDF
44
# (c) 2014 Diego Casorran
5+
# (c) 2015 James Hall
56
#
67

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

1617
# Update submodules
1718
git submodule foreach git pull origin master
1819

19-
echo ${version}
20+
echo "Building version ${version}"
2021

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

2525
# Fix conflict with adler32 & FileSaver
2626
adler1="libs/adler32cs.js/adler32cs.js"
@@ -49,7 +49,7 @@ for fn in ${files} ${libs}; do
4949
| sed -e 'H;${x;s/\s*@preserve/ /g;p;};d' \
5050
| sed -e 's/\s*===\+//' \
5151
| grep -v *global > ${output}.x
52-
52+
5353
if test "x$fn" = "xjspdf.js"; then
5454
cat ${output}.x \
5555
| sed s/\${versionID}/${version}-git\ Built\ on\ ${build}/ \

0 commit comments

Comments
 (0)