burp_cms 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (412) hide show
  1. data/LICENSE.txt +165 -0
  2. data/README.markdown +11 -0
  3. data/Rakefile +56 -0
  4. data/app/assets/images/burp/add-group-to-menu-1.png +0 -0
  5. data/app/assets/images/burp/add-group-to-menu-2.png +0 -0
  6. data/app/assets/images/burp/add-group-to-menu-3.png +0 -0
  7. data/app/assets/images/burp/add-group-to-menu-4.png +0 -0
  8. data/app/assets/images/burp/add-image-1.png +0 -0
  9. data/app/assets/images/burp/add-image-2.png +0 -0
  10. data/app/assets/images/burp/add-image-3.png +0 -0
  11. data/app/assets/images/burp/add-image-4.png +0 -0
  12. data/app/assets/images/burp/add-image-5.png +0 -0
  13. data/app/assets/images/burp/add-link-to-group-1.png +0 -0
  14. data/app/assets/images/burp/add-link-to-group-2.png +0 -0
  15. data/app/assets/images/burp/add-link-to-group-3.png +0 -0
  16. data/app/assets/images/burp/add-link-to-menu-1.png +0 -0
  17. data/app/assets/images/burp/add-link-to-menu-2.png +0 -0
  18. data/app/assets/images/burp/add-link-to-menu-3.png +0 -0
  19. data/app/assets/images/burp/add-link-to-menu-4.png +0 -0
  20. data/app/assets/images/burp/add-page-to-menu-1.png +0 -0
  21. data/app/assets/images/burp/add-page-to-menu-2.png +0 -0
  22. data/app/assets/images/burp/add-page-to-menu-3.png +0 -0
  23. data/app/assets/images/burp/add-page-to-menu-4.png +0 -0
  24. data/app/assets/images/burp/add-page-to-menu-5.png +0 -0
  25. data/app/assets/images/burp/adding-a-page-1.png +0 -0
  26. data/app/assets/images/burp/adding-a-page-2.png +0 -0
  27. data/app/assets/images/burp/adding-a-page-3.png +0 -0
  28. data/app/assets/images/burp/adding-a-page-4.png +0 -0
  29. data/app/assets/images/burp/change-page-title-1.png +0 -0
  30. data/app/assets/images/burp/change-page-title-2.png +0 -0
  31. data/app/assets/images/burp/change-page-title-3.png +0 -0
  32. data/app/assets/images/burp/change-page-title-4.png +0 -0
  33. data/app/assets/images/burp/change-the-text-1.png +0 -0
  34. data/app/assets/images/burp/change-the-text-2.png +0 -0
  35. data/app/assets/images/burp/change-the-text-3.png +0 -0
  36. data/app/assets/images/burp/enter-page-edit-mode-1.png +0 -0
  37. data/app/assets/images/burp/enter-page-edit-mode-2.png +0 -0
  38. data/app/assets/images/burp/enter-page-edit-mode-3.png +0 -0
  39. data/app/assets/images/burp/enter-page-edit-mode-4.jpg +0 -0
  40. data/app/assets/images/burp/enter-page-edit-mode-4.png +0 -0
  41. data/app/assets/images/burp/img/glyphicons-halflings-white.png +0 -0
  42. data/app/assets/images/burp/img/glyphicons-halflings.png +0 -0
  43. data/app/assets/images/burp/move-link-to-bottom-of-menu-1.png +0 -0
  44. data/app/assets/images/burp/move-link-to-bottom-of-menu-2.png +0 -0
  45. data/app/assets/images/burp/move-link-to-bottom-of-menu-3.png +0 -0
  46. data/app/assets/images/burp/remove-a-page-1.png +0 -0
  47. data/app/assets/images/burp/remove-a-page-2.png +0 -0
  48. data/app/assets/images/burp/remove-a-page-3.png +0 -0
  49. data/app/assets/images/burp/remove-a-page-4.png +0 -0
  50. data/app/assets/images/burp/remove-image-1.png +0 -0
  51. data/app/assets/images/burp/remove-image-2.png +0 -0
  52. data/app/assets/images/burp/remove-image-3.png +0 -0
  53. data/app/assets/images/burp/remove-image-4.png +0 -0
  54. data/app/assets/images/burp/remove-image-5.png +0 -0
  55. data/app/assets/images/burp/remove-page-from-menu-1.png +0 -0
  56. data/app/assets/images/burp/remove-page-from-menu-2.png +0 -0
  57. data/app/assets/images/burp/remove-page-from-menu-3.png +0 -0
  58. data/app/assets/images/burp/remove-page-from-menu-4.png +0 -0
  59. data/app/assets/javascripts/burp/application.js +22 -0
  60. data/app/assets/javascripts/burp/burp.js +2 -0
  61. data/app/assets/javascripts/burp/cms_helper.js +49 -0
  62. data/app/assets/javascripts/burp/edit-page.js +22 -0
  63. data/app/assets/javascripts/burp/lib/bootstrap.min.js +6 -0
  64. data/app/assets/javascripts/burp/lib/debug.js +222 -0
  65. data/app/assets/javascripts/burp/lib/fileupload.js +1255 -0
  66. data/app/assets/javascripts/burp/lib/missing-restful-verbs.js +46 -0
  67. data/app/assets/javascripts/burp/menu-functions.js +28 -0
  68. data/app/assets/javascripts/burp/pages-drag-and-drop.js +151 -0
  69. data/app/assets/packages/burp/editing/css/dropzone.css +15 -0
  70. data/app/assets/packages/burp/editing/css/edit-content.less +126 -0
  71. data/app/assets/packages/burp/editing/css/gallery.css +167 -0
  72. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/LICENSE +23 -0
  73. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/README.md +8 -0
  74. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/demo/activeline.html +72 -0
  75. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/demo/changemode.html +50 -0
  76. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/demo/closetag.html +65 -0
  77. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/demo/complete.html +70 -0
  78. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/demo/emacs.html +59 -0
  79. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/demo/folding.html +61 -0
  80. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/demo/formatting.html +80 -0
  81. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/demo/fullscreen.html +152 -0
  82. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/demo/loadmode.html +39 -0
  83. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/demo/marker.html +52 -0
  84. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/demo/matchhighlighter.html +37 -0
  85. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/demo/multiplex.html +59 -0
  86. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/demo/mustache.html +57 -0
  87. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/demo/preview.html +76 -0
  88. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/demo/resize.html +41 -0
  89. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/demo/runmode.html +49 -0
  90. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/demo/search.html +83 -0
  91. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/demo/theme.html +78 -0
  92. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/demo/vim.html +50 -0
  93. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/demo/visibletabs.html +61 -0
  94. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/doc/baboon.png +0 -0
  95. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/doc/baboon_vector.svg +153 -0
  96. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/doc/compress.html +148 -0
  97. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/doc/docs.css +154 -0
  98. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/doc/internals.html +494 -0
  99. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/doc/manual.html +1128 -0
  100. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/doc/oldrelease.html +267 -0
  101. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/doc/reporting.html +57 -0
  102. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/doc/upgrade_v2.2.html +95 -0
  103. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/index.html +417 -0
  104. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/keymap/emacs.js +29 -0
  105. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/keymap/vim.js +766 -0
  106. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/lib/codemirror.css +168 -0
  107. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/lib/codemirror.js +3181 -0
  108. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/lib/util/closetag.js +146 -0
  109. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/lib/util/dialog.css +23 -0
  110. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/lib/util/dialog.js +63 -0
  111. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/lib/util/foldcode.js +196 -0
  112. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/lib/util/formatting.js +297 -0
  113. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/lib/util/javascript-hint.js +134 -0
  114. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/lib/util/loadmode.js +51 -0
  115. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/lib/util/match-highlighter.js +44 -0
  116. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/lib/util/multiplex.js +72 -0
  117. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/lib/util/overlay.js +52 -0
  118. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/lib/util/pig-hint.js +123 -0
  119. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/lib/util/runmode.js +49 -0
  120. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/lib/util/search.js +118 -0
  121. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/lib/util/searchcursor.js +117 -0
  122. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/lib/util/simple-hint.css +16 -0
  123. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/lib/util/simple-hint.js +72 -0
  124. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/clike/clike.js +271 -0
  125. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/clike/index.html +101 -0
  126. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/clike/scala.html +765 -0
  127. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/clojure/clojure.js +207 -0
  128. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/clojure/index.html +66 -0
  129. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/coffeescript/LICENSE +22 -0
  130. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/coffeescript/coffeescript.js +347 -0
  131. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/coffeescript/index.html +727 -0
  132. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/css/css.js +124 -0
  133. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/css/index.html +55 -0
  134. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/diff/diff.js +32 -0
  135. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/diff/index.html +104 -0
  136. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/ecl/ecl.js +203 -0
  137. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/ecl/index.html +42 -0
  138. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/erlang/erlang.js +251 -0
  139. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/erlang/index.html +61 -0
  140. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/gfm/gfm.js +144 -0
  141. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/gfm/index.html +47 -0
  142. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/go/go.js +170 -0
  143. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/go/index.html +72 -0
  144. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/groovy/groovy.js +210 -0
  145. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/groovy/index.html +71 -0
  146. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/haskell/haskell.js +242 -0
  147. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/haskell/index.html +60 -0
  148. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/htmlembedded/htmlembedded.js +68 -0
  149. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/htmlembedded/index.html +49 -0
  150. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/htmlmixed/htmlmixed.js +85 -0
  151. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/htmlmixed/index.html +51 -0
  152. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/javascript/index.html +77 -0
  153. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/javascript/javascript.js +361 -0
  154. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/jinja2/index.html +37 -0
  155. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/jinja2/jinja2.js +42 -0
  156. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/less/index.html +618 -0
  157. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/less/less.js +232 -0
  158. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/lua/index.html +72 -0
  159. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/lua/lua.js +140 -0
  160. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/markdown/index.html +338 -0
  161. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/markdown/markdown.js +245 -0
  162. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/mysql/index.html +41 -0
  163. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/mysql/mysql.js +188 -0
  164. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/ntriples/index.html +32 -0
  165. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/ntriples/ntriples.js +172 -0
  166. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/pascal/LICENSE +7 -0
  167. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/pascal/index.html +48 -0
  168. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/pascal/pascal.js +94 -0
  169. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/perl/LICENSE +19 -0
  170. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/perl/index.html +62 -0
  171. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/perl/perl.js +816 -0
  172. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/php/index.html +48 -0
  173. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/php/php.js +150 -0
  174. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/pig/index.html +42 -0
  175. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/pig/pig.js +172 -0
  176. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/plsql/index.html +62 -0
  177. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/plsql/plsql.js +217 -0
  178. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/properties/index.html +40 -0
  179. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/properties/properties.js +63 -0
  180. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/python/LICENSE.txt +21 -0
  181. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/python/index.html +122 -0
  182. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/python/python.js +338 -0
  183. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/r/LICENSE +24 -0
  184. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/r/index.html +73 -0
  185. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/r/r.js +141 -0
  186. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/rpm/changes/changes.js +19 -0
  187. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/rpm/changes/index.html +53 -0
  188. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/rpm/spec/index.html +99 -0
  189. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/rpm/spec/spec.css +5 -0
  190. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/rpm/spec/spec.js +66 -0
  191. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/rst/index.html +525 -0
  192. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/rst/rst.js +326 -0
  193. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/ruby/LICENSE +24 -0
  194. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/ruby/index.html +171 -0
  195. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/ruby/ruby.js +195 -0
  196. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/rust/index.html +48 -0
  197. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/rust/rust.js +432 -0
  198. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/scheme/index.html +64 -0
  199. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/scheme/scheme.js +230 -0
  200. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/shell/index.html +50 -0
  201. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/shell/shell.js +103 -0
  202. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/smalltalk/index.html +55 -0
  203. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/smalltalk/smalltalk.js +139 -0
  204. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/smarty/index.html +82 -0
  205. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/smarty/smarty.js +148 -0
  206. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/sparql/index.html +40 -0
  207. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/sparql/sparql.js +143 -0
  208. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/stex/index.html +95 -0
  209. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/stex/stex.js +182 -0
  210. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/stex/test.html +263 -0
  211. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/tiddlywiki/index.html +140 -0
  212. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/tiddlywiki/tiddlywiki.css +14 -0
  213. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/tiddlywiki/tiddlywiki.js +384 -0
  214. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/tiki/index.html +82 -0
  215. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/tiki/tiki.css +26 -0
  216. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/tiki/tiki.js +316 -0
  217. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/vbscript/index.html +42 -0
  218. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/vbscript/vbscript.js +26 -0
  219. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/velocity/index.html +103 -0
  220. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/velocity/velocity.js +146 -0
  221. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/verilog/index.html +210 -0
  222. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/verilog/verilog.js +194 -0
  223. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/xml/index.html +44 -0
  224. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/xml/xml.js +325 -0
  225. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/xquery/LICENSE +20 -0
  226. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/xquery/index.html +222 -0
  227. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/xquery/test/index.html +27 -0
  228. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/xquery/test/testBase.js +42 -0
  229. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/xquery/test/testEmptySequenceKeyword.js +16 -0
  230. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/xquery/test/testMultiAttr.js +16 -0
  231. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/xquery/test/testNamespaces.js +91 -0
  232. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/xquery/test/testProcessingInstructions.js +16 -0
  233. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/xquery/test/testQuotes.js +19 -0
  234. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/xquery/xquery.js +448 -0
  235. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/yaml/index.html +67 -0
  236. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/yaml/yaml.js +95 -0
  237. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/package.json +29 -0
  238. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/test/index.html +28 -0
  239. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/test/mode_test.css +22 -0
  240. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/test/mode_test.js +164 -0
  241. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/test/test.js +344 -0
  242. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/theme/ambiance.css +81 -0
  243. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/theme/blackboard.css +25 -0
  244. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/theme/cobalt.css +18 -0
  245. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/theme/eclipse.css +25 -0
  246. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/theme/elegant.css +10 -0
  247. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/theme/erlang-dark.css +21 -0
  248. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/theme/lesser-dark.css +44 -0
  249. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/theme/monokai.css +28 -0
  250. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/theme/neat.css +9 -0
  251. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/theme/night.css +21 -0
  252. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/theme/rubyblue.css +21 -0
  253. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/theme/vibrant-ink.css +27 -0
  254. data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/theme/xq-dark.css +46 -0
  255. data/app/assets/packages/burp/editing/dep/FontAwesome/FontAwesome-Vectors.pdf +3180 -7
  256. data/app/assets/packages/burp/editing/dep/FontAwesome/FontAwesome.ttf +0 -0
  257. data/app/assets/packages/burp/editing/dep/FontAwesome/README.md +18 -0
  258. data/app/assets/packages/burp/editing/dep/FontAwesome/css/font-awesome-ie7.css +645 -0
  259. data/app/assets/packages/burp/editing/dep/FontAwesome/css/font-awesome.less +309 -0
  260. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/css/font-awesome-ie7.css +213 -0
  261. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/css/font-awesome.css +303 -0
  262. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/css/prettify.css +30 -0
  263. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/css/site.css +4904 -0
  264. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/font/fontawesome-webfont.eot +0 -0
  265. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/font/fontawesome-webfont.svg +255 -0
  266. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/font/fontawesome-webfont.ttf +0 -0
  267. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/font/fontawesome-webfont.woff +0 -0
  268. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/font/museo_slab_300-webfont.eot +0 -0
  269. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/font/museo_slab_300-webfont.ttf +0 -0
  270. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/font/museo_slab_500-webfont.eot +0 -0
  271. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/font/museo_slab_500-webfont.ttf +0 -0
  272. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/font/proximanova-webfont.eot +0 -0
  273. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/font/proximanova-webfont.ttf +0 -0
  274. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/ico/favicon.ico +0 -0
  275. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/js/backbone.min.js +37 -0
  276. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/js/index/index.js +89 -0
  277. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/js/jquery-1.7.1.min.js +4 -0
  278. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/js/prettify.min.js +28 -0
  279. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/js/tw-bs-201/bootstrap-alert.js +94 -0
  280. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/js/tw-bs-201/bootstrap-button.js +98 -0
  281. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/js/tw-bs-201/bootstrap-carousel.js +157 -0
  282. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/js/tw-bs-201/bootstrap-collapse.js +136 -0
  283. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/js/tw-bs-201/bootstrap-dropdown.js +92 -0
  284. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/js/tw-bs-201/bootstrap-modal.js +210 -0
  285. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/js/tw-bs-201/bootstrap-popover.js +95 -0
  286. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/js/tw-bs-201/bootstrap-scrollspy.js +125 -0
  287. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/js/tw-bs-201/bootstrap-tab.js +130 -0
  288. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/js/tw-bs-201/bootstrap-tooltip.js +270 -0
  289. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/js/tw-bs-201/bootstrap-transition.js +51 -0
  290. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/js/tw-bs-201/bootstrap-typeahead.js +271 -0
  291. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/js/underscore.min.js +31 -0
  292. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/font-awesome-ie7.less +245 -0
  293. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/font-awesome.less +327 -0
  294. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/font-site.less +26 -0
  295. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/mixins.less +43 -0
  296. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/site.less +300 -0
  297. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/accordion.less +33 -0
  298. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/alerts.less +58 -0
  299. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/bootstrap.less +62 -0
  300. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/breadcrumbs.less +24 -0
  301. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/button-groups.less +191 -0
  302. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/buttons.less +191 -0
  303. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/carousel.less +121 -0
  304. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/close.less +29 -0
  305. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/code.less +57 -0
  306. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/component-animations.less +20 -0
  307. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/dropdowns.less +143 -0
  308. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/forms.less +584 -0
  309. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/grid.less +5 -0
  310. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/hero-unit.less +22 -0
  311. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/labels-badges.less +55 -0
  312. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/layouts.less +17 -0
  313. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/mixins.less +631 -0
  314. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/modals.less +90 -0
  315. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/navbar.less +364 -0
  316. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/navs.less +363 -0
  317. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/pager.less +36 -0
  318. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/pagination.less +56 -0
  319. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/popovers.less +49 -0
  320. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/progress-bars.less +117 -0
  321. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/reset.less +126 -0
  322. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/responsive-1200px-min.less +26 -0
  323. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/responsive-767px-max.less +149 -0
  324. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/responsive-768px-979px.less +17 -0
  325. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/responsive-navbar.less +146 -0
  326. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/responsive-utilities.less +41 -0
  327. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/responsive.less +48 -0
  328. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/scaffolding.less +29 -0
  329. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/sprites.less +191 -0
  330. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/tables.less +176 -0
  331. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/thumbnails.less +47 -0
  332. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/tooltip.less +35 -0
  333. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/type.less +235 -0
  334. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/utilities.less +23 -0
  335. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/variables.less +205 -0
  336. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/wells.less +27 -0
  337. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/variables.less +206 -0
  338. data/app/assets/packages/burp/editing/dep/FontAwesome/docs/index.html +1087 -0
  339. data/app/assets/packages/burp/editing/dep/FontAwesome/font/fontawesome-webfont.eot +0 -0
  340. data/app/assets/packages/burp/editing/dep/FontAwesome/font/fontawesome-webfont.svg +255 -0
  341. data/app/assets/packages/burp/editing/dep/FontAwesome/font/fontawesome-webfont.ttf +0 -0
  342. data/app/assets/packages/burp/editing/dep/FontAwesome/font/fontawesome-webfont.woff +0 -0
  343. data/app/assets/packages/burp/editing/dep/FontAwesome/less/font-awesome-ie7.less +245 -0
  344. data/app/assets/packages/burp/editing/dep/FontAwesome/less/font-awesome.less +329 -0
  345. data/app/assets/packages/burp/editing/dep/FontAwesome/sass/font-awesome.sass +712 -0
  346. data/app/assets/packages/burp/editing/dep/FontAwesome/sass/font-awesome.scss +329 -0
  347. data/app/assets/packages/burp/editing/js/admin-dock.js +282 -0
  348. data/app/assets/packages/burp/editing/js/content-decorator.js +321 -0
  349. data/app/assets/packages/burp/editing/js/main.js +331 -0
  350. data/app/assets/packages/burp/editing/js/marked.js +781 -0
  351. data/app/assets/packages/burp/editing/js/md5.js +207 -0
  352. data/app/assets/packages/burp/editing/js/stay.js +143 -0
  353. data/app/assets/packages/burp/editing.js +23 -0
  354. data/app/assets/packages/burp/editing.less +7 -0
  355. data/app/assets/packages/gritter/README.markdown +57 -0
  356. data/app/assets/packages/gritter/css/jquery.gritter.less +101 -0
  357. data/app/assets/packages/gritter/gritter.js +3 -0
  358. data/app/assets/packages/gritter/gritter.less +3 -0
  359. data/app/assets/packages/gritter/images/gritter-light.png +0 -0
  360. data/app/assets/packages/gritter/images/gritter-long.png +0 -0
  361. data/app/assets/packages/gritter/images/gritter.png +0 -0
  362. data/app/assets/packages/gritter/images/ie-spacer.gif +0 -0
  363. data/app/assets/packages/gritter/images/trees.jpg +0 -0
  364. data/app/assets/packages/gritter/index.html +269 -0
  365. data/app/assets/packages/gritter/js/jquery.gritter.js +418 -0
  366. data/app/assets/packages/gritter/js/jquery.gritter.min.js +1 -0
  367. data/app/assets/stylesheets/burp/application.less +82 -0
  368. data/app/assets/stylesheets/burp/bootstrap.less +6158 -0
  369. data/app/assets/stylesheets/burp/docs.less +83 -0
  370. data/app/assets/stylesheets/burp/fileupload.less +31 -0
  371. data/app/assets/stylesheets/burp/views/dnd-menu.less +87 -0
  372. data/app/assets/stylesheets/burp/views/files/index.less +40 -0
  373. data/app/assets/stylesheets/burp/views/pages/index.less +4 -0
  374. data/app/assets/stylesheets/burp/views/static/help.less +11 -0
  375. data/app/controllers/burp/application_controller.rb +45 -0
  376. data/app/controllers/burp/catch_all_controller.rb +24 -0
  377. data/app/controllers/burp/error_controller.rb +7 -0
  378. data/app/controllers/burp/files_controller.rb +92 -0
  379. data/app/controllers/burp/groups_controller.rb +49 -0
  380. data/app/controllers/burp/links_controller.rb +48 -0
  381. data/app/controllers/burp/menus_controller.rb +33 -0
  382. data/app/controllers/burp/pages_controller.rb +112 -0
  383. data/app/controllers/burp/static_controller.rb +11 -0
  384. data/app/helpers/burp/application_helper.rb +4 -0
  385. data/app/lib/burp/access.rb +63 -0
  386. data/app/lib/burp/group.rb +110 -0
  387. data/app/lib/burp/link.rb +66 -0
  388. data/app/lib/burp/page.rb +23 -0
  389. data/app/lib/burp/util/upload_handler.rb +84 -0
  390. data/app/lib/burp/util.rb +39 -0
  391. data/app/models/burp/file_model.rb +45 -0
  392. data/app/models/burp/menu.rb +60 -0
  393. data/app/models/burp/page_model.rb +158 -0
  394. data/app/views/burp/files/index.html.erb +87 -0
  395. data/app/views/burp/groups/edit.html.erb +18 -0
  396. data/app/views/burp/links/edit.html.erb +19 -0
  397. data/app/views/burp/menus/edit.html.erb +157 -0
  398. data/app/views/burp/menus/index.html.erb +9 -0
  399. data/app/views/burp/pages/edit.html.erb +20 -0
  400. data/app/views/burp/pages/index.html.erb +114 -0
  401. data/app/views/burp/static/help.html.erb +543 -0
  402. data/app/views/burp/static/index.html.erb +15 -0
  403. data/app/views/layouts/burp/application.html.erb +57 -0
  404. data/config/cucumber.yml +12 -0
  405. data/config/initializers/bootstrap_form.rb +2 -0
  406. data/config/routes.rb +30 -0
  407. data/lib/burp/capistrano.rb +51 -0
  408. data/lib/burp/engine.rb +15 -0
  409. data/lib/burp/version.rb +3 -0
  410. data/lib/burp_cms.rb +64 -0
  411. data/lib/tasks/burp_tasks.rake +99 -0
  412. metadata +845 -0
@@ -0,0 +1,765 @@
1
+ <!doctype html>
2
+ <html>
3
+ <head>
4
+ <title>CodeMirror: C-like mode</title>
5
+ <link rel="stylesheet" href="../../lib/codemirror.css">
6
+ <link rel="stylesheet" href="../../theme/ambiance.css">
7
+ <script src="../../lib/codemirror.js"></script>
8
+ <script src="clike.js"></script>
9
+ <link rel="stylesheet" href="../../doc/docs.css">
10
+ <style>
11
+ body
12
+ {
13
+ margin: 0;
14
+ padding: 0;
15
+ max-width:inherit;
16
+ height: 100%;
17
+ }
18
+ html, form, .CodeMirror, .CodeMirror-scroll
19
+ {
20
+ height: 100%;
21
+ }
22
+ </style>
23
+ </head>
24
+ <body>
25
+ <form>
26
+ <textarea id="code" name="code">
27
+
28
+ /* __ *\
29
+ ** ________ ___ / / ___ Scala API **
30
+ ** / __/ __// _ | / / / _ | (c) 2003-2011, LAMP/EPFL **
31
+ ** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
32
+ ** /____/\___/_/ |_/____/_/ | | **
33
+ ** |/ **
34
+ \* */
35
+
36
+ package scala.collection
37
+
38
+ import generic._
39
+ import mutable.{ Builder, ListBuffer }
40
+ import annotation.{tailrec, migration, bridge}
41
+ import annotation.unchecked.{ uncheckedVariance => uV }
42
+ import parallel.ParIterable
43
+
44
+ /** A template trait for traversable collections of type `Traversable[A]`.
45
+ *
46
+ * $traversableInfo
47
+ * @define mutability
48
+ * @define traversableInfo
49
+ * This is a base trait of all kinds of $mutability Scala collections. It
50
+ * implements the behavior common to all collections, in terms of a method
51
+ * `foreach` with signature:
52
+ * {{{
53
+ * def foreach[U](f: Elem => U): Unit
54
+ * }}}
55
+ * Collection classes mixing in this trait provide a concrete
56
+ * `foreach` method which traverses all the
57
+ * elements contained in the collection, applying a given function to each.
58
+ * They also need to provide a method `newBuilder`
59
+ * which creates a builder for collections of the same kind.
60
+ *
61
+ * A traversable class might or might not have two properties: strictness
62
+ * and orderedness. Neither is represented as a type.
63
+ *
64
+ * The instances of a strict collection class have all their elements
65
+ * computed before they can be used as values. By contrast, instances of
66
+ * a non-strict collection class may defer computation of some of their
67
+ * elements until after the instance is available as a value.
68
+ * A typical example of a non-strict collection class is a
69
+ * <a href="../immutable/Stream.html" target="ContentFrame">
70
+ * `scala.collection.immutable.Stream`</a>.
71
+ * A more general class of examples are `TraversableViews`.
72
+ *
73
+ * If a collection is an instance of an ordered collection class, traversing
74
+ * its elements with `foreach` will always visit elements in the
75
+ * same order, even for different runs of the program. If the class is not
76
+ * ordered, `foreach` can visit elements in different orders for
77
+ * different runs (but it will keep the same order in the same run).'
78
+ *
79
+ * A typical example of a collection class which is not ordered is a
80
+ * `HashMap` of objects. The traversal order for hash maps will
81
+ * depend on the hash codes of its elements, and these hash codes might
82
+ * differ from one run to the next. By contrast, a `LinkedHashMap`
83
+ * is ordered because it's `foreach` method visits elements in the
84
+ * order they were inserted into the `HashMap`.
85
+ *
86
+ * @author Martin Odersky
87
+ * @version 2.8
88
+ * @since 2.8
89
+ * @tparam A the element type of the collection
90
+ * @tparam Repr the type of the actual collection containing the elements.
91
+ *
92
+ * @define Coll Traversable
93
+ * @define coll traversable collection
94
+ */
95
+ trait TraversableLike[+A, +Repr] extends HasNewBuilder[A, Repr]
96
+ with FilterMonadic[A, Repr]
97
+ with TraversableOnce[A]
98
+ with GenTraversableLike[A, Repr]
99
+ with Parallelizable[A, ParIterable[A]]
100
+ {
101
+ self =>
102
+
103
+ import Traversable.breaks._
104
+
105
+ /** The type implementing this traversable */
106
+ protected type Self = Repr
107
+
108
+ /** The collection of type $coll underlying this `TraversableLike` object.
109
+ * By default this is implemented as the `TraversableLike` object itself,
110
+ * but this can be overridden.
111
+ */
112
+ def repr: Repr = this.asInstanceOf[Repr]
113
+
114
+ /** The underlying collection seen as an instance of `$Coll`.
115
+ * By default this is implemented as the current collection object itself,
116
+ * but this can be overridden.
117
+ */
118
+ protected[this] def thisCollection: Traversable[A] = this.asInstanceOf[Traversable[A]]
119
+
120
+ /** A conversion from collections of type `Repr` to `$Coll` objects.
121
+ * By default this is implemented as just a cast, but this can be overridden.
122
+ */
123
+ protected[this] def toCollection(repr: Repr): Traversable[A] = repr.asInstanceOf[Traversable[A]]
124
+
125
+ /** Creates a new builder for this collection type.
126
+ */
127
+ protected[this] def newBuilder: Builder[A, Repr]
128
+
129
+ protected[this] def parCombiner = ParIterable.newCombiner[A]
130
+
131
+ /** Applies a function `f` to all elements of this $coll.
132
+ *
133
+ * Note: this method underlies the implementation of most other bulk operations.
134
+ * It's important to implement this method in an efficient way.
135
+ *
136
+ *
137
+ * @param f the function that is applied for its side-effect to every element.
138
+ * The result of function `f` is discarded.
139
+ *
140
+ * @tparam U the type parameter describing the result of function `f`.
141
+ * This result will always be ignored. Typically `U` is `Unit`,
142
+ * but this is not necessary.
143
+ *
144
+ * @usecase def foreach(f: A => Unit): Unit
145
+ */
146
+ def foreach[U](f: A => U): Unit
147
+
148
+ /** Tests whether this $coll is empty.
149
+ *
150
+ * @return `true` if the $coll contain no elements, `false` otherwise.
151
+ */
152
+ def isEmpty: Boolean = {
153
+ var result = true
154
+ breakable {
155
+ for (x <- this) {
156
+ result = false
157
+ break
158
+ }
159
+ }
160
+ result
161
+ }
162
+
163
+ /** Tests whether this $coll is known to have a finite size.
164
+ * All strict collections are known to have finite size. For a non-strict collection
165
+ * such as `Stream`, the predicate returns `true` if all elements have been computed.
166
+ * It returns `false` if the stream is not yet evaluated to the end.
167
+ *
168
+ * Note: many collection methods will not work on collections of infinite sizes.
169
+ *
170
+ * @return `true` if this collection is known to have finite size, `false` otherwise.
171
+ */
172
+ def hasDefiniteSize = true
173
+
174
+ def ++[B >: A, That](that: GenTraversableOnce[B])(implicit bf: CanBuildFrom[Repr, B, That]): That = {
175
+ val b = bf(repr)
176
+ if (that.isInstanceOf[IndexedSeqLike[_, _]]) b.sizeHint(this, that.seq.size)
177
+ b ++= thisCollection
178
+ b ++= that.seq
179
+ b.result
180
+ }
181
+
182
+ @bridge
183
+ def ++[B >: A, That](that: TraversableOnce[B])(implicit bf: CanBuildFrom[Repr, B, That]): That =
184
+ ++(that: GenTraversableOnce[B])(bf)
185
+
186
+ /** Concatenates this $coll with the elements of a traversable collection.
187
+ * It differs from ++ in that the right operand determines the type of the
188
+ * resulting collection rather than the left one.
189
+ *
190
+ * @param that the traversable to append.
191
+ * @tparam B the element type of the returned collection.
192
+ * @tparam That $thatinfo
193
+ * @param bf $bfinfo
194
+ * @return a new collection of type `That` which contains all elements
195
+ * of this $coll followed by all elements of `that`.
196
+ *
197
+ * @usecase def ++:[B](that: TraversableOnce[B]): $Coll[B]
198
+ *
199
+ * @return a new $coll which contains all elements of this $coll
200
+ * followed by all elements of `that`.
201
+ */
202
+ def ++:[B >: A, That](that: TraversableOnce[B])(implicit bf: CanBuildFrom[Repr, B, That]): That = {
203
+ val b = bf(repr)
204
+ if (that.isInstanceOf[IndexedSeqLike[_, _]]) b.sizeHint(this, that.size)
205
+ b ++= that
206
+ b ++= thisCollection
207
+ b.result
208
+ }
209
+
210
+ /** This overload exists because: for the implementation of ++: we should reuse
211
+ * that of ++ because many collections override it with more efficient versions.
212
+ * Since TraversableOnce has no '++' method, we have to implement that directly,
213
+ * but Traversable and down can use the overload.
214
+ */
215
+ def ++:[B >: A, That](that: Traversable[B])(implicit bf: CanBuildFrom[Repr, B, That]): That =
216
+ (that ++ seq)(breakOut)
217
+
218
+ def map[B, That](f: A => B)(implicit bf: CanBuildFrom[Repr, B, That]): That = {
219
+ val b = bf(repr)
220
+ b.sizeHint(this)
221
+ for (x <- this) b += f(x)
222
+ b.result
223
+ }
224
+
225
+ def flatMap[B, That](f: A => GenTraversableOnce[B])(implicit bf: CanBuildFrom[Repr, B, That]): That = {
226
+ val b = bf(repr)
227
+ for (x <- this) b ++= f(x).seq
228
+ b.result
229
+ }
230
+
231
+ /** Selects all elements of this $coll which satisfy a predicate.
232
+ *
233
+ * @param p the predicate used to test elements.
234
+ * @return a new $coll consisting of all elements of this $coll that satisfy the given
235
+ * predicate `p`. The order of the elements is preserved.
236
+ */
237
+ def filter(p: A => Boolean): Repr = {
238
+ val b = newBuilder
239
+ for (x <- this)
240
+ if (p(x)) b += x
241
+ b.result
242
+ }
243
+
244
+ /** Selects all elements of this $coll which do not satisfy a predicate.
245
+ *
246
+ * @param p the predicate used to test elements.
247
+ * @return a new $coll consisting of all elements of this $coll that do not satisfy the given
248
+ * predicate `p`. The order of the elements is preserved.
249
+ */
250
+ def filterNot(p: A => Boolean): Repr = filter(!p(_))
251
+
252
+ def collect[B, That](pf: PartialFunction[A, B])(implicit bf: CanBuildFrom[Repr, B, That]): That = {
253
+ val b = bf(repr)
254
+ for (x <- this) if (pf.isDefinedAt(x)) b += pf(x)
255
+ b.result
256
+ }
257
+
258
+ /** Builds a new collection by applying an option-valued function to all
259
+ * elements of this $coll on which the function is defined.
260
+ *
261
+ * @param f the option-valued function which filters and maps the $coll.
262
+ * @tparam B the element type of the returned collection.
263
+ * @tparam That $thatinfo
264
+ * @param bf $bfinfo
265
+ * @return a new collection of type `That` resulting from applying the option-valued function
266
+ * `f` to each element and collecting all defined results.
267
+ * The order of the elements is preserved.
268
+ *
269
+ * @usecase def filterMap[B](f: A => Option[B]): $Coll[B]
270
+ *
271
+ * @param pf the partial function which filters and maps the $coll.
272
+ * @return a new $coll resulting from applying the given option-valued function
273
+ * `f` to each element and collecting all defined results.
274
+ * The order of the elements is preserved.
275
+ def filterMap[B, That](f: A => Option[B])(implicit bf: CanBuildFrom[Repr, B, That]): That = {
276
+ val b = bf(repr)
277
+ for (x <- this)
278
+ f(x) match {
279
+ case Some(y) => b += y
280
+ case _ =>
281
+ }
282
+ b.result
283
+ }
284
+ */
285
+
286
+ /** Partitions this $coll in two ${coll}s according to a predicate.
287
+ *
288
+ * @param p the predicate on which to partition.
289
+ * @return a pair of ${coll}s: the first $coll consists of all elements that
290
+ * satisfy the predicate `p` and the second $coll consists of all elements
291
+ * that don't. The relative order of the elements in the resulting ${coll}s
292
+ * is the same as in the original $coll.
293
+ */
294
+ def partition(p: A => Boolean): (Repr, Repr) = {
295
+ val l, r = newBuilder
296
+ for (x <- this) (if (p(x)) l else r) += x
297
+ (l.result, r.result)
298
+ }
299
+
300
+ def groupBy[K](f: A => K): immutable.Map[K, Repr] = {
301
+ val m = mutable.Map.empty[K, Builder[A, Repr]]
302
+ for (elem <- this) {
303
+ val key = f(elem)
304
+ val bldr = m.getOrElseUpdate(key, newBuilder)
305
+ bldr += elem
306
+ }
307
+ val b = immutable.Map.newBuilder[K, Repr]
308
+ for ((k, v) <- m)
309
+ b += ((k, v.result))
310
+
311
+ b.result
312
+ }
313
+
314
+ /** Tests whether a predicate holds for all elements of this $coll.
315
+ *
316
+ * $mayNotTerminateInf
317
+ *
318
+ * @param p the predicate used to test elements.
319
+ * @return `true` if the given predicate `p` holds for all elements
320
+ * of this $coll, otherwise `false`.
321
+ */
322
+ def forall(p: A => Boolean): Boolean = {
323
+ var result = true
324
+ breakable {
325
+ for (x <- this)
326
+ if (!p(x)) { result = false; break }
327
+ }
328
+ result
329
+ }
330
+
331
+ /** Tests whether a predicate holds for some of the elements of this $coll.
332
+ *
333
+ * $mayNotTerminateInf
334
+ *
335
+ * @param p the predicate used to test elements.
336
+ * @return `true` if the given predicate `p` holds for some of the
337
+ * elements of this $coll, otherwise `false`.
338
+ */
339
+ def exists(p: A => Boolean): Boolean = {
340
+ var result = false
341
+ breakable {
342
+ for (x <- this)
343
+ if (p(x)) { result = true; break }
344
+ }
345
+ result
346
+ }
347
+
348
+ /** Finds the first element of the $coll satisfying a predicate, if any.
349
+ *
350
+ * $mayNotTerminateInf
351
+ * $orderDependent
352
+ *
353
+ * @param p the predicate used to test elements.
354
+ * @return an option value containing the first element in the $coll
355
+ * that satisfies `p`, or `None` if none exists.
356
+ */
357
+ def find(p: A => Boolean): Option[A] = {
358
+ var result: Option[A] = None
359
+ breakable {
360
+ for (x <- this)
361
+ if (p(x)) { result = Some(x); break }
362
+ }
363
+ result
364
+ }
365
+
366
+ def scan[B >: A, That](z: B)(op: (B, B) => B)(implicit cbf: CanBuildFrom[Repr, B, That]): That = scanLeft(z)(op)
367
+
368
+ def scanLeft[B, That](z: B)(op: (B, A) => B)(implicit bf: CanBuildFrom[Repr, B, That]): That = {
369
+ val b = bf(repr)
370
+ b.sizeHint(this, 1)
371
+ var acc = z
372
+ b += acc
373
+ for (x <- this) { acc = op(acc, x); b += acc }
374
+ b.result
375
+ }
376
+
377
+ @migration(2, 9,
378
+ "This scanRight definition has changed in 2.9.\n" +
379
+ "The previous behavior can be reproduced with scanRight.reverse."
380
+ )
381
+ def scanRight[B, That](z: B)(op: (A, B) => B)(implicit bf: CanBuildFrom[Repr, B, That]): That = {
382
+ var scanned = List(z)
383
+ var acc = z
384
+ for (x <- reversed) {
385
+ acc = op(x, acc)
386
+ scanned ::= acc
387
+ }
388
+ val b = bf(repr)
389
+ for (elem <- scanned) b += elem
390
+ b.result
391
+ }
392
+
393
+ /** Selects the first element of this $coll.
394
+ * $orderDependent
395
+ * @return the first element of this $coll.
396
+ * @throws `NoSuchElementException` if the $coll is empty.
397
+ */
398
+ def head: A = {
399
+ var result: () => A = () => throw new NoSuchElementException
400
+ breakable {
401
+ for (x <- this) {
402
+ result = () => x
403
+ break
404
+ }
405
+ }
406
+ result()
407
+ }
408
+
409
+ /** Optionally selects the first element.
410
+ * $orderDependent
411
+ * @return the first element of this $coll if it is nonempty, `None` if it is empty.
412
+ */
413
+ def headOption: Option[A] = if (isEmpty) None else Some(head)
414
+
415
+ /** Selects all elements except the first.
416
+ * $orderDependent
417
+ * @return a $coll consisting of all elements of this $coll
418
+ * except the first one.
419
+ * @throws `UnsupportedOperationException` if the $coll is empty.
420
+ */
421
+ override def tail: Repr = {
422
+ if (isEmpty) throw new UnsupportedOperationException("empty.tail")
423
+ drop(1)
424
+ }
425
+
426
+ /** Selects the last element.
427
+ * $orderDependent
428
+ * @return The last element of this $coll.
429
+ * @throws NoSuchElementException If the $coll is empty.
430
+ */
431
+ def last: A = {
432
+ var lst = head
433
+ for (x <- this)
434
+ lst = x
435
+ lst
436
+ }
437
+
438
+ /** Optionally selects the last element.
439
+ * $orderDependent
440
+ * @return the last element of this $coll$ if it is nonempty, `None` if it is empty.
441
+ */
442
+ def lastOption: Option[A] = if (isEmpty) None else Some(last)
443
+
444
+ /** Selects all elements except the last.
445
+ * $orderDependent
446
+ * @return a $coll consisting of all elements of this $coll
447
+ * except the last one.
448
+ * @throws `UnsupportedOperationException` if the $coll is empty.
449
+ */
450
+ def init: Repr = {
451
+ if (isEmpty) throw new UnsupportedOperationException("empty.init")
452
+ var lst = head
453
+ var follow = false
454
+ val b = newBuilder
455
+ b.sizeHint(this, -1)
456
+ for (x <- this.seq) {
457
+ if (follow) b += lst
458
+ else follow = true
459
+ lst = x
460
+ }
461
+ b.result
462
+ }
463
+
464
+ def take(n: Int): Repr = slice(0, n)
465
+
466
+ def drop(n: Int): Repr =
467
+ if (n <= 0) {
468
+ val b = newBuilder
469
+ b.sizeHint(this)
470
+ b ++= thisCollection result
471
+ }
472
+ else sliceWithKnownDelta(n, Int.MaxValue, -n)
473
+
474
+ def slice(from: Int, until: Int): Repr = sliceWithKnownBound(math.max(from, 0), until)
475
+
476
+ // Precondition: from >= 0, until > 0, builder already configured for building.
477
+ private[this] def sliceInternal(from: Int, until: Int, b: Builder[A, Repr]): Repr = {
478
+ var i = 0
479
+ breakable {
480
+ for (x <- this.seq) {
481
+ if (i >= from) b += x
482
+ i += 1
483
+ if (i >= until) break
484
+ }
485
+ }
486
+ b.result
487
+ }
488
+ // Precondition: from >= 0
489
+ private[scala] def sliceWithKnownDelta(from: Int, until: Int, delta: Int): Repr = {
490
+ val b = newBuilder
491
+ if (until <= from) b.result
492
+ else {
493
+ b.sizeHint(this, delta)
494
+ sliceInternal(from, until, b)
495
+ }
496
+ }
497
+ // Precondition: from >= 0
498
+ private[scala] def sliceWithKnownBound(from: Int, until: Int): Repr = {
499
+ val b = newBuilder
500
+ if (until <= from) b.result
501
+ else {
502
+ b.sizeHintBounded(until - from, this)
503
+ sliceInternal(from, until, b)
504
+ }
505
+ }
506
+
507
+ def takeWhile(p: A => Boolean): Repr = {
508
+ val b = newBuilder
509
+ breakable {
510
+ for (x <- this) {
511
+ if (!p(x)) break
512
+ b += x
513
+ }
514
+ }
515
+ b.result
516
+ }
517
+
518
+ def dropWhile(p: A => Boolean): Repr = {
519
+ val b = newBuilder
520
+ var go = false
521
+ for (x <- this) {
522
+ if (!p(x)) go = true
523
+ if (go) b += x
524
+ }
525
+ b.result
526
+ }
527
+
528
+ def span(p: A => Boolean): (Repr, Repr) = {
529
+ val l, r = newBuilder
530
+ var toLeft = true
531
+ for (x <- this) {
532
+ toLeft = toLeft && p(x)
533
+ (if (toLeft) l else r) += x
534
+ }
535
+ (l.result, r.result)
536
+ }
537
+
538
+ def splitAt(n: Int): (Repr, Repr) = {
539
+ val l, r = newBuilder
540
+ l.sizeHintBounded(n, this)
541
+ if (n >= 0) r.sizeHint(this, -n)
542
+ var i = 0
543
+ for (x <- this) {
544
+ (if (i < n) l else r) += x
545
+ i += 1
546
+ }
547
+ (l.result, r.result)
548
+ }
549
+
550
+ /** Iterates over the tails of this $coll. The first value will be this
551
+ * $coll and the final one will be an empty $coll, with the intervening
552
+ * values the results of successive applications of `tail`.
553
+ *
554
+ * @return an iterator over all the tails of this $coll
555
+ * @example `List(1,2,3).tails = Iterator(List(1,2,3), List(2,3), List(3), Nil)`
556
+ */
557
+ def tails: Iterator[Repr] = iterateUntilEmpty(_.tail)
558
+
559
+ /** Iterates over the inits of this $coll. The first value will be this
560
+ * $coll and the final one will be an empty $coll, with the intervening
561
+ * values the results of successive applications of `init`.
562
+ *
563
+ * @return an iterator over all the inits of this $coll
564
+ * @example `List(1,2,3).inits = Iterator(List(1,2,3), List(1,2), List(1), Nil)`
565
+ */
566
+ def inits: Iterator[Repr] = iterateUntilEmpty(_.init)
567
+
568
+ /** Copies elements of this $coll to an array.
569
+ * Fills the given array `xs` with at most `len` elements of
570
+ * this $coll, starting at position `start`.
571
+ * Copying will stop once either the end of the current $coll is reached,
572
+ * or the end of the array is reached, or `len` elements have been copied.
573
+ *
574
+ * $willNotTerminateInf
575
+ *
576
+ * @param xs the array to fill.
577
+ * @param start the starting index.
578
+ * @param len the maximal number of elements to copy.
579
+ * @tparam B the type of the elements of the array.
580
+ *
581
+ *
582
+ * @usecase def copyToArray(xs: Array[A], start: Int, len: Int): Unit
583
+ */
584
+ def copyToArray[B >: A](xs: Array[B], start: Int, len: Int) {
585
+ var i = start
586
+ val end = (start + len) min xs.length
587
+ breakable {
588
+ for (x <- this) {
589
+ if (i >= end) break
590
+ xs(i) = x
591
+ i += 1
592
+ }
593
+ }
594
+ }
595
+
596
+ def toTraversable: Traversable[A] = thisCollection
597
+ def toIterator: Iterator[A] = toStream.iterator
598
+ def toStream: Stream[A] = toBuffer.toStream
599
+
600
+ /** Converts this $coll to a string.
601
+ *
602
+ * @return a string representation of this collection. By default this
603
+ * string consists of the `stringPrefix` of this $coll,
604
+ * followed by all elements separated by commas and enclosed in parentheses.
605
+ */
606
+ override def toString = mkString(stringPrefix + "(", ", ", ")")
607
+
608
+ /** Defines the prefix of this object's `toString` representation.
609
+ *
610
+ * @return a string representation which starts the result of `toString`
611
+ * applied to this $coll. By default the string prefix is the
612
+ * simple name of the collection class $coll.
613
+ */
614
+ def stringPrefix : String = {
615
+ var string = repr.asInstanceOf[AnyRef].getClass.getName
616
+ val idx1 = string.lastIndexOf('.' : Int)
617
+ if (idx1 != -1) string = string.substring(idx1 + 1)
618
+ val idx2 = string.indexOf('$')
619
+ if (idx2 != -1) string = string.substring(0, idx2)
620
+ string
621
+ }
622
+
623
+ /** Creates a non-strict view of this $coll.
624
+ *
625
+ * @return a non-strict view of this $coll.
626
+ */
627
+ def view = new TraversableView[A, Repr] {
628
+ protected lazy val underlying = self.repr
629
+ override def foreach[U](f: A => U) = self foreach f
630
+ }
631
+
632
+ /** Creates a non-strict view of a slice of this $coll.
633
+ *
634
+ * Note: the difference between `view` and `slice` is that `view` produces
635
+ * a view of the current $coll, whereas `slice` produces a new $coll.
636
+ *
637
+ * Note: `view(from, to)` is equivalent to `view.slice(from, to)`
638
+ * $orderDependent
639
+ *
640
+ * @param from the index of the first element of the view
641
+ * @param until the index of the element following the view
642
+ * @return a non-strict view of a slice of this $coll, starting at index `from`
643
+ * and extending up to (but not including) index `until`.
644
+ */
645
+ def view(from: Int, until: Int): TraversableView[A, Repr] = view.slice(from, until)
646
+
647
+ /** Creates a non-strict filter of this $coll.
648
+ *
649
+ * Note: the difference between `c filter p` and `c withFilter p` is that
650
+ * the former creates a new collection, whereas the latter only
651
+ * restricts the domain of subsequent `map`, `flatMap`, `foreach`,
652
+ * and `withFilter` operations.
653
+ * $orderDependent
654
+ *
655
+ * @param p the predicate used to test elements.
656
+ * @return an object of class `WithFilter`, which supports
657
+ * `map`, `flatMap`, `foreach`, and `withFilter` operations.
658
+ * All these operations apply to those elements of this $coll which
659
+ * satisfy the predicate `p`.
660
+ */
661
+ def withFilter(p: A => Boolean): FilterMonadic[A, Repr] = new WithFilter(p)
662
+
663
+ /** A class supporting filtered operations. Instances of this class are
664
+ * returned by method `withFilter`.
665
+ */
666
+ class WithFilter(p: A => Boolean) extends FilterMonadic[A, Repr] {
667
+
668
+ /** Builds a new collection by applying a function to all elements of the
669
+ * outer $coll containing this `WithFilter` instance that satisfy predicate `p`.
670
+ *
671
+ * @param f the function to apply to each element.
672
+ * @tparam B the element type of the returned collection.
673
+ * @tparam That $thatinfo
674
+ * @param bf $bfinfo
675
+ * @return a new collection of type `That` resulting from applying
676
+ * the given function `f` to each element of the outer $coll
677
+ * that satisfies predicate `p` and collecting the results.
678
+ *
679
+ * @usecase def map[B](f: A => B): $Coll[B]
680
+ *
681
+ * @return a new $coll resulting from applying the given function
682
+ * `f` to each element of the outer $coll that satisfies
683
+ * predicate `p` and collecting the results.
684
+ */
685
+ def map[B, That](f: A => B)(implicit bf: CanBuildFrom[Repr, B, That]): That = {
686
+ val b = bf(repr)
687
+ for (x <- self)
688
+ if (p(x)) b += f(x)
689
+ b.result
690
+ }
691
+
692
+ /** Builds a new collection by applying a function to all elements of the
693
+ * outer $coll containing this `WithFilter` instance that satisfy
694
+ * predicate `p` and concatenating the results.
695
+ *
696
+ * @param f the function to apply to each element.
697
+ * @tparam B the element type of the returned collection.
698
+ * @tparam That $thatinfo
699
+ * @param bf $bfinfo
700
+ * @return a new collection of type `That` resulting from applying
701
+ * the given collection-valued function `f` to each element
702
+ * of the outer $coll that satisfies predicate `p` and
703
+ * concatenating the results.
704
+ *
705
+ * @usecase def flatMap[B](f: A => TraversableOnce[B]): $Coll[B]
706
+ *
707
+ * @return a new $coll resulting from applying the given collection-valued function
708
+ * `f` to each element of the outer $coll that satisfies predicate `p` and concatenating the results.
709
+ */
710
+ def flatMap[B, That](f: A => GenTraversableOnce[B])(implicit bf: CanBuildFrom[Repr, B, That]): That = {
711
+ val b = bf(repr)
712
+ for (x <- self)
713
+ if (p(x)) b ++= f(x).seq
714
+ b.result
715
+ }
716
+
717
+ /** Applies a function `f` to all elements of the outer $coll containing
718
+ * this `WithFilter` instance that satisfy predicate `p`.
719
+ *
720
+ * @param f the function that is applied for its side-effect to every element.
721
+ * The result of function `f` is discarded.
722
+ *
723
+ * @tparam U the type parameter describing the result of function `f`.
724
+ * This result will always be ignored. Typically `U` is `Unit`,
725
+ * but this is not necessary.
726
+ *
727
+ * @usecase def foreach(f: A => Unit): Unit
728
+ */
729
+ def foreach[U](f: A => U): Unit =
730
+ for (x <- self)
731
+ if (p(x)) f(x)
732
+
733
+ /** Further refines the filter for this $coll.
734
+ *
735
+ * @param q the predicate used to test elements.
736
+ * @return an object of class `WithFilter`, which supports
737
+ * `map`, `flatMap`, `foreach`, and `withFilter` operations.
738
+ * All these operations apply to those elements of this $coll which
739
+ * satisfy the predicate `q` in addition to the predicate `p`.
740
+ */
741
+ def withFilter(q: A => Boolean): WithFilter =
742
+ new WithFilter(x => p(x) && q(x))
743
+ }
744
+
745
+ // A helper for tails and inits.
746
+ private def iterateUntilEmpty(f: Traversable[A @uV] => Traversable[A @uV]): Iterator[Repr] = {
747
+ val it = Iterator.iterate(thisCollection)(f) takeWhile (x => !x.isEmpty)
748
+ it ++ Iterator(Nil) map (newBuilder ++= _ result)
749
+ }
750
+ }
751
+
752
+
753
+ </textarea>
754
+ </form>
755
+
756
+ <script>
757
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
758
+ lineNumbers: true,
759
+ matchBrackets: true,
760
+ theme: "ambiance",
761
+ mode: "text/x-scala"
762
+ });
763
+ </script>
764
+ </body>
765
+ </html>