]> git.parisson.com Git - pdf.js.git/commitdiff
PDF --> PDFJS, global wrapper named
authorArtur Adib <arturadib@gmail.com>
Wed, 26 Oct 2011 18:46:57 +0000 (14:46 -0400)
committerArtur Adib <arturadib@gmail.com>
Wed, 26 Oct 2011 18:46:57 +0000 (14:46 -0400)
examples/helloworld/hello.js
src/core.js
src/pdf.js
test/driver.js
web/viewer.js

index 15acbf2891a785b43e2da4982ae15adf9bfd5a89..45e61eb6fad91721f305f47dd6efb16aba6143d6 100644 (file)
@@ -7,11 +7,11 @@
 
 'use strict';
 
-PDF.getPdf('helloworld.pdf', function getPdfHelloWorld(data) {
+PDFJS.getPdf('helloworld.pdf', function getPdfHelloWorld(data) {
   //
   // Instantiate PDFDoc with PDF data
   //
-  var pdf = new PDF.PDFDoc(data);
+  var pdf = new PDFJS.PDFDoc(data);
   var page = pdf.getPage(1);
   var scale = 1.5;
 
index be43fc269796b0ef62aade94290a261ec4d923b9..4b411cff5c93fd566fe877df30ca249a5ee97468 100644 (file)
@@ -9,11 +9,11 @@ var ERRORS = 0, WARNINGS = 1, TODOS = 5;
 var verbosity = WARNINGS;
 var useWorker = false;
 
-// The global PDF object exposes the API
+// The global PDFJS object exposes the API
 // In production, it will be declared outside a global wrapper
 // In development, it will be declared here
-if (!globalScope.PDF) {
-  globalScope.PDF = {};
+if (!globalScope.PDFJS) {
+  globalScope.PDFJS = {};
 }
 
 // getPdf()
@@ -49,7 +49,7 @@ function getPdf(arg, callback) {
   };
   xhr.send(null);
 }
-globalScope.PDF.getPdf = getPdf;
+globalScope.PDFJS.getPdf = getPdf;
 
 var Page = (function pagePage() {
   function constructor(xref, pageNumber, pageDict, ref) {
@@ -608,4 +608,4 @@ var PDFDoc = (function() {
 
   return constructor;
 })();
-globalScope.PDF.PDFDoc = PDFDoc;
+globalScope.PDFJS.PDFDoc = PDFDoc;
index 5a17d3165166cc479c6e6f8c16143a3033822393..b2b8df7aa91c268a817446e65750b83bf6539fbb 100644 (file)
@@ -1,9 +1,9 @@
 /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
 
-var PDF = {};
+var PDFJS = {};
 
-(function() {
+(function pdfjsWrapper() {
 
   // Use strict in our context only - users might not want it
   'use strict';
index 5418b3eb98af54eca5fb02fdf4ea1281ebe8ace1..16375c30b3ec0c5eff49fe6688c80faa04b576d4 100644 (file)
@@ -82,7 +82,7 @@ function nextTask() {
   getPdf(task.file, function nextTaskGetPdf(data) {
     var failure;
     try {
-      task.pdfDoc = new PDFDoc(data);
+      task.pdfDoc = new PDFJS.PDFDoc(data);
     } catch (e) {
       failure = 'load PDF doc : ' + e.toString();
     }
index a6b0dea3098eb3f31f145760eef3175e56e31b51..1ab2c555c60a2c65b83d9fba31682e7704cbc0d9 100644 (file)
@@ -122,7 +122,7 @@ var PDFView = {
     document.title = this.url = url;
 
     var self = this;
-    PDF.getPdf(
+    PDFJS.getPdf(
       {
         url: url,
         progress: function getPdfProgress(evt) {
@@ -209,7 +209,7 @@ var PDFView = {
     while (container.hasChildNodes())
       container.removeChild(container.lastChild);
 
-    var pdf = new PDF.PDFDoc(data);
+    var pdf = new PDFJS.PDFDoc(data);
     var pagesCount = pdf.numPages;
     document.getElementById('numPages').innerHTML = pagesCount;
     document.getElementById('pageNumber').max = pagesCount;