Skip to content

Commit e24fab2

Browse files
committed
Refactor jspdf.plugin.* to plugins/*
1 parent 53f2f29 commit e24fab2

30 files changed

+243
-235
lines changed

MIT-LICENSE.txt

Lines changed: 1 addition & 1 deletion
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

bower.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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",

build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ output=dist/jspdf.min.js
88
options="-m -c --wrap --stats"
99
version="`python -c 'import time;t=time.gmtime(time.time());print("1.%d.%d" % (t[0] - 2014, t[7]))'`"
1010
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"
11+
files="jspdf.js plugins/*js"
1212
build=`date +%Y-%m-%dT%H:%M`
1313
commit=`git rev-parse --short=10 HEAD`
1414
whoami=`whoami`
@@ -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}/ \

examples/annotation/test_annotation.html

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* Licensed under the MIT License.
88
* http://opensource.org/licenses/mit-license
9-
*/
9+
*/
1010
-->
1111

1212
<html>
@@ -20,10 +20,10 @@
2020
<script>
2121
require_baseUrl_override = '../../';
2222
require(['../../libs/require/config'], function(){
23-
require(['jspdf.plugin.annotations', 'examples/js/test_harness'], function(){
23+
require(['plugins/annotations', 'examples/js/test_harness'], function(){
2424

2525
var pdf = new jsPDF('p', 'pt', 'letter');
26-
26+
2727
// Create pages with a table of contents.
2828
// TOC links to each page
2929
// Each page links back to TOC and to an external URL
@@ -32,55 +32,55 @@
3232
var text = 'Table of Contents';
3333
pdf.text(text, 20, y);
3434
y += pdf.getLineHeight() * 2;
35-
35+
3636
for (var i=2; i<10; i++){
3737
text = "Page " + i;
3838
pdf.textWithLink(text, 20, y, {pageNumber:i});
3939
y += pdf.getLineHeight();
40-
40+
4141
var x = 20;
4242
var width = pdf.textWithLink(" [100%]", x, y, {pageNumber:i, magFactor:'XYZ', zoom:1});
43-
x += width;
43+
x += width;
4444
var width = pdf.textWithLink(" [200%]", x, y, {pageNumber:i, magFactor:'XYZ', zoom:2});
45-
x += width;
45+
x += width;
4646
var width = pdf.textWithLink(" [50%]", x, y, {pageNumber:i, magFactor:'XYZ', zoom:.5});
47-
x += width;
47+
x += width;
4848
var width = pdf.textWithLink(" [Fit]", x, y, {pageNumber:i, magFactor:'Fit'});
49-
x += width;
49+
x += width;
5050
var width = pdf.textWithLink(" [FitH]", x, y, {pageNumber:i, magFactor:'FitH'});
51-
x += width;
51+
x += width;
5252
var width = pdf.textWithLink(" [FitV]", x, y, {pageNumber:i, magFactor:'FitV'});
53-
53+
5454
y += pdf.getLineHeight();
5555
}
56-
56+
5757
// Create Test Pages
5858
for (var i=2; i<10; i++){
5959
pdf.addPage();
6060
y = 20;
6161
var text = 'Page ' + i;
6262
pdf.text(text, 20, y);
6363
y += pdf.getLineHeight() * 2;
64-
64+
6565
text = "Goto First Page";
6666
pdf.textWithLink(text, 20, y, {pageNumber:1});
67-
y += pdf.getLineHeight();
68-
67+
y += pdf.getLineHeight();
68+
6969
text = "Goto External URL";
7070
pdf.textWithLink(text, 20, y, {url:'http://www.twelvetone.tv'});
71-
y += pdf.getLineHeight();
71+
y += pdf.getLineHeight();
7272
}
73-
73+
7474
var message = 'Chrome default PDF reader currently does not support magFactor links, \
7575
although links still work after manualy changing magFactor. <br /> \
7676
Firefox has a bug displaying annotations after the magFactor changes, but links do work. <br /> \
7777
To test magFactor links [...] without bugs, use Adobe Reader or compatible application.';
78-
78+
7979
pdf_test_harness_init(pdf, message);
80-
80+
8181
}); // require
8282
}); // require
83-
83+
8484
</script>
8585

8686
</head>

examples/annotation/test_annotation_2.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* Licensed under the MIT License.
88
* http://opensource.org/licenses/mit-license
9-
*/
9+
*/
1010
-->
1111

1212
<html>
@@ -19,14 +19,14 @@
1919
<script>
2020
require_baseUrl_override = '../../';
2121
require(['../../libs/require/config'], function(){
22-
require(['jspdf.plugin.annotations', 'examples/js/test_harness'], function(){
22+
require(['plugins/annotations', 'examples/js/test_harness'], function(){
2323

2424
var pdf = new jsPDF('p', 'pt', 'letter');
2525
var y = 20;
2626
var w;
2727
var text = 'Text Annotations';
2828
pdf.text(text, 20, y);
29-
29+
3030
pdf.setFontSize(12);
3131

3232
y += pdf.getLineHeight() * 2;
@@ -75,7 +75,7 @@
7575

7676
var warning = 'Most web browsers do not display annotations. Download the PDF and open in Adobe Reader, etc).'
7777
pdf_test_harness_init(pdf, warning);
78-
78+
7979
}); // require
8080
}); // require
8181
</script>

0 commit comments

Comments
 (0)