File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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
2325 * ====================================================================
2426 */
2527
26- ( function ( jsPDFAPI ) {
28+ ; ( function ( jsPDFAPI ) {
2729'use strict'
2830
2931var namespace = 'addImage_'
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff 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
1924def 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+
4367def 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.
You can’t perform that action at this time.
0 commit comments