card-mod-pdfjs 0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (739) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +10 -0
  3. data/public/LICENSE +177 -0
  4. data/public/build/pdf.js +11515 -0
  5. data/public/build/pdf.worker.js +43506 -0
  6. data/public/cmaps/78-EUC-H.bcmap +0 -0
  7. data/public/cmaps/78-EUC-V.bcmap +0 -0
  8. data/public/cmaps/78-H.bcmap +0 -0
  9. data/public/cmaps/78-RKSJ-H.bcmap +0 -0
  10. data/public/cmaps/78-RKSJ-V.bcmap +0 -0
  11. data/public/cmaps/78-V.bcmap +0 -0
  12. data/public/cmaps/78ms-RKSJ-H.bcmap +0 -0
  13. data/public/cmaps/78ms-RKSJ-V.bcmap +0 -0
  14. data/public/cmaps/83pv-RKSJ-H.bcmap +0 -0
  15. data/public/cmaps/90ms-RKSJ-H.bcmap +0 -0
  16. data/public/cmaps/90ms-RKSJ-V.bcmap +0 -0
  17. data/public/cmaps/90msp-RKSJ-H.bcmap +0 -0
  18. data/public/cmaps/90msp-RKSJ-V.bcmap +0 -0
  19. data/public/cmaps/90pv-RKSJ-H.bcmap +0 -0
  20. data/public/cmaps/90pv-RKSJ-V.bcmap +0 -0
  21. data/public/cmaps/Add-H.bcmap +0 -0
  22. data/public/cmaps/Add-RKSJ-H.bcmap +0 -0
  23. data/public/cmaps/Add-RKSJ-V.bcmap +0 -0
  24. data/public/cmaps/Add-V.bcmap +0 -0
  25. data/public/cmaps/Adobe-CNS1-0.bcmap +0 -0
  26. data/public/cmaps/Adobe-CNS1-1.bcmap +0 -0
  27. data/public/cmaps/Adobe-CNS1-2.bcmap +0 -0
  28. data/public/cmaps/Adobe-CNS1-3.bcmap +0 -0
  29. data/public/cmaps/Adobe-CNS1-4.bcmap +0 -0
  30. data/public/cmaps/Adobe-CNS1-5.bcmap +0 -0
  31. data/public/cmaps/Adobe-CNS1-6.bcmap +0 -0
  32. data/public/cmaps/Adobe-CNS1-UCS2.bcmap +0 -0
  33. data/public/cmaps/Adobe-GB1-0.bcmap +0 -0
  34. data/public/cmaps/Adobe-GB1-1.bcmap +0 -0
  35. data/public/cmaps/Adobe-GB1-2.bcmap +0 -0
  36. data/public/cmaps/Adobe-GB1-3.bcmap +0 -0
  37. data/public/cmaps/Adobe-GB1-4.bcmap +0 -0
  38. data/public/cmaps/Adobe-GB1-5.bcmap +0 -0
  39. data/public/cmaps/Adobe-GB1-UCS2.bcmap +0 -0
  40. data/public/cmaps/Adobe-Japan1-0.bcmap +0 -0
  41. data/public/cmaps/Adobe-Japan1-1.bcmap +0 -0
  42. data/public/cmaps/Adobe-Japan1-2.bcmap +0 -0
  43. data/public/cmaps/Adobe-Japan1-3.bcmap +0 -0
  44. data/public/cmaps/Adobe-Japan1-4.bcmap +0 -0
  45. data/public/cmaps/Adobe-Japan1-5.bcmap +0 -0
  46. data/public/cmaps/Adobe-Japan1-6.bcmap +0 -0
  47. data/public/cmaps/Adobe-Japan1-UCS2.bcmap +0 -0
  48. data/public/cmaps/Adobe-Korea1-0.bcmap +0 -0
  49. data/public/cmaps/Adobe-Korea1-1.bcmap +0 -0
  50. data/public/cmaps/Adobe-Korea1-2.bcmap +0 -0
  51. data/public/cmaps/Adobe-Korea1-UCS2.bcmap +0 -0
  52. data/public/cmaps/B5-H.bcmap +0 -0
  53. data/public/cmaps/B5-V.bcmap +0 -0
  54. data/public/cmaps/B5pc-H.bcmap +0 -0
  55. data/public/cmaps/B5pc-V.bcmap +0 -0
  56. data/public/cmaps/CNS-EUC-H.bcmap +0 -0
  57. data/public/cmaps/CNS-EUC-V.bcmap +0 -0
  58. data/public/cmaps/CNS1-H.bcmap +0 -0
  59. data/public/cmaps/CNS1-V.bcmap +0 -0
  60. data/public/cmaps/CNS2-H.bcmap +0 -0
  61. data/public/cmaps/CNS2-V.bcmap +3 -0
  62. data/public/cmaps/ETHK-B5-H.bcmap +0 -0
  63. data/public/cmaps/ETHK-B5-V.bcmap +0 -0
  64. data/public/cmaps/ETen-B5-H.bcmap +0 -0
  65. data/public/cmaps/ETen-B5-V.bcmap +0 -0
  66. data/public/cmaps/ETenms-B5-H.bcmap +3 -0
  67. data/public/cmaps/ETenms-B5-V.bcmap +0 -0
  68. data/public/cmaps/EUC-H.bcmap +0 -0
  69. data/public/cmaps/EUC-V.bcmap +0 -0
  70. data/public/cmaps/Ext-H.bcmap +0 -0
  71. data/public/cmaps/Ext-RKSJ-H.bcmap +0 -0
  72. data/public/cmaps/Ext-RKSJ-V.bcmap +0 -0
  73. data/public/cmaps/Ext-V.bcmap +0 -0
  74. data/public/cmaps/GB-EUC-H.bcmap +0 -0
  75. data/public/cmaps/GB-EUC-V.bcmap +0 -0
  76. data/public/cmaps/GB-H.bcmap +4 -0
  77. data/public/cmaps/GB-V.bcmap +0 -0
  78. data/public/cmaps/GBK-EUC-H.bcmap +0 -0
  79. data/public/cmaps/GBK-EUC-V.bcmap +0 -0
  80. data/public/cmaps/GBK2K-H.bcmap +0 -0
  81. data/public/cmaps/GBK2K-V.bcmap +0 -0
  82. data/public/cmaps/GBKp-EUC-H.bcmap +0 -0
  83. data/public/cmaps/GBKp-EUC-V.bcmap +0 -0
  84. data/public/cmaps/GBT-EUC-H.bcmap +0 -0
  85. data/public/cmaps/GBT-EUC-V.bcmap +0 -0
  86. data/public/cmaps/GBT-H.bcmap +0 -0
  87. data/public/cmaps/GBT-V.bcmap +0 -0
  88. data/public/cmaps/GBTpc-EUC-H.bcmap +0 -0
  89. data/public/cmaps/GBTpc-EUC-V.bcmap +0 -0
  90. data/public/cmaps/GBpc-EUC-H.bcmap +0 -0
  91. data/public/cmaps/GBpc-EUC-V.bcmap +0 -0
  92. data/public/cmaps/H.bcmap +0 -0
  93. data/public/cmaps/HKdla-B5-H.bcmap +0 -0
  94. data/public/cmaps/HKdla-B5-V.bcmap +0 -0
  95. data/public/cmaps/HKdlb-B5-H.bcmap +0 -0
  96. data/public/cmaps/HKdlb-B5-V.bcmap +0 -0
  97. data/public/cmaps/HKgccs-B5-H.bcmap +0 -0
  98. data/public/cmaps/HKgccs-B5-V.bcmap +0 -0
  99. data/public/cmaps/HKm314-B5-H.bcmap +0 -0
  100. data/public/cmaps/HKm314-B5-V.bcmap +0 -0
  101. data/public/cmaps/HKm471-B5-H.bcmap +0 -0
  102. data/public/cmaps/HKm471-B5-V.bcmap +0 -0
  103. data/public/cmaps/HKscs-B5-H.bcmap +0 -0
  104. data/public/cmaps/HKscs-B5-V.bcmap +0 -0
  105. data/public/cmaps/Hankaku.bcmap +0 -0
  106. data/public/cmaps/Hiragana.bcmap +0 -0
  107. data/public/cmaps/KSC-EUC-H.bcmap +0 -0
  108. data/public/cmaps/KSC-EUC-V.bcmap +0 -0
  109. data/public/cmaps/KSC-H.bcmap +0 -0
  110. data/public/cmaps/KSC-Johab-H.bcmap +0 -0
  111. data/public/cmaps/KSC-Johab-V.bcmap +0 -0
  112. data/public/cmaps/KSC-V.bcmap +0 -0
  113. data/public/cmaps/KSCms-UHC-H.bcmap +0 -0
  114. data/public/cmaps/KSCms-UHC-HW-H.bcmap +0 -0
  115. data/public/cmaps/KSCms-UHC-HW-V.bcmap +0 -0
  116. data/public/cmaps/KSCms-UHC-V.bcmap +0 -0
  117. data/public/cmaps/KSCpc-EUC-H.bcmap +0 -0
  118. data/public/cmaps/KSCpc-EUC-V.bcmap +0 -0
  119. data/public/cmaps/Katakana.bcmap +0 -0
  120. data/public/cmaps/LICENSE +36 -0
  121. data/public/cmaps/NWP-H.bcmap +0 -0
  122. data/public/cmaps/NWP-V.bcmap +0 -0
  123. data/public/cmaps/RKSJ-H.bcmap +0 -0
  124. data/public/cmaps/RKSJ-V.bcmap +0 -0
  125. data/public/cmaps/Roman.bcmap +0 -0
  126. data/public/cmaps/UniCNS-UCS2-H.bcmap +0 -0
  127. data/public/cmaps/UniCNS-UCS2-V.bcmap +0 -0
  128. data/public/cmaps/UniCNS-UTF16-H.bcmap +0 -0
  129. data/public/cmaps/UniCNS-UTF16-V.bcmap +0 -0
  130. data/public/cmaps/UniCNS-UTF32-H.bcmap +0 -0
  131. data/public/cmaps/UniCNS-UTF32-V.bcmap +0 -0
  132. data/public/cmaps/UniCNS-UTF8-H.bcmap +0 -0
  133. data/public/cmaps/UniCNS-UTF8-V.bcmap +0 -0
  134. data/public/cmaps/UniGB-UCS2-H.bcmap +0 -0
  135. data/public/cmaps/UniGB-UCS2-V.bcmap +0 -0
  136. data/public/cmaps/UniGB-UTF16-H.bcmap +0 -0
  137. data/public/cmaps/UniGB-UTF16-V.bcmap +0 -0
  138. data/public/cmaps/UniGB-UTF32-H.bcmap +0 -0
  139. data/public/cmaps/UniGB-UTF32-V.bcmap +0 -0
  140. data/public/cmaps/UniGB-UTF8-H.bcmap +0 -0
  141. data/public/cmaps/UniGB-UTF8-V.bcmap +0 -0
  142. data/public/cmaps/UniJIS-UCS2-H.bcmap +0 -0
  143. data/public/cmaps/UniJIS-UCS2-HW-H.bcmap +0 -0
  144. data/public/cmaps/UniJIS-UCS2-HW-V.bcmap +0 -0
  145. data/public/cmaps/UniJIS-UCS2-V.bcmap +0 -0
  146. data/public/cmaps/UniJIS-UTF16-H.bcmap +0 -0
  147. data/public/cmaps/UniJIS-UTF16-V.bcmap +0 -0
  148. data/public/cmaps/UniJIS-UTF32-H.bcmap +0 -0
  149. data/public/cmaps/UniJIS-UTF32-V.bcmap +0 -0
  150. data/public/cmaps/UniJIS-UTF8-H.bcmap +0 -0
  151. data/public/cmaps/UniJIS-UTF8-V.bcmap +0 -0
  152. data/public/cmaps/UniJIS2004-UTF16-H.bcmap +0 -0
  153. data/public/cmaps/UniJIS2004-UTF16-V.bcmap +0 -0
  154. data/public/cmaps/UniJIS2004-UTF32-H.bcmap +0 -0
  155. data/public/cmaps/UniJIS2004-UTF32-V.bcmap +0 -0
  156. data/public/cmaps/UniJIS2004-UTF8-H.bcmap +0 -0
  157. data/public/cmaps/UniJIS2004-UTF8-V.bcmap +0 -0
  158. data/public/cmaps/UniJISPro-UCS2-HW-V.bcmap +0 -0
  159. data/public/cmaps/UniJISPro-UCS2-V.bcmap +0 -0
  160. data/public/cmaps/UniJISPro-UTF8-V.bcmap +0 -0
  161. data/public/cmaps/UniJISX0213-UTF32-H.bcmap +0 -0
  162. data/public/cmaps/UniJISX0213-UTF32-V.bcmap +0 -0
  163. data/public/cmaps/UniJISX02132004-UTF32-H.bcmap +0 -0
  164. data/public/cmaps/UniJISX02132004-UTF32-V.bcmap +0 -0
  165. data/public/cmaps/UniKS-UCS2-H.bcmap +0 -0
  166. data/public/cmaps/UniKS-UCS2-V.bcmap +0 -0
  167. data/public/cmaps/UniKS-UTF16-H.bcmap +0 -0
  168. data/public/cmaps/UniKS-UTF16-V.bcmap +0 -0
  169. data/public/cmaps/UniKS-UTF32-H.bcmap +0 -0
  170. data/public/cmaps/UniKS-UTF32-V.bcmap +0 -0
  171. data/public/cmaps/UniKS-UTF8-H.bcmap +0 -0
  172. data/public/cmaps/UniKS-UTF8-V.bcmap +0 -0
  173. data/public/cmaps/V.bcmap +0 -0
  174. data/public/cmaps/WP-Symbol.bcmap +0 -0
  175. data/public/compatibility.js +616 -0
  176. data/public/compressed.tracemonkey-pldi-09.pdf +0 -0
  177. data/public/debugger.js +616 -0
  178. data/public/images/annotation-check.svg +11 -0
  179. data/public/images/annotation-comment.svg +16 -0
  180. data/public/images/annotation-help.svg +26 -0
  181. data/public/images/annotation-insert.svg +10 -0
  182. data/public/images/annotation-key.svg +11 -0
  183. data/public/images/annotation-newparagraph.svg +11 -0
  184. data/public/images/annotation-noicon.svg +7 -0
  185. data/public/images/annotation-note.svg +42 -0
  186. data/public/images/annotation-paragraph.svg +16 -0
  187. data/public/images/findbarButton-next-rtl.png +0 -0
  188. data/public/images/findbarButton-next-rtl@2x.png +0 -0
  189. data/public/images/findbarButton-next.png +0 -0
  190. data/public/images/findbarButton-next@2x.png +0 -0
  191. data/public/images/findbarButton-previous-rtl.png +0 -0
  192. data/public/images/findbarButton-previous-rtl@2x.png +0 -0
  193. data/public/images/findbarButton-previous.png +0 -0
  194. data/public/images/findbarButton-previous@2x.png +0 -0
  195. data/public/images/grab.cur +0 -0
  196. data/public/images/grabbing.cur +0 -0
  197. data/public/images/loading-icon.gif +0 -0
  198. data/public/images/loading-small.png +0 -0
  199. data/public/images/loading-small@2x.png +0 -0
  200. data/public/images/secondaryToolbarButton-documentProperties.png +0 -0
  201. data/public/images/secondaryToolbarButton-documentProperties@2x.png +0 -0
  202. data/public/images/secondaryToolbarButton-firstPage.png +0 -0
  203. data/public/images/secondaryToolbarButton-firstPage@2x.png +0 -0
  204. data/public/images/secondaryToolbarButton-handTool.png +0 -0
  205. data/public/images/secondaryToolbarButton-handTool@2x.png +0 -0
  206. data/public/images/secondaryToolbarButton-lastPage.png +0 -0
  207. data/public/images/secondaryToolbarButton-lastPage@2x.png +0 -0
  208. data/public/images/secondaryToolbarButton-rotateCcw.png +0 -0
  209. data/public/images/secondaryToolbarButton-rotateCcw@2x.png +0 -0
  210. data/public/images/secondaryToolbarButton-rotateCw.png +0 -0
  211. data/public/images/secondaryToolbarButton-rotateCw@2x.png +0 -0
  212. data/public/images/shadow.png +0 -0
  213. data/public/images/texture.png +0 -0
  214. data/public/images/toolbarButton-bookmark.png +0 -0
  215. data/public/images/toolbarButton-bookmark@2x.png +0 -0
  216. data/public/images/toolbarButton-download.png +0 -0
  217. data/public/images/toolbarButton-download@2x.png +0 -0
  218. data/public/images/toolbarButton-menuArrows.png +0 -0
  219. data/public/images/toolbarButton-menuArrows@2x.png +0 -0
  220. data/public/images/toolbarButton-openFile.png +0 -0
  221. data/public/images/toolbarButton-openFile@2x.png +0 -0
  222. data/public/images/toolbarButton-pageDown-rtl.png +0 -0
  223. data/public/images/toolbarButton-pageDown-rtl@2x.png +0 -0
  224. data/public/images/toolbarButton-pageDown.png +0 -0
  225. data/public/images/toolbarButton-pageDown@2x.png +0 -0
  226. data/public/images/toolbarButton-pageUp-rtl.png +0 -0
  227. data/public/images/toolbarButton-pageUp-rtl@2x.png +0 -0
  228. data/public/images/toolbarButton-pageUp.png +0 -0
  229. data/public/images/toolbarButton-pageUp@2x.png +0 -0
  230. data/public/images/toolbarButton-presentationMode.png +0 -0
  231. data/public/images/toolbarButton-presentationMode@2x.png +0 -0
  232. data/public/images/toolbarButton-print.png +0 -0
  233. data/public/images/toolbarButton-print@2x.png +0 -0
  234. data/public/images/toolbarButton-search.png +0 -0
  235. data/public/images/toolbarButton-search@2x.png +0 -0
  236. data/public/images/toolbarButton-secondaryToolbarToggle-rtl.png +0 -0
  237. data/public/images/toolbarButton-secondaryToolbarToggle-rtl@2x.png +0 -0
  238. data/public/images/toolbarButton-secondaryToolbarToggle.png +0 -0
  239. data/public/images/toolbarButton-secondaryToolbarToggle@2x.png +0 -0
  240. data/public/images/toolbarButton-sidebarToggle-rtl.png +0 -0
  241. data/public/images/toolbarButton-sidebarToggle-rtl@2x.png +0 -0
  242. data/public/images/toolbarButton-sidebarToggle.png +0 -0
  243. data/public/images/toolbarButton-sidebarToggle@2x.png +0 -0
  244. data/public/images/toolbarButton-viewAttachments.png +0 -0
  245. data/public/images/toolbarButton-viewAttachments@2x.png +0 -0
  246. data/public/images/toolbarButton-viewOutline-rtl.png +0 -0
  247. data/public/images/toolbarButton-viewOutline-rtl@2x.png +0 -0
  248. data/public/images/toolbarButton-viewOutline.png +0 -0
  249. data/public/images/toolbarButton-viewOutline@2x.png +0 -0
  250. data/public/images/toolbarButton-viewThumbnail.png +0 -0
  251. data/public/images/toolbarButton-viewThumbnail@2x.png +0 -0
  252. data/public/images/toolbarButton-zoomIn.png +0 -0
  253. data/public/images/toolbarButton-zoomIn@2x.png +0 -0
  254. data/public/images/toolbarButton-zoomOut.png +0 -0
  255. data/public/images/toolbarButton-zoomOut@2x.png +0 -0
  256. data/public/images/treeitem-collapsed-rtl.png +0 -0
  257. data/public/images/treeitem-collapsed-rtl@2x.png +0 -0
  258. data/public/images/treeitem-collapsed.png +0 -0
  259. data/public/images/treeitem-collapsed@2x.png +0 -0
  260. data/public/images/treeitem-expanded.png +0 -0
  261. data/public/images/treeitem-expanded@2x.png +0 -0
  262. data/public/l10n.js +1047 -0
  263. data/public/locale/ach/viewer.properties +173 -0
  264. data/public/locale/af/viewer.properties +173 -0
  265. data/public/locale/ak/viewer.properties +131 -0
  266. data/public/locale/an/viewer.properties +173 -0
  267. data/public/locale/ar/viewer.properties +173 -0
  268. data/public/locale/as/viewer.properties +172 -0
  269. data/public/locale/ast/viewer.properties +173 -0
  270. data/public/locale/az/viewer.properties +173 -0
  271. data/public/locale/be/viewer.properties +105 -0
  272. data/public/locale/bg/viewer.properties +173 -0
  273. data/public/locale/bn-BD/viewer.properties +173 -0
  274. data/public/locale/bn-IN/viewer.properties +173 -0
  275. data/public/locale/br/viewer.properties +173 -0
  276. data/public/locale/bs/viewer.properties +173 -0
  277. data/public/locale/ca/viewer.properties +173 -0
  278. data/public/locale/cs/viewer.properties +173 -0
  279. data/public/locale/csb/viewer.properties +134 -0
  280. data/public/locale/cy/viewer.properties +173 -0
  281. data/public/locale/da/viewer.properties +167 -0
  282. data/public/locale/de/viewer.properties +167 -0
  283. data/public/locale/el/viewer.properties +173 -0
  284. data/public/locale/en-GB/viewer.properties +173 -0
  285. data/public/locale/en-US/viewer.properties +173 -0
  286. data/public/locale/en-ZA/viewer.properties +173 -0
  287. data/public/locale/eo/viewer.properties +173 -0
  288. data/public/locale/es-AR/viewer.properties +167 -0
  289. data/public/locale/es-CL/viewer.properties +173 -0
  290. data/public/locale/es-ES/viewer.properties +111 -0
  291. data/public/locale/es-MX/viewer.properties +173 -0
  292. data/public/locale/et/viewer.properties +173 -0
  293. data/public/locale/eu/viewer.properties +173 -0
  294. data/public/locale/fa/viewer.properties +173 -0
  295. data/public/locale/ff/viewer.properties +173 -0
  296. data/public/locale/fi/viewer.properties +167 -0
  297. data/public/locale/fr/viewer.properties +167 -0
  298. data/public/locale/fy-NL/viewer.properties +180 -0
  299. data/public/locale/ga-IE/viewer.properties +173 -0
  300. data/public/locale/gd/viewer.properties +173 -0
  301. data/public/locale/gl/viewer.properties +173 -0
  302. data/public/locale/gu-IN/viewer.properties +167 -0
  303. data/public/locale/he/viewer.properties +173 -0
  304. data/public/locale/hi-IN/viewer.properties +173 -0
  305. data/public/locale/hr/viewer.properties +173 -0
  306. data/public/locale/hu/viewer.properties +173 -0
  307. data/public/locale/hy-AM/viewer.properties +173 -0
  308. data/public/locale/id/viewer.properties +173 -0
  309. data/public/locale/is/viewer.properties +173 -0
  310. data/public/locale/it/viewer.properties +111 -0
  311. data/public/locale/ja/viewer.properties +167 -0
  312. data/public/locale/ka/viewer.properties +173 -0
  313. data/public/locale/kk/viewer.properties +173 -0
  314. data/public/locale/km/viewer.properties +173 -0
  315. data/public/locale/kn/viewer.properties +173 -0
  316. data/public/locale/ko/viewer.properties +173 -0
  317. data/public/locale/ku/viewer.properties +147 -0
  318. data/public/locale/lg/viewer.properties +111 -0
  319. data/public/locale/lij/viewer.properties +124 -0
  320. data/public/locale/locale.properties +312 -0
  321. data/public/locale/lt/viewer.properties +173 -0
  322. data/public/locale/lv/viewer.properties +173 -0
  323. data/public/locale/mai/viewer.properties +173 -0
  324. data/public/locale/mk/viewer.properties +133 -0
  325. data/public/locale/ml/viewer.properties +173 -0
  326. data/public/locale/mn/viewer.properties +79 -0
  327. data/public/locale/mr/viewer.properties +173 -0
  328. data/public/locale/ms/viewer.properties +173 -0
  329. data/public/locale/my/viewer.properties +173 -0
  330. data/public/locale/nb-NO/viewer.properties +173 -0
  331. data/public/locale/nl/viewer.properties +173 -0
  332. data/public/locale/nn-NO/viewer.properties +173 -0
  333. data/public/locale/nso/viewer.properties +131 -0
  334. data/public/locale/oc/viewer.properties +171 -0
  335. data/public/locale/or/viewer.properties +172 -0
  336. data/public/locale/pa-IN/viewer.properties +173 -0
  337. data/public/locale/pl/viewer.properties +124 -0
  338. data/public/locale/pt-BR/viewer.properties +173 -0
  339. data/public/locale/pt-PT/viewer.properties +173 -0
  340. data/public/locale/rm/viewer.properties +173 -0
  341. data/public/locale/ro/viewer.properties +173 -0
  342. data/public/locale/ru/viewer.properties +111 -0
  343. data/public/locale/rw/viewer.properties +79 -0
  344. data/public/locale/sah/viewer.properties +171 -0
  345. data/public/locale/si/viewer.properties +172 -0
  346. data/public/locale/sk/viewer.properties +173 -0
  347. data/public/locale/sl/viewer.properties +173 -0
  348. data/public/locale/son/viewer.properties +173 -0
  349. data/public/locale/sq/viewer.properties +166 -0
  350. data/public/locale/sr/viewer.properties +173 -0
  351. data/public/locale/sv-SE/viewer.properties +173 -0
  352. data/public/locale/sw/viewer.properties +129 -0
  353. data/public/locale/ta/viewer.properties +173 -0
  354. data/public/locale/ta-LK/viewer.properties +72 -0
  355. data/public/locale/te/viewer.properties +173 -0
  356. data/public/locale/th/viewer.properties +173 -0
  357. data/public/locale/tl/viewer.properties +94 -0
  358. data/public/locale/tn/viewer.properties +83 -0
  359. data/public/locale/tr/viewer.properties +173 -0
  360. data/public/locale/uk/viewer.properties +173 -0
  361. data/public/locale/ur/viewer.properties +173 -0
  362. data/public/locale/vi/viewer.properties +173 -0
  363. data/public/locale/wo/viewer.properties +124 -0
  364. data/public/locale/xh/viewer.properties +173 -0
  365. data/public/locale/zh-CN/viewer.properties +173 -0
  366. data/public/locale/zh-TW/viewer.properties +174 -0
  367. data/public/locale/zu/viewer.properties +132 -0
  368. data/public/pdf.js +11515 -0
  369. data/public/pdf.worker.js +44463 -0
  370. data/public/viewer.css +2190 -0
  371. data/public/viewer.html +423 -0
  372. data/public/viewer.js +9742 -0
  373. data/public/web/cmaps/78-EUC-H.bcmap +0 -0
  374. data/public/web/cmaps/78-EUC-V.bcmap +0 -0
  375. data/public/web/cmaps/78-H.bcmap +0 -0
  376. data/public/web/cmaps/78-RKSJ-H.bcmap +0 -0
  377. data/public/web/cmaps/78-RKSJ-V.bcmap +0 -0
  378. data/public/web/cmaps/78-V.bcmap +0 -0
  379. data/public/web/cmaps/78ms-RKSJ-H.bcmap +0 -0
  380. data/public/web/cmaps/78ms-RKSJ-V.bcmap +0 -0
  381. data/public/web/cmaps/83pv-RKSJ-H.bcmap +0 -0
  382. data/public/web/cmaps/90ms-RKSJ-H.bcmap +0 -0
  383. data/public/web/cmaps/90ms-RKSJ-V.bcmap +0 -0
  384. data/public/web/cmaps/90msp-RKSJ-H.bcmap +0 -0
  385. data/public/web/cmaps/90msp-RKSJ-V.bcmap +0 -0
  386. data/public/web/cmaps/90pv-RKSJ-H.bcmap +0 -0
  387. data/public/web/cmaps/90pv-RKSJ-V.bcmap +0 -0
  388. data/public/web/cmaps/Add-H.bcmap +0 -0
  389. data/public/web/cmaps/Add-RKSJ-H.bcmap +0 -0
  390. data/public/web/cmaps/Add-RKSJ-V.bcmap +0 -0
  391. data/public/web/cmaps/Add-V.bcmap +0 -0
  392. data/public/web/cmaps/Adobe-CNS1-0.bcmap +0 -0
  393. data/public/web/cmaps/Adobe-CNS1-1.bcmap +0 -0
  394. data/public/web/cmaps/Adobe-CNS1-2.bcmap +0 -0
  395. data/public/web/cmaps/Adobe-CNS1-3.bcmap +0 -0
  396. data/public/web/cmaps/Adobe-CNS1-4.bcmap +0 -0
  397. data/public/web/cmaps/Adobe-CNS1-5.bcmap +0 -0
  398. data/public/web/cmaps/Adobe-CNS1-6.bcmap +0 -0
  399. data/public/web/cmaps/Adobe-CNS1-UCS2.bcmap +0 -0
  400. data/public/web/cmaps/Adobe-GB1-0.bcmap +0 -0
  401. data/public/web/cmaps/Adobe-GB1-1.bcmap +0 -0
  402. data/public/web/cmaps/Adobe-GB1-2.bcmap +0 -0
  403. data/public/web/cmaps/Adobe-GB1-3.bcmap +0 -0
  404. data/public/web/cmaps/Adobe-GB1-4.bcmap +0 -0
  405. data/public/web/cmaps/Adobe-GB1-5.bcmap +0 -0
  406. data/public/web/cmaps/Adobe-GB1-UCS2.bcmap +0 -0
  407. data/public/web/cmaps/Adobe-Japan1-0.bcmap +0 -0
  408. data/public/web/cmaps/Adobe-Japan1-1.bcmap +0 -0
  409. data/public/web/cmaps/Adobe-Japan1-2.bcmap +0 -0
  410. data/public/web/cmaps/Adobe-Japan1-3.bcmap +0 -0
  411. data/public/web/cmaps/Adobe-Japan1-4.bcmap +0 -0
  412. data/public/web/cmaps/Adobe-Japan1-5.bcmap +0 -0
  413. data/public/web/cmaps/Adobe-Japan1-6.bcmap +0 -0
  414. data/public/web/cmaps/Adobe-Japan1-UCS2.bcmap +0 -0
  415. data/public/web/cmaps/Adobe-Korea1-0.bcmap +0 -0
  416. data/public/web/cmaps/Adobe-Korea1-1.bcmap +0 -0
  417. data/public/web/cmaps/Adobe-Korea1-2.bcmap +0 -0
  418. data/public/web/cmaps/Adobe-Korea1-UCS2.bcmap +0 -0
  419. data/public/web/cmaps/B5-H.bcmap +0 -0
  420. data/public/web/cmaps/B5-V.bcmap +0 -0
  421. data/public/web/cmaps/B5pc-H.bcmap +0 -0
  422. data/public/web/cmaps/B5pc-V.bcmap +0 -0
  423. data/public/web/cmaps/CNS-EUC-H.bcmap +0 -0
  424. data/public/web/cmaps/CNS-EUC-V.bcmap +0 -0
  425. data/public/web/cmaps/CNS1-H.bcmap +0 -0
  426. data/public/web/cmaps/CNS1-V.bcmap +0 -0
  427. data/public/web/cmaps/CNS2-H.bcmap +0 -0
  428. data/public/web/cmaps/CNS2-V.bcmap +3 -0
  429. data/public/web/cmaps/ETHK-B5-H.bcmap +0 -0
  430. data/public/web/cmaps/ETHK-B5-V.bcmap +0 -0
  431. data/public/web/cmaps/ETen-B5-H.bcmap +0 -0
  432. data/public/web/cmaps/ETen-B5-V.bcmap +0 -0
  433. data/public/web/cmaps/ETenms-B5-H.bcmap +3 -0
  434. data/public/web/cmaps/ETenms-B5-V.bcmap +0 -0
  435. data/public/web/cmaps/EUC-H.bcmap +0 -0
  436. data/public/web/cmaps/EUC-V.bcmap +0 -0
  437. data/public/web/cmaps/Ext-H.bcmap +0 -0
  438. data/public/web/cmaps/Ext-RKSJ-H.bcmap +0 -0
  439. data/public/web/cmaps/Ext-RKSJ-V.bcmap +0 -0
  440. data/public/web/cmaps/Ext-V.bcmap +0 -0
  441. data/public/web/cmaps/GB-EUC-H.bcmap +0 -0
  442. data/public/web/cmaps/GB-EUC-V.bcmap +0 -0
  443. data/public/web/cmaps/GB-H.bcmap +4 -0
  444. data/public/web/cmaps/GB-V.bcmap +0 -0
  445. data/public/web/cmaps/GBK-EUC-H.bcmap +0 -0
  446. data/public/web/cmaps/GBK-EUC-V.bcmap +0 -0
  447. data/public/web/cmaps/GBK2K-H.bcmap +0 -0
  448. data/public/web/cmaps/GBK2K-V.bcmap +0 -0
  449. data/public/web/cmaps/GBKp-EUC-H.bcmap +0 -0
  450. data/public/web/cmaps/GBKp-EUC-V.bcmap +0 -0
  451. data/public/web/cmaps/GBT-EUC-H.bcmap +0 -0
  452. data/public/web/cmaps/GBT-EUC-V.bcmap +0 -0
  453. data/public/web/cmaps/GBT-H.bcmap +0 -0
  454. data/public/web/cmaps/GBT-V.bcmap +0 -0
  455. data/public/web/cmaps/GBTpc-EUC-H.bcmap +0 -0
  456. data/public/web/cmaps/GBTpc-EUC-V.bcmap +0 -0
  457. data/public/web/cmaps/GBpc-EUC-H.bcmap +0 -0
  458. data/public/web/cmaps/GBpc-EUC-V.bcmap +0 -0
  459. data/public/web/cmaps/H.bcmap +0 -0
  460. data/public/web/cmaps/HKdla-B5-H.bcmap +0 -0
  461. data/public/web/cmaps/HKdla-B5-V.bcmap +0 -0
  462. data/public/web/cmaps/HKdlb-B5-H.bcmap +0 -0
  463. data/public/web/cmaps/HKdlb-B5-V.bcmap +0 -0
  464. data/public/web/cmaps/HKgccs-B5-H.bcmap +0 -0
  465. data/public/web/cmaps/HKgccs-B5-V.bcmap +0 -0
  466. data/public/web/cmaps/HKm314-B5-H.bcmap +0 -0
  467. data/public/web/cmaps/HKm314-B5-V.bcmap +0 -0
  468. data/public/web/cmaps/HKm471-B5-H.bcmap +0 -0
  469. data/public/web/cmaps/HKm471-B5-V.bcmap +0 -0
  470. data/public/web/cmaps/HKscs-B5-H.bcmap +0 -0
  471. data/public/web/cmaps/HKscs-B5-V.bcmap +0 -0
  472. data/public/web/cmaps/Hankaku.bcmap +0 -0
  473. data/public/web/cmaps/Hiragana.bcmap +0 -0
  474. data/public/web/cmaps/KSC-EUC-H.bcmap +0 -0
  475. data/public/web/cmaps/KSC-EUC-V.bcmap +0 -0
  476. data/public/web/cmaps/KSC-H.bcmap +0 -0
  477. data/public/web/cmaps/KSC-Johab-H.bcmap +0 -0
  478. data/public/web/cmaps/KSC-Johab-V.bcmap +0 -0
  479. data/public/web/cmaps/KSC-V.bcmap +0 -0
  480. data/public/web/cmaps/KSCms-UHC-H.bcmap +0 -0
  481. data/public/web/cmaps/KSCms-UHC-HW-H.bcmap +0 -0
  482. data/public/web/cmaps/KSCms-UHC-HW-V.bcmap +0 -0
  483. data/public/web/cmaps/KSCms-UHC-V.bcmap +0 -0
  484. data/public/web/cmaps/KSCpc-EUC-H.bcmap +0 -0
  485. data/public/web/cmaps/KSCpc-EUC-V.bcmap +0 -0
  486. data/public/web/cmaps/Katakana.bcmap +0 -0
  487. data/public/web/cmaps/LICENSE +36 -0
  488. data/public/web/cmaps/NWP-H.bcmap +0 -0
  489. data/public/web/cmaps/NWP-V.bcmap +0 -0
  490. data/public/web/cmaps/RKSJ-H.bcmap +0 -0
  491. data/public/web/cmaps/RKSJ-V.bcmap +0 -0
  492. data/public/web/cmaps/Roman.bcmap +0 -0
  493. data/public/web/cmaps/UniCNS-UCS2-H.bcmap +0 -0
  494. data/public/web/cmaps/UniCNS-UCS2-V.bcmap +0 -0
  495. data/public/web/cmaps/UniCNS-UTF16-H.bcmap +0 -0
  496. data/public/web/cmaps/UniCNS-UTF16-V.bcmap +0 -0
  497. data/public/web/cmaps/UniCNS-UTF32-H.bcmap +0 -0
  498. data/public/web/cmaps/UniCNS-UTF32-V.bcmap +0 -0
  499. data/public/web/cmaps/UniCNS-UTF8-H.bcmap +0 -0
  500. data/public/web/cmaps/UniCNS-UTF8-V.bcmap +0 -0
  501. data/public/web/cmaps/UniGB-UCS2-H.bcmap +0 -0
  502. data/public/web/cmaps/UniGB-UCS2-V.bcmap +0 -0
  503. data/public/web/cmaps/UniGB-UTF16-H.bcmap +0 -0
  504. data/public/web/cmaps/UniGB-UTF16-V.bcmap +0 -0
  505. data/public/web/cmaps/UniGB-UTF32-H.bcmap +0 -0
  506. data/public/web/cmaps/UniGB-UTF32-V.bcmap +0 -0
  507. data/public/web/cmaps/UniGB-UTF8-H.bcmap +0 -0
  508. data/public/web/cmaps/UniGB-UTF8-V.bcmap +0 -0
  509. data/public/web/cmaps/UniJIS-UCS2-H.bcmap +0 -0
  510. data/public/web/cmaps/UniJIS-UCS2-HW-H.bcmap +0 -0
  511. data/public/web/cmaps/UniJIS-UCS2-HW-V.bcmap +0 -0
  512. data/public/web/cmaps/UniJIS-UCS2-V.bcmap +0 -0
  513. data/public/web/cmaps/UniJIS-UTF16-H.bcmap +0 -0
  514. data/public/web/cmaps/UniJIS-UTF16-V.bcmap +0 -0
  515. data/public/web/cmaps/UniJIS-UTF32-H.bcmap +0 -0
  516. data/public/web/cmaps/UniJIS-UTF32-V.bcmap +0 -0
  517. data/public/web/cmaps/UniJIS-UTF8-H.bcmap +0 -0
  518. data/public/web/cmaps/UniJIS-UTF8-V.bcmap +0 -0
  519. data/public/web/cmaps/UniJIS2004-UTF16-H.bcmap +0 -0
  520. data/public/web/cmaps/UniJIS2004-UTF16-V.bcmap +0 -0
  521. data/public/web/cmaps/UniJIS2004-UTF32-H.bcmap +0 -0
  522. data/public/web/cmaps/UniJIS2004-UTF32-V.bcmap +0 -0
  523. data/public/web/cmaps/UniJIS2004-UTF8-H.bcmap +0 -0
  524. data/public/web/cmaps/UniJIS2004-UTF8-V.bcmap +0 -0
  525. data/public/web/cmaps/UniJISPro-UCS2-HW-V.bcmap +0 -0
  526. data/public/web/cmaps/UniJISPro-UCS2-V.bcmap +0 -0
  527. data/public/web/cmaps/UniJISPro-UTF8-V.bcmap +0 -0
  528. data/public/web/cmaps/UniJISX0213-UTF32-H.bcmap +0 -0
  529. data/public/web/cmaps/UniJISX0213-UTF32-V.bcmap +0 -0
  530. data/public/web/cmaps/UniJISX02132004-UTF32-H.bcmap +0 -0
  531. data/public/web/cmaps/UniJISX02132004-UTF32-V.bcmap +0 -0
  532. data/public/web/cmaps/UniKS-UCS2-H.bcmap +0 -0
  533. data/public/web/cmaps/UniKS-UCS2-V.bcmap +0 -0
  534. data/public/web/cmaps/UniKS-UTF16-H.bcmap +0 -0
  535. data/public/web/cmaps/UniKS-UTF16-V.bcmap +0 -0
  536. data/public/web/cmaps/UniKS-UTF32-H.bcmap +0 -0
  537. data/public/web/cmaps/UniKS-UTF32-V.bcmap +0 -0
  538. data/public/web/cmaps/UniKS-UTF8-H.bcmap +0 -0
  539. data/public/web/cmaps/UniKS-UTF8-V.bcmap +0 -0
  540. data/public/web/cmaps/V.bcmap +0 -0
  541. data/public/web/cmaps/WP-Symbol.bcmap +0 -0
  542. data/public/web/compatibility.js +596 -0
  543. data/public/web/compressed.tracemonkey-pldi-09.pdf +0 -0
  544. data/public/web/debugger.js +616 -0
  545. data/public/web/images/annotation-check.svg +11 -0
  546. data/public/web/images/annotation-comment.svg +16 -0
  547. data/public/web/images/annotation-help.svg +26 -0
  548. data/public/web/images/annotation-insert.svg +10 -0
  549. data/public/web/images/annotation-key.svg +11 -0
  550. data/public/web/images/annotation-newparagraph.svg +11 -0
  551. data/public/web/images/annotation-noicon.svg +7 -0
  552. data/public/web/images/annotation-note.svg +42 -0
  553. data/public/web/images/annotation-paragraph.svg +16 -0
  554. data/public/web/images/findbarButton-next-rtl.png +0 -0
  555. data/public/web/images/findbarButton-next-rtl@2x.png +0 -0
  556. data/public/web/images/findbarButton-next.png +0 -0
  557. data/public/web/images/findbarButton-next@2x.png +0 -0
  558. data/public/web/images/findbarButton-previous-rtl.png +0 -0
  559. data/public/web/images/findbarButton-previous-rtl@2x.png +0 -0
  560. data/public/web/images/findbarButton-previous.png +0 -0
  561. data/public/web/images/findbarButton-previous@2x.png +0 -0
  562. data/public/web/images/grab.cur +0 -0
  563. data/public/web/images/grabbing.cur +0 -0
  564. data/public/web/images/loading-icon.gif +0 -0
  565. data/public/web/images/loading-small.png +0 -0
  566. data/public/web/images/loading-small@2x.png +0 -0
  567. data/public/web/images/secondaryToolbarButton-documentProperties.png +0 -0
  568. data/public/web/images/secondaryToolbarButton-documentProperties@2x.png +0 -0
  569. data/public/web/images/secondaryToolbarButton-firstPage.png +0 -0
  570. data/public/web/images/secondaryToolbarButton-firstPage@2x.png +0 -0
  571. data/public/web/images/secondaryToolbarButton-handTool.png +0 -0
  572. data/public/web/images/secondaryToolbarButton-handTool@2x.png +0 -0
  573. data/public/web/images/secondaryToolbarButton-lastPage.png +0 -0
  574. data/public/web/images/secondaryToolbarButton-lastPage@2x.png +0 -0
  575. data/public/web/images/secondaryToolbarButton-rotateCcw.png +0 -0
  576. data/public/web/images/secondaryToolbarButton-rotateCcw@2x.png +0 -0
  577. data/public/web/images/secondaryToolbarButton-rotateCw.png +0 -0
  578. data/public/web/images/secondaryToolbarButton-rotateCw@2x.png +0 -0
  579. data/public/web/images/shadow.png +0 -0
  580. data/public/web/images/texture.png +0 -0
  581. data/public/web/images/toolbarButton-bookmark.png +0 -0
  582. data/public/web/images/toolbarButton-bookmark@2x.png +0 -0
  583. data/public/web/images/toolbarButton-download.png +0 -0
  584. data/public/web/images/toolbarButton-download@2x.png +0 -0
  585. data/public/web/images/toolbarButton-menuArrows.png +0 -0
  586. data/public/web/images/toolbarButton-menuArrows@2x.png +0 -0
  587. data/public/web/images/toolbarButton-openFile.png +0 -0
  588. data/public/web/images/toolbarButton-openFile@2x.png +0 -0
  589. data/public/web/images/toolbarButton-pageDown-rtl.png +0 -0
  590. data/public/web/images/toolbarButton-pageDown-rtl@2x.png +0 -0
  591. data/public/web/images/toolbarButton-pageDown.png +0 -0
  592. data/public/web/images/toolbarButton-pageDown@2x.png +0 -0
  593. data/public/web/images/toolbarButton-pageUp-rtl.png +0 -0
  594. data/public/web/images/toolbarButton-pageUp-rtl@2x.png +0 -0
  595. data/public/web/images/toolbarButton-pageUp.png +0 -0
  596. data/public/web/images/toolbarButton-pageUp@2x.png +0 -0
  597. data/public/web/images/toolbarButton-presentationMode.png +0 -0
  598. data/public/web/images/toolbarButton-presentationMode@2x.png +0 -0
  599. data/public/web/images/toolbarButton-print.png +0 -0
  600. data/public/web/images/toolbarButton-print@2x.png +0 -0
  601. data/public/web/images/toolbarButton-search.png +0 -0
  602. data/public/web/images/toolbarButton-search@2x.png +0 -0
  603. data/public/web/images/toolbarButton-secondaryToolbarToggle-rtl.png +0 -0
  604. data/public/web/images/toolbarButton-secondaryToolbarToggle-rtl@2x.png +0 -0
  605. data/public/web/images/toolbarButton-secondaryToolbarToggle.png +0 -0
  606. data/public/web/images/toolbarButton-secondaryToolbarToggle@2x.png +0 -0
  607. data/public/web/images/toolbarButton-sidebarToggle-rtl.png +0 -0
  608. data/public/web/images/toolbarButton-sidebarToggle-rtl@2x.png +0 -0
  609. data/public/web/images/toolbarButton-sidebarToggle.png +0 -0
  610. data/public/web/images/toolbarButton-sidebarToggle@2x.png +0 -0
  611. data/public/web/images/toolbarButton-viewAttachments.png +0 -0
  612. data/public/web/images/toolbarButton-viewAttachments@2x.png +0 -0
  613. data/public/web/images/toolbarButton-viewOutline-rtl.png +0 -0
  614. data/public/web/images/toolbarButton-viewOutline-rtl@2x.png +0 -0
  615. data/public/web/images/toolbarButton-viewOutline.png +0 -0
  616. data/public/web/images/toolbarButton-viewOutline@2x.png +0 -0
  617. data/public/web/images/toolbarButton-viewThumbnail.png +0 -0
  618. data/public/web/images/toolbarButton-viewThumbnail@2x.png +0 -0
  619. data/public/web/images/toolbarButton-zoomIn.png +0 -0
  620. data/public/web/images/toolbarButton-zoomIn@2x.png +0 -0
  621. data/public/web/images/toolbarButton-zoomOut.png +0 -0
  622. data/public/web/images/toolbarButton-zoomOut@2x.png +0 -0
  623. data/public/web/images/treeitem-collapsed-rtl.png +0 -0
  624. data/public/web/images/treeitem-collapsed-rtl@2x.png +0 -0
  625. data/public/web/images/treeitem-collapsed.png +0 -0
  626. data/public/web/images/treeitem-collapsed@2x.png +0 -0
  627. data/public/web/images/treeitem-expanded.png +0 -0
  628. data/public/web/images/treeitem-expanded@2x.png +0 -0
  629. data/public/web/l10n.js +1033 -0
  630. data/public/web/locale/ach/viewer.properties +173 -0
  631. data/public/web/locale/af/viewer.properties +173 -0
  632. data/public/web/locale/ak/viewer.properties +131 -0
  633. data/public/web/locale/an/viewer.properties +173 -0
  634. data/public/web/locale/ar/viewer.properties +173 -0
  635. data/public/web/locale/as/viewer.properties +172 -0
  636. data/public/web/locale/ast/viewer.properties +173 -0
  637. data/public/web/locale/az/viewer.properties +173 -0
  638. data/public/web/locale/be/viewer.properties +105 -0
  639. data/public/web/locale/bg/viewer.properties +173 -0
  640. data/public/web/locale/bn-BD/viewer.properties +173 -0
  641. data/public/web/locale/bn-IN/viewer.properties +173 -0
  642. data/public/web/locale/br/viewer.properties +173 -0
  643. data/public/web/locale/bs/viewer.properties +173 -0
  644. data/public/web/locale/ca/viewer.properties +173 -0
  645. data/public/web/locale/cs/viewer.properties +173 -0
  646. data/public/web/locale/csb/viewer.properties +134 -0
  647. data/public/web/locale/cy/viewer.properties +173 -0
  648. data/public/web/locale/da/viewer.properties +167 -0
  649. data/public/web/locale/de/viewer.properties +167 -0
  650. data/public/web/locale/el/viewer.properties +173 -0
  651. data/public/web/locale/en-GB/viewer.properties +173 -0
  652. data/public/web/locale/en-US/viewer.properties +173 -0
  653. data/public/web/locale/en-ZA/viewer.properties +173 -0
  654. data/public/web/locale/eo/viewer.properties +173 -0
  655. data/public/web/locale/es-AR/viewer.properties +167 -0
  656. data/public/web/locale/es-CL/viewer.properties +173 -0
  657. data/public/web/locale/es-ES/viewer.properties +111 -0
  658. data/public/web/locale/es-MX/viewer.properties +173 -0
  659. data/public/web/locale/et/viewer.properties +173 -0
  660. data/public/web/locale/eu/viewer.properties +173 -0
  661. data/public/web/locale/fa/viewer.properties +173 -0
  662. data/public/web/locale/ff/viewer.properties +173 -0
  663. data/public/web/locale/fi/viewer.properties +167 -0
  664. data/public/web/locale/fr/viewer.properties +167 -0
  665. data/public/web/locale/fy-NL/viewer.properties +180 -0
  666. data/public/web/locale/ga-IE/viewer.properties +173 -0
  667. data/public/web/locale/gd/viewer.properties +173 -0
  668. data/public/web/locale/gl/viewer.properties +173 -0
  669. data/public/web/locale/gu-IN/viewer.properties +167 -0
  670. data/public/web/locale/he/viewer.properties +173 -0
  671. data/public/web/locale/hi-IN/viewer.properties +173 -0
  672. data/public/web/locale/hr/viewer.properties +173 -0
  673. data/public/web/locale/hu/viewer.properties +173 -0
  674. data/public/web/locale/hy-AM/viewer.properties +173 -0
  675. data/public/web/locale/id/viewer.properties +173 -0
  676. data/public/web/locale/is/viewer.properties +173 -0
  677. data/public/web/locale/it/viewer.properties +111 -0
  678. data/public/web/locale/ja/viewer.properties +167 -0
  679. data/public/web/locale/ka/viewer.properties +173 -0
  680. data/public/web/locale/kk/viewer.properties +173 -0
  681. data/public/web/locale/km/viewer.properties +173 -0
  682. data/public/web/locale/kn/viewer.properties +173 -0
  683. data/public/web/locale/ko/viewer.properties +173 -0
  684. data/public/web/locale/ku/viewer.properties +147 -0
  685. data/public/web/locale/lg/viewer.properties +111 -0
  686. data/public/web/locale/lij/viewer.properties +124 -0
  687. data/public/web/locale/locale.properties +312 -0
  688. data/public/web/locale/lt/viewer.properties +173 -0
  689. data/public/web/locale/lv/viewer.properties +173 -0
  690. data/public/web/locale/mai/viewer.properties +173 -0
  691. data/public/web/locale/mk/viewer.properties +133 -0
  692. data/public/web/locale/ml/viewer.properties +173 -0
  693. data/public/web/locale/mn/viewer.properties +79 -0
  694. data/public/web/locale/mr/viewer.properties +173 -0
  695. data/public/web/locale/ms/viewer.properties +173 -0
  696. data/public/web/locale/my/viewer.properties +173 -0
  697. data/public/web/locale/nb-NO/viewer.properties +173 -0
  698. data/public/web/locale/nl/viewer.properties +173 -0
  699. data/public/web/locale/nn-NO/viewer.properties +173 -0
  700. data/public/web/locale/nso/viewer.properties +131 -0
  701. data/public/web/locale/oc/viewer.properties +171 -0
  702. data/public/web/locale/or/viewer.properties +172 -0
  703. data/public/web/locale/pa-IN/viewer.properties +173 -0
  704. data/public/web/locale/pl/viewer.properties +124 -0
  705. data/public/web/locale/pt-BR/viewer.properties +173 -0
  706. data/public/web/locale/pt-PT/viewer.properties +173 -0
  707. data/public/web/locale/rm/viewer.properties +173 -0
  708. data/public/web/locale/ro/viewer.properties +173 -0
  709. data/public/web/locale/ru/viewer.properties +111 -0
  710. data/public/web/locale/rw/viewer.properties +79 -0
  711. data/public/web/locale/sah/viewer.properties +171 -0
  712. data/public/web/locale/si/viewer.properties +172 -0
  713. data/public/web/locale/sk/viewer.properties +173 -0
  714. data/public/web/locale/sl/viewer.properties +173 -0
  715. data/public/web/locale/son/viewer.properties +173 -0
  716. data/public/web/locale/sq/viewer.properties +166 -0
  717. data/public/web/locale/sr/viewer.properties +173 -0
  718. data/public/web/locale/sv-SE/viewer.properties +173 -0
  719. data/public/web/locale/sw/viewer.properties +129 -0
  720. data/public/web/locale/ta/viewer.properties +173 -0
  721. data/public/web/locale/ta-LK/viewer.properties +72 -0
  722. data/public/web/locale/te/viewer.properties +173 -0
  723. data/public/web/locale/th/viewer.properties +173 -0
  724. data/public/web/locale/tl/viewer.properties +94 -0
  725. data/public/web/locale/tn/viewer.properties +83 -0
  726. data/public/web/locale/tr/viewer.properties +173 -0
  727. data/public/web/locale/uk/viewer.properties +173 -0
  728. data/public/web/locale/ur/viewer.properties +173 -0
  729. data/public/web/locale/vi/viewer.properties +173 -0
  730. data/public/web/locale/wo/viewer.properties +124 -0
  731. data/public/web/locale/xh/viewer.properties +173 -0
  732. data/public/web/locale/zh-CN/viewer.properties +173 -0
  733. data/public/web/locale/zh-TW/viewer.properties +174 -0
  734. data/public/web/locale/zu/viewer.properties +132 -0
  735. data/public/web/viewer.css +2191 -0
  736. data/public/web/viewer.html +425 -0
  737. data/public/web/viewer.js +9780 -0
  738. data/set/abstract/pdfjs.rb +36 -0
  739. metadata +796 -0
@@ -0,0 +1,1033 @@
1
+ /**
2
+ * Copyright (c) 2011-2013 Fabien Cazenave, Mozilla.
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to
6
+ * deal in the Software without restriction, including without limitation the
7
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
8
+ * sell copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
20
+ * IN THE SOFTWARE.
21
+ */
22
+ /*
23
+ Additional modifications for PDF.js project:
24
+ - Disables language initialization on page loading;
25
+ - Removes consoleWarn and consoleLog and use console.log/warn directly.
26
+ - Removes window._ assignment.
27
+ - Remove compatibility code for OldIE.
28
+ */
29
+
30
+ /*jshint browser: true, devel: true, es5: true, globalstrict: true */
31
+ 'use strict';
32
+
33
+ document.webL10n = (function(window, document, undefined) {
34
+ var gL10nData = {};
35
+ var gTextData = '';
36
+ var gTextProp = 'textContent';
37
+ var gLanguage = '';
38
+ var gMacros = {};
39
+ var gReadyState = 'loading';
40
+
41
+
42
+ /**
43
+ * Synchronously loading l10n resources significantly minimizes flickering
44
+ * from displaying the app with non-localized strings and then updating the
45
+ * strings. Although this will block all script execution on this page, we
46
+ * expect that the l10n resources are available locally on flash-storage.
47
+ *
48
+ * As synchronous XHR is generally considered as a bad idea, we're still
49
+ * loading l10n resources asynchronously -- but we keep this in a setting,
50
+ * just in case... and applications using this library should hide their
51
+ * content until the `localized' event happens.
52
+ */
53
+
54
+ var gAsyncResourceLoading = true; // read-only
55
+
56
+
57
+ /**
58
+ * DOM helpers for the so-called "HTML API".
59
+ *
60
+ * These functions are written for modern browsers. For old versions of IE,
61
+ * they're overridden in the 'startup' section at the end of this file.
62
+ */
63
+
64
+ function getL10nResourceLinks() {
65
+ return document.querySelectorAll('link[type="application/l10n"]');
66
+ }
67
+
68
+ function getL10nDictionary() {
69
+ var script = document.querySelector('script[type="application/l10n"]');
70
+ // TODO: support multiple and external JSON dictionaries
71
+ return script ? JSON.parse(script.innerHTML) : null;
72
+ }
73
+
74
+ function getTranslatableChildren(element) {
75
+ return element ? element.querySelectorAll('*[data-l10n-id]') : [];
76
+ }
77
+
78
+ function getL10nAttributes(element) {
79
+ if (!element)
80
+ return {};
81
+
82
+ var l10nId = element.getAttribute('data-l10n-id');
83
+ var l10nArgs = element.getAttribute('data-l10n-args');
84
+ var args = {};
85
+ if (l10nArgs) {
86
+ try {
87
+ args = JSON.parse(l10nArgs);
88
+ } catch (e) {
89
+ console.warn('could not parse arguments for #' + l10nId);
90
+ }
91
+ }
92
+ return { id: l10nId, args: args };
93
+ }
94
+
95
+ function fireL10nReadyEvent(lang) {
96
+ var evtObject = document.createEvent('Event');
97
+ evtObject.initEvent('localized', true, false);
98
+ evtObject.language = lang;
99
+ document.dispatchEvent(evtObject);
100
+ }
101
+
102
+ function xhrLoadText(url, onSuccess, onFailure) {
103
+ onSuccess = onSuccess || function _onSuccess(data) {};
104
+ onFailure = onFailure || function _onFailure() {
105
+ console.warn(url + ' not found.');
106
+ };
107
+
108
+ var xhr = new XMLHttpRequest();
109
+ xhr.open('GET', url, gAsyncResourceLoading);
110
+ if (xhr.overrideMimeType) {
111
+ xhr.overrideMimeType('text/plain; charset=utf-8');
112
+ }
113
+ xhr.onreadystatechange = function() {
114
+ if (xhr.readyState == 4) {
115
+ if (xhr.status == 200 || xhr.status === 0) {
116
+ onSuccess(xhr.responseText);
117
+ } else {
118
+ onFailure();
119
+ }
120
+ }
121
+ };
122
+ xhr.onerror = onFailure;
123
+ xhr.ontimeout = onFailure;
124
+
125
+ // in Firefox OS with the app:// protocol, trying to XHR a non-existing
126
+ // URL will raise an exception here -- hence this ugly try...catch.
127
+ try {
128
+ xhr.send(null);
129
+ } catch (e) {
130
+ onFailure();
131
+ }
132
+ }
133
+
134
+
135
+ /**
136
+ * l10n resource parser:
137
+ * - reads (async XHR) the l10n resource matching `lang';
138
+ * - imports linked resources (synchronously) when specified;
139
+ * - parses the text data (fills `gL10nData' and `gTextData');
140
+ * - triggers success/failure callbacks when done.
141
+ *
142
+ * @param {string} href
143
+ * URL of the l10n resource to parse.
144
+ *
145
+ * @param {string} lang
146
+ * locale (language) to parse. Must be a lowercase string.
147
+ *
148
+ * @param {Function} successCallback
149
+ * triggered when the l10n resource has been successully parsed.
150
+ *
151
+ * @param {Function} failureCallback
152
+ * triggered when the an error has occured.
153
+ *
154
+ * @return {void}
155
+ * uses the following global variables: gL10nData, gTextData, gTextProp.
156
+ */
157
+
158
+ function parseResource(href, lang, successCallback, failureCallback) {
159
+ var baseURL = href.replace(/[^\/]*$/, '') || './';
160
+
161
+ // handle escaped characters (backslashes) in a string
162
+ function evalString(text) {
163
+ if (text.lastIndexOf('\\') < 0)
164
+ return text;
165
+ return text.replace(/\\\\/g, '\\')
166
+ .replace(/\\n/g, '\n')
167
+ .replace(/\\r/g, '\r')
168
+ .replace(/\\t/g, '\t')
169
+ .replace(/\\b/g, '\b')
170
+ .replace(/\\f/g, '\f')
171
+ .replace(/\\{/g, '{')
172
+ .replace(/\\}/g, '}')
173
+ .replace(/\\"/g, '"')
174
+ .replace(/\\'/g, "'");
175
+ }
176
+
177
+ // parse *.properties text data into an l10n dictionary
178
+ // If gAsyncResourceLoading is false, then the callback will be called
179
+ // synchronously. Otherwise it is called asynchronously.
180
+ function parseProperties(text, parsedPropertiesCallback) {
181
+ var dictionary = {};
182
+
183
+ // token expressions
184
+ var reBlank = /^\s*|\s*$/;
185
+ var reComment = /^\s*#|^\s*$/;
186
+ var reSection = /^\s*\[(.*)\]\s*$/;
187
+ var reImport = /^\s*@import\s+url\((.*)\)\s*$/i;
188
+ var reSplit = /^([^=\s]*)\s*=\s*(.+)$/; // TODO: escape EOLs with '\'
189
+
190
+ // parse the *.properties file into an associative array
191
+ function parseRawLines(rawText, extendedSyntax, parsedRawLinesCallback) {
192
+ var entries = rawText.replace(reBlank, '').split(/[\r\n]+/);
193
+ var currentLang = '*';
194
+ var genericLang = lang.split('-', 1)[0];
195
+ var skipLang = false;
196
+ var match = '';
197
+
198
+ function nextEntry() {
199
+ // Use infinite loop instead of recursion to avoid reaching the
200
+ // maximum recursion limit for content with many lines.
201
+ while (true) {
202
+ if (!entries.length) {
203
+ parsedRawLinesCallback();
204
+ return;
205
+ }
206
+ var line = entries.shift();
207
+
208
+ // comment or blank line?
209
+ if (reComment.test(line))
210
+ continue;
211
+
212
+ // the extended syntax supports [lang] sections and @import rules
213
+ if (extendedSyntax) {
214
+ match = reSection.exec(line);
215
+ if (match) { // section start?
216
+ // RFC 4646, section 4.4, "All comparisons MUST be performed
217
+ // in a case-insensitive manner."
218
+
219
+ currentLang = match[1].toLowerCase();
220
+ skipLang = (currentLang !== '*') &&
221
+ (currentLang !== lang) && (currentLang !== genericLang);
222
+ continue;
223
+ } else if (skipLang) {
224
+ continue;
225
+ }
226
+ match = reImport.exec(line);
227
+ if (match) { // @import rule?
228
+ loadImport(baseURL + match[1], nextEntry);
229
+ return;
230
+ }
231
+ }
232
+
233
+ // key-value pair
234
+ var tmp = line.match(reSplit);
235
+ if (tmp && tmp.length == 3) {
236
+ dictionary[tmp[1]] = evalString(tmp[2]);
237
+ }
238
+ }
239
+ }
240
+ nextEntry();
241
+ }
242
+
243
+ // import another *.properties file
244
+ function loadImport(url, callback) {
245
+ xhrLoadText(url, function(content) {
246
+ parseRawLines(content, false, callback); // don't allow recursive imports
247
+ }, null);
248
+ }
249
+
250
+ // fill the dictionary
251
+ parseRawLines(text, true, function() {
252
+ parsedPropertiesCallback(dictionary);
253
+ });
254
+ }
255
+
256
+ // load and parse l10n data (warning: global variables are used here)
257
+ xhrLoadText(href, function(response) {
258
+ gTextData += response; // mostly for debug
259
+
260
+ // parse *.properties text data into an l10n dictionary
261
+ parseProperties(response, function(data) {
262
+
263
+ // find attribute descriptions, if any
264
+ for (var key in data) {
265
+ var id, prop, index = key.lastIndexOf('.');
266
+ if (index > 0) { // an attribute has been specified
267
+ id = key.substring(0, index);
268
+ prop = key.substr(index + 1);
269
+ } else { // no attribute: assuming text content by default
270
+ id = key;
271
+ prop = gTextProp;
272
+ }
273
+ if (!gL10nData[id]) {
274
+ gL10nData[id] = {};
275
+ }
276
+ gL10nData[id][prop] = data[key];
277
+ }
278
+
279
+ // trigger callback
280
+ if (successCallback) {
281
+ successCallback();
282
+ }
283
+ });
284
+ }, failureCallback);
285
+ }
286
+
287
+ // load and parse all resources for the specified locale
288
+ function loadLocale(lang, callback) {
289
+ // RFC 4646, section 2.1 states that language tags have to be treated as
290
+ // case-insensitive. Convert to lowercase for case-insensitive comparisons.
291
+ if (lang) {
292
+ lang = lang.toLowerCase();
293
+ }
294
+
295
+ callback = callback || function _callback() {};
296
+
297
+ clear();
298
+ gLanguage = lang;
299
+
300
+ // check all <link type="application/l10n" href="..." /> nodes
301
+ // and load the resource files
302
+ var langLinks = getL10nResourceLinks();
303
+ var langCount = langLinks.length;
304
+ if (langCount === 0) {
305
+ // we might have a pre-compiled dictionary instead
306
+ var dict = getL10nDictionary();
307
+ if (dict && dict.locales && dict.default_locale) {
308
+ console.log('using the embedded JSON directory, early way out');
309
+ gL10nData = dict.locales[lang];
310
+ if (!gL10nData) {
311
+ var defaultLocale = dict.default_locale.toLowerCase();
312
+ for (var anyCaseLang in dict.locales) {
313
+ anyCaseLang = anyCaseLang.toLowerCase();
314
+ if (anyCaseLang === lang) {
315
+ gL10nData = dict.locales[lang];
316
+ break;
317
+ } else if (anyCaseLang === defaultLocale) {
318
+ gL10nData = dict.locales[defaultLocale];
319
+ }
320
+ }
321
+ }
322
+ callback();
323
+ } else {
324
+ console.log('no resource to load, early way out');
325
+ }
326
+ // early way out
327
+ fireL10nReadyEvent(lang);
328
+ gReadyState = 'complete';
329
+ return;
330
+ }
331
+
332
+ // start the callback when all resources are loaded
333
+ var onResourceLoaded = null;
334
+ var gResourceCount = 0;
335
+ onResourceLoaded = function() {
336
+ gResourceCount++;
337
+ if (gResourceCount >= langCount) {
338
+ callback();
339
+ fireL10nReadyEvent(lang);
340
+ gReadyState = 'complete';
341
+ }
342
+ };
343
+
344
+ // load all resource files
345
+ function L10nResourceLink(link) {
346
+ var href = link.href;
347
+ // Note: If |gAsyncResourceLoading| is false, then the following callbacks
348
+ // are synchronously called.
349
+ this.load = function(lang, callback) {
350
+ parseResource(href, lang, callback, function() {
351
+ console.warn(href + ' not found.');
352
+ // lang not found, used default resource instead
353
+ console.warn('"' + lang + '" resource not found');
354
+ gLanguage = '';
355
+ // Resource not loaded, but we still need to call the callback.
356
+ callback();
357
+ });
358
+ };
359
+ }
360
+
361
+ for (var i = 0; i < langCount; i++) {
362
+ var resource = new L10nResourceLink(langLinks[i]);
363
+ resource.load(lang, onResourceLoaded);
364
+ }
365
+ }
366
+
367
+ // clear all l10n data
368
+ function clear() {
369
+ gL10nData = {};
370
+ gTextData = '';
371
+ gLanguage = '';
372
+ // TODO: clear all non predefined macros.
373
+ // There's no such macro /yet/ but we're planning to have some...
374
+ }
375
+
376
+
377
+ /**
378
+ * Get rules for plural forms (shared with JetPack), see:
379
+ * http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html
380
+ * https://github.com/mozilla/addon-sdk/blob/master/python-lib/plural-rules-generator.p
381
+ *
382
+ * @param {string} lang
383
+ * locale (language) used.
384
+ *
385
+ * @return {Function}
386
+ * returns a function that gives the plural form name for a given integer:
387
+ * var fun = getPluralRules('en');
388
+ * fun(1) -> 'one'
389
+ * fun(0) -> 'other'
390
+ * fun(1000) -> 'other'.
391
+ */
392
+
393
+ function getPluralRules(lang) {
394
+ var locales2rules = {
395
+ 'af': 3,
396
+ 'ak': 4,
397
+ 'am': 4,
398
+ 'ar': 1,
399
+ 'asa': 3,
400
+ 'az': 0,
401
+ 'be': 11,
402
+ 'bem': 3,
403
+ 'bez': 3,
404
+ 'bg': 3,
405
+ 'bh': 4,
406
+ 'bm': 0,
407
+ 'bn': 3,
408
+ 'bo': 0,
409
+ 'br': 20,
410
+ 'brx': 3,
411
+ 'bs': 11,
412
+ 'ca': 3,
413
+ 'cgg': 3,
414
+ 'chr': 3,
415
+ 'cs': 12,
416
+ 'cy': 17,
417
+ 'da': 3,
418
+ 'de': 3,
419
+ 'dv': 3,
420
+ 'dz': 0,
421
+ 'ee': 3,
422
+ 'el': 3,
423
+ 'en': 3,
424
+ 'eo': 3,
425
+ 'es': 3,
426
+ 'et': 3,
427
+ 'eu': 3,
428
+ 'fa': 0,
429
+ 'ff': 5,
430
+ 'fi': 3,
431
+ 'fil': 4,
432
+ 'fo': 3,
433
+ 'fr': 5,
434
+ 'fur': 3,
435
+ 'fy': 3,
436
+ 'ga': 8,
437
+ 'gd': 24,
438
+ 'gl': 3,
439
+ 'gsw': 3,
440
+ 'gu': 3,
441
+ 'guw': 4,
442
+ 'gv': 23,
443
+ 'ha': 3,
444
+ 'haw': 3,
445
+ 'he': 2,
446
+ 'hi': 4,
447
+ 'hr': 11,
448
+ 'hu': 0,
449
+ 'id': 0,
450
+ 'ig': 0,
451
+ 'ii': 0,
452
+ 'is': 3,
453
+ 'it': 3,
454
+ 'iu': 7,
455
+ 'ja': 0,
456
+ 'jmc': 3,
457
+ 'jv': 0,
458
+ 'ka': 0,
459
+ 'kab': 5,
460
+ 'kaj': 3,
461
+ 'kcg': 3,
462
+ 'kde': 0,
463
+ 'kea': 0,
464
+ 'kk': 3,
465
+ 'kl': 3,
466
+ 'km': 0,
467
+ 'kn': 0,
468
+ 'ko': 0,
469
+ 'ksb': 3,
470
+ 'ksh': 21,
471
+ 'ku': 3,
472
+ 'kw': 7,
473
+ 'lag': 18,
474
+ 'lb': 3,
475
+ 'lg': 3,
476
+ 'ln': 4,
477
+ 'lo': 0,
478
+ 'lt': 10,
479
+ 'lv': 6,
480
+ 'mas': 3,
481
+ 'mg': 4,
482
+ 'mk': 16,
483
+ 'ml': 3,
484
+ 'mn': 3,
485
+ 'mo': 9,
486
+ 'mr': 3,
487
+ 'ms': 0,
488
+ 'mt': 15,
489
+ 'my': 0,
490
+ 'nah': 3,
491
+ 'naq': 7,
492
+ 'nb': 3,
493
+ 'nd': 3,
494
+ 'ne': 3,
495
+ 'nl': 3,
496
+ 'nn': 3,
497
+ 'no': 3,
498
+ 'nr': 3,
499
+ 'nso': 4,
500
+ 'ny': 3,
501
+ 'nyn': 3,
502
+ 'om': 3,
503
+ 'or': 3,
504
+ 'pa': 3,
505
+ 'pap': 3,
506
+ 'pl': 13,
507
+ 'ps': 3,
508
+ 'pt': 3,
509
+ 'rm': 3,
510
+ 'ro': 9,
511
+ 'rof': 3,
512
+ 'ru': 11,
513
+ 'rwk': 3,
514
+ 'sah': 0,
515
+ 'saq': 3,
516
+ 'se': 7,
517
+ 'seh': 3,
518
+ 'ses': 0,
519
+ 'sg': 0,
520
+ 'sh': 11,
521
+ 'shi': 19,
522
+ 'sk': 12,
523
+ 'sl': 14,
524
+ 'sma': 7,
525
+ 'smi': 7,
526
+ 'smj': 7,
527
+ 'smn': 7,
528
+ 'sms': 7,
529
+ 'sn': 3,
530
+ 'so': 3,
531
+ 'sq': 3,
532
+ 'sr': 11,
533
+ 'ss': 3,
534
+ 'ssy': 3,
535
+ 'st': 3,
536
+ 'sv': 3,
537
+ 'sw': 3,
538
+ 'syr': 3,
539
+ 'ta': 3,
540
+ 'te': 3,
541
+ 'teo': 3,
542
+ 'th': 0,
543
+ 'ti': 4,
544
+ 'tig': 3,
545
+ 'tk': 3,
546
+ 'tl': 4,
547
+ 'tn': 3,
548
+ 'to': 0,
549
+ 'tr': 0,
550
+ 'ts': 3,
551
+ 'tzm': 22,
552
+ 'uk': 11,
553
+ 'ur': 3,
554
+ 've': 3,
555
+ 'vi': 0,
556
+ 'vun': 3,
557
+ 'wa': 4,
558
+ 'wae': 3,
559
+ 'wo': 0,
560
+ 'xh': 3,
561
+ 'xog': 3,
562
+ 'yo': 0,
563
+ 'zh': 0,
564
+ 'zu': 3
565
+ };
566
+
567
+ // utility functions for plural rules methods
568
+ function isIn(n, list) {
569
+ return list.indexOf(n) !== -1;
570
+ }
571
+ function isBetween(n, start, end) {
572
+ return start <= n && n <= end;
573
+ }
574
+
575
+ // list of all plural rules methods:
576
+ // map an integer to the plural form name to use
577
+ var pluralRules = {
578
+ '0': function(n) {
579
+ return 'other';
580
+ },
581
+ '1': function(n) {
582
+ if ((isBetween((n % 100), 3, 10)))
583
+ return 'few';
584
+ if (n === 0)
585
+ return 'zero';
586
+ if ((isBetween((n % 100), 11, 99)))
587
+ return 'many';
588
+ if (n == 2)
589
+ return 'two';
590
+ if (n == 1)
591
+ return 'one';
592
+ return 'other';
593
+ },
594
+ '2': function(n) {
595
+ if (n !== 0 && (n % 10) === 0)
596
+ return 'many';
597
+ if (n == 2)
598
+ return 'two';
599
+ if (n == 1)
600
+ return 'one';
601
+ return 'other';
602
+ },
603
+ '3': function(n) {
604
+ if (n == 1)
605
+ return 'one';
606
+ return 'other';
607
+ },
608
+ '4': function(n) {
609
+ if ((isBetween(n, 0, 1)))
610
+ return 'one';
611
+ return 'other';
612
+ },
613
+ '5': function(n) {
614
+ if ((isBetween(n, 0, 2)) && n != 2)
615
+ return 'one';
616
+ return 'other';
617
+ },
618
+ '6': function(n) {
619
+ if (n === 0)
620
+ return 'zero';
621
+ if ((n % 10) == 1 && (n % 100) != 11)
622
+ return 'one';
623
+ return 'other';
624
+ },
625
+ '7': function(n) {
626
+ if (n == 2)
627
+ return 'two';
628
+ if (n == 1)
629
+ return 'one';
630
+ return 'other';
631
+ },
632
+ '8': function(n) {
633
+ if ((isBetween(n, 3, 6)))
634
+ return 'few';
635
+ if ((isBetween(n, 7, 10)))
636
+ return 'many';
637
+ if (n == 2)
638
+ return 'two';
639
+ if (n == 1)
640
+ return 'one';
641
+ return 'other';
642
+ },
643
+ '9': function(n) {
644
+ if (n === 0 || n != 1 && (isBetween((n % 100), 1, 19)))
645
+ return 'few';
646
+ if (n == 1)
647
+ return 'one';
648
+ return 'other';
649
+ },
650
+ '10': function(n) {
651
+ if ((isBetween((n % 10), 2, 9)) && !(isBetween((n % 100), 11, 19)))
652
+ return 'few';
653
+ if ((n % 10) == 1 && !(isBetween((n % 100), 11, 19)))
654
+ return 'one';
655
+ return 'other';
656
+ },
657
+ '11': function(n) {
658
+ if ((isBetween((n % 10), 2, 4)) && !(isBetween((n % 100), 12, 14)))
659
+ return 'few';
660
+ if ((n % 10) === 0 ||
661
+ (isBetween((n % 10), 5, 9)) ||
662
+ (isBetween((n % 100), 11, 14)))
663
+ return 'many';
664
+ if ((n % 10) == 1 && (n % 100) != 11)
665
+ return 'one';
666
+ return 'other';
667
+ },
668
+ '12': function(n) {
669
+ if ((isBetween(n, 2, 4)))
670
+ return 'few';
671
+ if (n == 1)
672
+ return 'one';
673
+ return 'other';
674
+ },
675
+ '13': function(n) {
676
+ if ((isBetween((n % 10), 2, 4)) && !(isBetween((n % 100), 12, 14)))
677
+ return 'few';
678
+ if (n != 1 && (isBetween((n % 10), 0, 1)) ||
679
+ (isBetween((n % 10), 5, 9)) ||
680
+ (isBetween((n % 100), 12, 14)))
681
+ return 'many';
682
+ if (n == 1)
683
+ return 'one';
684
+ return 'other';
685
+ },
686
+ '14': function(n) {
687
+ if ((isBetween((n % 100), 3, 4)))
688
+ return 'few';
689
+ if ((n % 100) == 2)
690
+ return 'two';
691
+ if ((n % 100) == 1)
692
+ return 'one';
693
+ return 'other';
694
+ },
695
+ '15': function(n) {
696
+ if (n === 0 || (isBetween((n % 100), 2, 10)))
697
+ return 'few';
698
+ if ((isBetween((n % 100), 11, 19)))
699
+ return 'many';
700
+ if (n == 1)
701
+ return 'one';
702
+ return 'other';
703
+ },
704
+ '16': function(n) {
705
+ if ((n % 10) == 1 && n != 11)
706
+ return 'one';
707
+ return 'other';
708
+ },
709
+ '17': function(n) {
710
+ if (n == 3)
711
+ return 'few';
712
+ if (n === 0)
713
+ return 'zero';
714
+ if (n == 6)
715
+ return 'many';
716
+ if (n == 2)
717
+ return 'two';
718
+ if (n == 1)
719
+ return 'one';
720
+ return 'other';
721
+ },
722
+ '18': function(n) {
723
+ if (n === 0)
724
+ return 'zero';
725
+ if ((isBetween(n, 0, 2)) && n !== 0 && n != 2)
726
+ return 'one';
727
+ return 'other';
728
+ },
729
+ '19': function(n) {
730
+ if ((isBetween(n, 2, 10)))
731
+ return 'few';
732
+ if ((isBetween(n, 0, 1)))
733
+ return 'one';
734
+ return 'other';
735
+ },
736
+ '20': function(n) {
737
+ if ((isBetween((n % 10), 3, 4) || ((n % 10) == 9)) && !(
738
+ isBetween((n % 100), 10, 19) ||
739
+ isBetween((n % 100), 70, 79) ||
740
+ isBetween((n % 100), 90, 99)
741
+ ))
742
+ return 'few';
743
+ if ((n % 1000000) === 0 && n !== 0)
744
+ return 'many';
745
+ if ((n % 10) == 2 && !isIn((n % 100), [12, 72, 92]))
746
+ return 'two';
747
+ if ((n % 10) == 1 && !isIn((n % 100), [11, 71, 91]))
748
+ return 'one';
749
+ return 'other';
750
+ },
751
+ '21': function(n) {
752
+ if (n === 0)
753
+ return 'zero';
754
+ if (n == 1)
755
+ return 'one';
756
+ return 'other';
757
+ },
758
+ '22': function(n) {
759
+ if ((isBetween(n, 0, 1)) || (isBetween(n, 11, 99)))
760
+ return 'one';
761
+ return 'other';
762
+ },
763
+ '23': function(n) {
764
+ if ((isBetween((n % 10), 1, 2)) || (n % 20) === 0)
765
+ return 'one';
766
+ return 'other';
767
+ },
768
+ '24': function(n) {
769
+ if ((isBetween(n, 3, 10) || isBetween(n, 13, 19)))
770
+ return 'few';
771
+ if (isIn(n, [2, 12]))
772
+ return 'two';
773
+ if (isIn(n, [1, 11]))
774
+ return 'one';
775
+ return 'other';
776
+ }
777
+ };
778
+
779
+ // return a function that gives the plural form name for a given integer
780
+ var index = locales2rules[lang.replace(/-.*$/, '')];
781
+ if (!(index in pluralRules)) {
782
+ console.warn('plural form unknown for [' + lang + ']');
783
+ return function() { return 'other'; };
784
+ }
785
+ return pluralRules[index];
786
+ }
787
+
788
+ // pre-defined 'plural' macro
789
+ gMacros.plural = function(str, param, key, prop) {
790
+ var n = parseFloat(param);
791
+ if (isNaN(n))
792
+ return str;
793
+
794
+ // TODO: support other properties (l20n still doesn't...)
795
+ if (prop != gTextProp)
796
+ return str;
797
+
798
+ // initialize _pluralRules
799
+ if (!gMacros._pluralRules) {
800
+ gMacros._pluralRules = getPluralRules(gLanguage);
801
+ }
802
+ var index = '[' + gMacros._pluralRules(n) + ']';
803
+
804
+ // try to find a [zero|one|two] key if it's defined
805
+ if (n === 0 && (key + '[zero]') in gL10nData) {
806
+ str = gL10nData[key + '[zero]'][prop];
807
+ } else if (n == 1 && (key + '[one]') in gL10nData) {
808
+ str = gL10nData[key + '[one]'][prop];
809
+ } else if (n == 2 && (key + '[two]') in gL10nData) {
810
+ str = gL10nData[key + '[two]'][prop];
811
+ } else if ((key + index) in gL10nData) {
812
+ str = gL10nData[key + index][prop];
813
+ } else if ((key + '[other]') in gL10nData) {
814
+ str = gL10nData[key + '[other]'][prop];
815
+ }
816
+
817
+ return str;
818
+ };
819
+
820
+
821
+ /**
822
+ * l10n dictionary functions
823
+ */
824
+
825
+ // fetch an l10n object, warn if not found, apply `args' if possible
826
+ function getL10nData(key, args, fallback) {
827
+ var data = gL10nData[key];
828
+ if (!data) {
829
+ console.warn('#' + key + ' is undefined.');
830
+ if (!fallback) {
831
+ return null;
832
+ }
833
+ data = fallback;
834
+ }
835
+
836
+ /** This is where l10n expressions should be processed.
837
+ * The plan is to support C-style expressions from the l20n project;
838
+ * until then, only two kinds of simple expressions are supported:
839
+ * {[ index ]} and {{ arguments }}.
840
+ */
841
+ var rv = {};
842
+ for (var prop in data) {
843
+ var str = data[prop];
844
+ str = substIndexes(str, args, key, prop);
845
+ str = substArguments(str, args, key);
846
+ rv[prop] = str;
847
+ }
848
+ return rv;
849
+ }
850
+
851
+ // replace {[macros]} with their values
852
+ function substIndexes(str, args, key, prop) {
853
+ var reIndex = /\{\[\s*([a-zA-Z]+)\(([a-zA-Z]+)\)\s*\]\}/;
854
+ var reMatch = reIndex.exec(str);
855
+ if (!reMatch || !reMatch.length)
856
+ return str;
857
+
858
+ // an index/macro has been found
859
+ // Note: at the moment, only one parameter is supported
860
+ var macroName = reMatch[1];
861
+ var paramName = reMatch[2];
862
+ var param;
863
+ if (args && paramName in args) {
864
+ param = args[paramName];
865
+ } else if (paramName in gL10nData) {
866
+ param = gL10nData[paramName];
867
+ }
868
+
869
+ // there's no macro parser yet: it has to be defined in gMacros
870
+ if (macroName in gMacros) {
871
+ var macro = gMacros[macroName];
872
+ str = macro(str, param, key, prop);
873
+ }
874
+ return str;
875
+ }
876
+
877
+ // replace {{arguments}} with their values
878
+ function substArguments(str, args, key) {
879
+ var reArgs = /\{\{\s*(.+?)\s*\}\}/g;
880
+ return str.replace(reArgs, function(matched_text, arg) {
881
+ if (args && arg in args) {
882
+ return args[arg];
883
+ }
884
+ if (arg in gL10nData) {
885
+ return gL10nData[arg];
886
+ }
887
+ console.log('argument {{' + arg + '}} for #' + key + ' is undefined.');
888
+ return matched_text;
889
+ });
890
+ }
891
+
892
+ // translate an HTML element
893
+ function translateElement(element) {
894
+ var l10n = getL10nAttributes(element);
895
+ if (!l10n.id)
896
+ return;
897
+
898
+ // get the related l10n object
899
+ var data = getL10nData(l10n.id, l10n.args);
900
+ if (!data) {
901
+ console.warn('#' + l10n.id + ' is undefined.');
902
+ return;
903
+ }
904
+
905
+ // translate element (TODO: security checks?)
906
+ if (data[gTextProp]) { // XXX
907
+ if (getChildElementCount(element) === 0) {
908
+ element[gTextProp] = data[gTextProp];
909
+ } else {
910
+ // this element has element children: replace the content of the first
911
+ // (non-empty) child textNode and clear other child textNodes
912
+ var children = element.childNodes;
913
+ var found = false;
914
+ for (var i = 0, l = children.length; i < l; i++) {
915
+ if (children[i].nodeType === 3 && /\S/.test(children[i].nodeValue)) {
916
+ if (found) {
917
+ children[i].nodeValue = '';
918
+ } else {
919
+ children[i].nodeValue = data[gTextProp];
920
+ found = true;
921
+ }
922
+ }
923
+ }
924
+ // if no (non-empty) textNode is found, insert a textNode before the
925
+ // first element child.
926
+ if (!found) {
927
+ var textNode = document.createTextNode(data[gTextProp]);
928
+ element.insertBefore(textNode, element.firstChild);
929
+ }
930
+ }
931
+ delete data[gTextProp];
932
+ }
933
+
934
+ for (var k in data) {
935
+ element[k] = data[k];
936
+ }
937
+ }
938
+
939
+ // webkit browsers don't currently support 'children' on SVG elements...
940
+ function getChildElementCount(element) {
941
+ if (element.children) {
942
+ return element.children.length;
943
+ }
944
+ if (typeof element.childElementCount !== 'undefined') {
945
+ return element.childElementCount;
946
+ }
947
+ var count = 0;
948
+ for (var i = 0; i < element.childNodes.length; i++) {
949
+ count += element.nodeType === 1 ? 1 : 0;
950
+ }
951
+ return count;
952
+ }
953
+
954
+ // translate an HTML subtree
955
+ function translateFragment(element) {
956
+ element = element || document.documentElement;
957
+
958
+ // check all translatable children (= w/ a `data-l10n-id' attribute)
959
+ var children = getTranslatableChildren(element);
960
+ var elementCount = children.length;
961
+ for (var i = 0; i < elementCount; i++) {
962
+ translateElement(children[i]);
963
+ }
964
+
965
+ // translate element itself if necessary
966
+ translateElement(element);
967
+ }
968
+
969
+ return {
970
+ // get a localized string
971
+ get: function(key, args, fallbackString) {
972
+ var index = key.lastIndexOf('.');
973
+ var prop = gTextProp;
974
+ if (index > 0) { // An attribute has been specified
975
+ prop = key.substr(index + 1);
976
+ key = key.substring(0, index);
977
+ }
978
+ var fallback;
979
+ if (fallbackString) {
980
+ fallback = {};
981
+ fallback[prop] = fallbackString;
982
+ }
983
+ var data = getL10nData(key, args, fallback);
984
+ if (data && prop in data) {
985
+ return data[prop];
986
+ }
987
+ return '{{' + key + '}}';
988
+ },
989
+
990
+ // debug
991
+ getData: function() { return gL10nData; },
992
+ getText: function() { return gTextData; },
993
+
994
+ // get|set the document language
995
+ getLanguage: function() { return gLanguage; },
996
+ setLanguage: function(lang, callback) {
997
+ loadLocale(lang, function() {
998
+ if (callback)
999
+ callback();
1000
+ translateFragment();
1001
+ });
1002
+ },
1003
+
1004
+ // get the direction (ltr|rtl) of the current language
1005
+ getDirection: function() {
1006
+ // http://www.w3.org/International/questions/qa-scripts
1007
+ // Arabic, Hebrew, Farsi, Pashto, Urdu
1008
+ var rtlList = ['ar', 'he', 'fa', 'ps', 'ur'];
1009
+ var shortCode = gLanguage.split('-', 1)[0];
1010
+ return (rtlList.indexOf(shortCode) >= 0) ? 'rtl' : 'ltr';
1011
+ },
1012
+
1013
+ // translate an element or document fragment
1014
+ translate: translateFragment,
1015
+
1016
+ // this can be used to prevent race conditions
1017
+ getReadyState: function() { return gReadyState; },
1018
+ ready: function(callback) {
1019
+ if (!callback) {
1020
+ return;
1021
+ } else if (gReadyState == 'complete' || gReadyState == 'interactive') {
1022
+ window.setTimeout(function() {
1023
+ callback();
1024
+ });
1025
+ } else if (document.addEventListener) {
1026
+ document.addEventListener('localized', function once() {
1027
+ document.removeEventListener('localized', once);
1028
+ callback();
1029
+ });
1030
+ }
1031
+ }
1032
+ };
1033
+ }) (window, document);