card-mod-pdfjs 0.1

Sign up to get free protection for your applications and to get access to all the features.
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
data/public/l10n.js ADDED
@@ -0,0 +1,1047 @@
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
+ };
105
+ onFailure = onFailure || function _onFailure() {
106
+ console.warn(url + ' not found.');
107
+ };
108
+
109
+ var xhr = new XMLHttpRequest();
110
+ xhr.open('GET', url, gAsyncResourceLoading);
111
+ if (xhr.overrideMimeType) {
112
+ xhr.overrideMimeType('text/plain; charset=utf-8');
113
+ }
114
+ xhr.onreadystatechange = function () {
115
+ if (xhr.readyState == 4) {
116
+ if (xhr.status == 200 || xhr.status === 0) {
117
+ onSuccess(xhr.responseText);
118
+ } else {
119
+ onFailure();
120
+ }
121
+ }
122
+ };
123
+ xhr.onerror = onFailure;
124
+ xhr.ontimeout = onFailure;
125
+
126
+ // in Firefox OS with the app:// protocol, trying to XHR a non-existing
127
+ // URL will raise an exception here -- hence this ugly try...catch.
128
+ try {
129
+ xhr.send(null);
130
+ } catch (e) {
131
+ onFailure();
132
+ }
133
+ }
134
+
135
+
136
+ /**
137
+ * l10n resource parser:
138
+ * - reads (async XHR) the l10n resource matching `lang';
139
+ * - imports linked resources (synchronously) when specified;
140
+ * - parses the text data (fills `gL10nData' and `gTextData');
141
+ * - triggers success/failure callbacks when done.
142
+ *
143
+ * @param {string} href
144
+ * URL of the l10n resource to parse.
145
+ *
146
+ * @param {string} lang
147
+ * locale (language) to parse. Must be a lowercase string.
148
+ *
149
+ * @param {Function} successCallback
150
+ * triggered when the l10n resource has been successully parsed.
151
+ *
152
+ * @param {Function} failureCallback
153
+ * triggered when the an error has occured.
154
+ *
155
+ * @return {void}
156
+ * uses the following global variables: gL10nData, gTextData, gTextProp.
157
+ */
158
+
159
+ function parseResource(href, lang, successCallback, failureCallback) {
160
+ var baseURL = href.replace(/[^\/]*$/, '') || './';
161
+
162
+ // handle escaped characters (backslashes) in a string
163
+ function evalString(text) {
164
+ if (text.lastIndexOf('\\') < 0)
165
+ return text;
166
+ return text.replace(/\\\\/g, '\\')
167
+ .replace(/\\n/g, '\n')
168
+ .replace(/\\r/g, '\r')
169
+ .replace(/\\t/g, '\t')
170
+ .replace(/\\b/g, '\b')
171
+ .replace(/\\f/g, '\f')
172
+ .replace(/\\{/g, '{')
173
+ .replace(/\\}/g, '}')
174
+ .replace(/\\"/g, '"')
175
+ .replace(/\\'/g, "'");
176
+ }
177
+
178
+ // parse *.properties text data into an l10n dictionary
179
+ // If gAsyncResourceLoading is false, then the callback will be called
180
+ // synchronously. Otherwise it is called asynchronously.
181
+ function parseProperties(text, parsedPropertiesCallback) {
182
+ var dictionary = {};
183
+
184
+ // token expressions
185
+ var reBlank = /^\s*|\s*$/;
186
+ var reComment = /^\s*#|^\s*$/;
187
+ var reSection = /^\s*\[(.*)\]\s*$/;
188
+ var reImport = /^\s*@import\s+url\((.*)\)\s*$/i;
189
+ var reSplit = /^([^=\s]*)\s*=\s*(.+)$/; // TODO: escape EOLs with '\'
190
+
191
+ // parse the *.properties file into an associative array
192
+ function parseRawLines(rawText, extendedSyntax, parsedRawLinesCallback) {
193
+ var entries = rawText.replace(reBlank, '').split(/[\r\n]+/);
194
+ var currentLang = '*';
195
+ var genericLang = lang.split('-', 1)[0];
196
+ var skipLang = false;
197
+ var match = '';
198
+
199
+ function nextEntry() {
200
+ // Use infinite loop instead of recursion to avoid reaching the
201
+ // maximum recursion limit for content with many lines.
202
+ while (true) {
203
+ if (!entries.length) {
204
+ parsedRawLinesCallback();
205
+ return;
206
+ }
207
+ var line = entries.shift();
208
+
209
+ // comment or blank line?
210
+ if (reComment.test(line))
211
+ continue;
212
+
213
+ // the extended syntax supports [lang] sections and @import rules
214
+ if (extendedSyntax) {
215
+ match = reSection.exec(line);
216
+ if (match) { // section start?
217
+ // RFC 4646, section 4.4, "All comparisons MUST be performed
218
+ // in a case-insensitive manner."
219
+
220
+ currentLang = match[1].toLowerCase();
221
+ skipLang = (currentLang !== '*') &&
222
+ (currentLang !== lang) && (currentLang !== genericLang);
223
+ continue;
224
+ } else if (skipLang) {
225
+ continue;
226
+ }
227
+ match = reImport.exec(line);
228
+ if (match) { // @import rule?
229
+ loadImport(baseURL + match[1], nextEntry);
230
+ return;
231
+ }
232
+ }
233
+
234
+ // key-value pair
235
+ var tmp = line.match(reSplit);
236
+ if (tmp && tmp.length == 3) {
237
+ dictionary[tmp[1]] = evalString(tmp[2]);
238
+ }
239
+ }
240
+ }
241
+
242
+ nextEntry();
243
+ }
244
+
245
+ // import another *.properties file
246
+ function loadImport(url, callback) {
247
+ xhrLoadText(url, function (content) {
248
+ parseRawLines(content, false, callback); // don't allow recursive imports
249
+ }, null);
250
+ }
251
+
252
+ // fill the dictionary
253
+ parseRawLines(text, true, function () {
254
+ parsedPropertiesCallback(dictionary);
255
+ });
256
+ }
257
+
258
+ // load and parse l10n data (warning: global variables are used here)
259
+ xhrLoadText(href, function (response) {
260
+ gTextData += response; // mostly for debug
261
+
262
+ // parse *.properties text data into an l10n dictionary
263
+ parseProperties(response, function (data) {
264
+
265
+ // find attribute descriptions, if any
266
+ for (var key in data) {
267
+ var id, prop, index = key.lastIndexOf('.');
268
+ if (index > 0) { // an attribute has been specified
269
+ id = key.substring(0, index);
270
+ prop = key.substr(index + 1);
271
+ } else { // no attribute: assuming text content by default
272
+ id = key;
273
+ prop = gTextProp;
274
+ }
275
+ if (!gL10nData[id]) {
276
+ gL10nData[id] = {};
277
+ }
278
+ gL10nData[id][prop] = data[key];
279
+ }
280
+
281
+ // trigger callback
282
+ if (successCallback) {
283
+ successCallback();
284
+ }
285
+ });
286
+ }, failureCallback);
287
+ }
288
+
289
+ // load and parse all resources for the specified locale
290
+ function loadLocale(lang, callback) {
291
+ // RFC 4646, section 2.1 states that language tags have to be treated as
292
+ // case-insensitive. Convert to lowercase for case-insensitive comparisons.
293
+ if (lang) {
294
+ lang = lang.toLowerCase();
295
+ }
296
+
297
+ callback = callback || function _callback() {
298
+ };
299
+
300
+ clear();
301
+ gLanguage = lang;
302
+
303
+ // check all <link type="application/l10n" href="..." /> nodes
304
+ // and load the resource files
305
+ var langLinks = getL10nResourceLinks();
306
+ var langCount = langLinks.length;
307
+ if (langCount === 0) {
308
+ // we might have a pre-compiled dictionary instead
309
+ var dict = getL10nDictionary();
310
+ if (dict && dict.locales && dict.default_locale) {
311
+ console.log('using the embedded JSON directory, early way out');
312
+ gL10nData = dict.locales[lang];
313
+ if (!gL10nData) {
314
+ var defaultLocale = dict.default_locale.toLowerCase();
315
+ for (var anyCaseLang in dict.locales) {
316
+ anyCaseLang = anyCaseLang.toLowerCase();
317
+ if (anyCaseLang === lang) {
318
+ gL10nData = dict.locales[lang];
319
+ break;
320
+ } else if (anyCaseLang === defaultLocale) {
321
+ gL10nData = dict.locales[defaultLocale];
322
+ }
323
+ }
324
+ }
325
+ callback();
326
+ } else {
327
+ console.log('no resource to load, early way out');
328
+ }
329
+ // early way out
330
+ fireL10nReadyEvent(lang);
331
+ gReadyState = 'complete';
332
+ return;
333
+ }
334
+
335
+ // start the callback when all resources are loaded
336
+ var onResourceLoaded = null;
337
+ var gResourceCount = 0;
338
+ onResourceLoaded = function () {
339
+ gResourceCount++;
340
+ if (gResourceCount >= langCount) {
341
+ callback();
342
+ fireL10nReadyEvent(lang);
343
+ gReadyState = 'complete';
344
+ }
345
+ };
346
+
347
+ // load all resource files
348
+ function L10nResourceLink(link) {
349
+ var href = link.href;
350
+ // Note: If |gAsyncResourceLoading| is false, then the following callbacks
351
+ // are synchronously called.
352
+ this.load = function (lang, callback) {
353
+ parseResource(href, lang, callback, function () {
354
+ console.warn(href + ' not found.');
355
+ // lang not found, used default resource instead
356
+ console.warn('"' + lang + '" resource not found');
357
+ gLanguage = '';
358
+ // Resource not loaded, but we still need to call the callback.
359
+ callback();
360
+ });
361
+ };
362
+ }
363
+
364
+ for (var i = 0; i < langCount; i++) {
365
+ var resource = new L10nResourceLink(langLinks[i]);
366
+ resource.load(lang, onResourceLoaded);
367
+ }
368
+ }
369
+
370
+ // clear all l10n data
371
+ function clear() {
372
+ gL10nData = {};
373
+ gTextData = '';
374
+ gLanguage = '';
375
+ // TODO: clear all non predefined macros.
376
+ // There's no such macro /yet/ but we're planning to have some...
377
+ }
378
+
379
+
380
+ /**
381
+ * Get rules for plural forms (shared with JetPack), see:
382
+ * http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html
383
+ * https://github.com/mozilla/addon-sdk/blob/master/python-lib/plural-rules-generator.p
384
+ *
385
+ * @param {string} lang
386
+ * locale (language) used.
387
+ *
388
+ * @return {Function}
389
+ * returns a function that gives the plural form name for a given integer:
390
+ * var fun = getPluralRules('en');
391
+ * fun(1) -> 'one'
392
+ * fun(0) -> 'other'
393
+ * fun(1000) -> 'other'.
394
+ */
395
+
396
+ function getPluralRules(lang) {
397
+ var locales2rules = {
398
+ 'af': 3,
399
+ 'ak': 4,
400
+ 'am': 4,
401
+ 'ar': 1,
402
+ 'asa': 3,
403
+ 'az': 0,
404
+ 'be': 11,
405
+ 'bem': 3,
406
+ 'bez': 3,
407
+ 'bg': 3,
408
+ 'bh': 4,
409
+ 'bm': 0,
410
+ 'bn': 3,
411
+ 'bo': 0,
412
+ 'br': 20,
413
+ 'brx': 3,
414
+ 'bs': 11,
415
+ 'ca': 3,
416
+ 'cgg': 3,
417
+ 'chr': 3,
418
+ 'cs': 12,
419
+ 'cy': 17,
420
+ 'da': 3,
421
+ 'de': 3,
422
+ 'dv': 3,
423
+ 'dz': 0,
424
+ 'ee': 3,
425
+ 'el': 3,
426
+ 'en': 3,
427
+ 'eo': 3,
428
+ 'es': 3,
429
+ 'et': 3,
430
+ 'eu': 3,
431
+ 'fa': 0,
432
+ 'ff': 5,
433
+ 'fi': 3,
434
+ 'fil': 4,
435
+ 'fo': 3,
436
+ 'fr': 5,
437
+ 'fur': 3,
438
+ 'fy': 3,
439
+ 'ga': 8,
440
+ 'gd': 24,
441
+ 'gl': 3,
442
+ 'gsw': 3,
443
+ 'gu': 3,
444
+ 'guw': 4,
445
+ 'gv': 23,
446
+ 'ha': 3,
447
+ 'haw': 3,
448
+ 'he': 2,
449
+ 'hi': 4,
450
+ 'hr': 11,
451
+ 'hu': 0,
452
+ 'id': 0,
453
+ 'ig': 0,
454
+ 'ii': 0,
455
+ 'is': 3,
456
+ 'it': 3,
457
+ 'iu': 7,
458
+ 'ja': 0,
459
+ 'jmc': 3,
460
+ 'jv': 0,
461
+ 'ka': 0,
462
+ 'kab': 5,
463
+ 'kaj': 3,
464
+ 'kcg': 3,
465
+ 'kde': 0,
466
+ 'kea': 0,
467
+ 'kk': 3,
468
+ 'kl': 3,
469
+ 'km': 0,
470
+ 'kn': 0,
471
+ 'ko': 0,
472
+ 'ksb': 3,
473
+ 'ksh': 21,
474
+ 'ku': 3,
475
+ 'kw': 7,
476
+ 'lag': 18,
477
+ 'lb': 3,
478
+ 'lg': 3,
479
+ 'ln': 4,
480
+ 'lo': 0,
481
+ 'lt': 10,
482
+ 'lv': 6,
483
+ 'mas': 3,
484
+ 'mg': 4,
485
+ 'mk': 16,
486
+ 'ml': 3,
487
+ 'mn': 3,
488
+ 'mo': 9,
489
+ 'mr': 3,
490
+ 'ms': 0,
491
+ 'mt': 15,
492
+ 'my': 0,
493
+ 'nah': 3,
494
+ 'naq': 7,
495
+ 'nb': 3,
496
+ 'nd': 3,
497
+ 'ne': 3,
498
+ 'nl': 3,
499
+ 'nn': 3,
500
+ 'no': 3,
501
+ 'nr': 3,
502
+ 'nso': 4,
503
+ 'ny': 3,
504
+ 'nyn': 3,
505
+ 'om': 3,
506
+ 'or': 3,
507
+ 'pa': 3,
508
+ 'pap': 3,
509
+ 'pl': 13,
510
+ 'ps': 3,
511
+ 'pt': 3,
512
+ 'rm': 3,
513
+ 'ro': 9,
514
+ 'rof': 3,
515
+ 'ru': 11,
516
+ 'rwk': 3,
517
+ 'sah': 0,
518
+ 'saq': 3,
519
+ 'se': 7,
520
+ 'seh': 3,
521
+ 'ses': 0,
522
+ 'sg': 0,
523
+ 'sh': 11,
524
+ 'shi': 19,
525
+ 'sk': 12,
526
+ 'sl': 14,
527
+ 'sma': 7,
528
+ 'smi': 7,
529
+ 'smj': 7,
530
+ 'smn': 7,
531
+ 'sms': 7,
532
+ 'sn': 3,
533
+ 'so': 3,
534
+ 'sq': 3,
535
+ 'sr': 11,
536
+ 'ss': 3,
537
+ 'ssy': 3,
538
+ 'st': 3,
539
+ 'sv': 3,
540
+ 'sw': 3,
541
+ 'syr': 3,
542
+ 'ta': 3,
543
+ 'te': 3,
544
+ 'teo': 3,
545
+ 'th': 0,
546
+ 'ti': 4,
547
+ 'tig': 3,
548
+ 'tk': 3,
549
+ 'tl': 4,
550
+ 'tn': 3,
551
+ 'to': 0,
552
+ 'tr': 0,
553
+ 'ts': 3,
554
+ 'tzm': 22,
555
+ 'uk': 11,
556
+ 'ur': 3,
557
+ 've': 3,
558
+ 'vi': 0,
559
+ 'vun': 3,
560
+ 'wa': 4,
561
+ 'wae': 3,
562
+ 'wo': 0,
563
+ 'xh': 3,
564
+ 'xog': 3,
565
+ 'yo': 0,
566
+ 'zh': 0,
567
+ 'zu': 3
568
+ };
569
+
570
+ // utility functions for plural rules methods
571
+ function isIn(n, list) {
572
+ return list.indexOf(n) !== -1;
573
+ }
574
+
575
+ function isBetween(n, start, end) {
576
+ return start <= n && n <= end;
577
+ }
578
+
579
+ // list of all plural rules methods:
580
+ // map an integer to the plural form name to use
581
+ var pluralRules = {
582
+ '0': function (n) {
583
+ return 'other';
584
+ },
585
+ '1': function (n) {
586
+ if ((isBetween((n % 100), 3, 10)))
587
+ return 'few';
588
+ if (n === 0)
589
+ return 'zero';
590
+ if ((isBetween((n % 100), 11, 99)))
591
+ return 'many';
592
+ if (n == 2)
593
+ return 'two';
594
+ if (n == 1)
595
+ return 'one';
596
+ return 'other';
597
+ },
598
+ '2': function (n) {
599
+ if (n !== 0 && (n % 10) === 0)
600
+ return 'many';
601
+ if (n == 2)
602
+ return 'two';
603
+ if (n == 1)
604
+ return 'one';
605
+ return 'other';
606
+ },
607
+ '3': function (n) {
608
+ if (n == 1)
609
+ return 'one';
610
+ return 'other';
611
+ },
612
+ '4': function (n) {
613
+ if ((isBetween(n, 0, 1)))
614
+ return 'one';
615
+ return 'other';
616
+ },
617
+ '5': function (n) {
618
+ if ((isBetween(n, 0, 2)) && n != 2)
619
+ return 'one';
620
+ return 'other';
621
+ },
622
+ '6': function (n) {
623
+ if (n === 0)
624
+ return 'zero';
625
+ if ((n % 10) == 1 && (n % 100) != 11)
626
+ return 'one';
627
+ return 'other';
628
+ },
629
+ '7': function (n) {
630
+ if (n == 2)
631
+ return 'two';
632
+ if (n == 1)
633
+ return 'one';
634
+ return 'other';
635
+ },
636
+ '8': function (n) {
637
+ if ((isBetween(n, 3, 6)))
638
+ return 'few';
639
+ if ((isBetween(n, 7, 10)))
640
+ return 'many';
641
+ if (n == 2)
642
+ return 'two';
643
+ if (n == 1)
644
+ return 'one';
645
+ return 'other';
646
+ },
647
+ '9': function (n) {
648
+ if (n === 0 || n != 1 && (isBetween((n % 100), 1, 19)))
649
+ return 'few';
650
+ if (n == 1)
651
+ return 'one';
652
+ return 'other';
653
+ },
654
+ '10': function (n) {
655
+ if ((isBetween((n % 10), 2, 9)) && !(isBetween((n % 100), 11, 19)))
656
+ return 'few';
657
+ if ((n % 10) == 1 && !(isBetween((n % 100), 11, 19)))
658
+ return 'one';
659
+ return 'other';
660
+ },
661
+ '11': function (n) {
662
+ if ((isBetween((n % 10), 2, 4)) && !(isBetween((n % 100), 12, 14)))
663
+ return 'few';
664
+ if ((n % 10) === 0 ||
665
+ (isBetween((n % 10), 5, 9)) ||
666
+ (isBetween((n % 100), 11, 14)))
667
+ return 'many';
668
+ if ((n % 10) == 1 && (n % 100) != 11)
669
+ return 'one';
670
+ return 'other';
671
+ },
672
+ '12': function (n) {
673
+ if ((isBetween(n, 2, 4)))
674
+ return 'few';
675
+ if (n == 1)
676
+ return 'one';
677
+ return 'other';
678
+ },
679
+ '13': function (n) {
680
+ if ((isBetween((n % 10), 2, 4)) && !(isBetween((n % 100), 12, 14)))
681
+ return 'few';
682
+ if (n != 1 && (isBetween((n % 10), 0, 1)) ||
683
+ (isBetween((n % 10), 5, 9)) ||
684
+ (isBetween((n % 100), 12, 14)))
685
+ return 'many';
686
+ if (n == 1)
687
+ return 'one';
688
+ return 'other';
689
+ },
690
+ '14': function (n) {
691
+ if ((isBetween((n % 100), 3, 4)))
692
+ return 'few';
693
+ if ((n % 100) == 2)
694
+ return 'two';
695
+ if ((n % 100) == 1)
696
+ return 'one';
697
+ return 'other';
698
+ },
699
+ '15': function (n) {
700
+ if (n === 0 || (isBetween((n % 100), 2, 10)))
701
+ return 'few';
702
+ if ((isBetween((n % 100), 11, 19)))
703
+ return 'many';
704
+ if (n == 1)
705
+ return 'one';
706
+ return 'other';
707
+ },
708
+ '16': function (n) {
709
+ if ((n % 10) == 1 && n != 11)
710
+ return 'one';
711
+ return 'other';
712
+ },
713
+ '17': function (n) {
714
+ if (n == 3)
715
+ return 'few';
716
+ if (n === 0)
717
+ return 'zero';
718
+ if (n == 6)
719
+ return 'many';
720
+ if (n == 2)
721
+ return 'two';
722
+ if (n == 1)
723
+ return 'one';
724
+ return 'other';
725
+ },
726
+ '18': function (n) {
727
+ if (n === 0)
728
+ return 'zero';
729
+ if ((isBetween(n, 0, 2)) && n !== 0 && n != 2)
730
+ return 'one';
731
+ return 'other';
732
+ },
733
+ '19': function (n) {
734
+ if ((isBetween(n, 2, 10)))
735
+ return 'few';
736
+ if ((isBetween(n, 0, 1)))
737
+ return 'one';
738
+ return 'other';
739
+ },
740
+ '20': function (n) {
741
+ if ((isBetween((n % 10), 3, 4) || ((n % 10) == 9)) && !(
742
+ isBetween((n % 100), 10, 19) ||
743
+ isBetween((n % 100), 70, 79) ||
744
+ isBetween((n % 100), 90, 99)
745
+ ))
746
+ return 'few';
747
+ if ((n % 1000000) === 0 && n !== 0)
748
+ return 'many';
749
+ if ((n % 10) == 2 && !isIn((n % 100), [12, 72, 92]))
750
+ return 'two';
751
+ if ((n % 10) == 1 && !isIn((n % 100), [11, 71, 91]))
752
+ return 'one';
753
+ return 'other';
754
+ },
755
+ '21': function (n) {
756
+ if (n === 0)
757
+ return 'zero';
758
+ if (n == 1)
759
+ return 'one';
760
+ return 'other';
761
+ },
762
+ '22': function (n) {
763
+ if ((isBetween(n, 0, 1)) || (isBetween(n, 11, 99)))
764
+ return 'one';
765
+ return 'other';
766
+ },
767
+ '23': function (n) {
768
+ if ((isBetween((n % 10), 1, 2)) || (n % 20) === 0)
769
+ return 'one';
770
+ return 'other';
771
+ },
772
+ '24': function (n) {
773
+ if ((isBetween(n, 3, 10) || isBetween(n, 13, 19)))
774
+ return 'few';
775
+ if (isIn(n, [2, 12]))
776
+ return 'two';
777
+ if (isIn(n, [1, 11]))
778
+ return 'one';
779
+ return 'other';
780
+ }
781
+ };
782
+
783
+ // return a function that gives the plural form name for a given integer
784
+ var index = locales2rules[lang.replace(/-.*$/, '')];
785
+ if (!(index in pluralRules)) {
786
+ console.warn('plural form unknown for [' + lang + ']');
787
+ return function () {
788
+ return 'other';
789
+ };
790
+ }
791
+ return pluralRules[index];
792
+ }
793
+
794
+ // pre-defined 'plural' macro
795
+ gMacros.plural = function (str, param, key, prop) {
796
+ var n = parseFloat(param);
797
+ if (isNaN(n))
798
+ return str;
799
+
800
+ // TODO: support other properties (l20n still doesn't...)
801
+ if (prop != gTextProp)
802
+ return str;
803
+
804
+ // initialize _pluralRules
805
+ if (!gMacros._pluralRules) {
806
+ gMacros._pluralRules = getPluralRules(gLanguage);
807
+ }
808
+ var index = '[' + gMacros._pluralRules(n) + ']';
809
+
810
+ // try to find a [zero|one|two] key if it's defined
811
+ if (n === 0 && (key + '[zero]') in gL10nData) {
812
+ str = gL10nData[key + '[zero]'][prop];
813
+ } else if (n == 1 && (key + '[one]') in gL10nData) {
814
+ str = gL10nData[key + '[one]'][prop];
815
+ } else if (n == 2 && (key + '[two]') in gL10nData) {
816
+ str = gL10nData[key + '[two]'][prop];
817
+ } else if ((key + index) in gL10nData) {
818
+ str = gL10nData[key + index][prop];
819
+ } else if ((key + '[other]') in gL10nData) {
820
+ str = gL10nData[key + '[other]'][prop];
821
+ }
822
+
823
+ return str;
824
+ };
825
+
826
+
827
+ /**
828
+ * l10n dictionary functions
829
+ */
830
+
831
+ // fetch an l10n object, warn if not found, apply `args' if possible
832
+ function getL10nData(key, args, fallback) {
833
+ var data = gL10nData[key];
834
+ if (!data) {
835
+ console.warn('#' + key + ' is undefined.');
836
+ if (!fallback) {
837
+ return null;
838
+ }
839
+ data = fallback;
840
+ }
841
+
842
+ /** This is where l10n expressions should be processed.
843
+ * The plan is to support C-style expressions from the l20n project;
844
+ * until then, only two kinds of simple expressions are supported:
845
+ * {[ index ]} and {{ arguments }}.
846
+ */
847
+ var rv = {};
848
+ for (var prop in data) {
849
+ var str = data[prop];
850
+ str = substIndexes(str, args, key, prop);
851
+ str = substArguments(str, args, key);
852
+ rv[prop] = str;
853
+ }
854
+ return rv;
855
+ }
856
+
857
+ // replace {[macros]} with their values
858
+ function substIndexes(str, args, key, prop) {
859
+ var reIndex = /\{\[\s*([a-zA-Z]+)\(([a-zA-Z]+)\)\s*\]\}/;
860
+ var reMatch = reIndex.exec(str);
861
+ if (!reMatch || !reMatch.length)
862
+ return str;
863
+
864
+ // an index/macro has been found
865
+ // Note: at the moment, only one parameter is supported
866
+ var macroName = reMatch[1];
867
+ var paramName = reMatch[2];
868
+ var param;
869
+ if (args && paramName in args) {
870
+ param = args[paramName];
871
+ } else if (paramName in gL10nData) {
872
+ param = gL10nData[paramName];
873
+ }
874
+
875
+ // there's no macro parser yet: it has to be defined in gMacros
876
+ if (macroName in gMacros) {
877
+ var macro = gMacros[macroName];
878
+ str = macro(str, param, key, prop);
879
+ }
880
+ return str;
881
+ }
882
+
883
+ // replace {{arguments}} with their values
884
+ function substArguments(str, args, key) {
885
+ var reArgs = /\{\{\s*(.+?)\s*\}\}/g;
886
+ return str.replace(reArgs, function (matched_text, arg) {
887
+ if (args && arg in args) {
888
+ return args[arg];
889
+ }
890
+ if (arg in gL10nData) {
891
+ return gL10nData[arg];
892
+ }
893
+ console.log('argument {{' + arg + '}} for #' + key + ' is undefined.');
894
+ return matched_text;
895
+ });
896
+ }
897
+
898
+ // translate an HTML element
899
+ function translateElement(element) {
900
+ var l10n = getL10nAttributes(element);
901
+ if (!l10n.id)
902
+ return;
903
+
904
+ // get the related l10n object
905
+ var data = getL10nData(l10n.id, l10n.args);
906
+ if (!data) {
907
+ console.warn('#' + l10n.id + ' is undefined.');
908
+ return;
909
+ }
910
+
911
+ // translate element (TODO: security checks?)
912
+ if (data[gTextProp]) { // XXX
913
+ if (getChildElementCount(element) === 0) {
914
+ element[gTextProp] = data[gTextProp];
915
+ } else {
916
+ // this element has element children: replace the content of the first
917
+ // (non-empty) child textNode and clear other child textNodes
918
+ var children = element.childNodes;
919
+ var found = false;
920
+ for (var i = 0, l = children.length; i < l; i++) {
921
+ if (children[i].nodeType === 3 && /\S/.test(children[i].nodeValue)) {
922
+ if (found) {
923
+ children[i].nodeValue = '';
924
+ } else {
925
+ children[i].nodeValue = data[gTextProp];
926
+ found = true;
927
+ }
928
+ }
929
+ }
930
+ // if no (non-empty) textNode is found, insert a textNode before the
931
+ // first element child.
932
+ if (!found) {
933
+ var textNode = document.createTextNode(data[gTextProp]);
934
+ element.insertBefore(textNode, element.firstChild);
935
+ }
936
+ }
937
+ delete data[gTextProp];
938
+ }
939
+
940
+ for (var k in data) {
941
+ element[k] = data[k];
942
+ }
943
+ }
944
+
945
+ // webkit browsers don't currently support 'children' on SVG elements...
946
+ function getChildElementCount(element) {
947
+ if (element.children) {
948
+ return element.children.length;
949
+ }
950
+ if (typeof element.childElementCount !== 'undefined') {
951
+ return element.childElementCount;
952
+ }
953
+ var count = 0;
954
+ for (var i = 0; i < element.childNodes.length; i++) {
955
+ count += element.nodeType === 1 ? 1 : 0;
956
+ }
957
+ return count;
958
+ }
959
+
960
+ // translate an HTML subtree
961
+ function translateFragment(element) {
962
+ element = element || document.documentElement;
963
+
964
+ // check all translatable children (= w/ a `data-l10n-id' attribute)
965
+ var children = getTranslatableChildren(element);
966
+ var elementCount = children.length;
967
+ for (var i = 0; i < elementCount; i++) {
968
+ translateElement(children[i]);
969
+ }
970
+
971
+ // translate element itself if necessary
972
+ translateElement(element);
973
+ }
974
+
975
+ return {
976
+ // get a localized string
977
+ get: function (key, args, fallbackString) {
978
+ var index = key.lastIndexOf('.');
979
+ var prop = gTextProp;
980
+ if (index > 0) { // An attribute has been specified
981
+ prop = key.substr(index + 1);
982
+ key = key.substring(0, index);
983
+ }
984
+ var fallback;
985
+ if (fallbackString) {
986
+ fallback = {};
987
+ fallback[prop] = fallbackString;
988
+ }
989
+ var data = getL10nData(key, args, fallback);
990
+ if (data && prop in data) {
991
+ return data[prop];
992
+ }
993
+ return '{{' + key + '}}';
994
+ },
995
+
996
+ // debug
997
+ getData: function () {
998
+ return gL10nData;
999
+ },
1000
+ getText: function () {
1001
+ return gTextData;
1002
+ },
1003
+
1004
+ // get|set the document language
1005
+ getLanguage: function () {
1006
+ return gLanguage;
1007
+ },
1008
+ setLanguage: function (lang, callback) {
1009
+ loadLocale(lang, function () {
1010
+ if (callback)
1011
+ callback();
1012
+ translateFragment();
1013
+ });
1014
+ },
1015
+
1016
+ // get the direction (ltr|rtl) of the current language
1017
+ getDirection: function () {
1018
+ // http://www.w3.org/International/questions/qa-scripts
1019
+ // Arabic, Hebrew, Farsi, Pashto, Urdu
1020
+ var rtlList = ['ar', 'he', 'fa', 'ps', 'ur'];
1021
+ var shortCode = gLanguage.split('-', 1)[0];
1022
+ return (rtlList.indexOf(shortCode) >= 0) ? 'rtl' : 'ltr';
1023
+ },
1024
+
1025
+ // translate an element or document fragment
1026
+ translate: translateFragment,
1027
+
1028
+ // this can be used to prevent race conditions
1029
+ getReadyState: function () {
1030
+ return gReadyState;
1031
+ },
1032
+ ready: function (callback) {
1033
+ if (!callback) {
1034
+ return;
1035
+ } else if (gReadyState == 'complete' || gReadyState == 'interactive') {
1036
+ window.setTimeout(function () {
1037
+ callback();
1038
+ });
1039
+ } else if (document.addEventListener) {
1040
+ document.addEventListener('localized', function once() {
1041
+ document.removeEventListener('localized', once);
1042
+ callback();
1043
+ });
1044
+ }
1045
+ }
1046
+ };
1047
+ })(window, document);