iqvoc 4.12.1 → 4.13.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (977) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +14 -0
  3. data/Gemfile +26 -42
  4. data/Gemfile.lock +372 -340
  5. data/README.md +3 -3
  6. data/{vendor → app}/assets/images/ajax-loader.gif +0 -0
  7. data/{vendor → app}/assets/images/treeview-default-line.gif +0 -0
  8. data/app/assets/javascripts/framework.js +5 -9
  9. data/app/assets/javascripts/iqvoc/autocomplete.js +2 -0
  10. data/app/assets/javascripts/iqvoc/concept_mapping_manager.js +141 -123
  11. data/app/assets/javascripts/iqvoc/create_note.js +52 -0
  12. data/app/assets/javascripts/iqvoc/debounce.js +21 -0
  13. data/app/assets/javascripts/iqvoc/{entityselect.js.erb → entityselect.js} +7 -5
  14. data/app/assets/javascripts/iqvoc/entityselect_qualified.js +51 -0
  15. data/app/assets/javascripts/iqvoc/federated_concept_mapper.js +126 -56
  16. data/app/assets/javascripts/iqvoc/iqvoc.js +16 -115
  17. data/app/assets/javascripts/iqvoc/label_resolver.js +35 -30
  18. data/app/assets/javascripts/iqvoc/langselect.js +2 -2
  19. data/app/assets/javascripts/iqvoc/manifest.js +11 -12
  20. data/app/assets/javascripts/iqvoc/treeview.js +227 -228
  21. data/app/assets/javascripts/manifest.js +2 -2
  22. data/app/assets/stylesheets/_framework.scss +3 -4
  23. data/app/assets/stylesheets/iqvoc/{settings/_bootstrap.scss → _bootstrap_overrides.scss} +54 -6
  24. data/app/assets/stylesheets/iqvoc/_manifest.scss +15 -17
  25. data/app/assets/stylesheets/iqvoc/components/_components.scss +31 -50
  26. data/app/assets/stylesheets/iqvoc/components/_entity_select.scss +0 -1
  27. data/app/assets/stylesheets/iqvoc/components/_label-list.scss +3 -3
  28. data/app/assets/stylesheets/iqvoc/components/_modals.scss +3 -5
  29. data/app/assets/stylesheets/iqvoc/components/_notes.scss +5 -0
  30. data/app/assets/stylesheets/iqvoc/components/_onebox.scss +18 -0
  31. data/app/assets/stylesheets/iqvoc/components/_sidebars.scss +6 -2
  32. data/app/assets/stylesheets/iqvoc/components/_simplete.scss +37 -0
  33. data/app/assets/stylesheets/iqvoc/components/{_treeview.scss.erb → _treeview.scss} +11 -3
  34. data/app/assets/stylesheets/iqvoc/components/typeahead.scss +4 -2
  35. data/app/assets/stylesheets/iqvoc/settings/_bootstrap-variables.scss +1 -853
  36. data/app/assets/stylesheets/iqvoc/settings/_fonts.scss +35 -35
  37. data/app/assets/stylesheets/iqvoc/settings/_manifest.scss +4 -0
  38. data/app/assets/stylesheets/iqvoc/{mixins → settings}/_mixins.scss +4 -0
  39. data/app/assets/stylesheets/{manifest.css.scss → manifest.scss} +1 -1
  40. data/app/controllers/collections_controller.rb +6 -3
  41. data/app/controllers/concepts/alphabetical_controller.rb +18 -16
  42. data/app/controllers/concepts/expired_controller.rb +9 -10
  43. data/app/controllers/concepts/hierarchical_controller.rb +1 -3
  44. data/app/controllers/concepts/scheme_controller.rb +4 -1
  45. data/app/controllers/concepts/untranslated_controller.rb +1 -1
  46. data/app/controllers/concepts/versions_controller.rb +1 -0
  47. data/app/controllers/concepts_controller.rb +4 -0
  48. data/app/controllers/concerns/controller_extensions.rb +37 -3
  49. data/app/controllers/errors_controller.rb +8 -0
  50. data/app/controllers/exports_controller.rb +1 -1
  51. data/app/controllers/frontpage_controller.rb +8 -1
  52. data/app/controllers/hierarchy_controller.rb +7 -1
  53. data/app/controllers/imports_controller.rb +1 -1
  54. data/app/controllers/rdf_controller.rb +3 -0
  55. data/app/controllers/search_results_controller.rb +7 -1
  56. data/app/controllers/user_sessions_controller.rb +5 -3
  57. data/app/controllers/users_controller.rb +2 -2
  58. data/app/helpers/application_helper.rb +1 -1
  59. data/app/helpers/concepts_helper.rb +2 -1
  60. data/app/helpers/dashboard_helper.rb +6 -2
  61. data/app/helpers/form_helper.rb +1 -1
  62. data/app/helpers/navigation_helper.rb +20 -9
  63. data/app/helpers/rdf_helper.rb +14 -0
  64. data/app/helpers/search_results_helper.rb +1 -1
  65. data/app/models/ability.rb +3 -0
  66. data/app/models/abstract_user.rb +19 -7
  67. data/app/models/application_record.rb +3 -0
  68. data/app/models/collection/base.rb +9 -9
  69. data/app/models/collection/member/base.rb +6 -3
  70. data/app/models/concept/base.rb +102 -32
  71. data/app/models/concept/relation/base.rb +3 -3
  72. data/app/models/concept/skos/base.rb +10 -0
  73. data/app/models/concerns/search_extension.rb +1 -1
  74. data/app/models/concerns/versioning.rb +11 -4
  75. data/app/models/configuration_setting.rb +1 -1
  76. data/app/models/dataset/iqvoc_dataset.rb +3 -2
  77. data/app/models/export.rb +2 -2
  78. data/app/models/import.rb +1 -1
  79. data/app/models/label/base.rb +26 -7
  80. data/app/models/labeling/base.rb +1 -1
  81. data/app/models/labeling/skos/alt_label.rb +4 -0
  82. data/app/models/labeling/skos/base.rb +1 -1
  83. data/app/models/labeling/skos/hidden_label.rb +2 -2
  84. data/app/models/match/base.rb +5 -3
  85. data/app/models/notation/base.rb +4 -1
  86. data/app/models/note/annotated/base.rb +1 -1
  87. data/app/models/note/base.rb +23 -5
  88. data/app/views/collections/_data.html.erb +16 -2
  89. data/app/views/collections/_form.html.erb +2 -2
  90. data/app/views/collections/_sidebar.html.erb +16 -8
  91. data/app/views/collections/show_published.html.erb +4 -4
  92. data/app/views/collections/show_unpublished.html.erb +6 -6
  93. data/app/views/concepts/_form.html.erb +2 -3
  94. data/app/views/concepts/alphabetical/_search_result.html.erb +10 -11
  95. data/app/views/concepts/alphabetical/index.html.erb +7 -2
  96. data/app/views/concepts/expired/index.html.erb +10 -5
  97. data/app/views/concepts/glance.html.erb +5 -4
  98. data/app/views/concepts/scheme/edit.html.erb +1 -1
  99. data/app/views/concepts/scheme/show.html.erb +2 -2
  100. data/app/views/concepts/scheme/show.iqrdf +1 -6
  101. data/app/views/concepts/show_published.html.erb +4 -4
  102. data/app/views/concepts/show_unpublished.html.erb +6 -6
  103. data/app/views/concepts/sidebars/_plural.html.erb +7 -2
  104. data/app/views/concepts/sidebars/_singular.html.erb +12 -7
  105. data/app/views/dashboard/_sidebar.html.erb +3 -0
  106. data/app/views/dashboard/_table.html.erb +20 -9
  107. data/app/views/dashboard/glance.html.erb +5 -4
  108. data/app/views/dashboard/index.html.erb +4 -1
  109. data/app/views/errors/access_denied.html.erb +17 -2
  110. data/app/views/errors/not_found.html.erb +17 -3
  111. data/app/views/errors/server_error.html.erb +38 -0
  112. data/app/views/frontpage/index.html.erb +28 -7
  113. data/app/views/instance_configuration/index.html.erb +4 -4
  114. data/app/views/kaminari/_first_page.html.erb +13 -0
  115. data/app/views/kaminari/_gap.html.erb +10 -0
  116. data/app/views/kaminari/_last_page.html.erb +13 -0
  117. data/app/views/kaminari/_next_page.html.erb +13 -0
  118. data/app/views/kaminari/_page.html.erb +18 -0
  119. data/app/views/kaminari/_paginator.html.erb +25 -0
  120. data/app/views/kaminari/_prev_page.html.erb +13 -0
  121. data/app/views/layouts/_controls.html.erb +30 -27
  122. data/app/views/layouts/_navigation.html.erb +15 -15
  123. data/app/views/layouts/_sections.html.erb +3 -1
  124. data/app/views/layouts/_user_navigation.html.erb +24 -34
  125. data/app/views/layouts/application.html.erb +41 -41
  126. data/app/views/pages/components.html.erb +5 -5
  127. data/app/views/pages/version.html.erb +12 -14
  128. data/app/views/partials/collection/_new_link_base.html.erb +5 -3
  129. data/app/views/partials/concept/_new_link_base.html.erb +5 -3
  130. data/app/views/partials/labeling/skos/_edit_base.html.erb +3 -1
  131. data/app/views/partials/match/_edit_base.html.erb +1 -1
  132. data/app/views/partials/notation/_edit_base.html.erb +1 -1
  133. data/app/views/partials/note/_edit_base.html.erb +19 -6
  134. data/app/views/partials/note/_note.html.erb +1 -1
  135. data/app/views/partials/note/_search_result.html.erb +1 -1
  136. data/app/views/partials/note/skos/_edit_change_note.html.erb +1 -0
  137. data/app/views/partials/note/skos/change_note/_search_result.html.erb +1 -1
  138. data/app/views/partials/note/skos/definition/_search_result.html.erb +1 -1
  139. data/app/views/search_results/_form.html.erb +4 -4
  140. data/app/views/search_results/_result_list.html.erb +15 -0
  141. data/app/views/search_results/_sidebar.html.erb +2 -0
  142. data/app/views/search_results/index.html.erb +1 -11
  143. data/app/views/search_results/index.iqrdf +2 -2
  144. data/app/views/search_results/sections/_change_note.html.erb +8 -8
  145. data/app/views/search_results/sections/_collection.html.erb +2 -2
  146. data/app/views/search_results/sections/_datasets.html.erb +9 -6
  147. data/app/views/search_results/sections/_klass.html.erb +2 -2
  148. data/app/views/search_results/sections/_languages.html.erb +11 -8
  149. data/app/views/search_results/sections/_mode.html.erb +2 -2
  150. data/app/views/search_results/sections/_note.html.erb +1 -1
  151. data/app/views/search_results/sections/_terms.html.erb +10 -11
  152. data/app/views/search_results/sections/_type.html.erb +14 -11
  153. data/app/views/triplestore_sync/index.html.erb +1 -1
  154. data/app/views/users/_form.html.erb +3 -1
  155. data/app/views/users/index.html.erb +8 -5
  156. data/config/application.rb +19 -32
  157. data/config/boot.rb +2 -17
  158. data/config/cable.yml +10 -0
  159. data/config/database.yml +12 -11
  160. data/config/database.yml.postgresql +14 -12
  161. data/config/engine.rb +4 -10
  162. data/config/environment.rb +4 -20
  163. data/config/environments/heroku.rb +0 -13
  164. data/config/initializers/apipie.rb +2 -0
  165. data/config/initializers/application_controller_renderer.rb +8 -0
  166. data/config/initializers/backtrace_silencers.rb +0 -16
  167. data/config/initializers/content_security_policy.rb +25 -0
  168. data/config/initializers/cookies_serializer.rb +2 -0
  169. data/config/initializers/delayed_job.rb +0 -1
  170. data/config/initializers/inflections.rb +0 -16
  171. data/config/initializers/iqvoc.rb +0 -2
  172. data/config/initializers/linked_data.rb +5 -0
  173. data/config/initializers/mime_types.rb +0 -16
  174. data/config/initializers/new_framework_defaults_5_1.rb +14 -0
  175. data/config/initializers/session_store.rb +0 -16
  176. data/config/initializers/sqlite3_booleans.rb +1 -0
  177. data/config/initializers/wrap_parameters.rb +2 -2
  178. data/config/locales/activerecord.de.yml +8 -7
  179. data/config/locales/activerecord.en.yml +2 -0
  180. data/config/locales/de.yml +25 -17
  181. data/config/locales/en.yml +15 -3
  182. data/config/puma.rb +37 -0
  183. data/config/routes.rb +3 -0
  184. data/config/secrets.yml +24 -0
  185. data/config/storage.yml +34 -0
  186. data/db/migrate/20100927101502_create_schema.rb +1 -1
  187. data/db/migrate/20101125141218_add_collection_tables.rb +1 -1
  188. data/db/migrate/20101129161528_add_type_to_collections.rb +1 -1
  189. data/db/migrate/20101202094602_add_origin_to_collections.rb +1 -1
  190. data/db/migrate/20101202135420_rename_collection_contents_to_collection_members.rb +1 -1
  191. data/db/migrate/20101208103531_add_type_to_collection_contents.rb +1 -1
  192. data/db/migrate/20101210153916_add_indexes_to_collections.rb +1 -1
  193. data/db/migrate/20110204121244_create_collection_labels.rb +1 -1
  194. data/db/migrate/20110208084250_change_origin_lengths.rb +1 -1
  195. data/db/migrate/20110328124300_discard_collection_specifics.rb +1 -1
  196. data/db/migrate/20110408120357_remove_classifications_and_classifiers.rb +1 -1
  197. data/db/migrate/20110408120740_remove_xl_specfic_stuff.rb +1 -1
  198. data/db/migrate/20110420133640_change_value_in_notes.rb +1 -1
  199. data/db/migrate/20110427120534_add_published_at_to_labels.rb +1 -1
  200. data/db/migrate/20110510162719_use_mono_hierarchy_instead_of_poly_hierarchy.rb +1 -1
  201. data/db/migrate/20110512132624_extend_notes_value_field_length.rb +1 -1
  202. data/db/migrate/20110525103100_separate_note_annotation_predicates.rb +1 -1
  203. data/db/migrate/20110615134040_change_umt_note_annotations_to_dct.rb +1 -1
  204. data/db/migrate/20120119000000_create_configuration_settings.rb +1 -1
  205. data/db/migrate/20120201120736_add_top_term_to_concepts.rb +1 -1
  206. data/db/migrate/20120326102037_add_rank_to_concept_relations.rb +1 -1
  207. data/db/migrate/20130227145825_fix_collection_type.rb +1 -1
  208. data/db/migrate/20130315093255_add_notations.rb +1 -1
  209. data/db/migrate/20130315141952_add_indexes_to_notations.rb +1 -1
  210. data/db/migrate/20130418093837_add_language_to_note_annotations.rb +1 -1
  211. data/db/migrate/20130502151221_fix_collection_member_types.rb +1 -1
  212. data/db/migrate/20130508103137_adjust_note_languages_setting.rb +2 -2
  213. data/db/migrate/20131220134356_create_delayed_jobs.rb +1 -1
  214. data/db/migrate/20131220144601_create_imports.rb +1 -1
  215. data/db/migrate/20140423095147_create_exports.rb +1 -1
  216. data/db/migrate/20140425130615_add_fk_indexes_to_exports_and_imports.rb +1 -1
  217. data/db/migrate/20140505144919_add_import_file_to_imports.rb +1 -1
  218. data/db/migrate/20140506073428_add_missing_imports_attributes.rb +1 -1
  219. data/db/migrate/20140506133619_add_namespace_to_exports.rb +1 -1
  220. data/db/migrate/20140730132113_add_type_to_users.rb +1 -1
  221. data/db/migrate/20140807072457_create_job_relations.rb +1 -1
  222. data/db/migrate/20140807123413_add_response_error_to_job_relation.rb +1 -1
  223. data/db/migrate/20141204151558_add_foreign_key_constraints.rb +1 -1
  224. data/db/migrate/20150316103756_delayed_jobs_optimizations.rb +1 -1
  225. data/db/migrate/20150317162953_drop_job_relation.rb +1 -1
  226. data/db/migrate/20170608093748_extend_job_output_log.rb +1 -1
  227. data/db/migrate/20170626074649_add_note_annotations_index.rb +1 -1
  228. data/db/migrate/20180430163647_utf8mb4_conversion.rb +1 -1
  229. data/db/migrate/20180525135715_fix_note_annotations_index.rb +1 -1
  230. data/db/migrate/20190403133600_change_collation.rb +1 -1
  231. data/db/migrate/20200220134024_add_position_to_notes.rb +5 -0
  232. data/db/migrate/20200529053158_extend_users.rb +14 -0
  233. data/db/migrate/20200901143030_add_collection_type_index.rb +5 -0
  234. data/db/schema.rb +120 -123
  235. data/iqvoc.gemspec +15 -13
  236. data/lib/iqvoc/configuration/core.rb +1 -3
  237. data/lib/iqvoc/configuration/navigation.rb +6 -0
  238. data/lib/iqvoc/environments/development.rb +29 -47
  239. data/lib/iqvoc/environments/production.rb +37 -30
  240. data/lib/iqvoc/environments/test.rb +11 -9
  241. data/lib/iqvoc/version.rb +1 -1
  242. data/lib/tasks/cleanup.rake +37 -0
  243. data/lib/tasks/db.rake +32 -0
  244. data/public/assets/fonts/FiraMono-Regular-0b6138c5b386dc9125473fd851926f29.ttf +0 -0
  245. data/public/assets/fonts/FiraMono-Regular-690950e8d89c92cba41eeeb13f1de93e.woff +0 -0
  246. data/public/assets/fonts/FiraMono-Regular-98f97ed2dbf9d94d4fa5df048434b88d.eot +0 -0
  247. data/public/assets/fonts/FiraMono-Regular.eot +0 -0
  248. data/public/assets/fonts/FiraMono-Regular.ttf +0 -0
  249. data/public/assets/fonts/FiraMono-Regular.woff +0 -0
  250. data/public/assets/fonts/FiraSans-Bold-0de5f536bd0dc370449c0c67a49a6fe7.eot +0 -0
  251. data/public/assets/fonts/FiraSans-Bold-25037ef8d155e38b5df0c242a4c6cf2d.ttf +0 -0
  252. data/public/assets/fonts/FiraSans-Bold-494219a9639084eb9528ff47f79fcda1.woff +0 -0
  253. data/public/assets/fonts/FiraSans-Bold.eot +0 -0
  254. data/public/assets/fonts/FiraSans-Bold.ttf +0 -0
  255. data/public/assets/fonts/FiraSans-Bold.woff +0 -0
  256. data/public/assets/fonts/FiraSans-BoldItalic-5b3b812df9e1cb2b1f34baad65a2bdfb.ttf +0 -0
  257. data/public/assets/fonts/FiraSans-BoldItalic-90b8087c48feff2e828f658c49de5399.eot +0 -0
  258. data/public/assets/fonts/FiraSans-BoldItalic-b10e46158d50bf9b78968112acf87310.woff +0 -0
  259. data/public/assets/fonts/FiraSans-BoldItalic.eot +0 -0
  260. data/public/assets/fonts/FiraSans-BoldItalic.ttf +0 -0
  261. data/public/assets/fonts/FiraSans-BoldItalic.woff +0 -0
  262. data/public/assets/fonts/FiraSans-Book-659d252627051e785260ba445da8930f.woff +0 -0
  263. data/public/assets/fonts/FiraSans-Book-abc65ceb7bfaed729bff7a9d1367b7d4.eot +0 -0
  264. data/public/assets/fonts/FiraSans-Book-f0410501d5ecc5fe66bcdbc02b482c81.ttf +0 -0
  265. data/public/assets/fonts/FiraSans-Book.eot +0 -0
  266. data/public/assets/fonts/FiraSans-Book.ttf +0 -0
  267. data/public/assets/fonts/FiraSans-Book.woff +0 -0
  268. data/public/assets/fonts/FiraSans-ExtraLight-140f15ee97cb2099ff01c2b57dcd1a24.woff +0 -0
  269. data/public/assets/fonts/FiraSans-ExtraLight-28e5c2679df66406ebd117fbdded6753.eot +0 -0
  270. data/public/assets/fonts/FiraSans-ExtraLight-c15de70ebceffce178cbd2e82aa2c373.ttf +0 -0
  271. data/public/assets/fonts/FiraSans-ExtraLight.eot +0 -0
  272. data/public/assets/fonts/FiraSans-ExtraLight.ttf +0 -0
  273. data/public/assets/fonts/FiraSans-ExtraLight.woff +0 -0
  274. data/public/assets/fonts/FiraSans-Italic-ac4cb18fe14a7c90f29cdd2ce499ba59.woff +0 -0
  275. data/public/assets/fonts/FiraSans-Italic-bdea00fee0da5ca9176061e00c26a0da.eot +0 -0
  276. data/public/assets/fonts/FiraSans-Italic-e7e76a0ee170fd29b5d8100753eff569.ttf +0 -0
  277. data/public/assets/fonts/FiraSans-Italic.eot +0 -0
  278. data/public/assets/fonts/FiraSans-Italic.ttf +0 -0
  279. data/public/assets/fonts/FiraSans-Italic.woff +0 -0
  280. data/public/assets/fonts/FiraSans-Light-20adaf630b690c3e3184daaeae585f22.woff +0 -0
  281. data/public/assets/fonts/FiraSans-Light-3689e18b38d335ec0c43823adb6a2984.eot +0 -0
  282. data/public/assets/fonts/FiraSans-Light-55b04531e7a9ecdf58090d70b94b68e2.ttf +0 -0
  283. data/public/assets/fonts/FiraSans-Light-SC-098407a72b7ad46f7c2480d7ac11baf2.eot +0 -0
  284. data/public/assets/fonts/FiraSans-Light-SC-82763fe2ce9e6b897556c6f3c2aceb29.woff2 +0 -0
  285. data/public/assets/fonts/FiraSans-Light-SC-c73985985f0501c1845a5185b180fe6b.woff +0 -0
  286. data/public/assets/fonts/FiraSans-Light-SC-c9563f48d9cccd91f07e46801c27130f.ttf +0 -0
  287. data/public/assets/fonts/FiraSans-Light-SC.eot +0 -0
  288. data/public/assets/fonts/FiraSans-Light-SC.ttf +0 -0
  289. data/public/assets/fonts/FiraSans-Light-SC.woff +0 -0
  290. data/public/assets/fonts/FiraSans-Light-SC.woff2 +0 -0
  291. data/public/assets/fonts/FiraSans-Light.eot +0 -0
  292. data/public/assets/fonts/FiraSans-Light.ttf +0 -0
  293. data/public/assets/fonts/FiraSans-Light.woff +0 -0
  294. data/public/assets/fonts/FiraSans-Medium-082fab59048189168006bf2e914ba8b7.woff +0 -0
  295. data/public/assets/fonts/FiraSans-Medium-11706edfe8651c355b413bd24b4b5e10.eot +0 -0
  296. data/public/assets/fonts/FiraSans-Medium-3a0dacdeaba1b4c054f2d6cb5061965d.ttf +0 -0
  297. data/public/assets/fonts/FiraSans-Medium.eot +0 -0
  298. data/public/assets/fonts/FiraSans-Medium.ttf +0 -0
  299. data/public/assets/fonts/FiraSans-Medium.woff +0 -0
  300. data/public/assets/fonts/FiraSans-MediumItalic-6c8a2646d72641226527d574a8485b66.woff +0 -0
  301. data/public/assets/fonts/FiraSans-MediumItalic-b81e92794a6878b6c578d97b3ad5e6d7.ttf +0 -0
  302. data/public/assets/fonts/FiraSans-MediumItalic-eae7f4a3c4db9fe83025909ebfae5ad9.eot +0 -0
  303. data/public/assets/fonts/FiraSans-MediumItalic.eot +0 -0
  304. data/public/assets/fonts/FiraSans-MediumItalic.ttf +0 -0
  305. data/public/assets/fonts/FiraSans-MediumItalic.woff +0 -0
  306. data/public/assets/fonts/FiraSans-Regular-537188a19aeebdd74a92e114af7a02cb.ttf +0 -0
  307. data/public/assets/fonts/FiraSans-Regular-5d6a923de9be80ff5c2995cc03d93127.woff +0 -0
  308. data/public/assets/fonts/FiraSans-Regular-db689e5fea21ed4b7890811151968dc6.eot +0 -0
  309. data/public/assets/fonts/FiraSans-Regular.eot +0 -0
  310. data/public/assets/fonts/FiraSans-Regular.ttf +0 -0
  311. data/public/assets/fonts/FiraSans-Regular.woff +0 -0
  312. data/public/assets/fonts/FiraSans-UltraLight-3baefce4c224a0f0b26cdafe37dfa55d.eot +0 -0
  313. data/public/assets/fonts/FiraSans-UltraLight-e3909a352b87f853bb464836adfd602a.ttf +0 -0
  314. data/public/assets/fonts/FiraSans-UltraLight-f7289beeaa2353caf487553ee8b8ef03.woff +0 -0
  315. data/public/assets/fonts/FiraSans-UltraLight.eot +0 -0
  316. data/public/assets/fonts/FiraSans-UltraLight.ttf +0 -0
  317. data/public/assets/fonts/FiraSans-UltraLight.woff +0 -0
  318. data/public/assets/fonts/FontAwesome.otf +0 -0
  319. data/public/assets/fonts/fontawesome-webfont.eot +0 -0
  320. data/public/assets/fonts/fontawesome-webfont.svg +2671 -0
  321. data/public/assets/fonts/fontawesome-webfont.ttf +0 -0
  322. data/public/assets/fonts/fontawesome-webfont.woff +0 -0
  323. data/public/assets/fonts/fontawesome-webfont.woff2 +0 -0
  324. data/public/assets/images/ajax-loader-30d8e72bfdae694b1938658e1b087df0.gif +0 -0
  325. data/public/assets/images/ajax-loader.gif +0 -0
  326. data/public/assets/images/iqvoc_logo-165f17a46cf0a1bf9464db9d136fb843.svg +41 -0
  327. data/public/assets/images/iqvoc_logo.svg +41 -0
  328. data/public/assets/images/treeview-default-line-5e3c0e0c48f48c23c45aef7b72c739c0.gif +0 -0
  329. data/public/assets/images/treeview-default-line.gif +0 -0
  330. data/public/assets/javascripts/bootstrap.bundle.min-68b3c2f1c1f636f947fff1229d3ffbf5.js +7 -0
  331. data/public/assets/javascripts/bootstrap.bundle.min.js +42 -0
  332. data/public/assets/javascripts/jquery-17e41799d7fba03a313ca6b67d8a0954.js +26 -0
  333. data/public/assets/javascripts/jquery-d52dc3a9171f1fc89dd0f8e35e42c9d2.js +26 -0
  334. data/{vendor/assets/bower_components/jquery/dist → public/assets/javascripts}/jquery.js +5142 -3472
  335. data/public/assets/javascripts/manifest-7708201f7c24d5186cd075c3317f9b70.js +7311 -0
  336. data/public/assets/javascripts/manifest-89894d9f630fa57378a0c28e2a3d9ea9.js +7325 -0
  337. data/public/assets/javascripts/manifest.js +5660 -0
  338. data/public/assets/manifest.json +1 -0
  339. data/public/assets/stylesheets/manifest-893c7de3dee9ed1295bc1b5b4c1f0c34.css +13 -0
  340. data/public/assets/stylesheets/manifest-94b7be92a9b1cfeafea4ea71af910324.css +13 -0
  341. data/public/assets/stylesheets/manifest-e576edf92efaaad86b15b565fa473d0b.css +7 -0
  342. data/public/assets/stylesheets/manifest.css +14314 -0
  343. data/public/export/{192518761412858257538294365837284445543.nt → 12750.nt} +0 -0
  344. data/public/export/{222655544999381011796369687711131211507.nt → 17385303752427181100115432751692126521.nt} +0 -0
  345. data/public/export/{28094.nt → 181196830007276319343907883650755121680.nt} +0 -0
  346. data/public/export/{317743731342877661346578631544287380698.nt → 194669028845730209313058462140064732442.nt} +0 -0
  347. data/public/export/{59040722386799844495905115730928244680.nt → 21988.nt} +0 -0
  348. data/public/export/{65316.nt → 230655012044692637365356891394989635995.nt} +0 -0
  349. data/public/export/233590502327750705645106563554497694497.nt +28 -0
  350. data/public/export/245884359537367641918690456207690070316.nt +28 -0
  351. data/public/export/250386066048669747259363837063223215204.nt +28 -0
  352. data/public/export/256041066575224861739818511470898486442.nt +28 -0
  353. data/public/export/287138383024694264939471429022965897163.nt +28 -0
  354. data/public/export/31892.nt +28 -0
  355. data/public/export/333774437366008328346740356666975078086.nt +28 -0
  356. data/public/export/34639390376251419382098415225771775708.nt +28 -0
  357. data/public/export/4098.nt +28 -0
  358. data/public/export/47070.nt +28 -0
  359. data/public/export/49947.nt +28 -0
  360. data/public/export/5793.nt +28 -0
  361. data/public/export/64089124325772410079516909502763866955.nt +28 -0
  362. data/public/export/64718.nt +28 -0
  363. data/public/export/71200590939430584664474292378126383577.nt +28 -0
  364. data/public/export/81965533953024918329855744567916239964.nt +28 -0
  365. data/public/uploads/import/{0090c45f8a575ba948e9e1f9346e8bd8.nt → 213b73161661ebbad4e5ee3f543ae617.nt} +0 -0
  366. data/public/uploads/import/{10b55d476cc7905edd5bf2ea3339266f.nt → 22ad4d7419b7914c7319c46a66839f77.nt} +0 -0
  367. data/public/uploads/import/{29f4bdb935b9ba14344c38808e2fc172.nt → 22b78e01b9b5876851578cf9a8373c07.nt} +0 -0
  368. data/public/uploads/import/{5686fe12a4157c537fe4f83de393e436.nt → 2ab75781f8141010699dd272f681b245.nt} +0 -0
  369. data/public/uploads/import/{a46e5777d14959f0a264fc27170a9aca.nt → 4c7fe47a2c21a681fd8f0eb3af0ebf19.nt} +0 -0
  370. data/public/uploads/import/{f47c4c34a7652d03188ef8815667a546.nt → 5265d7cb194f017c592a68914ecf8d9f.nt} +0 -0
  371. data/public/uploads/{tmp/1565090696-8977-0904/hobbies.nt → import/5cb5414a66e4ae5dbe05eb763c367bd1.nt} +0 -0
  372. data/public/uploads/{tmp/1565092660-26284-7315/hobbies.nt → import/6b042e00c2e2abf9241d2ece3e67ed27.nt} +0 -0
  373. data/public/uploads/{tmp/1565092837-26720-3638/hobbies.nt → import/749edd3918db157202b00f89418b87d1.nt} +0 -0
  374. data/public/uploads/{tmp/1565093111-27724-9556/hobbies.nt → import/7aeb9d76b78ba67674caa53a96e1caa0.nt} +0 -0
  375. data/public/uploads/{tmp/1565093198-28993-6950/hobbies.nt → import/7b7fc425b8926e586ca10d0f1385aa4e.nt} +0 -0
  376. data/public/uploads/{tmp/1565093353-29520-6028/hobbies.nt → import/8319d34702375718b20e72a6af71c503.nt} +0 -0
  377. data/public/uploads/import/9ec48f5aaece8d2a8770439e34199b19.nt +259 -0
  378. data/public/uploads/import/a22750632c35587057285920142c2db8.nt +259 -0
  379. data/public/uploads/import/a6d9eeb5e76ce0032614c8142a33c90b.nt +259 -0
  380. data/public/uploads/import/a7ec826e32e80d1fc61f5e89f7442199.nt +259 -0
  381. data/public/uploads/import/af2ac8cb84a194da9871ea701f915a25.nt +259 -0
  382. data/public/uploads/import/b50c67ef8cb51fa12812ac2601faaa75.nt +259 -0
  383. data/public/uploads/import/b66560ac9cc4aecd50f82d4fcec8bde4.nt +259 -0
  384. data/public/uploads/import/c1a12245a41d9105585fb48a0b5244ab.nt +259 -0
  385. data/public/uploads/import/c4b23750b9f72a7f93bcd979a9afded3.nt +259 -0
  386. data/public/uploads/import/d1edac76626a35a6e72a592c98e97b1a.nt +259 -0
  387. data/public/uploads/import/eca92dbeff4aec30e3072103bb5f565f.nt +259 -0
  388. data/public/uploads/import/f7996f8826062cd8dcfc8fac70e830b9.nt +259 -0
  389. data/public/uploads/tmp/1609926599-187261935008931-0002-5418/hobbies.nt +259 -0
  390. data/public/uploads/tmp/1610450700-516890595554445-0002-2685/hobbies.nt +259 -0
  391. data/public/uploads/tmp/1610450844-597126333235543-0001-0714/hobbies.nt +259 -0
  392. data/public/uploads/tmp/1611054155-443031323634581-0001-9192/hobbies.nt +259 -0
  393. data/public/uploads/tmp/1611225485-767301590714814-0002-6904/hobbies.nt +259 -0
  394. data/public/uploads/tmp/1611225661-919900076415463-0002-0657/hobbies.nt +259 -0
  395. data/public/uploads/tmp/1611227389-36557097935032-0002-4613/hobbies.nt +259 -0
  396. data/public/uploads/tmp/1611585376-822293462114758-0001-9752/hobbies.nt +259 -0
  397. data/public/uploads/tmp/1611585431-703460698560673-0002-7522/hobbies.nt +259 -0
  398. data/public/uploads/tmp/1611586554-483369300394995-0002-0872/hobbies.nt +259 -0
  399. data/public/uploads/tmp/1619777137-609890333749067-0002-0264/hobbies.nt +259 -0
  400. data/public/uploads/tmp/1627291050-163284787457980-0001-2701/hobbies.nt +259 -0
  401. data/public/uploads/tmp/1627291589-952446089963663-0002-3171/hobbies.nt +259 -0
  402. data/public/uploads/tmp/1627291819-788250283200541-0002-2503/hobbies.nt +259 -0
  403. data/public/uploads/tmp/1627292534-103362378955855-0001-7089/hobbies.nt +259 -0
  404. data/public/uploads/tmp/1627293799-506613299368066-0002-1247/hobbies.nt +259 -0
  405. data/public/uploads/tmp/1627293863-868842521367397-0001-4656/hobbies.nt +259 -0
  406. data/public/uploads/tmp/1636993960-338364327912413-0002-8049/hobbies.nt +259 -0
  407. data/public/uploads/tmp/1641550181-434480636271400-0002-7928/hobbies.nt +259 -0
  408. data/public/uploads/tmp/1641550416-6444469569098-0002-2156/hobbies.nt +259 -0
  409. data/public/uploads/tmp/1641550691-848542458162760-0002-6815/hobbies.nt +259 -0
  410. data/public/uploads/tmp/1641550716-647719127292471-0002-9954/hobbies.nt +259 -0
  411. data/public/uploads/tmp/1641551058-78248622355227-0002-3663/hobbies.nt +259 -0
  412. data/public/uploads/tmp/1641551220-744894908610606-0001-3879/hobbies.nt +259 -0
  413. data/test/controllers/concepts_movement_controller_test.rb +41 -36
  414. data/test/controllers/hierarchy_test.rb +38 -43
  415. data/test/controllers/rdf_rendering_test.rb +2 -4
  416. data/test/controllers/reverse_match_test.rb +49 -39
  417. data/test/integration/authentication_test.rb +1 -1
  418. data/test/integration/browse_concepts_and_labels_test.rb +3 -1
  419. data/test/integration/client_edit_concept_test.rb +1 -1
  420. data/test/integration/export_test.rb +2 -2
  421. data/test/integration/import_test.rb +2 -2
  422. data/test/integration/instance_configuration_browsing_test.rb +2 -2
  423. data/test/integration/navigation_test.rb +30 -3
  424. data/test/integration/note_annotations_test.rb +1 -1
  425. data/test/integration/search_test.rb +2 -2
  426. data/test/integration_test_helper.rb +1 -0
  427. data/test/models/hygiene_test.rb +1 -1
  428. data/test/test_helper.rb +0 -5
  429. metadata +305 -645
  430. data/app/assets/javascripts/iqvoc/concept_mapper.js +0 -73
  431. data/app/assets/javascripts/iqvoc/entityselect_qualified.js.erb +0 -45
  432. data/app/assets/javascripts/iqvoc/moving_sidebar.js +0 -37
  433. data/app/assets/javascripts/iqvoc/onebox.js.erb +0 -62
  434. data/app/assets/javascripts/iqvoc/quicksearch.js +0 -59
  435. data/app/assets/stylesheets/iqvoc/ie_fixes.css.scss +0 -6
  436. data/app/models/concerns/deep_cloning.rb +0 -94
  437. data/config/initializers/assets.rb +0 -5
  438. data/config/initializers/mysql_column_limit.rb +0 -14
  439. data/config/travis/database.yml.mysql +0 -9
  440. data/config/travis/database.yml.postgresql +0 -7
  441. data/config/travis/database.yml.sqlite +0 -5
  442. data/public/404.html +0 -58
  443. data/public/500.html +0 -57
  444. data/vendor/assets/bower_components/URIjs/LICENSE.txt +0 -21
  445. data/vendor/assets/bower_components/URIjs/README.md +0 -496
  446. data/vendor/assets/bower_components/URIjs/bower.json +0 -29
  447. data/vendor/assets/bower_components/URIjs/contributing.md +0 -19
  448. data/vendor/assets/bower_components/URIjs/src/IPv6.js +0 -188
  449. data/vendor/assets/bower_components/URIjs/src/SecondLevelDomains.js +0 -241
  450. data/vendor/assets/bower_components/URIjs/src/URI.fragmentQuery.js +0 -104
  451. data/vendor/assets/bower_components/URIjs/src/URI.fragmentURI.js +0 -97
  452. data/vendor/assets/bower_components/URIjs/src/URI.js +0 -2002
  453. data/vendor/assets/bower_components/URIjs/src/URI.min.js +0 -84
  454. data/vendor/assets/bower_components/URIjs/src/URITemplate.js +0 -499
  455. data/vendor/assets/bower_components/URIjs/src/jquery.URI.js +0 -235
  456. data/vendor/assets/bower_components/URIjs/src/jquery.URI.min.js +0 -7
  457. data/vendor/assets/bower_components/URIjs/src/punycode.js +0 -508
  458. data/vendor/assets/bower_components/bootstrap-sass/CHANGELOG.md +0 -189
  459. data/vendor/assets/bower_components/bootstrap-sass/CONTRIBUTING.md +0 -86
  460. data/vendor/assets/bower_components/bootstrap-sass/LICENSE +0 -21
  461. data/vendor/assets/bower_components/bootstrap-sass/README.md +0 -352
  462. data/vendor/assets/bower_components/bootstrap-sass/assets/fonts/bootstrap/glyphicons-halflings-regular.eot +0 -0
  463. data/vendor/assets/bower_components/bootstrap-sass/assets/fonts/bootstrap/glyphicons-halflings-regular.svg +0 -288
  464. data/vendor/assets/bower_components/bootstrap-sass/assets/fonts/bootstrap/glyphicons-halflings-regular.ttf +0 -0
  465. data/vendor/assets/bower_components/bootstrap-sass/assets/fonts/bootstrap/glyphicons-halflings-regular.woff +0 -0
  466. data/vendor/assets/bower_components/bootstrap-sass/assets/fonts/bootstrap/glyphicons-halflings-regular.woff2 +0 -0
  467. data/vendor/assets/bower_components/bootstrap-sass/assets/javascripts/bootstrap/affix.js +0 -162
  468. data/vendor/assets/bower_components/bootstrap-sass/assets/javascripts/bootstrap/alert.js +0 -94
  469. data/vendor/assets/bower_components/bootstrap-sass/assets/javascripts/bootstrap/button.js +0 -116
  470. data/vendor/assets/bower_components/bootstrap-sass/assets/javascripts/bootstrap/carousel.js +0 -237
  471. data/vendor/assets/bower_components/bootstrap-sass/assets/javascripts/bootstrap/collapse.js +0 -211
  472. data/vendor/assets/bower_components/bootstrap-sass/assets/javascripts/bootstrap/dropdown.js +0 -161
  473. data/vendor/assets/bower_components/bootstrap-sass/assets/javascripts/bootstrap/modal.js +0 -339
  474. data/vendor/assets/bower_components/bootstrap-sass/assets/javascripts/bootstrap/popover.js +0 -108
  475. data/vendor/assets/bower_components/bootstrap-sass/assets/javascripts/bootstrap/scrollspy.js +0 -172
  476. data/vendor/assets/bower_components/bootstrap-sass/assets/javascripts/bootstrap/tab.js +0 -153
  477. data/vendor/assets/bower_components/bootstrap-sass/assets/javascripts/bootstrap/tooltip.js +0 -476
  478. data/vendor/assets/bower_components/bootstrap-sass/assets/javascripts/bootstrap/transition.js +0 -59
  479. data/vendor/assets/bower_components/bootstrap-sass/assets/javascripts/bootstrap-sprockets.js +0 -12
  480. data/vendor/assets/bower_components/bootstrap-sass/assets/javascripts/bootstrap.js +0 -2317
  481. data/vendor/assets/bower_components/bootstrap-sass/assets/javascripts/bootstrap.min.js +0 -7
  482. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/_bootstrap-compass.scss +0 -9
  483. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/_bootstrap-mincer.scss +0 -19
  484. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/_bootstrap-sprockets.scss +0 -9
  485. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/_bootstrap.scss +0 -50
  486. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/_alerts.scss +0 -73
  487. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/_badges.scss +0 -68
  488. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/_breadcrumbs.scss +0 -26
  489. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/_button-groups.scss +0 -243
  490. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/_buttons.scss +0 -160
  491. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/_carousel.scss +0 -269
  492. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/_close.scss +0 -36
  493. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/_code.scss +0 -69
  494. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/_component-animations.scss +0 -37
  495. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/_dropdowns.scss +0 -214
  496. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/_forms.scss +0 -578
  497. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/_glyphicons.scss +0 -305
  498. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/_grid.scss +0 -84
  499. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/_input-groups.scss +0 -166
  500. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/_jumbotron.scss +0 -50
  501. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/_labels.scss +0 -66
  502. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/_list-group.scss +0 -124
  503. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/_media.scss +0 -61
  504. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/_mixins.scss +0 -39
  505. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/_modals.scss +0 -150
  506. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/_navbar.scss +0 -662
  507. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/_navs.scss +0 -242
  508. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/_normalize.scss +0 -427
  509. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/_pager.scss +0 -54
  510. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/_pagination.scss +0 -88
  511. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/_panels.scss +0 -265
  512. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/_popovers.scss +0 -135
  513. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/_print.scss +0 -107
  514. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/_progress-bars.scss +0 -87
  515. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/_responsive-embed.scss +0 -35
  516. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/_responsive-utilities.scss +0 -177
  517. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/_scaffolding.scss +0 -162
  518. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/_tables.scss +0 -234
  519. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/_theme.scss +0 -273
  520. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/_thumbnails.scss +0 -38
  521. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/_tooltip.scss +0 -102
  522. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/_type.scss +0 -298
  523. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/_utilities.scss +0 -55
  524. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/_variables.scss +0 -866
  525. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/_wells.scss +0 -29
  526. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/mixins/_alerts.scss +0 -14
  527. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/mixins/_background-variant.scss +0 -11
  528. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/mixins/_border-radius.scss +0 -18
  529. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/mixins/_buttons.scss +0 -52
  530. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/mixins/_center-block.scss +0 -7
  531. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/mixins/_clearfix.scss +0 -22
  532. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/mixins/_forms.scss +0 -88
  533. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/mixins/_gradients.scss +0 -58
  534. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +0 -81
  535. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/mixins/_grid.scss +0 -122
  536. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/mixins/_hide-text.scss +0 -21
  537. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/mixins/_image.scss +0 -33
  538. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/mixins/_labels.scss +0 -12
  539. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/mixins/_list-group.scss +0 -31
  540. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/mixins/_nav-divider.scss +0 -10
  541. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/mixins/_nav-vertical-align.scss +0 -9
  542. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/mixins/_opacity.scss +0 -8
  543. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/mixins/_pagination.scss +0 -23
  544. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/mixins/_panels.scss +0 -24
  545. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/mixins/_progress-bar.scss +0 -10
  546. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/mixins/_reset-filter.scss +0 -8
  547. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/mixins/_resize.scss +0 -6
  548. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/mixins/_responsive-visibility.scss +0 -21
  549. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/mixins/_size.scss +0 -10
  550. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/mixins/_tab-focus.scss +0 -9
  551. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/mixins/_table-row.scss +0 -28
  552. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss +0 -11
  553. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/mixins/_text-overflow.scss +0 -8
  554. data/vendor/assets/bower_components/bootstrap-sass/assets/stylesheets/bootstrap/mixins/_vendor-prefixes.scss +0 -222
  555. data/vendor/assets/bower_components/bootstrap-sass/bower.json +0 -40
  556. data/vendor/assets/bower_components/bootstrap-sass/composer.json +0 -35
  557. data/vendor/assets/bower_components/bootstrap-sass/package.json +0 -30
  558. data/vendor/assets/bower_components/bootstrap-sass/sache.json +0 -5
  559. data/vendor/assets/bower_components/html5shiv/Gruntfile.js +0 -61
  560. data/vendor/assets/bower_components/html5shiv/bower.json +0 -15
  561. data/vendor/assets/bower_components/html5shiv/dist/html5shiv-printshiv.js +0 -520
  562. data/vendor/assets/bower_components/html5shiv/dist/html5shiv-printshiv.min.js +0 -4
  563. data/vendor/assets/bower_components/html5shiv/dist/html5shiv.js +0 -322
  564. data/vendor/assets/bower_components/html5shiv/dist/html5shiv.min.js +0 -4
  565. data/vendor/assets/bower_components/html5shiv/package.json +0 -16
  566. data/vendor/assets/bower_components/html5shiv/readme.md +0 -152
  567. data/vendor/assets/bower_components/jqtree/LICENSE +0 -202
  568. data/vendor/assets/bower_components/jqtree/README.md +0 -24
  569. data/vendor/assets/bower_components/jqtree/_config.yml +0 -18
  570. data/vendor/assets/bower_components/jqtree/_entries/01_general.md +0 -7
  571. data/vendor/assets/bower_components/jqtree/_entries/02_introduction.md +0 -9
  572. data/vendor/assets/bower_components/jqtree/_entries/03_features.md +0 -15
  573. data/vendor/assets/bower_components/jqtree/_entries/04_demo.html +0 -34
  574. data/vendor/assets/bower_components/jqtree/_entries/05_requirements.md +0 -6
  575. data/vendor/assets/bower_components/jqtree/_entries/06_downloads.md +0 -9
  576. data/vendor/assets/bower_components/jqtree/_entries/07_tutorial.md +0 -77
  577. data/vendor/assets/bower_components/jqtree/_entries/08_examples.md +0 -8
  578. data/vendor/assets/bower_components/jqtree/_entries/09_changelog.md +0 -179
  579. data/vendor/assets/bower_components/jqtree/_entries/10_options.md +0 -6
  580. data/vendor/assets/bower_components/jqtree/_entries/11_autoescape.md +0 -6
  581. data/vendor/assets/bower_components/jqtree/_entries/12_autoopen.md +0 -28
  582. data/vendor/assets/bower_components/jqtree/_entries/13_closedicon.md +0 -12
  583. data/vendor/assets/bower_components/jqtree/_entries/14_data.md +0 -41
  584. data/vendor/assets/bower_components/jqtree/_entries/15_datafilter.md +0 -17
  585. data/vendor/assets/bower_components/jqtree/_entries/16_data-url.md +0 -21
  586. data/vendor/assets/bower_components/jqtree/_entries/17_draganddrop.md +0 -18
  587. data/vendor/assets/bower_components/jqtree/_entries/18_keyboardsupport.md +0 -14
  588. data/vendor/assets/bower_components/jqtree/_entries/19_oncanmove.md +0 -22
  589. data/vendor/assets/bower_components/jqtree/_entries/20_oncanmoveto.md +0 -22
  590. data/vendor/assets/bower_components/jqtree/_entries/21_oncanselectnode.md +0 -26
  591. data/vendor/assets/bower_components/jqtree/_entries/22_oncreateli.md +0 -16
  592. data/vendor/assets/bower_components/jqtree/_entries/23_onismovehandle.md +0 -17
  593. data/vendor/assets/bower_components/jqtree/_entries/24_onloadfailed.md +0 -15
  594. data/vendor/assets/bower_components/jqtree/_entries/25_openedicon.md +0 -12
  595. data/vendor/assets/bower_components/jqtree/_entries/26_openfolderdelay.md +0 -13
  596. data/vendor/assets/bower_components/jqtree/_entries/27_savestate.md +0 -42
  597. data/vendor/assets/bower_components/jqtree/_entries/28_selectable.md +0 -18
  598. data/vendor/assets/bower_components/jqtree/_entries/29_slide.md +0 -12
  599. data/vendor/assets/bower_components/jqtree/_entries/30_usecontextmenu.md +0 -14
  600. data/vendor/assets/bower_components/jqtree/_entries/31_functions.md +0 -6
  601. data/vendor/assets/bower_components/jqtree/_entries/32_addnodeafter.md +0 -20
  602. data/vendor/assets/bower_components/jqtree/_entries/33_addnodebefore.md +0 -8
  603. data/vendor/assets/bower_components/jqtree/_entries/34_appendnode.md +0 -33
  604. data/vendor/assets/bower_components/jqtree/_entries/35_closenode.md +0 -23
  605. data/vendor/assets/bower_components/jqtree/_entries/36_getnodebyid.md +0 -21
  606. data/vendor/assets/bower_components/jqtree/_entries/37_getselectednode.md +0 -10
  607. data/vendor/assets/bower_components/jqtree/_entries/38_getstate.md +0 -19
  608. data/vendor/assets/bower_components/jqtree/_entries/39_gettree.md +0 -8
  609. data/vendor/assets/bower_components/jqtree/_entries/40_loaddata.md +0 -46
  610. data/vendor/assets/bower_components/jqtree/_entries/41_loaddatafromurl.md +0 -55
  611. data/vendor/assets/bower_components/jqtree/_entries/42_movedown.md +0 -8
  612. data/vendor/assets/bower_components/jqtree/_entries/43_movenode.md +0 -15
  613. data/vendor/assets/bower_components/jqtree/_entries/44_moveup.md +0 -8
  614. data/vendor/assets/bower_components/jqtree/_entries/45_opennode.md +0 -29
  615. data/vendor/assets/bower_components/jqtree/_entries/46_addparentnode.md +0 -20
  616. data/vendor/assets/bower_components/jqtree/_entries/47_reload.md +0 -12
  617. data/vendor/assets/bower_components/jqtree/_entries/48_removenode.md +0 -12
  618. data/vendor/assets/bower_components/jqtree/_entries/49_selectnode.md +0 -24
  619. data/vendor/assets/bower_components/jqtree/_entries/50_scrolltonode.md +0 -13
  620. data/vendor/assets/bower_components/jqtree/_entries/51_setoption.md +0 -12
  621. data/vendor/assets/bower_components/jqtree/_entries/52_setstate.md +0 -8
  622. data/vendor/assets/bower_components/jqtree/_entries/53_toggle.md +0 -8
  623. data/vendor/assets/bower_components/jqtree/_entries/54_tojson.md +0 -13
  624. data/vendor/assets/bower_components/jqtree/_entries/55_updatenode.md +0 -33
  625. data/vendor/assets/bower_components/jqtree/_entries/56_events.md +0 -6
  626. data/vendor/assets/bower_components/jqtree/_entries/57_tree-click.md +0 -37
  627. data/vendor/assets/bower_components/jqtree/_entries/58_tree-close.md +0 -15
  628. data/vendor/assets/bower_components/jqtree/_entries/59_tree-contextmenu.md +0 -21
  629. data/vendor/assets/bower_components/jqtree/_entries/60_tree-dblclick.md +0 -19
  630. data/vendor/assets/bower_components/jqtree/_entries/61_tree-init.md +0 -15
  631. data/vendor/assets/bower_components/jqtree/_entries/62_tree-move.md +0 -71
  632. data/vendor/assets/bower_components/jqtree/_entries/63_tree-open.md +0 -15
  633. data/vendor/assets/bower_components/jqtree/_entries/64_tree-select.md +0 -28
  634. data/vendor/assets/bower_components/jqtree/_entries/65_multiple-selection.md +0 -9
  635. data/vendor/assets/bower_components/jqtree/_entries/66_add-to-selection.md +0 -11
  636. data/vendor/assets/bower_components/jqtree/_entries/67_get-selected-nodes.md +0 -10
  637. data/vendor/assets/bower_components/jqtree/_entries/68_is-node-selected.md +0 -11
  638. data/vendor/assets/bower_components/jqtree/_entries/69_remove-from-selection.md +0 -11
  639. data/vendor/assets/bower_components/jqtree/_entries/70_node-functions.md +0 -13
  640. data/vendor/assets/bower_components/jqtree/_entries/71_children.md +0 -12
  641. data/vendor/assets/bower_components/jqtree/_entries/72_getdata.md +0 -10
  642. data/vendor/assets/bower_components/jqtree/_entries/73_getlevel.md +0 -13
  643. data/vendor/assets/bower_components/jqtree/_entries/74_getnextnode.md +0 -12
  644. data/vendor/assets/bower_components/jqtree/_entries/75_getnextsibling.md +0 -10
  645. data/vendor/assets/bower_components/jqtree/_entries/76_getpreviousnode.md +0 -12
  646. data/vendor/assets/bower_components/jqtree/_entries/77_getprevioussibling.md +0 -10
  647. data/vendor/assets/bower_components/jqtree/_entries/78_parent.md +0 -10
  648. data/vendor/assets/bower_components/jqtree/_examples/01_load_json_data.html +0 -47
  649. data/vendor/assets/bower_components/jqtree/_examples/02_load_json_data_from_server.html +0 -31
  650. data/vendor/assets/bower_components/jqtree/_examples/03_drag_and_drop.html +0 -45
  651. data/vendor/assets/bower_components/jqtree/_examples/04_save_state.html +0 -52
  652. data/vendor/assets/bower_components/jqtree/_examples/05_load_on_demand.html +0 -70
  653. data/vendor/assets/bower_components/jqtree/_examples/06_autoescape.html +0 -47
  654. data/vendor/assets/bower_components/jqtree/_examples/07_autoscroll.html +0 -23
  655. data/vendor/assets/bower_components/jqtree/_examples/08_multiple_select.html +0 -72
  656. data/vendor/assets/bower_components/jqtree/_examples/09_custom_html.html +0 -68
  657. data/vendor/assets/bower_components/jqtree/_examples/10_icon_buttons.html +0 -27
  658. data/vendor/assets/bower_components/jqtree/_layouts/base.html +0 -48
  659. data/vendor/assets/bower_components/jqtree/_layouts/frontpage.html +0 -20
  660. data/vendor/assets/bower_components/jqtree/_layouts/page.html +0 -7
  661. data/vendor/assets/bower_components/jqtree/bower.json +0 -12
  662. data/vendor/assets/bower_components/jqtree/gulpfile.coffee +0 -30
  663. data/vendor/assets/bower_components/jqtree/gulpfile.js +0 -2
  664. data/vendor/assets/bower_components/jqtree/index.html +0 -48
  665. data/vendor/assets/bower_components/jqtree/jqtree-circle.png +0 -0
  666. data/vendor/assets/bower_components/jqtree/jqtree.css +0 -143
  667. data/vendor/assets/bower_components/jqtree/jqtree.jquery.json +0 -23
  668. data/vendor/assets/bower_components/jqtree/package.json +0 -23
  669. data/vendor/assets/bower_components/jqtree/phantomjs/runner.js +0 -193
  670. data/vendor/assets/bower_components/jqtree/phantomjs/server.js +0 -14
  671. data/vendor/assets/bower_components/jqtree/screenshot.png +0 -0
  672. data/vendor/assets/bower_components/jqtree/sitemap.txt +0 -11
  673. data/vendor/assets/bower_components/jqtree/src/drag_and_drop_handler.coffee +0 -466
  674. data/vendor/assets/bower_components/jqtree/src/elements_renderer.coffee +0 -198
  675. data/vendor/assets/bower_components/jqtree/src/key_handler.coffee +0 -92
  676. data/vendor/assets/bower_components/jqtree/src/mouse.widget.coffee +0 -181
  677. data/vendor/assets/bower_components/jqtree/src/node.coffee +0 -431
  678. data/vendor/assets/bower_components/jqtree/src/node_element.coffee +0 -144
  679. data/vendor/assets/bower_components/jqtree/src/save_state_handler.coffee +0 -191
  680. data/vendor/assets/bower_components/jqtree/src/scroll_handler.coffee +0 -100
  681. data/vendor/assets/bower_components/jqtree/src/select_node_handler.coffee +0 -76
  682. data/vendor/assets/bower_components/jqtree/src/simple.widget.coffee +0 -102
  683. data/vendor/assets/bower_components/jqtree/src/test.js +0 -1945
  684. data/vendor/assets/bower_components/jqtree/src/tree.jquery.coffee +0 -772
  685. data/vendor/assets/bower_components/jqtree/src/util.coffee +0 -117
  686. data/vendor/assets/bower_components/jqtree/src/version.coffee +0 -1
  687. data/vendor/assets/bower_components/jqtree/static/bower.json +0 -13
  688. data/vendor/assets/bower_components/jqtree/static/bower_components/blanket/dist/qunit/blanket.js +0 -5430
  689. data/vendor/assets/bower_components/jqtree/static/bower_components/bootstrap/dist/css/bootstrap-theme.min.css +0 -5
  690. data/vendor/assets/bower_components/jqtree/static/bower_components/bootstrap/dist/css/bootstrap.min.css +0 -5
  691. data/vendor/assets/bower_components/jqtree/static/bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.eot +0 -0
  692. data/vendor/assets/bower_components/jqtree/static/bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.svg +0 -229
  693. data/vendor/assets/bower_components/jqtree/static/bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf +0 -0
  694. data/vendor/assets/bower_components/jqtree/static/bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.woff +0 -0
  695. data/vendor/assets/bower_components/jqtree/static/bower_components/bootstrap/dist/js/bootstrap.min.js +0 -7
  696. data/vendor/assets/bower_components/jqtree/static/bower_components/fontawesome/css/font-awesome.min.css +0 -4
  697. data/vendor/assets/bower_components/jqtree/static/bower_components/fontawesome/fonts/FontAwesome.otf +0 -0
  698. data/vendor/assets/bower_components/jqtree/static/bower_components/fontawesome/fonts/fontawesome-webfont.eot +0 -0
  699. data/vendor/assets/bower_components/jqtree/static/bower_components/fontawesome/fonts/fontawesome-webfont.svg +0 -520
  700. data/vendor/assets/bower_components/jqtree/static/bower_components/fontawesome/fonts/fontawesome-webfont.ttf +0 -0
  701. data/vendor/assets/bower_components/jqtree/static/bower_components/fontawesome/fonts/fontawesome-webfont.woff +0 -0
  702. data/vendor/assets/bower_components/jqtree/static/bower_components/jquery/dist/jquery.min.js +0 -5
  703. data/vendor/assets/bower_components/jqtree/static/bower_components/jquery-cookie/jquery.cookie.js +0 -117
  704. data/vendor/assets/bower_components/jqtree/static/bower_components/jquery-mockjax/jquery.mockjax.js +0 -692
  705. data/vendor/assets/bower_components/jqtree/static/bower_components/pygments/css/monokai.css +0 -63
  706. data/vendor/assets/bower_components/jqtree/static/bower_components/qunit/qunit/qunit.css +0 -264
  707. data/vendor/assets/bower_components/jqtree/static/bower_components/qunit/qunit/qunit.js +0 -2819
  708. data/vendor/assets/bower_components/jqtree/static/documentation.css +0 -165
  709. data/vendor/assets/bower_components/jqtree/static/documentation.js +0 -51
  710. data/vendor/assets/bower_components/jqtree/static/example.css +0 -53
  711. data/vendor/assets/bower_components/jqtree/static/example_data.js +0 -128
  712. data/vendor/assets/bower_components/jqtree/static/examples/autoescape.js +0 -19
  713. data/vendor/assets/bower_components/jqtree/static/examples/autoscroll.js +0 -8
  714. data/vendor/assets/bower_components/jqtree/static/examples/custom_html.js +0 -32
  715. data/vendor/assets/bower_components/jqtree/static/examples/drag_and_drop.js +0 -15
  716. data/vendor/assets/bower_components/jqtree/static/examples/icon_buttons.js +0 -14
  717. data/vendor/assets/bower_components/jqtree/static/examples/load_json_data.js +0 -21
  718. data/vendor/assets/bower_components/jqtree/static/examples/load_json_data_from_server.js +0 -11
  719. data/vendor/assets/bower_components/jqtree/static/examples/load_on_demand.js +0 -20
  720. data/vendor/assets/bower_components/jqtree/static/examples/multiple_select.js +0 -27
  721. data/vendor/assets/bower_components/jqtree/static/examples/save_state.js +0 -13
  722. data/vendor/assets/bower_components/jqtree/static/jquery-1.11.2.min.js +0 -4
  723. data/vendor/assets/bower_components/jqtree/static/spinner.gif +0 -0
  724. data/vendor/assets/bower_components/jqtree/test/test.html +0 -23
  725. data/vendor/assets/bower_components/jqtree/test/test.js +0 -2604
  726. data/vendor/assets/bower_components/jqtree/tree.jquery.js +0 -3388
  727. data/vendor/assets/bower_components/jquery/MIT-LICENSE.txt +0 -21
  728. data/vendor/assets/bower_components/jquery/bower.json +0 -27
  729. data/vendor/assets/bower_components/jquery/dist/jquery.min.js +0 -5
  730. data/vendor/assets/bower_components/jquery/dist/jquery.min.map +0 -1
  731. data/vendor/assets/bower_components/jquery/src/ajax/jsonp.js +0 -89
  732. data/vendor/assets/bower_components/jquery/src/ajax/load.js +0 -75
  733. data/vendor/assets/bower_components/jquery/src/ajax/parseJSON.js +0 -13
  734. data/vendor/assets/bower_components/jquery/src/ajax/parseXML.js +0 -28
  735. data/vendor/assets/bower_components/jquery/src/ajax/script.js +0 -64
  736. data/vendor/assets/bower_components/jquery/src/ajax/var/nonce.js +0 -5
  737. data/vendor/assets/bower_components/jquery/src/ajax/var/rquery.js +0 -3
  738. data/vendor/assets/bower_components/jquery/src/ajax/xhr.js +0 -136
  739. data/vendor/assets/bower_components/jquery/src/ajax.js +0 -786
  740. data/vendor/assets/bower_components/jquery/src/attributes/attr.js +0 -141
  741. data/vendor/assets/bower_components/jquery/src/attributes/classes.js +0 -158
  742. data/vendor/assets/bower_components/jquery/src/attributes/prop.js +0 -94
  743. data/vendor/assets/bower_components/jquery/src/attributes/support.js +0 -35
  744. data/vendor/assets/bower_components/jquery/src/attributes/val.js +0 -161
  745. data/vendor/assets/bower_components/jquery/src/attributes.js +0 -11
  746. data/vendor/assets/bower_components/jquery/src/callbacks.js +0 -205
  747. data/vendor/assets/bower_components/jquery/src/core/access.js +0 -60
  748. data/vendor/assets/bower_components/jquery/src/core/init.js +0 -123
  749. data/vendor/assets/bower_components/jquery/src/core/parseHTML.js +0 -39
  750. data/vendor/assets/bower_components/jquery/src/core/ready.js +0 -97
  751. data/vendor/assets/bower_components/jquery/src/core/var/rsingleTag.js +0 -4
  752. data/vendor/assets/bower_components/jquery/src/core.js +0 -497
  753. data/vendor/assets/bower_components/jquery/src/css/addGetHookIf.js +0 -22
  754. data/vendor/assets/bower_components/jquery/src/css/curCSS.js +0 -57
  755. data/vendor/assets/bower_components/jquery/src/css/defaultDisplay.js +0 -70
  756. data/vendor/assets/bower_components/jquery/src/css/hiddenVisibleSelectors.js +0 -15
  757. data/vendor/assets/bower_components/jquery/src/css/support.js +0 -96
  758. data/vendor/assets/bower_components/jquery/src/css/swap.js +0 -28
  759. data/vendor/assets/bower_components/jquery/src/css/var/cssExpand.js +0 -3
  760. data/vendor/assets/bower_components/jquery/src/css/var/getStyles.js +0 -12
  761. data/vendor/assets/bower_components/jquery/src/css/var/isHidden.js +0 -13
  762. data/vendor/assets/bower_components/jquery/src/css/var/rmargin.js +0 -3
  763. data/vendor/assets/bower_components/jquery/src/css/var/rnumnonpx.js +0 -5
  764. data/vendor/assets/bower_components/jquery/src/css.js +0 -450
  765. data/vendor/assets/bower_components/jquery/src/data/Data.js +0 -181
  766. data/vendor/assets/bower_components/jquery/src/data/accepts.js +0 -20
  767. data/vendor/assets/bower_components/jquery/src/data/var/data_priv.js +0 -5
  768. data/vendor/assets/bower_components/jquery/src/data/var/data_user.js +0 -5
  769. data/vendor/assets/bower_components/jquery/src/data.js +0 -178
  770. data/vendor/assets/bower_components/jquery/src/deferred.js +0 -149
  771. data/vendor/assets/bower_components/jquery/src/deprecated.js +0 -13
  772. data/vendor/assets/bower_components/jquery/src/dimensions.js +0 -50
  773. data/vendor/assets/bower_components/jquery/src/effects/Tween.js +0 -114
  774. data/vendor/assets/bower_components/jquery/src/effects/animatedSelector.js +0 -13
  775. data/vendor/assets/bower_components/jquery/src/effects.js +0 -648
  776. data/vendor/assets/bower_components/jquery/src/event/ajax.js +0 -13
  777. data/vendor/assets/bower_components/jquery/src/event/alias.js +0 -39
  778. data/vendor/assets/bower_components/jquery/src/event/support.js +0 -9
  779. data/vendor/assets/bower_components/jquery/src/event.js +0 -868
  780. data/vendor/assets/bower_components/jquery/src/exports/amd.js +0 -24
  781. data/vendor/assets/bower_components/jquery/src/exports/global.js +0 -32
  782. data/vendor/assets/bower_components/jquery/src/intro.js +0 -44
  783. data/vendor/assets/bower_components/jquery/src/jquery.js +0 -37
  784. data/vendor/assets/bower_components/jquery/src/manipulation/_evalUrl.js +0 -18
  785. data/vendor/assets/bower_components/jquery/src/manipulation/support.js +0 -32
  786. data/vendor/assets/bower_components/jquery/src/manipulation/var/rcheckableType.js +0 -3
  787. data/vendor/assets/bower_components/jquery/src/manipulation.js +0 -580
  788. data/vendor/assets/bower_components/jquery/src/offset.js +0 -207
  789. data/vendor/assets/bower_components/jquery/src/outro.js +0 -1
  790. data/vendor/assets/bower_components/jquery/src/queue/delay.js +0 -22
  791. data/vendor/assets/bower_components/jquery/src/queue.js +0 -142
  792. data/vendor/assets/bower_components/jquery/src/selector-native.js +0 -172
  793. data/vendor/assets/bower_components/jquery/src/selector-sizzle.js +0 -14
  794. data/vendor/assets/bower_components/jquery/src/selector.js +0 -1
  795. data/vendor/assets/bower_components/jquery/src/serialize.js +0 -111
  796. data/vendor/assets/bower_components/jquery/src/sizzle/dist/sizzle.js +0 -2067
  797. data/vendor/assets/bower_components/jquery/src/sizzle/dist/sizzle.min.js +0 -3
  798. data/vendor/assets/bower_components/jquery/src/sizzle/dist/sizzle.min.map +0 -1
  799. data/vendor/assets/bower_components/jquery/src/traversing/findFilter.js +0 -100
  800. data/vendor/assets/bower_components/jquery/src/traversing/var/rneedsContext.js +0 -6
  801. data/vendor/assets/bower_components/jquery/src/traversing.js +0 -199
  802. data/vendor/assets/bower_components/jquery/src/var/arr.js +0 -3
  803. data/vendor/assets/bower_components/jquery/src/var/class2type.js +0 -4
  804. data/vendor/assets/bower_components/jquery/src/var/concat.js +0 -5
  805. data/vendor/assets/bower_components/jquery/src/var/hasOwn.js +0 -5
  806. data/vendor/assets/bower_components/jquery/src/var/indexOf.js +0 -5
  807. data/vendor/assets/bower_components/jquery/src/var/pnum.js +0 -3
  808. data/vendor/assets/bower_components/jquery/src/var/push.js +0 -5
  809. data/vendor/assets/bower_components/jquery/src/var/rnotwhite.js +0 -3
  810. data/vendor/assets/bower_components/jquery/src/var/slice.js +0 -5
  811. data/vendor/assets/bower_components/jquery/src/var/strundefined.js +0 -3
  812. data/vendor/assets/bower_components/jquery/src/var/support.js +0 -4
  813. data/vendor/assets/bower_components/jquery/src/var/toString.js +0 -5
  814. data/vendor/assets/bower_components/jquery/src/wrap.js +0 -79
  815. data/vendor/assets/bower_components/jquery-ujs/CHANGELOG.md +0 -24
  816. data/vendor/assets/bower_components/jquery-ujs/MIT-LICENSE.txt +0 -20
  817. data/vendor/assets/bower_components/jquery-ujs/README.md +0 -72
  818. data/vendor/assets/bower_components/jquery-ujs/bower.json +0 -20
  819. data/vendor/assets/bower_components/jquery-ujs/src/rails.js +0 -469
  820. data/vendor/assets/bower_components/typeahead.js/CHANGELOG.md +0 -222
  821. data/vendor/assets/bower_components/typeahead.js/CONTRIBUTING.md +0 -120
  822. data/vendor/assets/bower_components/typeahead.js/Gruntfile.js +0 -265
  823. data/vendor/assets/bower_components/typeahead.js/LICENSE +0 -19
  824. data/vendor/assets/bower_components/typeahead.js/README.md +0 -188
  825. data/vendor/assets/bower_components/typeahead.js/bower.json +0 -13
  826. data/vendor/assets/bower_components/typeahead.js/composer.json +0 -17
  827. data/vendor/assets/bower_components/typeahead.js/dist/bloodhound.js +0 -727
  828. data/vendor/assets/bower_components/typeahead.js/dist/bloodhound.min.js +0 -7
  829. data/vendor/assets/bower_components/typeahead.js/dist/typeahead.bundle.js +0 -1782
  830. data/vendor/assets/bower_components/typeahead.js/dist/typeahead.bundle.min.js +0 -7
  831. data/vendor/assets/bower_components/typeahead.js/dist/typeahead.jquery.js +0 -1184
  832. data/vendor/assets/bower_components/typeahead.js/dist/typeahead.jquery.min.js +0 -7
  833. data/vendor/assets/bower_components/typeahead.js/doc/bloodhound.md +0 -279
  834. data/vendor/assets/bower_components/typeahead.js/doc/jquery_typeahead.md +0 -383
  835. data/vendor/assets/bower_components/typeahead.js/doc/migration/0.10.0.md +0 -234
  836. data/vendor/assets/bower_components/typeahead.js/karma.conf.js +0 -98
  837. data/vendor/assets/bower_components/typeahead.js/package.json +0 -57
  838. data/vendor/assets/bower_components/typeahead.js/src/bloodhound/bloodhound.js +0 -234
  839. data/vendor/assets/bower_components/typeahead.js/src/bloodhound/lru_cache.js +0 -99
  840. data/vendor/assets/bower_components/typeahead.js/src/bloodhound/options_parser.js +0 -89
  841. data/vendor/assets/bower_components/typeahead.js/src/bloodhound/persistent_storage.js +0 -131
  842. data/vendor/assets/bower_components/typeahead.js/src/bloodhound/search_index.js +0 -169
  843. data/vendor/assets/bower_components/typeahead.js/src/bloodhound/tokenizers.js +0 -44
  844. data/vendor/assets/bower_components/typeahead.js/src/bloodhound/transport.js +0 -152
  845. data/vendor/assets/bower_components/typeahead.js/src/bloodhound/version.js +0 -7
  846. data/vendor/assets/bower_components/typeahead.js/src/common/utils.js +0 -152
  847. data/vendor/assets/bower_components/typeahead.js/src/typeahead/css.js +0 -77
  848. data/vendor/assets/bower_components/typeahead.js/src/typeahead/dataset.js +0 -210
  849. data/vendor/assets/bower_components/typeahead.js/src/typeahead/dropdown.js +0 -245
  850. data/vendor/assets/bower_components/typeahead.js/src/typeahead/event_bus.js +0 -38
  851. data/vendor/assets/bower_components/typeahead.js/src/typeahead/event_emitter.js +0 -119
  852. data/vendor/assets/bower_components/typeahead.js/src/typeahead/highlight.js +0 -84
  853. data/vendor/assets/bower_components/typeahead.js/src/typeahead/html.js +0 -15
  854. data/vendor/assets/bower_components/typeahead.js/src/typeahead/input.js +0 -311
  855. data/vendor/assets/bower_components/typeahead.js/src/typeahead/plugin.js +0 -129
  856. data/vendor/assets/bower_components/typeahead.js/src/typeahead/typeahead.js +0 -391
  857. data/vendor/assets/bower_components/typeahead.js/test/bloodhound_spec.js +0 -592
  858. data/vendor/assets/bower_components/typeahead.js/test/ci +0 -12
  859. data/vendor/assets/bower_components/typeahead.js/test/dataset_view_spec.js +0 -222
  860. data/vendor/assets/bower_components/typeahead.js/test/dropdown_view_spec.js +0 -353
  861. data/vendor/assets/bower_components/typeahead.js/test/event_emitter_spec.js +0 -111
  862. data/vendor/assets/bower_components/typeahead.js/test/fixtures/ajax_responses.js +0 -19
  863. data/vendor/assets/bower_components/typeahead.js/test/fixtures/data.js +0 -116
  864. data/vendor/assets/bower_components/typeahead.js/test/fixtures/html.js +0 -17
  865. data/vendor/assets/bower_components/typeahead.js/test/helpers/typeahead_mocks.js +0 -71
  866. data/vendor/assets/bower_components/typeahead.js/test/highlight_spec.js +0 -117
  867. data/vendor/assets/bower_components/typeahead.js/test/input_view_spec.js +0 -449
  868. data/vendor/assets/bower_components/typeahead.js/test/integration/test.html +0 -112
  869. data/vendor/assets/bower_components/typeahead.js/test/integration/test.js +0 -397
  870. data/vendor/assets/bower_components/typeahead.js/test/lru_cache_spec.js +0 -42
  871. data/vendor/assets/bower_components/typeahead.js/test/persistent_storage_spec.js +0 -131
  872. data/vendor/assets/bower_components/typeahead.js/test/playground.html +0 -347
  873. data/vendor/assets/bower_components/typeahead.js/test/search_index_spec.js +0 -60
  874. data/vendor/assets/bower_components/typeahead.js/test/tokenizers_spec.js +0 -60
  875. data/vendor/assets/bower_components/typeahead.js/test/transport_spec.js +0 -197
  876. data/vendor/assets/bower_components/typeahead.js/test/typeahead_view_spec.js +0 -570
  877. data/vendor/assets/bower_components/typeahead.js/typeahead.js.jquery.json +0 -40
  878. data/vendor/assets/images/animated-overlay.gif +0 -0
  879. data/vendor/assets/images/file.gif +0 -0
  880. data/vendor/assets/images/folder-closed.gif +0 -0
  881. data/vendor/assets/images/folder.gif +0 -0
  882. data/vendor/assets/images/minus.gif +0 -0
  883. data/vendor/assets/images/plus.gif +0 -0
  884. data/vendor/assets/images/treeview-black-line.gif +0 -0
  885. data/vendor/assets/images/treeview-black.gif +0 -0
  886. data/vendor/assets/images/treeview-default.gif +0 -0
  887. data/vendor/assets/images/treeview-famfamfam-line.gif +0 -0
  888. data/vendor/assets/images/treeview-famfamfam.gif +0 -0
  889. data/vendor/assets/images/treeview-gray-line.gif +0 -0
  890. data/vendor/assets/images/treeview-gray.gif +0 -0
  891. data/vendor/assets/images/treeview-red-line.gif +0 -0
  892. data/vendor/assets/images/treeview-red.gif +0 -0
  893. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/css/bootstrap-datepicker.css +0 -471
  894. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/css/bootstrap-datepicker.css.map +0 -1
  895. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/css/bootstrap-datepicker.min.css +0 -9
  896. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/css/bootstrap-datepicker.min.css.map +0 -1
  897. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/css/bootstrap-datepicker.standalone.css +0 -504
  898. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/css/bootstrap-datepicker.standalone.css.map +0 -1
  899. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/css/bootstrap-datepicker.standalone.min.css +0 -9
  900. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/css/bootstrap-datepicker.standalone.min.css.map +0 -1
  901. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/css/bootstrap-datepicker3.css +0 -678
  902. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/css/bootstrap-datepicker3.css.map +0 -1
  903. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/css/bootstrap-datepicker3.min.css +0 -9
  904. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/css/bootstrap-datepicker3.min.css.map +0 -1
  905. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/css/bootstrap-datepicker3.standalone.css +0 -707
  906. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/css/bootstrap-datepicker3.standalone.css.map +0 -1
  907. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/css/bootstrap-datepicker3.standalone.min.css +0 -9
  908. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/css/bootstrap-datepicker3.standalone.min.css.map +0 -1
  909. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/js/bootstrap-datepicker.js +0 -2096
  910. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/js/bootstrap-datepicker.min.js +0 -9
  911. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.ar.min.js +0 -1
  912. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.az.min.js +0 -1
  913. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.bg.min.js +0 -1
  914. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.bs.min.js +0 -1
  915. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.ca.min.js +0 -1
  916. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.cs.min.js +0 -1
  917. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.cy.min.js +0 -1
  918. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.da.min.js +0 -1
  919. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.de.min.js +0 -1
  920. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.el.min.js +0 -1
  921. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.en-AU.min.js +0 -1
  922. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.en-GB.min.js +0 -1
  923. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.eo.min.js +0 -1
  924. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.es.min.js +0 -1
  925. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.et.min.js +0 -1
  926. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.eu.min.js +0 -1
  927. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.fa.min.js +0 -1
  928. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.fi.min.js +0 -1
  929. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.fo.min.js +0 -1
  930. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.fr-CH.min.js +0 -1
  931. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.fr.min.js +0 -1
  932. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.gl.min.js +0 -1
  933. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.he.min.js +0 -1
  934. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.hr.min.js +0 -1
  935. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.hu.min.js +0 -1
  936. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.hy.min.js +0 -1
  937. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.id.min.js +0 -1
  938. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.is.min.js +0 -1
  939. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.it-CH.min.js +0 -1
  940. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.it.min.js +0 -1
  941. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.ja.min.js +0 -1
  942. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.ka.min.js +0 -1
  943. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.kh.min.js +0 -1
  944. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.kk.min.js +0 -1
  945. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.ko.min.js +0 -1
  946. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.kr.min.js +0 -1
  947. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.lt.min.js +0 -1
  948. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.lv.min.js +0 -1
  949. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.me.min.js +0 -1
  950. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.mk.min.js +0 -1
  951. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.mn.min.js +0 -1
  952. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.ms.min.js +0 -1
  953. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.nb.min.js +0 -1
  954. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.nl-BE.min.js +0 -1
  955. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.nl.min.js +0 -1
  956. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.no.min.js +0 -1
  957. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.pl.min.js +0 -1
  958. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.pt-BR.min.js +0 -1
  959. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.pt.min.js +0 -1
  960. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.ro.min.js +0 -1
  961. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.rs-latin.min.js +0 -1
  962. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.rs.min.js +0 -1
  963. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.ru.min.js +0 -1
  964. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.sk.min.js +0 -1
  965. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.sl.min.js +0 -1
  966. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.sq.min.js +0 -1
  967. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.sr-latin.min.js +0 -1
  968. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.sr.min.js +0 -1
  969. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.sv.min.js +0 -1
  970. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.sw.min.js +0 -1
  971. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.th.min.js +0 -1
  972. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.tr.min.js +0 -1
  973. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.uk.min.js +0 -1
  974. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.vi.min.js +0 -1
  975. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.zh-CN.min.js +0 -1
  976. data/vendor/assets/javascripts/bootstrap-datepicker-1.6.4-dist/locales/bootstrap-datepicker.zh-TW.min.js +0 -1
  977. data/vendor/assets/javascripts/storage.js +0 -122
@@ -1,3388 +0,0 @@
1
- (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
2
- (function() {
3
- var DragAndDropHandler, DragElement, HitAreasGenerator, Position, VisibleNodeIterator, node_module,
4
- __hasProp = {}.hasOwnProperty,
5
- __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
6
-
7
- node_module = require('./node');
8
-
9
- Position = node_module.Position;
10
-
11
- DragAndDropHandler = (function() {
12
- function DragAndDropHandler(tree_widget) {
13
- this.tree_widget = tree_widget;
14
- this.hovered_area = null;
15
- this.$ghost = null;
16
- this.hit_areas = [];
17
- this.is_dragging = false;
18
- this.current_item = null;
19
- }
20
-
21
- DragAndDropHandler.prototype.mouseCapture = function(position_info) {
22
- var $element, node_element;
23
- $element = $(position_info.target);
24
- if (!this.mustCaptureElement($element)) {
25
- return null;
26
- }
27
- if (this.tree_widget.options.onIsMoveHandle && !this.tree_widget.options.onIsMoveHandle($element)) {
28
- return null;
29
- }
30
- node_element = this.tree_widget._getNodeElement($element);
31
- if (node_element && this.tree_widget.options.onCanMove) {
32
- if (!this.tree_widget.options.onCanMove(node_element.node)) {
33
- node_element = null;
34
- }
35
- }
36
- this.current_item = node_element;
37
- return this.current_item !== null;
38
- };
39
-
40
- DragAndDropHandler.prototype.mouseStart = function(position_info) {
41
- var offset;
42
- this.refresh();
43
- offset = $(position_info.target).offset();
44
- this.drag_element = new DragElement(this.current_item.node, position_info.page_x - offset.left, position_info.page_y - offset.top, this.tree_widget.element);
45
- this.is_dragging = true;
46
- this.current_item.$element.addClass('jqtree-moving');
47
- return true;
48
- };
49
-
50
- DragAndDropHandler.prototype.mouseDrag = function(position_info) {
51
- var area, can_move_to;
52
- this.drag_element.move(position_info.page_x, position_info.page_y);
53
- area = this.findHoveredArea(position_info.page_x, position_info.page_y);
54
- can_move_to = this.canMoveToArea(area);
55
- if (can_move_to && area) {
56
- if (!area.node.isFolder()) {
57
- this.stopOpenFolderTimer();
58
- }
59
- if (this.hovered_area !== area) {
60
- this.hovered_area = area;
61
- if (this.mustOpenFolderTimer(area)) {
62
- this.startOpenFolderTimer(area.node);
63
- } else {
64
- this.stopOpenFolderTimer();
65
- }
66
- this.updateDropHint();
67
- }
68
- } else {
69
- this.removeHover();
70
- this.removeDropHint();
71
- this.stopOpenFolderTimer();
72
- }
73
- return true;
74
- };
75
-
76
- DragAndDropHandler.prototype.mustCaptureElement = function($element) {
77
- return !$element.is('input,select');
78
- };
79
-
80
- DragAndDropHandler.prototype.canMoveToArea = function(area) {
81
- var position_name;
82
- if (!area) {
83
- return false;
84
- } else if (this.tree_widget.options.onCanMoveTo) {
85
- position_name = Position.getName(area.position);
86
- return this.tree_widget.options.onCanMoveTo(this.current_item.node, area.node, position_name);
87
- } else {
88
- return true;
89
- }
90
- };
91
-
92
- DragAndDropHandler.prototype.mouseStop = function(position_info) {
93
- this.moveItem(position_info);
94
- this.clear();
95
- this.removeHover();
96
- this.removeDropHint();
97
- this.removeHitAreas();
98
- if (this.current_item) {
99
- this.current_item.$element.removeClass('jqtree-moving');
100
- this.current_item = null;
101
- }
102
- this.is_dragging = false;
103
- return false;
104
- };
105
-
106
- DragAndDropHandler.prototype.refresh = function() {
107
- this.removeHitAreas();
108
- if (this.current_item) {
109
- this.generateHitAreas();
110
- this.current_item = this.tree_widget._getNodeElementForNode(this.current_item.node);
111
- if (this.is_dragging) {
112
- return this.current_item.$element.addClass('jqtree-moving');
113
- }
114
- }
115
- };
116
-
117
- DragAndDropHandler.prototype.removeHitAreas = function() {
118
- return this.hit_areas = [];
119
- };
120
-
121
- DragAndDropHandler.prototype.clear = function() {
122
- this.drag_element.remove();
123
- return this.drag_element = null;
124
- };
125
-
126
- DragAndDropHandler.prototype.removeDropHint = function() {
127
- if (this.previous_ghost) {
128
- return this.previous_ghost.remove();
129
- }
130
- };
131
-
132
- DragAndDropHandler.prototype.removeHover = function() {
133
- return this.hovered_area = null;
134
- };
135
-
136
- DragAndDropHandler.prototype.generateHitAreas = function() {
137
- var hit_areas_generator;
138
- hit_areas_generator = new HitAreasGenerator(this.tree_widget.tree, this.current_item.node, this.getTreeDimensions().bottom);
139
- return this.hit_areas = hit_areas_generator.generate();
140
- };
141
-
142
- DragAndDropHandler.prototype.findHoveredArea = function(x, y) {
143
- var area, dimensions, high, low, mid;
144
- dimensions = this.getTreeDimensions();
145
- if (x < dimensions.left || y < dimensions.top || x > dimensions.right || y > dimensions.bottom) {
146
- return null;
147
- }
148
- low = 0;
149
- high = this.hit_areas.length;
150
- while (low < high) {
151
- mid = (low + high) >> 1;
152
- area = this.hit_areas[mid];
153
- if (y < area.top) {
154
- high = mid;
155
- } else if (y > area.bottom) {
156
- low = mid + 1;
157
- } else {
158
- return area;
159
- }
160
- }
161
- return null;
162
- };
163
-
164
- DragAndDropHandler.prototype.mustOpenFolderTimer = function(area) {
165
- var node;
166
- node = area.node;
167
- return node.isFolder() && !node.is_open && area.position === Position.INSIDE;
168
- };
169
-
170
- DragAndDropHandler.prototype.updateDropHint = function() {
171
- var node_element;
172
- if (!this.hovered_area) {
173
- return;
174
- }
175
- this.removeDropHint();
176
- node_element = this.tree_widget._getNodeElementForNode(this.hovered_area.node);
177
- return this.previous_ghost = node_element.addDropHint(this.hovered_area.position);
178
- };
179
-
180
- DragAndDropHandler.prototype.startOpenFolderTimer = function(folder) {
181
- var openFolder;
182
- openFolder = (function(_this) {
183
- return function() {
184
- return _this.tree_widget._openNode(folder, _this.tree_widget.options.slide, function() {
185
- _this.refresh();
186
- return _this.updateDropHint();
187
- });
188
- };
189
- })(this);
190
- this.stopOpenFolderTimer();
191
- return this.open_folder_timer = setTimeout(openFolder, this.tree_widget.options.openFolderDelay);
192
- };
193
-
194
- DragAndDropHandler.prototype.stopOpenFolderTimer = function() {
195
- if (this.open_folder_timer) {
196
- clearTimeout(this.open_folder_timer);
197
- return this.open_folder_timer = null;
198
- }
199
- };
200
-
201
- DragAndDropHandler.prototype.moveItem = function(position_info) {
202
- var doMove, event, moved_node, position, previous_parent, target_node;
203
- if (this.hovered_area && this.hovered_area.position !== Position.NONE && this.canMoveToArea(this.hovered_area)) {
204
- moved_node = this.current_item.node;
205
- target_node = this.hovered_area.node;
206
- position = this.hovered_area.position;
207
- previous_parent = moved_node.parent;
208
- if (position === Position.INSIDE) {
209
- this.hovered_area.node.is_open = true;
210
- }
211
- doMove = (function(_this) {
212
- return function() {
213
- _this.tree_widget.tree.moveNode(moved_node, target_node, position);
214
- _this.tree_widget.element.empty();
215
- return _this.tree_widget._refreshElements();
216
- };
217
- })(this);
218
- event = this.tree_widget._triggerEvent('tree.move', {
219
- move_info: {
220
- moved_node: moved_node,
221
- target_node: target_node,
222
- position: Position.getName(position),
223
- previous_parent: previous_parent,
224
- do_move: doMove,
225
- original_event: position_info.original_event
226
- }
227
- });
228
- if (!event.isDefaultPrevented()) {
229
- return doMove();
230
- }
231
- }
232
- };
233
-
234
- DragAndDropHandler.prototype.getTreeDimensions = function() {
235
- var offset;
236
- offset = this.tree_widget.element.offset();
237
- return {
238
- left: offset.left,
239
- top: offset.top,
240
- right: offset.left + this.tree_widget.element.width(),
241
- bottom: offset.top + this.tree_widget.element.height() + 16
242
- };
243
- };
244
-
245
- return DragAndDropHandler;
246
-
247
- })();
248
-
249
- VisibleNodeIterator = (function() {
250
- function VisibleNodeIterator(tree) {
251
- this.tree = tree;
252
- }
253
-
254
- VisibleNodeIterator.prototype.iterate = function() {
255
- var is_first_node, _iterateNode;
256
- is_first_node = true;
257
- _iterateNode = (function(_this) {
258
- return function(node, next_node) {
259
- var $element, child, children_length, i, must_iterate_inside, _i, _len, _ref;
260
- must_iterate_inside = (node.is_open || !node.element) && node.hasChildren();
261
- if (node.element) {
262
- $element = $(node.element);
263
- if (!$element.is(':visible')) {
264
- return;
265
- }
266
- if (is_first_node) {
267
- _this.handleFirstNode(node, $element);
268
- is_first_node = false;
269
- }
270
- if (!node.hasChildren()) {
271
- _this.handleNode(node, next_node, $element);
272
- } else if (node.is_open) {
273
- if (!_this.handleOpenFolder(node, $element)) {
274
- must_iterate_inside = false;
275
- }
276
- } else {
277
- _this.handleClosedFolder(node, next_node, $element);
278
- }
279
- }
280
- if (must_iterate_inside) {
281
- children_length = node.children.length;
282
- _ref = node.children;
283
- for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) {
284
- child = _ref[i];
285
- if (i === (children_length - 1)) {
286
- _iterateNode(node.children[i], null);
287
- } else {
288
- _iterateNode(node.children[i], node.children[i + 1]);
289
- }
290
- }
291
- if (node.is_open) {
292
- return _this.handleAfterOpenFolder(node, next_node, $element);
293
- }
294
- }
295
- };
296
- })(this);
297
- return _iterateNode(this.tree, null);
298
- };
299
-
300
- VisibleNodeIterator.prototype.handleNode = function(node, next_node, $element) {};
301
-
302
- VisibleNodeIterator.prototype.handleOpenFolder = function(node, $element) {};
303
-
304
- VisibleNodeIterator.prototype.handleClosedFolder = function(node, next_node, $element) {};
305
-
306
- VisibleNodeIterator.prototype.handleAfterOpenFolder = function(node, next_node, $element) {};
307
-
308
- VisibleNodeIterator.prototype.handleFirstNode = function(node, $element) {};
309
-
310
- return VisibleNodeIterator;
311
-
312
- })();
313
-
314
- HitAreasGenerator = (function(_super) {
315
- __extends(HitAreasGenerator, _super);
316
-
317
- function HitAreasGenerator(tree, current_node, tree_bottom) {
318
- HitAreasGenerator.__super__.constructor.call(this, tree);
319
- this.current_node = current_node;
320
- this.tree_bottom = tree_bottom;
321
- }
322
-
323
- HitAreasGenerator.prototype.generate = function() {
324
- this.positions = [];
325
- this.last_top = 0;
326
- this.iterate();
327
- return this.generateHitAreas(this.positions);
328
- };
329
-
330
- HitAreasGenerator.prototype.getTop = function($element) {
331
- return $element.offset().top;
332
- };
333
-
334
- HitAreasGenerator.prototype.addPosition = function(node, position, top) {
335
- var area;
336
- area = {
337
- top: top,
338
- node: node,
339
- position: position
340
- };
341
- this.positions.push(area);
342
- return this.last_top = top;
343
- };
344
-
345
- HitAreasGenerator.prototype.handleNode = function(node, next_node, $element) {
346
- var top;
347
- top = this.getTop($element);
348
- if (node === this.current_node) {
349
- this.addPosition(node, Position.NONE, top);
350
- } else {
351
- this.addPosition(node, Position.INSIDE, top);
352
- }
353
- if (next_node === this.current_node || node === this.current_node) {
354
- return this.addPosition(node, Position.NONE, top);
355
- } else {
356
- return this.addPosition(node, Position.AFTER, top);
357
- }
358
- };
359
-
360
- HitAreasGenerator.prototype.handleOpenFolder = function(node, $element) {
361
- if (node === this.current_node) {
362
- return false;
363
- }
364
- if (node.children[0] !== this.current_node) {
365
- this.addPosition(node, Position.INSIDE, this.getTop($element));
366
- }
367
- return true;
368
- };
369
-
370
- HitAreasGenerator.prototype.handleClosedFolder = function(node, next_node, $element) {
371
- var top;
372
- top = this.getTop($element);
373
- if (node === this.current_node) {
374
- return this.addPosition(node, Position.NONE, top);
375
- } else {
376
- this.addPosition(node, Position.INSIDE, top);
377
- if (next_node !== this.current_node) {
378
- return this.addPosition(node, Position.AFTER, top);
379
- }
380
- }
381
- };
382
-
383
- HitAreasGenerator.prototype.handleFirstNode = function(node, $element) {
384
- if (node !== this.current_node) {
385
- return this.addPosition(node, Position.BEFORE, this.getTop($(node.element)));
386
- }
387
- };
388
-
389
- HitAreasGenerator.prototype.handleAfterOpenFolder = function(node, next_node, $element) {
390
- if (node === this.current_node.node || next_node === this.current_node.node) {
391
- return this.addPosition(node, Position.NONE, this.last_top);
392
- } else {
393
- return this.addPosition(node, Position.AFTER, this.last_top);
394
- }
395
- };
396
-
397
- HitAreasGenerator.prototype.generateHitAreas = function(positions) {
398
- var group, hit_areas, position, previous_top, _i, _len;
399
- previous_top = -1;
400
- group = [];
401
- hit_areas = [];
402
- for (_i = 0, _len = positions.length; _i < _len; _i++) {
403
- position = positions[_i];
404
- if (position.top !== previous_top && group.length) {
405
- if (group.length) {
406
- this.generateHitAreasForGroup(hit_areas, group, previous_top, position.top);
407
- }
408
- previous_top = position.top;
409
- group = [];
410
- }
411
- group.push(position);
412
- }
413
- this.generateHitAreasForGroup(hit_areas, group, previous_top, this.tree_bottom);
414
- return hit_areas;
415
- };
416
-
417
- HitAreasGenerator.prototype.generateHitAreasForGroup = function(hit_areas, positions_in_group, top, bottom) {
418
- var area_height, area_top, i, position, position_count;
419
- position_count = Math.min(positions_in_group.length, 4);
420
- area_height = Math.round((bottom - top) / position_count);
421
- area_top = top;
422
- i = 0;
423
- while (i < position_count) {
424
- position = positions_in_group[i];
425
- hit_areas.push({
426
- top: area_top,
427
- bottom: area_top + area_height,
428
- node: position.node,
429
- position: position.position
430
- });
431
- area_top += area_height;
432
- i += 1;
433
- }
434
- return null;
435
- };
436
-
437
- return HitAreasGenerator;
438
-
439
- })(VisibleNodeIterator);
440
-
441
- DragElement = (function() {
442
- function DragElement(node, offset_x, offset_y, $tree) {
443
- this.offset_x = offset_x;
444
- this.offset_y = offset_y;
445
- this.$element = $("<span class=\"jqtree-title jqtree-dragging\">" + node.name + "</span>");
446
- this.$element.css("position", "absolute");
447
- $tree.append(this.$element);
448
- }
449
-
450
- DragElement.prototype.move = function(page_x, page_y) {
451
- return this.$element.offset({
452
- left: page_x - this.offset_x,
453
- top: page_y - this.offset_y
454
- });
455
- };
456
-
457
- DragElement.prototype.remove = function() {
458
- return this.$element.remove();
459
- };
460
-
461
- return DragElement;
462
-
463
- })();
464
-
465
- module.exports = DragAndDropHandler;
466
-
467
- }).call(this);
468
-
469
- },{"./node":6}],2:[function(require,module,exports){
470
- (function() {
471
- var ElementsRenderer, NodeElement, html_escape, node_element, util;
472
-
473
- node_element = require('./node_element');
474
-
475
- NodeElement = node_element.NodeElement;
476
-
477
- util = require('./util');
478
-
479
- html_escape = util.html_escape;
480
-
481
- ElementsRenderer = (function() {
482
- function ElementsRenderer(tree_widget) {
483
- this.tree_widget = tree_widget;
484
- this.opened_icon_element = this.createButtonElement(tree_widget.options.openedIcon);
485
- this.closed_icon_element = this.createButtonElement(tree_widget.options.closedIcon);
486
- }
487
-
488
- ElementsRenderer.prototype.render = function(from_node) {
489
- if (from_node && from_node.parent) {
490
- return this.renderFromNode(from_node);
491
- } else {
492
- return this.renderFromRoot();
493
- }
494
- };
495
-
496
- ElementsRenderer.prototype.renderFromRoot = function() {
497
- var $element;
498
- $element = this.tree_widget.element;
499
- $element.empty();
500
- return this.createDomElements($element[0], this.tree_widget.tree.children, true, true);
501
- };
502
-
503
- ElementsRenderer.prototype.renderFromNode = function(node) {
504
- var $previous_li, li, parent_node_element;
505
- $previous_li = $(node.element);
506
- parent_node_element = new NodeElement(node.parent, this.tree_widget);
507
- li = this.createLi(node);
508
- this.attachNodeData(node, li);
509
- $previous_li.after(li);
510
- $previous_li.remove();
511
- if (node.children) {
512
- return this.createDomElements(li, node.children, false, false);
513
- }
514
- };
515
-
516
- ElementsRenderer.prototype.createDomElements = function(element, children, is_root_node, is_open) {
517
- var child, li, ul, _i, _len;
518
- ul = this.createUl(is_root_node);
519
- element.appendChild(ul);
520
- for (_i = 0, _len = children.length; _i < _len; _i++) {
521
- child = children[_i];
522
- li = this.createLi(child);
523
- ul.appendChild(li);
524
- this.attachNodeData(child, li);
525
- if (child.hasChildren()) {
526
- this.createDomElements(li, child.children, false, child.is_open);
527
- }
528
- }
529
- return null;
530
- };
531
-
532
- ElementsRenderer.prototype.attachNodeData = function(node, li) {
533
- node.element = li;
534
- return $(li).data('node', node);
535
- };
536
-
537
- ElementsRenderer.prototype.createUl = function(is_root_node) {
538
- var class_string, ul;
539
- if (is_root_node) {
540
- class_string = 'jqtree-tree';
541
- } else {
542
- class_string = '';
543
- }
544
- ul = document.createElement('ul');
545
- ul.className = "jqtree_common " + class_string;
546
- return ul;
547
- };
548
-
549
- ElementsRenderer.prototype.createLi = function(node) {
550
- var li;
551
- if (node.isFolder()) {
552
- li = this.createFolderLi(node);
553
- } else {
554
- li = this.createNodeLi(node);
555
- }
556
- if (this.tree_widget.options.onCreateLi) {
557
- this.tree_widget.options.onCreateLi(node, $(li));
558
- }
559
- return li;
560
- };
561
-
562
- ElementsRenderer.prototype.createFolderLi = function(node) {
563
- var button_classes, button_link, div, escaped_name, folder_classes, icon_element, li, title_span;
564
- button_classes = this.getButtonClasses(node);
565
- folder_classes = this.getFolderClasses(node);
566
- escaped_name = this.escapeIfNecessary(node.name);
567
- if (node.is_open) {
568
- icon_element = this.opened_icon_element;
569
- } else {
570
- icon_element = this.closed_icon_element;
571
- }
572
- li = document.createElement('li');
573
- li.className = "jqtree_common " + folder_classes;
574
- div = document.createElement('div');
575
- div.className = "jqtree-element jqtree_common";
576
- li.appendChild(div);
577
- button_link = document.createElement('a');
578
- button_link.className = "jqtree_common " + button_classes;
579
- button_link.appendChild(icon_element.cloneNode(false));
580
- div.appendChild(button_link);
581
- title_span = document.createElement('span');
582
- title_span.className = "jqtree_common jqtree-title jqtree-title-folder";
583
- div.appendChild(title_span);
584
- title_span.innerHTML = escaped_name;
585
- return li;
586
- };
587
-
588
- ElementsRenderer.prototype.createNodeLi = function(node) {
589
- var class_string, div, escaped_name, li, li_classes, title_span;
590
- li_classes = ['jqtree_common'];
591
- if (this.tree_widget.select_node_handler && this.tree_widget.select_node_handler.isNodeSelected(node)) {
592
- li_classes.push('jqtree-selected');
593
- }
594
- class_string = li_classes.join(' ');
595
- escaped_name = this.escapeIfNecessary(node.name);
596
- li = document.createElement('li');
597
- li.className = class_string;
598
- div = document.createElement('div');
599
- div.className = "jqtree-element jqtree_common";
600
- li.appendChild(div);
601
- title_span = document.createElement('span');
602
- title_span.className = "jqtree-title jqtree_common";
603
- title_span.innerHTML = escaped_name;
604
- div.appendChild(title_span);
605
- return li;
606
- };
607
-
608
- ElementsRenderer.prototype.getButtonClasses = function(node) {
609
- var classes;
610
- classes = ['jqtree-toggler'];
611
- if (!node.is_open) {
612
- classes.push('jqtree-closed');
613
- }
614
- return classes.join(' ');
615
- };
616
-
617
- ElementsRenderer.prototype.getFolderClasses = function(node) {
618
- var classes;
619
- classes = ['jqtree-folder'];
620
- if (!node.is_open) {
621
- classes.push('jqtree-closed');
622
- }
623
- if (this.tree_widget.select_node_handler && this.tree_widget.select_node_handler.isNodeSelected(node)) {
624
- classes.push('jqtree-selected');
625
- }
626
- if (node.is_loading) {
627
- classes.push('jqtree-loading');
628
- }
629
- return classes.join(' ');
630
- };
631
-
632
- ElementsRenderer.prototype.escapeIfNecessary = function(value) {
633
- if (this.tree_widget.options.autoEscape) {
634
- return html_escape(value);
635
- } else {
636
- return value;
637
- }
638
- };
639
-
640
- ElementsRenderer.prototype.createButtonElement = function(value) {
641
- var div;
642
- if (typeof value === 'string') {
643
- div = document.createElement('div');
644
- div.innerHTML = value;
645
- return document.createTextNode(div.innerHTML);
646
- } else {
647
- return $(value)[0];
648
- }
649
- };
650
-
651
- return ElementsRenderer;
652
-
653
- })();
654
-
655
- module.exports = ElementsRenderer;
656
-
657
- }).call(this);
658
-
659
- },{"./node_element":7,"./util":12}],3:[function(require,module,exports){
660
-
661
- /*
662
- Copyright 2013 Marco Braak
663
-
664
- Licensed under the Apache License, Version 2.0 (the "License");
665
- you may not use this file except in compliance with the License.
666
- You may obtain a copy of the License at
667
-
668
- http://www.apache.org/licenses/LICENSE-2.0
669
-
670
- Unless required by applicable law or agreed to in writing, software
671
- distributed under the License is distributed on an "AS IS" BASIS,
672
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
673
- See the License for the specific language governing permissions and
674
- limitations under the License.
675
- */
676
-
677
- (function() {
678
- var DragAndDropHandler, ElementsRenderer, FolderElement, JqTreeWidget, KeyHandler, MouseWidget, Node, NodeElement, Position, SaveStateHandler, ScrollHandler, SelectNodeHandler, SimpleWidget, node, node_element, __version__,
679
- __hasProp = {}.hasOwnProperty,
680
- __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
681
-
682
- __version__ = require('./version');
683
-
684
- DragAndDropHandler = require('./drag_and_drop_handler');
685
-
686
- ElementsRenderer = require('./elements_renderer');
687
-
688
- KeyHandler = require('./key_handler');
689
-
690
- MouseWidget = require('./mouse.widget');
691
-
692
- SaveStateHandler = require('./save_state_handler');
693
-
694
- ScrollHandler = require('./scroll_handler');
695
-
696
- SelectNodeHandler = require('./select_node_handler');
697
-
698
- SimpleWidget = require('./simple.widget');
699
-
700
- node = require('./node');
701
-
702
- Node = node.Node;
703
-
704
- Position = node.Position;
705
-
706
- node_element = require('./node_element');
707
-
708
- NodeElement = node_element.NodeElement;
709
-
710
- FolderElement = node_element.FolderElement;
711
-
712
- JqTreeWidget = (function(_super) {
713
- __extends(JqTreeWidget, _super);
714
-
715
- function JqTreeWidget() {
716
- return JqTreeWidget.__super__.constructor.apply(this, arguments);
717
- }
718
-
719
- JqTreeWidget.prototype.defaults = {
720
- autoOpen: false,
721
- saveState: false,
722
- dragAndDrop: false,
723
- selectable: true,
724
- useContextMenu: true,
725
- onCanSelectNode: null,
726
- onSetStateFromStorage: null,
727
- onGetStateFromStorage: null,
728
- onCreateLi: null,
729
- onIsMoveHandle: null,
730
- onCanMove: null,
731
- onCanMoveTo: null,
732
- onLoadFailed: null,
733
- autoEscape: true,
734
- dataUrl: null,
735
- closedIcon: '&#x25ba;',
736
- openedIcon: '&#x25bc;',
737
- slide: true,
738
- nodeClass: Node,
739
- dataFilter: null,
740
- keyboardSupport: true,
741
- openFolderDelay: 500
742
- };
743
-
744
- JqTreeWidget.prototype.toggle = function(node, slide) {
745
- if (slide == null) {
746
- slide = null;
747
- }
748
- if (slide === null) {
749
- slide = this.options.slide;
750
- }
751
- if (node.is_open) {
752
- return this.closeNode(node, slide);
753
- } else {
754
- return this.openNode(node, slide);
755
- }
756
- };
757
-
758
- JqTreeWidget.prototype.getTree = function() {
759
- return this.tree;
760
- };
761
-
762
- JqTreeWidget.prototype.selectNode = function(node) {
763
- return this._selectNode(node, false);
764
- };
765
-
766
- JqTreeWidget.prototype._selectNode = function(node, must_toggle) {
767
- var canSelect, deselected_node, openParents, saveState;
768
- if (must_toggle == null) {
769
- must_toggle = false;
770
- }
771
- if (!this.select_node_handler) {
772
- return;
773
- }
774
- canSelect = (function(_this) {
775
- return function() {
776
- if (_this.options.onCanSelectNode) {
777
- return _this.options.selectable && _this.options.onCanSelectNode(node);
778
- } else {
779
- return _this.options.selectable;
780
- }
781
- };
782
- })(this);
783
- openParents = (function(_this) {
784
- return function() {
785
- var parent;
786
- parent = node.parent;
787
- if (parent && parent.parent && !parent.is_open) {
788
- return _this.openNode(parent, false);
789
- }
790
- };
791
- })(this);
792
- saveState = (function(_this) {
793
- return function() {
794
- if (_this.options.saveState) {
795
- return _this.save_state_handler.saveState();
796
- }
797
- };
798
- })(this);
799
- if (!node) {
800
- this._deselectCurrentNode();
801
- saveState();
802
- return;
803
- }
804
- if (!canSelect()) {
805
- return;
806
- }
807
- if (this.select_node_handler.isNodeSelected(node)) {
808
- if (must_toggle) {
809
- this._deselectCurrentNode();
810
- this._triggerEvent('tree.select', {
811
- node: null,
812
- previous_node: node
813
- });
814
- }
815
- } else {
816
- deselected_node = this.getSelectedNode();
817
- this._deselectCurrentNode();
818
- this.addToSelection(node);
819
- this._triggerEvent('tree.select', {
820
- node: node,
821
- deselected_node: deselected_node
822
- });
823
- openParents();
824
- }
825
- return saveState();
826
- };
827
-
828
- JqTreeWidget.prototype.getSelectedNode = function() {
829
- if (this.select_node_handler) {
830
- return this.select_node_handler.getSelectedNode();
831
- } else {
832
- return null;
833
- }
834
- };
835
-
836
- JqTreeWidget.prototype.toJson = function() {
837
- return JSON.stringify(this.tree.getData());
838
- };
839
-
840
- JqTreeWidget.prototype.loadData = function(data, parent_node) {
841
- return this._loadData(data, parent_node);
842
- };
843
-
844
- JqTreeWidget.prototype.loadDataFromUrl = function(url, parent_node, on_finished) {
845
- if ($.type(url) !== 'string') {
846
- on_finished = parent_node;
847
- parent_node = url;
848
- url = null;
849
- }
850
- return this._loadDataFromUrl(url, parent_node, on_finished);
851
- };
852
-
853
- JqTreeWidget.prototype.reload = function() {
854
- return this.loadDataFromUrl();
855
- };
856
-
857
- JqTreeWidget.prototype._loadDataFromUrl = function(url_info, parent_node, on_finished) {
858
- var $el, addLoadingClass, handeLoadData, loadDataFromUrlInfo, parseUrlInfo, removeLoadingClass;
859
- $el = null;
860
- addLoadingClass = (function(_this) {
861
- return function() {
862
- if (parent_node) {
863
- $el = $(parent_node.element);
864
- } else {
865
- $el = _this.element;
866
- }
867
- return $el.addClass('jqtree-loading');
868
- };
869
- })(this);
870
- removeLoadingClass = function() {
871
- if ($el) {
872
- return $el.removeClass('jqtree-loading');
873
- }
874
- };
875
- parseUrlInfo = function() {
876
- if ($.type(url_info) === 'string') {
877
- url_info = {
878
- url: url_info
879
- };
880
- }
881
- if (!url_info.method) {
882
- return url_info.method = 'get';
883
- }
884
- };
885
- handeLoadData = (function(_this) {
886
- return function(data) {
887
- removeLoadingClass();
888
- _this._loadData(data, parent_node);
889
- if (on_finished && $.isFunction(on_finished)) {
890
- return on_finished();
891
- }
892
- };
893
- })(this);
894
- loadDataFromUrlInfo = (function(_this) {
895
- return function() {
896
- parseUrlInfo();
897
- return $.ajax({
898
- url: url_info.url,
899
- data: url_info.data,
900
- type: url_info.method.toUpperCase(),
901
- cache: false,
902
- dataType: 'json',
903
- success: function(response) {
904
- var data;
905
- if ($.isArray(response) || typeof response === 'object') {
906
- data = response;
907
- } else {
908
- data = $.parseJSON(response);
909
- }
910
- if (_this.options.dataFilter) {
911
- data = _this.options.dataFilter(data);
912
- }
913
- return handeLoadData(data);
914
- },
915
- error: function(response) {
916
- removeLoadingClass();
917
- if (_this.options.onLoadFailed) {
918
- return _this.options.onLoadFailed(response);
919
- }
920
- }
921
- });
922
- };
923
- })(this);
924
- if (!url_info) {
925
- url_info = this._getDataUrlInfo(parent_node);
926
- }
927
- addLoadingClass();
928
- if (!url_info) {
929
- removeLoadingClass();
930
- } else if ($.isArray(url_info)) {
931
- handeLoadData(url_info);
932
- } else {
933
- return loadDataFromUrlInfo();
934
- }
935
- };
936
-
937
- JqTreeWidget.prototype._loadData = function(data, parent_node) {
938
- var deselectNodes, loadSubtree;
939
- if (parent_node == null) {
940
- parent_node = null;
941
- }
942
- deselectNodes = (function(_this) {
943
- return function() {
944
- var n, selected_nodes_under_parent, _i, _len;
945
- if (_this.select_node_handler) {
946
- selected_nodes_under_parent = _this.select_node_handler.getSelectedNodesUnder(parent_node);
947
- for (_i = 0, _len = selected_nodes_under_parent.length; _i < _len; _i++) {
948
- n = selected_nodes_under_parent[_i];
949
- _this.select_node_handler.removeFromSelection(n);
950
- }
951
- }
952
- return null;
953
- };
954
- })(this);
955
- loadSubtree = (function(_this) {
956
- return function() {
957
- parent_node.loadFromData(data);
958
- parent_node.load_on_demand = false;
959
- parent_node.is_loading = false;
960
- return _this._refreshElements(parent_node);
961
- };
962
- })(this);
963
- if (!data) {
964
- return;
965
- }
966
- this._triggerEvent('tree.load_data', {
967
- tree_data: data
968
- });
969
- if (!parent_node) {
970
- this._initTree(data);
971
- } else {
972
- deselectNodes();
973
- loadSubtree();
974
- }
975
- if (this.isDragging()) {
976
- return this.dnd_handler.refresh();
977
- }
978
- };
979
-
980
- JqTreeWidget.prototype.getNodeById = function(node_id) {
981
- return this.tree.getNodeById(node_id);
982
- };
983
-
984
- JqTreeWidget.prototype.getNodeByName = function(name) {
985
- return this.tree.getNodeByName(name);
986
- };
987
-
988
- JqTreeWidget.prototype.getNodesByProperty = function(key, value) {
989
- return this.tree.getNodesByProperty(key, value);
990
- };
991
-
992
- JqTreeWidget.prototype.openNode = function(node, slide) {
993
- if (slide == null) {
994
- slide = null;
995
- }
996
- if (slide === null) {
997
- slide = this.options.slide;
998
- }
999
- return this._openNode(node, slide);
1000
- };
1001
-
1002
- JqTreeWidget.prototype._openNode = function(node, slide, on_finished) {
1003
- var doOpenNode, parent;
1004
- if (slide == null) {
1005
- slide = true;
1006
- }
1007
- doOpenNode = (function(_this) {
1008
- return function(_node, _slide, _on_finished) {
1009
- var folder_element;
1010
- folder_element = new FolderElement(_node, _this);
1011
- return folder_element.open(_on_finished, _slide);
1012
- };
1013
- })(this);
1014
- if (node.isFolder()) {
1015
- if (node.load_on_demand) {
1016
- return this._loadFolderOnDemand(node, slide, on_finished);
1017
- } else {
1018
- parent = node.parent;
1019
- while (parent) {
1020
- if (parent.parent) {
1021
- doOpenNode(parent, false, null);
1022
- }
1023
- parent = parent.parent;
1024
- }
1025
- doOpenNode(node, slide, on_finished);
1026
- return this._saveState();
1027
- }
1028
- }
1029
- };
1030
-
1031
- JqTreeWidget.prototype._loadFolderOnDemand = function(node, slide, on_finished) {
1032
- if (slide == null) {
1033
- slide = true;
1034
- }
1035
- node.is_loading = true;
1036
- return this._loadDataFromUrl(null, node, (function(_this) {
1037
- return function() {
1038
- return _this._openNode(node, slide, on_finished);
1039
- };
1040
- })(this));
1041
- };
1042
-
1043
- JqTreeWidget.prototype.closeNode = function(node, slide) {
1044
- if (slide == null) {
1045
- slide = null;
1046
- }
1047
- if (slide === null) {
1048
- slide = this.options.slide;
1049
- }
1050
- if (node.isFolder()) {
1051
- new FolderElement(node, this).close(slide);
1052
- return this._saveState();
1053
- }
1054
- };
1055
-
1056
- JqTreeWidget.prototype.isDragging = function() {
1057
- if (this.dnd_handler) {
1058
- return this.dnd_handler.is_dragging;
1059
- } else {
1060
- return false;
1061
- }
1062
- };
1063
-
1064
- JqTreeWidget.prototype.refreshHitAreas = function() {
1065
- return this.dnd_handler.refresh();
1066
- };
1067
-
1068
- JqTreeWidget.prototype.addNodeAfter = function(new_node_info, existing_node) {
1069
- var new_node;
1070
- new_node = existing_node.addAfter(new_node_info);
1071
- this._refreshElements(existing_node.parent);
1072
- return new_node;
1073
- };
1074
-
1075
- JqTreeWidget.prototype.addNodeBefore = function(new_node_info, existing_node) {
1076
- var new_node;
1077
- new_node = existing_node.addBefore(new_node_info);
1078
- this._refreshElements(existing_node.parent);
1079
- return new_node;
1080
- };
1081
-
1082
- JqTreeWidget.prototype.addParentNode = function(new_node_info, existing_node) {
1083
- var new_node;
1084
- new_node = existing_node.addParent(new_node_info);
1085
- this._refreshElements(new_node.parent);
1086
- return new_node;
1087
- };
1088
-
1089
- JqTreeWidget.prototype.removeNode = function(node) {
1090
- var parent;
1091
- parent = node.parent;
1092
- if (parent) {
1093
- this.select_node_handler.removeFromSelection(node, true);
1094
- node.remove();
1095
- return this._refreshElements(parent);
1096
- }
1097
- };
1098
-
1099
- JqTreeWidget.prototype.appendNode = function(new_node_info, parent_node) {
1100
- parent_node = parent_node || this.tree;
1101
- node = parent_node.append(new_node_info);
1102
- this._refreshElements(parent_node);
1103
- return node;
1104
- };
1105
-
1106
- JqTreeWidget.prototype.prependNode = function(new_node_info, parent_node) {
1107
- if (!parent_node) {
1108
- parent_node = this.tree;
1109
- }
1110
- node = parent_node.prepend(new_node_info);
1111
- this._refreshElements(parent_node);
1112
- return node;
1113
- };
1114
-
1115
- JqTreeWidget.prototype.updateNode = function(node, data) {
1116
- var id_is_changed;
1117
- id_is_changed = data.id && data.id !== node.id;
1118
- if (id_is_changed) {
1119
- this.tree.removeNodeFromIndex(node);
1120
- }
1121
- node.setData(data);
1122
- if (id_is_changed) {
1123
- this.tree.addNodeToIndex(node);
1124
- }
1125
- this.renderer.renderFromNode(node);
1126
- return this._selectCurrentNode();
1127
- };
1128
-
1129
- JqTreeWidget.prototype.moveNode = function(node, target_node, position) {
1130
- var position_index;
1131
- position_index = Position.nameToIndex(position);
1132
- this.tree.moveNode(node, target_node, position_index);
1133
- return this._refreshElements();
1134
- };
1135
-
1136
- JqTreeWidget.prototype.getStateFromStorage = function() {
1137
- return this.save_state_handler.getStateFromStorage();
1138
- };
1139
-
1140
- JqTreeWidget.prototype.addToSelection = function(node) {
1141
- if (node) {
1142
- this.select_node_handler.addToSelection(node);
1143
- this._getNodeElementForNode(node).select();
1144
- return this._saveState();
1145
- }
1146
- };
1147
-
1148
- JqTreeWidget.prototype.getSelectedNodes = function() {
1149
- return this.select_node_handler.getSelectedNodes();
1150
- };
1151
-
1152
- JqTreeWidget.prototype.isNodeSelected = function(node) {
1153
- return this.select_node_handler.isNodeSelected(node);
1154
- };
1155
-
1156
- JqTreeWidget.prototype.removeFromSelection = function(node) {
1157
- this.select_node_handler.removeFromSelection(node);
1158
- this._getNodeElementForNode(node).deselect();
1159
- return this._saveState();
1160
- };
1161
-
1162
- JqTreeWidget.prototype.scrollToNode = function(node) {
1163
- var $element, top;
1164
- $element = $(node.element);
1165
- top = $element.offset().top - this.$el.offset().top;
1166
- return this.scroll_handler.scrollTo(top);
1167
- };
1168
-
1169
- JqTreeWidget.prototype.getState = function() {
1170
- return this.save_state_handler.getState();
1171
- };
1172
-
1173
- JqTreeWidget.prototype.setState = function(state) {
1174
- this.save_state_handler.setInitialState(state);
1175
- return this._refreshElements();
1176
- };
1177
-
1178
- JqTreeWidget.prototype.setOption = function(option, value) {
1179
- return this.options[option] = value;
1180
- };
1181
-
1182
- JqTreeWidget.prototype.moveDown = function() {
1183
- if (this.key_handler) {
1184
- return this.key_handler.moveDown();
1185
- }
1186
- };
1187
-
1188
- JqTreeWidget.prototype.moveUp = function() {
1189
- if (this.key_handler) {
1190
- return this.key_handler.moveUp();
1191
- }
1192
- };
1193
-
1194
- JqTreeWidget.prototype.getVersion = function() {
1195
- return __version__;
1196
- };
1197
-
1198
- JqTreeWidget.prototype._init = function() {
1199
- JqTreeWidget.__super__._init.call(this);
1200
- this.element = this.$el;
1201
- this.mouse_delay = 300;
1202
- this.is_initialized = false;
1203
- this.renderer = new ElementsRenderer(this);
1204
- if (SaveStateHandler != null) {
1205
- this.save_state_handler = new SaveStateHandler(this);
1206
- } else {
1207
- this.options.saveState = false;
1208
- }
1209
- if (SelectNodeHandler != null) {
1210
- this.select_node_handler = new SelectNodeHandler(this);
1211
- }
1212
- if (DragAndDropHandler != null) {
1213
- this.dnd_handler = new DragAndDropHandler(this);
1214
- } else {
1215
- this.options.dragAndDrop = false;
1216
- }
1217
- if (ScrollHandler != null) {
1218
- this.scroll_handler = new ScrollHandler(this);
1219
- }
1220
- if ((KeyHandler != null) && (SelectNodeHandler != null)) {
1221
- this.key_handler = new KeyHandler(this);
1222
- }
1223
- this._initData();
1224
- this.element.click($.proxy(this._click, this));
1225
- this.element.dblclick($.proxy(this._dblclick, this));
1226
- if (this.options.useContextMenu) {
1227
- return this.element.bind('contextmenu', $.proxy(this._contextmenu, this));
1228
- }
1229
- };
1230
-
1231
- JqTreeWidget.prototype._deinit = function() {
1232
- this.element.empty();
1233
- this.element.unbind();
1234
- if (this.key_handler) {
1235
- this.key_handler.deinit();
1236
- }
1237
- this.tree = null;
1238
- return JqTreeWidget.__super__._deinit.call(this);
1239
- };
1240
-
1241
- JqTreeWidget.prototype._initData = function() {
1242
- if (this.options.data) {
1243
- return this._loadData(this.options.data);
1244
- } else {
1245
- return this._loadDataFromUrl(this._getDataUrlInfo());
1246
- }
1247
- };
1248
-
1249
- JqTreeWidget.prototype._getDataUrlInfo = function(node) {
1250
- var data_url, getUrlFromString;
1251
- data_url = this.options.dataUrl || this.element.data('url');
1252
- getUrlFromString = (function(_this) {
1253
- return function() {
1254
- var data, selected_node_id, url_info;
1255
- url_info = {
1256
- url: data_url
1257
- };
1258
- if (node && node.id) {
1259
- data = {
1260
- node: node.id
1261
- };
1262
- url_info['data'] = data;
1263
- } else {
1264
- selected_node_id = _this._getNodeIdToBeSelected();
1265
- if (selected_node_id) {
1266
- data = {
1267
- selected_node: selected_node_id
1268
- };
1269
- url_info['data'] = data;
1270
- }
1271
- }
1272
- return url_info;
1273
- };
1274
- })(this);
1275
- if ($.isFunction(data_url)) {
1276
- return data_url(node);
1277
- } else if ($.type(data_url) === 'string') {
1278
- return getUrlFromString();
1279
- } else {
1280
- return data_url;
1281
- }
1282
- };
1283
-
1284
- JqTreeWidget.prototype._getNodeIdToBeSelected = function() {
1285
- if (this.options.saveState) {
1286
- return this.save_state_handler.getNodeIdToBeSelected();
1287
- } else {
1288
- return null;
1289
- }
1290
- };
1291
-
1292
- JqTreeWidget.prototype._initTree = function(data) {
1293
- var must_load_on_demand;
1294
- this.tree = new this.options.nodeClass(null, true, this.options.nodeClass);
1295
- if (this.select_node_handler) {
1296
- this.select_node_handler.clear();
1297
- }
1298
- this.tree.loadFromData(data);
1299
- must_load_on_demand = this._setInitialState();
1300
- this._refreshElements();
1301
- if (must_load_on_demand) {
1302
- this._setInitialStateOnDemand();
1303
- }
1304
- if (!this.is_initialized) {
1305
- this.is_initialized = true;
1306
- return this._triggerEvent('tree.init');
1307
- }
1308
- };
1309
-
1310
- JqTreeWidget.prototype._setInitialState = function() {
1311
- var autoOpenNodes, is_restored, must_load_on_demand, restoreState, _ref;
1312
- restoreState = (function(_this) {
1313
- return function() {
1314
- var must_load_on_demand, state;
1315
- if (!(_this.options.saveState && _this.save_state_handler)) {
1316
- return [false, false];
1317
- } else {
1318
- state = _this.save_state_handler.getStateFromStorage();
1319
- if (!state) {
1320
- return [false, false];
1321
- } else {
1322
- must_load_on_demand = _this.save_state_handler.setInitialState(state);
1323
- return [true, must_load_on_demand];
1324
- }
1325
- }
1326
- };
1327
- })(this);
1328
- autoOpenNodes = (function(_this) {
1329
- return function() {
1330
- var max_level, must_load_on_demand;
1331
- if (_this.options.autoOpen === false) {
1332
- return false;
1333
- }
1334
- max_level = _this._getAutoOpenMaxLevel();
1335
- must_load_on_demand = false;
1336
- _this.tree.iterate(function(node, level) {
1337
- if (node.load_on_demand) {
1338
- must_load_on_demand = true;
1339
- return false;
1340
- } else if (!node.hasChildren()) {
1341
- return false;
1342
- } else {
1343
- node.is_open = true;
1344
- return level !== max_level;
1345
- }
1346
- });
1347
- return must_load_on_demand;
1348
- };
1349
- })(this);
1350
- _ref = restoreState(), is_restored = _ref[0], must_load_on_demand = _ref[1];
1351
- if (!is_restored) {
1352
- must_load_on_demand = autoOpenNodes();
1353
- }
1354
- return must_load_on_demand;
1355
- };
1356
-
1357
- JqTreeWidget.prototype._setInitialStateOnDemand = function() {
1358
- var autoOpenNodes, restoreState;
1359
- restoreState = (function(_this) {
1360
- return function() {
1361
- var state;
1362
- if (!(_this.options.saveState && _this.save_state_handler)) {
1363
- return false;
1364
- } else {
1365
- state = _this.save_state_handler.getStateFromStorage();
1366
- if (!state) {
1367
- return false;
1368
- } else {
1369
- _this.save_state_handler.setInitialStateOnDemand(state);
1370
- return true;
1371
- }
1372
- }
1373
- };
1374
- })(this);
1375
- autoOpenNodes = (function(_this) {
1376
- return function() {
1377
- var loadAndOpenNode, loading_ids, max_level, openNodes;
1378
- max_level = _this._getAutoOpenMaxLevel();
1379
- loading_ids = [];
1380
- loadAndOpenNode = function(node) {
1381
- return _this._openNode(node, false, openNodes);
1382
- };
1383
- openNodes = function() {
1384
- return _this.tree.iterate(function(node, level) {
1385
- if (node.load_on_demand) {
1386
- if (!node.is_loading) {
1387
- loadAndOpenNode(node);
1388
- }
1389
- return false;
1390
- } else {
1391
- _this._openNode(node, false);
1392
- return level !== max_level;
1393
- }
1394
- });
1395
- };
1396
- return openNodes();
1397
- };
1398
- })(this);
1399
- if (!restoreState()) {
1400
- return autoOpenNodes();
1401
- }
1402
- };
1403
-
1404
- JqTreeWidget.prototype._getAutoOpenMaxLevel = function() {
1405
- if (this.options.autoOpen === true) {
1406
- return -1;
1407
- } else {
1408
- return parseInt(this.options.autoOpen);
1409
- }
1410
- };
1411
-
1412
-
1413
- /*
1414
- Redraw the tree or part of the tree.
1415
- * from_node: redraw this subtree
1416
- */
1417
-
1418
- JqTreeWidget.prototype._refreshElements = function(from_node) {
1419
- if (from_node == null) {
1420
- from_node = null;
1421
- }
1422
- this.renderer.render(from_node);
1423
- return this._triggerEvent('tree.refresh');
1424
- };
1425
-
1426
- JqTreeWidget.prototype._click = function(e) {
1427
- var click_target, event;
1428
- click_target = this._getClickTarget(e.target);
1429
- if (click_target) {
1430
- if (click_target.type === 'button') {
1431
- this.toggle(click_target.node, this.options.slide);
1432
- e.preventDefault();
1433
- return e.stopPropagation();
1434
- } else if (click_target.type === 'label') {
1435
- node = click_target.node;
1436
- event = this._triggerEvent('tree.click', {
1437
- node: node,
1438
- click_event: e
1439
- });
1440
- if (!event.isDefaultPrevented()) {
1441
- return this._selectNode(node, true);
1442
- }
1443
- }
1444
- }
1445
- };
1446
-
1447
- JqTreeWidget.prototype._dblclick = function(e) {
1448
- var click_target;
1449
- click_target = this._getClickTarget(e.target);
1450
- if (click_target && click_target.type === 'label') {
1451
- return this._triggerEvent('tree.dblclick', {
1452
- node: click_target.node,
1453
- click_event: e
1454
- });
1455
- }
1456
- };
1457
-
1458
- JqTreeWidget.prototype._getClickTarget = function(element) {
1459
- var $button, $el, $target;
1460
- $target = $(element);
1461
- $button = $target.closest('.jqtree-toggler');
1462
- if ($button.length) {
1463
- node = this._getNode($button);
1464
- if (node) {
1465
- return {
1466
- type: 'button',
1467
- node: node
1468
- };
1469
- }
1470
- } else {
1471
- $el = $target.closest('.jqtree-element');
1472
- if ($el.length) {
1473
- node = this._getNode($el);
1474
- if (node) {
1475
- return {
1476
- type: 'label',
1477
- node: node
1478
- };
1479
- }
1480
- }
1481
- }
1482
- return null;
1483
- };
1484
-
1485
- JqTreeWidget.prototype._getNode = function($element) {
1486
- var $li;
1487
- $li = $element.closest('li.jqtree_common');
1488
- if ($li.length === 0) {
1489
- return null;
1490
- } else {
1491
- return $li.data('node');
1492
- }
1493
- };
1494
-
1495
- JqTreeWidget.prototype._getNodeElementForNode = function(node) {
1496
- if (node.isFolder()) {
1497
- return new FolderElement(node, this);
1498
- } else {
1499
- return new NodeElement(node, this);
1500
- }
1501
- };
1502
-
1503
- JqTreeWidget.prototype._getNodeElement = function($element) {
1504
- node = this._getNode($element);
1505
- if (node) {
1506
- return this._getNodeElementForNode(node);
1507
- } else {
1508
- return null;
1509
- }
1510
- };
1511
-
1512
- JqTreeWidget.prototype._contextmenu = function(e) {
1513
- var $div;
1514
- $div = $(e.target).closest('ul.jqtree-tree .jqtree-element');
1515
- if ($div.length) {
1516
- node = this._getNode($div);
1517
- if (node) {
1518
- e.preventDefault();
1519
- e.stopPropagation();
1520
- this._triggerEvent('tree.contextmenu', {
1521
- node: node,
1522
- click_event: e
1523
- });
1524
- return false;
1525
- }
1526
- }
1527
- };
1528
-
1529
- JqTreeWidget.prototype._saveState = function() {
1530
- if (this.options.saveState) {
1531
- return this.save_state_handler.saveState();
1532
- }
1533
- };
1534
-
1535
- JqTreeWidget.prototype._mouseCapture = function(position_info) {
1536
- if (this.options.dragAndDrop) {
1537
- return this.dnd_handler.mouseCapture(position_info);
1538
- } else {
1539
- return false;
1540
- }
1541
- };
1542
-
1543
- JqTreeWidget.prototype._mouseStart = function(position_info) {
1544
- if (this.options.dragAndDrop) {
1545
- return this.dnd_handler.mouseStart(position_info);
1546
- } else {
1547
- return false;
1548
- }
1549
- };
1550
-
1551
- JqTreeWidget.prototype._mouseDrag = function(position_info) {
1552
- var result;
1553
- if (this.options.dragAndDrop) {
1554
- result = this.dnd_handler.mouseDrag(position_info);
1555
- if (this.scroll_handler) {
1556
- this.scroll_handler.checkScrolling();
1557
- }
1558
- return result;
1559
- } else {
1560
- return false;
1561
- }
1562
- };
1563
-
1564
- JqTreeWidget.prototype._mouseStop = function(position_info) {
1565
- if (this.options.dragAndDrop) {
1566
- return this.dnd_handler.mouseStop(position_info);
1567
- } else {
1568
- return false;
1569
- }
1570
- };
1571
-
1572
- JqTreeWidget.prototype._triggerEvent = function(event_name, values) {
1573
- var event;
1574
- event = $.Event(event_name);
1575
- $.extend(event, values);
1576
- this.element.trigger(event);
1577
- return event;
1578
- };
1579
-
1580
- JqTreeWidget.prototype.testGenerateHitAreas = function(moving_node) {
1581
- this.dnd_handler.current_item = this._getNodeElementForNode(moving_node);
1582
- this.dnd_handler.generateHitAreas();
1583
- return this.dnd_handler.hit_areas;
1584
- };
1585
-
1586
- JqTreeWidget.prototype._selectCurrentNode = function() {
1587
- node = this.getSelectedNode();
1588
- if (node) {
1589
- node_element = this._getNodeElementForNode(node);
1590
- if (node_element) {
1591
- return node_element.select();
1592
- }
1593
- }
1594
- };
1595
-
1596
- JqTreeWidget.prototype._deselectCurrentNode = function() {
1597
- node = this.getSelectedNode();
1598
- if (node) {
1599
- return this.removeFromSelection(node);
1600
- }
1601
- };
1602
-
1603
- return JqTreeWidget;
1604
-
1605
- })(MouseWidget);
1606
-
1607
- SimpleWidget.register(JqTreeWidget, 'tree');
1608
-
1609
- }).call(this);
1610
-
1611
- },{"./drag_and_drop_handler":1,"./elements_renderer":2,"./key_handler":4,"./mouse.widget":5,"./node":6,"./node_element":7,"./save_state_handler":8,"./scroll_handler":9,"./select_node_handler":10,"./simple.widget":11,"./version":13}],4:[function(require,module,exports){
1612
- (function() {
1613
- var KeyHandler,
1614
- __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
1615
-
1616
- KeyHandler = (function() {
1617
- var DOWN, LEFT, RIGHT, UP;
1618
-
1619
- LEFT = 37;
1620
-
1621
- UP = 38;
1622
-
1623
- RIGHT = 39;
1624
-
1625
- DOWN = 40;
1626
-
1627
- function KeyHandler(tree_widget) {
1628
- this.selectNode = __bind(this.selectNode, this);
1629
- this.tree_widget = tree_widget;
1630
- if (tree_widget.options.keyboardSupport) {
1631
- $(document).bind('keydown.jqtree', $.proxy(this.handleKeyDown, this));
1632
- }
1633
- }
1634
-
1635
- KeyHandler.prototype.deinit = function() {
1636
- return $(document).unbind('keydown.jqtree');
1637
- };
1638
-
1639
- KeyHandler.prototype.moveDown = function() {
1640
- var node;
1641
- node = this.tree_widget.getSelectedNode();
1642
- if (node) {
1643
- return this.selectNode(node.getNextNode());
1644
- } else {
1645
- return false;
1646
- }
1647
- };
1648
-
1649
- KeyHandler.prototype.moveUp = function() {
1650
- var node;
1651
- node = this.tree_widget.getSelectedNode();
1652
- if (node) {
1653
- return this.selectNode(node.getPreviousNode());
1654
- } else {
1655
- return false;
1656
- }
1657
- };
1658
-
1659
- KeyHandler.prototype.moveRight = function() {
1660
- var node;
1661
- node = this.tree_widget.getSelectedNode();
1662
- if (node && node.isFolder() && !node.is_open) {
1663
- this.tree_widget.openNode(node);
1664
- return false;
1665
- } else {
1666
- return true;
1667
- }
1668
- };
1669
-
1670
- KeyHandler.prototype.moveLeft = function() {
1671
- var node;
1672
- node = this.tree_widget.getSelectedNode();
1673
- if (node && node.isFolder() && node.is_open) {
1674
- this.tree_widget.closeNode(node);
1675
- return false;
1676
- } else {
1677
- return true;
1678
- }
1679
- };
1680
-
1681
- KeyHandler.prototype.handleKeyDown = function(e) {
1682
- var key;
1683
- if (!this.tree_widget.options.keyboardSupport) {
1684
- return true;
1685
- }
1686
- if ($(document.activeElement).is('textarea,input,select')) {
1687
- return true;
1688
- }
1689
- if (!this.tree_widget.getSelectedNode()) {
1690
- return true;
1691
- }
1692
- key = e.which;
1693
- switch (key) {
1694
- case DOWN:
1695
- return this.moveDown();
1696
- case UP:
1697
- return this.moveUp();
1698
- case RIGHT:
1699
- return this.moveRight();
1700
- case LEFT:
1701
- return this.moveLeft();
1702
- }
1703
- return true;
1704
- };
1705
-
1706
- KeyHandler.prototype.selectNode = function(node) {
1707
- if (!node) {
1708
- return true;
1709
- } else {
1710
- this.tree_widget.selectNode(node);
1711
- if (this.tree_widget.scroll_handler && (!this.tree_widget.scroll_handler.isScrolledIntoView($(node.element).find('.jqtree-element')))) {
1712
- this.tree_widget.scrollToNode(node);
1713
- }
1714
- return false;
1715
- }
1716
- };
1717
-
1718
- return KeyHandler;
1719
-
1720
- })();
1721
-
1722
- module.exports = KeyHandler;
1723
-
1724
- }).call(this);
1725
-
1726
- },{}],5:[function(require,module,exports){
1727
-
1728
- /*
1729
- This widget does the same a the mouse widget in jqueryui.
1730
- */
1731
-
1732
- (function() {
1733
- var MouseWidget, SimpleWidget,
1734
- __hasProp = {}.hasOwnProperty,
1735
- __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
1736
-
1737
- SimpleWidget = require('./simple.widget');
1738
-
1739
- MouseWidget = (function(_super) {
1740
- __extends(MouseWidget, _super);
1741
-
1742
- function MouseWidget() {
1743
- return MouseWidget.__super__.constructor.apply(this, arguments);
1744
- }
1745
-
1746
- MouseWidget.is_mouse_handled = false;
1747
-
1748
- MouseWidget.prototype._init = function() {
1749
- this.$el.bind('mousedown.mousewidget', $.proxy(this._mouseDown, this));
1750
- this.$el.bind('touchstart.mousewidget', $.proxy(this._touchStart, this));
1751
- this.is_mouse_started = false;
1752
- this.mouse_delay = 0;
1753
- this._mouse_delay_timer = null;
1754
- this._is_mouse_delay_met = true;
1755
- return this.mouse_down_info = null;
1756
- };
1757
-
1758
- MouseWidget.prototype._deinit = function() {
1759
- var $document;
1760
- this.$el.unbind('mousedown.mousewidget');
1761
- this.$el.unbind('touchstart.mousewidget');
1762
- $document = $(document);
1763
- $document.unbind('mousemove.mousewidget');
1764
- return $document.unbind('mouseup.mousewidget');
1765
- };
1766
-
1767
- MouseWidget.prototype._mouseDown = function(e) {
1768
- var result;
1769
- if (e.which !== 1) {
1770
- return;
1771
- }
1772
- result = this._handleMouseDown(e, this._getPositionInfo(e));
1773
- if (result) {
1774
- e.preventDefault();
1775
- }
1776
- return result;
1777
- };
1778
-
1779
- MouseWidget.prototype._handleMouseDown = function(e, position_info) {
1780
- if (MouseWidget.is_mouse_handled) {
1781
- return;
1782
- }
1783
- if (this.is_mouse_started) {
1784
- this._handleMouseUp(position_info);
1785
- }
1786
- this.mouse_down_info = position_info;
1787
- if (!this._mouseCapture(position_info)) {
1788
- return;
1789
- }
1790
- this._handleStartMouse();
1791
- this.is_mouse_handled = true;
1792
- return true;
1793
- };
1794
-
1795
- MouseWidget.prototype._handleStartMouse = function() {
1796
- var $document;
1797
- $document = $(document);
1798
- $document.bind('mousemove.mousewidget', $.proxy(this._mouseMove, this));
1799
- $document.bind('touchmove.mousewidget', $.proxy(this._touchMove, this));
1800
- $document.bind('mouseup.mousewidget', $.proxy(this._mouseUp, this));
1801
- $document.bind('touchend.mousewidget', $.proxy(this._touchEnd, this));
1802
- if (this.mouse_delay) {
1803
- return this._startMouseDelayTimer();
1804
- }
1805
- };
1806
-
1807
- MouseWidget.prototype._startMouseDelayTimer = function() {
1808
- if (this._mouse_delay_timer) {
1809
- clearTimeout(this._mouse_delay_timer);
1810
- }
1811
- this._mouse_delay_timer = setTimeout((function(_this) {
1812
- return function() {
1813
- return _this._is_mouse_delay_met = true;
1814
- };
1815
- })(this), this.mouse_delay);
1816
- return this._is_mouse_delay_met = false;
1817
- };
1818
-
1819
- MouseWidget.prototype._mouseMove = function(e) {
1820
- return this._handleMouseMove(e, this._getPositionInfo(e));
1821
- };
1822
-
1823
- MouseWidget.prototype._handleMouseMove = function(e, position_info) {
1824
- if (this.is_mouse_started) {
1825
- this._mouseDrag(position_info);
1826
- return e.preventDefault();
1827
- }
1828
- if (this.mouse_delay && !this._is_mouse_delay_met) {
1829
- return true;
1830
- }
1831
- this.is_mouse_started = this._mouseStart(this.mouse_down_info) !== false;
1832
- if (this.is_mouse_started) {
1833
- this._mouseDrag(position_info);
1834
- } else {
1835
- this._handleMouseUp(position_info);
1836
- }
1837
- return !this.is_mouse_started;
1838
- };
1839
-
1840
- MouseWidget.prototype._getPositionInfo = function(e) {
1841
- return {
1842
- page_x: e.pageX,
1843
- page_y: e.pageY,
1844
- target: e.target,
1845
- original_event: e
1846
- };
1847
- };
1848
-
1849
- MouseWidget.prototype._mouseUp = function(e) {
1850
- return this._handleMouseUp(this._getPositionInfo(e));
1851
- };
1852
-
1853
- MouseWidget.prototype._handleMouseUp = function(position_info) {
1854
- var $document;
1855
- $document = $(document);
1856
- $document.unbind('mousemove.mousewidget');
1857
- $document.unbind('touchmove.mousewidget');
1858
- $document.unbind('mouseup.mousewidget');
1859
- $document.unbind('touchend.mousewidget');
1860
- if (this.is_mouse_started) {
1861
- this.is_mouse_started = false;
1862
- this._mouseStop(position_info);
1863
- }
1864
- };
1865
-
1866
- MouseWidget.prototype._mouseCapture = function(position_info) {
1867
- return true;
1868
- };
1869
-
1870
- MouseWidget.prototype._mouseStart = function(position_info) {
1871
- return null;
1872
- };
1873
-
1874
- MouseWidget.prototype._mouseDrag = function(position_info) {
1875
- return null;
1876
- };
1877
-
1878
- MouseWidget.prototype._mouseStop = function(position_info) {
1879
- return null;
1880
- };
1881
-
1882
- MouseWidget.prototype.setMouseDelay = function(mouse_delay) {
1883
- return this.mouse_delay = mouse_delay;
1884
- };
1885
-
1886
- MouseWidget.prototype._touchStart = function(e) {
1887
- var touch;
1888
- if (e.originalEvent.touches.length > 1) {
1889
- return;
1890
- }
1891
- touch = e.originalEvent.changedTouches[0];
1892
- return this._handleMouseDown(e, this._getPositionInfo(touch));
1893
- };
1894
-
1895
- MouseWidget.prototype._touchMove = function(e) {
1896
- var touch;
1897
- if (e.originalEvent.touches.length > 1) {
1898
- return;
1899
- }
1900
- touch = e.originalEvent.changedTouches[0];
1901
- return this._handleMouseMove(e, this._getPositionInfo(touch));
1902
- };
1903
-
1904
- MouseWidget.prototype._touchEnd = function(e) {
1905
- var touch;
1906
- if (e.originalEvent.touches.length > 1) {
1907
- return;
1908
- }
1909
- touch = e.originalEvent.changedTouches[0];
1910
- return this._handleMouseUp(this._getPositionInfo(touch));
1911
- };
1912
-
1913
- return MouseWidget;
1914
-
1915
- })(SimpleWidget);
1916
-
1917
- module.exports = MouseWidget;
1918
-
1919
- }).call(this);
1920
-
1921
- },{"./simple.widget":11}],6:[function(require,module,exports){
1922
- (function() {
1923
- var Node, Position;
1924
-
1925
- Position = {
1926
- getName: function(position) {
1927
- return Position.strings[position - 1];
1928
- },
1929
- nameToIndex: function(name) {
1930
- var i, _i, _ref;
1931
- for (i = _i = 1, _ref = Position.strings.length; 1 <= _ref ? _i <= _ref : _i >= _ref; i = 1 <= _ref ? ++_i : --_i) {
1932
- if (Position.strings[i - 1] === name) {
1933
- return i;
1934
- }
1935
- }
1936
- return 0;
1937
- }
1938
- };
1939
-
1940
- Position.BEFORE = 1;
1941
-
1942
- Position.AFTER = 2;
1943
-
1944
- Position.INSIDE = 3;
1945
-
1946
- Position.NONE = 4;
1947
-
1948
- Position.strings = ['before', 'after', 'inside', 'none'];
1949
-
1950
- Node = (function() {
1951
- function Node(o, is_root, node_class) {
1952
- if (is_root == null) {
1953
- is_root = false;
1954
- }
1955
- if (node_class == null) {
1956
- node_class = Node;
1957
- }
1958
- this.setData(o);
1959
- this.children = [];
1960
- this.parent = null;
1961
- if (is_root) {
1962
- this.id_mapping = {};
1963
- this.tree = this;
1964
- this.node_class = node_class;
1965
- }
1966
- }
1967
-
1968
- Node.prototype.setData = function(o) {
1969
- var key, value, _results;
1970
- if (typeof o !== 'object') {
1971
- return this.name = o;
1972
- } else {
1973
- _results = [];
1974
- for (key in o) {
1975
- value = o[key];
1976
- if (key === 'label') {
1977
- _results.push(this.name = value);
1978
- } else {
1979
- _results.push(this[key] = value);
1980
- }
1981
- }
1982
- return _results;
1983
- }
1984
- };
1985
-
1986
- Node.prototype.initFromData = function(data) {
1987
- var addChildren, addNode;
1988
- addNode = (function(_this) {
1989
- return function(node_data) {
1990
- _this.setData(node_data);
1991
- if (node_data.children) {
1992
- return addChildren(node_data.children);
1993
- }
1994
- };
1995
- })(this);
1996
- addChildren = (function(_this) {
1997
- return function(children_data) {
1998
- var child, node, _i, _len;
1999
- for (_i = 0, _len = children_data.length; _i < _len; _i++) {
2000
- child = children_data[_i];
2001
- node = new _this.tree.node_class('');
2002
- node.initFromData(child);
2003
- _this.addChild(node);
2004
- }
2005
- return null;
2006
- };
2007
- })(this);
2008
- addNode(data);
2009
- return null;
2010
- };
2011
-
2012
-
2013
- /*
2014
- Create tree from data.
2015
-
2016
- Structure of data is:
2017
- [
2018
- {
2019
- label: 'node1',
2020
- children: [
2021
- { label: 'child1' },
2022
- { label: 'child2' }
2023
- ]
2024
- },
2025
- {
2026
- label: 'node2'
2027
- }
2028
- ]
2029
- */
2030
-
2031
- Node.prototype.loadFromData = function(data) {
2032
- var node, o, _i, _len;
2033
- this.removeChildren();
2034
- for (_i = 0, _len = data.length; _i < _len; _i++) {
2035
- o = data[_i];
2036
- node = new this.tree.node_class(o);
2037
- this.addChild(node);
2038
- if (typeof o === 'object' && o.children) {
2039
- node.loadFromData(o.children);
2040
- }
2041
- }
2042
- return null;
2043
- };
2044
-
2045
-
2046
- /*
2047
- Add child.
2048
-
2049
- tree.addChild(
2050
- new Node('child1')
2051
- );
2052
- */
2053
-
2054
- Node.prototype.addChild = function(node) {
2055
- this.children.push(node);
2056
- return node._setParent(this);
2057
- };
2058
-
2059
-
2060
- /*
2061
- Add child at position. Index starts at 0.
2062
-
2063
- tree.addChildAtPosition(
2064
- new Node('abc'),
2065
- 1
2066
- );
2067
- */
2068
-
2069
- Node.prototype.addChildAtPosition = function(node, index) {
2070
- this.children.splice(index, 0, node);
2071
- return node._setParent(this);
2072
- };
2073
-
2074
- Node.prototype._setParent = function(parent) {
2075
- this.parent = parent;
2076
- this.tree = parent.tree;
2077
- return this.tree.addNodeToIndex(this);
2078
- };
2079
-
2080
-
2081
- /*
2082
- Remove child. This also removes the children of the node.
2083
-
2084
- tree.removeChild(tree.children[0]);
2085
- */
2086
-
2087
- Node.prototype.removeChild = function(node) {
2088
- node.removeChildren();
2089
- return this._removeChild(node);
2090
- };
2091
-
2092
- Node.prototype._removeChild = function(node) {
2093
- this.children.splice(this.getChildIndex(node), 1);
2094
- return this.tree.removeNodeFromIndex(node);
2095
- };
2096
-
2097
-
2098
- /*
2099
- Get child index.
2100
-
2101
- var index = getChildIndex(node);
2102
- */
2103
-
2104
- Node.prototype.getChildIndex = function(node) {
2105
- return $.inArray(node, this.children);
2106
- };
2107
-
2108
-
2109
- /*
2110
- Does the tree have children?
2111
-
2112
- if (tree.hasChildren()) {
2113
- //
2114
- }
2115
- */
2116
-
2117
- Node.prototype.hasChildren = function() {
2118
- return this.children.length !== 0;
2119
- };
2120
-
2121
- Node.prototype.isFolder = function() {
2122
- return this.hasChildren() || this.load_on_demand;
2123
- };
2124
-
2125
-
2126
- /*
2127
- Iterate over all the nodes in the tree.
2128
-
2129
- Calls callback with (node, level).
2130
-
2131
- The callback must return true to continue the iteration on current node.
2132
-
2133
- tree.iterate(
2134
- function(node, level) {
2135
- console.log(node.name);
2136
-
2137
- // stop iteration after level 2
2138
- return (level <= 2);
2139
- }
2140
- );
2141
- */
2142
-
2143
- Node.prototype.iterate = function(callback) {
2144
- var _iterate;
2145
- _iterate = function(node, level) {
2146
- var child, result, _i, _len, _ref;
2147
- if (node.children) {
2148
- _ref = node.children;
2149
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
2150
- child = _ref[_i];
2151
- result = callback(child, level);
2152
- if (result && child.hasChildren()) {
2153
- _iterate(child, level + 1);
2154
- }
2155
- }
2156
- return null;
2157
- }
2158
- };
2159
- _iterate(this, 0);
2160
- return null;
2161
- };
2162
-
2163
-
2164
- /*
2165
- Move node relative to another node.
2166
-
2167
- Argument position: Position.BEFORE, Position.AFTER or Position.Inside
2168
-
2169
- // move node1 after node2
2170
- tree.moveNode(node1, node2, Position.AFTER);
2171
- */
2172
-
2173
- Node.prototype.moveNode = function(moved_node, target_node, position) {
2174
- if (moved_node.isParentOf(target_node)) {
2175
- return;
2176
- }
2177
- moved_node.parent._removeChild(moved_node);
2178
- if (position === Position.AFTER) {
2179
- return target_node.parent.addChildAtPosition(moved_node, target_node.parent.getChildIndex(target_node) + 1);
2180
- } else if (position === Position.BEFORE) {
2181
- return target_node.parent.addChildAtPosition(moved_node, target_node.parent.getChildIndex(target_node));
2182
- } else if (position === Position.INSIDE) {
2183
- return target_node.addChildAtPosition(moved_node, 0);
2184
- }
2185
- };
2186
-
2187
-
2188
- /*
2189
- Get the tree as data.
2190
- */
2191
-
2192
- Node.prototype.getData = function() {
2193
- var getDataFromNodes;
2194
- getDataFromNodes = (function(_this) {
2195
- return function(nodes) {
2196
- var data, k, node, tmp_node, v, _i, _len;
2197
- data = [];
2198
- for (_i = 0, _len = nodes.length; _i < _len; _i++) {
2199
- node = nodes[_i];
2200
- tmp_node = {};
2201
- for (k in node) {
2202
- v = node[k];
2203
- if ((k !== 'parent' && k !== 'children' && k !== 'element' && k !== 'tree') && Object.prototype.hasOwnProperty.call(node, k)) {
2204
- tmp_node[k] = v;
2205
- }
2206
- }
2207
- if (node.hasChildren()) {
2208
- tmp_node.children = getDataFromNodes(node.children);
2209
- }
2210
- data.push(tmp_node);
2211
- }
2212
- return data;
2213
- };
2214
- })(this);
2215
- return getDataFromNodes(this.children);
2216
- };
2217
-
2218
- Node.prototype.getNodeByName = function(name) {
2219
- var result;
2220
- result = null;
2221
- this.iterate(function(node) {
2222
- if (node.name === name) {
2223
- result = node;
2224
- return false;
2225
- } else {
2226
- return true;
2227
- }
2228
- });
2229
- return result;
2230
- };
2231
-
2232
- Node.prototype.addAfter = function(node_info) {
2233
- var child_index, node;
2234
- if (!this.parent) {
2235
- return null;
2236
- } else {
2237
- node = new this.tree.node_class(node_info);
2238
- child_index = this.parent.getChildIndex(this);
2239
- this.parent.addChildAtPosition(node, child_index + 1);
2240
- return node;
2241
- }
2242
- };
2243
-
2244
- Node.prototype.addBefore = function(node_info) {
2245
- var child_index, node;
2246
- if (!this.parent) {
2247
- return null;
2248
- } else {
2249
- node = new this.tree.node_class(node_info);
2250
- child_index = this.parent.getChildIndex(this);
2251
- this.parent.addChildAtPosition(node, child_index);
2252
- return node;
2253
- }
2254
- };
2255
-
2256
- Node.prototype.addParent = function(node_info) {
2257
- var child, new_parent, original_parent, _i, _len, _ref;
2258
- if (!this.parent) {
2259
- return null;
2260
- } else {
2261
- new_parent = new this.tree.node_class(node_info);
2262
- new_parent._setParent(this.tree);
2263
- original_parent = this.parent;
2264
- _ref = original_parent.children;
2265
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
2266
- child = _ref[_i];
2267
- new_parent.addChild(child);
2268
- }
2269
- original_parent.children = [];
2270
- original_parent.addChild(new_parent);
2271
- return new_parent;
2272
- }
2273
- };
2274
-
2275
- Node.prototype.remove = function() {
2276
- if (this.parent) {
2277
- this.parent.removeChild(this);
2278
- return this.parent = null;
2279
- }
2280
- };
2281
-
2282
- Node.prototype.append = function(node_info) {
2283
- var node;
2284
- node = new this.tree.node_class(node_info);
2285
- this.addChild(node);
2286
- return node;
2287
- };
2288
-
2289
- Node.prototype.prepend = function(node_info) {
2290
- var node;
2291
- node = new this.tree.node_class(node_info);
2292
- this.addChildAtPosition(node, 0);
2293
- return node;
2294
- };
2295
-
2296
- Node.prototype.isParentOf = function(node) {
2297
- var parent;
2298
- parent = node.parent;
2299
- while (parent) {
2300
- if (parent === this) {
2301
- return true;
2302
- }
2303
- parent = parent.parent;
2304
- }
2305
- return false;
2306
- };
2307
-
2308
- Node.prototype.getLevel = function() {
2309
- var level, node;
2310
- level = 0;
2311
- node = this;
2312
- while (node.parent) {
2313
- level += 1;
2314
- node = node.parent;
2315
- }
2316
- return level;
2317
- };
2318
-
2319
- Node.prototype.getNodeById = function(node_id) {
2320
- return this.id_mapping[node_id];
2321
- };
2322
-
2323
- Node.prototype.addNodeToIndex = function(node) {
2324
- if (node.id != null) {
2325
- return this.id_mapping[node.id] = node;
2326
- }
2327
- };
2328
-
2329
- Node.prototype.removeNodeFromIndex = function(node) {
2330
- if (node.id != null) {
2331
- return delete this.id_mapping[node.id];
2332
- }
2333
- };
2334
-
2335
- Node.prototype.removeChildren = function() {
2336
- this.iterate((function(_this) {
2337
- return function(child) {
2338
- _this.tree.removeNodeFromIndex(child);
2339
- return true;
2340
- };
2341
- })(this));
2342
- return this.children = [];
2343
- };
2344
-
2345
- Node.prototype.getPreviousSibling = function() {
2346
- var previous_index;
2347
- if (!this.parent) {
2348
- return null;
2349
- } else {
2350
- previous_index = this.parent.getChildIndex(this) - 1;
2351
- if (previous_index >= 0) {
2352
- return this.parent.children[previous_index];
2353
- } else {
2354
- return null;
2355
- }
2356
- }
2357
- };
2358
-
2359
- Node.prototype.getNextSibling = function() {
2360
- var next_index;
2361
- if (!this.parent) {
2362
- return null;
2363
- } else {
2364
- next_index = this.parent.getChildIndex(this) + 1;
2365
- if (next_index < this.parent.children.length) {
2366
- return this.parent.children[next_index];
2367
- } else {
2368
- return null;
2369
- }
2370
- }
2371
- };
2372
-
2373
- Node.prototype.getNodesByProperty = function(key, value) {
2374
- return this.filter(function(node) {
2375
- return node[key] === value;
2376
- });
2377
- };
2378
-
2379
- Node.prototype.filter = function(f) {
2380
- var result;
2381
- result = [];
2382
- this.iterate(function(node) {
2383
- if (f(node)) {
2384
- result.push(node);
2385
- }
2386
- return true;
2387
- });
2388
- return result;
2389
- };
2390
-
2391
- Node.prototype.getNextNode = function(include_children) {
2392
- var next_sibling;
2393
- if (include_children == null) {
2394
- include_children = true;
2395
- }
2396
- if (include_children && this.hasChildren() && this.is_open) {
2397
- return this.children[0];
2398
- } else {
2399
- if (!this.parent) {
2400
- return null;
2401
- } else {
2402
- next_sibling = this.getNextSibling();
2403
- if (next_sibling) {
2404
- return next_sibling;
2405
- } else {
2406
- return this.parent.getNextNode(false);
2407
- }
2408
- }
2409
- }
2410
- };
2411
-
2412
- Node.prototype.getPreviousNode = function() {
2413
- var previous_sibling;
2414
- if (!this.parent) {
2415
- return null;
2416
- } else {
2417
- previous_sibling = this.getPreviousSibling();
2418
- if (previous_sibling) {
2419
- if (!previous_sibling.hasChildren() || !previous_sibling.is_open) {
2420
- return previous_sibling;
2421
- } else {
2422
- return previous_sibling.getLastChild();
2423
- }
2424
- } else {
2425
- if (this.parent.parent) {
2426
- return this.parent;
2427
- } else {
2428
- return null;
2429
- }
2430
- }
2431
- }
2432
- };
2433
-
2434
- Node.prototype.getLastChild = function() {
2435
- var last_child;
2436
- if (!this.hasChildren()) {
2437
- return null;
2438
- } else {
2439
- last_child = this.children[this.children.length - 1];
2440
- if (!last_child.hasChildren() || !last_child.is_open) {
2441
- return last_child;
2442
- } else {
2443
- return last_child.getLastChild();
2444
- }
2445
- }
2446
- };
2447
-
2448
- return Node;
2449
-
2450
- })();
2451
-
2452
- module.exports = {
2453
- Node: Node,
2454
- Position: Position
2455
- };
2456
-
2457
- }).call(this);
2458
-
2459
- },{}],7:[function(require,module,exports){
2460
- (function() {
2461
- var BorderDropHint, FolderElement, GhostDropHint, NodeElement, Position, node,
2462
- __hasProp = {}.hasOwnProperty,
2463
- __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
2464
-
2465
- node = require('./node');
2466
-
2467
- Position = node.Position;
2468
-
2469
- NodeElement = (function() {
2470
- function NodeElement(node, tree_widget) {
2471
- this.init(node, tree_widget);
2472
- }
2473
-
2474
- NodeElement.prototype.init = function(node, tree_widget) {
2475
- this.node = node;
2476
- this.tree_widget = tree_widget;
2477
- if (!node.element) {
2478
- node.element = this.tree_widget.element;
2479
- }
2480
- return this.$element = $(node.element);
2481
- };
2482
-
2483
- NodeElement.prototype.getUl = function() {
2484
- return this.$element.children('ul:first');
2485
- };
2486
-
2487
- NodeElement.prototype.getSpan = function() {
2488
- return this.$element.children('.jqtree-element').find('span.jqtree-title');
2489
- };
2490
-
2491
- NodeElement.prototype.getLi = function() {
2492
- return this.$element;
2493
- };
2494
-
2495
- NodeElement.prototype.addDropHint = function(position) {
2496
- if (position === Position.INSIDE) {
2497
- return new BorderDropHint(this.$element);
2498
- } else {
2499
- return new GhostDropHint(this.node, this.$element, position);
2500
- }
2501
- };
2502
-
2503
- NodeElement.prototype.select = function() {
2504
- return this.getLi().addClass('jqtree-selected');
2505
- };
2506
-
2507
- NodeElement.prototype.deselect = function() {
2508
- return this.getLi().removeClass('jqtree-selected');
2509
- };
2510
-
2511
- return NodeElement;
2512
-
2513
- })();
2514
-
2515
- FolderElement = (function(_super) {
2516
- __extends(FolderElement, _super);
2517
-
2518
- function FolderElement() {
2519
- return FolderElement.__super__.constructor.apply(this, arguments);
2520
- }
2521
-
2522
- FolderElement.prototype.open = function(on_finished, slide) {
2523
- var $button, doOpen;
2524
- if (slide == null) {
2525
- slide = true;
2526
- }
2527
- if (!this.node.is_open) {
2528
- this.node.is_open = true;
2529
- $button = this.getButton();
2530
- $button.removeClass('jqtree-closed');
2531
- $button.html('');
2532
- $button.append(this.tree_widget.renderer.opened_icon_element.cloneNode(false));
2533
- doOpen = (function(_this) {
2534
- return function() {
2535
- _this.getLi().removeClass('jqtree-closed');
2536
- if (on_finished) {
2537
- on_finished();
2538
- }
2539
- return _this.tree_widget._triggerEvent('tree.open', {
2540
- node: _this.node
2541
- });
2542
- };
2543
- })(this);
2544
- if (slide) {
2545
- return this.getUl().slideDown('fast', doOpen);
2546
- } else {
2547
- this.getUl().show();
2548
- return doOpen();
2549
- }
2550
- }
2551
- };
2552
-
2553
- FolderElement.prototype.close = function(slide) {
2554
- var $button, doClose;
2555
- if (slide == null) {
2556
- slide = true;
2557
- }
2558
- if (this.node.is_open) {
2559
- this.node.is_open = false;
2560
- $button = this.getButton();
2561
- $button.addClass('jqtree-closed');
2562
- $button.html('');
2563
- $button.append(this.tree_widget.renderer.closed_icon_element.cloneNode(false));
2564
- doClose = (function(_this) {
2565
- return function() {
2566
- _this.getLi().addClass('jqtree-closed');
2567
- return _this.tree_widget._triggerEvent('tree.close', {
2568
- node: _this.node
2569
- });
2570
- };
2571
- })(this);
2572
- if (slide) {
2573
- return this.getUl().slideUp('fast', doClose);
2574
- } else {
2575
- this.getUl().hide();
2576
- return doClose();
2577
- }
2578
- }
2579
- };
2580
-
2581
- FolderElement.prototype.getButton = function() {
2582
- return this.$element.children('.jqtree-element').find('a.jqtree-toggler');
2583
- };
2584
-
2585
- FolderElement.prototype.addDropHint = function(position) {
2586
- if (!this.node.is_open && position === Position.INSIDE) {
2587
- return new BorderDropHint(this.$element);
2588
- } else {
2589
- return new GhostDropHint(this.node, this.$element, position);
2590
- }
2591
- };
2592
-
2593
- return FolderElement;
2594
-
2595
- })(NodeElement);
2596
-
2597
- BorderDropHint = (function() {
2598
- function BorderDropHint($element) {
2599
- var $div, width;
2600
- $div = $element.children('.jqtree-element');
2601
- width = $element.width() - 4;
2602
- this.$hint = $('<span class="jqtree-border"></span>');
2603
- $div.append(this.$hint);
2604
- this.$hint.css({
2605
- width: width,
2606
- height: $div.outerHeight() - 4
2607
- });
2608
- }
2609
-
2610
- BorderDropHint.prototype.remove = function() {
2611
- return this.$hint.remove();
2612
- };
2613
-
2614
- return BorderDropHint;
2615
-
2616
- })();
2617
-
2618
- GhostDropHint = (function() {
2619
- function GhostDropHint(node, $element, position) {
2620
- this.$element = $element;
2621
- this.node = node;
2622
- this.$ghost = $('<li class="jqtree_common jqtree-ghost"><span class="jqtree_common jqtree-circle"></span><span class="jqtree_common jqtree-line"></span></li>');
2623
- if (position === Position.AFTER) {
2624
- this.moveAfter();
2625
- } else if (position === Position.BEFORE) {
2626
- this.moveBefore();
2627
- } else if (position === Position.INSIDE) {
2628
- if (node.isFolder() && node.is_open) {
2629
- this.moveInsideOpenFolder();
2630
- } else {
2631
- this.moveInside();
2632
- }
2633
- }
2634
- }
2635
-
2636
- GhostDropHint.prototype.remove = function() {
2637
- return this.$ghost.remove();
2638
- };
2639
-
2640
- GhostDropHint.prototype.moveAfter = function() {
2641
- return this.$element.after(this.$ghost);
2642
- };
2643
-
2644
- GhostDropHint.prototype.moveBefore = function() {
2645
- return this.$element.before(this.$ghost);
2646
- };
2647
-
2648
- GhostDropHint.prototype.moveInsideOpenFolder = function() {
2649
- return $(this.node.children[0].element).before(this.$ghost);
2650
- };
2651
-
2652
- GhostDropHint.prototype.moveInside = function() {
2653
- this.$element.after(this.$ghost);
2654
- return this.$ghost.addClass('jqtree-inside');
2655
- };
2656
-
2657
- return GhostDropHint;
2658
-
2659
- })();
2660
-
2661
- module.exports = {
2662
- FolderElement: FolderElement,
2663
- NodeElement: NodeElement
2664
- };
2665
-
2666
- }).call(this);
2667
-
2668
- },{"./node":6}],8:[function(require,module,exports){
2669
- (function() {
2670
- var SaveStateHandler, indexOf, isInt, util;
2671
-
2672
- util = require('./util');
2673
-
2674
- indexOf = util.indexOf;
2675
-
2676
- isInt = util.isInt;
2677
-
2678
- SaveStateHandler = (function() {
2679
- function SaveStateHandler(tree_widget) {
2680
- this.tree_widget = tree_widget;
2681
- }
2682
-
2683
- SaveStateHandler.prototype.saveState = function() {
2684
- var state;
2685
- state = JSON.stringify(this.getState());
2686
- if (this.tree_widget.options.onSetStateFromStorage) {
2687
- return this.tree_widget.options.onSetStateFromStorage(state);
2688
- } else if (this.supportsLocalStorage()) {
2689
- return localStorage.setItem(this.getCookieName(), state);
2690
- } else if ($.cookie) {
2691
- $.cookie.raw = true;
2692
- return $.cookie(this.getCookieName(), state, {
2693
- path: '/'
2694
- });
2695
- }
2696
- };
2697
-
2698
- SaveStateHandler.prototype.getStateFromStorage = function() {
2699
- var json_data;
2700
- json_data = this._loadFromStorage();
2701
- if (json_data) {
2702
- return this._parseState(json_data);
2703
- } else {
2704
- return null;
2705
- }
2706
- };
2707
-
2708
- SaveStateHandler.prototype._parseState = function(json_data) {
2709
- var state;
2710
- state = $.parseJSON(json_data);
2711
- if (state && state.selected_node && isInt(state.selected_node)) {
2712
- state.selected_node = [state.selected_node];
2713
- }
2714
- return state;
2715
- };
2716
-
2717
- SaveStateHandler.prototype._loadFromStorage = function() {
2718
- if (this.tree_widget.options.onGetStateFromStorage) {
2719
- return this.tree_widget.options.onGetStateFromStorage();
2720
- } else if (this.supportsLocalStorage()) {
2721
- return localStorage.getItem(this.getCookieName());
2722
- } else if ($.cookie) {
2723
- $.cookie.raw = true;
2724
- return $.cookie(this.getCookieName());
2725
- } else {
2726
- return null;
2727
- }
2728
- };
2729
-
2730
- SaveStateHandler.prototype.getState = function() {
2731
- var getOpenNodeIds, getSelectedNodeIds;
2732
- getOpenNodeIds = (function(_this) {
2733
- return function() {
2734
- var open_nodes;
2735
- open_nodes = [];
2736
- _this.tree_widget.tree.iterate(function(node) {
2737
- if (node.is_open && node.id && node.hasChildren()) {
2738
- open_nodes.push(node.id);
2739
- }
2740
- return true;
2741
- });
2742
- return open_nodes;
2743
- };
2744
- })(this);
2745
- getSelectedNodeIds = (function(_this) {
2746
- return function() {
2747
- var n;
2748
- return (function() {
2749
- var _i, _len, _ref, _results;
2750
- _ref = this.tree_widget.getSelectedNodes();
2751
- _results = [];
2752
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
2753
- n = _ref[_i];
2754
- _results.push(n.id);
2755
- }
2756
- return _results;
2757
- }).call(_this);
2758
- };
2759
- })(this);
2760
- return {
2761
- open_nodes: getOpenNodeIds(),
2762
- selected_node: getSelectedNodeIds()
2763
- };
2764
- };
2765
-
2766
- SaveStateHandler.prototype.setInitialState = function(state) {
2767
- var must_load_on_demand;
2768
- if (!state) {
2769
- return false;
2770
- } else {
2771
- must_load_on_demand = this._openInitialNodes(state.open_nodes);
2772
- this._selectInitialNodes(state.selected_node);
2773
- return must_load_on_demand;
2774
- }
2775
- };
2776
-
2777
- SaveStateHandler.prototype._openInitialNodes = function(node_ids) {
2778
- var must_load_on_demand, node, node_id, _i, _len;
2779
- must_load_on_demand = false;
2780
- for (_i = 0, _len = node_ids.length; _i < _len; _i++) {
2781
- node_id = node_ids[_i];
2782
- node = this.tree_widget.getNodeById(node_id);
2783
- if (node) {
2784
- if (!node.load_on_demand) {
2785
- node.is_open = true;
2786
- } else {
2787
- must_load_on_demand = true;
2788
- }
2789
- }
2790
- }
2791
- return must_load_on_demand;
2792
- };
2793
-
2794
- SaveStateHandler.prototype._selectInitialNodes = function(node_ids) {
2795
- var node, node_id, select_count, _i, _len;
2796
- select_count = 0;
2797
- for (_i = 0, _len = node_ids.length; _i < _len; _i++) {
2798
- node_id = node_ids[_i];
2799
- node = this.tree_widget.getNodeById(node_id);
2800
- if (node) {
2801
- select_count += 1;
2802
- this.tree_widget.select_node_handler.addToSelection(node);
2803
- }
2804
- }
2805
- return select_count !== 0;
2806
- };
2807
-
2808
- SaveStateHandler.prototype.setInitialStateOnDemand = function(state) {
2809
- if (state) {
2810
- return this._setInitialStateOnDemand(state.open_nodes, state.selected_node);
2811
- }
2812
- };
2813
-
2814
- SaveStateHandler.prototype._setInitialStateOnDemand = function(node_ids, selected_nodes) {
2815
- var loadAndOpenNode, openNodes;
2816
- openNodes = (function(_this) {
2817
- return function() {
2818
- var new_nodes_ids, node, node_id, _i, _len;
2819
- new_nodes_ids = [];
2820
- for (_i = 0, _len = node_ids.length; _i < _len; _i++) {
2821
- node_id = node_ids[_i];
2822
- node = _this.tree_widget.getNodeById(node_id);
2823
- if (!node) {
2824
- new_nodes_ids.push(node_id);
2825
- } else {
2826
- if (!node.is_loading) {
2827
- if (node.load_on_demand) {
2828
- loadAndOpenNode(node);
2829
- } else {
2830
- _this.tree_widget._openNode(node, false);
2831
- }
2832
- }
2833
- }
2834
- }
2835
- node_ids = new_nodes_ids;
2836
- if (_this._selectInitialNodes(selected_nodes)) {
2837
- return _this.tree_widget._refreshElements();
2838
- }
2839
- };
2840
- })(this);
2841
- loadAndOpenNode = (function(_this) {
2842
- return function(node) {
2843
- return _this.tree_widget._openNode(node, false, openNodes);
2844
- };
2845
- })(this);
2846
- return openNodes();
2847
- };
2848
-
2849
- SaveStateHandler.prototype.getCookieName = function() {
2850
- if (typeof this.tree_widget.options.saveState === 'string') {
2851
- return this.tree_widget.options.saveState;
2852
- } else {
2853
- return 'tree';
2854
- }
2855
- };
2856
-
2857
- SaveStateHandler.prototype.supportsLocalStorage = function() {
2858
- var testSupport;
2859
- testSupport = function() {
2860
- var error, key;
2861
- if (typeof localStorage === "undefined" || localStorage === null) {
2862
- return false;
2863
- } else {
2864
- try {
2865
- key = '_storage_test';
2866
- sessionStorage.setItem(key, true);
2867
- sessionStorage.removeItem(key);
2868
- } catch (_error) {
2869
- error = _error;
2870
- return false;
2871
- }
2872
- return true;
2873
- }
2874
- };
2875
- if (this._supportsLocalStorage == null) {
2876
- this._supportsLocalStorage = testSupport();
2877
- }
2878
- return this._supportsLocalStorage;
2879
- };
2880
-
2881
- SaveStateHandler.prototype.getNodeIdToBeSelected = function() {
2882
- var state;
2883
- state = this.getStateFromStorage();
2884
- if (state && state.selected_node) {
2885
- return state.selected_node[0];
2886
- } else {
2887
- return null;
2888
- }
2889
- };
2890
-
2891
- return SaveStateHandler;
2892
-
2893
- })();
2894
-
2895
- module.exports = SaveStateHandler;
2896
-
2897
- }).call(this);
2898
-
2899
- },{"./util":12}],9:[function(require,module,exports){
2900
- (function() {
2901
- var ScrollHandler;
2902
-
2903
- ScrollHandler = (function() {
2904
- function ScrollHandler(tree_widget) {
2905
- this.tree_widget = tree_widget;
2906
- this.previous_top = -1;
2907
- this._initScrollParent();
2908
- }
2909
-
2910
- ScrollHandler.prototype._initScrollParent = function() {
2911
- var $scroll_parent, getParentWithOverflow, setDocumentAsScrollParent;
2912
- getParentWithOverflow = (function(_this) {
2913
- return function() {
2914
- var css_values, el, hasOverFlow, _i, _len, _ref;
2915
- css_values = ['overflow', 'overflow-y'];
2916
- hasOverFlow = function(el) {
2917
- var css_value, _i, _len, _ref;
2918
- for (_i = 0, _len = css_values.length; _i < _len; _i++) {
2919
- css_value = css_values[_i];
2920
- if ((_ref = $.css(el, css_value)) === 'auto' || _ref === 'scroll') {
2921
- return true;
2922
- }
2923
- }
2924
- return false;
2925
- };
2926
- if (hasOverFlow(_this.tree_widget.$el[0])) {
2927
- return _this.tree_widget.$el;
2928
- }
2929
- _ref = _this.tree_widget.$el.parents();
2930
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
2931
- el = _ref[_i];
2932
- if (hasOverFlow(el)) {
2933
- return $(el);
2934
- }
2935
- }
2936
- return null;
2937
- };
2938
- })(this);
2939
- setDocumentAsScrollParent = (function(_this) {
2940
- return function() {
2941
- _this.scroll_parent_top = 0;
2942
- return _this.$scroll_parent = null;
2943
- };
2944
- })(this);
2945
- if (this.tree_widget.$el.css('position') === 'fixed') {
2946
- setDocumentAsScrollParent();
2947
- }
2948
- $scroll_parent = getParentWithOverflow();
2949
- if ($scroll_parent && $scroll_parent.length && $scroll_parent[0].tagName !== 'HTML') {
2950
- this.$scroll_parent = $scroll_parent;
2951
- return this.scroll_parent_top = this.$scroll_parent.offset().top;
2952
- } else {
2953
- return setDocumentAsScrollParent();
2954
- }
2955
- };
2956
-
2957
- ScrollHandler.prototype.checkScrolling = function() {
2958
- var hovered_area;
2959
- hovered_area = this.tree_widget.dnd_handler.hovered_area;
2960
- if (hovered_area && hovered_area.top !== this.previous_top) {
2961
- this.previous_top = hovered_area.top;
2962
- if (this.$scroll_parent) {
2963
- return this._handleScrollingWithScrollParent(hovered_area);
2964
- } else {
2965
- return this._handleScrollingWithDocument(hovered_area);
2966
- }
2967
- }
2968
- };
2969
-
2970
- ScrollHandler.prototype._handleScrollingWithScrollParent = function(area) {
2971
- var distance_bottom;
2972
- distance_bottom = this.scroll_parent_top + this.$scroll_parent[0].offsetHeight - area.bottom;
2973
- if (distance_bottom < 20) {
2974
- this.$scroll_parent[0].scrollTop += 20;
2975
- this.tree_widget.refreshHitAreas();
2976
- return this.previous_top = -1;
2977
- } else if ((area.top - this.scroll_parent_top) < 20) {
2978
- this.$scroll_parent[0].scrollTop -= 20;
2979
- this.tree_widget.refreshHitAreas();
2980
- return this.previous_top = -1;
2981
- }
2982
- };
2983
-
2984
- ScrollHandler.prototype._handleScrollingWithDocument = function(area) {
2985
- var distance_top;
2986
- distance_top = area.top - $(document).scrollTop();
2987
- if (distance_top < 20) {
2988
- return $(document).scrollTop($(document).scrollTop() - 20);
2989
- } else if ($(window).height() - (area.bottom - $(document).scrollTop()) < 20) {
2990
- return $(document).scrollTop($(document).scrollTop() + 20);
2991
- }
2992
- };
2993
-
2994
- ScrollHandler.prototype.scrollTo = function(top) {
2995
- var tree_top;
2996
- if (this.$scroll_parent) {
2997
- return this.$scroll_parent[0].scrollTop = top;
2998
- } else {
2999
- tree_top = this.tree_widget.$el.offset().top;
3000
- return $(document).scrollTop(top + tree_top);
3001
- }
3002
- };
3003
-
3004
- ScrollHandler.prototype.isScrolledIntoView = function(element) {
3005
- var $element, element_bottom, element_top, view_bottom, view_top;
3006
- $element = $(element);
3007
- if (this.$scroll_parent) {
3008
- view_top = 0;
3009
- view_bottom = this.$scroll_parent.height();
3010
- element_top = $element.offset().top - this.scroll_parent_top;
3011
- element_bottom = element_top + $element.height();
3012
- } else {
3013
- view_top = $(window).scrollTop();
3014
- view_bottom = view_top + $(window).height();
3015
- element_top = $element.offset().top;
3016
- element_bottom = element_top + $element.height();
3017
- }
3018
- return (element_bottom <= view_bottom) && (element_top >= view_top);
3019
- };
3020
-
3021
- return ScrollHandler;
3022
-
3023
- })();
3024
-
3025
- module.exports = ScrollHandler;
3026
-
3027
- }).call(this);
3028
-
3029
- },{}],10:[function(require,module,exports){
3030
- (function() {
3031
- var SelectNodeHandler;
3032
-
3033
- SelectNodeHandler = (function() {
3034
- function SelectNodeHandler(tree_widget) {
3035
- this.tree_widget = tree_widget;
3036
- this.clear();
3037
- }
3038
-
3039
- SelectNodeHandler.prototype.getSelectedNode = function() {
3040
- var selected_nodes;
3041
- selected_nodes = this.getSelectedNodes();
3042
- if (selected_nodes.length) {
3043
- return selected_nodes[0];
3044
- } else {
3045
- return false;
3046
- }
3047
- };
3048
-
3049
- SelectNodeHandler.prototype.getSelectedNodes = function() {
3050
- var id, node, selected_nodes;
3051
- if (this.selected_single_node) {
3052
- return [this.selected_single_node];
3053
- } else {
3054
- selected_nodes = [];
3055
- for (id in this.selected_nodes) {
3056
- node = this.tree_widget.getNodeById(id);
3057
- if (node) {
3058
- selected_nodes.push(node);
3059
- }
3060
- }
3061
- return selected_nodes;
3062
- }
3063
- };
3064
-
3065
- SelectNodeHandler.prototype.getSelectedNodesUnder = function(parent) {
3066
- var id, node, selected_nodes;
3067
- if (this.selected_single_node) {
3068
- if (parent.isParentOf(this.selected_single_node)) {
3069
- return [this.selected_single_node];
3070
- } else {
3071
- return [];
3072
- }
3073
- } else {
3074
- selected_nodes = [];
3075
- for (id in this.selected_nodes) {
3076
- node = this.tree_widget.getNodeById(id);
3077
- if (node && parent.isParentOf(node)) {
3078
- selected_nodes.push(node);
3079
- }
3080
- }
3081
- return selected_nodes;
3082
- }
3083
- };
3084
-
3085
- SelectNodeHandler.prototype.isNodeSelected = function(node) {
3086
- if (node.id) {
3087
- return this.selected_nodes[node.id];
3088
- } else if (this.selected_single_node) {
3089
- return this.selected_single_node.element === node.element;
3090
- } else {
3091
- return false;
3092
- }
3093
- };
3094
-
3095
- SelectNodeHandler.prototype.clear = function() {
3096
- this.selected_nodes = {};
3097
- return this.selected_single_node = null;
3098
- };
3099
-
3100
- SelectNodeHandler.prototype.removeFromSelection = function(node, include_children) {
3101
- if (include_children == null) {
3102
- include_children = false;
3103
- }
3104
- if (!node.id) {
3105
- if (this.selected_single_node && node.element === this.selected_single_node.element) {
3106
- return this.selected_single_node = null;
3107
- }
3108
- } else {
3109
- delete this.selected_nodes[node.id];
3110
- if (include_children) {
3111
- return node.iterate((function(_this) {
3112
- return function(n) {
3113
- delete _this.selected_nodes[node.id];
3114
- return true;
3115
- };
3116
- })(this));
3117
- }
3118
- }
3119
- };
3120
-
3121
- SelectNodeHandler.prototype.addToSelection = function(node) {
3122
- if (node.id) {
3123
- return this.selected_nodes[node.id] = true;
3124
- } else {
3125
- return this.selected_single_node = node;
3126
- }
3127
- };
3128
-
3129
- return SelectNodeHandler;
3130
-
3131
- })();
3132
-
3133
- module.exports = SelectNodeHandler;
3134
-
3135
- }).call(this);
3136
-
3137
- },{}],11:[function(require,module,exports){
3138
-
3139
- /*
3140
- Copyright 2013 Marco Braak
3141
-
3142
- Licensed under the Apache License, Version 2.0 (the "License");
3143
- you may not use this file except in compliance with the License.
3144
- You may obtain a copy of the License at
3145
-
3146
- http://www.apache.org/licenses/LICENSE-2.0
3147
-
3148
- Unless required by applicable law or agreed to in writing, software
3149
- distributed under the License is distributed on an "AS IS" BASIS,
3150
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3151
- See the License for the specific language governing permissions and
3152
- limitations under the License.
3153
- */
3154
-
3155
- (function() {
3156
- var SimpleWidget,
3157
- __slice = [].slice;
3158
-
3159
- SimpleWidget = (function() {
3160
- SimpleWidget.prototype.defaults = {};
3161
-
3162
- function SimpleWidget(el, options) {
3163
- this.$el = $(el);
3164
- this.options = $.extend({}, this.defaults, options);
3165
- }
3166
-
3167
- SimpleWidget.prototype.destroy = function() {
3168
- return this._deinit();
3169
- };
3170
-
3171
- SimpleWidget.prototype._init = function() {
3172
- return null;
3173
- };
3174
-
3175
- SimpleWidget.prototype._deinit = function() {
3176
- return null;
3177
- };
3178
-
3179
- SimpleWidget.register = function(widget_class, widget_name) {
3180
- var callFunction, createWidget, destroyWidget, getDataKey, getWidgetData;
3181
- getDataKey = function() {
3182
- return "simple_widget_" + widget_name;
3183
- };
3184
- getWidgetData = function(el, data_key) {
3185
- var widget;
3186
- widget = $.data(el, data_key);
3187
- if (widget && (widget instanceof SimpleWidget)) {
3188
- return widget;
3189
- } else {
3190
- return null;
3191
- }
3192
- };
3193
- createWidget = function($el, options) {
3194
- var data_key, el, existing_widget, widget, _i, _len;
3195
- data_key = getDataKey();
3196
- for (_i = 0, _len = $el.length; _i < _len; _i++) {
3197
- el = $el[_i];
3198
- existing_widget = getWidgetData(el, data_key);
3199
- if (!existing_widget) {
3200
- widget = new widget_class(el, options);
3201
- if (!$.data(el, data_key)) {
3202
- $.data(el, data_key, widget);
3203
- }
3204
- widget._init();
3205
- }
3206
- }
3207
- return $el;
3208
- };
3209
- destroyWidget = function($el) {
3210
- var data_key, el, widget, _i, _len, _results;
3211
- data_key = getDataKey();
3212
- _results = [];
3213
- for (_i = 0, _len = $el.length; _i < _len; _i++) {
3214
- el = $el[_i];
3215
- widget = getWidgetData(el, data_key);
3216
- if (widget) {
3217
- widget.destroy();
3218
- }
3219
- _results.push($.removeData(el, data_key));
3220
- }
3221
- return _results;
3222
- };
3223
- callFunction = function($el, function_name, args) {
3224
- var el, result, widget, widget_function, _i, _len;
3225
- result = null;
3226
- for (_i = 0, _len = $el.length; _i < _len; _i++) {
3227
- el = $el[_i];
3228
- widget = $.data(el, getDataKey());
3229
- if (widget && (widget instanceof SimpleWidget)) {
3230
- widget_function = widget[function_name];
3231
- if (widget_function && (typeof widget_function === 'function')) {
3232
- result = widget_function.apply(widget, args);
3233
- }
3234
- }
3235
- }
3236
- return result;
3237
- };
3238
- return $.fn[widget_name] = function() {
3239
- var $el, args, argument1, function_name, options;
3240
- argument1 = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
3241
- $el = this;
3242
- if (argument1 === void 0 || typeof argument1 === 'object') {
3243
- options = argument1;
3244
- return createWidget($el, options);
3245
- } else if (typeof argument1 === 'string' && argument1[0] !== '_') {
3246
- function_name = argument1;
3247
- if (function_name === 'destroy') {
3248
- return destroyWidget($el);
3249
- } else {
3250
- return callFunction($el, function_name, args);
3251
- }
3252
- }
3253
- };
3254
- };
3255
-
3256
- return SimpleWidget;
3257
-
3258
- })();
3259
-
3260
- module.exports = SimpleWidget;
3261
-
3262
- }).call(this);
3263
-
3264
- },{}],12:[function(require,module,exports){
3265
- (function() {
3266
- var get_json_stringify_function, html_escape, indexOf, isInt, _indexOf;
3267
-
3268
- _indexOf = function(array, item) {
3269
- var i, value, _i, _len;
3270
- for (i = _i = 0, _len = array.length; _i < _len; i = ++_i) {
3271
- value = array[i];
3272
- if (value === item) {
3273
- return i;
3274
- }
3275
- }
3276
- return -1;
3277
- };
3278
-
3279
- indexOf = function(array, item) {
3280
- if (array.indexOf) {
3281
- return array.indexOf(item);
3282
- } else {
3283
- return _indexOf(array, item);
3284
- }
3285
- };
3286
-
3287
- isInt = function(n) {
3288
- return typeof n === 'number' && n % 1 === 0;
3289
- };
3290
-
3291
- get_json_stringify_function = function() {
3292
- var json_escapable, json_meta, json_quote, json_str, stringify;
3293
- json_escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
3294
- json_meta = {
3295
- '\b': '\\b',
3296
- '\t': '\\t',
3297
- '\n': '\\n',
3298
- '\f': '\\f',
3299
- '\r': '\\r',
3300
- '"': '\\"',
3301
- '\\': '\\\\'
3302
- };
3303
- json_quote = function(string) {
3304
- json_escapable.lastIndex = 0;
3305
- if (json_escapable.test(string)) {
3306
- return '"' + string.replace(json_escapable, function(a) {
3307
- var c;
3308
- c = json_meta[a];
3309
- return (typeof c === 'string' ? c : '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4));
3310
- }) + '"';
3311
- } else {
3312
- return '"' + string + '"';
3313
- }
3314
- };
3315
- json_str = function(key, holder) {
3316
- var i, k, partial, v, value, _i, _len;
3317
- value = holder[key];
3318
- switch (typeof value) {
3319
- case 'string':
3320
- return json_quote(value);
3321
- case 'number':
3322
- if (isFinite(value)) {
3323
- return String(value);
3324
- } else {
3325
- return 'null';
3326
- }
3327
- case 'boolean':
3328
- case 'null':
3329
- return String(value);
3330
- case 'object':
3331
- if (!value) {
3332
- return 'null';
3333
- }
3334
- partial = [];
3335
- if (Object.prototype.toString.apply(value) === '[object Array]') {
3336
- for (i = _i = 0, _len = value.length; _i < _len; i = ++_i) {
3337
- v = value[i];
3338
- partial[i] = json_str(i, value) || 'null';
3339
- }
3340
- return (partial.length === 0 ? '[]' : '[' + partial.join(',') + ']');
3341
- }
3342
- for (k in value) {
3343
- if (Object.prototype.hasOwnProperty.call(value, k)) {
3344
- v = json_str(k, value);
3345
- if (v) {
3346
- partial.push(json_quote(k) + ':' + v);
3347
- }
3348
- }
3349
- }
3350
- return (partial.length === 0 ? '{}' : '{' + partial.join(',') + '}');
3351
- }
3352
- };
3353
- stringify = function(value) {
3354
- return json_str('', {
3355
- '': value
3356
- });
3357
- };
3358
- return stringify;
3359
- };
3360
-
3361
- if (!((this.JSON != null) && (this.JSON.stringify != null) && typeof this.JSON.stringify === 'function')) {
3362
- if (this.JSON == null) {
3363
- this.JSON = {};
3364
- }
3365
- this.JSON.stringify = get_json_stringify_function();
3366
- }
3367
-
3368
- html_escape = function(string) {
3369
- return ('' + string).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;').replace(/'/g, '&#x27;').replace(/\//g, '&#x2F;');
3370
- };
3371
-
3372
- module.exports = {
3373
- _indexOf: _indexOf,
3374
- get_json_stringify_function: get_json_stringify_function,
3375
- html_escape: html_escape,
3376
- indexOf: indexOf,
3377
- isInt: isInt
3378
- };
3379
-
3380
- }).call(this);
3381
-
3382
- },{}],13:[function(require,module,exports){
3383
- (function() {
3384
- module.exports = '0.22.0';
3385
-
3386
- }).call(this);
3387
-
3388
- },{}]},{},[3])