diff --git a/extensions/firefox/components/PdfStreamConverter.js b/extensions/firefox/components/PdfStreamConverter.js index 23fd7b4c7..5332fb779 100644 --- a/extensions/firefox/components/PdfStreamConverter.js +++ b/extensions/firefox/components/PdfStreamConverter.js @@ -765,33 +765,28 @@ PdfStreamConverter.prototype = { // We get the DOM window here instead of before the request since it // may have changed during a redirect. var domWindow = getDOMWindow(channel); - // Double check the url is still the correct one. - if (domWindow.document.documentURIObject.equals(aRequest.URI)) { - var actions; - if (rangeRequest) { - // We are going to be issuing range requests, so cancel the - // original request - aRequest.resume(); - aRequest.cancel(Cr.NS_BINDING_ABORTED); - actions = new RangedChromeActions(domWindow, - contentDispositionFilename, aRequest); - } else { - actions = new StandardChromeActions( - domWindow, contentDispositionFilename, dataListener); - } - var requestListener = new RequestListener(actions); - domWindow.addEventListener(PDFJS_EVENT_ID, function(event) { - requestListener.receive(event); - }, false, true); - if (actions.supportsIntegratedFind()) { - var chromeWindow = getChromeWindow(domWindow); - var findEventManager = new FindEventManager(chromeWindow.gFindBar, - domWindow, - chromeWindow); - findEventManager.bind(); - } + var actions; + if (rangeRequest) { + // We are going to be issuing range requests, so cancel the + // original request + aRequest.resume(); + aRequest.cancel(Cr.NS_BINDING_ABORTED); + actions = new RangedChromeActions(domWindow, + contentDispositionFilename, aRequest); } else { - log('Dom window url did not match request url.'); + actions = new StandardChromeActions( + domWindow, contentDispositionFilename, dataListener); + } + var requestListener = new RequestListener(actions); + domWindow.addEventListener(PDFJS_EVENT_ID, function(event) { + requestListener.receive(event); + }, false, true); + if (actions.supportsIntegratedFind()) { + var chromeWindow = getChromeWindow(domWindow); + var findEventManager = new FindEventManager(chromeWindow.gFindBar, + domWindow, + chromeWindow); + findEventManager.bind(); } listener.onStopRequest(aRequest, context, statusCode); } diff --git a/l10n/es-MX/metadata.inc b/l10n/es-MX/metadata.inc deleted file mode 100644 index 650c5d805..000000000 --- a/l10n/es-MX/metadata.inc +++ /dev/null @@ -1,8 +0,0 @@ - - - es-MX - PDF Viewer - Utiliza HTML5 para mostrar archivos PDF directamente en Firefox. - - - diff --git a/l10n/es-MX/viewer.properties b/l10n/es-MX/viewer.properties deleted file mode 100644 index e7aff0612..000000000 --- a/l10n/es-MX/viewer.properties +++ /dev/null @@ -1,121 +0,0 @@ -# Copyright 2012 Mozilla Foundation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Main toolbar buttons (tooltips and alt text for images) -previous.title=Página anterior -previous_label=Anterior -next.title=Página siguiente -next_label=Siguiente - -# LOCALIZATION NOTE (page_label, page_of): -# These strings are concatenated to form the "Page: X of Y" string. -# Do not translate "{{pageCount}}", it will be substituted with a number -# representing the total number of pages. -page_label=Página: -page_of=of {{pageCount}} - -zoom_out.title=Reducir -zoom_out_label=Reducir -zoom_in.title=Aumentar -zoom_in_label=Aumentar -zoom.title=Tamaño -print.title=Imprimir -print_label=Imprimir -presentation_mode.title=Cambiar al modo de presentación -presentation_mode_label=Modo de presentación -open_file.title=Abrir archivo -open_file_label=Abrir -download.title=Descargar -download_label=Descargar -bookmark.title=Vista actual (copiar o abrir en una nueva ventana) -bookmark_label=Vista actual - -# Tooltips and alt text for side panel toolbar buttons -# (the _label strings are alt text for the buttons, the .title strings are -# tooltips) -toggle_sidebar.title=Activar barra lateral -toggle_sidebar_label=Activar barra lateral -outline.title=Mostrar el esquema del documento -outline_label=Esquema del documento -thumbs.title=Mostrar miniaturas -thumbs_label=Miniaturas -findbar.title=Buscar en el documento -findbar_label=Buscar - -# Thumbnails panel item (tooltip and alt text for images) -# LOCALIZATION NOTE (thumb_page_title): "{{page}}" will be replaced by the page -# number. -thumb_page_title=Página {{page}} -# LOCALIZATION NOTE (thumb_page_canvas): "{{page}}" will be replaced by the page -# number. -thumb_page_canvas=Miniatura o página {{page}} - -# Context menu -first_page.label=Ir a la primera página -last_page.label=Ir a la última página -page_rotate_cw.label=Girar hacia la derecha -page_rotate_ccw.label=Girar hacia la izquierda - -# Find panel button title and messages -find_label=Buscar: -find_previous.title=Ir a la anterior frase encontrada -find_previous_label=Anterior -find_next.title=Ir a la siguiente frase encontrada -find_next_label=Siguiente -find_highlight=Marcar todo -find_match_case_label=Coincidir con mayúsculas y minúsculas -find_reached_top=Inicio del documento, se continúa desde el final -find_reached_bottom=Final del documento, se continúa desde el inicio -find_not_found=No se encontró la frase - -# Error panel labels -error_more_info=Más información -error_less_info=Menos información -error_close=Cerrar -# LOCALIZATION NOTE (error_version_info): "{{version}}" and "{{build}}" will be -# replaced by the PDF.JS version and build ID. -error_version_info=PDF.js v{{version}} (compilación: {{build}}) -# LOCALIZATION NOTE (error_message): "{{message}}" will be replaced by an -# english string describing the error. -error_message=Mensaje: {{message}} -# LOCALIZATION NOTE (error_stack): "{{stack}}" will be replaced with a stack -# trace. -error_stack=Pila: {{stack}} -# LOCALIZATION NOTE (error_file): "{{file}}" will be replaced with a filename -error_file=Archivo: {{file}} -# LOCALIZATION NOTE (error_line): "{{line}}" will be replaced with a line number -error_line=Línea: {{line}} -rendering_error=Ocurrió un error al interpretar la página. - -# Predefined zoom values -page_scale_width=Ancho de página -page_scale_fit=Ajustar a la página -page_scale_auto=Ampliación automática -page_scale_actual=Tamaño real - -# Loading indicator messages -loading_error_indicator=Error -loading_error=Ocurrió un error al cargar el PDF. -invalid_file_error=Archivo PDF inválido o corrupto. -missing_file_error=Archivo PDF faltante. - -# LOCALIZATION NOTE (text_annotation_type): This is used as a tooltip. -# "{{type}}" will be replaced with an annotation type from a list defined in -# the PDF spec (32000-1:2008 Table 169 – Annotation types). -# Some common types are e.g.: "Check", "Text", "Comment", "Note" -text_annotation_type=[Anotación {{type}}] -request_password=El archivo PDF está protegido por contraseña: - -printing_not_supported=Advertencia: la impresión no está completamente soportada en este navegador. -web_fonts_disabled=Las tipografías web están deshabilitadas: no es posible utilizar tipografías PDF incrustadas. diff --git a/l10n/es/chrome.properties b/l10n/es/chrome.properties new file mode 100644 index 000000000..31c36187c --- /dev/null +++ b/l10n/es/chrome.properties @@ -0,0 +1,18 @@ +# Copyright 2012 Mozilla Foundation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Chrome notification bar messages and buttons +unsupported_feature=Es posible que este documento PDF no se muestre correctamente. +open_with_different_viewer=Abrir con un visor diferente +open_with_different_viewer.accessKey=a diff --git a/l10n/es/viewer.properties b/l10n/es/viewer.properties index 7125ccc05..059eed69a 100644 --- a/l10n/es/viewer.properties +++ b/l10n/es/viewer.properties @@ -1,104 +1,123 @@ -# Copyright 2012 Mozilla Foundation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Main toolbar buttons (tooltips and alt text for images) -previous.title=Página anterior -previous_label=Anterior -next.title=Página siguiente -next_label=Siguiente - -# LOCALIZATION NOTE (page_label, page_of): -# These strings are concatenated to form the "Page: X of Y" string. -# Do not translate "{{pageCount}}", it will be substituted with a number -# representing the total number of pages. -page_label=Página: -page_of=de {{pageCount}} - -zoom_out.title=Reducir -zoom_out_label=Reducir -zoom_in.title=Ampliar -zoom_in_label=Ampliar -zoom.title=Ampliación -print.title=Imprimir -print_label=Imprimir -fullscreen.title=Pantalla completa -fullscreen_label=Pantalla completa -open_file.title=Abrir archivo -open_file_label=Abrir -download.title=Descargar -download_label=Descargar -bookmark.title=Vista actual (copie o abra en una ventana nueva) -bookmark_label=Vista actual - -# Tooltips and alt text for side panel toolbar buttons -# (the _label strings are alt text for the buttons, the .title strings are -# tooltips) -toggle_slider.title=Alternar deslizador -toggle_slider_label=Alternar deslizador -outline.title=Mostrar esquema del documento -outline_label=Esquema del documento -thumbs.title=Mostrar miniaturas -thumbs_label=Miniaturas -findbar.title=Buscar en el documento -findbar_label=Buscar - -# Thumbnails panel item (tooltip and alt text for images) -# LOCALIZATION NOTE (thumb_page_title): "{{page}}" will be replaced by the page -# number. -thumb_page_title=Página {{page}} -# LOCALIZATION NOTE (thumb_page_canvas): "{{page}}" will be replaced by the page -# number. -thumb_page_canvas=Miniatura de la página {{page}} - -# Find panel button title and messages -find=Buscar -find_terms_not_found=(No encontrado) - -# Error panel labels -error_more_info=Más información -error_less_info=Menos información -error_close=Cerrar -# LOCALIZATION NOTE (error_build): "{{build}}" will be replaced by the PDF.JS -# build ID. -error_build=Compilación de PDF.JS: {{build}} -# LOCALIZATION NOTE (error_message): "{{message}}" will be replaced by an -# english string describing the error. -error_message=Mensaje: {{message}} -# LOCALIZATION NOTE (error_stack): "{{stack}}" will be replaced with a stack -# trace. -error_stack=Pila: {{stack}} -# LOCALIZATION NOTE (error_file): "{{file}}" will be replaced with a filename -error_file=Archivo: {{file}} -# LOCALIZATION NOTE (error_line): "{{line}}" will be replaced with a line number -error_line=Línea: {{line}} -rendering_error=Ocurrió un error mientras se renderizaba la página. - -# Predefined zoom values -page_scale_width=Anchura de página -page_scale_fit=Ajustar a la página -page_scale_auto=Ampliación automática -page_scale_actual=Tamaño real - -# Loading indicator messages -loading_error_indicator=Error -loading_error=Ocurrió un error mientras se cargaba el PDF. - -# LOCALIZATION NOTE (text_annotation_type): This is used as a tooltip. -# "{{type}}" will be replaced with an annotation type from a list defined in -# the PDF spec (32000-1:2008 Table 169 – Annotation types). -# Some common types are e.g.: "Check", "Text", "Comment", "Note" -text_annotation_type=[Anotación {{type}}] -request_password=El PDF está protegido con una contraseña: - -printing_not_supported=Aviso: La impresión no es compatible totalmente con este navegador. +# Copyright 2012 Mozilla Foundation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Main toolbar buttons (tooltips and alt text for images) +previous.title=Página anterior +previous_label=Anterior +next.title=Página siguiente +next_label=Siguiente + +# LOCALIZATION NOTE (page_label, page_of): +# These strings are concatenated to form the "Page: X of Y" string. +# Do not translate "{{pageCount}}", it will be substituted with a number +# representing the total number of pages. +page_label=Página: +page_of=de {{pageCount}} + +zoom_out.title=Reducir +zoom_out_label=Reducir +zoom_in.title=Aumentar +zoom_in_label=Aumentar +zoom.title=Ampliación +print.title=Imprimir +print_label=Imprimir +presentation_mode.title=Cambiar al modo de presentación +presentation_mode_label=Modo de presentación +open_file.title=Abrir un archivo +open_file_label=Abrir +download.title=Descargar +download_label=Descargar +bookmark.title=Vista actual (copie o abra en una ventana nueva) +bookmark_label=Vista actual + +# Tooltips and alt text for side panel toolbar buttons +# (the _label strings are alt text for the buttons, the .title strings are +# tooltips) +toggle_sidebar.title=Mostrar u ocultar la barra lateral +toggle_sidebar_label=Conmutar la barra lateral +outline.title=Mostrar el esquema del documento +outline_label=Esquema del documento +thumbs.title=Mostrar las miniaturas +thumbs_label=Miniaturas +findbar.title=Buscar en el documento +findbar_label=Buscar + +# Thumbnails panel item (tooltip and alt text for images) +# LOCALIZATION NOTE (thumb_page_title): "{{page}}" will be replaced by the page +# number. +thumb_page_title=Página {{page}} +# LOCALIZATION NOTE (thumb_page_canvas): "{{page}}" will be replaced by the page +# number. +thumb_page_canvas=Miniatura de la página {{page}} + +# Context menu +first_page.label=Ir a la primera página +last_page.label=Ir a la última página +page_rotate_cw.label=Girar a la derecha +page_rotate_ccw.label=Girar a la izquierda + +# Find panel button title and messages +find_label=Buscar: +find_previous.title=Ir a la frase encontrada anterior +find_previous_label=Anterior +find_next.title=Ir a la frase encontrada siguiente +find_next_label=Siguiente +find_highlight=Resaltar todo +find_match_case_label=Coincidir mayúsculas y minúsculas +find_reached_top=Se alcanzó el inicio del documento, se continúa desde el final +find_reached_bottom=Se alcanzó el final del documento, se continúa desde el inicio +find_not_found=No se encontró la frase + +# Error panel labels +error_more_info=Más información +error_less_info=Menos información +error_close=Cerrar +# LOCALIZATION NOTE (error_version_info): "{{version}}" and "{{build}}" will be +# replaced by the PDF.JS version and build ID. +error_version_info=PDF.js v{{version}} (compilación: {{build}}) +# LOCALIZATION NOTE (error_message): "{{message}}" will be replaced by an +# english string describing the error. +error_message=Mensaje: {{message}} +# LOCALIZATION NOTE (error_stack): "{{stack}}" will be replaced with a stack +# trace. +error_stack=Pila: {{stack}} +# LOCALIZATION NOTE (error_file): "{{file}}" will be replaced with a filename +error_file=Archivo: {{file}} +# LOCALIZATION NOTE (error_line): "{{line}}" will be replaced with a line number +error_line=Línea: {{line}} +rendering_error=Ocurrió un error al renderizar la página. + +# Predefined zoom values +page_scale_width=Anchura de la página +page_scale_fit=Ajustar a la página +page_scale_auto=Ampliación automática +page_scale_actual=Tamaño real + +# Loading indicator messages +loading_error_indicator=Error +loading_error=Ocurrió un error al cargar el PDF. +invalid_file_error=El archivo PDF no es válido o está dañado. +missing_file_error=Falta el archivo PDF. + +# LOCALIZATION NOTE (text_annotation_type): This is used as a tooltip. +# "{{type}}" will be replaced with an annotation type from a list defined in +# the PDF spec (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +text_annotation_type=[Anotación {{type}}] +request_password=El archivo PDF está protegido por una contraseña: + +printing_not_supported=Aviso: Este navegador no es compatible completamente con la impresión. +printing_not_ready=Aviso: El PDF no se ha cargado completamente para su impresión. +web_fonts_disabled=Se han desactivado los tipos de letra web: no se pueden usar los tipos de letra incrustados en el PDF. +web_colors_disabled=Se han desactivado los colores web. diff --git a/l10n/es-MX/chrome.properties b/l10n/ko/chrome.properties similarity index 83% rename from l10n/es-MX/chrome.properties rename to l10n/ko/chrome.properties index 755920bf3..fcd2f8f4f 100644 --- a/l10n/es-MX/chrome.properties +++ b/l10n/ko/chrome.properties @@ -13,6 +13,6 @@ # limitations under the License. # Chrome notification bar messages and buttons -unsupported_feature=Este documento PDF podría no mostrarse correctamente. -open_with_different_viewer=Abrir con un lector distinto +unsupported_feature=이 PDF 문서는 제대로 표시되지 않을 수 있습니다. +open_with_different_viewer=다른 뷰어로 열기 open_with_different_viewer.accessKey=o diff --git a/l10n/ko/metadata.inc b/l10n/ko/metadata.inc new file mode 100644 index 000000000..04a8f0786 --- /dev/null +++ b/l10n/ko/metadata.inc @@ -0,0 +1,8 @@ + + + ko + PDF 뷰어 + Firefox가 PDF 파일을 HTML5를 이용하여 직접 보여줍니다. + + + diff --git a/l10n/ko/viewer.properties b/l10n/ko/viewer.properties new file mode 100644 index 000000000..240a15138 --- /dev/null +++ b/l10n/ko/viewer.properties @@ -0,0 +1,123 @@ +# Copyright 2012 Mozilla Foundation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Main toolbar buttons (tooltips and alt text for images) +previous.title=이전 쪽 +previous_label=이전 +next.title=다음 쪽 +next_label=다음 + +# LOCALIZATION NOTE (page_label, page_of): +# These strings are concatenated to form the "Page: X of Y" string. +# Do not translate "{{pageCount}}", it will be substituted with a number +# representing the total number of pages. +page_label=쪽: +page_of=/ {{pageCount}} + +zoom_out.title=축소 +zoom_out_label=축소 +zoom_in.title=확대 +zoom_in_label=확대 +zoom.title=확대 비율 +print.title=출력 +print_label=출력 +presentation_mode.title=프레젠테이션 모드로 전환 +presentation_mode_label=프레젠테이션 모드 +open_file.title=파일 열기 +open_file_label=열기 +download.title=내려받기 +download_label=내려받기 +bookmark.title=현 화면 (복사하거나 새 창에서 열기) +bookmark_label=현 화면 + +# Tooltips and alt text for side panel toolbar buttons +# (the _label strings are alt text for the buttons, the .title strings are +# tooltips) +toggle_sidebar.title=사이드바 보이기/숨기기 +toggle_sidebar_label=사이드바 보이기/숨기기 +outline.title=문서 개요 보이기 +outline_label=문서 개요 +thumbs.title=쪽 작게 보기 +thumbs_label=쪽 작게 보기 +findbar.title=문서 내에서 찾기 +findbar_label=찾기 + +# Thumbnails panel item (tooltip and alt text for images) +# LOCALIZATION NOTE (thumb_page_title): "{{page}}" will be replaced by the page +# number. +thumb_page_title={{page}} 쪽 +# LOCALIZATION NOTE (thumb_page_canvas): "{{page}}" will be replaced by the page +# number. +thumb_page_canvas={{page}}쪽의 썸네일 + +# Context menu +first_page.label=첫 쪽으로 +last_page.label=끝 쪽으로 +page_rotate_cw.label=시계방향 회전 +page_rotate_ccw.label=반시계방향 회전 + +# Find panel button title and messages +find_label=찾기: +find_previous.title=이전 구절 찾기 +find_previous_label=이전 +find_next.title=다음 구절 찾기 +find_next_label=다음 +find_highlight=모두 강조 +find_match_case_label=대/소문자까지 정확히 +find_reached_top=문서의 처음, 끝에서부터 계속 +find_reached_bottom=문서의 끝, 처음에서부터 계속 +find_not_found=구절을 찾을 수 없습니다 + +# Error panel labels +error_more_info=더 보기 +error_less_info=간략히 +error_close=닫기 +# LOCALIZATION NOTE (error_version_info): "{{version}}" and "{{build}}" will be +# replaced by the PDF.JS version and build ID. +error_version_info=PDF.js v{{version}} (build: {{build}}) +# LOCALIZATION NOTE (error_message): "{{message}}" will be replaced by an +# english string describing the error. +error_message=메시지: {{message}} +# LOCALIZATION NOTE (error_stack): "{{stack}}" will be replaced with a stack +# trace. +error_stack=스택: {{stack}} +# LOCALIZATION NOTE (error_file): "{{file}}" will be replaced with a filename +error_file=파일: {{file}} +# LOCALIZATION NOTE (error_line): "{{line}}" will be replaced with a line number +error_line=행: {{line}} +rendering_error=쪽 렌더링 중 오류가 발생했습니다. + +# Predefined zoom values +page_scale_width=너비 맞춤 +page_scale_fit=쪽 맞춤 +page_scale_auto=자동 맞춤 +page_scale_actual=실제 크기 + +# Loading indicator messages +loading_error_indicator=오류 +loading_error=PDF를 불러오던 중 오류가 발생했습니다. +invalid_file_error=PDF 파일이 아니거나 깨진 파일입니다. +missing_file_error=PDF 파일이 없습니다. + +# LOCALIZATION NOTE (text_annotation_type): This is used as a tooltip. +# "{{type}}" will be replaced with an annotation type from a list defined in +# the PDF spec (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +text_annotation_type=[{{type}} Annotation] +request_password=암호로 보호되는 PDF파일입니다: + +printing_not_supported=경고: 이 브라우져는 출력을 완전히는 지원하지 않습니다. +printing_not_ready=경고: 이 PDF 파일은 완전히 적재되지 않았습니다. +web_fonts_disabled=웹 폰트 사용이 비활성되었습니다: 내장 PDF 폰트를 사용할 수 없습니다. +web_colors_disabled=웹 컬러가 비활성되었습니다. diff --git a/l10n/vi/chrome.properties b/l10n/vi/chrome.properties new file mode 100644 index 000000000..0770f7a9e --- /dev/null +++ b/l10n/vi/chrome.properties @@ -0,0 +1,18 @@ +# Copyright 2012 Mozilla Foundation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Chrome notification bar messages and buttons +unsupported_feature=Tài liệu PDF có thể hiện thị không chính xác. +open_with_different_viewer=Mở với chương trình xem khác +open_with_different_viewer.accessKey=o diff --git a/l10n/vi/metadata.inc b/l10n/vi/metadata.inc new file mode 100644 index 000000000..0c8653cd9 --- /dev/null +++ b/l10n/vi/metadata.inc @@ -0,0 +1,8 @@ + + + vi-VN + Trình Xem PDF + Dùng HTML5 để hiện trị PDF trực giao trên FireFox. + + + diff --git a/l10n/vi/viewer.properties b/l10n/vi/viewer.properties new file mode 100644 index 000000000..fa473234e --- /dev/null +++ b/l10n/vi/viewer.properties @@ -0,0 +1,123 @@ +# Copyright 2012 Mozilla Foundation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Main toolbar buttons (tooltips and alt text for images) +previous.title=Trang Trước +previous_label=Trước +next.title=Trang Tiếp +next_label=Tiếp + +# LOCALIZATION NOTE (page_label, page_of): +# These strings are concatenated to form the "Page: X of Y" string. +# Do not translate "{{pageCount}}", it will be substituted with a number +# representing the total number of pages. +page_label=Trang: +page_of=trên {{pageCount}} + +zoom_out.title=Phóng to +zoom_out_label=Phóng to +zoom_in.title=Thu nhỏ +zoom_in_label=Thu nhỏ +zoom.title=Thu phóng +print.title=In +print_label=In +presentation_mode.title=Chuyển sang chế độ thuyết trình +presentation_mode_label=Chế độ Thuyết trình +open_file.title=Mở Tệp +open_file_label=Tệp +download.title=Tải xuống +download_label=Tải xuống +bookmark.title=Đánh dấu (sao chép hoặc mở cửa sổ mới) +bookmark_label=Đánh dấu + +# Tooltips and alt text for side panel toolbar buttons +# (the _label strings are alt text for the buttons, the .title strings are +# tooltips) +toggle_sidebar.title=Đóng bật thanh lề +toggle_sidebar_label=Bật tắt thanh lề +outline.title=Hiện thị giản lược tài liệu +outline_label=Giản lược +thumbs.title=hiện tài liệu ở dạng ảnh thu nhỏ +thumbs_label=Ảnh thu nhỏ +findbar.title=Tìm trong văn bản +findbar_label=Tìm kiếm + +# Thumbnails panel item (tooltip and alt text for images) +# LOCALIZATION NOTE (thumb_page_title): "{{page}}" will be replaced by the page +# number. +thumb_page_title=Page {{page}} +# LOCALIZATION NOTE (thumb_page_canvas): "{{page}}" will be replaced by the page +# number. +thumb_page_canvas=Thumbnail of Page {{page}} + +# Context menu +first_page.label=Đến trang đầu tiên +last_page.label=Đến trang cuối cùng +page_rotate_cw.label=Quay sang phải +page_rotate_ccw.label=Quay sang trái + +# Find panel button title and messages +find_label=Tìm: +find_previous.title=Tìm kiếm câu xuất hiện phía trước +find_previous_label=Về trước +find_next.title=Tìm kiếm câu xuất hiện phía sau +find_next_label=Tiếp theo +find_highlight=Tô sáng toàn bộ +find_match_case_label=Giống chữ +find_reached_top=Đến cuối đầu tài liệu, tiếp tục từ cuối +find_reached_bottom=Đến cuối tài liệu, tiếp tục từ đầu +find_not_found=Không tìm thấy + +# Error panel labels +error_more_info=Thông tim thêm +error_less_info=Thông tin giản lược +error_close=Đóng +# LOCALIZATION NOTE (error_version_info): "{{version}}" and "{{build}}" will be +# replaced by the PDF.JS version and build ID. +error_version_info=PDF.js v{{version}} (dịch: {{build}}) +# LOCALIZATION NOTE (error_message): "{{message}}" will be replaced by an +# english string describing the error. +error_message=Thông báo: {{message}} +# LOCALIZATION NOTE (error_stack): "{{stack}}" will be replaced with a stack +# trace. +error_stack=Ngăn xếp: {{stack}} +# LOCALIZATION NOTE (error_file): "{{file}}" will be replaced with a filename +error_file=Tệp: {{file}} +# LOCALIZATION NOTE (error_line): "{{line}}" will be replaced with a line number +error_line=Dòng: {{line}} +rendering_error=An error occurred while rendering the page. + +# Predefined zoom values +page_scale_width=Ngang +page_scale_fit=Xem Toàn Trang +page_scale_auto=Tự Động +page_scale_actual=Kích thước thực + +# Loading indicator messages +loading_error_indicator=Lỗi +loading_error=Lỗi khi mở tệp PDF. +invalid_file_error=Tệp PDF bị hỏng hoặc lỗi. +missing_file_error=Thiếu tệp tin PDF. + +# LOCALIZATION NOTE (text_annotation_type): This is used as a tooltip. +# "{{type}}" will be replaced with an annotation type from a list defined in +# the PDF spec (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +text_annotation_type=[{{type}} Đánh dấu] +request_password=PDF được bảo vệ bởi mật mã: + +printing_not_supported=Chú ý: Công việc in ẩn không được hỗ trợ bởi trình duyệt. +printing_not_ready=Chú ý: Tệp PDF không sẵn sàng cho in ấn. +web_fonts_disabled=Phồng chữ cho Web bị vô tác dụng: không thể dùng phông chữ kèm theo tệp PDF. +web_colors_disabled=Màu cho Wev bị vô tác dụng. diff --git a/src/canvas.js b/src/canvas.js index 6dd5b2b03..913729737 100644 --- a/src/canvas.js +++ b/src/canvas.js @@ -16,7 +16,7 @@ */ /* globals ColorSpace, DeviceCmykCS, DeviceGrayCS, DeviceRgbCS, error, FONT_IDENTITY_MATRIX, IDENTITY_MATRIX, ImageData, isArray, isNum, - isString, Pattern, TilingPattern, TODO, Util, warn, assert */ + isString, Pattern, TilingPattern, TODO, Util, warn, assert, info */ 'use strict'; @@ -1401,7 +1401,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() { // - remove background color: // colorNew = color - alphaNew *colorBackdrop /(1 - alphaNew) if (!group.isolated) { - TODO('Support non-isolated groups.'); + info('TODO: Support non-isolated groups.'); } // TODO knockout - supposedly possible with the clever use of compositing @@ -1422,9 +1422,10 @@ var CanvasGraphics = (function CanvasGraphicsClosure() { group.bbox, currentCtx.mozCurrentTransform); // Use ceil in case we're between sizes so we don't create canvas that is - // too small. - var drawnWidth = Math.ceil(bounds[2] - bounds[0]); - var drawnHeight = Math.ceil(bounds[3] - bounds[1]); + // too small and make the canvas at least 1x1 pixels. + var drawnWidth = Math.max(Math.ceil(bounds[2] - bounds[0]), 1); + var drawnHeight = Math.max(Math.ceil(bounds[3] - bounds[1]), 1); + var scratchCanvas = createScratchCanvas(drawnWidth, drawnHeight); var groupCtx = scratchCanvas.getContext('2d'); addContextCurrentTransform(groupCtx); diff --git a/src/evaluator.js b/src/evaluator.js index 1bd97650c..76473185a 100644 --- a/src/evaluator.js +++ b/src/evaluator.js @@ -1532,7 +1532,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() { var fontNameStr = fontName && fontName.name; var baseFontStr = baseFont && baseFont.name; if (fontNameStr !== baseFontStr) { - warn('The FontDescriptor\'s FontName is "' + fontNameStr + + info('The FontDescriptor\'s FontName is "' + fontNameStr + '" but should be the same as the Font\'s BaseFont "' + baseFontStr + '"'); } diff --git a/src/fonts.js b/src/fonts.js index 3cfdba094..1354d91b8 100644 --- a/src/fonts.js +++ b/src/fonts.js @@ -17,7 +17,7 @@ /* globals assert, bytesToString, CIDToUnicodeMaps, error, ExpertCharset, ExpertSubsetCharset, FileReaderSync, globalScope, GlyphsUnicode, info, isArray, isNum, ISOAdobeCharset, isWorker, PDFJS, Stream, - stringToBytes, TextDecoder, TODO, warn, Lexer */ + stringToBytes, TextDecoder, TODO, warn, Lexer, Util */ 'use strict'; @@ -3647,80 +3647,144 @@ var Font = (function FontClosure() { var TTOpsStackDeltas = [ 0, 0, 0, 0, 0, 0, 0, 0, -2, -2, -2, -2, 0, 0, -2, -5, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, -1, 0, -1, -1, -1, -1, - 1, -1, -999, 0, 1, 0, 0, -2, 0, -1, -2, -1, -999, -999, -1, -1, + 1, -1, -999, 0, 1, 0, -1, -2, 0, -1, -2, -1, -1, 0, -1, -1, 0, 0, -999, -999, -1, -1, -1, -1, -2, -999, -2, -2, -2, 0, -2, -2, 0, 0, -2, 0, -2, 0, 0, 0, -2, -1, -1, 1, 1, 0, 0, -1, -1, -1, -1, -1, -1, -1, 0, 0, -1, 0, -1, -1, 0, -999, -1, -1, - -1, -1, -1, -1, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, + -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, -999, -999, -999, -999, -999, -1, -1, -2, -2, 0, 0, 0, 0, -1, -1, - -999, -2, -2, 0, 0, -1, -2, -2, 0, -999, 0, 0, 0, -1, -2]; + -999, -2, -2, 0, 0, -1, -2, -2, 0, 0, 0, -1, -1, -1, -2]; // 0xC0-DF == -1 and 0xE0-FF == -2 function sanitizeTTProgram(table, ttContext) { var data = table.data; var i = 0, n, lastEndf = 0, lastDeff = 0; var stack = []; + var callstack = []; + var functionsCalled = []; var tooComplexToFollowFunctions = ttContext.tooComplexToFollowFunctions; + var inFDEF = false, ifLevel = 0, inELSE = 0; for (var ii = data.length; i < ii;) { var op = data[i++]; // The TrueType instruction set docs can be found at // https://developer.apple.com/fonts/TTRefMan/RM05/Chap5.html if (op === 0x40) { // NPUSHB - pushes n bytes n = data[i++]; - for (var j = 0; j < n; j++) { - stack.push(data[i++]); + if (inFDEF || inELSE) { + i += n; + } else { + for (var j = 0; j < n; j++) { + stack.push(data[i++]); + } } } else if (op === 0x41) { // NPUSHW - pushes n words n = data[i++]; - for (var j = 0; j < n; j++) { - var b = data[i++]; - stack.push((b << 8) | data[i++]); + if (inFDEF || inELSE) { + i += n * 2; + } else { + for (var j = 0; j < n; j++) { + var b = data[i++]; + stack.push((b << 8) | data[i++]); + } } } else if ((op & 0xF8) === 0xB0) { // PUSHB - pushes bytes n = op - 0xB0 + 1; - for (var j = 0; j < n; j++) { - stack.push(data[i++]); + if (inFDEF || inELSE) { + i += n; + } else { + for (var j = 0; j < n; j++) { + stack.push(data[i++]); + } } } else if ((op & 0xF8) === 0xB8) { // PUSHW - pushes words n = op - 0xB8 + 1; - for (var j = 0; j < n; j++) { - var b = data[i++]; - stack.push((b << 8) | data[i++]); + if (inFDEF || inELSE) { + i += n * 2; + } else { + for (var j = 0; j < n; j++) { + var b = data[i++]; + stack.push((b << 8) | data[i++]); + } } } else if (op === 0x2B && !tooComplexToFollowFunctions) { // CALL - // collecting inforamtion about which functions are used - var funcId = stack[stack.length - 1]; - ttContext.functionsUsed[funcId] = true; - if (i >= 2 && data[i - 2] === 0x2B) { - // all data in stack, calls are performed in sequence - tooComplexToFollowFunctions = true; + if (!inFDEF && !inELSE) { + // collecting inforamtion about which functions are used + var funcId = stack[stack.length - 1]; + ttContext.functionsUsed[funcId] = true; + if (funcId in ttContext.functionsStackDeltas) { + stack.length += ttContext.functionsStackDeltas[funcId]; + } else if (funcId in ttContext.functionsDefined && + functionsCalled.indexOf(funcId) < 0) { + callstack.push({data: data, i: i, stackTop: stack.length - 1}); + functionsCalled.push(funcId); + var pc = ttContext.functionsDefined[funcId]; + data = pc.data; + i = pc.i; + } } } else if (op === 0x2C && !tooComplexToFollowFunctions) { // FDEF - // collecting inforamtion about which functions are defined - lastDeff = i; - var funcId = stack[stack.length - 1]; - ttContext.functionsDefined[funcId] = true; - if (i >= 2 && data[i - 2] === 0x2D) { - // all function ids in stack, FDEF/ENDF perfomed in sequence + if (inFDEF || inELSE) { + warn('TT: nested FDEFs not allowed'); tooComplexToFollowFunctions = true; } + inFDEF = true; + // collecting inforamtion about which functions are defined + lastDeff = i; + var funcId = stack.pop(); + ttContext.functionsDefined[funcId] = {data: data, i: i}; } else if (op === 0x2D) { // ENDF - end of function - lastEndf = i; + if (inFDEF) { + inFDEF = false; + lastEndf = i; + } else { + var pc = callstack.pop(); + var funcId = functionsCalled.pop(); + data = pc.data; + i = pc.i; + ttContext.functionsStackDeltas[funcId] = + stack.length - pc.stackTop; + } } else if (op === 0x89) { // IDEF - instruction definition + if (inFDEF || inELSE) { + warn('TT: nested IDEFs not allowed'); + tooComplexToFollowFunctions = true; + } + inFDEF = true; // recording it as a function to track ENDF lastDeff = i; + } else if (op === 0x58) { // IF + ++ifLevel; + } else if (op === 0x1B) { // ELSE + inELSE = ifLevel; + } else if (op === 0x59) { // EIF + if (inELSE === ifLevel) { + inELSE = 0; + } + --ifLevel; + } else if (op === 0x1C) { // JMPR + var offset = stack[stack.length - 1]; + // only jumping forward to prevent infinite loop + if (offset > 0) { i += offset - 1; } } // Adjusting stack not extactly, but just enough to get function id - var stackDelta = op <= 0x8E ? TTOpsStackDeltas[op] : - op >= 0xC0 && op <= 0xDF ? -1 : op >= 0xE0 ? -2 : 0; - while (stackDelta < 0 && stack.length > 0) { - stack.pop(); - stackDelta++; - } - while (stackDelta > 0) { - stack.push(NaN); // pushing any number into stack - stackDelta--; + if (!inFDEF && !inELSE) { + var stackDelta = op <= 0x8E ? TTOpsStackDeltas[op] : + op >= 0xC0 && op <= 0xDF ? -1 : op >= 0xE0 ? -2 : 0; + if (op >= 0x71 && op <= 0x75) { + n = stack.pop(); + if (n === n) { + stackDelta = -n * 2; + } + } + while (stackDelta < 0 && stack.length > 0) { + stack.pop(); + stackDelta++; + } + while (stackDelta > 0) { + stack.push(NaN); // pushing any number into stack + stackDelta--; + } } } ttContext.tooComplexToFollowFunctions = tooComplexToFollowFunctions; @@ -3729,20 +3793,44 @@ var Font = (function FontClosure() { content.push(new Uint8Array(i - data.length)); } if (lastDeff > lastEndf) { + warn('TT: complementing a missing function tail'); // new function definition started, but not finished // complete function by [CLEAR, ENDF] content.push(new Uint8Array([0x22, 0x2D])); } - if (ttContext.defineMissingFunctions && !tooComplexToFollowFunctions) { + foldTTTable(table, content); + } + + function addTTDummyFunctions(table, ttContext, maxFunctionDefs) { + var content = [table.data]; + if (!ttContext.tooComplexToFollowFunctions) { + var undefinedFunctions = []; for (var j = 0, jj = ttContext.functionsUsed.length; j < jj; j++) { if (!ttContext.functionsUsed[j] || ttContext.functionsDefined[j]) { continue; } + undefinedFunctions.push(j); + if (j >= maxFunctionDefs) { + continue; + } // function is used, but not defined - // creating empty one [PUSHB, function-id, FDEF, ENDF] - content.push(new Uint8Array([0xB0, j, 0x2C, 0x2D])); + if (j < 256) { + // creating empty one [PUSHB, function-id, FDEF, ENDF] + content.push(new Uint8Array([0xB0, j, 0x2C, 0x2D])); + } else { + // creating empty one [PUSHW, function-id, FDEF, ENDF] + content.push( + new Uint8Array([0xB8, j >> 8, j & 255, 0x2C, 0x2D])); + } + } + if (undefinedFunctions.length > 0) { + warn('TT: undefined functions: ' + undefinedFunctions); } } + foldTTTable(table, content); + } + + function foldTTTable(table, content) { if (content.length > 1) { // concatenating the content items var newLength = 0; @@ -3765,15 +3853,17 @@ var Font = (function FontClosure() { var ttContext = { functionsDefined: [], functionsUsed: [], + functionsStackDeltas: [], tooComplexToFollowFunctions: false }; + if (fpgm) { + sanitizeTTProgram(fpgm, ttContext); + } if (prep) { - // collecting prep functions info first sanitizeTTProgram(prep, ttContext); } if (fpgm) { - ttContext.defineMissingFunctions = true; - sanitizeTTProgram(fpgm, ttContext); + addTTDummyFunctions(fpgm, ttContext, maxFunctionDefs); } } @@ -3843,12 +3933,17 @@ var Font = (function FontClosure() { // Ensure the hmtx table contains the advance width and // sidebearings information for numGlyphs in the maxp table font.pos = (font.start || 0) + maxp.offset; - var version = int16(font.getBytes(4)); + var version = int32(font.getBytes(4)); var numGlyphs = int16(font.getBytes(2)); + var maxFunctionDefs = 0; + if (version >= 0x00010000 && maxp.length >= 22) { + font.pos += 14; + var maxFunctionDefs = int16(font.getBytes(2)); + } sanitizeMetrics(font, hhea, hmtx, numGlyphs); - sanitizeTTPrograms(fpgm, prep); + sanitizeTTPrograms(fpgm, prep, maxFunctionDefs); if (head) { sanitizeHead(head, numGlyphs, loca.length); @@ -6696,6 +6791,33 @@ var CFFCompiler = (function CFFCompilerClosure() { var nameIndex = this.compileNameIndex(cff.names); output.add(nameIndex); + if (cff.isCIDFont) { + // The spec is unclear on how font matrices should relate to each other + // when there is one in the main top dict and the sub top dicts. + // Windows handles this differently than linux and osx so we have to + // normalize to work on all. + // Rules based off of some mailing list discussions: + // - If main font has a matrix and subfont doesn't, use the main matrix. + // - If no main font matrix and there is a subfont matrix, use the + // subfont matrix. + // - If both have matrices, concat together. + // - If neither have matrices, use default. + // To make this work on all platforms we move the top matrix into each + // sub top dict and concat if necessary. + if (cff.topDict.hasName('FontMatrix')) { + var base = cff.topDict.getByName('FontMatrix'); + cff.topDict.removeByName('FontMatrix'); + for (var i = 0, ii = cff.fdArray.length; i < ii; i++) { + var subDict = cff.fdArray[i]; + var matrix = base.slice(0); + if (subDict.hasName('FontMatrix')) { + matrix = Util.transform(matrix, subDict.getByName('FontMatrix')); + } + subDict.setByName('FontMatrix', matrix); + } + } + } + var compiled = this.compileTopDicts([cff.topDict], output.length, cff.isCIDFont); diff --git a/src/network.js b/src/network.js index b3981febd..248cc8a0d 100644 --- a/src/network.js +++ b/src/network.js @@ -33,10 +33,6 @@ // // TODO(mack): dump() doesn't seem to work here... // dump(msg + '\n'); //} -//#else -function log(aMsg) { - console.log(aMsg); -} //#endif var NetworkManager = (function NetworkManagerClosure() { diff --git a/src/util.js b/src/util.js index babb9d717..4094c3350 100644 --- a/src/util.js +++ b/src/util.js @@ -262,6 +262,18 @@ var Util = PDFJS.Util = (function UtilClosure() { return Util.makeCssCmyk(cmyk); }; + // Concatenates two transformation matrices together and returns the result. + Util.transform = function Util_transform(m1, m2) { + return [ + m1[0] * m2[0] + m1[2] * m2[1], + m1[1] * m2[0] + m1[3] * m2[1], + m1[0] * m2[2] + m1[2] * m2[3], + m1[1] * m2[2] + m1[3] * m2[3], + m1[0] * m2[4] + m1[2] * m2[5] + m1[4], + m1[1] * m2[4] + m1[3] * m2[5] + m1[5] + ]; + }; + // For 2d affine transforms Util.applyTransform = function Util_applyTransform(p, m) { var xt = p[0] * m[0] + p[1] * m[2] + m[4]; diff --git a/test/pdfs/issue3061.pdf b/test/pdfs/issue3061.pdf new file mode 100644 index 000000000..4c16f7c58 Binary files /dev/null and b/test/pdfs/issue3061.pdf differ diff --git a/test/test_manifest.json b/test/test_manifest.json index 65f01c750..d6f89513c 100644 --- a/test/test_manifest.json +++ b/test/test_manifest.json @@ -906,6 +906,13 @@ "lastPage": 4, "type": "load" }, + { "id": "issue3061", + "file": "pdfs/issue3061.pdf", + "md5": "696a7cb1b194d095ca3f7861779a606b", + "rounds": 1, + "type": "eq", + "about": "CFF CID font with font matrices in main top dict and sub top dict." + }, { "id": "issue1878", "file": "pdfs/issue1878.pdf", "md5": "b4fb0ce7c19368e7104dce3d0d34bcb3", diff --git a/web/viewer.css b/web/viewer.css index 952a7e9e6..da0896418 100644 --- a/web/viewer.css +++ b/web/viewer.css @@ -256,14 +256,7 @@ html[dir='rtl'] #sidebarContent { #toolbarSidebar { width: 200px; height: 32px; - background-image: url(images/texture.png), - -webkit-linear-gradient(hsla(0,0%,30%,.99), hsla(0,0%,25%,.95)); - 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), - -ms-linear-gradient(hsla(0,0%,30%,.99), hsla(0,0%,25%,.95)); - background-image: url(images/texture.png), - -o-linear-gradient(hsla(0,0%,30%,.99), hsla(0,0%,25%,.95)); + background-color: #424242; /* fallback */ background-image: url(images/texture.png), linear-gradient(hsla(0,0%,30%,.99), hsla(0,0%,25%,.95)); box-shadow: inset -1px 0 0 rgba(0, 0, 0, 0.25), @@ -275,15 +268,8 @@ html[dir='rtl'] #sidebarContent { #toolbarContainer, .findbar { position: relative; - background-color: #474747; /* IE9 */ - background-image: url(images/texture.png), - -webkit-linear-gradient(hsla(0,0%,32%,.99), hsla(0,0%,27%,.95)); - 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), - -ms-linear-gradient(hsla(0,0%,32%,.99), hsla(0,0%,27%,.95)); - background-image: url(images/texture.png), - -o-linear-gradient(hsla(0,0%,32%,.99), hsla(0,0%,27%,.95)); + height: 32px; + background-color: #474747; /* fallback */ background-image: url(images/texture.png), linear-gradient(hsla(0,0%,32%,.99), hsla(0,0%,27%,.95)); box-shadow: inset 1px 0 0 hsla(0,0%,100%,.08), @@ -358,10 +344,7 @@ html[dir='rtl'] #sidebarContent { height: 100%; width: 50px; - background-image: -moz-linear-gradient(left, #999 0%, #fff 50%, #999 100%); - background-image: -ms-linear-gradient(left, #999 0%, #fff 50%, #999 100%); - background-image: -webkit-linear-gradient(left, #999 0%, #fff 50%, #999 100%); - background-image: linear-gradient(left, #999 0%, #fff 50%, #999 100%); + background-image: linear-gradient(to right, #999 0%, #fff 50%, #999 100%); background-size: 100% 100% no-repeat; -moz-animation: progressIndeterminate 2s linear infinite; @@ -540,10 +523,6 @@ html[dir='rtl'] .splitToolbarButton > .toolbarButton { .splitToolbarButton.toggled > .toolbarButton, .toolbarButton.textButton { background-color: hsla(0,0%,0%,.12); - background-image: -webkit-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); - background-image: -moz-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); - background-image: -ms-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); - background-image: -o-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); background-image: linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); background-clip: padding-box; border: 1px solid hsla(0,0%,0%,.35); @@ -678,10 +657,6 @@ html[dir='rtl'] .dropdownToolbarButton { .toolbarButton:focus, .dropdownToolbarButton { background-color: hsla(0,0%,0%,.12); - background-image: -webkit-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); - background-image: -moz-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); - background-image: -ms-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); - background-image: -o-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); background-image: linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); background-clip: padding-box; border: 1px solid hsla(0,0%,0%,.35); @@ -694,10 +669,6 @@ html[dir='rtl'] .dropdownToolbarButton { .toolbarButton:hover:active, .dropdownToolbarButton:hover:active { background-color: hsla(0,0%,0%,.2); - background-image: -webkit-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); - background-image: -moz-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); - background-image: -ms-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); - background-image: -o-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); background-image: 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, @@ -723,10 +694,6 @@ html[dir='rtl'] .dropdownToolbarButton { .toolbarButton.toggled, .splitToolbarButton.toggled > .toolbarButton.toggled { background-color: hsla(0,0%,0%,.3); - background-image: -webkit-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); - background-image: -moz-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); - background-image: -ms-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); - background-image: -o-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); background-image: 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, @@ -958,7 +925,7 @@ html[dir='rtl'] .toolbarButton.pageDown::before { 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-image: 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); @@ -1055,7 +1022,7 @@ a:focus > .thumbnail > .thumbnailSelectionRing > .thumbnailImage, a:focus > .thumbnail > .thumbnailSelectionRing, .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-image: 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, @@ -1070,7 +1037,7 @@ a:focus > .thumbnail > .thumbnailSelectionRing, .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-image: 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, @@ -1121,7 +1088,7 @@ html[dir='rtl'] .outlineItem > a { .outlineItem > a:hover { background-color: hsla(0,0%,100%,.02); - background-image: -moz-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); + background-image: 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, @@ -1131,7 +1098,7 @@ html[dir='rtl'] .outlineItem > a { .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-image: 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, diff --git a/web/viewer.html b/web/viewer.html index 76b158d81..7ec84f050 100644 --- a/web/viewer.html +++ b/web/viewer.html @@ -76,7 +76,7 @@ limitations under the License. - +
@@ -212,7 +212,7 @@ limitations under the License. data-l10n-id="page_rotate_cw" > -
+
diff --git a/web/viewer.js b/web/viewer.js index 225e95ac9..111e0c990 100644 --- a/web/viewer.js +++ b/web/viewer.js @@ -1442,6 +1442,13 @@ var PDFView = { left + ',' + top; } self.setInitialView(storedHash, scale); + + // Make all navigation keys work on document load, + // unless the viewer is embedded in another page. + if (window.parent === window) { + PDFView.container.focus(); + PDFView.container.blur(); + } }); pagesPromise.then(function() { @@ -1480,12 +1487,6 @@ var PDFView = { self.outline = new DocumentOutlineView(outline); document.getElementById('viewOutline').disabled = !outline; }); - - // Make all navigation keys work on document load, - // unless the viewer is embedded in another page. - if (window.parent.location === window.location) { - PDFView.container.focus(); - } }); pdfDocument.getMetadata().then(function(data) {