Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

first commit

  • Loading branch information...
commit 11aa88387077f74290e9f2786dec8d064e8b94bf 1 parent 32f0811
scottbw authored
Showing with 13,046 additions and 0 deletions.
  1. +202 −0 LICENSE
  2. +47 −0 client/diff_match_patch.js
  3. +481 −0 client/json2.js
  4. +1,925 −0 client/socket.io.js
  5. +287 −0 client/wave.js
  6. +299 −0 client/wave_old.js
  7. +51 −0 examples/chat/.svn/entries
  8. +14 −0 examples/chat/.svn/prop-base/default_thumbnail.png.svn-base
  9. BIN  examples/chat/.svn/text-base/default_thumbnail.png.svn-base
  10. +95 −0 examples/chat/chat.css
  11. +125 −0 examples/chat/chat.js
  12. BIN  examples/chat/default_thumbnail.png
  13. +51 −0 examples/chat/index.htm
  14. +50 −0 examples/chat/index_alice.htm
  15. +74 −0 examples/chat/smileys.js
  16. BIN  examples/chat/smileys/-_-'.png
  17. +755 −0 examples/chat/smileys/.svn/all-wcprops
  18. +6 −0 examples/chat/smileys/.svn/dir-prop-base
  19. +4,286 −0 examples/chat/smileys/.svn/entries
  20. +14 −0 examples/chat/smileys/.svn/prop-base/-_-'.png.svn-base
  21. +14 −0 examples/chat/smileys/.svn/prop-base/2fingers.png.svn-base
  22. +14 −0 examples/chat/smileys/.svn/prop-base/2love.png.svn-base
  23. +10 −0 examples/chat/smileys/.svn/prop-base/Emoticons.plist.svn-base
  24. +14 −0 examples/chat/smileys/.svn/prop-base/LOL.png.svn-base
  25. +14 −0 examples/chat/smileys/.svn/prop-base/Mr Po.png.svn-base
  26. +14 −0 examples/chat/smileys/.svn/prop-base/O_o.png.svn-base
  27. +14 −0 examples/chat/smileys/.svn/prop-base/alien.png.svn-base
  28. +14 −0 examples/chat/smileys/.svn/prop-base/ambivalent.png.svn-base
  29. +14 −0 examples/chat/smileys/.svn/prop-base/angry.png.svn-base
  30. +14 −0 examples/chat/smileys/.svn/prop-base/angry2.png.svn-base
  31. +14 −0 examples/chat/smileys/.svn/prop-base/ass.png.svn-base
  32. +14 −0 examples/chat/smileys/.svn/prop-base/baby.png.svn-base
  33. +14 −0 examples/chat/smileys/.svn/prop-base/baby2.png.svn-base
  34. +14 −0 examples/chat/smileys/.svn/prop-base/barbu.png.svn-base
  35. +14 −0 examples/chat/smileys/.svn/prop-base/beer.png.svn-base
  36. +14 −0 examples/chat/smileys/.svn/prop-base/beret.png.svn-base
  37. +14 −0 examples/chat/smileys/.svn/prop-base/bigkiss.png.svn-base
  38. +14 −0 examples/chat/smileys/.svn/prop-base/bigsmile.png.svn-base
  39. +14 −0 examples/chat/smileys/.svn/prop-base/blushing.png.svn-base
  40. +14 −0 examples/chat/smileys/.svn/prop-base/brokenheart.png.svn-base
  41. +14 −0 examples/chat/smileys/.svn/prop-base/bye.png.svn-base
  42. +14 −0 examples/chat/smileys/.svn/prop-base/cake.png.svn-base
  43. +14 −0 examples/chat/smileys/.svn/prop-base/cell.png.svn-base
  44. +14 −0 examples/chat/smileys/.svn/prop-base/chinois.png.svn-base
  45. +14 −0 examples/chat/smileys/.svn/prop-base/clock.png.svn-base
  46. +14 −0 examples/chat/smileys/.svn/prop-base/cocktail.png.svn-base
  47. +14 −0 examples/chat/smileys/.svn/prop-base/coffee.png.svn-base
  48. +14 −0 examples/chat/smileys/.svn/prop-base/cold.png.svn-base
  49. +14 −0 examples/chat/smileys/.svn/prop-base/confused.png.svn-base
  50. +14 −0 examples/chat/smileys/.svn/prop-base/cool.png.svn-base
  51. +14 −0 examples/chat/smileys/.svn/prop-base/crazy.png.svn-base
  52. +14 −0 examples/chat/smileys/.svn/prop-base/cry.png.svn-base
  53. +14 −0 examples/chat/smileys/.svn/prop-base/crying.png.svn-base
  54. +14 −0 examples/chat/smileys/.svn/prop-base/cyclop.png.svn-base
  55. +14 −0 examples/chat/smileys/.svn/prop-base/devil.png.svn-base
  56. +14 −0 examples/chat/smileys/.svn/prop-base/disgusted.png.svn-base
  57. +14 −0 examples/chat/smileys/.svn/prop-base/embarrassed.png.svn-base
  58. +14 −0 examples/chat/smileys/.svn/prop-base/ermm.png.svn-base
  59. +14 −0 examples/chat/smileys/.svn/prop-base/excl.png.svn-base
  60. +14 −0 examples/chat/smileys/.svn/prop-base/fear.png.svn-base
  61. +14 −0 examples/chat/smileys/.svn/prop-base/finger.png.svn-base
  62. +14 −0 examples/chat/smileys/.svn/prop-base/flower_wilt.png.svn-base
  63. +14 −0 examples/chat/smileys/.svn/prop-base/food.png.svn-base
  64. +14 −0 examples/chat/smileys/.svn/prop-base/footinmouth.png.svn-base
  65. +14 −0 examples/chat/smileys/.svn/prop-base/frown.png.svn-base
  66. +14 −0 examples/chat/smileys/.svn/prop-base/gaga.png.svn-base
  67. +14 −0 examples/chat/smileys/.svn/prop-base/gasp.png.svn-base
  68. +14 −0 examples/chat/smileys/.svn/prop-base/getlost.png.svn-base
  69. +14 −0 examples/chat/smileys/.svn/prop-base/grimacing.png.svn-base
  70. +14 −0 examples/chat/smileys/.svn/prop-base/grin.png.svn-base
  71. +14 −0 examples/chat/smileys/.svn/prop-base/grin2.png.svn-base
  72. +14 −0 examples/chat/smileys/.svn/prop-base/happy.png.svn-base
  73. +14 −0 examples/chat/smileys/.svn/prop-base/heart.png.svn-base
  74. +14 −0 examples/chat/smileys/.svn/prop-base/hot.png.svn-base
  75. +14 −0 examples/chat/smileys/.svn/prop-base/ill.png.svn-base
  76. +14 −0 examples/chat/smileys/.svn/prop-base/inlove.png.svn-base
  77. +14 −0 examples/chat/smileys/.svn/prop-base/innocent.png.svn-base
  78. +14 −0 examples/chat/smileys/.svn/prop-base/innocent2.png.svn-base
  79. +14 −0 examples/chat/smileys/.svn/prop-base/insane.png.svn-base
  80. +14 −0 examples/chat/smileys/.svn/prop-base/ironic.png.svn-base
  81. +14 −0 examples/chat/smileys/.svn/prop-base/island.png.svn-base
  82. +14 −0 examples/chat/smileys/.svn/prop-base/japonais.png.svn-base
  83. +14 −0 examples/chat/smileys/.svn/prop-base/kiss.png.svn-base
  84. +14 −0 examples/chat/smileys/.svn/prop-base/kiss2.png.svn-base
  85. +14 −0 examples/chat/smileys/.svn/prop-base/kissheart.png.svn-base
  86. +14 −0 examples/chat/smileys/.svn/prop-base/kleenex.png.svn-base
  87. +14 −0 examples/chat/smileys/.svn/prop-base/laugh.png.svn-base
  88. +14 −0 examples/chat/smileys/.svn/prop-base/laughing.png.svn-base
  89. +14 −0 examples/chat/smileys/.svn/prop-base/laughingweak.png.svn-base
  90. +14 −0 examples/chat/smileys/.svn/prop-base/laughwink.png.svn-base
  91. +14 −0 examples/chat/smileys/.svn/prop-base/lightbulb.png.svn-base
  92. +14 −0 examples/chat/smileys/.svn/prop-base/loveU.png.svn-base
  93. +14 −0 examples/chat/smileys/.svn/prop-base/moneymouth.png.svn-base
  94. +14 −0 examples/chat/smileys/.svn/prop-base/moon.png.svn-base
  95. +14 −0 examples/chat/smileys/.svn/prop-base/movie.png.svn-base
  96. +14 −0 examples/chat/smileys/.svn/prop-base/music.png.svn-base
  97. +14 −0 examples/chat/smileys/.svn/prop-base/naughty.png.svn-base
  98. +14 −0 examples/chat/smileys/.svn/prop-base/nerd.png.svn-base
  99. +14 −0 examples/chat/smileys/.svn/prop-base/oops.png.svn-base
  100. +14 −0 examples/chat/smileys/.svn/prop-base/party.png.svn-base
  101. +14 −0 examples/chat/smileys/.svn/prop-base/perfid.png.svn-base
  102. +14 −0 examples/chat/smileys/.svn/prop-base/pig.png.svn-base
  103. +14 −0 examples/chat/smileys/.svn/prop-base/pinch.png.svn-base
  104. +14 −0 examples/chat/smileys/.svn/prop-base/pirate.png.svn-base
  105. +14 −0 examples/chat/smileys/.svn/prop-base/pizza.png.svn-base
  106. +14 −0 examples/chat/smileys/.svn/prop-base/po content.png.svn-base
  107. +14 −0 examples/chat/smileys/.svn/prop-base/policeman.png.svn-base
  108. +14 −0 examples/chat/smileys/.svn/prop-base/present.png.svn-base
  109. +14 −0 examples/chat/smileys/.svn/prop-base/question.png.svn-base
  110. +14 −0 examples/chat/smileys/.svn/prop-base/rabbit.png.svn-base
  111. +14 −0 examples/chat/smileys/.svn/prop-base/rain.png.svn-base
  112. +14 −0 examples/chat/smileys/.svn/prop-base/rainbow.png.svn-base
  113. +14 −0 examples/chat/smileys/.svn/prop-base/rasta.png.svn-base
  114. +14 −0 examples/chat/smileys/.svn/prop-base/rose.png.svn-base
  115. +14 −0 examples/chat/smileys/.svn/prop-base/santa.png.svn-base
  116. +14 −0 examples/chat/smileys/.svn/prop-base/sarcastic.png.svn-base
  117. +14 −0 examples/chat/smileys/.svn/prop-base/sars.png.svn-base
  118. +14 −0 examples/chat/smileys/.svn/prop-base/sealed.png.svn-base
  119. +14 −0 examples/chat/smileys/.svn/prop-base/shaun.png.svn-base
  120. +14 −0 examples/chat/smileys/.svn/prop-base/sick.png.svn-base
  121. +14 −0 examples/chat/smileys/.svn/prop-base/slant.png.svn-base
  122. +14 −0 examples/chat/smileys/.svn/prop-base/sleep.png.svn-base
  123. +14 −0 examples/chat/smileys/.svn/prop-base/smile.png.svn-base
  124. +14 −0 examples/chat/smileys/.svn/prop-base/sorcerer.png.svn-base
  125. +14 −0 examples/chat/smileys/.svn/prop-base/star.png.svn-base
  126. +14 −0 examples/chat/smileys/.svn/prop-base/stuart.png.svn-base
  127. +14 −0 examples/chat/smileys/.svn/prop-base/sun.png.svn-base
  128. +14 −0 examples/chat/smileys/.svn/prop-base/thumbsdown.png.svn-base
  129. +14 −0 examples/chat/smileys/.svn/prop-base/thumbsup.png.svn-base
  130. +14 −0 examples/chat/smileys/.svn/prop-base/tongue.png.svn-base
  131. +14 −0 examples/chat/smileys/.svn/prop-base/turned.png.svn-base
  132. +14 −0 examples/chat/smileys/.svn/prop-base/unsure.png.svn-base
  133. +14 −0 examples/chat/smileys/.svn/prop-base/very_cool.png.svn-base
  134. +14 −0 examples/chat/smileys/.svn/prop-base/very_tired.png.svn-base
  135. +14 −0 examples/chat/smileys/.svn/prop-base/very_tyred2.png.svn-base
  136. +14 −0 examples/chat/smileys/.svn/prop-base/wOOt.png.svn-base
  137. +14 −0 examples/chat/smileys/.svn/prop-base/wassat.png.svn-base
  138. +14 −0 examples/chat/smileys/.svn/prop-base/weak.png.svn-base
  139. +14 −0 examples/chat/smileys/.svn/prop-base/whistling.png.svn-base
  140. +14 −0 examples/chat/smileys/.svn/prop-base/wink.png.svn-base
  141. +14 −0 examples/chat/smileys/.svn/prop-base/wub.png.svn-base
  142. +14 −0 examples/chat/smileys/.svn/prop-base/yuck.png.svn-base
  143. +14 −0 examples/chat/smileys/.svn/prop-base/yum.png.svn-base
  144. +14 −0 examples/chat/smileys/.svn/prop-base/zorro.png.svn-base
  145. BIN  examples/chat/smileys/.svn/text-base/-_-'.png.svn-base
  146. BIN  examples/chat/smileys/.svn/text-base/2fingers.png.svn-base
  147. BIN  examples/chat/smileys/.svn/text-base/2love.png.svn-base
  148. +1,276 −0 examples/chat/smileys/.svn/text-base/Emoticons.plist.svn-base
  149. BIN  examples/chat/smileys/.svn/text-base/LOL.png.svn-base
  150. BIN  examples/chat/smileys/.svn/text-base/Mr Po.png.svn-base
  151. BIN  examples/chat/smileys/.svn/text-base/O_o.png.svn-base
  152. BIN  examples/chat/smileys/.svn/text-base/alien.png.svn-base
  153. BIN  examples/chat/smileys/.svn/text-base/ambivalent.png.svn-base
  154. BIN  examples/chat/smileys/.svn/text-base/angry.png.svn-base
  155. BIN  examples/chat/smileys/.svn/text-base/angry2.png.svn-base
  156. BIN  examples/chat/smileys/.svn/text-base/ass.png.svn-base
  157. BIN  examples/chat/smileys/.svn/text-base/baby.png.svn-base
  158. BIN  examples/chat/smileys/.svn/text-base/baby2.png.svn-base
  159. BIN  examples/chat/smileys/.svn/text-base/barbu.png.svn-base
  160. BIN  examples/chat/smileys/.svn/text-base/beer.png.svn-base
  161. BIN  examples/chat/smileys/.svn/text-base/beret.png.svn-base
  162. BIN  examples/chat/smileys/.svn/text-base/bigkiss.png.svn-base
  163. BIN  examples/chat/smileys/.svn/text-base/bigsmile.png.svn-base
  164. BIN  examples/chat/smileys/.svn/text-base/blushing.png.svn-base
  165. BIN  examples/chat/smileys/.svn/text-base/brokenheart.png.svn-base
  166. BIN  examples/chat/smileys/.svn/text-base/bye.png.svn-base
  167. BIN  examples/chat/smileys/.svn/text-base/cake.png.svn-base
  168. BIN  examples/chat/smileys/.svn/text-base/cell.png.svn-base
  169. BIN  examples/chat/smileys/.svn/text-base/chinois.png.svn-base
  170. BIN  examples/chat/smileys/.svn/text-base/clock.png.svn-base
  171. BIN  examples/chat/smileys/.svn/text-base/cocktail.png.svn-base
  172. BIN  examples/chat/smileys/.svn/text-base/coffee.png.svn-base
  173. BIN  examples/chat/smileys/.svn/text-base/cold.png.svn-base
  174. BIN  examples/chat/smileys/.svn/text-base/confused.png.svn-base
  175. BIN  examples/chat/smileys/.svn/text-base/cool.png.svn-base
  176. BIN  examples/chat/smileys/.svn/text-base/crazy.png.svn-base
  177. BIN  examples/chat/smileys/.svn/text-base/cry.png.svn-base
  178. BIN  examples/chat/smileys/.svn/text-base/crying.png.svn-base
  179. BIN  examples/chat/smileys/.svn/text-base/cyclop.png.svn-base
  180. BIN  examples/chat/smileys/.svn/text-base/devil.png.svn-base
  181. BIN  examples/chat/smileys/.svn/text-base/disgusted.png.svn-base
  182. BIN  examples/chat/smileys/.svn/text-base/embarrassed.png.svn-base
  183. BIN  examples/chat/smileys/.svn/text-base/ermm.png.svn-base
  184. BIN  examples/chat/smileys/.svn/text-base/excl.png.svn-base
  185. BIN  examples/chat/smileys/.svn/text-base/fear.png.svn-base
  186. BIN  examples/chat/smileys/.svn/text-base/finger.png.svn-base
  187. BIN  examples/chat/smileys/.svn/text-base/flower_wilt.png.svn-base
  188. BIN  examples/chat/smileys/.svn/text-base/food.png.svn-base
  189. BIN  examples/chat/smileys/.svn/text-base/footinmouth.png.svn-base
  190. BIN  examples/chat/smileys/.svn/text-base/frown.png.svn-base
  191. BIN  examples/chat/smileys/.svn/text-base/gaga.png.svn-base
  192. BIN  examples/chat/smileys/.svn/text-base/gasp.png.svn-base
  193. BIN  examples/chat/smileys/.svn/text-base/getlost.png.svn-base
  194. BIN  examples/chat/smileys/.svn/text-base/grimacing.png.svn-base
  195. BIN  examples/chat/smileys/.svn/text-base/grin.png.svn-base
  196. BIN  examples/chat/smileys/.svn/text-base/grin2.png.svn-base
  197. BIN  examples/chat/smileys/.svn/text-base/happy.png.svn-base
  198. BIN  examples/chat/smileys/.svn/text-base/heart.png.svn-base
  199. BIN  examples/chat/smileys/.svn/text-base/hot.png.svn-base
  200. BIN  examples/chat/smileys/.svn/text-base/ill.png.svn-base
  201. BIN  examples/chat/smileys/.svn/text-base/inlove.png.svn-base
  202. BIN  examples/chat/smileys/.svn/text-base/innocent.png.svn-base
  203. BIN  examples/chat/smileys/.svn/text-base/innocent2.png.svn-base
  204. BIN  examples/chat/smileys/.svn/text-base/insane.png.svn-base
  205. BIN  examples/chat/smileys/.svn/text-base/ironic.png.svn-base
  206. BIN  examples/chat/smileys/.svn/text-base/island.png.svn-base
  207. BIN  examples/chat/smileys/.svn/text-base/japonais.png.svn-base
  208. BIN  examples/chat/smileys/.svn/text-base/kiss.png.svn-base
  209. BIN  examples/chat/smileys/.svn/text-base/kiss2.png.svn-base
  210. BIN  examples/chat/smileys/.svn/text-base/kissheart.png.svn-base
  211. BIN  examples/chat/smileys/.svn/text-base/kleenex.png.svn-base
  212. BIN  examples/chat/smileys/.svn/text-base/laugh.png.svn-base
  213. BIN  examples/chat/smileys/.svn/text-base/laughing.png.svn-base
  214. BIN  examples/chat/smileys/.svn/text-base/laughingweak.png.svn-base
  215. BIN  examples/chat/smileys/.svn/text-base/laughwink.png.svn-base
  216. BIN  examples/chat/smileys/.svn/text-base/lightbulb.png.svn-base
  217. BIN  examples/chat/smileys/.svn/text-base/loveU.png.svn-base
  218. BIN  examples/chat/smileys/.svn/text-base/moneymouth.png.svn-base
  219. BIN  examples/chat/smileys/.svn/text-base/moon.png.svn-base
  220. BIN  examples/chat/smileys/.svn/text-base/movie.png.svn-base
  221. BIN  examples/chat/smileys/.svn/text-base/music.png.svn-base
  222. BIN  examples/chat/smileys/.svn/text-base/naughty.png.svn-base
  223. BIN  examples/chat/smileys/.svn/text-base/nerd.png.svn-base
  224. BIN  examples/chat/smileys/.svn/text-base/oops.png.svn-base
  225. BIN  examples/chat/smileys/.svn/text-base/party.png.svn-base
  226. BIN  examples/chat/smileys/.svn/text-base/perfid.png.svn-base
  227. BIN  examples/chat/smileys/.svn/text-base/pig.png.svn-base
  228. BIN  examples/chat/smileys/.svn/text-base/pinch.png.svn-base
  229. BIN  examples/chat/smileys/.svn/text-base/pirate.png.svn-base
  230. BIN  examples/chat/smileys/.svn/text-base/pizza.png.svn-base
  231. BIN  examples/chat/smileys/.svn/text-base/po content.png.svn-base
  232. BIN  examples/chat/smileys/.svn/text-base/policeman.png.svn-base
  233. BIN  examples/chat/smileys/.svn/text-base/present.png.svn-base
  234. BIN  examples/chat/smileys/.svn/text-base/question.png.svn-base
  235. BIN  examples/chat/smileys/.svn/text-base/rabbit.png.svn-base
  236. BIN  examples/chat/smileys/.svn/text-base/rain.png.svn-base
  237. BIN  examples/chat/smileys/.svn/text-base/rainbow.png.svn-base
  238. BIN  examples/chat/smileys/.svn/text-base/rasta.png.svn-base
  239. BIN  examples/chat/smileys/.svn/text-base/rose.png.svn-base
  240. BIN  examples/chat/smileys/.svn/text-base/santa.png.svn-base
  241. BIN  examples/chat/smileys/.svn/text-base/sarcastic.png.svn-base
  242. BIN  examples/chat/smileys/.svn/text-base/sars.png.svn-base
  243. BIN  examples/chat/smileys/.svn/text-base/sealed.png.svn-base
  244. BIN  examples/chat/smileys/.svn/text-base/shaun.png.svn-base
  245. BIN  examples/chat/smileys/.svn/text-base/sick.png.svn-base
  246. BIN  examples/chat/smileys/.svn/text-base/slant.png.svn-base
  247. BIN  examples/chat/smileys/.svn/text-base/sleep.png.svn-base
  248. BIN  examples/chat/smileys/.svn/text-base/smile.png.svn-base
  249. BIN  examples/chat/smileys/.svn/text-base/sorcerer.png.svn-base
  250. BIN  examples/chat/smileys/.svn/text-base/star.png.svn-base
  251. BIN  examples/chat/smileys/.svn/text-base/stuart.png.svn-base
  252. BIN  examples/chat/smileys/.svn/text-base/sun.png.svn-base
  253. BIN  examples/chat/smileys/.svn/text-base/thumbsdown.png.svn-base
  254. BIN  examples/chat/smileys/.svn/text-base/thumbsup.png.svn-base
  255. BIN  examples/chat/smileys/.svn/text-base/tongue.png.svn-base
  256. BIN  examples/chat/smileys/.svn/text-base/turned.png.svn-base
  257. BIN  examples/chat/smileys/.svn/text-base/unsure.png.svn-base
  258. BIN  examples/chat/smileys/.svn/text-base/very_cool.png.svn-base
  259. BIN  examples/chat/smileys/.svn/text-base/very_tired.png.svn-base
  260. BIN  examples/chat/smileys/.svn/text-base/very_tyred2.png.svn-base
  261. BIN  examples/chat/smileys/.svn/text-base/wOOt.png.svn-base
  262. BIN  examples/chat/smileys/.svn/text-base/wassat.png.svn-base
  263. BIN  examples/chat/smileys/.svn/text-base/weak.png.svn-base
  264. BIN  examples/chat/smileys/.svn/text-base/whistling.png.svn-base
  265. BIN  examples/chat/smileys/.svn/text-base/wink.png.svn-base
  266. BIN  examples/chat/smileys/.svn/text-base/wub.png.svn-base
  267. BIN  examples/chat/smileys/.svn/text-base/yuck.png.svn-base
  268. BIN  examples/chat/smileys/.svn/text-base/yum.png.svn-base
  269. BIN  examples/chat/smileys/.svn/text-base/zorro.png.svn-base
  270. BIN  examples/chat/smileys/2fingers.png
  271. BIN  examples/chat/smileys/2love.png
  272. +1,276 −0 examples/chat/smileys/Emoticons.plist
  273. BIN  examples/chat/smileys/LOL.png
  274. BIN  examples/chat/smileys/Mr Po.png
  275. BIN  examples/chat/smileys/O_o.png
  276. BIN  examples/chat/smileys/alien.png
  277. BIN  examples/chat/smileys/ambivalent.png
  278. BIN  examples/chat/smileys/angry.png
  279. BIN  examples/chat/smileys/angry2.png
  280. BIN  examples/chat/smileys/ass.png
  281. BIN  examples/chat/smileys/baby.png
  282. BIN  examples/chat/smileys/baby2.png
  283. BIN  examples/chat/smileys/barbu.png
  284. BIN  examples/chat/smileys/beer.png
  285. BIN  examples/chat/smileys/beret.png
  286. BIN  examples/chat/smileys/bigkiss.png
  287. BIN  examples/chat/smileys/bigsmile.png
  288. BIN  examples/chat/smileys/blushing.png
  289. BIN  examples/chat/smileys/brokenheart.png
  290. BIN  examples/chat/smileys/bye.png
  291. BIN  examples/chat/smileys/cake.png
  292. BIN  examples/chat/smileys/cell.png
  293. BIN  examples/chat/smileys/chinois.png
  294. BIN  examples/chat/smileys/clock.png
  295. BIN  examples/chat/smileys/cocktail.png
  296. BIN  examples/chat/smileys/coffee.png
  297. BIN  examples/chat/smileys/cold.png
  298. BIN  examples/chat/smileys/confused.png
  299. BIN  examples/chat/smileys/cool.png
  300. BIN  examples/chat/smileys/crazy.png
Sorry, we could not display the entire diff because too many files (1,221) changed.
202 LICENSE
View
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
47 client/diff_match_patch.js
View
@@ -0,0 +1,47 @@
+(function(){var a;function diff_match_patch(){function b(){for(var c=0,e=1,d=2;e!=d;){c++;e=d;d<<=1}return c}this.Diff_Timeout=1;this.Diff_EditCost=4;this.Diff_DualThreshold=32;this.Match_Threshold=0.5;this.Match_Distance=1E3;this.Patch_DeleteThreshold=0.5;this.Patch_Margin=4;this.Match_MaxBits=b()}a=diff_match_patch.prototype;
+a.diff_main=function(b,c,e){if(b==null||c==null)throw Error("Null input. (diff_main)");if(b==c)return[[0,b]];if(typeof e=="undefined")e=true;var d=e,f=this.diff_commonPrefix(b,c);e=b.substring(0,f);b=b.substring(f);c=c.substring(f);f=this.diff_commonSuffix(b,c);var h=b.substring(b.length-f);b=b.substring(0,b.length-f);c=c.substring(0,c.length-f);b=this.diff_compute(b,c,d);e&&b.unshift([0,e]);h&&b.push([0,h]);this.diff_cleanupMerge(b);return b};
+a.diff_compute=function(b,c,e){var d;if(!b)return[[1,c]];if(!c)return[[-1,b]];d=b.length>c.length?b:c;var f=b.length>c.length?c:b,h=d.indexOf(f);if(h!=-1){d=[[1,d.substring(0,h)],[0,f],[1,d.substring(h+f.length)]];if(b.length>c.length)d[0][0]=d[2][0]=-1;return d}if(d=this.diff_halfMatch(b,c)){var g=d[0];b=d[1];f=d[2];c=d[3];d=d[4];g=this.diff_main(g,f,e);e=this.diff_main(b,c,e);return g.concat([[0,d]],e)}if(e&&(b.length<100||c.length<100))e=false;if(e){g=this.diff_linesToChars(b,c);b=g[0];c=g[1];
+g=g[2]}(d=this.diff_map(b,c))||(d=[[-1,b],[1,c]]);if(e){this.diff_charsToLines(d,g);this.diff_cleanupSemantic(d);d.push([0,""]);c=b=e=0;for(f=g="";e<d.length;){switch(d[e][0]){case 1:c++;f+=d[e][1];break;case -1:b++;g+=d[e][1];break;case 0:if(b>=1&&c>=1){g=this.diff_main(g,f,false);d.splice(e-b-c,b+c);e=e-b-c;for(b=g.length-1;b>=0;b--)d.splice(e,0,g[b]);e+=g.length}b=c=0;f=g="";break}e++}d.pop()}return d};
+a.diff_linesToChars=function(b,c){function e(i){for(var k="",j=0,l=-1,m=d.length;l<i.length-1;){l=i.indexOf("\n",j);if(l==-1)l=i.length-1;var n=i.substring(j,l+1);j=l+1;if(f.hasOwnProperty?f.hasOwnProperty(n):f[n]!==undefined)k+=String.fromCharCode(f[n]);else{k+=String.fromCharCode(m);f[n]=m;d[m++]=n}}return k}var d=[],f={};d[0]="";var h=e(b),g=e(c);return[h,g,d]};
+a.diff_charsToLines=function(b,c){for(var e=0;e<b.length;e++){for(var d=b[e][1],f=[],h=0;h<d.length;h++)f[h]=c[d.charCodeAt(h)];b[e][1]=f.join("")}};
+a.diff_map=function(b,c){var e=(new Date).getTime()+this.Diff_Timeout*1E3,d=b.length,f=c.length,h=d+f-1,g=this.Diff_DualThreshold*2<h,i=[],k=[],j={},l={};j[1]=0;l[1]=0;for(var m,n,o,p={},t=false,s=(d+f)%2,r=0;r<h;r++){if(this.Diff_Timeout>0&&(new Date).getTime()>e)return null;i[r]={};for(var q=-r;q<=r;q+=2){m=q==-r||q!=r&&j[q-1]<j[q+1]?j[q+1]:j[q-1]+1;n=m-q;if(g){o=m+","+n;if(s&&p[o]!==undefined)t=true;s||(p[o]=r)}for(;!t&&m<d&&n<f&&b.charAt(m)==c.charAt(n);){m++;n++;if(g){o=m+","+n;if(s&&p[o]!==
+undefined)t=true;s||(p[o]=r)}}j[q]=m;i[r][m+","+n]=true;if(m==d&&n==f)return this.diff_path1(i,b,c);else if(t){k=k.slice(0,p[o]+1);e=this.diff_path1(i,b.substring(0,m),c.substring(0,n));return e.concat(this.diff_path2(k,b.substring(m),c.substring(n)))}}if(g){k[r]={};for(q=-r;q<=r;q+=2){m=q==-r||q!=r&&l[q-1]<l[q+1]?l[q+1]:l[q-1]+1;n=m-q;o=d-m+","+(f-n);if(!s&&p[o]!==undefined)t=true;if(s)p[o]=r;for(;!t&&m<d&&n<f&&b.charAt(d-m-1)==c.charAt(f-n-1);){m++;n++;o=d-m+","+(f-n);if(!s&&p[o]!==undefined)t=
+true;if(s)p[o]=r}l[q]=m;k[r][m+","+n]=true;if(t){i=i.slice(0,p[o]+1);e=this.diff_path1(i,b.substring(0,d-m),c.substring(0,f-n));return e.concat(this.diff_path2(k,b.substring(d-m),c.substring(f-n)))}}}}return null};
+a.diff_path1=function(b,c,e){for(var d=[],f=c.length,h=e.length,g=null,i=b.length-2;i>=0;i--)for(;;)if(b[i][f-1+","+h]!==undefined){f--;if(g===-1)d[0][1]=c.charAt(f)+d[0][1];else d.unshift([-1,c.charAt(f)]);g=-1;break}else if(b[i][f+","+(h-1)]!==undefined){h--;if(g===1)d[0][1]=e.charAt(h)+d[0][1];else d.unshift([1,e.charAt(h)]);g=1;break}else{f--;h--;if(c.charAt(f)!=e.charAt(h))throw Error("No diagonal. Can't happen. (diff_path1)");if(g===0)d[0][1]=c.charAt(f)+d[0][1];else d.unshift([0,c.charAt(f)]);
+g=0}return d};
+a.diff_path2=function(b,c,e){for(var d=[],f=0,h=c.length,g=e.length,i=null,k=b.length-2;k>=0;k--)for(;;)if(b[k][h-1+","+g]!==undefined){h--;if(i===-1)d[f-1][1]+=c.charAt(c.length-h-1);else d[f++]=[-1,c.charAt(c.length-h-1)];i=-1;break}else if(b[k][h+","+(g-1)]!==undefined){g--;if(i===1)d[f-1][1]+=e.charAt(e.length-g-1);else d[f++]=[1,e.charAt(e.length-g-1)];i=1;break}else{h--;g--;if(c.charAt(c.length-h-1)!=e.charAt(e.length-g-1))throw Error("No diagonal. Can't happen. (diff_path2)");if(i===0)d[f-
+1][1]+=c.charAt(c.length-h-1);else d[f++]=[0,c.charAt(c.length-h-1)];i=0}return d};a.diff_commonPrefix=function(b,c){if(!b||!c||b.charAt(0)!=c.charAt(0))return 0;for(var e=0,d=Math.min(b.length,c.length),f=d,h=0;e<f;){if(b.substring(h,f)==c.substring(h,f))h=e=f;else d=f;f=Math.floor((d-e)/2+e)}return f};
+a.diff_commonSuffix=function(b,c){if(!b||!c||b.charAt(b.length-1)!=c.charAt(c.length-1))return 0;for(var e=0,d=Math.min(b.length,c.length),f=d,h=0;e<f;){if(b.substring(b.length-f,b.length-h)==c.substring(c.length-f,c.length-h))h=e=f;else d=f;f=Math.floor((d-e)/2+e)}return f};
+a.diff_halfMatch=function(b,c){function e(j,l,m){for(var n=j.substring(m,m+Math.floor(j.length/4)),o=-1,p="",t,s,r,q;(o=l.indexOf(n,o+1))!=-1;){var u=h.diff_commonPrefix(j.substring(m),l.substring(o)),v=h.diff_commonSuffix(j.substring(0,m),l.substring(0,o));if(p.length<v+u){p=l.substring(o-v,o)+l.substring(o,o+u);t=j.substring(0,m-v);s=j.substring(m+u);r=l.substring(0,o-v);q=l.substring(o+u)}}return p.length>=j.length/2?[t,s,r,q,p]:null}var d=b.length>c.length?b:c,f=b.length>c.length?c:b;if(d.length<
+10||f.length<1)return null;var h=this,g=e(d,f,Math.ceil(d.length/4));d=e(d,f,Math.ceil(d.length/2));var i;if(!g&&!d)return null;else i=d?g?g[4].length>d[4].length?g:d:d:g;var k;if(b.length>c.length){g=i[0];d=i[1];f=i[2];k=i[3]}else{f=i[0];k=i[1];g=i[2];d=i[3]}i=i[4];return[g,d,f,k,i]};
+a.diff_cleanupSemantic=function(b){for(var c=false,e=[],d=0,f=null,h=0,g=0,i=0;h<b.length;){if(b[h][0]==0){e[d++]=h;g=i;i=0;f=b[h][1]}else{i+=b[h][1].length;if(f!==null&&f.length<=g&&f.length<=i){b.splice(e[d-1],0,[-1,f]);b[e[d-1]+1][0]=1;d--;d--;h=d>0?e[d-1]:-1;i=g=0;f=null;c=true}}h++}c&&this.diff_cleanupMerge(b);this.diff_cleanupSemanticLossless(b)};
+a.diff_cleanupSemanticLossless=function(b){function c(s,r){if(!s||!r)return 5;var q=0;if(s.charAt(s.length-1).match(e)||r.charAt(0).match(e)){q++;if(s.charAt(s.length-1).match(d)||r.charAt(0).match(d)){q++;if(s.charAt(s.length-1).match(f)||r.charAt(0).match(f)){q++;if(s.match(h)||r.match(g))q++}}}return q}for(var e=/[^a-zA-Z0-9]/,d=/\s/,f=/[\r\n]/,h=/\n\r?\n$/,g=/^\r?\n\r?\n/,i=1;i<b.length-1;){if(b[i-1][0]==0&&b[i+1][0]==0){var k=b[i-1][1],j=b[i][1],l=b[i+1][1],m=this.diff_commonSuffix(k,j);if(m){var n=
+j.substring(j.length-m);k=k.substring(0,k.length-m);j=n+j.substring(0,j.length-m);l=n+l}m=k;n=j;for(var o=l,p=c(k,j)+c(j,l);j.charAt(0)===l.charAt(0);){k+=j.charAt(0);j=j.substring(1)+l.charAt(0);l=l.substring(1);var t=c(k,j)+c(j,l);if(t>=p){p=t;m=k;n=j;o=l}}if(b[i-1][1]!=m){if(m)b[i-1][1]=m;else{b.splice(i-1,1);i--}b[i][1]=n;if(o)b[i+1][1]=o;else{b.splice(i+1,1);i--}}}i++}};
+a.diff_cleanupEfficiency=function(b){for(var c=false,e=[],d=0,f="",h=0,g=false,i=false,k=false,j=false;h<b.length;){if(b[h][0]==0){if(b[h][1].length<this.Diff_EditCost&&(k||j)){e[d++]=h;g=k;i=j;f=b[h][1]}else{d=0;f=""}k=j=false}else{if(b[h][0]==-1)j=true;else k=true;if(f&&(g&&i&&k&&j||f.length<this.Diff_EditCost/2&&g+i+k+j==3)){b.splice(e[d-1],0,[-1,f]);b[e[d-1]+1][0]=1;d--;f="";if(g&&i){k=j=true;d=0}else{d--;h=d>0?e[d-1]:-1;k=j=false}c=true}}h++}c&&this.diff_cleanupMerge(b)};
+a.diff_cleanupMerge=function(b){b.push([0,""]);for(var c=0,e=0,d=0,f="",h="",g;c<b.length;)switch(b[c][0]){case 1:d++;h+=b[c][1];c++;break;case -1:e++;f+=b[c][1];c++;break;case 0:if(e!==0||d!==0){if(e!==0&&d!==0){g=this.diff_commonPrefix(h,f);if(g!==0){if(c-e-d>0&&b[c-e-d-1][0]==0)b[c-e-d-1][1]+=h.substring(0,g);else{b.splice(0,0,[0,h.substring(0,g)]);c++}h=h.substring(g);f=f.substring(g)}g=this.diff_commonSuffix(h,f);if(g!==0){b[c][1]=h.substring(h.length-g)+b[c][1];h=h.substring(0,h.length-g);f=
+f.substring(0,f.length-g)}}if(e===0)b.splice(c-e-d,e+d,[1,h]);else d===0?b.splice(c-e-d,e+d,[-1,f]):b.splice(c-e-d,e+d,[-1,f],[1,h]);c=c-e-d+(e?1:0)+(d?1:0)+1}else if(c!==0&&b[c-1][0]==0){b[c-1][1]+=b[c][1];b.splice(c,1)}else c++;e=d=0;h=f="";break}b[b.length-1][1]===""&&b.pop();e=false;for(c=1;c<b.length-1;){if(b[c-1][0]==0&&b[c+1][0]==0)if(b[c][1].substring(b[c][1].length-b[c-1][1].length)==b[c-1][1]){b[c][1]=b[c-1][1]+b[c][1].substring(0,b[c][1].length-b[c-1][1].length);b[c+1][1]=b[c-1][1]+b[c+
+1][1];b.splice(c-1,1);e=true}else if(b[c][1].substring(0,b[c+1][1].length)==b[c+1][1]){b[c-1][1]+=b[c+1][1];b[c][1]=b[c][1].substring(b[c+1][1].length)+b[c+1][1];b.splice(c+1,1);e=true}c++}e&&this.diff_cleanupMerge(b)};a.diff_xIndex=function(b,c){var e=0,d=0,f=0,h=0,g;for(g=0;g<b.length;g++){if(b[g][0]!==1)e+=b[g][1].length;if(b[g][0]!==-1)d+=b[g][1].length;if(e>c)break;f=e;h=d}if(b.length!=g&&b[g][0]===-1)return h;return h+(c-f)};
+a.diff_prettyHtml=function(b){for(var c=[],e=0,d=0;d<b.length;d++){var f=b[d][0],h=b[d][1],g=h.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\n/g,"&para;<BR>");switch(f){case 1:c[d]='<INS STYLE="background:#E6FFE6;" TITLE="i='+e+'">'+g+"</INS>";break;case -1:c[d]='<DEL STYLE="background:#FFE6E6;" TITLE="i='+e+'">'+g+"</DEL>";break;case 0:c[d]='<SPAN TITLE="i='+e+'">'+g+"</SPAN>";break}if(f!==-1)e+=h.length}return c.join("")};
+a.diff_text1=function(b){for(var c=[],e=0;e<b.length;e++)if(b[e][0]!==1)c[e]=b[e][1];return c.join("")};a.diff_text2=function(b){for(var c=[],e=0;e<b.length;e++)if(b[e][0]!==-1)c[e]=b[e][1];return c.join("")};a.diff_levenshtein=function(b){for(var c=0,e=0,d=0,f=0;f<b.length;f++){var h=b[f][0],g=b[f][1];switch(h){case 1:e+=g.length;break;case -1:d+=g.length;break;case 0:c+=Math.max(e,d);d=e=0;break}}c+=Math.max(e,d);return c};
+a.diff_toDelta=function(b){for(var c=[],e=0;e<b.length;e++)switch(b[e][0]){case 1:c[e]="+"+encodeURI(b[e][1]);break;case -1:c[e]="-"+b[e][1].length;break;case 0:c[e]="="+b[e][1].length;break}return c.join("\t").replace(/\x00/g,"%00").replace(/%20/g," ")};
+a.diff_fromDelta=function(b,c){var e=[],d=0,f=0;c=c.replace(/%00/g,"\u0000");for(var h=c.split(/\t/g),g=0;g<h.length;g++){var i=h[g].substring(1);switch(h[g].charAt(0)){case "+":try{e[d++]=[1,decodeURI(i)]}catch(k){throw Error("Illegal escape in diff_fromDelta: "+i);}break;case "-":case "=":var j=parseInt(i,10);if(isNaN(j)||j<0)throw Error("Invalid number in diff_fromDelta: "+i);i=b.substring(f,f+=j);if(h[g].charAt(0)=="=")e[d++]=[0,i];else e[d++]=[-1,i];break;default:if(h[g])throw Error("Invalid diff operation in diff_fromDelta: "+
+h[g]);}}if(f!=b.length)throw Error("Delta length ("+f+") does not equal source text length ("+b.length+").");return e};a.match_main=function(b,c,e){if(b==null||c==null||e==null)throw Error("Null input. (match_main)");e=Math.max(0,Math.min(e,b.length));return b==c?0:b.length?b.substring(e,e+c.length)==c?e:this.match_bitap(b,c,e):-1};
+a.match_bitap=function(b,c,e){function d(s,r){var q=s/c.length,u=Math.abs(e-r);if(!h.Match_Distance)return u?1:q;return q+u/h.Match_Distance}if(c.length>this.Match_MaxBits)throw Error("Pattern too long for this browser.");var f=this.match_alphabet(c),h=this,g=this.Match_Threshold,i=b.indexOf(c,e);if(i!=-1){g=Math.min(d(0,i),g);i=b.lastIndexOf(c,e+c.length);if(i!=-1)g=Math.min(d(0,i),g)}var k=1<<c.length-1;i=-1;for(var j,l,m=c.length+b.length,n,o=0;o<c.length;o++){j=0;for(l=m;j<l;){if(d(o,e+l)<=g)j=
+l;else m=l;l=Math.floor((m-j)/2+j)}m=l;j=Math.max(1,e-l+1);var p=Math.min(e+l,b.length)+c.length;l=Array(p+2);l[p+1]=(1<<o)-1;for(p=p;p>=j;p--){var t=f[b.charAt(p-1)];l[p]=o===0?(l[p+1]<<1|1)&t:(l[p+1]<<1|1)&t|(n[p+1]|n[p])<<1|1|n[p+1];if(l[p]&k){t=d(o,p-1);if(t<=g){g=t;i=p-1;if(i>e)j=Math.max(1,2*e-i);else break}}}if(d(o+1,e)>g)break;n=l}return i};a.match_alphabet=function(b){for(var c={},e=0;e<b.length;e++)c[b.charAt(e)]=0;for(e=0;e<b.length;e++)c[b.charAt(e)]|=1<<b.length-e-1;return c};
+a.patch_addContext=function(b,c){if(c.length!=0){for(var e=c.substring(b.start2,b.start2+b.length1),d=0;c.indexOf(e)!=c.lastIndexOf(e)&&e.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;){d+=this.Patch_Margin;e=c.substring(b.start2-d,b.start2+b.length1+d)}d+=this.Patch_Margin;(e=c.substring(b.start2-d,b.start2))&&b.diffs.unshift([0,e]);(d=c.substring(b.start2+b.length1,b.start2+b.length1+d))&&b.diffs.push([0,d]);b.start1-=e.length;b.start2-=e.length;b.length1+=e.length+d.length;b.length2+=
+e.length+d.length}};
+a.patch_make=function(b,c,e){var d;if(typeof b=="string"&&typeof c=="string"&&typeof e=="undefined"){d=b;c=this.diff_main(d,c,true);if(c.length>2){this.diff_cleanupSemantic(c);this.diff_cleanupEfficiency(c)}}else if(b&&typeof b=="object"&&typeof c=="undefined"&&typeof e=="undefined"){c=b;d=this.diff_text1(c)}else if(typeof b=="string"&&c&&typeof c=="object"&&typeof e=="undefined"){d=b;c=c}else if(typeof b=="string"&&typeof c=="string"&&e&&typeof e=="object"){d=b;c=e}else throw Error("Unknown call format to patch_make.");if(c.length===
+0)return[];e=[];b=new patch_obj;var f=0,h=0,g=0,i=d;d=d;for(var k=0;k<c.length;k++){var j=c[k][0],l=c[k][1];if(!f&&j!==0){b.start1=h;b.start2=g}switch(j){case 1:b.diffs[f++]=c[k];b.length2+=l.length;d=d.substring(0,g)+l+d.substring(g);break;case -1:b.length1+=l.length;b.diffs[f++]=c[k];d=d.substring(0,g)+d.substring(g+l.length);break;case 0:if(l.length<=2*this.Patch_Margin&&f&&c.length!=k+1){b.diffs[f++]=c[k];b.length1+=l.length;b.length2+=l.length}else if(l.length>=2*this.Patch_Margin)if(f){this.patch_addContext(b,
+i);e.push(b);b=new patch_obj;f=0;i=d;h=g}break}if(j!==1)h+=l.length;if(j!==-1)g+=l.length}if(f){this.patch_addContext(b,i);e.push(b)}return e};a.patch_deepCopy=function(b){for(var c=[],e=0;e<b.length;e++){var d=b[e],f=new patch_obj;f.diffs=[];for(var h=0;h<d.diffs.length;h++)f.diffs[h]=d.diffs[h].slice();f.start1=d.start1;f.start2=d.start2;f.length1=d.length1;f.length2=d.length2;c[e]=f}return c};
+a.patch_apply=function(b,c){if(b.length==0)return[c,[]];b=this.patch_deepCopy(b);var e=this.patch_addPadding(b);c=e+c+e;this.patch_splitMax(b);for(var d=0,f=[],h=0;h<b.length;h++){var g=b[h].start2+d,i=this.diff_text1(b[h].diffs),k,j=-1;if(i.length>this.Match_MaxBits){k=this.match_main(c,i.substring(0,this.Match_MaxBits),g);if(k!=-1){j=this.match_main(c,i.substring(i.length-this.Match_MaxBits),g+i.length-this.Match_MaxBits);if(j==-1||k>=j)k=-1}}else k=this.match_main(c,i,g);if(k==-1){f[h]=false;d-=
+b[h].length2-b[h].length1}else{f[h]=true;d=k-g;g=j==-1?c.substring(k,k+i.length):c.substring(k,j+this.Match_MaxBits);if(i==g)c=c.substring(0,k)+this.diff_text2(b[h].diffs)+c.substring(k+i.length);else{g=this.diff_main(i,g,false);if(i.length>this.Match_MaxBits&&this.diff_levenshtein(g)/i.length>this.Patch_DeleteThreshold)f[h]=false;else{this.diff_cleanupSemanticLossless(g);i=0;var l;for(j=0;j<b[h].diffs.length;j++){var m=b[h].diffs[j];if(m[0]!==0)l=this.diff_xIndex(g,i);if(m[0]===1)c=c.substring(0,
+k+l)+m[1]+c.substring(k+l);else if(m[0]===-1)c=c.substring(0,k+l)+c.substring(k+this.diff_xIndex(g,i+m[1].length));if(m[0]!==-1)i+=m[1].length}}}}}c=c.substring(e.length,c.length-e.length);return[c,f]};
+a.patch_addPadding=function(b){for(var c=this.Patch_Margin,e="",d=1;d<=c;d++)e+=String.fromCharCode(d);for(d=0;d<b.length;d++){b[d].start1+=c;b[d].start2+=c}d=b[0];var f=d.diffs;if(f.length==0||f[0][0]!=0){f.unshift([0,e]);d.start1-=c;d.start2-=c;d.length1+=c;d.length2+=c}else if(c>f[0][1].length){var h=c-f[0][1].length;f[0][1]=e.substring(f[0][1].length)+f[0][1];d.start1-=h;d.start2-=h;d.length1+=h;d.length2+=h}d=b[b.length-1];f=d.diffs;if(f.length==0||f[f.length-1][0]!=0){f.push([0,e]);d.length1+=
+c;d.length2+=c}else if(c>f[f.length-1][1].length){h=c-f[f.length-1][1].length;f[f.length-1][1]+=e.substring(0,h);d.length1+=h;d.length2+=h}return e};
+a.patch_splitMax=function(b){for(var c=0;c<b.length;c++)if(b[c].length1>this.Match_MaxBits){var e=b[c];b.splice(c--,1);for(var d=this.Match_MaxBits,f=e.start1,h=e.start2,g="";e.diffs.length!==0;){var i=new patch_obj,k=true;i.start1=f-g.length;i.start2=h-g.length;if(g!==""){i.length1=i.length2=g.length;i.diffs.push([0,g])}for(;e.diffs.length!==0&&i.length1<d-this.Patch_Margin;){g=e.diffs[0][0];var j=e.diffs[0][1];if(g===1){i.length2+=j.length;h+=j.length;i.diffs.push(e.diffs.shift());k=false}else if(g===
+-1&&i.diffs.length==1&&i.diffs[0][0]==0&&j.length>2*d){i.length1+=j.length;f+=j.length;k=false;i.diffs.push([g,j]);e.diffs.shift()}else{j=j.substring(0,d-i.length1-this.Patch_Margin);i.length1+=j.length;f+=j.length;if(g===0){i.length2+=j.length;h+=j.length}else k=false;i.diffs.push([g,j]);if(j==e.diffs[0][1])e.diffs.shift();else e.diffs[0][1]=e.diffs[0][1].substring(j.length)}}g=this.diff_text2(i.diffs);g=g.substring(g.length-this.Patch_Margin);j=this.diff_text1(e.diffs).substring(0,this.Patch_Margin);
+if(j!==""){i.length1+=j.length;i.length2+=j.length;if(i.diffs.length!==0&&i.diffs[i.diffs.length-1][0]===0)i.diffs[i.diffs.length-1][1]+=j;else i.diffs.push([0,j])}k||b.splice(++c,0,i)}}};a.patch_toText=function(b){for(var c=[],e=0;e<b.length;e++)c[e]=b[e];return c.join("")};
+a.patch_fromText=function(b){var c=[];if(!b)return c;b=b.replace(/%00/g,"\u0000");b=b.split("\n");for(var e=0;e<b.length;){var d=b[e].match(/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/);if(!d)throw Error("Invalid patch string: "+b[e]);var f=new patch_obj;c.push(f);f.start1=parseInt(d[1],10);if(d[2]===""){f.start1--;f.length1=1}else if(d[2]=="0")f.length1=0;else{f.start1--;f.length1=parseInt(d[2],10)}f.start2=parseInt(d[3],10);if(d[4]===""){f.start2--;f.length2=1}else if(d[4]=="0")f.length2=0;else{f.start2--;
+f.length2=parseInt(d[4],10)}for(e++;e<b.length;){d=b[e].charAt(0);try{var h=decodeURI(b[e].substring(1))}catch(g){throw Error("Illegal escape in patch_fromText: "+h);}if(d=="-")f.diffs.push([-1,h]);else if(d=="+")f.diffs.push([1,h]);else if(d==" ")f.diffs.push([0,h]);else if(d=="@")break;else if(d!=="")throw Error('Invalid patch mode "'+d+'" in: '+h);e++}}return c};function patch_obj(){this.diffs=[];this.start2=this.start1=null;this.length2=this.length1=0}
+patch_obj.prototype.toString=function(){var b,c;b=this.length1===0?this.start1+",0":this.length1==1?this.start1+1:this.start1+1+","+this.length1;c=this.length2===0?this.start2+",0":this.length2==1?this.start2+1:this.start2+1+","+this.length2;b=["@@ -"+b+" +"+c+" @@\n"];var e;for(c=0;c<this.diffs.length;c++){switch(this.diffs[c][0]){case 1:e="+";break;case -1:e="-";break;case 0:e=" ";break}b[c+1]=e+encodeURI(this.diffs[c][1])+"\n"}return b.join("").replace(/\x00/g,"%00").replace(/%20/g," ")};
+window.diff_match_patch=diff_match_patch;window.patch_obj=patch_obj;window.DIFF_DELETE=-1;window.DIFF_INSERT=1;window.DIFF_EQUAL=0;})()
481 client/json2.js
View
@@ -0,0 +1,481 @@
+/*
+ http://www.JSON.org/json2.js
+ 2009-09-29
+
+ Public Domain.
+
+ NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
+
+ See http://www.JSON.org/js.html
+
+
+ This code should be minified before deployment.
+ See http://javascript.crockford.com/jsmin.html
+
+ USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
+ NOT CONTROL.
+
+
+ This file creates a global JSON object containing two methods: stringify
+ and parse.
+
+ JSON.stringify(value, replacer, space)
+ value any JavaScript value, usually an object or array.
+
+ replacer an optional parameter that determines how object
+ values are stringified for objects. It can be a
+ function or an array of strings.
+
+ space an optional parameter that specifies the indentation
+ of nested structures. If it is omitted, the text will
+ be packed without extra whitespace. If it is a number,
+ it will specify the number of spaces to indent at each
+ level. If it is a string (such as '\t' or '&nbsp;'),
+ it contains the characters used to indent at each level.
+
+ This method produces a JSON text from a JavaScript value.
+
+ When an object value is found, if the object contains a toJSON
+ method, its toJSON method will be called and the result will be
+ stringified. A toJSON method does not serialize: it returns the
+ value represented by the name/value pair that should be serialized,
+ or undefined if nothing should be serialized. The toJSON method
+ will be passed the key associated with the value, and this will be
+ bound to the value
+
+ For example, this would serialize Dates as ISO strings.
+
+ Date.prototype.toJSON = function (key) {
+ function f(n) {
+ // Format integers to have at least two digits.
+ return n < 10 ? '0' + n : n;
+ }
+
+ return this.getUTCFullYear() + '-' +
+ f(this.getUTCMonth() + 1) + '-' +
+ f(this.getUTCDate()) + 'T' +
+ f(this.getUTCHours()) + ':' +
+ f(this.getUTCMinutes()) + ':' +
+ f(this.getUTCSeconds()) + 'Z';
+ };
+
+ You can provide an optional replacer method. It will be passed the
+ key and value of each member, with this bound to the containing
+ object. The value that is returned from your method will be
+ serialized. If your method returns undefined, then the member will
+ be excluded from the serialization.
+
+ If the replacer parameter is an array of strings, then it will be
+ used to select the members to be serialized. It filters the results
+ such that only members with keys listed in the replacer array are
+ stringified.
+
+ Values that do not have JSON representations, such as undefined or
+ functions, will not be serialized. Such values in objects will be
+ dropped; in arrays they will be replaced with null. You can use
+ a replacer function to replace those with JSON values.
+ JSON.stringify(undefined) returns undefined.
+
+ The optional space parameter produces a stringification of the
+ value that is filled with line breaks and indentation to make it
+ easier to read.
+
+ If the space parameter is a non-empty string, then that string will
+ be used for indentation. If the space parameter is a number, then
+ the indentation will be that many spaces.
+
+ Example:
+
+ text = JSON.stringify(['e', {pluribus: 'unum'}]);
+ // text is '["e",{"pluribus":"unum"}]'
+
+
+ text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t');
+ // text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]'
+
+ text = JSON.stringify([new Date()], function (key, value) {
+ return this[key] instanceof Date ?
+ 'Date(' + this[key] + ')' : value;
+ });
+ // text is '["Date(---current time---)"]'
+
+
+ JSON.parse(text, reviver)
+ This method parses a JSON text to produce an object or array.
+ It can throw a SyntaxError exception.
+
+ The optional reviver parameter is a function that can filter and
+ transform the results. It receives each of the keys and values,
+ and its return value is used instead of the original value.
+ If it returns what it received, then the structure is not modified.
+ If it returns undefined then the member is deleted.
+
+ Example:
+
+ // Parse the text. Values that look like ISO date strings will
+ // be converted to Date objects.
+
+ myData = JSON.parse(text, function (key, value) {
+ var a;
+ if (typeof value === 'string') {
+ a =
+/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);
+ if (a) {
+ return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],
+ +a[5], +a[6]));
+ }
+ }
+ return value;
+ });
+
+ myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) {
+ var d;
+ if (typeof value === 'string' &&
+ value.slice(0, 5) === 'Date(' &&
+ value.slice(-1) === ')') {
+ d = new Date(value.slice(5, -1));
+ if (d) {
+ return d;
+ }
+ }
+ return value;
+ });
+
+
+ This is a reference implementation. You are free to copy, modify, or
+ redistribute.
+*/
+
+/*jslint evil: true, strict: false */
+
+/*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply,
+ call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,
+ getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,
+ lastIndex, length, parse, prototype, push, replace, slice, stringify,
+ test, toJSON, toString, valueOf
+*/
+
+
+// Create a JSON object only if one does not already exist. We create the
+// methods in a closure to avoid creating global variables.
+
+if (!this.JSON) {
+ this.JSON = {};
+}
+
+(function () {
+
+ function f(n) {
+ // Format integers to have at least two digits.
+ return n < 10 ? '0' + n : n;
+ }
+
+ if (typeof Date.prototype.toJSON !== 'function') {
+
+ Date.prototype.toJSON = function (key) {
+
+ return isFinite(this.valueOf()) ?
+ this.getUTCFullYear() + '-' +
+ f(this.getUTCMonth() + 1) + '-' +
+ f(this.getUTCDate()) + 'T' +
+ f(this.getUTCHours()) + ':' +
+ f(this.getUTCMinutes()) + ':' +
+ f(this.getUTCSeconds()) + 'Z' : null;
+ };
+
+ String.prototype.toJSON =
+ Number.prototype.toJSON =
+ Boolean.prototype.toJSON = function (key) {
+ return this.valueOf();
+ };
+ }
+
+ var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
+ escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
+ gap,
+ indent,
+ meta = { // table of character substitutions
+ '\b': '\\b',
+ '\t': '\\t',
+ '\n': '\\n',
+ '\f': '\\f',
+ '\r': '\\r',
+ '"' : '\\"',
+ '\\': '\\\\'
+ },
+ rep;
+
+
+ function quote(string) {
+
+// If the string contains no control characters, no quote characters, and no
+// backslash characters, then we can safely slap some quotes around it.
+// Otherwise we must also replace the offending characters with safe escape
+// sequences.
+
+ escapable.lastIndex = 0;
+ return escapable.test(string) ?
+ '"' + string.replace(escapable, function (a) {
+ var c = meta[a];
+ return typeof c === 'string' ? c :
+ '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
+ }) + '"' :
+ '"' + string + '"';
+ }
+
+
+ function str(key, holder) {
+
+// Produce a string from holder[key].
+
+ var i, // The loop counter.
+ k, // The member key.
+ v, // The member value.
+ length,
+ mind = gap,
+ partial,
+ value = holder[key];
+
+// If the value has a toJSON method, call it to obtain a replacement value.
+
+ if (value && typeof value === 'object' &&
+ typeof value.toJSON === 'function') {
+ value = value.toJSON(key);
+ }
+
+// If we were called with a replacer function, then call the replacer to
+// obtain a replacement value.
+
+ if (typeof rep === 'function') {
+ value = rep.call(holder, key, value);
+ }
+
+// What happens next depends on the value's type.
+
+ switch (typeof value) {
+ case 'string':
+ return quote(value);
+
+ case 'number':
+
+// JSON numbers must be finite. Encode non-finite numbers as null.
+
+ return isFinite(value) ? String(value) : 'null';
+
+ case 'boolean':
+ case 'null':
+
+// If the value is a boolean or null, convert it to a string. Note:
+// typeof null does not produce 'null'. The case is included here in
+// the remote chance that this gets fixed someday.
+
+ return String(value);
+
+// If the type is 'object', we might be dealing with an object or an array or
+// null.
+
+ case 'object':
+
+// Due to a specification blunder in ECMAScript, typeof null is 'object',
+// so watch out for that case.
+
+ if (!value) {
+ return 'null';
+ }
+
+// Make an array to hold the partial results of stringifying this object value.
+
+ gap += indent;
+ partial = [];
+
+// Is the value an array?
+
+ if (Object.prototype.toString.apply(value) === '[object Array]') {
+
+// The value is an array. Stringify every element. Use null as a placeholder
+// for non-JSON values.
+
+ length = value.length;
+ for (i = 0; i < length; i += 1) {
+ partial[i] = str(i, value) || 'null';
+ }
+
+// Join all of the elements together, separated with commas, and wrap them in
+// brackets.
+
+ v = partial.length === 0 ? '[]' :
+ gap ? '[\n' + gap +
+ partial.join(',\n' + gap) + '\n' +
+ mind + ']' :
+ '[' + partial.join(',') + ']';
+ gap = mind;
+ return v;
+ }
+
+// If the replacer is an array, use it to select the members to be stringified.
+
+ if (rep && typeof rep === 'object') {
+ length = rep.length;
+ for (i = 0; i < length; i += 1) {
+ k = rep[i];
+ if (typeof k === 'string') {
+ v = str(k, value);
+ if (v) {
+ partial.push(quote(k) + (gap ? ': ' : ':') + v);
+ }
+ }
+ }
+ } else {
+
+// Otherwise, iterate through all of the keys in the object.
+
+ for (k in value) {
+ if (Object.hasOwnProperty.call(value, k)) {
+ v = str(k, value);
+ if (v) {
+ partial.push(quote(k) + (gap ? ': ' : ':') + v);
+ }
+ }
+ }
+ }
+
+// Join all of the member texts together, separated with commas,
+// and wrap them in braces.
+
+ v = partial.length === 0 ? '{}' :
+ gap ? '{\n' + gap + partial.join(',\n' + gap) + '\n' +
+ mind + '}' : '{' + partial.join(',') + '}';
+ gap = mind;
+ return v;
+ }
+ }
+
+// If the JSON object does not yet have a stringify method, give it one.
+
+ if (typeof JSON.stringify !== 'function') {
+ JSON.stringify = function (value, replacer, space) {
+
+// The stringify method takes a value and an optional replacer, and an optional
+// space parameter, and returns a JSON text. The replacer can be a function
+// that can replace values, or an array of strings that will select the keys.
+// A default replacer method can be provided. Use of the space parameter can
+// produce text that is more easily readable.
+
+ var i;
+ gap = '';
+ indent = '';
+
+// If the space parameter is a number, make an indent string containing that
+// many spaces.
+
+ if (typeof space === 'number') {
+ for (i = 0; i < space; i += 1) {
+ indent += ' ';
+ }
+
+// If the space parameter is a string, it will be used as the indent string.
+
+ } else if (typeof space === 'string') {
+ indent = space;
+ }
+
+// If there is a replacer, it must be a function or an array.
+// Otherwise, throw an error.
+
+ rep = replacer;
+ if (replacer && typeof replacer !== 'function' &&
+ (typeof replacer !== 'object' ||
+ typeof replacer.length !== 'number')) {
+ throw new Error('JSON.stringify');
+ }
+
+// Make a fake root object containing our value under the key of ''.
+// Return the result of stringifying the value.
+
+ return str('', {'': value});
+ };
+ }
+
+
+// If the JSON object does not yet have a parse method, give it one.
+
+ if (typeof JSON.parse !== 'function') {
+ JSON.parse = function (text, reviver) {
+
+// The parse method takes a text and an optional reviver function, and returns
+// a JavaScript value if the text is a valid JSON text.
+
+ var j;
+
+ function walk(holder, key) {
+
+// The walk method is used to recursively walk the resulting structure so
+// that modifications can be made.
+
+ var k, v, value = holder[key];
+ if (value && typeof value === 'object') {
+ for (k in value) {
+ if (Object.hasOwnProperty.call(value, k)) {
+ v = walk(value, k);
+ if (v !== undefined) {
+ value[k] = v;
+ } else {
+ delete value[k];
+ }
+ }
+ }
+ }
+ return reviver.call(holder, key, value);
+ }
+
+
+// Parsing happens in four stages. In the first stage, we replace certain
+// Unicode characters with escape sequences. JavaScript handles many characters
+// incorrectly, either silently deleting them, or treating them as line endings.
+
+ cx.lastIndex = 0;
+ if (cx.test(text)) {
+ text = text.replace(cx, function (a) {
+ return '\\u' +
+ ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
+ });
+ }
+
+// In the second stage, we run the text against regular expressions that look
+// for non-JSON patterns. We are especially concerned with '()' and 'new'
+// because they can cause invocation, and '=' because it can cause mutation.
+// But just to be safe, we want to reject all unexpected forms.
+
+// We split the second stage into 4 regexp operations in order to work around
+// crippling inefficiencies in IE's and Safari's regexp engines. First we
+// replace the JSON backslash pairs with '@' (a non-JSON character). Second, we
+// replace all simple value tokens with ']' characters. Third, we delete all
+// open brackets that follow a colon or comma or that begin the text. Finally,
+// we look to see that the remaining characters are only whitespace or ']' or
+// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.
+
+ if (/^[\],:{}\s]*$/.
+test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@').
+replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']').
+replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
+
+// In the third stage we use the eval function to compile the text into a
+// JavaScript structure. The '{' operator is subject to a syntactic ambiguity
+// in JavaScript: it can begin a block or an object literal. We wrap the text
+// in parens to eliminate the ambiguity.
+
+ j = eval('(' + text + ')');
+
+// In the optional fourth stage, we recursively walk the new structure, passing
+// each name/value pair to a reviver function for possible transformation.
+
+ return typeof reviver === 'function' ?
+ walk({'': j}, '') : j;
+ }
+
+// If the text is not JSON parseable, then a SyntaxError is thrown.
+
+ throw new SyntaxError('JSON.parse');
+ };
+ }
+}());
1,925 client/socket.io.js
View
@@ -0,0 +1,1925 @@
+/** Socket.IO 0.6 - Built with build.js */
+/**
+ * Socket.IO client
+ *
+ * @author Guillermo Rauch <guillermo@learnboost.com>
+ * @license The MIT license.
+ * @copyright Copyright (c) 2010 LearnBoost <dev@learnboost.com>
+ */
+
+this.io = {
+ version: '0.6',
+
+ setPath: function(path){
+ if (window.console && console.error) console.error('io.setPath will be removed. Please set the variable WEB_SOCKET_SWF_LOCATION pointing to WebSocketMain.swf');
+ this.path = /\/$/.test(path) ? path : path + '/';
+ WEB_SOCKET_SWF_LOCATION = path + 'lib/vendor/web-socket-js/WebSocketMain.swf';
+ }
+};
+
+if ('jQuery' in this) jQuery.io = this.io;
+
+if (typeof window != 'undefined'){
+ // WEB_SOCKET_SWF_LOCATION = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//cdn.socket.io/' + this.io.version + '/WebSocketMain.swf';
+ WEB_SOCKET_SWF_LOCATION = '/socket.io/lib/vendor/web-socket-js/WebSocketMain.swf';
+}
+/**
+ * Socket.IO client
+ *
+ * @author Guillermo Rauch <guillermo@learnboost.com>
+ * @license The MIT license.
+ * @copyright Copyright (c) 2010 LearnBoost <dev@learnboost.com>
+ */
+
+(function(){
+
+ var _pageLoaded = false;
+
+ io.util = {
+
+ ios: false,
+
+ load: function(fn){
+ if (document.readyState == 'complete' || _pageLoaded) return fn();
+ if ('attachEvent' in window){
+ window.attachEvent('onload', fn);
+ } else {
+ window.addEventListener('load', fn, false);
+ }
+ },
+
+ inherit: function(ctor, superCtor){
+ // no support for `instanceof` for now
+ for (var i in superCtor.prototype){
+ ctor.prototype[i] = superCtor.prototype[i];
+ }
+ },
+
+ indexOf: function(arr, item, from){
+ for (var l = arr.length, i = (from < 0) ? Math.max(0, l + from) : from || 0; i < l; i++){
+ if (arr[i] === item) return i;
+ }
+ return -1;
+ },
+
+ isArray: function(obj){
+ return Object.prototype.toString.call(obj) === '[object Array]';
+ }
+
+ };
+
+ io.util.ios = /iphone|ipad/i.test(navigator.userAgent);
+ io.util.android = /android/i.test(navigator.userAgent);
+ io.util.opera = /opera/i.test(navigator.userAgent);
+
+ io.util.load(function(){
+ _pageLoaded = true;
+ });
+
+})();
+/**
+ * Socket.IO client
+ *
+ * @author Guillermo Rauch <guillermo@learnboost.com>
+ * @license The MIT license.
+ * @copyright Copyright (c) 2010 LearnBoost <dev@learnboost.com>
+ */
+
+// abstract
+
+(function(){
+
+ var frame = '~m~',
+
+ stringify = function(message){
+ if (Object.prototype.toString.call(message) == '[object Object]'){
+ if (!('JSON' in window)){
+ if ('console' in window && console.error) console.error('Trying to encode as JSON, but JSON.stringify is missing.');
+ return '{ "$error": "Invalid message" }';
+ }
+ return '~j~' + JSON.stringify(message);
+ } else {
+ return String(message);
+ }
+ };
+
+ Transport = io.Transport = function(base, options){
+ this.base = base;
+ this.options = {
+ timeout: 15000 // based on heartbeat interval default
+ };
+ for (var i in options)
+ if (this.options.hasOwnProperty(i))
+ this.options[i] = options[i];
+ };
+
+ Transport.prototype.send = function(){
+ throw new Error('Missing send() implementation');
+ };
+
+ Transport.prototype.connect = function(){
+ throw new Error('Missing connect() implementation');
+ };
+
+ Transport.prototype.disconnect = function(){
+ throw new Error('Missing disconnect() implementation');
+ };
+
+ Transport.prototype._encode = function(messages){
+ var ret = '', message,
+ messages = io.util.isArray(messages) ? messages : [messages];
+ for (var i = 0, l = messages.length; i < l; i++){
+ message = messages[i] === null || messages[i] === undefined ? '' : stringify(messages[i]);
+ ret += frame + message.length + frame + message;
+ }
+ return ret;
+ };
+
+ Transport.prototype._decode = function(data){
+ var messages = [], number, n;
+ do {
+ if (data.substr(0, 3) !== frame) return messages;
+ data = data.substr(3);
+ number = '', n = '';
+ for (var i = 0, l = data.length; i < l; i++){
+ n = Number(data.substr(i, 1));
+ if (data.substr(i, 1) == n){
+ number += n;
+ } else {
+ data = data.substr(number.length + frame.length)
+ number = Number(number);
+ break;
+ }
+ }
+ messages.push(data.substr(0, number)); // here
+ data = data.substr(number);
+ } while(data !== '');
+ return messages;
+ };
+
+ Transport.prototype._onData = function(data){
+ this._setTimeout();
+ var msgs = this._decode(data);
+ if (msgs && msgs.length){
+ for (var i = 0, l = msgs.length; i < l; i++){
+ this._onMessage(msgs[i]);
+ }
+ }
+ };
+
+ Transport.prototype._setTimeout = function(){
+ var self = this;
+ if (this._timeout) clearTimeout(this._timeout);
+ this._timeout = setTimeout(function(){
+ self._onTimeout();
+ }, this.options.timeout);
+ };
+
+ Transport.prototype._onTimeout = function(){
+ this._onDisconnect();
+ };
+
+ Transport.prototype._onMessage = function(message){
+ if (!this.sessionid){
+ this.sessionid = message;
+ this._onConnect();
+ } else if (message.substr(0, 3) == '~h~'){
+ this._onHeartbeat(message.substr(3));
+ } else if (message.substr(0, 3) == '~j~'){
+ this.base._onMessage(JSON.parse(message.substr(3)));
+ } else {
+ this.base._onMessage(message);
+ }
+ },
+
+ Transport.prototype._onHeartbeat = function(heartbeat){
+ this.send('~h~' + heartbeat); // echo
+ };
+
+ Transport.prototype._onConnect = function(){
+ this.connected = true;
+ this.connecting = false;
+ this.base._onConnect();
+ this._setTimeout();
+ };
+
+ Transport.prototype._onDisconnect = function(){
+ this.connecting = false;
+ this.connected = false;
+ this.sessionid = null;
+ this.base._onDisconnect();
+ };
+
+ Transport.prototype._prepareUrl = function(){
+ return (this.base.options.secure ? 'https' : 'http')
+ + '://' + this.base.host
+ + ':' + this.base.options.port
+ + '/' + this.base.options.resource
+ + '/' + this.type
+ + (this.sessionid ? ('/' + this.sessionid) : '/');
+ };
+
+})();
+/**
+ * Socket.IO client
+ *
+ * @author Guillermo Rauch <guillermo@learnboost.com>
+ * @license The MIT license.
+ * @copyright Copyright (c) 2010 LearnBoost <dev@learnboost.com>
+ */
+
+(function(){
+
+ var empty = new Function,
+
+ XMLHttpRequestCORS = (function(){
+ if (!('XMLHttpRequest' in window)) return false;
+ // CORS feature detection
+ var a = new XMLHttpRequest();
+ return a.withCredentials != undefined;
+ })(),
+
+ request = function(xdomain){
+ if ('XDomainRequest' in window && xdomain) return new XDomainRequest();
+ if ('XMLHttpRequest' in window && (!xdomain || XMLHttpRequestCORS)) return new XMLHttpRequest();
+ if (!xdomain){
+ try {
+ var a = new ActiveXObject('MSXML2.XMLHTTP');
+ return a;
+ } catch(e){}
+
+ try {
+ var b = new ActiveXObject('Microsoft.XMLHTTP');
+ return b;
+ } catch(e){}
+ }
+ return false;
+ },
+
+ XHR = io.Transport.XHR = function(){
+ io.Transport.apply(this, arguments);
+ this._sendBuffer = [];
+ };
+
+ io.util.inherit(XHR, io.Transport);
+
+ XHR.prototype.connect = function(){
+ this._get();
+ return this;
+ };
+
+ XHR.prototype._checkSend = function(){
+ if (!this._posting && this._sendBuffer.length){
+ var encoded = this._encode(this._sendBuffer);
+ this._sendBuffer = [];
+ this._send(encoded);
+ }
+ };
+
+ XHR.prototype.send = function(data){
+ if (io.util.isArray(data)){
+ this._sendBuffer.push.apply(this._sendBuffer, data);
+ } else {
+ this._sendBuffer.push(data);
+ }
+ this._checkSend();
+ return this;
+ };
+
+ XHR.prototype._send = function(data){
+ var self = this;
+ this._posting = true;
+ this._sendXhr = this._request('send', 'POST');
+ this._sendXhr.onreadystatechange = function(){
+ var status;
+ if (self._sendXhr.readyState == 4){
+ self._sendXhr.onreadystatechange = empty;
+ try { status = self._sendXhr.status; } catch(e){}
+ self._posting = false;
+ if (status == 200){
+ self._checkSend();
+ } else {
+ self._onDisconnect();
+ }
+ }
+ };
+ this._sendXhr.send('data=' + encodeURIComponent(data));
+ },
+
+ XHR.prototype.disconnect = function(){
+ // send disconnection signal
+ this._onDisconnect();
+ return this;
+ }
+
+ XHR.prototype._onDisconnect = function(){
+ if (this._xhr){
+ this._xhr.onreadystatechange = this._xhr.onload = empty;
+ this._xhr.abort();
+ this._xhr = null;
+ }
+ if (this._sendXhr){
+ this._sendXhr.onreadystatechange = this._sendXhr.onload = empty;
+ this._sendXhr.abort();
+ this._sendXhr = null;
+ }
+ this._sendBuffer = [];
+ io.Transport.prototype._onDisconnect.call(this);
+ };
+
+ XHR.prototype._request = function(url, method, multipart){
+ var req = request(this.base._isXDomain());
+ if (multipart) req.multipart = true;
+ req.open(method || 'GET', this._prepareUrl() + (url ? '/' + url : ''));
+ if (method == 'POST' && 'setRequestHeader' in req){
+ req.setRequestHeader('Content-type', 'application/x-www-form-urlencoded; charset=utf-8');
+ }
+ return req;
+ };
+
+ XHR.check = function(xdomain){
+ try {
+ if (request(xdomain)) return true;
+ } catch(e){}
+ return false;
+ };
+
+ XHR.xdomainCheck = function(){
+ return XHR.check(true);
+ };
+
+ XHR.request = request;
+
+})();
+/**
+ * Socket.IO client
+ *
+ * @author Guillermo Rauch <guillermo@learnboost.com>
+ * @license The MIT license.
+ * @copyright Copyright (c) 2010 LearnBoost <dev@learnboost.com>
+ */
+
+(function(){
+
+ var WS = io.Transport.websocket = function(){
+ io.Transport.apply(this, arguments);
+ };
+
+ io.util.inherit(WS, io.Transport);
+
+ WS.prototype.type = 'websocket';
+
+ WS.prototype.connect = function(){
+ var self = this;
+ this.socket = new WebSocket(this._prepareUrl());
+ this.socket.onmessage = function(ev){ self._onData(ev.data); };
+ this.socket.onclose = function(ev){ self._onClose(); };
+ return this;
+ };
+
+ WS.prototype.send = function(data){
+ this.socket.send(this._encode(data));
+ return this;
+ }
+
+ WS.prototype.disconnect = function(){
+ this.socket.close();
+ return this;
+ };
+
+ WS.prototype._onClose = function(){
+ this._onDisconnect();
+ return this;
+ };
+
+ WS.prototype._prepareUrl = function(){
+ return (this.base.options.secure ? 'wss' : 'ws')
+ + '://' + this.base.host
+ + ':' + this.base.options.port
+ + '/' + this.base.options.resource
+ + '/' + this.type
+ + (this.sessionid ? ('/' + this.sessionid) : '');
+ };
+
+ WS.check = function(){
+ // we make sure WebSocket is not confounded with a previously loaded flash WebSocket
+ return 'WebSocket' in window && WebSocket.prototype && ( WebSocket.prototype.send && !!WebSocket.prototype.send.toString().match(/native/i)) && typeof WebSocket !== "undefined";
+ };
+
+ WS.xdomainCheck = function(){
+ return true;
+ };
+
+})();
+/**
+ * Socket.IO client
+ *
+ * @author Guillermo Rauch <guillermo@learnboost.com>
+ * @license The MIT license.
+ * @copyright Copyright (c) 2010 LearnBoost <dev@learnboost.com>
+ */
+
+(function(){
+
+ var Flashsocket = io.Transport.flashsocket = function(){
+ io.Transport.websocket.apply(this, arguments);
+ };
+
+ io.util.inherit(Flashsocket, io.Transport.websocket);
+
+ Flashsocket.prototype.type = 'flashsocket';
+
+ Flashsocket.prototype.connect = function(){
+ var self = this, args = arguments;
+ WebSocket.__addTask(function(){
+ io.Transport.websocket.prototype.connect.apply(self, args);
+ });
+ return this;
+ };
+
+ Flashsocket.prototype.send = function(){
+ var self = this, args = arguments;
+ WebSocket.__addTask(function(){
+ io.Transport.websocket.prototype.send.apply(self, args);
+ });
+ return this;
+ };
+
+ Flashsocket.prototype._onClose = function(){
+ if (!this.base.connected){
+ // something failed, we might be behind a proxy, so we'll try another transport
+ this.base.options.transports.splice(io.util.indexOf(this.base.options.transports, 'flashsocket'), 1);
+ this.base.transport = this.base.getTransport();
+ this.base.connect();
+ return;
+ }
+ return io.Transport.websocket.prototype._onClose.call(this);
+ };
+
+ Flashsocket.check = function(){
+ if (typeof WebSocket == 'undefined' || !('__addTask' in WebSocket)) return false;
+ if (io.util.opera) return false; // opera is buggy with this transport
+ if ('navigator' in window && 'plugins' in navigator && navigator.plugins['Shockwave Flash']){
+ return !!navigator.plugins['Shockwave Flash'].description;
+ }
+ if ('ActiveXObject' in window) {
+ try {
+ return !!new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version');
+ } catch (e) {}
+ }
+ return false;
+ };
+
+ Flashsocket.xdomainCheck = function(){
+ return true;
+ };
+
+})();
+/**
+ * Socket.IO client
+ *
+ * @author Guillermo Rauch <guillermo@learnboost.com>
+ * @license The MIT license.
+ * @copyright Copyright (c) 2010 LearnBoost <dev@learnboost.com>
+ */
+
+(function(){
+
+ var HTMLFile = io.Transport.htmlfile = function(){
+ io.Transport.XHR.apply(this, arguments);
+ };
+
+ io.util.inherit(HTMLFile, io.Transport.XHR);
+
+ HTMLFile.prototype.type = 'htmlfile';
+
+ HTMLFile.prototype._get = function(){
+ var self = this;
+ this._open();
+ window.attachEvent('onunload', function(){ self._destroy(); });
+ };
+
+ HTMLFile.prototype._open = function(){
+ this._doc = new ActiveXObject('htmlfile');
+ this._doc.open();
+ this._doc.write('<html></html>');
+ this._doc.parentWindow.s = this;
+ this._doc.close();
+
+ var _iframeC = this._doc.createElement('div');
+ this._doc.body.appendChild(_iframeC);
+ this._iframe = this._doc.createElement('iframe');
+ _iframeC.appendChild(this._iframe);
+ this._iframe.src = this._prepareUrl() + '/' + (+ new Date);
+ };
+
+ HTMLFile.prototype._ = function(data, doc){
+ this._onData(data);
+ var script = doc.getElementsByTagName('script')[0];
+ script.parentNode.removeChild(script);
+ };
+
+ HTMLFile.prototype._destroy = function(){
+ this._iframe.src = 'about:blank';
+ this._doc = null;
+ CollectGarbage();
+ };
+
+ HTMLFile.prototype.disconnect = function(){
+ this._destroy();
+ return io.Transport.XHR.prototype.disconnect.call(this);
+ };
+
+ HTMLFile.check = function(){
+ if ('ActiveXObject' in window){
+ try {
+ var a = new ActiveXObject('htmlfile');
+ return a && io.Transport.XHR.check();
+ } catch(e){}
+ }
+ return false;
+ };
+
+ HTMLFile.xdomainCheck = function(){
+ // we can probably do handling for sub-domains, we should test that it's cross domain but a subdomain here
+ return false;
+ };
+
+})();
+/**
+ * Socket.IO client
+ *
+ * @author Guillermo Rauch <guillermo@learnboost.com>
+ * @license The MIT license.
+ * @copyright Copyright (c) 2010 LearnBoost <dev@learnboost.com>
+ */
+
+(function(){
+
+ var XHRMultipart = io.Transport['xhr-multipart'] = function(){
+ io.Transport.XHR.apply(this, arguments);
+ };
+
+ io.util.inherit(XHRMultipart, io.Transport.XHR);
+
+ XHRMultipart.prototype.type = 'xhr-multipart';
+
+ XHRMultipart.prototype._get = function(){
+ var self = this;
+ this._xhr = this._request('', 'GET', true);
+ this._xhr.onreadystatechange = function(){
+ if (self._xhr.readyState == 3) self._onData(self._xhr.responseText);
+ };
+ this._xhr.send();
+ };
+
+ XHRMultipart.check = function(){
+ return 'XMLHttpRequest' in window && 'prototype' in XMLHttpRequest && 'multipart' in XMLHttpRequest.prototype;
+ };
+
+ XHRMultipart.xdomainCheck = function(){
+ return true;
+ };
+
+})();
+/**
+ * Socket.IO client
+ *
+ * @author Guillermo Rauch <guillermo@learnboost.com>
+ * @license The MIT license.
+ * @copyright Copyright (c) 2010 LearnBoost <dev@learnboost.com>
+ */
+
+(function(){
+
+ var empty = new Function(),
+
+ XHRPolling = io.Transport['xhr-polling'] = function(){
+ io.Transport.XHR.apply(this, arguments);
+ };
+
+ io.util.inherit(XHRPolling, io.Transport.XHR);
+
+ XHRPolling.prototype.type = 'xhr-polling';
+
+ XHRPolling.prototype.connect = function(){
+ if (io.util.ios || io.util.android){
+ var self = this;
+ io.util.load(function(){
+ setTimeout(function(){
+ io.Transport.XHR.prototype.connect.call(self);
+ }, 10);
+ });
+ } else {
+ io.Transport.XHR.prototype.connect.call(this);
+ }
+ };
+
+ XHRPolling.prototype._get = function(){
+ var self = this;
+ this._xhr = this._request(+ new Date, 'GET');
+ if ('onload' in this._xhr){
+ this._xhr.onload = function(){
+ self._onData(this.responseText);
+ self._get();
+ };
+ } else {
+ this._xhr.onreadystatechange = function(){
+ var status;
+ if (self._xhr.readyState == 4){
+ self._xhr.onreadystatechange = empty;
+ try { status = self._xhr.status; } catch(e){}
+ if (status == 200){
+ self._onData(self._xhr.responseText);
+ self._get();
+ } else {
+ self._onDisconnect();
+ }
+ }
+ };
+ }
+ this._xhr.send();
+ };
+
+ XHRPolling.check = function(){
+ return io.Transport.XHR.check();
+ };
+
+ XHRPolling.xdomainCheck = function(){
+ return io.Transport.XHR.xdomainCheck();
+ };
+
+})();
+/**
+ * Socket.IO client
+ *
+ * @author Guillermo Rauch <guillermo@learnboost.com>
+ * @license The MIT license.
+ * @copyright Copyright (c) 2010 LearnBoost <dev@learnboost.com>
+ */
+
+io.JSONP = [];
+
+JSONPPolling = io.Transport['jsonp-polling'] = function(){
+ io.Transport.XHR.apply(this, arguments);
+ this._insertAt = document.getElementsByTagName('script')[0];
+ this._index = io.JSONP.length;
+ io.JSONP.push(this);
+};
+
+io.util.inherit(JSONPPolling, io.Transport['xhr-polling']);
+
+JSONPPolling.prototype.type = 'jsonp-polling';
+
+JSONPPolling.prototype._send = function(data){
+ var self = this;
+ if (!('_form' in this)){
+ var form = document.createElement('FORM'),
+ area = document.createElement('TEXTAREA'),
+ id = this._iframeId = 'socket_io_iframe_' + this._index,
+ iframe;
+
+ form.style.position = 'absolute';
+ form.style.top = '-1000px';
+ form.style.left = '-1000px';
+ form.target = id;
+ form.method = 'POST';
+ form.action = this._prepareUrl() + '/' + (+new Date) + '/' + this._index;
+ area.name = 'data';
+ form.appendChild(area);
+ this._insertAt.parentNode.insertBefore(form, this._insertAt);
+ document.body.appendChild(form);
+
+ this._form = form;
+ this._area = area;
+ }
+
+ function complete(){
+ initIframe();
+ self._posting = false;
+ self._checkSend();
+ };
+
+ function initIframe(){
+ if (self._iframe){
+ self._form.removeChild(self._iframe);
+ }
+
+ try {
+ // ie6 dynamic iframes with target="" support (thanks Chris Lambacher)
+ iframe = document.createElement('<iframe name="'+ self._iframeId +'">');
+ } catch(e){
+ iframe = document.createElement('iframe');
+ iframe.name = self._iframeId;
+ }
+
+ iframe.id = self._iframeId;
+
+ self._form.appendChild(iframe);
+ self._iframe = iframe;
+ };
+
+ initIframe();
+
+ this._posting = true;
+ this._area.value = data;
+
+ try {
+ this._form.submit();
+ } catch(e){}
+
+ if (this._iframe.attachEvent){
+ iframe.onreadystatechange = function(){
+ if (self._iframe.readyState == 'complete') complete();
+ };
+ } else {
+ this._iframe.onload = complete;
+ }
+};
+
+JSONPPolling.prototype._get = function(){
+ var self = this,
+ script = document.createElement('SCRIPT');
+ if (this._script){
+ this._script.parentNode.removeChild(this._script);
+ this._script = null;
+ }
+ script.async = true;
+ script.src = this._prepareUrl() + '/' + (+new Date) + '/' + this._index;
+ script.onerror = function(){
+ self._onDisconnect();
+ };
+ this._insertAt.parentNode.insertBefore(script, this._insertAt);
+ this._script = script;
+};
+
+JSONPPolling.prototype._ = function(){
+ this._onData.apply(this, arguments);
+ this._get();
+ return this;
+};
+
+JSONPPolling.check = function(){
+ return true;
+};
+
+JSONPPolling.xdomainCheck = function(){
+ return true;
+};
+/**
+ * Socket.IO client
+ *
+ * @author Guillermo Rauch <guillermo@learnboost.com>
+ * @license The MIT license.
+ * @copyright Copyright (c) 2010 LearnBoost <dev@learnboost.com>
+ */
+
+(function(){
+
+ var Socket = io.Socket = function(host, options){
+ this.host = host || document.domain;
+ this.options = {
+ secure: false,
+ document: document,
+ port: document.location.port || 80,
+ resource: 'socket.io',
+ transports: ['websocket', 'flashsocket', 'htmlfile', 'xhr-multipart', 'xhr-polling', 'jsonp-polling'],
+ transportOptions: {
+ 'xhr-polling': {
+ timeout: 25000 // based on polling duration default
+ },
+ 'jsonp-polling': {
+ timeout: 25000
+ }
+ },
+ connectTimeout: 5000,
+ tryTransportsOnConnectTimeout: true,
+ rememberTransport: true
+ };
+ for (var i in options)
+ if (this.options.hasOwnProperty(i))
+ this.options[i] = options[i];
+ this.connected = false;
+ this.connecting = false;
+ this._events = {};
+ this.transport = this.getTransport();
+ if (!this.transport && 'console' in window) console.error('No transport available');
+ };
+
+ Socket.prototype.getTransport = function(override){
+ var transports = override || this.options.transports, match;
+ if (this.options.rememberTransport && !override){
+ match = this.options.document.cookie.match('(?:^|;)\\s*socketio=([^;]*)');
+ if (match){
+ this._rememberedTransport = true;
+ transports = [decodeURIComponent(match[1])];
+ }
+ }
+ for (var i = 0, transport; transport = transports[i]; i++){
+ if (io.Transport[transport]
+ && io.Transport[transport].check()
+ && (!this._isXDomain() || io.Transport[transport].xdomainCheck())){
+ return new io.Transport[transport](this, this.options.transportOptions[transport] || {});
+ }
+ }
+ return null;
+ };
+
+ Socket.prototype.connect = function(){
+ if (this.transport && !this.connected){
+ if (this.connecting) this.disconnect();
+ this.connecting = true;
+ this.transport.connect();
+ if (this.options.connectTimeout){
+ var self = this;
+ setTimeout(function(){
+ if (!self.connected){
+ self.disconnect();
+ if (self.options.tryTransportsOnConnectTimeout && !self._rememberedTransport){
+ var remainingTransports = [], transports = self.options.transports;
+ for (var i = 0, transport; transport = transports[i]; i++){
+ if (transport != self.transport.type) remainingTransports.push(transport);
+ }
+ if (remainingTransports.length){
+ self.transport = self.getTransport(remainingTransports);
+ self.connect();
+ }
+ }
+ }
+ }, this.options.connectTimeout)
+ }
+ }
+ return this;
+ };
+
+ Socket.prototype.send = function(data){
+ if (!this.transport || !this.transport.connected) return this._queue(data);
+ this.transport.send(data);
+ return this;
+ };
+
+ Socket.prototype.disconnect = function(){
+ this.transport.disconnect();
+ return this;
+ };
+
+ Socket.prototype.on = function(name, fn){
+ if (!(name in this._events)) this._events[name] = [];
+ this._events[name].push(fn);
+ return this;
+ };
+
+ Socket.prototype.fire = function(name, args){
+ if (name in this._events){
+ for (var i = 0, ii = this._events[name].length; i < ii; i++)
+ this._events[name][i].apply(this, args === undefined ? [] : args);
+ }
+ return this;
+ };
+
+ Socket.prototype.removeEvent = function(name, fn){
+ if (name in this._events){
+ for (var a = 0, l = this._events[name].length; a < l; a++)
+ if (this._events[name][a] == fn) this._events[name].splice(a, 1);
+ }
+ return this;
+ };
+
+ Socket.prototype._queue = function(message){
+ if (!('_queueStack' in this)) this._queueStack = [];
+ this._queueStack.push(message);
+ return this;
+ };
+
+ Socket.prototype._doQueue = function(){
+ if (!('_queueStack' in this) || !this._queueStack.length) return this;
+ this.transport.send(this._queueStack);
+ this._queueStack = [];
+ return this;
+ };
+
+ Socket.prototype._isXDomain = function(){
+ return this.host !== document.domain;
+ };
+
+ Socket.prototype._onConnect = function(){
+ this.connected = true;
+ this.connecting = false;
+ this._doQueue();
+ if (this.options.rememberTransport) this.options.document.cookie = 'socketio=' + encodeURIComponent(this.transport.type);
+ this.fire('connect');
+ };
+
+ Socket.prototype._onMessage = function(data){
+ this.fire('message', [data]);
+ };
+
+ Socket.prototype._onDisconnect = function(){
+ var wasConnected = this.connected;
+ this.connected = false;
+ this.connecting = false;
+ this._queueStack = [];
+ if (wasConnected) this.fire('disconnect');
+ };
+
+ Socket.prototype.addListener = Socket.prototype.addEvent = Socket.prototype.addEventListener = Socket.prototype.on;
+
+})();
+/* SWFObject v2.2 <http://code.google.com/p/swfobject/>
+ is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
+*/
+var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y<X;Y++){U[Y]()}}function K(X){if(J){X()}else{U[U.length]=X}}function s(Y){if(typeof O.addEventListener!=D){O.addEventListener("load",Y,false)}else{if(typeof j.addEventListener!=D){j.addEventListener("load",Y,false)}else{if(typeof O.attachEvent!=D){i(O,"onload",Y)}else{if(typeof O.onload=="function"){var X=O.onload;O.onload=function(){X();Y()}}else{O.onload=Y}}}}}function h(){if(T){V()}else{H()}}function V(){var X=j.getElementsByTagName("body")[0];var aa=C(r);aa.setAttribute("type",q);var Z=X.appendChild(aa);if(Z){var Y=0;(function(){if(typeof Z.GetVariable!=D){var ab=Z.GetVariable("$version");if(ab){ab=ab.split(" ")[1].split(",");M.pv=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}else{if(Y<10){Y++;setTimeout(arguments.callee,10);return}}X.removeChild(aa);Z=null;H()})()}else{H()}}function H(){var ag=o.length;if(ag>0){for(var af=0;af<ag;af++){var Y=o[af].id;var ab=o[af].callbackFn;var aa={success:false,id:Y};if(M.pv[0]>0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad<ac;ad++){if(X[ad].getAttribute("name").toLowerCase()!="movie"){ah[X[ad].getAttribute("name")]=X[ad].getAttribute("value")}}P(ai,ah,Y,ab)}else{p(ae);if(ab){ab(aa)}}}}}else{w(Y,true);if(ab){var Z=z(Y);if(Z&&typeof Z.SetVariable!=D){aa.success=true;aa.ref=Z}ab(aa)}}}}}function z(aa){var X=null;var Y=c(aa);if(Y&&Y.nodeName=="OBJECT"){if(typeof Y.SetVariable!=D){X=Y}else{var Z=Y.getElementsByTagName(r)[0];if(Z){X=Z}}}return X}function A(){return !a&&F("6.0.65")&&(M.win||M.mac)&&!(M.wk&&M.wk<312)}function P(aa,ab,X,Z){a=true;E=Z||null;B={success:false,id:X};var ae=c(X);if(ae){if(ae.nodeName=="OBJECT"){l=g(ae);Q=null}else{l=ae;Q=X}aa.id=R;if(typeof aa.width==D||(!/%$/.test(aa.width)&&parseInt(aa.width,10)<310)){aa.width="310"}if(typeof aa.height==D||(!/%$/.test(aa.height)&&parseInt(aa.height,10)<137)){aa.height="137"}j.title=j.title.slice(0,47)+" - Flash Player Installation";var ad=M.ie&&M.win?"ActiveX":"PlugIn",ac="MMredirectURL="+O.location.toString().replace(/&/g,"%26")+"&MMplayerType="+ad+"&MMdoctitle="+j.title;if(typeof ab.flashvars!=D){ab.flashvars+="&"+ac}else{ab.flashvars=ac}if(M.ie&&M.win&&ae.readyState!=4){var Y=C("div");X+="SWFObjectNew";Y.setAttribute("id",X);ae.parentNode.insertBefore(Y,ae);ae.style.display="none";(function(){if(ae.readyState==4){ae.parentNode.removeChild(ae)}else{setTimeout(arguments.callee,10)}})()}u(aa,ab,X)}}function p(Y){if(M.ie&&M.win&&Y.readyState!=4){var X=C("div");Y.parentNode.insertBefore(X,Y);X.parentNode.replaceChild(g(Y),X);Y.style.display="none";(function(){if(Y.readyState==4){Y.parentNode.removeChild(Y)}else{setTimeout(arguments.callee,10)}})()}else{Y.parentNode.replaceChild(g(Y),Y)}}function g(ab){var aa=C("div");if(M.win&&M.ie){aa.innerHTML=ab.innerHTML}else{var Y=ab.getElementsByTagName(r)[0];if(Y){var ad=Y.childNodes;if(ad){var X=ad.length;for(var Z=0;Z<X;Z++){if(!(ad[Z].nodeType==1&&ad[Z].nodeName=="PARAM")&&!(ad[Z].nodeType==8)){aa.appendChild(ad[Z].cloneNode(true))}}}}}return aa}function u(ai,ag,Y){var X,aa=c(Y);if(M.wk&&M.wk<312){return X}if(aa){if(typeof ai.id==D){ai.id=Y}if(M.ie&&M.win){var ah="";for(var ae in ai){if(ai[ae]!=Object.prototype[ae]){if(ae.toLowerCase()=="data"){ag.movie=ai[ae]}else{if(ae.toLowerCase()=="styleclass"){ah+=' class="'+ai[ae]+'"'}else{if(ae.toLowerCase()!="classid"){ah+=" "+ae+'="'+ai[ae]+'"'}}}}}var af="";for(var ad in ag){if(ag[ad]!=Object.prototype[ad]){af+='<param name="'+ad+'" value="'+ag[ad]+'" />'}}aa.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+ah+">"+af+"</object>";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab<ac;ab++){I[ab][0].detachEvent(I[ab][1],I[ab][2])}var Z=N.length;for(var aa=0;aa<Z;aa++){y(N[aa])}for(var Y in M){M[Y]=null}M=null;for(var X in swfobject){swfobject[X]=null}swfobject=null})}}();return{registerObject:function(ab,X,aa,Z){if(M.w3&&ab&&X){var Y={};Y.id=ab;Y.swfVersion=X;Y.expressInstall=aa;Y.callbackFn=Z;o[o.length]=Y;w(ab,false)}else{if(Z){Z({success:false,id:ab})}}},getObjectById:function(X){if(M.w3){return z(X)}},embedSWF:function(ab,ah,ae,ag,Y,aa,Z,ad,af,ac){var X={success:false,id:ah};if(M.w3&&!(M.wk&&M.wk<312)&&ab&&ah&&ae&&ag&&Y){w(ah,false);K(function(){ae+="";ag+="";var aj={};if(af&&typeof af===r){for(var al in af){aj[al]=af[al]}}aj.data=ab;aj.width=ae;aj.height=ag;var am={};if(ad&&typeof ad===r){for(var ak in ad){am[ak]=ad[ak]}}if(Z&&typeof Z===r){for(var ai in Z){if(typeof am.flashvars!=D){am.flashvars+="&"+ai+"="+Z[ai]}else{am.flashvars=ai+"="+Z[ai]}}}if(F(Y)){var an=u(aj,am,ah);if(aj.id==ah){w(ah,true)}X.success=true;X.ref=an}else{if(aa&&A()){aj.data=aa;P(aj,am,ah,ac);return}else{w(ah,true)}}if(ac){ac(X)}})}else{if(ac){ac(X)}}},switchOffAutoHideShow:function(){m=false},ua:M,getFlashPlayerVersion:function(){return{major:M.pv[0],minor:M.pv[1],release:M.pv[2]}},hasFlashPlayerVersion:F,createSWF:function(Z,Y,X){if(M.w3){return u(Z,Y,X)}else{return undefined}},showExpressInstall:function(Z,aa,X,Y){if(M.w3&&A()){P(Z,aa,X,Y)}},removeSWF:function(X){if(M.w3){y(X)}},createCSS:function(aa,Z,Y,X){if(M.w3){v(aa,Z,Y,X)}},addDomLoadEvent:K,addLoadEvent:s,getQueryParamValue:function(aa){var Z=j.location.search||j.location.hash;if(Z){if(/\?/.test(Z)){Z=Z.split("?")[1]}if(aa==null){return L(Z)}var Y=Z.split("&");for(var X=0;X<Y.length;X++){if(Y[X].substring(0,Y[X].indexOf("="))==aa){return L(Y[X].substring((Y[X].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(a){var X=c(R);if(X&&l){X.parentNode.replaceChild(l,X);if(Q){w(Q,true);if(M.ie&&M.win){l.style.display="block"}}if(E){E(B)}}a=false}}}}();
+/*
+/*
+Copyright 2006 Adobe Systems Incorporated
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
+OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+*/
+
+
+/*
+ * The Bridge class, responsible for navigating AS instances
+ */
+function FABridge(target,bridgeName)
+{
+ this.target = target;
+ this.remoteTypeCache = {};
+ this.remoteInstanceCache = {};
+ this.remoteFunctionCache = {};
+ this.localFunctionCache = {};
+ this.bridgeID = FABridge.nextBridgeID++;
+ this.name = bridgeName;
+ this.nextLocalFuncID = 0;
+ FABridge.instances[this.name] = this;
+ FABridge.idMap[this.bridgeID] = this;
+
+ return this;
+}
+
+// type codes for packed values
+FABridge.TYPE_ASINSTANCE = 1;
+FABridge.TYPE_ASFUNCTION = 2;
+
+FABridge.TYPE_JSFUNCTION = 3;
+FABridge.TYPE_ANONYMOUS = 4;
+
+FABridge.initCallbacks = {};
+FABridge.userTypes = {};
+
+FABridge.addToUserTypes = function()
+{
+ for (var i = 0; i < arguments.length; i++)
+ {
+ FABridge.userTypes[arguments[i]] = {
+ 'typeName': arguments[i],
+ 'enriched': false
+ };
+ }
+}
+
+FABridge.argsToArray = function(args)
+{
+ var result = [];
+ for (var i = 0; i < args.length; i++)
+ {
+ result[i] = args[i];
+ }
+ return result;
+}
+
+function instanceFactory(objID)
+{
+ this.fb_instance_id = objID;
+ return this;
+}
+
+function FABridge__invokeJSFunction(args)
+{
+ var funcID = args[0];
+ var throughArgs = args.concat();//FABridge.argsToArray(arguments);
+ throughArgs.shift();
+
+ var bridge = FABridge.extractBridgeFromID(funcID);
+ return bridge.invokeLocalFunction(funcID, throughArgs);
+}
+
+FABridge.addInitializationCallback = function(bridgeName, callback)
+{
+ var inst = FABridge.instances[bridgeName];
+ if (inst != undefined)
+ {
+ callback.call(inst);
+ return;
+ }
+
+ var callbackList = FABridge.initCallbacks[bridgeName];
+ if(callbackList == null)
+ {
+ FABridge.initCallbacks[bridgeName] = callbackList = [];
+ }
+
+ callbackList.push(callback);
+}
+
+// updated for changes to SWFObject2
+function FABridge__bridgeInitialized(bridgeName) {
+ var objects = document.getElementsByTagName("object");
+ var ol = objects.length;
+ var activeObjects = [];
+ if (ol > 0) {
+ for (var i = 0; i < ol; i++) {
+ if (typeof objects[i].SetVariable != "undefined") {
+ activeObjects[activeObjects.length] = objects[i];
+ }
+ }
+ }
+ var embeds = document.getElementsByTagName("embed");
+ var el = embeds.length;
+ var activeEmbeds = [];
+ if (el > 0) {
+ for (var j = 0; j < el; j++) {
+ if (typeof embeds[j].SetVariable != "undefined") {
+ activeEmbeds[activeEmbeds.length] = embeds[j];
+ }
+ }
+ }
+ var aol = activeObjects.length;
+ var ael = activeEmbeds.length;
+ var searchStr = "bridgeName="+ bridgeName;
+ if ((aol == 1 && !ael) || (aol == 1 && ael == 1)) {
+ FABridge.attachBridge(activeObjects[0], bridgeName);
+ }
+ else if (ael == 1 && !aol) {
+ FABridge.attachBridge(activeEmbeds[0], bridgeName);
+ }
+ else {
+ var flash_found = false;
+ if (aol > 1) {