From 76d877e48bd1b45703ec829a82c39ea3a800376b Mon Sep 17 00:00:00 2001 From: Brendan Dahl Date: Tue, 4 Sep 2012 10:22:32 -0700 Subject: [PATCH] Strip out license for bundled version. --- make.js | 11 ++++++++++- src/api.js | 2 ++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/make.js b/make.js index b3b655787..c3453810d 100755 --- a/make.js +++ b/make.js @@ -214,12 +214,14 @@ target.bundle = function() { 'pattern.js', 'stream.js', 'worker.js', - '../external/jpgjs/jpg.js', 'jpx.js', 'jbig2.js', 'bidi.js', 'metadata.js']; + var EXT_SRC_FILES = [ + '../external/jpgjs/jpg.js']; + if (!test('-d', BUILD_DIR)) mkdir(BUILD_DIR); @@ -230,6 +232,13 @@ target.bundle = function() { crlfchecker.checkIfCrlfIsPresent(SRC_FILES); + // Strip out all the vim/license headers. + var reg = /\n\/\* -\*- Mode(.|\n)*?Mozilla Foundation(.|\n)*?'use strict';/g; + bundle = bundle.replace(reg, ''); + + // Append external files last since we don't want to modify them. + bundle += cat(EXT_SRC_FILES); + // This just preprocesses the empty pdf.js file, we don't actually want to // preprocess everything yet since other build targets use this file. builder.preprocess('pdf.js', ROOT_DIR + BUILD_TARGET, diff --git a/src/api.js b/src/api.js index 8bb531a2c..d6d13a095 100644 --- a/src/api.js +++ b/src/api.js @@ -15,6 +15,8 @@ * limitations under the License. */ + 'use strict'; + /** * This is the main entry point for loading a PDF and interacting with it. * NOTE: If a URL is used to fetch the PDF data a standard XMLHttpRequest(XHR)