wagn 1.12.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (875) hide show
  1. data/.gitignore +24 -0
  2. data/.rspec +4 -0
  3. data/CONTRIBUTING.rdoc +13 -0
  4. data/GPL +331 -0
  5. data/Gemfile +87 -0
  6. data/LICENSE +16 -0
  7. data/README.rdoc +103 -0
  8. data/Rakefile +7 -0
  9. data/VERSION +1 -0
  10. data/app/assets/images/body-bg.bmp +0 -0
  11. data/app/assets/images/body-bg.png +0 -0
  12. data/app/assets/images/external_link.png +0 -0
  13. data/app/assets/images/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  14. data/app/assets/images/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  15. data/app/assets/images/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  16. data/app/assets/images/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  17. data/app/assets/images/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  18. data/app/assets/images/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  19. data/app/assets/images/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  20. data/app/assets/images/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  21. data/app/assets/images/images/ui-icons_222222_256x240.png +0 -0
  22. data/app/assets/images/images/ui-icons_2e83ff_256x240.png +0 -0
  23. data/app/assets/images/images/ui-icons_454545_256x240.png +0 -0
  24. data/app/assets/images/images/ui-icons_888888_256x240.png +0 -0
  25. data/app/assets/images/images/ui-icons_cd0a0a_256x240.png +0 -0
  26. data/app/assets/javascripts/application.js +25 -0
  27. data/app/assets/javascripts/html5shiv-printshiv.js +499 -0
  28. data/app/assets/javascripts/jquery.autosize.js +254 -0
  29. data/app/assets/javascripts/jquery.fileupload.js +1111 -0
  30. data/app/assets/javascripts/jquery.iframe-transport.js +156 -0
  31. data/app/assets/javascripts/jquery.ui.autocomplete.html.js +40 -0
  32. data/app/assets/javascripts/wagn.js.coffee +288 -0
  33. data/app/assets/javascripts/wagn_menu.js +76 -0
  34. data/app/assets/javascripts/wagn_mod.js.coffee +401 -0
  35. data/app/controllers/account_controller.rb +67 -0
  36. data/app/controllers/admin_controller.rb +130 -0
  37. data/app/controllers/card_controller.rb +163 -0
  38. data/app/controllers/stub_card_controller.rb +9 -0
  39. data/app/controllers/wagn_controller.rb +123 -0
  40. data/app/mailers/.gitkeep +0 -0
  41. data/app/mailers/mailer.rb +108 -0
  42. data/app/models/.gitkeep +0 -0
  43. data/app/models/account.rb +196 -0
  44. data/app/models/card.rb +42 -0
  45. data/app/models/card/reference.rb +71 -0
  46. data/app/models/card/revision.rb +45 -0
  47. data/app/models/user.rb +123 -0
  48. data/app/views/mailer/account_info.text.erb +17 -0
  49. data/app/views/mailer/change_notice.html.erb +32 -0
  50. data/app/views/mailer/flexmail.html.erb +6 -0
  51. data/app/views/mailer/signup_alert.html.erb +14 -0
  52. data/bin/wagn +9 -0
  53. data/config.ru +4 -0
  54. data/config/application.rb +15 -0
  55. data/config/boot.rb +8 -0
  56. data/config/environment.rb +8 -0
  57. data/config/environments/cucumber.rb +30 -0
  58. data/config/environments/development.rb +59 -0
  59. data/config/environments/production.rb +65 -0
  60. data/config/environments/profile.rb +28 -0
  61. data/config/environments/test.rb +45 -0
  62. data/config/initializers/01_init_ruby_extensions.rb +76 -0
  63. data/config/initializers/airbrake.rb +10 -0
  64. data/config/initializers/backtrace_silencers.rb +8 -0
  65. data/config/initializers/inflections.rb +13 -0
  66. data/config/initializers/mime_types.rb +13 -0
  67. data/config/initializers/notification.rb +4 -0
  68. data/config/initializers/recaptcha.rb +6 -0
  69. data/config/initializers/schema_views.rb +59 -0
  70. data/config/initializers/secret_token.rb +9 -0
  71. data/config/initializers/session_store.rb +9 -0
  72. data/config/initializers/uuid_state_file.rb +2 -0
  73. data/config/initializers/wrap_parameters.rb +15 -0
  74. data/config/routes.rb +45 -0
  75. data/config/samples/asset_htaccess +9 -0
  76. data/config/samples/cucumber.yml +8 -0
  77. data/config/samples/database.yml.erb +34 -0
  78. data/config/samples/robots.txt +12 -0
  79. data/config/version.txt +1 -0
  80. data/config/version_cards.txt +1 -0
  81. data/db/bootstrap/card_references.yml +1478 -0
  82. data/db/bootstrap/card_revisions.yml +3561 -0
  83. data/db/bootstrap/cards.yml +7192 -0
  84. data/db/bootstrap/users.yml +29 -0
  85. data/db/migrate/20110511221913_require_earlier_migrations.rb +17 -0
  86. data/db/migrate/20120105203350_require_1_8_migrations.rb +15 -0
  87. data/db/migrate/20121111025347_require_1_10_migrations.rb +15 -0
  88. data/db/migrate/20121118114000_split_link_type.rb +16 -0
  89. data/db/migrate/20121118115000_update_link_type.rb +19 -0
  90. data/db/migrate/20130106052640_table_cleanup.rb +25 -0
  91. data/db/migrate/20130109015336_trunk_left.rb +14 -0
  92. data/db/migrate/20130411210957_update_codenames.rb +14 -0
  93. data/db/migrate_cards/20130411191151_renaming_for_menu.rb +56 -0
  94. data/db/migrate_cards/20130411211600_delete_old_related_tab_cards.rb +27 -0
  95. data/db/migrate_cards/20130419215612_import_help_text.rb +23 -0
  96. data/db/migrate_cards/20130823192433_add_style_cards.rb +95 -0
  97. data/db/migrate_cards/20130910183318_move_styles_to_content.rb +19 -0
  98. data/db/migrate_cards/20130920214038_jsonize_tinymce.rb +24 -0
  99. data/db/migrate_cards/20130920291703_update_stylesheets.rb +26 -0
  100. data/db/migrate_cards/20130927191728_account_events.rb +29 -0
  101. data/db/migrate_cards/20131016172445_common_css_patch.rb +21 -0
  102. data/db/migrate_cards/20140110193325_reset_account_request_type.rb +19 -0
  103. data/db/migrate_cards/data/1.11_help_text.json +410 -0
  104. data/db/migrate_cards/data/1.12_stylesheets/classic_cards.scss +101 -0
  105. data/db/migrate_cards/data/1.12_stylesheets/common.scss +226 -0
  106. data/db/migrate_cards/data/1.12_stylesheets/right_sidebar.scss +27 -0
  107. data/db/migrate_cards/data/1.12_stylesheets/traditional.scss +152 -0
  108. data/db/schema.rb +92 -0
  109. data/db/seeds.rb +8 -0
  110. data/features/account_requests.feature +22 -0
  111. data/features/autonaming.feature +21 -0
  112. data/features/content_settings.feature +44 -0
  113. data/features/flexmail.feature +54 -0
  114. data/features/google_maps.feature +31 -0
  115. data/features/hello_wagn.feature +29 -0
  116. data/features/layouts.feature +23 -0
  117. data/features/notifications.feature +31 -0
  118. data/features/pattern_settings.feature +43 -0
  119. data/features/pointer_inputs.feature +81 -0
  120. data/features/presetting_content.feature +12 -0
  121. data/features/step_definitions/email_steps.rb +183 -0
  122. data/features/step_definitions/notification_steps.rb +23 -0
  123. data/features/step_definitions/wagn_steps.rb +207 -0
  124. data/features/step_definitions/web_steps.rb +138 -0
  125. data/features/support/env.rb +58 -0
  126. data/features/support/paths.rb +58 -0
  127. data/features/support/scopes.rb +22 -0
  128. data/features/support/wag_env.rb +11 -0
  129. data/features/table_of_contents.feature +35 -0
  130. data/features/templates.feature +30 -0
  131. data/features/update_includers.feature +68 -0
  132. data/features/virtual_cards.feature +11 -0
  133. data/features/watch.feature +54 -0
  134. data/lib/active_record/foreign_keys.rb +80 -0
  135. data/lib/active_record/quoting_and_matching.rb +72 -0
  136. data/lib/card/chunk.rb +103 -0
  137. data/lib/card/codename.rb +47 -0
  138. data/lib/card/constant.rb +20 -0
  139. data/lib/card/content.rb +206 -0
  140. data/lib/card/diff.rb +317 -0
  141. data/lib/card/exceptions.rb +22 -0
  142. data/lib/card/flexmail.rb +47 -0
  143. data/lib/card/format.rb +541 -0
  144. data/lib/card/name.rb +39 -0
  145. data/lib/card/query.rb +81 -0
  146. data/lib/card/query/card_spec.rb +516 -0
  147. data/lib/card/query/ref_spec.rb +23 -0
  148. data/lib/card/query/spec.rb +21 -0
  149. data/lib/card/query/value_spec.rb +66 -0
  150. data/lib/card/set.rb +239 -0
  151. data/lib/card/set_pattern.rb +140 -0
  152. data/lib/generators/card_migration/USAGE +12 -0
  153. data/lib/generators/card_migration/card_migration_generator.rb +10 -0
  154. data/lib/generators/card_migration/templates/card_migration.erb +16 -0
  155. data/lib/generators/format/USAGE +9 -0
  156. data/lib/generators/format/format_generator.rb +8 -0
  157. data/lib/generators/format/templates/format_spec_template.erb +6 -0
  158. data/lib/generators/format/templates/format_template.erb +3 -0
  159. data/lib/generators/set/USAGE +9 -0
  160. data/lib/generators/set/set_generator.rb +14 -0
  161. data/lib/generators/set/templates/set_spec_template.erb +6 -0
  162. data/lib/generators/set/templates/set_template.erb +1 -0
  163. data/lib/generators/wagn/USAGE +8 -0
  164. data/lib/generators/wagn/templates/Gemfile +5 -0
  165. data/lib/generators/wagn/templates/Rakefile +7 -0
  166. data/lib/generators/wagn/templates/config.ru +5 -0
  167. data/lib/generators/wagn/templates/config/application.rb +47 -0
  168. data/lib/generators/wagn/templates/config/boot.rb +11 -0
  169. data/lib/generators/wagn/templates/config/database.yml +35 -0
  170. data/lib/generators/wagn/templates/config/databases/frontbase.yml +31 -0
  171. data/lib/generators/wagn/templates/config/databases/ibm_db.yml +86 -0
  172. data/lib/generators/wagn/templates/config/databases/jdbc.yml +62 -0
  173. data/lib/generators/wagn/templates/config/databases/jdbcmysql.yml +33 -0
  174. data/lib/generators/wagn/templates/config/databases/jdbcpostgresql.yml +43 -0
  175. data/lib/generators/wagn/templates/config/databases/jdbcsqlite3.yml +20 -0
  176. data/lib/generators/wagn/templates/config/databases/mysql.yml +54 -0
  177. data/lib/generators/wagn/templates/config/databases/oracle.yml +39 -0
  178. data/lib/generators/wagn/templates/config/databases/postgresql.yml +55 -0
  179. data/lib/generators/wagn/templates/config/databases/sqlite3.yml +25 -0
  180. data/lib/generators/wagn/templates/config/environment.rb +5 -0
  181. data/lib/generators/wagn/templates/gitignore +18 -0
  182. data/lib/generators/wagn/templates/script/wagn +5 -0
  183. data/lib/generators/wagn/wagn_generator.rb +127 -0
  184. data/lib/tasks/.gitkeep +0 -0
  185. data/lib/tasks/cucumber.rake +68 -0
  186. data/lib/tasks/db.rake +54 -0
  187. data/lib/tasks/test.rake +94 -0
  188. data/lib/tasks/wagn.rake +215 -0
  189. data/lib/wagn.rb +33 -0
  190. data/lib/wagn/all.rb +16 -0
  191. data/lib/wagn/application.rb +96 -0
  192. data/lib/wagn/authenticated_system.rb +38 -0
  193. data/lib/wagn/cache.rb +176 -0
  194. data/lib/wagn/cli.rb +17 -0
  195. data/lib/wagn/commands.rb +2 -0
  196. data/lib/wagn/commands/application.rb +10 -0
  197. data/lib/wagn/env.rb +42 -0
  198. data/lib/wagn/exceptions.rb +10 -0
  199. data/lib/wagn/loader.rb +135 -0
  200. data/lib/wagn/location.rb +88 -0
  201. data/lib/wagn/migration_helper.rb +32 -0
  202. data/lib/wagn/script_wagn_loader.rb +29 -0
  203. data/lib/wagn/spec_helper.rb +99 -0
  204. data/lib/wagn/version.rb +27 -0
  205. data/mods/core/chunks/literal.rb +24 -0
  206. data/mods/core/chunks/reference.rb +41 -0
  207. data/mods/core/chunks/uri.rb +135 -0
  208. data/mods/core/formats/data_format.rb +2 -0
  209. data/mods/core/formats/html_format.rb +319 -0
  210. data/mods/core/formats/text_format.rb +5 -0
  211. data/mods/core/layouts/blank.html +5 -0
  212. data/mods/core/layouts/default.html +20 -0
  213. data/mods/core/layouts/noside.html +16 -0
  214. data/mods/core/layouts/pre.html +2 -0
  215. data/mods/core/layouts/simple.html +5 -0
  216. data/mods/core/set_patterns/01_all.rb +12 -0
  217. data/mods/core/set_patterns/02_all_plus.rb +11 -0
  218. data/mods/core/set_patterns/03_type.rb +19 -0
  219. data/mods/core/set_patterns/04_star.rb +11 -0
  220. data/mods/core/set_patterns/05_rstar.rb +13 -0
  221. data/mods/core/set_patterns/06_right.rb +16 -0
  222. data/mods/core/set_patterns/07_type_plus_right.rb +19 -0
  223. data/mods/core/set_patterns/08_self.rb +15 -0
  224. data/mods/core/sets/all/active_card.rb +21 -0
  225. data/mods/core/sets/all/attribute_tracking.rb +85 -0
  226. data/mods/core/sets/all/collection.rb +46 -0
  227. data/mods/core/sets/all/content.rb +90 -0
  228. data/mods/core/sets/all/fetch.rb +198 -0
  229. data/mods/core/sets/all/initialize.rb +45 -0
  230. data/mods/core/sets/all/name.rb +266 -0
  231. data/mods/core/sets/all/pattern.rb +79 -0
  232. data/mods/core/sets/all/permissions.rb +218 -0
  233. data/mods/core/sets/all/phases.rb +159 -0
  234. data/mods/core/sets/all/references.rb +102 -0
  235. data/mods/core/sets/all/rules.rb +125 -0
  236. data/mods/core/sets/all/states.rb +16 -0
  237. data/mods/core/sets/all/templating.rb +118 -0
  238. data/mods/core/sets/all/tracked_attributes.rb +145 -0
  239. data/mods/core/sets/all/trash.rb +45 -0
  240. data/mods/core/sets/all/type.rb +70 -0
  241. data/mods/core/sets/all/utils.rb +91 -0
  242. data/mods/standard/chunks/include.rb +85 -0
  243. data/mods/standard/chunks/link.rb +84 -0
  244. data/mods/standard/formats/css_format.rb +3 -0
  245. data/mods/standard/formats/csv_format.rb +3 -0
  246. data/mods/standard/formats/email_html_format.rb +9 -0
  247. data/mods/standard/formats/file_format.rb +3 -0
  248. data/mods/standard/formats/json_format.rb +3 -0
  249. data/mods/standard/formats/kml_format.rb +3 -0
  250. data/mods/standard/formats/rss_format.rb +8 -0
  251. data/mods/standard/formats/xml_format.rb +3 -0
  252. data/mods/standard/lib/google_maps_addon.rb +30 -0
  253. data/mods/standard/lib/stylesheets/functional.scss +181 -0
  254. data/mods/standard/lib/stylesheets/jquery-ui-smoothness.css +474 -0
  255. data/mods/standard/lib/stylesheets/standard.scss +614 -0
  256. data/mods/standard/sets/all/account.rb +241 -0
  257. data/mods/standard/sets/all/admin.rb +53 -0
  258. data/mods/standard/sets/all/all_css.rb +39 -0
  259. data/mods/standard/sets/all/all_csv.rb +53 -0
  260. data/mods/standard/sets/all/attach.rb +143 -0
  261. data/mods/standard/sets/all/base.rb +136 -0
  262. data/mods/standard/sets/all/comment.rb +39 -0
  263. data/mods/standard/sets/all/email_html.rb +7 -0
  264. data/mods/standard/sets/all/file.rb +14 -0
  265. data/mods/standard/sets/all/flexmail.rb +3 -0
  266. data/mods/standard/sets/all/follow.rb +117 -0
  267. data/mods/standard/sets/all/geocode.rb +16 -0
  268. data/mods/standard/sets/all/history.rb +112 -0
  269. data/mods/standard/sets/all/json.rb +73 -0
  270. data/mods/standard/sets/all/kml.rb +48 -0
  271. data/mods/standard/sets/all/rich_html.rb +472 -0
  272. data/mods/standard/sets/all/rss.rb +66 -0
  273. data/mods/standard/sets/all/text.rb +9 -0
  274. data/mods/standard/sets/right/account.rb +1 -0
  275. data/mods/standard/sets/right/add_help.rb +1 -0
  276. data/mods/standard/sets/right/comment.rb +3 -0
  277. data/mods/standard/sets/right/create.rb +82 -0
  278. data/mods/standard/sets/right/crypted_password.rb +4 -0
  279. data/mods/standard/sets/right/default.rb +2 -0
  280. data/mods/standard/sets/right/delete.rb +3 -0
  281. data/mods/standard/sets/right/email.rb +5 -0
  282. data/mods/standard/sets/right/help.rb +1 -0
  283. data/mods/standard/sets/right/read.rb +3 -0
  284. data/mods/standard/sets/right/salt.rb +4 -0
  285. data/mods/standard/sets/right/structure.rb +11 -0
  286. data/mods/standard/sets/right/style.rb +67 -0
  287. data/mods/standard/sets/right/update.rb +3 -0
  288. data/mods/standard/sets/right/when_created.rb +5 -0
  289. data/mods/standard/sets/right/when_last_edited.rb +5 -0
  290. data/mods/standard/sets/rstar/rules.rb +235 -0
  291. data/mods/standard/sets/self/account_links.rb +30 -0
  292. data/mods/standard/sets/self/alerts.rb +6 -0
  293. data/mods/standard/sets/self/foot.rb +9 -0
  294. data/mods/standard/sets/self/head.rb +105 -0
  295. data/mods/standard/sets/self/navbox.rb +28 -0
  296. data/mods/standard/sets/self/now.rb +7 -0
  297. data/mods/standard/sets/self/recent.rb +45 -0
  298. data/mods/standard/sets/self/search.rb +37 -0
  299. data/mods/standard/sets/self/style_functional.rb +8 -0
  300. data/mods/standard/sets/self/style_jquery_ui_smoothness.rb +8 -0
  301. data/mods/standard/sets/self/style_standard.rb +8 -0
  302. data/mods/standard/sets/self/version.rb +8 -0
  303. data/mods/standard/sets/type/account_request.rb +81 -0
  304. data/mods/standard/sets/type/basic.rb +43 -0
  305. data/mods/standard/sets/type/cardtype.rb +32 -0
  306. data/mods/standard/sets/type/css.rb +17 -0
  307. data/mods/standard/sets/type/date.rb +9 -0
  308. data/mods/standard/sets/type/file.rb +87 -0
  309. data/mods/standard/sets/type/html.rb +17 -0
  310. data/mods/standard/sets/type/image.rb +67 -0
  311. data/mods/standard/sets/type/layout_type.rb +11 -0
  312. data/mods/standard/sets/type/number.rb +20 -0
  313. data/mods/standard/sets/type/phrase.rb +3 -0
  314. data/mods/standard/sets/type/plain_text.rb +10 -0
  315. data/mods/standard/sets/type/pointer.rb +219 -0
  316. data/mods/standard/sets/type/ruby_and_script.rb +31 -0
  317. data/mods/standard/sets/type/scss.rb +34 -0
  318. data/mods/standard/sets/type/search_type.rb +268 -0
  319. data/mods/standard/sets/type/set.rb +109 -0
  320. data/mods/standard/sets/type/setting.rb +88 -0
  321. data/mods/standard/sets/type/skin.rb +27 -0
  322. data/mods/standard/sets/type/toggle.rb +12 -0
  323. data/mods/standard/sets/type/user.rb +24 -0
  324. data/public/404.html +27 -0
  325. data/public/500.html +28 -0
  326. data/public/assets/application-7f1664ac8e65db8af0bfa6539e23c7df.js +103 -0
  327. data/public/assets/application-7f1664ac8e65db8af0bfa6539e23c7df.js.gz +0 -0
  328. data/public/assets/application.js +103 -0
  329. data/public/assets/application.js.gz +0 -0
  330. data/public/assets/body-bg-660b752b44b87594071f3d0851ac5360.png +0 -0
  331. data/public/assets/body-bg-d031f29b6ba7399a6862382c3552f44c.bmp +0 -0
  332. data/public/assets/body-bg.bmp +0 -0
  333. data/public/assets/body-bg.png +0 -0
  334. data/public/assets/external_link-b15ab5051b4ec6f32892ed80019405b5.png +0 -0
  335. data/public/assets/external_link.png +0 -0
  336. data/public/assets/html5shiv-printshiv-ad36fc7219f4aeaa275f9a7fe2383413.js +1 -0
  337. data/public/assets/html5shiv-printshiv-ad36fc7219f4aeaa275f9a7fe2383413.js.gz +0 -0
  338. data/public/assets/html5shiv-printshiv.js +1 -0
  339. data/public/assets/html5shiv-printshiv.js.gz +0 -0
  340. data/public/assets/images/ui-bg_flat_0_aaaaaa_40x100-7d1197a52442bc56fcad60d0390f4b32.png +0 -0
  341. data/public/assets/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  342. data/public/assets/images/ui-bg_flat_75_ffffff_40x100-3c4b974defa5e8bdaf8a603034c4435e.png +0 -0
  343. data/public/assets/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  344. data/public/assets/images/ui-bg_glass_55_fbf9ee_1x400-38c2dea4d046fd3f56cc3996e2e6018b.png +0 -0
  345. data/public/assets/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  346. data/public/assets/images/ui-bg_glass_65_ffffff_1x400-ddb7ee7527bff283054406c50e597e1e.png +0 -0
  347. data/public/assets/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  348. data/public/assets/images/ui-bg_glass_75_dadada_1x400-d618461418b1ebc6b7996979f4c3dc92.png +0 -0
  349. data/public/assets/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  350. data/public/assets/images/ui-bg_glass_75_e6e6e6_1x400-48d8d545f708e5870a965ce9df8b0e38.png +0 -0
  351. data/public/assets/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  352. data/public/assets/images/ui-bg_glass_95_fef1ec_1x400-f3526b8f82249928f0a6baf044204b15.png +0 -0
  353. data/public/assets/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  354. data/public/assets/images/ui-bg_highlight-soft_75_cccccc_1x100-cec5c56503b8480f834c3fce35dae8df.png +0 -0
  355. data/public/assets/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  356. data/public/assets/images/ui-icons_222222_256x240-66e635a2f90b9f90675d402617630b24.png +0 -0
  357. data/public/assets/images/ui-icons_222222_256x240.png +0 -0
  358. data/public/assets/images/ui-icons_2e83ff_256x240-2ea4c160a75c1992daa2eeac86255b99.png +0 -0
  359. data/public/assets/images/ui-icons_2e83ff_256x240.png +0 -0
  360. data/public/assets/images/ui-icons_454545_256x240-5c7f12676bcead9cb2d4cb8f23f16e95.png +0 -0
  361. data/public/assets/images/ui-icons_454545_256x240.png +0 -0
  362. data/public/assets/images/ui-icons_888888_256x240-95fd3047e1f7325d995a21c729b04125.png +0 -0
  363. data/public/assets/images/ui-icons_888888_256x240.png +0 -0
  364. data/public/assets/images/ui-icons_cd0a0a_256x240-c0c1ec6a8bcf48fec40303e975a4dfa6.png +0 -0
  365. data/public/assets/images/ui-icons_cd0a0a_256x240.png +0 -0
  366. data/public/assets/jquerymobile/ajax-loader-a8a4bc1c4b502e156ed451507987eed7.png +0 -0
  367. data/public/assets/jquerymobile/ajax-loader-cad1a448fe000d9643c57860e5493861.gif +0 -0
  368. data/public/assets/jquerymobile/ajax-loader.gif +0 -0
  369. data/public/assets/jquerymobile/ajax-loader.png +0 -0
  370. data/public/assets/jquerymobile/icons-18-black-b6e62647e8518462e73fd052bfe25d6c.png +0 -0
  371. data/public/assets/jquerymobile/icons-18-black.png +0 -0
  372. data/public/assets/jquerymobile/icons-18-white-f4ae730f6acc1e5b1781652e5d6973c7.png +0 -0
  373. data/public/assets/jquerymobile/icons-18-white.png +0 -0
  374. data/public/assets/jquerymobile/icons-36-black-13a52024f9a92e59a69dca49014d9292.png +0 -0
  375. data/public/assets/jquerymobile/icons-36-black.png +0 -0
  376. data/public/assets/jquerymobile/icons-36-white-3b109c0900c418fd2e5468dfb35b3f59.png +0 -0
  377. data/public/assets/jquerymobile/icons-36-white.png +0 -0
  378. data/public/assets/manifest.yml +395 -0
  379. data/public/assets/tinymce-22b5a139d9ff7df7643afae9ce205508.js +13 -0
  380. data/public/assets/tinymce-22b5a139d9ff7df7643afae9ce205508.js.gz +0 -0
  381. data/public/assets/tinymce.js +13 -0
  382. data/public/assets/tinymce.js.gz +0 -0
  383. data/public/assets/tinymce/jquery.tinymce.js +1 -0
  384. data/public/assets/tinymce/langs/en.js +1 -0
  385. data/public/assets/tinymce/license.txt +504 -0
  386. data/public/assets/tinymce/plugins/advhr/css/advhr.css +5 -0
  387. data/public/assets/tinymce/plugins/advhr/editor_plugin.js +1 -0
  388. data/public/assets/tinymce/plugins/advhr/editor_plugin_src.js +57 -0
  389. data/public/assets/tinymce/plugins/advhr/js/rule.js +43 -0
  390. data/public/assets/tinymce/plugins/advhr/langs/en_dlg.js +1 -0
  391. data/public/assets/tinymce/plugins/advhr/rule.htm +58 -0
  392. data/public/assets/tinymce/plugins/advimage/css/advimage.css +13 -0
  393. data/public/assets/tinymce/plugins/advimage/editor_plugin.js +1 -0
  394. data/public/assets/tinymce/plugins/advimage/editor_plugin_src.js +50 -0
  395. data/public/assets/tinymce/plugins/advimage/image.htm +235 -0
  396. data/public/assets/tinymce/plugins/advimage/img/sample.gif +0 -0
  397. data/public/assets/tinymce/plugins/advimage/js/image.js +464 -0
  398. data/public/assets/tinymce/plugins/advimage/langs/en_dlg.js +1 -0
  399. data/public/assets/tinymce/plugins/advlink/css/advlink.css +8 -0
  400. data/public/assets/tinymce/plugins/advlink/editor_plugin.js +1 -0
  401. data/public/assets/tinymce/plugins/advlink/editor_plugin_src.js +61 -0
  402. data/public/assets/tinymce/plugins/advlink/js/advlink.js +543 -0
  403. data/public/assets/tinymce/plugins/advlink/langs/en_dlg.js +1 -0
  404. data/public/assets/tinymce/plugins/advlink/link.htm +338 -0
  405. data/public/assets/tinymce/plugins/advlist/editor_plugin.js +1 -0
  406. data/public/assets/tinymce/plugins/advlist/editor_plugin_src.js +176 -0
  407. data/public/assets/tinymce/plugins/autolink/editor_plugin.js +1 -0
  408. data/public/assets/tinymce/plugins/autolink/editor_plugin_src.js +184 -0
  409. data/public/assets/tinymce/plugins/autoresize/editor_plugin.js +1 -0
  410. data/public/assets/tinymce/plugins/autoresize/editor_plugin_src.js +119 -0
  411. data/public/assets/tinymce/plugins/autosave/editor_plugin.js +1 -0
  412. data/public/assets/tinymce/plugins/autosave/editor_plugin_src.js +433 -0
  413. data/public/assets/tinymce/plugins/bbcode/editor_plugin.js +1 -0
  414. data/public/assets/tinymce/plugins/bbcode/editor_plugin_src.js +120 -0
  415. data/public/assets/tinymce/plugins/contextmenu/editor_plugin.js +1 -0
  416. data/public/assets/tinymce/plugins/contextmenu/editor_plugin_src.js +163 -0
  417. data/public/assets/tinymce/plugins/directionality/editor_plugin.js +1 -0
  418. data/public/assets/tinymce/plugins/directionality/editor_plugin_src.js +85 -0
  419. data/public/assets/tinymce/plugins/emotions/editor_plugin.js +1 -0
  420. data/public/assets/tinymce/plugins/emotions/editor_plugin_src.js +43 -0
  421. data/public/assets/tinymce/plugins/emotions/emotions.htm +42 -0
  422. data/public/assets/tinymce/plugins/emotions/img/smiley-cool.gif +0 -0
  423. data/public/assets/tinymce/plugins/emotions/img/smiley-cry.gif +0 -0
  424. data/public/assets/tinymce/plugins/emotions/img/smiley-embarassed.gif +0 -0
  425. data/public/assets/tinymce/plugins/emotions/img/smiley-foot-in-mouth.gif +0 -0
  426. data/public/assets/tinymce/plugins/emotions/img/smiley-frown.gif +0 -0
  427. data/public/assets/tinymce/plugins/emotions/img/smiley-innocent.gif +0 -0
  428. data/public/assets/tinymce/plugins/emotions/img/smiley-kiss.gif +0 -0
  429. data/public/assets/tinymce/plugins/emotions/img/smiley-laughing.gif +0 -0
  430. data/public/assets/tinymce/plugins/emotions/img/smiley-money-mouth.gif +0 -0
  431. data/public/assets/tinymce/plugins/emotions/img/smiley-sealed.gif +0 -0
  432. data/public/assets/tinymce/plugins/emotions/img/smiley-smile.gif +0 -0
  433. data/public/assets/tinymce/plugins/emotions/img/smiley-surprised.gif +0 -0
  434. data/public/assets/tinymce/plugins/emotions/img/smiley-tongue-out.gif +0 -0
  435. data/public/assets/tinymce/plugins/emotions/img/smiley-undecided.gif +0 -0
  436. data/public/assets/tinymce/plugins/emotions/img/smiley-wink.gif +0 -0
  437. data/public/assets/tinymce/plugins/emotions/img/smiley-yell.gif +0 -0
  438. data/public/assets/tinymce/plugins/emotions/js/emotions.js +43 -0
  439. data/public/assets/tinymce/plugins/emotions/langs/en_dlg.js +1 -0
  440. data/public/assets/tinymce/plugins/example/dialog.htm +22 -0
  441. data/public/assets/tinymce/plugins/example/editor_plugin.js +1 -0
  442. data/public/assets/tinymce/plugins/example/editor_plugin_src.js +84 -0
  443. data/public/assets/tinymce/plugins/example/img/example.gif +0 -0
  444. data/public/assets/tinymce/plugins/example/js/dialog.js +19 -0
  445. data/public/assets/tinymce/plugins/example/langs/en.js +3 -0
  446. data/public/assets/tinymce/plugins/example/langs/en_dlg.js +3 -0
  447. data/public/assets/tinymce/plugins/example_dependency/editor_plugin.js +1 -0
  448. data/public/assets/tinymce/plugins/example_dependency/editor_plugin_src.js +50 -0
  449. data/public/assets/tinymce/plugins/fullpage/css/fullpage.css +143 -0
  450. data/public/assets/tinymce/plugins/fullpage/editor_plugin.js +1 -0
  451. data/public/assets/tinymce/plugins/fullpage/editor_plugin_src.js +405 -0
  452. data/public/assets/tinymce/plugins/fullpage/fullpage.htm +259 -0
  453. data/public/assets/tinymce/plugins/fullpage/js/fullpage.js +232 -0
  454. data/public/assets/tinymce/plugins/fullpage/langs/en_dlg.js +1 -0
  455. data/public/assets/tinymce/plugins/fullscreen/editor_plugin.js +1 -0
  456. data/public/assets/tinymce/plugins/fullscreen/editor_plugin_src.js +234 -0
  457. data/public/assets/tinymce/plugins/fullscreen/fullscreen.htm +117 -0
  458. data/public/assets/tinymce/plugins/iespell/editor_plugin.js +1 -0
  459. data/public/assets/tinymce/plugins/iespell/editor_plugin_src.js +54 -0
  460. data/public/assets/tinymce/plugins/inlinepopups/editor_plugin.js +1 -0
  461. data/public/assets/tinymce/plugins/inlinepopups/editor_plugin_src.js +699 -0
  462. data/public/assets/tinymce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif +0 -0
  463. data/public/assets/tinymce/plugins/inlinepopups/skins/clearlooks2/img/button.gif +0 -0
  464. data/public/assets/tinymce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif +0 -0
  465. data/public/assets/tinymce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif +0 -0
  466. data/public/assets/tinymce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif +0 -0
  467. data/public/assets/tinymce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif +0 -0
  468. data/public/assets/tinymce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif +0 -0
  469. data/public/assets/tinymce/plugins/inlinepopups/skins/clearlooks2/window.css +90 -0
  470. data/public/assets/tinymce/plugins/inlinepopups/template.htm +387 -0
  471. data/public/assets/tinymce/plugins/insertdatetime/editor_plugin.js +1 -0
  472. data/public/assets/tinymce/plugins/insertdatetime/editor_plugin_src.js +83 -0
  473. data/public/assets/tinymce/plugins/layer/editor_plugin.js +1 -0
  474. data/public/assets/tinymce/plugins/layer/editor_plugin_src.js +262 -0
  475. data/public/assets/tinymce/plugins/legacyoutput/editor_plugin.js +1 -0
  476. data/public/assets/tinymce/plugins/legacyoutput/editor_plugin_src.js +139 -0
  477. data/public/assets/tinymce/plugins/lists/editor_plugin.js +1 -0
  478. data/public/assets/tinymce/plugins/lists/editor_plugin_src.js +955 -0
  479. data/public/assets/tinymce/plugins/media/css/media.css +17 -0
  480. data/public/assets/tinymce/plugins/media/editor_plugin.js +1 -0
  481. data/public/assets/tinymce/plugins/media/editor_plugin_src.js +898 -0
  482. data/public/assets/tinymce/plugins/media/js/embed.js +73 -0
  483. data/public/assets/tinymce/plugins/media/js/media.js +513 -0
  484. data/public/assets/tinymce/plugins/media/langs/en_dlg.js +1 -0
  485. data/public/assets/tinymce/plugins/media/media.htm +922 -0
  486. data/public/assets/tinymce/plugins/media/moxieplayer.swf +0 -0
  487. data/public/assets/tinymce/plugins/nonbreaking/editor_plugin.js +1 -0
  488. data/public/assets/tinymce/plugins/nonbreaking/editor_plugin_src.js +54 -0
  489. data/public/assets/tinymce/plugins/noneditable/editor_plugin.js +1 -0
  490. data/public/assets/tinymce/plugins/noneditable/editor_plugin_src.js +537 -0
  491. data/public/assets/tinymce/plugins/pagebreak/editor_plugin.js +1 -0
  492. data/public/assets/tinymce/plugins/pagebreak/editor_plugin_src.js +74 -0
  493. data/public/assets/tinymce/plugins/paste/editor_plugin.js +1 -0
  494. data/public/assets/tinymce/plugins/paste/editor_plugin_src.js +885 -0
  495. data/public/assets/tinymce/plugins/paste/js/pastetext.js +36 -0
  496. data/public/assets/tinymce/plugins/paste/js/pasteword.js +51 -0
  497. data/public/assets/tinymce/plugins/paste/langs/en_dlg.js +1 -0
  498. data/public/assets/tinymce/plugins/paste/pastetext.htm +27 -0
  499. data/public/assets/tinymce/plugins/paste/pasteword.htm +21 -0
  500. data/public/assets/tinymce/plugins/preview/editor_plugin.js +1 -0
  501. data/public/assets/tinymce/plugins/preview/editor_plugin_src.js +53 -0
  502. data/public/assets/tinymce/plugins/preview/example.html +28 -0
  503. data/public/assets/tinymce/plugins/preview/jscripts/embed.js +73 -0
  504. data/public/assets/tinymce/plugins/preview/preview.html +17 -0
  505. data/public/assets/tinymce/plugins/print/editor_plugin.js +1 -0
  506. data/public/assets/tinymce/plugins/print/editor_plugin_src.js +34 -0
  507. data/public/assets/tinymce/plugins/save/editor_plugin.js +1 -0
  508. data/public/assets/tinymce/plugins/save/editor_plugin_src.js +101 -0
  509. data/public/assets/tinymce/plugins/searchreplace/css/searchreplace.css +6 -0
  510. data/public/assets/tinymce/plugins/searchreplace/editor_plugin.js +1 -0
  511. data/public/assets/tinymce/plugins/searchreplace/editor_plugin_src.js +61 -0
  512. data/public/assets/tinymce/plugins/searchreplace/js/searchreplace.js +148 -0
  513. data/public/assets/tinymce/plugins/searchreplace/langs/en_dlg.js +1 -0
  514. data/public/assets/tinymce/plugins/searchreplace/searchreplace.htm +100 -0
  515. data/public/assets/tinymce/plugins/spellchecker/css/content.css +1 -0
  516. data/public/assets/tinymce/plugins/spellchecker/editor_plugin.js +1 -0
  517. data/public/assets/tinymce/plugins/spellchecker/editor_plugin_src.js +471 -0
  518. data/public/assets/tinymce/plugins/spellchecker/img/wline.gif +0 -0
  519. data/public/assets/tinymce/plugins/style/css/props.css +14 -0
  520. data/public/assets/tinymce/plugins/style/editor_plugin.js +1 -0
  521. data/public/assets/tinymce/plugins/style/editor_plugin_src.js +71 -0
  522. data/public/assets/tinymce/plugins/style/js/props.js +709 -0
  523. data/public/assets/tinymce/plugins/style/langs/en_dlg.js +1 -0
  524. data/public/assets/tinymce/plugins/style/props.htm +845 -0
  525. data/public/assets/tinymce/plugins/style/readme.txt +19 -0
  526. data/public/assets/tinymce/plugins/tabfocus/editor_plugin.js +1 -0
  527. data/public/assets/tinymce/plugins/tabfocus/editor_plugin_src.js +122 -0
  528. data/public/assets/tinymce/plugins/table/cell.htm +180 -0
  529. data/public/assets/tinymce/plugins/table/css/cell.css +17 -0
  530. data/public/assets/tinymce/plugins/table/css/row.css +25 -0
  531. data/public/assets/tinymce/plugins/table/css/table.css +13 -0
  532. data/public/assets/tinymce/plugins/table/editor_plugin.js +1 -0
  533. data/public/assets/tinymce/plugins/table/editor_plugin_src.js +1456 -0
  534. data/public/assets/tinymce/plugins/table/js/cell.js +319 -0
  535. data/public/assets/tinymce/plugins/table/js/merge_cells.js +27 -0
  536. data/public/assets/tinymce/plugins/table/js/row.js +254 -0
  537. data/public/assets/tinymce/plugins/table/js/table.js +501 -0
  538. data/public/assets/tinymce/plugins/table/langs/en_dlg.js +1 -0
  539. data/public/assets/tinymce/plugins/table/merge_cells.htm +32 -0
  540. data/public/assets/tinymce/plugins/table/row.htm +158 -0
  541. data/public/assets/tinymce/plugins/table/table.htm +188 -0
  542. data/public/assets/tinymce/plugins/template/blank.htm +12 -0
  543. data/public/assets/tinymce/plugins/template/css/template.css +23 -0
  544. data/public/assets/tinymce/plugins/template/editor_plugin.js +1 -0
  545. data/public/assets/tinymce/plugins/template/editor_plugin_src.js +159 -0
  546. data/public/assets/tinymce/plugins/template/js/template.js +106 -0
  547. data/public/assets/tinymce/plugins/template/langs/en_dlg.js +1 -0
  548. data/public/assets/tinymce/plugins/template/template.htm +31 -0
  549. data/public/assets/tinymce/plugins/visualblocks/css/visualblocks.css +21 -0
  550. data/public/assets/tinymce/plugins/visualblocks/editor_plugin.js +1 -0
  551. data/public/assets/tinymce/plugins/visualblocks/editor_plugin_src.js +63 -0
  552. data/public/assets/tinymce/plugins/visualchars/editor_plugin.js +1 -0
  553. data/public/assets/tinymce/plugins/visualchars/editor_plugin_src.js +83 -0
  554. data/public/assets/tinymce/plugins/wordcount/editor_plugin.js +1 -0
  555. data/public/assets/tinymce/plugins/wordcount/editor_plugin_src.js +122 -0
  556. data/public/assets/tinymce/plugins/xhtmlxtras/abbr.htm +142 -0
  557. data/public/assets/tinymce/plugins/xhtmlxtras/acronym.htm +142 -0
  558. data/public/assets/tinymce/plugins/xhtmlxtras/attributes.htm +149 -0
  559. data/public/assets/tinymce/plugins/xhtmlxtras/cite.htm +142 -0
  560. data/public/assets/tinymce/plugins/xhtmlxtras/css/attributes.css +11 -0
  561. data/public/assets/tinymce/plugins/xhtmlxtras/css/popup.css +9 -0
  562. data/public/assets/tinymce/plugins/xhtmlxtras/del.htm +162 -0
  563. data/public/assets/tinymce/plugins/xhtmlxtras/editor_plugin.js +1 -0
  564. data/public/assets/tinymce/plugins/xhtmlxtras/editor_plugin_src.js +132 -0
  565. data/public/assets/tinymce/plugins/xhtmlxtras/ins.htm +162 -0
  566. data/public/assets/tinymce/plugins/xhtmlxtras/js/abbr.js +28 -0
  567. data/public/assets/tinymce/plugins/xhtmlxtras/js/acronym.js +28 -0
  568. data/public/assets/tinymce/plugins/xhtmlxtras/js/attributes.js +111 -0
  569. data/public/assets/tinymce/plugins/xhtmlxtras/js/cite.js +28 -0
  570. data/public/assets/tinymce/plugins/xhtmlxtras/js/del.js +53 -0
  571. data/public/assets/tinymce/plugins/xhtmlxtras/js/element_common.js +229 -0
  572. data/public/assets/tinymce/plugins/xhtmlxtras/js/ins.js +53 -0
  573. data/public/assets/tinymce/plugins/xhtmlxtras/langs/en_dlg.js +1 -0
  574. data/public/assets/tinymce/themes/advanced/about.htm +52 -0
  575. data/public/assets/tinymce/themes/advanced/anchor.htm +26 -0
  576. data/public/assets/tinymce/themes/advanced/charmap.htm +55 -0
  577. data/public/assets/tinymce/themes/advanced/color_picker.htm +70 -0
  578. data/public/assets/tinymce/themes/advanced/editor_template.js +1 -0
  579. data/public/assets/tinymce/themes/advanced/editor_template_src.js +1490 -0
  580. data/public/assets/tinymce/themes/advanced/image.htm +80 -0
  581. data/public/assets/tinymce/themes/advanced/img/colorpicker.jpg +0 -0
  582. data/public/assets/tinymce/themes/advanced/img/flash.gif +0 -0
  583. data/public/assets/tinymce/themes/advanced/img/icons.gif +0 -0
  584. data/public/assets/tinymce/themes/advanced/img/iframe.gif +0 -0
  585. data/public/assets/tinymce/themes/advanced/img/pagebreak.gif +0 -0
  586. data/public/assets/tinymce/themes/advanced/img/quicktime.gif +0 -0
  587. data/public/assets/tinymce/themes/advanced/img/realmedia.gif +0 -0
  588. data/public/assets/tinymce/themes/advanced/img/shockwave.gif +0 -0
  589. data/public/assets/tinymce/themes/advanced/img/trans.gif +0 -0
  590. data/public/assets/tinymce/themes/advanced/img/video.gif +0 -0
  591. data/public/assets/tinymce/themes/advanced/img/windowsmedia.gif +0 -0
  592. data/public/assets/tinymce/themes/advanced/js/about.js +73 -0
  593. data/public/assets/tinymce/themes/advanced/js/anchor.js +56 -0
  594. data/public/assets/tinymce/themes/advanced/js/charmap.js +363 -0
  595. data/public/assets/tinymce/themes/advanced/js/color_picker.js +345 -0
  596. data/public/assets/tinymce/themes/advanced/js/image.js +253 -0
  597. data/public/assets/tinymce/themes/advanced/js/link.js +159 -0
  598. data/public/assets/tinymce/themes/advanced/js/source_editor.js +78 -0
  599. data/public/assets/tinymce/themes/advanced/langs/en.js +1 -0
  600. data/public/assets/tinymce/themes/advanced/langs/en_dlg.js +1 -0
  601. data/public/assets/tinymce/themes/advanced/link.htm +57 -0
  602. data/public/assets/tinymce/themes/advanced/shortcuts.htm +47 -0
  603. data/public/assets/tinymce/themes/advanced/skins/default/content.css +50 -0
  604. data/public/assets/tinymce/themes/advanced/skins/default/dialog.css +118 -0
  605. data/public/assets/tinymce/themes/advanced/skins/default/img/buttons.png +0 -0
  606. data/public/assets/tinymce/themes/advanced/skins/default/img/items.gif +0 -0
  607. data/public/assets/tinymce/themes/advanced/skins/default/img/menu_arrow.gif +0 -0
  608. data/public/assets/tinymce/themes/advanced/skins/default/img/menu_check.gif +0 -0
  609. data/public/assets/tinymce/themes/advanced/skins/default/img/progress.gif +0 -0
  610. data/public/assets/tinymce/themes/advanced/skins/default/img/tabs.gif +0 -0
  611. data/public/assets/tinymce/themes/advanced/skins/default/ui.css +219 -0
  612. data/public/assets/tinymce/themes/advanced/skins/highcontrast/content.css +24 -0
  613. data/public/assets/tinymce/themes/advanced/skins/highcontrast/dialog.css +106 -0
  614. data/public/assets/tinymce/themes/advanced/skins/highcontrast/ui.css +106 -0
  615. data/public/assets/tinymce/themes/advanced/skins/o2k7/content.css +48 -0
  616. data/public/assets/tinymce/themes/advanced/skins/o2k7/dialog.css +118 -0
  617. data/public/assets/tinymce/themes/advanced/skins/o2k7/img/button_bg.png +0 -0
  618. data/public/assets/tinymce/themes/advanced/skins/o2k7/img/button_bg_black.png +0 -0
  619. data/public/assets/tinymce/themes/advanced/skins/o2k7/img/button_bg_silver.png +0 -0
  620. data/public/assets/tinymce/themes/advanced/skins/o2k7/ui.css +222 -0
  621. data/public/assets/tinymce/themes/advanced/skins/o2k7/ui_black.css +8 -0
  622. data/public/assets/tinymce/themes/advanced/skins/o2k7/ui_silver.css +5 -0
  623. data/public/assets/tinymce/themes/advanced/source_editor.htm +25 -0
  624. data/public/assets/tinymce/themes/simple/editor_template.js +1 -0
  625. data/public/assets/tinymce/themes/simple/editor_template_src.js +84 -0
  626. data/public/assets/tinymce/themes/simple/img/icons.gif +0 -0
  627. data/public/assets/tinymce/themes/simple/langs/en.js +1 -0
  628. data/public/assets/tinymce/themes/simple/skins/default/content.css +25 -0
  629. data/public/assets/tinymce/themes/simple/skins/default/ui.css +32 -0
  630. data/public/assets/tinymce/themes/simple/skins/o2k7/content.css +17 -0
  631. data/public/assets/tinymce/themes/simple/skins/o2k7/img/button_bg.png +0 -0
  632. data/public/assets/tinymce/themes/simple/skins/o2k7/ui.css +35 -0
  633. data/public/assets/tinymce/tiny_mce.js +1 -0
  634. data/public/assets/tinymce/tiny_mce_jquery.js +1 -0
  635. data/public/assets/tinymce/tiny_mce_jquery_src.js +17913 -0
  636. data/public/assets/tinymce/tiny_mce_popup.js +5 -0
  637. data/public/assets/tinymce/tiny_mce_src.js +19127 -0
  638. data/public/assets/tinymce/utils/editable_selects.js +70 -0
  639. data/public/assets/tinymce/utils/form_utils.js +210 -0
  640. data/public/assets/tinymce/utils/mctabs.js +162 -0
  641. data/public/assets/tinymce/utils/validate.js +252 -0
  642. data/public/assets2bpacked/jstree/README.txt +10 -0
  643. data/public/assets2bpacked/jstree/_demo/_dump.sql +20 -0
  644. data/public/assets2bpacked/jstree/_demo/_inc/__mysql_errors.log +0 -0
  645. data/public/assets2bpacked/jstree/_demo/_inc/class._database.php +146 -0
  646. data/public/assets2bpacked/jstree/_demo/_inc/class._database_i.php +152 -0
  647. data/public/assets2bpacked/jstree/_demo/_inc/class.tree.php +602 -0
  648. data/public/assets2bpacked/jstree/_demo/_install.txt +6 -0
  649. data/public/assets2bpacked/jstree/_demo/config.php +14 -0
  650. data/public/assets2bpacked/jstree/_demo/file.png +0 -0
  651. data/public/assets2bpacked/jstree/_demo/folder.png +0 -0
  652. data/public/assets2bpacked/jstree/_demo/index.html +461 -0
  653. data/public/assets2bpacked/jstree/_demo/root.png +0 -0
  654. data/public/assets2bpacked/jstree/_demo/server.php +69 -0
  655. data/public/assets2bpacked/jstree/_docs/!style.css +48 -0
  656. data/public/assets2bpacked/jstree/_docs/_drive.png +0 -0
  657. data/public/assets2bpacked/jstree/_docs/_html_data.html +2 -0
  658. data/public/assets2bpacked/jstree/_docs/_json_data.json +4 -0
  659. data/public/assets2bpacked/jstree/_docs/_search_data.json +6 -0
  660. data/public/assets2bpacked/jstree/_docs/_search_result.json +1 -0
  661. data/public/assets2bpacked/jstree/_docs/_xml_flat.xml +12 -0
  662. data/public/assets2bpacked/jstree/_docs/_xml_nest.xml +18 -0
  663. data/public/assets2bpacked/jstree/_docs/checkbox.html +171 -0
  664. data/public/assets2bpacked/jstree/_docs/contextmenu.html +121 -0
  665. data/public/assets2bpacked/jstree/_docs/cookies.html +97 -0
  666. data/public/assets2bpacked/jstree/_docs/core.html +689 -0
  667. data/public/assets2bpacked/jstree/_docs/crrm.html +316 -0
  668. data/public/assets2bpacked/jstree/_docs/dnd.html +199 -0
  669. data/public/assets2bpacked/jstree/_docs/hotkeys.html +82 -0
  670. data/public/assets2bpacked/jstree/_docs/html_data.html +175 -0
  671. data/public/assets2bpacked/jstree/_docs/index.html +86 -0
  672. data/public/assets2bpacked/jstree/_docs/json_data.html +249 -0
  673. data/public/assets2bpacked/jstree/_docs/languages.html +152 -0
  674. data/public/assets2bpacked/jstree/_docs/logo.png +0 -0
  675. data/public/assets2bpacked/jstree/_docs/search.html +153 -0
  676. data/public/assets2bpacked/jstree/_docs/sort.html +85 -0
  677. data/public/assets2bpacked/jstree/_docs/syntax/!script.js +2232 -0
  678. data/public/assets2bpacked/jstree/_docs/syntax/!style.css +511 -0
  679. data/public/assets2bpacked/jstree/_docs/syntax/clipboard.swf +0 -0
  680. data/public/assets2bpacked/jstree/_docs/syntax/help.png +0 -0
  681. data/public/assets2bpacked/jstree/_docs/syntax/magnifier.png +0 -0
  682. data/public/assets2bpacked/jstree/_docs/syntax/page_white_code.png +0 -0
  683. data/public/assets2bpacked/jstree/_docs/syntax/page_white_copy.png +0 -0
  684. data/public/assets2bpacked/jstree/_docs/syntax/printer.png +0 -0
  685. data/public/assets2bpacked/jstree/_docs/syntax/wrapping.png +0 -0
  686. data/public/assets2bpacked/jstree/_docs/themeroller.html +107 -0
  687. data/public/assets2bpacked/jstree/_docs/themes.html +127 -0
  688. data/public/assets2bpacked/jstree/_docs/types.html +178 -0
  689. data/public/assets2bpacked/jstree/_docs/ui.html +197 -0
  690. data/public/assets2bpacked/jstree/_docs/unique.html +85 -0
  691. data/public/assets2bpacked/jstree/_docs/xml_data.html +218 -0
  692. data/public/assets2bpacked/jstree/_lib/jquery.cookie.js +96 -0
  693. data/public/assets2bpacked/jstree/_lib/jquery.hotkeys.js +99 -0
  694. data/public/assets2bpacked/jstree/_lib/jquery.js +5 -0
  695. data/public/assets2bpacked/jstree/jquery.jstree.js +4564 -0
  696. data/public/assets2bpacked/jstree/themes/apple/bg.jpg +0 -0
  697. data/public/assets2bpacked/jstree/themes/apple/d.png +0 -0
  698. data/public/assets2bpacked/jstree/themes/apple/dot_for_ie.gif +0 -0
  699. data/public/assets2bpacked/jstree/themes/apple/style.css +61 -0
  700. data/public/assets2bpacked/jstree/themes/apple/throbber.gif +0 -0
  701. data/public/assets2bpacked/jstree/themes/classic/d.gif +0 -0
  702. data/public/assets2bpacked/jstree/themes/classic/d.png +0 -0
  703. data/public/assets2bpacked/jstree/themes/classic/dot_for_ie.gif +0 -0
  704. data/public/assets2bpacked/jstree/themes/classic/style.css +77 -0
  705. data/public/assets2bpacked/jstree/themes/classic/throbber.gif +0 -0
  706. data/public/assets2bpacked/jstree/themes/default-rtl/d.gif +0 -0
  707. data/public/assets2bpacked/jstree/themes/default-rtl/d.png +0 -0
  708. data/public/assets2bpacked/jstree/themes/default-rtl/dots.gif +0 -0
  709. data/public/assets2bpacked/jstree/themes/default-rtl/style.css +84 -0
  710. data/public/assets2bpacked/jstree/themes/default-rtl/throbber.gif +0 -0
  711. data/public/assets2bpacked/jstree/themes/default/d.gif +0 -0
  712. data/public/assets2bpacked/jstree/themes/default/d.png +0 -0
  713. data/public/assets2bpacked/jstree/themes/default/style.css +74 -0
  714. data/public/assets2bpacked/jstree/themes/default/throbber.gif +0 -0
  715. data/public/favicon.ico +0 -0
  716. data/public/jasmine/card_form.html +13 -0
  717. data/public/robots.txt +12 -0
  718. data/script/autospec +4 -0
  719. data/script/rails +6 -0
  720. data/script/test_filter +25 -0
  721. data/script/wagn.rb +6 -0
  722. data/spec/controllers/account_controller_spec.rb +43 -0
  723. data/spec/controllers/admin_controller_spec.rb +23 -0
  724. data/spec/controllers/captcha_spec.rb +103 -0
  725. data/spec/controllers/card_controller_spec.rb +353 -0
  726. data/spec/controllers/location_spec.rb +49 -0
  727. data/spec/controllers/sets_spec.rb +97 -0
  728. data/spec/controllers/wagn_controller_spec.rb +5 -0
  729. data/spec/javascripts/helpers/.gitkeep +0 -0
  730. data/spec/javascripts/helpers/jasmine-config.js +2 -0
  731. data/spec/javascripts/helpers/jasmine-jquery-1.3.1.js +295 -0
  732. data/spec/javascripts/support/jasmine.yml +77 -0
  733. data/spec/javascripts/support/jasmine_config.rb +24 -0
  734. data/spec/javascripts/support/jasmine_runner.rb +21 -0
  735. data/spec/javascripts/wagn_spec.coffee +40 -0
  736. data/spec/lib/card/chunk_spec.rb +18 -0
  737. data/spec/lib/card/codename_spec.rb +30 -0
  738. data/spec/lib/card/content_spec.rb +293 -0
  739. data/spec/lib/card/diff_spec.rb +111 -0
  740. data/spec/lib/card/flexmail_spec.rb +209 -0
  741. data/spec/lib/card/format_spec.rb +173 -0
  742. data/spec/lib/card/name_spec.rb +275 -0
  743. data/spec/lib/card/query_spec.rb +456 -0
  744. data/spec/lib/card/set_pattern_spec.rb +40 -0
  745. data/spec/lib/card/set_spec.rb +84 -0
  746. data/spec/lib/wagn/cache_spec.rb +120 -0
  747. data/spec/lib/wagn/loader_spec.rb +33 -0
  748. data/spec/mailers/account_spec.rb +66 -0
  749. data/spec/mailers/mailer_spec.rb +57 -0
  750. data/spec/models/account_spec.rb +19 -0
  751. data/spec/models/card/cardtype_spec.rb +218 -0
  752. data/spec/models/card/comment_spec.rb +38 -0
  753. data/spec/models/card/create_spec.rb +83 -0
  754. data/spec/models/card/reference_spec.rb +214 -0
  755. data/spec/models/card/revision_spec.rb +58 -0
  756. data/spec/models/card/trash_spec.rb +258 -0
  757. data/spec/models/card/type_transition_spec.rb +162 -0
  758. data/spec/models/card/validation_spec.rb +37 -0
  759. data/spec/models/card_spec.rb +177 -0
  760. data/spec/models/user_spec.rb +95 -0
  761. data/spec/mods/core/chunks/literal_spec.rb +15 -0
  762. data/spec/mods/core/chunks/uri_spec.rb +293 -0
  763. data/spec/mods/core/formats/data_format_spec.rb +6 -0
  764. data/spec/mods/core/formats/html_format_spec.rb +165 -0
  765. data/spec/mods/core/formats/text_format_spec.rb +6 -0
  766. data/spec/mods/core/sets/all/active_card_spec.rb +6 -0
  767. data/spec/mods/core/sets/all/attribute_tracking_spec.rb +22 -0
  768. data/spec/mods/core/sets/all/collection_spec.rb +49 -0
  769. data/spec/mods/core/sets/all/content_spec.rb +15 -0
  770. data/spec/mods/core/sets/all/fetch_spec.rb +206 -0
  771. data/spec/mods/core/sets/all/initialize_spec.rb +59 -0
  772. data/spec/mods/core/sets/all/name_spec.rb +30 -0
  773. data/spec/mods/core/sets/all/pattern_spec.rb +93 -0
  774. data/spec/mods/core/sets/all/permissions_spec.rb +481 -0
  775. data/spec/mods/core/sets/all/phases_spec.rb +6 -0
  776. data/spec/mods/core/sets/all/references_spec.rb +9 -0
  777. data/spec/mods/core/sets/all/rules2_spec.rb +250 -0
  778. data/spec/mods/core/sets/all/rules_spec.rb +99 -0
  779. data/spec/mods/core/sets/all/states_spec.rb +6 -0
  780. data/spec/mods/core/sets/all/templating_spec.rb +105 -0
  781. data/spec/mods/core/sets/all/tracked_attributes_spec.rb +316 -0
  782. data/spec/mods/core/sets/all/type_spec.rb +49 -0
  783. data/spec/mods/core/sets/all/utils_spec.rb +6 -0
  784. data/spec/mods/standard/chunks/include_spec.rb +182 -0
  785. data/spec/mods/standard/chunks/link_spec.rb +60 -0
  786. data/spec/mods/standard/formats/css_format_spec.rb +6 -0
  787. data/spec/mods/standard/formats/csv_format_spec.rb +6 -0
  788. data/spec/mods/standard/formats/email_html_format_spec.rb +6 -0
  789. data/spec/mods/standard/formats/file_format_spec.rb +6 -0
  790. data/spec/mods/standard/formats/json_format_spec.rb +6 -0
  791. data/spec/mods/standard/formats/kml_format_spec.rb +6 -0
  792. data/spec/mods/standard/formats/rss_format_spec.rb +6 -0
  793. data/spec/mods/standard/formats/xml_format_spec.rb +6 -0
  794. data/spec/mods/standard/sets/all/account_spec.rb +117 -0
  795. data/spec/mods/standard/sets/all/admin_spec.rb +6 -0
  796. data/spec/mods/standard/sets/all/all_css_spec.rb +11 -0
  797. data/spec/mods/standard/sets/all/all_csv_spec.rb +10 -0
  798. data/spec/mods/standard/sets/all/attach_spec.rb +10 -0
  799. data/spec/mods/standard/sets/all/base_spec.rb +52 -0
  800. data/spec/mods/standard/sets/all/email_html_spec.rb +14 -0
  801. data/spec/mods/standard/sets/all/file_spec.rb +6 -0
  802. data/spec/mods/standard/sets/all/flexmail_spec.rb +6 -0
  803. data/spec/mods/standard/sets/all/follow_spec.rb +96 -0
  804. data/spec/mods/standard/sets/all/geocode_spec.rb +37 -0
  805. data/spec/mods/standard/sets/all/json_spec.rb +27 -0
  806. data/spec/mods/standard/sets/all/kml_spec.rb +6 -0
  807. data/spec/mods/standard/sets/all/rich_html_spec.rb +10 -0
  808. data/spec/mods/standard/sets/all/rss_spec.rb +6 -0
  809. data/spec/mods/standard/sets/all/text_spec.rb +6 -0
  810. data/spec/mods/standard/sets/right/account_spec.rb +6 -0
  811. data/spec/mods/standard/sets/right/add_help_spec.rb +6 -0
  812. data/spec/mods/standard/sets/right/comment_spec.rb +6 -0
  813. data/spec/mods/standard/sets/right/create_spec.rb +6 -0
  814. data/spec/mods/standard/sets/right/crypted_password_spec.rb +6 -0
  815. data/spec/mods/standard/sets/right/default_spec.rb +6 -0
  816. data/spec/mods/standard/sets/right/delete_spec.rb +6 -0
  817. data/spec/mods/standard/sets/right/email_spec.rb +27 -0
  818. data/spec/mods/standard/sets/right/help_spec.rb +6 -0
  819. data/spec/mods/standard/sets/right/read_spec.rb +6 -0
  820. data/spec/mods/standard/sets/right/salt_spec.rb +6 -0
  821. data/spec/mods/standard/sets/right/structure_spec.rb +10 -0
  822. data/spec/mods/standard/sets/right/style_spec.rb +6 -0
  823. data/spec/mods/standard/sets/right/update_spec.rb +6 -0
  824. data/spec/mods/standard/sets/right/when_created_spec.rb +8 -0
  825. data/spec/mods/standard/sets/right/when_last_edited_spec.rb +8 -0
  826. data/spec/mods/standard/sets/rstar/rules_spec.rb +26 -0
  827. data/spec/mods/standard/sets/self/account_links_spec.rb +10 -0
  828. data/spec/mods/standard/sets/self/alerts_spec.rb +6 -0
  829. data/spec/mods/standard/sets/self/foot_spec.rb +6 -0
  830. data/spec/mods/standard/sets/self/head_spec.rb +18 -0
  831. data/spec/mods/standard/sets/self/navbox_spec.rb +8 -0
  832. data/spec/mods/standard/sets/self/now_spec.rb +8 -0
  833. data/spec/mods/standard/sets/self/recent_spec.rb +6 -0
  834. data/spec/mods/standard/sets/self/search_spec.rb +6 -0
  835. data/spec/mods/standard/sets/self/style_functional_spec.rb +6 -0
  836. data/spec/mods/standard/sets/self/style_jquery_ui_smoothness_spec.rb +6 -0
  837. data/spec/mods/standard/sets/self/style_standard_spec.rb +6 -0
  838. data/spec/mods/standard/sets/self/version_spec.rb +8 -0
  839. data/spec/mods/standard/sets/type/account_request_spec.rb +160 -0
  840. data/spec/mods/standard/sets/type/basic_spec.rb +6 -0
  841. data/spec/mods/standard/sets/type/cardtype_spec.rb +6 -0
  842. data/spec/mods/standard/sets/type/css_spec.rb +6 -0
  843. data/spec/mods/standard/sets/type/date_spec.rb +8 -0
  844. data/spec/mods/standard/sets/type/file_spec.rb +6 -0
  845. data/spec/mods/standard/sets/type/html_spec.rb +24 -0
  846. data/spec/mods/standard/sets/type/image_spec.rb +17 -0
  847. data/spec/mods/standard/sets/type/layout_type_spec.rb +8 -0
  848. data/spec/mods/standard/sets/type/number_spec.rb +8 -0
  849. data/spec/mods/standard/sets/type/phrase_spec.rb +8 -0
  850. data/spec/mods/standard/sets/type/plain_text_spec.rb +12 -0
  851. data/spec/mods/standard/sets/type/pointer_spec.rb +74 -0
  852. data/spec/mods/standard/sets/type/ruby_and_script_spec.rb +6 -0
  853. data/spec/mods/standard/sets/type/scss_spec.rb +6 -0
  854. data/spec/mods/standard/sets/type/search_type_spec.rb +16 -0
  855. data/spec/mods/standard/sets/type/set_spec.rb +27 -0
  856. data/spec/mods/standard/sets/type/setting_spec.rb +6 -0
  857. data/spec/mods/standard/sets/type/skin_spec.rb +6 -0
  858. data/spec/mods/standard/sets/type/toggle_spec.rb +13 -0
  859. data/spec/mods/standard/sets/type/user_spec.rb +6 -0
  860. data/spec/spec.opts +6 -0
  861. data/test/fixtures/.gitkeep +0 -0
  862. data/test/fixtures/card_references.yml +1954 -0
  863. data/test/fixtures/card_revisions.yml +4499 -0
  864. data/test/fixtures/cards.yml +9419 -0
  865. data/test/fixtures/mao2.jpg +0 -0
  866. data/test/fixtures/rails.gif +0 -0
  867. data/test/fixtures/users.yml +169 -0
  868. data/test/performance/card_create_test.rb +22 -0
  869. data/test/performance/fetch_test.rb +9 -0
  870. data/test/performance/homepage_test.rb +9 -0
  871. data/test/performance/render_test.rb +10 -0
  872. data/test/seed.rb +192 -0
  873. data/test/test_helper.rb +123 -0
  874. data/wagn.gemspec +46 -0
  875. metadata +1307 -0
@@ -0,0 +1,152 @@
1
+ <!DOCTYPE html
2
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4
+ <html xmlns="http://www.w3.org/1999/xhtml">
5
+ <head>
6
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
7
+ <title>jsTree v.1.0 - languages documentation</title>
8
+ <script type="text/javascript" src="../_lib/jquery.js"></script>
9
+ <script type="text/javascript" src="../_lib/jquery.cookie.js"></script>
10
+ <script type="text/javascript" src="../_lib/jquery.hotkeys.js"></script>
11
+ <script type="text/javascript" src="../jquery.jstree.js"></script>
12
+
13
+ <link type="text/css" rel="stylesheet" href="syntax/!style.css"/>
14
+ <link type="text/css" rel="stylesheet" href="!style.css"/>
15
+ <script type="text/javascript" src="syntax/!script.js"></script>
16
+ </head>
17
+ <body>
18
+ <div id="container">
19
+
20
+ <h1 id="dhead">jsTree v.1.0</h1>
21
+ <h1>languages plugin</h1>
22
+ <h2>Description</h2>
23
+ <div id="description">
24
+ <p>The <code>languages</code> plugin enables multilanguage trees. This means that each node has a specified number of titles - each in a different "language". Only one language set is visible at any given time. This is useful for maintaining the same structure in many languages (hence the name of the plugin)</p>
25
+ </div>
26
+
27
+ <h2 id="configuration">Configuration</h2>
28
+ <div class="panel configuration">
29
+ <p>Expects an array of language codes. Each of the items is used as a CSS class name, so make sure you specify only valid CSS class name strings. The first langauge will be visible onload. For example:</p>
30
+ <p><code>[ "en", "de", "bg" ]</code></p>
31
+ </div>
32
+
33
+ <h2 id="demos">Demos</h2>
34
+ <div class="panel">
35
+ <p>Check your data plugin documentation (<a href="html_data.html">html_data</a>, <a href="xml_data.html">xml_data</a>, <a href="json_data.html">json_data</a>) or take a close look at these examples for information on how to specify multilanguage nodes.</p>
36
+
37
+ <h3>Using the languages plugin with HTML data</h3>
38
+ <input type="button" class="button" value="en" id="en_1" style="float:left;" />
39
+ <input type="button" class="button" value="bg" id="bg_1" style="float:left;" />
40
+ <input type="button" class="button" value="rename_1" id="rename_1" style="float:left;" />
41
+ <input type="button" class="button" value="rename_2" id="rename_2" style="" />
42
+ <div id="demo1" class="demo">
43
+ <ul>
44
+ <li id="phtml_1">
45
+ <a href="#" class="en">Root node 1</a>
46
+ <a href="#" class="bg">Корен 1</a>
47
+ <ul>
48
+ <li id="phtml_2">
49
+ <a href="#" class="en">Child node 1</a>
50
+ <a href="#" class="bg">Дете 1</a>
51
+ </li>
52
+ <li id="phtml_3">
53
+ <a href="#" class="en">Child node 2</a>
54
+ <a href="#" class="bg">Дете 2</a>
55
+ </li>
56
+ </ul>
57
+ </li>
58
+ <li id="phtml_4">
59
+ <a href="#" class="en">Root node 2</a>
60
+ <a href="#" class="bg">Корен 2</a>
61
+ </li>
62
+ </ul>
63
+ </div>
64
+ <script type="text/javascript" class="source">
65
+ $(function () {
66
+ $("#en_1, #bg_1").click(function () {
67
+ $("#demo1").jstree("set_lang", this.value);
68
+ });
69
+ $("#rename_1").click(function () {
70
+ $("#demo1").jstree("rename_node", "#phtml_1", "Rename visible lang");
71
+ });
72
+ $("#rename_2").click(function () {
73
+ $("#demo1").jstree("rename_node", "#phtml_1", "Rename `bg`", "bg");
74
+ });
75
+ $("#demo1").jstree({
76
+ "languages" : [ "en", "bg" ],
77
+ "plugins" : [ "themes", "html_data", "languages","checkbox"]
78
+ });
79
+ });
80
+ </script>
81
+
82
+ </div>
83
+
84
+ <h2 id="api">API</h2>
85
+ <div class="panel api">
86
+
87
+ <h3 id="set_lang">.set_lang ( lang )</h3>
88
+ <p>Set the tree's visible language. Triggers an event.</p>
89
+ <ul class="arguments">
90
+ <li>
91
+ <code class="tp">string <br />number</code> <strong>lang</strong>
92
+ <p>Either the language code string (as specified in the config) or an index from the config array.</p>
93
+ </li>
94
+ </ul>
95
+ <h3 id="get_lang">.get_lang ( )</h3>
96
+ <p>Returns the name of the currently visible language.</p>
97
+
98
+ <h3 id="_get_string">._get_string ( node , lang )</h3>
99
+ <p>Returns the needed string from the core config object. Overwrites the <a href="core.html#_get_string">get_string function</a> from the core. If the key does not exist in that language, but exists in the root of the object - that is returned, if even that does not exist - the key itself is returned.</p>
100
+ <ul class="arguments">
101
+ <li>
102
+ <code class="tp">string</code> <strong>key</strong>
103
+ <p>The name of the string you are looking for. If you want to use the localize option just set the strings core config option to an object like this one: <code>strings : { "lang-code-here" : { "string-key" : "string-value" ... }, "other-lang" : { ... } }</code>, otherwise _get_strings won't be affected.</p>
104
+ </li>
105
+ <li>
106
+ <code class="tp">string</code> <strong>lang</strong>
107
+ <p>The language code string (as specified in the config) to get the key in. If not specified the currently visible language is used.</p>
108
+ </li>
109
+ </ul>
110
+
111
+ <h3 id="get_text">.get_text ( node , lang )</h3>
112
+ <p>Returns the title of a node. Overwrites the <a href="core.html#get_text">get_text function</a> from the core.</p>
113
+ <ul class="arguments">
114
+ <li>
115
+ <code class="tp">mixed</code> <strong>node</strong>
116
+ <p>This can be a DOM node, jQuery node or selector pointing to the element whose title you need.</p>
117
+ </li>
118
+ <li>
119
+ <code class="tp">string</code> <strong>lang</strong>
120
+ <p>The language code string (as specified in the config) to get the title in. If you omit this - the currently visible language is used.</p>
121
+ </li>
122
+ </ul>
123
+
124
+ <h3 id="set_text">.set_text ( node , text , lang )</h3>
125
+ <p>Sets the title of a node. Overwrites the <a href="core.html#set_text">set_text function</a> from the core. This is used internally - you should use <a href="core.html#rename_node">rename_node</a>. Since <code>rename_node</code> uses <code>set_text</code> internally you can pass a language string as a third parameter to rename_node.</p>
126
+ <ul class="arguments">
127
+ <li>
128
+ <code class="tp">mixed</code> <strong>node</strong>
129
+ <p>This can be a DOM node, jQuery node or selector pointing to the element whose title you want to change.</p>
130
+ </li>
131
+ <li>
132
+ <code class="tp">string</code> <strong>text</strong>
133
+ <p>The new title.</p>
134
+ </li>
135
+ <li>
136
+ <code class="tp">string</code> <strong>lang</strong>
137
+ <p>The language code string (as specified in the config) to get the title in. If you omit this - the currently visible language is used.</p>
138
+ </li>
139
+ </ul>
140
+
141
+ <h3 id="_load_css">._load_css ( )</h3>
142
+ <p>used only internally to include the CSS necessary for the plugin onload.</p>
143
+
144
+ <h3 id="create_node">.create_node ( obj , position , js , callback )</h3>
145
+ <p>Overwrites the <a href="core.html#create_node">create_node</a> function from the core. To create a node with a few titles use an array for the <code>data</code> property of the <code>js</code> parameter:</p>
146
+ <p><code>{ "data" : [ { "title" : "EN title", language : "en" }, { "title" : "BG заглавие", language : "bg" } ] }</code></p>
147
+
148
+ </div>
149
+
150
+ </div>
151
+ </body>
152
+ </html>
@@ -0,0 +1,153 @@
1
+ <!DOCTYPE html
2
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4
+ <html xmlns="http://www.w3.org/1999/xhtml">
5
+ <head>
6
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
7
+ <title>jsTree v.1.0 - Search documentation</title>
8
+ <script type="text/javascript" src="../_lib/jquery.js"></script>
9
+ <script type="text/javascript" src="../_lib/jquery.cookie.js"></script>
10
+ <script type="text/javascript" src="../_lib/jquery.hotkeys.js"></script>
11
+ <script type="text/javascript" src="../jquery.jstree.js"></script>
12
+
13
+ <link type="text/css" rel="stylesheet" href="syntax/!style.css"/>
14
+ <link type="text/css" rel="stylesheet" href="!style.css"/>
15
+ <script type="text/javascript" src="syntax/!script.js"></script>
16
+ </head>
17
+ <body>
18
+ <div id="container">
19
+
20
+ <h1 id="dhead">jsTree v.1.0</h1>
21
+ <h1>search plugin</h1>
22
+ <h2>Description</h2>
23
+ <div id="description">
24
+ <p>The <code>search</code> plugin enables searching for nodes whose title contains a given string, works on async trees too. All found nodes get the <code>jstree-search</code> class applied to their contained <code>a</code> nodes - you can use that class to style search results.</p>
25
+ </div>
26
+
27
+ <h2 id="configuration">Configuration</h2>
28
+ <div class="panel configuration">
29
+
30
+ <h3>search_method</h3>
31
+ <p class="meta">A string. Default is <code>"contains"</code>.</p>
32
+ <p>The method to use for searching. The other options bundled with jstree are <code>"jstree_contains"</code> (case insensitive search) and <code>"jstree_title_contains"</code> (case insensitive based on the title tag of the A node). For multiple word search take a look this: <a href="https://github.com/vakata/jstree/issues/10">https://github.com/vakata/jstree/issues/10</a> - you can easily write your own method too.</p>
33
+
34
+ <h3>show_only_matches</h3>
35
+ <p class="meta">A boolean. Default is <code>false</code>.</p>
36
+ <p>If set to <code>true</code> all non-matching nodes are hidden and only the matching nodes (and their parents) are left visible, until the search is cleared. Keep in mind <code>show_only_matches</code> is heavy on the browser/DOM and is still experimental.</p>
37
+
38
+ <h3>ajax</h3>
39
+ <p class="meta">An object (or <code>false</code> if not used). Default is <code>false</code>.</p>
40
+ <p>This object can be used to make a request to the server on each search - useful if you are using async trees. That way you can return an array of IDs that need to be loaded before the actual DOM search is performed (so that all the nodes that will match the search are loaded). For example if the user searches for "string", you get that on the server side, check the database and find out that there is a node containing that string. But the node is the child of some other node, etc - so in your response you must return the path to the node (without the node itself) as ids: <code>["#root_node","#child_node_3"]</code>. This means that jstree will load those two nodes before doing the client side search, ensuring that your node will be visible.</p>
41
+ <p>The ajax config object is pretty much the same as the <a href="http://api.jquery.com/jQuery.ajax/">jQuery ajax settings object</a>.</p>
42
+ <p>You can set the <code>data</code> option to a function, that will be executed in the current tree's scope (<code>this</code> will be the tree instance) and gets the search string as a paramater. Whatever you return in the function will be sent to the server as data.</p>
43
+ <p>You can set the <code>url</code> option to a function, that will be executed in the current tree's scope (<code>this</code> will be the tree instance) and gets the search string as a paramater. Whatever you return in the function will be used as the URL of the ajax request.</p>
44
+ <p>The <code>error</code> and <code>success</code> functions (if present) also fire in the context of the tree, and if you return a value in the <code>success</code> function it will be used as the array of IDs.</p>
45
+
46
+ </div>
47
+
48
+ <h2 id="demos">Demos</h2>
49
+ <div class="panel">
50
+
51
+ <h3>Searching nodes</h3>
52
+ <p>Do not open the node - instead - just press the button.</p>
53
+ <input type="button" class="button" value="Search" id="search" style="" />
54
+ <div id="demo1" class="demo"></div>
55
+ <script type="text/javascript" class="source">
56
+ $(function () {
57
+ $("#search").click(function () {
58
+ $("#demo1").jstree("search","TARGEt");
59
+ });
60
+ $("#demo1")
61
+ .jstree({
62
+ "json_data" : {
63
+ "data" : [
64
+ {
65
+ "attr" : { "id" : "root_node" },
66
+ "data" : "A closed node",
67
+ "state" : "closed"
68
+ }
69
+ ],
70
+ "ajax" : {
71
+ "url" : "_search_data.json",
72
+ "data" : function (n) {
73
+ return { id : n.attr ? n.attr("id") : 0 };
74
+ }
75
+ }
76
+ },
77
+ "search" : {
78
+ "case_insensitive" : true,
79
+ "ajax" : {
80
+ "url" : "_search_result.json"
81
+ }
82
+ },
83
+ "plugins" : [ "themes", "json_data", "search" ]
84
+ })
85
+ .bind("search.jstree", function (e, data) {
86
+ alert("Found " + data.rslt.nodes.length + " nodes matching '" + data.rslt.str + "'.");
87
+ });
88
+ });
89
+ </script>
90
+
91
+ <h3>Using adv_search</h3>
92
+ <p>Try pressing the buttons. It will also work with AJAX searching.</p>
93
+ <input type="button" class="button" value="search for ADV_SEARCH" id="search1" rel="ADV_SEARCH" style="float:left;" />
94
+ <input type="button" class="button" value="search for Root" id="search2" rel="Root" style="float:left;" />
95
+ <input type="button" class="button" value="search for Child" id="search3" rel="Child" style="float:left;" />
96
+ <input type="button" class="button" value="Clear search" id="clear" style="" />
97
+ <div id="demo2" class="demo">
98
+ <ul>
99
+ <li class="jstree-open"><a href="#">Root node 1</a>
100
+ <ul>
101
+ <li><a href="#">Child node 1</a></li>
102
+ <li><a href="#">Child node 2</a></li>
103
+ <li><a href="#">ADV_SEARCH</a></li>
104
+ <li><a href="#">Child node 4</a></li>
105
+ </ul>
106
+ </li>
107
+ <li><a href="#">Root node 2</a>
108
+ </ul>
109
+ </div>
110
+ <script type="text/javascript" class="source">
111
+ $(function () {
112
+ $("#search1, #search2, #search3").click(function () {
113
+ $("#demo2").jstree("search", $(this).attr("rel"));
114
+ });
115
+ $("#clear").click(function () {
116
+ $("#demo2").jstree("clear_search");
117
+ });
118
+ $("#demo2")
119
+ .jstree({
120
+ "plugins" : [ "themes", "html_data", "search", "adv_search" ]
121
+ });
122
+ });
123
+ </script>
124
+
125
+ </div>
126
+
127
+ <h2 id="api">API</h2>
128
+ <div class="panel api">
129
+
130
+ <h3 id="search">.search ( str , skip_async )</h3>
131
+ <p>Searches for nodes matching the supplied string. Triggers an event.</p>
132
+ <ul class="arguments">
133
+ <li>
134
+ <code class="tp">string</code> <strong>str</strong>
135
+ <p>The string to search for.</p>
136
+ </li>
137
+ <li>
138
+ <code class="tp">boolean</code> <strong>skip_async</strong>
139
+ <p>If set to <code>true</code> - skip the async search (if setup in the config). This is used mostly internally.</p>
140
+ </li>
141
+ </ul>
142
+
143
+ <h3 id="clear_search">.clear_search ( )</h3>
144
+ <p>Clears the current search. This function is automatically called when doing a new search. Triggers an event.</p>
145
+
146
+ <h3 id="_search_open">._search_open ( is_callback )</h3>
147
+ <p>Used internally if async is setup in the config. This functions loads the nodes returned by the server one by one.</p>
148
+
149
+ </div>
150
+
151
+ </div>
152
+ </body>
153
+ </html>
@@ -0,0 +1,85 @@
1
+ <!DOCTYPE html
2
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4
+ <html xmlns="http://www.w3.org/1999/xhtml">
5
+ <head>
6
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
7
+ <title>jsTree v.1.0 - sort documentation</title>
8
+ <script type="text/javascript" src="../_lib/jquery.js"></script>
9
+ <script type="text/javascript" src="../_lib/jquery.cookie.js"></script>
10
+ <script type="text/javascript" src="../_lib/jquery.hotkeys.js"></script>
11
+ <script type="text/javascript" src="../jquery.jstree.js"></script>
12
+
13
+ <link type="text/css" rel="stylesheet" href="syntax/!style.css"/>
14
+ <link type="text/css" rel="stylesheet" href="!style.css"/>
15
+ <script type="text/javascript" src="syntax/!script.js"></script>
16
+ </head>
17
+ <body>
18
+ <div id="container">
19
+
20
+ <h1 id="dhead">jsTree v.1.0</h1>
21
+ <h1>sort plugin</h1>
22
+ <h2>Description</h2>
23
+ <div id="description">
24
+ <p>The <code>sort</code> enables jstree to automatically sort all nodes using a specified function. This means that when the user creates, renames or moves nodes around - they will automatically sort.</p>
25
+ </div>
26
+
27
+ <h2 id="configuration">Configuration</h2>
28
+ <div class="panel configuration">
29
+
30
+ <p>Expects a function. The functions receives two arguments - two nodes to be compared. Return <code>-1</code> or <code>1</code> (or any other different from -1). Default is: </p>
31
+ <p><code>function (a, b) { return this.get_text(a) > this.get_text(b) ? 1 : -1; }</code></p>
32
+
33
+ </div>
34
+
35
+ <h2 id="demos">Demos</h2>
36
+ <div class="panel">
37
+ <h3>Using the sort plugin</h3>
38
+ <input type="button" class="button" value="rename" id="rename" style="" />
39
+ <div id="demo1" class="demo">
40
+ <ul>
41
+ <li id="phtml_1">
42
+ <a href="#">Root node 1</a>
43
+ <ul>
44
+ <li id="phtml_2">
45
+ <a href="#">Child node 1</a>
46
+ </li>
47
+ <li id="phtml_3">
48
+ <a href="#">Child node 2</a>
49
+ </li>
50
+ </ul>
51
+ </li>
52
+ <li id="phtml_4">
53
+ <a href="#">Root node 2</a>
54
+ </li>
55
+ </ul>
56
+ </div>
57
+ <script type="text/javascript" class="source">
58
+ $(function () {
59
+ $("#rename").click(function () {
60
+ $("#demo1").jstree("rename");
61
+ });
62
+ $("#demo1").jstree({
63
+ "plugins" : [ "themes", "html_data", "ui", "crrm", "sort" ]
64
+ });
65
+ });
66
+ </script>
67
+
68
+ </div>
69
+
70
+ <h2 id="api">API</h2>
71
+ <div class="panel api">
72
+
73
+ <h3 id="sort">.sort ( node )</h3>
74
+ <p>Sorts the children of the specified node - this function is called automatically.</p>
75
+ <ul class="arguments">
76
+ <li>
77
+ <code class="tp">mixed</code> <strong>node</strong>
78
+ <p>This can be a DOM node, jQuery node or selector pointing to the element.</p>
79
+ </li>
80
+ </ul>
81
+ </div>
82
+
83
+ </div>
84
+ </body>
85
+ </html>
@@ -0,0 +1,2232 @@
1
+ /**
2
+ * SyntaxHighlighter
3
+ * http://alexgorbatchev.com/
4
+ *
5
+ * SyntaxHighlighter is donationware. If you are using it, please donate.
6
+ * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
7
+ *
8
+ * @version
9
+ * 2.1.364 (October 15 2009)
10
+ *
11
+ * @copyright
12
+ * Copyright (C) 2004-2009 Alex Gorbatchev.
13
+ *
14
+ * @license
15
+ * This file is part of SyntaxHighlighter.
16
+ *
17
+ * SyntaxHighlighter is free software: you can redistribute it and/or modify
18
+ * it under the terms of the GNU Lesser General Public License as published by
19
+ * the Free Software Foundation, either version 3 of the License, or
20
+ * (at your option) any later version.
21
+ *
22
+ * SyntaxHighlighter is distributed in the hope that it will be useful,
23
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
24
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25
+ * GNU General Public License for more details.
26
+ *
27
+ * You should have received a copy of the GNU General Public License
28
+ * along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>.
29
+ */
30
+ //
31
+ // Begin anonymous function. This is used to contain local scope variables without polutting global scope.
32
+ //
33
+ if (!window.SyntaxHighlighter) var SyntaxHighlighter = function() {
34
+
35
+ // Shortcut object which will be assigned to the SyntaxHighlighter variable.
36
+ // This is a shorthand for local reference in order to avoid long namespace
37
+ // references to SyntaxHighlighter.whatever...
38
+ var sh = {
39
+ defaults : {
40
+ /** Additional CSS class names to be added to highlighter elements. */
41
+ 'class-name' : '',
42
+
43
+ /** First line number. */
44
+ 'first-line' : 1,
45
+
46
+ /**
47
+ * Pads line numbers. Possible values are:
48
+ *
49
+ * false - don't pad line numbers.
50
+ * true - automaticaly pad numbers with minimum required number of leading zeroes.
51
+ * [int] - length up to which pad line numbers.
52
+ */
53
+ 'pad-line-numbers' : true,
54
+
55
+ /** Lines to highlight. */
56
+ 'highlight' : null,
57
+
58
+ /** Enables or disables smart tabs. */
59
+ 'smart-tabs' : true,
60
+
61
+ /** Gets or sets tab size. */
62
+ 'tab-size' : 4,
63
+
64
+ /** Enables or disables gutter. */
65
+ 'gutter' : true,
66
+
67
+ /** Enables or disables toolbar. */
68
+ 'toolbar' : true,
69
+
70
+ /** Forces code view to be collapsed. */
71
+ 'collapse' : false,
72
+
73
+ /** Enables or disables automatic links. */
74
+ 'auto-links' : true,
75
+
76
+ /** Gets or sets light mode. Equavalent to turning off gutter and toolbar. */
77
+ 'light' : false,
78
+
79
+ /** Enables or disables automatic line wrapping. */
80
+ 'wrap-lines' : true,
81
+
82
+ 'html-script' : false
83
+ },
84
+
85
+ config : {
86
+ /** Enables use of <SCRIPT type="syntaxhighlighter" /> tags. */
87
+ useScriptTags : true,
88
+
89
+ /** Path to the copy to clipboard SWF file. */
90
+ clipboardSwf : null,
91
+
92
+ /** Width of an item in the toolbar. */
93
+ toolbarItemWidth : 16,
94
+
95
+ /** Height of an item in the toolbar. */
96
+ toolbarItemHeight : 16,
97
+
98
+ /** Blogger mode flag. */
99
+ bloggerMode : false,
100
+
101
+ stripBrs : false,
102
+
103
+ /** Name of the tag that SyntaxHighlighter will automatically look for. */
104
+ tagName : 'pre',
105
+
106
+ strings : {
107
+ expandSource : 'show source',
108
+ viewSource : 'view source',
109
+ copyToClipboard : 'copy to clipboard',
110
+ copyToClipboardConfirmation : 'The code is in your clipboard now',
111
+ print : 'print',
112
+ help : '?',
113
+ alert: 'SyntaxHighlighter\n\n',
114
+ noBrush : 'Can\'t find brush for: ',
115
+ brushNotHtmlScript : 'Brush wasn\'t configured for html-script option: ',
116
+
117
+ // this is populated by the build script
118
+ aboutDialog : '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>About SyntaxHighlighter</title></head><body style="font-family:Geneva,Arial,Helvetica,sans-serif;background-color:#fff;color:#000;font-size:1em;text-align:center;"><div style="text-align:center;margin-top:3em;"><div style="font-size:xx-large;">SyntaxHighlighter</div><div style="font-size:.75em;margin-bottom:4em;"><div>version 2.1.364 (October 15 2009)</div><div><a href="http://alexgorbatchev.com" target="_blank" style="color:#0099FF;text-decoration:none;">http://alexgorbatchev.com</a></div><div>If you like this script, please <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=2930402" style="color:#0099FF;text-decoration:none;">donate</a> to keep development active!</div></div><div>JavaScript code syntax highlighter.</div><div>Copyright 2004-2009 Alex Gorbatchev.</div></div></body></html>'
119
+ },
120
+
121
+ /** If true, output will show HTML produces instead. */
122
+ debug : false
123
+ },
124
+
125
+ /** Internal 'global' variables. */
126
+ vars : {
127
+ discoveredBrushes : null,
128
+ spaceWidth : null,
129
+ printFrame : null,
130
+ highlighters : {}
131
+ },
132
+
133
+ /** This object is populated by user included external brush files. */
134
+ brushes : {},
135
+
136
+ /** Common regular expressions. */
137
+ regexLib : {
138
+ multiLineCComments : /\/\*[\s\S]*?\*\//gm,
139
+ singleLineCComments : /\/\/.*$/gm,
140
+ singleLinePerlComments : /#.*$/gm,
141
+ doubleQuotedString : /"([^\\"\n]|\\.)*"/g,
142
+ singleQuotedString : /'([^\\'\n]|\\.)*'/g,
143
+ multiLineDoubleQuotedString : /"([^\\"]|\\.)*"/g,
144
+ multiLineSingleQuotedString : /'([^\\']|\\.)*'/g,
145
+ xmlComments : /(&lt;|<)!--[\s\S]*?--(&gt;|>)/gm,
146
+ url : /&lt;\w+:\/\/[\w-.\/?%&=@:;]*&gt;|\w+:\/\/[\w-.\/?%&=@:;]*/g,
147
+
148
+ /** <?= ?> tags. */
149
+ phpScriptTags : { left: /(&lt;|<)\?=?/g, right: /\?(&gt;|>)/g },
150
+
151
+ /** <%= %> tags. */
152
+ aspScriptTags : { left: /(&lt;|<)%=?/g, right: /%(&gt;|>)/g },
153
+
154
+ /** <script></script> tags. */
155
+ scriptScriptTags : { left: /(&lt;|<)\s*script.*?(&gt;|>)/gi, right: /(&lt;|<)\/\s*script\s*(&gt;|>)/gi }
156
+ },
157
+
158
+ toolbar : {
159
+ /**
160
+ * Creates new toolbar for a highlighter.
161
+ * @param {Highlighter} highlighter Target highlighter.
162
+ */
163
+ create : function(highlighter)
164
+ {
165
+ var div = document.createElement('DIV'),
166
+ items = sh.toolbar.items
167
+ ;
168
+
169
+ div.className = 'toolbar';
170
+
171
+ for (var name in items)
172
+ {
173
+ var constructor = items[name],
174
+ command = new constructor(highlighter),
175
+ element = command.create()
176
+ ;
177
+
178
+ highlighter.toolbarCommands[name] = command;
179
+
180
+ if (element == null)
181
+ continue;
182
+
183
+ if (typeof(element) == 'string')
184
+ element = sh.toolbar.createButton(element, highlighter.id, name);
185
+
186
+ element.className += 'item ' + name;
187
+ div.appendChild(element);
188
+ }
189
+
190
+ return div;
191
+ },
192
+
193
+ /**
194
+ * Create a standard anchor button for the toolbar.
195
+ * @param {String} label Label text to display.
196
+ * @param {String} highlighterId Highlighter ID that this button would belong to.
197
+ * @param {String} commandName Command name that would be executed.
198
+ * @return {Element} Returns an 'A' element.
199
+ */
200
+ createButton : function(label, highlighterId, commandName)
201
+ {
202
+ var a = document.createElement('a'),
203
+ style = a.style,
204
+ config = sh.config,
205
+ width = config.toolbarItemWidth,
206
+ height = config.toolbarItemHeight
207
+ ;
208
+
209
+ a.href = '#' + commandName;
210
+ a.title = label;
211
+ a.highlighterId = highlighterId;
212
+ a.commandName = commandName;
213
+ a.innerHTML = label;
214
+
215
+ if (isNaN(width) == false)
216
+ style.width = width + 'px';
217
+
218
+ if (isNaN(height) == false)
219
+ style.height = height + 'px';
220
+
221
+ a.onclick = function(e)
222
+ {
223
+ try
224
+ {
225
+ sh.toolbar.executeCommand(
226
+ this,
227
+ e || window.event,
228
+ this.highlighterId,
229
+ this.commandName
230
+ );
231
+ }
232
+ catch(e)
233
+ {
234
+ sh.utils.alert(e.message);
235
+ }
236
+
237
+ return false;
238
+ };
239
+
240
+ return a;
241
+ },
242
+
243
+ /**
244
+ * Executes a toolbar command.
245
+ * @param {Element} sender Sender element.
246
+ * @param {MouseEvent} event Original mouse event object.
247
+ * @param {String} highlighterId Highlighter DIV element ID.
248
+ * @param {String} commandName Name of the command to execute.
249
+ * @return {Object} Passes out return value from command execution.
250
+ */
251
+ executeCommand : function(sender, event, highlighterId, commandName, args)
252
+ {
253
+ var highlighter = sh.vars.highlighters[highlighterId],
254
+ command
255
+ ;
256
+
257
+ if (highlighter == null || (command = highlighter.toolbarCommands[commandName]) == null)
258
+ return null;
259
+
260
+ return command.execute(sender, event, args);
261
+ },
262
+
263
+ /** Collection of toolbar items. */
264
+ items : {
265
+ expandSource : function(highlighter)
266
+ {
267
+ this.create = function()
268
+ {
269
+ if (highlighter.getParam('collapse') != true)
270
+ return;
271
+
272
+ return sh.config.strings.expandSource;
273
+ };
274
+
275
+ this.execute = function(sender, event, args)
276
+ {
277
+ var div = highlighter.div;
278
+
279
+ sender.parentNode.removeChild(sender);
280
+ div.className = div.className.replace('collapsed', '');
281
+ };
282
+ },
283
+
284
+ /**
285
+ * Command to open a new window and display the original unformatted source code inside.
286
+ */
287
+ viewSource : function(highlighter)
288
+ {
289
+ this.create = function()
290
+ {
291
+ return sh.config.strings.viewSource;
292
+ };
293
+
294
+ this.execute = function(sender, event, args)
295
+ {
296
+ var code = sh.utils.fixInputString(highlighter.originalCode).replace(/</g, '&lt;'),
297
+ wnd = sh.utils.popup('', '_blank', 750, 400, 'location=0, resizable=1, menubar=0, scrollbars=1')
298
+ ;
299
+
300
+ code = sh.utils.unindent(code);
301
+
302
+ wnd.document.write('<pre>' + code + '</pre>');
303
+ wnd.document.close();
304
+ };
305
+ },
306
+
307
+ /**
308
+ * Command to copy the original source code in to the clipboard.
309
+ * Uses Flash method if <code>clipboardSwf</code> is configured.
310
+ */
311
+ copyToClipboard : function(highlighter)
312
+ {
313
+ var flashDiv, flashSwf,
314
+ highlighterId = highlighter.id
315
+ ;
316
+
317
+ this.create = function()
318
+ {
319
+ var config = sh.config;
320
+
321
+ // disable functionality if running locally
322
+ if (config.clipboardSwf == null)
323
+ return null;
324
+
325
+ function params(list)
326
+ {
327
+ var result = '';
328
+
329
+ for (var name in list)
330
+ result += "<param name='" + name + "' value='" + list[name] + "'/>";
331
+
332
+ return result;
333
+ };
334
+
335
+ function attributes(list)
336
+ {
337
+ var result = '';
338
+
339
+ for (var name in list)
340
+ result += " " + name + "='" + list[name] + "'";
341
+
342
+ return result;
343
+ };
344
+
345
+ var args1 = {
346
+ width : config.toolbarItemWidth,
347
+ height : config.toolbarItemHeight,
348
+ id : highlighterId + '_clipboard',
349
+ type : 'application/x-shockwave-flash',
350
+ title : sh.config.strings.copyToClipboard
351
+ },
352
+
353
+ // these arguments are used in IE's <param /> collection
354
+ args2 = {
355
+ allowScriptAccess : 'always',
356
+ wmode : 'transparent',
357
+ flashVars : 'highlighterId=' + highlighterId,
358
+ menu : 'false'
359
+ },
360
+ swf = config.clipboardSwf,
361
+ html
362
+ ;
363
+
364
+ if (/msie/i.test(navigator.userAgent))
365
+ {
366
+ html = '<object'
367
+ + attributes({
368
+ classid : 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000',
369
+ codebase : 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0'
370
+ })
371
+ + attributes(args1)
372
+ + '>'
373
+ + params(args2)
374
+ + params({ movie : swf })
375
+ + '</object>'
376
+ ;
377
+ }
378
+ else
379
+ {
380
+ html = '<embed'
381
+ + attributes(args1)
382
+ + attributes(args2)
383
+ + attributes({ src : swf })
384
+ + '/>'
385
+ ;
386
+ }
387
+
388
+ flashDiv = document.createElement('div');
389
+ flashDiv.innerHTML = html;
390
+
391
+ return flashDiv;
392
+ };
393
+
394
+ this.execute = function(sender, event, args)
395
+ {
396
+ var command = args.command;
397
+
398
+ switch (command)
399
+ {
400
+ case 'get':
401
+ var code = sh.utils.unindent(
402
+ sh.utils.fixInputString(highlighter.originalCode)
403
+ .replace(/&lt;/g, '<')
404
+ .replace(/&gt;/g, '>')
405
+ .replace(/&amp;/g, '&')
406
+ );
407
+
408
+ if(window.clipboardData)
409
+ // will fall through to the confirmation because there isn't a break
410
+ window.clipboardData.setData('text', code);
411
+ else
412
+ return sh.utils.unindent(code);
413
+
414
+ case 'ok':
415
+ sh.utils.alert(sh.config.strings.copyToClipboardConfirmation);
416
+ break;
417
+
418
+ case 'error':
419
+ sh.utils.alert(args.message);
420
+ break;
421
+ }
422
+ };
423
+ },
424
+
425
+ /** Command to print the colored source code. */
426
+ printSource : function(highlighter)
427
+ {
428
+ this.create = function()
429
+ {
430
+ return sh.config.strings.print;
431
+ };
432
+
433
+ this.execute = function(sender, event, args)
434
+ {
435
+ var iframe = document.createElement('IFRAME'),
436
+ doc = null
437
+ ;
438
+
439
+ // make sure there is never more than one hidden iframe created by SH
440
+ if (sh.vars.printFrame != null)
441
+ document.body.removeChild(sh.vars.printFrame);
442
+
443
+ sh.vars.printFrame = iframe;
444
+
445
+ // this hides the iframe
446
+ iframe.style.cssText = 'position:absolute;width:0px;height:0px;left:-500px;top:-500px;';
447
+
448
+ document.body.appendChild(iframe);
449
+ doc = iframe.contentWindow.document;
450
+
451
+ copyStyles(doc, window.document);
452
+ doc.write('<div class="' + highlighter.div.className.replace('collapsed', '') + ' printing">' + highlighter.div.innerHTML + '</div>');
453
+ doc.close();
454
+
455
+ iframe.contentWindow.focus();
456
+ iframe.contentWindow.print();
457
+
458
+ function copyStyles(destDoc, sourceDoc)
459
+ {
460
+ var links = sourceDoc.getElementsByTagName('link');
461
+
462
+ for(var i = 0; i < links.length; i++)
463
+ if(links[i].rel.toLowerCase() == 'stylesheet' && /shCore\.css$/.test(links[i].href))
464
+ destDoc.write('<link type="text/css" rel="stylesheet" href="' + links[i].href + '"></link>');
465
+ };
466
+ };
467
+ },
468
+
469
+ /** Command to display the about dialog window. */
470
+ about : function(highlighter)
471
+ {
472
+ this.create = function()
473
+ {
474
+ return sh.config.strings.help;
475
+ };
476
+
477
+ this.execute = function(sender, event)
478
+ {
479
+ var wnd = sh.utils.popup('', '_blank', 500, 250, 'scrollbars=0'),
480
+ doc = wnd.document
481
+ ;
482
+
483
+ doc.write(sh.config.strings.aboutDialog);
484
+ doc.close();
485
+ wnd.focus();
486
+ };
487
+ }
488
+ }
489
+ },
490
+
491
+ utils : {
492
+ /**
493
+ * Finds an index of element in the array.
494
+ * @ignore
495
+ * @param {Object} searchElement
496
+ * @param {Number} fromIndex
497
+ * @return {Number} Returns index of element if found; -1 otherwise.
498
+ */
499
+ indexOf : function(array, searchElement, fromIndex)
500
+ {
501
+ fromIndex = Math.max(fromIndex || 0, 0);
502
+
503
+ for (var i = fromIndex; i < array.length; i++)
504
+ if(array[i] == searchElement)
505
+ return i;
506
+
507
+ return -1;
508
+ },
509
+
510
+ /**
511
+ * Generates a unique element ID.
512
+ */
513
+ guid : function(prefix)
514
+ {
515
+ return prefix + Math.round(Math.random() * 1000000).toString();
516
+ },
517
+
518
+ /**
519
+ * Merges two objects. Values from obj2 override values in obj1.
520
+ * Function is NOT recursive and works only for one dimensional objects.
521
+ * @param {Object} obj1 First object.
522
+ * @param {Object} obj2 Second object.
523
+ * @return {Object} Returns combination of both objects.
524
+ */
525
+ merge: function(obj1, obj2)
526
+ {
527
+ var result = {}, name;
528
+
529
+ for (name in obj1)
530
+ result[name] = obj1[name];
531
+
532
+ for (name in obj2)
533
+ result[name] = obj2[name];
534
+
535
+ return result;
536
+ },
537
+
538
+ /**
539
+ * Attempts to convert string to boolean.
540
+ * @param {String} value Input string.
541
+ * @return {Boolean} Returns true if input was "true", false if input was "false" and value otherwise.
542
+ */
543
+ toBoolean: function(value)
544
+ {
545
+ switch (value)
546
+ {
547
+ case "true":
548
+ return true;
549
+
550
+ case "false":
551
+ return false;
552
+ }
553
+
554
+ return value;
555
+ },
556
+
557
+ /**
558
+ * Opens up a centered popup window.
559
+ * @param {String} url URL to open in the window.
560
+ * @param {String} name Popup name.
561
+ * @param {int} width Popup width.
562
+ * @param {int} height Popup height.
563
+ * @param {String} options window.open() options.
564
+ * @return {Window} Returns window instance.
565
+ */
566
+ popup: function(url, name, width, height, options)
567
+ {
568
+ var x = (screen.width - width) / 2,
569
+ y = (screen.height - height) / 2
570
+ ;
571
+
572
+ options += ', left=' + x +
573
+ ', top=' + y +
574
+ ', width=' + width +
575
+ ', height=' + height
576
+ ;
577
+ options = options.replace(/^,/, '');
578
+
579
+ var win = window.open(url, name, options);
580
+ win.focus();
581
+ return win;
582
+ },
583
+
584
+ /**
585
+ * Adds event handler to the target object.
586
+ * @param {Object} obj Target object.
587
+ * @param {String} type Name of the event.
588
+ * @param {Function} func Handling function.
589
+ */
590
+ addEvent: function(obj, type, func)
591
+ {
592
+ if (obj.attachEvent)
593
+ {
594
+ obj['e' + type + func] = func;
595
+ obj[type + func] = function()
596
+ {
597
+ obj['e' + type + func](window.event);
598
+ }
599
+ obj.attachEvent('on' + type, obj[type + func]);
600
+ }
601
+ else
602
+ {
603
+ obj.addEventListener(type, func, false);
604
+ }
605
+ },
606
+
607
+ /**
608
+ * Displays an alert.
609
+ * @param {String} str String to display.
610
+ */
611
+ alert: function(str)
612
+ {
613
+ alert(sh.config.strings.alert + str)
614
+ },
615
+
616
+ /**
617
+ * Finds a brush by its alias.
618
+ *
619
+ * @param {String} alias Brush alias.
620
+ * @param {Boolean} alert Suppresses the alert if false.
621
+ * @return {Brush} Returns bursh constructor if found, null otherwise.
622
+ */
623
+ findBrush: function(alias, alert)
624
+ {
625
+ var brushes = sh.vars.discoveredBrushes,
626
+ result = null
627
+ ;
628
+
629
+ if (brushes == null)
630
+ {
631
+ brushes = {};
632
+
633
+ // Find all brushes
634
+ for (var brush in sh.brushes)
635
+ {
636
+ var aliases = sh.brushes[brush].aliases;
637
+
638
+ if (aliases == null)
639
+ continue;
640
+
641
+ // keep the brush name
642
+ sh.brushes[brush].name = brush.toLowerCase();
643
+
644
+ for (var i = 0; i < aliases.length; i++)
645
+ brushes[aliases[i]] = brush;
646
+ }
647
+
648
+ sh.vars.discoveredBrushes = brushes;
649
+ }
650
+
651
+ result = sh.brushes[brushes[alias]];
652
+
653
+ if (result == null && alert != false)
654
+ sh.utils.alert(sh.config.strings.noBrush + alias);
655
+
656
+ return result;
657
+ },
658
+
659
+ /**
660
+ * Executes a callback on each line and replaces each line with result from the callback.
661
+ * @param {Object} str Input string.
662
+ * @param {Object} callback Callback function taking one string argument and returning a string.
663
+ */
664
+ eachLine: function(str, callback)
665
+ {
666
+ var lines = str.split('\n');
667
+
668
+ for (var i = 0; i < lines.length; i++)
669
+ lines[i] = callback(lines[i]);
670
+
671
+ return lines.join('\n');
672
+ },
673
+
674
+ /**
675
+ * This is a special trim which only removes first and last empty lines
676
+ * and doesn't affect valid leading space on the first line.
677
+ *
678
+ * @param {String} str Input string
679
+ * @return {String} Returns string without empty first and last lines.
680
+ */
681
+ trimFirstAndLastLines: function(str)
682
+ {
683
+ return str.replace(/^[ ]*[\n]+|[\n]*[ ]*$/g, '');
684
+ },
685
+
686
+ /**
687
+ * Parses key/value pairs into hash object.
688
+ *
689
+ * Understands the following formats:
690
+ * - name: word;
691
+ * - name: [word, word];
692
+ * - name: "string";
693
+ * - name: 'string';
694
+ *
695
+ * For example:
696
+ * name1: value; name2: [value, value]; name3: 'value'
697
+ *
698
+ * @param {String} str Input string.
699
+ * @return {Object} Returns deserialized object.
700
+ */
701
+ parseParams: function(str)
702
+ {
703
+ var match,
704
+ result = {},
705
+ arrayRegex = new XRegExp("^\\[(?<values>(.*?))\\]$"),
706
+ regex = new XRegExp(
707
+ "(?<name>[\\w-]+)" +
708
+ "\\s*:\\s*" +
709
+ "(?<value>" +
710
+ "[\\w-%#]+|" + // word
711
+ "\\[.*?\\]|" + // [] array
712
+ '".*?"|' + // "" string
713
+ "'.*?'" + // '' string
714
+ ")\\s*;?",
715
+ "g"
716
+ )
717
+ ;
718
+
719
+ while ((match = regex.exec(str)) != null)
720
+ {
721
+ var value = match.value
722
+ .replace(/^['"]|['"]$/g, '') // strip quotes from end of strings
723
+ ;
724
+
725
+ // try to parse array value
726
+ if (value != null && arrayRegex.test(value))
727
+ {
728
+ var m = arrayRegex.exec(value);
729
+ value = m.values.length > 0 ? m.values.split(/\s*,\s*/) : [];
730
+ }
731
+
732
+ result[match.name] = value;
733
+ }
734
+
735
+ return result;
736
+ },
737
+
738
+ /**
739
+ * Wraps each line of the string into <code/> tag with given style applied to it.
740
+ *
741
+ * @param {String} str Input string.
742
+ * @param {String} css Style name to apply to the string.
743
+ * @return {String} Returns input string with each line surrounded by <span/> tag.
744
+ */
745
+ decorate: function(str, css)
746
+ {
747
+ if (str == null || str.length == 0 || str == '\n')
748
+ return str;
749
+
750
+ str = str.replace(/</g, '&lt;');
751
+
752
+ // Replace two or more sequential spaces with &nbsp; leaving last space untouched.
753
+ str = str.replace(/ {2,}/g, function(m)
754
+ {
755
+ var spaces = '';
756
+
757
+ for (var i = 0; i < m.length - 1; i++)
758
+ spaces += '&nbsp;';
759
+
760
+ return spaces + ' ';
761
+ });
762
+
763
+ // Split each line and apply <span class="...">...</span> to them so that
764
+ // leading spaces aren't included.
765
+ if (css != null)
766
+ str = sh.utils.eachLine(str, function(line)
767
+ {
768
+ if (line.length == 0)
769
+ return '';
770
+
771
+ var spaces = '';
772
+
773
+ line = line.replace(/^(&nbsp;| )+/, function(s)
774
+ {
775
+ spaces = s;
776
+ return '';
777
+ });
778
+
779
+ if (line.length == 0)
780
+ return spaces;
781
+
782
+ return spaces + '<code class="' + css + '">' + line + '</code>';
783
+ });
784
+
785
+ return str;
786
+ },
787
+
788
+ /**
789
+ * Pads number with zeros until it's length is the same as given length.
790
+ *
791
+ * @param {Number} number Number to pad.
792
+ * @param {Number} length Max string length with.
793
+ * @return {String} Returns a string padded with proper amount of '0'.
794
+ */
795
+ padNumber : function(number, length)
796
+ {
797
+ var result = number.toString();
798
+
799
+ while (result.length < length)
800
+ result = '0' + result;
801
+
802
+ return result;
803
+ },
804
+
805
+ /**
806
+ * Measures width of a single space character.
807
+ * @return {Number} Returns width of a single space character.
808
+ */
809
+ measureSpace : function()
810
+ {
811
+ var container = document.createElement('div'),
812
+ span,
813
+ result = 0,
814
+ body = document.body,
815
+ id = sh.utils.guid('measureSpace'),
816
+
817
+ // variable names will be compressed, so it's better than a plain string
818
+ divOpen = '<div class="',
819
+ closeDiv = '</div>',
820
+ closeSpan = '</span>'
821
+ ;
822
+
823
+ // we have to duplicate highlighter nested structure in order to get an acurate space measurment
824
+ container.innerHTML =
825
+ divOpen + 'syntaxhighlighter">'
826
+ + divOpen + 'lines">'
827
+ + divOpen + 'line">'
828
+ + divOpen + 'content'
829
+ + '"><span class="block"><span id="' + id + '">&nbsp;' + closeSpan + closeSpan
830
+ + closeDiv
831
+ + closeDiv
832
+ + closeDiv
833
+ + closeDiv
834
+ ;
835
+
836
+ body.appendChild(container);
837
+ span = document.getElementById(id);
838
+
839
+ if (/opera/i.test(navigator.userAgent))
840
+ {
841
+ var style = window.getComputedStyle(span, null);
842
+ result = parseInt(style.getPropertyValue("width"));
843
+ }
844
+ else
845
+ {
846
+ result = span.offsetWidth;
847
+ }
848
+
849
+ body.removeChild(container);
850
+
851
+ return result;
852
+ },
853
+
854
+ /**
855
+ * Replaces tabs with spaces.
856
+ *
857
+ * @param {String} code Source code.
858
+ * @param {Number} tabSize Size of the tab.
859
+ * @return {String} Returns code with all tabs replaces by spaces.
860
+ */
861
+ processTabs : function(code, tabSize)
862
+ {
863
+ var tab = '';
864
+
865
+ for (var i = 0; i < tabSize; i++)
866
+ tab += ' ';
867
+
868
+ return code.replace(/\t/g, tab);
869
+ },
870
+
871
+ /**
872
+ * Replaces tabs with smart spaces.
873
+ *
874
+ * @param {String} code Code to fix the tabs in.
875
+ * @param {Number} tabSize Number of spaces in a column.
876
+ * @return {String} Returns code with all tabs replaces with roper amount of spaces.
877
+ */
878
+ processSmartTabs : function(code, tabSize)
879
+ {
880
+ var lines = code.split('\n'),
881
+ tab = '\t',
882
+ spaces = ''
883
+ ;
884
+
885
+ // Create a string with 1000 spaces to copy spaces from...
886
+ // It's assumed that there would be no indentation longer than that.
887
+ for (var i = 0; i < 50; i++)
888
+ spaces += ' '; // 20 spaces * 50
889
+
890
+ // This function inserts specified amount of spaces in the string
891
+ // where a tab is while removing that given tab.
892
+ function insertSpaces(line, pos, count)
893
+ {
894
+ return line.substr(0, pos)
895
+ + spaces.substr(0, count)
896
+ + line.substr(pos + 1, line.length) // pos + 1 will get rid of the tab
897
+ ;
898
+ };
899
+
900
+ // Go through all the lines and do the 'smart tabs' magic.
901
+ code = sh.utils.eachLine(code, function(line)
902
+ {
903
+ if (line.indexOf(tab) == -1)
904
+ return line;
905
+
906
+ var pos = 0;
907
+
908
+ while ((pos = line.indexOf(tab)) != -1)
909
+ {
910
+ // This is pretty much all there is to the 'smart tabs' logic.
911
+ // Based on the position within the line and size of a tab,
912
+ // calculate the amount of spaces we need to insert.
913
+ var spaces = tabSize - pos % tabSize;
914
+ line = insertSpaces(line, pos, spaces);
915
+ }
916
+
917
+ return line;
918
+ });
919
+
920
+ return code;
921
+ },
922
+
923
+ /**
924
+ * Performs various string fixes based on configuration.
925
+ */
926
+ fixInputString : function(str)
927
+ {
928
+ var br = /<br\s*\/?>|&lt;br\s*\/?&gt;/gi;
929
+
930
+ if (sh.config.bloggerMode == true)
931
+ str = str.replace(br, '\n');
932
+
933
+ if (sh.config.stripBrs == true)
934
+ str = str.replace(br, '');
935
+
936
+ return str;
937
+ },
938
+
939
+ /**
940
+ * Removes all white space at the begining and end of a string.
941
+ *
942
+ * @param {String} str String to trim.
943
+ * @return {String} Returns string without leading and following white space characters.
944
+ */
945
+ trim: function(str)
946
+ {
947
+ return str.replace(/^\s+|\s+$/g, '');
948
+ },
949
+
950
+ /**
951
+ * Unindents a block of text by the lowest common indent amount.
952
+ * @param {String} str Text to unindent.
953
+ * @return {String} Returns unindented text block.
954
+ */
955
+ unindent: function(str)
956
+ {
957
+ var lines = sh.utils.fixInputString(str).split('\n'),
958
+ indents = new Array(),
959
+ regex = /^\s*/,
960
+ min = 1000
961
+ ;
962
+
963
+ // go through every line and check for common number of indents
964
+ for (var i = 0; i < lines.length && min > 0; i++)
965
+ {
966
+ var line = lines[i];
967
+
968
+ if (sh.utils.trim(line).length == 0)
969
+ continue;
970
+
971
+ var matches = regex.exec(line);
972
+
973
+ // In the event that just one line doesn't have leading white space
974
+ // we can't unindent anything, so bail completely.
975
+ if (matches == null)
976
+ return str;
977
+
978
+ min = Math.min(matches[0].length, min);
979
+ }
980
+
981
+ // trim minimum common number of white space from the begining of every line
982
+ if (min > 0)
983
+ for (var i = 0; i < lines.length; i++)
984
+ lines[i] = lines[i].substr(min);
985
+
986
+ return lines.join('\n');
987
+ },
988
+
989
+ /**
990
+ * Callback method for Array.sort() which sorts matches by
991
+ * index position and then by length.
992
+ *
993
+ * @param {Match} m1 Left object.
994
+ * @param {Match} m2 Right object.
995
+ * @return {Number} Returns -1, 0 or -1 as a comparison result.
996
+ */
997
+ matchesSortCallback: function(m1, m2)
998
+ {
999
+ // sort matches by index first
1000
+ if(m1.index < m2.index)
1001
+ return -1;
1002
+ else if(m1.index > m2.index)
1003
+ return 1;
1004
+ else
1005
+ {
1006
+ // if index is the same, sort by length
1007
+ if(m1.length < m2.length)
1008
+ return -1;
1009
+ else if(m1.length > m2.length)
1010
+ return 1;
1011
+ }
1012
+
1013
+ return 0;
1014
+ },
1015
+
1016
+ /**
1017
+ * Executes given regular expression on provided code and returns all
1018
+ * matches that are found.
1019
+ *
1020
+ * @param {String} code Code to execute regular expression on.
1021
+ * @param {Object} regex Regular expression item info from <code>regexList</code> collection.
1022
+ * @return {Array} Returns a list of Match objects.
1023
+ */
1024
+ getMatches: function(code, regexInfo)
1025
+ {
1026
+ function defaultAdd(match, regexInfo)
1027
+ {
1028
+ return [new sh.Match(match[0], match.index, regexInfo.css)];
1029
+ };
1030
+
1031
+ var index = 0,
1032
+ match = null,
1033
+ result = [],
1034
+ func = regexInfo.func ? regexInfo.func : defaultAdd
1035
+ ;
1036
+
1037
+ while((match = regexInfo.regex.exec(code)) != null)
1038
+ result = result.concat(func(match, regexInfo));
1039
+
1040
+ return result;
1041
+ },
1042
+
1043
+ processUrls: function(code)
1044
+ {
1045
+ var lt = '&lt;',
1046
+ gt = '&gt;'
1047
+ ;
1048
+
1049
+ return code.replace(sh.regexLib.url, function(m)
1050
+ {
1051
+ var suffix = '', prefix = '';
1052
+
1053
+ // We include &lt; and &gt; in the URL for the common cases like <http://google.com>
1054
+ // The problem is that they get transformed into &lt;http://google.com&gt;
1055
+ // Where as &gt; easily looks like part of the URL string.
1056
+
1057
+ if (m.indexOf(lt) == 0)
1058
+ {
1059
+ prefix = lt;
1060
+ m = m.substring(lt.length);
1061
+ }
1062
+
1063
+ if (m.indexOf(gt) == m.length - gt.length)
1064
+ {
1065
+ m = m.substring(0, m.length - gt.length);
1066
+ suffix = gt;
1067
+ }
1068
+
1069
+ return prefix + '<a href="' + m + '">' + m + '</a>' + suffix;
1070
+ });
1071
+ },
1072
+
1073
+ /**
1074
+ * Finds all <SCRIPT TYPE="syntaxhighlighter" /> elements.
1075
+ * @return {Array} Returns array of all found SyntaxHighlighter tags.
1076
+ */
1077
+ getSyntaxHighlighterScriptTags: function()
1078
+ {
1079
+ var tags = document.getElementsByTagName('script'),
1080
+ result = []
1081
+ ;
1082
+
1083
+ for (var i = 0; i < tags.length; i++)
1084
+ if (tags[i].type == 'syntaxhighlighter')
1085
+ result.push(tags[i]);
1086
+
1087
+ return result;
1088
+ },
1089
+
1090
+ /**
1091
+ * Strips <![CDATA[]]> from <SCRIPT /> content because it should be used
1092
+ * there in most cases for XHTML compliance.
1093
+ * @param {String} original Input code.
1094
+ * @return {String} Returns code without leading <![CDATA[]]> tags.
1095
+ */
1096
+ stripCData: function(original)
1097
+ {
1098
+ var left = '<![CDATA[',
1099
+ right = ']]>',
1100
+ // for some reason IE inserts some leading blanks here
1101
+ copy = sh.utils.trim(original),
1102
+ changed = false
1103
+ ;
1104
+
1105
+ if (copy.indexOf(left) == 0)
1106
+ {
1107
+ copy = copy.substring(left.length);
1108
+ changed = true;
1109
+ }
1110
+
1111
+ if (copy.indexOf(right) == copy.length - right.length)
1112
+ {
1113
+ copy = copy.substring(0, copy.length - right.length);
1114
+ changed = true;
1115
+ }
1116
+
1117
+ return changed ? copy : original;
1118
+ }
1119
+ }, // end of utils
1120
+
1121
+ /**
1122
+ * Shorthand to highlight all elements on the page that are marked as
1123
+ * SyntaxHighlighter source code.
1124
+ *
1125
+ * @param {Object} globalParams Optional parameters which override element's
1126
+ * parameters. Only used if element is specified.
1127
+ *
1128
+ * @param {Object} element Optional element to highlight. If none is
1129
+ * provided, all elements in the current document
1130
+ * are highlighted.
1131
+ */
1132
+ highlight : function(globalParams, element)
1133
+ {
1134
+ function toArray(source)
1135
+ {
1136
+ var result = [];
1137
+
1138
+ for (var i = 0; i < source.length; i++)
1139
+ result.push(source[i]);
1140
+
1141
+ return result;
1142
+ };
1143
+
1144
+ var elements = element ? [element] : toArray(document.getElementsByTagName(sh.config.tagName)),
1145
+ propertyName = 'innerHTML',
1146
+ highlighter = null,
1147
+ conf = sh.config
1148
+ ;
1149
+
1150
+ // support for <SCRIPT TYPE="syntaxhighlighter" /> feature
1151
+ if (conf.useScriptTags)
1152
+ elements = elements.concat(sh.utils.getSyntaxHighlighterScriptTags());
1153
+
1154
+ if (elements.length === 0)
1155
+ return;
1156
+
1157
+ for (var i = 0; i < elements.length; i++)
1158
+ {
1159
+ var target = elements[i],
1160
+ params = sh.utils.parseParams(target.className),
1161
+ brushName,
1162
+ code,
1163
+ result
1164
+ ;
1165
+
1166
+ // local params take precedence over globals
1167
+ params = sh.utils.merge(globalParams, params);
1168
+ brushName = params['brush'];
1169
+
1170
+ if (brushName == null)
1171
+ continue;
1172
+
1173
+ // Instantiate a brush
1174
+ if (params['html-script'] == 'true' || sh.defaults['html-script'] == true)
1175
+ {
1176
+ highlighter = new sh.HtmlScript(brushName);
1177
+ brushName = 'htmlscript';
1178
+ }
1179
+ else
1180
+ {
1181
+ var brush = sh.utils.findBrush(brushName);
1182
+
1183
+ if (brush)
1184
+ {
1185
+ brushName = brush.name;
1186
+ highlighter = new brush();
1187
+ }
1188
+ else
1189
+ {
1190
+ continue;
1191
+ }
1192
+ }
1193
+
1194
+ code = target[propertyName];
1195
+
1196
+ // remove CDATA from <SCRIPT/> tags if it's present
1197
+ if (conf.useScriptTags)
1198
+ code = sh.utils.stripCData(code);
1199
+
1200
+ params['brush-name'] = brushName;
1201
+ highlighter.highlight(code, params);
1202
+
1203
+ result = highlighter.div;
1204
+
1205
+ if (sh.config.debug)
1206
+ {
1207
+ result = document.createElement('textarea');
1208
+ result.value = highlighter.div.innerHTML;
1209
+ result.style.width = '70em';
1210
+ result.style.height = '30em';
1211
+ }
1212
+
1213
+ target.parentNode.replaceChild(result, target);
1214
+ }
1215
+ },
1216
+
1217
+ /**
1218
+ * Main entry point for the SyntaxHighlighter.
1219
+ * @param {Object} params Optional params to apply to all highlighted elements.
1220
+ */
1221
+ all : function(params)
1222
+ {
1223
+ sh.utils.addEvent(
1224
+ window,
1225
+ 'load',
1226
+ function() { sh.highlight(params); }
1227
+ );
1228
+ }
1229
+ }; // end of sh
1230
+
1231
+ /**
1232
+ * Match object.
1233
+ */
1234
+ sh.Match = function(value, index, css)
1235
+ {
1236
+ this.value = value;
1237
+ this.index = index;
1238
+ this.length = value.length;
1239
+ this.css = css;
1240
+ this.brushName = null;
1241
+ };
1242
+
1243
+ sh.Match.prototype.toString = function()
1244
+ {
1245
+ return this.value;
1246
+ };
1247
+
1248
+ /**
1249
+ * Simulates HTML code with a scripting language embedded.
1250
+ *
1251
+ * @param {String} scriptBrushName Brush name of the scripting language.
1252
+ */
1253
+ sh.HtmlScript = function(scriptBrushName)
1254
+ {
1255
+ var brushClass = sh.utils.findBrush(scriptBrushName),
1256
+ scriptBrush,
1257
+ xmlBrush = new sh.brushes.Xml(),
1258
+ bracketsRegex = null
1259
+ ;
1260
+
1261
+ if (brushClass == null)
1262
+ return;
1263
+
1264
+ scriptBrush = new brushClass();
1265
+ this.xmlBrush = xmlBrush;
1266
+
1267
+ if (scriptBrush.htmlScript == null)
1268
+ {
1269
+ sh.utils.alert(sh.config.strings.brushNotHtmlScript + scriptBrushName);
1270
+ return;
1271
+ }
1272
+
1273
+ xmlBrush.regexList.push(
1274
+ { regex: scriptBrush.htmlScript.code, func: process }
1275
+ );
1276
+
1277
+ function offsetMatches(matches, offset)
1278
+ {
1279
+ for (var j = 0; j < matches.length; j++)
1280
+ matches[j].index += offset;
1281
+ }
1282
+
1283
+ function process(match, info)
1284
+ {
1285
+ var code = match.code,
1286
+ matches = [],
1287
+ regexList = scriptBrush.regexList,
1288
+ offset = match.index + match.left.length,
1289
+ htmlScript = scriptBrush.htmlScript,
1290
+ result
1291
+ ;
1292
+
1293
+ // add all matches from the code
1294
+ for (var i = 0; i < regexList.length; i++)
1295
+ {
1296
+ result = sh.utils.getMatches(code, regexList[i]);
1297
+ offsetMatches(result, offset);
1298
+ matches = matches.concat(result);
1299
+ }
1300
+
1301
+ // add left script bracket
1302
+ if (htmlScript.left != null && match.left != null)
1303
+ {
1304
+ result = sh.utils.getMatches(match.left, htmlScript.left);
1305
+ offsetMatches(result, match.index);
1306
+ matches = matches.concat(result);
1307
+ }
1308
+
1309
+ // add right script bracket
1310
+ if (htmlScript.right != null && match.right != null)
1311
+ {
1312
+ result = sh.utils.getMatches(match.right, htmlScript.right);
1313
+ offsetMatches(result, match.index + match[0].lastIndexOf(match.right));
1314
+ matches = matches.concat(result);
1315
+ }
1316
+
1317
+ for (var j = 0; j < matches.length; j++)
1318
+ matches[j].brushName = brushClass.name;
1319
+
1320
+ return matches;
1321
+ }
1322
+ };
1323
+
1324
+ sh.HtmlScript.prototype.highlight = function(code, params)
1325
+ {
1326
+ this.xmlBrush.highlight(code, params);
1327
+ this.div = this.xmlBrush.div;
1328
+ }
1329
+
1330
+ /**
1331
+ * Main Highlither class.
1332
+ * @constructor
1333
+ */
1334
+ sh.Highlighter = function()
1335
+ {
1336
+ };
1337
+
1338
+ sh.Highlighter.prototype = {
1339
+ /**
1340
+ * Returns value of the parameter passed to the highlighter.
1341
+ * @param {String} name Name of the parameter.
1342
+ * @param {Object} defaultValue Default value.
1343
+ * @return {Object} Returns found value or default value otherwise.
1344
+ */
1345
+ getParam : function(name, defaultValue)
1346
+ {
1347
+ var result = this.params[name];
1348
+ return sh.utils.toBoolean(result == null ? defaultValue : result);
1349
+ },
1350
+
1351
+ /**
1352
+ * Shortcut to document.createElement().
1353
+ * @param {String} name Name of the element to create (DIV, A, etc).
1354
+ * @return {HTMLElement} Returns new HTML element.
1355
+ */
1356
+ create: function(name)
1357
+ {
1358
+ return document.createElement(name);
1359
+ },
1360
+
1361
+ /**
1362
+ * Applies all regular expression to the code and stores all found
1363
+ * matches in the `this.matches` array.
1364
+ * @param {Array} regexList List of regular expressions.
1365
+ * @param {String} code Source code.
1366
+ * @return {Array} Returns list of matches.
1367
+ */
1368
+ findMatches: function(regexList, code)
1369
+ {
1370
+ var result = [];
1371
+
1372
+ if (regexList != null)
1373
+ for (var i = 0; i < regexList.length; i++)
1374
+ // BUG: length returns len+1 for array if methods added to prototype chain (oising@gmail.com)
1375
+ if (typeof (regexList[i]) == "object")
1376
+ result = result.concat(sh.utils.getMatches(code, regexList[i]));
1377
+
1378
+ // sort the matches
1379
+ return result.sort(sh.utils.matchesSortCallback);
1380
+ },
1381
+
1382
+ /**
1383
+ * Checks to see if any of the matches are inside of other matches.
1384
+ * This process would get rid of highligted strings inside comments,
1385
+ * keywords inside strings and so on.
1386
+ */
1387
+ removeNestedMatches: function()
1388
+ {
1389
+ var matches = this.matches;
1390
+
1391
+ // Optimized by Jose Prado (http://joseprado.com)
1392
+ for (var i = 0; i < matches.length; i++)
1393
+ {
1394
+ if (matches[i] === null)
1395
+ continue;
1396
+
1397
+ var itemI = matches[i],
1398
+ itemIEndPos = itemI.index + itemI.length
1399
+ ;
1400
+
1401
+ for (var j = i + 1; j < matches.length && matches[i] !== null; j++)
1402
+ {
1403
+ var itemJ = matches[j];
1404
+
1405
+ if (itemJ === null)
1406
+ continue;
1407
+ else if (itemJ.index > itemIEndPos)
1408
+ break;
1409
+ else if (itemJ.index == itemI.index && itemJ.length > itemI.length)
1410
+ this.matches[i] = null;
1411
+ else if (itemJ.index >= itemI.index && itemJ.index < itemIEndPos)
1412
+ this.matches[j] = null;
1413
+ }
1414
+ }
1415
+ },
1416
+
1417
+ /**
1418
+ * Splits block of text into individual DIV lines.
1419
+ * @param {String} code Code to highlight.
1420
+ * @return {String} Returns highlighted code in HTML form.
1421
+ */
1422
+ createDisplayLines : function(code)
1423
+ {
1424
+ var lines = code.split(/\n/g),
1425
+ firstLine = parseInt(this.getParam('first-line')),
1426
+ padLength = this.getParam('pad-line-numbers'),
1427
+ highlightedLines = this.getParam('highlight', []),
1428
+ hasGutter = this.getParam('gutter')
1429
+ ;
1430
+
1431
+ code = '';
1432
+
1433
+ if (padLength == true)
1434
+ padLength = (firstLine + lines.length - 1).toString().length;
1435
+ else if (isNaN(padLength) == true)
1436
+ padLength = 0;
1437
+
1438
+ for (var i = 0; i < lines.length; i++)
1439
+ {
1440
+ var line = lines[i],
1441
+ indent = /^(&nbsp;|\s)+/.exec(line),
1442
+ lineClass = 'alt' + (i % 2 == 0 ? 1 : 2),
1443
+ lineNumber = sh.utils.padNumber(firstLine + i, padLength),
1444
+ highlighted = sh.utils.indexOf(highlightedLines, (firstLine + i).toString()) != -1,
1445
+ spaces = null
1446
+ ;
1447
+
1448
+ if (indent != null)
1449
+ {
1450
+ spaces = indent[0].toString();
1451
+ line = line.substr(spaces.length);
1452
+ }
1453
+
1454
+ line = sh.utils.trim(line);
1455
+
1456
+ if (line.length == 0)
1457
+ line = '&nbsp;';
1458
+
1459
+ if (highlighted)
1460
+ lineClass += ' highlighted';
1461
+
1462
+ code +=
1463
+ '<div class="line ' + lineClass + '">'
1464
+ + '<table>'
1465
+ + '<tr>'
1466
+ + (hasGutter ? '<td class="number"><code>' + lineNumber + '</code></td>' : '')
1467
+ + '<td class="content">'
1468
+ + (spaces != null ? '<code class="spaces">' + spaces.replace(' ', '&nbsp;') + '</code>' : '')
1469
+ + line
1470
+ + '</td>'
1471
+ + '</tr>'
1472
+ + '</table>'
1473
+ + '</div>'
1474
+ ;
1475
+ }
1476
+
1477
+ return code;
1478
+ },
1479
+
1480
+ /**
1481
+ * Finds all matches in the source code.
1482
+ * @param {String} code Source code to process matches in.
1483
+ * @param {Array} matches Discovered regex matches.
1484
+ * @return {String} Returns formatted HTML with processed mathes.
1485
+ */
1486
+ processMatches: function(code, matches)
1487
+ {
1488
+ var pos = 0,
1489
+ result = '',
1490
+ decorate = sh.utils.decorate, // make an alias to save some bytes
1491
+ brushName = this.getParam('brush-name', '')
1492
+ ;
1493
+
1494
+ function getBrushNameCss(match)
1495
+ {
1496
+ var result = match ? (match.brushName || brushName) : brushName;
1497
+ return result ? result + ' ' : '';
1498
+ };
1499
+
1500
+ // Finally, go through the final list of matches and pull the all
1501
+ // together adding everything in between that isn't a match.
1502
+ for (var i = 0; i < matches.length; i++)
1503
+ {
1504
+ var match = matches[i],
1505
+ matchBrushName
1506
+ ;
1507
+
1508
+ if (match === null || match.length === 0)
1509
+ continue;
1510
+
1511
+ matchBrushName = getBrushNameCss(match);
1512
+
1513
+ result += decorate(code.substr(pos, match.index - pos), matchBrushName + 'plain')
1514
+ + decorate(match.value, matchBrushName + match.css)
1515
+ ;
1516
+
1517
+ pos = match.index + match.length;
1518
+ }
1519
+
1520
+ // don't forget to add whatever's remaining in the string
1521
+ result += decorate(code.substr(pos), getBrushNameCss() + 'plain');
1522
+
1523
+ return result;
1524
+ },
1525
+
1526
+ /**
1527
+ * Highlights the code and returns complete HTML.
1528
+ * @param {String} code Code to highlight.
1529
+ * @param {Object} params Parameters object.
1530
+ */
1531
+ highlight: function(code, params)
1532
+ {
1533
+ // using variables for shortcuts because JS compressor will shorten local variable names
1534
+ var conf = sh.config,
1535
+ vars = sh.vars,
1536
+ div,
1537
+ divClassName,
1538
+ tabSize,
1539
+ important = 'important'
1540
+ ;
1541
+
1542
+ this.params = {};
1543
+ this.div = null;
1544
+ this.lines = null;
1545
+ this.code = null;
1546
+ this.bar = null;
1547
+ this.toolbarCommands = {};
1548
+ this.id = sh.utils.guid('highlighter_');
1549
+
1550
+ // register this instance in the highlighters list
1551
+ vars.highlighters[this.id] = this;
1552
+
1553
+ if (code === null)
1554
+ code = '';
1555
+
1556
+ // local params take precedence over defaults
1557
+ this.params = sh.utils.merge(sh.defaults, params || {});
1558
+
1559
+ // process light mode
1560
+ if (this.getParam('light') == true)
1561
+ this.params.toolbar = this.params.gutter = false;
1562
+
1563
+ this.div = div = this.create('DIV');
1564
+ this.lines = this.create('DIV');
1565
+ this.lines.className = 'lines';
1566
+
1567
+ className = 'syntaxhighlighter';
1568
+ div.id = this.id;
1569
+
1570
+ // make collapsed
1571
+ if (this.getParam('collapse'))
1572
+ className += ' collapsed';
1573
+
1574
+ // disable gutter
1575
+ if (this.getParam('gutter') == false)
1576
+ className += ' nogutter';
1577
+
1578
+ // disable line wrapping
1579
+ if (this.getParam('wrap-lines') == false)
1580
+ this.lines.className += ' no-wrap';
1581
+
1582
+ // add custom user style name
1583
+ className += ' ' + this.getParam('class-name');
1584
+
1585
+ // add brush alias to the class name for custom CSS
1586
+ className += ' ' + this.getParam('brush-name');
1587
+
1588
+ div.className = className;
1589
+
1590
+ this.originalCode = code;
1591
+ this.code = sh.utils.trimFirstAndLastLines(code)
1592
+ .replace(/\r/g, ' ') // IE lets these buggers through
1593
+ ;
1594
+
1595
+ tabSize = this.getParam('tab-size');
1596
+
1597
+ // replace tabs with spaces
1598
+ this.code = this.getParam('smart-tabs') == true
1599
+ ? sh.utils.processSmartTabs(this.code, tabSize)
1600
+ : sh.utils.processTabs(this.code, tabSize)
1601
+ ;
1602
+
1603
+ this.code = sh.utils.unindent(this.code);
1604
+
1605
+ // add controls toolbar
1606
+ if (this.getParam('toolbar'))
1607
+ {
1608
+ this.bar = this.create('DIV');
1609
+ this.bar.className = 'bar';
1610
+ this.bar.appendChild(sh.toolbar.create(this));
1611
+ div.appendChild(this.bar);
1612
+
1613
+ // set up toolbar rollover
1614
+ var bar = this.bar;
1615
+ function hide() { bar.className = bar.className.replace('show', ''); }
1616
+ div.onmouseover = function() { hide(); bar.className += ' show'; };
1617
+ div.onmouseout = function() { hide(); }
1618
+ }
1619
+
1620
+ div.appendChild(this.lines);
1621
+
1622
+ this.matches = this.findMatches(this.regexList, this.code);
1623
+ this.removeNestedMatches();
1624
+
1625
+ code = this.processMatches(this.code, this.matches);
1626
+
1627
+ // finally, split all lines so that they wrap well
1628
+ code = this.createDisplayLines(sh.utils.trim(code));
1629
+
1630
+ // finally, process the links
1631
+ if (this.getParam('auto-links'))
1632
+ code = sh.utils.processUrls(code);
1633
+
1634
+ this.lines.innerHTML = code;
1635
+ },
1636
+
1637
+ /**
1638
+ * Converts space separated list of keywords into a regular expression string.
1639
+ * @param {String} str Space separated keywords.
1640
+ * @return {String} Returns regular expression string.
1641
+ */
1642
+ getKeywords: function(str)
1643
+ {
1644
+ str = str
1645
+ .replace(/^\s+|\s+$/g, '')
1646
+ .replace(/\s+/g, '|')
1647
+ ;
1648
+
1649
+ return '\\b(?:' + str + ')\\b';
1650
+ },
1651
+
1652
+ /**
1653
+ * Makes a brush compatible with the `html-script` functionality.
1654
+ * @param {Object} regexGroup Object containing `left` and `right` regular expressions.
1655
+ */
1656
+ forHtmlScript: function(regexGroup)
1657
+ {
1658
+ this.htmlScript = {
1659
+ left : { regex: regexGroup.left, css: 'script' },
1660
+ right : { regex: regexGroup.right, css: 'script' },
1661
+ code : new XRegExp(
1662
+ "(?<left>" + regexGroup.left.source + ")" +
1663
+ "(?<code>.*?)" +
1664
+ "(?<right>" + regexGroup.right.source + ")",
1665
+ "sgi"
1666
+ )
1667
+ };
1668
+ }
1669
+ }; // end of Highlighter
1670
+
1671
+ return sh;
1672
+ }(); // end of anonymous function
1673
+
1674
+
1675
+ /**
1676
+ * XRegExp 0.6.1
1677
+ * (c) 2007-2008 Steven Levithan
1678
+ * <http://stevenlevithan.com/regex/xregexp/>
1679
+ * MIT License
1680
+ *
1681
+ * provides an augmented, cross-browser implementation of regular expressions
1682
+ * including support for additional modifiers and syntax. several convenience
1683
+ * methods and a recursive-construct parser are also included.
1684
+ */
1685
+
1686
+ // prevent running twice, which would break references to native globals
1687
+ if (!window.XRegExp) {
1688
+ // anonymous function to avoid global variables
1689
+ (function () {
1690
+ // copy various native globals for reference. can't use the name ``native``
1691
+ // because it's a reserved JavaScript keyword.
1692
+ var real = {
1693
+ exec: RegExp.prototype.exec,
1694
+ match: String.prototype.match,
1695
+ replace: String.prototype.replace,
1696
+ split: String.prototype.split
1697
+ },
1698
+ /* regex syntax parsing with support for all the necessary cross-
1699
+ browser and context issues (escapings, character classes, etc.) */
1700
+ lib = {
1701
+ part: /(?:[^\\([#\s.]+|\\(?!k<[\w$]+>|[pP]{[^}]+})[\S\s]?|\((?=\?(?!#|<[\w$]+>)))+|(\()(?:\?(?:(#)[^)]*\)|<([$\w]+)>))?|\\(?:k<([\w$]+)>|[pP]{([^}]+)})|(\[\^?)|([\S\s])/g,
1702
+ replaceVar: /(?:[^$]+|\$(?![1-9$&`']|{[$\w]+}))+|\$(?:([1-9]\d*|[$&`'])|{([$\w]+)})/g,
1703
+ extended: /^(?:\s+|#.*)+/,
1704
+ quantifier: /^(?:[?*+]|{\d+(?:,\d*)?})/,
1705
+ classLeft: /&&\[\^?/g,
1706
+ classRight: /]/g
1707
+ },
1708
+ indexOf = function (array, item, from) {
1709
+ for (var i = from || 0; i < array.length; i++)
1710
+ if (array[i] === item) return i;
1711
+ return -1;
1712
+ },
1713
+ brokenExecUndef = /()??/.exec("")[1] !== undefined,
1714
+ plugins = {};
1715
+
1716
+ /**
1717
+ * Accepts a pattern and flags, returns a new, extended RegExp object.
1718
+ * differs from a native regex in that additional flags and syntax are
1719
+ * supported and browser inconsistencies are ameliorated.
1720
+ * @ignore
1721
+ */
1722
+ XRegExp = function (pattern, flags) {
1723
+ if (pattern instanceof RegExp) {
1724
+ if (flags !== undefined)
1725
+ throw TypeError("can't supply flags when constructing one RegExp from another");
1726
+ return pattern.addFlags(); // new copy
1727
+ }
1728
+
1729
+ var flags = flags || "",
1730
+ singleline = flags.indexOf("s") > -1,
1731
+ extended = flags.indexOf("x") > -1,
1732
+ hasNamedCapture = false,
1733
+ captureNames = [],
1734
+ output = [],
1735
+ part = lib.part,
1736
+ match, cc, len, index, regex;
1737
+
1738
+ part.lastIndex = 0; // in case the last XRegExp compilation threw an error (unbalanced character class)
1739
+
1740
+ while (match = real.exec.call(part, pattern)) {
1741
+ // comment pattern. this check must come before the capturing group check,
1742
+ // because both match[1] and match[2] will be non-empty.
1743
+ if (match[2]) {
1744
+ // keep tokens separated unless the following token is a quantifier
1745
+ if (!lib.quantifier.test(pattern.slice(part.lastIndex)))
1746
+ output.push("(?:)");
1747
+ // capturing group
1748
+ } else if (match[1]) {
1749
+ captureNames.push(match[3] || null);
1750
+ if (match[3])
1751
+ hasNamedCapture = true;
1752
+ output.push("(");
1753
+ // named backreference
1754
+ } else if (match[4]) {
1755
+ index = indexOf(captureNames, match[4]);
1756
+ // keep backreferences separate from subsequent literal numbers
1757
+ // preserve backreferences to named groups that are undefined at this point as literal strings
1758
+ output.push(index > -1 ?
1759
+ "\\" + (index + 1) + (isNaN(pattern.charAt(part.lastIndex)) ? "" : "(?:)") :
1760
+ match[0]
1761
+ );
1762
+ // unicode element (requires plugin)
1763
+ } else if (match[5]) {
1764
+ output.push(plugins.unicode ?
1765
+ plugins.unicode.get(match[5], match[0].charAt(1) === "P") :
1766
+ match[0]
1767
+ );
1768
+ // character class opening delimiter ("[" or "[^")
1769
+ // (non-native unicode elements are not supported within character classes)
1770
+ } else if (match[6]) {
1771
+ if (pattern.charAt(part.lastIndex) === "]") {
1772
+ // for cross-browser compatibility with ECMA-262 v3 behavior,
1773
+ // convert [] to (?!) and [^] to [\S\s].
1774
+ output.push(match[6] === "[" ? "(?!)" : "[\\S\\s]");
1775
+ part.lastIndex++;
1776
+ } else {
1777
+ // parse the character class with support for inner escapes and
1778
+ // ES4's infinitely nesting intersection syntax ([&&[^&&[]]]).
1779
+ cc = XRegExp.matchRecursive("&&" + pattern.slice(match.index), lib.classLeft, lib.classRight, "", {escapeChar: "\\"})[0];
1780
+ output.push(match[6] + cc + "]");
1781
+ part.lastIndex += cc.length + 1;
1782
+ }
1783
+ // dot ("."), pound sign ("#"), or whitespace character
1784
+ } else if (match[7]) {
1785
+ if (singleline && match[7] === ".") {
1786
+ output.push("[\\S\\s]");
1787
+ } else if (extended && lib.extended.test(match[7])) {
1788
+ len = real.exec.call(lib.extended, pattern.slice(part.lastIndex - 1))[0].length;
1789
+ // keep tokens separated unless the following token is a quantifier
1790
+ if (!lib.quantifier.test(pattern.slice(part.lastIndex - 1 + len)))
1791
+ output.push("(?:)");
1792
+ part.lastIndex += len - 1;
1793
+ } else {
1794
+ output.push(match[7]);
1795
+ }
1796
+ } else {
1797
+ output.push(match[0]);
1798
+ }
1799
+ }
1800
+
1801
+ regex = RegExp(output.join(""), real.replace.call(flags, /[sx]+/g, ""));
1802
+ regex._x = {
1803
+ source: pattern,
1804
+ captureNames: hasNamedCapture ? captureNames : null
1805
+ };
1806
+ return regex;
1807
+ };
1808
+
1809
+ /**
1810
+ * Barebones plugin support for now (intentionally undocumented)
1811
+ * @ignore
1812
+ * @param {Object} name
1813
+ * @param {Object} o
1814
+ */
1815
+ XRegExp.addPlugin = function (name, o) {
1816
+ plugins[name] = o;
1817
+ };
1818
+
1819
+ /**
1820
+ * Adds named capture support, with values returned as ``result.name``.
1821
+ *
1822
+ * Also fixes two cross-browser issues, following the ECMA-262 v3 spec:
1823
+ * - captured values for non-participating capturing groups should be returned
1824
+ * as ``undefined``, rather than the empty string.
1825
+ * - the regex's ``lastIndex`` should not be incremented after zero-length
1826
+ * matches.
1827
+ * @ignore
1828
+ */
1829
+ RegExp.prototype.exec = function (str) {
1830
+ var match = real.exec.call(this, str),
1831
+ name, i, r2;
1832
+ if (match) {
1833
+ // fix browsers whose exec methods don't consistently return
1834
+ // undefined for non-participating capturing groups
1835
+ if (brokenExecUndef && match.length > 1) {
1836
+ // r2 doesn't need /g or /y, but they shouldn't hurt
1837
+ r2 = new RegExp("^" + this.source + "$(?!\\s)", this.getNativeFlags());
1838
+ real.replace.call(match[0], r2, function () {
1839
+ for (i = 1; i < arguments.length - 2; i++) {
1840
+ if (arguments[i] === undefined) match[i] = undefined;
1841
+ }
1842
+ });
1843
+ }
1844
+ // attach named capture properties
1845
+ if (this._x && this._x.captureNames) {
1846
+ for (i = 1; i < match.length; i++) {
1847
+ name = this._x.captureNames[i - 1];
1848
+ if (name) match[name] = match[i];
1849
+ }
1850
+ }
1851
+ // fix browsers that increment lastIndex after zero-length matches
1852
+ if (this.global && this.lastIndex > (match.index + match[0].length))
1853
+ this.lastIndex--;
1854
+ }
1855
+ return match;
1856
+ };
1857
+ })(); // end anonymous function
1858
+ } // end if(!window.XRegExp)
1859
+
1860
+ /**
1861
+ * intentionally undocumented
1862
+ * @ignore
1863
+ */
1864
+ RegExp.prototype.getNativeFlags = function () {
1865
+ return (this.global ? "g" : "") +
1866
+ (this.ignoreCase ? "i" : "") +
1867
+ (this.multiline ? "m" : "") +
1868
+ (this.extended ? "x" : "") +
1869
+ (this.sticky ? "y" : "");
1870
+ };
1871
+
1872
+ /**
1873
+ * Accepts flags; returns a new XRegExp object generated by recompiling
1874
+ * the regex with the additional flags (may include non-native flags).
1875
+ * The original regex object is not altered.
1876
+ * @ignore
1877
+ */
1878
+ RegExp.prototype.addFlags = function (flags) {
1879
+ var regex = new XRegExp(this.source, (flags || "") + this.getNativeFlags());
1880
+ if (this._x) {
1881
+ regex._x = {
1882
+ source: this._x.source,
1883
+ captureNames: this._x.captureNames ? this._x.captureNames.slice(0) : null
1884
+ };
1885
+ }
1886
+ return regex;
1887
+ };
1888
+
1889
+ /**
1890
+ * Accepts a context object and string; returns the result of calling
1891
+ * ``exec`` with the provided string. the context is ignored but is
1892
+ * accepted for congruity with ``Function.prototype.call``.
1893
+ * @ignore
1894
+ */
1895
+ RegExp.prototype.call = function (context, str) {
1896
+ return this.exec(str);
1897
+ };
1898
+
1899
+ /**
1900
+ * Accepts a context object and arguments array; returns the result of
1901
+ * calling ``exec`` with the first value in the arguments array. the context
1902
+ * is ignored but is accepted for congruity with ``Function.prototype.apply``.
1903
+ * @ignore
1904
+ */
1905
+ RegExp.prototype.apply = function (context, args) {
1906
+ return this.exec(args[0]);
1907
+ };
1908
+
1909
+ /**
1910
+ * Accepts a pattern and flags; returns an XRegExp object. if the pattern
1911
+ * and flag combination has previously been cached, the cached copy is
1912
+ * returned, otherwise the new object is cached.
1913
+ * @ignore
1914
+ */
1915
+ XRegExp.cache = function (pattern, flags) {
1916
+ var key = "/" + pattern + "/" + (flags || "");
1917
+ return XRegExp.cache[key] || (XRegExp.cache[key] = new XRegExp(pattern, flags));
1918
+ };
1919
+
1920
+ /**
1921
+ * Accepts a string; returns the string with regex metacharacters escaped.
1922
+ * the returned string can safely be used within a regex to match a literal
1923
+ * string. escaped characters are [, ], {, }, (, ), -, *, +, ?, ., \, ^, $,
1924
+ * |, #, [comma], and whitespace.
1925
+ * @ignore
1926
+ */
1927
+ XRegExp.escape = function (str) {
1928
+ return str.replace(/[-[\]{}()*+?.\\^$|,#\s]/g, "\\$&");
1929
+ };
1930
+
1931
+ /**
1932
+ * Accepts a string to search, left and right delimiters as regex pattern
1933
+ * strings, optional regex flags (may include non-native s, x, and y flags),
1934
+ * and an options object which allows setting an escape character and changing
1935
+ * the return format from an array of matches to a two-dimensional array of
1936
+ * string parts with extended position data. returns an array of matches
1937
+ * (optionally with extended data), allowing nested instances of left and right
1938
+ * delimiters. use the g flag to return all matches, otherwise only the first
1939
+ * is returned. if delimiters are unbalanced within the subject data, an error
1940
+ * is thrown.
1941
+ *
1942
+ * This function admittedly pushes the boundaries of what can be accomplished
1943
+ * sensibly without a "real" parser. however, by doing so it provides flexible
1944
+ * and powerful recursive parsing capabilities with minimal code weight.
1945
+ *
1946
+ * Warning: the ``escapeChar`` option is considered experimental and might be
1947
+ * changed or removed in future versions of XRegExp.
1948
+ *
1949
+ * unsupported features:
1950
+ * - backreferences within delimiter patterns when using ``escapeChar``.
1951
+ * - although providing delimiters as regex objects adds the minor feature of
1952
+ * independent delimiter flags, it introduces other limitations and is only
1953
+ * intended to be done by the ``XRegExp`` constructor (which can't call
1954
+ * itself while building a regex).
1955
+ *
1956
+ * @ignore
1957
+ */
1958
+ XRegExp.matchRecursive = function (str, left, right, flags, options) {
1959
+ var options = options || {},
1960
+ escapeChar = options.escapeChar,
1961
+ vN = options.valueNames,
1962
+ flags = flags || "",
1963
+ global = flags.indexOf("g") > -1,
1964
+ ignoreCase = flags.indexOf("i") > -1,
1965
+ multiline = flags.indexOf("m") > -1,
1966
+ sticky = flags.indexOf("y") > -1,
1967
+ /* sticky mode has its own handling in this function, which means you
1968
+ can use flag "y" even in browsers which don't support it natively */
1969
+ flags = flags.replace(/y/g, ""),
1970
+ left = left instanceof RegExp ? (left.global ? left : left.addFlags("g")) : new XRegExp(left, "g" + flags),
1971
+ right = right instanceof RegExp ? (right.global ? right : right.addFlags("g")) : new XRegExp(right, "g" + flags),
1972
+ output = [],
1973
+ openTokens = 0,
1974
+ delimStart = 0,
1975
+ delimEnd = 0,
1976
+ lastOuterEnd = 0,
1977
+ outerStart, innerStart, leftMatch, rightMatch, escaped, esc;
1978
+
1979
+ if (escapeChar) {
1980
+ if (escapeChar.length > 1) throw SyntaxError("can't supply more than one escape character");
1981
+ if (multiline) throw TypeError("can't supply escape character when using the multiline flag");
1982
+ escaped = XRegExp.escape(escapeChar);
1983
+ /* Escape pattern modifiers:
1984
+ /g - not needed here
1985
+ /i - included
1986
+ /m - **unsupported**, throws error
1987
+ /s - handled by XRegExp when delimiters are provided as strings
1988
+ /x - handled by XRegExp when delimiters are provided as strings
1989
+ /y - not needed here; supported by other handling in this function
1990
+ */
1991
+ esc = new RegExp(
1992
+ "^(?:" + escaped + "[\\S\\s]|(?:(?!" + left.source + "|" + right.source + ")[^" + escaped + "])+)+",
1993
+ ignoreCase ? "i" : ""
1994
+ );
1995
+ }
1996
+
1997
+ while (true) {
1998
+ /* advance the starting search position to the end of the last delimiter match.
1999
+ a couple special cases are also covered:
2000
+ - if using an escape character, advance to the next delimiter's starting position,
2001
+ skipping any escaped characters
2002
+ - first time through, reset lastIndex in case delimiters were provided as regexes
2003
+ */
2004
+ left.lastIndex = right.lastIndex = delimEnd +
2005
+ (escapeChar ? (esc.exec(str.slice(delimEnd)) || [""])[0].length : 0);
2006
+
2007
+ leftMatch = left.exec(str);
2008
+ rightMatch = right.exec(str);
2009
+
2010
+ // only keep the result which matched earlier in the string
2011
+ if (leftMatch && rightMatch) {
2012
+ if (leftMatch.index <= rightMatch.index)
2013
+ rightMatch = null;
2014
+ else leftMatch = null;
2015
+ }
2016
+
2017
+ /* paths*:
2018
+ leftMatch | rightMatch | openTokens | result
2019
+ 1 | 0 | 1 | ...
2020
+ 1 | 0 | 0 | ...
2021
+ 0 | 1 | 1 | ...
2022
+ 0 | 1 | 0 | throw
2023
+ 0 | 0 | 1 | throw
2024
+ 0 | 0 | 0 | break
2025
+ * - does not include the sticky mode special case
2026
+ - the loop ends after the first completed match if not in global mode
2027
+ */
2028
+
2029
+ if (leftMatch || rightMatch) {
2030
+ delimStart = (leftMatch || rightMatch).index;
2031
+ delimEnd = (leftMatch ? left : right).lastIndex;
2032
+ } else if (!openTokens) {
2033
+ break;
2034
+ }
2035
+
2036
+ if (sticky && !openTokens && delimStart > lastOuterEnd)
2037
+ break;
2038
+
2039
+ if (leftMatch) {
2040
+ if (!openTokens++) {
2041
+ outerStart = delimStart;
2042
+ innerStart = delimEnd;
2043
+ }
2044
+ } else if (rightMatch && openTokens) {
2045
+ if (!--openTokens) {
2046
+ if (vN) {
2047
+ if (vN[0] && outerStart > lastOuterEnd)
2048
+ output.push([vN[0], str.slice(lastOuterEnd, outerStart), lastOuterEnd, outerStart]);
2049
+ if (vN[1]) output.push([vN[1], str.slice(outerStart, innerStart), outerStart, innerStart]);
2050
+ if (vN[2]) output.push([vN[2], str.slice(innerStart, delimStart), innerStart, delimStart]);
2051
+ if (vN[3]) output.push([vN[3], str.slice(delimStart, delimEnd), delimStart, delimEnd]);
2052
+ } else {
2053
+ output.push(str.slice(innerStart, delimStart));
2054
+ }
2055
+ lastOuterEnd = delimEnd;
2056
+ if (!global)
2057
+ break;
2058
+ }
2059
+ } else {
2060
+ // reset lastIndex in case delimiters were provided as regexes
2061
+ left.lastIndex = right.lastIndex = 0;
2062
+ throw Error("subject data contains unbalanced delimiters");
2063
+ }
2064
+
2065
+ // if the delimiter matched an empty string, advance delimEnd to avoid an infinite loop
2066
+ if (delimStart === delimEnd)
2067
+ delimEnd++;
2068
+ }
2069
+
2070
+ if (global && !sticky && vN && vN[0] && str.length > lastOuterEnd)
2071
+ output.push([vN[0], str.slice(lastOuterEnd), lastOuterEnd, str.length]);
2072
+
2073
+ // reset lastIndex in case delimiters were provided as regexes
2074
+ left.lastIndex = right.lastIndex = 0;
2075
+
2076
+ return output;
2077
+ };
2078
+ /**
2079
+ * SyntaxHighlighter
2080
+ * http://alexgorbatchev.com/
2081
+ *
2082
+ * SyntaxHighlighter is donationware. If you are using it, please donate.
2083
+ * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
2084
+ *
2085
+ * @version
2086
+ * 2.0.320 (May 03 2009)
2087
+ *
2088
+ * @copyright
2089
+ * Copyright (C) 2004-2009 Alex Gorbatchev.
2090
+ *
2091
+ * @license
2092
+ * This file is part of SyntaxHighlighter.
2093
+ *
2094
+ * SyntaxHighlighter is free software: you can redistribute it and/or modify
2095
+ * it under the terms of the GNU Lesser General Public License as published by
2096
+ * the Free Software Foundation, either version 3 of the License, or
2097
+ * (at your option) any later version.
2098
+ *
2099
+ * SyntaxHighlighter is distributed in the hope that it will be useful,
2100
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
2101
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2102
+ * GNU General Public License for more details.
2103
+ *
2104
+ * You should have received a copy of the GNU General Public License
2105
+ * along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>.
2106
+ */
2107
+ SyntaxHighlighter.brushes.Xml = function()
2108
+ {
2109
+ function process(match, regexInfo)
2110
+ {
2111
+ var constructor = SyntaxHighlighter.Match,
2112
+ code = match[0],
2113
+ tag = new XRegExp('(&lt;|<)[\\s\\/\\?]*(?<name>[:\\w-\\.]+)', 'xg').exec(code),
2114
+ result = []
2115
+ ;
2116
+
2117
+ if (match.attributes != null)
2118
+ {
2119
+ var attributes,
2120
+ regex = new XRegExp('(?<name> [\\w:\\-\\.]+)' +
2121
+ '\\s*=\\s*' +
2122
+ '(?<value> ".*?"|\'.*?\'|\\w+)',
2123
+ 'xg');
2124
+
2125
+ while ((attributes = regex.exec(code)) != null)
2126
+ {
2127
+ result.push(new constructor(attributes.name, match.index + attributes.index, 'color1'));
2128
+ result.push(new constructor(attributes.value, match.index + attributes.index + attributes[0].indexOf(attributes.value), 'string'));
2129
+ }
2130
+ }
2131
+
2132
+ if (tag != null)
2133
+ result.push(
2134
+ new constructor(tag.name, match.index + tag[0].indexOf(tag.name), 'keyword')
2135
+ );
2136
+
2137
+ return result;
2138
+ }
2139
+
2140
+ this.regexList = [
2141
+ { regex: new XRegExp('(\\&lt;|<)\\!\\[[\\w\\s]*?\\[(.|\\s)*?\\]\\](\\&gt;|>)', 'gm'), css: 'color2' }, // <![ ... [ ... ]]>
2142
+ { regex: new XRegExp('(\\&lt;|<)!--\\s*.*?\\s*--(\\&gt;|>)', 'gm'), css: 'comments' }, // <!-- ... -->
2143
+ { regex: new XRegExp('(&lt;|<)[\\s\\/\\?]*(\\w+)(?<attributes>.*?)[\\s\\/\\?]*(&gt;|>)', 'sg'), func: process }
2144
+ ];
2145
+ };
2146
+
2147
+ SyntaxHighlighter.brushes.Xml.prototype = new SyntaxHighlighter.Highlighter();
2148
+ SyntaxHighlighter.brushes.Xml.aliases = ['xml', 'xhtml', 'xslt', 'html', 'xhtml'];
2149
+ /**
2150
+ * SyntaxHighlighter
2151
+ * http://alexgorbatchev.com/
2152
+ *
2153
+ * SyntaxHighlighter is donationware. If you are using it, please donate.
2154
+ * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
2155
+ *
2156
+ * @version
2157
+ * 2.0.320 (May 03 2009)
2158
+ *
2159
+ * @copyright
2160
+ * Copyright (C) 2004-2009 Alex Gorbatchev.
2161
+ *
2162
+ * @license
2163
+ * This file is part of SyntaxHighlighter.
2164
+ *
2165
+ * SyntaxHighlighter is free software: you can redistribute it and/or modify
2166
+ * it under the terms of the GNU Lesser General Public License as published by
2167
+ * the Free Software Foundation, either version 3 of the License, or
2168
+ * (at your option) any later version.
2169
+ *
2170
+ * SyntaxHighlighter is distributed in the hope that it will be useful,
2171
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
2172
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2173
+ * GNU General Public License for more details.
2174
+ *
2175
+ * You should have received a copy of the GNU General Public License
2176
+ * along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>.
2177
+ */
2178
+ SyntaxHighlighter.brushes.JScript = function()
2179
+ {
2180
+ var keywords = 'break case catch continue ' +
2181
+ 'default delete do else false ' +
2182
+ 'for function if in instanceof ' +
2183
+ 'new null return super switch ' +
2184
+ 'this throw true try typeof var while with'
2185
+ ;
2186
+
2187
+ this.regexList = [
2188
+ { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
2189
+ { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
2190
+ { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings
2191
+ { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings
2192
+ { regex: /\s*#.*/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion
2193
+ { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // keywords
2194
+ ];
2195
+
2196
+ this.forHtmlScript(SyntaxHighlighter.regexLib.scriptScriptTags);
2197
+ };
2198
+
2199
+ SyntaxHighlighter.brushes.JScript.prototype = new SyntaxHighlighter.Highlighter();
2200
+ SyntaxHighlighter.brushes.JScript.aliases = ['js', 'jscript', 'javascript'];
2201
+
2202
+
2203
+ SyntaxHighlighter.config.clipboardSwf = 'syntax/clipboard.swf';
2204
+ $(function () {
2205
+ var divs = $([]);
2206
+ $("#container .source").each(function () {
2207
+ var code = $(this).html().replace(/</g,'&lt;').replace(/>/g,'&gt;'),
2208
+ div = $('<div class="code"><pre class="brush:' + ( $(this).is("script") ? 'js' : 'xml' ) + ';">' + code + '</pre></div>'),
2209
+ demo = $(this).prevAll(".demo:eq(0)");
2210
+ $(this).after(div);
2211
+ if(!$(this).hasClass("below")) divs = divs.add(div);
2212
+ });
2213
+ SyntaxHighlighter.all();
2214
+
2215
+ setTimeout((function (divs) {
2216
+ return function () {
2217
+ divs.each(function () {
2218
+ var div = $(this),
2219
+ demo = $(this).prevAll(".demo:eq(0)"),
2220
+ h = false;
2221
+ var h = Math.max(demo[0].offsetHeight, div[0].offsetHeight);
2222
+ if(h) {
2223
+ if(h < 198) h = 198;
2224
+ div.height(h);
2225
+ demo.height(h);
2226
+ }
2227
+ });
2228
+ }
2229
+ })(divs), 500);
2230
+
2231
+ // $(".panel").hide().prev().click(function () { $(this).next().toggle(); }).css("cursor","pointer");
2232
+ });