spree_backend 3.1.14 → 3.2.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/images/admin/logo.png +0 -0
- data/app/assets/javascripts/spree/backend/admin.js +2 -25
- data/app/assets/javascripts/spree/backend/checkouts/edit.js +2 -1
- data/app/assets/javascripts/spree/backend/line_items.js.coffee +2 -2
- data/app/assets/javascripts/spree/backend/line_items_on_order_edit.js +5 -2
- data/app/assets/javascripts/spree/backend/option_type_autocomplete.js +2 -2
- data/app/assets/javascripts/spree/backend/option_value_picker.js +2 -2
- data/app/assets/javascripts/spree/backend/payments/edit.js.coffee +10 -8
- data/app/assets/javascripts/spree/backend/product_picker.js +3 -2
- data/app/assets/javascripts/spree/backend/{shipments.js.erb → shipments.js} +1 -1
- data/app/assets/javascripts/spree/backend/states.js +9 -7
- data/app/assets/javascripts/spree/backend/stock_location.js +3 -0
- data/app/assets/javascripts/spree/backend/tag_picker.js +52 -0
- data/app/assets/javascripts/spree/backend/taxon_autocomplete.js +2 -2
- data/app/assets/javascripts/spree/backend/taxon_permalink_preview.js +12 -0
- data/app/assets/javascripts/spree/backend/taxonomy.js.coffee +2 -2
- data/app/assets/javascripts/spree/backend/taxons.js.coffee +1 -1
- data/app/assets/javascripts/spree/backend/user_picker.js +4 -3
- data/app/assets/javascripts/spree/backend.js +8 -7
- data/app/assets/stylesheets/spree/backend/components/_main.scss +5 -1
- data/app/assets/stylesheets/spree/backend/components/_sidebar.scss +7 -0
- data/app/assets/stylesheets/spree/backend/shared/_forms.scss +1 -1
- data/app/assets/stylesheets/spree/backend/spree_admin.css.scss +0 -1
- data/app/controllers/spree/admin/base_controller.rb +0 -11
- data/app/controllers/spree/admin/option_types_controller.rb +2 -14
- data/app/controllers/spree/admin/option_values_controller.rb +1 -1
- data/app/controllers/spree/admin/orders_controller.rb +7 -7
- data/app/controllers/spree/admin/payment_methods_controller.rb +4 -0
- data/app/controllers/spree/admin/product_properties_controller.rb +1 -1
- data/app/controllers/spree/admin/products_controller.rb +1 -1
- data/app/controllers/spree/admin/promotion_actions_controller.rb +5 -5
- data/app/controllers/spree/admin/promotion_rules_controller.rb +6 -6
- data/app/controllers/spree/admin/promotions_controller.rb +2 -2
- data/app/controllers/spree/admin/properties_controller.rb +1 -1
- data/app/controllers/spree/admin/prototypes_controller.rb +2 -2
- data/app/controllers/spree/admin/refunds_controller.rb +1 -1
- data/app/controllers/spree/admin/reimbursement_types_controller.rb +26 -0
- data/app/controllers/spree/admin/reimbursements_controller.rb +1 -1
- data/app/controllers/spree/admin/reports_controller.rb +1 -1
- data/app/controllers/spree/admin/resource_controller.rb +8 -8
- data/app/controllers/spree/admin/return_authorizations_controller.rb +3 -3
- data/app/controllers/spree/admin/return_index_controller.rb +1 -1
- data/app/controllers/spree/admin/shipping_methods_controller.rb +2 -2
- data/app/controllers/spree/admin/states_controller.rb +1 -1
- data/app/controllers/spree/admin/stock_items_controller.rb +2 -2
- data/app/controllers/spree/admin/stock_movements_controller.rb +1 -5
- data/app/controllers/spree/admin/store_credits_controller.rb +1 -1
- data/app/controllers/spree/admin/taxons_controller.rb +1 -10
- data/app/controllers/spree/admin/users_controller.rb +5 -41
- data/app/controllers/spree/admin/variants_controller.rb +3 -1
- data/app/helpers/spree/admin/base_helper.rb +1 -6
- data/app/helpers/spree/admin/navigation_helper.rb +9 -31
- data/app/helpers/spree/admin/promotion_rules_helper.rb +12 -0
- data/app/views/kaminari/_first_page.html.erb +1 -1
- data/app/views/kaminari/_last_page.html.erb +1 -1
- data/app/views/kaminari/_next_page.html.erb +1 -1
- data/app/views/kaminari/_page.html.erb +1 -1
- data/app/views/kaminari/_paginator.html.erb +2 -4
- data/app/views/kaminari/_prev_page.html.erb +1 -1
- data/app/views/spree/admin/adjustments/_adjustments_table.html.erb +1 -1
- data/app/views/spree/admin/adjustments/_form.html.erb +4 -4
- data/app/views/spree/admin/countries/_form.html.erb +2 -2
- data/app/views/spree/admin/countries/edit.html.erb +3 -3
- data/app/views/spree/admin/countries/index.html.erb +3 -3
- data/app/views/spree/admin/countries/new.html.erb +3 -3
- data/app/views/spree/admin/customer_returns/new.html.erb +1 -1
- data/app/views/spree/admin/images/_form.html.erb +2 -2
- data/app/views/spree/admin/option_types/_form.html.erb +2 -2
- data/app/views/spree/admin/option_types/edit.html.erb +5 -5
- data/app/views/spree/admin/option_types/new.html.erb +3 -3
- data/app/views/spree/admin/orders/_adjustments.html.erb +6 -4
- data/app/views/spree/admin/orders/_form.html.erb +1 -1
- data/app/views/spree/admin/orders/_line_items.html.erb +8 -6
- data/app/views/spree/admin/orders/_line_items_edit_form.html.erb +1 -1
- data/app/views/spree/admin/orders/_shipment.html.erb +9 -7
- data/app/views/spree/admin/orders/cart.html.erb +0 -4
- data/app/views/spree/admin/orders/edit.html.erb +0 -4
- data/app/views/spree/admin/orders/index.html.erb +20 -20
- data/app/views/spree/admin/payment_methods/_form.html.erb +5 -5
- data/app/views/spree/admin/payment_methods/index.html.erb +3 -3
- data/app/views/spree/admin/payments/_form.html.erb +6 -6
- data/app/views/spree/admin/payments/source_forms/_gateway.html.erb +6 -6
- data/app/views/spree/admin/products/_form.html.erb +14 -8
- data/app/views/spree/admin/products/_properties_form.erb +1 -1
- data/app/views/spree/admin/products/index.html.erb +6 -6
- data/app/views/spree/admin/products/new.html.erb +16 -16
- data/app/views/spree/admin/promotion_categories/_form.html.erb +3 -3
- data/app/views/spree/admin/promotion_categories/edit.html.erb +3 -3
- data/app/views/spree/admin/promotion_categories/index.html.erb +3 -3
- data/app/views/spree/admin/promotion_categories/new.html.erb +3 -3
- data/app/views/spree/admin/promotions/_actions.html.erb +4 -4
- data/app/views/spree/admin/promotions/_form.html.erb +10 -10
- data/app/views/spree/admin/promotions/_promotion_rule.html.erb +1 -1
- data/app/views/spree/admin/promotions/_rules.html.erb +4 -4
- data/app/views/spree/admin/promotions/actions/_create_adjustment.html.erb +1 -1
- data/app/views/spree/admin/promotions/actions/_create_item_adjustments.html.erb +2 -2
- data/app/views/spree/admin/promotions/actions/_create_line_items.html.erb +1 -1
- data/app/views/spree/admin/promotions/edit.html.erb +6 -6
- data/app/views/spree/admin/promotions/index.html.erb +5 -5
- data/app/views/spree/admin/promotions/new.html.erb +3 -3
- data/app/views/spree/admin/promotions/rules/_country.html.erb +6 -0
- data/app/views/spree/admin/promotions/rules/_landing_page.html.erb +1 -1
- data/app/views/spree/admin/promotions/rules/_product.html.erb +2 -2
- data/app/views/spree/admin/promotions/rules/_taxon.html.erb +2 -2
- data/app/views/spree/admin/properties/_form.html.erb +2 -2
- data/app/views/spree/admin/properties/edit.html.erb +3 -3
- data/app/views/spree/admin/properties/index.html.erb +6 -6
- data/app/views/spree/admin/prototypes/_prototypes.html.erb +1 -1
- data/app/views/spree/admin/prototypes/available.js.erb +1 -1
- data/app/views/spree/admin/prototypes/edit.html.erb +3 -3
- data/app/views/spree/admin/prototypes/index.html.erb +3 -3
- data/app/views/spree/admin/prototypes/new.html.erb +3 -3
- data/app/views/spree/admin/prototypes/show.html.erb +1 -1
- data/app/views/spree/admin/refunds/edit.html.erb +2 -0
- data/app/views/spree/admin/refunds/new.html.erb +2 -0
- data/app/views/spree/admin/reimbursement_types/_form.html.erb +32 -0
- data/app/views/spree/admin/reimbursement_types/edit.html.erb +11 -0
- data/app/views/spree/admin/reimbursement_types/index.html.erb +9 -0
- data/app/views/spree/admin/reimbursement_types/new.html.erb +11 -0
- data/app/views/spree/admin/reimbursements/edit.html.erb +1 -1
- data/app/views/spree/admin/reports/sales_total.html.erb +1 -1
- data/app/views/spree/admin/return_authorizations/_form.html.erb +4 -4
- data/app/views/spree/admin/return_index/customer_returns.html.erb +1 -2
- data/app/views/spree/admin/return_index/return_authorizations.html.erb +4 -4
- data/app/views/spree/admin/roles/edit.html.erb +1 -1
- data/app/views/spree/admin/roles/new.html.erb +1 -1
- data/app/views/spree/admin/shared/_calculator_fields.html.erb +2 -2
- data/app/views/spree/admin/shared/_destroy.js.erb +1 -1
- data/app/views/spree/admin/shared/_edit_resource_links.html.erb +2 -2
- data/app/views/spree/admin/shared/_head.html.erb +2 -1
- data/app/views/spree/admin/shared/_header.html.erb +4 -11
- data/app/views/spree/admin/shared/_index_table_options.html.erb +1 -1
- data/app/views/spree/admin/shared/_main_menu.html.erb +6 -0
- data/app/views/spree/admin/shared/_new_resource_links.html.erb +2 -2
- data/app/views/spree/admin/shared/_order_summary.html.erb +3 -3
- data/app/views/spree/admin/shared/_refunds.html.erb +1 -1
- data/app/views/spree/admin/shared/_report_order_criteria.html.erb +3 -3
- data/app/views/spree/admin/shared/_translations.html.erb +38 -38
- data/app/views/spree/admin/shared/{_update_order_state.js → _update_order_state.js.erb} +3 -3
- data/app/views/spree/admin/shared/named_types/_index.html.erb +2 -2
- data/app/views/spree/admin/shipping_categories/edit.html.erb +3 -3
- data/app/views/spree/admin/shipping_categories/index.html.erb +3 -3
- data/app/views/spree/admin/shipping_categories/new.html.erb +3 -3
- data/app/views/spree/admin/shipping_methods/_form.html.erb +14 -14
- data/app/views/spree/admin/shipping_methods/edit.html.erb +3 -3
- data/app/views/spree/admin/shipping_methods/index.html.erb +3 -3
- data/app/views/spree/admin/shipping_methods/new.html.erb +3 -3
- data/app/views/spree/admin/states/_form.html.erb +2 -2
- data/app/views/spree/admin/states/_state_list.html.erb +2 -2
- data/app/views/spree/admin/states/edit.html.erb +3 -3
- data/app/views/spree/admin/states/index.html.erb +3 -3
- data/app/views/spree/admin/states/new.html.erb +3 -3
- data/app/views/spree/admin/stock_locations/_form.html.erb +0 -8
- data/app/views/spree/admin/stock_locations/_transfer_stock_form.html.erb +1 -1
- data/app/views/spree/admin/stock_locations/edit.html.erb +3 -3
- data/app/views/spree/admin/stock_locations/index.html.erb +4 -4
- data/app/views/spree/admin/stock_locations/new.html.erb +3 -3
- data/app/views/spree/admin/stock_transfers/index.html.erb +3 -3
- data/app/views/spree/admin/stock_transfers/new.html.erb +1 -1
- data/app/views/spree/admin/stock_transfers/show.html.erb +3 -3
- data/app/views/spree/admin/tax_categories/_form.html.erb +7 -7
- data/app/views/spree/admin/tax_categories/edit.html.erb +3 -3
- data/app/views/spree/admin/tax_categories/new.html.erb +3 -3
- data/app/views/spree/admin/tax_rates/_form.html.erb +5 -5
- data/app/views/spree/admin/tax_rates/edit.html.erb +3 -3
- data/app/views/spree/admin/tax_rates/new.html.erb +3 -3
- data/app/views/spree/admin/taxonomies/_form.html.erb +2 -2
- data/app/views/spree/admin/taxonomies/_js_head.html.erb +0 -5
- data/app/views/spree/admin/taxonomies/new.html.erb +1 -1
- data/app/views/spree/admin/taxons/_form.html.erb +7 -7
- data/app/views/spree/admin/taxons/_taxon_table.html.erb +1 -1
- data/app/views/spree/admin/taxons/edit.html.erb +0 -15
- data/app/views/spree/admin/taxons/index.html.erb +1 -1
- data/app/views/spree/admin/trackers/_form.html.erb +1 -1
- data/app/views/spree/admin/trackers/edit.html.erb +3 -3
- data/app/views/spree/admin/trackers/index.html.erb +3 -3
- data/app/views/spree/admin/trackers/new.html.erb +3 -3
- data/app/views/spree/admin/users/_addresses_form.html.erb +2 -2
- data/app/views/spree/admin/users/_form.html.erb +3 -3
- data/app/views/spree/admin/users/index.html.erb +7 -7
- data/app/views/spree/admin/users/items.html.erb +2 -2
- data/app/views/spree/admin/users/new.html.erb +3 -3
- data/app/views/spree/admin/variants/_autocomplete_line_items_stock.js.erb +24 -7
- data/app/views/spree/admin/variants/_autocomplete_stock.js.erb +1 -0
- data/app/views/spree/admin/variants/_form.html.erb +7 -7
- data/app/views/spree/admin/variants/new.html.erb +3 -3
- data/app/views/spree/admin/zones/_country_members.html.erb +1 -1
- data/app/views/spree/admin/zones/_form.html.erb +6 -6
- data/app/views/spree/admin/zones/_state_members.html.erb +1 -1
- data/app/views/spree/admin/zones/edit.html.erb +3 -3
- data/app/views/spree/admin/zones/index.html.erb +5 -5
- data/app/views/spree/admin/zones/new.html.erb +3 -3
- data/config/routes.rb +4 -12
- data/lib/spree/backend/engine.rb +2 -6
- data/spec/controllers/spree/admin/base_controller_spec.rb +46 -0
- data/spec/controllers/spree/admin/customer_returns_controller_spec.rb +185 -0
- data/spec/controllers/spree/admin/general_settings_controller_spec.rb +41 -0
- data/spec/controllers/spree/admin/missing_products_controller_spec.rb +18 -0
- data/spec/controllers/spree/admin/orders/customer_details_controller_spec.rb +197 -0
- data/spec/controllers/spree/admin/orders_controller_spec.rb +296 -0
- data/spec/controllers/spree/admin/payment_methods_controller_spec.rb +49 -0
- data/spec/controllers/spree/admin/payments_controller_spec.rb +97 -0
- data/spec/controllers/spree/admin/products_controller_spec.rb +99 -0
- data/spec/controllers/spree/admin/promotion_actions_controller_spec.rb +21 -0
- data/spec/controllers/spree/admin/promotion_rules_controller_spec.rb +21 -0
- data/spec/controllers/spree/admin/promotions_controller_spec.rb +44 -0
- data/spec/controllers/spree/admin/refunds_controller_spec.rb +32 -0
- data/spec/controllers/spree/admin/reimbursements_controller_spec.rb +74 -0
- data/spec/controllers/spree/admin/reports_controller_spec.rb +42 -0
- data/spec/controllers/spree/admin/resource_controller_spec.rb +252 -0
- data/spec/controllers/spree/admin/return_authorizations_controller_spec.rb +225 -0
- data/spec/controllers/spree/admin/return_index_controller_spec.rb +37 -0
- data/spec/controllers/spree/admin/return_items_controller_spec.rb +27 -0
- data/spec/controllers/spree/admin/shipping_methods_controller_spec.rb +14 -0
- data/spec/controllers/spree/admin/stock_items_controller_spec.rb +19 -0
- data/spec/controllers/spree/admin/stock_locations_controller_spec.rb +41 -0
- data/spec/controllers/spree/admin/stock_transfers_controller_spec.rb +41 -0
- data/spec/controllers/spree/admin/tax_categories_controller_spec.rb +34 -0
- data/spec/controllers/spree/admin/users_controller_spec.rb +161 -0
- data/spec/controllers/spree/admin/variants_controller_spec.rb +32 -0
- data/spec/features/admin/configuration/analytics_tracker_spec.rb +47 -0
- data/spec/features/admin/configuration/countries_spec.rb +24 -0
- data/spec/features/admin/configuration/general_settings_spec.rb +44 -0
- data/spec/features/admin/configuration/payment_methods_spec.rb +63 -0
- data/spec/features/admin/configuration/roles_spec.rb +47 -0
- data/spec/features/admin/configuration/shipping_methods_spec.rb +62 -0
- data/spec/features/admin/configuration/states_spec.rb +68 -0
- data/spec/features/admin/configuration/stock_locations_spec.rb +48 -0
- data/spec/features/admin/configuration/store_credit_categories_spec.rb +50 -0
- data/spec/features/admin/configuration/tax_categories_spec.rb +56 -0
- data/spec/features/admin/configuration/tax_rates_spec.rb +18 -0
- data/spec/features/admin/configuration/zones_spec.rb +39 -0
- data/spec/features/admin/homepage_spec.rb +89 -0
- data/spec/features/admin/locale_spec.rb +31 -0
- data/spec/features/admin/orders/adjustments_promotions_spec.rb +53 -0
- data/spec/features/admin/orders/adjustments_spec.rb +129 -0
- data/spec/features/admin/orders/cancelling_and_resuming_spec.rb +47 -0
- data/spec/features/admin/orders/customer_details_spec.rb +154 -0
- data/spec/features/admin/orders/line_items_spec.rb +51 -0
- data/spec/features/admin/orders/listing_spec.rb +224 -0
- data/spec/features/admin/orders/log_entries_spec.rb +55 -0
- data/spec/features/admin/orders/new_order_spec.rb +186 -0
- data/spec/features/admin/orders/order_details_spec.rb +662 -0
- data/spec/features/admin/orders/payments_spec.rb +231 -0
- data/spec/features/admin/orders/risk_analysis_spec.rb +48 -0
- data/spec/features/admin/orders/shipments_spec.rb +64 -0
- data/spec/features/admin/orders/state_changes_spec.rb +21 -0
- data/spec/features/admin/products/edit/images_spec.rb +86 -0
- data/spec/features/admin/products/edit/products_spec.rb +64 -0
- data/spec/features/admin/products/edit/taxons_spec.rb +41 -0
- data/spec/features/admin/products/edit/variants_spec.rb +56 -0
- data/spec/features/admin/products/option_types_spec.rb +114 -0
- data/spec/features/admin/products/products_spec.rb +445 -0
- data/spec/features/admin/products/properties_spec.rb +147 -0
- data/spec/features/admin/products/prototypes_spec.rb +112 -0
- data/spec/features/admin/products/stock_management_spec.rb +124 -0
- data/spec/features/admin/products/taxonomies_spec.rb +52 -0
- data/spec/features/admin/products/variant_spec.rb +50 -0
- data/spec/features/admin/promotions/adjustments_spec.rb +259 -0
- data/spec/features/admin/promotions/option_value_rule_spec.rb +70 -0
- data/spec/features/admin/promotions/tiered_calculator_spec.rb +70 -0
- data/spec/features/admin/refund_reasons/refund_reasons_spec.rb +57 -0
- data/spec/features/admin/reimbursement_type/edit_reimbursement_type_spec.rb +36 -0
- data/spec/features/admin/reimbursement_type/new_reimbursement_type_spec.rb +62 -0
- data/spec/features/admin/reports_spec.rb +61 -0
- data/spec/features/admin/return_authorization_reasons/return_authorization_reasons_spec.rb +63 -0
- data/spec/features/admin/returns/customer_returns_spec.rb +80 -0
- data/spec/features/admin/returns/return_authorizations_spec.rb +152 -0
- data/spec/features/admin/stock_transfer_spec.rb +75 -0
- data/spec/features/admin/store_credits_spec.rb +93 -0
- data/spec/features/admin/taxons_spec.rb +47 -0
- data/spec/features/admin/users_spec.rb +286 -0
- data/spec/helpers/admin/base_helper_spec.rb +30 -0
- data/spec/helpers/admin/navigation_helper_spec.rb +111 -0
- data/spec/helpers/admin/promotion_rules_helper_spec.rb +12 -0
- data/spec/helpers/admin/stock_movements_helper_spec.rb +30 -0
- data/spec/models/spree/resource_spec.rb +48 -0
- data/spec/routing/admin_path_spec.rb +22 -0
- data/spec/spec_helper.rb +144 -0
- data/spec/support/appear_before_matcher.rb +8 -0
- data/spec/support/ror_ringer.jpeg +0 -0
- data/spec/test_views/spree/admin/submodule/posts/edit.html.erb +1 -0
- data/spec/test_views/spree/admin/submodule/posts/new.html.erb +1 -0
- data/spec/test_views/spree/admin/widgets/edit.html.erb +1 -0
- data/spec/test_views/spree/admin/widgets/new.html.erb +1 -0
- data/spree_backend.gemspec +4 -3
- data/vendor/assets/javascripts/jquery.jstree/jquery.jstree.js +130 -154
- metadata +114 -34
- data/app/assets/images/admin/payment_banner.png +0 -0
- data/app/assets/images/admin/progress.gif +0 -0
- data/app/assets/javascripts/spree/backend/nested-attribute.js +0 -27
- data/app/assets/javascripts/spree/backend/orders/edit_form.js +0 -21
- data/app/assets/stylesheets/spree/backend/components/_variables.scss +0 -12
- data/app/assets/stylesheets/spree/backend/plugins/_js_tree.scss +0 -0
- data/app/assets/stylesheets/spree/backend/shared/_typography.scss +0 -5
- data/app/controllers/spree/admin/root_controller.rb +0 -18
- data/app/controllers/spree/admin/search_controller.rb +0 -41
- data/app/helpers/spree/admin/inventory_settings_helper.rb +0 -9
- data/app/helpers/spree/admin/products_helper.rb +0 -29
- data/app/helpers/spree/admin/tables_helper.rb +0 -15
- data/app/helpers/spree/promotion_rules_helper.rb +0 -13
- data/app/views/spree/admin/inventory_units/adjust.html.erb +0 -29
- data/app/views/spree/admin/orders/_line_item.html.erb +0 -21
- data/app/views/spree/admin/refund_reasons/destroy.js.erb +0 -1
- data/app/views/spree/admin/return_authorization_reasons/destroy.js.erb +0 -1
- data/app/views/spree/admin/search/products.rabl +0 -9
- data/app/views/spree/admin/search/users.rabl +0 -30
- data/app/views/spree/admin/stock_movements/edit.html.erb +0 -17
@@ -13,7 +13,7 @@
|
|
13
13
|
*/
|
14
14
|
|
15
15
|
/*jslint browser: true, onevar: true, undef: true, bitwise: true, strict: true */
|
16
|
-
/*global window : false, clearInterval: false, clearTimeout: false, document: false, setInterval: false, setTimeout: false, jQuery: false, navigator: false, XSLTProcessor: false, DOMParser: false, XMLSerializer: false
|
16
|
+
/*global window : false, clearInterval: false, clearTimeout: false, document: false, setInterval: false, setTimeout: false, jQuery: false, navigator: false, XSLTProcessor: false, DOMParser: false, XMLSerializer: false*/
|
17
17
|
|
18
18
|
"use strict";
|
19
19
|
|
@@ -114,7 +114,7 @@
|
|
114
114
|
if(isMethodCall) {
|
115
115
|
if(settings.substring(0, 1) == '_') { return returnValue; }
|
116
116
|
this.each(function() {
|
117
|
-
var instance = instances[$.data(this, "
|
117
|
+
var instance = instances[$.data(this, "jstree-instance-id")],
|
118
118
|
methodValue = (instance && $.isFunction(instance[settings])) ? instance[settings].apply(instance, args) : instance;
|
119
119
|
if(typeof methodValue !== "undefined" && (settings.indexOf("is_") === 0 || (methodValue !== true && methodValue !== false))) { returnValue = methodValue; return false; }
|
120
120
|
});
|
@@ -122,7 +122,7 @@
|
|
122
122
|
else {
|
123
123
|
this.each(function() {
|
124
124
|
// extend settings and allow for multiple hashes and $.data
|
125
|
-
var instance_id = $.data(this, "
|
125
|
+
var instance_id = $.data(this, "jstree-instance-id"),
|
126
126
|
a = [],
|
127
127
|
b = settings ? $.extend({}, true, settings) : {},
|
128
128
|
c = $(this),
|
@@ -137,7 +137,7 @@
|
|
137
137
|
// push a new empty object to the instances array
|
138
138
|
instance_id = parseInt(instances.push({}),10) - 1;
|
139
139
|
// store the jstree instance id to the container element
|
140
|
-
$.data(this, "
|
140
|
+
$.data(this, "jstree-instance-id", instance_id);
|
141
141
|
// clean up all plugins
|
142
142
|
b.plugins = $.isArray(b.plugins) ? b.plugins : $.jstree.defaults.plugins.slice();
|
143
143
|
b.plugins.unshift("core");
|
@@ -159,7 +159,7 @@
|
|
159
159
|
$.each(instances[instance_id]._get_settings().plugins, function (i, val) { instances[instance_id].data[val] = {}; });
|
160
160
|
$.each(instances[instance_id]._get_settings().plugins, function (i, val) { if(plugins[val]) { plugins[val].__init.apply(instances[instance_id]); } });
|
161
161
|
// initialize the instance
|
162
|
-
setTimeout(function() {
|
162
|
+
setTimeout(function() { instances[instance_id].init(); }, 0);
|
163
163
|
});
|
164
164
|
}
|
165
165
|
// return the jquery selection (or if it was a method call that returned a value - the returned value)
|
@@ -178,7 +178,7 @@
|
|
178
178
|
var o = $(needle);
|
179
179
|
if(!o.length && typeof needle === "string") { o = $("#" + needle); }
|
180
180
|
if(!o.length) { return null; }
|
181
|
-
return instances[o.closest(".jstree").data("
|
181
|
+
return instances[o.closest(".jstree").data("jstree-instance-id")] || null;
|
182
182
|
},
|
183
183
|
_instance : function (index, container, settings) {
|
184
184
|
// for plugins to store data in
|
@@ -356,8 +356,7 @@
|
|
356
356
|
this.get_container()
|
357
357
|
.delegate("li > ins", "click.jstree", $.proxy(function (event) {
|
358
358
|
var trgt = $(event.target);
|
359
|
-
|
360
|
-
this.toggle_node(trgt);
|
359
|
+
if(trgt.is("ins") && event.pageY - trgt.offset().top < this.data.core.li_height) { this.toggle_node(trgt); }
|
361
360
|
}, this))
|
362
361
|
.bind("mousedown.jstree", $.proxy(function () {
|
363
362
|
this.set_focus(); // This used to be setTimeout(set_focus,0) - why?
|
@@ -434,9 +433,9 @@
|
|
434
433
|
this.get_container()
|
435
434
|
.unbind(".jstree")
|
436
435
|
.undelegate(".jstree")
|
437
|
-
.removeData("
|
436
|
+
.removeData("jstree-instance-id")
|
438
437
|
.find("[class^='jstree']")
|
439
|
-
.
|
438
|
+
.andSelf()
|
440
439
|
.attr("class", function () { return this.className.replace(/jstree[^ ]*|$/ig,''); });
|
441
440
|
$(document)
|
442
441
|
.unbind(".jstree-" + n)
|
@@ -679,7 +678,7 @@
|
|
679
678
|
}
|
680
679
|
else {
|
681
680
|
original_obj = obj;
|
682
|
-
if(obj.is(".jstree-closed")) { obj = obj.find("li.jstree-closed").
|
681
|
+
if(obj.is(".jstree-closed")) { obj = obj.find("li.jstree-closed").andSelf(); }
|
683
682
|
else { obj = obj.find("li.jstree-closed"); }
|
684
683
|
}
|
685
684
|
var _this = this;
|
@@ -695,12 +694,12 @@
|
|
695
694
|
var _this = this;
|
696
695
|
obj = obj ? this._get_node(obj) : this.get_container();
|
697
696
|
if(!obj || obj === -1) { obj = this.get_container_ul(); }
|
698
|
-
obj.find("li.jstree-open").
|
697
|
+
obj.find("li.jstree-open").andSelf().each(function () { _this.close_node(this, !do_animation); });
|
699
698
|
this.__callback({ "obj" : obj });
|
700
699
|
},
|
701
700
|
clean_node : function (obj) {
|
702
701
|
obj = obj && obj != -1 ? $(obj) : this.get_container_ul();
|
703
|
-
obj = obj.is("li") ? obj.find("li").
|
702
|
+
obj = obj.is("li") ? obj.find("li").andSelf() : obj.find("li");
|
704
703
|
obj.removeClass("jstree-last")
|
705
704
|
.filter("li:last-child").addClass("jstree-last").end()
|
706
705
|
.filter(":has(li)")
|
@@ -753,7 +752,6 @@
|
|
753
752
|
if(m.language) { tmp.addClass(m.language); }
|
754
753
|
}
|
755
754
|
tmp.prepend("<ins class='jstree-icon'> </ins>");
|
756
|
-
if(!m.icon && js.icon) { m.icon = js.icon; }
|
757
755
|
if(m.icon) {
|
758
756
|
if(m.icon.indexOf("/") === -1) { tmp.children("ins").addClass(m.icon); }
|
759
757
|
else { tmp.children("ins").css("background","url('" + m.icon + "') center center no-repeat"); }
|
@@ -922,12 +920,10 @@
|
|
922
920
|
check_move : function () {
|
923
921
|
var obj = prepared_move, ret = true, r = obj.r === -1 ? this.get_container() : obj.r;
|
924
922
|
if(!obj || !obj.o || obj.or[0] === obj.o[0]) { return false; }
|
925
|
-
if(
|
926
|
-
|
927
|
-
|
928
|
-
|
929
|
-
});
|
930
|
-
}
|
923
|
+
if(obj.op && obj.np && obj.op[0] === obj.np[0] && obj.cp - 1 === obj.o.index()) { return false; }
|
924
|
+
obj.o.each(function () {
|
925
|
+
if(r.parentsUntil(".jstree", "li").andSelf().index(this) !== -1) { ret = false; return false; }
|
926
|
+
});
|
931
927
|
return ret;
|
932
928
|
},
|
933
929
|
move_node : function (obj, ref, position, is_copy, is_prepared, skip_check) {
|
@@ -945,7 +941,7 @@
|
|
945
941
|
var o = false;
|
946
942
|
if(is_copy) {
|
947
943
|
o = obj.o.clone(true);
|
948
|
-
o.find("*[id]").
|
944
|
+
o.find("*[id]").andSelf().each(function () {
|
949
945
|
if(this.id) { this.id = "copy_" + this.id; }
|
950
946
|
});
|
951
947
|
}
|
@@ -1142,7 +1138,7 @@
|
|
1142
1138
|
switch(!0) {
|
1143
1139
|
case (is_range):
|
1144
1140
|
this.data.ui.last_selected.addClass("jstree-last-selected");
|
1145
|
-
obj = obj[ obj.index() < this.data.ui.last_selected.index() ? "nextUntil" : "prevUntil" ](".jstree-last-selected").
|
1141
|
+
obj = obj[ obj.index() < this.data.ui.last_selected.index() ? "nextUntil" : "prevUntil" ](".jstree-last-selected").andSelf();
|
1146
1142
|
if(s.select_limit == -1 || obj.length < s.select_limit) {
|
1147
1143
|
this.data.ui.last_selected.removeClass("jstree-last-selected");
|
1148
1144
|
this.data.ui.selected.each(function () {
|
@@ -1246,7 +1242,7 @@
|
|
1246
1242
|
.bind("move_node.jstree", $.proxy(function (e, data) {
|
1247
1243
|
if(this._get_settings().crrm.move.open_onmove) {
|
1248
1244
|
var t = this;
|
1249
|
-
data.rslt.np.parentsUntil(".jstree").
|
1245
|
+
data.rslt.np.parentsUntil(".jstree").andSelf().filter(".jstree-closed").each(function () {
|
1250
1246
|
t.open_node(this, false, true);
|
1251
1247
|
});
|
1252
1248
|
}
|
@@ -1662,7 +1658,7 @@
|
|
1662
1658
|
obj = this._get_node(obj);
|
1663
1659
|
var s = this._get_settings().json_data;
|
1664
1660
|
if(obj && obj !== -1 && s.progressive_unload && ($.isFunction(s.data) || !!s.ajax)) {
|
1665
|
-
obj.removeData("
|
1661
|
+
obj.removeData("jstree-children");
|
1666
1662
|
}
|
1667
1663
|
return this.__call_old();
|
1668
1664
|
},
|
@@ -1672,11 +1668,11 @@
|
|
1672
1668
|
success_func = function () {};
|
1673
1669
|
obj = this._get_node(obj);
|
1674
1670
|
|
1675
|
-
if(obj && obj !== -1 && (s.progressive_render || s.progressive_unload) && !obj.is(".jstree-open, .jstree-leaf") && obj.children("ul").children("li").length === 0 && obj.data("
|
1676
|
-
d = this._parse_json(obj.data("
|
1671
|
+
if(obj && obj !== -1 && (s.progressive_render || s.progressive_unload) && !obj.is(".jstree-open, .jstree-leaf") && obj.children("ul").children("li").length === 0 && obj.data("jstree-children")) {
|
1672
|
+
d = this._parse_json(obj.data("jstree-children"), obj);
|
1677
1673
|
if(d) {
|
1678
1674
|
obj.append(d);
|
1679
|
-
if(!s.progressive_unload) { obj.removeData("
|
1675
|
+
if(!s.progressive_unload) { obj.removeData("jstree-children"); }
|
1680
1676
|
}
|
1681
1677
|
this.clean_node(obj);
|
1682
1678
|
if(s_call) { s_call.call(this); }
|
@@ -1684,8 +1680,8 @@
|
|
1684
1680
|
}
|
1685
1681
|
|
1686
1682
|
if(obj && obj !== -1) {
|
1687
|
-
if(obj.data("
|
1688
|
-
else { obj.data("
|
1683
|
+
if(obj.data("jstree-is-loading")) { return; }
|
1684
|
+
else { obj.data("jstree-is-loading",true); }
|
1689
1685
|
}
|
1690
1686
|
switch(!0) {
|
1691
1687
|
case (!s.data && !s.ajax): throw "Neither data nor ajax settings supplied.";
|
@@ -1699,14 +1695,14 @@
|
|
1699
1695
|
}
|
1700
1696
|
else {
|
1701
1697
|
obj.children("a.jstree-loading").removeClass("jstree-loading");
|
1702
|
-
obj.removeData("
|
1698
|
+
obj.removeData("jstree-is-loading");
|
1703
1699
|
if(s.correct_state) { this.correct_state(obj); }
|
1704
1700
|
}
|
1705
1701
|
if(e_call) { e_call.call(this); }
|
1706
1702
|
}
|
1707
1703
|
else {
|
1708
1704
|
if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); }
|
1709
|
-
else { obj.append(d).children("a.jstree-loading").removeClass("jstree-loading"); obj.removeData("
|
1705
|
+
else { obj.append(d).children("a.jstree-loading").removeClass("jstree-loading"); obj.removeData("jstree-is-loading"); }
|
1710
1706
|
this.clean_node(obj);
|
1711
1707
|
if(s_call) { s_call.call(this); }
|
1712
1708
|
}
|
@@ -1731,7 +1727,7 @@
|
|
1731
1727
|
if(ef) { ef.call(this, x, t, e); }
|
1732
1728
|
if(obj != -1 && obj.length) {
|
1733
1729
|
obj.children("a.jstree-loading").removeClass("jstree-loading");
|
1734
|
-
obj.removeData("
|
1730
|
+
obj.removeData("jstree-is-loading");
|
1735
1731
|
if(t === "success" && s.correct_state) { this.correct_state(obj); }
|
1736
1732
|
}
|
1737
1733
|
else {
|
@@ -1748,7 +1744,7 @@
|
|
1748
1744
|
d = this._parse_json(d, obj);
|
1749
1745
|
if(d) {
|
1750
1746
|
if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); }
|
1751
|
-
else { obj.append(d).children("a.jstree-loading").removeClass("jstree-loading"); obj.removeData("
|
1747
|
+
else { obj.append(d).children("a.jstree-loading").removeClass("jstree-loading"); obj.removeData("jstree-is-loading"); }
|
1752
1748
|
this.clean_node(obj);
|
1753
1749
|
if(s_call) { s_call.call(this); }
|
1754
1750
|
}
|
@@ -1761,7 +1757,7 @@
|
|
1761
1757
|
}
|
1762
1758
|
else {
|
1763
1759
|
obj.children("a.jstree-loading").removeClass("jstree-loading");
|
1764
|
-
obj.removeData("
|
1760
|
+
obj.removeData("jstree-is-loading");
|
1765
1761
|
if(s.correct_state) {
|
1766
1762
|
this.correct_state(obj);
|
1767
1763
|
if(s_call) { s_call.call(this); }
|
@@ -1788,16 +1784,14 @@
|
|
1788
1784
|
|
1789
1785
|
if(!js) { return d; }
|
1790
1786
|
if(s.progressive_unload && obj && obj !== -1) {
|
1791
|
-
obj.data("
|
1787
|
+
obj.data("jstree-children", d);
|
1792
1788
|
}
|
1793
1789
|
if($.isArray(js)) {
|
1794
1790
|
d = $('<ul>');
|
1795
1791
|
if(!js.length) { return false; }
|
1796
1792
|
for(i = 0, j = js.length; i < j; i++) {
|
1797
1793
|
tmp = this._parse_json(js[i], obj, true);
|
1798
|
-
if(tmp.length) {
|
1799
|
-
d = d.append(tmp);
|
1800
|
-
}
|
1794
|
+
if(tmp.length) { d = d.append(tmp); }
|
1801
1795
|
}
|
1802
1796
|
d = d.children();
|
1803
1797
|
}
|
@@ -1830,10 +1824,10 @@
|
|
1830
1824
|
d.prepend("<ins class='jstree-icon'> </ins>");
|
1831
1825
|
if(js.children) {
|
1832
1826
|
if(s.progressive_render && js.state !== "open") {
|
1833
|
-
d.addClass("jstree-closed").data("
|
1827
|
+
d.addClass("jstree-closed").data("jstree-children", js.children);
|
1834
1828
|
}
|
1835
1829
|
else {
|
1836
|
-
if(s.progressive_unload) { d.data("
|
1830
|
+
if(s.progressive_unload) { d.data("jstree-children", js.children); }
|
1837
1831
|
if($.isArray(js.children) && js.children.length) {
|
1838
1832
|
tmp = this._parse_json(js.children, obj, true);
|
1839
1833
|
if(tmp.length) {
|
@@ -1934,7 +1928,6 @@
|
|
1934
1928
|
* This is useful for maintaining the same structure in many languages (hence the name of the plugin)
|
1935
1929
|
*/
|
1936
1930
|
(function ($) {
|
1937
|
-
var sh = false;
|
1938
1931
|
$.jstree.plugin("languages", {
|
1939
1932
|
__init : function () { this._load_css(); },
|
1940
1933
|
defaults : [],
|
@@ -1949,9 +1942,9 @@
|
|
1949
1942
|
else { return false; }
|
1950
1943
|
}
|
1951
1944
|
if(i == this.data.languages.current_language) { return true; }
|
1952
|
-
st = $.vakata.css.get_css(selector + "." + this.data.languages.current_language, false,
|
1945
|
+
st = $.vakata.css.get_css(selector + "." + this.data.languages.current_language, false, this.data.languages.language_css);
|
1953
1946
|
if(st !== false) { st.style.display = "none"; }
|
1954
|
-
st = $.vakata.css.get_css(selector + "." + i, false,
|
1947
|
+
st = $.vakata.css.get_css(selector + "." + i, false, this.data.languages.language_css);
|
1955
1948
|
if(st !== false) { st.style.display = ""; }
|
1956
1949
|
this.data.languages.current_language = i;
|
1957
1950
|
this.__callback(i);
|
@@ -2025,7 +2018,7 @@
|
|
2025
2018
|
if(langs[ln] != this.data.languages.current_language) { str += " display:none; "; }
|
2026
2019
|
str += " } ";
|
2027
2020
|
}
|
2028
|
-
|
2021
|
+
this.data.languages.language_css = $.vakata.css.add_sheet({ 'str' : str, 'title' : "jstree-languages" });
|
2029
2022
|
}
|
2030
2023
|
},
|
2031
2024
|
create_node : function (obj, position, js, callback) {
|
@@ -2693,14 +2686,14 @@
|
|
2693
2686
|
$(function() {
|
2694
2687
|
var css_string = '' +
|
2695
2688
|
'#vakata-dragged ins { display:block; text-decoration:none; width:16px; height:16px; margin:0 0 0 0; padding:0; position:absolute; top:4px; left:4px; ' +
|
2696
|
-
'
|
2689
|
+
' border-radius:4px; -webkit-border-radius:4px; ' +
|
2697
2690
|
'} ' +
|
2698
2691
|
'#vakata-dragged .jstree-ok { background:green; } ' +
|
2699
2692
|
'#vakata-dragged .jstree-invalid { background:red; } ' +
|
2700
2693
|
'#jstree-marker { padding:0; margin:0; font-size:12px; overflow:hidden; height:12px; width:8px; position:absolute; top:-30px; z-index:10001; background-repeat:no-repeat; display:none; background-color:transparent; text-shadow:1px 1px 1px white; color:black; line-height:10px; } ' +
|
2701
2694
|
'#jstree-marker-line { padding:0; margin:0; line-height:0%; font-size:1px; overflow:hidden; height:1px; width:100px; position:absolute; top:-30px; z-index:10000; background-repeat:no-repeat; display:none; background-color:#456c43; ' +
|
2702
2695
|
' cursor:pointer; border:1px solid #eeeeee; border-left:0; -moz-box-shadow: 0px 0px 2px #666; -webkit-box-shadow: 0px 0px 2px #666; box-shadow: 0px 0px 2px #666; ' +
|
2703
|
-
'
|
2696
|
+
' border-radius:1px; -webkit-border-radius:1px; ' +
|
2704
2697
|
'}' +
|
2705
2698
|
'';
|
2706
2699
|
$.vakata.css.add_sheet({ str : css_string, title : "jstree" });
|
@@ -2807,7 +2800,7 @@
|
|
2807
2800
|
obj.each(function () {
|
2808
2801
|
t = $(this);
|
2809
2802
|
c = t.is("li") && (t.hasClass("jstree-checked") || (rc && t.children(":checked").length)) ? "jstree-checked" : "jstree-unchecked";
|
2810
|
-
t.find("li").
|
2803
|
+
t.find("li").andSelf().each(function () {
|
2811
2804
|
var $t = $(this), nm;
|
2812
2805
|
$t.children("a" + (_this.data.languages ? "" : ":eq(0)") ).not(":has(.jstree-checkbox)").prepend("<ins class='jstree-checkbox'> </ins>").parent().not(".jstree-checked, .jstree-unchecked").addClass( ts ? "jstree-unchecked" : c );
|
2813
2806
|
if(rc) {
|
@@ -2818,20 +2811,19 @@
|
|
2818
2811
|
else {
|
2819
2812
|
$t.children(":checkbox").addClass("jstree-real-checkbox");
|
2820
2813
|
}
|
2821
|
-
|
2822
|
-
|
2823
|
-
if(c === "jstree-checked" || $t.hasClass("jstree-checked") || $t.children(':checked').length) {
|
2824
|
-
$t.find("li").addBack().addClass("jstree-checked").children(":checkbox").prop("checked", true);
|
2814
|
+
if(c === "jstree-checked") {
|
2815
|
+
$t.children(":checkbox").attr("checked","checked");
|
2825
2816
|
}
|
2826
2817
|
}
|
2827
|
-
|
2828
|
-
|
2829
|
-
$t.addClass("jstree-checked").children(":checkbox").prop("checked", true);
|
2830
|
-
}
|
2818
|
+
if(c === "jstree-checked" && !ts) {
|
2819
|
+
$t.find("li").addClass("jstree-checked");
|
2831
2820
|
}
|
2832
2821
|
});
|
2833
2822
|
});
|
2834
2823
|
if(!ts) {
|
2824
|
+
if(obj.length === 1 && obj.is("li")) { this._repair_state(obj); }
|
2825
|
+
if(obj.is("li")) { obj.each(function () { _this._repair_state(this); }); }
|
2826
|
+
else { obj.find("> ul > li").each(function () { _this._repair_state(this); }); }
|
2835
2827
|
obj.find(".jstree-checked").parent().parent().each(function () { _this._repair_state(this); });
|
2836
2828
|
}
|
2837
2829
|
},
|
@@ -2843,25 +2835,25 @@
|
|
2843
2835
|
if(this._get_settings().checkbox.two_state) {
|
2844
2836
|
if(state) {
|
2845
2837
|
obj.removeClass("jstree-checked").addClass("jstree-unchecked");
|
2846
|
-
if(rc) { obj.children(":checkbox").
|
2838
|
+
if(rc) { obj.children(":checkbox").removeAttr("checked"); }
|
2847
2839
|
}
|
2848
2840
|
else {
|
2849
2841
|
obj.removeClass("jstree-unchecked").addClass("jstree-checked");
|
2850
|
-
if(rc) { obj.children(":checkbox").
|
2842
|
+
if(rc) { obj.children(":checkbox").attr("checked","checked"); }
|
2851
2843
|
}
|
2852
2844
|
}
|
2853
2845
|
else {
|
2854
2846
|
if(state) {
|
2855
|
-
coll = obj.find("li").
|
2847
|
+
coll = obj.find("li").andSelf();
|
2856
2848
|
if(!coll.filter(".jstree-checked, .jstree-undetermined").length) { return false; }
|
2857
2849
|
coll.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");
|
2858
|
-
if(rc) { coll.children(":checkbox").
|
2850
|
+
if(rc) { coll.children(":checkbox").removeAttr("checked"); }
|
2859
2851
|
}
|
2860
2852
|
else {
|
2861
|
-
coll = obj.find("li").
|
2853
|
+
coll = obj.find("li").andSelf();
|
2862
2854
|
if(!coll.filter(".jstree-unchecked, .jstree-undetermined").length) { return false; }
|
2863
2855
|
coll.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked");
|
2864
|
-
if(rc) { coll.children(":checkbox").
|
2856
|
+
if(rc) { coll.children(":checkbox").attr("checked","checked"); }
|
2865
2857
|
if(this.data.ui) { this.data.ui.last_selected = obj; }
|
2866
2858
|
this.data.checkbox.last_selected = obj;
|
2867
2859
|
}
|
@@ -2869,24 +2861,24 @@
|
|
2869
2861
|
var $this = $(this);
|
2870
2862
|
if(state) {
|
2871
2863
|
if($this.children("ul").children("li.jstree-checked, li.jstree-undetermined").length) {
|
2872
|
-
$this.parentsUntil(".jstree", "li").
|
2873
|
-
if(rc) { $this.parentsUntil(".jstree", "li").
|
2864
|
+
$this.parentsUntil(".jstree", "li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
|
2865
|
+
if(rc) { $this.parentsUntil(".jstree", "li").andSelf().children(":checkbox").removeAttr("checked"); }
|
2874
2866
|
return false;
|
2875
2867
|
}
|
2876
2868
|
else {
|
2877
2869
|
$this.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");
|
2878
|
-
if(rc) { $this.children(":checkbox").
|
2870
|
+
if(rc) { $this.children(":checkbox").removeAttr("checked"); }
|
2879
2871
|
}
|
2880
2872
|
}
|
2881
2873
|
else {
|
2882
2874
|
if($this.children("ul").children("li.jstree-unchecked, li.jstree-undetermined").length) {
|
2883
|
-
$this.parentsUntil(".jstree", "li").
|
2884
|
-
if(rc) { $this.parentsUntil(".jstree", "li").
|
2875
|
+
$this.parentsUntil(".jstree", "li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
|
2876
|
+
if(rc) { $this.parentsUntil(".jstree", "li").andSelf().children(":checkbox").removeAttr("checked"); }
|
2885
2877
|
return false;
|
2886
2878
|
}
|
2887
2879
|
else {
|
2888
2880
|
$this.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked");
|
2889
|
-
if(rc) { $this.children(":checkbox").
|
2881
|
+
if(rc) { $this.children(":checkbox").attr("checked","checked"); }
|
2890
2882
|
}
|
2891
2883
|
}
|
2892
2884
|
});
|
@@ -2944,10 +2936,6 @@
|
|
2944
2936
|
_repair_state : function (obj) {
|
2945
2937
|
obj = this._get_node(obj);
|
2946
2938
|
if(!obj.length) { return; }
|
2947
|
-
if(this._get_settings().checkbox.two_state) {
|
2948
|
-
obj.find('li').addBack().not('.jstree-checked').removeClass('jstree-undetermined').addClass('jstree-unchecked').children(':checkbox').prop('checked', true);
|
2949
|
-
return;
|
2950
|
-
}
|
2951
2939
|
var rc = this._get_settings().checkbox.real_checkboxes,
|
2952
2940
|
a = obj.find("> ul > .jstree-checked").length,
|
2953
2941
|
b = obj.find("> ul > .jstree-undetermined").length,
|
@@ -2956,8 +2944,8 @@
|
|
2956
2944
|
else if(a === 0 && b === 0) { this.change_state(obj, true); }
|
2957
2945
|
else if(a === c) { this.change_state(obj, false); }
|
2958
2946
|
else {
|
2959
|
-
obj.parentsUntil(".jstree","li").
|
2960
|
-
if(rc) { obj.parentsUntil(".jstree", "li").
|
2947
|
+
obj.parentsUntil(".jstree","li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
|
2948
|
+
if(rc) { obj.parentsUntil(".jstree", "li").andSelf().children(":checkbox").removeAttr("checked"); }
|
2961
2949
|
}
|
2962
2950
|
},
|
2963
2951
|
reselect : function () {
|
@@ -2995,37 +2983,49 @@
|
|
2995
2983
|
*/
|
2996
2984
|
(function ($) {
|
2997
2985
|
$.vakata.xslt = function (xml, xsl, callback) {
|
2998
|
-
var
|
2999
|
-
// IE9
|
3000
|
-
if(
|
3001
|
-
|
3002
|
-
|
3003
|
-
|
3004
|
-
|
3005
|
-
|
3006
|
-
|
3007
|
-
|
3008
|
-
|
3009
|
-
|
3010
|
-
|
3011
|
-
|
3012
|
-
|
3013
|
-
catch (e) { }
|
2986
|
+
var rs = "", xm, xs, processor, support;
|
2987
|
+
// TODO: IE9 no XSLTProcessor, no document.recalc
|
2988
|
+
if(document.recalc) {
|
2989
|
+
xm = document.createElement('xml');
|
2990
|
+
xs = document.createElement('xml');
|
2991
|
+
xm.innerHTML = xml;
|
2992
|
+
xs.innerHTML = xsl;
|
2993
|
+
$("body").append(xm).append(xs);
|
2994
|
+
setTimeout( (function (xm, xs, callback) {
|
2995
|
+
return function () {
|
2996
|
+
callback.call(null, xm.transformNode(xs.XMLDocument));
|
2997
|
+
setTimeout( (function (xm, xs) { return function () { $(xm).remove(); $(xs).remove(); }; })(xm, xs), 200);
|
2998
|
+
};
|
2999
|
+
})(xm, xs, callback), 100);
|
3000
|
+
return true;
|
3014
3001
|
}
|
3015
|
-
|
3016
|
-
|
3017
|
-
|
3018
|
-
|
3019
|
-
|
3020
|
-
|
3021
|
-
r = p.transformToFragment(xml, document);
|
3022
|
-
r = $('<div />').append(r).html();
|
3002
|
+
if(typeof window.DOMParser !== "undefined" && typeof window.XMLHttpRequest !== "undefined" && typeof window.XSLTProcessor === "undefined") {
|
3003
|
+
xml = new DOMParser().parseFromString(xml, "text/xml");
|
3004
|
+
xsl = new DOMParser().parseFromString(xsl, "text/xml");
|
3005
|
+
// alert(xml.transformNode());
|
3006
|
+
// callback.call(null, new XMLSerializer().serializeToString(rs));
|
3007
|
+
|
3023
3008
|
}
|
3024
|
-
|
3025
|
-
|
3026
|
-
|
3009
|
+
if(typeof window.DOMParser !== "undefined" && typeof window.XMLHttpRequest !== "undefined" && typeof window.XSLTProcessor !== "undefined") {
|
3010
|
+
processor = new XSLTProcessor();
|
3011
|
+
support = $.isFunction(processor.transformDocument) ? (typeof window.XMLSerializer !== "undefined") : true;
|
3012
|
+
if(!support) { return false; }
|
3013
|
+
xml = new DOMParser().parseFromString(xml, "text/xml");
|
3014
|
+
xsl = new DOMParser().parseFromString(xsl, "text/xml");
|
3015
|
+
if($.isFunction(processor.transformDocument)) {
|
3016
|
+
rs = document.implementation.createDocument("", "", null);
|
3017
|
+
processor.transformDocument(xml, xsl, rs, null);
|
3018
|
+
callback.call(null, new XMLSerializer().serializeToString(rs));
|
3019
|
+
return true;
|
3020
|
+
}
|
3021
|
+
else {
|
3022
|
+
processor.importStylesheet(xsl);
|
3023
|
+
rs = processor.transformToFragment(xml, document);
|
3024
|
+
callback.call(null, $("<div />").append(rs).html());
|
3025
|
+
return true;
|
3026
|
+
}
|
3027
3027
|
}
|
3028
|
-
|
3028
|
+
return false;
|
3029
3029
|
};
|
3030
3030
|
var xsl = {
|
3031
3031
|
'nest' : '<' + '?xml version="1.0" encoding="utf-8" ?>' +
|
@@ -3194,8 +3194,8 @@
|
|
3194
3194
|
|
3195
3195
|
obj = this._get_node(obj);
|
3196
3196
|
if(obj && obj !== -1) {
|
3197
|
-
if(obj.data("
|
3198
|
-
else { obj.data("
|
3197
|
+
if(obj.data("jstree-is-loading")) { return; }
|
3198
|
+
else { obj.data("jstree-is-loading",true); }
|
3199
3199
|
}
|
3200
3200
|
switch(!0) {
|
3201
3201
|
case (!s.data && !s.ajax): throw "Neither data nor ajax settings supplied.";
|
@@ -3207,14 +3207,14 @@
|
|
3207
3207
|
if(d.length > 10) {
|
3208
3208
|
d = $(d);
|
3209
3209
|
if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); }
|
3210
|
-
else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d); obj.removeData("
|
3210
|
+
else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d); obj.removeData("jstree-is-loading"); }
|
3211
3211
|
if(s.clean_node) { this.clean_node(obj); }
|
3212
3212
|
if(s_call) { s_call.call(this); }
|
3213
3213
|
}
|
3214
3214
|
else {
|
3215
3215
|
if(obj && obj !== -1) {
|
3216
3216
|
obj.children("a.jstree-loading").removeClass("jstree-loading");
|
3217
|
-
obj.removeData("
|
3217
|
+
obj.removeData("jstree-is-loading");
|
3218
3218
|
if(s.correct_state) {
|
3219
3219
|
this.correct_state(obj);
|
3220
3220
|
if(s_call) { s_call.call(this); }
|
@@ -3258,7 +3258,7 @@
|
|
3258
3258
|
if(ef) { ef.call(this, x, t, e); }
|
3259
3259
|
if(obj !== -1 && obj.length) {
|
3260
3260
|
obj.children("a.jstree-loading").removeClass("jstree-loading");
|
3261
|
-
obj.removeData("
|
3261
|
+
obj.removeData("jstree-is-loading");
|
3262
3262
|
if(t === "success" && s.correct_state) { this.correct_state(obj); }
|
3263
3263
|
}
|
3264
3264
|
else {
|
@@ -3279,14 +3279,14 @@
|
|
3279
3279
|
if(d.length > 10) {
|
3280
3280
|
d = $(d);
|
3281
3281
|
if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); }
|
3282
|
-
else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d); obj.removeData("
|
3282
|
+
else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d); obj.removeData("jstree-is-loading"); }
|
3283
3283
|
if(s.clean_node) { this.clean_node(obj); }
|
3284
3284
|
if(s_call) { s_call.call(this); }
|
3285
3285
|
}
|
3286
3286
|
else {
|
3287
3287
|
if(obj && obj !== -1) {
|
3288
3288
|
obj.children("a.jstree-loading").removeClass("jstree-loading");
|
3289
|
-
obj.removeData("
|
3289
|
+
obj.removeData("jstree-is-loading");
|
3290
3290
|
if(s.correct_state) {
|
3291
3291
|
this.correct_state(obj);
|
3292
3292
|
if(s_call) { s_call.call(this); }
|
@@ -3401,26 +3401,12 @@
|
|
3401
3401
|
* DOES NOT WORK WITH JSON PROGRESSIVE RENDER
|
3402
3402
|
*/
|
3403
3403
|
(function ($) {
|
3404
|
-
|
3405
|
-
|
3406
|
-
|
3407
|
-
|
3408
|
-
|
3409
|
-
|
3410
|
-
$.expr[':'].jstree_title_contains = $.expr.createPseudo(function(search) {
|
3411
|
-
return function(a) {
|
3412
|
-
return (a.getAttribute("title") || "").toLowerCase().indexOf(search.toLowerCase())>=0;
|
3413
|
-
};
|
3414
|
-
});
|
3415
|
-
}
|
3416
|
-
else {
|
3417
|
-
$.expr[':'].jstree_contains = function(a,i,m){
|
3418
|
-
return (a.textContent || a.innerText || "").toLowerCase().indexOf(m[3].toLowerCase())>=0;
|
3419
|
-
};
|
3420
|
-
$.expr[':'].jstree_title_contains = function(a,i,m) {
|
3421
|
-
return (a.getAttribute("title") || "").toLowerCase().indexOf(m[3].toLowerCase())>=0;
|
3422
|
-
};
|
3423
|
-
}
|
3404
|
+
$.expr[':'].jstree_contains = function(a,i,m){
|
3405
|
+
return (a.textContent || a.innerText || "").toLowerCase().indexOf(m[3].toLowerCase())>=0;
|
3406
|
+
};
|
3407
|
+
$.expr[':'].jstree_title_contains = function(a,i,m) {
|
3408
|
+
return (a.getAttribute("title") || "").toLowerCase().indexOf(m[3].toLowerCase())>=0;
|
3409
|
+
};
|
3424
3410
|
$.jstree.plugin("search", {
|
3425
3411
|
__init : function () {
|
3426
3412
|
this.data.search.str = "";
|
@@ -3429,7 +3415,7 @@
|
|
3429
3415
|
this.get_container()
|
3430
3416
|
.bind("search.jstree", function (e, data) {
|
3431
3417
|
$(this).children("ul").find("li").hide().removeClass("jstree-last");
|
3432
|
-
data.rslt.nodes.parentsUntil(".jstree").
|
3418
|
+
data.rslt.nodes.parentsUntil(".jstree").andSelf().show()
|
3433
3419
|
.filter("ul").each(function () { $(this).children("li:visible").eq(-1).addClass("jstree-last"); });
|
3434
3420
|
})
|
3435
3421
|
.bind("clear_search.jstree", function () {
|
@@ -3700,11 +3686,6 @@
|
|
3700
3686
|
this.show_contextmenu(e.currentTarget, e.pageX, e.pageY);
|
3701
3687
|
}
|
3702
3688
|
}, this))
|
3703
|
-
.delegate("a", "click.jstree", $.proxy(function (e) {
|
3704
|
-
if(this.data.contextmenu) {
|
3705
|
-
$.vakata.context.hide();
|
3706
|
-
}
|
3707
|
-
}, this))
|
3708
3689
|
.bind("destroy.jstree", $.proxy(function () {
|
3709
3690
|
// TODO: move this to descruct method
|
3710
3691
|
if(this.data.contextmenu) {
|
@@ -4015,7 +3996,7 @@
|
|
4015
3996
|
// this used to use html() and clean the whitespace, but this way any attached data was lost
|
4016
3997
|
this.data.html_data.original_container_html = this.get_container().find(" > ul > li").clone(true);
|
4017
3998
|
// remove white space from LI node - otherwise nodes appear a bit to the right
|
4018
|
-
this.data.html_data.original_container_html.find("li").
|
3999
|
+
this.data.html_data.original_container_html.find("li").andSelf().contents().filter(function() { return this.nodeType == 3; }).remove();
|
4019
4000
|
},
|
4020
4001
|
defaults : {
|
4021
4002
|
data : false,
|
@@ -4035,8 +4016,8 @@
|
|
4035
4016
|
success_func = function () {};
|
4036
4017
|
obj = this._get_node(obj);
|
4037
4018
|
if(obj && obj !== -1) {
|
4038
|
-
if(obj.data("
|
4039
|
-
else { obj.data("
|
4019
|
+
if(obj.data("jstree-is-loading")) { return; }
|
4020
|
+
else { obj.data("jstree-is-loading",true); }
|
4040
4021
|
}
|
4041
4022
|
switch(!0) {
|
4042
4023
|
case ($.isFunction(s.data)):
|
@@ -4045,14 +4026,14 @@
|
|
4045
4026
|
d = $(d);
|
4046
4027
|
if(!d.is("ul")) { d = $("<ul />").append(d); }
|
4047
4028
|
if(obj == -1 || !obj) { this.get_container().children("ul").empty().append(d.children()).find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'> </ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); }
|
4048
|
-
else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d).children("ul").find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'> </ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); obj.removeData("
|
4029
|
+
else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d).children("ul").find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'> </ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); obj.removeData("jstree-is-loading"); }
|
4049
4030
|
this.clean_node(obj);
|
4050
4031
|
if(s_call) { s_call.call(this); }
|
4051
4032
|
}
|
4052
4033
|
else {
|
4053
4034
|
if(obj && obj !== -1) {
|
4054
4035
|
obj.children("a.jstree-loading").removeClass("jstree-loading");
|
4055
|
-
obj.removeData("
|
4036
|
+
obj.removeData("jstree-is-loading");
|
4056
4037
|
if(s.correct_state) {
|
4057
4038
|
this.correct_state(obj);
|
4058
4039
|
if(s_call) { s_call.call(this); }
|
@@ -4097,7 +4078,7 @@
|
|
4097
4078
|
if(ef) { ef.call(this, x, t, e); }
|
4098
4079
|
if(obj != -1 && obj.length) {
|
4099
4080
|
obj.children("a.jstree-loading").removeClass("jstree-loading");
|
4100
|
-
obj.removeData("
|
4081
|
+
obj.removeData("jstree-is-loading");
|
4101
4082
|
if(t === "success" && s.correct_state) { this.correct_state(obj); }
|
4102
4083
|
}
|
4103
4084
|
else {
|
@@ -4115,14 +4096,14 @@
|
|
4115
4096
|
d = $(d);
|
4116
4097
|
if(!d.is("ul")) { d = $("<ul />").append(d); }
|
4117
4098
|
if(obj == -1 || !obj) { this.get_container().children("ul").empty().append(d.children()).find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'> </ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); }
|
4118
|
-
else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d).children("ul").find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'> </ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); obj.removeData("
|
4099
|
+
else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d).children("ul").find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'> </ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); obj.removeData("jstree-is-loading"); }
|
4119
4100
|
this.clean_node(obj);
|
4120
4101
|
if(s_call) { s_call.call(this); }
|
4121
4102
|
}
|
4122
4103
|
else {
|
4123
4104
|
if(obj && obj !== -1) {
|
4124
4105
|
obj.children("a.jstree-loading").removeClass("jstree-loading");
|
4125
|
-
obj.removeData("
|
4106
|
+
obj.removeData("jstree-is-loading");
|
4126
4107
|
if(s.correct_state) {
|
4127
4108
|
this.correct_state(obj);
|
4128
4109
|
if(s_call) { s_call.call(this); }
|
@@ -4233,8 +4214,7 @@
|
|
4233
4214
|
_fn : {
|
4234
4215
|
_themeroller : function (obj) {
|
4235
4216
|
var s = this._get_settings().themeroller;
|
4236
|
-
obj =
|
4237
|
-
obj = (!obj || obj == -1) ? this.get_container_ul() : obj.parent();
|
4217
|
+
obj = !obj || obj == -1 ? this.get_container_ul() : this._get_node(obj).parent();
|
4238
4218
|
obj
|
4239
4219
|
.find("li.jstree-closed")
|
4240
4220
|
.children("ins.jstree-icon").removeClass(s.opened).addClass("ui-icon " + s.closed).end()
|
@@ -4347,19 +4327,15 @@
|
|
4347
4327
|
},
|
4348
4328
|
_fn : {
|
4349
4329
|
_check_unique : function (nms, p, func) {
|
4350
|
-
var cnms = []
|
4330
|
+
var cnms = [];
|
4351
4331
|
p.children("a").each(function () { cnms.push($(this).text().replace(/^\s+/g,"")); });
|
4352
4332
|
if(!cnms.length || !nms.length) { return true; }
|
4353
|
-
|
4354
|
-
|
4355
|
-
ok = false;
|
4356
|
-
return false;
|
4357
|
-
}
|
4358
|
-
});
|
4359
|
-
if(!ok) {
|
4333
|
+
cnms = cnms.sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,"").split(",");
|
4334
|
+
if((cnms.length + nms.length) != cnms.concat(nms).sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,"").split(",").length) {
|
4360
4335
|
this._get_settings().unique.error_callback.call(null, nms, p, func);
|
4336
|
+
return false;
|
4361
4337
|
}
|
4362
|
-
return
|
4338
|
+
return true;
|
4363
4339
|
},
|
4364
4340
|
check_move : function () {
|
4365
4341
|
if(!this.__call_old()) { return false; }
|
@@ -4446,7 +4422,7 @@
|
|
4446
4422
|
obj = !obj || obj == -1 ? this.get_container().find("> ul > li") : this._get_node(obj);
|
4447
4423
|
if(obj === false) { return; } // added for removing root nodes
|
4448
4424
|
obj.each(function () {
|
4449
|
-
$(this).find("li").
|
4425
|
+
$(this).find("li").andSelf().each(function () {
|
4450
4426
|
var $t = $(this);
|
4451
4427
|
if($t.children(".jstree-wholerow-span").length) { return true; }
|
4452
4428
|
$t.prepend("<span class='jstree-wholerow-span' style='width:" + ($t.parentsUntil(".jstree","li").length * 18) + "px;'> </span>");
|