Skip to content
Browse files

Tweaking comments for minification and presentation + build script ma…

…tching that
  • Loading branch information...
1 parent 3764937 commit adc6311628c28b5502cae5bd123bb7958772158c Daniel Dotsenko committed Jun 20, 2012
Showing with 43 additions and 16 deletions.
  1. +6 −6 jspdf.js
  2. +7 −5 jspdf.plugin.addimage.js
  3. +5 −4 jspdf.plugin.sillysvgrenderer.js
  4. +25 −1 wscript.py
View
12 jspdf.js
@@ -1,9 +1,9 @@
-/** @preserve
- * ====================================================================
- * jsPDF
- * Copyright (c) 2010 James Hall, https://github.com/MrRio/jsPDF
- * Copyright (c) 2012 Willow Systems Corporation, willow-systems.com
- *
+/** @preserve jsPDF ( ${buildDate} ${commitID} )
+Copyright (c) 2010 James Hall, https://github.com/MrRio/jsPDF
+Copyright (c) 2012 Willow Systems Corporation, willow-systems.com
+MIT license.
+*/
+/**
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
View
12 jspdf.plugin.addimage.js
@@ -1,7 +1,9 @@
-/** ====================================================================
- * jsPDF addImage plugin (JPEG only at this time)
- * Copyright (c) 2012 https://github.com/siefkenj/
- *
+/** @preserve
+jsPDF addImage plugin (JPEG only at this time)
+Copyright (c) 2012 https://github.com/siefkenj/
+*/
+
+/**
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
@@ -23,7 +25,7 @@
* ====================================================================
*/
-(function(jsPDFAPI) {
+;(function(jsPDFAPI) {
'use strict'
var namespace = 'addImage_'
View
9 jspdf.plugin.sillysvgrenderer.js
@@ -1,7 +1,8 @@
-/** ====================================================================
- * jsPDF Silly SVG plugin
- * Copyright (c) 2012 Willow Systems Corporation, willow-systems.com
- *
+/** @preserve
+jsPDF Silly SVG plugin
+Copyright (c) 2012 Willow Systems Corporation, willow-systems.com
+*/
+/**
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
View
26 wscript.py
@@ -13,7 +13,12 @@ def minifyfiles(context):
print("=== Compressing jsPDF and select plugins into " + minified.name)
minified.text = compress_with_closure_compiler(
- src.text + ';' + addImagePlugin.text
+ src.data.replace(
+ "${buildDate}", timeUTC()
+ ).replace(
+ "${commitID}", getCommitIDstring()
+ ) +
+ addImagePlugin.data
)
def builddocs(context):
@@ -40,6 +45,25 @@ def builddocs(context):
]
)
+def timeUTC():
+ import datetime
+ return datetime.datetime.utcnow().strftime("%Y-%m-%dT%H:%M")
+
+def getCommitIDstring():
+ import subprocess
+
+ if not subprocess.check_output:
+ # let's not bother emulating it. Not important
+ return ""
+ else:
+ return "commit ID " + subprocess.check_output(
+ [
+ 'git'
+ , 'rev-parse'
+ , 'HEAD'
+ ]
+ ).strip()
+
def compress_with_closure_compiler(code, compression_level = None):
'''Sends text of JavaScript code to Google's Closure Compiler API
Returns text of compressed code.

0 comments on commit adc6311

Please sign in to comment.
Something went wrong with that request. Please try again.