pdfjs_viewer-rails 0.0.9 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (424) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +75 -3
  3. data/app/assets/javascripts/pdfjs_viewer/application.js +2 -3
  4. data/app/assets/javascripts/pdfjs_viewer/pdfjs/pdf.js +18538 -0
  5. data/app/assets/javascripts/pdfjs_viewer/viewer.js +9320 -6823
  6. data/app/assets/javascripts/pdfjs_viewer/viewer_configurations.js +3 -0
  7. data/app/assets/stylesheets/pdfjs_viewer/pdfjs/viewer.css +278 -115
  8. data/app/controllers/pdfjs_viewer/viewer_controller.rb +3 -0
  9. data/app/views/pdfjs_viewer/viewer/_extra_head.html.erb +1 -0
  10. data/app/views/pdfjs_viewer/viewer/_head.html.erb +14 -0
  11. data/app/views/pdfjs_viewer/viewer/_printcontainer.html.erb +79 -0
  12. data/app/views/pdfjs_viewer/viewer/_viewer.html.erb +83 -152
  13. data/lib/pdfjs_viewer-rails/helpers.rb +3 -2
  14. data/lib/pdfjs_viewer-rails/version.rb +1 -1
  15. data/public/pdfjs/pdf.js.map +1 -0
  16. data/public/pdfjs/web/images/secondaryToolbarButton-selectTool.png +0 -0
  17. data/public/pdfjs/web/images/secondaryToolbarButton-selectTool@2x.png +0 -0
  18. data/public/pdfjs/web/images/texture.png +0 -0
  19. data/public/pdfjs/web/images/toolbarButton-menuArrows.png +0 -0
  20. data/public/pdfjs/web/images/toolbarButton-viewAttachments@2x.png +0 -0
  21. data/public/pdfjs/web/images/toolbarButton-viewThumbnail@2x.png +0 -0
  22. data/public/pdfjs/web/images/treeitem-collapsed-rtl.png +0 -0
  23. data/public/pdfjs/web/images/treeitem-collapsed-rtl@2x.png +0 -0
  24. data/public/pdfjs/web/locale/ach/viewer.properties +22 -16
  25. data/public/pdfjs/web/locale/af/viewer.properties +27 -16
  26. data/public/pdfjs/web/locale/ak/viewer.properties +11 -12
  27. data/public/pdfjs/web/locale/an/viewer.properties +25 -14
  28. data/public/pdfjs/web/locale/ar/viewer.properties +27 -16
  29. data/public/pdfjs/web/locale/as/viewer.properties +11 -16
  30. data/public/pdfjs/web/locale/ast/viewer.properties +174 -108
  31. data/public/pdfjs/web/locale/az/viewer.properties +26 -15
  32. data/public/pdfjs/web/locale/be/viewer.properties +184 -105
  33. data/public/pdfjs/web/locale/bg/viewer.properties +39 -28
  34. data/public/pdfjs/web/locale/bn-BD/viewer.properties +37 -26
  35. data/public/pdfjs/web/locale/bn-IN/viewer.properties +18 -14
  36. data/public/pdfjs/web/locale/br/viewer.properties +21 -14
  37. data/public/pdfjs/web/locale/bs/viewer.properties +25 -14
  38. data/public/pdfjs/web/locale/ca/viewer.properties +26 -15
  39. data/public/pdfjs/web/locale/cs/viewer.properties +43 -26
  40. data/public/pdfjs/web/locale/cy/viewer.properties +26 -15
  41. data/public/pdfjs/web/locale/da/viewer.properties +31 -14
  42. data/public/pdfjs/web/locale/de/viewer.properties +33 -16
  43. data/public/pdfjs/web/locale/el/viewer.properties +43 -24
  44. data/public/pdfjs/web/locale/en-GB/viewer.properties +31 -14
  45. data/public/pdfjs/web/locale/en-US/viewer.properties +25 -14
  46. data/public/pdfjs/web/locale/en-ZA/viewer.properties +13 -16
  47. data/public/pdfjs/web/locale/eo/viewer.properties +29 -18
  48. data/public/pdfjs/web/locale/es-AR/viewer.properties +33 -16
  49. data/public/pdfjs/web/locale/es-CL/viewer.properties +119 -65
  50. data/public/pdfjs/web/locale/es-ES/viewer.properties +17 -11
  51. data/public/pdfjs/web/locale/es-MX/viewer.properties +25 -14
  52. data/public/pdfjs/web/locale/et/viewer.properties +32 -15
  53. data/public/pdfjs/web/locale/eu/viewer.properties +25 -14
  54. data/public/pdfjs/web/locale/fa/viewer.properties +27 -16
  55. data/public/pdfjs/web/locale/ff/viewer.properties +25 -14
  56. data/public/pdfjs/web/locale/fi/viewer.properties +31 -14
  57. data/public/pdfjs/web/locale/fr/viewer.properties +58 -41
  58. data/public/pdfjs/web/locale/fy-NL/viewer.properties +40 -35
  59. data/public/pdfjs/web/locale/ga-IE/viewer.properties +31 -20
  60. data/public/pdfjs/web/locale/gd/viewer.properties +25 -14
  61. data/public/pdfjs/web/locale/gl/viewer.properties +9 -14
  62. data/public/pdfjs/web/locale/gu-IN/viewer.properties +31 -14
  63. data/public/pdfjs/web/locale/he/viewer.properties +25 -14
  64. data/public/pdfjs/web/locale/hi-IN/viewer.properties +31 -21
  65. data/public/pdfjs/web/locale/hr/viewer.properties +30 -19
  66. data/public/pdfjs/web/locale/hu/viewer.properties +25 -14
  67. data/public/pdfjs/web/locale/hy-AM/viewer.properties +26 -15
  68. data/public/pdfjs/web/locale/id/viewer.properties +25 -14
  69. data/public/pdfjs/web/locale/is/viewer.properties +25 -14
  70. data/public/pdfjs/web/locale/it/viewer.properties +19 -13
  71. data/public/pdfjs/web/locale/ja/viewer.properties +45 -28
  72. data/public/pdfjs/web/locale/ka/viewer.properties +113 -7
  73. data/public/pdfjs/web/locale/kk/viewer.properties +28 -17
  74. data/public/pdfjs/web/locale/km/viewer.properties +28 -17
  75. data/public/pdfjs/web/locale/kn/viewer.properties +23 -14
  76. data/public/pdfjs/web/locale/ko/viewer.properties +25 -14
  77. data/public/pdfjs/web/locale/ku/viewer.properties +11 -12
  78. data/public/pdfjs/web/locale/lg/viewer.properties +11 -10
  79. data/public/pdfjs/web/locale/lij/viewer.properties +165 -109
  80. data/public/pdfjs/web/locale/lt/viewer.properties +29 -18
  81. data/public/pdfjs/web/locale/lv/viewer.properties +25 -14
  82. data/public/pdfjs/web/locale/mai/viewer.properties +11 -16
  83. data/public/pdfjs/web/locale/mk/viewer.properties +68 -61
  84. data/public/pdfjs/web/locale/ml/viewer.properties +11 -16
  85. data/public/pdfjs/web/locale/mn/viewer.properties +9 -6
  86. data/public/pdfjs/web/locale/mr/viewer.properties +34 -23
  87. data/public/pdfjs/web/locale/ms/viewer.properties +41 -28
  88. data/public/pdfjs/web/locale/my/viewer.properties +23 -16
  89. data/public/pdfjs/web/locale/nb-NO/viewer.properties +32 -15
  90. data/public/pdfjs/web/locale/nl/viewer.properties +29 -18
  91. data/public/pdfjs/web/locale/nn-NO/viewer.properties +55 -38
  92. data/public/pdfjs/web/locale/nso/viewer.properties +10 -11
  93. data/public/pdfjs/web/locale/oc/viewer.properties +31 -18
  94. data/public/pdfjs/web/locale/or/viewer.properties +11 -16
  95. data/public/pdfjs/web/locale/pa-IN/viewer.properties +54 -51
  96. data/public/pdfjs/web/locale/pl/viewer.properties +20 -41
  97. data/public/pdfjs/web/locale/pt-BR/viewer.properties +46 -35
  98. data/public/pdfjs/web/locale/pt-PT/viewer.properties +35 -24
  99. data/public/pdfjs/web/locale/rm/viewer.properties +31 -14
  100. data/public/pdfjs/web/locale/ro/viewer.properties +40 -29
  101. data/public/pdfjs/web/locale/ru/viewer.properties +183 -110
  102. data/public/pdfjs/web/locale/rw/viewer.properties +9 -7
  103. data/public/pdfjs/web/locale/sah/viewer.properties +11 -16
  104. data/public/pdfjs/web/locale/si/viewer.properties +12 -14
  105. data/public/pdfjs/web/locale/sk/viewer.properties +25 -14
  106. data/public/pdfjs/web/locale/sl/viewer.properties +26 -15
  107. data/public/pdfjs/web/locale/son/viewer.properties +22 -15
  108. data/public/pdfjs/web/locale/sq/viewer.properties +66 -47
  109. data/public/pdfjs/web/locale/sr/viewer.properties +33 -16
  110. data/public/pdfjs/web/locale/sv-SE/viewer.properties +25 -14
  111. data/public/pdfjs/web/locale/sw/viewer.properties +10 -11
  112. data/public/pdfjs/web/locale/ta-LK/viewer.properties +9 -4
  113. data/public/pdfjs/web/locale/ta/viewer.properties +27 -16
  114. data/public/pdfjs/web/locale/te/viewer.properties +46 -36
  115. data/public/pdfjs/web/locale/th/viewer.properties +63 -52
  116. data/public/pdfjs/web/locale/tl/viewer.properties +27 -8
  117. data/public/pdfjs/web/locale/tn/viewer.properties +9 -9
  118. data/public/pdfjs/web/locale/tr/viewer.properties +31 -20
  119. data/public/pdfjs/web/locale/uk/viewer.properties +27 -16
  120. data/public/pdfjs/web/locale/ur/viewer.properties +19 -14
  121. data/public/pdfjs/web/locale/vi/viewer.properties +25 -14
  122. data/public/pdfjs/web/locale/wo/viewer.properties +12 -12
  123. data/public/pdfjs/web/locale/xh/viewer.properties +25 -14
  124. data/public/pdfjs/web/locale/zh-CN/viewer.properties +30 -19
  125. data/public/pdfjs/web/locale/zh-TW/viewer.properties +25 -15
  126. data/public/pdfjs/web/locale/zu/viewer.properties +11 -12
  127. data/public/pdfjs/web/pdf.worker.js +45507 -0
  128. data/public/pdfjs/web/pdf.worker.js.map +1 -0
  129. data/test/dummy/app/assets/config/manifest.js +5 -0
  130. data/test/dummy/app/views/pdfjs_viewer/viewer/_extra_head.html.erb +1 -0
  131. data/test/dummy/app/views/sample/helper.html.erb +1 -1
  132. data/test/dummy/db/test.sqlite3 +0 -0
  133. data/test/dummy/log/test.log +1770 -89
  134. data/test/dummy/public/sample.pdf +0 -0
  135. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/-l/-lmREjXar1FRJ-qvxQYIcElssqWObGgYoAF-eff-GSI.cache +1 -0
  136. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/0X/0XaDr7BS6WD-1ZDWLs26li57iimlNOdbpYXu3COgsIA.cache +0 -0
  137. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/0b/0b2Yr0w8Kcv3H34YvS1k7ZIGpp3dh4_7WCmfi2uM0Bo.cache +1 -0
  138. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/1C/1CuVPLGkTRz3C8yksihFAA7r-PGExELVV95-nJujRgI.cache +1 -0
  139. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/1N/1NtVyTwC6gpkp4uPKks2i7XIDOc5xenKIwYbhYCPIZ0.cache +1 -0
  140. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/1V/1VFVQM3UvHZJeyfocqq1Ri1Ld4l_3VUA9f46XNQ5SqI.cache +0 -0
  141. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/1f/1fidLos4TsMC1Jzat66F4EuJMnvA4Ek4Yq3Wx_diqLA.cache +0 -0
  142. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/2R/2R98e2YVPrPua4mm1LnZJXzfgLbo7qgs7FDQSYqlwQY.cache +0 -0
  143. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/2k/2k2QxmtA7SFZWB1zLj10t-ZpwXLD8vtXHmDOkSrZWOU.cache +1 -0
  144. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/3I/3IUZQGAalEE2P68Ob6-jgHDDlLjcHN9rDb6zdVLvKXA.cache +0 -0
  145. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/4Y/4YfA4FbKpPO73V3dWQbDlh1_hUGWCLH_rus1BKCbmq4.cache +1 -0
  146. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/4h/4hGOMi8t9jA7rT-JyBz2wfIqmxxA6C-s63ulLteZmcA.cache +0 -0
  147. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/4t/4tVZLzuOFp3qqkNwJL6okWQg7SAt5WX8nirlPvL6v-Y.cache +0 -0
  148. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/4u/4ulvtPKNTLNgCnb7PBjj37O4Y61UX9EwDS4cjf105sE.cache +1 -0
  149. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/51/514_xqQJY6nPLefyDto_IvNYRJAEktoJAOQ9t4l2SuI.cache +0 -0
  150. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/5L/5Lly_CA8DZvPhQV2jDQx-Y6P_y3Ygra9t5jfSlGhHDA.cache +0 -0
  151. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/60/60rvu0XUvN93CtM3JpR9lkagXbYOOcP3XMAwArKf3iU.cache +1 -0
  152. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/66/66rMsErvbsDZN8Aw7gwgmjTsUCaW1Q_le3MrGPPBSbc.cache +1 -0
  153. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/7Q/7Q-pDkI2jygwa4-YpVs8LrHlGq76qvNF9cMKvIW19kw.cache +0 -0
  154. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/7u/7uViSjDgKF94AdY5eHIxebaJppkSsjIZUhJivtjlDV0.cache +1 -0
  155. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/7x/7x0UflNmZiyLz6l0qXexSKA5vSGDWtPvVyjpqxc4HOA.cache +1 -0
  156. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/8N/8NHrDFfbr9Dq5-k4ZEt4mrK9_S_WmayrkeAyR5gCsow.cache +1 -0
  157. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/8l/8l2VGTx_PcamE4fcI80EAeYWfYFMUOr1ZIdScNNLbn4.cache +1 -0
  158. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/9G/9GFNrvErbVcHyYoYCLPFVsaq6obi6zBXRfXRwlC_iig.cache +0 -0
  159. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/9S/9S1o3C_oz3WJO3m3zzkza6Q9vKA5WA6eGOWQuGTRQ3k.cache +1 -0
  160. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/AY/AYMLVwPVGVIAZH9JGKGImZOn2bjTqHUWwQDu9mdGzMw.cache +0 -0
  161. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/Am/AmERsfodVKxkkJ64pEvTqgnVjUO_vl5XI0OyXH6A11w.cache +1 -0
  162. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/Aw/AwGJsPzwrFfQJdKyC6KqhULhmx-DsookR6bTgwFcIAs.cache +0 -0
  163. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/B1/B1E4ZaLHU_KsfBquykVRKezQ-FRJl8v6--jX-yPGXnU.cache +0 -0
  164. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/B5/B5MDyeqMIx4GXhYZalpYkG3p3tBawiXl8hnHa4MMAQs.cache +1 -0
  165. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/C_/C_DAxUoLpJKozTFWURYaVNOWWQJe__0paQV8GWnSItE.cache +1 -0
  166. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/Cx/CxaQbme5ko-wxsVAwK--ul806HSJN2MwOnoPc8P9xPM.cache +0 -0
  167. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/Cx/cxKqQP5IZ0fdnsNxqjtovom-U8YKaaaAoLN0lkqlgmM.cache +1 -0
  168. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/D3/D3NQOCRTjgeuT449sw9wZTYfLClDh2bSEH8SlgA-tnc.cache +1 -0
  169. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/Dq/DqsfG7gyEmHCLWJFw8KEKZQd6xoIOcO__5TkBzsx3jk.cache +0 -0
  170. data/test/dummy/tmp/cache/assets/sprockets/{v3.0/J7/J7_1-jGIsJgQtlfH0jw7bFkUHm4lYEMwsflGlbds724.cache → v4.0.0/Dr/Dr2MkEtw8xvNoHzZkeTsrW9x4V-ov29KwUXJ3Ytd7xA.cache} +0 -0
  171. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/Dx/DxpORYhFQUee72PMFyH5hmyJ25-2cGjHoHfYDtlRcRs.cache +1 -0
  172. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/EF/EFCvsRgX3BcuZljpVdflnRpsMV8wugWpLXgVRSNHd2U.cache +0 -0
  173. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/Ev/Evv_jSn6ri1cHbzt2LeJt7QbZQGPetcWZ_W_M74hvZ8.cache +1 -0
  174. data/test/dummy/tmp/cache/assets/sprockets/{v3.0/S7/S7Jl8rwFDyT5waxhH9H2R_iTja9kXUzDpjchUj6BMDM.cache → v4.0.0/F5/F5QVTdQWhxejC7Hh4dw12tC9h9oER-CVhmuJorL1qLc.cache} +0 -0
  175. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/FK/FKE8-r24UNUM3hMXxJG6O3FNfYvi3aNZNogc_cVE95U.cache +1 -0
  176. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/GZ/GZE1uEJZ37lAijmeMj_1zMbwBjOgNlQFLqGEVRch0ac.cache +1 -0
  177. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/HP/HPbcXagW7N26tDcMQgv9_r8t1zH7TtuGYrs3oodVwso.cache +0 -0
  178. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/I2/I2ATvoFZ2TL3nPNvbfeqof0l4bhj3XggnJ3yQJ4Ayaw.cache +1 -0
  179. data/test/dummy/tmp/cache/assets/sprockets/{v3.0/Mz/Mz4WGIDdPycd4JOgDa4gtKMpO8H5MMhhNP_aSAivvlI.cache → v4.0.0/IE/IEHYsh5JtvYpOm4fKRK8i73Kld043YRGZx4UQKCrkLc.cache} +0 -0
  180. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/Ip/IpdEGQFk3_1PDWVS-jNlVpp9mODQhRe0ANsVFB_SC8A.cache +0 -0
  181. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/Iz/Iz4ic4cBk0cakoJ6s54nUNCYi9cQY3LHcaPWOrYUEmA.cache +1 -0
  182. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/JY/JYRKIfZvFeJJg7YXs4MW5cp8d__rZHrIJB4NRXM9wZU.cache +0 -0
  183. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/Jt/JtOEwyyV03hv8pbItClIEYBX_RCs54G24e0VPNOoWCI.cache +0 -0
  184. data/test/dummy/tmp/cache/assets/sprockets/{v3.0/71/71stgYwt4t69lIMueMKuSlCwQk1DL9R226Ee1prhseM.cache → v4.0.0/Kb/KbW87iTtZeGwhwOzqfuQx1FEkI4LPaXDomgyCNb62ws.cache} +0 -0
  185. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/LI/LIKFPcJ1se4iAGU3QiJja9o1ii6GWRK-v9lvq5y92pY.cache +1 -0
  186. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/M4/M4qPB8ROhK-PyRz1Z3wJ-ygcJghC-dPRjgKwl3gh_8M.cache +0 -0
  187. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/MD/MDkIPQSUBzWb_aUdhTkcU33TLvvnX50Ga64obHq4alA.cache +0 -0
  188. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/N0/N06_pjy6BGKJUTsqIxd5ae_OaZ5xhe5kRqaiiQNyb1o.cache +1 -0
  189. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/N3/N3qPqUfUuosjcEmWyCsVrevQWtleH5a-j9KibYBOiAU.cache +0 -0
  190. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/NB/NB4rmJl43C0j2sMk7rvV68zKk6LIwe8oSE202hsQIVE.cache +0 -0
  191. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/NE/NERKHzfGRgUtxIaKk351O8At6hN3Z_WmOJWBHnyAgJU.cache +0 -0
  192. data/test/dummy/tmp/cache/assets/sprockets/{v3.0/T4/T4HdrzfDiTLFdSbO3SxncQtKzXUYU_21Na477K963-A.cache → v4.0.0/NF/NFgDH-U92odJCph94D_u3Vf1TQ9aE47diTENTVlErpQ.cache} +0 -0
  193. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/OI/OI6uxGcnsKavdWTtwDAasU3wPx8QXhzBgV0X2n1KjMQ.cache +0 -0
  194. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/OO/OOgLMDCLY8g9iAVOQIpMIAPXWa5ktKrhJjcRJEYohGs.cache +0 -0
  195. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/OO/ooyoOnI5A5xJuh3z8Z-ci1RArvgJ9PCZpf2c-oup10E.cache +1 -0
  196. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/OP/OPY7eBOtRZytk4yAS-_WSVaYBl6cH1b192gDGfjCfoQ.cache +1 -0
  197. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/PC/PCeurKXRahIDlP9tRcOVatNTyM1CReaqhiQzE1wy_c8.cache +0 -0
  198. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/PP/PPa0f6y1dPEk5k5nDnkYOHm-hNSyoHraUjkWH7-87Uo.cache +1 -0
  199. data/test/dummy/tmp/cache/assets/sprockets/{v3.0/uG/uGB8pQq7xPDYA5nByG0nWXGe9_8G6vjUD4YWdayZUBU.cache → v4.0.0/Pg/PgvHapfJ4XmTxEfkr0v-RLyS5JvuI_BQi8NjQQsjfkw.cache} +0 -0
  200. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/Pg/pGA_JnDDQlLL9RgMEqNuMELYKZh4_8orr_daua34vXk.cache +1 -0
  201. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/Pu/PuF-erEO9Cmy9sQyFoLqivPBHUyrrwjgvB9l3aFz4C4.cache +1 -0
  202. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/Q3/Q3Q6MT0F4JMTVLlXw7c0xUmVyGDqCwOVowbwVD50K3s.cache +1 -0
  203. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/QO/QOd41yOl9N2G7DxsuYjWPRC_Om1KmSdCDU2eZeilYIY.cache +0 -0
  204. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/QX/QXEHkMzTT6JXQX314coHx1i3ke40DkSZn-zi085zeG8.cache +0 -0
  205. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/Qp/QpAgfQP6U5jcFY5doMrcWCffY03uflvWMbb03Osa6HY.cache +1 -0
  206. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/RA/RAXAeC3kfxNZnXpmCwb-qn_FQJ341EsL4X2UMoNj0Uk.cache +0 -0
  207. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/RI/RIxeN1uIBV1W2RgyoYXG3XW_kHO8azJufVzY8P6Gb7U.cache +1 -0
  208. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/SM/SMgUxo_qOBvLvEK1EOWPVKg0frCoAEcbMz4ajX40CoQ.cache +1 -0
  209. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/VP/VPqFDN_2SCNZqqhZ9YIYZJyXQyC8HPOSjBxLAXjJUTo.cache +2 -0
  210. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/VP/VpmEcu3zJe0snpgnyXo28Y9CR_Z4gWOXuSF6bCqcNzc.cache +1 -0
  211. data/test/dummy/tmp/cache/assets/sprockets/{v3.0/Bi/BiBHyucnKyS4xGpxUaVGSzTEDSBLG38nAlOlD2fIcd8.cache → v4.0.0/W7/W7hh0dVpxEqTKdviyRDIHIsH1R9GT2hNdDzwdte3Nz0.cache} +0 -0
  212. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/WD/WDuw8twbXVN-_Gg9ZzK9u4DDNqn1TteRGlIuv_aa-QA.cache +0 -0
  213. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/XB/XBXQ4cCJlGbG0xFwpeDlDU4TQTcFWMYg7I9lAaWcEsM.cache +0 -0
  214. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/XR/XRQlMBopl7a7Jcgd10jZhV1EE0byt-9Oc8Je0UbaVCI.cache +0 -0
  215. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/Xo/XorZqUhm5Dx82vY0iLShsV82J44N9MWwymJ-xJqxjtE.cache +1 -0
  216. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/YC/YChE4yerh7h2ESkCvPWgHNmpvd-6Tlvu5dYC0vU50bg.cache +0 -0
  217. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/YC/ycYj6WSn9-Dtf8pbKj8cTWz78ic5RDhppNhTz0jnRw0.cache +0 -0
  218. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/Ye/Yesdya1cJqbzEFlyZjSZNrrrKncP6A8wT60bM_gDSn0.cache +1 -0
  219. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/_9/_9Df-Wg-hg1H3a4KC3w4D3L8gGHjynD3FEP7yR_CX7Y.cache +0 -0
  220. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/a7/a7i7UP5U6Ov1wz57MtD7oIJwaEcZp8ZZBZ6gdG-bY58.cache +0 -0
  221. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/as/asfo-X1cfhAI_4aPIjtILMT3E0o7WEYvVmC6Jaj2t38.cache +1 -0
  222. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/ch/chtPVIfeMzwhXmacsO4PPqQjNhvQLmc7-zZx1Sg2Cno.cache +0 -0
  223. data/test/dummy/tmp/cache/assets/sprockets/{v3.0/jr/jrK6gITAaG-WCXCpnRQJzZIpw6kGVRdaX-k3sYE12nA.cache → v4.0.0/cl/clyISbC0KryDMhct-YGNbEEKSMwqOzQIhSarjF1P8r4.cache} +0 -0
  224. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/cz/czUK-RJBveMll9eYD8g6rTtGfl5VmA_QjnQ7Uf9Y2nA.cache +1 -0
  225. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/dV/dViCI_zQMwNbS4OmSFMSSYYF_jEkTIUSMNUSR-P7PdE.cache +1 -0
  226. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/eG/eGsVuUaGsi7m8U8oe-Yun6LsMTZZwv2dAnkYXn_JVjw.cache +0 -0
  227. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/fO/fOMwhE_LoK6PBz43rr86imRHqStpfn-j0zKwNCEFA7A.cache +0 -0
  228. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/fb/fbcj7itMSGt-kdSRxK6AB0nRdZVu-D9ydDjNtJymoZQ.cache +1 -0
  229. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/fi/fiFKBYw__5HFRz1AJqpDR4zvuOTgL9UTdw4F4ZnqYSg.cache +0 -0
  230. data/test/dummy/tmp/cache/assets/sprockets/{v3.0/p6/p63nGo7X2XlRl6QMB02rCfpb3CFcnBA2rCMd61FHvmk.cache → v4.0.0/g3/g3FImRt_WSdB3AJATqNrYTTpFhJ4_h0k0dJHg_igurQ.cache} +0 -0
  231. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/g8/g8CX16fkcOcyH0CF8sJ4Q-UQZgVT2qytd9wFxZfi6dw.cache +0 -0
  232. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/gR/gR8C9CncmLdDw-EocNZqJp_Aeh-ZLTECe5mc3pp_hp8.cache +1 -0
  233. data/test/dummy/tmp/cache/assets/sprockets/{v3.0/2u/2uyy2VveB6Rsc9JlymSEB0Qe6iSjYCpAw2PYwPb22YQ.cache → v4.0.0/hA/hAlBeenL7obXexZ8BV7y5txHHhKTTC3z_Ajnomo_ddg.cache} +0 -0
  234. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/hM/hMhbDjdHYVI7KihEY2_qoA2gCoSjNqVOO-AWp1TAQ7A.cache +0 -0
  235. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/iK/iKbAfMeZFgsqghv6mlqoQfhQCGVYHmVRY8TVYwqItMw.cache +0 -0
  236. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/js/jszwJYIqGBs_vNgoYpTLBwYr-UkQcocQ0NBCGoEC1xI.cache +1 -0
  237. data/test/dummy/tmp/cache/assets/sprockets/{v3.0/KG/KGy1h2Np66_BWPyUYInRDn111Eo4u18iJz79A5Y_8OA.cache → v4.0.0/k1/k1ZZk_rc0Y2u6OVJFWmW2Oc5r4ry2slvl9FgAy1WDc4.cache} +0 -0
  238. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/kd/kd6nkjO5EQi4vBIYzbAKlNjrslJkJPnX_m8jH1EZD6Y.cache +1 -0
  239. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/kh/khnQMYg4IPY6_sXYIFti4J_9yKQc3_b6GORtFVLrzOE.cache +1 -0
  240. data/test/dummy/tmp/cache/assets/sprockets/{v3.0/bA/bAcEmOvSYU9DO7MT8-T7yHkggM32bUOyR-8TWntFS7E.cache → v4.0.0/lS/lSZn-CQCNgZ5F7OXc4mpcTnwFIzHpHtL0iPTyZL31v0.cache} +0 -0
  241. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/lT/lTxrEmTXm23GEk3ISi5qtEoYM1rqI9AYzkD26aoasQQ.cache +1 -0
  242. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/lU/lUjp67U_YbE14_X7xnSTDcMwOVgiWF3-FHb_yif3kC4.cache +0 -0
  243. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/le/lejIn_jlvyadKS3me0gOB49iI8SJUW1nLWlxOcgkO_k.cache +0 -0
  244. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/mm/mmEQpQZ17TwXCS7-OihitWehDJKxvg9HXlo74g7YZ8g.cache +1 -0
  245. data/test/dummy/tmp/cache/assets/sprockets/{v3.0/zR/zRbdRb-o65vqEx7gHWM-P97_PjFwvomEwygExzhOHTs.cache → v4.0.0/ny/nySX9xY8GVjq8lxHLaokecbVQFri3H_pqQ5ytA2uXwo.cache} +0 -0
  246. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/p4/p4WHavXhUgY2ubVF6tXt_u-hX4ZS06FfjxcM_qsF9mI.cache +1 -0
  247. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/pa/paq2b-coLJizAccytZuATQhfCSguqbBJdYXWc8Fyup8.cache +4 -0
  248. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/ph/ph-v3FvrMv6i8Y_KgPSvgMPIxYhaE1-UEDMVYFH1tDo.cache +1 -0
  249. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/pl/plJ87vXodUAoRqG3i5un0gEpqnRKVvuneeLI9jWAaFM.cache +0 -0
  250. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/qv/qvLBTEMTkTqvpE01Wb-TBj5FS8zoHijnXT_HI7Aviog.cache +0 -0
  251. data/test/dummy/tmp/cache/assets/sprockets/{v3.0/9L/9LtRMVlN7YCDqIGfUJcjJseLSM2aDb3DoGHGErvlYpE.cache → v4.0.0/ro/roZHBpaLIO0Elw6MTQld9etf9K-nmCVBATN15NKZhh8.cache} +0 -0
  252. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/s6/s6qdBr2THGjUKtZptbwt51LqdUY45X1KUukE_MkldFo.cache +1 -0
  253. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/s9/s922q4NrUcCBhaMaKRwUVY9uDnrvKbm2YlJmiaLvtAM.cache +0 -0
  254. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/sQ/sQ9kUYcYCVtzBgCr0dHtjWWwQXAUuDvcKE7viYEMGrc.cache +0 -0
  255. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/sp/sp45zrfDq1U_O8efmQ2xUkP3ale5f4UgIV6ph-xYtRU.cache +1 -0
  256. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/ss/ssidpjNHJeIRP1DArO58wY11cNzfnwLraPYUvt4ozkg.cache +0 -0
  257. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/t3/t3ax_k1a_nmiQ4zF2PalaCH7-7C3lZyN7wlKn_V-puc.cache +0 -0
  258. data/test/dummy/tmp/cache/assets/sprockets/{v3.0/-q/-q6NQgY81e7LDSsdY_XCGtLdDsXiy9ImIKCPBSmLRVY.cache → v4.0.0/u0/u0CiJwhveeWyr8l-amiVTzfLG2WM16zxcdKxTcw08Dw.cache} +0 -0
  259. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/uW/uWrE5jGykNTXzfomZWop-40evTv0HMarJ1cC6iF31jI.cache +1 -0
  260. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/ua/uarMuxiCflV7mHH0LUV4CE171FFltKAASZPXHEWS9uI.cache +0 -0
  261. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/vC/vC7hmqzbKAktMmLea8k4uIfpOBDVQghbOroENscRNBM.cache +0 -0
  262. data/test/dummy/tmp/cache/assets/sprockets/{v3.0/As/AsjkHfKxFtug5RaXLjxS0tB_y-9vBMQecSlFe7cNmY8.cache → v4.0.0/vI/vIl3YhfXQycLKyCxR2lKK3G6I4nR9OwpJQDotA7g3A4.cache} +0 -0
  263. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/vR/vRmK6N2pk7V6jxrWMI_tWcRWthlUlf6lt-TZgnUvWw4.cache +0 -0
  264. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/vZ/vZoRVNI4g3ZxhlM02nFtcEYVcwJ188tC8zi6AytXxBw.cache +1 -0
  265. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/vo/voBUXzYnbfEh2q4iqAGN7csd6wfatR9k3DhU4fjE8f8.cache +0 -0
  266. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/vs/vsQwdd7nb7UOkkBO5ba1tLA2j1WPbSIkc7JollidPMs.cache +1 -0
  267. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/wA/wAOOSCxDmKhlbcT0Ldr7vt31sN6zbQu03xPRHdohX3k.cache +0 -0
  268. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/xn/xnDw7D_Uk4g-rkmZl3T-Xm6emd0939hy0xI5pJdUWvM.cache +0 -0
  269. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/y3/y3lDac4K4bSpQHP88Fh7bls3-IZ24qN1pYlm119Mst4.cache +1 -0
  270. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/yA/yABOMiKJLqLZOCOBLBJjeEwvd6DZlCnKjanSlymoFos.cache +1 -0
  271. data/test/dummy/tmp/cache/assets/sprockets/{v3.0/Lc/Lc6rpjP6oLsRJWScD4W3e6la4t9niKxd8YGT2bBh0MU.cache → v4.0.0/ym/ymTjP7xTnz0IsG8Erou0O7fYw_22ZuKREL7b8os154c.cache} +0 -0
  272. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/yo/yoJkscf27cCw03TsQRLprs2pxkGnDdAyYuhr380cwbA.cache +1 -0
  273. data/test/integration/viewer_test.rb +33 -2
  274. data/test/sandbox/full_viewer.png +0 -0
  275. data/test/sandbox/helper.png +0 -0
  276. data/test/sandbox/minimal_viewer.png +0 -0
  277. data/test/sandbox/reduced_viewer.png +0 -0
  278. data/test/test_helper.rb +2 -2
  279. metadata +342 -356
  280. data/app/assets/javascripts/pdfjs_viewer/pdfjs/compatibility.js +0 -593
  281. data/app/assets/javascripts/pdfjs_viewer/pdfjs/l10n.js +0 -1033
  282. data/app/assets/javascripts/pdfjs_viewer/pdfjs/pdf.combined.js +0 -47884
  283. data/public/pdfjs/web/compressed.tracemonkey-pldi-09.pdf +0 -0
  284. data/public/pdfjs/web/viewer.html +0 -411
  285. data/test/dummy/log/development.log +0 -259
  286. data/test/dummy/tmp/cache/assets/sprockets/v3.0/-t/-t5GVzBWkde9ub5Dw01su_QUfCvcfq2n7qOU7Kpy20o.cache +0 -1
  287. data/test/dummy/tmp/cache/assets/sprockets/v3.0/08/080G4FuPE7XFV1a1w2UPhtjxWHV1PqEDphm1BVU6bqk.cache +0 -1
  288. data/test/dummy/tmp/cache/assets/sprockets/v3.0/0T/0T3vHG3AoM6H9-UUe2BPzwXDHSRwMWkdI_eYNLXIaV0.cache +0 -0
  289. data/test/dummy/tmp/cache/assets/sprockets/v3.0/1f/1fidLos4TsMC1Jzat66F4EuJMnvA4Ek4Yq3Wx_diqLA.cache +0 -0
  290. data/test/dummy/tmp/cache/assets/sprockets/v3.0/2H/2HU5q2HDLP-LB23hM72fUDoS_j5lPaJSI7IF01U7NDc.cache +0 -1
  291. data/test/dummy/tmp/cache/assets/sprockets/v3.0/35/35zufUzA_pQC-5GZWRjDFnpQSnnRB7IZ11GOWUCrSuQ.cache +0 -1
  292. data/test/dummy/tmp/cache/assets/sprockets/v3.0/41/41bbmlVTHFhKYgY3Mb5w8wRpzeBDAnvso4yeZfycmZw.cache +0 -0
  293. data/test/dummy/tmp/cache/assets/sprockets/v3.0/4f/4fdHLlIfLD3AKTlp44tZ9bJcfv1ckrqz884hSOBoJc0.cache +0 -0
  294. data/test/dummy/tmp/cache/assets/sprockets/v3.0/4z/4zaTuQNQ-f4VplXdAsrqxg9X3_jgn83bTKExkgyK1Dc.cache +0 -1
  295. data/test/dummy/tmp/cache/assets/sprockets/v3.0/5F/5FtUQmmePVDek5RfbRjG9-tEWQN9LmsMbMsUzxG0oXA.cache +0 -1
  296. data/test/dummy/tmp/cache/assets/sprockets/v3.0/5H/5Htfw7H-9yCiEsKrcea6l5fKFCbTUr_Rer3KeOltfpQ.cache +0 -0
  297. data/test/dummy/tmp/cache/assets/sprockets/v3.0/5L/5Lly_CA8DZvPhQV2jDQx-Y6P_y3Ygra9t5jfSlGhHDA.cache +0 -0
  298. data/test/dummy/tmp/cache/assets/sprockets/v3.0/6U/6UPfT3oOX0Z5g_LVzD1fIrbBg2IF3E0Zs9ZcpPmEumY.cache +0 -0
  299. data/test/dummy/tmp/cache/assets/sprockets/v3.0/6p/6pl5BgV5NUKa0M5z1JWmRyR7VMlmV_TnuXaIHa-a0tA.cache +0 -1
  300. data/test/dummy/tmp/cache/assets/sprockets/v3.0/6y/6yWCnWQZ4ibluEIW8EvyYOZqmrH0xhi0Db8smuj6t18.cache +0 -1
  301. data/test/dummy/tmp/cache/assets/sprockets/v3.0/6z/6ztMTmnOacQTXs6Vnv6OfSLyvoHXkIqhKfs3ajnEyYs.cache +0 -0
  302. data/test/dummy/tmp/cache/assets/sprockets/v3.0/79/79dZygZE-ACvSNiThevxriXuL0L2a5nzsG6smkijiIY.cache +0 -0
  303. data/test/dummy/tmp/cache/assets/sprockets/v3.0/7l/7ln8dFl8yZOucQdjPjsGTORt3sOUzaF8GPUAJAiGukU.cache +0 -1
  304. data/test/dummy/tmp/cache/assets/sprockets/v3.0/7y/7yNlixqTVXpTDGdxtRdPR3-Heab5x0aBdJdGJ8EHdgc.cache +0 -0
  305. data/test/dummy/tmp/cache/assets/sprockets/v3.0/81/81292vRreJmEuLhLhV6HxALK7epFEwvRgw58uQLFAEs.cache +0 -1
  306. data/test/dummy/tmp/cache/assets/sprockets/v3.0/8d/8dSdlbQtg7bAzL4WJW_v1LLaVQ-eVnAQQ5N6H4gwOsQ.cache +0 -1
  307. data/test/dummy/tmp/cache/assets/sprockets/v3.0/9J/9JF1ActxnHWpo9QCp5ZUB7lpq5deaBf04E8tpwBaqIQ.cache +0 -1
  308. data/test/dummy/tmp/cache/assets/sprockets/v3.0/9V/9VjE3x4J-o2hYYW_OmIQnAdFeDw-BWRJwMG8YpdQn84.cache +0 -1
  309. data/test/dummy/tmp/cache/assets/sprockets/v3.0/9h/9hKDxRykvMd5d3ibRhzcS4EAMb9o3Fa_Ybl-m5wox18.cache +0 -0
  310. data/test/dummy/tmp/cache/assets/sprockets/v3.0/A-/A-x6g1hcYwickErEJa4hv1Lggyfdd3j3Wab236wTgVY.cache +0 -1
  311. data/test/dummy/tmp/cache/assets/sprockets/v3.0/AA/AAUMS8uXVgslBOoirrsLdY4Ag1ijItQ0spJjhta63h4.cache +0 -0
  312. data/test/dummy/tmp/cache/assets/sprockets/v3.0/AY/AYWyTNfFrMFXNeXyr6qyeU5cU4VNBaRZ9GSH0A_FTG4.cache +0 -0
  313. data/test/dummy/tmp/cache/assets/sprockets/v3.0/As/aSGbex_eb2YmMSeGCSJbfqr4raznNAQ-hLIQi1ELA08.cache +0 -0
  314. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Ax/AxGKs1wHRZDhTLT08ByVX0X7p3jxnzpFWvik33-2HGc.cache +0 -0
  315. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Az/Azfd0siA6xNhvTYx1sIfH_68yT2lktwcv1iHV27Evus.cache +0 -1
  316. data/test/dummy/tmp/cache/assets/sprockets/v3.0/BS/BSyrC2z_r77PQolC4IeFWphPsVuwm_IMzp4u70S6vDk.cache +0 -0
  317. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Bb/BbyGO7nv2FMFnwC8jnxCXIfCZCpPItXqqIu2lTKvCsk.cache +0 -1
  318. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Bc/BciIoQECZf_1y1NR9MwSpgeqNrT-rX20dmMv5fgF64g.cache +0 -1
  319. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Bh/Bh1h2g7TPWnpDSPyssUWy3q55lN9l1LPhnlvaXlXCwA.cache +0 -0
  320. data/test/dummy/tmp/cache/assets/sprockets/v3.0/C-/C-rYxWqMLNU8YVQd2fJlnScQWjraLZGSVYNno8ZWwYE.cache +0 -1
  321. data/test/dummy/tmp/cache/assets/sprockets/v3.0/DS/DSOLSc6A5RVSmvM415eEWAWG_AgOvZcLZOXQjsXyWQA.cache +0 -0
  322. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Di/DigdgIqS7bGlgBulDuFvQPpifrIXU4OL1BRq56BrNi8.cache +0 -1
  323. data/test/dummy/tmp/cache/assets/sprockets/v3.0/EA/EA58tBohqYgVMAfTWbqYQMfhbZyQ7xOVE5nyFYQ4ILY.cache +0 -0
  324. data/test/dummy/tmp/cache/assets/sprockets/v3.0/ER/ERnhvKmzMsN4ne6bfo--b-C7Q-6QxfzACrKgE2vh1nE.cache +0 -0
  325. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Ek/EkAuJl_fpdrMEvoOocPF7T4XwQ6YaE3krHedVoQVAhc.cache +0 -0
  326. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Ep/Ep_qJLsM6Koq_xt0sRgrOu9kVjfZLxX6c1k9JgyyVzI.cache +0 -0
  327. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Ge/GeNnWyMrCVZcLQwvFIUxmeE5QnbBW0ooOwi9I_YF6NE.cache +0 -0
  328. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Ge/GefKNcQdME9gFg7x6Ubl10AKRWQOI8rpB84b1DwqMQA.cache +0 -1
  329. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Go/Go7suWCHlEDa8ucybgyeVgOLKNDOmYcnkky1s-9jQro.cache +0 -0
  330. data/test/dummy/tmp/cache/assets/sprockets/v3.0/H8/H8_IGSoQCZ3LBxii2RZXH8KqYUx-WpJhM_7zJk-cw9Y.cache +0 -1
  331. data/test/dummy/tmp/cache/assets/sprockets/v3.0/He/He8dbO9KB_qFzpPwv04NBqBfMYxlOE7vytxtEUT1FIg.cache +0 -0
  332. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Hp/HpkDNfjcvnQ3cWDf2DuhP3yDpOqDmhOs48DmtdNMTXs.cache +0 -0
  333. data/test/dummy/tmp/cache/assets/sprockets/v3.0/I2/I2MZs_8sc534WdUN3-XnHBGP3A0LDtDmHbxu-dVGvr0.cache +0 -1
  334. data/test/dummy/tmp/cache/assets/sprockets/v3.0/IE/IEUeuaZvKg2F4IEObI0zgU_SO60U02BcqA3YdjfYLhs.cache +0 -1
  335. data/test/dummy/tmp/cache/assets/sprockets/v3.0/IE/IeEv80zxsBwBelFUt7XuhqyTzUX8u6ZlAASZcRQ1q8Y.cache +0 -0
  336. data/test/dummy/tmp/cache/assets/sprockets/v3.0/IH/IHRC4-8LT7E2d69WoMd8mtCTcuHs9CHdx06qQOkqeb4.cache +0 -1
  337. data/test/dummy/tmp/cache/assets/sprockets/v3.0/IR/IR0071WvcQcaWbeJdaVAHLTe8wRpr6E98_55rO51vJI.cache +0 -1
  338. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Ig/IgDY1CRIUs7PK8O0saLCPILkrVsWS-0EDdac2-vDwhA.cache +0 -1
  339. data/test/dummy/tmp/cache/assets/sprockets/v3.0/JP/JPrrUGF_3-GtB7jM_E_4HzYlkxJ5_4jj4mq6vXzVnN0.cache +0 -0
  340. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Jf/Jf_0BNbCJItwTH1g9AzYSV7cnq3GpFlcrZjODr5KUEY.cache +0 -1
  341. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Jk/JkxqhdQnl29bTrWBKW_nGDe54MaTAFxUeVvG6fsEyDs.cache +0 -0
  342. data/test/dummy/tmp/cache/assets/sprockets/v3.0/K7/K7S5z9d_3JC-gVOj-236ZBlw8ovV_jLRT1LSPNm5EBk.cache +0 -1
  343. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Ks/KsFAy16AhHBjV1q7vt82A6Y33NsSbqsFrv9BiKZMreg.cache +0 -0
  344. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Lb/LbpOkaxE_qd8m5Ckur4t_mqarROkdCQ-BHt07H-u6C0.cache +0 -1
  345. data/test/dummy/tmp/cache/assets/sprockets/v3.0/M-/M-uK4ThehS1nk0YpPEwPu-F1jUTul8eBkyg1mBg0gvg.cache +0 -0
  346. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Ma/MaVnsdU0tivsecHGXwf_n_3-yLSSuotq6spLQr-bs0c.cache +0 -0
  347. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Mo/MogwKpf20as_2fJUDTrlUcDdMh20evxDffERAKk8QlA.cache +0 -0
  348. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Mz/mzI7pDy1zvv-w3xgMptsk1WhW985tn21VLDInMf5_as.cache +0 -1
  349. data/test/dummy/tmp/cache/assets/sprockets/v3.0/OI/OI6uxGcnsKavdWTtwDAasU3wPx8QXhzBgV0X2n1KjMQ.cache +0 -0
  350. data/test/dummy/tmp/cache/assets/sprockets/v3.0/QP/QP_11qyTmflgTGiwcW0MSJenVgRiv-nJrIYdJlGoH3E.cache +0 -1
  351. data/test/dummy/tmp/cache/assets/sprockets/v3.0/RH/RHvDByu5dX4Hsd19kB-lR6jbsWCtSUlEOuZn09W6yTg.cache +0 -0
  352. data/test/dummy/tmp/cache/assets/sprockets/v3.0/RP/RPm5aX4qNBojnmbdvw-kqHBZdKP8lgSYcfKMWBDWJEM.cache +0 -1
  353. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Rz/RzY1cYjFXjcJbB6Xf0OLXcOsLIFR-fJygQbmDgn-I0U.cache +0 -1
  354. data/test/dummy/tmp/cache/assets/sprockets/v3.0/SQ/SQAGM5ieWLt5zrjyMNz6CokZ4X8NB85kSPQeBlt0xNw.cache +0 -0
  355. data/test/dummy/tmp/cache/assets/sprockets/v3.0/SY/SYKIVw0JdXBkHnkRBwlVpuYz9ywvRpQDFDaZpjasz-g.cache +0 -0
  356. data/test/dummy/tmp/cache/assets/sprockets/v3.0/TB/TBC4TQJ7eLxKqqxNVC92qwET2VtN6Pz4WLAJ8ZsD_eE.cache +0 -2
  357. data/test/dummy/tmp/cache/assets/sprockets/v3.0/TL/TLiKl88xrJgr5wstIvihdZ6URJu0-uK_gwNGWA85w4o.cache +0 -0
  358. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Tj/TjYsQV9h_b-PQ9mB812dFtYHJ4a4FrfZgqvGDl0ecLI.cache +0 -0
  359. data/test/dummy/tmp/cache/assets/sprockets/v3.0/U8/U8lReX_PG7IIl0UT6e66lbpiKaHIVr35LVsCkFILG_E.cache +0 -1
  360. data/test/dummy/tmp/cache/assets/sprockets/v3.0/UF/UFlw5aQDhyk_odf54MCShCKgL4tdOkYpvars0SojIec.cache +0 -0
  361. data/test/dummy/tmp/cache/assets/sprockets/v3.0/UV/UVNBbRFrLJPMBVttqJhfB97xE7jwfcz8116f561SgMI.cache +0 -0
  362. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Ui/Ui6clyARo_JCQlsKG-ZLLtoK-VL2VZ-d5gwiayl3PBA.cache +0 -1
  363. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Ul/UlZIs4zBOzazcKXNnGO5yi23YtGu39nz5k2lrMAH-fg.cache +0 -0
  364. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Uz/UzTxgkkJxu_yF_A4VqzZXaI8jHOo2uqg2jQzQlCGDio.cache +0 -0
  365. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Uz/uzrz2VsOGZr8bImxBFHVyh_kZsyrJBbERoUKLbRr9wA.cache +0 -1
  366. data/test/dummy/tmp/cache/assets/sprockets/v3.0/VL/VLLs8UrNjV8bfd8uPyFHkkLb7Uq6wk-sSBHldEjIQWg.cache +0 -0
  367. data/test/dummy/tmp/cache/assets/sprockets/v3.0/VS/VSY-hml0wKkEILztFY2MRmrwdjaTw138yvlr_kdR5wA.cache +0 -1
  368. data/test/dummy/tmp/cache/assets/sprockets/v3.0/WL/WLjT_PqLYAab7ICYxacunvKK7x0J7CyIJsxi7bVph1Y.cache +0 -1
  369. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Xp/XpHZvs8omFcn_aNkmaGBOj11vjlgis0GAIP3MKVcUyg.cache +0 -1
  370. data/test/dummy/tmp/cache/assets/sprockets/v3.0/YJ/YJhpKq1vU8uVW9TP9DvaO4yjZBVYT2Gv5d_CW9Xjvgc.cache +0 -1
  371. data/test/dummy/tmp/cache/assets/sprockets/v3.0/_H/_HDoShPSg9SdiXdQroUZtQd3S82RZaRlhw4n_BarXd4.cache +0 -0
  372. data/test/dummy/tmp/cache/assets/sprockets/v3.0/_x/_xKbdjmcLyZhehb01ubXK_0Jw0QzOHeqwszrntGHhgA.cache +0 -1
  373. data/test/dummy/tmp/cache/assets/sprockets/v3.0/aT/aTt4wK2WIQvQRV2gAzjoymdBNfvgkNfAZthlIeu413M.cache +0 -1
  374. data/test/dummy/tmp/cache/assets/sprockets/v3.0/ak/akvJqh_CeKLt1fdEwDIV9zHTTT3AugzmeUHM8y57jKY.cache +0 -0
  375. data/test/dummy/tmp/cache/assets/sprockets/v3.0/ao/ao1pPYOFJ7wX29UdnX0Bjt1xqxPOLtYKeuys3Ax7UHY.cache +0 -1
  376. data/test/dummy/tmp/cache/assets/sprockets/v3.0/b2/b28ZzBxW--4poZM3tMAMMk1RyB_6u-p1MsHeQowcKpc.cache +0 -0
  377. data/test/dummy/tmp/cache/assets/sprockets/v3.0/cE/cEeKuWJlIZEoE6BdWqTI-t-E0N2LAeufboemcnI5Ltg.cache +0 -0
  378. data/test/dummy/tmp/cache/assets/sprockets/v3.0/cR/cRYLwr6_kGeZYZrNWP40U26TFX4f2QAbevRDC32I8zk.cache +0 -0
  379. data/test/dummy/tmp/cache/assets/sprockets/v3.0/cW/cWKFgp1roz93Kd99ls1d6ayBMMRXc5z1nOnPJPOFBM0.cache +0 -0
  380. data/test/dummy/tmp/cache/assets/sprockets/v3.0/ca/cazmkYR6tJ4f0DptT7Qr8mo-BZwfvM4EKpJ3yF-HQIs.cache +0 -0
  381. data/test/dummy/tmp/cache/assets/sprockets/v3.0/d4/d4UJTJcZGylngswkFZgsStffrdVU8IysEAukleJHq_U.cache +0 -0
  382. data/test/dummy/tmp/cache/assets/sprockets/v3.0/eg/eghgqLUKT9lADymq4Vk0hb5NYXIIFrpWDUqeHuEDt74.cache +0 -1
  383. data/test/dummy/tmp/cache/assets/sprockets/v3.0/f5/f5SXLtaZpoKUrBhYyANene_B0pZh4Fs3q0qsnYI17Ss.cache +0 -0
  384. data/test/dummy/tmp/cache/assets/sprockets/v3.0/fB/fBypaaSqpls1GcwwQ4HclPsG-XOKuoI2VyzNufjyfnU.cache +0 -0
  385. data/test/dummy/tmp/cache/assets/sprockets/v3.0/fO/fOMwhE_LoK6PBz43rr86imRHqStpfn-j0zKwNCEFA7A.cache +0 -0
  386. data/test/dummy/tmp/cache/assets/sprockets/v3.0/fq/fqzJZ9XDtHWdf_SrXg-T7l6O2NtlSoC1dgRq3w8nbqg.cache +0 -1
  387. data/test/dummy/tmp/cache/assets/sprockets/v3.0/g-/g-MxLh6QZ8uqSQpzl71sOO6FhoLd-mPY9ytN3SHSd6s.cache +0 -1
  388. data/test/dummy/tmp/cache/assets/sprockets/v3.0/ga/gaONmV2vWDOfl6XOybIxlSMpcETo2PaZG3_ex6ZtSVc.cache +0 -1
  389. data/test/dummy/tmp/cache/assets/sprockets/v3.0/gs/gs1fq9lqaJbqSHx_WnrLGo_rbzlZGfhkP8OGkuumHLk.cache +0 -1
  390. data/test/dummy/tmp/cache/assets/sprockets/v3.0/ja/jaQH1tnuMWObXXMX988ejVTiawMvE6L76842FrwIIS0.cache +0 -0
  391. data/test/dummy/tmp/cache/assets/sprockets/v3.0/js/js7jNKdNVyNNYQRxeDp0KoAh7sdYoveaQVNQkBuXDe8.cache +0 -0
  392. data/test/dummy/tmp/cache/assets/sprockets/v3.0/k9/k9YO1Qb-Ja2eQJEc_LqqaYiR2Jk9c73e_1u85EyYEUw.cache +0 -0
  393. data/test/dummy/tmp/cache/assets/sprockets/v3.0/kO/kOJdTGjX5wCNUqYrGe6jxPS2lw1-T90j87elJ6HlVR0.cache +0 -1
  394. data/test/dummy/tmp/cache/assets/sprockets/v3.0/kR/kRo_i8ixuzuziAXr-0X5Sv-pJtnyCokfgOS-jCbF9Wk.cache +0 -0
  395. data/test/dummy/tmp/cache/assets/sprockets/v3.0/lD/lDZ1BHw5ItAbM7e0LAXXg3wMOJvdtj1ynrdiQ99qoko.cache +0 -0
  396. data/test/dummy/tmp/cache/assets/sprockets/v3.0/lm/lmszFoPAF57gCrLseYD8wvbThDi_j0Ys3R-AygQjuhM.cache +0 -1
  397. data/test/dummy/tmp/cache/assets/sprockets/v3.0/lw/lwMDtxzgforpVTNvcnw_xXMixHfXTfsgUIgFKltZutw.cache +0 -0
  398. data/test/dummy/tmp/cache/assets/sprockets/v3.0/ly/lY6Xiq4wNrMhr1GiQOrtNKSaPhpnCMgjPNSi3ZN51mk.cache +0 -0
  399. data/test/dummy/tmp/cache/assets/sprockets/v3.0/ly/lyDeyCTO3D1TCcPpMAEsrpHgWH6AspQwFnGKOHzrH7Y.cache +0 -1
  400. data/test/dummy/tmp/cache/assets/sprockets/v3.0/mD/mDLr1lrD6WgTt48gRX8tF51GnjLshUXG-Txvu-HoVsI.cache +0 -1
  401. data/test/dummy/tmp/cache/assets/sprockets/v3.0/mS/mSj21XsZvaMOK22e6ov7GZ3-YZ9_UD_go_7lA-ey7vc.cache +0 -1
  402. data/test/dummy/tmp/cache/assets/sprockets/v3.0/nR/nRXBZs1TbcYM5xyj5Qx1UBWrSNEHZVPP37R2yo2s1K8.cache +0 -1
  403. data/test/dummy/tmp/cache/assets/sprockets/v3.0/ne/nexQjB0awaxA5vRef-9hPWFgWrYosUCpVU_a0uEclmc.cache +0 -0
  404. data/test/dummy/tmp/cache/assets/sprockets/v3.0/pC/pCMBdLnOAQOsMegdUF76NAgdZrY6EJKJoW0dE_QRLY0.cache +0 -0
  405. data/test/dummy/tmp/cache/assets/sprockets/v3.0/pk/pkkfBywe4K-JsW2OeLY2g8FVj1UmXnrSljtomau_rXw.cache +0 -0
  406. data/test/dummy/tmp/cache/assets/sprockets/v3.0/qT/qTJMU6xMxg--8mAi0aRjFEuf4EPvPrkg3zoxvurjmkM.cache +0 -0
  407. data/test/dummy/tmp/cache/assets/sprockets/v3.0/qd/qdQffu_fIz8BjDX9Qm06YvRis27trrnziWOTE3Yiq_w.cache +0 -0
  408. data/test/dummy/tmp/cache/assets/sprockets/v3.0/qd/qdrmd8Ttm0KIVoULM8tCA5HpYmtgLqNAVkcJ2_a5Ckg.cache +0 -1
  409. data/test/dummy/tmp/cache/assets/sprockets/v3.0/rR/rRp2gtP0SbjQbb9XGgLRhywKVIwYztgeAq0kCl4GEd8.cache +0 -1
  410. data/test/dummy/tmp/cache/assets/sprockets/v3.0/ro/ro_7q1G-1gCLv9Of5_G0fpt1qRpdeeE-C-kOpk7xZBI.cache +0 -1
  411. data/test/dummy/tmp/cache/assets/sprockets/v3.0/s9/s9bOYlWBgcKy5os6sTFZRtrgGE5XcnF404zQra9HxmQ.cache +0 -0
  412. data/test/dummy/tmp/cache/assets/sprockets/v3.0/sT/sTn4Un1H4aTfN5GuwdM5Di6DBocGF9fbHgAPgvJklDQ.cache +0 -1
  413. data/test/dummy/tmp/cache/assets/sprockets/v3.0/sj/sjBcRn1DJs7jFTrYJPoOpLbCWPov_JYXS7uszBvJDM0.cache +0 -1
  414. data/test/dummy/tmp/cache/assets/sprockets/v3.0/uB/uBld_x-EceyLitiqDaSne4Z47i9GDiaha9ZmP-AWYN8.cache +0 -2
  415. data/test/dummy/tmp/cache/assets/sprockets/v3.0/w-/w-xtN1s7rcgQgiGPvMc0LNPFYj_lLBvsCJqtl50X0Xg.cache +0 -1
  416. data/test/dummy/tmp/cache/assets/sprockets/v3.0/wm/wm9-Heugu7FpUNf32e_mJJPtHCm50eEJfomC-oWDDUs.cache +0 -0
  417. data/test/dummy/tmp/cache/assets/sprockets/v3.0/xU/XuLQCLsgS3WU-zc1F9_WRJj1ldlUqRMWqd3o_o0TVEQ.cache +0 -0
  418. data/test/dummy/tmp/cache/assets/sprockets/v3.0/xU/xU9JSYkEQI0cWQhhaxMThnNrqVnYZPI9pCNEdf96xNg.cache +0 -0
  419. data/test/dummy/tmp/cache/assets/sprockets/v3.0/xg/xghgUy4QUAcMUz3tekj_NeSYQG99DVqs02ElMYUg6LU.cache +0 -1
  420. data/test/dummy/tmp/cache/assets/sprockets/v3.0/yz/yZ4rknNFFykgsDGpns_JhcT__AR_qbf4mGZEy8vSrtM.cache +0 -1
  421. data/test/dummy/tmp/cache/assets/sprockets/v3.0/yz/yzg9_Tpun3ZssXl9nCyYEOEQmK9FHcYZlqPYlNwmEAc.cache +0 -1
  422. data/test/dummy/tmp/cache/assets/sprockets/v3.0/z0/z0teEXFifx1LtInSms4WF41wGZ5nBI3ogYR7Acyip6w.cache +0 -1
  423. data/test/dummy/tmp/cache/assets/sprockets/v3.0/z4/z47xsrpJjs8d1MIm1r57yADNit604olUHS2D0MYBrxs.cache +0 -1
  424. data/test/dummy/tmp/cache/assets/sprockets/v3.0/zX/zXTZrbZQWUzxCxfLbWxzNflWnJHwvg9GD7VbAv4Rz_A.cache +0 -0
@@ -1,1033 +0,0 @@
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);