]> git.parisson.com Git - pdf.js.git/commitdiff
Fix lint warnings in hello.js.
authorKalervo Kujala <kkujala@>
Mon, 26 Sep 2011 20:28:16 +0000 (23:28 +0300)
committerKalervo Kujala <kkujala@>
Mon, 26 Sep 2011 20:28:16 +0000 (23:28 +0300)
Also split the long lines in README.

examples/helloworld/README.md
examples/helloworld/hello.js

index 8395733f3d989b90ee617381c119f47beff400b1..9b7b3001a539e5b92da016ce91ee5707ba821a3a 100644 (file)
@@ -1,16 +1,18 @@
 ## "Hello World" overview
 
 This example is a minimalistic application of the pdf.js project. The file 
-`helloworld.pdf` is from the GNUpdf project (see [Introduction to PDF at GNUpdf](http://gnupdf.org/Introduction_to_PDF), and contains a simple and 
+`helloworld.pdf` is from the GNUpdf project (see [Introduction to PDF at
+GNUpdf] (http://gnupdf.org/Introduction_to_PDF)), and contains a simple and
 human-readable PDF.
 
 
 ## Getting started
 
-Point your browser to `index.html`. Voila. Take a peek at `hello.js` to see 
+Point your browser to `index.html`. Voila. Take a peek at `hello.js` to see
 how to make basic calls to `pdf.js`.
 
 
 ## Additional resources
 
 + [GNUpdf - Introduction to PDF](http://gnupdf.org/Introduction_to_PDF)
+
index 21799c33a6641db53d359580669a9088b1097e13..d873cf5f0dab317ab0c1216478adaa99c05318c3 100644 (file)
@@ -1,13 +1,17 @@
+/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
+
 //
 // See README for overview
 //
 
+'use strict';
 
 //
 // Ajax GET request, for binary files
 // (like jQuery's $.get(), but supports the binary type ArrayBuffer)
 //
-var ajaxGet = function(url, callback){
+var ajaxGet = function(url, callback) {
   var xhr = new XMLHttpRequest();
   xhr.open('GET', url);
   xhr.mozResponseType = xhr.responseType = 'arraybuffer';
@@ -20,13 +24,13 @@ var ajaxGet = function(url, callback){
       callback(data);
     }
   };
-  xhr.send(null);  
-}
+  xhr.send(null);
+};
 
 //
 // This is where the fun happens
 //
-ajaxGet('helloworld.pdf', function(data){
+ajaxGet('helloworld.pdf', function ajaxGetHelloWorld(data) {
   //
   // Instantiate PDFDoc with PDF data
   //
@@ -40,10 +44,11 @@ ajaxGet('helloworld.pdf', function(data){
   var canvas = document.getElementById('the-canvas');
   var context = canvas.getContext('2d');
   canvas.height = page.height * scale;
-  canvas.width = page.width * scale;  
+  canvas.width = page.width * scale;
 
   //
   // Render PDF page into canvas context
   //
   page.startRendering(context);
 });
+