Fixed vim indentation rules.

This commit is contained in:
Justin D'Arcangelo 2011-06-23 21:18:07 -04:00
parent b18006a055
commit b9af0da8f8
3 changed files with 596 additions and 604 deletions

View File

@ -1,5 +1,5 @@
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- / /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- /
/* vim: set shiftwidth=4 tabstop=8 autoindent cindent expandtab: */ /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
body { body {
background-color: #929292; background-color: #929292;

View File

@ -3,11 +3,11 @@
<head> <head>
<title>pdf.js Multi-Page Viewer</title> <title>pdf.js Multi-Page Viewer</title>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8"/> <meta http-equiv="Content-type" content="text/html;charset=UTF-8"/>
<link rel="stylesheet" href="multi-page-viewer.css" type="text/css" media="screen"/> <link rel="stylesheet" href="multi_page_viewer.css" type="text/css" media="screen"/>
<script type="text/javascript" src="pdf.js"></script> <script type="text/javascript" src="pdf.js"></script>
<script type="text/javascript" src="fonts.js"></script> <script type="text/javascript" src="fonts.js"></script>
<script type="text/javascript" src="glyphlist.js"></script> <script type="text/javascript" src="glyphlist.js"></script>
<script type="text/javascript" src="multi-page-viewer.js"></script> <script type="text/javascript" src="multi_page_viewer.js"></script>
</head> </head>
<body> <body>
<div id="controls"> <div id="controls">

View File

@ -1,5 +1,5 @@
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- / /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- /
/* vim: set shiftwidth=4 tabstop=8 autoindent cindent expandtab: */ /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
"use strict"; "use strict";
@ -197,10 +197,8 @@ var PDFViewer = {
document.location.hash = PDFViewer.pageNumber; document.location.hash = PDFViewer.pageNumber;
PDFViewer.previousPageButton.className = (PDFViewer.pageNumber === 1) ? PDFViewer.previousPageButton.className = (PDFViewer.pageNumber === 1) ? 'disabled' : '';
'disabled' : ''; PDFViewer.nextPageButton.className = (PDFViewer.pageNumber === PDFViewer.numberOfPages) ? 'disabled' : '';
PDFViewer.nextPageButton.className = (PDFViewer.pageNumber === PDFViewer.numberOfPages) ?
'disabled' : '';
} }
}, },
@ -227,10 +225,7 @@ var PDFViewer = {
req.onreadystatechange = function() { req.onreadystatechange = function() {
if (req.readyState === 4 && req.status === req.expected) { if (req.readyState === 4 && req.status === req.expected) {
var data = req.mozResponseArrayBuffer || var data = req.mozResponseArrayBuffer || req.mozResponse || req.responseArrayBuffer || req.response;
req.mozResponse ||
req.responseArrayBuffer ||
req.response;
PDFViewer.readPDF(data); PDFViewer.readPDF(data);
} }
@ -257,10 +252,8 @@ var PDFViewer = {
document.location.hash = 1; document.location.hash = 1;
} }
PDFViewer.previousPageButton.className = (PDFViewer.pageNumber === 1) ? PDFViewer.previousPageButton.className = (PDFViewer.pageNumber === 1) ? 'disabled' : '';
'disabled' : ''; PDFViewer.nextPageButton.className = (PDFViewer.pageNumber === PDFViewer.numberOfPages) ? 'disabled' : '';
PDFViewer.nextPageButton.className = (PDFViewer.pageNumber === PDFViewer.numberOfPages) ?
'disabled' : '';
} }
}; };
@ -271,6 +264,7 @@ window.onload = function() {
var qs = window.location.search.substring(1); var qs = window.location.search.substring(1);
var kvs = qs.split('&'); var kvs = qs.split('&');
var params = {}; var params = {};
for (var i = 0; i < kvs.length; ++i) { for (var i = 0; i < kvs.length; ++i) {
var kv = kvs[i].split('='); var kv = kvs[i].split('=');
params[unescape(kv[0])] = unescape(kv[1]); params[unescape(kv[0])] = unescape(kv[1]);
@ -455,10 +449,8 @@ window.onload = function() {
// Update the page number input with the current page number. // Update the page number input with the current page number.
if (!PDFViewer.willJumpToPage && visiblePages.length > 0) { if (!PDFViewer.willJumpToPage && visiblePages.length > 0) {
PDFViewer.pageNumber = PDFViewer.pageNumberInput.value = visiblePages[0]; PDFViewer.pageNumber = PDFViewer.pageNumberInput.value = visiblePages[0];
PDFViewer.previousPageButton.className = (PDFViewer.pageNumber === 1) ? PDFViewer.previousPageButton.className = (PDFViewer.pageNumber === 1) ? 'disabled' : '';
'disabled' : ''; PDFViewer.nextPageButton.className = (PDFViewer.pageNumber === PDFViewer.numberOfPages) ? 'disabled' : '';
PDFViewer.nextPageButton.className = (PDFViewer.pageNumber === PDFViewer.numberOfPages) ?
'disabled' : '';
} else { } else {
PDFViewer.willJumpToPage = false; PDFViewer.willJumpToPage = false;
} }