diff --git a/external/jpgjs/jpg.js b/external/jpgjs/jpg.js index dc8956ac0..103153d9d 100644 --- a/external/jpgjs/jpg.js +++ b/external/jpgjs/jpg.js @@ -637,7 +637,10 @@ var JpegImage = (function jpegImage() { tableData[z] = data[offset++]; } } else if ((quantizationTableSpec >> 4) === 1) { //16 bit - tableData[j] = readUint16(); + for (j = 0; j < 64; j++) { + var z = dctZigZag[j]; + tableData[z] = readUint16(); + } } else throw "DQT: invalid table spec"; quantizationTables[quantizationTableSpec & 15] = tableData; @@ -652,7 +655,8 @@ var JpegImage = (function jpegImage() { frame.precision = data[offset++]; frame.scanLines = readUint16(); frame.samplesPerLine = readUint16(); - frame.components = []; + frame.components = {}; + frame.componentsOrder = []; var componentsCount = data[offset++], componentId; var maxH = 0, maxV = 0; for (i = 0; i < componentsCount; i++) { @@ -660,6 +664,7 @@ var JpegImage = (function jpegImage() { var h = data[offset + 1] >> 4; var v = data[offset + 1] & 15; var qId = data[offset + 2]; + frame.componentsOrder.push(componentId); frame.components[componentId] = { h: h, v: v, @@ -728,14 +733,13 @@ var JpegImage = (function jpegImage() { this.jfif = jfif; this.adobe = adobe; this.components = []; - for (var id in frame.components) { - if (frame.components.hasOwnProperty(id)) { - this.components.push({ - lines: buildComponentData(frame, frame.components[id]), - scaleX: frame.components[id].h / frame.maxH, - scaleY: frame.components[id].v / frame.maxV - }); - } + for (var i = 0; i < frame.componentsOrder.length; i++) { + var component = frame.components[frame.componentsOrder[i]]; + this.components.push({ + lines: buildComponentData(frame, component), + scaleX: component.h / frame.maxH, + scaleY: component.v / frame.maxV + }); } }, getData: function getData(width, height) { diff --git a/web/debugger.js b/web/debugger.js index 610a63854..aeb3ab4ce 100644 --- a/web/debugger.js +++ b/web/debugger.js @@ -423,8 +423,9 @@ var PDFBug = (function PDFBugClosure() { panels.setAttribute('class', 'panels'); ui.appendChild(panels); - document.body.appendChild(ui); - document.body.style.paddingRight = panelWidth + 'px'; + var container = document.getElementById('viewerContainer'); + container.appendChild(ui); + container.style.right = panelWidth + 'px'; // Initialize all the debugging tools. var tools = this.tools; diff --git a/web/images/texture.png b/web/images/texture.png new file mode 100644 index 000000000..df0086493 Binary files /dev/null and b/web/images/texture.png differ diff --git a/web/images/toolbarButton-bookmark.png b/web/images/toolbarButton-bookmark.png new file mode 100644 index 000000000..1e5259a97 Binary files /dev/null and b/web/images/toolbarButton-bookmark.png differ diff --git a/web/images/toolbarButton-download.png b/web/images/toolbarButton-download.png new file mode 100644 index 000000000..8676d8e2c Binary files /dev/null and b/web/images/toolbarButton-download.png differ diff --git a/web/images/toolbarButton-menuArrows.png b/web/images/toolbarButton-menuArrows.png new file mode 100644 index 000000000..31b06b5af Binary files /dev/null and b/web/images/toolbarButton-menuArrows.png differ diff --git a/web/images/toolbarButton-pageDown.png b/web/images/toolbarButton-pageDown.png new file mode 100644 index 000000000..762ac43e0 Binary files /dev/null and b/web/images/toolbarButton-pageDown.png differ diff --git a/web/images/toolbarButton-pageUp.png b/web/images/toolbarButton-pageUp.png new file mode 100644 index 000000000..3155b8bd2 Binary files /dev/null and b/web/images/toolbarButton-pageUp.png differ diff --git a/web/images/toolbarButton-print.png b/web/images/toolbarButton-print.png new file mode 100644 index 000000000..fef84dd59 Binary files /dev/null and b/web/images/toolbarButton-print.png differ diff --git a/web/images/toolbarButton-sidebarToggle.png b/web/images/toolbarButton-sidebarToggle.png new file mode 100644 index 000000000..5a937c712 Binary files /dev/null and b/web/images/toolbarButton-sidebarToggle.png differ diff --git a/web/images/toolbarButton-viewOutline.png b/web/images/toolbarButton-viewOutline.png new file mode 100644 index 000000000..cb3967b7f Binary files /dev/null and b/web/images/toolbarButton-viewOutline.png differ diff --git a/web/images/toolbarButton-viewThumbnail.png b/web/images/toolbarButton-viewThumbnail.png new file mode 100644 index 000000000..3a27f0439 Binary files /dev/null and b/web/images/toolbarButton-viewThumbnail.png differ diff --git a/web/images/toolbarButton-zoomIn.png b/web/images/toolbarButton-zoomIn.png new file mode 100644 index 000000000..670acd93f Binary files /dev/null and b/web/images/toolbarButton-zoomIn.png differ diff --git a/web/images/toolbarButton-zoomOut.png b/web/images/toolbarButton-zoomOut.png new file mode 100644 index 000000000..810fbf989 Binary files /dev/null and b/web/images/toolbarButton-zoomOut.png differ diff --git a/web/locale.properties b/web/locale.properties index d5c9dae37..328e00538 100644 --- a/web/locale.properties +++ b/web/locale.properties @@ -1,10 +1,9 @@ [*] bookmark.title=Current view (copy or open in new window) -bookmark_icon.alt=Bookmark -previous_label=Previous -next_label=Next -print_label=Print -download_label=Download +previous.title=Previous +next.title=Next +print.title=Print +download_label.title=Download zoom_out.title=Zoom Out zoom_in.title=Zoom In error_more_info=More Information @@ -17,23 +16,24 @@ error_file=File: {{file}} error_line=Line: {{line}} page_scale_width=Page Width page_scale_fit=Page Fit -page_scale_auto=Auto +page_scale_auto=Automatic Zoom +page_scale_actual=Actual Size +toggle_slider.title=Toggle Slider thumbs.title=Show Thumbnails -thumbs_icon.alt=Thumbs outline.title=Show Document Outline -outline_icon.alt=Document Outline loading=Loading... {{percent}}% loading_error_indicator=Error loading_error=An error occurred while loading the PDF. rendering_error=An error occurred while rendering the page. +page_label=Page: +page_of=of {{pageCount}} [ru] bookmark.title=Ссылка на текущий вид (скопировать или открыть в новом окне) -bookmark_icon.alt=Закладка -previous_label=Предыдущая -next_label=Следующая -print_label=Печать -download_label=Загрузить +previous.title=Предыдущая +next.title=Следующая +print.title=Печать +download.title=Загрузить zoom_out.title=Уменьшить zoom_in.title=Увеличить error_more_info=Больше информации @@ -47,43 +47,42 @@ error_line=Строка: {{line}} page_scale_width=Ширина страницы page_scale_fit=Вся страница page_scale_auto=Автоматически +page_scale_actual=Настоящий размер thumbs.title=Показать уменьшенные изображения -thumbs_icon.alt=Уменьшенные изображения outline.title=Показать содержание документа -outline_icon.alt=Содержание документа loading=Загрузка... {{percent}}% loading_error_indicator=Ошибка loading_error=Произошла ошибка во время загрузки PDF. rendering_error=Произошла ошибка во время создания страницы. - -loading=Загрузка... {{percent}}% +page_label=Страница: +page_of=из {{pageCount}} [xx] bookmark.title=<<<_¢ȗггεпţ ṿiεẂ (¢OÞӳ Oг OÞεп iп пεẂ ẂiпÐOẂ)_>>> -bookmark_icon.alt=<<<_ьOOқмãгқ_>>> -previous_label=<<<_ÞгεṿiOȗ§_>>> -next_label=<<<_пεӾţ_>>> -print_label=<<<_Þгiпţ_>>> -download_label=<<<_ÐOẂпḻOãÐ_>>> +previous.title=<<<_ÞгεṿiOȗ§_>>> +next.title=<<<_пεӾţ_>>> +print.title=<<<_Þгiпţ_>>> +download_label.title=<<<_ÐOẂпḻOãÐ_>>> zoom_out.title=<<<_ƩOOм Oȗţ_>>> zoom_in.title=<<<_ƩOOм iп_>>> error_more_info=<<<_мOгε iп£OгмãţiOп_>>> error_less_info=<<<_ḻε§§ iп£OгмãţiOп_>>> error_close=<<<_¢ḻO§ε_>>> -error_build=<<<_ÞУ.ʃ§ ьȗiḻÐ: {{ьȗiḻÐ}}_>>> -error_message=<<<_мε§§ãģε: {{мε§§ãģε}}_>>> -error_stack=<<<_§ţã¢қ: {{§ţã¢қ}}_>>> -error_file=<<<_£iḻε: {{£iḻε}}_>>> -error_line=<<<_ḻiпε: {{ḻiпε}}_>>> +error_build=<<<_ÞУ.ʃ§ ьȗiḻÐ: {{build}}_>>> +error_message=<<<_мε§§ãģε: {{message}}_>>> +error_stack=<<<_§ţã¢қ: {{stack}}_>>> +error_file=<<<_£iḻε: {{file}}_>>> +error_line=<<<_ḻiпε: {{line}}_>>> page_scale_width=<<<_Þãģε ẂiÐţН_>>> page_scale_fit=<<<_Þãģε £iţ_>>> -page_scale_auto=<<<_ãȗţO_>>> +page_scale_auto=<<<_ãȗţOмãţi¢ ƩOOм_>>> +page_scale_actual=<<<_ã¢ţȗãḻ §iƩε_>>> +toggle_slider.title=<<<_ţOģģḻε §ḻiÐεг_>>> thumbs.title=<<<_§НOẂ ţНȗмьпãiḻ§_>>> -thumbs_icon.alt=<<<_ţНȗмь§_>>> outline.title=<<<_§НOẂ ÐO¢ȗмεпţ Oȗţḻiпε_>>> -outline_icon.alt=<<<_ÐO¢ȗмεпţ Oȗţḻiпε_>>> -loading=<<<_ḻOãÐiпģ... {{Þεг¢εпţ}}%_>>> +loading=<<<_ḻOãÐiпģ... {{percent}}%_>>> loading_error_indicator=<<<_εггOг_>>> loading_error=<<<_ãп εггOг O¢¢ȗггεÐ ẂНiḻε ḻOãÐiпģ ţНε ÞУ._>>> rendering_error=<<<_ãп εггOг O¢¢ȗггεÐ ẂНiḻε гεпÐεгiпģ ţНε Þãģε._>>> - +page_label=Þãģε: +page_of=<<<_O£ {{pageCount}}_>>> diff --git a/web/viewer.css b/web/viewer.css index 9a0cf388c..2397f7ef5 100644 --- a/web/viewer.css +++ b/web/viewer.css @@ -1,175 +1,558 @@ -/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- / -/* vim: set shiftwidth=4 tabstop=8 autoindent cindent expandtab: */ - -body { - background-color: #929292; - font-family: 'Lucida Grande', 'Lucida Sans Unicode', Helvetica, Arial, Verdana, sans-serif; - margin: 0px; - padding: 0px; +* { + padding: 0; + margin: 0; } +html { + height: 100%; +} + +body { + height: 100%; + background-color: #404040; + background-image: url(images/texture.png); + font-family: Segoe UI, Verdana, sans-serif; +} + +.hidden { + display: none; +} [hidden] { display: none !important; } -/* === Toolbar === */ -#controls { - background-color: #eee; - background: -o-linear-gradient(bottom,#eee 0%,#fff 100%); - background: -moz-linear-gradient(center bottom, #eee 0%, #fff 100%); - background: -webkit-gradient(linear, left bottom, left top, color-stop(0.0, #ddd), color-stop(1.0, #fff)); - border-bottom: 1px solid #666; - padding: 3px; - position: fixed; - left: 0px; - top: 0px; - height: 24px; +/* outer/inner center provides horizontal center */ +.outerCenter { + float: right; + position: relative; + right: 50%; +} +.innerCenter { + float: right; + position: relative; + right: -50%; +} + +#outerContainer { width: 100%; - z-index: 1; - white-space:nowrap; - overflow: hidden; -} - -.separator { - display: inline; - border-left: 1px solid #d3d3d3; - border-right: 1px solid #fff; - height: 16px; - width:0px; - margin: 4px; -} - -#controls > a > img { - margin: 4px; - height: 16px; -} - -#controls > button { - line-height: 16px; -} - -#controls > button > img { - width: 16px; - height: 16px; -} - -#controls > button[disabled] > img { - opacity: 0.5; -} - -#pageNumber { - text-align: right; -} - -#fileInput { - line-height: 16px; -} - -/* === Sidebar === */ -#sidebar { - position: fixed; - width: 350px; - top: 62px; - bottom: 18px; - left: -290px; - transition: left 0.25s ease-in-out 1s; - -o-transition: left 0.25s ease-in-out 1s; - -moz-transition: left 0.25s ease-in-out 1s; - -webkit-transition: left 0.25s ease-in-out 1s; - z-index: 1; -} - -#sidebar:hover, -#sidebar.pinned { - left: 0px; - transition: left 0.25s ease-in-out 0s; - -o-transition: left 0.25s ease-in-out 0s; - -moz-transition: left 0.25s ease-in-out 0s; - -webkit-transition: left 0.25s ease-in-out 0s; -} - -#pinIcon { - position: absolute; - top: 4px; - right: 55px; - width: 15px; - height: 15px; - background: center no-repeat; - background-image: url('images/pin-up.svg'); - background-size: 15px 15px; -} - -#pinIcon:hover { - background-color: rgba(255,255,255,0.35); -} - -#sidebar.pinned #pinIcon { - background-image: url('images/pin-down.svg'); - background-size: 15px 15px; -} - -#sidebarBox { - background-color: rgba(0, 0, 0, 0.7); - width: 300px; height: 100%; - border-top-right-radius: 8px; - border-bottom-right-radius: 8px; - -moz-border-radius-topright: 8px; - -moz-border-radius-bottomright: 8px; - -webkit-border-top-right-radius: 8px; - -webkit-border-bottom-right-radius: 8px; - box-shadow: 0px 2px 8px #000; - -moz-box-shadow: 0px 2px 8px #000; - -webkit-box-shadow: 0px 2px 8px #000; } -#sidebarScrollView { +#sidebarContainer { position: absolute; + top: 0; + bottom: 0; + left: -200px; + width: 200px; + -moz-transition-property: left; + -moz-transition-duration: 200ms; + -moz-transition-timing-function: ease; + -webkit-transition-property: left; + -webkit-transition-duration: 200ms; + -webkit-transition-timing-function: ease; +} +#outerContainer.sidebarOpen > #sidebarContainer { + left: 0px; +} + +#mainContainer { + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + -moz-transition-property: left; + -moz-transition-duration: 200ms; + -moz-transition-timing-function: ease; + -webkit-transition-property: left; + -webkit-transition-duration: 200ms; + -webkit-transition-timing-function: ease; +} +#outerContainer.sidebarOpen > #mainContainer { + left: 200px; +} + +#sidebarContent { + top: 32px; + left: 0; + bottom: 0; + overflow: auto; + position: absolute; + width: 200px; + + background-color: hsla(0,0%,0%,.1); + box-shadow: inset -1px 0 0 hsla(0,0%,0%,.25); +} + +#viewerContainer { + overflow: auto; + box-shadow: inset 1px 0 0 hsla(0,0%,100%,.05); + padding-top: 30px; + position: absolute; + top: 32px; + right: 0; + bottom: 0; + left: 0; +} + +.toolbar { + position: absolute; + left: 0; + right: 0; + height: 32px; + z-index: 9999; + cursor: default; +} + +#toolbarContainer { + width: 100%; +} + +#toolbarSidebar { + width: 200px; + height: 32px; + background-image: url(images/texture.png), + -moz-linear-gradient(hsla(0,0%,30%,.99), hsla(0,0%,25%,.95)); + background-image: url(images/texture.png), + -webkit-linear-gradient(hsla(0,0%,30%,.99), hsla(0,0%,25%,.95)); + box-shadow: inset -2px 0 0 hsla(0,0%,100%,.08), + inset 0 1px 1px hsla(0,0%,0%,.15), + inset 0 -1px 0 hsla(0,0%,100%,.05), + 0 1px 0 hsla(0,0%,0%,.15), + 0 1px 1px hsla(0,0%,0%,.1); +} + +#toolbarViewer { + position: relative; + margin-left: -1px; + height: 32px; + background-image: url(images/texture.png), + -moz-linear-gradient(hsla(0,0%,32%,.99), hsla(0,0%,27%,.95)); + background-image: url(images/texture.png), + -webkit-linear-gradient(hsla(0,0%,32%,.99), hsla(0,0%,27%,.95)); + border-left: 1px solid hsla(0,0%,0%,.5); + box-shadow: inset 1px 0 0 hsla(0,0%,100%,.08), + inset 0 1px 1px hsla(0,0%,0%,.15), + inset 0 -1px 0 hsla(0,0%,100%,.05), + 0 1px 0 hsla(0,0%,0%,.15), + 0 1px 1px hsla(0,0%,0%,.1); +} + +#toolbarViewerLeft { + position: absolute; + top: 0; + left: 0; +} +#toolbarViewerRight { + position: absolute; + top: 0; + right: 0; +} +#toolbarViewerLeft > *, +#toolbarViewerMiddle > *, +#toolbarViewerRight > * { + float: left; +} + +.splitToolbarButton { + margin: 3px 2px 4px 0; + display: inline-block; +} +.splitToolbarButton > .toolbarButton { + border-radius: 0; + float: left; +} + +.toolbarButton { + border: 0 none; + background-color: rgba(0, 0, 0, 0); + width: 32px; + height: 25px; +} + +.toolbarButton[disabled] { + opacity: .5; +} + +.splitToolbarButton:hover > .toolbarButton, +.splitToolbarButton.toggled > .toolbarButton { + background-color: hsla(0,0%,0%,.12); + background-image: -moz-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); + background-image: -webkit-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); + background-clip: padding-box; + border: 1px solid hsla(0,0%,0%,.35); + border-color: hsla(0,0%,0%,.32) hsla(0,0%,0%,.38) hsla(0,0%,0%,.42); + box-shadow: 0 1px 0 hsla(0,0%,100%,.05) inset, + 0 0 1px hsla(0,0%,100%,.15) inset, + 0 1px 0 hsla(0,0%,100%,.05); + -moz-transition-property: background-color, border-color, box-shadow; + -moz-transition-duration: 150ms; + -moz-transition-timing-function: ease; + -webkit-transition-property: background-color, border-color, box-shadow; + -webkit-transition-duration: 150ms; + -webkit-transition-timing-function: ease; +} +.splitToolbarButton > .toolbarButton:hover, +.dropdownToolbarButton:hover { + background-color: hsla(0,0%,0%,.2); + box-shadow: 0 1px 0 hsla(0,0%,100%,.05) inset, + 0 0 1px hsla(0,0%,100%,.15) inset, + 0 0 1px hsla(0,0%,0%,.05); + z-index: 199; +} +.splitToolbarButton > .toolbarButton:first-child { + position: relative; + margin: 0; + margin-right: -1px; + border-top-left-radius: 2px; + border-bottom-left-radius: 2px; + border-right-color: transparent; +} +.splitToolbarButton > .toolbarButton:last-child { + position: relative; + margin: 0; + margin-left: -1px; + border-top-right-radius: 2px; + border-bottom-right-radius: 2px; + border-left-color: transparent; +} +.splitToolbarButtonSeparator { + padding: 8px 0; + width: 1px; + background-color: hsla(0,0%,00%,.5); + z-index: 99; + box-shadow: 0 0 0 1px hsla(0,0%,100%,.08); + display: inline-block; + margin: 5px 0; + float:left; +} +.splitToolbarButton:hover > .splitToolbarButtonSeparator, +.splitToolbarButton.toggled > .splitToolbarButtonSeparator { + padding: 12px 0; + margin: 0; + box-shadow: 0 0 0 1px hsla(0,0%,100%,.03); + -moz-transition-property: padding; + -moz-transition-duration: 10ms; + -moz-transition-timing-function: ease; + -webkit-transition-property: padding; + -webkit-transition-duration: 10ms; + -webkit-transition-timing-function: ease; +} + +.toolbarButton, +.dropdownToolbarButton { + min-width: 16px; + padding: 2px 6px 0; + margin: 3px 2px 4px 0; + border: 1px solid transparent; + border-radius: 2px; + color: hsl(0,0%,95%); + font-size: 12px; + line-height: 14px; + -moz-user-select:none; + -webkit-user-select:none; + cursor: default; + -moz-transition-property: background-color, border-color, box-shadow; + -moz-transition-duration: 150ms; + -moz-transition-timing-function: ease; + -webkit-transition-property: background-color, border-color, box-shadow; + -webkit-transition-duration: 150ms; + -webkit-transition-timing-function: ease; +} + +.toolbarButton:hover, +.dropdownToolbarButton { + background-color: hsla(0,0%,0%,.12); + background-image: -moz-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); + background-image: -webkit-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); + background-clip: padding-box; + border: 1px solid hsla(0,0%,0%,.35); + border-color: hsla(0,0%,0%,.32) hsla(0,0%,0%,.38) hsla(0,0%,0%,.42); + box-shadow: 0 1px 0 hsla(0,0%,100%,.05) inset, + 0 0 1px hsla(0,0%,100%,.15) inset, + 0 1px 0 hsla(0,0%,100%,.05); +} + +.toolbarButton:hover:active, +.dropdownToolbarButton:hover:active { + background-color: hsla(0,0%,0%,.2); + background-image: -moz-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); + background-image: -webkit-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); + border-color: hsla(0,0%,0%,.35) hsla(0,0%,0%,.4) hsla(0,0%,0%,.45); + box-shadow: 0 1px 1px hsla(0,0%,0%,.1) inset, + 0 0 1px hsla(0,0%,0%,.2) inset, + 0 1px 0 hsla(0,0%,100%,.05); + -moz-transition-property: background-color, border-color, box-shadow; + -moz-transition-duration: 10ms; + -moz-transition-timing-function: linear; + -webkit-transition-property: background-color, border-color, box-shadow; + -webkit-transition-duration: 10ms; + -webkit-transition-timing-function: linear; +} + +.toolbarButton.toggled, +.splitToolbarButton.toggled > .toolbarButton.toggled { + background-color: hsla(0,0%,0%,.3); + background-image: -moz-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); + background-image: -webkit-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); + border-color: hsla(0,0%,0%,.4) hsla(0,0%,0%,.45) hsla(0,0%,0%,.5); + box-shadow: 0 1px 1px hsla(0,0%,0%,.1) inset, + 0 0 1px hsla(0,0%,0%,.2) inset, + 0 1px 0 hsla(0,0%,100%,.05); + -moz-transition-property: background-color, border-color, box-shadow; + -moz-transition-duration: 10ms; + -moz-transition-timing-function: linear; + -webkit-transition-property: background-color, border-color, box-shadow; + -webkit-transition-duration: 10ms; + -webkit-transition-timing-function: linear; +} + +.toolbarButton.toggled:hover:active, +.splitToolbarButton.toggled > .toolbarButton.toggled:hover:active { + background-color: hsla(0,0%,0%,.4); + border-color: hsla(0,0%,0%,.4) hsla(0,0%,0%,.5) hsla(0,0%,0%,.55); + box-shadow: 0 1px 1px hsla(0,0%,0%,.2) inset, + 0 0 1px hsla(0,0%,0%,.3) inset, + 0 1px 0 hsla(0,0%,100%,.05); +} + +.dropdownToolbarButton { + min-width: 120px; + max-width: 120px; + padding: 3px 2px 2px; overflow: hidden; - overflow-y: auto; - top: 20px; - bottom: 10px; - left: 10px; - width: 280px; + background: url(images/toolbarButton-menuArrows.png) no-repeat 95%; +} + +.dropdownToolbarButton > select { + -moz-appearance: none; /* in the future this might matter, see bugzilla bug #649849 */ + -webkit-appearance: none; + min-width: 140px; + font-size: 12px; + color: hsl(0,0%,95%); + margin:0; + padding:0; + border:none; + background: transparent; +} + +#customScaleOption { + display: none; +} + +#pageWidthOption { + border-bottom: 1px rgba(255, 255, 255, .5) solid; +} + +.splitToolbarButton:first-child, +.toolbarButton:first-child { + margin-left: 4px; +} +.splitToolbarButton:last-child, +.toolbarButton:last-child { + margin-right: 4px; +} + +.toolbarButtonSpacer { + width: 30px; + display: inline-block; + height: 1px; +} + +.toolbarButtonFlexibleSpacer { + -moz-box-flex: 1; + -webkit-box-flex: 1; + min-width: 30px; +} + +.toolbarButton#sidebarToggle::before { + display: inline-block; + content: url(images/toolbarButton-sidebarToggle.png); +} + +.toolbarButton.pageUp::before { + display: inline-block; + content: url(images/toolbarButton-pageUp.png); +} + +.toolbarButton.pageDown::before { + display: inline-block; + content: url(images/toolbarButton-pageDown.png); +} + +.toolbarButton.zoomOut::before { + display: inline-block; + content: url(images/toolbarButton-zoomOut.png); +} + +.toolbarButton.zoomIn::before { + display: inline-block; + content: url(images/toolbarButton-zoomIn.png); +} + +.toolbarButton.print::before { + display: inline-block; + content: url(images/toolbarButton-print.png); +} + +.toolbarButton.download::before { + display: inline-block; + content: url(images/toolbarButton-download.png); +} + +.toolbarButton.bookmark { + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + box-sizing: border-box; + margin-top: 3px; + padding-top: 4px; +} + +.toolbarButton.bookmark::before { + content: url(images/toolbarButton-bookmark.png); +} + +#viewThumbnail.toolbarButton::before { + display: inline-block; + content: url(images/toolbarButton-viewThumbnail.png); +} + +#viewOutline.toolbarButton::before { + display: inline-block; + content: url(images/toolbarButton-viewOutline.png); +} + +.toolbarField { + min-width: 16px; + width: 32px; + padding: 3px 6px; + margin: 4px 0 4px 0; + border: 1px solid transparent; + border-radius: 2px; + background-color: hsla(0,0%,100%,.09); + background-image: -moz-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); + background-clip: padding-box; + border: 1px solid hsla(0,0%,0%,.35); + border-color: hsla(0,0%,0%,.32) hsla(0,0%,0%,.38) hsla(0,0%,0%,.42); + box-shadow: 0 1px 0 hsla(0,0%,0%,.05) inset, + 0 1px 0 hsla(0,0%,100%,.05); + color: hsl(0,0%,95%); + font-size: 12px; + line-height: 14px; + text-align: right; + outline-style: none; + -moz-transition-property: background-color, border-color, box-shadow; + -moz-transition-duration: 150ms; + -moz-transition-timing-function: ease; +} + +.toolbarField.pageNumber { + width: 40px; +} + +.toolbarField.pageNumber::-webkit-inner-spin-button, +.toolbarField.pageNumber::-webkit-outer-spin-button { + -webkit-appearance: none; + margin: 0; +} + +.toolbarField:hover { + background-color: hsla(0,0%,100%,.11); + border-color: hsla(0,0%,0%,.4) hsla(0,0%,0%,.43) hsla(0,0%,0%,.45); +} + +.toolbarField:focus { + background-color: hsla(0,0%,100%,.15); + border-color: hsla(204,100%,65%,.8) hsla(204,100%,65%,.85) hsla(204,100%,65%,.9); +} + +.toolbarLabel { + min-width: 16px; + padding: 3px 6px 3px 2px; + margin: 4px 2px 4px 0; + border: 1px solid transparent; + border-radius: 2px; + color: hsl(0,0%,85%); + font-size: 12px; + line-height: 14px; + text-align: left; + -moz-user-select:none; + -webkit-user-select:none; + cursor: default; +} + +#thumbnailView { + position: fixed; + width: 120px; + top: 33px; + bottom: 0; + padding: 10px 40px 0; + overflow: auto; } .thumbnail { - width: 134px; - height: 134px; - margin-top: 5px; - margin-bottom: 5px; - margin-left:auto; - margin-right:auto; - line-height: 134px; - text-align: center; - overflow: hidden; + margin-bottom: 15px; + float: left; + width: 114px; + height: 142px; } .thumbnail:not([data-loaded]) { - background-color: gray; + border: 1px dashed rgba(255, 255, 255, 0.5); } -.thumbnail > canvas { - vertical-align: middle; - display: inline-block; +.thumbnailImage { + -moz-transition-duration: 150ms; + border: 1px solid transparent; + box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3); + opacity: 0.8; + z-index: 99; } -#outlineScrollView { - position: absolute; - background-color: #fff; - overflow: auto; - top: 20px; - bottom: 10px; - left: 10px; - width: 280px; +.thumbnailSelectionRing { + border-radius: 2px; + padding: 7px; + -moz-transition-duration: 150ms; +} + +.thumbnail:hover > .thumbnailSelectionRing > .thumbnailImage { + opacity: .9; +} + +.thumbnail:hover > .thumbnailSelectionRing { + background-color: hsla(0,0%,100%,.15); + background-image: -moz-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); + background-clip: padding-box; + box-shadow: 0 1px 0 hsla(0,0%,100%,.05) inset, + 0 0 1px hsla(0,0%,100%,.2) inset, + 0 0 1px hsla(0,0%,0%,.2); + color: hsla(0,0%,100%,.9); +} + +.thumbnail.selected > .thumbnailSelectionRing > .thumbnailImage { + box-shadow: 0 0 0 1px hsla(0,0%,0%,.5); + opacity: 1; +} + +.thumbnail.selected > .thumbnailSelectionRing { + background-color: hsla(0,0%,100%,.3); + background-image: -moz-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); + background-clip: padding-box; + box-shadow: 0 1px 0 hsla(0,0%,100%,.05) inset, + 0 0 1px hsla(0,0%,100%,.1) inset, + 0 0 1px hsla(0,0%,0%,.2); + color: hsla(0,0%,100%,1); } #outlineView { - padding-top: 4px; - padding-bottom: 100px; - padding-left: 6px; - padding-right: 6px; - font-size: smaller; + position: fixed; + width: 192px; + top: 33px; + bottom: 0; + padding: 4px 4px 0; + overflow: auto; + -moz-user-select:none; + -webkit-user-select:none; } .outlineItem > .outlineItems { @@ -178,44 +561,47 @@ body { .outlineItem > a { text-decoration: none; - color: black; + display: block; + height: 20px; + padding: 2px 0 0 10px; + margin-bottom: 1px; + border-radius: 2px; + color: hsla(0,0%,100%,.8); + font-size: 13px; + line-height: 15px; + -moz-user-select:none; + cursor: default; + white-space: nowrap; } .outlineItem > a:hover { - background: #ff0; - box-shadow: 0px 2px 10px #ff0; + background-color: hsla(0,0%,100%,.02); + background-image: -moz-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); + background-clip: padding-box; + box-shadow: 0 1px 0 hsla(0,0%,100%,.05) inset, + 0 0 1px hsla(0,0%,100%,.2) inset, + 0 0 1px hsla(0,0%,0%,.2); + color: hsla(0,0%,100%,.9); } -#sidebarControls { - position:absolute; - width: 120px; - height: 32px; - left: 15px; - bottom: 35px; +.outlineItem.selected { + background-color: hsla(0,0%,100%,.08); + background-image: -moz-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); + background-clip: padding-box; + box-shadow: 0 1px 0 hsla(0,0%,100%,.05) inset, + 0 0 1px hsla(0,0%,100%,.1) inset, + 0 0 1px hsla(0,0%,0%,.2); + color: hsla(0,0%,100%,1); } -#sidebarControls > button { - box-shadow: 0px 4px 10px #000; - -moz-box-shadow: 0px 4px 10px #000; - -webkit-box-shadow: 0px 4px 10px #000; +.noOutline { + font-size: 12px; + color: hsla(0,0%,100%,.8); + font-style: italic; } -#sidebarControls > button > img { - width: 32px; - height: 32px; -} -#sidebarControls > button[disabled] > img { - opacity: 0.5; -} -#sidebarControls > button[data-selected] { - box-shadow: 0px 4px 10px #ff0; - -moz-box-shadow: 0px 4px 10px #ff0; - -webkit-box-shadow: 0px 4px 10px #ff0; -} - -/* === Content view === */ canvas { margin: auto; display: block; @@ -256,6 +642,50 @@ canvas { background: url('images/loading-icon.gif') center no-repeat; } +#loadingBox { + margin: 100px 0; + text-align: center; + color: #ddd; + font-size: 14px; +} + +#loadingBar { + background-color: #333; + display: inline-block; + border: 1px solid black; + clear: both; + margin: 0px; + margin-top: 5px; + line-height: 0; + border-radius: 4px; + width: 200px; + height: 25px; +} + +#loadingBar .progress { + display: inline-block; + float: left; + + background: #666; + background: -moz-linear-gradient(top, #999 0%, #666 50%, #999 100%); + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#999), color-stop(50%,#666), color-stop(100%,#999)); + background: -webkit-linear-gradient(top, #999 0%,#666 50%,#999 100%); + background: -o-linear-gradient(top, #999 0%,#666 50%,#999 100%); + background: -ms-linear-gradient(top, #999 0%,#666 50%,#999 100%); + background: linear-gradient(top, #999 0%,#666 50%,#999 100%); + + border-top-left-radius: 3px; + border-bottom-left-radius: 3px; + + width: 0%; + height: 100%; +} + +#loadingBar .progress.full { + border-top-right-radius: 3px; + border-bottom-right-radius: 3px; +} + .textLayer { position: absolute; left: 0; @@ -272,6 +702,12 @@ canvas { line-height:1.3; } +/* TODO: file FF bug to support ::-moz-selection:window-inactive + so we can override the opaque grey background when the window is inactive; + see https://bugzilla.mozilla.org/show_bug.cgi?id=706209 */ +::selection { background:rgba(0,0,255,0.3); } +::-moz-selection { background:rgba(0,0,255,0.3); } + .annotComment > div { position: absolute; } @@ -301,39 +737,13 @@ canvas { margin: 0px; } -/* TODO: file FF bug to support ::-moz-selection:window-inactive - so we can override the opaque grey background when the window is inactive; - see https://bugzilla.mozilla.org/show_bug.cgi?id=706209 */ -::selection { background:rgba(0,0,255,0.3); } -::-moz-selection { background:rgba(0,0,255,0.3); } - -#viewer { - margin: 44px 0px 0px; - padding: 8px 0px; -} - -#sidebarView canvas:hover { - background: #ff0; - box-shadow: 0px 2px 10px #ff0; - -moz-box-shadow: 0px 2px 10px #ff0; - -webkit-box-shadow: 0px 2px 10px #ff0; -} - -#pageWidthOption { - border-top: 1px solid black; -} - -#customScaleOption { - display: none; -} - #errorWrapper { background: none repeat scroll 0 0 #FF5555; color: white; left: 0; - position: fixed; + position: absolute; right: 0; - top: 30px; + top: 32px; z-index: 1000; padding: 3px; font-size: 0.8em; @@ -359,116 +769,56 @@ canvas { clear: both; } -/* === Printed media overrides === */ -@media print { - #sidebar { - display: none; - } - - #controls { - display: none; - } - - #viewer { - margin: 0; - padding: 0; - } - - .page { - display: none; - margin: 0; - } - - .page canvas { - box-shadow: none; - -moz-box-shadow: none; - -webkit-box-shadow: none; - } - - .page[data-loaded] { - display: block; - page-break-after: always; - } -} - -#loadingBox { - margin: 100px 0; - text-align: center; -} - -#loadingBar { - background-color: #333; - display: inline-block; - border: 1px solid black; - clear: both; - margin:0px; - line-height: 0; - border-radius: 4px; - width: 15em; - height: 1.5em; -} - -#loadingBar .progress { - background-color: green; - display: inline-block; - float: left; - - background: #b4e391; - background: -moz-linear-gradient(top, #b4e391 0%, #61c419 50%, #b4e391 100%); - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#b4e391), color-stop(50%,#61c419), color-stop(100%,#b4e391)); - background: -webkit-linear-gradient(top, #b4e391 0%,#61c419 50%,#b4e391 100%); - background: -o-linear-gradient(top, #b4e391 0%,#61c419 50%,#b4e391 100%); - background: -ms-linear-gradient(top, #b4e391 0%,#61c419 50%,#b4e391 100%); - background: linear-gradient(top, #b4e391 0%,#61c419 50%,#b4e391 100%); - - border-top-left-radius: 3px; - border-bottom-left-radius: 3px; - - width: 0%; - height: 100%; +.fileInput { + background: white; + color: black; + margin-top: 5px; } #PDFBug { - font-size: 10px; + background: none repeat scroll 0 0 white; + border: 1px solid #666666; position: fixed; - top: 35px; - bottom: 5px; - right: 2px; - width: 300px; - background: white; - border: 1px solid #666; - padding: 0; -} -#PDFBug .controls { - border-bottom: 1px solid #666; - padding: 3px; - background: -moz-linear-gradient(center bottom, #eee 0%, #fff 100%); -} -#PDFBug .panels { - overflow: auto; - position: absolute; - top: 27px; - left: 0; + top: 32px; right: 0; bottom: 0; + font-size: 10px; + padding: 0; + width: 300px; +} +#PDFBug .controls { + background:#EEEEEE; + border-bottom: 1px solid #666666; + padding: 3px; +} +#PDFBug .panels { + bottom: 0; + left: 0; + overflow: auto; + position: absolute; + right: 0; + top: 27px; } #PDFBug button.active { font-weight: bold; } .debuggerShowText { - background: yellow; + background: none repeat scroll 0 0 yellow; color: blue; opacity: 0.3; } .debuggerHideText:hover { - background: yellow; + background: none repeat scroll 0 0 yellow; opacity: 0.3; } #PDFBug .stats { + font-family: courier; font-size: 10px; white-space: pre; - font-family: courier; } #PDFBug .stats .title { - font-weight: bold; + font-weight: bold; +} +#PDFBug table { + font-size: 10px; } diff --git a/web/viewer.html b/web/viewer.html index 95c92b0f7..b90464c48 100644 --- a/web/viewer.html +++ b/web/viewer.html @@ -1,153 +1,146 @@ - - Simple pdf.js page viewer - + + PDF.js viewer + - - + + - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + -
- +
- - -
- - - - / - -- - -
- - - - -
- - - -
- - - - - -
- - - -
- - - Bookmark - - -
- - -