jekyll-theme-hydejack 7.5.2 → 8.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (328) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.md +1 -4
  3. data/README.md +139 -86
  4. data/_includes/body/analytics.html +36 -0
  5. data/_includes/{comments.html → body/comments.html} +0 -0
  6. data/_includes/{footer.html → body/footer.html} +4 -2
  7. data/_includes/body/index.html +22 -0
  8. data/_includes/body/main.html +18 -0
  9. data/_includes/{menu.html → body/menu.html} +1 -0
  10. data/_includes/{nav.html → body/nav.html} +0 -0
  11. data/_includes/body/scripts.html +22 -0
  12. data/_includes/{sidebar.html → body/sidebar.html} +19 -6
  13. data/_includes/{about.html → components/about.html} +1 -1
  14. data/_includes/{author.html → components/author.html} +3 -3
  15. data/_includes/{avatar-tag.html → components/avatar-tag.html} +0 -0
  16. data/_includes/{srcset-img.html → components/hy-img.html} +24 -8
  17. data/_includes/{link.html → components/link.html} +0 -0
  18. data/_includes/{message.html → components/message.html} +0 -0
  19. data/_includes/{pagination.html → components/pagination.html} +2 -2
  20. data/_includes/{post-list-item.html → components/post-list-item.html} +0 -0
  21. data/_includes/{post.html → components/post.html} +21 -10
  22. data/_includes/{related-posts.html → components/related-posts.html} +1 -1
  23. data/_includes/components/social-list-item.html +40 -0
  24. data/_includes/components/social.html +23 -0
  25. data/_includes/{tag-list.html → components/tag-list.html} +0 -0
  26. data/_includes/head/index.html +9 -0
  27. data/_includes/head/links.html +7 -5
  28. data/_includes/head/meta.html +3 -3
  29. data/_includes/{page-style.html → head/page-style.html} +1 -1
  30. data/_includes/head/scripts.html +10 -39
  31. data/_includes/head/styles.html +42 -15
  32. data/_includes/header.txt +1 -1
  33. data/_includes/my-body.html +42 -0
  34. data/_includes/my-scripts.html +55 -0
  35. data/_includes/scripts/load-js.js +60 -0
  36. data/_includes/scripts/load-js.min.js +1 -0
  37. data/_includes/{smart-url → smart-url.txt} +0 -0
  38. data/_includes/styles/inline.scss +15 -19
  39. data/_includes/styles/style.scss +20 -17
  40. data/_includes/templates/animation.html +1 -1
  41. data/_includes/templates/back.html +1 -1
  42. data/_includes/templates/cookies-banner.html +1 -1
  43. data/_includes/templates/error.html +1 -1
  44. data/_includes/{templates.html → templates/index.html} +1 -2
  45. data/_includes/templates/loading.html +1 -1
  46. data/_includes/templates/permalink.html +1 -1
  47. data/_layouts/about.html +29 -30
  48. data/_layouts/base.html +20 -62
  49. data/_layouts/blog.html +20 -22
  50. data/_layouts/compress.html +1 -1
  51. data/_layouts/default.html +13 -18
  52. data/_layouts/home.html +11 -16
  53. data/_layouts/list.html +13 -18
  54. data/_layouts/not-found.html +11 -16
  55. data/_layouts/page.html +12 -17
  56. data/_layouts/post.html +15 -20
  57. data/_layouts/redirect.html +11 -16
  58. data/_sass/_mixins.scss +10 -15
  59. data/_sass/_spinner.scss +10 -15
  60. data/_sass/_variables.scss +35 -19
  61. data/_sass/hydejack/__inline/_avatar.scss +33 -32
  62. data/_sass/hydejack/__inline/_base.scss +30 -68
  63. data/_sass/hydejack/__inline/_break-layout.scss +19 -26
  64. data/_sass/hydejack/__inline/_content.scss +29 -34
  65. data/_sass/hydejack/__inline/_footer.scss +19 -26
  66. data/_sass/hydejack/__inline/_images.scss +38 -0
  67. data/_sass/hydejack/__inline/_katex.scss +19 -26
  68. data/_sass/hydejack/__inline/_links.scss +45 -0
  69. data/_sass/hydejack/__inline/_mark-external.scss +19 -26
  70. data/_sass/hydejack/__inline/_menu.scss +28 -35
  71. data/_sass/hydejack/__inline/_sidebar.scss +76 -76
  72. data/_sass/hydejack/__inline/_social.scss +25 -31
  73. data/_sass/hydejack/__inline/_utilities.scss +42 -0
  74. data/_sass/hydejack/__link/_avatar.scss +29 -28
  75. data/_sass/hydejack/__link/_base.scss +19 -83
  76. data/_sass/hydejack/__link/_break-layout.scss +35 -34
  77. data/_sass/hydejack/__link/_content.scss +19 -26
  78. data/_sass/hydejack/__link/_footer.scss +19 -26
  79. data/_sass/hydejack/__link/_images.scss +84 -0
  80. data/_sass/hydejack/__link/_katex.scss +19 -26
  81. data/_sass/hydejack/__link/_links.scss +53 -0
  82. data/_sass/hydejack/__link/_mark-external.scss +19 -26
  83. data/_sass/hydejack/__link/_menu.scss +29 -50
  84. data/_sass/hydejack/__link/_sidebar.scss +71 -118
  85. data/_sass/hydejack/__link/_social.scss +19 -26
  86. data/_sass/hydejack/__link/_utilities.scss +51 -0
  87. data/_sass/hydejack/_avatar.pre.scss +26 -20
  88. data/_sass/hydejack/_base.pre.scss +22 -88
  89. data/_sass/hydejack/_break-layout.pre.scss +26 -23
  90. data/_sass/hydejack/_content.pre.scss +20 -23
  91. data/_sass/hydejack/_footer.pre.scss +10 -15
  92. data/_sass/hydejack/_images.pre.scss +77 -0
  93. data/_sass/hydejack/_katex.pre.scss +10 -15
  94. data/_sass/hydejack/_links.pre.scss +47 -0
  95. data/_sass/hydejack/_mark-external.pre.scss +10 -15
  96. data/_sass/hydejack/_menu.pre.scss +31 -38
  97. data/_sass/hydejack/_sidebar.pre.scss +98 -116
  98. data/_sass/hydejack/_social.pre.scss +16 -20
  99. data/_sass/hydejack/_utilities.pre.scss +43 -0
  100. data/_sass/my-variables.scss +0 -8
  101. data/_sass/pooleparty/__inline/_base.scss +19 -28
  102. data/_sass/pooleparty/__inline/_code.scss +19 -26
  103. data/_sass/pooleparty/__inline/_footer.scss +19 -26
  104. data/_sass/pooleparty/__inline/_footnotes.scss +19 -26
  105. data/_sass/pooleparty/__inline/_message.scss +19 -26
  106. data/_sass/pooleparty/__inline/_pagination.scss +19 -26
  107. data/_sass/pooleparty/__inline/_posts.scss +19 -26
  108. data/_sass/pooleparty/__inline/_read-more.scss +25 -0
  109. data/_sass/pooleparty/__inline/_related.scss +19 -26
  110. data/_sass/pooleparty/__inline/_table.scss +19 -26
  111. data/_sass/pooleparty/__inline/_type.scss +25 -39
  112. data/_sass/pooleparty/__link/_base.scss +19 -26
  113. data/_sass/pooleparty/__link/_code.scss +19 -26
  114. data/_sass/pooleparty/__link/_footer.scss +19 -26
  115. data/_sass/pooleparty/__link/_footnotes.scss +30 -26
  116. data/_sass/pooleparty/__link/_message.scss +19 -26
  117. data/_sass/pooleparty/__link/_pagination.scss +19 -26
  118. data/_sass/pooleparty/__link/_posts.scss +20 -27
  119. data/_sass/pooleparty/__link/_read-more.scss +45 -0
  120. data/_sass/pooleparty/__link/_related.scss +19 -26
  121. data/_sass/pooleparty/__link/_table.scss +19 -26
  122. data/_sass/pooleparty/__link/_type.scss +27 -48
  123. data/_sass/pooleparty/_base.pre.scss +10 -17
  124. data/_sass/pooleparty/_code.pre.scss +10 -15
  125. data/_sass/pooleparty/_footer.pre.scss +10 -15
  126. data/_sass/pooleparty/_footnotes.pre.scss +21 -15
  127. data/_sass/pooleparty/_message.pre.scss +10 -15
  128. data/_sass/pooleparty/_pagination.pre.scss +10 -15
  129. data/_sass/pooleparty/_posts.pre.scss +11 -16
  130. data/_sass/pooleparty/_read-more.pre.scss +36 -0
  131. data/_sass/pooleparty/_related.pre.scss +10 -15
  132. data/_sass/pooleparty/_table.pre.scss +10 -15
  133. data/_sass/pooleparty/_type.pre.scss +24 -50
  134. data/assets/Resume.pdf +0 -0
  135. data/assets/bower.json +3 -3
  136. data/assets/bower_components/fontfaceobserver/.bower.json +33 -0
  137. data/assets/bower_components/fontfaceobserver/.gitignore +2 -0
  138. data/assets/bower_components/fontfaceobserver/.travis.yml +16 -0
  139. data/assets/bower_components/fontfaceobserver/Gruntfile.js +101 -0
  140. data/assets/bower_components/fontfaceobserver/LICENSE +23 -0
  141. data/assets/bower_components/fontfaceobserver/bower.json +22 -0
  142. data/assets/bower_components/fontfaceobserver/exports.js +8 -0
  143. data/assets/bower_components/fontfaceobserver/externs-commonjs.js +10 -0
  144. data/assets/bower_components/fontfaceobserver/externs.js +15 -0
  145. data/assets/bower_components/fontfaceobserver/fontfaceobserver.js +12 -0
  146. data/assets/bower_components/fontfaceobserver/fontfaceobserver.standalone.js +8 -0
  147. data/assets/bower_components/fontfaceobserver/package.json +57 -0
  148. data/assets/bower_components/fontfaceobserver/src/descriptors.js +10 -0
  149. data/assets/bower_components/fontfaceobserver/src/observer.js +349 -0
  150. data/assets/bower_components/fontfaceobserver/src/ruler.js +130 -0
  151. data/assets/bower_components/fontfaceobserver/test/assets/index.html +8 -0
  152. data/assets/bower_components/fontfaceobserver/test/assets/late.css +1 -0
  153. data/assets/bower_components/fontfaceobserver/test/assets/sourcesanspro-regular.eot +0 -0
  154. data/assets/bower_components/fontfaceobserver/test/assets/sourcesanspro-regular.ttf +0 -0
  155. data/assets/bower_components/fontfaceobserver/test/assets/sourcesanspro-regular.woff +0 -0
  156. data/assets/bower_components/fontfaceobserver/test/assets/subset.eot +0 -0
  157. data/assets/bower_components/fontfaceobserver/test/assets/subset.ttf +0 -0
  158. data/assets/bower_components/fontfaceobserver/test/assets/subset.woff +0 -0
  159. data/assets/bower_components/fontfaceobserver/test/deps.js +5 -0
  160. data/assets/bower_components/fontfaceobserver/test/index.html +97 -0
  161. data/assets/bower_components/fontfaceobserver/test/observer-test.js +465 -0
  162. data/assets/bower_components/fontfaceobserver/test/ruler-test.js +112 -0
  163. data/assets/bower_components/fontfaceobserver/vendor/google/base.js +1489 -0
  164. data/assets/bower_components/katex/.bower.json +7 -6
  165. data/assets/bower_components/katex/dist/contrib/auto-render.js +790 -0
  166. data/assets/bower_components/katex/dist/contrib/auto-render.min.js +1 -1
  167. data/assets/bower_components/katex/dist/contrib/copy-tex.css +12 -0
  168. data/assets/bower_components/katex/dist/contrib/copy-tex.js +174 -0
  169. data/assets/bower_components/katex/dist/contrib/copy-tex.min.css +1 -0
  170. data/assets/bower_components/katex/dist/contrib/copy-tex.min.js +1 -0
  171. data/assets/bower_components/katex/dist/contrib/mathtex-script-type.js +113 -0
  172. data/assets/bower_components/katex/dist/contrib/mathtex-script-type.min.js +1 -0
  173. data/assets/bower_components/katex/dist/fonts/KaTeX_AMS-Regular.ttf +0 -0
  174. data/assets/bower_components/katex/dist/fonts/KaTeX_AMS-Regular.woff +0 -0
  175. data/assets/bower_components/katex/dist/fonts/KaTeX_AMS-Regular.woff2 +0 -0
  176. data/assets/bower_components/katex/dist/fonts/KaTeX_Caligraphic-Bold.ttf +0 -0
  177. data/assets/bower_components/katex/dist/fonts/KaTeX_Caligraphic-Bold.woff +0 -0
  178. data/assets/bower_components/katex/dist/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
  179. data/assets/bower_components/katex/dist/fonts/KaTeX_Caligraphic-Regular.ttf +0 -0
  180. data/assets/bower_components/katex/dist/fonts/KaTeX_Caligraphic-Regular.woff +0 -0
  181. data/assets/bower_components/katex/dist/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
  182. data/assets/bower_components/katex/dist/fonts/KaTeX_Fraktur-Bold.ttf +0 -0
  183. data/assets/bower_components/katex/dist/fonts/KaTeX_Fraktur-Bold.woff +0 -0
  184. data/assets/bower_components/katex/dist/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
  185. data/assets/bower_components/katex/dist/fonts/KaTeX_Fraktur-Regular.ttf +0 -0
  186. data/assets/bower_components/katex/dist/fonts/KaTeX_Fraktur-Regular.woff +0 -0
  187. data/assets/bower_components/katex/dist/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
  188. data/assets/bower_components/katex/dist/fonts/KaTeX_Main-Bold.ttf +0 -0
  189. data/assets/bower_components/katex/dist/fonts/KaTeX_Main-Bold.woff +0 -0
  190. data/assets/bower_components/katex/dist/fonts/KaTeX_Main-Bold.woff2 +0 -0
  191. data/assets/bower_components/katex/dist/fonts/KaTeX_Main-BoldItalic.ttf +0 -0
  192. data/assets/bower_components/katex/dist/fonts/KaTeX_Main-BoldItalic.woff +0 -0
  193. data/assets/bower_components/katex/dist/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
  194. data/assets/bower_components/katex/dist/fonts/KaTeX_Main-Italic.ttf +0 -0
  195. data/assets/bower_components/katex/dist/fonts/KaTeX_Main-Italic.woff +0 -0
  196. data/assets/bower_components/katex/dist/fonts/KaTeX_Main-Italic.woff2 +0 -0
  197. data/assets/bower_components/katex/dist/fonts/KaTeX_Main-Regular.ttf +0 -0
  198. data/assets/bower_components/katex/dist/fonts/KaTeX_Main-Regular.woff +0 -0
  199. data/assets/bower_components/katex/dist/fonts/KaTeX_Main-Regular.woff2 +0 -0
  200. data/assets/bower_components/katex/dist/fonts/KaTeX_Math-Italic.ttf +0 -0
  201. data/assets/bower_components/katex/dist/fonts/KaTeX_Math-Italic.woff +0 -0
  202. data/assets/bower_components/katex/dist/fonts/KaTeX_Math-Italic.woff2 +0 -0
  203. data/assets/bower_components/katex/dist/fonts/KaTeX_SansSerif-Bold.ttf +0 -0
  204. data/assets/bower_components/katex/dist/fonts/KaTeX_SansSerif-Bold.woff +0 -0
  205. data/assets/bower_components/katex/dist/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
  206. data/assets/bower_components/katex/dist/fonts/KaTeX_SansSerif-Italic.ttf +0 -0
  207. data/assets/bower_components/katex/dist/fonts/KaTeX_SansSerif-Italic.woff +0 -0
  208. data/assets/bower_components/katex/dist/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
  209. data/assets/bower_components/katex/dist/fonts/KaTeX_SansSerif-Regular.ttf +0 -0
  210. data/assets/bower_components/katex/dist/fonts/KaTeX_SansSerif-Regular.woff +0 -0
  211. data/assets/bower_components/katex/dist/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
  212. data/assets/bower_components/katex/dist/fonts/KaTeX_Script-Regular.ttf +0 -0
  213. data/assets/bower_components/katex/dist/fonts/KaTeX_Script-Regular.woff +0 -0
  214. data/assets/bower_components/katex/dist/fonts/KaTeX_Script-Regular.woff2 +0 -0
  215. data/assets/bower_components/katex/dist/fonts/KaTeX_Size1-Regular.ttf +0 -0
  216. data/assets/bower_components/katex/dist/fonts/KaTeX_Size1-Regular.woff +0 -0
  217. data/assets/bower_components/katex/dist/fonts/KaTeX_Size1-Regular.woff2 +0 -0
  218. data/assets/bower_components/katex/dist/fonts/KaTeX_Size2-Regular.ttf +0 -0
  219. data/assets/bower_components/katex/dist/fonts/KaTeX_Size2-Regular.woff +0 -0
  220. data/assets/bower_components/katex/dist/fonts/KaTeX_Size2-Regular.woff2 +0 -0
  221. data/assets/bower_components/katex/dist/fonts/KaTeX_Size3-Regular.ttf +0 -0
  222. data/assets/bower_components/katex/dist/fonts/KaTeX_Size3-Regular.woff +0 -0
  223. data/assets/bower_components/katex/dist/fonts/KaTeX_Size3-Regular.woff2 +0 -0
  224. data/assets/bower_components/katex/dist/fonts/KaTeX_Size4-Regular.ttf +0 -0
  225. data/assets/bower_components/katex/dist/fonts/KaTeX_Size4-Regular.woff +0 -0
  226. data/assets/bower_components/katex/dist/fonts/KaTeX_Size4-Regular.woff2 +0 -0
  227. data/assets/bower_components/katex/dist/fonts/KaTeX_Typewriter-Regular.ttf +0 -0
  228. data/assets/bower_components/katex/dist/fonts/KaTeX_Typewriter-Regular.woff +0 -0
  229. data/assets/bower_components/katex/dist/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
  230. data/assets/bower_components/katex/dist/katex.css +129 -209
  231. data/assets/bower_components/katex/dist/katex.js +14381 -9023
  232. data/assets/bower_components/katex/dist/katex.min.css +1 -1
  233. data/assets/bower_components/katex/dist/katex.min.js +1 -6
  234. data/assets/bower_components/katex/flow-typed/match-at.js +3 -0
  235. data/assets/bower_components/katex/flow-typed/object-assign.js +6 -0
  236. data/assets/bower_components/katex/package-lock.json +13848 -0
  237. data/assets/css/hydejack-8.0.0.css +3 -0
  238. data/assets/img/default-1.jpg +0 -0
  239. data/assets/img/example-content-ii.jpg +0 -0
  240. data/assets/img/example-content-iii.jpg +0 -0
  241. data/assets/img/hydejack-8.jpg +0 -0
  242. data/assets/img/hydejack-8@0,25x.jpg +0 -0
  243. data/assets/img/hydejack-8@0,5x.jpg +0 -0
  244. data/assets/img/projects/hy-drawer.svg +12 -0
  245. data/assets/img/projects/hy-img.svg +17 -0
  246. data/assets/img/projects/hy-push-state.svg +13 -0
  247. data/assets/img/resume.png +0 -0
  248. data/assets/img/sidebar-bg.jpg +0 -0
  249. data/assets/img/swipe.svg +22 -0
  250. data/assets/img/w3m.png +0 -0
  251. data/assets/js/hydejack-8.0.0.js +46 -0
  252. data/assets/js/sw.js +318 -0
  253. data/assets/manifest.json +4 -3
  254. data/assets/version.json +1 -1
  255. data/licenses/Apache-2.0.md +1 -4
  256. data/licenses/GPL-3.0.md +1 -4
  257. data/licenses/MIT.md +1 -4
  258. data/licenses/PRO.md +2 -6
  259. data/licenses/README.md +10 -0
  260. data/licenses/W3C.md +31 -0
  261. metadata +107 -94
  262. data/_includes/blog.html +0 -5
  263. data/_includes/body.html +0 -25
  264. data/_includes/head.html +0 -5
  265. data/_includes/scripts/load-js-deferred.js +0 -68
  266. data/_includes/scripts/load-js-deferred.min.js +0 -1
  267. data/_includes/social-list-item.html +0 -34
  268. data/_includes/social.html +0 -20
  269. data/assets/bower_components/katex/dist/fonts/KaTeX_AMS-Regular.eot +0 -0
  270. data/assets/bower_components/katex/dist/fonts/KaTeX_Caligraphic-Bold.eot +0 -0
  271. data/assets/bower_components/katex/dist/fonts/KaTeX_Caligraphic-Regular.eot +0 -0
  272. data/assets/bower_components/katex/dist/fonts/KaTeX_Fraktur-Bold.eot +0 -0
  273. data/assets/bower_components/katex/dist/fonts/KaTeX_Fraktur-Regular.eot +0 -0
  274. data/assets/bower_components/katex/dist/fonts/KaTeX_Main-Bold.eot +0 -0
  275. data/assets/bower_components/katex/dist/fonts/KaTeX_Main-Italic.eot +0 -0
  276. data/assets/bower_components/katex/dist/fonts/KaTeX_Main-Regular.eot +0 -0
  277. data/assets/bower_components/katex/dist/fonts/KaTeX_Math-BoldItalic.eot +0 -0
  278. data/assets/bower_components/katex/dist/fonts/KaTeX_Math-BoldItalic.ttf +0 -0
  279. data/assets/bower_components/katex/dist/fonts/KaTeX_Math-BoldItalic.woff +0 -0
  280. data/assets/bower_components/katex/dist/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
  281. data/assets/bower_components/katex/dist/fonts/KaTeX_Math-Italic.eot +0 -0
  282. data/assets/bower_components/katex/dist/fonts/KaTeX_Math-Regular.eot +0 -0
  283. data/assets/bower_components/katex/dist/fonts/KaTeX_Math-Regular.ttf +0 -0
  284. data/assets/bower_components/katex/dist/fonts/KaTeX_Math-Regular.woff +0 -0
  285. data/assets/bower_components/katex/dist/fonts/KaTeX_Math-Regular.woff2 +0 -0
  286. data/assets/bower_components/katex/dist/fonts/KaTeX_SansSerif-Bold.eot +0 -0
  287. data/assets/bower_components/katex/dist/fonts/KaTeX_SansSerif-Italic.eot +0 -0
  288. data/assets/bower_components/katex/dist/fonts/KaTeX_SansSerif-Regular.eot +0 -0
  289. data/assets/bower_components/katex/dist/fonts/KaTeX_Script-Regular.eot +0 -0
  290. data/assets/bower_components/katex/dist/fonts/KaTeX_Size1-Regular.eot +0 -0
  291. data/assets/bower_components/katex/dist/fonts/KaTeX_Size2-Regular.eot +0 -0
  292. data/assets/bower_components/katex/dist/fonts/KaTeX_Size3-Regular.eot +0 -0
  293. data/assets/bower_components/katex/dist/fonts/KaTeX_Size4-Regular.eot +0 -0
  294. data/assets/bower_components/katex/dist/fonts/KaTeX_Typewriter-Regular.eot +0 -0
  295. data/assets/bower_components/webfontloader/.bower.json +0 -38
  296. data/assets/bower_components/webfontloader/CHANGELOG +0 -419
  297. data/assets/bower_components/webfontloader/Gemfile +0 -3
  298. data/assets/bower_components/webfontloader/LICENSE +0 -176
  299. data/assets/bower_components/webfontloader/Rakefile +0 -269
  300. data/assets/bower_components/webfontloader/bower.json +0 -23
  301. data/assets/bower_components/webfontloader/browsers.json +0 -133
  302. data/assets/bower_components/webfontloader/externs.js +0 -19
  303. data/assets/bower_components/webfontloader/package.json +0 -37
  304. data/assets/bower_components/webfontloader/src/closure.js +0 -2
  305. data/assets/bower_components/webfontloader/src/core/cssclassname.js +0 -46
  306. data/assets/bower_components/webfontloader/src/core/domhelper.js +0 -405
  307. data/assets/bower_components/webfontloader/src/core/eventdispatcher.js +0 -195
  308. data/assets/bower_components/webfontloader/src/core/font.js +0 -140
  309. data/assets/bower_components/webfontloader/src/core/fontmodule.js +0 -16
  310. data/assets/bower_components/webfontloader/src/core/fontmoduleloader.js +0 -47
  311. data/assets/bower_components/webfontloader/src/core/fontruler.js +0 -60
  312. data/assets/bower_components/webfontloader/src/core/fontwatcher.js +0 -171
  313. data/assets/bower_components/webfontloader/src/core/fontwatchrunner.js +0 -249
  314. data/assets/bower_components/webfontloader/src/core/initialize.js +0 -97
  315. data/assets/bower_components/webfontloader/src/core/nativefontwatchrunner.js +0 -69
  316. data/assets/bower_components/webfontloader/src/core/stylesheetwaiter.js +0 -48
  317. data/assets/bower_components/webfontloader/src/core/webfont.js +0 -97
  318. data/assets/bower_components/webfontloader/src/modules.yml +0 -34
  319. data/assets/bower_components/webfontloader/src/modules/custom.js +0 -63
  320. data/assets/bower_components/webfontloader/src/modules/fontdeck.js +0 -66
  321. data/assets/bower_components/webfontloader/src/modules/google/fontapiparser.js +0 -181
  322. data/assets/bower_components/webfontloader/src/modules/google/fontapiurlbuilder.js +0 -77
  323. data/assets/bower_components/webfontloader/src/modules/google/googlefontapi.js +0 -54
  324. data/assets/bower_components/webfontloader/src/modules/monotype.js +0 -110
  325. data/assets/bower_components/webfontloader/src/modules/typekit.js +0 -73
  326. data/assets/bower_components/webfontloader/webfontloader.gemspec +0 -191
  327. data/assets/bower_components/webfontloader/webfontloader.js +0 -17
  328. data/assets/js/hydejack-7.5.2.js +0 -249
@@ -0,0 +1,112 @@
1
+ describe('Ruler', function () {
2
+ var Ruler = fontface.Ruler,
3
+ ruler = null;
4
+
5
+ beforeEach(function () {
6
+ ruler = new Ruler('hello');
7
+ ruler.setFont('', '');
8
+ ruler.setWidth(100);
9
+ document.body.appendChild(ruler.getElement());
10
+ });
11
+
12
+ afterEach(function () {
13
+ document.body.removeChild(ruler.getElement());
14
+ ruler = null;
15
+ });
16
+
17
+ describe('#constructor', function () {
18
+ it('creates a new instance with the correct signature', function () {
19
+ expect(ruler, 'not to be', null);
20
+ expect(ruler.onResize, 'to be a function');
21
+ expect(ruler.setFont, 'to be a function');
22
+ });
23
+ });
24
+
25
+ describe('#onResize', function () {
26
+ it('detects expansion', function (done) {
27
+ ruler.onResize(function (width) {
28
+ expect(width, 'to equal', 200);
29
+ done();
30
+ });
31
+
32
+ ruler.setWidth(200);
33
+ });
34
+
35
+ it('detects multiple expansions', function (done) {
36
+ var first = true;
37
+
38
+ ruler.onResize(function (width) {
39
+ if (first) {
40
+ expect(width, 'to equal', 200);
41
+ ruler.setWidth(300);
42
+ first = false;
43
+ } else {
44
+ expect(width, 'to equal', 300);
45
+ done();
46
+ }
47
+ });
48
+
49
+ ruler.setWidth(200);
50
+ });
51
+
52
+ it('detects collapse', function (done) {
53
+ ruler.onResize(function (width) {
54
+ expect(width, 'to equal', 50);
55
+ done();
56
+ });
57
+
58
+ ruler.setWidth(50);
59
+ });
60
+
61
+ it('detects multiple collapses', function (done) {
62
+ var first = true;
63
+
64
+ ruler.onResize(function (width) {
65
+ if (first) {
66
+ expect(width, 'to equal', 70);
67
+ ruler.setWidth(50);
68
+ first = false;
69
+ } else {
70
+ expect(width, 'to equal', 50);
71
+ done();
72
+ }
73
+ });
74
+
75
+ ruler.setWidth(70);
76
+ });
77
+
78
+ it('detects a collapse and an expansion', function (done) {
79
+ var first = true;
80
+
81
+ ruler.onResize(function (width) {
82
+ if (first) {
83
+ expect(width, 'to equal', 70);
84
+ ruler.setWidth(100);
85
+ first = false;
86
+ } else {
87
+ expect(width, 'to equal', 100);
88
+ done();
89
+ }
90
+ });
91
+
92
+ ruler.setWidth(70);
93
+ });
94
+
95
+ it('detects an expansion and a collapse', function (done) {
96
+ var first = true;
97
+
98
+ ruler.onResize(function (width) {
99
+ if (first) {
100
+ expect(width, 'to equal', 200);
101
+ ruler.setWidth(100);
102
+ first = false;
103
+ } else {
104
+ expect(width, 'to equal', 100);
105
+ done();
106
+ }
107
+ });
108
+
109
+ ruler.setWidth(200);
110
+ });
111
+ });
112
+ });
@@ -0,0 +1,1489 @@
1
+ // Copyright 2006 The Closure Library Authors. All Rights Reserved.
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS-IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ /**
16
+ * @fileoverview Bootstrap for the Google JS Library (Closure).
17
+ *
18
+ * In uncompiled mode base.js will write out Closure's deps file, unless the
19
+ * global <code>CLOSURE_NO_DEPS</code> is set to true. This allows projects to
20
+ * include their own deps file(s) from different locations.
21
+ *
22
+ *
23
+ * @provideGoog
24
+ */
25
+
26
+
27
+ /**
28
+ * @define {boolean} Overridden to true by the compiler when --closure_pass
29
+ * or --mark_as_compiled is specified.
30
+ */
31
+ var COMPILED = false;
32
+
33
+
34
+ /**
35
+ * Base namespace for the Closure library. Checks to see goog is
36
+ * already defined in the current scope before assigning to prevent
37
+ * clobbering if base.js is loaded more than once.
38
+ *
39
+ * @const
40
+ */
41
+ var goog = goog || {}; // Identifies this file as the Closure base.
42
+
43
+
44
+ /**
45
+ * Reference to the global context. In most cases this will be 'window'.
46
+ */
47
+ goog.global = window;
48
+
49
+
50
+ /**
51
+ * @define {boolean} DEBUG is provided as a convenience so that debugging code
52
+ * that should not be included in a production js_binary can be easily stripped
53
+ * by specifying --define goog.DEBUG=false to the JSCompiler. For example, most
54
+ * toString() methods should be declared inside an "if (goog.DEBUG)" conditional
55
+ * because they are generally used for debugging purposes and it is difficult
56
+ * for the JSCompiler to statically determine whether they are used.
57
+ */
58
+ goog.DEBUG = true;
59
+
60
+
61
+ /**
62
+ * @define {string} LOCALE defines the locale being used for compilation. It is
63
+ * used to select locale specific data to be compiled in js binary. BUILD rule
64
+ * can specify this value by "--define goog.LOCALE=<locale_name>" as JSCompiler
65
+ * option.
66
+ *
67
+ * Take into account that the locale code format is important. You should use
68
+ * the canonical Unicode format with hyphen as a delimiter. Language must be
69
+ * lowercase, Language Script - Capitalized, Region - UPPERCASE.
70
+ * There are few examples: pt-BR, en, en-US, sr-Latin-BO, zh-Hans-CN.
71
+ *
72
+ * See more info about locale codes here:
73
+ * http://www.unicode.org/reports/tr35/#Unicode_Language_and_Locale_Identifiers
74
+ *
75
+ * For language codes you should use values defined by ISO 693-1. See it here
76
+ * http://www.w3.org/WAI/ER/IG/ert/iso639.htm. There is only one exception from
77
+ * this rule: the Hebrew language. For legacy reasons the old code (iw) should
78
+ * be used instead of the new code (he), see http://wiki/Main/IIISynonyms.
79
+ */
80
+ goog.LOCALE = 'en'; // default to en
81
+
82
+
83
+ /**
84
+ * @define {boolean} Whether this code is running on trusted sites.
85
+ *
86
+ * On untrusted sites, several native functions can be defined or overridden by
87
+ * external libraries like Prototype, Datejs, and JQuery and setting this flag
88
+ * to false forces closure to use its own implementations when possible.
89
+ *
90
+ * If your javascript can be loaded by a third party site and you are wary about
91
+ * relying on non-standard implementations, specify
92
+ * "--define goog.TRUSTED_SITE=false" to the JSCompiler.
93
+ */
94
+ goog.TRUSTED_SITE = true;
95
+
96
+
97
+ /**
98
+ * Creates object stubs for a namespace. The presence of one or more
99
+ * goog.provide() calls indicate that the file defines the given
100
+ * objects/namespaces. Build tools also scan for provide/require statements
101
+ * to discern dependencies, build dependency files (see deps.js), etc.
102
+ * @see goog.require
103
+ * @param {string} name Namespace provided by this file in the form
104
+ * "goog.package.part".
105
+ */
106
+ goog.provide = function(name) {
107
+ if (!COMPILED) {
108
+ // Ensure that the same namespace isn't provided twice. This is intended
109
+ // to teach new developers that 'goog.provide' is effectively a variable
110
+ // declaration. And when JSCompiler transforms goog.provide into a real
111
+ // variable declaration, the compiled JS should work the same as the raw
112
+ // JS--even when the raw JS uses goog.provide incorrectly.
113
+ if (goog.isProvided_(name)) {
114
+ throw Error('Namespace "' + name + '" already declared.');
115
+ }
116
+ delete goog.implicitNamespaces_[name];
117
+
118
+ var namespace = name;
119
+ while ((namespace = namespace.substring(0, namespace.lastIndexOf('.')))) {
120
+ if (goog.getObjectByName(namespace)) {
121
+ break;
122
+ }
123
+ goog.implicitNamespaces_[namespace] = true;
124
+ }
125
+ }
126
+
127
+ goog.exportPath_(name);
128
+ };
129
+
130
+
131
+ /**
132
+ * Marks that the current file should only be used for testing, and never for
133
+ * live code in production.
134
+ * @param {string=} opt_message Optional message to add to the error that's
135
+ * raised when used in production code.
136
+ */
137
+ goog.setTestOnly = function(opt_message) {
138
+ if (COMPILED && !goog.DEBUG) {
139
+ opt_message = opt_message || '';
140
+ throw Error('Importing test-only code into non-debug environment' +
141
+ opt_message ? ': ' + opt_message : '.');
142
+ }
143
+ };
144
+
145
+
146
+ if (!COMPILED) {
147
+
148
+ /**
149
+ * Check if the given name has been goog.provided. This will return false for
150
+ * names that are available only as implicit namespaces.
151
+ * @param {string} name name of the object to look for.
152
+ * @return {boolean} Whether the name has been provided.
153
+ * @private
154
+ */
155
+ goog.isProvided_ = function(name) {
156
+ return !goog.implicitNamespaces_[name] && !!goog.getObjectByName(name);
157
+ };
158
+
159
+ /**
160
+ * Namespaces implicitly defined by goog.provide. For example,
161
+ * goog.provide('goog.events.Event') implicitly declares
162
+ * that 'goog' and 'goog.events' must be namespaces.
163
+ *
164
+ * @type {Object}
165
+ * @private
166
+ */
167
+ goog.implicitNamespaces_ = {};
168
+ }
169
+
170
+
171
+ /**
172
+ * Builds an object structure for the provided namespace path,
173
+ * ensuring that names that already exist are not overwritten. For
174
+ * example:
175
+ * "a.b.c" -> a = {};a.b={};a.b.c={};
176
+ * Used by goog.provide and goog.exportSymbol.
177
+ * @param {string} name name of the object that this file defines.
178
+ * @param {*=} opt_object the object to expose at the end of the path.
179
+ * @param {Object=} opt_objectToExportTo The object to add the path to; default
180
+ * is |goog.global|.
181
+ * @private
182
+ */
183
+ goog.exportPath_ = function(name, opt_object, opt_objectToExportTo) {
184
+ var parts = name.split('.');
185
+ var cur = opt_objectToExportTo || goog.global;
186
+
187
+ // Internet Explorer exhibits strange behavior when throwing errors from
188
+ // methods externed in this manner. See the testExportSymbolExceptions in
189
+ // base_test.html for an example.
190
+ if (!(parts[0] in cur) && cur.execScript) {
191
+ cur.execScript('var ' + parts[0]);
192
+ }
193
+
194
+ // Certain browsers cannot parse code in the form for((a in b); c;);
195
+ // This pattern is produced by the JSCompiler when it collapses the
196
+ // statement above into the conditional loop below. To prevent this from
197
+ // happening, use a for-loop and reserve the init logic as below.
198
+
199
+ // Parentheses added to eliminate strict JS warning in Firefox.
200
+ for (var part; parts.length && (part = parts.shift());) {
201
+ if (!parts.length && goog.isDef(opt_object)) {
202
+ // last part and we have an object; use it
203
+ cur[part] = opt_object;
204
+ } else if (cur[part]) {
205
+ cur = cur[part];
206
+ } else {
207
+ cur = cur[part] = {};
208
+ }
209
+ }
210
+ };
211
+
212
+
213
+ /**
214
+ * Returns an object based on its fully qualified external name. If you are
215
+ * using a compilation pass that renames property names beware that using this
216
+ * function will not find renamed properties.
217
+ *
218
+ * @param {string} name The fully qualified name.
219
+ * @param {Object=} opt_obj The object within which to look; default is
220
+ * |goog.global|.
221
+ * @return {?} The value (object or primitive) or, if not found, null.
222
+ */
223
+ goog.getObjectByName = function(name, opt_obj) {
224
+ var parts = name.split('.');
225
+ var cur = opt_obj || goog.global;
226
+ for (var part; part = parts.shift(); ) {
227
+ if (goog.isDefAndNotNull(cur[part])) {
228
+ cur = cur[part];
229
+ } else {
230
+ return null;
231
+ }
232
+ }
233
+ return cur;
234
+ };
235
+
236
+
237
+ /**
238
+ * Globalizes a whole namespace, such as goog or goog.lang.
239
+ *
240
+ * @param {Object} obj The namespace to globalize.
241
+ * @param {Object=} opt_global The object to add the properties to.
242
+ * @deprecated Properties may be explicitly exported to the global scope, but
243
+ * this should no longer be done in bulk.
244
+ */
245
+ goog.globalize = function(obj, opt_global) {
246
+ var global = opt_global || goog.global;
247
+ for (var x in obj) {
248
+ global[x] = obj[x];
249
+ }
250
+ };
251
+
252
+
253
+ /**
254
+ * Adds a dependency from a file to the files it requires.
255
+ * @param {string} relPath The path to the js file.
256
+ * @param {Array} provides An array of strings with the names of the objects
257
+ * this file provides.
258
+ * @param {Array} requires An array of strings with the names of the objects
259
+ * this file requires.
260
+ */
261
+ goog.addDependency = function(relPath, provides, requires) {
262
+ if (!COMPILED) {
263
+ var provide, require;
264
+ var path = relPath.replace(/\\/g, '/');
265
+ var deps = goog.dependencies_;
266
+ for (var i = 0; provide = provides[i]; i++) {
267
+ deps.nameToPath[provide] = path;
268
+ if (!(path in deps.pathToNames)) {
269
+ deps.pathToNames[path] = {};
270
+ }
271
+ deps.pathToNames[path][provide] = true;
272
+ }
273
+ for (var j = 0; require = requires[j]; j++) {
274
+ if (!(path in deps.requires)) {
275
+ deps.requires[path] = {};
276
+ }
277
+ deps.requires[path][require] = true;
278
+ }
279
+ }
280
+ };
281
+
282
+
283
+
284
+
285
+ // NOTE(nnaze): The debug DOM loader was included in base.js as an orignal
286
+ // way to do "debug-mode" development. The dependency system can sometimes
287
+ // be confusing, as can the debug DOM loader's asyncronous nature.
288
+ //
289
+ // With the DOM loader, a call to goog.require() is not blocking -- the
290
+ // script will not load until some point after the current script. If a
291
+ // namespace is needed at runtime, it needs to be defined in a previous
292
+ // script, or loaded via require() with its registered dependencies.
293
+ // User-defined namespaces may need their own deps file. See http://go/js_deps,
294
+ // http://go/genjsdeps, or, externally, DepsWriter.
295
+ // http://code.google.com/closure/library/docs/depswriter.html
296
+ //
297
+ // Because of legacy clients, the DOM loader can't be easily removed from
298
+ // base.js. Work is being done to make it disableable or replaceable for
299
+ // different environments (DOM-less JavaScript interpreters like Rhino or V8,
300
+ // for example). See bootstrap/ for more information.
301
+
302
+
303
+ /**
304
+ * @define {boolean} Whether to enable the debug loader.
305
+ *
306
+ * If enabled, a call to goog.require() will attempt to load the namespace by
307
+ * appending a script tag to the DOM (if the namespace has been registered).
308
+ *
309
+ * If disabled, goog.require() will simply assert that the namespace has been
310
+ * provided (and depend on the fact that some outside tool correctly ordered
311
+ * the script).
312
+ */
313
+ goog.ENABLE_DEBUG_LOADER = true;
314
+
315
+
316
+ /**
317
+ * Implements a system for the dynamic resolution of dependencies
318
+ * that works in parallel with the BUILD system. Note that all calls
319
+ * to goog.require will be stripped by the JSCompiler when the
320
+ * --closure_pass option is used.
321
+ * @see goog.provide
322
+ * @param {string} name Namespace to include (as was given in goog.provide())
323
+ * in the form "goog.package.part".
324
+ */
325
+ goog.require = function(name) {
326
+
327
+ // if the object already exists we do not need do do anything
328
+ // TODO(arv): If we start to support require based on file name this has
329
+ // to change
330
+ // TODO(arv): If we allow goog.foo.* this has to change
331
+ // TODO(arv): If we implement dynamic load after page load we should probably
332
+ // not remove this code for the compiled output
333
+ if (!COMPILED) {
334
+ if (goog.isProvided_(name)) {
335
+ return;
336
+ }
337
+
338
+ if (goog.ENABLE_DEBUG_LOADER) {
339
+ var path = goog.getPathFromDeps_(name);
340
+ if (path) {
341
+ goog.included_[path] = true;
342
+ goog.writeScripts_();
343
+ return;
344
+ }
345
+ }
346
+
347
+ var errorMessage = 'goog.require could not find: ' + name;
348
+ if (goog.global.console) {
349
+ goog.global.console['error'](errorMessage);
350
+ }
351
+
352
+
353
+ throw Error(errorMessage);
354
+
355
+ }
356
+ };
357
+
358
+
359
+ /**
360
+ * Path for included scripts
361
+ * @type {string}
362
+ */
363
+ goog.basePath = '';
364
+
365
+
366
+ /**
367
+ * A hook for overriding the base path.
368
+ * @type {string|undefined}
369
+ */
370
+ goog.global.CLOSURE_BASE_PATH;
371
+
372
+
373
+ /**
374
+ * Whether to write out Closure's deps file. By default,
375
+ * the deps are written.
376
+ * @type {boolean|undefined}
377
+ */
378
+ goog.global.CLOSURE_NO_DEPS;
379
+
380
+
381
+ /**
382
+ * A function to import a single script. This is meant to be overridden when
383
+ * Closure is being run in non-HTML contexts, such as web workers. It's defined
384
+ * in the global scope so that it can be set before base.js is loaded, which
385
+ * allows deps.js to be imported properly.
386
+ *
387
+ * The function is passed the script source, which is a relative URI. It should
388
+ * return true if the script was imported, false otherwise.
389
+ */
390
+ goog.global.CLOSURE_IMPORT_SCRIPT;
391
+
392
+
393
+ /**
394
+ * Null function used for default values of callbacks, etc.
395
+ * @return {void} Nothing.
396
+ */
397
+ goog.nullFunction = function() {};
398
+
399
+
400
+ /**
401
+ * The identity function. Returns its first argument.
402
+ *
403
+ * @param {*=} opt_returnValue The single value that will be returned.
404
+ * @param {...*} var_args Optional trailing arguments. These are ignored.
405
+ * @return {?} The first argument. We can't know the type -- just pass it along
406
+ * without type.
407
+ * @deprecated Use goog.functions.identity instead.
408
+ */
409
+ goog.identityFunction = function(opt_returnValue, var_args) {
410
+ return opt_returnValue;
411
+ };
412
+
413
+
414
+ /**
415
+ * When defining a class Foo with an abstract method bar(), you can do:
416
+ *
417
+ * Foo.prototype.bar = goog.abstractMethod
418
+ *
419
+ * Now if a subclass of Foo fails to override bar(), an error
420
+ * will be thrown when bar() is invoked.
421
+ *
422
+ * Note: This does not take the name of the function to override as
423
+ * an argument because that would make it more difficult to obfuscate
424
+ * our JavaScript code.
425
+ *
426
+ * @type {!Function}
427
+ * @throws {Error} when invoked to indicate the method should be
428
+ * overridden.
429
+ */
430
+ goog.abstractMethod = function() {
431
+ throw Error('unimplemented abstract method');
432
+ };
433
+
434
+
435
+ /**
436
+ * Adds a {@code getInstance} static method that always return the same instance
437
+ * object.
438
+ * @param {!Function} ctor The constructor for the class to add the static
439
+ * method to.
440
+ */
441
+ goog.addSingletonGetter = function(ctor) {
442
+ ctor.getInstance = function() {
443
+ if (ctor.instance_) {
444
+ return ctor.instance_;
445
+ }
446
+ if (goog.DEBUG) {
447
+ // NOTE: JSCompiler can't optimize away Array#push.
448
+ goog.instantiatedSingletons_[goog.instantiatedSingletons_.length] = ctor;
449
+ }
450
+ return ctor.instance_ = new ctor;
451
+ };
452
+ };
453
+
454
+
455
+ /**
456
+ * All singleton classes that have been instantiated, for testing. Don't read
457
+ * it directly, use the {@code goog.testing.singleton} module. The compiler
458
+ * removes this variable if unused.
459
+ * @type {!Array.<!Function>}
460
+ * @private
461
+ */
462
+ goog.instantiatedSingletons_ = [];
463
+
464
+
465
+ if (!COMPILED && goog.ENABLE_DEBUG_LOADER) {
466
+ /**
467
+ * Object used to keep track of urls that have already been added. This
468
+ * record allows the prevention of circular dependencies.
469
+ * @type {Object}
470
+ * @private
471
+ */
472
+ goog.included_ = {};
473
+
474
+
475
+ /**
476
+ * This object is used to keep track of dependencies and other data that is
477
+ * used for loading scripts
478
+ * @private
479
+ * @type {Object}
480
+ */
481
+ goog.dependencies_ = {
482
+ pathToNames: {}, // 1 to many
483
+ nameToPath: {}, // 1 to 1
484
+ requires: {}, // 1 to many
485
+ // used when resolving dependencies to prevent us from
486
+ // visiting the file twice
487
+ visited: {},
488
+ written: {} // used to keep track of script files we have written
489
+ };
490
+
491
+
492
+ /**
493
+ * Tries to detect whether is in the context of an HTML document.
494
+ * @return {boolean} True if it looks like HTML document.
495
+ * @private
496
+ */
497
+ goog.inHtmlDocument_ = function() {
498
+ var doc = goog.global.document;
499
+ return typeof doc != 'undefined' &&
500
+ 'write' in doc; // XULDocument misses write.
501
+ };
502
+
503
+
504
+ /**
505
+ * Tries to detect the base path of the base.js script that bootstraps Closure
506
+ * @private
507
+ */
508
+ goog.findBasePath_ = function() {
509
+ if (goog.global.CLOSURE_BASE_PATH) {
510
+ goog.basePath = goog.global.CLOSURE_BASE_PATH;
511
+ return;
512
+ } else if (!goog.inHtmlDocument_()) {
513
+ return;
514
+ }
515
+ var doc = goog.global.document;
516
+ var scripts = doc.getElementsByTagName('script');
517
+ // Search backwards since the current script is in almost all cases the one
518
+ // that has base.js.
519
+ for (var i = scripts.length - 1; i >= 0; --i) {
520
+ var src = scripts[i].src;
521
+ var qmark = src.lastIndexOf('?');
522
+ var l = qmark == -1 ? src.length : qmark;
523
+ if (src.substr(l - 7, 7) == 'base.js') {
524
+ goog.basePath = src.substr(0, l - 7);
525
+ return;
526
+ }
527
+ }
528
+ };
529
+
530
+
531
+ /**
532
+ * Imports a script if, and only if, that script hasn't already been imported.
533
+ * (Must be called at execution time)
534
+ * @param {string} src Script source.
535
+ * @private
536
+ */
537
+ goog.importScript_ = function(src) {
538
+ var importScript = goog.global.CLOSURE_IMPORT_SCRIPT ||
539
+ goog.writeScriptTag_;
540
+ if (!goog.dependencies_.written[src] && importScript(src)) {
541
+ goog.dependencies_.written[src] = true;
542
+ }
543
+ };
544
+
545
+
546
+ /**
547
+ * The default implementation of the import function. Writes a script tag to
548
+ * import the script.
549
+ *
550
+ * @param {string} src The script source.
551
+ * @return {boolean} True if the script was imported, false otherwise.
552
+ * @private
553
+ */
554
+ goog.writeScriptTag_ = function(src) {
555
+ if (goog.inHtmlDocument_()) {
556
+ var doc = goog.global.document;
557
+
558
+ // If the user tries to require a new symbol after document load,
559
+ // something has gone terribly wrong. Doing a document.write would
560
+ // wipe out the page.
561
+ if (doc.readyState == 'complete') {
562
+ // Certain test frameworks load base.js multiple times, which tries
563
+ // to write deps.js each time. If that happens, just fail silently.
564
+ // These frameworks wipe the page between each load of base.js, so this
565
+ // is OK.
566
+ var isDeps = /\bdeps.js$/.test(src);
567
+ if (isDeps) {
568
+ return false;
569
+ } else {
570
+ throw Error('Cannot write "' + src + '" after document load');
571
+ }
572
+ }
573
+
574
+ doc.write(
575
+ '<script type="text/javascript" src="' + src + '"></' + 'script>');
576
+ return true;
577
+ } else {
578
+ return false;
579
+ }
580
+ };
581
+
582
+
583
+ /**
584
+ * Resolves dependencies based on the dependencies added using addDependency
585
+ * and calls importScript_ in the correct order.
586
+ * @private
587
+ */
588
+ goog.writeScripts_ = function() {
589
+ // the scripts we need to write this time
590
+ var scripts = [];
591
+ var seenScript = {};
592
+ var deps = goog.dependencies_;
593
+
594
+ function visitNode(path) {
595
+ if (path in deps.written) {
596
+ return;
597
+ }
598
+
599
+ // we have already visited this one. We can get here if we have cyclic
600
+ // dependencies
601
+ if (path in deps.visited) {
602
+ if (!(path in seenScript)) {
603
+ seenScript[path] = true;
604
+ scripts.push(path);
605
+ }
606
+ return;
607
+ }
608
+
609
+ deps.visited[path] = true;
610
+
611
+ if (path in deps.requires) {
612
+ for (var requireName in deps.requires[path]) {
613
+ // If the required name is defined, we assume that it was already
614
+ // bootstrapped by other means.
615
+ if (!goog.isProvided_(requireName)) {
616
+ if (requireName in deps.nameToPath) {
617
+ visitNode(deps.nameToPath[requireName]);
618
+ } else {
619
+ throw Error('Undefined nameToPath for ' + requireName);
620
+ }
621
+ }
622
+ }
623
+ }
624
+
625
+ if (!(path in seenScript)) {
626
+ seenScript[path] = true;
627
+ scripts.push(path);
628
+ }
629
+ }
630
+
631
+ for (var path in goog.included_) {
632
+ if (!deps.written[path]) {
633
+ visitNode(path);
634
+ }
635
+ }
636
+
637
+ for (var i = 0; i < scripts.length; i++) {
638
+ if (scripts[i]) {
639
+ goog.importScript_(goog.basePath + scripts[i]);
640
+ } else {
641
+ throw Error('Undefined script input');
642
+ }
643
+ }
644
+ };
645
+
646
+
647
+ /**
648
+ * Looks at the dependency rules and tries to determine the script file that
649
+ * fulfills a particular rule.
650
+ * @param {string} rule In the form goog.namespace.Class or project.script.
651
+ * @return {?string} Url corresponding to the rule, or null.
652
+ * @private
653
+ */
654
+ goog.getPathFromDeps_ = function(rule) {
655
+ if (rule in goog.dependencies_.nameToPath) {
656
+ return goog.dependencies_.nameToPath[rule];
657
+ } else {
658
+ return null;
659
+ }
660
+ };
661
+
662
+ goog.findBasePath_();
663
+
664
+ // Allow projects to manage the deps files themselves.
665
+ if (!goog.global.CLOSURE_NO_DEPS) {
666
+ goog.importScript_(goog.basePath + 'deps.js');
667
+ }
668
+ }
669
+
670
+
671
+
672
+ //==============================================================================
673
+ // Language Enhancements
674
+ //==============================================================================
675
+
676
+
677
+ /**
678
+ * This is a "fixed" version of the typeof operator. It differs from the typeof
679
+ * operator in such a way that null returns 'null' and arrays return 'array'.
680
+ * @param {*} value The value to get the type of.
681
+ * @return {string} The name of the type.
682
+ */
683
+ goog.typeOf = function(value) {
684
+ var s = typeof value;
685
+ if (s == 'object') {
686
+ if (value) {
687
+ // Check these first, so we can avoid calling Object.prototype.toString if
688
+ // possible.
689
+ //
690
+ // IE improperly marshals tyepof across execution contexts, but a
691
+ // cross-context object will still return false for "instanceof Object".
692
+ if (value instanceof Array) {
693
+ return 'array';
694
+ } else if (value instanceof Object) {
695
+ return s;
696
+ }
697
+
698
+ // HACK: In order to use an Object prototype method on the arbitrary
699
+ // value, the compiler requires the value be cast to type Object,
700
+ // even though the ECMA spec explicitly allows it.
701
+ var className = Object.prototype.toString.call(
702
+ /** @type {Object} */ (value));
703
+ // In Firefox 3.6, attempting to access iframe window objects' length
704
+ // property throws an NS_ERROR_FAILURE, so we need to special-case it
705
+ // here.
706
+ if (className == '[object Window]') {
707
+ return 'object';
708
+ }
709
+
710
+ // We cannot always use constructor == Array or instanceof Array because
711
+ // different frames have different Array objects. In IE6, if the iframe
712
+ // where the array was created is destroyed, the array loses its
713
+ // prototype. Then dereferencing val.splice here throws an exception, so
714
+ // we can't use goog.isFunction. Calling typeof directly returns 'unknown'
715
+ // so that will work. In this case, this function will return false and
716
+ // most array functions will still work because the array is still
717
+ // array-like (supports length and []) even though it has lost its
718
+ // prototype.
719
+ // Mark Miller noticed that Object.prototype.toString
720
+ // allows access to the unforgeable [[Class]] property.
721
+ // 15.2.4.2 Object.prototype.toString ( )
722
+ // When the toString method is called, the following steps are taken:
723
+ // 1. Get the [[Class]] property of this object.
724
+ // 2. Compute a string value by concatenating the three strings
725
+ // "[object ", Result(1), and "]".
726
+ // 3. Return Result(2).
727
+ // and this behavior survives the destruction of the execution context.
728
+ if ((className == '[object Array]' ||
729
+ // In IE all non value types are wrapped as objects across window
730
+ // boundaries (not iframe though) so we have to do object detection
731
+ // for this edge case
732
+ typeof value.length == 'number' &&
733
+ typeof value.splice != 'undefined' &&
734
+ typeof value.propertyIsEnumerable != 'undefined' &&
735
+ !value.propertyIsEnumerable('splice')
736
+
737
+ )) {
738
+ return 'array';
739
+ }
740
+ // HACK: There is still an array case that fails.
741
+ // function ArrayImpostor() {}
742
+ // ArrayImpostor.prototype = [];
743
+ // var impostor = new ArrayImpostor;
744
+ // this can be fixed by getting rid of the fast path
745
+ // (value instanceof Array) and solely relying on
746
+ // (value && Object.prototype.toString.vall(value) === '[object Array]')
747
+ // but that would require many more function calls and is not warranted
748
+ // unless closure code is receiving objects from untrusted sources.
749
+
750
+ // IE in cross-window calls does not correctly marshal the function type
751
+ // (it appears just as an object) so we cannot use just typeof val ==
752
+ // 'function'. However, if the object has a call property, it is a
753
+ // function.
754
+ if ((className == '[object Function]' ||
755
+ typeof value.call != 'undefined' &&
756
+ typeof value.propertyIsEnumerable != 'undefined' &&
757
+ !value.propertyIsEnumerable('call'))) {
758
+ return 'function';
759
+ }
760
+
761
+
762
+ } else {
763
+ return 'null';
764
+ }
765
+
766
+ } else if (s == 'function' && typeof value.call == 'undefined') {
767
+ // In Safari typeof nodeList returns 'function', and on Firefox
768
+ // typeof behaves similarly for HTML{Applet,Embed,Object}Elements
769
+ // and RegExps. We would like to return object for those and we can
770
+ // detect an invalid function by making sure that the function
771
+ // object has a call method.
772
+ return 'object';
773
+ }
774
+ return s;
775
+ };
776
+
777
+
778
+ /**
779
+ * Returns true if the specified value is not |undefined|.
780
+ * WARNING: Do not use this to test if an object has a property. Use the in
781
+ * operator instead. Additionally, this function assumes that the global
782
+ * undefined variable has not been redefined.
783
+ * @param {*} val Variable to test.
784
+ * @return {boolean} Whether variable is defined.
785
+ */
786
+ goog.isDef = function(val) {
787
+ return val !== undefined;
788
+ };
789
+
790
+
791
+ /**
792
+ * Returns true if the specified value is |null|
793
+ * @param {*} val Variable to test.
794
+ * @return {boolean} Whether variable is null.
795
+ */
796
+ goog.isNull = function(val) {
797
+ return val === null;
798
+ };
799
+
800
+
801
+ /**
802
+ * Returns true if the specified value is defined and not null
803
+ * @param {*} val Variable to test.
804
+ * @return {boolean} Whether variable is defined and not null.
805
+ */
806
+ goog.isDefAndNotNull = function(val) {
807
+ // Note that undefined == null.
808
+ return val != null;
809
+ };
810
+
811
+
812
+ /**
813
+ * Returns true if the specified value is an array
814
+ * @param {*} val Variable to test.
815
+ * @return {boolean} Whether variable is an array.
816
+ */
817
+ goog.isArray = function(val) {
818
+ return goog.typeOf(val) == 'array';
819
+ };
820
+
821
+
822
+ /**
823
+ * Returns true if the object looks like an array. To qualify as array like
824
+ * the value needs to be either a NodeList or an object with a Number length
825
+ * property.
826
+ * @param {*} val Variable to test.
827
+ * @return {boolean} Whether variable is an array.
828
+ */
829
+ goog.isArrayLike = function(val) {
830
+ var type = goog.typeOf(val);
831
+ return type == 'array' || type == 'object' && typeof val.length == 'number';
832
+ };
833
+
834
+
835
+ /**
836
+ * Returns true if the object looks like a Date. To qualify as Date-like
837
+ * the value needs to be an object and have a getFullYear() function.
838
+ * @param {*} val Variable to test.
839
+ * @return {boolean} Whether variable is a like a Date.
840
+ */
841
+ goog.isDateLike = function(val) {
842
+ return goog.isObject(val) && typeof val.getFullYear == 'function';
843
+ };
844
+
845
+
846
+ /**
847
+ * Returns true if the specified value is a string
848
+ * @param {*} val Variable to test.
849
+ * @return {boolean} Whether variable is a string.
850
+ */
851
+ goog.isString = function(val) {
852
+ return typeof val == 'string';
853
+ };
854
+
855
+
856
+ /**
857
+ * Returns true if the specified value is a boolean
858
+ * @param {*} val Variable to test.
859
+ * @return {boolean} Whether variable is boolean.
860
+ */
861
+ goog.isBoolean = function(val) {
862
+ return typeof val == 'boolean';
863
+ };
864
+
865
+
866
+ /**
867
+ * Returns true if the specified value is a number
868
+ * @param {*} val Variable to test.
869
+ * @return {boolean} Whether variable is a number.
870
+ */
871
+ goog.isNumber = function(val) {
872
+ return typeof val == 'number';
873
+ };
874
+
875
+
876
+ /**
877
+ * Returns true if the specified value is a function
878
+ * @param {*} val Variable to test.
879
+ * @return {boolean} Whether variable is a function.
880
+ */
881
+ goog.isFunction = function(val) {
882
+ return goog.typeOf(val) == 'function';
883
+ };
884
+
885
+
886
+ /**
887
+ * Returns true if the specified value is an object. This includes arrays
888
+ * and functions.
889
+ * @param {*} val Variable to test.
890
+ * @return {boolean} Whether variable is an object.
891
+ */
892
+ goog.isObject = function(val) {
893
+ var type = typeof val;
894
+ return type == 'object' && val != null || type == 'function';
895
+ // return Object(val) === val also works, but is slower, especially if val is
896
+ // not an object.
897
+ };
898
+
899
+
900
+ /**
901
+ * Gets a unique ID for an object. This mutates the object so that further
902
+ * calls with the same object as a parameter returns the same value. The unique
903
+ * ID is guaranteed to be unique across the current session amongst objects that
904
+ * are passed into {@code getUid}. There is no guarantee that the ID is unique
905
+ * or consistent across sessions. It is unsafe to generate unique ID for
906
+ * function prototypes.
907
+ *
908
+ * @param {Object} obj The object to get the unique ID for.
909
+ * @return {number} The unique ID for the object.
910
+ */
911
+ goog.getUid = function(obj) {
912
+ // TODO(arv): Make the type stricter, do not accept null.
913
+
914
+ // In Opera window.hasOwnProperty exists but always returns false so we avoid
915
+ // using it. As a consequence the unique ID generated for BaseClass.prototype
916
+ // and SubClass.prototype will be the same.
917
+ return obj[goog.UID_PROPERTY_] ||
918
+ (obj[goog.UID_PROPERTY_] = ++goog.uidCounter_);
919
+ };
920
+
921
+
922
+ /**
923
+ * Removes the unique ID from an object. This is useful if the object was
924
+ * previously mutated using {@code goog.getUid} in which case the mutation is
925
+ * undone.
926
+ * @param {Object} obj The object to remove the unique ID field from.
927
+ */
928
+ goog.removeUid = function(obj) {
929
+ // TODO(arv): Make the type stricter, do not accept null.
930
+
931
+ // DOM nodes in IE are not instance of Object and throws exception
932
+ // for delete. Instead we try to use removeAttribute
933
+ if ('removeAttribute' in obj) {
934
+ obj.removeAttribute(goog.UID_PROPERTY_);
935
+ }
936
+ /** @preserveTry */
937
+ try {
938
+ delete obj[goog.UID_PROPERTY_];
939
+ } catch (ex) {
940
+ }
941
+ };
942
+
943
+
944
+ /**
945
+ * Name for unique ID property. Initialized in a way to help avoid collisions
946
+ * with other closure javascript on the same page.
947
+ * @type {string}
948
+ * @private
949
+ */
950
+ goog.UID_PROPERTY_ = 'closure_uid_' + ((Math.random() * 1e9) >>> 0);
951
+
952
+
953
+ /**
954
+ * Counter for UID.
955
+ * @type {number}
956
+ * @private
957
+ */
958
+ goog.uidCounter_ = 0;
959
+
960
+
961
+ /**
962
+ * Adds a hash code field to an object. The hash code is unique for the
963
+ * given object.
964
+ * @param {Object} obj The object to get the hash code for.
965
+ * @return {number} The hash code for the object.
966
+ * @deprecated Use goog.getUid instead.
967
+ */
968
+ goog.getHashCode = goog.getUid;
969
+
970
+
971
+ /**
972
+ * Removes the hash code field from an object.
973
+ * @param {Object} obj The object to remove the field from.
974
+ * @deprecated Use goog.removeUid instead.
975
+ */
976
+ goog.removeHashCode = goog.removeUid;
977
+
978
+
979
+ /**
980
+ * Clones a value. The input may be an Object, Array, or basic type. Objects and
981
+ * arrays will be cloned recursively.
982
+ *
983
+ * WARNINGS:
984
+ * <code>goog.cloneObject</code> does not detect reference loops. Objects that
985
+ * refer to themselves will cause infinite recursion.
986
+ *
987
+ * <code>goog.cloneObject</code> is unaware of unique identifiers, and copies
988
+ * UIDs created by <code>getUid</code> into cloned results.
989
+ *
990
+ * @param {*} obj The value to clone.
991
+ * @return {*} A clone of the input value.
992
+ * @deprecated goog.cloneObject is unsafe. Prefer the goog.object methods.
993
+ */
994
+ goog.cloneObject = function(obj) {
995
+ var type = goog.typeOf(obj);
996
+ if (type == 'object' || type == 'array') {
997
+ if (obj.clone) {
998
+ return obj.clone();
999
+ }
1000
+ var clone = type == 'array' ? [] : {};
1001
+ for (var key in obj) {
1002
+ clone[key] = goog.cloneObject(obj[key]);
1003
+ }
1004
+ return clone;
1005
+ }
1006
+
1007
+ return obj;
1008
+ };
1009
+
1010
+
1011
+ /**
1012
+ * A native implementation of goog.bind.
1013
+ * @param {Function} fn A function to partially apply.
1014
+ * @param {Object|undefined} selfObj Specifies the object which |this| should
1015
+ * point to when the function is run.
1016
+ * @param {...*} var_args Additional arguments that are partially
1017
+ * applied to the function.
1018
+ * @return {!Function} A partially-applied form of the function bind() was
1019
+ * invoked as a method of.
1020
+ * @private
1021
+ * @suppress {deprecated} The compiler thinks that Function.prototype.bind
1022
+ * is deprecated because some people have declared a pure-JS version.
1023
+ * Only the pure-JS version is truly deprecated.
1024
+ */
1025
+ goog.bindNative_ = function(fn, selfObj, var_args) {
1026
+ return /** @type {!Function} */ (fn.call.apply(fn.bind, arguments));
1027
+ };
1028
+
1029
+
1030
+ /**
1031
+ * A pure-JS implementation of goog.bind.
1032
+ * @param {Function} fn A function to partially apply.
1033
+ * @param {Object|undefined} selfObj Specifies the object which |this| should
1034
+ * point to when the function is run.
1035
+ * @param {...*} var_args Additional arguments that are partially
1036
+ * applied to the function.
1037
+ * @return {!Function} A partially-applied form of the function bind() was
1038
+ * invoked as a method of.
1039
+ * @private
1040
+ */
1041
+ goog.bindJs_ = function(fn, selfObj, var_args) {
1042
+ if (!fn) {
1043
+ throw new Error();
1044
+ }
1045
+
1046
+ if (arguments.length > 2) {
1047
+ var boundArgs = Array.prototype.slice.call(arguments, 2);
1048
+ return function() {
1049
+ // Prepend the bound arguments to the current arguments.
1050
+ var newArgs = Array.prototype.slice.call(arguments);
1051
+ Array.prototype.unshift.apply(newArgs, boundArgs);
1052
+ return fn.apply(selfObj, newArgs);
1053
+ };
1054
+
1055
+ } else {
1056
+ return function() {
1057
+ return fn.apply(selfObj, arguments);
1058
+ };
1059
+ }
1060
+ };
1061
+
1062
+
1063
+ /**
1064
+ * Partially applies this function to a particular 'this object' and zero or
1065
+ * more arguments. The result is a new function with some arguments of the first
1066
+ * function pre-filled and the value of |this| 'pre-specified'.<br><br>
1067
+ *
1068
+ * Remaining arguments specified at call-time are appended to the pre-
1069
+ * specified ones.<br><br>
1070
+ *
1071
+ * Also see: {@link #partial}.<br><br>
1072
+ *
1073
+ * Usage:
1074
+ * <pre>var barMethBound = bind(myFunction, myObj, 'arg1', 'arg2');
1075
+ * barMethBound('arg3', 'arg4');</pre>
1076
+ *
1077
+ * @param {Function} fn A function to partially apply.
1078
+ * @param {Object|undefined} selfObj Specifies the object which |this| should
1079
+ * point to when the function is run.
1080
+ * @param {...*} var_args Additional arguments that are partially
1081
+ * applied to the function.
1082
+ * @return {!Function} A partially-applied form of the function bind() was
1083
+ * invoked as a method of.
1084
+ * @suppress {deprecated} See above.
1085
+ */
1086
+ goog.bind = function(fn, selfObj, var_args) {
1087
+ // TODO(nicksantos): narrow the type signature.
1088
+ if (Function.prototype.bind &&
1089
+ // NOTE(nicksantos): Somebody pulled base.js into the default
1090
+ // Chrome extension environment. This means that for Chrome extensions,
1091
+ // they get the implementation of Function.prototype.bind that
1092
+ // calls goog.bind instead of the native one. Even worse, we don't want
1093
+ // to introduce a circular dependency between goog.bind and
1094
+ // Function.prototype.bind, so we have to hack this to make sure it
1095
+ // works correctly.
1096
+ Function.prototype.bind.toString().indexOf('native code') != -1) {
1097
+ goog.bind = goog.bindNative_;
1098
+ } else {
1099
+ goog.bind = goog.bindJs_;
1100
+ }
1101
+ return goog.bind.apply(null, arguments);
1102
+ };
1103
+
1104
+
1105
+ /**
1106
+ * Like bind(), except that a 'this object' is not required. Useful when the
1107
+ * target function is already bound.
1108
+ *
1109
+ * Usage:
1110
+ * var g = partial(f, arg1, arg2);
1111
+ * g(arg3, arg4);
1112
+ *
1113
+ * @param {Function} fn A function to partially apply.
1114
+ * @param {...*} var_args Additional arguments that are partially
1115
+ * applied to fn.
1116
+ * @return {!Function} A partially-applied form of the function bind() was
1117
+ * invoked as a method of.
1118
+ */
1119
+ goog.partial = function(fn, var_args) {
1120
+ var args = Array.prototype.slice.call(arguments, 1);
1121
+ return function() {
1122
+ // Prepend the bound arguments to the current arguments.
1123
+ var newArgs = Array.prototype.slice.call(arguments);
1124
+ newArgs.unshift.apply(newArgs, args);
1125
+ return fn.apply(this, newArgs);
1126
+ };
1127
+ };
1128
+
1129
+
1130
+ /**
1131
+ * Copies all the members of a source object to a target object. This method
1132
+ * does not work on all browsers for all objects that contain keys such as
1133
+ * toString or hasOwnProperty. Use goog.object.extend for this purpose.
1134
+ * @param {Object} target Target.
1135
+ * @param {Object} source Source.
1136
+ */
1137
+ goog.mixin = function(target, source) {
1138
+ for (var x in source) {
1139
+ target[x] = source[x];
1140
+ }
1141
+
1142
+ // For IE7 or lower, the for-in-loop does not contain any properties that are
1143
+ // not enumerable on the prototype object (for example, isPrototypeOf from
1144
+ // Object.prototype) but also it will not include 'replace' on objects that
1145
+ // extend String and change 'replace' (not that it is common for anyone to
1146
+ // extend anything except Object).
1147
+ };
1148
+
1149
+
1150
+ /**
1151
+ * @return {number} An integer value representing the number of milliseconds
1152
+ * between midnight, January 1, 1970 and the current time.
1153
+ */
1154
+ goog.now = (goog.TRUSTED_SITE && Date.now) || (function() {
1155
+ // Unary plus operator converts its operand to a number which in the case of
1156
+ // a date is done by calling getTime().
1157
+ return +new Date();
1158
+ });
1159
+
1160
+
1161
+ /**
1162
+ * Evals javascript in the global scope. In IE this uses execScript, other
1163
+ * browsers use goog.global.eval. If goog.global.eval does not evaluate in the
1164
+ * global scope (for example, in Safari), appends a script tag instead.
1165
+ * Throws an exception if neither execScript or eval is defined.
1166
+ * @param {string} script JavaScript string.
1167
+ */
1168
+ goog.globalEval = function(script) {
1169
+ if (goog.global.execScript) {
1170
+ goog.global.execScript(script, 'JavaScript');
1171
+ } else if (goog.global.eval) {
1172
+ // Test to see if eval works
1173
+ if (goog.evalWorksForGlobals_ == null) {
1174
+ goog.global.eval('var _et_ = 1;');
1175
+ if (typeof goog.global['_et_'] != 'undefined') {
1176
+ delete goog.global['_et_'];
1177
+ goog.evalWorksForGlobals_ = true;
1178
+ } else {
1179
+ goog.evalWorksForGlobals_ = false;
1180
+ }
1181
+ }
1182
+
1183
+ if (goog.evalWorksForGlobals_) {
1184
+ goog.global.eval(script);
1185
+ } else {
1186
+ var doc = goog.global.document;
1187
+ var scriptElt = doc.createElement('script');
1188
+ scriptElt.type = 'text/javascript';
1189
+ scriptElt.defer = false;
1190
+ // Note(user): can't use .innerHTML since "t('<test>')" will fail and
1191
+ // .text doesn't work in Safari 2. Therefore we append a text node.
1192
+ scriptElt.appendChild(doc.createTextNode(script));
1193
+ doc.body.appendChild(scriptElt);
1194
+ doc.body.removeChild(scriptElt);
1195
+ }
1196
+ } else {
1197
+ throw Error('goog.globalEval not available');
1198
+ }
1199
+ };
1200
+
1201
+
1202
+ /**
1203
+ * Indicates whether or not we can call 'eval' directly to eval code in the
1204
+ * global scope. Set to a Boolean by the first call to goog.globalEval (which
1205
+ * empirically tests whether eval works for globals). @see goog.globalEval
1206
+ * @type {?boolean}
1207
+ * @private
1208
+ */
1209
+ goog.evalWorksForGlobals_ = null;
1210
+
1211
+
1212
+ /**
1213
+ * Optional map of CSS class names to obfuscated names used with
1214
+ * goog.getCssName().
1215
+ * @type {Object|undefined}
1216
+ * @private
1217
+ * @see goog.setCssNameMapping
1218
+ */
1219
+ goog.cssNameMapping_;
1220
+
1221
+
1222
+ /**
1223
+ * Optional obfuscation style for CSS class names. Should be set to either
1224
+ * 'BY_WHOLE' or 'BY_PART' if defined.
1225
+ * @type {string|undefined}
1226
+ * @private
1227
+ * @see goog.setCssNameMapping
1228
+ */
1229
+ goog.cssNameMappingStyle_;
1230
+
1231
+
1232
+ /**
1233
+ * Handles strings that are intended to be used as CSS class names.
1234
+ *
1235
+ * This function works in tandem with @see goog.setCssNameMapping.
1236
+ *
1237
+ * Without any mapping set, the arguments are simple joined with a
1238
+ * hyphen and passed through unaltered.
1239
+ *
1240
+ * When there is a mapping, there are two possible styles in which
1241
+ * these mappings are used. In the BY_PART style, each part (i.e. in
1242
+ * between hyphens) of the passed in css name is rewritten according
1243
+ * to the map. In the BY_WHOLE style, the full css name is looked up in
1244
+ * the map directly. If a rewrite is not specified by the map, the
1245
+ * compiler will output a warning.
1246
+ *
1247
+ * When the mapping is passed to the compiler, it will replace calls
1248
+ * to goog.getCssName with the strings from the mapping, e.g.
1249
+ * var x = goog.getCssName('foo');
1250
+ * var y = goog.getCssName(this.baseClass, 'active');
1251
+ * becomes:
1252
+ * var x= 'foo';
1253
+ * var y = this.baseClass + '-active';
1254
+ *
1255
+ * If one argument is passed it will be processed, if two are passed
1256
+ * only the modifier will be processed, as it is assumed the first
1257
+ * argument was generated as a result of calling goog.getCssName.
1258
+ *
1259
+ * @param {string} className The class name.
1260
+ * @param {string=} opt_modifier A modifier to be appended to the class name.
1261
+ * @return {string} The class name or the concatenation of the class name and
1262
+ * the modifier.
1263
+ */
1264
+ goog.getCssName = function(className, opt_modifier) {
1265
+ var getMapping = function(cssName) {
1266
+ return goog.cssNameMapping_[cssName] || cssName;
1267
+ };
1268
+
1269
+ var renameByParts = function(cssName) {
1270
+ // Remap all the parts individually.
1271
+ var parts = cssName.split('-');
1272
+ var mapped = [];
1273
+ for (var i = 0; i < parts.length; i++) {
1274
+ mapped.push(getMapping(parts[i]));
1275
+ }
1276
+ return mapped.join('-');
1277
+ };
1278
+
1279
+ var rename;
1280
+ if (goog.cssNameMapping_) {
1281
+ rename = goog.cssNameMappingStyle_ == 'BY_WHOLE' ?
1282
+ getMapping : renameByParts;
1283
+ } else {
1284
+ rename = function(a) {
1285
+ return a;
1286
+ };
1287
+ }
1288
+
1289
+ if (opt_modifier) {
1290
+ return className + '-' + rename(opt_modifier);
1291
+ } else {
1292
+ return rename(className);
1293
+ }
1294
+ };
1295
+
1296
+
1297
+ /**
1298
+ * Sets the map to check when returning a value from goog.getCssName(). Example:
1299
+ * <pre>
1300
+ * goog.setCssNameMapping({
1301
+ * "goog": "a",
1302
+ * "disabled": "b",
1303
+ * });
1304
+ *
1305
+ * var x = goog.getCssName('goog');
1306
+ * // The following evaluates to: "a a-b".
1307
+ * goog.getCssName('goog') + ' ' + goog.getCssName(x, 'disabled')
1308
+ * </pre>
1309
+ * When declared as a map of string literals to string literals, the JSCompiler
1310
+ * will replace all calls to goog.getCssName() using the supplied map if the
1311
+ * --closure_pass flag is set.
1312
+ *
1313
+ * @param {!Object} mapping A map of strings to strings where keys are possible
1314
+ * arguments to goog.getCssName() and values are the corresponding values
1315
+ * that should be returned.
1316
+ * @param {string=} opt_style The style of css name mapping. There are two valid
1317
+ * options: 'BY_PART', and 'BY_WHOLE'.
1318
+ * @see goog.getCssName for a description.
1319
+ */
1320
+ goog.setCssNameMapping = function(mapping, opt_style) {
1321
+ goog.cssNameMapping_ = mapping;
1322
+ goog.cssNameMappingStyle_ = opt_style;
1323
+ };
1324
+
1325
+
1326
+ /**
1327
+ * To use CSS renaming in compiled mode, one of the input files should have a
1328
+ * call to goog.setCssNameMapping() with an object literal that the JSCompiler
1329
+ * can extract and use to replace all calls to goog.getCssName(). In uncompiled
1330
+ * mode, JavaScript code should be loaded before this base.js file that declares
1331
+ * a global variable, CLOSURE_CSS_NAME_MAPPING, which is used below. This is
1332
+ * to ensure that the mapping is loaded before any calls to goog.getCssName()
1333
+ * are made in uncompiled mode.
1334
+ *
1335
+ * A hook for overriding the CSS name mapping.
1336
+ * @type {Object|undefined}
1337
+ */
1338
+ goog.global.CLOSURE_CSS_NAME_MAPPING;
1339
+
1340
+
1341
+ if (!COMPILED && goog.global.CLOSURE_CSS_NAME_MAPPING) {
1342
+ // This does not call goog.setCssNameMapping() because the JSCompiler
1343
+ // requires that goog.setCssNameMapping() be called with an object literal.
1344
+ goog.cssNameMapping_ = goog.global.CLOSURE_CSS_NAME_MAPPING;
1345
+ }
1346
+
1347
+
1348
+ /**
1349
+ * Gets a localized message.
1350
+ *
1351
+ * This function is a compiler primitive. If you give the compiler a localized
1352
+ * message bundle, it will replace the string at compile-time with a localized
1353
+ * version, and expand goog.getMsg call to a concatenated string.
1354
+ *
1355
+ * Messages must be initialized in the form:
1356
+ * <code>
1357
+ * var MSG_NAME = goog.getMsg('Hello {$placeholder}', {'placeholder': 'world'});
1358
+ * </code>
1359
+ *
1360
+ * @param {string} str Translatable string, places holders in the form {$foo}.
1361
+ * @param {Object=} opt_values Map of place holder name to value.
1362
+ * @return {string} message with placeholders filled.
1363
+ */
1364
+ goog.getMsg = function(str, opt_values) {
1365
+ var values = opt_values || {};
1366
+ for (var key in values) {
1367
+ var value = ('' + values[key]).replace(/\$/g, '$$$$');
1368
+ str = str.replace(new RegExp('\\{\\$' + key + '\\}', 'gi'), value);
1369
+ }
1370
+ return str;
1371
+ };
1372
+
1373
+
1374
+ /**
1375
+ * Gets a localized message. If the message does not have a translation, gives a
1376
+ * fallback message.
1377
+ *
1378
+ * This is useful when introducing a new message that has not yet been
1379
+ * translated into all languages.
1380
+ *
1381
+ * This function is a compiler primtive. Must be used in the form:
1382
+ * <code>var x = goog.getMsgWithFallback(MSG_A, MSG_B);</code>
1383
+ * where MSG_A and MSG_B were initialized with goog.getMsg.
1384
+ *
1385
+ * @param {string} a The preferred message.
1386
+ * @param {string} b The fallback message.
1387
+ * @return {string} The best translated message.
1388
+ */
1389
+ goog.getMsgWithFallback = function(a, b) {
1390
+ return a;
1391
+ };
1392
+
1393
+
1394
+ /**
1395
+ * Exposes an unobfuscated global namespace path for the given object.
1396
+ * Note that fields of the exported object *will* be obfuscated,
1397
+ * unless they are exported in turn via this function or
1398
+ * goog.exportProperty
1399
+ *
1400
+ * <p>Also handy for making public items that are defined in anonymous
1401
+ * closures.
1402
+ *
1403
+ * ex. goog.exportSymbol('public.path.Foo', Foo);
1404
+ *
1405
+ * ex. goog.exportSymbol('public.path.Foo.staticFunction',
1406
+ * Foo.staticFunction);
1407
+ * public.path.Foo.staticFunction();
1408
+ *
1409
+ * ex. goog.exportSymbol('public.path.Foo.prototype.myMethod',
1410
+ * Foo.prototype.myMethod);
1411
+ * new public.path.Foo().myMethod();
1412
+ *
1413
+ * @param {string} publicPath Unobfuscated name to export.
1414
+ * @param {*} object Object the name should point to.
1415
+ * @param {Object=} opt_objectToExportTo The object to add the path to; default
1416
+ * is |goog.global|.
1417
+ */
1418
+ goog.exportSymbol = function(publicPath, object, opt_objectToExportTo) {
1419
+ goog.exportPath_(publicPath, object, opt_objectToExportTo);
1420
+ };
1421
+
1422
+
1423
+ /**
1424
+ * Exports a property unobfuscated into the object's namespace.
1425
+ * ex. goog.exportProperty(Foo, 'staticFunction', Foo.staticFunction);
1426
+ * ex. goog.exportProperty(Foo.prototype, 'myMethod', Foo.prototype.myMethod);
1427
+ * @param {Object} object Object whose static property is being exported.
1428
+ * @param {string} publicName Unobfuscated name to export.
1429
+ * @param {*} symbol Object the name should point to.
1430
+ */
1431
+ goog.exportProperty = function(object, publicName, symbol) {
1432
+ object[publicName] = symbol;
1433
+ };
1434
+
1435
+
1436
+ /**
1437
+ * Inherit the prototype methods from one constructor into another.
1438
+ *
1439
+ * Usage:
1440
+ * <pre>
1441
+ * function ParentClass(a, b) { }
1442
+ * ParentClass.prototype.foo = function(a) { }
1443
+ *
1444
+ * function ChildClass(a, b, c) {
1445
+ * goog.base(this, a, b);
1446
+ * }
1447
+ * goog.inherits(ChildClass, ParentClass);
1448
+ *
1449
+ * var child = new ChildClass('a', 'b', 'see');
1450
+ * child.foo(); // works
1451
+ * </pre>
1452
+ *
1453
+ * In addition, a superclass' implementation of a method can be invoked
1454
+ * as follows:
1455
+ *
1456
+ * <pre>
1457
+ * ChildClass.prototype.foo = function(a) {
1458
+ * ChildClass.superClass_.foo.call(this, a);
1459
+ * // other code
1460
+ * };
1461
+ * </pre>
1462
+ *
1463
+ * @param {Function} childCtor Child class.
1464
+ * @param {Function} parentCtor Parent class.
1465
+ */
1466
+ goog.inherits = function(childCtor, parentCtor) {
1467
+ /** @constructor */
1468
+ function tempCtor() {};
1469
+ tempCtor.prototype = parentCtor.prototype;
1470
+ childCtor.superClass_ = parentCtor.prototype;
1471
+ childCtor.prototype = new tempCtor();
1472
+ /** @override */
1473
+ childCtor.prototype.constructor = childCtor;
1474
+ };
1475
+
1476
+ /**
1477
+ * Allow for aliasing within scope functions. This function exists for
1478
+ * uncompiled code - in compiled code the calls will be inlined and the
1479
+ * aliases applied. In uncompiled code the function is simply run since the
1480
+ * aliases as written are valid JavaScript.
1481
+ * @param {function()} fn Function to call. This function can contain aliases
1482
+ * to namespaces (e.g. "var dom = goog.dom") or classes
1483
+ * (e.g. "var Timer = goog.Timer").
1484
+ */
1485
+ goog.scope = function(fn) {
1486
+ fn.call(goog.global);
1487
+ };
1488
+
1489
+