Skip to content

Commit d92c3f8

Browse files
committed
Merge pull request mozilla#2988 from mduan/annotation-refactor-tx
Refactor annotation code
2 parents 01cdd68 + da2c4d5 commit d92c3f8

39 files changed

+679
-504
lines changed

examples/acroforms/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<script type="text/javascript" src="../../src/api.js"></script>
1313
<script type="text/javascript" src="../../src/canvas.js"></script>
1414
<script type="text/javascript" src="../../src/obj.js"></script>
15+
<script type="text/javascript" src="../../src/annotation.js"></script>
1516
<script type="text/javascript" src="../../src/function.js"></script>
1617
<script type="text/javascript" src="../../src/charsets.js"></script>
1718
<script type="text/javascript" src="../../src/cidmaps.js"></script>

examples/helloworld/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<script type="text/javascript" src="../../src/api.js"></script>
1313
<script type="text/javascript" src="../../src/canvas.js"></script>
1414
<script type="text/javascript" src="../../src/obj.js"></script>
15+
<script type="text/javascript" src="../../src/annotation.js"></script>
1516
<script type="text/javascript" src="../../src/function.js"></script>
1617
<script type="text/javascript" src="../../src/charsets.js"></script>
1718
<script type="text/javascript" src="../../src/cidmaps.js"></script>

extensions/firefox/tools/l10n.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,10 @@
105105
// Arabic, Hebrew, Farsi, Pashto, Urdu
106106
var rtlList = ['ar', 'he', 'fa', 'ps', 'ur'];
107107
return (rtlList.indexOf(gLanguage) >= 0) ? 'rtl' : 'ltr';
108-
}
108+
},
109+
110+
// translate an element or document fragment
111+
translate: translateFragment
109112
};
110113
})(this);
111114

l10n/ar/viewer.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,11 @@ page_scale_actual=الحجم الحقيقي
9898
loading_error_indicator=خطأ
9999
loading_error=حدث خطأ أثناء تحميل وثيقه الـPDF
100100

101-
# LOCALIZATION NOTE (text_annotation_type): This is used as a tooltip.
101+
# LOCALIZATION NOTE (text_annotation_type.alt): This is used as a tooltip.
102102
# "{{type}}" will be replaced with an annotation type from a list defined in
103103
# the PDF spec (32000-1:2008 Table 169 – Annotation types).
104104
# Some common types are e.g.: "Check", "Text", "Comment", "Note"
105-
text_annotation_type=[ملاحظة {{type}}]
105+
text_annotation_type.alt=[ملاحظة {{type}}]
106106
request_password=الـPDF محمي بكلمة مرور:
107107

108108
printing_not_supported=تحذير: الطباعة ليست مدعومة كليًا في هذا المتصفح.

l10n/ca/viewer.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,11 @@ loading_error_indicator=Error
114114
loading_error=Ha ocorregut un error mentres es carregava el PDF.
115115
invalid_file_error=Invàlid o fitxer PDF corrupte.
116116

117-
# LOCALIZATION NOTE (text_annotation_type): This is used as a tooltip.
117+
# LOCALIZATION NOTE (text_annotation_type.alt): This is used as a tooltip.
118118
# "{{type}}" will be replaced with an annotation type from a list defined in
119119
# the PDF spec (32000-1:2008 Table 169 – Annotation types).
120120
# Some common types are e.g.: "Check", "Text", "Comment", "Note"
121-
text_annotation_type=[Anotació {{type}}]
121+
text_annotation_type.alt=[Anotació {{type}}]
122122
request_password=El PDF està protegit amb una contrasenya:
123123

124124
printing_not_supported=Avís: La impressió no és compatible totalment en aquest navegador.

l10n/cs/viewer.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ rendering_error=Došlo k chybě při vykreslování stránky.
4141
page_label=Stránka:
4242
page_of=z{{pageCount}}
4343
open_file.title=Otevřít soubor
44-
text_annotation_type=[{{type}}Anotace]
44+
text_annotation_type.alt=[{{type}}Anotace]
4545
toggle_slider_label=Přepnout posuvník
4646
thumbs_label=Náhledy
4747
outline_label=Přehled dokumentu

l10n/da/viewer.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ missing_file_error=Manglende PDF-fil
114114
# "{{type}}" vil blive ersattet af en kommentar type fra en liste
115115
# defineret i PDF specifikationen (32000-1:2008 Table 169 – Annotation types).
116116
# Nogle almindelige typer er f.eks.: "Check", "Text", "Comment" og "Note"
117-
text_annotation_type=[{{type}} Kommentar]
117+
text_annotation_type.alt=[{{type}} Kommentar]
118118
request_password=PDF filen er beskyttet med et kodeord:
119119
invalid_password=Ugyldigt kodeord.
120120

l10n/de/viewer.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,11 @@ loading_error_indicator=Fehler
109109
loading_error=Das PDF konnte nicht geladen werden.
110110
invalid_file_error=Ungültige oder beschädigte PDF-Datei.
111111

112-
# LOCALIZATION NOTE (text_annotation_type): This is used as a tooltip.
112+
# LOCALIZATION NOTE (text_annotation_type.alt): This is used as a tooltip.
113113
# "{{type}}" will be replaced with an annotation type from a list defined in
114114
# the PDF spec (32000-1:2008 Table 169 – Annotation types).
115115
# Some common types are e.g.: "Check", "Text", "Comment", "Note"
116-
text_annotation_type=[{{type}} Annotation]
116+
text_annotation_type.alt=[{{type}} Annotation]
117117
request_password=Das PDF ist passwortgeschützt:
118118

119119
printing_not_supported=Warnung: Drucken wird durch diesen Browser nicht vollständig unterstützt.

l10n/en-US/viewer.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,11 @@ loading_error=An error occurred while loading the PDF.
110110
invalid_file_error=Invalid or corrupted PDF file.
111111
missing_file_error=Missing PDF file.
112112

113-
# LOCALIZATION NOTE (text_annotation_type): This is used as a tooltip.
113+
# LOCALIZATION NOTE (text_annotation_type.alt): This is used as a tooltip.
114114
# "{{type}}" will be replaced with an annotation type from a list defined in
115115
# the PDF spec (32000-1:2008 Table 169 – Annotation types).
116116
# Some common types are e.g.: "Check", "Text", "Comment", "Note"
117-
text_annotation_type=[{{type}} Annotation]
117+
text_annotation_type.alt=[{{type}} Annotation]
118118
request_password=PDF is protected by a password:
119119
invalid_password=Invalid Password.
120120

l10n/es/viewer.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ missing_file_error=Falta el archivo PDF.
114114
# "{{type}}" will be replaced with an annotation type from a list defined in
115115
# the PDF spec (32000-1:2008 Table 169 – Annotation types).
116116
# Some common types are e.g.: "Check", "Text", "Comment", "Note"
117-
text_annotation_type=[Anotación {{type}}]
117+
text_annotation_type.alt=[Anotación {{type}}]
118118
request_password=El archivo PDF está protegido por una contraseña:
119119

120120
printing_not_supported=Aviso: Este navegador no es compatible completamente con la impresión.

l10n/fi/viewer.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,11 @@ loading_error=Virhe on tapahtunut PDF:ää ladattaessa.
110110
invalid_file_error=Virheellinen tai vioittunut PDF tiedosto.
111111
missing_file_error=PDF tiedostoa ei löytynyt.
112112

113-
# LOCALIZATION NOTE (text_annotation_type): This is used as a tooltip.
113+
# LOCALIZATION NOTE (text_annotation_type.alt): This is used as a tooltip.
114114
# "{{type}}" will be replaced with an annotation type from a list defined in
115115
# the PDF spec (32000-1:2008 Table 169 – Annotation types).
116116
# Some common types are e.g.: "Check", "Text", "Comment", "Note"
117-
text_annotation_type=[{{type}} Selite]
117+
text_annotation_type.alt=[{{type}} Selite]
118118
request_password=PDF on salasanasuojattu:
119119

120120
printing_not_supported=Varoitus: Tämä selain ei täysin tue tulostusta.

l10n/fr/viewer.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ missing_file_error=Fichier PDF manquant.
114114
# "{{type}}" will be replaced with an annotation type from a list defined in
115115
# the PDF spec (32000-1:2008 Table 169 – Annotation types).
116116
# Some common types are e.g.: "Check", "Text", "Comment", "Note"
117-
text_annotation_type=[Annotation {{type}}]
117+
text_annotation_type.alt=[Annotation {{type}}]
118118
request_password=Le PDF est protégé par un mot de passe :
119119

120120
printing_not_supported=Attention : l'impression n'est pas totalement prise en charge par ce navigateur.

l10n/he/viewer.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ rendering_error=אירעה שגיאה בעת עיבוד הדף.
4141
page_label=דף:
4242
page_of=מתוך {{pageCount}}
4343
open_file.title=פתיחת קובץ
44-
text_annotation_type=[{{type}} Annotation]
44+
text_annotation_type.alt=[{{type}} Annotation]
4545
toggle_slider_label=מתג החלקה
4646
thumbs_label=תמונות ממוזערות
4747
outline_label=מתאר מסמך

l10n/it/viewer.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@ rendering_error=
4141
page_label=Pagina:
4242
page_of=di {{pageCount}}
4343
open_file.title=Apri File
44-
text_annotation_type=[{{type}} Annotazione]
44+
text_annotation_type.alt=[{{type}} Annotazione]

l10n/ja/viewer.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,11 @@ loading_error=PDF の読み込み中にエラーが発生しました
110110
invalid_file_error=無効または破損した PDF ファイル
111111
missing_file_error=PDF ファイルが見つかりません。
112112

113-
# LOCALIZATION NOTE (text_annotation_type): This is used as a tooltip.
113+
# LOCALIZATION NOTE (text_annotation_type.alt): This is used as a tooltip.
114114
# "{{type}}" will be replaced with an annotation type from a list defined in
115115
# the PDF spec (32000-1:2008 Table 169 – Annotation types).
116116
# Some common types are e.g.: "Check", "Text", "Comment", "Note"
117-
text_annotation_type=[{{type}} 注釈]
117+
text_annotation_type.alt=[{{type}} 注釈]
118118
request_password=PDF はパスワードによって保護されています
119119
invalid_password=無効なパスワードです
120120

l10n/lt/viewer.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,11 @@ loading_error=PDF bylos įkelimo metu įvyko klaida.
110110
invalid_file_error=Neteisinga arba pažeista PDF byla.
111111
missing_file_error=Trūksta PDF bylos.
112112

113-
# LOCALIZATION NOTE (text_annotation_type): This is used as a tooltip.
113+
# LOCALIZATION NOTE (text_annotation_type.alt): This is used as a tooltip.
114114
# "{{type}}" will be replaced with an annotation type from a list defined in
115115
# the PDF spec (32000-1:2008 Table 169 – Annotation types).
116116
# Some common types are e.g.: "Check", "Text", "Comment", "Note"
117-
text_annotation_type=[{{type}} Pastaba]
117+
text_annotation_type.alt=[{{type}} Pastaba]
118118
request_password=PDF byla yra apsaugota slaptažodžiu:
119119

120120
printing_not_supported=Dėmesio: Naršyklė pilnai nepalaiko spausdinimo.

l10n/nl/viewer.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,11 @@ loading_error=Er is een fout opgetreden bij het laden van het PDF-bestand.
110110
invalid_file_error=Ongeldig of corrupt PDF-bestand.
111111
missing_file_error=Ontbrekend PDF-bestand.
112112

113-
# LOCALIZATION NOTE (text_annotation_type): This is used as a tooltip.
113+
# LOCALIZATION NOTE (text_annotation_type.alt): This is used as a tooltip.
114114
# "{{type}}" will be replaced with an annotation type from a list defined in
115115
# the PDF spec (32000-1:2008 Table 169 – Annotation types).
116116
# Some common types are e.g.: "Check", "Text", "Comment", "Note"
117-
text_annotation_type=[{{type}}-aantekening]
117+
text_annotation_type.alt=[{{type}}-aantekening]
118118
request_password=Dit PDF-bestand is beveiligd met een wachtwoord:
119119

120120
printing_not_supported=Waarschuwing: afdrukken wordt niet volledig ondersteund door deze browser.

l10n/pl/viewer.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,11 @@ loading_error=Wystąpił błąd podczas wczytywania pliku PDF.
110110
invalid_file_error=Błędny lub uszkodzony plik PDF.
111111
missing_file_error=Nie znaleziono pliku PDF.
112112

113-
# LOCALIZATION NOTE (text_annotation_type): This is used as a tooltip.
113+
# LOCALIZATION NOTE (text_annotation_type.alt): This is used as a tooltip.
114114
# "{{type}}" will be replaced with an annotation type from a list defined in
115115
# the PDF spec (32000-1:2008 Table 169 - Annotation types).
116116
# Some common types are e.g.: "Check", "Text", "Comment", "Note"
117-
text_annotation_type=[Komentarz {{type}}]
117+
text_annotation_type.alt=[Komentarz {{type}}]
118118
request_password=Plik PDF jest chroniony przez hasło:
119119

120120
printing_not_supported=Ostrzeżenie: Drukowanie nie jest w pełni obsługiwane przez tę przeglądarkę.

l10n/pt-BR/viewer.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@ rendering_error=Um erro ocorreu ao apresentar a página.
4141
page_label=Página:
4242
page_of=de {{pageCount}}
4343
open_file.title=Abrir arquivo
44-
text_annotation_type=[{{type}} Anotações]
44+
text_annotation_type.alt=[{{type}} Anotações]

l10n/ro/viewer.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ rendering_error=S-a produs o eroare în timpul procesării paginii.
4141
page_label=Pagina:
4242
page_of=din {{pageCount}}
4343
open_file.title=Deschide fișier
44-
text_annotation_type=[Adnotare {{type}}]
44+
text_annotation_type.alt=[Adnotare {{type}}]
4545
toggle_slider_label=Vedere de ansamblu
4646
thumbs_label=Miniaturi
4747
outline_label=Cuprins

l10n/ru/viewer.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ rendering_error=Произошла ошибка во время создания
4141
page_label=Страница:
4242
page_of=из {{pageCount}}
4343
open_file.title=Открыть файл
44-
text_annotation_type=[Аннотация {{type}}]
44+
text_annotation_type.alt=[Аннотация {{type}}]
4545
toggle_slider_label=Вспомогательная панель
4646
thumbs_label=Уменьшенные изображения
4747
outline_label=Содержание документа

l10n/sr/viewer.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ rendering_error=Дошло је до грешке приликом приказ
4141
page_label=Страна:
4242
page_of=од {{pageCount}}
4343
open_file.title=Отвори датотеку
44-
text_annotation_type=[{{type}} Annotation]
44+
text_annotation_type.alt=[{{type}} Annotation]
4545
toggle_slider_label=Клизач
4646
thumbs_label=Сличице
4747
outline_label=Документи у линијама

l10n/sv/viewer.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,11 @@ loading_error=Ett fel inträffade när PDF-filen laddades.
110110
invalid_file_error=Ogiltig eller korrupt PDF-fil.
111111
missing_file_error=PDF-filen saknas.
112112

113-
# LOCALIZATION NOTE (text_annotation_type): This is used as a tooltip.
113+
# LOCALIZATION NOTE (text_annotation_type.alt): This is used as a tooltip.
114114
# "{{type}}" will be replaced with an annotation type from a list defined in
115115
# the PDF spec (32000-1:2008 Table 169 – Annotation types).
116116
# Some common types are e.g.: "Check", "Text", "Comment", "Note"
117-
text_annotation_type=[{{type}}-anteckning]
117+
text_annotation_type.alt=[{{type}}-anteckning]
118118
request_password=PDF-filen är lösenordsskyddad:
119119
invalid_password=Felaktigt lösenord.
120120

l10n/tr/viewer.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,11 @@ loading_error=PDF yüklenirken hata.
110110
invalid_file_error=Geçersiz yada bozuk dosya.
111111
missing_file_error=PDF dosyası bulunamadı.
112112

113-
# LOCALIZATION NOTE (text_annotation_type): This is used as a tooltip.
113+
# LOCALIZATION NOTE (text_annotation_type.alt): This is used as a tooltip.
114114
# "{{type}}" will be replaced with an annotation type from a list defined in
115115
# the PDF spec (32000-1:2008 Table 169 – Annotation types).
116116
# Some common types are e.g.: "Check", "Text", "Comment", "Note"
117-
text_annotation_type=[{{type}} Not]
117+
text_annotation_type.alt=[{{type}} Not]
118118
request_password=PDF Şifre ile korunmakta:
119119

120120
printing_not_supported=Uyarı: Yazdırma işlemi bu tarayıcı ile tam desteklenmiyor.

l10n/zh-CN/viewer.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,11 @@ loading_error=加载 PDF 文件时出错。
110110
invalid_file_error=PDF 文件无效或已损坏。
111111
missing_file_error=缺失 PDF 文件。
112112

113-
# LOCALIZATION NOTE (text_annotation_type): This is used as a tooltip.
113+
# LOCALIZATION NOTE (text_annotation_type.alt): This is used as a tooltip.
114114
# "{{type}}" will be replaced with an annotation type from a list defined in
115115
# the PDF spec (32000-1:2008 Table 169 – Annotation types).
116116
# Some common types are e.g.: "Check", "Text", "Comment", "Note"
117-
text_annotation_type=[{{type}} 注解]
117+
text_annotation_type.alt=[{{type}} 注解]
118118
request_password=该 PDF 文档受密码保护:
119119

120120
printing_not_supported=警告:该浏览器不能完全支持打印。

l10n/zh-TW/viewer.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ missing_file_error=遺失PDF檔案。
104104
# 其他標籤和訊息
105105
# "{{type}}" 用來表示PDF格式規範 (32000-1:2008 Table 169 – Annotation types) 入面所定義的註解種類。
106106
# 一些常見的類型有: "Check"、 "Text"、 "Comment"、 "Note"
107-
text_annotation_type=[{{type}} 註解]
107+
text_annotation_type.alt=[{{type}} 註解]
108108
request_password=PDF檔案受密碼保護:
109109
invalid_password=密碼無效。
110110

make.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ target.bundle = function(args) {
239239
'api.js',
240240
'canvas.js',
241241
'obj.js',
242+
'annotation.js',
242243
'function.js',
243244
'charsets.js',
244245
'cidmaps.js',

0 commit comments

Comments
 (0)