utopia-wiki 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (415) hide show
  1. checksums.yaml +7 -0
  2. data/.github/workflows/development.yml +62 -0
  3. data/.gitignore +18 -0
  4. data/.rspec +2 -0
  5. data/.yarnrc +1 -0
  6. data/Gemfile +4 -0
  7. data/README.md +46 -0
  8. data/bake/utopia/wiki.rb +13 -0
  9. data/lib/components/.yarn-integrity +19 -0
  10. data/lib/components/jquery-litebox/README.md +66 -0
  11. data/lib/components/jquery-litebox/bower.json +27 -0
  12. data/lib/components/jquery-litebox/dist/jquery.litebox.css +23 -0
  13. data/lib/components/jquery-litebox/dist/jquery.litebox.gallery.css +48 -0
  14. data/lib/components/jquery-litebox/dist/jquery.litebox.js +30 -0
  15. data/lib/components/jquery-litebox/example/index.html +69 -0
  16. data/lib/components/jquery-litebox/example/jquery.min.js +4 -0
  17. data/lib/components/jquery-litebox/example/sample_images/large/IMG_3340.jpg +0 -0
  18. data/lib/components/jquery-litebox/example/sample_images/large/IMG_3341.jpg +0 -0
  19. data/lib/components/jquery-litebox/example/sample_images/large/IMG_3344.jpg +0 -0
  20. data/lib/components/jquery-litebox/example/sample_images/large/IMG_3351.jpg +0 -0
  21. data/lib/components/jquery-litebox/example/sample_images/medium/IMG_3340.jpg +0 -0
  22. data/lib/components/jquery-litebox/example/sample_images/medium/IMG_3341.jpg +0 -0
  23. data/lib/components/jquery-litebox/example/sample_images/medium/IMG_3344.jpg +0 -0
  24. data/lib/components/jquery-litebox/example/sample_images/medium/IMG_3351.jpg +0 -0
  25. data/lib/components/jquery-litebox/example/sample_images/small/IMG_3340.jpg +0 -0
  26. data/lib/components/jquery-litebox/example/sample_images/small/IMG_3341.jpg +0 -0
  27. data/lib/components/jquery-litebox/example/sample_images/small/IMG_3344.jpg +0 -0
  28. data/lib/components/jquery-litebox/example/sample_images/small/IMG_3351.jpg +0 -0
  29. data/lib/components/jquery-litebox/package.json +29 -0
  30. data/lib/components/jquery-syntax/Gemfile +5 -0
  31. data/lib/components/jquery-syntax/LICENSE.txt +19 -0
  32. data/lib/components/jquery-syntax/NOTES.txt +20 -0
  33. data/lib/components/jquery-syntax/README.md +95 -0
  34. data/lib/components/jquery-syntax/Rakefile +211 -0
  35. data/lib/components/jquery-syntax/bower.json +25 -0
  36. data/lib/components/jquery-syntax/config.ru +4 -0
  37. data/lib/components/jquery-syntax/dist/base/jquery.syntax.brush.apache.css +12 -0
  38. data/lib/components/jquery-syntax/dist/base/jquery.syntax.brush.applescript.css +5 -0
  39. data/lib/components/jquery-syntax/dist/base/jquery.syntax.brush.assembly.css +8 -0
  40. data/lib/components/jquery-syntax/dist/base/jquery.syntax.brush.bash-script.css +6 -0
  41. data/lib/components/jquery-syntax/dist/base/jquery.syntax.brush.bash.css +4 -0
  42. data/lib/components/jquery-syntax/dist/base/jquery.syntax.brush.clang.css +6 -0
  43. data/lib/components/jquery-syntax/dist/base/jquery.syntax.brush.css.css +14 -0
  44. data/lib/components/jquery-syntax/dist/base/jquery.syntax.brush.diff.css +16 -0
  45. data/lib/components/jquery-syntax/dist/base/jquery.syntax.brush.html.css +5 -0
  46. data/lib/components/jquery-syntax/dist/base/jquery.syntax.brush.ocaml.css +3 -0
  47. data/lib/components/jquery-syntax/dist/base/jquery.syntax.brush.protobuf.css +2 -0
  48. data/lib/components/jquery-syntax/dist/base/jquery.syntax.brush.python.css +6 -0
  49. data/lib/components/jquery-syntax/dist/base/jquery.syntax.brush.ruby.css +2 -0
  50. data/lib/components/jquery-syntax/dist/base/jquery.syntax.brush.xml.css +18 -0
  51. data/lib/components/jquery-syntax/dist/base/jquery.syntax.core.css +58 -0
  52. data/lib/components/jquery-syntax/dist/base/jquery.syntax.editor.css +6 -0
  53. data/lib/components/jquery-syntax/dist/base/theme.js +1 -0
  54. data/lib/components/jquery-syntax/dist/bright/jquery.syntax.core.css +27 -0
  55. data/lib/components/jquery-syntax/dist/bright/theme.js +1 -0
  56. data/lib/components/jquery-syntax/dist/jquery.syntax.brush.apache.js +3 -0
  57. data/lib/components/jquery-syntax/dist/jquery.syntax.brush.applescript.js +5 -0
  58. data/lib/components/jquery-syntax/dist/jquery.syntax.brush.assembly.js +3 -0
  59. data/lib/components/jquery-syntax/dist/jquery.syntax.brush.bash-script.js +4 -0
  60. data/lib/components/jquery-syntax/dist/jquery.syntax.brush.bash.js +2 -0
  61. data/lib/components/jquery-syntax/dist/jquery.syntax.brush.basic.js +5 -0
  62. data/lib/components/jquery-syntax/dist/jquery.syntax.brush.clang.js +5 -0
  63. data/lib/components/jquery-syntax/dist/jquery.syntax.brush.csharp.js +4 -0
  64. data/lib/components/jquery-syntax/dist/jquery.syntax.brush.css.js +5 -0
  65. data/lib/components/jquery-syntax/dist/jquery.syntax.brush.diff.js +2 -0
  66. data/lib/components/jquery-syntax/dist/jquery.syntax.brush.go.js +3 -0
  67. data/lib/components/jquery-syntax/dist/jquery.syntax.brush.haskell.js +3 -0
  68. data/lib/components/jquery-syntax/dist/jquery.syntax.brush.html.js +4 -0
  69. data/lib/components/jquery-syntax/dist/jquery.syntax.brush.io.js +3 -0
  70. data/lib/components/jquery-syntax/dist/jquery.syntax.brush.java.js +4 -0
  71. data/lib/components/jquery-syntax/dist/jquery.syntax.brush.javascript.js +3 -0
  72. data/lib/components/jquery-syntax/dist/jquery.syntax.brush.kai.js +2 -0
  73. data/lib/components/jquery-syntax/dist/jquery.syntax.brush.lisp.js +2 -0
  74. data/lib/components/jquery-syntax/dist/jquery.syntax.brush.lua.js +3 -0
  75. data/lib/components/jquery-syntax/dist/jquery.syntax.brush.nginx.js +2 -0
  76. data/lib/components/jquery-syntax/dist/jquery.syntax.brush.ocaml.js +4 -0
  77. data/lib/components/jquery-syntax/dist/jquery.syntax.brush.ooc.js +4 -0
  78. data/lib/components/jquery-syntax/dist/jquery.syntax.brush.pascal.js +4 -0
  79. data/lib/components/jquery-syntax/dist/jquery.syntax.brush.perl5.js +3 -0
  80. data/lib/components/jquery-syntax/dist/jquery.syntax.brush.php-script.js +4 -0
  81. data/lib/components/jquery-syntax/dist/jquery.syntax.brush.php.js +2 -0
  82. data/lib/components/jquery-syntax/dist/jquery.syntax.brush.plain.js +2 -0
  83. data/lib/components/jquery-syntax/dist/jquery.syntax.brush.protobuf.js +3 -0
  84. data/lib/components/jquery-syntax/dist/jquery.syntax.brush.python.js +5 -0
  85. data/lib/components/jquery-syntax/dist/jquery.syntax.brush.ruby.js +5 -0
  86. data/lib/components/jquery-syntax/dist/jquery.syntax.brush.scala.js +4 -0
  87. data/lib/components/jquery-syntax/dist/jquery.syntax.brush.smalltalk.js +2 -0
  88. data/lib/components/jquery-syntax/dist/jquery.syntax.brush.sql.js +4 -0
  89. data/lib/components/jquery-syntax/dist/jquery.syntax.brush.super-collider.js +3 -0
  90. data/lib/components/jquery-syntax/dist/jquery.syntax.brush.swift.js +3 -0
  91. data/lib/components/jquery-syntax/dist/jquery.syntax.brush.trenni.js +2 -0
  92. data/lib/components/jquery-syntax/dist/jquery.syntax.brush.xml.js +4 -0
  93. data/lib/components/jquery-syntax/dist/jquery.syntax.brush.yaml.js +2 -0
  94. data/lib/components/jquery-syntax/dist/jquery.syntax.cache.js +7 -0
  95. data/lib/components/jquery-syntax/dist/jquery.syntax.core.js +34 -0
  96. data/lib/components/jquery-syntax/dist/jquery.syntax.editor.js +11 -0
  97. data/lib/components/jquery-syntax/dist/jquery.syntax.js +8 -0
  98. data/lib/components/jquery-syntax/dist/jquery.syntax.min.js +13 -0
  99. data/lib/components/jquery-syntax/dist/paper/jquery.syntax.core.css +31 -0
  100. data/lib/components/jquery-syntax/dist/paper/theme.js +1 -0
  101. data/lib/components/jquery-syntax/examples/ex.applescript.html +120 -0
  102. data/lib/components/jquery-syntax/examples/ex.asm.html +43 -0
  103. data/lib/components/jquery-syntax/examples/ex.bash.html +139 -0
  104. data/lib/components/jquery-syntax/examples/ex.clang.html +337 -0
  105. data/lib/components/jquery-syntax/examples/ex.css.html +48 -0
  106. data/lib/components/jquery-syntax/examples/ex.diff.html +1226 -0
  107. data/lib/components/jquery-syntax/examples/ex.editor.html +28 -0
  108. data/lib/components/jquery-syntax/examples/ex.html.html +134 -0
  109. data/lib/components/jquery-syntax/examples/ex.javascript.html +330 -0
  110. data/lib/components/jquery-syntax/examples/ex.ooc.html +119 -0
  111. data/lib/components/jquery-syntax/examples/ex.php.html +54 -0
  112. data/lib/components/jquery-syntax/examples/ex.python.html +1510 -0
  113. data/lib/components/jquery-syntax/examples/ex.ruby.html +358 -0
  114. data/lib/components/jquery-syntax/examples/ex.swift.html +90 -0
  115. data/lib/components/jquery-syntax/examples/index.css +18 -0
  116. data/lib/components/jquery-syntax/examples/jquery-1.6.min.js +16 -0
  117. data/lib/components/jquery-syntax/examples/tests.html +71 -0
  118. data/lib/components/jquery-syntax/examples/wrapping-flex.html +71 -0
  119. data/lib/components/jquery-syntax/examples/wrapping.html +181 -0
  120. data/lib/components/jquery-syntax/ext/closure/COPYING +202 -0
  121. data/lib/components/jquery-syntax/ext/closure/README +292 -0
  122. data/lib/components/jquery-syntax/ext/closure/compiler.jar +0 -0
  123. data/lib/components/jquery-syntax/ext/theme.rb +85 -0
  124. data/lib/components/jquery-syntax/install.yaml +9 -0
  125. data/lib/components/jquery-syntax/jQuery.Syntax.artx/Preview/preview.png +0 -0
  126. data/lib/components/jquery-syntax/jQuery.Syntax.artx/doc.thread +0 -0
  127. data/lib/components/jquery-syntax/package.json +31 -0
  128. data/lib/components/jquery-syntax/source/jquery.syntax.brush.apache.js +41 -0
  129. data/lib/components/jquery-syntax/source/jquery.syntax.brush.applescript.js +57 -0
  130. data/lib/components/jquery-syntax/source/jquery.syntax.brush.assembly.js +37 -0
  131. data/lib/components/jquery-syntax/source/jquery.syntax.brush.bash-script.js +67 -0
  132. data/lib/components/jquery-syntax/source/jquery.syntax.brush.bash.js +33 -0
  133. data/lib/components/jquery-syntax/source/jquery.syntax.brush.basic.js +51 -0
  134. data/lib/components/jquery-syntax/source/jquery.syntax.brush.clang.js +89 -0
  135. data/lib/components/jquery-syntax/source/jquery.syntax.brush.csharp.js +47 -0
  136. data/lib/components/jquery-syntax/source/jquery.syntax.brush.css.js +80 -0
  137. data/lib/components/jquery-syntax/source/jquery.syntax.brush.diff.js +24 -0
  138. data/lib/components/jquery-syntax/source/jquery.syntax.brush.go.js +47 -0
  139. data/lib/components/jquery-syntax/source/jquery.syntax.brush.haskell.js +45 -0
  140. data/lib/components/jquery-syntax/source/jquery.syntax.brush.html.js +66 -0
  141. data/lib/components/jquery-syntax/source/jquery.syntax.brush.io.js +45 -0
  142. data/lib/components/jquery-syntax/source/jquery.syntax.brush.java.js +45 -0
  143. data/lib/components/jquery-syntax/source/jquery.syntax.brush.javascript.js +42 -0
  144. data/lib/components/jquery-syntax/source/jquery.syntax.brush.kai.js +29 -0
  145. data/lib/components/jquery-syntax/source/jquery.syntax.brush.lisp.js +34 -0
  146. data/lib/components/jquery-syntax/source/jquery.syntax.brush.lua.js +44 -0
  147. data/lib/components/jquery-syntax/source/jquery.syntax.brush.nginx.js +30 -0
  148. data/lib/components/jquery-syntax/source/jquery.syntax.brush.ocaml.js +73 -0
  149. data/lib/components/jquery-syntax/source/jquery.syntax.brush.ooc.js +46 -0
  150. data/lib/components/jquery-syntax/source/jquery.syntax.brush.pascal.js +51 -0
  151. data/lib/components/jquery-syntax/source/jquery.syntax.brush.perl5.js +52 -0
  152. data/lib/components/jquery-syntax/source/jquery.syntax.brush.php-script.js +48 -0
  153. data/lib/components/jquery-syntax/source/jquery.syntax.brush.php.js +15 -0
  154. data/lib/components/jquery-syntax/source/jquery.syntax.brush.plain.js +10 -0
  155. data/lib/components/jquery-syntax/source/jquery.syntax.brush.protobuf.js +43 -0
  156. data/lib/components/jquery-syntax/source/jquery.syntax.brush.python.js +44 -0
  157. data/lib/components/jquery-syntax/source/jquery.syntax.brush.ruby.js +77 -0
  158. data/lib/components/jquery-syntax/source/jquery.syntax.brush.scala.js +44 -0
  159. data/lib/components/jquery-syntax/source/jquery.syntax.brush.smalltalk.js +29 -0
  160. data/lib/components/jquery-syntax/source/jquery.syntax.brush.sql.js +31 -0
  161. data/lib/components/jquery-syntax/source/jquery.syntax.brush.super-collider.js +57 -0
  162. data/lib/components/jquery-syntax/source/jquery.syntax.brush.swift.js +55 -0
  163. data/lib/components/jquery-syntax/source/jquery.syntax.brush.trenni.js +35 -0
  164. data/lib/components/jquery-syntax/source/jquery.syntax.brush.xml.js +50 -0
  165. data/lib/components/jquery-syntax/source/jquery.syntax.brush.yaml.js +29 -0
  166. data/lib/components/jquery-syntax/source/jquery.syntax.core.js +1114 -0
  167. data/lib/components/jquery-syntax/source/jquery.syntax.editor.js +291 -0
  168. data/lib/components/jquery-syntax/source/jquery.syntax.js +258 -0
  169. data/lib/components/jquery-syntax/themes/base/jquery.syntax.brush.apache.sass +23 -0
  170. data/lib/components/jquery-syntax/themes/base/jquery.syntax.brush.applescript.sass +11 -0
  171. data/lib/components/jquery-syntax/themes/base/jquery.syntax.brush.assembly.sass +16 -0
  172. data/lib/components/jquery-syntax/themes/base/jquery.syntax.brush.bash-script.sass +14 -0
  173. data/lib/components/jquery-syntax/themes/base/jquery.syntax.brush.bash.sass +11 -0
  174. data/lib/components/jquery-syntax/themes/base/jquery.syntax.brush.clang.sass +12 -0
  175. data/lib/components/jquery-syntax/themes/base/jquery.syntax.brush.css.sass +25 -0
  176. data/lib/components/jquery-syntax/themes/base/jquery.syntax.brush.diff.sass +25 -0
  177. data/lib/components/jquery-syntax/themes/base/jquery.syntax.brush.html.sass +12 -0
  178. data/lib/components/jquery-syntax/themes/base/jquery.syntax.brush.ocaml.sass +8 -0
  179. data/lib/components/jquery-syntax/themes/base/jquery.syntax.brush.protobuf.sass +7 -0
  180. data/lib/components/jquery-syntax/themes/base/jquery.syntax.brush.python.sass +12 -0
  181. data/lib/components/jquery-syntax/themes/base/jquery.syntax.brush.ruby.sass +9 -0
  182. data/lib/components/jquery-syntax/themes/base/jquery.syntax.brush.xml.sass +30 -0
  183. data/lib/components/jquery-syntax/themes/base/jquery.syntax.core.sass +86 -0
  184. data/lib/components/jquery-syntax/themes/base/jquery.syntax.editor.sass +12 -0
  185. data/lib/components/jquery-syntax/themes/bright/_config.yaml +2 -0
  186. data/lib/components/jquery-syntax/themes/bright/jquery.syntax.core.sass +42 -0
  187. data/lib/components/jquery-syntax/themes/paper/_config.yaml +2 -0
  188. data/lib/components/jquery-syntax/themes/paper/jquery.syntax.core.sass +47 -0
  189. data/lib/components/jquery/AUTHORS.txt +327 -0
  190. data/lib/components/jquery/LICENSE.txt +20 -0
  191. data/lib/components/jquery/README.md +62 -0
  192. data/lib/components/jquery/bower.json +14 -0
  193. data/lib/components/jquery/dist/jquery.js +10872 -0
  194. data/lib/components/jquery/dist/jquery.min.js +2 -0
  195. data/lib/components/jquery/dist/jquery.min.map +1 -0
  196. data/lib/components/jquery/dist/jquery.slim.js +8777 -0
  197. data/lib/components/jquery/dist/jquery.slim.min.js +2 -0
  198. data/lib/components/jquery/dist/jquery.slim.min.map +1 -0
  199. data/lib/components/jquery/external/sizzle/LICENSE.txt +36 -0
  200. data/lib/components/jquery/external/sizzle/dist/sizzle.js +2478 -0
  201. data/lib/components/jquery/external/sizzle/dist/sizzle.min.js +3 -0
  202. data/lib/components/jquery/external/sizzle/dist/sizzle.min.map +1 -0
  203. data/lib/components/jquery/package.json +117 -0
  204. data/lib/components/jquery/src/ajax.js +873 -0
  205. data/lib/components/jquery/src/ajax/jsonp.js +103 -0
  206. data/lib/components/jquery/src/ajax/load.js +77 -0
  207. data/lib/components/jquery/src/ajax/script.js +74 -0
  208. data/lib/components/jquery/src/ajax/var/location.js +5 -0
  209. data/lib/components/jquery/src/ajax/var/nonce.js +5 -0
  210. data/lib/components/jquery/src/ajax/var/rquery.js +5 -0
  211. data/lib/components/jquery/src/ajax/xhr.js +170 -0
  212. data/lib/components/jquery/src/attributes.js +13 -0
  213. data/lib/components/jquery/src/attributes/attr.js +141 -0
  214. data/lib/components/jquery/src/attributes/classes.js +186 -0
  215. data/lib/components/jquery/src/attributes/prop.js +143 -0
  216. data/lib/components/jquery/src/attributes/support.js +33 -0
  217. data/lib/components/jquery/src/attributes/val.js +191 -0
  218. data/lib/components/jquery/src/callbacks.js +236 -0
  219. data/lib/components/jquery/src/core.js +400 -0
  220. data/lib/components/jquery/src/core/DOMEval.js +43 -0
  221. data/lib/components/jquery/src/core/access.js +72 -0
  222. data/lib/components/jquery/src/core/camelCase.js +23 -0
  223. data/lib/components/jquery/src/core/init.js +129 -0
  224. data/lib/components/jquery/src/core/isAttached.js +26 -0
  225. data/lib/components/jquery/src/core/nodeName.js +13 -0
  226. data/lib/components/jquery/src/core/parseHTML.js +65 -0
  227. data/lib/components/jquery/src/core/parseXML.js +30 -0
  228. data/lib/components/jquery/src/core/ready-no-deferred.js +97 -0
  229. data/lib/components/jquery/src/core/ready.js +86 -0
  230. data/lib/components/jquery/src/core/readyException.js +13 -0
  231. data/lib/components/jquery/src/core/stripAndCollapse.js +14 -0
  232. data/lib/components/jquery/src/core/support.js +20 -0
  233. data/lib/components/jquery/src/core/toType.js +20 -0
  234. data/lib/components/jquery/src/core/var/rsingleTag.js +7 -0
  235. data/lib/components/jquery/src/css.js +494 -0
  236. data/lib/components/jquery/src/css/addGetHookIf.js +26 -0
  237. data/lib/components/jquery/src/css/adjustCSS.js +74 -0
  238. data/lib/components/jquery/src/css/curCSS.js +65 -0
  239. data/lib/components/jquery/src/css/finalPropName.js +42 -0
  240. data/lib/components/jquery/src/css/hiddenVisibleSelectors.js +15 -0
  241. data/lib/components/jquery/src/css/showHide.js +105 -0
  242. data/lib/components/jquery/src/css/support.js +133 -0
  243. data/lib/components/jquery/src/css/var/cssExpand.js +5 -0
  244. data/lib/components/jquery/src/css/var/getStyles.js +17 -0
  245. data/lib/components/jquery/src/css/var/isHiddenWithinTree.js +34 -0
  246. data/lib/components/jquery/src/css/var/rboxStyle.js +7 -0
  247. data/lib/components/jquery/src/css/var/rnumnonpx.js +7 -0
  248. data/lib/components/jquery/src/css/var/swap.js +26 -0
  249. data/lib/components/jquery/src/data.js +180 -0
  250. data/lib/components/jquery/src/data/Data.js +162 -0
  251. data/lib/components/jquery/src/data/var/acceptData.js +19 -0
  252. data/lib/components/jquery/src/data/var/dataPriv.js +7 -0
  253. data/lib/components/jquery/src/data/var/dataUser.js +7 -0
  254. data/lib/components/jquery/src/deferred.js +399 -0
  255. data/lib/components/jquery/src/deferred/exceptionHook.js +21 -0
  256. data/lib/components/jquery/src/deprecated.js +87 -0
  257. data/lib/components/jquery/src/deprecated/ajax-event-alias.js +22 -0
  258. data/lib/components/jquery/src/deprecated/event.js +48 -0
  259. data/lib/components/jquery/src/dimensions.js +57 -0
  260. data/lib/components/jquery/src/effects.js +701 -0
  261. data/lib/components/jquery/src/effects/Tween.js +125 -0
  262. data/lib/components/jquery/src/effects/animatedSelector.js +15 -0
  263. data/lib/components/jquery/src/event.js +892 -0
  264. data/lib/components/jquery/src/event/focusin.js +58 -0
  265. data/lib/components/jquery/src/event/support.js +11 -0
  266. data/lib/components/jquery/src/event/trigger.js +201 -0
  267. data/lib/components/jquery/src/exports/amd.js +26 -0
  268. data/lib/components/jquery/src/exports/global.js +34 -0
  269. data/lib/components/jquery/src/jquery.js +41 -0
  270. data/lib/components/jquery/src/manipulation.js +480 -0
  271. data/lib/components/jquery/src/manipulation/_evalUrl.js +32 -0
  272. data/lib/components/jquery/src/manipulation/buildFragment.js +106 -0
  273. data/lib/components/jquery/src/manipulation/getAll.js +32 -0
  274. data/lib/components/jquery/src/manipulation/setGlobalEval.js +22 -0
  275. data/lib/components/jquery/src/manipulation/support.js +41 -0
  276. data/lib/components/jquery/src/manipulation/var/rscriptType.js +5 -0
  277. data/lib/components/jquery/src/manipulation/var/rtagName.js +8 -0
  278. data/lib/components/jquery/src/manipulation/wrapMap.js +30 -0
  279. data/lib/components/jquery/src/offset.js +238 -0
  280. data/lib/components/jquery/src/queue.js +145 -0
  281. data/lib/components/jquery/src/queue/delay.js +24 -0
  282. data/lib/components/jquery/src/selector-native.js +241 -0
  283. data/lib/components/jquery/src/selector-sizzle.js +19 -0
  284. data/lib/components/jquery/src/selector.js +3 -0
  285. data/lib/components/jquery/src/serialize.js +136 -0
  286. data/lib/components/jquery/src/traversing.js +198 -0
  287. data/lib/components/jquery/src/traversing/findFilter.js +97 -0
  288. data/lib/components/jquery/src/traversing/var/dir.js +22 -0
  289. data/lib/components/jquery/src/traversing/var/rneedsContext.js +8 -0
  290. data/lib/components/jquery/src/traversing/var/siblings.js +17 -0
  291. data/lib/components/jquery/src/var/ObjectFunctionString.js +7 -0
  292. data/lib/components/jquery/src/var/arr.js +5 -0
  293. data/lib/components/jquery/src/var/class2type.js +6 -0
  294. data/lib/components/jquery/src/var/document.js +5 -0
  295. data/lib/components/jquery/src/var/documentElement.js +7 -0
  296. data/lib/components/jquery/src/var/flat.js +16 -0
  297. data/lib/components/jquery/src/var/fnToString.js +7 -0
  298. data/lib/components/jquery/src/var/getProto.js +5 -0
  299. data/lib/components/jquery/src/var/hasOwn.js +7 -0
  300. data/lib/components/jquery/src/var/indexOf.js +7 -0
  301. data/lib/components/jquery/src/var/isFunction.js +13 -0
  302. data/lib/components/jquery/src/var/isWindow.js +8 -0
  303. data/lib/components/jquery/src/var/pnum.js +5 -0
  304. data/lib/components/jquery/src/var/push.js +7 -0
  305. data/lib/components/jquery/src/var/rcheckableType.js +5 -0
  306. data/lib/components/jquery/src/var/rcssNum.js +9 -0
  307. data/lib/components/jquery/src/var/rnothtmlwhite.js +8 -0
  308. data/lib/components/jquery/src/var/slice.js +7 -0
  309. data/lib/components/jquery/src/var/support.js +6 -0
  310. data/lib/components/jquery/src/var/toString.js +7 -0
  311. data/lib/components/jquery/src/wrap.js +78 -0
  312. data/lib/utopia/wiki.rb +80 -0
  313. data/lib/utopia/wiki/version.rb +27 -0
  314. data/package.json +6 -0
  315. data/pages/_editor.xnode +21 -0
  316. data/pages/_heading.xnode +2 -0
  317. data/pages/_listing.xnode +23 -0
  318. data/pages/_navigation.xnode +33 -0
  319. data/pages/_page.xnode +32 -0
  320. data/pages/_thumbnail.xnode +8 -0
  321. data/pages/controller.rb +77 -0
  322. data/pages/create.xnode +15 -0
  323. data/pages/edit.xnode +10 -0
  324. data/pages/errors/exception.xnode +5 -0
  325. data/pages/errors/file-not-found.xnode +5 -0
  326. data/pages/links.yaml +2 -0
  327. data/pages/show.xnode +15 -0
  328. data/public/.nojekyll +0 -0
  329. data/public/_components/jquery-litebox/jquery.litebox.css +23 -0
  330. data/public/_components/jquery-litebox/jquery.litebox.gallery.css +48 -0
  331. data/public/_components/jquery-litebox/jquery.litebox.js +30 -0
  332. data/public/_components/jquery-syntax/base/jquery.syntax.brush.apache.css +12 -0
  333. data/public/_components/jquery-syntax/base/jquery.syntax.brush.applescript.css +5 -0
  334. data/public/_components/jquery-syntax/base/jquery.syntax.brush.assembly.css +8 -0
  335. data/public/_components/jquery-syntax/base/jquery.syntax.brush.bash-script.css +6 -0
  336. data/public/_components/jquery-syntax/base/jquery.syntax.brush.bash.css +4 -0
  337. data/public/_components/jquery-syntax/base/jquery.syntax.brush.clang.css +6 -0
  338. data/public/_components/jquery-syntax/base/jquery.syntax.brush.css.css +14 -0
  339. data/public/_components/jquery-syntax/base/jquery.syntax.brush.diff.css +16 -0
  340. data/public/_components/jquery-syntax/base/jquery.syntax.brush.html.css +5 -0
  341. data/public/_components/jquery-syntax/base/jquery.syntax.brush.ocaml.css +3 -0
  342. data/public/_components/jquery-syntax/base/jquery.syntax.brush.protobuf.css +2 -0
  343. data/public/_components/jquery-syntax/base/jquery.syntax.brush.python.css +6 -0
  344. data/public/_components/jquery-syntax/base/jquery.syntax.brush.ruby.css +2 -0
  345. data/public/_components/jquery-syntax/base/jquery.syntax.brush.xml.css +18 -0
  346. data/public/_components/jquery-syntax/base/jquery.syntax.core.css +58 -0
  347. data/public/_components/jquery-syntax/base/jquery.syntax.editor.css +6 -0
  348. data/public/_components/jquery-syntax/base/theme.js +1 -0
  349. data/public/_components/jquery-syntax/bright/jquery.syntax.core.css +27 -0
  350. data/public/_components/jquery-syntax/bright/theme.js +1 -0
  351. data/public/_components/jquery-syntax/jquery.syntax.brush.apache.js +3 -0
  352. data/public/_components/jquery-syntax/jquery.syntax.brush.applescript.js +5 -0
  353. data/public/_components/jquery-syntax/jquery.syntax.brush.assembly.js +3 -0
  354. data/public/_components/jquery-syntax/jquery.syntax.brush.bash-script.js +4 -0
  355. data/public/_components/jquery-syntax/jquery.syntax.brush.bash.js +2 -0
  356. data/public/_components/jquery-syntax/jquery.syntax.brush.basic.js +5 -0
  357. data/public/_components/jquery-syntax/jquery.syntax.brush.clang.js +5 -0
  358. data/public/_components/jquery-syntax/jquery.syntax.brush.csharp.js +4 -0
  359. data/public/_components/jquery-syntax/jquery.syntax.brush.css.js +5 -0
  360. data/public/_components/jquery-syntax/jquery.syntax.brush.diff.js +2 -0
  361. data/public/_components/jquery-syntax/jquery.syntax.brush.go.js +3 -0
  362. data/public/_components/jquery-syntax/jquery.syntax.brush.haskell.js +3 -0
  363. data/public/_components/jquery-syntax/jquery.syntax.brush.html.js +4 -0
  364. data/public/_components/jquery-syntax/jquery.syntax.brush.io.js +3 -0
  365. data/public/_components/jquery-syntax/jquery.syntax.brush.java.js +4 -0
  366. data/public/_components/jquery-syntax/jquery.syntax.brush.javascript.js +3 -0
  367. data/public/_components/jquery-syntax/jquery.syntax.brush.kai.js +2 -0
  368. data/public/_components/jquery-syntax/jquery.syntax.brush.lisp.js +2 -0
  369. data/public/_components/jquery-syntax/jquery.syntax.brush.lua.js +3 -0
  370. data/public/_components/jquery-syntax/jquery.syntax.brush.nginx.js +2 -0
  371. data/public/_components/jquery-syntax/jquery.syntax.brush.ocaml.js +4 -0
  372. data/public/_components/jquery-syntax/jquery.syntax.brush.ooc.js +4 -0
  373. data/public/_components/jquery-syntax/jquery.syntax.brush.pascal.js +4 -0
  374. data/public/_components/jquery-syntax/jquery.syntax.brush.perl5.js +3 -0
  375. data/public/_components/jquery-syntax/jquery.syntax.brush.php-script.js +4 -0
  376. data/public/_components/jquery-syntax/jquery.syntax.brush.php.js +2 -0
  377. data/public/_components/jquery-syntax/jquery.syntax.brush.plain.js +2 -0
  378. data/public/_components/jquery-syntax/jquery.syntax.brush.protobuf.js +3 -0
  379. data/public/_components/jquery-syntax/jquery.syntax.brush.python.js +5 -0
  380. data/public/_components/jquery-syntax/jquery.syntax.brush.ruby.js +5 -0
  381. data/public/_components/jquery-syntax/jquery.syntax.brush.scala.js +4 -0
  382. data/public/_components/jquery-syntax/jquery.syntax.brush.smalltalk.js +2 -0
  383. data/public/_components/jquery-syntax/jquery.syntax.brush.sql.js +4 -0
  384. data/public/_components/jquery-syntax/jquery.syntax.brush.super-collider.js +3 -0
  385. data/public/_components/jquery-syntax/jquery.syntax.brush.swift.js +3 -0
  386. data/public/_components/jquery-syntax/jquery.syntax.brush.trenni.js +2 -0
  387. data/public/_components/jquery-syntax/jquery.syntax.brush.xml.js +4 -0
  388. data/public/_components/jquery-syntax/jquery.syntax.brush.yaml.js +2 -0
  389. data/public/_components/jquery-syntax/jquery.syntax.cache.js +7 -0
  390. data/public/_components/jquery-syntax/jquery.syntax.core.js +34 -0
  391. data/public/_components/jquery-syntax/jquery.syntax.editor.js +11 -0
  392. data/public/_components/jquery-syntax/jquery.syntax.js +8 -0
  393. data/public/_components/jquery-syntax/jquery.syntax.min.js +13 -0
  394. data/public/_components/jquery-syntax/paper/jquery.syntax.core.css +31 -0
  395. data/public/_components/jquery-syntax/paper/theme.js +1 -0
  396. data/public/_components/jquery/jquery.js +10872 -0
  397. data/public/_components/jquery/jquery.min.js +2 -0
  398. data/public/_components/jquery/jquery.min.map +1 -0
  399. data/public/_components/jquery/jquery.slim.js +8777 -0
  400. data/public/_components/jquery/jquery.slim.min.js +2 -0
  401. data/public/_components/jquery/jquery.slim.min.map +1 -0
  402. data/public/_static/icon.png +0 -0
  403. data/public/_static/site.css +191 -0
  404. data/utopia-wiki.gemspec +39 -0
  405. data/wiki/Gemfile +10 -0
  406. data/wiki/config.ru +7 -0
  407. data/wiki/pages/_logos/Async.png +0 -0
  408. data/wiki/pages/_logos/Falcon.png +0 -0
  409. data/wiki/pages/_logos/Utopia.png +0 -0
  410. data/wiki/pages/index.en.md +62 -0
  411. data/wiki/pages/index.md +57 -0
  412. data/wiki/pages/links.yaml +2 -0
  413. data/wiki/pages/usage/merging/index.md +3 -0
  414. data/yarn.lock +22 -0
  415. metadata +675 -0
@@ -0,0 +1,48 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <link rel="stylesheet" href="index.css" type="text/css" media="screen" />
5
+
6
+ <script src="jquery-1.6.min.js" type="text/javascript"></script>
7
+ <script src="../dist/jquery.syntax.js" type="text/javascript"></script>
8
+ <script src="../dist/jquery.syntax.cache.js" type="text/javascript"></script>
9
+
10
+ <script type="text/javascript">
11
+ jQuery(function($) {
12
+ $.syntax();
13
+ });
14
+ </script>
15
+
16
+ </head>
17
+ <body>
18
+ <h1>Syntax: CSS</h1>
19
+
20
+ <h2>Special Example</h2>
21
+
22
+ <p>This example extracts definitions and creates example elements on the right hand side.</p>
23
+
24
+ <pre><code class="syntax brush-css">
25
+ p {
26
+ background-color: #ccc;
27
+ border: 1px solid black;
28
+ }
29
+
30
+ /* The way this information is extracted isn't that great, but as long as the CSS is kept simple, it is fine for demonstration purposes */
31
+
32
+ h1 {
33
+ color: #cfcfcf;
34
+ background-color: red;
35
+ border: 1px solid green;
36
+
37
+ padding: 10px;
38
+ }
39
+
40
+ h2 {
41
+ color: PaleGoldenRod;
42
+ text-shadow: 0.1em 0.1em 5px #333;
43
+
44
+ border-color:#ff0000 #0000ff;
45
+ }
46
+ </code></pre>
47
+ </body>
48
+ </html>
@@ -0,0 +1,1226 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <link rel="stylesheet" href="index.css" type="text/css" media="screen" />
5
+
6
+ <script src="jquery-1.6.min.js" type="text/javascript"></script>
7
+ <script src="../dist/jquery.syntax.js" type="text/javascript"></script>
8
+ <script src="../dist/jquery.syntax.cache.js" type="text/javascript"></script>
9
+
10
+ <script type="text/javascript">
11
+ jQuery(function($) {
12
+ $.syntax();
13
+ });
14
+ </script>
15
+
16
+ </head>
17
+ <body>
18
+ <h1>Syntax: Diff</h1>
19
+
20
+ <h2>jQuery.Syntax Diff</h2>
21
+
22
+ <pre><code class="syntax brush-diff">
23
+ diff --git a/ex.ruby.html b/ex.ruby.html
24
+ index a02a04e..7d42db0 100644
25
+ --- a/ex.ruby.html
26
+ +++ b/ex.ruby.html
27
+ @@ -21,6 +21,8 @@
28
+ &lt;body&gt;
29
+ &lt;h1&gt;Syntax: Ruby&lt;/h1&gt;
30
+
31
+ + &lt;h2&gt;Ruby Script #1&lt;/h2&gt;
32
+ +
33
+ &lt;pre class=&quot;ruby&quot;&gt;#!/usr/bin/env ruby
34
+
35
+ # Copyright (c) 2009 Samuel Williams. Released under the GNU GPLv3.
36
+ @@ -104,5 +106,257 @@ end
37
+ # RExec daemon runner
38
+ Server.daemonize&lt;/pre&gt;
39
+
40
+ + &lt;h2&gt;Ruby Script #2&lt;/h2&gt;
41
+ +
42
+ + &lt;pre class=&quot;ruby&quot;&gt;#!/usr/bin/env ruby
43
+ +# Simple Operator Expression Parser
44
+ +
45
+ +require &amp;#x27;set&amp;#x27;
46
+ +
47
+ +DEBUG = false
48
+ +
49
+ +class Array
50
+ + def map_to(with)
51
+ + r = {}
52
+ +
53
+ + each_with_index { |v,i| r[v] = with[i] }
54
+ +
55
+ + return r
56
+ + end
57
+ +end
58
+ +
59
+ +module Expression
60
+ + class Context
61
+ + def initialize(operators, values)
62
+ + @values = values
63
+ + @operators = operators
64
+ + end
65
+ +
66
+ + def value_of (key)
67
+ + @values[key]
68
+ + end
69
+ +
70
+ + def call (op, args)
71
+ + @operators.call(op, args)
72
+ + end
73
+ + end
74
+ +
75
+ + class Constant
76
+ + def initialize(value)
77
+ + @value = value
78
+ + end
79
+ +
80
+ + def evaluate (ctx)
81
+ + return @value
82
+ + end
83
+ + end
84
+ +
85
+ + class Identifier
86
+ + def initialize(name)
87
+ + @name = name
88
+ + end
89
+ +
90
+ + def evaluate (ctx)
91
+ + ctx.value_of(@name)
92
+ + end
93
+ + end
94
+ +
95
+ + class Operator
96
+ + def initialize(name, args = [])
97
+ + @name = name
98
+ + @args = args
99
+ + end
100
+ +
101
+ + def name
102
+ + @name
103
+ + end
104
+ +
105
+ + def evaluate (ctx)
106
+ + ctx.call(@name, @args.collect { |a| a.evaluate(ctx) })
107
+ + end
108
+ +
109
+ + def args
110
+ + @args
111
+ + end
112
+ + end
113
+ +
114
+ + class Brackets
115
+ + def initialize(node)
116
+ + @node = node
117
+ + end
118
+ +
119
+ + def evaluate (ctx)
120
+ + @node.evaluate(ctx)
121
+ + end
122
+ + end
123
+ +
124
+ + class Parser
125
+ + def initialize(ops, expr)
126
+ + @identifiers = []
127
+ + @operators = ops
128
+ +
129
+ + # Tokens and expressions line up
130
+ + @expressions = []
131
+ + @tokens = []
132
+ +
133
+ + @top = nil
134
+ +
135
+ + parse(expr)
136
+ + end
137
+ +
138
+ + def evaluate (ctx)
139
+ + @expressions.collect do |expr|
140
+ + expr != nil ? expr.evaluate(ctx) : nil
141
+ + end
142
+ + end
143
+ +
144
+ + def identifiers
145
+ + @identifiers
146
+ + end
147
+ +
148
+ + def tokens
149
+ + @tokens
150
+ + end
151
+ + private
152
+ + def parse(expr)
153
+ + symbols = @operators.keys + [&amp;quot;(&amp;quot;, &amp;quot;)&amp;quot;]
154
+ + tokenizer = Regexp.union(Regexp.union(*symbols), /[A-Z]+/)
155
+ +
156
+ + @tokens = expr.scan(tokenizer)
157
+ + @expressions = [nil] * @tokens.size
158
+ +
159
+ + @identifiers = Set.new(expr.scan(/[A-Z]+/))
160
+ +
161
+ + @top, i = process_expression
162
+ +
163
+ + if DEBUG
164
+ + puts &amp;quot;Processed #{i} tokens...&amp;quot;
165
+ + puts &amp;quot;Tokens: &amp;quot; + @tokens.join(&amp;quot; &amp;quot;)
166
+ + puts @top.inspect
167
+ + puts @expressions.inspect
168
+ + end
169
+ + end
170
+ +
171
+ + def process_expression(i = 0)
172
+ + ast = []
173
+ + ops = {}
174
+ + while i &amp;lt; @tokens.size
175
+ + t = @tokens[i]
176
+ +
177
+ + if t == &amp;quot;(&amp;quot;
178
+ + result, i = process_expression(i+1)
179
+ + ast += result
180
+ + elsif t == &amp;quot;)&amp;quot;
181
+ + break
182
+ + else
183
+ + result = process_token(i)
184
+ + ast &amp;lt;&amp;lt; result
185
+ + end
186
+ +
187
+ + if result.class == Operator
188
+ + ops[result.name] ||= []
189
+ + # Store the index
190
+ + ops[result.name] &amp;lt;&amp;lt; (ast.size - 1)
191
+ + end
192
+ +
193
+ + i += 1
194
+ + end
195
+ +
196
+ + #puts ast.inspect
197
+ +
198
+ + # We need to sort the list of operators now
199
+ + # [c, infix, prefix, c]
200
+ +
201
+ + @operators.order.each do |name|
202
+ + op_kind = @operators.kind(name)
203
+ + next unless ops[name]
204
+ +
205
+ + ops[name].each do |loc|
206
+ + op = ast[loc]
207
+ +
208
+ + if op_kind == :prefix
209
+ + rhs = find_subexpression(ast, loc, RHS_SEARCH)
210
+ + op.args &amp;lt;&amp;lt; ast[rhs]
211
+ + ast[rhs] = nil
212
+ + elsif op_kind == :infix
213
+ + lhs = find_subexpression(ast, loc, LHS_SEARCH)
214
+ + rhs = find_subexpression(ast, loc, RHS_SEARCH)
215
+ + op.args &amp;lt;&amp;lt; ast[lhs]
216
+ + op.args &amp;lt;&amp;lt; ast[rhs]
217
+ + ast[lhs] = ast[rhs] = nil
218
+ + elsif op_kind == :postfix
219
+ + lhs = find_subexpression(ast, loc, LHS_SEARCH)
220
+ + op.args &amp;lt;&amp;lt; ast[lhs]
221
+ + ast[rhs] = nil
222
+ + end
223
+ + end
224
+ + end
225
+ +
226
+ + return [ast.uniq, i]
227
+ + end
228
+ +
229
+ + RHS_SEARCH = 1
230
+ + LHS_SEARCH = -1
231
+ +
232
+ + def find_subexpression(ast, loc, dir)
233
+ + while loc &amp;gt;= 0 &amp;amp;&amp;amp; loc &amp;lt; ast.size
234
+ + loc += dir
235
+ + return loc if ast[loc] != nil
236
+ + end
237
+ +
238
+ + return nil
239
+ + end
240
+ +
241
+ + def process_token(i)
242
+ + t = @tokens[i]
243
+ +
244
+ + if @operators.key? t
245
+ + tok = Operator.new(t)
246
+ + elsif t.match /[A-Z]+/
247
+ + tok = Identifier.new(t)
248
+ + else
249
+ + tok = Constant.new(t)
250
+ + end
251
+ +
252
+ + @expressions[i] = tok
253
+ + return tok
254
+ + end
255
+ + end
256
+ +
257
+ + TYPE = 0
258
+ + FUNC = 1
259
+ + class Operators
260
+ + def initialize
261
+ + @operators = {}
262
+ + @order = []
263
+ + end
264
+ +
265
+ + def add(sym, kind, &amp;amp;block)
266
+ + @operators[sym] = [kind, block]
267
+ + @order &amp;lt;&amp;lt; sym
268
+ + end
269
+ +
270
+ + def order
271
+ + @order
272
+ + end
273
+ +
274
+ + def keys
275
+ + @operators.keys
276
+ + end
277
+ +
278
+ + def key? k
279
+ + @operators.key? k
280
+ + end
281
+ +
282
+ + def kind k
283
+ + @operators[k][0]
284
+ + end
285
+ +
286
+ + def call(k, args)
287
+ + @operators[k][1].call(*args)
288
+ + end
289
+ + end
290
+ +end&lt;/pre&gt;
291
+ +
292
+ &lt;/body&gt;
293
+ &lt;/html&gt;
294
+
295
+ diff --git a/example.css b/example.css
296
+ index e69de29..4ece63a 100644
297
+ --- a/example.css
298
+ +++ b/example.css
299
+ @@ -0,0 +1,3 @@
300
+ +body {
301
+ + font-size: 70%;
302
+ +}
303
+
304
+ diff --git a/example.html b/example.html
305
+ deleted file mode 100644
306
+ index 7ac7cd5..0000000
307
+ --- a/example.html
308
+ +++ /dev/null
309
+ @@ -1,46 +0,0 @@
310
+ -&lt;!DOCTYPE html&gt;
311
+ -&lt;html&gt;
312
+ - &lt;head&gt;
313
+ -
314
+ - &lt;link rel=&quot;stylesheet&quot; href=&quot;jquery.syntax.css&quot; type=&quot;text/css&quot; media=&quot;screen&quot; /&gt;
315
+ - &lt;link rel=&quot;stylesheet&quot; href=&quot;example.css&quot; type=&quot;text/css&quot; media=&quot;screen&quot; /&gt;
316
+ -
317
+ - &lt;script src=&quot;jquery-1.4.1.js&quot; type=&quot;text/javascript&quot; charset=&quot;utf-8&quot;&gt;&lt;/script&gt;
318
+ -
319
+ - &lt;script src=&quot;jquery.syntax.js&quot; type=&quot;text/javascript&quot; charset=&quot;utf-8&quot;&gt;&lt;/script&gt;
320
+ - &lt;script src=&quot;jquery.syntax.cache.js&quot; type=&quot;text/javascript&quot; charset=&#x27;utf-8&#x27;&gt;&lt;/script&gt;
321
+ -
322
+ - &lt;script type=&quot;text/javascript&quot; language=&quot;JavaScript&quot;&gt;
323
+ - //&lt;!--
324
+ - $(function() {
325
+ - $(&#x27;#highlight&#x27;).click(function() {
326
+ - $(&#x27;pre.clang&#x27;).syntax({brush: &#x27;clang&#x27;, layout: &#x27;table&#x27;, replace: true}, function(options, html, container) {
327
+ - //$(&#x27;.function&#x27;, html).replaceWith(function(){
328
+ - // return $(&#x27;&lt;a&gt;&#x27;).addClass(&#x27;function&#x27;).attr(&#x27;href&#x27;, &#x27;#&#x27; + $(this).text()).html($(this).html());
329
+ - //})
330
+ - });
331
+ - });
332
+ - });
333
+ - //--&gt;
334
+ - &lt;/script&gt;
335
+ -
336
+ - &lt;/head&gt;
337
+ - &lt;body&gt;
338
+ - &lt;h1&gt;Syntax Highlighting Example&lt;/h1&gt;
339
+ -
340
+ - &lt;button id=&quot;highlight&quot;&gt;Highlight&lt;/button&gt;
341
+ -
342
+ - &lt;pre class=&quot;clang&quot;&gt;#include &amp;lt;iostream&amp;gt;
343
+ -/* Multi line c comment
344
+ -
345
+ - Hello World
346
+ -*/
347
+ -
348
+ - const char * s = &quot;My name is computer!\n\n&quot;
349
+ -int main (int argv, char ** argv) {
350
+ - return EXIT_SUCCESS;
351
+ -}
352
+ -&lt;/pre&gt;
353
+ -
354
+ - &lt;/body&gt;
355
+ -&lt;/html&gt;
356
+
357
+ diff --git a/example2.html b/example2.html
358
+ deleted file mode 100644
359
+ index f5f1d8c..0000000
360
+ --- a/example2.html
361
+ +++ /dev/null
362
+ @@ -1,81 +0,0 @@
363
+ -&lt;!DOCTYPE html&gt;
364
+ -&lt;html&gt;
365
+ - &lt;head&gt;
366
+ -
367
+ - &lt;link rel=&quot;stylesheet&quot; href=&quot;jquery.syntax.css&quot; type=&quot;text/css&quot; media=&quot;screen&quot; /&gt;
368
+ - &lt;link rel=&quot;stylesheet&quot; href=&quot;example.css&quot; type=&quot;text/css&quot; media=&quot;screen&quot; /&gt;
369
+ -
370
+ - &lt;script src=&quot;jquery-1.4.1.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
371
+ -
372
+ - &lt;script src=&quot;jquery.syntax.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
373
+ - &lt;script src=&quot;jquery.syntax.cache.js&quot; type=&quot;text/javascript&quot; charset=&#x27;utf-8&#x27;&gt;&lt;/script&gt;
374
+ -
375
+ - &lt;script src=&quot;jquery.syntax.brush.clang.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
376
+ - &lt;script src=&quot;jquery.syntax.layout.table.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
377
+ -
378
+ - &lt;link rel=&quot;stylesheet&quot; href=&quot;jquery.syntax.layout.table.css&quot; type=&quot;text/css&quot; media=&quot;screen&quot;&gt;
379
+ -
380
+ - &lt;script type=&quot;text/javascript&quot; language=&quot;JavaScript&quot;&gt;
381
+ - //&lt;!--
382
+ - $(function() {
383
+ - $(&#x27;#highlight&#x27;).click(function() {
384
+ - window.console.profile(&quot;Syntax Highlighting&quot;);
385
+ - start = new Date();
386
+ -
387
+ - $(&#x27;pre.clang&#x27;).syntax({brush: &#x27;clang&#x27;, layout: &#x27;table&#x27;, replace: true}, function(options, html, container) {
388
+ - //$(&#x27;.function&#x27;, html).replaceWith(function(){
389
+ - // return $(&#x27;&lt;a&gt;&#x27;).addClass(&#x27;function&#x27;).attr(&#x27;href&#x27;, &#x27;#&#x27; + $(this).text()).html($(this).html());
390
+ - //})
391
+ -
392
+ - finish = new Date();
393
+ - window.console.profileEnd();
394
+ - window.console.log(finish - start);
395
+ - });
396
+ - });
397
+ - });
398
+ - //--&gt;
399
+ - &lt;/script&gt;
400
+ -
401
+ - &lt;/head&gt;
402
+ - &lt;body&gt;
403
+ - &lt;h1&gt;Syntax Highlighting Example&lt;/h1&gt;
404
+ -
405
+ - &lt;button id=&quot;highlight&quot;&gt;Highlight&lt;/button&gt;
406
+ -
407
+ - &lt;pre class=&quot;clang&quot;&gt;#include &amp;lt;iostream&amp;gt;
408
+ -
409
+ -// If we increase row by 1, the offset will increase by sz (number of elements per row i.e. number of columns)
410
+ -// If we increase col by 1, the offset will increase by 1
411
+ -unsigned rowMajorOffset(unsigned row, unsigned col, unsigned sz)
412
+ -{
413
+ - return col + row * sz;
414
+ -}
415
+ -
416
+ -// If we increase col by 1, the offset will increase by sz (number of elements per column i.e. number of rows)
417
+ -// If we increase row by 1, the offset will increase by 1
418
+ -unsigned columnMajorOffset(unsigned row, unsigned col, unsigned sz)
419
+ -{
420
+ - return row + col * sz;
421
+ -}
422
+ -
423
+ -int main (int argc, char * const argv[]) {
424
+ - Matrix&amp;lt;float, 4, 2, false&amp;gt; rowMajorMatrix;
425
+ - Matrix&amp;lt;float, 4, 2, true&amp;gt; columnMajorMatrix;
426
+ -
427
+ - rowMajorMatrix.loadTestPattern();
428
+ - rowMajorMatrix.debug();
429
+ -
430
+ - columnMajorMatrix.loadTestPattern();
431
+ - columnMajorMatrix.debug();
432
+ -
433
+ - rowMajorMatrix = columnMajorMatrix.transposeStorage();
434
+ - rowMajorMatrix.debug();
435
+ -
436
+ - Matrix&amp;lt;float, 2, 4, false&amp;gt; transposedMatrix = columnMajorMatrix.transposeMatrix();
437
+ - transposedMatrix.debug();
438
+ -
439
+ - return 0;
440
+ -}&lt;/pre&gt;
441
+ -
442
+ - &lt;/body&gt;
443
+ -&lt;/html&gt;
444
+
445
+ diff --git a/example3.html b/example3.html
446
+ deleted file mode 100644
447
+ index d559b68..0000000
448
+ --- a/example3.html
449
+ +++ /dev/null
450
+ @@ -1,171 +0,0 @@
451
+ -&lt;!DOCTYPE html&gt;
452
+ -&lt;html&gt;
453
+ - &lt;head&gt;
454
+ -
455
+ - &lt;link rel=&quot;stylesheet&quot; href=&quot;jquery.syntax.css&quot; type=&quot;text/css&quot; media=&quot;screen&quot; /&gt;
456
+ - &lt;link rel=&quot;stylesheet&quot; href=&quot;example.css&quot; type=&quot;text/css&quot; media=&quot;screen&quot; /&gt;
457
+ -
458
+ - &lt;script src=&quot;jquery-1.4.1.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
459
+ -
460
+ - &lt;script src=&quot;jquery.syntax.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
461
+ - &lt;script src=&quot;jquery.syntax.cache.js&quot; type=&quot;text/javascript&quot; charset=&#x27;utf-8&#x27;&gt;&lt;/script&gt;
462
+ -
463
+ - &lt;script src=&quot;jquery.syntax.brush.clang.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
464
+ - &lt;script src=&quot;jquery.syntax.layout.table.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
465
+ -
466
+ - &lt;link rel=&quot;stylesheet&quot; href=&quot;jquery.syntax.layout.table.css&quot; type=&quot;text/css&quot; media=&quot;screen&quot;&gt;
467
+ -
468
+ - &lt;script type=&quot;text/javascript&quot; language=&quot;JavaScript&quot;&gt;
469
+ - //&lt;!--
470
+ - $(function() {
471
+ - $(&#x27;#highlight&#x27;).click(function() {
472
+ - window.console.profile(&quot;Syntax Highlighting&quot;);
473
+ - start = new Date();
474
+ -
475
+ - $(&#x27;pre.clang&#x27;).syntax({brush: &#x27;clang&#x27;, layout: &#x27;table&#x27;, replace: true}, function(options, html, container) {
476
+ - //$(&#x27;.function&#x27;, html).replaceWith(function(){
477
+ - // return $(&#x27;&lt;a&gt;&#x27;).addClass(&#x27;function&#x27;).attr(&#x27;href&#x27;, &#x27;#&#x27; + $(this).text()).html($(this).html());
478
+ - //})
479
+ -
480
+ - finish = new Date();
481
+ - window.console.profileEnd();
482
+ - window.console.log(finish - start);
483
+ - });
484
+ - });
485
+ - });
486
+ - //--&gt;
487
+ - &lt;/script&gt;
488
+ -
489
+ - &lt;/head&gt;
490
+ - &lt;body&gt;
491
+ - &lt;h1&gt;Syntax Highlighting Example&lt;/h1&gt;
492
+ -
493
+ - &lt;button id=&quot;highlight&quot;&gt;Highlight&lt;/button&gt;
494
+ -
495
+ - &lt;pre class=&quot;clang&quot;&gt;#include &amp;lt;iostream&amp;gt;
496
+ -
497
+ -// If we increase row by 1, the offset will increase by sz (number of elements per row i.e. number of columns)
498
+ -// If we increase col by 1, the offset will increase by 1
499
+ -unsigned rowMajorOffset(unsigned row, unsigned col, unsigned sz)
500
+ -{
501
+ - return col + row * sz;
502
+ -}
503
+ -
504
+ -// If we increase col by 1, the offset will increase by sz (number of elements per column i.e. number of rows)
505
+ -// If we increase row by 1, the offset will increase by 1
506
+ -unsigned columnMajorOffset(unsigned row, unsigned col, unsigned sz)
507
+ -{
508
+ - return row + col * sz;
509
+ -}
510
+ -
511
+ -template &amp;lt;typename _ValueT, unsigned _R, unsigned _C, bool _ColumnMajor&amp;gt;
512
+ -class Matrix {
513
+ -protected:
514
+ - enum { ColumnMajor = _ColumnMajor };
515
+ - enum { R = _R };
516
+ - enum { C = _C };
517
+ -
518
+ - typedef _ValueT ValueT;
519
+ -
520
+ - ValueT m_values[C*R];
521
+ -
522
+ -public:
523
+ - const ValueT &amp;amp; at (unsigned r, unsigned c) const
524
+ - {
525
+ - if (ColumnMajor)
526
+ - return m_values[columnMajorOffset(r, c, R)];
527
+ - else
528
+ - return m_values[rowMajorOffset(r, c, C)];
529
+ - }
530
+ -
531
+ - ValueT &amp;amp; at (unsigned r, unsigned c)
532
+ - {
533
+ - if (ColumnMajor)
534
+ - return m_values[columnMajorOffset(r, c, R)];
535
+ - else
536
+ - return m_values[rowMajorOffset(r, c, C)];
537
+ - }
538
+ -
539
+ - void loadTestPattern ()
540
+ - {
541
+ - for (unsigned r = 0; r &amp;lt; R; r += 1)
542
+ - for (unsigned c = 0; c &amp;lt; C; c += 1)
543
+ - at(r, c) = (r+1) * 1000 + (c+1);
544
+ - }
545
+ -
546
+ - void debug ()
547
+ - {
548
+ - using namespace std;
549
+ -
550
+ - if (ColumnMajor)
551
+ - cout &amp;lt;&amp;lt; &amp;quot;Column-Major Matrix &amp;quot; &amp;lt;&amp;lt; &amp;quot;(&amp;quot; &amp;lt;&amp;lt; R &amp;lt;&amp;lt; &amp;quot;,&amp;quot; &amp;lt;&amp;lt; C &amp;lt;&amp;lt; &amp;quot;)&amp;quot; &amp;lt;&amp;lt; &amp;quot; @ &amp;quot; &amp;lt;&amp;lt; this &amp;lt;&amp;lt; endl;
552
+ - else
553
+ - cout &amp;lt;&amp;lt; &amp;quot;Row-Major Matrix &amp;quot; &amp;lt;&amp;lt; &amp;quot;(&amp;quot; &amp;lt;&amp;lt; R &amp;lt;&amp;lt; &amp;quot;,&amp;quot; &amp;lt;&amp;lt; C &amp;lt;&amp;lt; &amp;quot;)&amp;quot; &amp;lt;&amp;lt; &amp;quot; @ &amp;quot; &amp;lt;&amp;lt; this &amp;lt;&amp;lt; endl;
554
+ -
555
+ - cout &amp;lt;&amp;lt; &amp;quot;Memory Offset: &amp;quot;;
556
+ - for (unsigned i = 0; i &amp;lt; (R*C); i += 1)
557
+ - cout &amp;lt;&amp;lt; i &amp;lt;&amp;lt; &amp;quot; &amp;quot;;
558
+ - cout &amp;lt;&amp;lt; endl;
559
+ -
560
+ - cout &amp;lt;&amp;lt; &amp;quot; Values: &amp;quot;;
561
+ - for (unsigned i = 0; i &amp;lt; (R*C); i += 1)
562
+ - cout &amp;lt;&amp;lt; m_values[i] &amp;lt;&amp;lt; &amp;quot; &amp;quot;;
563
+ - cout &amp;lt;&amp;lt; endl;
564
+ -
565
+ - cout &amp;lt;&amp;lt; &amp;quot;Standard Mathematical Notation:&amp;quot; &amp;lt;&amp;lt; endl;
566
+ - cout &amp;lt;&amp;lt; &amp;quot; &amp;quot;;
567
+ - for (unsigned c = 0; c &amp;lt; C; c += 1)
568
+ - cout &amp;lt;&amp;lt; &amp;quot;Col &amp;quot; &amp;lt;&amp;lt; c &amp;lt;&amp;lt; &amp;quot; &amp;quot;;
569
+ - cout &amp;lt;&amp;lt; endl;
570
+ -
571
+ - for (unsigned r = 0; r &amp;lt; R; r += 1) {
572
+ - cout &amp;lt;&amp;lt; &amp;quot;Row &amp;quot; &amp;lt;&amp;lt; r &amp;lt;&amp;lt; &amp;quot; &amp;quot;;
573
+ - for (unsigned c = 0; c &amp;lt; C; c += 1)
574
+ - cout &amp;lt;&amp;lt; at(r, c) &amp;lt;&amp;lt; &amp;quot; &amp;quot;;
575
+ - cout &amp;lt;&amp;lt; endl;
576
+ - }
577
+ - cout &amp;lt;&amp;lt; endl;
578
+ - }
579
+ -
580
+ - Matrix&amp;lt;ValueT, R, C, !ColumnMajor&amp;gt; transposeStorage () const
581
+ - {
582
+ - Matrix&amp;lt;ValueT, R, C, !ColumnMajor&amp;gt; result;
583
+ -
584
+ - for (unsigned r = 0; r &amp;lt; R; r += 1)
585
+ - for (unsigned c = 0; c &amp;lt; C; c += 1)
586
+ - result.at(r, c) = at(r, c);
587
+ -
588
+ - return result;
589
+ - }
590
+ -
591
+ - Matrix&amp;lt;ValueT, C, R, !ColumnMajor&amp;gt; transposeMatrix () const
592
+ - {
593
+ - Matrix&amp;lt;ValueT, C, R, !ColumnMajor&amp;gt; result;
594
+ -
595
+ - memcpy(&amp;amp;result.at(0,0), m_values, sizeof(m_values));
596
+ -
597
+ - return result;
598
+ - }
599
+ -};
600
+ -
601
+ -int main (int argc, char * const argv[]) {
602
+ - Matrix&amp;lt;float, 4, 2, false&amp;gt; rowMajorMatrix;
603
+ - Matrix&amp;lt;float, 4, 2, true&amp;gt; columnMajorMatrix;
604
+ -
605
+ - rowMajorMatrix.loadTestPattern();
606
+ - rowMajorMatrix.debug();
607
+ -
608
+ - columnMajorMatrix.loadTestPattern();
609
+ - columnMajorMatrix.debug();
610
+ -
611
+ - rowMajorMatrix = columnMajorMatrix.transposeStorage();
612
+ - rowMajorMatrix.debug();
613
+ -
614
+ - Matrix&amp;lt;float, 2, 4, false&amp;gt; transposedMatrix = columnMajorMatrix.transposeMatrix();
615
+ - transposedMatrix.debug();
616
+ -
617
+ - return 0;
618
+ -}&lt;/pre&gt;
619
+ -
620
+ - &lt;/body&gt;
621
+ -&lt;/html&gt;
622
+
623
+ diff --git a/jquery.syntax.brush.clang.js b/jquery.syntax.brush.clang.js
624
+ index dcbebbc..3c10a29 100644
625
+ --- a/jquery.syntax.brush.clang.js
626
+ +++ b/jquery.syntax.brush.clang.js
627
+ @@ -1,16 +1,19 @@
628
+ // brush: &quot;clang&quot; aliases: [&quot;cpp&quot;, &quot;c&quot;, &quot;objective-c&quot;]
629
+
630
+ Syntax.register(&#x27;clang&#x27;, function(brush) {
631
+ - var keywords = [&quot;@interface&quot;, &quot;@implementation&quot;, &quot;@protocol&quot;, &quot;@end&quot;, &quot;@private&quot;, &quot;@protected&quot;, &quot;@public&quot;, &quot;@try&quot;, &quot;@throw&quot;, &quot;@catch&quot;, &quot;@finally&quot;, &quot;@class&quot;, &quot;@selector&quot;, &quot;@encode&quot;, &quot;@synchronized&quot;, &quot;struct&quot;, &quot;break&quot;, &quot;continue&quot;, &quot;else&quot;, &quot;for&quot;, &quot;switch&quot;, &quot;case&quot;, &quot;default&quot;, &quot;enum&quot;, &quot;goto&quot;, &quot;register&quot;, &quot;sizeof&quot;, &quot;typedef&quot;, &quot;volatile&quot;, &quot;do&quot;, &quot;extern&quot;, &quot;if&quot;, &quot;return&quot;, &quot;static&quot;, &quot;union&quot;, &quot;while&quot;, &quot;asm&quot;, &quot;dynamic_cast&quot;, &quot;namespace&quot;, &quot;reinterpret_cast&quot;, &quot;try&quot;, &quot;explicit&quot;, &quot;static_cast&quot;, &quot;typeid&quot;, &quot;catch&quot;, &quot;operator&quot;, &quot;template&quot;, &quot;class&quot;, &quot;friend&quot;, &quot;private&quot;, &quot;using&quot;, &quot;const_cast&quot;, &quot;inline&quot;, &quot;public&quot;, &quot;throw&quot;, &quot;virtual&quot;, &quot;mutable&quot;, &quot;protected&quot;, &quot;wchar_t&quot;];
632
+ + var keywords = [&quot;@interface&quot;, &quot;@implementation&quot;, &quot;@protocol&quot;, &quot;@end&quot;, &quot;@private&quot;, &quot;@protected&quot;, &quot;@public&quot;, &quot;@try&quot;, &quot;@throw&quot;, &quot;@catch&quot;, &quot;@finally&quot;, &quot;@class&quot;, &quot;@selector&quot;, &quot;@encode&quot;, &quot;@synchronized&quot;, &quot;@property&quot;, &quot;struct&quot;, &quot;break&quot;, &quot;continue&quot;, &quot;else&quot;, &quot;for&quot;, &quot;switch&quot;, &quot;case&quot;, &quot;default&quot;, &quot;enum&quot;, &quot;goto&quot;, &quot;register&quot;, &quot;sizeof&quot;, &quot;typedef&quot;, &quot;volatile&quot;, &quot;do&quot;, &quot;extern&quot;, &quot;if&quot;, &quot;return&quot;, &quot;static&quot;, &quot;union&quot;, &quot;while&quot;, &quot;asm&quot;, &quot;dynamic_cast&quot;, &quot;namespace&quot;, &quot;reinterpret_cast&quot;, &quot;try&quot;, &quot;explicit&quot;, &quot;static_cast&quot;, &quot;typeid&quot;, &quot;catch&quot;, &quot;operator&quot;, &quot;template&quot;, &quot;class&quot;, &quot;friend&quot;, &quot;private&quot;, &quot;using&quot;, &quot;const_cast&quot;, &quot;inline&quot;, &quot;public&quot;, &quot;throw&quot;, &quot;virtual&quot;, &quot;mutable&quot;, &quot;protected&quot;, &quot;wchar_t&quot;];
633
+
634
+ - var types = [&quot;auto&quot;, &quot;const&quot;, &quot;double&quot;, &quot;float&quot;, &quot;int&quot;, &quot;short&quot;, &quot;char&quot;, &quot;long&quot;, &quot;signed&quot;, &quot;unsigned&quot;, &quot;bool&quot;, &quot;void&quot;, &quot;typename&quot;];
635
+ - var operators = [&quot;+&quot;, &quot;*&quot;, &quot;/&quot;, &quot;-&quot;, &quot;&amp;&quot;, &quot;|&quot;, &quot;~&quot;, &quot;!&quot;, &quot;%&quot;, &quot;&lt;&quot;, &quot;=&quot;, &quot;&gt;&quot;, &quot;new&quot;, &quot;delete&quot;];
636
+ + var types = [&quot;auto&quot;, &quot;const&quot;, &quot;double&quot;, &quot;float&quot;, &quot;int&quot;, &quot;short&quot;, &quot;char&quot;, &quot;long&quot;, &quot;signed&quot;, &quot;unsigned&quot;, &quot;bool&quot;, &quot;void&quot;, &quot;typename&quot;, &quot;id&quot;];
637
+ + var operators = [&quot;+&quot;, &quot;*&quot;, &quot;/&quot;, &quot;-&quot;, &quot;&amp;&quot;, &quot;|&quot;, &quot;~&quot;, &quot;!&quot;, &quot;%&quot;, &quot;&lt;&quot;, &quot;=&quot;, &quot;&gt;&quot;, &quot;[&quot;, &quot;]&quot;, &quot;new&quot;, &quot;delete&quot;];
638
+ var values = [&quot;this&quot;, &quot;true&quot;, &quot;false&quot;, /[0-9]+(\.[0-9]+)?/g];
639
+
640
+ - brush.push(values, {klass: &#x27;constant&#x27;, children: null});
641
+ - brush.push(types, {klass: &#x27;type&#x27;, children: null})
642
+ - brush.push(keywords, {klass: &#x27;keyword&#x27;, children: null})
643
+ - brush.push(operators, {klass: &#x27;operator&#x27;, children: null})
644
+ + brush.push(values, {klass: &#x27;constant&#x27;, children: []});
645
+ + brush.push(types, {klass: &#x27;type&#x27;, children: []})
646
+ + brush.push(keywords, {klass: &#x27;keyword&#x27;, children: []})
647
+ + brush.push(operators, {klass: &#x27;operator&#x27;, children: []})
648
+ +
649
+ + // Objective-C classes
650
+ + brush.push({pattern: /\b[A-Z][\w]*\b/g, klass: &#x27;type&#x27;, children: []})
651
+
652
+ brush.push({
653
+ pattern: /#.*$/gmi,
654
+ @@ -21,6 +24,15 @@ Syntax.register(&#x27;clang&#x27;, function(brush) {
655
+ brush.push(Syntax.lib.cStyleComment);
656
+ brush.push(Syntax.lib.cppStyleComment);
657
+
658
+ + // Objective-C style functions
659
+ + brush.push({pattern: /\w+:/g, klass: &#x27;function&#x27;, children: []});
660
+ + brush.push({
661
+ + pattern: /[^:\[]\s+(\w+)(?=])/g,
662
+ + klass: &#x27;function&#x27;,
663
+ + matches: Syntax.singleMatchFunction(1, {klass: &#x27;function&#x27;, children: []})
664
+ + })
665
+ +
666
+ + // Strings
667
+ brush.push({pattern: /&quot;.+?&quot;/g, klass: &#x27;string&#x27;, children: &#x27;escape&#x27;});
668
+ brush.push({pattern: /\\./g, klass: &#x27;escape&#x27;});
669
+
670
+ diff --git a/jquery.syntax.brush.ruby.js b/jquery.syntax.brush.ruby.js
671
+ index 71fdeaf..64a4626 100644
672
+ --- a/jquery.syntax.brush.ruby.js
673
+ +++ b/jquery.syntax.brush.ruby.js
674
+ @@ -1,34 +1,30 @@
675
+ // brush: &quot;ruby&quot; aliases: []
676
+
677
+ -/*
678
+ - # This ruby code will generate a list of classes.
679
+ - classes = []
680
+ -
681
+ - ObjectSpace.each_object(Class) do |c|
682
+ - classes &lt;&lt; c
683
+ - end
684
+ -
685
+ - puts classes.collect{|cls| cls.name}.inspect
686
+ -*/
687
+ +Syntax.lib.rubyStyleFunction = {pattern: /(?:def\s+|\.)([a-z_][a-z0-9_]+)/gi, matches: Syntax.singleMatchFunction(1, {klass: &#x27;function&#x27;, children: null})}
688
+ +Syntax.lib.rubyStyleSymbol = {pattern: /:[\w]+/, klass: &#x27;constant&#x27;, children: null}
689
+
690
+ Syntax.register(&#x27;ruby&#x27;, function(brush) {
691
+ var keywords = [&quot;alias&quot;, &quot;and&quot;, &quot;begin&quot;, &quot;break&quot;, &quot;case&quot;, &quot;class&quot;, &quot;def&quot;, &quot;define_method&quot;, &quot;defined&quot;, &quot;do&quot;, &quot;each&quot;, &quot;else&quot;, &quot;elsif&quot;, &quot;end&quot;, &quot;ensure&quot;, &quot;false&quot;, &quot;for&quot;, &quot;if&quot;, &quot;in&quot;, &quot;module&quot;, &quot;new&quot;, &quot;next&quot;, &quot;nil&quot;, &quot;not&quot;, &quot;or&quot;, &quot;raise&quot;, &quot;redo&quot;, &quot;rescue&quot;, &quot;retry&quot;, &quot;return&quot;, &quot;self&quot;, &quot;super&quot;, &quot;then&quot;, &quot;throw&quot;, &quot;true&quot;, &quot;undef&quot;, &quot;unless&quot;, &quot;until&quot;, &quot;when&quot;, &quot;while&quot;, &quot;yield&quot;];
692
+
693
+ - var types = [&quot;Socket&quot;, &quot;UNIXServer&quot;, &quot;UNIXSocket&quot;, &quot;UDPSocket&quot;, &quot;TCPServer&quot;, &quot;TCPSocket&quot;, &quot;IPSocket&quot;, &quot;BasicSocket&quot;, &quot;SocketError&quot;, &quot;Pathname&quot;, &quot;StopIteration&quot;, &quot;Enumerable::Enumerator&quot;, &quot;Binding&quot;, &quot;UnboundMethod&quot;, &quot;Method&quot;, &quot;Proc&quot;, &quot;SystemStackError&quot;, &quot;LocalJumpError&quot;, &quot;Struct::Tms&quot;, &quot;Process::Status&quot;, &quot;Time&quot;, &quot;Dir&quot;, &quot;File::Stat&quot;, &quot;File&quot;, &quot;IO&quot;, &quot;EOFError&quot;, &quot;IOError&quot;, &quot;Range&quot;, &quot;MatchData&quot;, &quot;Regexp&quot;, &quot;RegexpError&quot;, &quot;Struct&quot;, &quot;Hash&quot;, &quot;Array&quot;, &quot;Errno::EDQUOT&quot;, &quot;Errno::ESTALE&quot;, &quot;Errno::EINPROGRESS&quot;, &quot;Errno::EALREADY&quot;, &quot;Errno::EHOSTUNREACH&quot;, &quot;Errno::EHOSTDOWN&quot;, &quot;Errno::ECONNREFUSED&quot;, &quot;Errno::ETIMEDOUT&quot;, &quot;Errno::ETOOMANYREFS&quot;, &quot;Errno::ESHUTDOWN&quot;, &quot;Errno::ENOTCONN&quot;, &quot;Errno::EISCONN&quot;, &quot;Errno::ENOBUFS&quot;, &quot;Errno::ECONNRESET&quot;, &quot;Errno::ECONNABORTED&quot;, &quot;Errno::ENETRESET&quot;, &quot;Errno::ENETUNREACH&quot;, &quot;Errno::ENETDOWN&quot;, &quot;Errno::EADDRNOTAVAIL&quot;, &quot;Errno::EADDRINUSE&quot;, &quot;Errno::EAFNOSUPPORT&quot;, &quot;Errno::EPFNOSUPPORT&quot;, &quot;Errno::EOPNOTSUPP&quot;, &quot;Errno::ESOCKTNOSUPPORT&quot;, &quot;Errno::EPROTONOSUPPORT&quot;, &quot;Errno::ENOPROTOOPT&quot;, &quot;Errno::EPROTOTYPE&quot;, &quot;Errno::EMSGSIZE&quot;, &quot;Errno::EDESTADDRREQ&quot;, &quot;Errno::ENOTSOCK&quot;, &quot;Errno::EUSERS&quot;, &quot;Errno::EILSEQ&quot;, &quot;Errno::EOVERFLOW&quot;, &quot;Errno::EBADMSG&quot;, &quot;Errno::EMULTIHOP&quot;, &quot;Errno::EPROTO&quot;, &quot;Errno::ENOLINK&quot;, &quot;Errno::EREMOTE&quot;, &quot;Errno::ENOSR&quot;, &quot;Errno::ETIME&quot;, &quot;Errno::ENODATA&quot;, &quot;Errno::ENOSTR&quot;, &quot;Errno::EIDRM&quot;, &quot;Errno::ENOMSG&quot;, &quot;Errno::ELOOP&quot;, &quot;Errno::ENOTEMPTY&quot;, &quot;Errno::ENOSYS&quot;, &quot;Errno::ENOLCK&quot;, &quot;Errno::ENAMETOOLONG&quot;, &quot;Errno::EDEADLK&quot;, &quot;Errno::ERANGE&quot;, &quot;Errno::EDOM&quot;, &quot;Errno::EPIPE&quot;, &quot;Errno::EMLINK&quot;, &quot;Errno::EROFS&quot;, &quot;Errno::ESPIPE&quot;, &quot;Errno::ENOSPC&quot;, &quot;Errno::EFBIG&quot;, &quot;Errno::ETXTBSY&quot;, &quot;Errno::ENOTTY&quot;, &quot;Errno::EMFILE&quot;, &quot;Errno::ENFILE&quot;, &quot;Errno::EINVAL&quot;, &quot;Errno::EISDIR&quot;, &quot;Errno::ENOTDIR&quot;, &quot;Errno::ENODEV&quot;, &quot;Errno::EXDEV&quot;, &quot;Errno::EEXIST&quot;, &quot;Errno::EBUSY&quot;, &quot;Errno::ENOTBLK&quot;, &quot;Errno::EFAULT&quot;, &quot;Errno::EACCES&quot;, &quot;Errno::ENOMEM&quot;, &quot;Errno::EAGAIN&quot;, &quot;Errno::ECHILD&quot;, &quot;Errno::EBADF&quot;, &quot;Errno::ENOEXEC&quot;, &quot;Errno::E2BIG&quot;, &quot;Errno::ENXIO&quot;, &quot;Errno::EIO&quot;, &quot;Errno::EINTR&quot;, &quot;Errno::ESRCH&quot;, &quot;Errno::ENOENT&quot;, &quot;Errno::EPERM&quot;, &quot;Bignum&quot;, &quot;Float&quot;, &quot;Fixnum&quot;, &quot;Integer&quot;, &quot;Numeric&quot;, &quot;FloatDomainError&quot;, &quot;ZeroDivisionError&quot;, &quot;ThreadGroup&quot;, &quot;Continuation&quot;, &quot;Thread&quot;, &quot;ThreadError&quot;, &quot;SystemCallError&quot;, &quot;NoMemoryError&quot;, &quot;SecurityError&quot;, &quot;RuntimeError&quot;, &quot;NotImplementedError&quot;, &quot;LoadError&quot;, &quot;SyntaxError&quot;, &quot;ScriptError&quot;, &quot;NoMethodError&quot;, &quot;NameError::message&quot;, &quot;NameError&quot;, &quot;RangeError&quot;, &quot;IndexError&quot;, &quot;ArgumentError&quot;, &quot;TypeError&quot;, &quot;StandardError&quot;, &quot;Interrupt&quot;, &quot;SignalException&quot;, &quot;fatal&quot;, &quot;SystemExit&quot;, &quot;Exception&quot;, &quot;String&quot;, &quot;FalseClass&quot;, &quot;TrueClass&quot;, &quot;Data&quot;, &quot;Symbol&quot;, &quot;NilClass&quot;, &quot;Class&quot;, &quot;Module&quot;, &quot;Object&quot;];
694
+ -
695
+ var operators = [&quot;+&quot;, &quot;*&quot;, &quot;/&quot;, &quot;-&quot;, &quot;&amp;&quot;, &quot;|&quot;, &quot;~&quot;, &quot;!&quot;, &quot;%&quot;, &quot;&lt;&quot;, &quot;=&quot;, &quot;&gt;&quot;];
696
+ var values = [&quot;this&quot;, &quot;true&quot;, &quot;false&quot;, &quot;nil&quot;, /[0-9]+(\.[0-9]+)?/g];
697
+
698
+ brush.push(values, {klass: &#x27;constant&#x27;, children: null});
699
+ - brush.push(types, {klass: &#x27;type&#x27;, children: null})
700
+ +
701
+ + brush.push({pattern: /(@+|\$)[\w]+/g, klass: &#x27;variable&#x27;, children: null})
702
+ +
703
+ + brush.push({pattern: /[A-Z_][\w:]+/g, klass: &#x27;type&#x27;, children: null})
704
+ brush.push(keywords, {klass: &#x27;keyword&#x27;, children: null})
705
+ brush.push(operators, {klass: &#x27;operator&#x27;, children: null})
706
+
707
+ brush.push(Syntax.lib.perlStyleComment)
708
+ + brush.push(Syntax.lib.webLink)
709
+
710
+ brush.push({pattern: /&quot;.+?&quot;/g, klass: &#x27;string&#x27;, children: [&#x27;escape&#x27;]});
711
+ + brush.push({pattern: /&#x27;.+?&#x27;/g, klass: &#x27;string&#x27;, children: [&#x27;escape&#x27;]});
712
+ brush.push({pattern: /\\./g, klass: &#x27;escape&#x27;});
713
+
714
+ brush.push(Syntax.lib.rubyStyleFunction);
715
+ + brush.push(Syntax.lib.cStyleFunction);
716
+ });
717
+
718
+ diff --git a/jquery.syntax.css b/jquery.syntax.css
719
+ index 0c4d657..2423173 100644
720
+ --- a/jquery.syntax.css
721
+ +++ b/jquery.syntax.css
722
+ @@ -14,12 +14,12 @@
723
+
724
+ .syntax .keyword {
725
+ color: #3c3;
726
+ - font-weight: bold;
727
+ }
728
+
729
+ .syntax .type,
730
+ .syntax .template {
731
+ - color: #3c3;
732
+ + color: #191;
733
+ + font-weight: bold;
734
+ }
735
+
736
+ .syntax .typename {
737
+ @@ -44,7 +44,12 @@
738
+ color: #c00;
739
+ }
740
+
741
+ -.syntax .template {
742
+ +.syntax .href {
743
+ + color: #00f;
744
+ + text-decoration: underline;
745
+ +}
746
+ +
747
+ +.syntax .variable {
748
+ font-style: italic;
749
+ }
750
+
751
+ diff --git a/jquery.syntax.js b/jquery.syntax.js
752
+ index 7dfc642..07fc8a1 100644
753
+ --- a/jquery.syntax.js
754
+ +++ b/jquery.syntax.js
755
+ @@ -73,9 +73,8 @@ ResourceLoader.prototype._finish = function (name) {
756
+ if (!resource)
757
+ window.console.log(&quot;Could not load resource named &quot;, name)
758
+ else {
759
+ - for (var i in loading) {
760
+ + for (var i = 0; i &lt; loading.length; i += 1)
761
+ loading[i](resource)
762
+ - }
763
+ }
764
+ }
765
+
766
+ @@ -100,11 +99,9 @@ Syntax = {
767
+
768
+ Syntax.getResource(&#x27;jquery.syntax.brush&#x27;, name, callback)
769
+ }),
770
+ -
771
+ layouts: new ResourceLoader(function(name, callback) {
772
+ Syntax.getResource(&#x27;jquery.syntax.layout&#x27;, name, callback)
773
+ - }),
774
+ -
775
+ + }),
776
+ getStyles: function (path) {
777
+ var link = $(&#x27;&lt;link&gt;&#x27;)
778
+ $(&quot;head&quot;).append(link)
779
+ @@ -115,7 +112,6 @@ Syntax = {
780
+ href: path
781
+ })
782
+ },
783
+ -
784
+ getScript: function (path, callback) {
785
+ $.ajax({
786
+ async: &#x27;true&#x27;,
787
+ @@ -128,7 +124,6 @@ Syntax = {
788
+ cache: true
789
+ })
790
+ },
791
+ -
792
+ getResource: function (prefix, name, callback) {
793
+ var basename = prefix + &quot;.&quot; + name
794
+
795
+ @@ -137,25 +132,22 @@ Syntax = {
796
+
797
+ Syntax.getScript(this.root + basename + &#x27;.js&#x27;, callback)
798
+ },
799
+ -
800
+ register: function (name, callback) {
801
+ - brush = Syntax.brushes[name] = new Syntax.Brush()
802
+ + var brush = Syntax.brushes[name] = new Syntax.Brush()
803
+ window.console.log(&quot;Registering brush&quot;, name, Syntax.brushes)
804
+
805
+ brush.klass = name
806
+
807
+ callback(brush)
808
+ },
809
+ -
810
+ alias: function (name, aliases) {
811
+ - for (var i in aliases)
812
+ + for (var i = 0; i &lt; aliases.length; i += 1)
813
+ Syntax.aliases[aliases[i]] = name
814
+ },
815
+ -
816
+ getMatches: function (text, expr) {
817
+ //window.console.log(&quot;getMatches: &quot;, text, expr)
818
+
819
+ - var matches = []
820
+ + var matches = [], match = null
821
+
822
+ while((match = expr.pattern.exec(text)) != null) {
823
+ if (expr.matches)
824
+ @@ -168,23 +160,23 @@ Syntax = {
825
+ }
826
+ }
827
+
828
+ -// Default layout
829
+ Syntax.layouts.plain = function (options, html, container) {
830
+ return html
831
+ }
832
+
833
+ Syntax.singleMatchFunction = function(index, rule) {
834
+ - return function(token) {
835
+ + return function(match) {
836
+ return new Syntax.Match(RegExp.indexOf(match, index), match[index].length, rule, match[index])
837
+ }
838
+ }
839
+
840
+ -Syntax.lib.cStyleComment = {pattern: /\/\*[\s\S]*?\*\//gm, klass: &#x27;comment&#x27;, children: null}
841
+ -Syntax.lib.cppStyleComment = {pattern: /\/\/.*$/gm, klass: &#x27;comment&#x27;, children: null}
842
+ -Syntax.lib.perlStyleComment = {pattern: /#.*$/gm, klass: &#x27;comment&#x27;, children: null}
843
+ -Syntax.lib.cStyleFunction = {pattern: /([a-z_][a-z0-9_]+)\s*\(/gi, matches: Syntax.singleMatchFunction(1, {klass: &#x27;function&#x27;, children: null})}
844
+ -Syntax.lib.rubyStyleFunction = {pattern: /\.([a-z_][a-z0-9_]+)/gi, matches: Syntax.singleMatchFunction(1, {klass: &#x27;function&#x27;, children: null})}
845
+ -Syntax.lib.rubyStyleSymbol = {pattern: /:[\w]+/, klass: &#x27;constant&#x27;, children: null}
846
+ +Syntax.lib.cStyleComment = {pattern: /\/\*[\s\S]*?\*\//gm, klass: &#x27;comment&#x27;, children: [&#x27;href&#x27;]}
847
+ +Syntax.lib.cppStyleComment = {pattern: /\/\/.*$/gm, klass: &#x27;comment&#x27;, children: [&#x27;href&#x27;]}
848
+ +Syntax.lib.perlStyleComment = {pattern: /#.*$/gm, klass: &#x27;comment&#x27;, children: [&#x27;href&#x27;]}
849
+ +
850
+ +Syntax.lib.cStyleFunction = {pattern: /([a-z_][a-z0-9_]+)\s*\(/gi, matches: Syntax.singleMatchFunction(1, {klass: &#x27;function&#x27;, children: []})}
851
+ +
852
+ +Syntax.lib.webLink = {pattern: /https?:\/\/([-\w~!$?&amp;#\/+|.,=]|%[a-f\d]{2})+/g, klass: &#x27;href&#x27;}
853
+
854
+ Syntax.Match = function (offset, length, expr, value) {
855
+ this.offset = offset
856
+ @@ -199,16 +191,11 @@ Syntax.Match = function (offset, length, expr, value) {
857
+ }
858
+
859
+ Syntax.Match.sort = function (a,b) {
860
+ - var diff = a.offset - b.offset
861
+ -
862
+ - if (diff != 0)
863
+ - return diff
864
+ - else
865
+ - return b.length - a.length
866
+ + return (a.offset - b.offset) || (b.length - a.length)
867
+ }
868
+
869
+ Syntax.Match.prototype.contains = function (match) {
870
+ - return (this.offset &lt;= match.offset) &amp;&amp; (match.endOffset &lt;= this.endOffset)
871
+ + return (match.offset &gt;= this.offset) &amp;&amp; (match.endOffset &lt;= this.endOffset)
872
+ }
873
+
874
+ Syntax.Match.defaultReduceCallback = function (node, container) {
875
+ @@ -237,9 +224,8 @@ Syntax.Match.prototype.reduce = function (append) {
876
+ if (this.expression &amp;&amp; this.expression.klass)
877
+ container.addClass(this.expression.klass)
878
+
879
+ - for (var i in this.children) {
880
+ + for (var i = 0; i &lt; this.children.length; i += 1) {
881
+ //window.console.log(i, this.children[i], text)
882
+ -
883
+ var child = this.children[i]
884
+ var end = child.offset
885
+
886
+ @@ -256,56 +242,59 @@ Syntax.Match.prototype.reduce = function (append) {
887
+ else if (start &lt; this.endOffset)
888
+ append(this.value.substr(start - this.offset, this.endOffset - start), container)
889
+ else if (start &gt; this.endOffset)
890
+ - window.console.log(&quot;Start position&quot;, start, &quot;exceeds length of value&quot;, this)
891
+ + window.console.log(&quot;Start position&quot;, start, &quot;exceeds length of value&quot;, this.offset, this.length)
892
+
893
+ return container
894
+ }
895
+
896
+ -// This function is by far the biggest overal cost in terms of run-time. This is not because
897
+ -// it is slow, but mostly because it is called many times. It already has as much of the logic
898
+ -// folded into it (few function calls). I considered making it non-recursive, but after testing,
899
+ -// I found that less than 64 out of 500 function calls recursed at all, so it wouldn&#x27;t be worth
900
+ -// it - it might even get slower.
901
+ -Syntax.Match.prototype.insert = function (match) {
902
+ +// This is not a general tree insertion function. It is optimised to run in almost constant
903
+ +// time, but data must be inserted in sorted order, otherwise you will have problems.
904
+ +Syntax.Match.prototype.insertAtEnd = function (match) {
905
+ + if (!this.contains(match)) {
906
+ + window.console.log(this, &quot;does not contain&quot;, match)
907
+ + return null;
908
+ + }
909
+ +
910
+ // We have explicitly said: no children
911
+ if (this.expression.children === null)
912
+ return null
913
+ -
914
+ - if (this.expression.children) {
915
+ - // window.console.log(this.expression.children, match.expression.klass, $.inArray(match.expression.klass, this.expression.children))
916
+ + else if (this.expression.children) {
917
+ if ($.inArray(match.expression.klass, this.expression.children) == -1)
918
+ return null
919
+ }
920
+
921
+ - if (!this.contains(match))
922
+ - return null
923
+ -
924
+ if (this.children.length &gt; 0) {
925
+ - for (var i in this.children) {
926
+ - var child = this.children[i]
927
+ -
928
+ - if (match.offset &lt; child.offset) {
929
+ - if (match.endOffset &lt;= child.offset) {
930
+ - this.children.splice(i, 0, match)
931
+ - return this
932
+ - } else {
933
+ - window.console.log(&quot;Match &quot; + match.toString() + &quot; &quot; + displacement + &quot; existing child: &quot; + this.children[i].toString())
934
+ - return null
935
+ - }
936
+ - } else if (match.offset &lt; child.endOffset) {
937
+ - if (match.endOffset &lt;= child.endOffset) {
938
+ - // Recursive step
939
+ - return child.insert(match)
940
+ - } else {
941
+ - var parts = match.halfBisect(child.endOffset)
942
+ - child.insert(parts[0])
943
+ - match = parts[1]
944
+ - }
945
+ + var i = this.children.length-1
946
+ + var child = this.children[i]
947
+ +
948
+ + if (match.offset &lt; child.offset) {
949
+ + if (match.endOffset &lt;= child.offset) {
950
+ + // displacement = &#x27;before&#x27;
951
+ + this.children.splice(i, 0, match)
952
+ + return this
953
+ + } else {
954
+ + // displacement = &#x27;left-overlap&#x27;
955
+ + return null
956
+ + }
957
+ + } else if (match.offset &lt; child.endOffset) {
958
+ + if (match.endOffset &lt;= child.endOffset) {
959
+ + // displacement = &#x27;contains&#x27;
960
+ + var result = child.insertAtEnd(match)
961
+ + return result
962
+ } else {
963
+ - if (i == this.children.length-1) {
964
+ - this.children.splice(i+1, 0, match)
965
+ - return this
966
+ - }
967
+ + // displacement = &#x27;right-overlap&#x27;
968
+ + // This code should work, but right now I don&#x27;t think its useful.
969
+ + window.console.error(&quot;Cannot add match&quot;, match, &quot;into&quot;, this, &quot;it right-overlaps!&quot;)
970
+ + //var parts = match.halfBisect(child.endOffset)
971
+ + // child.insertAtEnd(parts[0])
972
+ + // this.insertAtEnd(parts[1])
973
+ + return null;
974
+ + }
975
+ + } else {
976
+ + // displacement = &#x27;after&#x27;
977
+ + if (i == this.children.length-1) {
978
+ + this.children.splice(i+1, 0, match)
979
+ + return this
980
+ }
981
+ }
982
+
983
+ @@ -328,7 +317,14 @@ Syntax.Match.prototype.halfBisect = function(offset) {
984
+ Syntax.Match.prototype.bisectAtOffsets = function(splits) {
985
+ var parts = [], start = this.offset, prev = null, children = $.merge([], this.children)
986
+
987
+ - for (var i in splits) {
988
+ + // Copy the array so we can modify it.
989
+ + splits = splits.slice(0)
990
+ +
991
+ + // We need to split including the last part.
992
+ + splits.push(this.endOffset)
993
+ + splits.sort(function(a,b){return a-b})
994
+ +
995
+ + for (var i = 0; i &lt; splits.length; i += 1) {
996
+ var offset = splits[i]
997
+
998
+ if (offset &lt; this.offset || offset &gt; this.endOffset) {
999
+ @@ -336,7 +332,7 @@ Syntax.Match.prototype.bisectAtOffsets = function(splits) {
1000
+ }
1001
+
1002
+ var match = new Syntax.Match(start, offset - start, this.expression)
1003
+ - match.value = this.value.substr(start, match.length)
1004
+ + match.value = this.value.substr(start - this.offset, match.length)
1005
+
1006
+ if (prev)
1007
+ prev.next = match
1008
+ @@ -351,7 +347,7 @@ Syntax.Match.prototype.bisectAtOffsets = function(splits) {
1009
+ splits.length = parts.length
1010
+
1011
+ for (var i = 0; i &lt; parts.length; i += 1) {
1012
+ - var offset = splits.shift()
1013
+ + var offset = splits[0]
1014
+
1015
+ while (children.length &gt; 0) {
1016
+ if (children[0].endOffset &lt;= parts[i].endOffset)
1017
+ @@ -362,15 +358,18 @@ Syntax.Match.prototype.bisectAtOffsets = function(splits) {
1018
+
1019
+ if (children.length) {
1020
+ // We may have an intersection
1021
+ - if (children[0].offset &lt; parts[i].offset) {
1022
+ - children_parts = children.shift().bisectAtOffsets(splits)
1023
+ + if (children[0].offset &lt; parts[i].endOffset) {
1024
+ + var children_parts = children.shift().bisectAtOffsets(splits), j = 0
1025
+
1026
+ - for (var j in children_parts)
1027
+ + for (; j &lt; children_parts.length; j += 1)
1028
+ parts[i+j].children.push(children_parts[j])
1029
+
1030
+ - // i += (j-1)
1031
+ + // Skip any parts which have been populated already
1032
+ + // i += (children_parts.length-1)
1033
+ }
1034
+ }
1035
+ +
1036
+ + splits.shift();
1037
+ }
1038
+
1039
+ if (children.length)
1040
+ @@ -380,14 +379,11 @@ Syntax.Match.prototype.bisectAtOffsets = function(splits) {
1041
+ }
1042
+
1043
+ Syntax.Match.prototype.split = function(pattern) {
1044
+ - var splits = []
1045
+ + var splits = [], match
1046
+
1047
+ while ((match = pattern.exec(this.value)) != null)
1048
+ splits.push(pattern.lastIndex)
1049
+
1050
+ - // We need to have a fake split at the end.
1051
+ - splits.push(this.endOffset)
1052
+ -
1053
+ return this.bisectAtOffsets(splits)
1054
+ }
1055
+
1056
+ @@ -400,14 +396,24 @@ Syntax.Brush.prototype.push = function () {
1057
+ if ($.isArray(arguments[0])) {
1058
+ var patterns = arguments[0], rule = arguments[1]
1059
+
1060
+ - for (var i in patterns)
1061
+ + for (var i = 0; i &lt; patterns.length; i += 1)
1062
+ this.push($.extend({pattern: patterns[i]}, rule))
1063
+ } else {
1064
+ var rule = arguments[0]
1065
+
1066
+ if (typeof(rule.pattern) == &#x27;string&#x27;) {
1067
+ rule.string = rule.pattern
1068
+ - rule.pattern = new RegExp(RegExp.escape(rule.pattern), rule.options || &#x27;g&#x27;)
1069
+ + var prefix = &quot;\\b&quot;, postfix = &quot;\\b&quot;
1070
+ +
1071
+ + if (!rule.pattern.match(/^\w/)) {
1072
+ + if (!rule.pattern.match(/\w$/))
1073
+ + prefix = postfix = &quot;&quot;
1074
+ + else
1075
+ + prefix = &quot;\\B&quot;
1076
+ + }
1077
+ +
1078
+ +
1079
+ + rule.pattern = rule.pattern = new RegExp(prefix + RegExp.escape(rule.pattern) + postfix, rule.options || &#x27;g&#x27;)
1080
+ }
1081
+
1082
+ if (rule.pattern.global)
1083
+ @@ -420,9 +426,8 @@ Syntax.Brush.prototype.push = function () {
1084
+ Syntax.Brush.prototype.getMatches = function(text) {
1085
+ var matches = []
1086
+
1087
+ - for (var i in this.rules) {
1088
+ + for (var i = 0; i &lt; this.rules.length; i += 1)
1089
+ matches = matches.concat(Syntax.getMatches(text, this.rules[i]))
1090
+ - }
1091
+
1092
+ return matches
1093
+ }
1094
+ @@ -434,15 +439,14 @@ Syntax.Brush.prototype.process = function(text) {
1095
+ // This sort is absolutely key to the functioning of the tree insertion algorithm.
1096
+ matches.sort(Syntax.Match.sort)
1097
+
1098
+ - for (var i in matches) {
1099
+ - top.insert(matches[i])
1100
+ - }
1101
+ + for (var i = 0; i &lt; matches.length; i += 1)
1102
+ + top.insertAtEnd(matches[i])
1103
+
1104
+ var lines = top.split(/\n/g)
1105
+
1106
+ var html = $(&#x27;&lt;pre&gt;&#x27;).addClass(&#x27;syntax&#x27;)
1107
+
1108
+ - for (var i in lines) {
1109
+ + for (var i = 0; i &lt; lines.length; i += 1) {
1110
+ var line = lines[i].reduce()
1111
+ html.append(line)
1112
+ }
1113
+ diff --git a/jquery.syntax.layout.table.css b/jquery.syntax.layout.table.css
1114
+ index 6e12646..043f721 100644
1115
+ --- a/jquery.syntax.layout.table.css
1116
+ +++ b/jquery.syntax.layout.table.css
1117
+ @@ -11,6 +11,10 @@ table.syntax {
1118
+ -webkit-box-shadow: 5px 5px 5px #eee;
1119
+ }
1120
+
1121
+ +table.syntax tr.alt td.source {
1122
+ + background-color: #f6f6f6;
1123
+ +}
1124
+ +
1125
+ table.syntax td {
1126
+ padding-left: 0.4em;
1127
+ padding-right: 0.4em;
1128
+ @@ -22,5 +26,5 @@ table.syntax td.number {
1129
+
1130
+ width: 2.5em;
1131
+ color: #555;
1132
+ - background-color: #dadada;
1133
+ + background-color: #e0e0e0;
1134
+ }
1135
+
1136
+ diff --git a/jquery.syntax.layout.table.js b/jquery.syntax.layout.table.js
1137
+ index 9cd68c3..14967c4 100644
1138
+ --- a/jquery.syntax.layout.table.js
1139
+ +++ b/jquery.syntax.layout.table.js
1140
+ @@ -1,16 +1,14 @@
1141
+ -Syntax.layouts.table = function(options, code, container) {
1142
+ - var table = $(&#x27;&lt;table&gt;&#x27;), tr = null, td = null;
1143
+ +Syntax.layouts.tableJQ = function(options, code, container) {
1144
+ + var table = $(&#x27;&lt;table class=&quot;syntax&quot;&gt;&#x27;), tr = null, td = null;
1145
+ var line = 1;
1146
+
1147
+ - table.addClass(&#x27;syntax&#x27;);
1148
+ -
1149
+ code.children().each(function() {
1150
+ - tr = $(&#x27;&lt;tr&gt;&#x27;).addClass(&#x27;line&#x27;, &#x27;line-&#x27; + line);
1151
+ + tr = $(&#x27;&lt;tr class=&quot;line ln&#x27; + line + &#x27;&quot;&gt;&#x27;)
1152
+
1153
+ - td = $(&#x27;&lt;td&gt;&#x27;).addClass(&#x27;number&#x27;).text(line);
1154
+ + td = $(&#x27;&lt;td class=&quot;number&quot;&gt;&#x27; + line + &#x27;&lt;/td&gt;&#x27;)
1155
+ tr.append(td);
1156
+
1157
+ - td = $(&#x27;&lt;td&gt;&#x27;).addClass(&#x27;source&#x27;);
1158
+ + td = $(&#x27;&lt;td class=&quot;source&quot;&gt;&#x27;)
1159
+ td.append(this);
1160
+ tr.append(td);
1161
+
1162
+ @@ -19,4 +17,57 @@ Syntax.layouts.table = function(options, code, container) {
1163
+ });
1164
+
1165
+ return table;
1166
+ -}
1167
+
1168
+ +}
1169
+ +
1170
+ +Syntax.layouts.tableDOM = function(options, code, container) {
1171
+ + var table = $(&#x27;&lt;table&gt;&#x27;), tr = null, td = null;
1172
+ + var line = 1;
1173
+ +
1174
+ + table.addClass(&#x27;syntax&#x27;);
1175
+ +
1176
+ + code.children().each(function() {
1177
+ + tr = document.createElement(&#x27;tr&#x27;)
1178
+ + tr.className = &quot;line ln&quot; + line
1179
+ +
1180
+ + if (line % 2)
1181
+ + tr.className += &quot; alt&quot;
1182
+ +
1183
+ + td = document.createElement(&#x27;td&#x27;)
1184
+ + td.className = &quot;number&quot;
1185
+ + td.innerHTML = line
1186
+ + tr.appendChild(td)
1187
+ +
1188
+ + td = document.createElement(&#x27;td&#x27;)
1189
+ + td.className = &quot;source&quot;
1190
+ + td.innerHTML = this.innerHTML
1191
+ + tr.appendChild(td)
1192
+ +
1193
+ + table[0].appendChild(tr)
1194
+ + line = line + 1;
1195
+ + });
1196
+ +
1197
+ + $(&#x27;span.href&#x27;, table).each(function(){
1198
+ + $(this).replaceWith($(&#x27;&lt;a&gt;&#x27;).attr(&#x27;href&#x27;, this.innerHTML).text(this.innerHTML))
1199
+ + })
1200
+ +
1201
+ + return table;
1202
+ +}
1203
+ +
1204
+ +Syntax.layouts.tableSTR = function(options, code, container) {
1205
+ + var table = &quot;&lt;table class=&#x27;syntax&#x27;&gt;&quot;, tr = null, td = null;
1206
+ + var line = 1;
1207
+ +
1208
+ + code.children().each(function() {
1209
+ + table += &quot;&lt;tr class=&#x27;line ln&quot; + line + &quot;&#x27;&gt;&lt;td class=&#x27;number&#x27;&gt;&lt;/td&gt;&lt;td class=&#x27;source&#x27;&gt;&quot; + this.innerHTML + &quot;&lt;/td&gt;&lt;/tr&gt;&quot;
1210
+ +
1211
+ + line = line + 1;
1212
+ + });
1213
+ +
1214
+ + table += &quot;&lt;/table&gt;&quot;
1215
+ +
1216
+ + window.console.log(table.length)
1217
+ +
1218
+ + return $(table);
1219
+ +}
1220
+ +
1221
+ +Syntax.layouts.table = Syntax.layouts.tableDOM
1222
+
1223
+ </code></pre>
1224
+
1225
+ </body>
1226
+ </html>