Skip to content

Commit adc6311

Browse files
author
Daniel Dotsenko
committed
Tweaking comments for minification and presentation + build script matching that
1 parent 3764937 commit adc6311

4 files changed

Lines changed: 43 additions & 16 deletions

File tree

jspdf.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
/** @preserve
2-
* ====================================================================
3-
* jsPDF
4-
* Copyright (c) 2010 James Hall, https://github.com/MrRio/jsPDF
5-
* Copyright (c) 2012 Willow Systems Corporation, willow-systems.com
6-
*
1+
/** @preserve jsPDF ( ${buildDate} ${commitID} )
2+
Copyright (c) 2010 James Hall, https://github.com/MrRio/jsPDF
3+
Copyright (c) 2012 Willow Systems Corporation, willow-systems.com
4+
MIT license.
5+
*/
6+
/**
77
* Permission is hereby granted, free of charge, to any person obtaining
88
* a copy of this software and associated documentation files (the
99
* "Software"), to deal in the Software without restriction, including

jspdf.plugin.addimage.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
/** ====================================================================
2-
* jsPDF addImage plugin (JPEG only at this time)
3-
* Copyright (c) 2012 https://github.com/siefkenj/
4-
*
1+
/** @preserve
2+
jsPDF addImage plugin (JPEG only at this time)
3+
Copyright (c) 2012 https://github.com/siefkenj/
4+
*/
5+
6+
/**
57
* Permission is hereby granted, free of charge, to any person obtaining
68
* a copy of this software and associated documentation files (the
79
* "Software"), to deal in the Software without restriction, including
@@ -23,7 +25,7 @@
2325
* ====================================================================
2426
*/
2527

26-
(function(jsPDFAPI) {
28+
;(function(jsPDFAPI) {
2729
'use strict'
2830

2931
var namespace = 'addImage_'

jspdf.plugin.sillysvgrenderer.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
/** ====================================================================
2-
* jsPDF Silly SVG plugin
3-
* Copyright (c) 2012 Willow Systems Corporation, willow-systems.com
4-
*
1+
/** @preserve
2+
jsPDF Silly SVG plugin
3+
Copyright (c) 2012 Willow Systems Corporation, willow-systems.com
4+
*/
5+
/**
56
* Permission is hereby granted, free of charge, to any person obtaining
67
* a copy of this software and associated documentation files (the
78
* "Software"), to deal in the Software without restriction, including

wscript.py

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,12 @@ def minifyfiles(context):
1313

1414
print("=== Compressing jsPDF and select plugins into " + minified.name)
1515
minified.text = compress_with_closure_compiler(
16-
src.text + ';' + addImagePlugin.text
16+
src.data.replace(
17+
"${buildDate}", timeUTC()
18+
).replace(
19+
"${commitID}", getCommitIDstring()
20+
) +
21+
addImagePlugin.data
1722
)
1823

1924
def builddocs(context):
@@ -40,6 +45,25 @@ def builddocs(context):
4045
]
4146
)
4247

48+
def timeUTC():
49+
import datetime
50+
return datetime.datetime.utcnow().strftime("%Y-%m-%dT%H:%M")
51+
52+
def getCommitIDstring():
53+
import subprocess
54+
55+
if not subprocess.check_output:
56+
# let's not bother emulating it. Not important
57+
return ""
58+
else:
59+
return "commit ID " + subprocess.check_output(
60+
[
61+
'git'
62+
, 'rev-parse'
63+
, 'HEAD'
64+
]
65+
).strip()
66+
4367
def compress_with_closure_compiler(code, compression_level = None):
4468
'''Sends text of JavaScript code to Google's Closure Compiler API
4569
Returns text of compressed code.

0 commit comments

Comments
 (0)