Merge branch 'master' of https://github.com/andreasgal/pdf.js.git into issue-649

This commit is contained in:
notmasteryet 2011-10-11 20:29:40 -05:00
commit db5550af09
2 changed files with 15 additions and 7 deletions

View File

@ -3,6 +3,9 @@ BUILD_DIR := build
DEFAULT_BROWSERS := resources/browser_manifests/browser_manifest.json DEFAULT_BROWSERS := resources/browser_manifests/browser_manifest.json
DEFAULT_TESTS := test_manifest.json DEFAULT_TESTS := test_manifest.json
EXTENSION_SRC := ./extensions/firefox
EXTENSION_NAME := pdf.js.xpi
# Let folks define custom rules for their clones. # Let folks define custom rules for their clones.
-include local.mk -include local.mk
@ -103,14 +106,17 @@ lint:
# TODO: Use the Closure compiler to optimize the pdf.js files. # TODO: Use the Closure compiler to optimize the pdf.js files.
# #
GH_PAGES = $(BUILD_DIR)/gh-pages GH_PAGES = $(BUILD_DIR)/gh-pages
web: | compiler pages-repo \ web: | extension compiler pages-repo \
$(addprefix $(GH_PAGES)/, $(PDF_JS_FILES)) \ $(addprefix $(GH_PAGES)/, $(PDF_JS_FILES)) \
$(addprefix $(GH_PAGES)/, $(wildcard web/*.*)) \ $(addprefix $(GH_PAGES)/, $(wildcard web/*.*)) \
$(addprefix $(GH_PAGES)/, $(wildcard web/images/*.*)) $(addprefix $(GH_PAGES)/, $(wildcard web/images/*.*)) \
$(addprefix $(GH_PAGES)/, $(wildcard $(EXTENSION_SRC)/*.xpi))
@cp $(GH_PAGES)/web/index.html.template $(GH_PAGES)/index.html; @cp $(GH_PAGES)/web/index.html.template $(GH_PAGES)/index.html;
@cd $(GH_PAGES); git add -A; @cd $(GH_PAGES); git add -A;
@echo
@echo "Website built in $(GH_PAGES)." @echo "Website built in $(GH_PAGES)."
@echo "Don't forget to cd into $(GH_PAGES)/ and issue 'git commit' to push changes."
# make pages-repo # make pages-repo
# #
@ -126,6 +132,7 @@ pages-repo: | $(BUILD_DIR)
fi; fi;
@mkdir -p $(GH_PAGES)/web; @mkdir -p $(GH_PAGES)/web;
@mkdir -p $(GH_PAGES)/web/images; @mkdir -p $(GH_PAGES)/web/images;
@mkdir -p $(GH_PAGES)/$(EXTENSION_SRC);
$(GH_PAGES)/%.js: %.js $(GH_PAGES)/%.js: %.js
@cp $< $@ @cp $< $@
@ -136,6 +143,9 @@ $(GH_PAGES)/web/%: web/%
$(GH_PAGES)/web/images/%: web/images/% $(GH_PAGES)/web/images/%: web/images/%
@cp $< $@ @cp $< $@
$(GH_PAGES)/$(EXTENSION_SRC)/%: $(EXTENSION_SRC)/%
@cp -R $< $@
# # make compiler # # make compiler
# # # #
# # This target downloads the Closure compiler, and places it in the # # This target downloads the Closure compiler, and places it in the
@ -149,13 +159,11 @@ $(GH_PAGES)/web/images/%: web/images/%
# curl $(COMPILER_URL) > $(BUILD_DIR)/compiler.zip; # curl $(COMPILER_URL) > $(BUILD_DIR)/compiler.zip;
# cd $(BUILD_DIR); unzip compiler.zip compiler.jar; # cd $(BUILD_DIR); unzip compiler.zip compiler.jar;
# make firefox-extension # make extension
# #
# This target produce a restartless firefox extension containing a # This target produce a restartless firefox extension containing a
# copy of the pdf.js source. # copy of the pdf.js source.
CONTENT_DIR := content CONTENT_DIR := content
EXTENSION_SRC := ./extensions/firefox
EXTENSION_NAME := pdf.js.xpi
PDF_WEB_FILES = \ PDF_WEB_FILES = \
web/images \ web/images \
web/compatibility.js \ web/compatibility.js \

4
pdf.js
View File

@ -6797,11 +6797,11 @@ var PDFFunction = (function pdfFunction() {
diff.push(c1[i] - c0[i]); diff.push(c1[i] - c0[i]);
this.func = function pdfFunctionConstructInterpolatedFunc(args) { this.func = function pdfFunctionConstructInterpolatedFunc(args) {
var x = args[0]; var x = n == 1 ? args[0] : Math.pow(args[0], n);
var out = []; var out = [];
for (var j = 0; j < length; ++j) for (var j = 0; j < length; ++j)
out.push(c0[j] + (x^n * diff[i])); out.push(c0[j] + (x * diff[j]));
return out; return out;
}; };